From 6697778d0948cec03b2ffa0964adb7e9a7a67615 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Wed, 21 Feb 2024 17:48:05 +0800 Subject: [PATCH] djseo --- .../PatientRegisterEditGroupBatch.vue | 200 +++++++ .../PatientRegisterEditItemBatch.vue | 472 ++++++++++++++++ .../patientRegister/PatientRegisterList.vue | 509 +----------------- src/main.js | 12 +- src/store/index.js | 27 +- 5 files changed, 724 insertions(+), 496 deletions(-) create mode 100644 src/components/patientRegister/PatientRegisterEditGroupBatch.vue create mode 100644 src/components/patientRegister/PatientRegisterEditItemBatch.vue diff --git a/src/components/patientRegister/PatientRegisterEditGroupBatch.vue b/src/components/patientRegister/PatientRegisterEditGroupBatch.vue new file mode 100644 index 0000000..98d4b07 --- /dev/null +++ b/src/components/patientRegister/PatientRegisterEditGroupBatch.vue @@ -0,0 +1,200 @@ + + + diff --git a/src/components/patientRegister/PatientRegisterEditItemBatch.vue b/src/components/patientRegister/PatientRegisterEditItemBatch.vue new file mode 100644 index 0000000..dd7edd9 --- /dev/null +++ b/src/components/patientRegister/PatientRegisterEditItemBatch.vue @@ -0,0 +1,472 @@ + + + diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index 1a2a350..00329c9 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -245,206 +245,26 @@ -
-
- 批量调整分组只针对单位体检有效,个人体检将忽略此操作;不能调整已收费或已检的项目及已总检的体检人员。 -
-
-
分组 - - - -
-
-
个人支付 -
单位支付 -
免费 -
-
-
保留加做项目(包括不属于原分组的、没有设置分组的) -
-
- - 确 定 - 取 消 - + +
-
-
- 批量调整分组只针对单位体检有效,个人体检将忽略此操作;不能调整已收费或已检的项目及已总检的体检人员。 -
-
-
增加项目 - 删除项目 -
-
-
如果删除项目属于分组则删除体检记录信息的分组设置 -
-
-
直接录入 - - - -
-
-
- - - - - - - - - - - - -
-
-
- 删除 -
-
- 删除全部 -
-
- 全个人支付 -
-
- 全单位支付 -
-
- 全赠送 -
-
-
-
- - 确 定 - 取 消 - +
@@ -482,12 +302,16 @@ import Camera from "../../components/patientRegister/Camera.vue"; import PatientRegisterAsbItem from "../../components/patientRegister/patientRegisterAsbItem.vue"; import ElProgressOCX from "../../components/report/ElProgressOCX.vue"; +import PatientRegisterEditGroupBatch from "./PatientRegisterEditGroupBatch.vue"; +import PatientRegisterEditItemBatch from "./PatientRegisterEditItemBatch.vue"; export default { components: { PatientRegisterEdit, Camera, PatientRegisterAsbItem, + PatientRegisterEditGroupBatch, //批量调整分组 + PatientRegisterEditItemBatch, //批量调整项目 ElProgressOCX, }, data() { @@ -508,27 +332,8 @@ export default { rClickRow: null, //右击的行 rClickColumn: null, //右击的列(预留) - dialogGroup: false, - groupBatch: { - patientRegisterId: null, - customerOrgGroupId: null, - payTypeFlag: "1", //0:个人付费,1:单位付费 2:免费 - isReserveAddAsbitem: true, //是否保留加做项目 - }, - - dialogAsbitem: false, - asbitemBatch: { - operate: "add", - isDeleteGroup: false, - asbItemId: "", - asbitemsTemp: [], //删除或增加项目临时用 - asbitemCurr: {}, //当前选中要删除的项目(批量调整) - }, - quickAsb: [], //可供快速选择的组合项目 - //动态列 headerCols: [], - //拖动列 dropCol: [ { label: "序号",prop: "sn",minWidth: 40,align:"center"}, @@ -588,7 +393,7 @@ export default { this.peisid = window.sessionStorage.getItem('peisid'); - //初始化可以拖动的列 + // 初始化可以拖动的列 this.dropCol = this.columnDrop(this.dropCol); this.$nextTick(() => { @@ -599,6 +404,7 @@ export default { ...mapState([ "window", "dataTransOpts", + "dialogWin", "dict", "elProgress", "patientRegister", @@ -609,6 +415,7 @@ export default { ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]), moment,dddw,deepCopy, + // 扩展定义表格行样式 handleRowClassName({ row, rowIndex }) { // highLightBg 为 'selected'的高亮 //console.log(rowIndex, row) @@ -738,19 +545,7 @@ export default { } this.multipleSelection = JSON.parse(JSON.stringify(rows)); }, - - //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf - getCustomerOrgGroup(customerOrgId) { - getapi( - `/api/app/customer-org-group/in-customer-org-id/${customerOrgId}` - ).then((res) => { - console.log("getCustomerOrgGroup", res.data); - if (res.code == 1) { - this.patientRegister.customerOrgGroup = res.data; - } - }); - }, - + //设置新增/编辑的form数据 setForm(formData){ this.patientRegister.patientRegisterRd = deepCopy(formData) @@ -818,7 +613,7 @@ export default { if(lfind > -1){ // 弹出编辑框,只有在编辑框显示时,才去触发获取数据 this.dataTransOpts.tableS.patient_register.id = this.patientRegister.prList[lfind].id - this.getCustomerOrgGroup(this.patientRegister.prList[lfind].customerOrgParentId); + // this.getCustomerOrgGroup(this.patientRegister.prList[lfind].customerOrgParentId); setTimeout(() => { this.dataTransOpts.refresh.register_asbitem.M++ }, 20); @@ -907,7 +702,6 @@ export default { .catch(err =>{ this.$message.error(`操作失败 ${err}`); }); - }, // 单个编辑 @@ -1130,6 +924,11 @@ export default { curLoad.forEach((e,index) =>{ this.patientRegister.prList.push(Object.assign({index:Number(oldCount)+Number(index),choosed:false},e)) }) + + //如果 有选中 记录,则刷新其对应的组合项目 + if(this.dataTransOpts.tableS.patient_register.id){ + this.dataTransOpts.refresh.register_asbitem.M++ + } } loading.close(); }, @@ -1234,124 +1033,10 @@ export default { return; } - this.dialogGroup = true; - }, - - //批量更新分组处理 - async groupBatchHandle() { - let groupBatch = { patientRegisterId: null, ...this.groupBatch }; - - if (groupBatch.isReserveAddAsbitem) { - groupBatch.isReserveAddAsbitem = "Y"; - } else { - groupBatch.isReserveAddAsbitem = "N"; - } - console.log("groupBatch", groupBatch); - if (!groupBatch.customerOrgGroupId) { - this.$message.warning("请选择分组"); - return; - } - - this.elProgress.display = true; - this.elProgress.percentage = 0; - for (let i = 0; i < this.multipleSelection.length; i++) { - groupBatch.patientRegisterId = this.multipleSelection[i].id; - try { - await postapi( - "/api/app/patientregister/updatepatientregistercustomerorggroup", - groupBatch - ); - } catch (error) { - console.log(error); - } - this.elProgress.percentage = Math.floor( - ((i + 1) * 100) / this.multipleSelection.length - ); - } - console.log("操作成功!"); - this.dialogGroup = false; - this.Query(); - }, - - //快速查询项目 - filterMethod(keyWords) { - //console.log('filterMethod',this.dict.asbItemQuick) - if (keyWords) { - this.quickAsb = []; - this.dict.asbItemQuick.forEach((item) => { - if ( - item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - -1 || - item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - -1 || - item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 - ) { - this.quickAsb.push(item); - } - }); - } else { - this.quickAsb = deepCopy(this.dict.asbItemQuick); - } - }, - - //快速选择项目 - quickChoosedAsb(v) { - //过滤已选的的组合项目 - let lfind = -1; - if (v) { - lfind = arrayExistObj(this.quickAsb, "id", v); - if (lfind > -1) { - this.asbitemBatch.asbitemsTemp.push({ - asbitemId: v, - asbitemName: this.quickAsb[lfind].displayName, //仅作显示用 - patientRegisterId: null, - standardPrice: this.quickAsb[lfind].price, - chargePrice: this.quickAsb[lfind].price, - payTypeFlag: "1", //默认单位支付 - isCharge: "N", - amount: 1, - }); - this.quickAsb.splice(lfind, 1); - arrayReduce(this.dict.asbItemQuick, { id: v }, "id=id"); - } - } - //console.log(v, this.asbitemBatch.asbitemsTemp); - this.$nextTick(() => { - this.$refs['quickAsbOCX'].blur(); //total asbItemId - this.asbItemId = '' - this.quickAsb = deepCopy(this.dict.asbItemQuick) - this.$refs['quickAsbOCX'].focus(); //total asbItemId - }); - - }, - - //删除临时显示的组合项目 - removeAbs(row) { - let lfind = arrayExistObj( - this.asbitemBatch.asbitemsTemp, - "asbitemId", - row.asbitemId - ); - if (lfind > -1) this.asbitemBatch.asbitemsTemp.splice(lfind, 1); - }, - - rowClickaAbitemCurr(row) { - this.asbitemBatch.asbitemCurr = row; - }, - - btnRemoveAbs() { - if (!this.asbitemBatch.asbitemCurr.asbitemId) { - this.$message.warning("请选择要删除的组合项目!"); - return; - } - this.removeAbs(this.asbitemBatch.asbitemCurr); - this.asbitemBatch.asbitemCurr.asbitemId = null; - }, + this.dialogWin.PatientRegisterEditGroupBatch = true; - removeAllAbs() { - this.asbitemBatch.asbitemsTemp = []; }, - + //批量更新项目 btnAsbBatch() { let customerOrgId = this.patientRegister.query.customerOrgId; @@ -1371,150 +1056,10 @@ export default { return } - this.dialogAsbitem = true; - //供快速选择的组合项目 - this.dict.asbItemQuick = deepCopy(this.dict.asbItemAll); - this.asbitemBatch.asbitemCurr.asbitemId = null; - this.asbitemBatch.asbitemsTemp = []; - }, - - asbitemDel(type) { - //typ==0 为批量删除 - if (Number(type) == 0) { - this.asbitemBatch.asbitemsTemp = []; - } else { - if (!this.asbitemBatch.asbitemCurr.asbitemId) { - this.$message.warning("请选中要删除的项目!"); - return; - } - //console.log(this.asbitemBatch.asbitemsTemp,this.asbitemBatch.asbitemCurr) - let lfind = arrayExistObj( - this.asbitemBatch.asbitemsTemp, - "asbitemId", - this.asbitemBatch.asbitemCurr.asbitemId - ); - if (lfind > -1) { - this.asbitemBatch.asbitemsTemp.splice(lfind, 1); - this.asbitemBatch.asbitemCurr.asbitemId = null; - } - //console.log(lfind); - } - }, - - //批量调整支付方式 - changePayTypeFlag(flag) { - this.asbitemBatch.asbitemsTemp.forEach((e) => { - e.payTypeFlag = flag; - return e; - }); - }, - - //批量调整项目 - async asbitemBatchHandle() { - let msg = "", - body = {}; - if (this.asbitemBatch.asbitemsTemp.length == 0) { - this.$message.warning("没有选择组合项目,不可执行此操作!"); - return; - } - if (this.asbitemBatch.operate == "add") { - this.asbitemBatch.asbitemsTemp.forEach((e, index) => { - if (!e.amount || !e.chargePrice) { - msg = "第 " + (index + 1) + " 行,未输入数量或价格!"; - } - }); - if (msg) { - this.$message.warning(msg); - return; - } - // { - // "organizationUnitId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "createRegisterAsbitemDtos": [ - // { - // "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "standardPrice": 0, - // "chargePrice": 0, - // "payTypeFlag": "string", - // "isCharge": "string", - // "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "amount": 0, - // "groupPackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" - // } - // ] - // } - let createRegisterAsbitemDtos = deepCopy( - this.asbitemBatch.asbitemsTemp - ); - - createRegisterAsbitemDtos.forEach((e) => { - delete e.asbitemName; - return e; - }); - this.elProgress.display = true; - this.elProgress.percentage = 0; - for (let i = 0; i < this.multipleSelection.length; i++) { - createRegisterAsbitemDtos.forEach((e) => { - e.patientRegisterId = this.multipleSelection[i].id; - return e; - }); - body = { - organizationUnitId: this.multipleSelection[i].organizationUnitId, - createRegisterAsbitemDtos, - }; - try { - await postapi( - "/api/app/registerasbitem/createregisterasbitemincustomerorgmany", - body - ); - } catch (error) { - console.log("批量增加项目错误,原因:", error); - } - this.elProgress.percentage = Math.floor( - ((i + 1) * 100) / this.multipleSelection.length - ); - } - } else { - // { - // isDeleteGroup: 'N', - // patientRegisterId: null, - // asbitemIds: [], - // } - let asbitemIds = []; - if (this.asbitemBatch.isDeleteGroup) { - body.isDeleteGroup = "Y"; - } else { - body.isDeleteGroup = "N"; - } - this.elProgress.display = true; - this.elProgress.percentage = 0; - for (let i = 0; i < this.multipleSelection.length; i++) { - this.asbitemBatch.asbitemsTemp.forEach((e) => { - asbitemIds.push(e.asbitemId); - }); - - body.patientRegisterId = this.multipleSelection[i].id; - body.asbitemIds = asbitemIds; - - try { - await postapi( - "/api/app/registerasbitem/deleteregisterasbitemincustomerorgmany", - body - ); - } catch (error) { - console.log("批量删除项目错误,原因:", error); - } - this.elProgress.percentage = Math.floor( - ((i + 1) * 100) / this.multipleSelection.length - ); - } - } - - console.log("操作成功!"); - this.dialogAsbitem = false; - this.Query(); + this.dialogWin.PatientRegisterEditItemBatch = true; + }, - + //检验申请 async lisRequest(prId) { let isPrintLisRequest = false; diff --git a/src/main.js b/src/main.js index 52096b1..4766b7b 100644 --- a/src/main.js +++ b/src/main.js @@ -106,26 +106,24 @@ function onResize() { } onResize(); -// 监听keydown:获取键盘按住事件,code返回按住的键信息 (为了省事放在全局,后续优化应考虑放至具体用到界面上) +// 监听keydown:获取键盘按住事件,code返回按住的键信息 window.addEventListener('keydown', code => { - console.log('keydown',code) + // console.log('keydown',code) if (code.key == "Shift" && code.shiftKey) { store.commit('setData', { key: 'window.shift', value: true });// 标记按住了shift键 } if (code.key == "Control" && code.ctrlKey) { store.commit('setData', { key: 'window.ctrl', value: true });// 标记按住了ctrl键 } - }); -// // 监听keyup:获取键盘松开事件,code返回按住的键信息 (为了省事放在全局,后续优化应考虑放至具体用到界面上) +// // 监听keyup:获取键盘松开事件,code返回按住的键信息 window.addEventListener('keyup', code => { - console.log('keyup',code) + // console.log('keyup',code) if (code.key == "Shift") { store.commit('setData', { key: 'window.shift', value: false });// 标记松开了shift键 } if (code.key == "Control") { store.commit('setData', { key: 'window.ctrl', value: false });// 标记松开了ctrl键 - } - + } }); diff --git a/src/store/index.js b/src/store/index.js index 7964d14..a8680f0 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -183,7 +183,7 @@ export default new Vuex.Store({ dataAsbitemOCX: [], //通用组合项目查询的数据 }, - //公共字典数据 add by pengjun + //公共字典数据(量大的数据字典推荐用 indexedDB ) add by pengjun dict: { personOrgId: "00000000-0000-0000-0000-000000000000", //个人体检单位ID organization: [], //体检中心 @@ -245,7 +245,7 @@ export default new Vuex.Store({ diagnosisLevel: [], //诊断级别 }, - //项目特有的对象数据 + // 项目特有的对象数据 project private projPriv: { idNos: { Code: "Success", //读取成功/失败 @@ -262,17 +262,21 @@ export default new Vuex.Store({ }, //读取身份证信息 }, - //多层数据传递时使用(统一归结在此,便于管理) + // 多层数据传递时使用(统一归结在此,便于管理) dataTransOpts: { //强制刷新(如触发数据刷新的ID值没有变化时,但也想强制刷新数据: S--single 单记录刷新,M--more 多记录刷新) refresh: { - patient_register: { S: 0, M: 0 }, - register_asbitem: { S: 0, M: 0 }, - register_check: { S: 0, M: 0 }, - register_check_item: { S: 0, M: 0 }, + asbitem: { S: 0, M: 0 }, // 组合项目 + customer_org_group: { S: 0, M: 0 }, // 单位分组 + patient_register: { S: 0, M: 0 }, // 体检人员记录 + register_asbitem: { S: 0, M: 0 }, // 体检人员登记的项目(合并前) + register_check: { S: 0, M: 0 }, // 体检人员登记的项目(合并后) + register_check_item: { S: 0, M: 0 }, // 体检人员登记的明细项目 }, //表当前数据(单条记录 S--single) tableS: { + asbitem: { id: '' }, // 组合项目 + customer_org_group: { id: '' }, // 单位分组 patient_register: { id: '' }, register_asbitem: { id: '' }, register_check: { id: '' }, @@ -280,12 +284,21 @@ export default new Vuex.Store({ }, //表当前数据(多条记录 M--more) tableM: { + asbitem: [], // 组合项目 + customer_org_group: [], // 单位分组 patient_register: [], register_asbitem: [], register_check: [], register_check_item: [] } + }, + + // 弹窗控制 + dialogWin: { + PatientRegisterEditItemBatch: false, //批量调整项目 + PatientRegisterEditGroupBatch: false, //批量调整分组 } + }, getters: {