Browse Source

修改:信息单新增编辑货品列表增加 合计

zh 2 years ago
parent
commit
459e983c41
1 changed files with 18 additions and 2 deletions
  1. 18 2
      src/views/supply/engin/components/engin_form.vue

+ 18 - 2
src/views/supply/engin/components/engin_form.vue

@@ -255,6 +255,8 @@
         fit
         highlight-current-row
         stripe
+        show-summary
+        :summary-method="$getSummaries"
         max-height="400"
       >
         <el-table-column align="center" label="序号" type="index" width="50" />
@@ -300,7 +302,7 @@
             <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent />
           </template>
         </el-table-column>
-        <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
+        <el-table-column align="center" label="订单金额" prop="myTotalAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ (scope.row.price || 0) * (scope.row.qty || 0) }}
           </template>
@@ -547,7 +549,20 @@ export default {
       return JSON.parse(localStorage.getItem('supply_user')).isCustomer
     }
   },
+  watch:{
+    goodsList:{
+      deep:true,
+      immediate:true,
+      handler(val,oval){
+        val.forEach(item => {
+            item.myTotalAmount = (item.price || 0) * (item.qty || 0)
+            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'taxRate','oldQty', 'hasSendQty']
+            item.sums2 = ['myTotalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
+          })
+      }
 
+    }
+  },
   async created() {
     await this.getSalesmanList()
     this.getDictList()
@@ -620,6 +635,7 @@ export default {
           item.cantDel = true
           item.cid = item.id
         })
+
         this.goodsList = data.items
       })
     },
@@ -856,7 +872,7 @@ export default {
 
     // 删除产品
     deleteItem(index, row, id) {
-   
+
       // id id存在就说明这个货品已经引用过了
       // if (this.listItem && this.examineStatus === 'OK' && id) {
       //   this.$errorMsg('已审核通过的型号不能删除')