From 640f40c9124481f888276c5b37f5d3ed1cfaf24c Mon Sep 17 00:00:00 2001 From: miaojiale <1123971748@qq.com> Date: Tue, 6 Jun 2023 16:32:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8C=BB=E8=81=94=E4=BD=93?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E5=85=A8=E9=83=A8=E6=8C=89=E9=92=AE,?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=87=92=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DialogComponents/Form.vue | 17 ++++++++- src/views/systems/user/index.vue | 48 +++++++++++++++++------- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/src/components/DialogComponents/Form.vue b/src/components/DialogComponents/Form.vue index 9580768..27f435a 100644 --- a/src/components/DialogComponents/Form.vue +++ b/src/components/DialogComponents/Form.vue @@ -162,7 +162,22 @@ v-el-select-loadmore="loadmore" @change="item.func ? item.func($event) : {}" > + <!--ç¦ç”¨allçš„æ¡ä»¶: valueæœ‰å€¼ï¼Œå¹¶ä¸”å€¼ä¸æ˜¯all--> <el-option + :key="'all'" + label="全部" + value="all" + :disabled=" + form[item.prop] + ? form[item.prop].length > 0 && + form[item.prop].indexOf('all') < 0 + : false + " + ></el-option> +    + <!--ç¦ç”¨éžallæ¡ä»¶: form[item.prop]为all--> + <el-option + :disabled="form[item.prop] == 'all'" v-for="(opt, optIndex) in item.opts" :key="optIndex" :label="opt.label" @@ -368,7 +383,7 @@ export default { }, methods: { loadmore() { - this.$emit("loadMore", this.current + 1) + // this.$emit("loadMore", this.current + 1) }, open() { this.visible = true diff --git a/src/views/systems/user/index.vue b/src/views/systems/user/index.vue index c4c28a2..cdc96d4 100644 --- a/src/views/systems/user/index.vue +++ b/src/views/systems/user/index.vue @@ -439,6 +439,7 @@ export default { rules: [ { required: true, message: "请选择医è”体", trigger: "change" }, ], + func: this.valueChange, multiple: true, }, ], @@ -459,6 +460,13 @@ export default { this.loadMore() }, methods: { + valueChange(val) { + console.log(val) + if (val.includes("all")) { + // this.unionIds = this.consortiaList.map((e) => e.id) + console.log(this.consortiaDataRole[0].opts) + } + }, // 修改å¯ç”¨çŠ¶æ€ // å¯ç”¨çŠ¶æ€ openChage(data, index) { @@ -478,7 +486,7 @@ export default { let params = { current: current, unionName: this.searchQuery ? this.searchQuery : undefined, - size: 20, + size: 10000, } medicalunionList(params).then((res) => { if (res.code === 1) { @@ -509,19 +517,29 @@ export default { this.options = [] } }, + // 授æƒåŒ»è”体 handleConsortiaConfirm(unionIds) { - console.log(unionIds, this.rowId) + let unionIdList = unionIds.consortiaList + if (unionIds.consortiaList.includes("all")) { + unionIdList = this.consortiaDataRole[0].opts.map((e) => e.value) + } const data = { userId: this.rowId, - unionIds: unionIds.consortiaList, + unionIds: unionIdList, } - baseUnion(data).then((res) => { - if (res.code === 1) { - this.$message.success("æŽˆæƒæˆåŠŸ") - this.handleSearch() - this.$refs.consortiaRole.close() - } - }) + baseUnion(data) + .then((res) => { + if (res.code === 1) { + this.$message.success("æŽˆæƒæˆåŠŸ") + this.handleSearch() + this.$refs.consortiaRole.close() + } else { + this.$refs.consortiaRole.loading = false + } + }) + .catch(() => { + this.$refs.consortiaRole.loading = false + }) }, orgChange(orgId) { const list = [] @@ -594,6 +612,7 @@ export default { } }) }, + // 医è”体授æƒå¼¹çª— handleConsortia({ id }) { this.rowId = id this.$refs.consortiaRole.open() @@ -604,10 +623,13 @@ export default { res.data.unionList.map((item) => { consortiaList.push(item.id) }) - - this.consortiaList = [...consortiaList] + if (consortiaList.length == this.consortiaDataRole[0].opts.length) { + this.consortiaList = ["all"] + } else { + this.consortiaList = consortiaList + } this.$refs.consortiaRole.initFields({ - consortiaList: consortiaList, + consortiaList: this.consortiaList, }) } }) -- 2.22.0