Commit d0047928 authored by tianhongyang's avatar tianhongyang

项目管理 工料汇总 成本汇总 现场经费 小数保留为4位

parent d7ee9ea3
......@@ -635,6 +635,7 @@ export default {
box-shadow: unset;
}
}
/* 滚动条在最右侧时 */
&.is-scrolling-right {
/* 右侧固定列 */
......@@ -643,6 +644,19 @@ export default {
box-shadow: unset;
}
}
// 没有滚动条
&.is-scrolling-none {
& + .el-table__fixed {
box-shadow: unset;
}
/* 右侧固定列 */
& + .el-table__fixed + .el-table__fixed-right,
& + .el-table__fixed-right {
box-shadow: unset;
}
}
}
.el-table__fixed-right,
.el-table__fixed {
......
......@@ -55,6 +55,8 @@ import DictData from '@/components/DictData';
// 全局缩放
import ScreenScal from "@/utils/screenScal";
import { decimalFormat } from "@/utils/decimal";
// 全局方法挂载
Vue.prototype.getDicts = getDicts;
Vue.prototype.getConfigKey = getConfigKey;
......@@ -66,6 +68,7 @@ Vue.prototype.selectDictLabels = selectDictLabels;
Vue.prototype.download = download;
Vue.prototype.handleTree = handleTree;
Vue.prototype.$mitt = mitt();
Vue.prototype.$decimalFormat = (num) => decimalFormat(num);
// 全局组件挂载
Vue.component('DictTag', DictTag);
......
import Decimal from "decimal.js";
/**
* 全局方法 处理为特定的decimal 格式
* @param {*} num
*/
export const decimalFormat = (num) => {
// 处理特殊字符为字母的情况
const reg = /[a-zA-Z]/gmi;
if (reg.test(num) && num != undefined && num != null && isFinite(num)) {
return num;
} else if (!parseFloat(num)) {
return "-";
} else {
return add(num, 0, 4, 15, true);
}
};
/**
* 加法
* @param {*} num1
......@@ -12,7 +29,7 @@ export const add = (num1, num2, digit = 9, intLen = 20, omit = false) => {
const decimal1 = new Decimal(num1);
const decimal2 = new Decimal(num2);
const result = decimal1.plus(decimal2);
return omit ? result.toFixed(digit, Decimal.ROUND_UP) : result.toDecimalPlaces(digit, Decimal.ROUND_UP).toSignificantDigits(intLen).toString();
return omit ? result.toFixed(digit, Decimal.ROUND_HALF_UP) : result.toDecimalPlaces(digit, Decimal.ROUND_HALF_UP).toSignificantDigits(intLen).toString();
};
/**
......@@ -27,7 +44,7 @@ export const subtract = (num1, num2, digit = 9, intLen = 20, omit = false) => {
const decimal1 = new Decimal(num1);
const decimal2 = new Decimal(num2);
const result = decimal1.minus(decimal2);
return omit ? result.toFixed(digit, Decimal.ROUND_UP) : result.toDecimalPlaces(digit, Decimal.ROUND_UP).toSignificantDigits(intLen).toString();
return omit ? result.toFixed(digit, Decimal.ROUND_HALF_UP) : result.toDecimalPlaces(digit, Decimal.ROUND_HALF_UP).toSignificantDigits(intLen).toString();
};
/**
......@@ -42,7 +59,7 @@ export const multiply = (num1, num2, digit = 9, intLen = 20, omit = false) => {
const decimal1 = new Decimal(num1);
const decimal2 = new Decimal(num2);
const result = decimal1.times(decimal2);
return omit ? result.toFixed(digit, Decimal.ROUND_UP) : result.toDecimalPlaces(digit, Decimal.ROUND_UP).toSignificantDigits(intLen).toString();
return omit ? result.toFixed(digit, Decimal.ROUND_HALF_UP) : result.toDecimalPlaces(digit, Decimal.ROUND_HALF_UP).toSignificantDigits(intLen).toString();
};
/**
......@@ -57,7 +74,7 @@ export const divide = (num1, num2, digit = 9, intLen = 20, omit = false) => {
const decimal1 = new Decimal(num1);
const decimal2 = new Decimal(num2);
const result = decimal1.dividedBy(decimal2);
return omit ? result.toFixed(digit, Decimal.ROUND_UP) : result.toDecimalPlaces(digit, Decimal.ROUND_UP).toSignificantDigits(intLen).toString();
return omit ? result.toFixed(digit, Decimal.ROUND_HALF_UP) : result.toDecimalPlaces(digit, Decimal.ROUND_HALF_UP).toSignificantDigits(intLen).toString();
};
// 检测结果是否是负数
......
......@@ -45,6 +45,22 @@
<el-form :model="dataForm" ref="costSummaryForm" :show-message="false" v-else-if="!tableLoading" class="feed-summary-form">
<custom-table ref="costSummaryTable" :tableData="dataForm.tableDataList" :formColum="formColum" :max-height="true" :row-key="rowKey"
:default-expand-all="true" :indent="8" :tableDataTotal="total" :paging="false" :cell-class-name="cellClassName">
<!-- 不含税成本合价 -->
<template slot="taxExclusiveTotal" slot-scope="scope">
{{$decimalFormat(scope.row.taxExclusiveTotal)}}
</template>
<!-- 成本税金合价 -->
<template slot="cbTaxesTotal" slot-scope="scope">
{{$decimalFormat(scope.row.cbTaxesTotal)}}
</template>
<!-- 含税成本合价 -->
<template slot="taxInclusiveTotal" slot-scope="scope">
{{$decimalFormat(scope.row.taxInclusiveTotal)}}
</template>
<!-- 含税成本平米指标 -->
<template slot="taxInclusivePmTarget" slot-scope="scope">
{{$decimalFormat(scope.row.taxInclusivePmTarget)}}
</template>
<!-- 本月费用(含税) -->
<template slot="taxInclusiveExpense" slot-scope="scope">
<!-- 本月费用(含税)编辑单元格 -->
......@@ -53,6 +69,7 @@
<el-input placeholder="请输入" v-model="scope.row.taxInclusiveExpense" clearable
@input="v => editIptValueRectify(v, scope.row, 'taxInclusiveExpense')"></el-input>
</el-form-item>
<span v-else-if="!addActualCostEditStatus">{{$decimalFormat(scope.row.taxInclusiveExpense)}}</span>
</template>
<!-- 本月费用(不含税) -->
<template slot="taxExclusiveExpense" slot-scope="scope">
......@@ -61,6 +78,15 @@
<el-input placeholder="请输入" v-model="scope.row.taxExclusiveExpense" clearable
@input="v => editIptValueRectify(v, scope.row, 'taxExclusiveExpense')"></el-input>
</el-form-item>
<span v-else-if="!addActualCostEditStatus">{{$decimalFormat(scope.row.taxExclusiveExpense)}}</span>
</template>
<!-- 截止本月费用(含税) -->
<template slot="taxInclusiveExpenseTotal" slot-scope="scope">
{{$decimalFormat(scope.row.taxInclusiveExpenseTotal)}}
</template>
<!-- 截止本月费用(不含税) -->
<template slot="taxExclusiveExpenseTotal" slot-scope="scope">
{{$decimalFormat(scope.row.taxExclusiveExpenseTotal)}}
</template>
</custom-table>
</el-form>
......@@ -173,16 +199,16 @@ export default {
formColum: [
{ label: '序号', prop: "number", minWidth: "80", uid: v4(), fixed: "left" },
{ label: '名称', prop: "cbName", width: "303", uid: v4(), showOverflowTooltip: true, fixed: "left" },
{ label: '不含税成本合价', prop: "taxExclusiveTotal", width: "182", uid: v4() },
{ label: '成本税金合价', prop: "cbTaxesTotal", width: "182", uid: v4() },
{ label: '含税成本合价', prop: "taxInclusiveTotal", width: "182", uid: v4() },
{ label: '不含税成本合价', prop: "taxExclusiveTotal", width: "182", uid: v4(), slot: true },
{ label: '成本税金合价', prop: "cbTaxesTotal", width: "182", uid: v4(), slot: true },
{ label: '含税成本合价', prop: "taxInclusiveTotal", width: "182", uid: v4(), slot: true },
{ label: '成本占比', prop: "cbProportion", width: "182", uid: v4() },
{ label: '含税成本平米指标', prop: "taxInclusivePmTarget", width: "182", uid: v4() },
{ label: '含税成本平米指标', prop: "taxInclusivePmTarget", width: "182", uid: v4(), slot: true },
{ label: '备注', prop: "remark", width: "182", uid: v4() },
{ label: '本月费用(含税)', prop: "taxInclusiveExpense", width: "182", uid: v4(), slot: true },
{ label: '本月费用(不含税)', prop: "taxExclusiveExpense", width: "182", uid: v4(), slot: true },
{ label: '截止本月费用(含税)', prop: "taxInclusiveExpenseTotal", width: "182", uid: v4() },
{ label: '截止本月费用(不含税)', prop: "taxExclusiveExpenseTotal", width: "182", uid: v4() },
{ label: '截止本月费用(含税)', prop: "taxInclusiveExpenseTotal", width: "182", uid: v4(), slot: true },
{ label: '截止本月费用(不含税)', prop: "taxExclusiveExpenseTotal", width: "182", uid: v4(), slot: true },
],
monthList: [],
// 源数据月份
......
......@@ -46,6 +46,30 @@
</div>
<span v-else>-</span>
</template>
<template slot="guidePrice" slot-scope="scope">
{{$decimalFormat(scope.row.guidePrice)}}
</template>
<template slot="bidUnitPrice" slot-scope="scope">
{{$decimalFormat(scope.row.bidUnitPrice)}}
</template>
<template slot="unitPriceDifference" slot-scope="scope">
{{$decimalFormat(scope.row.unitPriceDifference)}}
</template>
<template slot="quantity" slot-scope="scope">
{{$decimalFormat(scope.row.quantity)}}
</template>
<template slot="combinedPrice" slot-scope="scope">
{{$decimalFormat(scope.row.combinedPrice)}}
</template>
<template slot="combinedPriceTax" slot-scope="scope">
{{$decimalFormat(scope.row.combinedPriceTax)}}
</template>
<template slot="totalQuantities" slot-scope="scope">
{{$decimalFormat(scope.row.totalQuantities)}}
</template>
<template slot="pushQuantities" slot-scope="scope">
{{$decimalFormat(scope.row.pushQuantities)}}
</template>
<!-- 本月工程量 -->
<template slot="quantities" slot-scope="scope">
<!-- 编辑单元格 -->
......@@ -54,6 +78,7 @@
<el-input placeholder="请输入" v-model="scope.row.quantities" clearable
@input="v => statisticsSum(v,'quantities',scope.row)"></el-input>
</el-form-item>
<span v-else-if="!addActualCostEditStatus">{{$decimalFormat(scope.row.quantities)}}</span>
</template>
<!-- 本月采购单价 -->
<template slot="purchaseUnitPrice" slot-scope="scope">
......@@ -63,6 +88,7 @@
<el-input placeholder="请输入" v-model="scope.row.purchaseUnitPrice" clearable
@input="v => statisticsSum(v,'purchaseUnitPrice',scope.row)"></el-input>
</el-form-item>
<span v-else-if="!addActualCostEditStatus">{{$decimalFormat(scope.row.purchaseUnitPrice)}}</span>
</template>
</custom-table>
</el-form>
......@@ -76,6 +102,33 @@
@click="parseFloat(scope.row.quantities) ? pushProjectUse(scope.row) : ''">推送物资</span>
</div>
</template>
<template slot="guidePrice" slot-scope="scope">
{{$decimalFormat(scope.row.guidePrice)}}
</template>
<template slot="bidUnitPrice" slot-scope="scope">
{{$decimalFormat(scope.row.bidUnitPrice)}}
</template>
<template slot="unitPriceDifference" slot-scope="scope">
{{$decimalFormat(scope.row.unitPriceDifference)}}
</template>
<template slot="quantity" slot-scope="scope">
{{$decimalFormat(scope.row.quantity)}}
</template>
<template slot="combinedPrice" slot-scope="scope">
{{$decimalFormat(scope.row.combinedPrice)}}
</template>
<template slot="combinedPriceTax" slot-scope="scope">
{{$decimalFormat(scope.row.combinedPriceTax)}}
</template>
<template slot="totalQuantities" slot-scope="scope">
{{$decimalFormat(scope.row.totalQuantities)}}
</template>
<template slot="quantities" slot-scope="scope">
{{$decimalFormat(scope.row.quantities)}}
</template>
<template slot="conversionQuantities" slot-scope="scope">
{{$decimalFormat(scope.row.conversionQuantities)}}
</template>
</entity-materials-table>
</div>
......@@ -206,12 +259,12 @@ export default {
{ label: '甲供材料说明', prop: "materialDescription", width: "137", uid: v4() },
{
label: '计划成本', prop: "jhcb", align: "center", uid: v4(), children: [
{ label: '指导价格', prop: "guidePrice", minWidth: "81", uid: v4() },
{ label: '投标选用单价(不含税)', prop: "bidUnitPrice", minWidth: "179", uid: v4() },
{ label: '单价差额', prop: "unitPriceDifference", minWidth: "81", uid: v4() },
{ label: '数量', prop: "quantity", minWidth: "150", uid: v4() },
{ label: '合价(不含税)', prop: "combinedPrice", minWidth: "150", uid: v4() },
{ label: '合价(含税)', prop: "combinedPriceTax", minWidth: "150", uid: v4() },
{ label: '指导价格', prop: "guidePrice", minWidth: "81", uid: v4(), slot: true },
{ label: '投标选用单价(不含税)', prop: "bidUnitPrice", minWidth: "179", uid: v4(), slot: true },
{ label: '单价差额', prop: "unitPriceDifference", minWidth: "81", uid: v4(), slot: true },
{ label: '数量', prop: "quantity", minWidth: "150", uid: v4(), slot: true },
{ label: '合价(不含税)', prop: "combinedPrice", minWidth: "150", uid: v4(), slot: true },
{ label: '合价(含税)', prop: "combinedPriceTax", minWidth: "150", uid: v4(), slot: true },
{ label: '品牌名称', prop: "brandName", minWidth: "81", uid: v4() },
{ label: '投标选用来源', prop: "bidSource", minWidth: "109", uid: v4() },
]
......@@ -224,7 +277,7 @@ export default {
{ label: '填写时间', prop: "createTime", minWidth: "160", uid: v4(), slot: true },
]
},
{ label: '推送工程量', prop: "pushQuantities", width: "95", uid: v4() },
{ label: '推送工程量', prop: "pushQuantities", width: "95", uid: v4(), slot: true },
{ label: '备注', prop: "remark", width: "115", uid: v4(), slot: true },
{ label: '操作', prop: "action-field-bar", width: "99", uid: v4(), fixed: "right" },
],
......@@ -242,12 +295,12 @@ export default {
{ label: '甲供材料说明', prop: "materialDescription", width: "137", uid: v4() },
{
label: '计划成本', prop: "jhcb", align: "center", uid: v4(), children: [
{ label: '指导价格', prop: "guidePrice", minWidth: "81", uid: v4() },
{ label: '投标选用单价(不含税)', prop: "bidUnitPrice", minWidth: "179", uid: v4() },
{ label: '单价差额', prop: "unitPriceDifference", minWidth: "81", uid: v4() },
{ label: '数量', prop: "quantity", minWidth: "150", uid: v4() },
{ label: '合价(不含税)', prop: "combinedPrice", minWidth: "150", uid: v4() },
{ label: '合价(含税)', prop: "combinedPriceTax", minWidth: "150", uid: v4() },
{ label: '指导价格', prop: "guidePrice", minWidth: "81", uid: v4(), slot: true },
{ label: '投标选用单价(不含税)', prop: "bidUnitPrice", minWidth: "179", uid: v4(), slot: true },
{ label: '单价差额', prop: "unitPriceDifference", minWidth: "81", uid: v4(), slot: true },
{ label: '数量', prop: "quantity", minWidth: "150", uid: v4(), slot: true },
{ label: '合价(不含税)', prop: "combinedPrice", minWidth: "150", uid: v4(), slot: true },
{ label: '合价(含税)', prop: "combinedPriceTax", minWidth: "150", uid: v4(), slot: true },
{ label: '品牌名称', prop: "brandName", minWidth: "81", uid: v4() },
{ label: '投标选用来源', prop: "bidSource", minWidth: "109", uid: v4() },
]
......
......@@ -27,6 +27,30 @@
<dsk-skeleton v-if="tableLoading"></dsk-skeleton>
<custom-table v-else-if="!tableLoading" :tableData="dataForm.tableDataList" :formColum="formColum" :max-height="true"
:tableDataTotal="total" :paging="false">
<template slot="expenseValue" slot-scope="scope">
{{$decimalFormat(scope.row.expenseValue)}}
</template>
<template slot="byfy" slot-scope="scope">
{{$decimalFormat(scope.row.byfy)}}
</template>
<template slot="jzbyzfy" slot-scope="scope">
{{$decimalFormat(scope.row.jzbyzfy)}}
</template>
<template slot="cbCount" slot-scope="scope">
{{$decimalFormat(scope.row.cbCount)}}
</template>
<template slot="unitPrice" slot-scope="scope">
{{$decimalFormat(scope.row.unitPrice)}}
</template>
<template slot="excludeTaxSumPrice" slot-scope="scope">
{{$decimalFormat(scope.row.excludeTaxSumPrice)}}
</template>
<template slot="includeTaxSumPrice" slot-scope="scope">
{{$decimalFormat(scope.row.includeTaxSumPrice)}}
</template>
<template slot="engineeringVolume" slot-scope="scope">
{{$decimalFormat(scope.row.engineeringVolume)}}
</template>
</custom-table>
</div>
</div>
......@@ -98,20 +122,20 @@ export default {
formColumOptions: {
"现场经费": [
{ label: '名称', prop: "expenseName", minWidth: "175", uid: v4(), showOverflowTooltip: true },
{ label: '数量', prop: "expenseValue", width: "175", uid: v4() },
{ label: '数量', prop: "expenseValue", width: "175", uid: v4(), slot: true },
{ label: '占比', prop: "proportion", width: "175", uid: v4() },
{ label: '本月费用', prop: "byfy", minWidth: "175", uid: v4() },
{ label: '截至本月总费用', prop: "jzbyzfy", minWidth: "175", uid: v4() },
{ label: '本月费用', prop: "byfy", minWidth: "175", uid: v4(), slot: true },
{ label: '截至本月总费用', prop: "jzbyzfy", minWidth: "175", uid: v4(), slot: true },
],
"其他费用(包含建设其他费)": [
{ label: '序号', prop: "number", width: "60", fixed: false, uid: v4() },
{ label: '名称', prop: "expenseName", width: "121", uid: v4(), showOverflowTooltip: true },
{ label: '单位', prop: "unit", width: "121", uid: v4() },
{ label: '成本数量', prop: "cbCount", width: "121", uid: v4() },
{ label: '成本数量', prop: "cbCount", width: "121", uid: v4(), slot: true },
{ label: '使用时间', prop: "useTime", width: "129", uid: v4() },
{ label: '公司单价', prop: "unitPrice", width: "129", uid: v4() },
{ label: '目标成本合价(不含税)', prop: "excludeTaxSumPrice", width: "180", uid: v4() },
{ label: '目标成本合价(含税)', prop: "includeTaxSumPrice", width: "180", uid: v4() },
{ label: '公司单价', prop: "unitPrice", width: "129", uid: v4(), slot: true },
{ label: '目标成本合价(不含税)', prop: "excludeTaxSumPrice", width: "180", uid: v4(), slot: true },
{ label: '目标成本合价(含税)', prop: "includeTaxSumPrice", width: "180", uid: v4(), slot: true },
{ label: '备注', prop: "remark", width: "384", uid: v4(), showOverflowTooltip: true },
{ label: '成本科目', prop: "cbSubject", width: "129", uid: v4() },
{ label: '税金类型', prop: "taxType", width: "129", uid: v4() },
......@@ -122,30 +146,30 @@ export default {
{ label: '序号', prop: "number", width: "60", fixed: false, uid: v4() },
{ label: '名称', prop: "expenseName", minWidth: "121", uid: v4(), showOverflowTooltip: true },
{ label: '单位', prop: "unit", width: "121", uid: v4() },
{ label: '成本数量', prop: "cbCount", width: "121", uid: v4() },
{ label: '成本数量', prop: "cbCount", width: "121", uid: v4(), slot: true },
{ label: '使用时间', prop: "useTime", width: "121", uid: v4() },
{ label: '公司单价', prop: "unitPrice", width: "121", uid: v4() },
{ label: '目标成本合价(不含税)', prop: "excludeTaxSumPrice", width: "180", uid: v4() },
{ label: '目标成本合价(含税)', prop: "includeTaxSumPrice", width: "180", uid: v4() },
{ label: '公司单价', prop: "unitPrice", width: "121", uid: v4(), slot: true },
{ label: '目标成本合价(不含税)', prop: "excludeTaxSumPrice", width: "180", uid: v4(), slot: true },
{ label: '目标成本合价(含税)', prop: "includeTaxSumPrice", width: "180", uid: v4(), slot: true },
{ label: '成本科目', prop: "cbSubject", width: "121", uid: v4() },
{ label: '税金类型', prop: "taxType", width: "121", uid: v4() },
{ label: '本月费用', prop: "byfy", width: "121", uid: v4() },
{ label: '截止本月总费用', prop: "jzbyzfy", width: "128", uid: v4() },
{ label: '本月费用', prop: "byfy", width: "121", uid: v4(), slot: true },
{ label: '截止本月总费用', prop: "jzbyzfy", width: "128", uid: v4(), slot: true },
],
"现场管理费": [
{ label: '序号', prop: "number", width: "60", fixed: false, uid: v4() },
{ label: '名称', prop: "expenseName", minWidth: "121", uid: v4(), showOverflowTooltip: true },
{ label: '单位', prop: "unit", width: "121", uid: v4() },
{ label: '工程量', prop: "engineeringVolume", width: "121", uid: v4() },
{ label: '工程量', prop: "engineeringVolume", width: "121", uid: v4(), slot: true },
{ label: '增值税税率', prop: "addedTaxRate", width: "121", uid: v4() },
{ label: '不含税单价(元)', prop: "unitPrice", width: "180", uid: v4() },
{ label: '不含税合价(元)', prop: "excludeTaxSumPrice", width: "180", uid: v4() },
{ label: '含税合价(元)', prop: "includeTaxSumPrice", width: "180", uid: v4() },
{ label: '不含税单价(元)', prop: "unitPrice", width: "180", uid: v4(), slot: true },
{ label: '不含税合价(元)', prop: "excludeTaxSumPrice", width: "180", uid: v4(), slot: true },
{ label: '含税合价(元)', prop: "includeTaxSumPrice", width: "180", uid: v4(), slot: true },
{ label: '备注', prop: "remark", width: "121", uid: v4() },
{ label: '成本科目', prop: "cbSubject", width: "121", uid: v4() },
{ label: '税金类型', prop: "taxType", width: "121", uid: v4() },
{ label: '本月费用', prop: "byfy", width: "121", uid: v4() },
{ label: '截止本月总费用', prop: "jzbyzfy", width: "128", uid: v4() },
{ label: '本月费用', prop: "byfy", width: "121", uid: v4(), slot: true },
{ label: '截止本月总费用', prop: "jzbyzfy", width: "128", uid: v4(), slot: true },
]
},
// 已记录月份集合
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment