ソースを参照

成本分配表-转入数量-可编辑

jbb 2 年 前
コミット
7c15442121

+ 13 - 5
src/views/cost-allocation-total/modal/fabInQuaModal.vue

@@ -10,7 +10,11 @@
   >
     <!-- tabel  -->
     <a-spin :spinning="confirmLoading">
-      <a-table :loading="loading" bordered :columns="columns" :data-source="data" :pagination="false"> </a-table>
+      <a-table :loading="loading" bordered :columns="columns" :data-source="data" :pagination="false"> 
+        <span slot="unitCost" slot-scope="text,record">
+              <a-input placeholder="请输入" v-model="record.unitCost"  @change="changeUnitCost(record)"/>
+          </span>
+      </a-table>
       <!-- 导出 打印 返回  -->
       <a-row style="marginTop:20px;">
         <a-col :md="24" :sm="12">
@@ -73,10 +77,11 @@ export default {
           dataIndex: 'unitCost',
           width: 120,
           className: 'replacecolor',
-           customRender: (text, record, index) => {
-            var re =  Number(text).toFixed(3)
-            return re
-         }
+          scopedSlots: { customRender: 'unitCost' },
+        //    customRender: (text, record, index) => {
+        //     var re =  Number(text).toFixed(3)
+        //     return re
+        //  }
         },
         {
           title: '总成本',
@@ -130,6 +135,9 @@ export default {
       //   }
       // })
     },
+    changeUnitCost(record){
+      record.cost = record.unitCost*record.number
+    },
     // 打印
     print() {},
 

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

@@ -366,6 +366,9 @@ export default {
             // 页面打开加载的数据
             var oneData = this.$refs.unitTabs.tabsAllData[0]
             this.$refs.unitTabs.fabData = oneData.syCostAllocationFabricList
+            this.$refs.unitTabs.fabData[0].syTransfers.map(item =>{
+              item.unitCost =  item.unitCost.toFixed(3)
+             })
             this.$refs.unitTabs.ingData = oneData.syCostAllocationIngredientList
             this.$refs.unitTabs.shipData = oneData.syCostAllocationShipdetail
             this.calculation(oneData.syCostAllocationShipdetail)