From 3c9c1a4f8ccbf765c35e44b21c790ef428e12868 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期三, 13 十二月 2023 18:26:05 +0800
Subject: [PATCH] feat: 物品规格管理 接口对接

---
 admin-web/src/views/foundation/material/specs/list.vue |   36 ++++++++++++++++++++++++++++--------
 1 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/admin-web/src/views/foundation/material/specs/list.vue b/admin-web/src/views/foundation/material/specs/list.vue
index 63e01c7..eadc4a7 100644
--- a/admin-web/src/views/foundation/material/specs/list.vue
+++ b/admin-web/src/views/foundation/material/specs/list.vue
@@ -12,7 +12,7 @@
 <script>
 import winMd from '@/components/win/win-md'
 import myButton from '@/components/myButton/myButton'
-import {delSpecs} from "@/api/foudation/material";
+import {delSpecs, updSpecsStatus} from "@/api/foudation/material";
 import specsAdd from "@/views/foundation/material/specs/specsAdd.vue";
 import {mapGetters} from 'vuex'
 import MyTableV2 from "@/components/myTable/myTableV2.vue";
@@ -37,6 +37,7 @@
       },
       // 琛ㄦ牸鏁版嵁
       table: {
+        autoLoad: false,
         showIndex: true, // 鏄惁鏄剧ず搴忓彿
         expand: false, // 鏄惁鏄剧ず璇︽儏鏁版嵁
         dataIndex: 'goodsTemplatesId',
@@ -61,8 +62,8 @@
         },
         // 鍒椾俊鎭�
         columns: [
-          {title: '瑙勬牸鍨嬪彿', field: 'goodsCode', align: 'left', minWidth: 120},
-          {title: '鍗曚綅', field: 'classification', align: 'center', width: 100},
+          {title: '瑙勬牸鍨嬪彿', field: 'modelName', align: 'left', minWidth: 120},
+          {title: '鍗曚綅', field: 'unit', align: 'center', width: 100},
           {
             field: 'states',
             title: '鐘舵��',
@@ -105,7 +106,7 @@
           ],
         },
         paging: {
-          show: true, // 鏄剧ず鍒嗛〉
+          show: false, // 鏄剧ず鍒嗛〉
           // 鍒嗛〉淇℃伅
           page: {
             small: false,
@@ -120,16 +121,35 @@
   computed: {
     ...mapGetters(['userInfo'])
   },
-  created() {
+  mounted() {
+    this.$nextTick(()=>{
+      this.search()
+    })
+
   },
   methods: {
     showAdd(){
-      this.specsSetting.mid = this.setting.id;//鐗╁搧ID
+      this.specsSetting.goodsTemplatesId = this.setting.goodsTemplatesId;//鐗╁搧ID
       this.specsSetting.show = true;
+    },
+    updState(row) {
+      let vm = this
+      let text = row.states == 0 ? "鍚敤" : "绂佺敤";
+      vm.$modal.confirm('纭瑕�' + text + '"' + row.modelName + '"瑙勬牸鍚楋紵').then(function () {
+        let params = Object.assign({}, row)
+        params.states = row.states == 1 ? 0 : 1
+        updSpecsStatus(params).then(res => {
+          if (res) {
+            row.states = row.states === 1 ? 0 : 1
+            vm.$modal.msgSuccess(text + "鎴愬姛");
+            vm.search()
+          }
+        })
+      })
     },
     del(row) {
       this.$modal
-        .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.categoryName + '"鐨勬満鏋勫悧锛�')
+        .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.modelName + '"鐨勮鏍煎悧锛�')
         .then(function () {
           delSpecs({ id: row.id }).then((res) => {});
         })
@@ -143,7 +163,7 @@
     },
     // 鏌ヨtable鍒楄〃
     search() {
-      this.$refs.myTable.search()
+      this.$refs.myTable.search({goodsTemplatesId:this.specsSetting.goodsTemplatesId})
     },
 
   }

--
Gitblit v1.9.1