From cf6a4b874aed82592eea78294715c7c688f9b248 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期五, 03 十一月 2023 14:50:31 +0800
Subject: [PATCH] Merge branch 'dev' into songshankun/add-token

---
 src/views/operate/orderPoint/index.vue |   56 +++++++++++++++++---------------------------------------
 1 files changed, 17 insertions(+), 39 deletions(-)

diff --git a/src/views/operate/orderPoint/index.vue b/src/views/operate/orderPoint/index.vue
index d53c274..80c1401 100644
--- a/src/views/operate/orderPoint/index.vue
+++ b/src/views/operate/orderPoint/index.vue
@@ -7,9 +7,11 @@
         :show-apply="false"
         :placeholder="'璇疯緭鍏ヤ綅缃�/浜у搧'"
         :amount-view="false"
+        :search-task-map="searchTaskMap"
         @addCommonClick="addProductClick"
         @searchClick="getList"
         @discardBtnClick="discardBtnClick"
+        @delSelectClick="delSelectClick"
       />
     </div>
     <div class="content_wrap">
@@ -136,11 +138,14 @@
       maxInventory: 0,
       orderNumber: 0,
       unit: "",
-      reorderId: 0
+      reorderId: 0,
+      searchTaskMap: [],
+      type: "bh"
     }
   },
   created() {
     this.setTable()
+    this.searchTaskMap = [{ type: this.type, title: "閲嶆柊璁㈣喘" }]
     this.getData()
     this.getLocationList()
   },
@@ -164,14 +169,17 @@
       }
     },
     // 璇锋眰鏁版嵁
-    async getData() {
+    async getData(data) {
       await getReorderRuleList({
+        locationId: data?.id,
+        type: this.type,
+        keyWord: data?.jointName,
         page: this.pagerOptions.currPage,
         pageSize: this.pagerOptions.pageSize
       }).then((res) => {
         if (res.code === 200) {
           console.log(res)
-          const list = res.data.map((item) => {
+          const list = res.data?.map((item) => {
             let orderNum = 0
             if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) {
               orderNum = this.caculateOrderNumber(
@@ -384,42 +392,7 @@
     //鏍戠偣鍑�
     handleNodeClick(data) {
       console.log(data, "sss")
-      getReorderRuleList({
-        locationId: data.id,
-        page: 1,
-        pageSize: 15,
-        type: "",
-        keyWord: data.jointName
-      }).then((res) => {
-        console.log(res, "res999")
-        if (res.code === 200) {
-          console.log(res)
-          const list = res.data.map((item) => {
-            let orderNum = 0
-            if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) {
-              orderNum = this.caculateOrderNumber(
-                parseFloat(item.minInventory),
-                parseFloat(item.maxInventory),
-                parseFloat(item.prediction)
-              )
-            }
-            return {
-              ...item,
-              productName: item.product.name,
-              locationName: item.location.name,
-              isSet: false,
-              isEdit: true,
-              editable: true,
-              isOrder: true,
-              isView: item?.minInventory - item?.prediction > 0 ? true : false,
-              orderNumber: orderNum
-            }
-          })
-          this.tableList.tableData = list || []
-          this.tableData = list || []
-          this.pagerOptions.totalCount = res.total
-        }
-      })
+      this.getData(data)
     },
     async getLocationList() {
       await getLocationTreeList().then((res) => {
@@ -433,6 +406,11 @@
         ]
         console.log(res, "res666")
       })
+    },
+    // 鍒犻櫎type
+    delSelectClick() {
+      this.type = ""
+      this.getData()
     }
   }
 }

--
Gitblit v1.8.0