فهرست منبع

【修改】零售订单添加-合计

莫绍宝 3 سال پیش
والد
کامیت
1e4178476c
1فایلهای تغییر یافته به همراه30 افزوده شده و 13 حذف شده
  1. 30 13
      src/views/supply/retail/components/retail_form.vue

+ 30 - 13
src/views/supply/retail/components/retail_form.vue

@@ -75,7 +75,9 @@
     </div>
 
     <div class="table" style="margin-top: 20px">
-      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400" 
+        show-summary
+        :summary-method="$getSummaries">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
         <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="140" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -100,10 +102,10 @@
                <el-input v-model="scope.row.fileNo" size="small" ></el-input>
           </template>
            </el-table-column> -->
-      <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+        <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-input v-model="scope.row.price" size="small" type="number" v-if="listItem && !isDealer"></el-input>
-            <div v-else>{{scope.row.price}}</div>
+            <div v-else>{{scope.row.price | numToFixed}}</div>
           </template>
         </el-table-column>
         <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
@@ -111,9 +113,9 @@
             <el-input v-model="scope.row.qty" size="small" type="number"></el-input>
           </template>
         </el-table-column>
-        <el-table-column align="right" label="订单金额" min-width="100" show-overflow-tooltip>
+        <el-table-column align="right" label="订单金额" prop="compute_amount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{scope.row.price * scope.row.qty}}
+            {{(scope.row.price * scope.row.qty) | numToFixed}}
           </template>
         </el-table-column>
         <el-table-column align="center" label="返利类型" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
@@ -128,19 +130,19 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column align="right" label="可用返利" min-width="100" show-overflow-tooltip>
+        <el-table-column align="right" label="可用返利" prop="rebateAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{scope.row.rebateAmount}}
+            {{scope.row.rebateAmount | numToFixed}}
           </template>
         </el-table-column>
-        <el-table-column align="right" label="使用返利金额" min-width="120" show-overflow-tooltip>
+        <el-table-column align="right" label="使用返利金额" prop="compute_flAmount" min-width="120" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{((scope.row.price - scope.row.discAmount) * scope.row.qty * (scope.row.rebateRate * 100)) / 100}}
+            {{(((scope.row.price - scope.row.discAmount) * scope.row.qty * (scope.row.rebateRate * 100)) / 100) | numToFixed}}
           </template>
         </el-table-column>
-        <el-table-column align="right" label="格力折扣" min-width="100" show-overflow-tooltip>
+        <el-table-column align="right" label="格力折扣" prop="compute_zkAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{scope.row.qty * scope.row.discAmount}}
+            {{(scope.row.qty * scope.row.discAmount) | numToFixed}}
           </template>
         </el-table-column>
         <el-table-column align="center" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
@@ -155,9 +157,9 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column align="right" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
+        <el-table-column align="right" label="实付金额" prop="compute_sfAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{((scope.row.price * scope.row.qty) * 100 - (((scope.row.price - scope.row.discAmount) * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100}}
+            {{(((scope.row.price * scope.row.qty) * 100 - (((scope.row.price - scope.row.discAmount) * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100) | numToFixed}}
           </template>
         </el-table-column>
         <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100">
@@ -432,6 +434,15 @@ export default {
         }else {
           this.mainForm.salesMan = '';
         }
+
+        if(newValue && newValue.length) {
+          newValue.forEach((item, index) => {
+            this.goodsList[index].compute_amount = item.price * item.qty;
+            this.goodsList[index].compute_flAmount = ((item.price - item.discAmount) * item.qty * (item.rebateRate * 100)) / 100;
+            this.goodsList[index].compute_zkAmount = item.qty * item.discAmount;
+            this.goodsList[index].compute_sfAmount = ((item.price * item.qty) * 100 - (((item.price - item.discAmount) * item.qty * (item.rebateRate * 100)) / 100) * 100 - ((item.qty * (item.discAmount * 100)) / 100) * 100) / 100;
+          })
+        }
       },
       immediate: true,
       deep: true
@@ -478,6 +489,9 @@ export default {
           item.status1 = '';
           item.status2 = '';
           item.rebateAmount = item.curRebateAmount;
+
+          item.sums1 = ['qty', 'directTransferQty'];
+          item.sums2 = ['price', 'rebateAmount', 'compute_amount', 'compute_flAmount', 'compute_zkAmount', 'compute_sfAmount'];
         })
         this.goodsList = data.retailOrderItemList;
       })
@@ -566,6 +580,9 @@ export default {
           item.serviceId = (item.wallets && item.wallets.length) ? item.wallets[0].serviceId : '';
           item.serviceName = (item.wallets && item.wallets.length) ? item.wallets[0].serviceName : '';
           item.needDeleteId = true;
+
+          item.sums1 = ['qty', 'directTransferQty'];
+          item.sums2 = ['price', 'rebateAmount', 'compute_amount', 'compute_flAmount', 'compute_zkAmount', 'compute_sfAmount'];
         });
         this.leftGoodsList = res.data.records;
         this.listTotal = res.data.total;