From 06611cb899ed5e32479585d175b8011a90bc675f Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 16 十月 2023 12:42:49 +0800
Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/crm-web into wn

---
 src/store/modules/getClientName.js                             |   17 +
 src/components/layout/components/appHeader/index.vue           |   18 
 src/views/client/followupRecords/AddFollowupRecordsDialog.vue  |  100 ++++++---
 src/api/common/payment.js                                      |   44 +++
 src/components/makepager/CommonFormTableView.vue               |    8 
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue         |   12 +
 src/views/other/commonDialog/SelectCommonDialog.vue            |   12 
 src/views/sales/salesReturn/AddSalesReturnDialog.vue           |   35 ++-
 src/views/sales/refundForm/AddRefundFormDialog.vue             |   15 +
 src/views/service/clientServiceOrder/mixin/codeMixin.js        |   13 
 src/api/common/address.js                                      |    9 
 src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue |   39 +++
 src/api/common/standard.js                                     |    9 
 src/views/sales/quotation/AddQuotationDialog.vue               |   28 ++
 src/views/client/followupRecords/index.vue                     |    2 
 src/views/sales/quotation/DetailQuotation.vue                  |   50 ++--
 src/api/common/other.js                                        |   16 +
 src/views/sales/subOrder/AddSubOrderDialog.vue                 |   42 +++
 src/views/sales/contractManage/AddContractManageDialog.vue     |   57 ++++-
 src/views/client/followupRecords/mixin/codeMixin.js            |   13 
 src/views/sales/quotation/index.vue                            |    8 
 21 files changed, 380 insertions(+), 167 deletions(-)

diff --git a/src/api/common/address.js b/src/api/common/address.js
index 1a22d46..66e2460 100644
--- a/src/api/common/address.js
+++ b/src/api/common/address.js
@@ -1,9 +1,16 @@
 // import request from "@/common/untils/request.js"
 import axios from "axios"
