Prechádzať zdrojové kódy

优惠改成改价(支持加价)

LaveyD 4 mesiacov pred
rodič
commit
d484e4e3de

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

@@ -139,7 +139,7 @@
               <template slot-scope="scope">
                 <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>
+                <div v-if="scope.row.discountPrice" style="color: #52c41a">改价:{{ scope.row.discountPrice }}</div>
                 <div v-if="scope.row.price !== scope.row.settlementPrice" style="color: #0080ff">结算价:{{ scope.row.settlementPrice }}</div>
               </template>
             </el-table-column>

+ 1 - 1
src/pages/queryReport/salesQuery.vue

@@ -1576,7 +1576,7 @@ const COLUMN_SCHEMA = [
   { key: 'unitPrice', label: '门票单价', group: '票务', column: 'extra', apiKey: 'unitPrice' },
   { key: 'ticketPrice', label: '门票价格', group: '票务', column: 'extra', apiKey: 'ticketPrice' },
   { key: 'originalPrice', label: '门票原价', group: '票务', column: 'extra', apiKey: 'originalPrice' },
-  { key: 'discountPrice', label: '门票优免价格', group: '票务', column: 'extra', apiKey: 'discountPrice' },
+  { key: 'discountPrice', label: '门票调整价格', group: '票务', column: 'extra', apiKey: 'discountPrice' },
   { key: 'settlementPrice', label: '门票结算价格', group: '票务', column: 'extra', apiKey: 'settlementPrice' },
   { key: 'guestName', label: '游客姓名', group: '游客', column: 'extra', apiKey: 'guestName' },
   { key: 'guestPhone', label: '游客电话', group: '游客', column: 'extra', apiKey: 'guestPhone' },

+ 1 - 1
src/pages/sellManage/retail/Confirm.vue

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

+ 11 - 10
src/pages/sellManage/retail/OrderInfo.vue

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