|
|
@@ -99,7 +99,7 @@
|
|
|
label="单价">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.discountPrice">
|
|
|
- {{ scope.row.price }} <s style="color: #f56c6c;">{{ scope.row.originalPrice }}</s>
|
|
|
+ {{ scope.row.originalPrice + scope.row.discountPrice }} <s style="color: #f56c6c;">{{ scope.row.originalPrice }}</s>
|
|
|
</span>
|
|
|
<span v-else>
|
|
|
{{ scope.row.price }}
|
|
|
@@ -111,7 +111,7 @@
|
|
|
label="小计">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.discountPrice">
|
|
|
- {{ scope.row.total - scope.row.discountPrice * scope.row.tickets.length }} <s style="color: #f56c6c;">{{ scope.row.total }}</s>
|
|
|
+ {{ 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 }}
|
|
|
@@ -130,7 +130,7 @@
|
|
|
<el-button
|
|
|
@click="distinctTicket(scope.row)"
|
|
|
type="text">
|
|
|
- 优惠
|
|
|
+ 改价
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
@click="handleDelete(scope.row)"
|
|
|
@@ -141,9 +141,9 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <!-- 设置优惠说明的弹框 -->
|
|
|
+ <!-- 设置改价说明的弹框 -->
|
|
|
<el-dialog
|
|
|
- title="优惠/说明"
|
|
|
+ title="改价/说明"
|
|
|
:visible.sync="showDiscountDialog"
|
|
|
width="400px"
|
|
|
@close="showDiscountDialog = false"
|
|
|
@@ -152,15 +152,15 @@
|
|
|
<el-form-item label="票单价">
|
|
|
<span>{{ discountInfo.ticketPrice }}</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="优惠金额">
|
|
|
+ <el-form-item label="改价金额">
|
|
|
<el-input-number
|
|
|
v-model.number="discountInfo.discountPrice"
|
|
|
- :min="0"
|
|
|
:precision="2"
|
|
|
style="width: 200px"
|
|
|
></el-input-number>
|
|
|
+ <el-tag type="warning" style="margin-top: 5px;">负数表示减价,正数表示加价</el-tag>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="优惠说明">
|
|
|
+ <el-form-item label="改价说明">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
v-model="discountInfo.discountDescription"
|
|
|
@@ -245,7 +245,7 @@ export default {
|
|
|
orderPrice () {
|
|
|
return this.value.reduce((init, item) => {
|
|
|
let price = this.$NP.times(item.count, item.originalPrice)
|
|
|
- return this.$NP.plus(init, price, item.discountPrice ? -item.discountPrice * item.tickets.length : 0)
|
|
|
+ return this.$NP.plus(init, price, item.discountPrice ? item.discountPrice * item.tickets.length : 0)
|
|
|
}, 0)
|
|
|
},
|
|
|
tickets () {
|
|
|
@@ -293,11 +293,12 @@ export default {
|
|
|
},
|
|
|
confirmDistinct () {
|
|
|
const { discountPrice, discountDescription } = this.discountInfo
|
|
|
+
|
|
|
this.$set(this.currentItem, 'discountPrice', discountPrice)
|
|
|
this.$set(this.currentItem, 'discountDescription', discountDescription)
|
|
|
this.currentItem.tickets.forEach(ticket => {
|
|
|
this.$set(ticket, 'discountPrice', discountPrice)
|
|
|
- this.$set(ticket, 'price', ticket.originalPrice - discountPrice)
|
|
|
+ this.$set(ticket, 'price', ticket.originalPrice + discountPrice)
|
|
|
this.$set(ticket, 'discountDescription', discountDescription)
|
|
|
})
|
|
|
this.showDiscountDialog = false
|