Commit a4b29ee1 by lp784568205

修改三级联动

parent 8910fcf7
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -303,23 +303,124 @@ export default {
this.$set(this.cxFormData, "lasjRqsjJssj", this.formatDate(new Date()));
},
watch: {
"cxFormData.xszalxdm": {
handler(newName, oldName) {
debugger;
if (newName != oldName) {
console.log(this.cxQueryField[3].codeOptions);
// "cxFormData.xszalxdm": {
// handler(newName, oldName) {
// debugger;
// if (newName != oldName) {
// console.log(this.cxQueryField[3].codeOptions);
this.$set(this.cxFormData, "ajlbdm", newName.substring(0, 8));
// this.$set(this.cxFormData, "ajlbdm", newName.substring(0, 8));
// }
// },
// },
// "cxFormData.xslalxdm": {
// handler(newName, oldName) {
// debugger;
// if (newName != oldName) {
// this.$set(this.cxFormData, "xszalxdm", newName.substring(0, 12));
// }
// },
// },
//监听器中监听表单的值,刷新下拉框的数据
"cxFormData.ajlbCode": {
handler(val, oldVal) {
let self = this;
//请求接口 4 CODE_GABAJZLB_bz
if (val !== "") {
if (oldVal != "") {
self.$set(self.cxFormData, "ajxzlb", "");
}
axios
.get(`JsonData/CODE_GABAJZLB_bz.json`)
.then((res) => {
self.cxQueryField[4].codeOptions = res.data.rows.filter((value) => {
return value.id.indexOf(val) == 0;
});
})
.catch((err) => {
console.log(err);
});
} else {
axios
.get(`JsonData/CODE_GABAJZLB_bz.json`)
.then((res) => {
self.cxQueryField[4].codeOptions = res.data.rows;
// self.$set(val, "codeOptions", res.data.rows);
})
.catch((err) => {
console.log(err);
});
self.$set(self.cxFormData, "ajxzlb", "");
}
},
deep: true,
},
"cxFormData.xslalxdm": {
handler(newName, oldName) {
debugger;
if (newName != oldName) {
this.$set(this.cxFormData, "xszalxdm", newName.substring(0, 12));
"cxFormData.ajxzlb": {
handler(val, oldVal) {
let self = this;
//请求接口 5 CODE_GABAJXZLB_bz
if (val !== "") {
if (oldVal != "") {
self.$set(self.cxFormData, "ajxlb", "");
}
axios
.get(`JsonData/CODE_GABAJXZLB_bz.json`)
.then((res) => {
self.cxQueryField[5].codeOptions = res.data.rows.filter((value) => {
return value.id.indexOf(val) == 0;
});
})
.catch((err) => {
console.log(err);
});
axios
.get(`JsonData/CODE_AJLB_bz.json`)
.then((res) => {
let resultObj = res.data.rows.find((i) => val.indexOf(i.id) == 0);
if (resultObj) {
self.$set(self.cxFormData, "ajlbCode", resultObj.id);
} else {
self.$set(self.cxFormData, "ajlbCode", "");
}
})
.catch((err) => {
console.log(err);
});
} else {
axios
.get(`JsonData/CODE_GABAJXZLB_bz.json`)
.then((res) => {
self.cxQueryField[5].codeOptions = res.data.rows;
})
.catch((err) => {
console.log(err);
});
self.$set(self.cxFormData, "ajxlb", "");
}
},
deep: true,
},
"cxFormData.ajxlb": {
handler(val) {
let self = this;
if (val !== "") {
axios
.get(`JsonData/CODE_GABAJZLB_bz.json`)
.then((res) => {
let resultObj = res.data.rows.find((i) => val.indexOf(i.id) == 0);
if (resultObj) {
self.$set(self.cxFormData, "ajxzlb", resultObj.id);
} else {
self.$set(self.cxFormData, "ajxzlb", "");
}
})
.catch((err) => {
console.log(err);
});
} else {
}
},
deep: true,
},
},
};
......
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