From df665c54e22397300b7924751675fc6f215eb21d Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Mon, 8 Apr 2024 11:28:12 +0800 Subject: [PATCH] =?UTF-8?q?batch=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PatientRegisterEditGroupBatch.vue | 65 ++++++++++++++----- .../PatientRegisterEditItemBatch.vue | 18 +++-- 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/src/components/patientRegister/PatientRegisterEditGroupBatch.vue b/src/components/patientRegister/PatientRegisterEditGroupBatch.vue index 991326b..650f811 100644 --- a/src/components/patientRegister/PatientRegisterEditGroupBatch.vue +++ b/src/components/patientRegister/PatientRegisterEditGroupBatch.vue @@ -9,13 +9,20 @@ -
-
个人支付 -
单位支付 -
免费 +
+ +
+ 支付方式 +
+
+
+ 个人支付 +
单位支付 +
免费 +
-
保留加做项目(包括不属于原分组的、没有设置分组的) + 保留加做项目(包括不属于原分组的、没有设置分组的)
@@ -65,10 +72,11 @@ export default { payTypeFlag: "1", //0:个人付费,1:单位付费 2:免费 isReserveAddAsbitem: true, //是否保留加做项目 }, - groupBatchInit:{}, + groupBatchInit: {}, }; }, + created() { this.groupBatchInit = deepCopy(this.groupBatch) }, @@ -90,7 +98,7 @@ export default { }, methods: { moment, dddw, deepCopy, - + //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf getCustomerOrgGroup(customerOrgRegisterId) { this.customerOrgGroup = [] @@ -120,24 +128,45 @@ export default { this.$message.warning("请选择分组"); return; } - + let isContinue = true // 遇到错误是否继续 this.elProgress.display = true; this.elProgress.percentage = 0; for (let i = 0; i < this.multipleSelection.length; i++) { + if (!isContinue) break; groupBatch.patientRegisterId = this.multipleSelection[i].id; try { - await postapi( - "/api/app/patientregister/updatepatientregistercustomerorggroup", - groupBatch - ); - } catch (error) { - console.log(error); + // 旧接口:/api/app/patientregister/updatepatientregistercustomerorggroup + let res = await postapi("/api/app/patientregister/BatchUpdateCustomerOrgGroup", groupBatch); + if (res.code == -1) { + try { + await this.$confirm(`人员 ${this.multipleSelection[i].patientName} 调整分组失败, 是否继续操作其他人员?`, "提示", { + confirmButtonText: "是", + cancelButtonText: "否", + type: "warning", + }) + } catch (error) { + console.log(error) // 取消 + isContinue = false; + } + } + } catch (err) { + try { + await this.$confirm(`人员 ${this.multipleSelection[i].patientName} 调整分组失败, 是否继续操作其他人员?`, "提示", { + confirmButtonText: "是", + cancelButtonText: "否", + type: "warning", + }) + } catch (error) { + console.log(error) // 取消 + isContinue = false; + } } - this.elProgress.percentage = Math.floor( - ((i + 1) * 100) / this.multipleSelection.length - ); + + + this.elProgress.percentage = Math.floor(((i + 1) * 100) / this.multipleSelection.length); } - console.log("操作成功!"); + // console.log("操作成功!"); + this.elProgress.display = false; this.dialogWin.PatientRegisterEditGroupBatch = false // 操作成功后,刷新列表 this.patientRegister.query.times++ diff --git a/src/components/patientRegister/PatientRegisterEditItemBatch.vue b/src/components/patientRegister/PatientRegisterEditItemBatch.vue index 0f30511..eee1864 100644 --- a/src/components/patientRegister/PatientRegisterEditItemBatch.vue +++ b/src/components/patientRegister/PatientRegisterEditItemBatch.vue @@ -267,14 +267,19 @@ export default { return; } let registerCheckAsbitems = deepCopy( - this.asbitemBatch.asbitemsTemp - ); + this.asbitemBatch.asbitemsTemp + ); + let isContinue = true // 遇到错误是否继续 if (this.asbitemBatch.operate == "add") { this.asbitemBatch.asbitemsTemp.forEach((e, index) => { - if (!e.amount || !e.chargePrice) { - msg = "第 " + (index + 1) + " 行,未输入数量或价格!"; + if (!e.amount) { + msg = "第 " + (index + 1) + " 行,未输入数量!"; } + if (e.chargePrice == '' || Number(e.chargePrice) < 0) { + msg = "第 " + (index + 1) + " 行,价格必须 ≥ 0 !"; + } + }); if (msg) { this.$message.warning(msg); @@ -288,7 +293,7 @@ export default { this.elProgress.display = true; this.elProgress.percentage = 0; - let isContinue = true // 遇到错误是否继续 + for (let i = 0; i < this.multipleSelection.length; i++) { if (!isContinue) break; // createRegisterAsbitemDtos.forEach((e) => { @@ -350,10 +355,11 @@ export default { this.elProgress.display = true; this.elProgress.percentage = 0; for (let i = 0; i < this.multipleSelection.length; i++) { + if (!isContinue) break; // this.asbitemBatch.asbitemsTemp.forEach((e) => { // asbitemIds.push(e.asbitemId); // }); 旧的参数 - + body.patientRegisterId = this.multipleSelection[i].id; // body.asbitemIds = asbitemIds;