| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- let isSD2016 = true;
- function overwriteRationCalcBases() {
- if (typeof rationCalcBases == "undefined") return;
- for (let key in rationCalcBases) delete rationCalcBases[key];
- rationCalcBases["人工费"] = function (node, isTender) {
- return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
- };
- rationCalcBases["材料费"] = function (node, isTender) {
- return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
- };
- rationCalcBases["施工机械使用费"] = function (node, isTender) {
- return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
- };
- rationCalcBases["商品砼费"] = function (node, isTender) {
- return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptMarketPrice, isTender);
- };
- rationCalcBases["外购砼构件费"] = function (node, isTender) {
- return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptMarketPrice, isTender);
- };
- }
- (function overwriteFeeTypes() {
- if (typeof cpFeeTypes == "undefined") return;
- cpFeeTypes = [
- {
- type: "marketDirect",
- name: "直接费",
- },
- {
- type: "marketDirectWork",
- name: "直接工程费",
- },
- {
- type: "marketLabour",
- name: "人工费",
- },
- {
- type: "marketMaterial",
- name: "材料费",
- },
- {
- type: "marketMachine",
- name: "施工机械使用费",
- },
- {
- type: "otherFee",
- name: "其他工程费",
- },
- {
- type: "otherFee1",
- name: "其他工程费I",
- },
- {
- type: "otherFee2",
- name: "其他工程费II",
- },
- {
- type: "indirect",
- name: "间接费",
- },
- {
- type: "manage",
- name: "企业管理费",
- },
- {
- type: "force",
- name: "规费",
- },
- {
- type: "profit",
- name: "利润",
- },
- {
- type: "tax",
- name: "税金",
- },
- {
- type: "common",
- name: "建安费",
- },
- ];
- })();
- // 清单基数
- const progression = ["养护工程管理费", "养护工程设计费"];
- const deficiency = {};
- if (typeof baseFigureMap !== "undefined") {
- const { fixedFlag } = commonConstants;
- const budgetMap = {
- // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
- 建筑安装工程费: {
- base: "JZAZGCF",
- fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
- filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
- pick: false,
- },
- // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
- 养护工程管理费: {
- isProgressive: true,
- base: "YHGCGLF",
- fixedFlag: null,
- filter: [fixedFlag.MAINTENANCE_EXPENSES],
- pick: true,
- },
- // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
- 养护工程设计费: {
- isProgressive: true,
- base: "YHGCSJF",
- fixedFlag: null,
- filter: [fixedFlag.MAINTENANCE_EXPENSES],
- pick: true,
- },
- // 显示:仅“价差预备费”可显示
- 价差预备费: {
- base: "JCYBF",
- fixedFlag: null,
- filter: [fixedFlag.SPREAD_BUDGET_FEE],
- pick: true,
- },
- };
- const boqMap = {
- //仅允许用于固定类别是“第100章至700章清单”以外的清单
- 各章清单合计: {
- base: "GZQDHJ",
- fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
- filter: [fixedFlag.ONE_SEVEN_BILLS],
- pick: false,
- },
- //仅允许用于固定类别是“第100章至700章清单”以外的清单
- 专项暂定合计: {
- base: "ZXZDHJ",
- fixedFlag: null,
- filter: [fixedFlag.ONE_SEVEN_BILLS],
- pick: false,
- },
- /*
- * 清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
- * 因此{100章以外合计}不设置关联的清单固定行
- * */
- //仅允许用于固定类别为“100章清单”引用
- "100章以外清单合计": {
- base: "YBZYHQDHJ",
- fixedFlag: null,
- filter: [fixedFlag.ONE_HUNDRED_BILLS],
- pick: true,
- },
- };
- baseFigureMap.budget = budgetMap;
- baseFigureMap.boq = boqMap;
- }
- if (typeof baseFigureTemplate !== "undefined") {
- const { fixedFlag } = commonConstants;
- baseFigureTemplate.budget = {
- // 建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
- JZAZGCF(tender) {
- return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, "common");
- },
- // 养护工程管理费 算法:以{建筑安装工程费}为基数,采用累进办法计算
- YHGCGLF(tender) {
- const baseFee = this["JZAZGCF"](tender);
- if (!tender) {
- calcBase.baseProgressiveFee = baseFee;
- }
- return calculateUtil.getProgressiveFee(baseFee, "养护工程管理费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
- },
- // 养护工程设计费 算法:以{建筑安装工程费}为基数,采用累进办法计算。
- YHGCSJF(tender) {
- const baseFee = this["JZAZGCF"](tender);
- if (!tender) {
- calcBase.baseProgressiveFee = baseFee;
- }
- return calculateUtil.getProgressiveFee(baseFee, "养护工程设计费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
- },
- /* 价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
- 价差预备费 P * [(1+i)^(n-1) -1]
- P——建筑安装工程费总额(元);
- i——年工程造价增涨率(%);
- n——设计文件编制年至养护项目开工年+养护项目建设期限(年)。
- */
- JCYBF(tender) {
- //建筑安装工程费作为基数
- const installFee = this["JZAZGCF"](tender);
- //年造价增涨
- const costGrowthRate = calcBase.project.property.costGrowthRate ? calcBase.project.property.costGrowthRate : 0;
- //增涨计费年限
- const growthPeriod = projectObj.project.property.growthPeriod ? calcBase.project.property.growthPeriod : 0;
- //= P * [(1+i)^(n-1) -1]
- return (installFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
- },
- };
- baseFigureTemplate.boq = {
- //{各章清单合计}
- // 取清单固定类别是“第100章至700章清单”的金额
- GZQDHJ: function (tender) {
- return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, "common");
- },
- //{专项暂定合计}
- // 第100章至700章清单行的暂估合价
- ZXZDHJ: function (tender) {
- return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'estimate');
- },
- //{100章以外清单合计}
- // 取清单固定清单[第100章至700章清单]的金额,但扣除清单100章下的金额。
- // 如果是固定清单[第100章至700章清单]下100章以外清单引用此基数,要排除自身(目前只允许100章的清单使用,所以暂时不需要此判断)
- YBZYHQDHJ: function (tender) {
- let oneToSeven = cbTools.findNodeByFlag(fixedFlag.ONE_SEVEN_BILLS);
- if (!oneToSeven) {
- return 0;
- }
- //100-700章固定节点的所有子节点
- let allChildren = [];
- function getChildren(nodes) {
- allChildren = allChildren.concat(nodes);
- for (let node of nodes) {
- if (node.children.length > 0) {
- getChildren(node.children);
- }
- }
- }
- getChildren(oneToSeven.children);
- //扣除的节点:100章的节点[100-200)
- let deductNodes = allChildren.filter(cbTools.withingOneHundred);
- //计算金额
- let fullFeeField = tender ? "common.tenderTotalFee" : "common.totalFee";
- return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
- },
- };
- }
- //工料机类型排序:人工、机上人工、混凝土、砂浆、配合比、普通材料、商品混凝土、商品砂浆、外购砼构件、绿化苗木、机械台班、机械组成物、设备。
- function o_sortRationGLJ(list, std, tm) {
- let lo_sh = typeof _ !== "undefined" ? _ : require("lodash");
- const field = std ? "gljType" : "type";
- let TypeMap = {
- 1: 1,
- 303: 2,
- 202: 3,
- 203: 4,
- 204: 5,
- 201: 6,
- 205: 7,
- 206: 8,
- 208: 9,
- 209: 10,
- 301: 11,
- 302: 12,
- 5: 13,
- };
- if (tm) TypeMap = tm;
- list = lo_sh.sortByAll(list, [
- function (item) {
- return TypeMap[item[field]];
- },
- function (item) {
- let arr = item.code.split("-");
- return arr[0];
- },
- "code",
- ]);
- return list;
- }
- if (typeof gljUtil !== "undefined") {
- gljUtil.sortRationGLJ = o_sortRationGLJ;
- gljUtil.sortProjectGLJ = function (list) {
- //人工、机上人工、普通材料、商品混凝土、商品砂浆、外购砼构件、绿化苗木、机械台班、机械组成物、设备、混凝土、砂浆、配合比
- const TypeMap = {
- 1: 1,
- 303: 2,
- 201: 3,
- 205: 4,
- 206: 5,
- 208: 6,
- 209: 7,
- 301: 8,
- 302: 9,
- 5: 10,
- 202: 11,
- 203: 12,
- 204: 13,
- };
- return o_sortRationGLJ(list, false, TypeMap);
- };
- gljUtil.getAssUsedPrice = function(g){//山东辅助生产人工费取市场价
- return g.marketPrice;
- }
- gljUtil.getElecCode = function () {
- return "865";
- }
- }
- //山东工地转移费率值修改特殊处理
- if (typeof feeRateObject !== "undefined") {
- feeRateObject.feeRateSpecialHandle = function (subRate, value) {
- let result = {};
- if (subRate.name == "工地转移(km)" && value && value < 50) {
- //工地转移50km以内按50km算
- result.valueKey = "50";
- result.value = scMathUtil.roundForObj(value, getDecimal("feeRate")); //设置显示的节点值
- }
- return result;
- };
- }
- if (typeof gljOprObj !== 'undefined') {
- // 添加、替换工料机界面工料机排序
- gljOprObj.sortSelectViewGLJ = function (data) {
- // 工料机编码:按“-”前的数值排序
- const reg = /[^-]+/;
- data.sort((a, b) => {
- const orgCodeA = a.code;
- const orgCodeB = b.code;
- const regCodeA = orgCodeA.match(reg);
- const regCodeB = orgCodeB.match(reg);
- const compareCodeA = regCodeA
- ? +regCodeA[0]
- ? +regCodeA[0]
- : regCodeA[0]
- : orgCodeA;
- const compareCodeB = regCodeB
- ? +regCodeB[0]
- ? +regCodeB[0]
- : regCodeB
- : orgCodeB;
- return isNaN(compareCodeA) && isNaN(compareCodeB)
- ? compareCodeA.localeCompare(compareCodeB)
- : compareCodeA - compareCodeB;
- });
- // 工料机类型排序:人工、机上人工、混凝土、砂浆、配合比、普通材料、商品混凝土、商品砂浆、外购砼构件、绿化苗木、机械台班、机械组成物、设备。
- const TypeMap = {
- 1: 1,
- 303: 2,
- 202: 3,
- 203: 4,
- 204: 5,
- 201: 6,
- 205: 7,
- 206: 8,
- 208: 9,
- 209: 10,
- 301: 11,
- 302: 12,
- 5: 13,
- };
- data.sort((a, b) => {
- const typeA = TypeMap[a.gljType];
- const typeB = TypeMap[b.gljType];
- return typeA - typeB;
- });
- }
- }
- if (typeof electrovalenceObj !== 'undefined') {
- electrovalenceObj.options = [
- { code: "870", name: "电网电", specs: "", unit: "kW·h", type: "201" },
- { code: "1791", name: "5kw以内柴油发电机组", specs: "5GF1", unit: "台班", type: "301" },
- { code: "1792", name: "15kw以内柴油发电机组", specs: "12GF1", unit: "台班", type: "301" },
- { code: "1793", name: "30kw以内柴油发电机组", specs: "30GFY-2", unit: "台班", type: "301" },
- { code: "1794", name: "50kw以内柴油发电机组", specs: "50GFY-2", unit: "台班", type: "301" },
- { code: "1795", name: "75kw以内柴油发电机组", specs: "75GFY-4", unit: "台班", type: "301" },
- { code: "1796", name: "100kw以内柴油发电机组", specs: "90GFZ", unit: "台班", type: "301" },
- { code: "1797", name: "120kw以内柴油发电机组", specs: "120GFY-4", unit: "台班", type: "301" },
- { code: "1798", name: "160kw以内柴油发电机组", specs: "160GF", unit: "台班", type: "301" },
- { code: "1799", name: "200kw以内柴油发电机组", specs: "200GF", unit: "台班", type: "301" },
- { code: "1800", name: "250kw以内柴油发电机组", specs: "250GF4-4", unit: "台班", type: "301" },
- { code: "1801", name: "320kw以内柴油发电机组", specs: "320GF-2", unit: "台班", type: "301" }
- ]
- }
- if (typeof projectObj !== 'undefined') {
- projectObj.isInsertEquipmentVisable = function (selected) {
- return false;//山东养护(2016)和湖南养护(2014),预算、工程量清单项目右键应隐藏“插入设备”按钮。
- }
- }
- //是否需要将“设备”的处理成“普通材料”
- function ifTransEqToMateria(){
- return true;
- }
- if (typeof module !== "undefined" && !module.nodeType) {
- module.exports = {
- progression,
- deficiency,
- ifTransEqToMateria,
- sortRationGLJ: o_sortRationGLJ,
- getDefalutAssistProductionFeeRate: function () {
- return 5;
- },
- };
- }
|