From c899dff1fce7f8054008cd9887a9729cdffd88cb Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期四, 19 十一月 2026 11:34:32 +0800
Subject: [PATCH] 测试完成
---
src/views/followvisit/zysatisfaction/index.vue | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 205 insertions(+), 10 deletions(-)
diff --git a/src/views/followvisit/zysatisfaction/index.vue b/src/views/followvisit/zysatisfaction/index.vue
index 05b216f..54ea141 100644
--- a/src/views/followvisit/zysatisfaction/index.vue
+++ b/src/views/followvisit/zysatisfaction/index.vue
@@ -15,6 +15,18 @@
v-show="showSearch"
label-width="98px"
>
+ <el-form-item label="婊℃剰搴︾被鍨�" prop="satisfactionScope">
+ <el-select
+ v-model="satisfactionScope"
+ placeholder="榛樿绂婚櫌"
+ clearable
+ style="width: 150px"
+ @change="handleSatisfactionScopeChange"
+ >
+ <el-option label="绂婚櫌婊℃剰搴�" value="leave" />
+ <el-option label="鍦ㄩ櫌婊℃剰搴�" value="hospital" />
+ </el-select>
+ </el-form-item>
<!-- <el-form-item label="鍑洪櫌鏃堕棿">
<el-date-picker
v-model="dateRange"
@@ -67,6 +79,24 @@
@change="handleChange"
></el-cascader>
</el-form-item>
+ <el-form-item label="鐐逛綅" prop="pointLocations" v-if="isTongdeCampus">
+ <el-select
+ v-model="topqueryParams.pointLocations"
+ multiple
+ filterable
+ clearable
+ placeholder="璇烽�夋嫨鐐逛綅"
+ style="width: 240px"
+ @change="handlePointLocationChange"
+ >
+ <el-option
+ v-for="item in pointOptions"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ ></el-option>
+ </el-select>
+ </el-form-item>
<!-- <el-form-item label="鏈嶅姟鐘舵��" prop="status">
<el-select
@@ -82,12 +112,16 @@
</el-option>
</el-select>
</el-form-item> -->
+ <!-- 澶勭悊鐘舵�侊細淇濈暀绾ц仈鑱斿姩锛堜竴绾уぇ绫� 鈫� 浜岀骇鍏蜂綋鐘舵�侊級锛�
+ 闈㈡澘鎸傚湪鏈粍浠跺唴(popper-append-to-body=false)锛岄伩鍏嶄笅鎷夎窇鍒板埆澶� -->
<el-form-item label="澶勭悊鐘舵��" prop="status">
<el-cascader
v-model="serviceStatusValue"
placeholder="璇烽�夋嫨"
:options="serviceStatusOptions"
:props="cascaderProps"
+ :popper-append-to-body="false"
+ style="width: 180px"
@change="handleServiceStatusChange"
clearable
></el-cascader>
@@ -375,17 +409,32 @@
label="绉戝"
align="center"
key="leaveldeptname"
- prop="leaveldeptname"
width="120"
>
+ <template slot-scope="scope">
+ {{ deptNameOf(scope.row) }}
+ </template>
</el-table-column>
<el-table-column
label="鐥呭尯"
align="center"
key="leavehospitaldistrictname"
- prop="leavehospitaldistrictname"
width="120"
>
+ <template slot-scope="scope">
+ {{ wardNameOf(scope.row) }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ v-if="isTongdeCampus"
+ label="鐐逛綅"
+ width="120"
+ align="center"
+ key="pointLocation"
+ >
+ <template slot-scope="scope">
+ {{ pointNameOf(scope.row) }}
+ </template>
</el-table-column>
<el-table-column
@@ -393,7 +442,8 @@
align="center"
key="updateBy"
prop="updateBy"
- width="120"
+ min-width="120"
+ :show-overflow-tooltip="true"
/>
<el-table-column
label="浣忛櫌婊℃剰搴︽ā鏉垮悕绉�"
@@ -897,6 +947,7 @@
updateUser,
resetUserPwd,
changeUserStatus,
+ deptTreeSelect,
} from "@/api/system/user";
import {
getTaskservelist,
@@ -1089,6 +1140,8 @@
label: "搴旈殢璁挎棩鏈�(鍊掑簭)",
},
],
+ // 婊℃剰搴︾被鍨嬶細leave=绂婚櫌婊℃剰搴︼紙鎸夌闄㈢瀹�/鐥呭尯鏌ワ級锛宧ospital=鍦ㄩ櫌婊℃剰搴︼紙鎸夊湪闄㈢瀹�/鐥呭尯鏌ワ級
+ satisfactionScope: "leave",
// 鏌ヨ鍙傛暟
topqueryParams: {
pageNum: 1,
@@ -1103,6 +1156,7 @@
scopetype: [],
leaveldeptcodes: [],
leavehospitaldistrictcodes: [],
+ pointLocations: [],
},
propss: { multiple: true },
options: [],
@@ -1194,6 +1248,10 @@
leavehospitaldistrictcode: "",
serviceState: [],
checkboxlist: [],
+ // 鐐逛綅鍒楄〃锛堝悓寰烽櫌鍖猴紝deptType=3锛�
+ pointOptions: [],
+ // 鐐逛綅閫夋嫨鍘嗗彶鍊硷紙鐢ㄤ簬鈥滃叏閮�/鍏蜂綋鐐逛綅鈥濅簰鏂ュ垽鏂級
+ pointPrevLocations: [],
// 琛ㄥ崟鏍¢獙
rules: {},
};
@@ -1224,6 +1282,7 @@
} else {
this.getList(1);
}
+ this.getPointOptions();
this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg;
});
@@ -1250,21 +1309,26 @@
);
console.log(this.topqueryParams.leavehospitaldistrictcodes, "11");
}
+
+ const queryParams = this.buildQueryParams();
+
this.loading = true;
if (
- this.topqueryParams.leavehospitaldistrictcodes[0] &&
- this.topqueryParams.leaveldeptcodes[0]
+ queryParams.leavehospitaldistrictcodes &&
+ queryParams.leavehospitaldistrictcodes[0] &&
+ queryParams.leaveldeptcodes &&
+ queryParams.leaveldeptcodes[0]
) {
- this.topqueryParams.deptOrDistrict = 2;
+ queryParams.deptOrDistrict = 2;
} else {
- this.topqueryParams.deptOrDistrict = 1;
+ queryParams.deptOrDistrict = 1;
}
if (!this.followupAuthority()) {
this.$message.warning("鏈厤缃瀹�/鐥呭尯鐩稿叧鏉冮檺涓嶅彲鏌ヨ");
return Promise.reject(new Error("鏃犳潈闄愭煡璇�"));
}
- getTaskservelist(this.topqueryParams).then((response) => {
+ getTaskservelist(this.buildScopePayload(queryParams)).then((response) => {
this.userList = response.rows[0].serviceSubtaskList;
this.total = response.total;
if (refresh) {
@@ -1309,6 +1373,104 @@
this.total = response.total;
});
},
+
+ // 鍒囨崲婊℃剰搴︾被鍨嬶紙绂婚櫌/鍦ㄩ櫌锛夊悗閲嶆柊鏌ヨ
+ handleSatisfactionScopeChange() {
+ this.topqueryParams.pageNum = 1;
+ this.getList(1);
+ },
+
+ // 鎸夋弧鎰忓害绫诲瀷缁勮绉戝/鐥呭尯鏉′欢锛�
+ // 绂婚櫌婊℃剰搴� => leaveldeptcodes / leavehospitaldistrictcodes锛�
+ // 鍦ㄩ櫌婊℃剰搴� => deptcodes / hospitaldistrictcodes锛堝湪闄㈢瀹ゃ�佸湪闄㈢梾鍖猴級
+ buildScopePayload(params) {
+ const payload = { ...params };
+ if (this.satisfactionScope === "hospital") {
+ // 閫夌偣浣嶆椂 leaveldeptcodes/leavehospitaldistrictcodes 涓� null锛岄渶鍘熸牱閫忎紶锛屼笉鑳� || [] 鍏滄垚绌烘暟缁�
+ payload.deptcodes = params.leaveldeptcodes;
+ payload.hospitaldistrictcodes = params.leavehospitaldistrictcodes;
+ delete payload.leaveldeptcodes;
+ delete payload.leavehospitaldistrictcodes;
+ }
+ return payload;
+ },
+
+ // 绉戝鍚嶇О锛氬湪闄㈡弧鎰忓害浼樺厛鍙栧湪闄㈢瀹わ紝鍏朵綑鍙栧嚭闄㈢瀹�
+ deptNameOf(row) {
+ if (!row) return "-";
+ return (
+ (this.satisfactionScope === "hospital"
+ ? row.deptname || row.leaveldeptname
+ : row.leaveldeptname || row.deptname) || "-"
+ );
+ },
+
+ // 鐥呭尯鍚嶇О锛氬湪闄㈡弧鎰忓害浼樺厛鍙栧湪闄㈢梾鍖猴紝鍏朵綑鍙栧嚭闄㈢梾鍖�
+ wardNameOf(row) {
+ if (!row) return "-";
+ return (
+ (this.satisfactionScope === "hospital"
+ ? row.hospitaldistrictname || row.leavehospitaldistrictname
+ : row.leavehospitaldistrictname || row.hospitaldistrictname) || "-"
+ );
+ },
+
+ // 鐐逛綅鍒楄〃锛堝悓寰烽櫌鍖猴紝deptType=3锛�
+ getPointOptions() {
+ if (!this.isTongdeCampus) return;
+ deptTreeSelect(3).then((response) => {
+ const flat = [];
+ const walk = (nodes) => {
+ (Array.isArray(nodes) ? nodes : []).forEach((n) => {
+ if (n.label && n.deptCode) {
+ flat.push({ label: n.label, value: String(n.deptCode) });
+ }
+ if (n.children && n.children.length) walk(n.children);
+ });
+ };
+ walk(response && response.data);
+ 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 缂栫爜鏄犲皠涓虹偣浣嶅悕绉�
+ pointNameOf(row) {
+ if (
+ !row ||
+ row.pointLocation === undefined ||
+ row.pointLocation === null ||
+ row.pointLocation === ""
+ ) {
+ return "";
+ }
+ const found = this.pointOptions.find(
+ (p) => String(p.value) === String(row.pointLocation)
+ );
+ return found ? found.label : row.pointLocation;
+ },
+
// 鏈嶅姟鐘舵�佸彉鏇村鐞�
handleServiceStatusChange(value) {
// 娓呯┖閫夋嫨
@@ -1487,6 +1649,23 @@
this.topqueryParams.finishtimeEnd = this.dateRangefs[1];
this.getList(refresh);
},
+ // 鏋勯�犳煡璇�/瀵煎嚭鍙傛暟锛氶�夋嫨鐐逛綅鏃剁瀹�/鐥呭尯浼� null锛屽惁鍒欎繚鎸佸師鍊�
+ buildQueryParams() {
+ const params = { ...this.topqueryParams };
+ 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;
+ }
+ return params;
+ },
// 鎮h�呰寖鍥村鐞�
handleChange(value) {
let type = value[0];
@@ -1522,7 +1701,9 @@
scopetype: [],
leaveldeptcodes: [],
leavehospitaldistrictcodes: [],
+ pointLocations: ["all"],
};
+ this.pointPrevLocations = ["all"];
this.handleQuery(1);
},
/** 閲嶇疆鎸夐挳鎿嶄綔 */
@@ -1543,7 +1724,9 @@
scopetype: [],
leaveldeptcodes: [],
leavehospitaldistrictcodes: [],
+ pointLocations: ["all"],
};
+ this.pointPrevLocations = ["all"];
},
handleSelectionChange(rows) {
this.selectedRows = rows.map((row) => {
@@ -1836,15 +2019,22 @@
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
+ // 瀵煎嚭闇�瑕佸叏閲忔暟鎹紝涓存椂鍘绘帀鍒嗛〉锛涘鍑哄悗蹇呴』杩樺師锛屽惁鍒欏垎椤典細绠楁垚 Infinity锛堥〉鐮佹樉绀� infinity锛�
+ const originalPageNum = this.topqueryParams.pageNum;
+ const originalPageSize = this.topqueryParams.pageSize;
this.topqueryParams.pageNum = null;
this.topqueryParams.pageSize = null;
this.download(
"smartor/serviceSubtask/patItemExport",
{
- ...this.topqueryParams,
+ ...this.buildScopePayload(this.buildQueryParams()),
},
`user_${new Date().getTime()}.xlsx`
- );
+ ).finally(() => {
+ this.topqueryParams.pageNum = originalPageNum;
+ this.topqueryParams.pageSize = originalPageSize;
+ this.getList();
+ });
},
// 寮傚父鍒楁覆鏌�
tableRowClassName({ row, rowIndex }) {
@@ -2085,6 +2275,11 @@
box-shadow: 0 2px 12px rgba(31, 45, 61, 0.05);
}
+/* 绾ц仈涓嬫媺鎸傚湪鏈粍浠跺唴鏃讹紝浠ユ墍鍦ㄨ〃鍗曢」涓哄畾浣嶅熀鍑嗭紝閬垮厤闈㈡澘璺戝埌椤甸潰鍒 */
+::v-deep .el-form--inline .el-form-item {
+ position: relative;
+}
+
/* 闅愯棌鍒嗗壊绾� */
::v-deep .el-divider {
display: none;
--
Gitblit v1.9.3