ソースを参照

fix: 提交;

bug/0816
yinsiyu 1ヶ月前
コミット
a42ce27e6d
1個のファイルの変更16行の追加7行の削除
  1. +16
    -7
      src/views/userManage/roleManage/roleList/components/CrudPopup/index.vue

+ 16
- 7
src/views/userManage/roleManage/roleList/components/CrudPopup/index.vue ファイルの表示

@@ -134,10 +134,12 @@ export default {
this.form.saleProcessChecks = res?.data?.saleProcess || [];
}
this.form.doctorWorkChecks = this.form.doctorWorkChecks.filter(item => this.treeData.findIndex(item2 => item2.id === item) < 0)
this.form.saleManageChecks = this.form.doctorWorkChecks.filter(item => this.treeData2.findIndex(item2 => item2.id === item) <0)
this.form.saleProcessChecks = this.form.doctorWorkChecks.filter(item => this.treeData3.findIndex(item2 => item2.id === item) <0)

console.log('this.form.doctorWorkChecks=', this.form.doctorWorkChecks)
this.form.saleManageChecks = this.form.saleManageChecks.filter(item => this.treeData2.findIndex(item2 => item2.id === item) < 0)

this.form.saleProcessChecks = this.form.saleProcessChecks.filter(item => this.treeData3.findIndex(item2 => item2.id === item) < 0)
this.$nextTick(() => {
console.log("this.$refs.tree=", this.$refs.tree);
this.$refs.tree.setCheckedKeys(this.form.doctorWorkChecks);
this.$refs.tree2.setCheckedKeys(this.form.saleManageChecks);
this.$refs.tree3.setCheckedKeys(this.form.saleProcessChecks);
@@ -145,7 +147,7 @@ export default {
this.loading = false;
},
handleSelectMenuChange({ checkedKeys, halfCheckedKeys }, property) {
console.log("property=", property);
console.log("property=", property, checkedKeys);
this.form[property] = checkedKeys;
this.$nextTick(() => {
this.$refs.form?.validateField("menuIdList");
@@ -186,14 +188,19 @@ export default {
if (valid) {
this.loading = true;
try {
const { menuIdList, doctorWorkChecks, saleManageChecks, saleProcessChecks, ...params } =
this.form;
const { menuIdList, doctorWorkChecks, saleManageChecks, saleProcessChecks, ...params } = this.form;
await this.$nextTick();
const halfChecks1 = this.$refs.tree.getHalfCheckedKeys();
const halfChecks2 = this.$refs.tree2.getHalfCheckedKeys();
const halfChecks3 = this.$refs.tree3.getHalfCheckedKeys();
console.log('doctorWorkChecks=', doctorWorkChecks)
console.log('saleManageChecks=', saleManageChecks)
console.log('saleProcessChecks=', saleProcessChecks)
console.log('halfChecks1=', halfChecks3)
console.log('halfChecks1=', halfChecks3)
console.log('halfChecks1=', halfChecks3)
const res = await saveRole({
menuIdList: [...doctorWorkChecks, ...saleManageChecks, ...saleProcessChecks, ...halfChecks1, ...halfChecks2, ...halfChecks3],
menuIdList: [...this.form.doctorWorkChecks, ...this.form.saleManageChecks, ...this.form.saleProcessChecks, ...halfChecks1, ...halfChecks2, ...halfChecks3],
...params,
});
if (this.form.roleId) {
@@ -214,6 +221,8 @@ export default {
},
dialogClosed() {
this.$refs.tree.setCheckedKeys([]);
this.$refs.tree2.setCheckedKeys([]);
this.$refs.tree3.setCheckedKeys([]);
this.form = this.getFormDefaultValue();
this.$nextTick(() => {
this.$refs.form.clearValidate("menuIdList");


読み込み中…
キャンセル
保存