Commit a0a87d83 by chenwq

fix(addRecruitment): 修复门店地址验证逻辑,更新省市选择处理

1 parent 4ae3ff44
...@@ -277,7 +277,7 @@ export default { ...@@ -277,7 +277,7 @@ export default {
required: true, required: true,
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (this.addForm.bySystemMerchant) { if (this.addForm.bySystemMerchant) {
if (!this.addForm.province || !this.addForm.merchantAddress) { if (!this.addForm.provinceCode || !this.addForm.provinceCityCode) {
callback(new Error("请选择门店地址")); callback(new Error("请选择门店地址"));
} else { } else {
callback(); callback();
...@@ -485,15 +485,19 @@ export default { ...@@ -485,15 +485,19 @@ export default {
this.$refs[this.editChildRef] && this.$refs[this.editChildRef].$refs.form.clearValidate(); this.$refs[this.editChildRef] && this.$refs[this.editChildRef].$refs.form.clearValidate();
}, },
handleSelectProvince(val) { handleSelectProvince(val) {
this.addForm.provinceCode = val.code; this.addForm.provinceCode = val ? val.code : '';
this.addForm.province = val.name; this.addForm.province = val ? val.name : '';
this.addForm.cityCode = ""; this.addForm.cityCode = "";
this.addForm.cityName = ""; this.addForm.cityName = "";
this.addForm.merchantAddress = val.name; this.addForm.provinceCityCode = ""
this.addForm.merchantAddress = val ? val.name : '';
this.$refs.editFormRef.$refs[this.editChildRef].validateField("merchantAddress");
}, },
handleSelectCity(val) { handleSelectCity(val) {
this.addForm.provinceCityCode = this.addForm.provinceCode + "/" + val.code; this.addForm.provinceCityCode = val ? (this.addForm.provinceCode + "/" + val.code) : '';
this.addForm.merchantAddress = this.addForm.province + "" + val.name; this.addForm.merchantAddress = val ? (this.addForm.province + "" + val.name) : '';
this.$refs.editFormRef.$refs[this.editChildRef].validateField("merchantAddress");
}, },
getBrandName() { getBrandName() {
console.log(this.addForm.brand); console.log(this.addForm.brand);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!