Commit 640f40c9 authored by miaojiale's avatar miaojiale

增加医联体授权全部按钮,取消懒加载

parent 52c048f5
......@@ -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
......
......@@ -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,
})
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment