diff --git a/package-lock.json b/package-lock.json index 93a6a75..7e724af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "markdown-it": "^14.1.0", "moment": "^2.29.4", "node-polyfill-webpack-plugin": "^2.0.1", + "pinyin": "^4.0.0", "print-js": "^1.6.0", "qrcode": "^1.5.4", "sortablejs": "^1.15.0", @@ -7824,6 +7825,11 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/keypress": { + "version": "0.1.0", + "resolved": "https://registry.npmmirror.com/keypress/-/keypress-0.1.0.tgz", + "integrity": "sha512-x0yf9PL/nx9Nw9oLL8ZVErFAk85/lslwEP7Vz7s5SI1ODXZIgit3C5qyWjw4DxOuO/3Hb4866SQh28a1V1d+WA==" + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz", @@ -9374,6 +9380,47 @@ "node": ">=8.6" } }, + "node_modules/pinyin": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/pinyin/-/pinyin-4.0.0.tgz", + "integrity": "sha512-vHpV5K+vpp6XUUpZNGRDuHoN+1xcmieM3EWlH4QjSX2kkpG/gVOwpqwV9EOJ9x9c9UERFKeLml5XVSukE/PLgQ==", + "dependencies": { + "commander": "~1.1.1" + }, + "bin": { + "pinyin": "bin/pinyin" + }, + "engines": { + "install-node": "^18.0.0" + }, + "peerDependencies": { + "@node-rs/jieba": "^1.6.0", + "nodejieba": "^3.4.4", + "segmentit": "^2.0.3" + }, + "peerDependenciesMeta": { + "@node-rs/jieba": { + "optional": true + }, + "nodejieba": { + "optional": true + }, + "segmentit": { + "optional": true + } + } + }, + "node_modules/pinyin/node_modules/commander": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/commander/-/commander-1.1.1.tgz", + "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", + "dependencies": { + "keypress": "0.1.x" + }, + "engines": { + "node": ">= 0.6.x" + } + }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-4.2.0.tgz", diff --git a/package.json b/package.json index 46b168b..21cf977 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "markdown-it": "^14.1.0", "moment": "^2.29.4", "node-polyfill-webpack-plugin": "^2.0.1", + "pinyin": "^4.0.0", "print-js": "^1.6.0", "qrcode": "^1.5.4", "sortablejs": "^1.15.0", diff --git a/src/components/doctorCheck/PatientRegisterBase2.vue b/src/components/doctorCheck/PatientRegisterBase2.vue index d021fe1..e9cfcbd 100644 --- a/src/components/doctorCheck/PatientRegisterBase2.vue +++ b/src/components/doctorCheck/PatientRegisterBase2.vue @@ -289,10 +289,10 @@ export default { this.prBase = res.data // ---------- 如果是总检与审核医生不可选时,则总检与审核默认当前用户,此功能放至保存时触发 - // if (this.prBase.completeFlag != '3') this.prBase.summaryDoctorId = this.userId - // if (this.prBase.completeFlag == '3' && this.prBase.isAudit == 'N') { - // this.prBase.auditDoctorId = this.userId - // } + if (this.prBase.completeFlag != '3') this.prBase.summaryDoctorId = this.prBase.summaryDoctorId || this.userId + if (this.prBase.completeFlag == '3' && this.prBase.isAudit == 'N') { + this.prBase.auditDoctorId = this.prBase.auditDoctorId || this.userId + } // ---------- // console.log('res.data',res.data) // console.log('this.prBase',this.prBase) diff --git a/src/views/customerReport/unitSettlement.vue b/src/views/customerReport/unitSettlement.vue index 0328863..f81c38f 100644 --- a/src/views/customerReport/unitSettlement.vue +++ b/src/views/customerReport/unitSettlement.vue @@ -365,7 +365,8 @@ page-break-before: avoid;}}`, // 去除页眉页脚 // 强制将单元格值转换为字符串 forceStringFormatter(row, column, cellValue) { - // 如果 cellValue 存在,则转为字符串;否则返回原值 + console.log('row, column, cellValue',row, column.property, cellValue) + // 如果 cellValue 存在,则转为字符串;否则返回原值 return cellValue ? "\u200C" + String(cellValue) : cellValue }, diff --git a/src/views/doctorCheck/sumDoctorCheck.vue b/src/views/doctorCheck/sumDoctorCheck.vue index acb6c7c..99f753c 100644 --- a/src/views/doctorCheck/sumDoctorCheck.vue +++ b/src/views/doctorCheck/sumDoctorCheck.vue @@ -619,6 +619,7 @@ export default { historySummary: '', // 历史综述 }, patient_registerInit: {}, // 重置用到 + userId:'', // 当前用户ID // 综述建议部份 summaryList: [], @@ -754,7 +755,7 @@ export default { //挂载完成 mounted() { - + this.userId = window.sessionStorage.getItem("userId") this.dictInit(); // 监听来自 Electron 的调用 @@ -1216,7 +1217,7 @@ export default { let body = { patientRegisterId: this.patient_register.id, - summaryDoctorId: this.patient_register.summaryDoctorId || null, + summaryDoctorId: this.patient_register.summaryDoctorId ||this.userId || null, summaryDate: this.patient_register.summaryDate || moment(new Date()).format("yyyy-MM-DD HH:mm:ss"), medicalConclusionId: this.patient_register.medicalConclusionId || null, summaryHistoricalReview: this.patient_register.historySummary, @@ -1288,8 +1289,11 @@ export default { .then((res) => { if (res.code > -1) { //this.patient_register.completeFlag = '3'; + this.patient_register.completeFlag = '3' + this.patient_register.summaryDoctorId = body.summaryDoctorId + this.patient_register.summaryDate = moment(new Date()).format("yyyy-MM-DD HH:mm:ss") this.getInfoByPatientRegisterNo(this.patient_register.patientRegisterNo) - .then(() => { + .then(() => { this.refParamsQuery.brushSummary++ }) } @@ -1400,7 +1404,7 @@ export default { // patient_register.summaryDoctorId // patient_register.auditDoctorId let auditDoctorId = this.patient_register.auditDoctorId - if (!auditDoctorId) auditDoctorId = window.sessionStorage.getItem("userId") + if (!auditDoctorId) auditDoctorId = this.userId||null let body = { patientRegisterId: this.patient_register.id, auditDoctorId, // 不传时,取当前用户 @@ -1438,8 +1442,10 @@ export default { postapi(`/api/app/patientregister/updatepatientregisterauditordoctor`, body) .then((res) => { console.log("unAudit", res.data); - if (res.code != -1) { + if (res.code > -1) { this.patient_register.isAudit = body.isAudit; + this.patient_register.auditDoctorId = body.auditDoctorId + this.patient_register.auditDate = moment(new Date()).format("yyyy-MM-DD HH:mm:ss") } }) .catch((err) => { diff --git a/src/views/report/report.vue b/src/views/report/report.vue index b42b73e..421f699 100644 --- a/src/views/report/report.vue +++ b/src/views/report/report.vue @@ -20,10 +20,10 @@ Math.floor(((window.pageWidth - 110 - 60) * 3) / 4) + 'px;' "> -
+
@@ -33,8 +33,8 @@ :type="dragCol[index].type" :min-width="dragCol[index].minWidth" :align="dragCol[index].align" :label="dragCol[index].type ? '' : item.label" :prop="dragCol[index].prop" :sortable="dragCol[index].type || dragCol[index].prop == 'sn' ? false : true" + :sort-method="(a, b) => chineseSort(a, b, dragCol[index].prop)" :show-overflow-tooltip="dragCol[index].showTooltip"> - @@ -128,7 +125,7 @@ 导出/推送 - 人员信息导出 + 人员信息导出 导出Zip 导出Jpg 导出 pdf 报告 @@ -136,6 +133,9 @@
+
+ test +
@@ -199,6 +199,8 @@ import moment from "moment"; import { mapState, mapActions } from "vuex"; import Sortable from "sortablejs"; +import FileSaver from 'file-saver'; +import pinyin from 'pinyin'; import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { tcdate, @@ -304,6 +306,7 @@ export default { { label: "序号", prop: "sn", minWidth: 40, align: "center" }, { label: "打印", prop: "isReportPrint", minWidth: 60, align: "center" }, { label: "领取", prop: "isReceiveReport", minWidth: 60, align: "center" }, + { label: "上传", prop: "isUpload", minWidth: 60, align: "center" }, { label: "体检进度", prop: "completeFlag", minWidth: 90, align: "center" }, { label: "体检日期", prop: "medicalStartDate", minWidth: 100, align: "center" }, { label: "单位名称", prop: "org", minWidth: 180, align: "left", showTooltip: true }, @@ -342,9 +345,8 @@ export default { { label: "领取时间", prop: "reportReceiveDate", minWidth: 140, align: "center" }, { label: "锁住", prop: "isLock", minWidth: 60, align: "center" }, { label: "预约备单", prop: "isUploadAppoint", minWidth: 90, align: "center" }, - { label: "上传", prop: "isUpload", minWidth: 60, align: "center" }, { label: "检后推送", prop: "isPushThirdResult", minWidth: 90, align: "center" }, - + // { label: "标准金额", prop: "standardAmount", minWidth: 80, align: "center" }, // { label: "应收金额", prop: "receivableAmount", minWidth: 80, align: "center" }, // { label: "实收金额", prop: "chargeAmount", minWidth: 80, align: "center" }, @@ -408,6 +410,42 @@ export default { }, methods: { dddw, setPrStatusColor, + + // 强制将单元格值转换为字符串 + // forceStringFormatter(row, column, cellValue) { + // //console.log('row, column, cellValue',row, column.property, cellValue) + // // 如果 cellValue 存在,则转为字符串;否则返回原值 + // if(['idNo','patientRegisterNo','patientNo','mobileTelephone','telephone'].includes(column.property)){ + // return cellValue ? "\u200C" + String(cellValue) : cellValue + // }else{ + // return cellValue + // } + // }, + + // 如果不想预处理,也可以在排序方法中动态计算 + chineseSort(a, b, colName) { + // console.log('a, b', a, b) + // const pinyinA = pinyin(a[colName], { style: pinyin.STYLE_NORMAL }).join(''); + // const pinyinB = pinyin(b[colName], { style: pinyin.STYLE_NORMAL }).join(''); + let valA = a[colName],valB = b[colName] + if (typeof valA == 'string'){ + // 单位、部门、姓名、地址、备注 + if(['patientName','org','dept','address','remark'].includes(colName)){ + return valA.localeCompare(valB,'zh'); + }else{ + return valA.localeCompare(valB); + } + + }else{ + return valA - valB + } + }, + + + btnTest() { + console.log('this.tableDatas3', this.tableDatas) + }, + //数据初始化 dictInit() { //性别 @@ -1086,7 +1124,7 @@ export default { this.upTsjh() break; default: //lis - this.btnExport() + this.btnExport('report_tjbg') break; } }, @@ -1271,14 +1309,14 @@ export default { //推送检后信息--健康评估 async upTsjh() { - + if ( this.checkedRows && this.checkedRows.length > 0 ) { this.elProgress.display = true; this.elProgress.percentage = 0; - + for ( let i = 0; i < this.checkedRows.length; @@ -1291,11 +1329,11 @@ export default { // 调上传接口 try { - let res = await postapi('/api/app/ThirdResultPush/PushHtyResultByPatientRegisterId',{patientRegisterId:e.patientRegisterId}) - if(res.code > -1){ + let res = await postapi('/api/app/ThirdResultPush/PushHtyResultByPatientRegisterId', { patientRegisterId: e.patientRegisterId }) + if (res.code > -1) { // 推送检后成功,更新状态 e.isPushThirdResult = "Y"; - } + } } catch (error) { console.log("error", error); this.$message.warning({ showClose: true, message: error }); @@ -1608,58 +1646,15 @@ export default { return rd; }, - //通用导出 + //通用导出 btnExport(elId) { - require.ensure([], () => { - const tHeader = []; - const filterVal = []; - this.dragCol.forEach((e) => { - tHeader.push(e.label); - filterVal.push(e.prop); - }); - const list = this.tableDatas.map((row, index) => { - const newRow = { ...row }; // 创建副本,避免修改原数据 - // 使用对象映射优化数据转换 - newRow.sn = index + 1; - if (newRow.completeFlag) - newRow.completeFlag = - newRow.isAudit == "Y" - ? "已审核" - : dddw( - this.dict.completeFlag, - "id", - newRow.completeFlag, - "displayName" - ); - newRow.isReportPrint = newRow.isReportPrint == "Y" ? "√" : ""; - if (newRow.idNo) newRow.idNo = "\u200C" + newRow.idNo; - if (newRow.patientRegisterNo) - newRow.patientRegisterNo = "\u200C" + newRow.patientRegisterNo; - if (newRow.patientNo) newRow.patientNo = "\u200C" + newRow.patientNo; - if (newRow.isLock) newRow.isLock = newRow.isLock == "Y" ? "√" : ""; - if (newRow.isVip) newRow.isVip = newRow.isVip == "Y" ? "√" : ""; - if (newRow.isUpload) - newRow.isUpload = newRow.isUpload == "Y" ? "√" : ""; - if (newRow.isUploadAppoint) - newRow.isUploadAppoint = newRow.isUploadAppoint == "Y" ? "√" : ""; - if (newRow.isReceiveReport) - newRow.isReceiveReport = newRow.isReceiveReport == "Y" ? "√" : ""; - - - if (newRow.birthDate) - newRow.birthDate = moment(newRow.birthDate).format("yyyy-MM-DD"); - - return newRow; - }); - const data = list.map((v) => filterVal.map((j) => v[j])); - exportJsonToExcel( - tHeader, - data, - "人员列表" + moment(new Date()).format("yyyyMMDDHHmmss") - ); //"列表excel" 是下载后的表名 可修改 - }); - + let table = document.getElementById(elId); + let tableData = table.innerHTML + let fileName = moment(new Date()).format('yyyyMMDDHHmmss') + '.xls' + let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" }); + FileSaver.saveAs(blob, fileName); }, + }, //监听事件