ソースを参照

客户管理 订单查询改造

xgb 1 週間 前
コミット
46a3ac04d7

+ 1 - 1
src/views/components/his/storeOrderDetails.vue

@@ -168,7 +168,7 @@
          </el-table-column>
        </el-table>
        <div style="float: right;margin: 20px" v-if="item.totalPrice!=null">
-         合计:<span class="color-danger">¥{{item.totalPrice.toFixed(2)}}</span>
+        合计:<span class="color-danger">¥{{item.totalPrice.toFixed(2)}}</span>
        </div>
        <div style="float: right;margin: 20px" v-if="item.orderType==2">
          剂数:<span class="color-danger">{{counts}}</span>

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

@@ -203,6 +203,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>
@@ -230,6 +235,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>
       <div style="margin: 60px 0px 20px 0px">
@@ -629,6 +636,16 @@ export default {
       this.scheduleOptions = response.data;
     });
   },
+  computed: {
+    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() {
       if (typeof this.editForm.offlinePayAmount === 'number') {