From 3a94fefb02746237a8d7271e8f59b1a4261bf61e Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 13 十一月 2023 18:19:49 +0800
Subject: [PATCH] 重订货点击空白显示对象问题 位置模块编辑查看的时候点击当前库存跳转到位置报表并且把当前位置商品列出来

---
 src/views/productManage/reorderRules/index.vue   |    2 +-
 src/components/makepager/CommonFormTableView.vue |    4 +++-
 src/views/warehouseManage/position/AddDialog.vue |   13 ++++++++++++-
 src/components/makepager/FormBtnsView.vue        |    9 ++++++++-
 src/views/reportForm/locationReport/index.vue    |   21 ++++++++++++---------
 src/views/warehouseManage/position/index.vue     |    7 ++++---
 6 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 61232d2..8417584 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -205,7 +205,9 @@
               <!-- 浜у搧 -->
               <el-form-item v-else-if="item.product" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
                 <div class="custom-name">
-                  <span v-if="scope.row.isEdit || scope.row.editable">{{ scope.row[item.prop] }}</span>
+                  <span v-if="scope.row.isEdit || scope.row.editable">{{
+                    scope.row[item.prop]?.label ?? scope.row[item.prop]
+                  }}</span>
                   <el-select
                     v-else
                     v-model="scope.row[item.prop]"
diff --git a/src/components/makepager/FormBtnsView.vue b/src/components/makepager/FormBtnsView.vue
index 653231a..6a1fafa 100644
--- a/src/components/makepager/FormBtnsView.vue
+++ b/src/components/makepager/FormBtnsView.vue
@@ -87,7 +87,7 @@
         <div class="right-label">宸插敭</div>
       </div>
     </div> -->
-    <div v-if="showPosition" class="sub-number no-cursor">
+    <div v-if="showPosition" :class="showPositionCursor?'sub-number yes-cursor':'no-cursor sub-number'" @click="positionReport">
       <div class="left"><i class="el-icon-help"></i></div>
       <div class="right">
         <div class="right-one">褰撳墠搴撳瓨</div>
@@ -129,6 +129,10 @@
       type: Boolean,
       default: true
     },
+    showPositionCursor:{
+      type: Boolean,
+      default: false,
+    },
     countObject: {
       type: Object,
       default: () => {
@@ -147,6 +151,9 @@
     return {}
   },
   methods: {
+    positionReport(){
+      this.$emit("positionReport")
+    },
     // 杩涘嚭
     inOutBoundClick() {
       this.$emit("inOutBoundClick")
diff --git a/src/views/productManage/reorderRules/index.vue b/src/views/productManage/reorderRules/index.vue
index 57d32fa..c233acd 100644
--- a/src/views/productManage/reorderRules/index.vue
+++ b/src/views/productManage/reorderRules/index.vue
@@ -134,7 +134,7 @@
             }
             return {
               ...item,
-              productName: item.product.name,
+              productName: { label: item.product.name, value: item.product.id },
               locationName: item.location.name,
               isSet: false,
               isEdit: true,
diff --git a/src/views/reportForm/locationReport/index.vue b/src/views/reportForm/locationReport/index.vue
index 6efd9ed..fd09e6c 100644
--- a/src/views/reportForm/locationReport/index.vue
+++ b/src/views/reportForm/locationReport/index.vue
@@ -106,7 +106,8 @@
       },
       productId: this.$route.params.id,
       productName: this.$route.params.name,
-      metaTitle: this.$route.meta.title
+      metaTitle: this.$route.meta.title,
+      keyWord:''
     }
   },
   created() {
@@ -218,20 +219,22 @@
         pageSize: this.pagerOptions.pageSize
       })
       }else{
-        this.getLocationData({
+        let params={
           page: this.pagerOptions.currPage,
-          pageSize: this.pagerOptions.pageSize
-        })
+          pageSize: this.pagerOptions.pageSize,
+          keyWord:this.keyWord,
+        }
+        if(this.$route.params.positionId){
+          params.positionId=this.$route.params.positionId
+        }
+        this.getLocationData(params)
       }
     },
 
     // 鎼滅储
     getList(val) {
-      this.getLocationData({
-        page: 1,
-        pageSize: this.pagerOptions.pageSize,
-        keyWord: val
-      })
+      this.keyWord=val
+      this.getData()
     },
     // 琛岀偣鍑�
     tableRowClick(row) {
diff --git a/src/views/warehouseManage/position/AddDialog.vue b/src/views/warehouseManage/position/AddDialog.vue
index dba6cb2..30cdb4f 100644
--- a/src/views/warehouseManage/position/AddDialog.vue
+++ b/src/views/warehouseManage/position/AddDialog.vue
@@ -32,7 +32,7 @@
         size="mini"
       >
         <div class="content-number-bg">
-          <FormBtnsView :showPosition="true" :showWarehouse="false" @productClick="productClick" />
+          <FormBtnsView :showPosition="true" :showPositionCursor="this.editConfig.title != '鏂板缓'?true:false" @positionReport="positionReport" :showWarehouse="false" @productClick="productClick" />
         </div>
         <div class="basic-info">
           <div class="basic-info-view">
@@ -241,6 +241,17 @@
         callback()
       }
     },
+    // 褰撳墠搴撳瓨
+    positionReport(){
+      if(this.editConfig.title != '鏂板缓'){
+        this.$router.push({
+          name: "locationReport",
+          params: {
+            positionId: this.editConfig.infomation.id
+          }
+        })
+      }
+    },
     // 璺嚎
     productClick() {},
     // 璁剧疆鍒犻櫎/鎵撳嵃/缂栬緫鏄惁鏄剧ず
diff --git a/src/views/warehouseManage/position/index.vue b/src/views/warehouseManage/position/index.vue
index b1bc80c..773ef77 100644
--- a/src/views/warehouseManage/position/index.vue
+++ b/src/views/warehouseManage/position/index.vue
@@ -124,12 +124,13 @@
     },
     // 璇锋眰鏁版嵁
     async getData() {
-      await getLocationList({
+      let params={
         type: this.type,
         keyword: this.keyword,
         page: this.pagerOptions.currPage,
-        pageSize: this.pagerOptions.pageSize
-      }).then((res) => {
+        pageSize: this.pagerOptions.pageSize,
+      }
+      await getLocationList(params).then((res) => {
         if (res.code === 200) {
           const list = res.data ? res.data : []
           this.tableList.tableInfomation = list

--
Gitblit v1.8.0