From 191c8a8cfbf22395ad8256dc41538a46ce7af94c Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 04 一月 2024 18:46:02 +0800
Subject: [PATCH] 销售 报价单目前是查询的对应的客户下的报价单,没有依赖于销售机会,修改为报价单依赖于选择的销售机会的查询

---
 src/components/makepager/TableCommonView.vue           |    1 +
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue |   15 +++++++++++----
 src/views/other/commonDialog/SelectCommonDialog.vue    |   17 +++++++++++++++++
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue
index 9cf911e..584763a 100644
--- a/src/components/makepager/TableCommonView.vue
+++ b/src/components/makepager/TableCommonView.vue
@@ -7,6 +7,7 @@
       :data="tableList.tableInfomation"
       tooltip-effect="dark"
       :height="'calc(100% - 0px)'"
+      :max-height="tableList.maxHeight"
       style="width: 100%"
       :lazy="tableList.lazy"
       :show-summary="showSummary.show"
diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue
index 4da1e9c..2a0acf5 100644
--- a/src/views/other/commonDialog/SelectCommonDialog.vue
+++ b/src/views/other/commonDialog/SelectCommonDialog.vue
@@ -29,6 +29,7 @@
           </div>
         </div>
         <TableCommonView
+        class="bg-list"
           ref="tableListRef"
           :table-list="tableList"
           :select-box="editCommonConfig.isSelectBox"
@@ -74,6 +75,7 @@
           isSelectBox:false,
           title: "",
           clientId: 0,
+          isRequest:true,
           client_name: "",
           tableInfomation: []
         }
@@ -175,6 +177,7 @@
         this.showCol = ["鎶ヤ环鍗曞彿", "閿�鍞礋璐d汉"]
         this.tableList = {
           selectIndex: true,
+
           tableInfomation: [],
           allcol: [],
           showcol: this.showCol,
@@ -347,6 +350,16 @@
     },
     // 鎶ヤ环鍗�
     async getQuotationList() {
+      if(!this.editConfig.isRequest){
+        this.tableList.tableInfomation =this.editConfig.tableInfomation.map((item) => {
+              return {
+                ...item,
+                member_name: item.member.username
+              }
+            })
+        this.pagerOptions.totalCount =this.editConfig.count?this.editConfig.count:0
+        return true;
+      }
       await getQuotationList({
         search_map: this.search_map,
         page: this.pagerOptions.currPage,
@@ -552,6 +565,9 @@
 <style lang="scss" scoped>
 .bg-view {
   margin: 10px;
+  .bg-list{
+    min-height:370px;
+    }
   .query-bg {
     margin-left: -20px;
     margin-bottom: 10px;
@@ -563,6 +579,7 @@
         width: 100px;
       }
     }
+   
     .btn {
       float: right;
     }
diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index c7fa8a6..e4e0366 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -107,7 +107,7 @@
                       :disabled="isNameChanceEdit || isView"
                     ></el-autocomplete>
                     <div
-                      v-if="!isNameChanceEdit && !isView"
+                      v-if="!isNameChanceEdit && !isView&&editConfig.infomation.client_name"
                       class="common-select-btn"
                       @click="selClientClick('chance')"
                     >
@@ -178,7 +178,7 @@
                       :disabled="isAddQuatation || isView"
                     ></el-autocomplete>
                     <div
-                      v-if="!isAddQuatation && !isView"
+                      v-if="!isAddQuatation && !isView&&editConfig.infomation.sale_chance_name"
                       class="common-select-btn"
                       @click="selClientClick('quotation')"
                     >
@@ -787,6 +787,7 @@
         if (res.code == 200) {
           console.log(res)
           this.quotationList = res.data.list
+          this.count=res.data.count;
           if (value === "鍏ㄩ儴浜у搧") {
             // this.quotationList.map((item) => {
               // if (item.id === this.editConfig.infomation.quotationId) {
@@ -814,11 +815,15 @@
         restaurants = this.clientList
         console.log(restaurants, "瀹㈡埛鍗�")
       } else if (value === "chance") {
-        restaurants = this.saleChancelist
+        if(this.editConfig.infomation.client_name){
+          restaurants = this.saleChancelist
+        }
       } else if (value === "subbill") {
         restaurants = this.subOrderList
       } else if (value === "quotation") {
-        restaurants = this.quotationList
+        if(this.editConfig.infomation.sale_chance_name){
+          restaurants = this.quotationList
+        }
       }
       var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants
       cb(results)
@@ -896,6 +901,8 @@
         this.editSelCommonConfig.title = "鎶ヤ环鍗�"
         this.editSelCommonConfig.editVisible = true
         this.editSelCommonConfig.clientId = this.clientId
+        this.editSelCommonConfig.isRequest = false
+        this.editSelCommonConfig.count=this.count
         this.editSelCommonConfig.tableInfomation = [...this.quotationList]
       }
     },

--
Gitblit v1.8.0