| | |
| | | :summary-method="getInnerSummaries" |
| | | > |
| | | <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 label="æ éé访人次" align="center" width="100" key="nonFollowUp" prop="nonFollowUp" /> |
| | | <el-table-column label="åºé访人次" align="center" width="100" key="followUpNeeded" prop="followUpNeeded" /> |
| | | <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 |
| | | label="æ éé访人次" |
| | | align="center" |
| | | width="100" |
| | | key="nonFollowUp" |
| | | prop="nonFollowUp" |
| | | /> |
| | | <el-table-column |
| | | label="åºé访人次" |
| | | align="center" |
| | | width="100" |
| | | key="followUpNeeded" |
| | | prop="followUpNeeded" |
| | | /> |
| | | |
| | | <el-table-column align="center" label="馿¬¡åºé¢é访"> |
| | | <el-table-column label="éé访" align="center" key="needFollowUp" prop="needFollowUp" /> |
| | | <el-table-column label="å¾
é访" align="center" key="pendingFollowUp" prop="pendingFollowUp" /> |
| | | <el-table-column label="é访æå" align="center" key="followUpSuccess" prop="followUpSuccess" /> |
| | | <el-table-column label="é访失败" align="center" key="followUpFail" prop="followUpFail" /> |
| | | <el-table-column label="é访ç" align="center" width="120" key="followUpRate" prop="followUpRate" /> |
| | | <el-table-column v-if="orgname != '丽水å¸ä¸å»é¢'" label="åæ¶ç" align="center" width="120" key="rate" prop="rate"> |
| | | <el-table-column |
| | | label="éé访" |
| | | align="center" |
| | | key="needFollowUp" |
| | | prop="needFollowUp" |
| | | /> |
| | | <el-table-column |
| | | label="å¾
é访" |
| | | align="center" |
| | | key="pendingFollowUp" |
| | | prop="pendingFollowUp" |
| | | /> |
| | | <el-table-column |
| | | label="é访æå" |
| | | align="center" |
| | | key="followUpSuccess" |
| | | prop="followUpSuccess" |
| | | /> |
| | | <el-table-column |
| | | label="é访失败" |
| | | align="center" |
| | | key="followUpFail" |
| | | prop="followUpFail" |
| | | /> |
| | | <el-table-column |
| | | label="é访ç" |
| | | align="center" |
| | | width="120" |
| | | key="followUpRate" |
| | | prop="followUpRate" |
| | | /> |
| | | <el-table-column |
| | | v-if="orgname != '丽水å¸ä¸å»é¢'" |
| | | label="åæ¶ç" |
| | | align="center" |
| | | width="120" |
| | | key="rate" |
| | | prop="rate" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleSeeDetails(scope.row)"> |
| | | <span class="button-zx">{{ (Number(scope.row.rate) * 100).toFixed(2) }}%</span> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="handleSeeDetails(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 label="çä¿¡" align="center" key="sms" prop="sms" /> |
| | | <el-table-column label="微信" align="center" key="weChat" prop="weChat" /> |
| | | <el-table-column |
| | | label="人工" |
| | | align="center" |
| | | key="manual" |
| | | prop="manual" |
| | | /> |
| | | <el-table-column |
| | | label="çä¿¡" |
| | | align="center" |
| | | key="sms" |
| | | prop="sms" |
| | | /> |
| | | <el-table-column |
| | | label="微信" |
| | | align="center" |
| | | key="weChat" |
| | | prop="weChat" |
| | | /> |
| | | </el-table-column> |
| | | </el-table> |
| | | </template> |
| | |
| | | :show-overflow-tooltip="true" |
| | | :sort-method="sortChineseNumber" |
| | | /> |
| | | <el-table-column label="ç§å®¤" align="center" key="deptname" prop="deptname" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="åºé¢äººæ¬¡" align="center" key="dischargeCount" prop="dischargeCount" /> |
| | | <el-table-column label="æ éé访人次" align="center" width="100" key="nonFollowUp" prop="nonFollowUp" /> |
| | | <el-table-column label="åºé访人次" align="center" width="100" key="followUpNeeded" prop="followUpNeeded" /> |
| | | <el-table-column |
| | | label="ç§å®¤" |
| | | align="center" |
| | | key="deptname" |
| | | prop="deptname" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="åºé¢äººæ¬¡" |
| | | align="center" |
| | | key="dischargeCount" |
| | | prop="dischargeCount" |
| | | /> |
| | | <el-table-column |
| | | label="æ éé访人次" |
| | | align="center" |
| | | width="100" |
| | | key="nonFollowUp" |
| | | prop="nonFollowUp" |
| | | /> |
| | | <el-table-column |
| | | label="åºé访人次" |
| | | align="center" |
| | | width="100" |
| | | key="followUpNeeded" |
| | | prop="followUpNeeded" |
| | | /> |
| | | |
| | | <el-table-column align="center" label="馿¬¡åºé¢é访"> |
| | | <el-table-column label="éé访" align="center" key="needFollowUp" prop="needFollowUp"> |
| | | <el-table-column |
| | | label="éé访" |
| | | align="center" |
| | | key="needFollowUp" |
| | | prop="needFollowUp" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleViewDetails(scope.row, 'needFollowUpInfo', 'éé访å表')"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click=" |
| | | handleViewDetails(scope.row, 'needFollowUpInfo', 'éé访å表') |
| | | " |
| | | > |
| | | <span class="button-zx">{{ scope.row.needFollowUp }}</span> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¾
é访" align="center" key="pendingFollowUp" prop="pendingFollowUp"> |
| | | <el-table-column |
| | | label="å¾
é访" |
| | | align="center" |
| | | key="pendingFollowUp" |
| | | prop="pendingFollowUp" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleViewDetails(scope.row, 'pendingFollowUpInfo', 'å¾
é访å表')"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click=" |
| | | handleViewDetails( |
| | | scope.row, |
| | | 'pendingFollowUpInfo', |
| | | 'å¾
é访å表' |
| | | ) |
| | | " |
| | | > |
| | | <span class="button-zx">{{ scope.row.pendingFollowUp }}</span> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="é访æå" align="center" key="followUpSuccess" prop="followUpSuccess"> |
| | | <el-table-column |
| | | label="é访æå" |
| | | align="center" |
| | | key="followUpSuccess" |
| | | prop="followUpSuccess" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleViewDetails(scope.row, 'followUpSuccessInfo', 'é访æåå表')"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click=" |
| | | handleViewDetails( |
| | | scope.row, |
| | | 'followUpSuccessInfo', |
| | | 'é访æåå表' |
| | | ) |
| | | " |
| | | > |
| | | <span class="button-zx">{{ scope.row.followUpSuccess }}</span> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="é访失败" align="center" key="followUpFail" prop="followUpFail"> |
| | | <el-table-column |
| | | label="é访失败" |
| | | align="center" |
| | | key="followUpFail" |
| | | prop="followUpFail" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleViewDetails(scope.row, 'followUpFailInfo', 'é访失败å表')"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click=" |
| | | handleViewDetails( |
| | | scope.row, |
| | | 'followUpFailInfo', |
| | | 'é访失败å表' |
| | | ) |
| | | " |
| | | > |
| | | <span class="button-zx">{{ scope.row.followUpFail }}</span> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="é访ç" align="center" width="120" key="followUpRate" prop="followUpRate" /> |
| | | <el-table-column v-if="orgname != '丽水å¸ä¸å»é¢'" label="åæ¶ç" align="center" width="120" key="rate" prop="rate"> |
| | | <el-table-column |
| | | label="é访ç" |
| | | align="center" |
| | | width="120" |
| | | key="followUpRate" |
| | | prop="followUpRate" |
| | | /> |
| | | <el-table-column |
| | | v-if="orgname != '丽水å¸ä¸å»é¢'" |
| | | label="åæ¶ç" |
| | | align="center" |
| | | width="120" |
| | | key="rate" |
| | | prop="rate" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleSeeDetails(scope.row)"> |
| | | <span class="button-zx">{{ (Number(scope.row.rate) * 100).toFixed(2) }}%</span> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="handleSeeDetails(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 |
| | | label="人工" |
| | | align="center" |
| | | key="manual" |
| | | prop="manual" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleViewDetails(scope.row, 'manualInfo', '人工é访å表')"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click=" |
| | | handleViewDetails(scope.row, 'manualInfo', '人工é访å表') |
| | | " |
| | | > |
| | | <span class="button-zx">{{ scope.row.manual }}</span> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="çä¿¡" align="center" key="sms" prop="sms"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleViewDetails(scope.row, 'smsInfo', 'çä¿¡é访å表')"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="handleViewDetails(scope.row, 'smsInfo', 'çä¿¡é访å表')" |
| | | > |
| | | <span class="button-zx">{{ scope.row.sms }}</span> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="微信" align="center" key="weChat" prop="weChat"> |
| | | <el-table-column |
| | | label="微信" |
| | | align="center" |
| | | key="weChat" |
| | | prop="weChat" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="handleViewDetails(scope.row, 'weChatInfo', '微信é访å表')"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click=" |
| | | handleViewDetails(scope.row, 'weChatInfo', '微信é访å表') |
| | | " |
| | | > |
| | | <span class="button-zx">{{ scope.row.weChat }}</span> |
| | | </el-button> |
| | | </template> |
| | |
| | | </el-table-column> |
| | | |
| | | <!-- é访æ
åµåï¼ä»
丽水å¸ä¸å»é¢æ¾ç¤ºï¼ --> |
| | | <el-table-column v-if="orgname == '丽水å¸ä¸å»é¢'" align="center" label="é访æ
åµ"> |
| | | <el-table-column label="æ£å¸¸è¯é³" align="center" width="100" key="taskSituation1" prop="taskSituation1" /> |
| | | <el-table-column label="æ£è
ææ¥ææè®¿" align="center" width="100" key="taskSituation2" prop="taskSituation2" /> |
| | | <el-table-column label="é¢è®¿æè
æ¥è¯" align="center" width="100" key="taskSituation3" prop="taskSituation3" /> |
| | | <el-table-column label="微信é访" align="center" width="100" key="taskSituation4" prop="taskSituation4" /> |
| | | <el-table-column label="é访çµè¯ä¸æ£ç¡®" align="center" width="100" key="taskSituation5" prop="taskSituation5" /> |
| | | <el-table-column label="å
¶ä»æ
åµä¸å®é访" align="center" width="100" key="taskSituation6" prop="taskSituation6" /> |
| | | <el-table-column |
| | | v-if="orgname == '丽水å¸ä¸å»é¢'" |
| | | align="center" |
| | | label="é访æ
åµ" |
| | | > |
| | | <el-table-column |
| | | label="æ£å¸¸è¯é³" |
| | | align="center" |
| | | width="100" |
| | | key="taskSituation1" |
| | | prop="taskSituation1" |
| | | /> |
| | | <el-table-column |
| | | label="æ£è
ææ¥ææè®¿" |
| | | align="center" |
| | | width="100" |
| | | key="taskSituation2" |
| | | prop="taskSituation2" |
| | | /> |
| | | <el-table-column |
| | | label="é¢è®¿æè
æ¥è¯" |
| | | align="center" |
| | | width="100" |
| | | key="taskSituation3" |
| | | prop="taskSituation3" |
| | | /> |
| | | <el-table-column |
| | | label="微信é访" |
| | | align="center" |
| | | width="100" |
| | | key="taskSituation4" |
| | | prop="taskSituation4" |
| | | /> |
| | | <el-table-column |
| | | label="é访çµè¯ä¸æ£ç¡®" |
| | | align="center" |
| | | width="100" |
| | | key="taskSituation5" |
| | | prop="taskSituation5" |
| | | /> |
| | | <el-table-column |
| | | label="å
¶ä»æ
åµä¸å®é访" |
| | | align="center" |
| | | width="100" |
| | | key="taskSituation6" |
| | | prop="taskSituation6" |
| | | /> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | |
| | | import { saveAs } from "file-saver"; |
| | | |
| | | export default { |
| | | name: 'FirstFollowUp', |
| | | name: "FirstFollowUp", |
| | | props: { |
| | | queryParams: { |
| | | type: Object, |
| | | required: true |
| | | required: true, |
| | | }, |
| | | flatArrayhospit: { |
| | | type: Array, |
| | | default: () => [] |
| | | default: () => [], |
| | | }, |
| | | flatArraydept: { |
| | | type: Array, |
| | | default: () => [] |
| | | default: () => [], |
| | | }, |
| | | options: { |
| | | type: Array, |
| | | default: () => [] |
| | | default: () => [], |
| | | }, |
| | | orgname: { |
| | | type: String, |
| | | default: '' |
| | | } |
| | | default: "", |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | loading: false, |
| | | expands: [], |
| | | ids: [] |
| | | } |
| | | ids: [], |
| | | patientqueryParams: { pn: 1, ps: 10 }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | loadData() { |
| | | this.loading = true |
| | | this.loading = true; |
| | | const params = { |
| | | ...this.queryParams, |
| | | visitCount: 1, |
| | | leavehospitaldistrictcodes: this.queryParams.leavehospitaldistrictcodes.includes("all") |
| | | leavehospitaldistrictcodes: |
| | | this.queryParams.leavehospitaldistrictcodes.includes("all") |
| | | ? this.getAllWardCodes() |
| | | : this.queryParams.leavehospitaldistrictcodes, |
| | | deptcodes: this.queryParams.deptcodes.includes("all") |
| | | ? this.getAllDeptCodes() |
| | | : this.queryParams.deptcodes |
| | | } |
| | | : this.queryParams.deptcodes, |
| | | }; |
| | | |
| | | delete params.leavehospitaldistrictcodes.all |
| | | delete params.deptcodes.all |
| | | delete params.leavehospitaldistrictcodes.all; |
| | | delete params.deptcodes.all; |
| | | |
| | | getSfStatistics(params) |
| | | .then(response => { |
| | | this.tableData = this.customSort(response.data) |
| | | .then((response) => { |
| | | this.tableData = this.customSort(response.data); |
| | | }) |
| | | .catch(error => { |
| | | console.error("è·å馿¬¡éè®¿æ°æ®å¤±è´¥:", error) |
| | | this.$message.error("è·å馿¬¡éè®¿æ°æ®å¤±è´¥") |
| | | .catch((error) => { |
| | | console.error("è·å馿¬¡éè®¿æ°æ®å¤±è´¥:", error); |
| | | this.$message.error("è·å馿¬¡éè®¿æ°æ®å¤±è´¥"); |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false |
| | | }) |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | |
| | | getAllWardCodes() { |
| | | return this.flatArrayhospit |
| | | .filter(item => item.value !== 'all') |
| | | .map(item => item.value) |
| | | .filter((item) => item.value !== "all") |
| | | .map((item) => item.value); |
| | | }, |
| | | |
| | | getAllDeptCodes() { |
| | | return this.flatArraydept |
| | | .filter(item => item.value !== 'all') |
| | | .map(item => item.value) |
| | | .filter((item) => item.value !== "all") |
| | | .map((item) => item.value); |
| | | }, |
| | | |
| | | customSort(data) { |
| | | const order = [ |
| | | "ä¸","äº","ä¸","å","äº","å
","ä¸","å
«","ä¹","å", |
| | | "åä¸","åäº","åä¸","åå","åäº","åå
","åä¸","åå
«","åä¹","äºå", |
| | | "äºåä¸","äºåäº","äºåä¸","äºåå","äºåäº","äºåå
","äºåä¸","äºåå
«","äºåä¹","ä¸å", |
| | | "ä¸åä¸","ä¸åäº","ä¸åä¸","ä¸åå","ä¸åäº","ä¸åå
","ä¸åä¸","ä¸åå
«","ä¸åä¹","åå", |
| | | "ååä¸","ååäº","ååä¸","ååå","ååäº" |
| | | ] |
| | | "ä¸", |
| | | "äº", |
| | | "ä¸", |
| | | "å", |
| | | "äº", |
| | | "å
", |
| | | "ä¸", |
| | | "å
«", |
| | | "ä¹", |
| | | "å", |
| | | "åä¸", |
| | | "åäº", |
| | | "åä¸", |
| | | "åå", |
| | | "åäº", |
| | | "åå
", |
| | | "åä¸", |
| | | "åå
«", |
| | | "åä¹", |
| | | "äºå", |
| | | "äºåä¸", |
| | | "äºåäº", |
| | | "äºåä¸", |
| | | "äºåå", |
| | | "äºåäº", |
| | | "äºåå
", |
| | | "äºåä¸", |
| | | "äºåå
«", |
| | | "äºåä¹", |
| | | "ä¸å", |
| | | "ä¸åä¸", |
| | | "ä¸åäº", |
| | | "ä¸åä¸", |
| | | "ä¸åå", |
| | | "ä¸åäº", |
| | | "ä¸åå
", |
| | | "ä¸åä¸", |
| | | "ä¸åå
«", |
| | | "ä¸åä¹", |
| | | "åå", |
| | | "ååä¸", |
| | | "ååäº", |
| | | "ååä¸", |
| | | "ååå", |
| | | "ååäº", |
| | | ]; |
| | | |
| | | return data.sort((a, b) => { |
| | | const getIndex = (name) => { |
| | | if (!name || typeof name !== "string") return -1 |
| | | const chineseMatch = name.match(/^([ä¸äºä¸åäºå
ä¸å
«ä¹å]+)/) |
| | | if (!name || typeof name !== "string") return -1; |
| | | const chineseMatch = name.match(/^([ä¸äºä¸åäºå
ä¸å
«ä¹å]+)/); |
| | | if (chineseMatch && chineseMatch[1]) { |
| | | return order.indexOf(chineseMatch[1]) |
| | | return order.indexOf(chineseMatch[1]); |
| | | } |
| | | const arabicMatch = name.match(/^(\d+)/) |
| | | const arabicMatch = name.match(/^(\d+)/); |
| | | if (arabicMatch && arabicMatch[1]) { |
| | | const num = parseInt(arabicMatch[1], 10) |
| | | const num = parseInt(arabicMatch[1], 10); |
| | | if (num >= 1 && num <= 45) { |
| | | return num - 1 |
| | | return num - 1; |
| | | } |
| | | } |
| | | return -1 |
| | | } |
| | | return -1; |
| | | }; |
| | | |
| | | const indexA = getIndex(a.leavehospitaldistrictname) |
| | | const indexB = getIndex(b.leavehospitaldistrictname) |
| | | const indexA = getIndex(a.leavehospitaldistrictname); |
| | | const indexB = getIndex(b.leavehospitaldistrictname); |
| | | |
| | | if (indexA === -1 && indexB === -1) { |
| | | return (a.leavehospitaldistrictname || "").localeCompare(b.leavehospitaldistrictname || "") |
| | | return (a.leavehospitaldistrictname || "").localeCompare( |
| | | b.leavehospitaldistrictname || "" |
| | | ); |
| | | } |
| | | if (indexA === -1) return 1 |
| | | if (indexB === -1) return -1 |
| | | return indexA - indexB |
| | | }) |
| | | if (indexA === -1) return 1; |
| | | if (indexB === -1) return -1; |
| | | return indexA - indexB; |
| | | }); |
| | | }, |
| | | |
| | | sortChineseNumber(aRow, bRow) { |
| | | const a = aRow.leavehospitaldistrictname |
| | | const b = bRow.leavehospitaldistrictname |
| | | const a = aRow.leavehospitaldistrictname; |
| | | const b = bRow.leavehospitaldistrictname; |
| | | |
| | | const chineseNumMap = { |
| | | ä¸:1,äº:2,ä¸:3,å:4,äº:5,å
:6,ä¸:7,å
«:8,ä¹:9,å:10, |
| | | åä¸:11,åäº:12,åä¸:13,åå:14,åäº:15,åå
:16,åä¸:17,åå
«:18,åä¹:19,äºå:20, |
| | | äºåä¸:21,äºåäº:22,äºåä¸:23,äºåå:24,äºåäº:25,äºåå
:26,äºåä¸:27,äºåå
«:28,äºåä¹:29,ä¸å:30, |
| | | ä¸åä¸:31,ä¸åäº:32,ä¸åä¸:33,ä¸åå:34,ä¸åäº:35,ä¸åå
:36,ä¸åä¸:37,ä¸åå
«:38,ä¸åä¹:39,åå:40, |
| | | ååä¸:41,ååäº:42,ååä¸:43,ååå:44,ååäº:45 |
| | | } |
| | | ä¸: 1, |
| | | äº: 2, |
| | | ä¸: 3, |
| | | å: 4, |
| | | äº: 5, |
| | | å
: 6, |
| | | ä¸: 7, |
| | | å
«: 8, |
| | | ä¹: 9, |
| | | å: 10, |
| | | åä¸: 11, |
| | | åäº: 12, |
| | | åä¸: 13, |
| | | åå: 14, |
| | | åäº: 15, |
| | | åå
: 16, |
| | | åä¸: 17, |
| | | åå
«: 18, |
| | | åä¹: 19, |
| | | äºå: 20, |
| | | äºåä¸: 21, |
| | | äºåäº: 22, |
| | | äºåä¸: 23, |
| | | äºåå: 24, |
| | | äºåäº: 25, |
| | | äºåå
: 26, |
| | | äºåä¸: 27, |
| | | äºåå
«: 28, |
| | | äºåä¹: 29, |
| | | ä¸å: 30, |
| | | ä¸åä¸: 31, |
| | | ä¸åäº: 32, |
| | | ä¸åä¸: 33, |
| | | ä¸åå: 34, |
| | | ä¸åäº: 35, |
| | | ä¸åå
: 36, |
| | | ä¸åä¸: 37, |
| | | ä¸åå
«: 38, |
| | | ä¸åä¹: 39, |
| | | åå: 40, |
| | | ååä¸: 41, |
| | | ååäº: 42, |
| | | ååä¸: 43, |
| | | ååå: 44, |
| | | ååäº: 45, |
| | | }; |
| | | |
| | | const getNumberFromText = (text) => { |
| | | if (!text || typeof text !== "string") return -1 |
| | | const match = text.match(/^([ä¸äºä¸åäºå
ä¸å
«ä¹å]+)/) |
| | | if (!text || typeof text !== "string") return -1; |
| | | const match = text.match(/^([ä¸äºä¸åäºå
ä¸å
«ä¹å]+)/); |
| | | if (match && match[1]) { |
| | | const chineseNum = match[1] |
| | | return chineseNumMap[chineseNum] !== undefined ? chineseNumMap[chineseNum] : -1 |
| | | const chineseNum = match[1]; |
| | | return chineseNumMap[chineseNum] !== undefined |
| | | ? chineseNumMap[chineseNum] |
| | | : -1; |
| | | } |
| | | const arabicMatch = text.match(/^(\d+)/) |
| | | const arabicMatch = text.match(/^(\d+)/); |
| | | if (arabicMatch && arabicMatch[1]) { |
| | | const num = parseInt(arabicMatch[1], 10) |
| | | return num >= 1 && num <= 45 ? num : -1 |
| | | const num = parseInt(arabicMatch[1], 10); |
| | | return num >= 1 && num <= 45 ? num : -1; |
| | | } |
| | | return -1 |
| | | } |
| | | return -1; |
| | | }; |
| | | |
| | | const numA = getNumberFromText(a) |
| | | const numB = getNumberFromText(b) |
| | | const numA = getNumberFromText(a); |
| | | const numB = getNumberFromText(b); |
| | | |
| | | if (numA === -1 && numB === -1) { |
| | | return (a || "").localeCompare(b || "") |
| | | return (a || "").localeCompare(b || ""); |
| | | } |
| | | if (numA === -1) return 1 |
| | | if (numB === -1) return -1 |
| | | return numA - numB |
| | | if (numA === -1) return 1; |
| | | if (numB === -1) return -1; |
| | | return numA - numB; |
| | | }, |
| | | |
| | | getRowKey(row) { |
| | | return row.statisticaltype === 1 ? row.leavehospitaldistrictcode : row.deptcode |
| | | return row.statisticaltype === 1 |
| | | ? row.leavehospitaldistrictcode |
| | | : row.deptcode; |
| | | }, |
| | | |
| | | handleRowClick(row) { |
| | | if (this.expands.includes(this.getRowKey(row))) { |
| | | this.expands = [] |
| | | return |
| | | this.expands = []; |
| | | return; |
| | | } |
| | | |
| | | const params = { |
| | |
| | | : this.queryParams.deptcodes, |
| | | leavehospitaldistrictcodes: [row.leavehospitaldistrictcode], |
| | | drcode: "1", |
| | | visitCount: 1 |
| | | } |
| | | visitCount: 1, |
| | | }; |
| | | |
| | | delete params.leavehospitaldistrictcodes.all |
| | | delete params.deptcodes.all |
| | | delete params.leavehospitaldistrictcodes.all; |
| | | delete params.deptcodes.all; |
| | | |
| | | if (!row.doctorStats) { |
| | | this.loading = true |
| | | this.loading = true; |
| | | getSfStatistics(params).then((res) => { |
| | | this.$set(row, "doctorStats", res.data) |
| | | this.expands = [this.getRowKey(row)] |
| | | this.loading = false |
| | | }) |
| | | this.$set(row, "doctorStats", res.data); |
| | | this.expands = [this.getRowKey(row)]; |
| | | this.loading = false; |
| | | }); |
| | | } else { |
| | | this.expands = [this.getRowKey(row)] |
| | | this.expands = [this.getRowKey(row)]; |
| | | } |
| | | }, |
| | | |
| | | getSummaries(param) { |
| | | const { columns, data } = param |
| | | const sums = [] |
| | | const { columns, data } = param; |
| | | const sums = []; |
| | | |
| | | columns.forEach((column, index) => { |
| | | if (index === 0) { |
| | | sums[index] = "å计" |
| | | return |
| | | sums[index] = "å计"; |
| | | return; |
| | | } |
| | | if (index === 1 || index === 2) { |
| | | sums[index] = "/" |
| | | return |
| | | sums[index] = "/"; |
| | | return; |
| | | } |
| | | |
| | | if (column.property === "followUpRate" || column.property === "rate") { |
| | | const percentageValues = data |
| | | .map((item) => { |
| | | const value = item[column.property] |
| | | if (!value || value === "-" || value === "0%") return null |
| | | const value = item[column.property]; |
| | | if (!value || value === "-" || value === "0%") return null; |
| | | if (typeof value === "string" && value.includes("%")) { |
| | | const numValue = parseFloat(value.replace("%", "")) / 100 |
| | | return isNaN(numValue) ? null : numValue |
| | | const numValue = parseFloat(value.replace("%", "")) / 100; |
| | | return isNaN(numValue) ? null : numValue; |
| | | } else { |
| | | const numValue = parseFloat(value) |
| | | return isNaN(numValue) ? null : numValue |
| | | const numValue = parseFloat(value); |
| | | return isNaN(numValue) ? null : numValue; |
| | | } |
| | | }) |
| | | .filter((value) => value !== null && value !== 0) |
| | | .filter((value) => value !== null && value !== 0); |
| | | |
| | | if (percentageValues.length > 0) { |
| | | const average = percentageValues.reduce((sum, value) => sum + value, 0) / percentageValues.length |
| | | sums[index] = (average * 100).toFixed(2) + "%" |
| | | const average = |
| | | percentageValues.reduce((sum, value) => sum + value, 0) / |
| | | percentageValues.length; |
| | | sums[index] = (average * 100).toFixed(2) + "%"; |
| | | } else { |
| | | sums[index] = "0.00%" |
| | | sums[index] = "0.00%"; |
| | | } |
| | | } else { |
| | | const values = data.map((item) => { |
| | | const value = item[column.property] |
| | | if (value === "-" || value === "" || value === null) return 0 |
| | | return Number(value) || 0 |
| | | }) |
| | | const value = item[column.property]; |
| | | if (value === "-" || value === "" || value === null) return 0; |
| | | return Number(value) || 0; |
| | | }); |
| | | |
| | | if (!values.every((value) => isNaN(value))) { |
| | | sums[index] = values.reduce((prev, curr) => prev + curr, 0) |
| | | sums[index] = this.formatNumber(sums[index]) |
| | | sums[index] = values.reduce((prev, curr) => prev + curr, 0); |
| | | sums[index] = this.formatNumber(sums[index]); |
| | | } else { |
| | | sums[index] = "-" |
| | | sums[index] = "-"; |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | return sums |
| | | return sums; |
| | | }, |
| | | |
| | | getInnerSummaries(param) { |
| | | const { columns, data } = param |
| | | const sums = [] |
| | | const { columns, data } = param; |
| | | const sums = []; |
| | | |
| | | columns.forEach((column, index) => { |
| | | if (index === 0) { |
| | | sums[index] = "å°è®¡" |
| | | return |
| | | sums[index] = "å°è®¡"; |
| | | return; |
| | | } |
| | | |
| | | if (column.property === "drname" || column.property === "deptname") { |
| | | sums[index] = "-" |
| | | return |
| | | sums[index] = "-"; |
| | | return; |
| | | } |
| | | |
| | | if (column.property === "followUpRate" || column.property === "rate") { |
| | | const percentageValues = data |
| | | .map((item) => { |
| | | const value = item[column.property] |
| | | if (!value || value === "-" || value === "0%") return null |
| | | const value = item[column.property]; |
| | | if (!value || value === "-" || value === "0%") return null; |
| | | if (typeof value === "string" && value.includes("%")) { |
| | | const numValue = parseFloat(value.replace("%", "")) / 100 |
| | | return isNaN(numValue) ? null : numValue |
| | | const numValue = parseFloat(value.replace("%", "")) / 100; |
| | | return isNaN(numValue) ? null : numValue; |
| | | } else { |
| | | const numValue = parseFloat(value) |
| | | return isNaN(numValue) ? null : numValue |
| | | const numValue = parseFloat(value); |
| | | return isNaN(numValue) ? null : numValue; |
| | | } |
| | | }) |
| | | .filter((value) => value !== null && value !== 0) |
| | | .filter((value) => value !== null && value !== 0); |
| | | |
| | | if (percentageValues.length > 0) { |
| | | const average = percentageValues.reduce((sum, value) => sum + value, 0) / percentageValues.length |
| | | sums[index] = (average * 100).toFixed(2) + "%" |
| | | const average = |
| | | percentageValues.reduce((sum, value) => sum + value, 0) / |
| | | percentageValues.length; |
| | | sums[index] = (average * 100).toFixed(2) + "%"; |
| | | } else { |
| | | sums[index] = "0.00%" |
| | | sums[index] = "0.00%"; |
| | | } |
| | | } else { |
| | | const values = data.map((item) => { |
| | | const value = item[column.property] |
| | | if (value === "-" || value === "" || value === null) return 0 |
| | | return Number(value) || 0 |
| | | }) |
| | | const value = item[column.property]; |
| | | if (value === "-" || value === "" || value === null) return 0; |
| | | return Number(value) || 0; |
| | | }); |
| | | |
| | | if (!values.every((value) => isNaN(value))) { |
| | | sums[index] = values.reduce((prev, curr) => prev + curr, 0) |
| | | sums[index] = this.formatNumber(sums[index]) |
| | | sums[index] = values.reduce((prev, curr) => prev + curr, 0); |
| | | sums[index] = this.formatNumber(sums[index]); |
| | | } else { |
| | | sums[index] = "-" |
| | | sums[index] = "-"; |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | return sums |
| | | return sums; |
| | | }, |
| | | |
| | | formatNumber(num) { |
| | | if (isNaN(num)) return "-" |
| | | return Number.isInteger(num) ? num.toString() : num.toFixed(0) |
| | | if (isNaN(num)) return "-"; |
| | | return Number.isInteger(num) ? num.toString() : num.toFixed(0); |
| | | }, |
| | | |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map((item) => item.tagid) |
| | | this.ids = selection.map((item) => item.tagid); |
| | | }, |
| | | |
| | | handleViewDetails(row, infoKey, titleSuffix) { |
| | | const title = `${row.leavehospitaldistrictname || row.deptname}${titleSuffix}` |
| | | this.$emit('view-details', row[infoKey], title) |
| | | const title = `${ |
| | | row.leavehospitaldistrictname || row.deptname |
| | | }${titleSuffix}`; |
| | | this.$emit("view-details", row[infoKey], title); |
| | | }, |
| | | |
| | | handleSeeDetails(row) { |
| | | this.$emit('see-details', row) |
| | | this.$emit("see-details", row); |
| | | }, |
| | | |
| | | async exportTable() { |
| | | try { |
| | | let dateRangeString = "" |
| | | let sheetNameSuffix = "" |
| | | let dateRangeString = ""; |
| | | let sheetNameSuffix = ""; |
| | | |
| | | if (this.queryParams.dateRange && this.queryParams.dateRange.length === 2) { |
| | | const startDateStr = this.queryParams.dateRange[0] |
| | | const endDateStr = this.queryParams.dateRange[1] |
| | | if ( |
| | | this.queryParams.dateRange && |
| | | this.queryParams.dateRange.length === 2 |
| | | ) { |
| | | const startDateStr = this.queryParams.dateRange[0]; |
| | | const endDateStr = this.queryParams.dateRange[1]; |
| | | const formatDateForDisplay = (dateTimeStr) => { |
| | | return dateTimeStr.split(" ")[0] |
| | | } |
| | | const startDateFormatted = formatDateForDisplay(startDateStr) |
| | | const endDateFormatted = formatDateForDisplay(endDateStr) |
| | | dateRangeString = `${startDateFormatted}è³${endDateFormatted}` |
| | | sheetNameSuffix = `${startDateFormatted}è³${endDateFormatted}` |
| | | return dateTimeStr.split(" ")[0]; |
| | | }; |
| | | const startDateFormatted = formatDateForDisplay(startDateStr); |
| | | const endDateFormatted = formatDateForDisplay(endDateStr); |
| | | dateRangeString = `${startDateFormatted}è³${endDateFormatted}`; |
| | | sheetNameSuffix = `${startDateFormatted}è³${endDateFormatted}`; |
| | | } else { |
| | | const now = new Date() |
| | | const currentMonth = now.getMonth() + 1 |
| | | dateRangeString = `${currentMonth}æ` |
| | | sheetNameSuffix = `${currentMonth}æ` |
| | | const now = new Date(); |
| | | const currentMonth = now.getMonth() + 1; |
| | | dateRangeString = `${currentMonth}æ`; |
| | | sheetNameSuffix = `${currentMonth}æ`; |
| | | } |
| | | |
| | | const excelName = `馿¬¡åºé¢é访ç»è®¡è¡¨_${dateRangeString}.xlsx` |
| | | const worksheetName = `馿¬¡é访ç»è®¡_${sheetNameSuffix}` |
| | | const excelName = `馿¬¡åºé¢é访ç»è®¡è¡¨_${dateRangeString}.xlsx`; |
| | | const worksheetName = `馿¬¡é访ç»è®¡_${sheetNameSuffix}`; |
| | | |
| | | if (!this.tableData || this.tableData.length === 0) { |
| | | this.$message.warning("ææ é¦æ¬¡éè®¿æ°æ®å¯å¯¼åº") |
| | | return false |
| | | this.$message.warning("ææ é¦æ¬¡éè®¿æ°æ®å¯å¯¼åº"); |
| | | return false; |
| | | } |
| | | |
| | | const workbook = new ExcelJS.Workbook() |
| | | const worksheet = workbook.addWorksheet(worksheetName) |
| | | const workbook = new ExcelJS.Workbook(); |
| | | const worksheet = workbook.addWorksheet(worksheetName); |
| | | |
| | | // æå»ºè¡¨æ ¼ |
| | | this.buildExportSheet(worksheet, sheetNameSuffix) |
| | | this.buildExportSheet(worksheet, sheetNameSuffix); |
| | | |
| | | const buffer = await workbook.xlsx.writeBuffer() |
| | | const buffer = await workbook.xlsx.writeBuffer(); |
| | | const blob = new Blob([buffer], { |
| | | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" |
| | | }) |
| | | saveAs(blob, excelName) |
| | | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
| | | }); |
| | | saveAs(blob, excelName); |
| | | |
| | | this.$message.success("å¯¼åºæå") |
| | | return true |
| | | this.$message.success("å¯¼åºæå"); |
| | | return true; |
| | | } catch (error) { |
| | | console.error("导åºå¤±è´¥:", error) |
| | | this.$message.error(`导åºå¤±è´¥: ${error.message}`) |
| | | return false |
| | | console.error("导åºå¤±è´¥:", error); |
| | | this.$message.error(`导åºå¤±è´¥: ${error.message}`); |
| | | return false; |
| | | } |
| | | }, |
| | | |
| | | buildExportSheet(worksheet, sheetNameSuffix) { |
| | | const titleStyle = { |
| | | font: { name: "微软é
é»", size: 16, bold: true, color: { argb: "FF000000" } }, |
| | | fill: { type: "pattern", pattern: "solid", fgColor: { argb: "FFE6F3FF" } }, |
| | | font: { |
| | | name: "微软é
é»", |
| | | size: 16, |
| | | bold: true, |
| | | color: { argb: "FF000000" }, |
| | | }, |
| | | fill: { |
| | | type: "pattern", |
| | | pattern: "solid", |
| | | fgColor: { argb: "FFE6F3FF" }, |
| | | }, |
| | | alignment: { vertical: "middle", horizontal: "center", wrapText: true }, |
| | | border: { |
| | | top: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | left: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | bottom: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } } |
| | | } |
| | | } |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | }, |
| | | }; |
| | | |
| | | const headerStyle = { |
| | | font: { name: "微软é
é»", size: 11, bold: true, color: { argb: "FF000000" } }, |
| | | fill: { type: "pattern", pattern: "solid", fgColor: { argb: "FFF5F7FA" } }, |
| | | font: { |
| | | name: "微软é
é»", |
| | | size: 11, |
| | | bold: true, |
| | | color: { argb: "FF000000" }, |
| | | }, |
| | | fill: { |
| | | type: "pattern", |
| | | pattern: "solid", |
| | | fgColor: { argb: "FFF5F7FA" }, |
| | | }, |
| | | alignment: { vertical: "middle", horizontal: "center", wrapText: true }, |
| | | border: { |
| | | top: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | left: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | bottom: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } } |
| | | } |
| | | } |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | }, |
| | | }; |
| | | |
| | | const cellStyle = { |
| | | font: { name: "å®ä½", size: 10, color: { argb: "FF000000" } }, |
| | |
| | | top: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | left: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | bottom: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } } |
| | | } |
| | | } |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | }, |
| | | }; |
| | | |
| | | const summaryStyle = { |
| | | font: { name: "å®ä½", size: 10, bold: true, color: { argb: "FF409EFF" } }, |
| | | fill: { type: "pattern", pattern: "solid", fgColor: { argb: "FFF5F7FA" } }, |
| | | font: { |
| | | name: "å®ä½", |
| | | size: 10, |
| | | bold: true, |
| | | color: { argb: "FF409EFF" }, |
| | | }, |
| | | fill: { |
| | | type: "pattern", |
| | | pattern: "solid", |
| | | fgColor: { argb: "FFF5F7FA" }, |
| | | }, |
| | | alignment: { vertical: "middle", horizontal: "center" }, |
| | | border: { |
| | | top: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | left: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | bottom: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } } |
| | | } |
| | | } |
| | | right: { style: "thin", color: { argb: "FFD0D0D0" } }, |
| | | }, |
| | | }; |
| | | |
| | | // æ·»å æ é¢è¡ |
| | | worksheet.mergeCells(1, 1, 1, 16) |
| | | const titleCell = worksheet.getCell(1, 1) |
| | | titleCell.value = `馿¬¡åºé¢é访ç»è®¡è¡¨_${sheetNameSuffix}` |
| | | titleCell.style = titleStyle |
| | | worksheet.getRow(1).height = 35 |
| | | worksheet.mergeCells(1, 1, 1, 16); |
| | | const titleCell = worksheet.getCell(1, 1); |
| | | titleCell.value = `馿¬¡åºé¢é访ç»è®¡è¡¨_${sheetNameSuffix}`; |
| | | titleCell.style = titleStyle; |
| | | worksheet.getRow(1).height = 35; |
| | | |
| | | // 表头 |
| | | const secondRowHeaders = [ |
| | | "", "åºé¢ç
åº", "ç§å®¤", "åºé¢äººæ¬¡", "æ éé访人次", "åºé访人次", |
| | | "éé访", "å¾
é访", "é访æå", "é访失败", "é访ç", "åæ¶ç", "人工", "çä¿¡", "微信" |
| | | ] |
| | | "", |
| | | "åºé¢ç
åº", |
| | | "ç§å®¤", |
| | | "åºé¢äººæ¬¡", |
| | | "æ éé访人次", |
| | | "åºé访人次", |
| | | "éé访", |
| | | "å¾
é访", |
| | | "é访æå", |
| | | "é访失败", |
| | | "é访ç", |
| | | "åæ¶ç", |
| | | "人工", |
| | | "çä¿¡", |
| | | "微信", |
| | | ]; |
| | | |
| | | secondRowHeaders.forEach((header, index) => { |
| | | const cell = worksheet.getCell(3, index + 1) |
| | | cell.value = header |
| | | cell.style = headerStyle |
| | | }) |
| | | const cell = worksheet.getCell(3, index + 1); |
| | | cell.value = header; |
| | | cell.style = headerStyle; |
| | | }); |
| | | |
| | | // åå¹¶åå
æ ¼ |
| | | for (let i = 1; i <= 6; i++) { |
| | | worksheet.mergeCells(2, i, 3, i) |
| | | const cell = worksheet.getCell(2, i) |
| | | cell.style = headerStyle |
| | | worksheet.mergeCells(2, i, 3, i); |
| | | const cell = worksheet.getCell(2, i); |
| | | cell.style = headerStyle; |
| | | } |
| | | |
| | | worksheet.getCell(2, 1).value = "" |
| | | worksheet.getCell(2, 2).value = "åºé¢ç
åº" |
| | | worksheet.getCell(2, 3).value = "ç§å®¤" |
| | | worksheet.getCell(2, 4).value = "åºé¢äººæ¬¡" |
| | | worksheet.getCell(2, 5).value = "æ éé访人次" |
| | | worksheet.getCell(2, 6).value = "åºé访人次" |
| | | worksheet.getCell(2, 1).value = ""; |
| | | worksheet.getCell(2, 2).value = "åºé¢ç
åº"; |
| | | worksheet.getCell(2, 3).value = "ç§å®¤"; |
| | | worksheet.getCell(2, 4).value = "åºé¢äººæ¬¡"; |
| | | worksheet.getCell(2, 5).value = "æ éé访人次"; |
| | | worksheet.getCell(2, 6).value = "åºé访人次"; |
| | | |
| | | worksheet.mergeCells(2, 7, 2, 15) |
| | | worksheet.getCell(2, 7).value = "馿¬¡åºé¢é访" |
| | | worksheet.getCell(2, 7).style = headerStyle |
| | | worksheet.mergeCells(2, 7, 2, 15); |
| | | worksheet.getCell(2, 7).value = "馿¬¡åºé¢é访"; |
| | | worksheet.getCell(2, 7).style = headerStyle; |
| | | |
| | | worksheet.getRow(2).height = 28 |
| | | worksheet.getRow(3).height = 25 |
| | | worksheet.getRow(2).height = 28; |
| | | worksheet.getRow(3).height = 25; |
| | | |
| | | // æ°æ®è¡ |
| | | this.tableData.forEach((item, rowIndex) => { |
| | | const dataRow = worksheet.addRow([ |
| | | const dataRow = worksheet.addRow( |
| | | [ |
| | | "", |
| | | item.leavehospitaldistrictname || "", |
| | | item.deptname || "", |
| | |
| | | item.rate ? (Number(item.rate) * 100).toFixed(2) + "%" : "0%", |
| | | item.manual || 0, |
| | | item.sms || 0, |
| | | item.weChat || 0 |
| | | ], rowIndex + 4) |
| | | item.weChat || 0, |
| | | ], |
| | | rowIndex + 4 |
| | | ); |
| | | |
| | | dataRow.eachCell((cell) => { |
| | | cell.style = cellStyle |
| | | }) |
| | | dataRow.height = 24 |
| | | }) |
| | | cell.style = cellStyle; |
| | | }); |
| | | dataRow.height = 24; |
| | | }); |
| | | |
| | | // åè®¡è¡ |
| | | const summaries = this.getExportSummaries() |
| | | const summaryRow = worksheet.addRow(summaries) |
| | | const summaries = this.getExportSummaries(); |
| | | const summaryRow = worksheet.addRow(summaries); |
| | | summaryRow.eachCell((cell, colNumber) => { |
| | | cell.style = summaryStyle |
| | | cell.style = summaryStyle; |
| | | if (colNumber === 1) { |
| | | cell.value = "å计" |
| | | cell.value = "å计"; |
| | | } |
| | | }) |
| | | summaryRow.height = 28 |
| | | }); |
| | | summaryRow.height = 28; |
| | | |
| | | // å宽 |
| | | worksheet.columns = [ |
| | | { width: 8 }, { width: 20 }, { width: 15 }, { width: 12 }, { width: 12 }, { width: 12 }, |
| | | { width: 10 }, { width: 10 }, { width: 10 }, { width: 10 }, { width: 12 }, { width: 12 }, |
| | | { width: 8 }, { width: 8 }, { width: 8 } |
| | | ] |
| | | { width: 8 }, |
| | | { width: 20 }, |
| | | { width: 15 }, |
| | | { width: 12 }, |
| | | { width: 12 }, |
| | | { width: 12 }, |
| | | { width: 10 }, |
| | | { width: 10 }, |
| | | { width: 10 }, |
| | | { width: 10 }, |
| | | { width: 12 }, |
| | | { width: 12 }, |
| | | { width: 8 }, |
| | | { width: 8 }, |
| | | { width: 8 }, |
| | | ]; |
| | | }, |
| | | |
| | | getExportSummaries() { |
| | | const summaries = ["å计", "/", "/", 0, 0, 0, 0, 0, 0, 0, "0%", "0%", 0, 0, 0] |
| | | const summaries = [ |
| | | "å计", |
| | | "/", |
| | | "/", |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | "0%", |
| | | "0%", |
| | | 0, |
| | | 0, |
| | | 0, |
| | | ]; |
| | | |
| | | this.tableData.forEach((item) => { |
| | | summaries[3] += Number(item.dischargeCount) || 0 |
| | | summaries[4] += Number(item.nonFollowUp) || 0 |
| | | summaries[5] += Number(item.followUpNeeded) || 0 |
| | | summaries[6] += Number(item.needFollowUp) || 0 |
| | | summaries[7] += Number(item.pendingFollowUp) || 0 |
| | | summaries[8] += Number(item.followUpSuccess) || 0 |
| | | summaries[9] += Number(item.followUpFail) || 0 |
| | | summaries[12] += Number(item.manual) || 0 |
| | | summaries[13] += Number(item.sms) || 0 |
| | | summaries[14] += Number(item.weChat) || 0 |
| | | }) |
| | | summaries[3] += Number(item.dischargeCount) || 0; |
| | | summaries[4] += Number(item.nonFollowUp) || 0; |
| | | summaries[5] += Number(item.followUpNeeded) || 0; |
| | | summaries[6] += Number(item.needFollowUp) || 0; |
| | | summaries[7] += Number(item.pendingFollowUp) || 0; |
| | | summaries[8] += Number(item.followUpSuccess) || 0; |
| | | summaries[9] += Number(item.followUpFail) || 0; |
| | | summaries[12] += Number(item.manual) || 0; |
| | | summaries[13] += Number(item.sms) || 0; |
| | | summaries[14] += Number(item.weChat) || 0; |
| | | }); |
| | | |
| | | const followUpRateValues = this.tableData |
| | | .map((item) => this.extractPercentageValue(item.followUpRate)) |
| | | .filter((value) => value !== null) |
| | | .filter((value) => value !== null); |
| | | |
| | | const rateValues = this.tableData |
| | | .map((item) => this.extractPercentageValue(item.rate)) |
| | | .filter((value) => value !== null) |
| | | .filter((value) => value !== null); |
| | | |
| | | if (followUpRateValues.length > 0) { |
| | | const avgFollowUpRate = followUpRateValues.reduce((sum, val) => sum + val, 0) / followUpRateValues.length |
| | | summaries[10] = (avgFollowUpRate * 100).toFixed(2) + "%" |
| | | const avgFollowUpRate = |
| | | followUpRateValues.reduce((sum, val) => sum + val, 0) / |
| | | followUpRateValues.length; |
| | | summaries[10] = (avgFollowUpRate * 100).toFixed(2) + "%"; |
| | | } |
| | | |
| | | if (rateValues.length > 0) { |
| | | const avgRate = rateValues.reduce((sum, val) => sum + val, 0) / rateValues.length |
| | | summaries[11] = (avgRate * 100).toFixed(2) + "%" |
| | | const avgRate = |
| | | rateValues.reduce((sum, val) => sum + val, 0) / rateValues.length; |
| | | summaries[11] = (avgRate * 100).toFixed(2) + "%"; |
| | | } |
| | | |
| | | summaries[3] = this.formatNumber(summaries[3]) |
| | | summaries[4] = this.formatNumber(summaries[4]) |
| | | summaries[5] = this.formatNumber(summaries[5]) |
| | | summaries[6] = this.formatNumber(summaries[6]) |
| | | summaries[7] = this.formatNumber(summaries[7]) |
| | | summaries[8] = this.formatNumber(summaries[8]) |
| | | summaries[9] = this.formatNumber(summaries[9]) |
| | | summaries[12] = this.formatNumber(summaries[12]) |
| | | summaries[13] = this.formatNumber(summaries[13]) |
| | | summaries[14] = this.formatNumber(summaries[14]) |
| | | summaries[3] = this.formatNumber(summaries[3]); |
| | | summaries[4] = this.formatNumber(summaries[4]); |
| | | summaries[5] = this.formatNumber(summaries[5]); |
| | | summaries[6] = this.formatNumber(summaries[6]); |
| | | summaries[7] = this.formatNumber(summaries[7]); |
| | | summaries[8] = this.formatNumber(summaries[8]); |
| | | summaries[9] = this.formatNumber(summaries[9]); |
| | | summaries[12] = this.formatNumber(summaries[12]); |
| | | summaries[13] = this.formatNumber(summaries[13]); |
| | | summaries[14] = this.formatNumber(summaries[14]); |
| | | |
| | | return summaries |
| | | return summaries; |
| | | }, |
| | | |
| | | extractPercentageValue(value) { |
| | | if (!value) return null |
| | | if (!value) return null; |
| | | if (typeof value === "string" && value.includes("%")) { |
| | | const num = parseFloat(value.replace("%", "")) |
| | | return isNaN(num) ? null : num / 100 |
| | | const num = parseFloat(value.replace("%", "")); |
| | | return isNaN(num) ? null : num / 100; |
| | | } |
| | | const num = parseFloat(value) |
| | | return isNaN(num) ? null : num |
| | | const num = parseFloat(value); |
| | | return isNaN(num) ? null : num; |
| | | }, |
| | | |
| | | selectTimelyRate(row, dateRange) { |
| | | const params = { |
| | | ...this.patientqueryParams, |
| | | starttime: this.parseTime(dateRange[0]), |
| | | endtime: this.parseTime(dateRange[1]), |
| | | deptcode: row.deptcode |
| | | } |
| | | return selectTimelyRate(params) |
| | | } |
| | | } |
| | | } |
| | | console.log(row, dateRange, 88); |
| | | |
| | | // const params = { |
| | | // ...this.patientqueryParams, |
| | | // starttime: this.parseTime(dateRange[0]), |
| | | // endtime: this.parseTime(dateRange[1]), |
| | | // deptcode: row.deptcode, |
| | | // }; |
| | | this.patientqueryParams.starttime = this.parseTime(dateRange[0]); |
| | | this.patientqueryParams.endtime = this.parseTime(dateRange[1]); |
| | | this.patientqueryParams.deptcode = row.deptcode; |
| | | return selectTimelyRate(this.patientqueryParams); |
| | | }, |
| | | selectTimelyRates(dateRange) { |
| | | this.patientqueryParams.pn = dateRange.pageNum; |
| | | this.patientqueryParams.ps = dateRange.pageSize; |
| | | |
| | | return selectTimelyRate(this.patientqueryParams); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |