This commit is contained in:
曹辉 2023-01-29 15:08:48 +08:00
parent 28b2ee91b2
commit bc9fa82eba
3 changed files with 25 additions and 8 deletions

View File

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

View File

@ -138,6 +138,7 @@ export default {
{ required: true, message: "请输入商品顺序", trigger: "blur" },
],
},
isResouceShow: 1,
treeOption: {
lazy: true,
checkStrictly: true, // 是否可选择任意一级
@ -245,11 +246,14 @@ export default {
);
}
}
console.log(this.goodDetailsLists);
},
// 取消按钮
cancel() {
console.log(this.form);
// 清空选中的节点
this.$refs.cascader.$refs.panel.clearCheckedNodes();
// 设置为空可以让节点不高亮显示
this.$refs.cascader.$refs.panel.activePath = [];
++this.isResouceShow;
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.form.goodsPictureUrl);
@ -276,7 +280,6 @@ export default {
}, ],
}, ];
},
handleQuery2() {
// this.getListByUserquery.pageNum = 1;
this.getList2();
@ -298,7 +301,6 @@ export default {
addcancel() {
this.resetQuery2();
},
// 表单重置
reset() {
this.form = {
@ -413,6 +415,11 @@ export default {
});
}
this.imgsurl = { pictureUrlList: [] };
// 清空选中的节点
this.$refs.cascader.$refs.panel.clearCheckedNodes();
// 设置为空可以让节点不高亮显示
this.$refs.cascader.$refs.panel.activePath = [];
++this.isResouceShow;
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
@ -422,9 +429,12 @@ export default {
e.goodsPrice = Number(e.goodsPrice);
});
addGoodsInfo(this.form).then((response) => {
console.log(this.form);
// 清空选中的节点
this.$refs.cascader.$refs.panel.clearCheckedNodes();
// 设置为空可以让节点不高亮显示
this.$refs.cascader.$refs.panel.activePath = [];
++this.isResouceShow;
this.$modal.msgSuccess("新增成功");
// this.StationName = "请选择所属护理站";
this.open = false;
this.getList();

View File

@ -203,6 +203,7 @@
:visible.sync="open"
width="1200px"
append-to-body
:before-close="cancel"
>
<el-form
ref="form"
@ -235,6 +236,7 @@
style="width: 210px"
:show-all-levels="false"
:clearable="true"
:key="isResouceShow"
ref="cascader"
:placeholder="form.goodsCategoryName ? form.goodsCategoryName : ''"
>