| | |
| | | getorganization() { |
| | | getorganization({ pageSize: 30 }).then((res) => { |
| | | if (res.code == 200) { |
| | | // 下拉值必须唯一:市一 3 个院区的 orgid 都是 1, |
| | | // 丽水区域各机构的 organizationID 都是 1,单用任一字段都会重复。 |
| | | // 这里用「orgid + organizationID + 下标」组成唯一键,登录时再取真实参数。 |
| | | this.options = (res.rows || []).map((item, index) => ({ |
| | | value: `${item.orgid}__${item.organizationID}__${index}`, |
| | | label: item.organizationName || "", |
| | | campusid: item.organizationID, |
| | | orgid: item.orgid, |
| | | })); |
| | | // 同德系列 / 南华系列 / 浙江省新华医院:用 campusid(organizationID) 作下拉键值; |
| | | // 其余(丽水区域 organizationID 全为 "1" 不唯一):用 orgid 作下拉键值 |
| | | const campusidKeywords = ["同德", "南华", "浙江省新华医院", "第一人民医院"]; |
| | | this.options = (res.rows || []).map((item) => { |
| | | console.log(item.organizationName); |
| | | |
| | | const name = item.organizationName || ""; |
| | | const useCampusid = campusidKeywords.some((kw) => |
| | | name.includes(kw) |
| | | ); |
| | | return { |
| | | value: String(useCampusid ? item.organizationID : item.orgid), |
| | | label: name, |
| | | campusid: item.organizationID, |
| | | orgid: item.orgid, |
| | | }; |
| | | }); |
| | | } |
| | | }); |
| | | }, |