修改订单管理优惠金额计算,修复订单退款时客座费部分退款问题

This commit is contained in:
2024-11-20 18:25:37 +08:00
parent d9cf881b62
commit 9969251050
4 changed files with 180 additions and 85 deletions

View File

@@ -12,10 +12,18 @@
<div class="u-flex color-999 u-m-t-4">
{{ goods.productSkuName||'' }}
</div>
<div class="flex u-row-between u-p-b-16 u-m-t-10 border-bottom">
<span>退款数量</span>
<div class="u-flex">
<number-box v-model="number" :min="1" :max="max"></number-box>
<div class="u-p-b-16 border-bottom">
<div class="flex u-row-between">
<span>退款数量</span>
<div class="u-flex" v-if="!isSeatFee">
<number-box v-model="number" :min="1" :max="max"></number-box>
</div>
<div class="u-flex" v-else>
{{ number }}
</div>
</div>
<div class="u-font-12 color-999 u-m-t-8" v-if="isSeatFee">
<div><span class="color-red">*</span><span>客座费只能全退</span> </div>
</div>
</div>
<div class="u-m-t-12 u-font-12 color-999">菜品已点数量 {{ max }} </div>
@@ -25,7 +33,7 @@
</div>
<div class="u-flex u-m-t-12 ">
<span>退款金额</span>
<span class="color-red font-bold">{{ goods.price * number|to2 }}</span>
<span class="color-red font-bold">{{ tuikuanJine }}</span>
</div>
<div class="u-m-t-26">
<div><span>退款原因</span> <span class="color-red">*</span></div>
@@ -57,6 +65,8 @@
</template>
<script>
import numberBox from "./number-box.vue";
import {returnIsSeatFee} from '../util.js'
export default {
components: { numberBox },
props: {
@@ -64,12 +74,6 @@ export default {
type: Boolean,
default: true,
},
goods: {
type: Object,
default: () => {
return {};
},
},
max: {
type: Number,
default: 1,
@@ -87,8 +91,20 @@ export default {
{ label: "等待时间过长", checked: false },
],
note: "",
goods:{
productId: -999
}
};
},
computed:{
tuikuanJine(){
const danjia=(this.goods.priceAmount||0)/this.goods.num
return (danjia*this.number).toFixed(2);
},
isSeatFee(){
return returnIsSeatFee(this.goods)
}
},
filters:{
to2(val){
return val.toFixed(2);
@@ -112,9 +128,15 @@ export default {
}
this.note = tag + "," + this.note;
},
open(note) {
open(item) {
this.goods = item?item:this.goods;
console.log(item)
this.show = true;
this.number = 1;
if (item.productId != "-999") {
this.number = 1;
} else {
this.number = item.num;
}
},
close() {
this.show = false;