From 348f8d69a51b2f580d4d5f11719e583078131721 Mon Sep 17 00:00:00 2001 From: xyc <3422692813@qq.com> Date: Mon, 1 Sep 2025 17:22:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9B=B4=E6=96=B00901?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/partner/workOrder.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/partner/workOrder.vue b/src/views/partner/workOrder.vue index 2aaab70..13fa722 100644 --- a/src/views/partner/workOrder.vue +++ b/src/views/partner/workOrder.vue @@ -270,8 +270,9 @@ type="text" icon="el-icon-edit" @click="settlementWork(scope.row)" - v-if="!scope.row.settlementAmount && !scope.row.realPayMoney" + > + 结算 Date: Tue, 2 Sep 2025 17:42:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B00902?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/partner/workOrder.vue | 67 +++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/src/views/partner/workOrder.vue b/src/views/partner/workOrder.vue index 0c1f5aa..f38668a 100644 --- a/src/views/partner/workOrder.vue +++ b/src/views/partner/workOrder.vue @@ -490,20 +490,29 @@ append-to-body > - + {{ goodsPrice / 100 }} + 单位:元 - + + + :min="0" + :max="goodsPrice / 100" + @change="jisuan" + placeholder="请输入优惠金额"> + +
+ 可输入范围:0 - {{ goodsPrice / 100 }} 元 +
- - + + + + @@ -1009,14 +1018,21 @@ - + + @change="batchJisuan" + style="width: 100%;" + > + + +
+ 可输入范围:0 - {{ settleForm.goodsPrice }} 元 +
this.goodsPrice / 100) { - this.reduceMoney = this.goodsPrice / 100; + // 修复后的计算逻辑 + const goodsPriceYuan = this.goodsPrice / 100; + + // 确保优惠金额不超过商品价格 + if (this.reduceMoney > goodsPriceYuan) { + this.reduceMoney = goodsPriceYuan; } - this.payMoney = this.goodsPrice / 100 - this.reduceMoney; + + // 计算实付金额,确保不低于0 + this.payMoney = Math.max(0, goodsPriceYuan - this.reduceMoney); }, jisuanSetlementMoney() { console.log('执行了算') @@ -1564,11 +1586,18 @@ export default { this.settlementForm.settlementAmount = this.settlementForm.goodsPrice / 100 - this.settlementForm.settlementReduceMoney; }, batchJisuan() { + // 确保优惠金额不超过商品价格 if (this.settleForm.reduceMoney > this.settleForm.goodsPrice) { this.settleForm.reduceMoney = this.settleForm.goodsPrice; } - this.settleForm.realPayMoney = - this.settleForm.goodsPrice - this.settleForm.reduceMoney; + + // 计算实付金额 + this.settleForm.realPayMoney = this.settleForm.goodsPrice - this.settleForm.reduceMoney; + + // 确保实付金额不为负数 + if (this.settleForm.realPayMoney < 0) { + this.settleForm.realPayMoney = 0; + } }, tijiao() { console.log(this.fileUrls); From 34b49e31ee31133a46967ffbf7c004347d2e9ba2 Mon Sep 17 00:00:00 2001 From: xyc <3422692813@qq.com> Date: Thu, 4 Sep 2025 10:58:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B00904?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/partner/workOrder.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/partner/workOrder.vue b/src/views/partner/workOrder.vue index f38668a..f0d6b9b 100644 --- a/src/views/partner/workOrder.vue +++ b/src/views/partner/workOrder.vue @@ -335,6 +335,7 @@ class-name="small-padding fixed-width" >