|
|
@@ -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"); |
|
|
|