From 62d36f52a6058e0483feceb8819475b31bc1f102 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期三, 10 四月 2024 18:59:23 +0800
Subject: [PATCH] 库存调整,出入库明细跳转明细单修改

---
 src/views/overview/AddOverviewDialog.vue |   63 ++++++++++++++++++++++---------
 1 files changed, 44 insertions(+), 19 deletions(-)

diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue
index d65496a..7b32ed0 100644
--- a/src/views/overview/AddOverviewDialog.vue
+++ b/src/views/overview/AddOverviewDialog.vue
@@ -203,7 +203,7 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item :label="workType === 1 ? '浠撳簱浣嶇疆' : '璋冨嚭浣嶇疆'" prop="location">
+                <el-form-item :label="workType === 1 ? '浠撳簱浣嶇疆' : '浠�'" prop="location">
                   <el-select
                     @change="rootLocationChange"
                     v-model="editConfig.infomation.location"
@@ -243,7 +243,7 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12" v-if="workType === 3">
-                <el-form-item label="璋冨叆浣嶇疆" prop="toLocation">
+                <el-form-item label="鑷�" prop="toLocation">
                   <el-select
                     @change="toLocationChange"
                     v-model="editConfig.infomation.toLocation"
@@ -516,7 +516,7 @@
       supplierOptions: [], //渚涘簲鍟�
       clientOptions: [], //瀹㈡埛
       memberOptions: [{ id: 1, name: "绠$悊鍛�" }],
-      formLocationOptions: [], // 璋冨嚭浣嶇疆
+      formLocationOptions: [], // 鑷�
       toLocationOptions: [], // 浠撳簱浣嶇疆
       showButton: true,
       activeName: "first",
@@ -765,7 +765,7 @@
       console.log(validArr, "xxx")
       Promise.all(validArr)
         .then((results) => {
-          console.log(results, "鎵ц鎴愬姛")
+          console.log(results, "鎵ц鎴愬姛", this.tableData)
           for (let i = 0; i < this.tableData.length; i++) {
             if (this.tableData[i].productName.length === 0) {
               this.isNoProduct = true
@@ -979,6 +979,7 @@
           return {
             ...item,
             productName: item.product.name,
+            productId: item.product.id,
             unit: item.product.unit
           }
         })
@@ -991,32 +992,54 @@
       if (this.workType === 1) {
         tableColumnArr = [
           { label: "浜у搧鍚嶇О", prop: "productName", productName: true, isRequird: true },
-          { label: "浜у搧缂栫爜", prop: "id" },
-          { label: "璁¢噺鍗曚綅", prop: "unit" },
+          { label: "浜у搧缂栫爜", prop: "productId" },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "浜у搧瑙勬牸", prop: "specs" },
           { label: "浜у搧鍨嬪彿", prop: "model" },
-          { label: "鏁伴噺", prop: "amount", inputFloat: true }
+          { label: "璁¢噺鍗曚綅", prop: "unit" },
         ]
       } else if (this.workType === 2) {
         tableColumnArr = [
           { label: "浜у搧鍚嶇О", prop: "productName", productName: true, isRequird: true },
-          { label: "浜у搧缂栫爜", prop: "id" },
-          { label: "璁¢噺鍗曚綅", prop: "unit" },
+          { label: "浜у搧缂栫爜", prop: "productId" },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "浜у搧瑙勬牸", prop: "specs" },
           { label: "浜у搧鍨嬪彿", prop: "model" },
-          // { label: "璋冨嚭浣嶇疆", prop: "fromLocationId", sonLocation: true, isRequird: true },
-          { label: "鏁伴噺", prop: "amount", inputFloat: true }
+          { label: "浠�", prop: "fromLocationId", sonLocation: true, isRequird: true },
+          { label: "璁¢噺鍗曚綅", prop: "unit" },
         ]
       } else if (this.workType === 3) {
         tableColumnArr = [
           { label: "浜у搧鍚嶇О", prop: "productName", productName: true, isRequird: true },
-          { label: "浜у搧缂栫爜", prop: "id" },
-          { label: "璁¢噺鍗曚綅", prop: "unit" },
+          { label: "浜у搧缂栫爜", prop: "productId" },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "浜у搧瑙勬牸", prop: "specs" },
           { label: "浜у搧鍨嬪彿", prop: "model" },
-          { label: "璋冨嚭浣嶇疆", prop: "fromLocationId", sonLocation: true, isRequird: true },
-          { label: "璋冨叆浣嶇疆", prop: "toLocationId", toLocation: true, isRequird: true },
-          { label: "鏁伴噺", prop: "amount", inputFloat: true }
+          { label: "浠�", prop: "fromLocationId", sonLocation: true, isRequird: true },
+          { label: "鑷�", prop: "toLocationId", toLocation: true, isRequird: true },
+          { label: "璁¢噺鍗曚綅", prop: "unit" },
+        ]
+      }else if (this.workType === 4) {
+        tableColumnArr = [
+          { label: "浜у搧鍚嶇О", prop: "productName", productName: true, isRequird: true },
+          { label: "浜у搧缂栫爜", prop: "productId" },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
+          { label: "浜у搧瑙勬牸", prop: "specs" },
+          { label: "浜у搧鍨嬪彿", prop: "model" },
+          { label: "浠�", prop: "fromLocationId", sonLocation: true, isRequird: true },
+          { label: "鑷�", prop: "toLocationId", toLocation: true, isRequird: true },
+          { label: "璁¢噺鍗曚綅", prop: "unit" },
+        ]
+      }else if (this.workType === 5) {
+        tableColumnArr = [
+          { label: "浜у搧鍚嶇О", prop: "productName", productName: true, isRequird: true },
+          { label: "浜у搧缂栫爜", prop: "productId" },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
+          { label: "浜у搧瑙勬牸", prop: "specs" },
+          { label: "浜у搧鍨嬪彿", prop: "model" },
+          { label: "浠�", prop: "fromLocationId", sonLocation: true, isRequird: true },
+          { label: "鑷�", prop: "toLocationId", toLocation: true, isRequird: true },
+          { label: "璁¢噺鍗曚綅", prop: "unit" },
         ]
       }
       this.productTableList = {
@@ -1098,9 +1121,12 @@
       let list = this.tableData.map((res) => {
         return {
           ...res,
-          productName: res.name
+          amount: 1,
+          productName: res.name,
+          productId: res.id
         }
       })
+      this.tableData = list
       this.productTableList.tableData = list
       // this.showSummary.show = true
     },
@@ -1115,10 +1141,9 @@
     },
     // 鍒犻櫎
     handleDelClick(scope, value) {
-      console.log(scope)
       if (value === "鎿嶄綔") {
         this.tableData.splice(scope.$index, 1)
-        this.productTableList.tableData.splice(scope.$index, 1)
+        this.productTableList.tableData = this.tableData
         this.$message.success("鍒犻櫎鎴愬姛锛�")
       } else {
         this.detailTableData.splice(scope.$index, 1)

--
Gitblit v1.8.0