|
@@ -95,7 +95,7 @@ export default {
|
|
|
await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions(['query', 'fetch', 'create', 'update']),
|
|
|
+ ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
// 查询
|
|
|
async search({ skip = 0, limit = 5, ...info } = {}) {
|
|
|
info.goods = this.id;
|
|
@@ -135,16 +135,21 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
}).then(async () => {
|
|
|
+ let res;
|
|
|
let list = data.reply;
|
|
|
if (index == '0') {
|
|
|
- list = [];
|
|
|
+ res = await this.delete(data.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({ type: `success`, message: `刪除成功` });
|
|
|
+ }
|
|
|
} else {
|
|
|
list.splice(index, 1);
|
|
|
+ if (data.id) res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({ type: `success`, message: `删除成功` });
|
|
|
+ }
|
|
|
}
|
|
|
- if (data.id) res = await this.update(data);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$message({ type: `success`, message: `删除成功` });
|
|
|
- }
|
|
|
+
|
|
|
this.search();
|
|
|
});
|
|
|
},
|