From 8a3eb31883207bc333927a461f743e15b72d7ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Thu, 25 May 2023 18:08:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Nursingstationserviceorder.vue | 2 +- pages/hospitalcare/hospitalcare.vue | 69 +++++++++++++++++-- 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue b/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue index 8ba7b13..c8fdcd0 100644 --- a/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue +++ b/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue @@ -7,7 +7,7 @@ {{item.orderStatus=='WAIT_PAY'?'待付款':''}} {{item.orderStatus=='PAY'?'已付款':''}} {{item.orderStatus=='WAIT_DISPATCH'&&item.orderType!='COMPANION_IN_HOSPITAL'?'待服务':''}} - {{item.orderStatus=='WAIT_DISPATCH'&&item.orderType=='COMPANION_IN_HOSPITAL'?'服务完成':''}} + {{item.orderStatus=='WAIT_DISPATCH'&&item.orderType=='COMPANION_IN_HOSPITAL'?'已支付(陪诊陪护)':''}} {{item.orderStatus=='NOT_FINISH'?'待完成':''}} {{item.orderStatus=='COMPLETE'?'待评价':''}} {{item.orderStatus=='EVALUATED'?'服务完成':''}} diff --git a/pages/hospitalcare/hospitalcare.vue b/pages/hospitalcare/hospitalcare.vue index af5c76b..99664bc 100644 --- a/pages/hospitalcare/hospitalcare.vue +++ b/pages/hospitalcare/hospitalcare.vue @@ -44,7 +44,7 @@ - ¥{{orderlist.totalPrice}} + ¥{{totalPrice}} 购买 @@ -82,6 +82,7 @@ }, timevalue: undefined, timepicker: false, + totalPrice: false, } }, onShow() {}, @@ -92,7 +93,7 @@ }, watch: { companionDays() { - this.orderlist.totalPrice = this.companionDays * this.orderlist.nurseItemPrice + this.totalPrice = this.argMul(this.companionDays, this.orderlist.totalPrice) }, }, methods: { @@ -174,6 +175,7 @@ getPatientInfo(stationId, stationItemId, stationItemPriceId) { getAppStationItemInfo(stationId, stationItemId, stationItemPriceId).then(res => { res.data.nurseItemContent = '' + this.totalPrice = res.data.totalPrice this.orderlist.totalPrice = res.data.totalPrice this.orderlist.nurseItemName = res.data.nurseItemName this.orderlist.nurseItemPrice = res.data.nurseItemPrice @@ -190,14 +192,73 @@ this.timepicker = true }, timeconfirm(e) { - console.log(e) this.orderlist.companionStartDate = e.year + '-' + e.month + '-' + e.day this.orderlist.companionEndDate = e.year + '-' + e.endmonth + '-' + e.endday var starttime = e.year + '.' + e.month + '.' + e.day var endtime = e.year + '.' + e.endmonth + '.' + e.endday this.timevalue = starttime + ' - ' + endtime this.timepicker = false - } + }, + argAdd(arg1, arg2) { + // 加法函数 + var _this = this, + r1 = 0, + r2 = 0, + m = 0; + try { + r1 = arg1.toString().split(".")[1].length + } catch (e) {} + try { + r2 = arg2.toString().split(".")[1].length + } catch (e) {} + m = Math.pow(10, Math.max(r1, r2)) + return _this.argDiv((_this.argMul(arg1, m) + _this.argMul(arg2, m)), m) + }, + argSubtr(arg1, arg2) { + // 减法函数 + var _this = this, + r1 = 0, + r2 = 0, + m = 0; + try { + r1 = arg1.toString().split(".")[1].length + } catch (e) {} + try { + r2 = arg2.toString().split(".")[1].length + } catch (e) {} + m = Math.pow(10, Math.max(r1, r2)); + return _this.argDiv((_this.argMul(arg1, m) - _this.argMul(arg2, m)), m) + }, + argMul(arg1, arg2) { + // 乘法函数 + var _this = this, + m = 0, + s1 = arg1.toString(), + s2 = arg2.toString(); + try { + m += s1.split(".")[1].length + } catch (e) {} + try { + m += s2.split(".")[1].length + } catch (e) {} + return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m) + }, + argDiv(arg1, arg2) { + // 除法函数 + var _this = this, + t1 = 0, + t2 = 0, + r1, r2; + try { + t1 = arg1.toString().split(".")[1].length + } catch (e) {} + try { + t2 = arg2.toString().split(".")[1].length + } catch (e) {} + r1 = Number(arg1.toString().replace(".", "")) + r2 = Number(arg2.toString().replace(".", "")) + return _this.argMul((r1 / r2), Math.pow(10, t2 - t1)); + }, } }