From 0db5b7d7779c0ef677c3f20072f275fec6a99da5 Mon Sep 17 00:00:00 2001 From: WXL (wul) <wl_5969728@163.com> Date: 星期一, 18 八月 2025 16:32:14 +0800 Subject: [PATCH] 测试完成 --- src/views/sfstatistics/percentage/index.vue | 371 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 345 insertions(+), 26 deletions(-) diff --git a/src/views/sfstatistics/percentage/index.vue b/src/views/sfstatistics/percentage/index.vue index a045763..a9288cf 100644 --- a/src/views/sfstatistics/percentage/index.vue +++ b/src/views/sfstatistics/percentage/index.vue @@ -44,16 +44,11 @@ v-show="showSearch" label-width="98px" > - <!-- <el-form-item label="鍖婚櫌" prop="userName"> - <el-select v-model="queryParams.value1" placeholder="璇烽�夋嫨"> - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value" - > - </el-option> - </el-select> + <!-- <el-form-item label="璐d换鍖荤敓" prop="userName"> + <el-input + v-model="queryParams.drname" + placeholder="璇疯緭鍏ヤ富娌诲尰鐢�" + ></el-input> </el-form-item> --> <el-form-item label="缁熻绫诲瀷" prop="userName"> <el-select @@ -149,18 +144,231 @@ >閲嶇疆</el-button > </el-form-item> + <el-col :span="19"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="medium" + @click="handleExport" + >瀵煎嚭</el-button + > + </el-col> </el-form> - <!-- <right-toolbar - :showSearch.sync="showSearch" - @queryTable="getList" - :columns="columns" - ></right-toolbar> --> <el-table v-loading="loading" :data="userList" :border="true" @selection-change="handleSelectionChange" + @row-click="handleRowClick" + @expand-change="handleRowClick" + :row-key="getRowKey" + :expand-row-keys="expands" > + <!-- 灞曞紑琛岀澶村垪 --> + <el-table-column type="expand"> + <template slot-scope="props"> + <el-table + :data="props.row.doctorStats" + border + style="width: 95%; margin: 0 auto" + class="inner-table" + > + <el-table-column + label="鍖荤敓濮撳悕" + prop="drname" + align="center" + /> + <el-table-column + label="绉戝" + width="120" + prop="deptname" + align="center" + /> + <el-table-column + label="鍑洪櫌浜烘" + prop="dischargeCount" + align="center" + /> + <el-table-column + label="鍑洪櫌浜烘" + align="center" + key="dischargeCount" + prop="dischargeCount" + > + </el-table-column> + + <el-table-column + label="鏃犻渶闅忚浜烘" + align="center" + width="100" + key="nonFollowUp" + prop="nonFollowUp" + > + </el-table-column> + <el-table-column + label="搴旈殢璁夸汉娆�" + align="center" + width="100" + key="followUpNeeded" + prop="followUpNeeded" + > + </el-table-column> + <el-table-column align="center" label="棣栨鍑洪櫌闅忚"> + <el-table-column + label="搴旈殢璁�" + align="center" + key="needFollowUp" + prop="needFollowUp" + > + </el-table-column> + <el-table-column + label="寰呴殢璁�" + align="center" + key="pendingFollowUp" + prop="pendingFollowUp" + > + </el-table-column> + <el-table-column + label="闅忚鎴愬姛" + align="center" + key="followUpSuccess" + prop="followUpSuccess" + > + </el-table-column> + <el-table-column + label="闅忚澶辫触" + align="center" + key="followUpFail" + prop="followUpFail" + > + </el-table-column> + <el-table-column + label="闅忚鐜�" + align="center" + width="120" + key="followUpRate" + prop="followUpRate" + > + <!-- <template slot-scope="scope"> + <span + >{{ + (Number(scope.row.followUpRate) * 100).toFixed(2) + }}%</span + > + </template> --> + </el-table-column> + <el-table-column + label="鍙婃椂鐜�" + align="center" + width="120" + key="rate" + prop="rate" + > + <template slot-scope="scope"> + <el-button + size="medium" + type="text" + @click="Seedetails(scope.row)" + ><span class="button-zx" + >{{ + (Number(scope.row.rate) * 100).toFixed(2) + }}%</span + ></el-button + > + </template> + </el-table-column> + <el-table-column + label="浜哄伐" + align="center" + key="manual" + prop="manual" + > + </el-table-column> + <el-table-column + label="鐭俊" + align="center" + key="sms" + prop="sms" + > + </el-table-column> + <el-table-column + label="寰俊" + align="center" + key="weChat" + prop="weChat" + > + </el-table-column> + </el-table-column> + <el-table-column align="center" label="鍐嶆鍑洪櫌闅忚"> + <el-table-column + label="搴旈殢璁�" + align="center" + key="needFollowUpAgain" + prop="needFollowUpAgain" + > + </el-table-column> + <el-table-column + label="寰呴殢璁�" + align="center" + key="pendingFollowUpAgain" + prop="pendingFollowUpAgain" + > + </el-table-column> + <el-table-column + label="闅忚鎴愬姛" + align="center" + key="followUpSuccessAgain" + prop="followUpSuccessAgain" + > + </el-table-column> + <el-table-column + label="闅忚澶辫触" + align="center" + key="followUpFailAgain" + prop="followUpFailAgain" + > + </el-table-column> + <el-table-column + label="闅忚鐜�" + align="center" + width="120" + key="followUpRateAgain" + prop="followUpRateAgain" + > + <!-- <template slot-scope="scope"> + <span + >{{ + (Number(scope.row.FollowUpRateAgain) * 100).toFixed(2) + }}%</span + > + </template> --> + </el-table-column> + <el-table-column + label="浜哄伐" + align="center" + key="manualAgain" + prop="manualAgain" + > + </el-table-column> + <el-table-column + label="鐭俊" + align="center" + key="smsAgain" + prop="smsAgain" + > + </el-table-column> + <el-table-column + label="寰俊" + align="center" + key="weChatAgain" + prop="weChatAgain" + > + </el-table-column> + </el-table-column> + </el-table> + </template> + </el-table-column> <el-table-column label="鍑洪櫌鐥呭尯" align="center" @@ -639,6 +847,7 @@ return { topactiveName: "Local", //椤堕儴閫夋嫨 activeName: "first", //渚ц竟閫夋嫨 + expands: [], // 閬僵灞� loading: false, Seedloading: false, @@ -698,6 +907,10 @@ postOptions: [], // 瑙掕壊閫夐」 roleOptions: [], + // 瀛樺偍鎵�鏈夌瀹や唬鐮� + allDeptCodes: [], + // 瀛樺偍鎵�鏈夌梾鍖轰唬鐮� + allWardCodes: [], // 琛ㄥ崟鍙傛暟 form: {}, forms: { @@ -774,6 +987,8 @@ serviceType: [2], dateRange: [], statisticaltype: 1, + leavehospitaldistrictcodes: ["all"], // 榛樿閫変腑鍏ㄩ儴鐥呭尯 + deptcodes: [], // 榛樿閫変腑鍏ㄩ儴绉戝 }, // 鍒椾俊鎭� columns: [ @@ -789,18 +1004,68 @@ }, watch: {}, created() { - this.getList(); this.getDeptTree(); + this.getList(); }, methods: { /** 鏌ヨ鏍囩鍒楄〃 */ getList() { - getSfStatistics(this.queryParams).then((response) => { + // 澶勭悊鏌ヨ鍙傛暟 + const params = { + ...this.queryParams, + // 濡傛灉閫夋嫨浜�"鍏ㄩ儴"锛屽垯浼犳墍鏈夌梾鍖�/绉戝浠g爜 + leavehospitaldistrictcodes: + this.queryParams.leavehospitaldistrictcodes.includes("all") + ? this.allWardCodes + : this.queryParams.leavehospitaldistrictcodes, + deptcodes: this.queryParams.deptcodes.includes("all") + ? this.allDeptCodes + : this.queryParams.deptcodes, + }; + + // 绉婚櫎鍙兘瀛樺湪鐨�"all"鍊� + delete params.leavehospitaldistrictcodes.all; + delete params.deptcodes.all; + getSfStatistics(params).then((response) => { console.log(response); // this.total = response.total; this.userList = response.data; }); + }, + getRowKey(row) { + return row.statisticaltype === 1 + ? row.leavehospitaldistrictcode + : row.deptcode; + }, + + // 澶勭悊琛岀偣鍑诲睍寮� + handleRowClick(row) { + console.log(row,'row'); + + // 濡傛灉宸茬粡灞曞紑鍒欐敹璧� + if (this.expands.includes(this.getRowKey(row))) { + this.expands = []; + return; + } + // 澶勭悊鏌ヨ鍙傛暟 + const params = { + ...this.queryParams, + // 濡傛灉閫夋嫨浜�"鍏ㄩ儴"锛屽垯浼犳墍鏈夌梾鍖�/绉戝浠g爜 + leavehospitaldistrictcodes: [row.leavehospitaldistrictcode], + drcode: "1", + }; + // 濡傛灉璇ヨ杩樻病鏈夊姞杞藉尰鐢熸暟鎹紝鍒欏姞杞� + if (!row.doctorStats) { + this.loading = true; + getSfStatistics(params).then((res) => { + this.$set(row, "doctorStats", res.data); + this.expands = [this.getRowKey(row)]; + this.loading = false; + }); + } else { + this.expands = [this.getRowKey(row)]; + } }, /** 淇敼鏍囩 */ handleUpdate(row) { @@ -824,17 +1089,25 @@ value: dept.deptCode, }; }); - this.flatArrayhospit = store.getters.belongWards.map((dept) => { + // 瀛樺偍鎵�鏈夌瀹や唬鐮� + this.allDeptCodes = store.getters.belongDepts.map( + (dept) => dept.deptCode + ); + + // 鐥呭尯鍒楄〃 + this.flatArrayhospit = store.getters.belongWards.map((ward) => { return { - label: dept.districtName, - value: dept.districtCode, + label: ward.districtName, + value: ward.districtCode, }; }); - // deptTreeSelect().then((response) => { - // this.deptOptions = response.data; - // console.log(this.deptOptions, " this.deptOptions"); - // this.flatArray = this.flattenArray(response.data); - // }); + + // 瀛樺偍鎵�鏈夌梾鍖轰唬鐮� + this.allWardCodes = store.getters.belongWards.map( + (ward) => ward.districtCode + ); + this.flatArraydept.push({ label: "鍏ㄩ儴", value: "all" }); + this.flatArrayhospit.push({ label: "鍏ㄩ儴", value: "all" }); }, flattenArray(multiArray) { let result = []; @@ -970,7 +1243,7 @@ /** 鎼滅储鎸夐挳鎿嶄綔 */ handleQuery() { this.queryParams.pageNum = 1; - if (this.queryParams.dateRange) this.queryParams.dateRange = []; + if (!this.queryParams.dateRange) this.queryParams.dateRange = []; if (this.queryParams.statisticaltype == 1) { this.queryParams.deptcodes = []; } else if (this.queryParams.statisticaltype == 2) { @@ -1124,6 +1397,52 @@ font-size: 20px; } } +/* 浣胯鏈夋墜鍨嬫寚閽� */ +.el-table__row { + cursor: pointer; +} +/* 鍐呭眰鍖荤敓琛ㄦ牸鏍峰紡 */ +.inner-table { + // 琛ㄥご鑳屾櫙鑹� + ::v-deep .el-table__header-wrapper { + background-color: #f0f7ff !important; + + th { + background-color: #f0f7ff !important; + } + } + + // 琛ㄦ牸琛岃儗鏅壊 + ::v-deep .el-table__body-wrapper { + tr { + background-color: #f9fbfe !important; + + &:hover { + background-color: #e6f1ff !important; + } + } + } + + // 杈规棰滆壊 + ::v-deep .el-table--border { + border-color: #d9e8ff !important; + + td, + th { + border-color: #d9e8ff !important; + } + } + + // 鏂戦┈绾规晥鏋� + ::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td { + background-color: #f5f9ff !important; + } +} +/* 灞曞紑琛屾牱寮� */ +.el-table__expanded-cell { + padding: 10px 0 !important; + background: #f8f8f8; +} .document { width: 100px; height: 50px; -- Gitblit v1.9.3