解决配送地址选择不回显bug

master
lemon橪 2021-07-02 09:37:46 +08:00
parent d8b9d81f70
commit 35ea8adf7d
2 changed files with 49 additions and 7 deletions

View File

@ -22,6 +22,11 @@ export default {
this.init();
},
methods: {
clear() {
this.data = [];
this.selectedWay = [];
this.init();
},
/**
* 关闭
*/
@ -50,30 +55,66 @@ export default {
// console.warn(this.$store.state.shipTemplate);
//
let checkData = [];
let disabledData = checkedData.filter((item, i) => {
return i != index;
if (i != index) {
return i != index;
} else {
checkData.push(item);
}
});
//
checkData.forEach((check) => {
// id
check.areaId.split(",").forEach((ids) => {
this.data.forEach((item) => {
//
if (check.selectedAll) {
check.area.split(",").forEach((area) => {
if (area == item.name) {
this.$set(item, "checked", true);
}
});
}
//
item.children.forEach((child, childIndex) => {
//
if (item.checked) {
this.$set(child, "checked", true);
}
if (child.id == ids) {
this.$set(child, "checked", true);
}
});
});
});
});
//
disabledData.forEach((dis) => {
console.log(dis)
// id
dis.areaId.split(",").forEach((ids) => {
//
this.data.forEach((item) => {
//
//
if (dis.selectedAll) {
dis.area.split(",").forEach((area) => {
if (area == item.name) {
console.log(item.name +"选中")
this.$set(item, "disabled", true);
}
});
}
//
item.children.forEach((child, childIndex) => {
//
if (child.id == ids) {
//
if (item.disabled) {
this.$set(child, "disabled", true);
} else {
if (child.id == ids) {
this.$set(child, "disabled", true);
}
}
});
});

View File

@ -213,6 +213,7 @@ export default {
},
//
add() {
this.$refs.region.clear()
this.title = "添加运费模板";
this.csTab = true;
this.operation = "ADD";