|
@@ -3,8 +3,14 @@
|
|
|
<el-card>
|
|
<el-card>
|
|
|
<div
|
|
<div
|
|
|
slot="header"
|
|
slot="header"
|
|
|
- class="card-title">
|
|
|
|
|
- <span class="top-title">订单明细</span>
|
|
|
|
|
|
|
+ class="card-title"
|
|
|
|
|
+ style="display: flex">
|
|
|
|
|
+ <div class="top-title">订单明细</div>
|
|
|
|
|
+ <!-- <el-button
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ @click="distinctOrder">
|
|
|
|
|
+ 优惠/说明
|
|
|
|
|
+ </el-button> -->
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<div class="is-flex">
|
|
<div class="is-flex">
|
|
@@ -91,29 +97,84 @@
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="price"
|
|
prop="price"
|
|
|
label="单价">
|
|
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>
|
|
|
|
|
+ <span v-else>
|
|
|
|
|
+ {{ scope.row.price }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="total"
|
|
prop="total"
|
|
|
label="小计">
|
|
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>
|
|
|
|
|
+ <span v-else>
|
|
|
|
|
+ {{ scope.row.total }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="操作"
|
|
label="操作"
|
|
|
- width="140">
|
|
|
|
|
|
|
+ width="160">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
<el-button
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
|
|
|
|
+ @click="showTouristList(scope.row)"
|
|
|
type="text">
|
|
type="text">
|
|
|
- 删除
|
|
|
|
|
|
|
+ 门票列表
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
- @click="showTouristList(scope.row)"
|
|
|
|
|
|
|
+ @click="distinctTicket(scope.row)"
|
|
|
type="text">
|
|
type="text">
|
|
|
- 门票列表
|
|
|
|
|
|
|
+ 优惠
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
|
|
+ type="text">
|
|
|
|
|
+ 删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
+ <!-- 设置优惠说明的弹框 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="优惠/说明"
|
|
|
|
|
+ :visible.sync="showDistinctDialog"
|
|
|
|
|
+ width="400px"
|
|
|
|
|
+ @close="showDistinctDialog = false"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form label-width="80px">
|
|
|
|
|
+ <el-form-item label="票单价">
|
|
|
|
|
+ <span>{{ distinctInfo.ticketPrice }}</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="优惠金额">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ v-model.number="distinctInfo.discountPrice"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :precision="2"
|
|
|
|
|
+ style="width: 200px"
|
|
|
|
|
+ ></el-input-number>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="说明">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ v-model="distinctInfo.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 type="primary" @click="confirmDistinct">确定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
<Confirm
|
|
<Confirm
|
|
|
:remark="remark"
|
|
:remark="remark"
|
|
|
:tickets="tickets"
|
|
:tickets="tickets"
|
|
@@ -184,7 +245,7 @@ export default {
|
|
|
orderPrice () {
|
|
orderPrice () {
|
|
|
return this.value.reduce((init, item) => {
|
|
return this.value.reduce((init, item) => {
|
|
|
let price = this.$NP.times(item.count, item.price)
|
|
let price = this.$NP.times(item.count, item.price)
|
|
|
- return this.$NP.plus(init, price)
|
|
|
|
|
|
|
+ return this.$NP.plus(init, price, item.distinctPrice ? -item.distinctPrice * item.tickets.length : 0)
|
|
|
}, 0)
|
|
}, 0)
|
|
|
},
|
|
},
|
|
|
tickets () {
|
|
tickets () {
|
|
@@ -205,10 +266,37 @@ export default {
|
|
|
remark: ''
|
|
remark: ''
|
|
|
}],
|
|
}],
|
|
|
autoPrint: this.$localStore.get('autoPrint'),
|
|
autoPrint: this.$localStore.get('autoPrint'),
|
|
|
- autoPrintSmallTicket: this.$localStore.get('autoPrintSmallTicket')
|
|
|
|
|
|
|
+ autoPrintSmallTicket: this.$localStore.get('autoPrintSmallTicket'),
|
|
|
|
|
+ showDistinctDialog: false,
|
|
|
|
|
+ currentItem: null,
|
|
|
|
|
+ distinctInfo: {
|
|
|
|
|
+ ticketPrice: 0,
|
|
|
|
|
+ discountPrice: 0,
|
|
|
|
|
+ description: ''
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ distinctOrder () {
|
|
|
|
|
+ if (this.tickets.length === 0) {
|
|
|
|
|
+ this.$message.warning('请先添加订单项')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.showDistinctDialog = 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
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmDistinct () {
|
|
|
|
|
+ this.$set(this.currentItem, 'distinctPrice', this.distinctInfo.discountPrice)
|
|
|
|
|
+ this.$set(this.currentItem, 'description', this.distinctInfo.description)
|
|
|
|
|
+ this.showDistinctDialog = false
|
|
|
|
|
+ },
|
|
|
// 更新图片备注列表
|
|
// 更新图片备注列表
|
|
|
updateRemarks (data) {
|
|
updateRemarks (data) {
|
|
|
this.pictureRemarks = data
|
|
this.pictureRemarks = data
|