Commit 2ff7a1ab authored by Smile's avatar Smile Committed by wux

feat:空运出货自动带出送货地址

parent 29e9b70f
......@@ -2,7 +2,7 @@
<div>
<el-form ref="airShipmentForm" :model="airShipmentObj" :rules="rules" label-width="100px">
<el-form-item :label="$t('')" prop="deliverType">
<el-radio-group v-model="airShipmentObj.deliverType">
<el-radio-group v-model="airShipmentObj.deliverType" @change="handleRadioChange">
<el-radio v-for="item in deliverTypes" :key="item.value" :label="item.value">{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
......@@ -83,6 +83,12 @@ export default {
return {
// 空运出货对象
airShipmentObj: {},
//初始地址
oldAddress: "",
//订单对象
shipmentObj:{},
//所有供应商
suppliers: [],
// 送货方式
deliverTypes: constantDict.deliverType,
// 校验
......@@ -94,10 +100,17 @@ export default {
},
created() {
const voName = this.$attrs.currNode.voName;
this.shipmentObj = { ...this.$attrs.shipmentObj };
this.suppliers= this.$attrs.allSupplier;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["deliverTime"]);
oldData = formatNumberString(oldData, ["deliverType"]);
this.airShipmentObj = oldData;
this.oldAddress=this.airShipmentObj.deliverAddress
//判断是否有地址数据,没有就带出默认地址
if (!this.oldAddress) {
this.handleRadioChange(this.airShipmentObj.deliverType);
}
this.airShipmentApprovalInfo = this.$attrs.shipmentObj.airShipmentApprovalInfo
},
methods: {
......@@ -136,6 +149,22 @@ export default {
cancel(type) {
this.$emit("closeDialog", type);
},
handleRadioChange: function (value) {
if (this.oldAddress){
return
}
if (value === "1") {
this.shipmentObj.bookAirInfo.shipperId;
this.suppliers.forEach((item) => {
if (item.id === this.shipmentObj.bookAirInfo.shipperId) {
this.airShipmentObj.deliverAddress = item.address;
}
});
}
if (value === "2") {
this.airShipmentObj.deliverAddress = this.shipmentObj.startWarehouseResp.addressZh;
}
}
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment