From bbbc478129f72b26e2ec4a2e981ed8698a96880c Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 22 十月 2026 00:28:18 +0800
Subject: [PATCH] 当service_type=6时,需要根据传入的入院还是离院病区(病区)去后端查询
---
src/views/Satisfaction/sfstatistics/components/SatisfactionStatistics.vue | 62 ++++++++++++++++++++++++++++---
1 files changed, 56 insertions(+), 6 deletions(-)
diff --git a/src/views/Satisfaction/sfstatistics/components/SatisfactionStatistics.vue b/src/views/Satisfaction/sfstatistics/components/SatisfactionStatistics.vue
index 5646d6b..eda31ce 100644
--- a/src/views/Satisfaction/sfstatistics/components/SatisfactionStatistics.vue
+++ b/src/views/Satisfaction/sfstatistics/components/SatisfactionStatistics.vue
@@ -11,6 +11,18 @@
label-width="100px"
class="query-form"
>
+ <el-form-item label="婊℃剰搴︾被鍨�" prop="satisfactionScope">
+ <el-select
+ v-model="satisfactionScope"
+ placeholder="榛樿鍦ㄩ櫌"
+ clearable
+ style="width: 140px"
+ @change="handleSearch"
+ >
+ <el-option label="绂婚櫌婊℃剰搴�" value="leave" />
+ <el-option label="鍦ㄩ櫌婊℃剰搴�" value="hospital" />
+ </el-select>
+ </el-form-item>
<el-form-item label="缁熻绫诲瀷" prop="patientSource">
<el-select
v-model="queryParams.type"
@@ -684,6 +696,10 @@
dicts: ["dimensionality_type"],
data() {
return {
+ // 婊℃剰搴︾被鍨嬶細leave=绂婚櫌婊℃剰搴︼紙leaveldeptcodes/leavehospitaldistrictcodes锛夛紝
+ // hospital=鍦ㄩ櫌婊℃剰搴︼紙deptcodes/hospitaldistrictcodes锛�
+ // 榛樿鍦ㄩ櫌锛氫繚鎸佽椤靛師鏈夎姹傚弬鏁颁笉鍙�
+ satisfactionScope: "hospital",
// 鏌ヨ鍙傛暟
queryParams: {
type: 2,
@@ -866,6 +882,11 @@
const dict = this.dict && this.dict.type && this.dict.type.dimensionality_type;
return dict ? dict.map((d) => String(d.value)) : [];
},
+
+ // 鏄惁鎸夈�屽湪闄㈡弧鎰忓害銆嶅彛寰勬煡璇紙鏈〉榛樿鍦ㄩ櫌锛屾墍浠ユ竻绌轰笅鎷夋椂浠嶆寜鍦ㄩ櫌澶勭悊锛�
+ isInHospitalSatisfaction() {
+ return this.satisfactionScope !== "leave";
+ },
},
mounted() {
@@ -892,6 +913,8 @@
async initData() {
await this.getDeptList();
await this.getWardList();
+ // 鎺ュ彛榛樿鎸夈�屽叏閮ㄧ瀹� + 鍏ㄩ儴鐥呭尯 + 鏈�杩�7澶┿�嶆煡璇紝杩欓噷鎶婂疄闄呬娇鐢ㄧ殑鏉′欢鍥炴樉鍒扮瓫閫夋
+ this.echoQueryParams();
this.initChart();
await this.loadData();
},
@@ -920,6 +943,33 @@
});
resolve();
});
+ },
+
+ // 绉戝/鐥呭尯鏉′欢锛�
+ // 鍦ㄩ櫌婊℃剰搴� => deptcodes / hospitaldistrictcodes锛涚闄㈡弧鎰忓害 => leaveldeptcodes / leavehospitaldistrictcodes
+ buildScopeParams() {
+ const deptCodes = this.deptCodes;
+ const wardCodes = this.hospitalDistrictCodes;
+ return this.isInHospitalSatisfaction
+ ? { deptcodes: deptCodes, hospitaldistrictcodes: wardCodes }
+ : { leaveldeptcodes: deptCodes, leavehospitaldistrictcodes: wardCodes };
+ },
+
+ // 鎶婃帴鍙e疄闄呬娇鐢ㄧ殑鏌ヨ鏉′欢鍥炴樉鍒扮瓫閫夋锛�
+ // 绉戝/鐥呭尯鏈�夋椂鎺ュ彛鎸夈�屽叏閮ㄣ�嶆煡锛屾椂闂存湭閫夋椂鎺ュ彛鎸夈�屾渶杩�7澶┿�嶆煡锛岃繖閲屾妸鍚屾牱鐨勫�煎啓鍥炵瓫閫夋
+ echoQueryParams() {
+ if (
+ !this.queryParams.dateRange ||
+ this.queryParams.dateRange.length !== 2
+ ) {
+ this.queryParams.dateRange = [this.startTime, this.endTime];
+ }
+ if (!(this.queryParams.deptCodes || []).length) {
+ this.queryParams.deptCodes = this.deptList.map((dept) => dept.value);
+ }
+ if (!(this.queryParams.wardCodes || []).length) {
+ this.queryParams.wardCodes = this.wardList.map((ward) => ward.value);
+ }
},
// 鑾峰彇鍥捐〃鏍囬
@@ -963,8 +1013,7 @@
type: this.queryParams.type,
startTime: this.startTime,
endTime: this.endTime,
- deptcodes: this.deptCodes, // 浣跨敤璁$畻灞炴��
- hospitaldistrictcodes: this.hospitalDistrictCodes, // 浣跨敤璁$畻灞炴��
+ ...this.buildScopeParams(),
templateid: this.templateId,
};
@@ -983,8 +1032,7 @@
type: this.queryParams.type,
startTime: this.startTime,
endTime: this.endTime,
- deptcodes: this.deptCodes, // 浣跨敤璁$畻灞炴��
- hospitaldistrictcodes: this.hospitalDistrictCodes, // 浣跨敤璁$畻灞炴��
+ ...this.buildScopeParams(),
templateid: this.templateId,
questionType: this.queryParams.type || null,
serviceTypes: this.defaultServiceTypes,
@@ -2012,8 +2060,10 @@
handleReset() {
this.$refs.queryForm.resetFields();
this.queryParams.dateRange = [];
- this.queryParams.deptCodes = []; // 閲嶇疆涓烘暟缁�
- this.queryParams.wardCodes = []; // 閲嶇疆涓烘暟缁�
+ this.queryParams.deptCodes = []; // 閲嶇疆涓烘暟缁�
+ this.queryParams.wardCodes = []; // 閲嶇疆涓烘暟缁�
+ // 閲嶇疆鍚庢帴鍙d粛鎸夈�屽叏閮ㄧ瀹�/鍏ㄩ儴鐥呭尯 + 鏈�杩�7澶┿�嶆煡璇紝绛涢�夋鍚屾鍥炴樉锛岄伩鍏嶆閲岀┖绌恒�佽姹傞噷鏈夊��
+ this.echoQueryParams();
this.detailQueryParams.pageNum = 1;
this.dimensionQueryParams.pageNum = 1;
this.loadData();
--
Gitblit v1.9.3