From a7283ede11fae835a1c49e7b59dde493f23f72be Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期四, 15 八月 2024 13:11:12 +0800
Subject: [PATCH] 1.BOM页面  开发完成100%

---
 src/api/ProductModel.js                    |    9 +++++++++
 src/views/materialManager/materialList.vue |   38 +++++++++++++++++++-------------------
 2 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/src/api/ProductModel.js b/src/api/ProductModel.js
index 1b9b71f..dadca0c 100644
--- a/src/api/ProductModel.js
+++ b/src/api/ProductModel.js
@@ -186,3 +186,12 @@
     data
   })
 }
+
+// 鐗╂枡娓呭崟鍒犻櫎鎻愪氦-T+鐣呮嵎閫氭ā寮�
+export function TBomDelete(data) {
+  return request({
+    url: 'ProductModel/TBomDelete',
+    method: 'post',
+    data
+  })
+}
diff --git a/src/views/materialManager/materialList.vue b/src/views/materialManager/materialList.vue
index 2b83580..8549a6e 100644
--- a/src/views/materialManager/materialList.vue
+++ b/src/views/materialManager/materialList.vue
@@ -623,7 +623,7 @@
   AddUpdateTBomUnitGroup,
   BomMainData,
   AddUpdateTBomParentData,
-  AddUpdateTBomDetailsData, AddUpdateTBomMaxVsion, AddUpdateTBomDetailsBomData, TBomAddUpdate
+  AddUpdateTBomDetailsData, AddUpdateTBomMaxVsion, AddUpdateTBomDetailsBomData, TBomAddUpdate, TBomDelete
 } from '@/api/ProductModel'
 
 export default {
@@ -1079,23 +1079,23 @@
     },
     // 鍒犻櫎鎸夐挳
     async del(row) {
-      // this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
-      //   confirmButtonText: '纭畾',
-      //   cancelButtonText: '鍙栨秷',
-      //   type: 'warning'
-      // }).then(() => {
-      //   DeleteBoIventory({ bomid: row.id }).then(res => {
-      //     if (res.code === '200') {
-      //       this.$message.success('鍒犻櫎鎴愬姛!')
-      //       if (this.form.page > 1 && this.tableData.length === 1) {
-      //         this.form.page--
-      //       }
-      //       this.getBomMainData()
-      //     }
-      //   })
-      // }).catch(() => {
-      //   this.$message.info('宸插彇娑堝垹闄�')
-      // })
+      this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        TBomDelete(row).then(res => {
+          if (res.code === '200') {
+            this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
+            this.getBomMainData()
+          }
+        })
+      }).catch(() => {
+        this.$message.info('宸插彇娑堝垹闄�')
+      })
     },
     // 瀵硅瘽妗嗗叧闂簨浠�
     handleClose() {
@@ -1144,7 +1144,7 @@
               'base_quantity': i.BASE_QUANTITY,
               'loss_quantity': i.LOSS_QUANTITY,
               'total_quantity': i.TOTAL_QUANTITY,
-              'idchildbom': i.tableData2.find(j => j.version === i.idchildbom).id
+              'idchildbom': i.idchildbom === '' ? '' : i.tableData2.find(j => j.version === i.idchildbom).id
             })
           })
 

--
Gitblit v1.9.3