Browse Source

成本分配表-合计计算

jbb 2 years ago
parent
commit
f7970698ad

+ 12 - 8
src/views/reportForms/cost-allocation-table.vue

@@ -81,11 +81,6 @@
                 <a href="javascript:void(0)" @click="mainTableExpenseCNY()">{{ detailsPlanNum.rmbExpense }}</a>
               </a-form-model-item>
             </a-col>
-            <!-- <a-col :md="6" :sm="8">
-              <a-form-model-item label="税率%" prop="taxrate" class="fontColor">
-                {{ detailsPlanNum.taxrate }}
-              </a-form-model-item>
-            </a-col> -->
             <a-col :md="6" :sm="8">
               <a-form-model-item label="实际出货数量" prop="actualShipquantity">
                 {{ detailsPlanNum.actualShipquantity }}
@@ -191,6 +186,11 @@
                 {{ detailsPlanNum.preparedBy }}
               </a-form-model-item>
             </a-col>
+            <a-col :md="6" :sm="8">
+              <a-form-model-item label="税率%" prop="taxrate" >
+                <a-input placeholder="请输入" v-model="detailsPlanNum.taxrate"  @blur="changeTaxrate"/>
+              </a-form-model-item>
+            </a-col>
 
             <a-col :md="6" :sm="8" class="noprint">
               <h4 style="color:red;">
@@ -477,8 +477,8 @@ export default {
             })
             //  this.$refs.unitTabs.sumInfo.fabricAmount = s.toFixed(3) //合计中的面料总额
              this.$refs.unitTabs.sumInfo.fabricAmount = (this.detailsPlanNum.fabriccostIncludestax!==''&&this.detailsPlanNum.fabriccostIncludestax)?(Number(this.detailsPlanNum.fabriccostIncludestax)).toFixed(2):'' //合计中的面料总额
-             this.$refs.unitTabs.sumInfo.fabricExcludTax =(Number(this.$refs.unitTabs.sumInfo.fabricAmount)/1.13).toFixed(2)//合计中的不含税面料总额
-            // this.detailsPlanNum.fabriccostIncludestax = s.toFixed(3) //表头中面料含税总额
+             this.$refs.unitTabs.sumInfo.fabricExcludTax =(Number(this.$refs.unitTabs.sumInfo.fabricAmount)/(1+Number(this.detailsPlanNum.taxrate))).toFixed(2)//合计中的不含税面料总额
+             // this.detailsPlanNum.fabriccostIncludestax = s.toFixed(3) //表头中面料含税总额
             // this.detailsPlanNum.fabriccostNotincludestax = (s/1.13).toFixed(3) //表头中面料不含税总额
             //合计中辅料相关金额
             var s = 0,
@@ -488,7 +488,7 @@ export default {
               v+=Number(item.rmbAmount)
             })
             this.$refs.unitTabs.sumInfo.ingAmount =(v/2).toFixed(2)//辅料金额合计
-            this.$refs.unitTabs.sumInfo.ingExcludAmount = ((v/2).toFixed(2)/1.13).toFixed(2)//辅料不含税金额合计
+            this.$refs.unitTabs.sumInfo.ingExcludAmount = ((v/2).toFixed(2)/(1+Number(this.detailsPlanNum.taxrate))).toFixed(2)//辅料不含税金额合计
             //合计中出运明细相关金额
             var s =0,
             v = 0,
@@ -724,6 +724,10 @@ export default {
         })
         
     },
+    //该表税率
+    changeTaxrate(){
+      this.$refs.unitTabs.changeTaxrate(this.detailsPlanNum.taxrate)
+    },
     //计算事故单美元金额和事故单人民币金额
     accidentCalculation(val){
       var usaMoney = 0,

+ 23 - 3
src/views/reportForms/cost-allocation-table/tabs.vue

@@ -276,7 +276,7 @@ export default {
         {
           title: '购入数量',
           dataIndex: 'purchaseQuantity',
-          width: '9%',
+          width: '6%',
           className: 'replacecolor',
           customRender: (text, record, index) => {
             if(text!==''&&text){
@@ -287,7 +287,7 @@ export default {
         {
           title: '余下数量',
           dataIndex: 'fabricremainingQuantity',
-          width: '7%',
+          width: '6%',
           className: 'replacecolor',
           customCell: this.fabRemQuaCustomCell,
           scopedSlots: { customRender: 'fabRemaQuaSlot' }
@@ -295,7 +295,7 @@ export default {
         {
           title: '损耗',
           dataIndex: 'loss',
-          width: '9%',
+          width: '6%',
           className: 'replacecolor',
           customRender: (text, record, index) => {
             if(text!==''&&text){
@@ -316,6 +316,17 @@ export default {
           // slots:{title:'remainingQuantitycostTitle'} ,
 
         },
+        {
+          title: '多发少发',
+          dataIndex: 'pilosityFewer',
+          width: '9%',
+          className: 'replacecolor',
+          customRender: (text, record, index) => {
+            if(text!==''&&text){
+              return Number(text).toFixed(2)
+            }
+          },
+        },
         {
           title: '备注',
           dataIndex: 'remarks',
@@ -613,6 +624,15 @@ export default {
   },
   created() {},
   methods: {
+    changeTaxrate(data){
+      this.sumInfo.fabricExcludTax =''
+      this.sumInfo.ingExcludAmount=''
+      this.sumInfo.amountTotal=''
+      this.sumInfo.fabricExcludTax =(Number(this.sumInfo.fabricAmount)/(1+Number(data))).toFixed(2)//合计中的不含税面料总额
+      this.sumInfo.ingExcludAmount = (Number(this.sumInfo.ingAmount).toFixed(2)/(1+Number(data))).toFixed(2)//辅料不含税金额合计
+      this.sumInfo.amountTotal = Number(this.sumInfo.fabricExcludTax)+Number(this.sumInfo.ingExcludAmount)+Number( this.sumInfo.shipProcesFees)//合计金额
+      this.$forceUpdate()
+    },
     tabsCallback(key) {
       this.activeKey = key
       // console.log('点击的是', this.activeKey)