|
|
@@ -98,8 +98,8 @@
|
|
|
prop="price"
|
|
|
label="单价">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.distinctPrice">
|
|
|
- {{ scope.row.price - scope.row.distinctPrice }} <s style="color: #f56c6c;">{{ scope.row.price }}</s>
|
|
|
+ <span v-if="scope.row.discountPrice">
|
|
|
+ {{ scope.row.price }} <s style="color: #f56c6c;">{{ scope.row.originalPrice }}</s>
|
|
|
</span>
|
|
|
<span v-else>
|
|
|
{{ scope.row.price }}
|
|
|
@@ -110,8 +110,8 @@
|
|
|
prop="total"
|
|
|
label="小计">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.distinctPrice">
|
|
|
- {{ scope.row.total - scope.row.distinctPrice * scope.row.tickets.length }} <s style="color: #f56c6c;">{{ scope.row.total }}</s>
|
|
|
+ <span v-if="scope.row.discountPrice">
|
|
|
+ {{ scope.row.total - scope.row.discountPrice * scope.row.tickets.length }} <s style="color: #f56c6c;">{{ scope.row.total }}</s>
|
|
|
</span>
|
|
|
<span v-else>
|
|
|
{{ scope.row.total }}
|
|
|
@@ -144,17 +144,17 @@
|
|
|
<!-- 设置优惠说明的弹框 -->
|
|
|
<el-dialog
|
|
|
title="优惠/说明"
|
|
|
- :visible.sync="showDistinctDialog"
|
|
|
+ :visible.sync="showDiscountDialog"
|
|
|
width="400px"
|
|
|
- @close="showDistinctDialog = false"
|
|
|
+ @close="showDiscountDialog = false"
|
|
|
>
|
|
|
<el-form label-width="80px">
|
|
|
<el-form-item label="票单价">
|
|
|
- <span>{{ distinctInfo.ticketPrice }}</span>
|
|
|
+ <span>{{ discountInfo.ticketPrice }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="优惠金额">
|
|
|
<el-input-number
|
|
|
- v-model.number="distinctInfo.discountPrice"
|
|
|
+ v-model.number="discountInfo.discountPrice"
|
|
|
:min="0"
|
|
|
:precision="2"
|
|
|
style="width: 200px"
|
|
|
@@ -163,14 +163,14 @@
|
|
|
<el-form-item label="说明">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
- v-model="distinctInfo.description"
|
|
|
+ v-model="discountInfo.description"
|
|
|
:rows="3"
|
|
|
placeholder="请输入说明"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="showDistinctDialog = false">取消</el-button>
|
|
|
+ <el-button @click="showDiscountDialog = false">取消</el-button>
|
|
|
<el-button type="primary" @click="confirmDistinct">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
@@ -244,8 +244,8 @@ export default {
|
|
|
},
|
|
|
orderPrice () {
|
|
|
return this.value.reduce((init, item) => {
|
|
|
- let price = this.$NP.times(item.count, item.price)
|
|
|
- return this.$NP.plus(init, price, item.distinctPrice ? -item.distinctPrice * item.tickets.length : 0)
|
|
|
+ let price = this.$NP.times(item.count, item.originalPrice)
|
|
|
+ return this.$NP.plus(init, price, item.discountPrice ? -item.discountPrice * item.tickets.length : 0)
|
|
|
}, 0)
|
|
|
},
|
|
|
tickets () {
|
|
|
@@ -267,9 +267,9 @@ export default {
|
|
|
}],
|
|
|
autoPrint: this.$localStore.get('autoPrint'),
|
|
|
autoPrintSmallTicket: this.$localStore.get('autoPrintSmallTicket'),
|
|
|
- showDistinctDialog: false,
|
|
|
+ showDiscountDialog: false,
|
|
|
currentItem: null,
|
|
|
- distinctInfo: {
|
|
|
+ discountInfo: {
|
|
|
ticketPrice: 0,
|
|
|
discountPrice: 0,
|
|
|
description: ''
|
|
|
@@ -282,20 +282,25 @@ export default {
|
|
|
this.$message.warning('请先添加订单项')
|
|
|
return
|
|
|
}
|
|
|
- this.showDistinctDialog = true
|
|
|
+ this.showDiscountDialog = true
|
|
|
},
|
|
|
distinctTicket (item) {
|
|
|
this.currentItem = item
|
|
|
- console.log(item, 'item')
|
|
|
- this.distinctInfo.ticketPrice = item.currentTicket.price
|
|
|
- this.distinctInfo.discountPrice = item.distinctPrice || 0
|
|
|
- this.distinctInfo.description = item.description || ''
|
|
|
- this.showDistinctDialog = true
|
|
|
+ this.discountInfo.ticketPrice = item.currentTicket.price
|
|
|
+ this.discountInfo.discountPrice = item.discountPrice || 0
|
|
|
+ this.discountInfo.description = item.description || ''
|
|
|
+ this.showDiscountDialog = true
|
|
|
},
|
|
|
confirmDistinct () {
|
|
|
- this.$set(this.currentItem, 'distinctPrice', this.distinctInfo.discountPrice)
|
|
|
- this.$set(this.currentItem, 'description', this.distinctInfo.description)
|
|
|
- this.showDistinctDialog = false
|
|
|
+ const { discountPrice, description } = this.discountInfo
|
|
|
+ this.$set(this.currentItem, 'discountPrice', discountPrice)
|
|
|
+ this.$set(this.currentItem, 'description', description)
|
|
|
+ this.currentItem.tickets.forEach(ticket => {
|
|
|
+ this.$set(ticket, 'discountPrice', discountPrice)
|
|
|
+ this.$set(ticket, 'price', ticket.originalPrice - discountPrice)
|
|
|
+ this.$set(ticket, 'description', description)
|
|
|
+ })
|
|
|
+ this.showDiscountDialog = false
|
|
|
},
|
|
|
// 更新图片备注列表
|
|
|
updateRemarks (data) {
|