dct 5 tháng trước cách đây
mục cha
commit
ac333c45f8

+ 3 - 1
src/components/GlobalComponents/OrderDetail.vue

@@ -108,7 +108,9 @@
             <el-table-column width="100" prop="ticketTypeName" label="票种"> </el-table-column>
             <el-table-column width="80" prop="price" label="单价(¥)">
               <template slot-scope="scope">
-                {{ scope.row.checkNum ? scope.row.price / scope.row.checkNum : scope.row.price }}
+                <div class="">{{ scope.row.checkNum ? scope.row.price / scope.row.checkNum : scope.row.price }}</div>
+                <div v-if="scope.row.discountPrice" style="color: #bbb">原价:{{ scope.row.originalPrice }}</div>
+                <div v-if="scope.row.discountPrice" style="color: #52c41a">优惠:{{ scope.row.discountPrice }}</div>
               </template>
             </el-table-column>
             <el-table-column width="80" prop="price" label="小计"></el-table-column>

+ 2 - 2
src/pages/sellManage/batchSale/Confirm.vue

@@ -55,8 +55,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 }}

+ 0 - 5
src/pages/sellManage/common/confirmMixin.js

@@ -250,8 +250,6 @@ export default {
     createOrder (params) {
       this.submitDisable = true
       params.tickets.forEach(ticket => {
-        const { price, distinctPrice } = ticket
-
         if (params.checkWay !== 5) {
           ticket.ticketNo = ''
           ticket.isStorage = 0
@@ -262,9 +260,6 @@ export default {
         ticket.face = {
           faceImg: ticket.face
         }
-
-        ticket.price = distinctPrice ? price - distinctPrice : price
-        ticket.originalPrice = price
       })
 
       params.discountDescription = params.tickets.map((item) => item.discountDescription).filter(i => i).join(',')

+ 3 - 6
src/pages/sellManage/common/orderItemMixin.js

@@ -29,18 +29,15 @@ export default {
       this.$refs.touristList.show()
     },
     updateTourist (data) {
-      const { currentTicket, distinctPrice = 0 } = this.currentRecord
-      const { id: ticketTypeId, playDateBegin, playDateEnd, isDiscount, price, batchConfigId } = currentTicket
+      const { currentTicket } = this.currentRecord
+      const { id: ticketTypeId, playDateBegin, playDateEnd, isDiscount, batchConfigId } = currentTicket
       this.currentRecord.tickets = data.map(item => {
         const data = {
           ...item,
           playDateBegin,
           playDateEnd,
           isDiscount,
-          ticketTypeId,
-          price: distinctPrice ? price - distinctPrice : price,
-          distinctPrice,
-          originalPrice: price
+          ticketTypeId
         }
 
         batchConfigId && (data.batchConfigId = batchConfigId)

+ 3 - 7
src/pages/sellManage/retail/Confirm.vue

@@ -48,8 +48,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 }}
@@ -277,11 +277,7 @@ export default {
 
         params.tickets = allTickets
       } else {
-        params.tickets = tickets.map((item, idx) => {
-          const orderItem = this.orderInfo[idx]
-          item.distinctPrice = orderItem ? orderItem.distinctPrice : 0
-          return item
-        })
+        params.tickets = tickets
       }
       // params.count = this.totalCount
       params.payChannel = this.currentPayChannel

+ 6 - 1
src/pages/sellManage/retail/FormInfo.vue

@@ -461,6 +461,7 @@ export default {
           const { currentBatch } = this
           const { id, name, checkCount, isUseDateLimit } = this.currentTicket
           const price = this.currentPrice
+          const originalPrice = this.currentPrice
 
           if (this.isTeam) {
             if (!this.form.teamId) {
@@ -499,7 +500,9 @@ export default {
               ...item,
               ticketTypeId: id,
               checkNum: checkCount,
-              price: this.currentPrice,
+              price,
+              originalPrice,
+              discountPrice: 0,
               ticketNo: item.ticketNo,
               batchConfigId: currentBatch?.id || '',
               face: item.face,
@@ -535,6 +538,8 @@ export default {
               ticketName: name,
               count: tickets.length,
               price,
+              originalPrice,
+              discountPrice: 0,
               total: this.totalPrice,
               playDateBegin: pdb,
               currentTicket: {

+ 28 - 23
src/pages/sellManage/retail/OrderInfo.vue

@@ -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) {