yusheng hace 1 año
padre
commit
6a67000b4d

+ 46 - 46
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -30,7 +30,7 @@
           <el-form-item label="退货类型" prop="returnSourceType">
             <el-select
               v-model="form.returnSourceType"
-              @change="handleSetReturnSourceType"
+              @change="onchangeLink"
               style="width: 100%"
             >
               <el-option :value="3" label="销售发货退货"></el-option>
@@ -50,7 +50,7 @@
               dictName="退货类型"
               clearable
               v-model="form.type"
-              @change="onchangeLink"
+              @change="handleSetReturnSourceType"
             >
             </DictSelection>
           </el-form-item>
@@ -286,7 +286,7 @@
   import inventoryTable1 from '@/BIZComponents/inventoryTable.vue';
   import { getSendSaleOrderConfirmDetail } from '@/api/saleManage/invoiceConfirm';
   import { contactDetail } from '@/api/saleManage/contact';
-  
+
   export default {
     mixins: [dictMixins],
     components: {
@@ -339,21 +339,14 @@
         entrustedCode: '',
         entrustedId: '',
         entrustedReceiveId: '',
-        entrustedReceiveCode: '',
-        type: ''
+        entrustedReceiveCode: ''
+        // type: '10'
       };
 
       return {
         fullscreen: false, //全屏
-        customerMark:'',
+        customerMark: '',
         oldProductList: [],
-        returnList: [
-          { label: '原货退回', value: '1' },
-          { label: '部分原货+实物赔偿', value: '2' },
-          { label: '部分原货+现金赔偿', value: '3' },
-          { label: '全部实物赔偿', value: '4' },
-          { label: '全部现金赔偿', value: '5' }
-        ],
 
         oldColumns: [
           {
@@ -493,8 +486,11 @@
             slot: 'pricingWay',
             align: 'center',
             formatter: (row, column) => {
-              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
-
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
             }
           },
           {
@@ -636,7 +632,7 @@
         if (this.form.returnSourceType == 1) {
           if (this.form.type === '10') {
             allcountAmount =
-              his.$refs.inventoryTableref &&
+              this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.totalAmount;
           }
           if (this.form.type === '20') {
@@ -684,34 +680,35 @@
       },
       onchangeLink() {
         // this.getSendSaleOrderDetail(this.form.sendId);
+        this.form.type=''
         this.handleSetReturnSourceType();
       },
-     async contactDetail(id){
-      const {base}= await contactDetail(id)
-      this.customerMark=base.serialNo
-      this.$refs.inventoryTableref1.setCustomerMark(base.serialNo)
+      async contactDetail(id) {
+        const { base } = await contactDetail(id);
+        this.customerMark = base.serialNo;
+        this.$refs.inventoryTableref1.setCustomerMark(base.serialNo);
       },
       //设置退货类型
       handleSetReturnSourceType(val) {
+        this.form = Object.assign({}, this.form, {
+          orderId: '',
+          sendNo: '',
+          orderNo: '',
+          sendId: '',
+          contactName: '',
+          contactId: '',
+          pricingWay: '',
+          entrustedCode: '',
+          entrustedId: '',
+          entrustedReceiveId: '',
+          entrustedReceiveCode: '',
+      
+        });
         this.$nextTick(() => {
-          this.form = Object.assign({}, this.form, {
-            orderId: '',
-            sendNo: '',
-            orderNo: '',
-            sendId: '',
-            contactName: '',
-            contactId: '',
-            pricingWay: '',
-            entrustedCode: '',
-            entrustedId: '',
-            entrustedReceiveId: '',
-            entrustedReceiveCode: ''
-            // type:''
-          });
           this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue([]);
-          this.productList = [];
         });
+        this.productList = [];
       },
       //选择受托收货单弹框
       handleEntrustedReceive(e) {
@@ -799,14 +796,14 @@
           data = await getSendSaleOrderCordList(params);
         } else {
           res = await getSendSaleOrderConfirmDetail(params.sendNoList);
-          params.sendNoList=[res.sendNo]
+          params.sendNoList = [res.sendNo];
           data = await getSendSaleOrderCordList(params);
         }
 
         this.loading = false;
         if (data) {
-          if(data.contactId){
-             this.contactDetail(data.contactId)
+          if (data.contactId) {
+            this.contactDetail(data.contactId);
           }
           data.productList.forEach((item) => {
             item.sendProductId = item.productId;
@@ -830,7 +827,7 @@
               entrustedReceiveCode: ''
             });
             if (params.activeName == 2) {
-               this.productList = data.productList;
+              this.productList = data.productList;
               this.$refs.inventoryTableref &&
                 this.$refs.inventoryTableref.putTableValue(res.productList);
               return;
@@ -866,17 +863,18 @@
         });
       },
       saveDate(data) {
-        console.log(this.productList,'this.productList')
+        console.log(this.productList, 'this.productList');
         data.forEach((item) => {
           item['totalCount'] = item.measureQuantity;
           item['qmsResult'] = item.result;
           item['qmsStatus'] = item.status;
           this.productList.forEach((val) => {
-            console.log(val,'val')
+            console.log(val, 'val');
             if (item.productCode == val.productCode) {
               item['singlePrice'] = val.singlePrice;
               item['clientCode'] = item.clientCode || val.customerMark;
-              item['pricingWay'] = item.pricingWay || val.pricingWay||this.form.pricingWay;
+              item['pricingWay'] =
+                item.pricingWay || val.pricingWay || this.form.pricingWay;
             }
           });
         });
@@ -888,9 +886,9 @@
         this.loading = true;
         const data = await getSendSaleOrderrecordDetailSplit(id);
         this.productList = data.productList;
-        if(data.contactId){
-             this.contactDetail(data.contactId)
-          }
+        if (data.contactId) {
+          this.contactDetail(data.contactId);
+        }
         if (type) return;
         if (data.entrustedCode) {
           await this.getInfo({ id: data.entrustedId });
@@ -939,7 +937,9 @@
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(data.productList);
             this.$refs.inventoryTableref1 &&
-              this.$refs.inventoryTableref1.putTableValue({productList:data.redressProductList});
+              this.$refs.inventoryTableref1.putTableValue({
+                productList: data.redressProductList
+              });
             if (this.form.returnSourceType != 2) {
               this.getSendSaleOrderDetail(data.sendId, 1);
             } else {