|
@@ -8,7 +8,7 @@
|
|
|
@init="init"
|
|
|
/>
|
|
|
<table-list
|
|
|
- rowKey="id"
|
|
|
+ rowKey="goodsId"
|
|
|
ref="tableList"
|
|
|
:tableSets="tableSet"
|
|
|
:tableData="tableData"
|
|
@@ -17,7 +17,7 @@
|
|
|
@addClick="addClick"
|
|
|
>
|
|
|
<template slot="customize">
|
|
|
- <el-button> 批量删除 </el-button>
|
|
|
+ <el-button @click="remove"> 批量删除 </el-button>
|
|
|
<el-button> 导出excel </el-button>
|
|
|
</template>
|
|
|
<template slot="about" slot-scope="props">
|
|
@@ -47,7 +47,7 @@
|
|
|
</template>
|
|
|
<template slot="status" slot-scope="props">
|
|
|
<el-switch
|
|
|
- v-model="props.scope.row.status"
|
|
|
+ v-model="props.scope.row.goodsStatus"
|
|
|
active-color="#13ce66"
|
|
|
inactive-color="#ff4949"
|
|
|
:active-value="1"
|
|
@@ -101,9 +101,10 @@ export default {
|
|
|
index: 0,
|
|
|
ch: "条",
|
|
|
num: true,
|
|
|
- choice: false,
|
|
|
+ choice: true,
|
|
|
addHide: false,
|
|
|
custom: false,
|
|
|
+ openCheckMore: true,
|
|
|
},
|
|
|
formList: [
|
|
|
{
|
|
@@ -185,23 +186,6 @@ export default {
|
|
|
scope: "solt",
|
|
|
soltName: "status",
|
|
|
},
|
|
|
- {
|
|
|
- label: "商品状态",
|
|
|
- prop: "status",
|
|
|
- hidden: true,
|
|
|
- scope: "isOptions",
|
|
|
- options: [
|
|
|
- {
|
|
|
- label: "有效",
|
|
|
- value: 1,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "无效",
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
-
|
|
|
{
|
|
|
label: "录入时间",
|
|
|
prop: "createTime",
|
|
@@ -237,13 +221,18 @@ export default {
|
|
|
methods: {
|
|
|
statusChange(e, row) {
|
|
|
this.$api
|
|
|
- .editgoodspoints({ goodsId: row.goodsId, status: e })
|
|
|
+ .editgoodspoints({
|
|
|
+ goodsId: row.goodsId,
|
|
|
+ goodsStatus: e,
|
|
|
+ status: row.status,
|
|
|
+ goodsType: row.goodsType,
|
|
|
+ })
|
|
|
.then((res) => {
|
|
|
this.$message.success("操作成功");
|
|
|
- row.status = e;
|
|
|
+ row.goodsStatus = e;
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- return (row.status = e ? 0 : 1);
|
|
|
+ return (row.goodsStatus = e ? 0 : 1);
|
|
|
});
|
|
|
},
|
|
|
addClick(data) {
|
|
@@ -257,6 +246,14 @@ export default {
|
|
|
pageSize: 10,
|
|
|
pageNum: 1,
|
|
|
};
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.tableList.clearMoreActive();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (v === 3) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.tableList.clearMoreActive();
|
|
|
+ });
|
|
|
}
|
|
|
this.$api
|
|
|
.goodslistPoints(this.formData)
|
|
@@ -272,21 +269,45 @@ export default {
|
|
|
init() {
|
|
|
this.search(2);
|
|
|
},
|
|
|
+ remove() {
|
|
|
+ if (this.$refs.tableList.allCheckData.length === 0) {
|
|
|
+ this.$message.error("请勾选数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定批量删除选中的数据吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$api
|
|
|
+ .editgoodsbatchRemove({
|
|
|
+ goodsIds: this.$refs.tableList.allCheckData.map((i) => i.goodsId),
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message.success("批量删除成功");
|
|
|
+ this.search(3);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
del(v) {
|
|
|
- this.$alert(
|
|
|
- "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
- }
|
|
|
- )
|
|
|
- .then(() => {})
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消删除",
|
|
|
- });
|
|
|
- });
|
|
|
+ this.$confirm("确定删除此内容?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$api
|
|
|
+ .editgoodsbatchRemove({
|
|
|
+ goodsIds: [v.goodsId],
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ this.search(3);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
},
|
|
|
};
|