Prechádzať zdrojové kódy

新增字段“合计成本” ---cjh

17767204043 3 rokov pred
rodič
commit
d8eb860b98

+ 8 - 1
src/views/PurchasingManage/redFontInstockOrder/detail.vue

@@ -98,6 +98,7 @@ export default {
                {title:'无税金额',align:'center',key:'no_tax_total_price',minWidth:120},
                {title:'税额',align:'center',key:'tax_total_price',minWidth:120},
                {title:'价格合计',align:'center',key:'total',minWidth:120},
+               {title:'合计成本',align:'center',key:'total_cost',minWidth:120},
                {title:'参照采购入库单号',align:'center',key:'reference_order_no',minWidth:120,render:(h,params)=>{
                    const {row}=params;
                    return row.refer?h('a',{on:{'click':()=>{
@@ -223,7 +224,7 @@ export default {
                         return;
                     }
                     const values = data.map(item => Number(item[key]));
-                    if (key === 'num'||key==='no_tax_total_price'||key==='tax_total_price'||key==='total') {
+                    if (key === 'num'||key==='no_tax_total_price'||key==='tax_total_price'||key==='total' || key === "total_cost") {
                         const v = values.reduce((prev, curr) => {
                             const value = Number(curr);
                             if (!isNaN(value)) {
@@ -273,6 +274,9 @@ export default {
 /deep/ .ivu-table-summary td:nth-child(11) .ivu-table-cell{
     color: red;
 }
+/deep/ .ivu-table-summary td:nth-child(12) .ivu-table-cell{
+    color: red;
+}
 /deep/ .ivu-table-body td:nth-child(5)  {
     color: red;
 }
@@ -285,4 +289,7 @@ export default {
 /deep/ .ivu-table-body td:nth-child(11)  {
     color: red;
 }
+/deep/ .ivu-table-body td:nth-child(12)  {
+    color: red;
+}
 </style>

+ 7 - 0
src/views/PurchasingManage/redFontInstockOrder/edit.vue

@@ -1217,6 +1217,13 @@ export default {
     //       this.searchData.type = 0
     //     }
     //   });
+     this.tableData.forEach((e) => {
+        let total_cost_value = (
+          e.no_tax_total_price * 1 +
+          e.transport_price * 1
+        ).toFixed(2);
+        this.$set(e, "total_cost",total_cost_value);
+      });
       let obj = JSON.parse(JSON.stringify(this.searchData))
       obj.order_time = parseInt(new Date(obj.order_time).getTime() / 1000) || ''
       let children = JSON.parse(JSON.stringify(this.tableData));