This commit is contained in:
曹辉 2023-01-29 15:09:07 +08:00
parent 04eaeb3dd8
commit 3a4a1396f4
3 changed files with 21 additions and 6 deletions

View File

@ -244,6 +244,7 @@
:clearable="true" :clearable="true"
ref="cascader" ref="cascader"
:placeholder="form.goodsCategoryName ? form.goodsCategoryName : ''" :placeholder="form.goodsCategoryName ? form.goodsCategoryName : ''"
:key="isResouceShow"
> >
</el-cascader> </el-cascader>
<!-- <el-select <!-- <el-select

View File

@ -148,7 +148,7 @@ export default {
}, 300); }, 300);
}, },
}, },
ruleForm: [], isResouceShow: 1,
}; };
}, },
created() { created() {
@ -261,6 +261,7 @@ export default {
this.$refs.cascader.$refs.panel.clearCheckedNodes(); this.$refs.cascader.$refs.panel.clearCheckedNodes();
// 设置为空可以让节点不高亮显示 // 设置为空可以让节点不高亮显示
this.$refs.cascader.$refs.panel.activePath = []; this.$refs.cascader.$refs.panel.activePath = [];
++this.isResouceShow
}, },
//页面所属护理站 //页面所属护理站
ParamsStation(item) { ParamsStation(item) {
@ -419,7 +420,11 @@ export default {
updatePicture(obj).then((res) => {}); updatePicture(obj).then((res) => {});
} }
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
++this.isResouceShow
// 清空选中的节点
this.$refs.cascader.$refs.panel.clearCheckedNodes();
// 设置为空可以让节点不高亮显示
this.$refs.cascader.$refs.panel.activePath = [];
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
@ -431,6 +436,11 @@ export default {
addGoodsInfo(this.form).then((response) => { addGoodsInfo(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.StationName = "请选择所属护理站"; this.StationName = "请选择所属护理站";
++this.isResouceShow
// 清空选中的节点
this.$refs.cascader.$refs.panel.clearCheckedNodes();
// 设置为空可以让节点不高亮显示
this.$refs.cascader.$refs.panel.activePath = [];
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
@ -501,4 +511,4 @@ export default {
}); });
}, },
}, },
}; };

View File

@ -205,6 +205,7 @@
:show-all-levels="false" :show-all-levels="false"
ref="cascader" ref="cascader"
:placeholder="form.parentName ? form.parentName : ''" :placeholder="form.parentName ? form.parentName : ''"
:key="isResouceShow"
> >
</el-cascader> </el-cascader>
<!-- <el-input <!-- <el-input
@ -278,6 +279,7 @@ export default {
components: { stationAcatar }, components: { stationAcatar },
data() { data() {
return { return {
isResouceShow: 1,
treeOption: { treeOption: {
lazy: true, lazy: true,
checkStrictly: true, // checkStrictly: true, //
@ -379,7 +381,7 @@ export default {
this.loading = true; this.loading = true;
this.queryParams.parentId = data.id; this.queryParams.parentId = data.id;
this.queryParams.parentName = data.goodsCategoryName; this.queryParams.parentName = data.goodsCategoryName;
this.categoryLevel = data.categoryLevel; // this.categoryLevel = data.categoryLevel;
this.handleQuery(); this.handleQuery();
getStationCategoryList(data.id).then((res) => { getStationCategoryList(data.id).then((res) => {
res.data.forEach((e) => { res.data.forEach((e) => {
@ -425,6 +427,7 @@ export default {
}, },
// //
cancel() { cancel() {
++this.isResouceShow;
if (this.form.parentId) { if (this.form.parentId) {
// //
this.$refs.cascader.$refs.panel.clearCheckedNodes(); this.$refs.cascader.$refs.panel.clearCheckedNodes();
@ -490,8 +493,7 @@ export default {
this.form.parentId = this.queryParams.parentId; this.form.parentId = this.queryParams.parentId;
// } // }
this.form.parentName = this.queryParams.parentName; this.form.parentName = this.queryParams.parentName;
this.form.categoryLevel = this.categoryLevel; // this.form.categoryLevel = this.categoryLevel;
console.log(this.form);
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -523,6 +525,7 @@ export default {
this.$refs.cascader.$refs.panel.clearCheckedNodes(); this.$refs.cascader.$refs.panel.clearCheckedNodes();
// //
this.$refs.cascader.$refs.panel.activePath = []; this.$refs.cascader.$refs.panel.activePath = [];
++this.isResouceShow;
this.open = false; this.open = false;
this.getList(); this.getList();
this.info(); this.info();
@ -534,6 +537,7 @@ export default {
this.$refs.cascader.$refs.panel.clearCheckedNodes(); this.$refs.cascader.$refs.panel.clearCheckedNodes();
// //
this.$refs.cascader.$refs.panel.activePath = []; this.$refs.cascader.$refs.panel.activePath = [];
++this.isResouceShow;
this.open = false; this.open = false;
this.getList(); this.getList();
this.info(); this.info();