|
@@ -59,15 +59,23 @@
|
|
|
>发布商品</el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
- <el-dropdown>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" plain size="mini" @click="handleExportAll"
|
|
|
+ >导出全部</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-dropdown :hide-on-click="false" trigger="click">
|
|
|
<el-button type="primary" plain size="mini">
|
|
|
更多批量操作<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item style="color: red">批量删除</el-dropdown-item>
|
|
|
- <el-dropdown-item>批量加入活动</el-dropdown-item>
|
|
|
- <el-dropdown-item>批量导出</el-dropdown-item>
|
|
|
- <el-dropdown-item>批量下架</el-dropdown-item>
|
|
|
+ <el-dropdown-item style="color: red" @click.native="BatchRemove"
|
|
|
+ >批量删除</el-dropdown-item
|
|
|
+ >
|
|
|
+ <el-dropdown-item @click.native="handleEvents">批量加入活动</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="handleExport">批量导出</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="handleDelist">批量下架</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
@@ -234,125 +242,43 @@
|
|
|
|
|
|
<lookProduct ref="lookProductRefs"></lookProduct>
|
|
|
<el-dialog
|
|
|
- title="编辑"
|
|
|
+ title="活动列表"
|
|
|
:visible.sync="dialogVisible"
|
|
|
- width="60%"
|
|
|
:before-close="dialogVisible == false"
|
|
|
>
|
|
|
- <el-table :data="dataTable.skuList" style="width: 100%; margin-top: 20px">
|
|
|
- <el-table-column prop="name" label="规格名称" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.skuSpecsList[0].specsName"
|
|
|
- placeholder="请输入规格名称"
|
|
|
- clearable
|
|
|
- @input="passValue"
|
|
|
- />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="规格内容" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.skuSpecsList[0].specsValue"
|
|
|
- placeholder="规格内容"
|
|
|
- clearable
|
|
|
- @input="passValue"
|
|
|
- />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="name" label="库存" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.stock"
|
|
|
- placeholder="库存"
|
|
|
- clearable
|
|
|
- @input="passValue"
|
|
|
- >
|
|
|
- <template slot="suffix"> {{ unit }} </template>
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="起批量" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.minPurchase"
|
|
|
- placeholder="起批量"
|
|
|
- clearable
|
|
|
- @input="passValue"
|
|
|
- >
|
|
|
- <template slot="suffix">
|
|
|
- {{ unit }}
|
|
|
- </template>
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="收购价" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.skuCost.purchaseFee"
|
|
|
- placeholder="收购价"
|
|
|
- clearable
|
|
|
- @input="passValue"
|
|
|
- >
|
|
|
- <template slot="suffix"> {{ unit }}/元 </template>
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="人工费" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.skuCost.laborFee"
|
|
|
- placeholder="人工费"
|
|
|
- clearable
|
|
|
- @input="passValue"
|
|
|
- >
|
|
|
- <template slot="suffix"> {{ unit }}/元 </template>
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="代办费" width="160">
|
|
|
+ <el-table
|
|
|
+ :data="eventList"
|
|
|
+ row-key="id"
|
|
|
+ @current-change="eventsChange"
|
|
|
+ highlight-current-row
|
|
|
+ >
|
|
|
+ <el-table-column label width="45">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.skuCost.agencyFee"
|
|
|
- placeholder="代办费"
|
|
|
- clearable
|
|
|
- @input="passValue"
|
|
|
- >
|
|
|
- <template slot="suffix"> {{ unit }}/元 </template>
|
|
|
- </el-input>
|
|
|
+ <el-radio :label="scope.row.id" v-model="radioId"><span></span></el-radio>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="材料费" width="160">
|
|
|
+ <el-table-column prop="title" label="活动名称"> </el-table-column>
|
|
|
+ <el-table-column prop="intro" label="活动介绍"> </el-table-column>
|
|
|
+ <el-table-column prop="startTime" label="开始时间"> </el-table-column>
|
|
|
+ <el-table-column prop="endTime" label="结束时间"> </el-table-column>
|
|
|
+ <el-table-column prop="tag" label="是否使用代金券">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- @input="passValue"
|
|
|
- v-model="scope.row.skuCost.materialFee"
|
|
|
- placeholder="材料费"
|
|
|
- clearable
|
|
|
- >
|
|
|
- <template slot="suffix"> {{ unit }}/元 </template>
|
|
|
- </el-input>
|
|
|
+ <el-tag>
|
|
|
+ {{ scope.row.useVoucher == 1 ? "是" : "否" }}
|
|
|
+ </el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="商品单价" width="80">
|
|
|
+ <el-table-column prop="tag" label="备注" width="160">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ computePrice(scope.row) }}元/{{ unit }}
|
|
|
+ <el-tag>
|
|
|
+ {{ scope.row.tag == 1 ? "年货节" : "" }}
|
|
|
+ </el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column prop="address" label="操作" width="160">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- style="color: red"
|
|
|
- @click="removeSpecification(scope, scope.$index)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
</el-table>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitGg">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="eventsSubmit">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -366,8 +292,11 @@ import {
|
|
|
editGoods,
|
|
|
goodsRemove,
|
|
|
} from "@/api/manage/product";
|
|
|
+
|
|
|
+import { promotionList, promotionSku } from "@/api/active/index";
|
|
|
import { getClassificationListPage } from "@/api/common/index";
|
|
|
import lookProduct from "../lookProduct.vue";
|
|
|
+import { getStoreInfo } from "@/api/common/index";
|
|
|
export default {
|
|
|
components: { lookProduct },
|
|
|
name: "product",
|
|
@@ -406,15 +335,60 @@ export default {
|
|
|
dataTable: {},
|
|
|
unit: "",
|
|
|
skuId: "",
|
|
|
+ eventList: [],
|
|
|
+ radioId: "",
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ eventsSubmit() {
|
|
|
+ let ids = [];
|
|
|
+ this.multipleSelection.forEach((e) => {
|
|
|
+ ids.push({
|
|
|
+ spuId: e.id,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ let params = {
|
|
|
+ promotionId: this.radioId,
|
|
|
+ skuList: ids,
|
|
|
+ type: 1,
|
|
|
+ };
|
|
|
+ promotionSku(params).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.$message.success("添加成功!");
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ eventsChange(val) {
|
|
|
+ console.log(val);
|
|
|
+ this.radioId = val.id;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 批量加入活动
|
|
|
+ */
|
|
|
+ handleEvents() {
|
|
|
+ if (this.multipleSelection.length < 1) {
|
|
|
+ this.$message.error("请选择要参与活动的商品!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.dialogVisible = true;
|
|
|
+ promotionList({
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.eventList = res.data.records;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
back() {
|
|
|
this.toggle = true;
|
|
|
},
|
|
|
+
|
|
|
handleDelete(record) {
|
|
|
this.$confirm("是否确认删除该商品?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -423,7 +397,7 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
goodsRemove({
|
|
|
- spuId: record.id,
|
|
|
+ spuIds: record.id,
|
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success(`删除成功!`);
|
|
@@ -446,10 +420,6 @@ export default {
|
|
|
spuId: this.skuId,
|
|
|
skuList: this.dataTable.skuList,
|
|
|
};
|
|
|
- // this.dataTable.skuList.forEach((e) => {
|
|
|
- // params.skuPriceList.push(e.skuPriceList[0]);
|
|
|
- // params.skuSpecsList.push(e.skuSpecsList[0]);
|
|
|
- // });
|
|
|
editGoods(params).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success("编辑成功");
|
|
@@ -474,6 +444,97 @@ export default {
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
+ handleDelist() {
|
|
|
+ if (this.multipleSelection.length < 1) {
|
|
|
+ this.$message.error("请选择要导出的商品!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let ids = [];
|
|
|
+ this.multipleSelection.forEach((e) => {
|
|
|
+ ids.push(e.id);
|
|
|
+ });
|
|
|
+ this.$confirm("是否批量下架商品?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ GoodsUpOrDown({
|
|
|
+ spuId: ids.toString(),
|
|
|
+ spuStatus: 1,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success(`操作成功!`);
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消操作",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleExportAll() {
|
|
|
+ this.download(
|
|
|
+ "system/goods/export",
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ },
|
|
|
+ `商品信息_${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ handleExport() {
|
|
|
+ if (this.multipleSelection.length < 1) {
|
|
|
+ this.$message.error("请选择要导出的商品!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let ids = [];
|
|
|
+ this.multipleSelection.forEach((e) => {
|
|
|
+ ids.push(e.id);
|
|
|
+ });
|
|
|
+ this.queryParams.spuId = ids.toString();
|
|
|
+ this.download(
|
|
|
+ "system/goods/export",
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ },
|
|
|
+ `商品信息_${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ BatchRemove() {
|
|
|
+ console.log(this.multipleSelection);
|
|
|
+ if (this.multipleSelection.length < 1) {
|
|
|
+ this.$message.error("请选择要删除的商品!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let ids = [];
|
|
|
+ this.multipleSelection.forEach((e) => {
|
|
|
+ ids.push(e.id);
|
|
|
+ });
|
|
|
+ this.$confirm("是否确认批量删除商品?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ goodsRemove({
|
|
|
+ spuIds: ids.toString(),
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success(`批量删除成功!`);
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消操作",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 查询参数列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -551,7 +612,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
handleUpdate(record) {
|
|
|
getGoodsInfo({ spuId: record.id }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
@@ -587,7 +647,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
cascaderChange(val) {
|
|
|
if (val.length == 1) {
|
|
|
this.queryParams.categoryId = val[0];
|