From 31df83987f8209d49f0625f6e334101a7f003e86 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 17 四月 2024 14:32:07 +0800
Subject: [PATCH] 产品编辑单位模块 设置默认值的时候,自动把其他的关闭,不用手动取消+增加的时候自动滚动到底部

---
 src/views/overview/OverviewListView.vue |   71 ++++++++++++++++++++++++++++++-----
 1 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/src/views/overview/OverviewListView.vue b/src/views/overview/OverviewListView.vue
index 1811b59..49354f5 100644
--- a/src/views/overview/OverviewListView.vue
+++ b/src/views/overview/OverviewListView.vue
@@ -97,7 +97,7 @@
   data() {
     return {
       tableList: {},
-      showcol: ["浠撳簱浣嶇疆", "鏉ユ簮","鏉ユ簮鍗曟嵁","璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�", "鏃ユ湡",   "閿�鍞槑缁嗗崟", "鐘舵��"],
+      showcol: ["浠撳簱浣嶇疆", "鏉ユ簮","鏉ユ簮鍗曟嵁","璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�", "鏃ユ湡",   "閿�鍞槑缁嗗崟", "鐘舵��" ,"涓荤","浼氳","淇濈鍛�",],
       searchOptions: [],
       commonDetail: {
         visible: false,
@@ -109,7 +109,7 @@
         title: "鏂板缓",
         infomation: {}
       },
-      workType: this.$route.params.workType,
+      workType: this.$route.query.workType,
       keyword: "",
       params: {},
       displayEdit: false,
@@ -120,7 +120,7 @@
       numberLabel: "鍗曞彿",
       TabsIndex: "0",
       productTableList: {},
-      showBottomCol: ["浜у搧缂栧彿", "浜у搧鍚嶇О", "浜у搧瑙勬牸", "浜у搧鍨嬪彿", "璁¢噺鍗曚綅", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鏁伴噺"],
+      showBottomCol: ["浜у搧缂栧彿", "浜у搧鍚嶇О", "浜у搧瑙勬牸", "浜у搧鍨嬪彿", "璁¢噺鍗曚綅", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鏁伴噺","涓荤","浼氳","淇濈鍛�",'杈呭姪鏁伴噺','杈呭姪鍗曚綅'],
       tableBottomColumn: [],
       selectRow: {},
       productColumn: [
@@ -128,8 +128,10 @@
         { label: "浜у搧鍚嶇О", prop: "productName" },
         { label: "浜у搧瑙勬牸", prop: "specs" },
         { label: "浜у搧鍨嬪彿", prop: "model" },
+        { label: "鏁伴噺", prop: "amount" },
         { label: "璁¢噺鍗曚綅", prop: "unit" },
-        { label: "鏁伴噺", prop: "amount" }
+        { label: "杈呭姪鏁伴噺", prop: "adjunctAmount" },
+        { label: "杈呭姪鍗曚綅", prop: "adjunctUnit" }
       ],
       allotProductColumn: [
         { label: "浜у搧缂栧彿", prop: "id", default: true },
@@ -139,7 +141,9 @@
         { label: "璁¢噺鍗曚綅", prop: "unit" },
         { label: "璋冨嚭浣嶇疆", prop: "location" },
         { label: "璋冨叆浣嶇疆", prop: "toLocation" },
-        { label: "鏁伴噺", prop: "amount" }
+        { label: "鏁伴噺", prop: "amount" },
+        { label: "杈呭姪鏁伴噺", prop: "adjunctAmount" },
+        { label: "杈呭姪鍗曚綅", prop: "adjunctUnit" }
       ]
     }
   },
@@ -151,7 +155,8 @@
     if (paramsData) {
       params = JSON.parse(sessionStorage.getItem("paramsData"))
     } else {
-      params = this.$route.params
+      params = this.$route.query
+      params.id=Number(params.id)
       sessionStorage.setItem("paramsData", JSON.stringify(params))
     }
     this.params = params
@@ -175,7 +180,7 @@
         this.toLabel = "瀹㈡埛浣嶇疆"
         this.numberLabel = "鍑哄簱鍗曞彿"
       } else {
-        this.showcol=["浠撳簱浣嶇疆", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�", "鏃ユ湡",   "閿�鍞槑缁嗗崟", "鐘舵��"],
+        this.showcol=["浠撳簱浣嶇疆", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�","鏃ユ湡",   "閿�鍞槑缁嗗崟", "鐘舵��","涓荤","浼氳","淇濈鍛�",],
         this.formLabel = "璋冨嚭浣嶇疆"
         this.toLabel = "璋冨叆浣嶇疆"
         this.numberLabel = "璋冩嫧鍗曞彿"
@@ -288,7 +293,25 @@
           status: true,
           isCallMethod: true,
           getCallMethod: this.getStatus
-        }
+        },
+        {
+          label: "涓荤",
+          prop: "manager",
+          isShowColumn: showcol.includes("涓荤"),
+          default: false
+        },
+        {
+          label: "浼氳",
+          prop: "accountant",
+          isShowColumn: showcol.includes("浼氳"),
+          default: false
+        },
+        {
+          label: "淇濈鍛�",
+          prop: "custodian",
+          isShowColumn: showcol.includes("淇濈鍛�"),
+          default: false
+        },
       ]
       return tableColumn
     },
@@ -300,7 +323,7 @@
     async getData() {
       await getOperation({
         number: this.keyword,
-        operationTypeId: this.$route.params.id ? this.$route.params.id : this.params.id,
+        operationTypeId: this.$route.query.id ? Number(this.$route.query.id) : this.params.id,
         page: this.pagerOptions.currPage,
         pageSize: this.pagerOptions.pageSize,
         status: this.params.status
@@ -327,12 +350,27 @@
     // bottom浜у搧淇℃伅鏁版嵁澶勭悊
     bottomProductData(arr) {
       const list = arr.details.map((item) => {
+        let adjunctUnit=''
+        let adjunctAmount=''
+        if(item.product.moreUnit&&item.product.moreUnitList){
+          let moreUnitList=item.product.moreUnitList
+          if(moreUnitList.length>0){
+            for(let j in moreUnitList){
+              if(moreUnitList[j].floating){
+                adjunctUnit=moreUnitList[j].unit
+                adjunctAmount=moreUnitList[j].amount
+              }
+            }
+          }
+        }
         return {
           ...item,
           productName: item.product.name,
           unit: item.product.unit,
           location: arr.location.name,
-          toLocation: arr.toLocation.name
+          toLocation: arr.toLocation.name,
+          adjunctUnit:adjunctUnit,
+          adjunctAmount:adjunctAmount
         }
       })
       this.productTableList.tableInfomation = list
@@ -369,7 +407,18 @@
       }
       row.locationID = row.location.jointName
       row.locationId = row.location.value
-
+      row.managerObj={
+        label:row.manager,
+        value:row.managerId
+      }
+      row.accountantObj={
+        label:row.accountant,
+        value:row.accountantId
+      }
+      row.custodianObj={
+        label:row.custodian,
+        value:row.custodianId
+      }
       // row.tolocationId=row.tolocation.value
       this.editConfig.infomation = { ...row }
     },

--
Gitblit v1.8.0