diff --git a/src/views/emis/emisWaybill/waybillModify.vue b/src/views/emis/emisWaybill/waybillModify.vue index 0dc7d7d6..90d78fbc 100644 --- a/src/views/emis/emisWaybill/waybillModify.vue +++ b/src/views/emis/emisWaybill/waybillModify.vue @@ -521,6 +521,16 @@ + + + 是否为虚拟单 + + + + + + + @@ -864,7 +874,7 @@ import ExchangeRatePanel from '@/views/emis/EmisBaseTools/ExchangeRatePanel.vue' import TransProductCasPicker from '@/views/emis/EmisBaseTools/TransProductCasPicker.vue'; // import TransProductCasPicker from '@/views/emis/EmisBaseTools/TransProductCasPicker.vue'; - +import MasterBillCodePicker from '@/views/emis/EmisBaseTools/MasterBillCodePicker.vue'; import feeItemForm from './feeItemForm.vue'; import TanexPrinterPanel from '@/views/emis/EmisBaseTools/TanexPrinterPanel.vue'; @@ -908,12 +918,21 @@ components: { DistrictPicker2, ExchangeRatePanel, SeaSiteSimplePicker0, - SeaSiteSimplePicker1 + SeaSiteSimplePicker1, + MasterBillCodePicker, }, dicts: ['emis_qujian_fangshi','emis_declare_mode','emis_customs_clear', 'emis_tab_packing_type','emis_tab_dispatch_mode','emis_payment_type', 'emis_calc_fee_type','emis_print_type','sys_currency_type'], data() { + //校验关联主单线路 + var checkmasterProductType = (rule, value, callback) => { + if (this.masterBillProductType && this.masterBillProductType != this.form.productType) { + callback(new Error('输入单号不正确'));// 关联主单和运单线路不一致 + } else { + callback(); + } + } return { activeNames:['1','2','3','4'], exchangeRate:null, @@ -1024,6 +1043,10 @@ data() { ], packType: [ { required: true, message: "包装类型不能为空",trigger: ["blur",'change'] } + ], + //自定义校验 + masterBillCode:[ + {validator: checkmasterProductType, trigger: ['blur', 'change']} ], dispatchMethod: [ { required: true, message: "派件方式不能为空", trigger: ["blur",'change'] } @@ -1748,11 +1771,19 @@ methods: { departurePort:null, destinationPort:null, boxQuantity:null, - carryType:null + carryType:null, + blVirtual:null, + masterBillCode:null }; this.resetForm("form"); }, onProductChange(item,transType){ + //非缅甸快递/缅甸快递进口/柬埔寨快递进口 重置虚拟单 + if(item !==null && item[0]!=='012' && item[0]!=='002' && item[0] !== '014'){ + this.form.remark=null; + this.form.masterBillCode=null; + this.form.blVirtual=null; + } if(item!=null && item.length==2){ this.form.transLine=item[0]; this.form.productType=item[1]; @@ -2371,6 +2402,28 @@ methods: { this.form.billCode="" } }, + //获取虚拟运单关联主单 + onMasterBillCodeChange(val) { + if (val) { + this.form.masterBillCode = val.value; + this.masterBillProductType = val.productType; + // this.masterBillProductType = '242011'; + //生成备注 + this.form.remark = `该单为虚拟单:对应主单为${this.form.masterBillCode}`; + } else { + //清空 + this.form.masterBillCode = null; + this.masterBillProductType = null; + this.form.remark = null; + } + }, + //虚拟单变化 + handleVirtualChange(){ + if(this.form.blVirtual!=='1'){ + this.form.remark = null; + this.form.masterBillCode =null; + } + } } };