From cafe626bcd88599d60be2474c96dd16644109f69 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Fri, 26 Apr 2024 18:16:43 +0800 Subject: [PATCH] retrieve --- .../doctorCheck/PatientRegisterList.vue | 86 ++++++++-- src/components/patientRegister/PatientLis.vue | 153 +++--------------- .../patientRegister/PatientRegisterEdit.vue | 34 ++-- .../patientRegister/PatientRegisterItem.vue | 69 ++++---- .../patientRegister/PatientRegisterList.vue | 6 +- 5 files changed, 153 insertions(+), 195 deletions(-) diff --git a/src/components/doctorCheck/PatientRegisterList.vue b/src/components/doctorCheck/PatientRegisterList.vue index 466675b..c8ee519 100644 --- a/src/components/doctorCheck/PatientRegisterList.vue +++ b/src/components/doctorCheck/PatientRegisterList.vue @@ -10,7 +10,8 @@
- + @@ -56,8 +57,8 @@ +
+
+
+ 共:{{ loadOpts.totalCount }} 条记录,当前显示:{{ dataList.length }} + 条。 +
+
+ width="800px" height="600px"> @@ -216,6 +224,15 @@ export default { quickAsb: [], asbItemQuick: [], + dom: null, //用于滚动加载数据 + lazyLoading: false, //是否懒加载中 + loadOpts: { + totalCount: 0, + skipCount: 0, + maxResultCount: 100, + }, + loadOptsInit: {}, + oneClick: 0, // 1 表示行单击一次 DbClick: 0, // 1 表示行有单击第二次 }; @@ -223,12 +240,17 @@ export default { created() { this.dictInit() + this.loadOptsInit = Object.assign({}, this.loadOpts) }, //挂载完成 - mounted() { }, + mounted() { + this.$nextTick(() => { + this.scrollFull() + }) + }, computed: { - ...mapState(["window", "dataTransOpts", "dict", "customerOrg","patientRegister", "doctorCheck", "sumDoctorCheck", "report"]), + ...mapState(["window", "dataTransOpts", "dict", "customerOrg", "patientRegister", "doctorCheck", "sumDoctorCheck", "report"]), }, methods: { ...mapMutations(['doctorCheckPrBaseInit', 'sumPREditInit']), @@ -263,7 +285,7 @@ export default { this.local.completeFlag.splice(0, 1) //预记选项去掉 }, - + //快速选择组合项目时,调整可按拼间简码及简称查找 filterMethod(keyWords) { //console.log('filterMethod',this.asbItemQuick) @@ -335,7 +357,7 @@ export default { //双击选中客户记录后,并半闭列表 rowDblclick(row) { - this.rowClick(row) + // this.rowClick(row) this.doctorCheck.doctorCheckDialogVisible = false this.sumDoctorCheck.sumDoctorCheckDialogVisible = false @@ -347,7 +369,13 @@ export default { }, //查询 - query() { + async query() { + this.loadOpts = Object.assign(this.loadOpts, this.loadOptsInit) + await this.getPrList() + }, + + async getPrList() { + if (this.loadOpts.skipCount != 0 && this.loadOpts.skipCount * this.loadOpts.maxResultCount >= this.loadOpts.totalCount) return let body = {}, customerOrgs = [] console.log('this.report.dataCusOrgOCX', this.report.dataCusOrgOCX) if (this.report.dataCusOrgOCX.length > 0) { @@ -380,7 +408,7 @@ export default { if (this.local.query.checkAsb) body.asbitems = [this.local.query.checkAsb] if (this.local.query.haveImage) body.isPicture = 'Y' - body.maxResultCount = 1000 + body.isFilterPreRegistration = 'Y' //是否需要过滤预登记数据 Y=过滤预登记数据 N=不过滤 默认为N (备注:只有CompleteFlag参数的值不为0的情况才有效,null值也有效) // "patientName": "string", // "sexId": "string", @@ -388,7 +416,7 @@ export default { // "completeFlag": "string", // "maxResultCount": 0 - console.log('/api/patientregister/getpeisrecordlist', body) + console.log('/api/patientregister/getpeisrecordlist', Object.assign(body,this.loadOpts)) // const loading = this.$loading({ // lock: true, // text: "Loading", @@ -397,8 +425,13 @@ export default { // }); postapi('/api/patientregister/getpeisrecordlist', body) .then((res) => { - if (res.code != -1) { - this.dataList = res.data.items; + if (res.code > -1) { + + // 刷新最大记录数 + this.loadOpts.totalCount = res.data.totalCount + if (body.skipCount == 0) this.dataList = []; + this.dataList = this.dataList.concat(res.data.items) + } }) // .finally(() =>{ @@ -407,6 +440,33 @@ export default { ; }, + //数据量多时,滚动加载 + async load() { + this.loadOpts.skipCount++ + await this.getPrList() + }, + + //滚动加载数据 + scrollFull() { + this.dom = this.$refs['info'].bodyWrapper + console.log('this.dom', this.dom) + + this.dom.addEventListener('scroll', async () => { + // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight); + if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) { + // 获取到的不是全部数据 当滚动到底部 + console.log('scrollTop', this.dom.scrollTop, 'clientHeight', this.dom.clientHeight, 'scrollHeight', this.dom.scrollHeight); + if ((Number(this.loadOpts.skipCount) + 1) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) { + this.lazyLoading = false + } else { + this.lazyLoading = true + await this.load() + this.lazyLoading = false + // this.dom.scrollTop = this.dom.scrollTop - 100 + } + } + }) + }, //关闭 close() { diff --git a/src/components/patientRegister/PatientLis.vue b/src/components/patientRegister/PatientLis.vue index f797974..fc8f188 100644 --- a/src/components/patientRegister/PatientLis.vue +++ b/src/components/patientRegister/PatientLis.vue @@ -2,12 +2,12 @@
-
+
+ :height="window.pageHeight < 600 ? 238 : Math.floor((window.pageHeight - 243) * 2 / 3)" @row-click="rowClick" + size="small" row-key="id" @selection-change="handleSelectionChange" ref="info" id="info" + :row-class-name="handleRowClassName"> -
- -
- 加载中... -
-
-
- +
-
+
全选
@@ -261,7 +255,8 @@ export default { oneClick: 0, // 1 表示行单击一次 DbClick: 0, // 1 表示行有单击第二次 - lisLabel: 'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg', + printPre: 0, + lisLabel: '', // data:application/pdf;base64, }; }, @@ -374,6 +369,7 @@ export default { //点击体检次数行 rowClick(row) { + /* if (this.oneClick == 0) { this.oneClick = 1; } else { @@ -389,7 +385,8 @@ export default { setTimeout(() => { //300ms内没有第二次点击,执行单击事件 if (this.oneClick == 1 && this.DbClick == 0) this.rowClickRetrieve(row) }, 300) - + */ + this.rowClickRetrieve(row) }, rowClickRetrieve(row) { @@ -452,16 +449,11 @@ export default { // 弹出编辑框,只有在编辑框显示时,才去触发获取数据 this.dataTransOpts.tableS.patient_register.id = this.tableData[lfind].id this.tableDataCurrentRow = deepCopy(this.tableData[lfind]) - this.dataTransOpts.refresh.register_check_asbitem.M++ //触发所选组合项目刷新 + //触发条码预览 + if (this.$peisAPI) this.lisPrint(this.dataTransOpts.tableS.patient_register.id, "0002", "Y", "Y") } }, - // 双击 - rowDblclick(row) { - this.rowClick(row) - this.btnEdit() - }, - //查询 async Query() { // 查询时,清掉明细数据 (滚动时不清) @@ -674,7 +666,7 @@ export default { }, //检验条码打印 - lisPrint(prId, ReportCode, isPreview) { + lisPrint(prId, ReportCode, isPreview, IsUploadPdf) { if (!this.$peisAPI) { this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" }); return; @@ -686,7 +678,7 @@ export default { ReportCode, token, isBuildImage: 'N', - IsUploadPdf: 'N', + IsUploadPdf, preViewCanPrint: "N", Parameters: [ { Name: "printer", Value: user }, @@ -695,29 +687,14 @@ export default { BusinessCode: prId }; - if (isPreview) { - /* - postapi( - `/api/app/printreport/getlisrequestreport?PatientRegisterId=${prId}` - ) - .then((res) => { - if (res.code != -1) { - toOutShell.ReportTable = { lisRequest: res.data }; - console.log( - "JSON.stringify(toOutShell)", - JSON.stringify(toOutShell) - ); - return this.$peisAPI.printPre(JSON.stringify(toOutShell)); - } - }) - .catch((err) => { - this.$message.warning(err); - }); - */ + if (isPreview) { this.$peisAPI.printPre(JSON.stringify(toOutShell)) .then(res => { - if (JSON.parse(res).code < 0) { + let lres = JSON.parse(res) + if (lres.code < 0) { this.$message.warning({ showClose: true, message: JSON.parse(res).message }); + }else if(IsUploadPdf == 'Y'){ + this.lisLabel = 'data:application/pdf;base64,' + lres.data } }) .catch((err) => { @@ -726,39 +703,7 @@ export default { }); } else { - /* - postapi( - `/api/app/printreport/getlisrequestreport?PatientRegisterId=${prId}` - ) - .then((res) => { - if (res.code != -1) { - toOutShell.ReportTable = { lisRequest: res.data }; - console.log( - "JSON.stringify(toOutShell)", - JSON.stringify(toOutShell) - ); - return this.$peisAPI.print(JSON.stringify(toOutShell)); - } - }) - .then((res) => { - //console.log("res", res); - if (JSON.parse(res).code >= 0) { - //更新打印状态 /api/app/lisrequest/updatelisrequestisprint - // { - // "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId) - // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" - // } - return postapi("/api/app/lisrequest/updatelisrequestisprint", { - operateType: 1, - patientRegisterId: prId, - }); - } - }) - .catch((err) => { - this.$message.warning(err); - }); - */ + this.$peisAPI.print(JSON.stringify(toOutShell)) .then(res => { if (JSON.parse(res).code < 0) { @@ -803,25 +748,7 @@ export default { BusinessCode: prId }; - if (isPreview) { - /* - postapi( - `/api/app/printreport/getpacsnoreport?PatientRegisterId=${prId}` - ) - .then((res) => { - if (res.code != -1) { - toOutShell.ReportTable = { lisRequest: res.data }; - console.log( - "JSON.stringify(toOutShell)", - JSON.stringify(toOutShell) - ); - return this.$peisAPI.printPre(JSON.stringify(toOutShell)); - } - }) - .catch((err) => { - this.$message.warning(err); - }); - */ + if (isPreview) { this.$peisAPI.printPre(JSON.stringify(toOutShell)) .then(res => { if (JSON.parse(res).code < 0) { @@ -832,39 +759,7 @@ export default { console.log('打印pacs条码错误', err) this.$message.warning({ showClose: true, message: `${err}` }); }); - } else { - /* - postapi( - `/api/app/printreport/getpacsnoreport?PatientRegisterId=${prId}` - ) - .then((res) => { - if (res.code != -1) { - toOutShell.ReportTable = { lisRequest: res.data }; - console.log( - "JSON.stringify(toOutShell)", - JSON.stringify(toOutShell) - ); - return this.$peisAPI.print(JSON.stringify(toOutShell)); - } - }) - .then((res) => { - if (JSON.parse(res).code >= 0) { - //更新打印状态 /api/app/lisrequest/updatelisrequestisprint - // { - // "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId) - // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" - // } - return postapi("/api/app/lisrequest/updatelisrequestisprint", { - operateType: 1, - patientRegisterId: prId, - }); - } - }) - .catch((err) => { - this.$message.warning(err); - }); - */ + } else { this.$peisAPI.print(JSON.stringify(toOutShell)) .then(res => { if (JSON.parse(res).code < 0) { diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue index 4e626dd..290c5f9 100644 --- a/src/components/patientRegister/PatientRegisterEdit.vue +++ b/src/components/patientRegister/PatientRegisterEdit.vue @@ -24,7 +24,7 @@ @@ -1803,24 +1803,24 @@ export default { }, //拍照触发 - "form.photo"(newVal, oldVal) { - //console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal) - if (newVal != oldVal) { - this.getPeoplePhoto(newVal) - } - }, + // "form.photo"(newVal, oldVal) { + // //console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal) + // if (newVal != oldVal) { + // this.getPeoplePhoto(newVal) + // } + // }, //修改单位触发 - "form.customerOrgId": { - // immediate:true, - // // deep:true, - handler(newVal, oldVal) { - //console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal) - if (newVal != oldVal) { - this.changeCustomerOrgId(newVal) - } - } - }, + // "form.customerOrgId": { + // // immediate:true, + // // // deep:true, + // handler(newVal, oldVal) { + // //console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal) + // if (newVal != oldVal) { + // this.changeCustomerOrgId(newVal) + // } + // } + // }, // 从体检人员登记列表 点登记,触发 // 清空查询条件 diff --git a/src/components/patientRegister/PatientRegisterItem.vue b/src/components/patientRegister/PatientRegisterItem.vue index 8963308..79519fa 100644 --- a/src/components/patientRegister/PatientRegisterItem.vue +++ b/src/components/patientRegister/PatientRegisterItem.vue @@ -235,7 +235,7 @@ export default { }) }, mounted() { - this.getPrAsb(this.dataTransOpts.tableS.patient_register.id) + // this.getPrAsb(this.dataTransOpts.tableS.patient_register.id) }, methods: { @@ -423,36 +423,36 @@ export default { }, //更新所选组合项目 - async onSubmit(msg) { - let ret = false + // async onSubmit(msg) { + // let ret = false - ret = await this.batchAddAsb() - if (!ret) { - if (msg) this.$message.warning({ showClose: true, message: `组合项目 ${msg} 失败!`}) - return - } + // ret = await this.batchAddAsb() + // if (!ret) { + // if (msg) this.$message.warning({ showClose: true, message: `组合项目 ${msg} 失败!`}) + // return + // } - ret = await this.batchDelAsb() - if (!ret) { - if (msg) this.$message.warning({ showClose: true, message: `组合项目 ${msg} 失败!`}) - return - } + // ret = await this.batchDelAsb() + // if (!ret) { + // if (msg) this.$message.warning({ showClose: true, message: `组合项目 ${msg} 失败!`}) + // return + // } - ret = await this.batchEditAsb() - if (!ret) { - if (msg) this.$message.warning({ showClose: true, message: `组合项目 ${msg} 失败!`}) - return - } + // ret = await this.batchEditAsb() + // if (!ret) { + // if (msg) this.$message.warning({ showClose: true, message: `组合项目 ${msg} 失败!`}) + // return + // } - console.log('this.prAsbOpraOpts.formId', this.prAsbOpraOpts.formId) - if (this.prAsbOpraOpts.formId) { - this.refreshFormId() - } else { - //触发保存人员基本信息 - this.triggerHeadSave() - this.getPrAsb(this.prForm.id) - } - }, + // console.log('this.prAsbOpraOpts.formId', this.prAsbOpraOpts.formId) + // if (this.prAsbOpraOpts.formId) { + // this.refreshFormId() + // } else { + // //触发保存人员基本信息 + // this.triggerHeadSave() + // this.getPrAsb(this.prForm.id) + // } + // }, //未选组合项目 勾选情况 handleSelectionChange(val) { @@ -1117,7 +1117,8 @@ export default { // } // } // }, - + + // 查询人员登记项目 "dataTransOpts.refresh.register_check_asbitem.D": { // immediate: true, // 立即执行 // deep: true, // 深度监听复杂类型内变化 @@ -1176,12 +1177,12 @@ export default { }, //体检信息保存,触发已选组合项目保存 - "prAsbOpraOpts.prAsbSave"(newVal, oldVal) { - console.log("patientRegister.saveTimes newVal:", newVal, " oldVal:", oldVal); - if (newVal != oldVal) { - this.onSubmit(''); - } - }, + // "prAsbOpraOpts.prAsbSave"(newVal, oldVal) { + // console.log("patientRegister.saveTimes newVal:", newVal, " oldVal:", oldVal); + // if (newVal != oldVal) { + // this.onSubmit(''); + // } + // }, }, }; diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index ddfba87..90f5b6a 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -609,7 +609,7 @@ export default { // 双击 rowDblclick(row) { - this.rowClick(row) + // this.rowClick(row) this.btnEdit() }, @@ -690,11 +690,13 @@ export default { return; } //console.log(this.patientRegister.patientRegisterRd,this.tableData) - this.dialogWin.PatientRegisterEdit = true; + // 触发数据刷新 this.dataTransOpts.refresh.patient_register.S++ //触发人员信息刷新(会同时刷新组合项目) this.dataTransOpts.plus.clearPatientRegisterQuery++ //触发清空人员登记界面的查询条件 + this.dialogWin.PatientRegisterEdit = true; + }, //新增或编辑后选中记录