|
|
@@ -1,9 +1,7 @@
|
|
|
<template>
|
|
|
<container title="店铺管理">
|
|
|
<template v-slot:btn>
|
|
|
- <el-button type="primary" @click="handelEdit('')"
|
|
|
- >添加店铺</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="handelEdit('')">添加店铺</el-button>
|
|
|
<el-button @click="batchDel">批量删除</el-button>
|
|
|
</template>
|
|
|
<search-box-new
|
|
|
@@ -27,7 +25,7 @@
|
|
|
inactive-color="#ff4949"
|
|
|
:active-value="1"
|
|
|
:inactive-value="0"
|
|
|
- @change="statusChange($event, props.scope.row)"
|
|
|
+ @change="editStore(props.scope.row.storeId, $event)"
|
|
|
>
|
|
|
</el-switch>
|
|
|
</template>
|
|
|
@@ -35,7 +33,7 @@
|
|
|
<el-button type="text" @click="handelEdit(props.scope.row.storeId)"
|
|
|
>编辑</el-button
|
|
|
>
|
|
|
- <el-button type="text" @click="handelDel(props.scope.row.storeId)"
|
|
|
+ <el-button type="text" @click="del(props.scope.row.storeId)"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</template>
|
|
|
@@ -48,6 +46,7 @@
|
|
|
/>
|
|
|
<Store-set-dlg
|
|
|
:storeId="storeId"
|
|
|
+ @search="search"
|
|
|
:dialogVisible.sync="dialogVisible"
|
|
|
></Store-set-dlg>
|
|
|
</container>
|
|
|
@@ -55,7 +54,7 @@
|
|
|
|
|
|
<script>
|
|
|
import StoreSetDlg from "./components/StoreSetDlg.vue";
|
|
|
-import { getStoreList } from "../../api/store/index";
|
|
|
+import { getStoreList, editStore, storeBatchDel } from "../../api/store/index";
|
|
|
export default {
|
|
|
name: "SaasMemberRecord",
|
|
|
|
|
|
@@ -116,6 +115,7 @@ export default {
|
|
|
search(v) {
|
|
|
if (v === 2) {
|
|
|
this.formData = {
|
|
|
+ status: "0,1",
|
|
|
pageSize: 10,
|
|
|
pageNum: 1,
|
|
|
storeName: undefined,
|
|
|
@@ -131,15 +131,24 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
- del(id) {
|
|
|
- this.$confirm("确定删除吗?", "提示", {
|
|
|
+ del(storeId) {
|
|
|
+ this.$confirm("确定删除该店铺吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
})
|
|
|
- .then(() => {})
|
|
|
+ .then(() => {
|
|
|
+ this.editStore(storeId, -1);
|
|
|
+ })
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
+ editStore(storeId, status) {
|
|
|
+ editStore({ storeId, status, merId: "1" }).then((res) => {
|
|
|
+ status == -1 && this.$message.success("删除成功");
|
|
|
+ this.$store.commit("EDICSTORELIST");
|
|
|
+ this.search();
|
|
|
+ });
|
|
|
+ },
|
|
|
handelEdit(storeId) {
|
|
|
this.storeId = storeId;
|
|
|
this.dialogVisible = true;
|
|
|
@@ -156,30 +165,20 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
const ids = this.$refs.tableList.allCheckData.map(
|
|
|
- (item) => item.moduleExamId
|
|
|
+ (item) => item.storeId
|
|
|
);
|
|
|
- moduleVolumeBatchDel({
|
|
|
+ storeBatchDel({
|
|
|
status: -1,
|
|
|
- ids,
|
|
|
+ storeIds: ids,
|
|
|
}).then((res) => {
|
|
|
this.$message.success("批量删除成功");
|
|
|
this.$refs.tableList.clearMoreActive();
|
|
|
- this.search(1);
|
|
|
+ this.$store.commit("EDICSTORELIST");
|
|
|
+ this.search();
|
|
|
});
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
- statusChange(e, row) {
|
|
|
- // this.$api
|
|
|
- // .editmallstore({ storeId: row.storeId, status: e })
|
|
|
- // .then((res) => {
|
|
|
- // this.$message.success("操作成功");
|
|
|
- // row.status = e;
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // return (row.status = e ? 0 : 1);
|
|
|
- // });
|
|
|
- },
|
|
|
},
|
|
|
components: { StoreSetDlg },
|
|
|
};
|