YY 2 년 전
부모
커밋
df67380af0
2개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 0
      src/util/opera.js
  2. 1 1
      src/views/platmanag/goods/spec.vue

+ 7 - 0
src/util/opera.js

@@ -9,6 +9,13 @@ export default {
     if (this.$checkRes(res)) {
       this.$set(this, `list`, res.data);
       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: {
     ...dictData({ getDict: 'query' }),
     ...mapActions(['query', 'fetch', 'update', 'delete', 'create']),
-    ...goods({ goodsFetch: 'fetch' }),
+    ...goods({ goodsFetch: 'fetch', goodsUpdate: 'update' }),
     ...methodUtil,
     // 添加自定义
     initAddData() {