Browse Source

装箱单面辅料新增页面增加超发数量计算公式

jbb 2 years ago
parent
commit
fd5807ecfb

+ 13 - 1
src/views/packing-list/packinglist-fabrics/addFabricDrawer.vue

@@ -257,7 +257,7 @@
               <!-- 实际报关数量 -->
               <template slot="actualDeclaredQuantity" slot-scope="text, record, index">
                 <a-form-model-item prop="actualDeclaredQuantity">
-                  <a-input style="width:100%" type="text" v-model="record.actualDeclaredQuantity" />
+                  <a-input style="width:100%" type="text" v-model="record.actualDeclaredQuantity" @change="actualDeclaredQuantityChange(record)"/>
                 </a-form-model-item>
               </template>
 
@@ -627,6 +627,10 @@ export default {
             this.addFabricData.map(item =>{
               item.inventoryQuantity = 0
               item.meter = 0
+              item.excessQuantity = item.actualDeclaredQuantity - item.remainingQuantity
+              if(item.excessQuantity < 0){
+                item.excessQuantity = 0
+              }
               // item.planLotNumber = item.orderNumber()
               if(item.manualYarnFlag == 0){
                  this.manualYarnDisabled = true
@@ -831,6 +835,14 @@ export default {
     inventoryQuantityChange(record){
       record.actualDeclaredQuantity = record.inventoryQuantity
     },
+    actualDeclaredQuantityChange(record){
+      if(record.actualDeclaredQuantity !== '' || !record.actualDeclaredQuantity){
+        record.excessQuantity = record.actualDeclaredQuantity - record.remainingQuantity
+        if(record.excessQuantity < 0){
+          record.excessQuantity = 0}
+      }
+
+    },
 
     // 分页、排序、筛选变化时触发
     // handleTableChange(pagination, filters, sorter) {

+ 0 - 1
src/views/reportForms/cost-allocation-table/tabs.vue

@@ -404,7 +404,6 @@ export default {
   created() {},
   methods: {
     tabsCallback(key) {
-      debugger
       this.activeKey = key
       // console.log('点击的是', this.activeKey)
       if (key == 0) {