Browse Source

成本分配表-面料/辅料-弹窗数据更新时保存/添加保存时得动画效果

jbb 1 year ago
parent
commit
9ed2214699

+ 3 - 0
src/views/cost-allocation-total/modal/ingInQuaModal.vue

@@ -141,6 +141,9 @@ export default {
     },
     // 打印
     print() {},
+    changeUnitCost(record){
+      record.cost = record.unitCost*record.number
+    },
 
     cancel() {
       console.log('返回成本分配统计表')

+ 29 - 6
src/views/reportForms/cost-allocation-table.vue

@@ -534,11 +534,17 @@ export default {
       this.$nextTick(() => {
         // TODO:接口完善后,type 应改为 add(暂时为了回显数据)
         this.loading = true
+        this.$refs.unitTabs.mList = []
+        this.$refs.unitTabs.fList = []
         var Staging = '',
-        StagingLast = ''
+        StagingLast = '',
+        file = ''
         if(data=='queryNew'){
           Staging =this.detailsPlanNum.memo
           StagingLast = this.detailsPlanNum.remarks
+          file = this.fileList
+          this.$refs.unitTabs.mList = this.$refs.unitTabs.tabsAllData[0].syCostAllocationFabricList
+          this.$refs.unitTabs.fList = this.$refs.unitTabs.tabsAllData[0].syCostAllocationIngredientList
         }
         seachPlanNum({ plannum: this.detailsPlanNum.planNum, type: data }).then(res => {
           if (res.success) {
@@ -546,10 +552,6 @@ export default {
              this.loading = false
             this.detailsPlanNum = res.result //所有详情
             this.copyFabriccostIncludestax = res.result.fabriccostIncludestax
-            if(data=='queryNew'){
-              this.detailsPlanNum.memo = Staging
-              this.detailsPlanNum.remarks = StagingLast
-             }
             if(Number(this.detailsPlanNum.shortseveral)<0){
               this.detailsPlanNum.shortseveral = 0
               this.detailsPlanNum.shortvalue = 0
@@ -668,6 +670,25 @@ export default {
               current: res.result.current,
               pageSize: res.result.size
             }
+            if(data=='queryNew'){
+              this.detailsPlanNum.memo = Staging
+              this.detailsPlanNum.remarks = StagingLast
+              this.fileList = file
+              oneData.syCostAllocationFabricList.map(item=>{
+                this.$refs.unitTabs.mList.map(event=>{
+                  if(item.goodsName==event.goodsName){
+                    item.transferCost = event.transferCost
+                  }
+                })
+              })
+              oneData.syCostAllocationIngredientList.map(item=>{
+                this.$refs.unitTabs.fList.map(event=>{
+                  if(item.goodsName==event.goodsName){
+                    item.transferCost = event.transferCost
+                  }
+                })
+              })
+             }
           }else {
             this.loading = false
             this.$message.error(res.message);
@@ -948,8 +969,10 @@ export default {
         // var planNum = this.detailsPlanNum.planNum,
          var json = this.detailsPlanNum
          json.outdata=moment(json.outdata).format('YYYY-MM-DD hh:mm:ss')
+         this.loading=true
         addHalfInfo(json).then(res => {
-          this.isDisabled = false
+          this.isDisabled = false  
+          this.loading=false
           if (res.success) {
             console.log('保存的部分信息', halfInfo)
             this.$message.success('保存成功')

+ 19 - 2
src/views/reportForms/cost-allocation-table/tabs.vue

@@ -630,6 +630,8 @@ export default {
       tabsAllData: [], //tabs所有数据集合
       tabNameList: [], //tabs数组集合
       activeKey: '0',
+      mList:[],
+      fList:[],
       sumInfo: {} //合计对象
     }
   },
@@ -689,6 +691,7 @@ export default {
         on: {
           click: event => {
             console.log('面料 - 转入数量')
+            console.log( this.mList,this.fList)
             this.$refs.fabInQuaModal.fabInQuaModVis = true
             this.$refs.fabInQuaModal.record = record
             record.syTransfers.map(item=>{
@@ -697,6 +700,13 @@ export default {
               }
             })
             this.$refs.fabInQuaModal.data = record.syTransfers
+            if(this.mList.length!==0){
+              this.mList.map(item=>{
+                if(item.goodsName == record.goodsName){
+                  this.$refs.fabInQuaModal.data = item.syTransfers
+                }
+              })
+            }
           }
         }
       }
@@ -718,7 +728,7 @@ export default {
       this.ingData.map(item=>{
         if(item.goodsName == record.goodsName){
           item.transferCost = data
-        }
+          debugge        }
       })
     },
     // 面料 -余下数量 弹框
@@ -755,13 +765,20 @@ export default {
             console.log('辅料 - 转入数量')
             this.$refs.ingInQuaModal.ingInQuaModVis = true
             this.$refs.ingInQuaModal.planNum = this.planNum
-            this.$refs.ingInQuaModal.record = this.record
+            this.$refs.ingInQuaModal.record = record
             record.syTransfers.map(item=>{
               if(item.unitCost){
                item.unitCost =  (item.unitCost).toFixed(3)
               }
             })
             this.$refs.ingInQuaModal.data = record.syTransfers
+            if(this.fList.length!==0){
+              this.fList.map(item=>{
+                if(item.goodsName == record.goodsName){
+                  this.$refs.ingInQuaModal.data = item.syTransfers
+                }
+              })
+            }
           }
         }
       }