Commit eda13e4c authored by lanbaoming's avatar lanbaoming

28

parent 5f8aadd9
...@@ -442,12 +442,23 @@ ...@@ -442,12 +442,23 @@
</div> </div>
<div> <div>
<el-form-item :label="$t('收货方式')" prop="harvestMethod" class="ml-20"> <el-form-item :label="$t('收货方式')" prop="harvestMethod" class="ml-20">
<!--
<dict-selector :type="DICT_TYPE.ECW_HARVEST_METHOD" <dict-selector :type="DICT_TYPE.ECW_HARVEST_METHOD"
v-model="form.harvestMethod" :filter="item => item.value == 1 v-model="form.harvestMethod" :filter="item => item.value == 1
|| homeDeliveryService" defaultable :disabled="false" /> || homeDeliveryService" defaultable :disabled="false" />-->
<el-select v-model="harvestMethod2" @change="handleChange">
<el-option
v-for="dict in lunchList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</div> </div>
<div v-if="homeDeliveryService && +form.harvestMethod === 2"> <div v-if="showAdress">
<el-form-item :label="$t('收货地区')" prop="country"> <el-form-item :label="$t('收货地区')" prop="country">
<area-selector <area-selector
:country="form.consigneeVO ? form.consigneeVO.country : undefined" :country="form.consigneeVO ? form.consigneeVO.country : undefined"
...@@ -729,7 +740,13 @@ export default { ...@@ -729,7 +740,13 @@ export default {
updateChannel: false, // 是否更新渠道 updateChannel: false, // 是否更新渠道
offerData: [],// 关联报价单 offerData: [],// 关联报价单
offerIdNochange:false, offerIdNochange:false,
offerNumber:null offerNumber:null,
showAdress: false,
harvestMethod2: null,
lunchList: [
{ label: "自提", value: 1 },
{ label: "送货上门", value: 2 },
],
}; };
}, },
computed:{ computed:{
...@@ -1260,10 +1277,20 @@ export default { ...@@ -1260,10 +1277,20 @@ export default {
this.initing = false this.initing = false
console.log("初始化完成 initing", this.initing) console.log("初始化完成 initing", this.initing)
}) })
}, 100) }, 100)
}) })
//alert(this.form.harvestMethod);
if (this.form.harvestMethod == 2) {
this.showAdress = true;
this.harvestMethod2 = this.form.harvestMethod;
} else {
this.showAdress = false;
this.harvestMethod2 = this.form.harvestMethod;
}
console.log('order数据加载成功') console.log('order数据加载成功')
}).catch(() => { }).catch(() => {
this.initing = false this.initing = false
...@@ -1414,9 +1441,35 @@ export default { ...@@ -1414,9 +1441,35 @@ export default {
this.form.orderItemVOList.splice(index, 1) this.form.orderItemVOList.splice(index, 1)
}) })
}, },
handleChange(harvestMethod) {
if (harvestMethod == 1) {
this.showAdress = false;
} else {
if (this.homeDeliveryService == false) {
this.harvestMethod2 = 1;
this.$message.error("此路线未开通上门服务。");
return;
}
this.showAdress = true;
}
if (harvestMethod == 2 && !this.form.address && this.form.consigneeId) {
getCustomer(this.form.consigneeId).then((res) => {
if (res.data.address) {
this.$set(this.form, "consigneeAddress", res.data.address);
}
});
}
},
/** 提交按钮 */ /** 提交按钮 */
// type 在新建的时候表示状态,0草稿,2带入仓 // type 在新建的时候表示状态,0草稿,2带入仓
submitForm(submitType) { submitForm(submitType) {
this.form.harvestMethod=this.harvestMethod2;
if (this.harvestMethod2 == 2&&
this.homeDeliveryService == false
) {
this.$message.error("此路线未开通上门服务。");
}
this.$refs["form"].validate(async (valid, errors) => { this.$refs["form"].validate(async (valid, errors) => {
if (!valid) { if (!valid) {
return this.$showFormValidateErrors(errors) return this.$showFormValidateErrors(errors)
......
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