+import request from "@/common/untils/request";
 
 // 鑾峰彇鍩庡競鍒楄〃
 export const getCityList = async (data) => {
-  return await axios.get(`/api/city/list`, {
+  return await request({
+    url: "/api/city/list",
+    method: "get",
     params: data
   })
+  //
+  // return await axios.get(`/api/city/list`, {
+  //   params: data
+  // })
 }
diff --git a/src/api/common/other.js b/src/api/common/other.js
index a909ab6..475a982 100644
--- a/src/api/common/other.js
+++ b/src/api/common/other.js
@@ -50,16 +50,28 @@
 }
 // 鑾峰彇浜у搧鍒楄〃
 export const getProductList = async (data) => {
-  return await axios.get(`/api/product/list`, {
+  return await request({
+    url: "/api/product/list",
+    method: "get",
     params: data
   })
+
+  // return await axios.get(`/api/product/list`, {
+  //   params: data
+  // })
 }
 
 // 鑾峰彇甯歌闂鍒楄〃
 export const getFaqList = async (data) => {
-  return await axios.get(`/api/faq/list`, {
+  return await request({
+    url: "/api/faq/list",
+    method: "get",
     params: data
   })
+
+  // return await axios.get(`/api/faq/list`, {
+  //   params: data
+  // })
 }
 
 // 鍒嗛厤
diff --git a/src/api/common/payment.js b/src/api/common/payment.js
index 0988731..e81d8e1 100644
--- a/src/api/common/payment.js
+++ b/src/api/common/payment.js
@@ -37,9 +37,15 @@
 
 // 鑾峰彇鏀舵鍗�
 export const getReceiptList = async (data) => {
-  return await axios.get(`/api/receipt/list`, {
+  return await request({
+    url: "/api/receipt/list",
+    method: "get",
     params: data
   })
+
+  // return await axios.get(`/api/receipt/list`, {
+  //   params: data
+  // })
 }
 // 娣诲姞鏀舵鍗�
 export function addReceipt(data) {
@@ -100,35 +106,61 @@
 
 // 鑾峰彇閾惰璐︽埛鍒楄〃
 export const getBankAccountList = async (data) => {
-  return await axios.get(`/api/bankAccount/list`, {
+  return await request({
+    url: "/api/bankAccount/list",
+    method: "get",
     params: data
   })
+  //
+  // return await axios.get(`/api/bankAccount/list`, {
+  //   params: data
+  // })
 }
 
 // 鑾峰彇鏀粯鏂瑰紡鍒楄〃
 export const getPaymentTypeList = async (data) => {
-  return await axios.get(`/api/paymentType/list`, {
+  return await request({
+    url: "/api/paymentType/list",
+    method: "get",
     params: data
   })
+  // return await axios.get(`/api/paymentType/list`, {
+  //   params: data
+  // })
 }
 
 // 鑾峰彇鍙戠エ绫诲埆鍒楄〃
 export const getInvoiceTypeList = async (data) => {
-  return await axios.get(`/api/invoiceType/list`, {
+  return await request({
+    url: "/api/invoiceType/list",
+    method: "get",
     params: data
   })
+  // return await axios.get(`/api/invoiceType/list`, {
+  //   params: data
+  // })
 }
 
 // 绁ㄦ嵁鐘舵�佸垪琛�
 export const getInvoiceStatusList = async (data) => {
-  return await axios.get(`/api/invoiceStatus/list`, {
+  return await request({
+    url: "/api/invoiceStatus/list",
+    method: "get",
     params: data
   })
+  // return await axios.get(`/api/invoiceStatus/list`, {
+  //   params: data
+  // })
 }
 
 // 鐗╃悊鍏徃鍒楄〃
 export const getCourierCompanyList = async (data) => {
-  return await axios.get(`/api/courierCompany/list`, {
+  return await request({
+    url: "/api/courierCompany/list",
+    method: "get",
     params: data
   })
+  // return await axios.get(`/api/courierCompany/list`, {
+  //   params: data
+  // })
 }
diff --git a/src/api/common/standard.js b/src/api/common/standard.js
index f46e844..2dc9003 100644
--- a/src/api/common/standard.js
+++ b/src/api/common/standard.js
@@ -1,5 +1,6 @@
 // import request from "@/common/untils/request.js"
 import axios from "axios"
+import request from "@/common/untils/request";
 //缂栫爜瑙勮寖鍒楄〃
 // export function getCodeStandardList  (data)  {
 //   return request({
@@ -9,7 +10,13 @@
 //   });
 // }
 export function getCodeStandardList(data) {
-  return  axios.get(`/api/code/getCodeList`, {
+  // return  axios.get(`/api/code/getCodeList`, {
+  //   params: data
+  // })
+
+  return request({
+    url: "/api/code/getCodeList",
+    method: "get",
     params: data
   })
 }
diff --git a/src/components/layout/components/appHeader/index.vue b/src/components/layout/components/appHeader/index.vue
index 5427586..07c8b04 100644
--- a/src/components/layout/components/appHeader/index.vue
+++ b/src/components/layout/components/appHeader/index.vue
@@ -1,15 +1,15 @@
 <template>
   <div class="sales-lead">
     <div class="header-title">{{ headerTitle }}</div>
-    <div class="header-user-info">
-      <div class="avatar"><el-avatar icon="el-icon-user-solid"></el-avatar></div>
-      <el-dropdown @command="handleCommand">
-        <div class="el-dropdown-link">鐢ㄦ埛鍚�<i class="el-icon-arrow-down el-icon--right"></i></div>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item command="logout">閫�鍑�</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
-    </div>
+<!--    <div class="header-user-info">-->
+<!--      <div class="avatar"><el-avatar icon="el-icon-user-solid"></el-avatar></div>-->
+<!--      <el-dropdown @command="handleCommand">-->
+<!--        <div class="el-dropdown-link">鐢ㄦ埛鍚�<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i></div>-->
+<!--        <el-dropdown-menu slot="dropdown">-->
+<!--          <el-dropdown-item command="logout">閫�鍑�</el-dropdown-item>-->
+<!--        </el-dropdown-menu>-->
+<!--      </el-dropdown>-->
+<!--    </div>-->
   </div>
 </template>
 
diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 35e69fb..fbdc6fe 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -229,10 +229,10 @@
         page: 1,
         pageSize: 5
       }).then((res) => {
-        console.log(res.data)
-        if (res.data.code === 200) {
-          if (res.data.data.data && res.data.data.data.length > 0) {
-            this.productList = res.data.data.data
+        console.log(res,"浜у搧鍚嶇О")
+        if (res.code === 200) {
+          if (res.data.data && res.data.data.length > 0) {
+            this.productList = res.data.data
           }
         }
       })
diff --git a/src/store/modules/getClientName.js b/src/store/modules/getClientName.js
index c53f358..194f2b0 100644
--- a/src/store/modules/getClientName.js
+++ b/src/store/modules/getClientName.js
@@ -84,7 +84,7 @@
         }
       })
     },
-    getContactFilter({commit},newData){
+    getContactFilter({ commit }, newData) {
       commit("contactNameList", newData)
     },
     geChance(context) {
@@ -95,6 +95,9 @@
           Message.error(res.msg)
         }
       })
+    },
+    getChanceFilter({commit},newData){
+      commit("saleChancelist",newData)
     },
     geLead(context) {
       getSalesLeadsList().then((res) => {
@@ -141,6 +144,9 @@
         }
       })
     },
+    getSalesDetailsFliter({commit},newData){
+      commit("salesDetailsList", newData)
+    },
     geQuotation(context) {
       getQuotationList().then((res) => {
         if (res.code == 200) {
@@ -161,9 +167,9 @@
     },
     geProductList(context) {
       getProductList({ productName: "", productNumber: "", page: 1, pageSize: 10 }).then((res) => {
-        if (res.data.code == 200) {
-          console.log(res.data.data.data)
-          context.commit("productList", res.data.data.data)
+        if (res.code == 200) {
+          console.log(res.data.data)
+          context.commit("productList", res.data.data)
         } else {
           Message.error(res.msg)
         }
@@ -178,6 +184,9 @@
           Message.error(res.msg)
         }
       })
+    },
+    getReturnListFliter({commit},newData){
+      commit("salesReturnList",newData)
     }
   }
 }
diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
index 3ee7e0d..1ca59b2 100644
--- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
+++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
@@ -25,21 +25,17 @@
               <el-col :span="12" v-if="isUnflod">
                 <el-form-item label="璺熻繘璁板綍缂栧彿" prop="number">
                   <WordInput
-                    v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0"
+                    v-if="codenumer && (explain != '' || isIdDisabled) && method == 0"
                     :codenumer="codenumer"
                     :sum="sum"
-                    :disabled="this.editConfig.title !== '鏂板缓'  || isIdDisabled"
+                    :disabled="this.editConfig.title !== '鏂板缓' || isIdDisabled"
                     :inputValue="inputValue"
                     @codeList="codeList"
                   />
                   <span v-else-if="method == 0" style="color: #f56c6c"
-                    >璇蜂紭鍏堥厤缃紪鐮佽鑼�
-                    <el-button type="text"  @click="numberClick">
-                        閰嶇疆瑙勮寖
-                      </el-button
-                    ></span
+                    >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
                   >
-                  <span  v-else>鑷姩鐢熸垚</span>
+                  <span v-else>鑷姩鐢熸垚</span>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
@@ -163,12 +159,18 @@
                       value-key="name"
                       @select="handleSelectClient('chance', $event)"
                       style="width: 100%"
+                      placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О"
+                      :disabled="isChance"
                     ></el-autocomplete>
-                    <div class="common-select-btn" @click="selClientClick('chance')">
+                    <div v-if="!isChance" class="common-select-btn" @click="selClientClick('chance')">
                       <i class="el-icon-circle-plus-outline"></i>
                     </div>
                     <div
-                      v-if="editConfig.infomation.sale_chance_name && editConfig.infomation.sale_chance_name.length > 0"
+                      v-if="
+                        editConfig.infomation.sale_chance_name &&
+                        editConfig.infomation.sale_chance_name.length > 0 &&
+                        !isChance
+                      "
                       class="common-select-btn"
                       @click="clearupClient('chance')"
                     >
@@ -339,9 +341,10 @@
 import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"
 import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
 import SelectLeadDialog from "@/views/other/commonDialog/SelectLeadDialog"
-import codeMixin from "./mixin/codeMixin";
-import { getContactList } from "@/api/client/contacts"
-import { mapActions  } from 'vuex';
+import codeMixin from "./mixin/codeMixin"
+// import { getContactList } from "@/api/client/contacts"
+import { mapActions } from "vuex"
+import { getSaleChanceList } from "@/api/sales/salesOpportunity"
 
 export default {
   name: "AddFollowupRecordsDialog",
@@ -369,9 +372,9 @@
     contactNamelist() {
       return this.$store.state.getClientName.contactNamelist
     },
-    saleChancelist() {
-      return this.$store.state.getClientName.saleChancelist
-    },
+    // saleChancelist() {
+    //   return this.$store.state.getClientName.saleChancelist
+    // },
     saleLeadlist() {
       return this.$store.state.getClientName.saleLeadlist
     }
@@ -384,8 +387,9 @@
         number: [{ required: true, message: "璇疯緭鍏ヨ窡杩涜褰曠紪鍙�", trigger: "blur" }],
         member_id: [{ required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }],
         record: [{ required: true, message: "璇疯緭鍏ヨ窡杩涜褰�", trigger: "blur" }],
-        client_name:[{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
-        topic:[{ required: true, message: "璇疯緭鍏ヤ富棰�", trigger: "blur" }],
+        client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
+        contact_name: [{ required: true, message: "璇烽�夋嫨鑱旂郴浜哄鍚�", trigger: "change" }],
+        topic: [{ required: true, message: "璇疯緭鍏ヤ富棰�", trigger: "blur" }],
         // content: [{ required: true, message: "璇疯緭鍏ュ唴瀹�", trigger: "blur" }],
         phoneNumber: [
           { required: false, message: "", trigger: "blur" },
@@ -431,37 +435,39 @@
       contactId: this.editContactsConfig.infomation.contact_id,
       saleChanceId: this.editContactsConfig.infomation.sale_chance_id,
       saleLeadId: this.editContactsConfig.infomation.sales_leads_id,
+      saleChancelist: [],
+      isChance: true
     }
   },
   created() {
     this.$store.dispatch("geClient")
     this.$store.dispatch("geContact")
-    this.$store.dispatch("geChance")
+    // this.$store.dispatch("geChance")
     this.$store.dispatch("geLead")
     this.getCommonData()
     this.getContactInfoList()
-    this.formInfo();
+    this.formInfo()
   },
-  watch:{
-    'editContactsConfig.visible'(val){
-      if(val){
+  watch: {
+    "editContactsConfig.visible"(val) {
+      if (val) {
         this.formInfo()
       }
     },
-    'editContactsConfig.infomation.codeStandID'(){
+    "editContactsConfig.infomation.codeStandID"() {
       this.formInfo()
     }
   },
   methods: {
-    ...mapActions (['getContactFilter']),
-    formInfo(){
-      this.objCode.type='璺熻繘璁板綍缂栫爜'
-      this.objCode.codeStandID = ''
-      if(this.editConfig.infomation.codeStandID){
-        this.objCode.codeStandID = this.editConfig.infomation.codeStandID;
+    ...mapActions(["getContactFilter"]),
+    formInfo() {
+      this.objCode.type = "璺熻繘璁板綍缂栫爜"
+      this.objCode.codeStandID = ""
+      if (this.editConfig.infomation.codeStandID) {
+        this.objCode.codeStandID = this.editConfig.infomation.codeStandID
       }
-      this.getRCodeStandardList();
-    }, 
+      this.getRCodeStandardList()
+    },
     getCommonData() {
       getAllData().then((res) => {
         console.log(res)
@@ -538,8 +544,8 @@
           sale_chance_id: this.saleChanceId || 0,
           sales_leads_id: this.saleLeadId || 0,
           topic: data.topic || "",
-          codeStandID:data.ID,
-          codeRule:this.codeRule,
+          codeStandID: data.ID,
+          codeRule: this.codeRule
         }
       }
       let params = {}
@@ -549,6 +555,20 @@
         params = { ...follow_record, id: data.id || 0 }
       }
       return params
+    },
+    // 鑾峰彇閿�鍞満浼�
+    getChanceList(id) {
+      getSaleChanceList({
+        page: 0,
+        pageSize: 0,
+        search_map: {
+          client_id: id
+        }
+      }).then((res) => {
+        if (res.code == 200) {
+          this.saleChancelist = res.data.list
+        }
+      })
     },
     // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶
     querySearchAsync(queryString, cb, value) {
@@ -574,11 +594,8 @@
       if (value === "client") {
         this.clientId = item.id
         this.editConfig.infomation.client_name = item.name
-        await getContactList({
-          clientId:this.clientId
-        }).then((res)=>{
-          this.getContactFilter(res.data.list)
-        })
+        this.isChance = false
+        this.getChanceList(item.id)
         // console.log("clientId",this.clientId,this.editConfig.infomation.client_name)
       } else if (value === "contact") {
         this.contactId = item.id
@@ -609,6 +626,8 @@
       } else if (value === "client") {
         this.editConfig.infomation.client_name = row.name
         this.clientId = row.id
+        this.isChance = false
+        this.getChanceList(row.id)
       } else if (value === "chance") {
         this.editConfig.infomation.sale_chance_name = row.name
         this.saleChanceId = row.id
@@ -622,6 +641,9 @@
       if (value === "client") {
         this.editConfig.infomation.client_name = ""
         this.clientId = 0
+        this.isChance = true
+        this.editConfig.infomation.sale_chance_name = ""
+        this.saleChanceId = 0
       } else if (value === "contact") {
         this.editConfig.infomation.contact_name = ""
         this.contactId = 0
diff --git a/src/views/client/followupRecords/index.vue b/src/views/client/followupRecords/index.vue
index 0e14e4a..72a09e5 100644
--- a/src/views/client/followupRecords/index.vue
+++ b/src/views/client/followupRecords/index.vue
@@ -249,7 +249,7 @@
     },
     // 鎼滅储
     onFilterSearch(searchText) {
-      this.search_map.name = searchText ?? ""
+      this.search_map.client_name = searchText ?? ""
       this.pagerOptions.currPage = 1
       this.getData()
     },
diff --git a/src/views/client/followupRecords/mixin/codeMixin.js b/src/views/client/followupRecords/mixin/codeMixin.js
index 70bac5d..a370e3b 100644
--- a/src/views/client/followupRecords/mixin/codeMixin.js
+++ b/src/views/client/followupRecords/mixin/codeMixin.js
@@ -27,20 +27,15 @@
         this.codenumer = []
         this.sum = 0
         this.explain = ""
-        if (res.data.code == 200) {
-          const {
-            List = [],
-            ID,
-            AutoRule = {},
-            Method
-          } = res.data.data && res.data.data.data ? res.data.data.data[0] : []
-          this.codeRule = res.data.data && res.data.data.data ? res.data.data.data[0] : {}
+        if (res.code == 200) {
+          const { List = [], ID, AutoRule = {}, Method } = res.data && res.data.data ? res.data.data[0] : []
+          this.codeRule = res.data && res.data.data ? res.data.data[0] : {}
           let autoRule = AutoRule
           let method = Method ? Method : 0
           this.method = method
           let rules = List
           this.editConfig.infomation.ID = ID
-          if (method == 0 && res.data.data.data.length > 0) {
+          if (method == 0 && res.data.data.length > 0) {
             console.log("sss")
             rules.forEach((item, index) => {
               // setTimeout(() => {
diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue
index 0f44348..4ea3c14 100644
--- a/src/views/other/commonDialog/SelectCommonDialog.vue
+++ b/src/views/other/commonDialog/SelectCommonDialog.vue
@@ -66,6 +66,7 @@
         return {
           editVisible: false,
           title: "",
+          clientId: 0,
           tableInfomation: []
         }
       }
@@ -93,6 +94,9 @@
     }
   },
   created() {
+    this.search_map = {
+      client_id: this.editConfig.clientId
+    }
     this.setTable()
     this.getData()
   },
@@ -391,15 +395,15 @@
         pageSize: this.pagerOptions.pageSize
       }).then((res) => {
         console.log(res.data)
-        if (res.data.code === 200) {
-          if (res.data.data.data && res.data.data.data.length > 0) {
-            const list = res.data.data.data.map((item) => {
+        if (res.code === 200) {
+          if (res.data.data && res.data.data.length > 0) {
+            const list = res.data.data.map((item) => {
               return {
                 ...item
               }
             })
             this.tableList.tableInfomation = list || []
-            this.pagerOptions.totalCount = res.data.data.count
+            this.pagerOptions.totalCount = res.data.count
           } else {
             this.tableList.tableInfomation = []
           }
diff --git a/src/views/sales/contractManage/AddContractManageDialog.vue b/src/views/sales/contractManage/AddContractManageDialog.vue
index 712268d..e7b2623 100644
--- a/src/views/sales/contractManage/AddContractManageDialog.vue
+++ b/src/views/sales/contractManage/AddContractManageDialog.vue
@@ -38,11 +38,9 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="鍚堝悓鍚嶇О" prop="name">
+                <el-form-item label="鍚堝悓鍚嶇О" prop="contractName">
                   <div class="custom-name">
-                    <el-input v-model="editConfig.infomation.name"></el-input>
-                    <!-- <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> -->
-                    <!-- <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> -->
+                    <el-input v-model="editConfig.infomation.contractName"></el-input>
                   </div>
                 </el-form-item>
               </el-col>
@@ -116,12 +114,18 @@
                       value-key="number"
                       @select="handleSelectClient('quotation', $event)"
                       style="width: 100%"
+                      placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О"
+                      :disabled="isAddQuatation"
                     ></el-autocomplete>
-                    <div class="common-select-btn" @click="selClientClick('quotation')">
+                    <div v-if="!isAddQuatation" class="common-select-btn" @click="selClientClick('quotation')">
                       <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                     </div>
                     <div
-                      v-if="editConfig.infomation.quotation_number && editConfig.infomation.quotation_number.length > 0"
+                      v-if="
+                        editConfig.infomation.quotation_number &&
+                        editConfig.infomation.quotation_number.length > 0 &&
+                        !isAddQuatation
+                      "
                       class="common-select-btn"
                       @click="clearupClient('quotation')"
                     >
@@ -233,6 +237,7 @@
 import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
 import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
 import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getQuotationList } from "@/api/sales/quotation"
 export default {
   name: "AddContractManageDialog",
   mixins: [codeMixin],
@@ -252,10 +257,10 @@
   computed: {
     clientList() {
       return this.$store.state.getClientName.clientList
-    },
-    quotationList() {
-      return this.$store.state.getClientName.quotationList
     }
+    // quotationList() {
+    //   return this.$store.state.getClientName.quotationList
+    // }
   },
   data() {
     return {
@@ -264,7 +269,8 @@
       rules: {
         number: [{ required: true, validator: this.checkCode, trigger: "blur" }],
         client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
-        member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }]
+        member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+        contractName: [{ required: true, message: "璇疯緭鍏ュ悎鍚屽悕绉�", trigger: "blur" }]
       },
       memberOptions: [],
       statusOptions: [], // 鍚堝悓鐘舵��
@@ -282,12 +288,14 @@
         infomation: {}
       },
       clientId: this.editCommonConfig.infomation.clientId,
-      quotationId: this.editCommonConfig.infomation.quotationId
+      quotationId: this.editCommonConfig.infomation.quotationId,
+      isAddQuatation: true,
+      quotationList: []
     }
   },
   created() {
     this.$store.dispatch("geClient")
-    this.$store.dispatch("geQuotation")
+    // this.$store.dispatch("geQuotation")
     this.getCommonData()
     this.formInfo()
   },
@@ -357,7 +365,7 @@
       console.log(data)
       let params = {
         id: this.editConfig.title === "鏂板缓" ? 0 : data.id,
-        name: data.name || "",
+        contractName: data.contractName || "",
         client_id: this.clientId || 0,
         file: "",
         member_id: data.memberId || 0,
@@ -371,6 +379,21 @@
     },
     handleClose() {
       this.editConfig.visible = false
+    },
+    // 鑾峰彇鎶ヤ环鍗�
+    getQuotation(id) {
+      getQuotationList({
+        page: 0,
+        pageSize: 0,
+        search_map: {
+          client_id: id
+        }
+      }).then((res) => {
+        if (res.code == 200) {
+          console.log(res)
+          this.quotationList = res.data.list
+        }
+      })
     },
     // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶
     querySearchAsync(queryString, cb, value) {
@@ -397,6 +420,8 @@
       if (value === "client") {
         this.editConfig.infomation.client_name = item.name
         this.clientId = item.id
+        this.isAddQuatation = false
+        this.getQuotation(item.id)
       } else if (value === "quotation") {
         this.editConfig.infomation.quotation_number = item.number
         this.quotationId = item.id
@@ -418,6 +443,8 @@
       if (value === "client") {
         this.editConfig.infomation.client_name = row.name
         this.clientId = row.id
+        this.isAddQuatation = false
+        this.getQuotation(row.id)
       } else if (value === "quotation") {
         this.editConfig.infomation.quotation_number = row.number
         this.quotationId = row.id
@@ -427,9 +454,11 @@
     clearupClient(value) {
       console.log(value)
       if (value === "client") {
-        console.log("ss88888")
         this.editConfig.infomation.client_name = ""
         this.clientId = 0
+        this.isAddQuatation = true
+        this.editConfig.infomation.quotation_number = ""
+        this.quotationId = 0
       } else if (value === "quotation") {
         this.editConfig.infomation.quotation_number = ""
         this.quotationId = 0
diff --git a/src/views/sales/quotation/AddQuotationDialog.vue b/src/views/sales/quotation/AddQuotationDialog.vue
index d186f73..deb0a8d 100644
--- a/src/views/sales/quotation/AddQuotationDialog.vue
+++ b/src/views/sales/quotation/AddQuotationDialog.vue
@@ -40,8 +40,14 @@
                   <span v-else>{{ editConfig.title === "鏂板缓" ? "鑷姩鐢熸垚" : editConfig.infomation.number }}</span>
                 </el-form-item>
               </el-col>
-
               <el-col :span="12">
+                <el-form-item label="鎶ヤ环鍚嶇О" prop="quotationName">
+                  <div class="custom-name">
+                    <el-input v-model="editConfig.infomation.quotationName"></el-input>
+                  </div>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="12">
                 <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name">
                   <div class="custom-name">
                     <el-autocomplete
@@ -66,7 +72,7 @@
                     </div>
                   </div>
                 </el-form-item>
-              </el-col>
+              </el-col> -->
               <!--              <el-col :span="12">-->
               <!--                <el-form-item label="鎶ヤ环缂栧彿" prop="number">-->
               <!--                  <el-input v-model="editConfig.infomation.number"></el-input>-->
@@ -106,7 +112,7 @@
                   </el-date-picker>
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
+              <!-- <el-col :span="12">
                 <el-form-item label="鑱旂郴浜哄鍚�" prop="contact_id">
                   <div class="custom-name">
                     <el-autocomplete
@@ -131,7 +137,7 @@
                     </div>
                   </div>
                 </el-form-item>
-              </el-col>
+              </el-col> -->
               <el-col :span="12">
                 <el-form-item label="閿�鍞礋璐d汉" prop="member_id">
                   <el-select
@@ -349,10 +355,9 @@
       dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
-        client_id: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
         number: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
         quotation_status_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
-        sale_chance_name: [{ required: true, message: "璇烽�夋嫨閿�鍞満浼�", trigger: "blur" }],
+        sale_chance_name: [{ required: true, validator: this.checkChance, trigger: "blur" }],
         member_id: [{ required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }]
       },
       memberOptions: [],
@@ -490,9 +495,8 @@
       let data = this.editConfig.infomation
       let params = {
         id: this.editConfig.title === "鏂板缓" ? 0 : data.id,
-        client_id: this.clientId || 0,
+        quotationName: data.quotationName || "",
         conditions: data.conditions || "",
-        contact_id: this.contactId || 0,
         file: data.file || "",
         member_id: data.member_id || 0,
         number: data.number || "",
@@ -655,6 +659,14 @@
     clearupProduct(data) {
       this.tableData = data
       this.productTableList.tableData = this.tableData
+    },
+    // 璁㈠崟缂栫爜鍗曠嫭鏍¢獙
+    checkChance(rule, value, callback) {
+      if (this.editConfig.infomation.sale_chance_name && this.editConfig.infomation.sale_chance_name.length > 0) {
+        callback()
+      } else {
+        callback(new Error("璇烽�夋嫨閿�鍞満浼�"))
+      }
     }
   }
 }
diff --git a/src/views/sales/quotation/DetailQuotation.vue b/src/views/sales/quotation/DetailQuotation.vue
index 5e294ec..4fb9144 100644
--- a/src/views/sales/quotation/DetailQuotation.vue
+++ b/src/views/sales/quotation/DetailQuotation.vue
@@ -51,31 +51,12 @@
                     <div class="content-title">{{ item.leftStr + "锛�" }}</div>
                     <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                   </div>
-                  <div class="right">
+                  <div v-if="item.rightStr.length > 0" class="right">
                     <div class="content-title">{{ item.rightStr + "锛�" }}</div>
                     <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                   </div>
                 </li>
               </ul>
-            </div>
-          </div>
-          <!-- 鏉′欢涓庢潯娆� -->
-          <div class="basic-info">
-            <div class="basic-info-label" @click="expandClick('termsConditions')">
-              <i v-if="isTermsConditionsExpand" class="el-icon-arrow-down"></i>
-              <i v-else class="el-icon-arrow-up"></i>
-              <span style="margin-left: 10px">鏉′欢涓庢潯娆�</span>
-            </div>
-            <div v-show="isTermsConditionsExpand" class="basic-info-content">
-              <div class="termsConditions">
-                <div class="content-title">{{ "鏉′欢涓庢潯娆�" + "锛�" }}</div>
-                <div class="content-termsConditions">
-                  {{ "\n" + detailConfig.infomation.conditions }}
-                  <!-- <ul>
-                    <li v-for="(item, index) in Status.termsConditions" :key="index">{{ item }}</li>
-                  </ul> -->
-                </div>
-              </div>
             </div>
           </div>
           <!-- 闄勪欢淇℃伅 -->
@@ -110,6 +91,25 @@
                 :show-summary="showSummary"
                 :product-table-list="productTableList"
               />
+            </div>
+          </div>
+          <!-- 鏉′欢涓庢潯娆� -->
+          <div class="basic-info">
+            <div class="basic-info-label" @click="expandClick('termsConditions')">
+              <i v-if="isTermsConditionsExpand" class="el-icon-arrow-down"></i>
+              <i v-else class="el-icon-arrow-up"></i>
+              <span style="margin-left: 10px">鏉′欢涓庢潯娆�</span>
+            </div>
+            <div v-show="isTermsConditionsExpand" class="basic-info-content">
+              <div class="termsConditions">
+                <div class="content-title">{{ "鏉′欢涓庢潯娆�" + "锛�" }}</div>
+                <div class="content-termsConditions">
+                  {{ "\n" + detailConfig.infomation.conditions }}
+                  <!-- <ul>
+                    <li v-for="(item, index) in Status.termsConditions" :key="index">{{ item }}</li>
+                  </ul> -->
+                </div>
+              </div>
             </div>
           </div>
           <!-- 瀹℃壒鏃ュ織 -->
@@ -206,8 +206,8 @@
         {
           leftStr: "鎶ヤ环鍗曠姸鎬�",
           leftValue: item.quotation_status.name,
-          rightStr: "鑱旂郴浜哄鍚�",
-          rightValue: item.contact_name
+          rightStr: "閿�鍞満浼�",
+          rightValue: item.sale_chance.name
         },
         {
           leftStr: "鏈夋晥鏈熻嚦",
@@ -216,9 +216,9 @@
           rightValue: item.member.username
         },
         {
-          leftStr: "閿�鍞満浼�",
-          leftValue: item.sale_chance.name,
-          rightStr: "鍒涘缓鏃堕棿",
+          leftStr: "鍒涘缓鏃堕棿",
+          leftValue: "",
+          rightStr: "",
           rightValue: ""
         }
       ]
diff --git a/src/views/sales/quotation/index.vue b/src/views/sales/quotation/index.vue
index 508e0c1..38ae9fc 100644
--- a/src/views/sales/quotation/index.vue
+++ b/src/views/sales/quotation/index.vue
@@ -127,8 +127,8 @@
       },
       tableColumn: [
         { label: "鎶ヤ环鍗曞彿", prop: "number", min: 90, isCommonClick: true, default: true }, // 鎶ヤ环鍗曞彿
-        { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 120, isClientClick: true }, // 瀹㈡埛鍚嶇О
-        { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 90, isContactClick: true }, // 鑱旂郴浜哄鍚�
+        { label: "鎶ヤ环鍗曞悕绉�", prop: "quotationName", min: 120, isClientClick: true }, // 鎶ヤ环鍗曞悕绉�
+        // { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 90, isContactClick: true }, // 鑱旂郴浜哄鍚�
         { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
         { label: "鏈夋晥鏈�", prop: "validity_date", min: 100 }, // 淇敼鏃堕棿
         // { label: "灏忚", prop: "subTotal" }, // 灏忚
@@ -137,7 +137,7 @@
         { label: "鏁伴噺", prop: "productNumber", isProductAmount: true },
         { label: "浠风◣鍚堣", prop: "priceTax", isProductTotal: true }
       ],
-      showCol: ["鎶ヤ环鍗曞彿", "瀹㈡埛鍚嶇О", "鑱旂郴浜哄鍚�", "閿�鍞礋璐d汉", "鏈夋晥鏈�", "浜у搧鍚嶇О", "鏁伴噺", "浠风◣鍚堣"]
+      showCol: ["鎶ヤ环鍗曞彿", "鎶ヤ环鍗曞悕绉�", "鑱旂郴浜哄鍚�", "閿�鍞礋璐d汉", "鏈夋晥鏈�", "浜у搧鍚嶇О", "鏁伴噺", "浠风◣鍚堣"]
     }
   },
   created() {
@@ -233,6 +233,8 @@
       console.log(row)
       this.editConfig.visible = true
       this.editConfig.title = "缂栬緫"
+      console.log("dddddddd")
+      console.log(row)
       this.editConfig.infomation = { ...row, currency: "浜烘皯甯�" }
     },
     // 鎵归噺鍒犻櫎
diff --git a/src/views/sales/refundForm/AddRefundFormDialog.vue b/src/views/sales/refundForm/AddRefundFormDialog.vue
index 4a7f564..61d8fdf 100644
--- a/src/views/sales/refundForm/AddRefundFormDialog.vue
+++ b/src/views/sales/refundForm/AddRefundFormDialog.vue
@@ -314,6 +314,9 @@
 import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
 import { getPaymentTypeList } from "@/api/common/payment"
 import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getSalesReturnList } from "@/api/sales/salesReturn"
+import { mapActions } from 'vuex'; 
+
 export default {
   name: "AddRefundFormDialog",
   mixins: [codeMixin],
@@ -397,7 +400,8 @@
       this.formInfo()
     }
   },
-  methods: {
+  methods: { 
+    ...mapActions(["getReturnListFliter"]),  
     formInfo() {
       this.objCode.type = "閿�鍞��娆剧紪鐮�"
       this.objCode.codeStandID = ""
@@ -508,9 +512,16 @@
         }
       }
     },
-    handleSelectClient(value, item) {
+    async handleSelectClient(value, item) {
       if (value === "client") {
         this.clientId = item.id
+        console.log("瀹㈡埛鍚嶇О",this.clientId,value,item)
+        await getSalesReturnList({
+          clientId:this.clientId
+        }).then((res)=>{
+          this.getReturnListFliter(res.data.list)
+        })
+
       } else if (value === "salesReturn") {
         console.log(item)
         this.editConfig.infomation.sale_return_nunber = item.number
diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index e487891..76b4762 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -385,6 +385,9 @@
 import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
 import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan"
 import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getSaleChanceList} from "@/api/sales/salesOpportunity"
+import {mapActions} from "vuex"
+
 export default {
   name: "AddSalesDetailsDialog",
   mixins: [codeMixin],
@@ -479,6 +482,7 @@
     }
   },
   methods: {
+    ...mapActions(["getChanceFilter"]), 
     formInfo() {
       this.objCode.type = "閿�鍞槑缁嗙紪鐮�"
       this.objCode.codeStandID = ""
@@ -609,10 +613,16 @@
         return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
       }
     },
-    handleSelectClient(value, item) {
+    async handleSelectClient(value, item) {
       if (value === "client") {
         this.clientId = item.id
         this.editConfig.infomation.client_name = item.name
+        // 闇�瑕佷慨鏀�
+        await getSaleChanceList({
+          client_id:this.clientId
+        }).then((res)=>{
+          this.getChanceFilter(res.data.list)
+        })
       } else if (value === "chance") {
         this.saleChanceId = item.id
         this.editConfig.infomation.client_name = item.name
diff --git a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
index 5e5f9aa..5d4ebd6 100644
--- a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
+++ b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -93,12 +93,18 @@
                       "
                       value-key="name"
                       @select="handleSelectClient('contact', $event)"
+                      placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О"
+                      :disabled="isContact"
                     ></el-autocomplete>
-                    <div class="common-select-btn" @click="selClientClick('contact')">
+                    <div v-if="!isContact" class="common-select-btn" @click="selClientClick('contact')">
                       <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                     </div>
                     <div
-                      v-if="editConfig.infomation.contact_name && editConfig.infomation.contact_name.length > 0"
+                      v-if="
+                        editConfig.infomation.contact_name &&
+                        editConfig.infomation.contact_name.length > 0 &&
+                        !isContact
+                      "
                       class="common-select-btn"
                       @click="clearupClient('contact')"
                     >
@@ -572,6 +578,7 @@
 import { getCityList } from "@/api/common/address"
 import WordInput from "@/components/wordInput.vue"
 import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getContactList } from "@/api/client/contacts"
 export default {
   name: "AddSalesOpportunityDialog",
   mixins: [codeMixin],
@@ -594,9 +601,6 @@
     },
     clientList() {
       return this.$store.state.getClientName.clientList
-    },
-    contactNamelist() {
-      return this.$store.state.getClientName.contactNamelist
     }
   },
   data() {
@@ -640,12 +644,13 @@
       restaurants: [],
       clientId: this.editCommonConfig.infomation.client_id,
       contactId: this.editCommonConfig.infomation.contact_id,
-      objCode: { name: "", page: 0, pageSize: 0, type: "閿�鍞満浼氱紪鐮�", codeStandID: "" }
+      objCode: { name: "", page: 0, pageSize: 0, type: "閿�鍞満浼氱紪鐮�", codeStandID: "" },
+      isContact: true,
+      contactNamelist: []
     }
   },
   created() {
     this.$store.dispatch("geClient")
-    this.$store.dispatch("geContact")
     if (this.editConfig.title !== "鏂板缓" && this.editConfig.infomation.province_id !== 0) {
       this.getCityList(this.editConfig.infomation.province_id, "edit")
     }
@@ -777,6 +782,19 @@
       }
       return params
     },
+    // 鑾峰彇鑱旂郴浜哄垪琛�
+    getContactList(id) {
+      getContactList({
+        clientId: id,
+        page: 0,
+        pageSize: 0,
+        search_map: {}
+      }).then((res) => {
+        if (res.code == 200) {
+          this.contactNamelist = res.data.list
+        }
+      })
+    },
     // 閫夋嫨鐢ㄦ埛鐩稿叧鏂规硶
     querySearchAsync(queryString, cb, value) {
       var restaurants = []
@@ -796,6 +814,8 @@
     handleSelectClient(value, item) {
       if (value === "client") {
         this.clientId = item.id
+        this.isContact = false
+        this.getContactList(item.id)
       } else if (value === "contact") {
         this.contactId = item.id
       }
@@ -811,6 +831,8 @@
       if (value === "contact") {
         this.editConfig.infomation.contact_name = row.name
         this.contactId = row.id
+        this.isContact = false
+        this.getContactList(row.id)
       } else if (value === "client") {
         this.editConfig.infomation.client_name = row.name
         this.clientId = row.id
@@ -832,6 +854,9 @@
       if (value === "client") {
         this.editConfig.infomation.client_name = ""
         this.clientId = 0
+        this.isContact = true
+        this.editConfig.infomation.contact_name = ""
+        this.contactId = 0
       } else if (value === "contact") {
         this.editConfig.infomation.contact_name = ""
         this.contactId = 0
diff --git a/src/views/sales/salesReturn/AddSalesReturnDialog.vue b/src/views/sales/salesReturn/AddSalesReturnDialog.vue
index 0b271ca..731a46a 100644
--- a/src/views/sales/salesReturn/AddSalesReturnDialog.vue
+++ b/src/views/sales/salesReturn/AddSalesReturnDialog.vue
@@ -68,7 +68,7 @@
               </el-col>
 
               <el-col :span="12">
-                <el-form-item label="鍚堝悓璁㈠崟">
+                <el-form-item label="閿�鍞槑缁嗗崟">
                   <div class="custom-name">
                     <el-autocomplete
                       style="width: 100%"
@@ -130,8 +130,8 @@
             </el-row>
           </div>
           <!-- 鍔ㄦ�佷俊鎭� -->
-          <div class="basic-info-title">鍔ㄦ�佷俊鎭�</div>
-          <div class="basic-info-view">
+          <!-- <div class="basic-info-title">鍔ㄦ�佷俊鎭�</div> -->
+          <!-- <div class="basic-info-view">
             <el-row>
               <el-col :span="12">
                 <el-form-item label="鐘舵��" prop="salesReturnStatusId">
@@ -145,13 +145,14 @@
                     >
                       <el-option v-for="item in statusOptions" :key="item.id" :label="item.name" :value="item.id">
                       </el-option>
-                    </el-select>
+                    </el-select> -->
                     <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> -->
-                  </div>
+                  <!-- </div>
                 </el-form-item>
               </el-col>
             </el-row>
-          </div>
+          </div> -->
+
           <!-- 澶囨敞淇℃伅 -->
           <div class="basic-info-title">澶囨敞淇℃伅</div>
           <div class="basic-info-view">
@@ -247,6 +248,9 @@
 import { getProductList } from "@/api/common/other"
 import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
 import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getSalesDetailsList } from "@/api/sales/salesDetails"
+import {mapActions} from "vuex"
+
 export default {
   name: "AddSalesReturnDialog",
   mixins: [codeMixin],
@@ -327,6 +331,7 @@
     }
   },
   methods: {
+    ...mapActions(["getSalesDetailsFliter"]), 
     formInfo() {
       this.objCode.type = "閿�鍞��璐х紪鐮�"
       this.objCode.codeStandID = ""
@@ -349,12 +354,12 @@
     // 鑾峰彇浜у搧鍒楄〃
     async getProductList() {
       await getProductList({
-        page: 0,
-        pageSize: 0,
+        page: 1,
+        pageSize: 15,
         productName: "",
-        productNumber: ""
+        productNumber: "",
+        // clientId:"100"
       }).then((res) => {
-        console.log(res)
       })
     },
     // 淇濆瓨
@@ -444,10 +449,18 @@
         }
       }
     },
-    handleSelectClient(value, item) {
+    async handleSelectClient(value, item) {
       if (value === "client") {
         this.clientId = item.id
+        await getSalesDetailsList({
+          clientId:this.clientId
+        }).then((res)=>{
+          this.getSalesDetailsFliter(res.data.list)
+        })
+        
       } else if (value === "contract") {
+        console.log(item,item.number,"閫夋嫨妗�66")
+        this.productTableList.tableData=item.products
         this.SalesDetailsId = item.id
       }
     },
diff --git a/src/views/sales/subOrder/AddSubOrderDialog.vue b/src/views/sales/subOrder/AddSubOrderDialog.vue
index 3acc1ed..d224472 100644
--- a/src/views/sales/subOrder/AddSubOrderDialog.vue
+++ b/src/views/sales/subOrder/AddSubOrderDialog.vue
@@ -78,14 +78,17 @@
                       "
                       value-key="number"
                       @select="handleSelectClient('master', $event)"
+                      placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О"
+                      :disabled="isAddMaster"
                     ></el-autocomplete>
-                    <div class="common-select-btn" @click="selClientClick('master')">
+                    <div v-if="!isAddMaster" class="common-select-btn" @click="selClientClick('master')">
                       <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                     </div>
                     <div
                       v-if="
                         editConfig.infomation.master_order_number &&
-                        editConfig.infomation.master_order_number.length > 0
+                        editConfig.infomation.master_order_number.length > 0 &&
+                        !isAddMaster
                       "
                       class="common-select-btn"
                       @click="clearupClient('master')"
@@ -189,6 +192,7 @@
 import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
 import WordInput from "@/components/wordInput.vue"
 import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getMasterOrderList } from "@/api/sales/masterOrder"
 
 export default {
   name: "SubOrderDialog",
@@ -209,10 +213,10 @@
   computed: {
     clientList() {
       return this.$store.state.getClientName.clientList
-    },
-    masterOrderList() {
-      return this.$store.state.getClientName.masterOrderList
     }
+    // masterOrderList() {
+    //   return this.$store.state.getClientName.masterOrderList
+    // }
   },
   data() {
     return {
@@ -258,12 +262,14 @@
       tableData: [],
       productId: 1,
       addProductArr: [],
-      objCode: { name: "", page: 0, pageSize: 0, type: "閿�鍞瓙鍗曠紪鐮�", codeStandID: "" }
+      objCode: { name: "", page: 0, pageSize: 0, type: "閿�鍞瓙鍗曠紪鐮�", codeStandID: "" },
+      isAddMaster: true,
+      masterOrderList: []
     }
   },
   created() {
     this.$store.dispatch("geClient")
-    this.$store.dispatch("geMaster")
+    // this.$store.dispatch("geMaster")
     this.setTableForm()
     this.getCommonData()
     this.formInfo()
@@ -377,6 +383,20 @@
     handleClose() {
       this.editConfig.visible = false
     },
+    // 鑾峰彇閿�鍞�诲崟
+    getMasterList(id) {
+      getMasterOrderList({
+        page: 0,
+        pageSize: 0,
+        search_map: {
+          client_id: id
+        }
+      }).then((res) => {
+        if (res.code == 200) {
+          this.masterOrderList = res.data.list
+        }
+      })
+    },
     // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶
     querySearchAsync(queryString, cb, value) {
       var restaurants = []
@@ -401,6 +421,8 @@
     handleSelectClient(value, item) {
       if (value === "client") {
         this.clientId = item.id
+        this.isAddMaster = false
+        this.getMasterList(item.id)
       } else if (value === "master") {
         this.masterId = item.id
       }
@@ -411,6 +433,7 @@
       } else if (value == "master") {
         this.editSelectMasterConfig.title = "閿�鍞�诲崟"
         this.editSelectMasterConfig.editVisible = true
+        this.editSelectMasterConfig.clientId = this.clientId
         this.editSelectMasterConfig.tableInfomation = [...this.masterOrderList]
       }
     },
@@ -420,6 +443,8 @@
         this.editConfig.infomation.client_name = row.name
         this.editConfig.infomation.client_id = row.id
         this.clientId = row.id
+        this.isAddMaster = false
+        this.getMasterList(row.id)
       } else if (value == "master") {
         this.editConfig.infomation.master_order_number = row.number
         this.masterId = row.id
@@ -432,6 +457,9 @@
         this.editConfig.infomation.client_name = ""
         this.editConfig.infomation.client_id = 0
         this.clientId = 0
+        this.isAddMaster = true
+        this.editConfig.infomation.master_order_number = ""
+        this.masterId = 0
       } else if (value == "master") {
         this.editConfig.infomation.master_order_number = ""
         this.masterId = 0
diff --git a/src/views/service/clientServiceOrder/mixin/codeMixin.js b/src/views/service/clientServiceOrder/mixin/codeMixin.js
index b0f9b5e..db2034f 100644
--- a/src/views/service/clientServiceOrder/mixin/codeMixin.js
+++ b/src/views/service/clientServiceOrder/mixin/codeMixin.js
@@ -27,20 +27,15 @@
         this.codenumer = []
         this.sum = 0
         this.explain = ""
-        if (res.data.code == 200) {
-          const {
-            List = [],
-            ID,
-            AutoRule = {},
-            Method
-          } = res.data.data && res.data.data.data ? res.data.data.data[0] : []
-          this.codeRule = res.data.data && res.data.data.data ? res.data.data.data[0] : {}
+        if (res.code == 200) {
+          const { List = [], ID, AutoRule = {}, Method } = res.data && res.data.data ? res.data.data[0] : []
+          this.codeRule = res.data && res.data.data ? res.data.data[0] : {}
           let autoRule = AutoRule
           let method = Method ? Method : 0
           this.method = method
           let rules = List
           this.editConfig.infomation.ID = ID
-          if (method == 0 && res.data.data.data.length > 0) {
+          if (method == 0 && res.data.data.length > 0) {
             rules.forEach((item, index) => {
               // setTimeout(() => {
               //   this.codenumer = item.length;

--
Gitblit v1.8.0