| | |
| | | clearable |
| | | placeholder="请选择点位" |
| | | style="width: 240px" |
| | | @change="handlePointLocationChange" |
| | | > |
| | | <el-option |
| | | v-for="item in pointOptions" |
| | |
| | | checkboxlist: [], |
| | | // 点位列表(同德院区,deptType=3) |
| | | pointOptions: [], |
| | | // 点位选择历史值(用于“全部/具体点位”互斥判断) |
| | | pointPrevLocations: [], |
| | | // 表单校验 |
| | | rules: {}, |
| | | }; |
| | |
| | | }); |
| | | }; |
| | | walk(response && response.data); |
| | | this.pointOptions = flat; |
| | | this.pointOptions = [{ label: "全部", value: "all" }, ...flat]; |
| | | // 进入页面默认查询全部点位 |
| | | this.topqueryParams.pointLocations = ["all"]; |
| | | this.pointPrevLocations = ["all"]; |
| | | if (!this.errtype) { |
| | | this.getList(1); |
| | | } |
| | | }); |
| | | }, |
| | | // 点位选择:全部与具体点位互斥 |
| | | handlePointLocationChange(val) { |
| | | const all = "all"; |
| | | const hasAll = val.includes(all); |
| | | if (hasAll && val.length > 1) { |
| | | const prev = this.pointPrevLocations || []; |
| | | if (prev.includes(all)) { |
| | | // 之前已选“全部”,本次新增具体点位 → 去掉“全部” |
| | | this.topqueryParams.pointLocations = val.filter((v) => v !== all); |
| | | } else { |
| | | // 本次新增“全部” → 只保留“全部” |
| | | this.topqueryParams.pointLocations = [all]; |
| | | } |
| | | } |
| | | this.pointPrevLocations = [...this.topqueryParams.pointLocations]; |
| | | }, |
| | | |
| | | // 点位名称:将 pointLocation 编码映射为点位名称 |
| | |
| | | // 构造查询/导出参数:选择点位时科室/病区传 null,否则保持原值 |
| | | buildQueryParams() { |
| | | const params = { ...this.topqueryParams }; |
| | | if ( |
| | | this.topqueryParams.pointLocations && |
| | | this.topqueryParams.pointLocations.length > 0 |
| | | ) { |
| | | let locations = this.topqueryParams.pointLocations || []; |
| | | // “全部”点位:展开为所有实际点位编码 |
| | | if (locations.includes("all")) { |
| | | locations = this.pointOptions |
| | | .filter((p) => p.value !== "all") |
| | | .map((p) => p.value); |
| | | } |
| | | params.pointLocations = locations; |
| | | if (locations.length > 0) { |
| | | params.leaveldeptcodes = null; |
| | | params.leavehospitaldistrictcodes = null; |
| | | } |
| | |
| | | scopetype: [], |
| | | leaveldeptcodes: [], |
| | | leavehospitaldistrictcodes: [], |
| | | pointLocations: [], |
| | | pointLocations: ["all"], |
| | | }; |
| | | this.pointPrevLocations = ["all"]; |
| | | this.handleQuery(1); |
| | | }, |
| | | handleSelectionChange(rows) { |