YY 2 năm trước cách đây
mục cha
commit
df67380af0

+ 7 - 0
src/util/opera.js

@@ -9,6 +9,13 @@ export default {
     if (this.$checkRes(res)) {
     if (this.$checkRes(res)) {
       this.$set(this, `list`, res.data);
       this.$set(this, `list`, res.data);
       this.$set(this, `total`, res.total);
       this.$set(this, `total`, res.total);
+      if (res.total === 0) {
+        let arr = await this.goodsUpdate({
+          _id: this.defaultSearch.goods,
+          status: '0',
+        });
+        console.log(arr);
+      }
     }
     }
   },
   },
   // 去添加
   // 去添加

+ 1 - 1
src/views/platmanag/goods/spec.vue

@@ -142,7 +142,7 @@ export default {
   methods: {
   methods: {
     ...dictData({ getDict: 'query' }),
     ...dictData({ getDict: 'query' }),
     ...mapActions(['query', 'fetch', 'update', 'delete', 'create']),
     ...mapActions(['query', 'fetch', 'update', 'delete', 'create']),
-    ...goods({ goodsFetch: 'fetch' }),
+    ...goods({ goodsFetch: 'fetch', goodsUpdate: 'update' }),
     ...methodUtil,
     ...methodUtil,
     // 添加自定义
     // 添加自定义
     initAddData() {
     initAddData() {