Commit 6d514ad5 authored by lanbaoming's avatar lanbaoming

2024-06-28-02提交

parent 077073fb
...@@ -841,26 +841,27 @@ ...@@ -841,26 +841,27 @@
prop="harvestMethod" prop="harvestMethod"
class="ml-20" class="ml-20"
> >
<dict-selector :type="DICT_TYPE.ECW_HARVEST_METHOD"
v-model="form.harvestMethod" :filter="item => item.value == 1 ||
homeDeliveryService" defaultable :disabled="false" />
<!-- <!--
<el-select <dict-selector
:type="DICT_TYPE.ECW_HARVEST_METHOD"
v-model="form.harvestMethod" v-model="form.harvestMethod"
ref="select" :filter="(item) => item.value == 1 || homeDeliveryService"
@change="handleChange" defaultable
> :disabled="false"
/>-->
<el-select v-model="harvestMethod2" @change="handleChange">
<el-option <el-option
v-for="(t, i) of lunchList" v-for="dict in lunchList"
:key="i" :key="dict.value"
:label="t.label" :label="dict.label"
:value="t.value" :value="dict.value"
></el-option> ></el-option>
</el-select>--> </el-select>
</el-form-item> </el-form-item>
</div> </div>
<div v-if="homeDeliveryService&&form.harvestMethod==2"> <!--<div v-if="homeDeliveryService&&form.harvestMethod==2">-->
<div v-show="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"
...@@ -1331,6 +1332,8 @@ export default { ...@@ -1331,6 +1332,8 @@ export default {
offerData: [], // 关联报价单 offerData: [], // 关联报价单
offerIdNochange: false, offerIdNochange: false,
offerNumber: null, offerNumber: null,
showAdress: false,
harvestMethod2: null,
lunchList: [ lunchList: [
{ label: "自提", value: 1 }, { label: "自提", value: 1 },
{ label: "送货上门", value: 2 }, { label: "送货上门", value: 2 },
...@@ -1678,7 +1681,11 @@ export default { ...@@ -1678,7 +1681,11 @@ export default {
} }
}, },
// 选择送货上门需要查询并填充默认地址 // 选择送货上门需要查询并填充默认地址
"form.harvestMethod"(harvestMethod) { /*
"form.harvestMethod1"(harvestMethod) {
// if (harvestMethod == 2) this.showAdress = true;
//else this.showAdress = false;
if (harvestMethod == 2 && !this.form.address && this.form.consigneeId) { if (harvestMethod == 2 && !this.form.address && this.form.consigneeId) {
getCustomer(this.form.consigneeId).then((res) => { getCustomer(this.form.consigneeId).then((res) => {
if (res.data.address) { if (res.data.address) {
...@@ -1686,7 +1693,8 @@ export default { ...@@ -1686,7 +1693,8 @@ export default {
} }
}); });
} }
}, },*/
"form.isCargoControl"(isCargoControl) { "form.isCargoControl"(isCargoControl) {
console.log( console.log(
"form.isCargoControl", "form.isCargoControl",
...@@ -1815,7 +1823,7 @@ export default { ...@@ -1815,7 +1823,7 @@ export default {
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.select.change(); // this.$refs.select.change();
}); });
}, },
methods: { methods: {
...@@ -1833,8 +1841,19 @@ export default { ...@@ -1833,8 +1841,19 @@ export default {
}; };
this.channelList = (await getChannelList(query)).data; this.channelList = (await getChannelList(query)).data;
}, },
handleChange(harvestMethod) { handleChange(harvestMethod) {
if (harvestMethod == 2 && !this.form.address && this.form.consigneeId) { 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) => { getCustomer(this.form.consigneeId).then((res) => {
if (res.data.address) { if (res.data.address) {
this.$set(this.form, "consigneeAddress", res.data.address); this.$set(this.form, "consigneeAddress", res.data.address);
...@@ -2042,8 +2061,15 @@ export default { ...@@ -2042,8 +2061,15 @@ export default {
}); });
}, 100); }, 100);
}); });
//alert(this.form.harvestMethod);
this.handleChange(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(() => {
...@@ -2241,6 +2267,13 @@ export default { ...@@ -2241,6 +2267,13 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
// type 在新建的时候表示状态,0草稿,2带入仓 // type 在新建的时候表示状态,0草稿,2带入仓
submitForm(submitType) { submitForm(submitType) {
this.form.harvestMethod = this.harvestMethod2;
if (this.harvestMethod2 == 2) {
if (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