From b4cfb9cb80d259f7ed4745b3ec87b1d29aea8a1b Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Mon, 30 Nov 2020 14:27:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=A2=84=E4=BB=98=E8=B4=B9?= =?UTF-8?q?=E6=94=B6=E8=B4=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/fantang/prepayment/index.vue | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/ruoyi-ui/src/views/fantang/prepayment/index.vue b/ruoyi-ui/src/views/fantang/prepayment/index.vue index 744fef5d4..b1dda03e4 100644 --- a/ruoyi-ui/src/views/fantang/prepayment/index.vue +++ b/ruoyi-ui/src/views/fantang/prepayment/index.vue @@ -140,7 +140,7 @@ @@ -178,7 +178,7 @@ @@ -322,6 +322,7 @@ "departName": item.departName, "name": item.name, "bedId": item.bedId, + "patientId": item.patientId, } }); this.loading = false; @@ -333,7 +334,10 @@ // 处理自动查询列表选择的事件 handleSelect(item) { this.formAddPrepayment.name = item.name; - console.log(item); + this.formAddPrepayment.patientId = item.patientId; + this.formAddPrepayment.bedId = item.bedId; + this.formAddPrepayment.departName = item.departName; + this.formAddPrepayment["hospitalId"] = item.value ; }, // 处理点击查询图标的事件 @@ -367,9 +371,11 @@ settlementId: null, settlementFlag: null, prepaid: 500, - prepaidAt: new Date() + prepaidAt: new Date(), + hospitalId: null, + name: null, }; - this.resetForm("form"); + this.resetForm("formAddPrepayment"); }, /** 搜索按钮操作 */ handleQuery() { @@ -390,7 +396,6 @@ /** 新增按钮操作 */ handleAdd() { this.reset(); - this.formAddPrepayment.pre this.open = true; this.title = "添加收费管理"; }, @@ -405,22 +410,24 @@ }); }, /** 提交按钮 */ - submitForm() { - this.$refs["form"].validate(valid => { + submitformAddPrepayment() { + let hospitalId = this.formAddPrepayment.hospitalId; + this.$refs["formAddPrepayment"].validate(valid => { if (valid) { - if (this.formAddPrepayment.prepaymentId != null) { - updatePrepayment(this.formAddPrepayment).then(response => { - this.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); - } else { - addPrepayment(this.formAddPrepayment).then(response => { - this.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); + if (!this.NoPrepayments.find(function(x) { + return x.hospitalId === hospitalId; + })) { + this.msgError("未找到该住院号记录,请先添加!"); + return ; } + + this.formAddPrepayment.prepaidAt = null; + console.log("form -->", this.formAddPrepayment) + addPrepayment(this.formAddPrepayment).then(response => { + this.msgSuccess("新增成功"); + this.open = false; + this.getList(); + }); } }); },