yusheng преди 1 година
родител
ревизия
a4df4a100d

+ 4 - 3
src/views/bpm/handleTask/components/inquiryManage/addDialog.vue

@@ -102,7 +102,7 @@
       :isUpdate="isUpdate"
       @deliveryDateChange="deliveryDateChange"
 
-      @setIsInquiry="setIsInquiry"
+
     ></inquiryTable>
   </div>
 </template>
@@ -229,7 +229,7 @@
           this.$nextTick(() => {
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data.detailList);
-              this.setIsInquiry()
+              // this.setIsInquiry()
 
           });
           if (type == 'init') {
@@ -347,7 +347,7 @@
         this.supplierList = this.supplierList.filter(
           (item) => item.supplierId != supplierId
         );
-        this.setIsInquiry()
+        // this.setIsInquiry()
 
       },
 
@@ -451,6 +451,7 @@
 
       async getTableValue() {
         let supplierList = [];
+        this.setIsInquiry()
         this.supplierList.forEach((item) => {
           supplierList.push(
             this.$refs['inquiryTable' + item.supplierId][0].getTableValue()

+ 1 - 0
src/views/bpm/handleTask/components/inquiryManage/inquiryTable.vue

@@ -707,6 +707,7 @@
         });
       },
       setIsInquiry() {
+        return
         this.$emit('setIsInquiry');
       },
       deliveryDateChange(row) {

+ 24 - 2
src/views/bpm/handleTask/components/inquiryManage/inventoryTable.vue

@@ -374,7 +374,9 @@
             prop: 'supplierIds',
             label: '供应商选择',
             slot: 'supplierIds',
-            align: 'center'
+            align: 'center',
+            filters: this.supplierList,
+            filterMethod: this.filterMethod
           },
           {
             minWidth: 100,
@@ -538,7 +540,7 @@
         return comitDatasource;
       },
       setIsInquiry(list) {
-        return;
+        // return;
         this.form.datasource.forEach((productItem, index) => {
           //产品清单
           let isInquiry = 0,
@@ -568,9 +570,17 @@
           console.log(totalCountS, 'codeS');
         });
       },
+      filterMethod(value, row, column) {
+        let ids = row.supplierList.map((item) => item.id);
+        if (ids.length > 0 && ids.includes(value)) {
+          return row;
+        }
+      },
       //修改回显
       async putTableValue(data) {
         if (data && data?.length) {
+          let supplierList = [],
+            supplierIds = [];
           this.form.datasource = data;
           let codeList = this.form.datasource.map((item) => item.productCode);
           //获取仓库库存
@@ -585,6 +595,18 @@
               'availableCountBase',
               find.availableCountBase
             );
+          supplierList.push(...item.supplierList);
+
+          });
+          supplierIds = Array.from(
+            new Set(supplierList.map((item) => item.id))
+          );
+          this.supplierList = supplierIds.map((id) => {
+            let data = supplierList.find((item) => item.id == id);
+            return {
+              text: data.name,
+              value: data.id
+            };
           });
           this.$refs.table.reload();
         }

+ 21 - 1
src/views/bpm/handleTask/components/quotation/addDialog.vue

@@ -517,6 +517,17 @@
         const data = await getcontactlink({ contactId });
         if (data && data?.length) {
           this.linkNameOptions = data;
+          
+          let firstLink =
+            this.linkNameOptions.find((item) => item.ifChief == 1) || {};
+          this.form = Object.assign({}, this.form, {
+            contactLinkId: firstLink.id || this.linkNameOptions[0]?.id,
+            contactLinkName:
+              firstLink.linkName || this.linkNameOptions[0]?.linkName,
+              contactTel:
+              firstLink.mobilePhone || this.linkNameOptions[0]?.mobilePhone,
+              contactEmail:  firstLink.email || this.linkNameOptions[0]?.email
+          });
         }
       },
 
@@ -575,10 +586,19 @@
           contactLinkId: '',
           contactLinkName: '',
           contactEmail: '',
-          contactTel: ''
+          contactTel: '',
+          customerMark: base.serialNo
+
         });
         this.getLinkInfo(obj.id);
         this.getBusinessList(obj.name);
+        this.$nextTick(() => {
+          if(this.form.opportunityType==1){
+            this.$refs.inventoryTable.putTableValue([])
+            this.form.opportunityId=''
+          }
+          this.$refs.inventoryTable.setCustomerMark(base.serialNo);
+        });
       },
 
       handParent() {