|
|
|
@ -136,6 +136,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
|
|
|
|
import { getapi, postapi } from "@/api/api"; |
|
|
|
import { mapState } from "vuex"; |
|
|
|
export default { |
|
|
|
@ -167,16 +168,30 @@ export default { |
|
|
|
methods: { |
|
|
|
//保存按钮 |
|
|
|
Onsubmit() { |
|
|
|
console.log(this.personnelUnit.id); |
|
|
|
if (this.personnelUnit.id === "") { |
|
|
|
this.$message.warning("请先选择单位分组"); |
|
|
|
if (!this.personnelUnit.customerOrgGroupId) { |
|
|
|
alert("请先选择单位分组"); |
|
|
|
return; |
|
|
|
} else { |
|
|
|
postapi("/api/app/customer-org-group-detail/many", this.addrulst).then( |
|
|
|
(res) => { |
|
|
|
this.$message.success("操作成功"); |
|
|
|
console.log(this.addrulst); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// console.log(this.addrulst); |
|
|
|
// // console.log(this.personnelUnit.form.id); |
|
|
|
// if (this.addrulst[customerOrgGroupId] == undefined) { |
|
|
|
// this.$message.warning("请先选择单位分组"); |
|
|
|
// } else { |
|
|
|
// postapi("/api/app/customer-org-group-detail/many", this.addrulst).then( |
|
|
|
// (res) => { |
|
|
|
// console.log(this.personnelUnit.form.id); |
|
|
|
// this.$message.success("操作成功"); |
|
|
|
// } |
|
|
|
// ); |
|
|
|
// } |
|
|
|
}, |
|
|
|
//移除按钮 |
|
|
|
addselecteditems() { |
|
|
|
@ -188,15 +203,23 @@ export default { |
|
|
|
for (var i = count; i >= 0; i--) { |
|
|
|
// this.personnelUnit.nogroupselected.splice(i, 1); |
|
|
|
if ( |
|
|
|
!this.rightselctedata.includes(this.rightselctedata[i].displayName) |
|
|
|
// !this.rightselctedata.includes(this.rightselctedata[i].displayName) |
|
|
|
[...new Set(this.rightselctedata)] |
|
|
|
) { |
|
|
|
this.tabledata.push(this.rightselctedata[i]); |
|
|
|
this.personnelUnit.nogroupselected.splice(i, 1); |
|
|
|
console.log(this.rightselctedata[i]); |
|
|
|
|
|
|
|
} |
|
|
|
// this.tabledata.push(this.rightselctedata[i]); |
|
|
|
} |
|
|
|
// this. |
|
|
|
this.rightselctedata.forEach((item) => { |
|
|
|
this.addrulst.push({ |
|
|
|
asbitemId: item.id, |
|
|
|
price: item.price, |
|
|
|
customerOrgGroupId: this.personnelUnit.customerOrgGroupId, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
//右侧勾选按钮 |
|
|
|
@ -215,18 +238,17 @@ export default { |
|
|
|
for (var i = count; i >= 0; i--) { |
|
|
|
// this.tabledata.splice(i, 1); |
|
|
|
// this.personnelUnit.nogroupselected.push(this.unselecteddata[i]); |
|
|
|
if ( |
|
|
|
[...new Set(this.unselecteddata)] |
|
|
|
) { |
|
|
|
if ([...new Set(this.unselecteddata)]) { |
|
|
|
this.tabledata.splice(i, 1); |
|
|
|
this.personnelUnit.nogroupselected.push(this.unselecteddata[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.unselecteddata.forEach((item) => { |
|
|
|
this.addrulst.push({ |
|
|
|
asbitemId: item.id, |
|
|
|
price: item.price, |
|
|
|
customerOrgGroupId: this.personnelUnit.form.id, |
|
|
|
customerOrgGroupId: this.personnelUnit.customerOrgGroupId, |
|
|
|
}); |
|
|
|
}); |
|
|
|
console.log(this.addrulst, "hhhhhhh"); |
|
|
|
@ -292,6 +314,35 @@ export default { |
|
|
|
this.options = res.data; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//获取当前列列表数据 |
|
|
|
listeninglist() { |
|
|
|
getapi( |
|
|
|
`/api/app/customer-org-group/${this.personnelUnit.customerOrgGroupId}` |
|
|
|
).then((res) => { |
|
|
|
this.personnelUnit.form = res.data; |
|
|
|
console.log(res); |
|
|
|
}); |
|
|
|
getapi( |
|
|
|
`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.form.id}` |
|
|
|
).then((res) => { |
|
|
|
console.log(res); |
|
|
|
this.personnelUnit.nogroupselected = res.data; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// getapi(`/api/app/customer-org-group/${row.id}`).then((res) |
|
|
|
}, |
|
|
|
//监听事件 |
|
|
|
watch: { |
|
|
|
// |
|
|
|
"personnelUnit.customerOrgGroupId"(newVal, oldVal) { |
|
|
|
//console.log('patientRegister.addTimes newVal:',newVal,' oldVal:',oldVal) |
|
|
|
if (newVal != oldVal) { |
|
|
|
console.log("newVal", newVal); |
|
|
|
this.listeninglist(); |
|
|
|
// |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|