فهرست منبع

客户管理 订单展示原价

xgb 1 روز پیش
والد
کامیت
f109e541c7
1فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 15 0
      src/views/hisStore/components/productOrder.vue

+ 15 - 0
src/views/hisStore/components/productOrder.vue

@@ -173,6 +173,11 @@
             <p>{{JSON.parse(scope.row.jsonInfo).productName}}</p>
           </template>
         </el-table-column>
+        <el-table-column label="原单价" width="240" align="center">
+          <template slot-scope="scope">
+            <p>¥{{(scope.row.originalPrice ? scope.row.originalPrice.toFixed(2) : JSON.parse(scope.row.jsonInfo).price.toFixed(2))}}</p>
+          </template>
+        </el-table-column>
         <el-table-column label="单价" width="240" align="center">
           <template slot-scope="scope">
             <p>¥{{JSON.parse(scope.row.jsonInfo).price.toFixed(2)}}</p>
@@ -195,6 +200,8 @@
         </el-table-column>
       </el-table>
       <div style="float: right;margin: 20px" v-if="order!=null">
+        <span style="color: #909399;text-decoration: line-through;">原价合计:¥{{originalTotal.toFixed(2)}}</span>
+        &nbsp;&nbsp;
         合计:<span class="color-danger">¥{{order.totalPrice.toFixed(2)}}</span>
       </div>
 
@@ -692,6 +699,14 @@ export default {
   computed: {
     company(){
       return this.$store.state.user.user;
+    },
+    originalTotal() {
+      if (!this.items) return 0;
+      return this.items.reduce((sum, item) => {
+        const info = JSON.parse(item.jsonInfo);
+        const price = item.originalPrice != null ? item.originalPrice : info.price;
+        return sum + (price * item.num);
+      }, 0);
     }
   },
   methods: {formatAmount() {