|
|
@@ -14,6 +14,49 @@
|
|
|
* */
|
|
|
|
|
|
const XMLStandard = (function () {
|
|
|
+ //属性类型
|
|
|
+ const TYPE = {
|
|
|
+ DATE: 1, //日期类型YYYY-MM-DD
|
|
|
+ DATE_TIME: 2, //日期类型YYY-MM-DDTHH:mm:ss
|
|
|
+ INT: 3, //整数类型
|
|
|
+ DECIMAL: 4, //数值类型,不限制小数位数
|
|
|
+ NUM2: 5, //数值类型2:最多两位小数
|
|
|
+ BOOL: 6 //布尔型
|
|
|
+ };
|
|
|
+ const WHITE_SPACE = {
|
|
|
+ COLLAPSE: 1 //移除所有空白字符(换行、回车、空格以及制表符会被替换为空格,开头和结尾的空格会被移除,而多个连续的空格会被缩减为一个单一的空格)
|
|
|
+ };
|
|
|
+ //费用类别:固定行ID对应
|
|
|
+ const FEE_TYPE = {
|
|
|
+ [fixedFlag.SUB_ENGINERRING]: '1100',
|
|
|
+ [fixedFlag.MEASURE]: '1200',
|
|
|
+ [fixedFlag.CONSTRUCTION_ORGANIZATION]: '120201',
|
|
|
+ [fixedFlag.SAFETY_CONSTRUCTION]: '1204',
|
|
|
+ [fixedFlag.PROJECT_COMPLETE_ARCH_FEE]: '10041',
|
|
|
+ [fixedFlag.HOUSE_QUALITY_ACCEPT_FEE]: '1206',
|
|
|
+ [fixedFlag.OTHER]: '1300',
|
|
|
+ [fixedFlag.CHARGE]: '800',
|
|
|
+ [fixedFlag.TAX]: '900',
|
|
|
+ [fixedFlag.ADDED_VALUE_TAX]: '9001',
|
|
|
+ [fixedFlag.ADDITIONAL_TAX]: '9002',
|
|
|
+ [fixedFlag.ENVIRONMENTAL_PROTECTION_TAX]: '9003',
|
|
|
+ 0: '1800', //其他未定义的大项费用
|
|
|
+ };
|
|
|
+ //文件类型
|
|
|
+ const FILE_KIND = {
|
|
|
+ '1': '投标',
|
|
|
+ '2': '招标',
|
|
|
+ };
|
|
|
+ //计税方法
|
|
|
+ const TAX_TYPE = {
|
|
|
+ '1': '一般计税法',
|
|
|
+ '2': '简易计税法',
|
|
|
+ };
|
|
|
+ //加载数据间隔,减少服务器压力
|
|
|
+ const TIMEOUT_TIME = 500;
|
|
|
+ function isDef(v) {
|
|
|
+ return typeof v !== 'undefined' && v !== null;
|
|
|
+ }
|
|
|
return function (userID, granularity) {
|
|
|
this.GRANULARITY = {
|
|
|
PROJECT: 1, //导出建设项目
|
|
|
@@ -24,24 +67,6 @@ const XMLStandard = (function () {
|
|
|
if (!granularity || ![1, 2, 3].includes(granularity)) {
|
|
|
granularity = this.GRANULARITY.PROJECT;
|
|
|
}
|
|
|
- //属性类型
|
|
|
- const TYPE = {
|
|
|
- DATE: 1, //日期类型YYYY-MM-DD
|
|
|
- DATE_TIME: 2, //日期类型YYY-MM-DDTHH:mm:ss
|
|
|
- INT: 3, //整数类型
|
|
|
- DECIMAL: 4, //数值类型,不限制小数位数
|
|
|
- NUM2: 5, //数值类型2:最多两位小数
|
|
|
- BOOL: 6 //布尔型
|
|
|
- };
|
|
|
- const WHITE_SPACE = {
|
|
|
- COLLAPSE: 1 //移除所有空白字符(换行、回车、空格以及制表符会被替换为空格,开头和结尾的空格会被移除,而多个连续的空格会被缩减为一个单一的空格)
|
|
|
- };
|
|
|
- //加载数据间隔,减少服务器压力
|
|
|
- const TIMEOUT_TIME = 500;
|
|
|
-
|
|
|
- function isDef(v) {
|
|
|
- return typeof v !== 'undefined' && v !== null;
|
|
|
- }
|
|
|
/*
|
|
|
* 检查
|
|
|
* 创建节点时检查节点的数据
|
|
|
@@ -64,41 +89,54 @@ const XMLStandard = (function () {
|
|
|
rst.filterAttrs.push(data);
|
|
|
continue;
|
|
|
}
|
|
|
- let isFail = false;
|
|
|
+ let isFail = false,
|
|
|
+ tempFail = '';
|
|
|
if (data.minLen && data.value.length < data.minLen){
|
|
|
isFail = true;
|
|
|
- rst.failHints.push(`“${data.name}”字符数不可小于${data.minLen}个`);
|
|
|
+ tempFail = `“${data.name}”字符数不可小于${data.minLen}个`;
|
|
|
+ //rst.failHints.push(`“${data.name}”字符数不可小于${data.minLen}个`);
|
|
|
} else if (data.maxLen && data.value.length > data.maxLen) {
|
|
|
isFail = true;
|
|
|
- rst.failHints.push(`“${data.name}”字符数不可大于${data.maxLen}个`);
|
|
|
+ tempFail = `“${data.name}”字符数不可大于${data.maxLen}个`;
|
|
|
+ //rst.failHints.push(`“${data.name}”字符数不可大于${data.maxLen}个`);
|
|
|
} else if (data.enumeration && !data.enumeration.includes(data.value)) {
|
|
|
isFail = true;
|
|
|
- rst.failHints.push(`“${data.name}”只能从“${data.enumeration.join(';')}”中选择`);
|
|
|
+ tempFail = `“${data.name}”只能从“${data.enumeration.join(';')}”中选择`;
|
|
|
+ //rst.failHints.push(`“${data.name}”只能从“${data.enumeration.join(';')}”中选择`);
|
|
|
} else if (data.type && data.type === TYPE.DATE && !dateReg.test(data.value)) {
|
|
|
isFail = true;
|
|
|
- rst.push(`“${data.name}”日期格式必须是YYYY-MM-DD`);
|
|
|
+ tempFail = `“${data.name}”日期格式必须是YYYY-MM-DD`;
|
|
|
+ //rst.push(`“${data.name}”日期格式必须是YYYY-MM-DD`);
|
|
|
} else if (data.type && data.type === TYPE.INT && !Number.isInteger(parseFloat(data.value))) {
|
|
|
isFail = true;
|
|
|
- rst.failHints.push(`“${data.name}”必须为整数`);
|
|
|
+ tempFail = `“${data.name}”必须为整数`;
|
|
|
+ //rst.failHints.push(`“${data.name}”必须为整数`);
|
|
|
} else if (data.type && data.type === TYPE.DECIMAL && isNaN(parseFloat(data.value))) {
|
|
|
isFail = true;
|
|
|
- rst.failHints.push(`“${data.name}”必须为数值`)
|
|
|
+ tempFail = `“${data.name}”必须为数值`;
|
|
|
+ //rst.failHints.push(`“${data.name}”必须为数值`)
|
|
|
} else if (data.type && data.type === TYPE.NUM2) {
|
|
|
let v = parseFloat(data.value);
|
|
|
if (isNaN(v)) {
|
|
|
isFail = true;
|
|
|
+ tempFail = `“${data.name}”必须为数值`;
|
|
|
rst.failHints.push(`“${data.name}”必须为数值`);
|
|
|
} else if (!data.value.length || (data.value.split('.').length > 1 && data.value.split('.')[1].length > 2)){
|
|
|
isFail = true;
|
|
|
- rst.failHints.push(`“${data.name}”小数位数不得多于两位`);
|
|
|
+ //tempFail = `“${data.name}”小数位数不得多于两位`;
|
|
|
+ //rst.failHints.push(`“${data.name}”小数位数不得多于两位`);
|
|
|
}
|
|
|
} else if (data.type && data.type === TYPE.BOOL && !['true', 'false'].includes(data.value.toString())) {
|
|
|
isFail = true;
|
|
|
- rst.failHints.push(`“${data.name}”必须为true或false`);
|
|
|
+ tempFail = `“${data.name}”必须为true或false`;
|
|
|
+ //rst.failHints.push(`“${data.name}”必须为true或false`);
|
|
|
}
|
|
|
if (!isFail || data.required) {
|
|
|
rst.filterAttrs.push(data);
|
|
|
}
|
|
|
+ if (isFail && data.required && tempFail) {
|
|
|
+ rst.failHints.push(tempFail);
|
|
|
+ }
|
|
|
}
|
|
|
return rst;
|
|
|
}
|
|
|
@@ -156,8 +194,8 @@ const XMLStandard = (function () {
|
|
|
{name: '建设单位', value: getValueByKey(source.basicInformation, 'constructionUnit'), required: true},
|
|
|
{name: '标准版本号', value: '3.2.2', required: true},
|
|
|
{name: '标准名称', value: '重庆造价软件数据交换标准(清单计价)', required: true,},
|
|
|
- {name: '文件类型', value: getValueByKey(source.basicInformation, 'fileKind'), required: true, enumeration: ['招标', '投标', '控制价', '结算', '其他']},
|
|
|
- {name: '计税方法', value: 'todo', required: true},
|
|
|
+ {name: '文件类型', value: source.fileKind, required: true, enumeration: ['招标', '投标', '控制价', '结算', '其他']},
|
|
|
+ {name: '计税方法', value: source.taxType, required: true, enumeration: ['营业税', '一般计税法', '简易计税法']},
|
|
|
];
|
|
|
//唯一约束
|
|
|
this.constraints = {
|
|
|
@@ -176,7 +214,7 @@ const XMLStandard = (function () {
|
|
|
{name: '编制单位', value: getValueByKey(source.basicInformation, 'establishmentUnit'), required: true},
|
|
|
{name: '审核单位', value: getValueByKey(source.basicInformation, 'auditUnit')},
|
|
|
{name: '编制人', value: getValueByKey(source.basicInformation, 'buildingUnitAuthor'), required: true},
|
|
|
- {name: '审核人', value: 'todo'},
|
|
|
+ {name: '审核人', value: getValueByKey(source.basicInformation, 'auditUnitAuditor')},
|
|
|
{name: '开工日期', value: getValueByKey(source.basicInformation, 'commencementDate'), type: TYPE.DATE},
|
|
|
{name: '竣工日期', value: getValueByKey(source.basicInformation, 'completionDate'), type: TYPE.DATE},
|
|
|
{name: '编制日期', value: getValueByKey(source.basicInformation, 'establishDate'), type: TYPE.DATE, required: true},
|
|
|
@@ -208,7 +246,7 @@ const XMLStandard = (function () {
|
|
|
{name: '投标工期', value: getValueByKey(source.basicInformation, 'biddingPeriod')},
|
|
|
{name: '投标保证金', value: getValueByKey(source.basicInformation, 'biddingMargin'), type: TYPE.NUM2},
|
|
|
{name: '质量承诺', value: getValueByKey(source.basicInformation, 'qualityCommitment')},
|
|
|
- {name: '担保类型', value: getValueByKey(source.basicInformation, 'guaranteeType')},
|
|
|
+ {name: '担保类型', value: getValueByKey(source.basicInformation, 'guaranteeType'), enumeration: ['支票', '现金', '电汇', '汇票']},
|
|
|
{name: '投标总价', value: source.summaryInfo.engineeringCost, required: true, type: TYPE.NUM2},
|
|
|
];
|
|
|
element.call(this, '投标信息', attrs);
|
|
|
@@ -237,6 +275,12 @@ const XMLStandard = (function () {
|
|
|
{name: '措施项目清单合计', value: summaryInfo.measure, required: true, type: TYPE.NUM2},
|
|
|
{name: '安全文明施工专项费', value: summaryInfo.safetyConstruction, required: true, type: TYPE.NUM2},
|
|
|
{name: '其他项目清单合计', value: summaryInfo.other, required: true, type: TYPE.NUM2},
|
|
|
+ {name: '暂列金额合计', value: summaryInfo.provisional, type: TYPE.NUM2},
|
|
|
+ {name: '材料暂估价合计', value: summaryInfo.materialProvisional, type: TYPE.NUM2},
|
|
|
+ {name: '专业工程暂估价合计', value: summaryInfo.engineeringEstimate, type: TYPE.NUM2},
|
|
|
+ {name: '计日工合计', value: summaryInfo.daywork, type: TYPE.NUM2},
|
|
|
+ {name: '总承包服务费合计', value: summaryInfo.turnKeyContract, type: TYPE.NUM2},
|
|
|
+ {name: '签证索赔合计', value: summaryInfo.claimVisa, type: TYPE.NUM2},
|
|
|
{name: '规费', value: summaryInfo.charge, required: true, type: TYPE.NUM2},
|
|
|
{name: '税金', value: summaryInfo.tax, required: true, type: TYPE.NUM2},
|
|
|
];
|
|
|
@@ -254,8 +298,8 @@ const XMLStandard = (function () {
|
|
|
//单位工程定义
|
|
|
function Tender(source) {
|
|
|
const TAX = {
|
|
|
- 1: '一般计税',
|
|
|
- 2: '简易计税'
|
|
|
+ '1': '一般计税',
|
|
|
+ '2': '简易计税',
|
|
|
};
|
|
|
let attrs = [
|
|
|
{name: '编号', value: source.code, required: true, minLen: 1, maxLen: 255, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
@@ -267,8 +311,11 @@ const XMLStandard = (function () {
|
|
|
'房屋安装修缮工程', '房屋修缮单拆除'
|
|
|
]},
|
|
|
{name: '金额', value: source.summaryInfo.engineeringCost, type: TYPE.NUM2},
|
|
|
- {name: '定额库编码', value: source.defaultRationLibCode},
|
|
|
- {name: '计税方法', value: TAX[source.taxType], required: true},
|
|
|
+ {name: '定额库编码', value: source.defaultRationLibCode, enumeration: [
|
|
|
+ 'CQ18TJ', 'CQ18ZS', 'CQ18AZ', 'CQ18SZ', 'CQ18YL', 'CQ18FG', 'CQ18GD', 'CQ18FS',
|
|
|
+ 'CQ18LS', 'CQ18GZW', 'CQ18BP', 'CQ18ZP'
|
|
|
+ ]},
|
|
|
+ {name: '计税方法', value: TAX[source.taxType], required: true, enumeration: ['营业税', '一般计税', '简易计税']},
|
|
|
];
|
|
|
this.constraints = {
|
|
|
billsCode: [], //清单项目项目编码
|
|
|
@@ -283,6 +330,7 @@ const XMLStandard = (function () {
|
|
|
otherItemNo: [], //其他列项序号
|
|
|
feeItemNo: [], //费用项序号
|
|
|
mainBillsCode: [], //主要清单明细项目编码 (标准文件中constraint中没有定义此唯一性,但是主要清单明细的备注那里说明了,这里处理一下)
|
|
|
+ appraisalDetailCode: [], //评审材料明细代码唯一(标准文件中constraint中没有定义此唯一性,但是评审材料明细的备注里说明了)
|
|
|
};
|
|
|
element.call(this, '单位工程', attrs);
|
|
|
}
|
|
|
@@ -320,7 +368,7 @@ const XMLStandard = (function () {
|
|
|
{name: '费率', value: source.feeRate},
|
|
|
{name: '金额', value: getFee(source.fees, 'common.totalFee'), type: TYPE.NUM2},
|
|
|
{name: '其中暂估价', value: getFee(source.fees, 'estimate.totalFee'), type: TYPE.NUM2},
|
|
|
- {name: '费用类别', value: source.feeType, type: TYPE.INT, required: true},
|
|
|
+ {name: '费用类别', value: source.feeType, type: TYPE.INT, required: true, enumeration: ['1100', '1200', '1204', '1300', '800', '900', '1800', '1']},
|
|
|
{name: '备注', value: source.remark},
|
|
|
];
|
|
|
element.call(this, '计价程序费用行', attrs);
|
|
|
@@ -391,15 +439,15 @@ const XMLStandard = (function () {
|
|
|
{name: '单位', value: source.unit, required: true, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
{name: '定额库编码', value: source.libCode, required: true},
|
|
|
{name: '原始定额编号', value: source.code, minLen: 1, maxLen: 80, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
- {name: '子目类型', value: source.subType, required: true, type: TYPE.INT, enumeration: ['0', '1', '2', '3', '4', '5', '6']}, //todo
|
|
|
+ {name: '子目类型', value: source.subType, required: true, type: TYPE.INT, enumeration: ['0', '1', '2', '3', '4', '5', '6']},
|
|
|
{name: '工程量', value: source.quantity, required: true, type: TYPE.DECIMAL},
|
|
|
{name: '工程量计算式', value: source.quantityEXP},
|
|
|
{name: '定额单价', value: getFee(source.fees, 'rationUnitPrice.unitFee'), required: true, type: TYPE.DECIMAL},
|
|
|
{name: '定额合价', value: getFee(source.fees, 'rationUnitPrice.totalFee'), required: true, type: TYPE.NUM2},
|
|
|
{name: '综合单价', value: getFee(source.fees, 'common.unitFee'), required: true, type: TYPE.DECIMAL},
|
|
|
{name: '综合合价', value: getFee(source.fees, 'common.totalFee'), required: true, type: TYPE.NUM2},
|
|
|
- {name: '单价构成文件ID', value: 0, required: true, type: TYPE.INT}, //todo
|
|
|
- {name: '分包标志', value: !!source.isSubcontract, type: TYPE.BOOL},
|
|
|
+ {name: '单价构成文件ID', value: source.programID, required: true, type: TYPE.INT},
|
|
|
+ {name: '分包标志', value: false, type: TYPE.BOOL},
|
|
|
{name: '备注', value: source.remark}
|
|
|
];
|
|
|
element.call(this, '定额子目', attrs);
|
|
|
@@ -414,7 +462,7 @@ const XMLStandard = (function () {
|
|
|
{name: '人材机代码', value: source.code, required: true, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
{name: '消耗量', value: source.quantity, required: true, type: TYPE.DECIMAL},
|
|
|
{name: '总消耗量', value: source.totalQuantity, required: true, type: TYPE.DECIMAL},
|
|
|
- {name: '数量计算方式', value: 1, required: true, type: TYPE.INT},
|
|
|
+ {name: '数量计算方式', value: 1, required: true, type: TYPE.INT, enumeration: ['1', '2']},
|
|
|
];
|
|
|
element.call(this, '人材机含量', attrs);
|
|
|
}
|
|
|
@@ -601,7 +649,7 @@ const XMLStandard = (function () {
|
|
|
let attrs = [
|
|
|
{name: '编号', value: source.code, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
{name: '工程名称', value: source.name, minLen: 1, maxLen: 255, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
- {name: '计算基础', value: 0, type: TYPE.DECIMAL, required: true}, //todo
|
|
|
+ {name: '计算基础', value: source.calcBaseValue, type: TYPE.DECIMAL, required: true},
|
|
|
{name: '服务内容', value: source.serviceContent, maxLen: 255, required: true},
|
|
|
{name: '费率', value: source.feeRate, type: TYPE.DECIMAL, required: true},
|
|
|
{name: '金额', value: getFee(source.fees, 'common.totalFee'), type: TYPE.NUM2, required: true},
|
|
|
@@ -618,8 +666,9 @@ const XMLStandard = (function () {
|
|
|
{name: '数量', value: source.quantity, type: TYPE.DECIMAL, required: true},
|
|
|
{name: '单价', value: getFee(source.fees, 'common.unitFee'), type: TYPE.DECIMAL, required: true},
|
|
|
{name: '合价', value: getFee(source.fees, 'common.totalFee'), type: TYPE.NUM2, required: true},
|
|
|
- {name: '依据', value: '', required: true},
|
|
|
- ]
|
|
|
+ {name: '依据', value: source.claimVisa, required: true},
|
|
|
+ ];
|
|
|
+ element.call(this, '签证索赔计价汇总费用项', attrs);
|
|
|
}
|
|
|
//其他定义
|
|
|
function Other(source) {
|
|
|
@@ -636,8 +685,8 @@ const XMLStandard = (function () {
|
|
|
{name: '计算基础', value: source.calcBase, maxLen: 255},
|
|
|
{name: '费率', value: source.feeRate, type: TYPE.DECIMAL},
|
|
|
{name: '金额', value: source.commonTotalFee, type: TYPE.NUM2, required: true},
|
|
|
- {name: '不计入合价标志', value: false, type: TYPE.BOOL},
|
|
|
- {name: '招标人标志', value: true, type: TYPE.BOOL},
|
|
|
+ {name: '不计入合价标志', value: source.notSummray, type: TYPE.BOOL},
|
|
|
+ {name: '招标人标志', value: false, type: TYPE.BOOL},
|
|
|
{name: '备注', value: source.remark, maxLen: 255}
|
|
|
];
|
|
|
element.call(this, '其他列项', attrs);
|
|
|
@@ -670,20 +719,20 @@ const XMLStandard = (function () {
|
|
|
let attrs = [
|
|
|
{name: '代码', value: source.code, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
{name: '名称', value: source.name, minLen: 1, maxLen: 255, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
- {name: '规格', value: source.spec, maxLen: 255},
|
|
|
+ {name: '规格', value: source.specs, maxLen: 255},
|
|
|
{name: '单位', value: source.unit, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
{name: '原始代码', value: source.orgCode, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
{name: '费用类别', value: source.feeType, enumeration: ['1', '2', '3', '4'], required: true},
|
|
|
- {name: '配比类别', value: '', type: TYPE.INT}, //todo
|
|
|
- {name: '主要材料类别', value: '', type: TYPE.INT}, //todo
|
|
|
- {name: '主要材料单位系数', value: '', type: TYPE.DECIMAL}, //todo
|
|
|
- {name: '材料耗用类型', value: '', type: TYPE.INT, required: true}, //todo
|
|
|
- {name: '供货方式', value: '', type: TYPE.INT}, //todo
|
|
|
- {name: '暂估材料标志', value: !!source.is_evaluate, type: TYPE.BOOL},
|
|
|
- {name: '不计税设备标志', value: !!source.is_adjust_price, type: TYPE.BOOL, required: true}, //todo
|
|
|
- {name: '单价不从明细汇总标志', value: !!source.excludeRatio, type: TYPE.BOOL}, //todo
|
|
|
+ {name: '配比类别', value: source.ratioType, type: TYPE.INT},
|
|
|
+ {name: '主要材料类别', value: source.mainMaterialType, type: TYPE.INT},
|
|
|
+ {name: '主要材料单位系数', value: source.materialCoe, type: TYPE.DECIMAL},
|
|
|
+ {name: '材料耗用类型', value: 0, type: TYPE.INT, required: true},
|
|
|
+ {name: '供应方式', value: source.supply, type: TYPE.INT, enumeration: ['1', '2']},
|
|
|
+ {name: '暂估材料标志', value: source.is_evaluate, type: TYPE.BOOL},
|
|
|
+ {name: '不计税设备标志', value: source.no_tax_eqp, type: TYPE.BOOL, required: true},
|
|
|
+ {name: '单价不从明细汇总标志', value: source.notFromDetail, type: TYPE.BOOL},
|
|
|
{name: '定额价', value: source.basePrice, type: TYPE.DECIMAL, required: true},
|
|
|
- {name: '定额价调整', value: '', type: TYPE.DECIMAL, required: true}, //todo
|
|
|
+ {name: '定额价调整', value: source.adjPrice, type: TYPE.DECIMAL, required: true},
|
|
|
{name: '市场价', value: source.marketPrice, type: TYPE.DECIMAL, required: true},
|
|
|
{name: '数量', value: source.quantity, type: TYPE.DECIMAL, required: true},
|
|
|
{name: '产地', value: source.originPlace, maxLen: 255},
|
|
|
@@ -702,6 +751,59 @@ const XMLStandard = (function () {
|
|
|
];
|
|
|
element.call(this, '人材机配比', attrs);
|
|
|
}
|
|
|
+ //评标材料表定义
|
|
|
+ function EvalBidMaterial() {
|
|
|
+ element.call(this, '评标材料表', []);
|
|
|
+ }
|
|
|
+ //暂估价材料表定义
|
|
|
+ function EvalEstimateMaterial() {
|
|
|
+ element.call(this, '暂估价材料表', []);
|
|
|
+ }
|
|
|
+ //材料明细定义
|
|
|
+ function MaterialDetail(source) {
|
|
|
+ let attrs = [
|
|
|
+ {name: '序号', value: source.serialNo, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
+ {name: '关联材料号', value: source.orgCode, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
+ {name: '材料名称', value: source.name, minLen: 1, maxLen: 255, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
+ {name: '规格型号', value: source.specs, maxLen: 255},
|
|
|
+ {name: '计量单位', value: source.unit, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
+ {name: '数量', value: source.quantity, type: TYPE.DECIMAL},
|
|
|
+ {name: '单价', value: source.marketPrice, type: TYPE.DECIMAL},
|
|
|
+ {name: '合价', value: source.totalPrice, type: TYPE.NUM2},
|
|
|
+ {name: '产地', value: source.originPlace, maxLen: 255},
|
|
|
+ {name: '厂家', value: source.vender, maxLen: 255},
|
|
|
+ {name: '品牌', value: source.brand, maxLen: 255},
|
|
|
+ {name: '质量等级', value: source.qualityGrace, maxLen: 255},
|
|
|
+ {name: '备注', value: source.remark, maxLen: 255},
|
|
|
+ ];
|
|
|
+ element.call(this, '材料明细', attrs);
|
|
|
+ }
|
|
|
+ //清单综合单价计算程序定义
|
|
|
+ function CalcProgram() {
|
|
|
+ element.call(this, '清单综合单价计算程序', []);
|
|
|
+ }
|
|
|
+ //综合单价计算程序文件定义
|
|
|
+ function CalcProgramFile(source) {
|
|
|
+ let attrs = [
|
|
|
+ {name: 'ID', value: source.ID, type: TYPE.INT, required: true},
|
|
|
+ {name: '名称', value: source.name, minLen: 1, maxLen: 255, whiteSpace: WHITE_SPACE.COLLAPSE, required: true}
|
|
|
+ ];
|
|
|
+ element.call(this, '综合单价计算程序文件', attrs);
|
|
|
+ }
|
|
|
+ //综合单价计算程序费用项定义
|
|
|
+ function CalcProgramFeeItem(source) {
|
|
|
+ let attrs = [
|
|
|
+ {name: '序号', value: source.serialNo, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
+ {name: '行代号', value: source.rowCode, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
+ {name: '项目名称', value: source.name, minLen: 1, maxLen: 255, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
+ {name: '计算基础表达式', value: source.calcBase, maxLen: 255, required: true},
|
|
|
+ {name: '计算基础说明', value: source.statement, maxLen: 255},
|
|
|
+ {name: '费率', value: source.feeRate, type: TYPE.DECIMAL},
|
|
|
+ {name: '费用类别', value: source.feeType, type: TYPE.INT, required: true},
|
|
|
+ {name: '备注', value: source.remark, maxLen: 255},
|
|
|
+ ];
|
|
|
+ element.call(this, '综合单价计算程序费用项', attrs);
|
|
|
+ }
|
|
|
//主要清单汇总定义
|
|
|
function MainBillsSummary() {
|
|
|
element.call(this, '主要清单汇总', []);
|
|
|
@@ -720,6 +822,21 @@ const XMLStandard = (function () {
|
|
|
];
|
|
|
element.call(this, '主要清单明细', attrs);
|
|
|
}
|
|
|
+ //评审材料汇总定义
|
|
|
+ function AppraisalSummary(){
|
|
|
+ element.call(this, '评审材料汇总', []);
|
|
|
+ }
|
|
|
+ //评审材料明细定义
|
|
|
+ function AppraisalDetail(source) {
|
|
|
+ let attrs = [
|
|
|
+ {name: '代码', value: source.orgCode, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
+ {name: '名称', value: source.name, minLen: 1, maxLen: 255, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
+ {name: '规格', value: source.specs, maxLen: 255},
|
|
|
+ {name: '单位', value: source.unit, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE, required: true},
|
|
|
+ {name: '市场价', value: source.marketPrice, type: TYPE.DECIMAL, required: true}
|
|
|
+ ];
|
|
|
+ element.call(this, '评审材料明细', attrs);
|
|
|
+ }
|
|
|
|
|
|
async function setTimeoutSync(handle, time) {
|
|
|
return new Promise(function(resolve, reject) {
|
|
|
@@ -858,7 +975,13 @@ const XMLStandard = (function () {
|
|
|
engData.children = sortByNext(engData.children);
|
|
|
}
|
|
|
//标段
|
|
|
- let project = curProjectEle = new Project({basicInformation: projectData.property.basicInformation, name: projectData.name});
|
|
|
+ let project = new Project({
|
|
|
+ basicInformation: projectData.property.basicInformation,
|
|
|
+ name: projectData.name,
|
|
|
+ fileKind: projectData.property.fileKind ? FILE_KIND[projectData.property.fileKind] : '',
|
|
|
+ taxType: projectData.property.taxType ? TAX_TYPE[projectData.property.taxType] : ''
|
|
|
+ });
|
|
|
+ curProjectEle = project;
|
|
|
//项目信息
|
|
|
let projectInfo = new ProjectInfo({basicInformation: projectData.property.basicInformation});
|
|
|
project.children.push(projectInfo);
|
|
|
@@ -881,18 +1004,31 @@ const XMLStandard = (function () {
|
|
|
project.children.push(feeForm);
|
|
|
//主要清单汇总 主要清单明细在loadTender中设置
|
|
|
let mainBillsSummaryEle = new MainBillsSummary();
|
|
|
- project.children.unshift(mainBillsSummaryEle); //插入到第一个位置,必须要排在loadTender前,这样才能添加到明细数据,插在第一位方便后面排序
|
|
|
+ project.children.unshift(mainBillsSummaryEle); //必须要排在loadTender前,这样才能添加到明细数据
|
|
|
+ //评审材料汇总 评审材料明细在loadTender中设置
|
|
|
+ let appraisalSummary = new AppraisalSummary();
|
|
|
+ project.children.unshift(appraisalSummary);
|
|
|
//单项工程
|
|
|
for (let eng of projectData.children) {
|
|
|
curPMData.engineering = eng;
|
|
|
let engElement = await loadEngineering(projectData.summaryInfo, eng);
|
|
|
project.children.push(engElement);
|
|
|
}
|
|
|
- //主要清单汇总 排在后面
|
|
|
- project.children.shift(mainBillsSummaryEle);
|
|
|
- project.children.push(mainBillsSummaryEle);
|
|
|
+ //主要清单汇总、评审材料汇总 排在后面
|
|
|
+ project.children = [...project.children.slice(2), mainBillsSummaryEle, appraisalSummary];
|
|
|
return project;
|
|
|
}
|
|
|
+ //单位工程内的人材机ID: 用于代码映射关系 //单位工程级别,C+数组下标 <==> gljID
|
|
|
+ let tenderGljs = [];
|
|
|
+ //获取人材机代码,eg: C0, C1....
|
|
|
+ function getGljCode(gljID) {
|
|
|
+ let idx = tenderGljs.findIndex(ID => ID === gljID);
|
|
|
+ if (~idx) {
|
|
|
+ return `C${idx}`;
|
|
|
+ }
|
|
|
+ tenderGljs.push(gljID);
|
|
|
+ return `C${tenderGljs.length - 1}`;
|
|
|
+ }
|
|
|
/*
|
|
|
* 加载单项工程数据
|
|
|
* @param {Object}summaryInfo(项目汇总信息映射) {Object}engData(单项工程数据)
|
|
|
@@ -902,11 +1038,15 @@ const XMLStandard = (function () {
|
|
|
let engineering = new Engineering(source);
|
|
|
//单项工程编号要唯一
|
|
|
checkUnique(curProjectEle.constraints.engCode, source.code, '单项工程编号');
|
|
|
+ //费用构成
|
|
|
+ /*let feeForm = new FeeFrom(summaryInfo[engData.ID]);
|
|
|
+ engineering.children.push(feeForm);*/
|
|
|
//分批次获取单位工程
|
|
|
for (let tenderData of engData.children) {
|
|
|
curPMData.tender = tenderData;
|
|
|
await setTimeoutSync(() => {},TIMEOUT_TIME); //间隔一段时间再初始单位工程数据,减少服务器压力
|
|
|
let tender = await loadTender(summaryInfo, tenderData);
|
|
|
+ tenderGljs = []; //清空单位工程内所有的人材机(ID)
|
|
|
engineering.children.push(tender);
|
|
|
}
|
|
|
return engineering;
|
|
|
@@ -929,6 +1069,10 @@ const XMLStandard = (function () {
|
|
|
tenderDetail.rationLibMap[lib.id] = lib;
|
|
|
}
|
|
|
}
|
|
|
+ //初始化项目人材机代号(人材机生成的代号要由排序后的项目人材机从C0开始生成),定额下的人材机含量提前使用到了这个代码,所以需要先初始化
|
|
|
+ let allGljs = gljUtil.sortRationGLJ(tenderDetail.projectGLJ.datas.gljList); //人材机汇总排序
|
|
|
+ tenderGljs = allGljs.map(glj => glj.glj_id);
|
|
|
+
|
|
|
//单位工程
|
|
|
let tenderSource = {
|
|
|
code: getIncreamentData('projectCode'),
|
|
|
@@ -964,10 +1108,26 @@ const XMLStandard = (function () {
|
|
|
//规费和税金清单
|
|
|
let chargeTax = loadChargeTax(tenderDetail);
|
|
|
tender.children.push(chargeTax);
|
|
|
+ //建设项目下评审材料汇总设置评审材料明细
|
|
|
+ let curAppraisalSummary = curProjectEle.children.find(ele => ele.name === '评审材料汇总');
|
|
|
//人材机汇总
|
|
|
- let gljSummary = loadGlj(tenderDetail);
|
|
|
- if (gljSummary) {
|
|
|
+ let gljSumarryInfo = loadGlj(curAppraisalSummary, tenderDetail);
|
|
|
+ if (gljSumarryInfo) {
|
|
|
+ let {gljSummary, evalBidMaterial, evalEstimateMaterial} = gljSumarryInfo;
|
|
|
tender.children.push(gljSummary);
|
|
|
+ //评标材料表
|
|
|
+ if (evalBidMaterial && evalBidMaterial.children.length) {
|
|
|
+ tender.children.push(evalBidMaterial);
|
|
|
+ }
|
|
|
+ //暂估价材料表
|
|
|
+ if (evalEstimateMaterial && evalEstimateMaterial.children.length) {
|
|
|
+ tender.children.push(evalEstimateMaterial);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //清单综合单价计算程序
|
|
|
+ let calcProgram = loadCalcProgram(tenderDetail);
|
|
|
+ if (calcProgram) {
|
|
|
+ tender.children.push(calcProgram);
|
|
|
}
|
|
|
//给建设项目下主要清单汇总设置主要清单明细
|
|
|
let curMainBillsSummary = curProjectEle.children.find(ele => ele.name === '主要清单汇总');
|
|
|
@@ -995,9 +1155,9 @@ const XMLStandard = (function () {
|
|
|
rowCode: `F${serialNo}`,
|
|
|
name: node.data.name,
|
|
|
calcBase: node.data.calcBase,
|
|
|
- feeRate: node.data.feeRate,
|
|
|
+ feeRate: node.data.feeRate !== '' ? node.data.feeRate : 100,
|
|
|
fees: node.data.fees,
|
|
|
- feeType: FEE_TYPE[flag],
|
|
|
+ feeType: FEE_TYPE[flag] || FEE_TYPE['0'],
|
|
|
remark: node.data.remark
|
|
|
};
|
|
|
let dxfy = new DXFYRow(source);
|
|
|
@@ -1092,6 +1252,24 @@ const XMLStandard = (function () {
|
|
|
}
|
|
|
}
|
|
|
loadFeatureContent();
|
|
|
+ //解析工程量计算式
|
|
|
+ function parseQuantityExp(rationData) {
|
|
|
+ if (rationData.quantityEXP === 'QDL') { //取清单工程量
|
|
|
+ return node.data.quantity;
|
|
|
+ } else if (rationData.quantityEXP === 'GCLMXHJ') { //从明细汇总成数值
|
|
|
+ let referDetail = detail.quantity_detail.datas.filter(data => data.rationID === rationData.ID && data.isSummation);
|
|
|
+ if (referDetail.length === 0) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ let rst = 0;
|
|
|
+ for (let d of referDetail) {
|
|
|
+ rst = scMathUtil.roundForObj(rst + d.result, detail.projectInfo.property.decimal.process);
|
|
|
+ }
|
|
|
+ return scMathUtil.roundForObj(rst, detail.projectInfo.property.decimal.ration.quantity);
|
|
|
+ } else {
|
|
|
+ return rationData.quantityEXP;
|
|
|
+ }
|
|
|
+ }
|
|
|
/*
|
|
|
* 加载定额子目
|
|
|
* @param {Array}rationData(清单项目下定额数据) {Array}rationGljData(定额的人材机数据) {Object}decimal(项目小数位数)
|
|
|
@@ -1105,17 +1283,31 @@ const XMLStandard = (function () {
|
|
|
if (rationData.adjustState) {
|
|
|
viewCode += '换';
|
|
|
}
|
|
|
+ //子目类型 补充定额为“1”,标准定额无换算为“0”,标准定额有换算为“2”,安装费用,即自动生成的安装子目,为“3”,子目级人材机,即量价、与定额同级的人材机 其他待完善……
|
|
|
+ let subType;
|
|
|
+ if (rationData.type === rationType.ration && rationData.from === 'cpt') {
|
|
|
+ subType = '1';
|
|
|
+ } else if (rationData.type === rationType.ration && !rationData.adjustState) {
|
|
|
+ subType = '0';
|
|
|
+ } else if (rationData.type === rationType.ration && rationData.adjustState) {
|
|
|
+ subType = '2';
|
|
|
+ } else if (rationData.type === rationType.install) {
|
|
|
+ subType = '3';
|
|
|
+ } else if (rationData.type === rationType.volumePrice) {
|
|
|
+ subType = '6';
|
|
|
+ }
|
|
|
let rationSource = {
|
|
|
viewCode: viewCode,
|
|
|
name: rationData.name,
|
|
|
unit: rationData.unit,
|
|
|
libCode: '',
|
|
|
code: rationData.code,
|
|
|
- subType: 1,
|
|
|
+ subType: subType,
|
|
|
quantity: rationData.quantity,
|
|
|
- quantityEXP: rationData.quantityEXP,
|
|
|
+ quantityEXP: parseQuantityExp(rationData),
|
|
|
fees: rationData.fees,
|
|
|
isSubcontract: rationData.isSubcontract,
|
|
|
+ programID: rationData.programID,
|
|
|
remark: rationData.remark
|
|
|
};
|
|
|
if (rationData.from === 'std' && isDef(rationData.libID)) { //来自标准库,设置定额库编码
|
|
|
@@ -1129,7 +1321,8 @@ const XMLStandard = (function () {
|
|
|
rationGljData = gljUtil.sortRationGLJ(rationGljData);
|
|
|
for (let rGlj of rationGljData) {
|
|
|
let gljSource = {
|
|
|
- code: rGlj.code,
|
|
|
+ //code: rGlj.code,
|
|
|
+ code: getGljCode(rGlj.GLJID),
|
|
|
quantity: rGlj.quantity,
|
|
|
totalQuantity: gljUtil.getTotalQuantity(rGlj, rationData, decimal.glj.quantity, decimal.ration.quantity)
|
|
|
};
|
|
|
@@ -1167,9 +1360,6 @@ const XMLStandard = (function () {
|
|
|
failList.push('不存在分部分项清单');
|
|
|
return fbfxBills;
|
|
|
}
|
|
|
- if (subEngNode.children.length === 0) {
|
|
|
- failList.push('分部分项清单下必须要有清单分部或清单项目');
|
|
|
- }
|
|
|
for (let node of subEngNode.children) {
|
|
|
if (node.data.type === billType.FB) {
|
|
|
if (node.children.length === 0) {
|
|
|
@@ -1246,10 +1436,10 @@ const XMLStandard = (function () {
|
|
|
code: node.data.code,
|
|
|
name: node.data.name,
|
|
|
calcBase: node.data.calcBase,
|
|
|
- feeRate: node.data.feeRate,
|
|
|
+ feeRate: node.data.feeRate !== '' ? node.data.feeRate : 100,
|
|
|
fees: node.data.fees,
|
|
|
remark: node.data.remark,
|
|
|
- feeType: FEE_TYPE[fixedFlag.CONSTRUCTION_ORGANIZATION]
|
|
|
+ feeType: FEE_TYPE[getNodeFlag(node)] || FEE_TYPE['0']
|
|
|
};
|
|
|
let formula = new FormulaCalcMeasure(source);
|
|
|
parent.children.push(formula);
|
|
|
@@ -1296,9 +1486,10 @@ const XMLStandard = (function () {
|
|
|
otherEle.children.push(loadEngEstimate(engEstimateNode));
|
|
|
}
|
|
|
//添加计日工元素
|
|
|
+ debugger;
|
|
|
let dayWorkNode = detail.Bills.tree.items.find(node => getNodeFlag(node) === fixedFlag.DAYWORK);
|
|
|
- let dayWorkEle = new DayWorkItem({fees: dayWorkNode.data.fees});
|
|
|
- if (dayWorkNode && dayWorkNode.children.length > 0) {
|
|
|
+ let dayWorkEle = new DayWork({fees: dayWorkNode.data.fees});
|
|
|
+ if (dayWorkNode && dayWorkNode.children.length > 0) {
|
|
|
//要显示计日工元素,人工、材料、施工机械,最少有一条含有子项(计日工项目)
|
|
|
let filterNodes = dayWorkNode.children.filter(node => [fixedFlag.LABOUR, fixedFlag.MATERIAL, fixedFlag.MACHINE].includes(getNodeFlag(node)));
|
|
|
for (let fNode of filterNodes) {
|
|
|
@@ -1446,8 +1637,10 @@ const XMLStandard = (function () {
|
|
|
} else { //总承包服务费费用项
|
|
|
let source = {
|
|
|
code: node.data.code,
|
|
|
+ name: node.data.name,
|
|
|
serviceContent: node.data.serviceContent,
|
|
|
- feeRate: node.data.feeRate,
|
|
|
+ calcBaseValue: node.data.calcBaseValue,
|
|
|
+ feeRate: node.data.feeRate !== '' ? node.data.feeRate : 100,
|
|
|
fees: node.data.fees,
|
|
|
remark: node.data.remark
|
|
|
};
|
|
|
@@ -1483,8 +1676,9 @@ const XMLStandard = (function () {
|
|
|
code: node.data.code,
|
|
|
name: node.data.name,
|
|
|
calcBase: node.data.calcBase,
|
|
|
- feeRate: node.data.feeRate,
|
|
|
+ feeRate: node.data.feeRate !== '' ? node.data.feeRate : 100,
|
|
|
commonTotalFee: totalFee,
|
|
|
+ notSummary: belongFlag && belongFlag === fixedFlag.MATERIAL_PROVISIONAL, //不计入合价,只有材料(工程设备)暂估价固定节点
|
|
|
remark: node.data.remark
|
|
|
});
|
|
|
otherItems.push(otherItemEle);
|
|
|
@@ -1521,9 +1715,9 @@ const XMLStandard = (function () {
|
|
|
rowCode: `F${serialNo}`,
|
|
|
name: node.data.name,
|
|
|
calcBase: node.data.calcBase,
|
|
|
- feeRate: node.data.feeRate,
|
|
|
+ feeRate: node.data.feeRate !== '' ? node.data.feeRate : 100,
|
|
|
fees: node.data.fees,
|
|
|
- feeType: FEE_TYPE[getNodeFlag(node)],
|
|
|
+ feeType: FEE_TYPE[getNodeFlag(node)] || FEE_TYPE['0'],
|
|
|
remark: node.data.remark
|
|
|
};
|
|
|
//序号唯一
|
|
|
@@ -1538,7 +1732,10 @@ const XMLStandard = (function () {
|
|
|
* @return {void}
|
|
|
* */
|
|
|
function loadMainBillsItems(parent, detail) {
|
|
|
- let mainBills = detail.Bills.datas.filter(data => data.mainBills);
|
|
|
+ let mainBills = detail.Bills.datas.filter(data => {
|
|
|
+ let billsNode = detail.Bills.tree.nodes[`${detail.Bills.tree.prefix}${data.ID}`];
|
|
|
+ return data.mainBills && billsNode && billsNode.children.length === 0;
|
|
|
+ });
|
|
|
for (let bills of mainBills) {
|
|
|
let source = {
|
|
|
code: bills.code,
|
|
|
@@ -1555,31 +1752,72 @@ const XMLStandard = (function () {
|
|
|
}
|
|
|
}
|
|
|
/*
|
|
|
- * 加载人材机汇总
|
|
|
- * @param {Object}detail
|
|
|
+ * 加载人材机汇总相关:人材机汇总、评标、暂估
|
|
|
+ * @param {Object}appraisalSummary(建设项目下的评审材料汇总) {Object}detail
|
|
|
* @return {Object}
|
|
|
* */
|
|
|
- function loadGlj(detail) {
|
|
|
+ function loadGlj(appraisalSummary, detail) {
|
|
|
let gljList = detail.projectGLJ.datas.gljList;
|
|
|
+ let evalBidSeq = 1, //评标序号
|
|
|
+ evalEstSeq = 1; //暂估序号
|
|
|
if (gljList.length > 0) {
|
|
|
//创建人材机汇总节点
|
|
|
let gljSummary = new GljSummary();
|
|
|
+ //创建评标材料表节点
|
|
|
+ let evalBidMaterial = new EvalBidMaterial();
|
|
|
+ //创建暂估价材料表节点
|
|
|
+ let evalEstimateMaterial = new EvalEstimateMaterial();
|
|
|
//人材机节点
|
|
|
let allGljs = gljUtil.sortRationGLJ(gljList); //人材机汇总排序
|
|
|
//计算总消耗量
|
|
|
gljUtil.calcProjectGLJQuantity(detail.projectGLJ.datas,
|
|
|
detail.ration_glj.datas, detail.Ration.datas, detail.Bills.datas, curPMData.tender.property.decimal.glj.quantity, _, scMathUtil);
|
|
|
+ //类型-配比类别映射
|
|
|
+ let ratioMapping = {
|
|
|
+ '202': '1', //为“混凝土”时,取“1”;
|
|
|
+ '205': '2', //为“商品混凝土”时,取“2”;
|
|
|
+ '203': '3', //为“砂浆”时,取“3”;
|
|
|
+ '206': '4', //为“商品砂浆”时,取“4”;
|
|
|
+ '204': '5' //为“配合比”时,取“5”
|
|
|
+ };
|
|
|
+ //三材类别-主要材料类别映射 三材类型:钢材1、钢筋2、木材3、水泥4、商品砼5、商品砂浆6
|
|
|
+ let mainMaterialMapping = {
|
|
|
+ '1': '100', //为“钢材”、“钢筋”时,取“100”;
|
|
|
+ '2': '100',
|
|
|
+ '4': '200', //为“水泥”时,取“200”;
|
|
|
+ '3': '300', //为“木材”时,取“300”;
|
|
|
+ '5': '400', //为“商品砼”、商品砂浆”时,取“400”。
|
|
|
+ '6': '400'
|
|
|
+ };
|
|
|
for (let glj of allGljs) {
|
|
|
+ //gljUtil.getAdjustPrice(glj,proGLJ.datas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil);
|
|
|
let price = gljUtil.getGLJPrice(glj, detail.projectGLJ.datas,
|
|
|
curPMData.tender.property.calcOptions, detail.labourCoe.datas, curPMData.tender.property.decimal, false, _, scMathUtil);
|
|
|
+ //调整价
|
|
|
+ let adjPrice = gljUtil.getAdjustPrice(glj, detail.projectGLJ.datas,
|
|
|
+ curPMData.tender.property.calcOptions, detail.labourCoe.datas, curPMData.tender.property.decimal, false, _, scMathUtil);
|
|
|
+ //获取人材机费用类别: 1=人工费 2=材料费 3=机械费 4=未计价费
|
|
|
+ let feeType = glj.type.toString()[0];
|
|
|
+ if (feeType && !['1', '2', '3'].includes(feeType)) {
|
|
|
+ feeType = '4';
|
|
|
+ }
|
|
|
let gljSource = {
|
|
|
- code: glj.code,
|
|
|
+ //code: glj.code,
|
|
|
+ code: getGljCode(glj.glj_id),
|
|
|
name: glj.name,
|
|
|
- spec: glj.spec,
|
|
|
+ specs: glj.specs,
|
|
|
unit: glj.unit,
|
|
|
- orgCode: glj.original_code,
|
|
|
- is_evaluate: glj.is_evaluate,
|
|
|
- basePrice: price.base,
|
|
|
+ orgCode: glj.code, //不取原始编码了,直接取编码
|
|
|
+ feeType: feeType,
|
|
|
+ ratioType: ratioMapping[glj.type],
|
|
|
+ mainMaterialType: mainMaterialMapping[glj.materialType],
|
|
|
+ materialCoe: glj.materialCoe,
|
|
|
+ supply: glj.supply === 2 ? 2 : 1, //供货方式为“完全甲供”,取“2”;否则取“1”。
|
|
|
+ is_evaluate: !!glj.is_evaluate,
|
|
|
+ no_tax_eqp: !!glj.no_tax_eqp,
|
|
|
+ notFromDetail: !glj.ratio_data.length, //单价不从明细汇总标志,如果有配比组成,取“false”;否则取“true”。
|
|
|
+ basePrice: price.basePrice,
|
|
|
+ adjPrice: adjPrice,
|
|
|
marketPrice: price.marketPrice,
|
|
|
quantity: glj.quantity,
|
|
|
originPlace: glj.originPlace,
|
|
|
@@ -1596,14 +1834,73 @@ const XMLStandard = (function () {
|
|
|
ratioData = detail.projectGLJ.datas.mixRatioMap[connectKey];
|
|
|
if (ratioData && Array.isArray(ratioData)) {
|
|
|
for (let ratio of ratioData) {
|
|
|
- let gljRatio = new GljRatio({code: ratio.code, quantity: ratio.consumption});
|
|
|
+ let gljRatio = new GljRatio({code: getGljCode(ratio.glj_id), quantity: ratio.consumption});
|
|
|
gljEle.children.push(gljRatio);
|
|
|
}
|
|
|
}
|
|
|
gljSummary.children.push(gljEle);
|
|
|
+ gljSource.totalPrice = scMathUtil.roundForObj(gljSource.quantity * gljSource.marketPrice,
|
|
|
+ detail.projectInfo.property.decimal.bills.totalPrice);
|
|
|
+ //评标和暂估材料表下的材料明细中的人材机代码,要求单位工程内唯一,由于人材机汇总也有这个限制,所以这里不再处理
|
|
|
+ if (glj.is_eval_material) { //评标
|
|
|
+ gljSource.serialNo = evalBidSeq++;
|
|
|
+ evalBidMaterial.children.push(new MaterialDetail(gljSource));
|
|
|
+ //给建设项目下的评审材料汇总设置明细数据,这里需要检测代码(编号)唯一性,因为是汇总所有单位工程的,要求所有单位工程内评审材料代码唯一
|
|
|
+ appraisalSummary.children.push(new AppraisalDetail(gljSource));
|
|
|
+ checkUnique(curTenderEle.constraints.appraisalDetailCode, gljSource.code, '评审材料明细代码');
|
|
|
+ }
|
|
|
+ if (glj.is_evaluate) { //暂估
|
|
|
+ gljSource.serialNo = evalEstSeq++;
|
|
|
+ evalEstimateMaterial.children.push(new MaterialDetail(gljSource));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {gljSummary, evalBidMaterial, evalEstimateMaterial};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * 加载清单综合单价计算程序
|
|
|
+ * */
|
|
|
+ function loadCalcProgram(detail) {
|
|
|
+ let calcProgram = detail.calcProgram;
|
|
|
+ if (!calcProgram) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ let calcProramTemplates = calcProgram.templates;
|
|
|
+ if (!Array.isArray(calcProramTemplates) || calcProramTemplates.length === 0) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ //创建清单综合单价计算程序
|
|
|
+ let calcProgramEle = new CalcProgram();
|
|
|
+ //创建综合单价计算程序文件
|
|
|
+ for (let calcFile of calcProramTemplates) {
|
|
|
+ let calcFileEle = new CalcProgramFile({ID: calcFile.ID, name: calcFile.name});
|
|
|
+ //创建计算程序费用项
|
|
|
+ for (let calcItem of calcFile.calcItems) {
|
|
|
+ let idx = calcFile.calcItems.indexOf(calcItem);
|
|
|
+ //如果是有[]的基数则转换为其简称,如“[定额人工费]”对应的检查是"RGF"
|
|
|
+ let calcBase = calcItem.dispExpr.replace(/\[[\u4e00-\u9fa5]+\]/g, str => rationBaseShort[str] ? rationBaseShort[str] : '');
|
|
|
+ let feeType = calcProgram.feeTypes.find(data => data.type === calcItem.fieldName);
|
|
|
+ if (feeType) {
|
|
|
+ feeType = feeType.code;
|
|
|
+ }
|
|
|
+ let source = {
|
|
|
+ serialNo: idx + 1,
|
|
|
+ rowCode: `F${idx + 1}`,
|
|
|
+ name: calcItem.name,
|
|
|
+ calcBase: calcBase,
|
|
|
+ statement: calcItem.statement,
|
|
|
+ feeRate: calcItem.feeRate !== '' ? calcItem.feeRate : 100,
|
|
|
+ feeType: feeType,
|
|
|
+ remark: calcItem.memo
|
|
|
+ };
|
|
|
+ let calcItemEle = new CalcProgramFeeItem(source);
|
|
|
+ calcFileEle.children.push(calcItemEle);
|
|
|
+ }
|
|
|
+ if (calcFileEle.children.length > 0) { //计算程序文件必须有费用项
|
|
|
+ calcProgramEle.children.push(calcFileEle);
|
|
|
}
|
|
|
- return gljSummary;
|
|
|
}
|
|
|
+ return calcProgramEle.children.length > 0 ? calcProgramEle : null;
|
|
|
}
|
|
|
//开始标签
|
|
|
function startTag(ele) {
|
|
|
@@ -1669,11 +1966,13 @@ const XMLStandard = (function () {
|
|
|
}
|
|
|
/*
|
|
|
* 导出数据
|
|
|
- * @param {Number}tenderID(当前界面的单位工程ID,后台根据这个单位工程,去找其建设项目下所有数据)
|
|
|
+ * @param {Number}tenderID(当前界面的单位工程ID,后台根据这个单位工程,根据导出粒度去找其建设项目下相关数据)
|
|
|
* @return {void}
|
|
|
* */
|
|
|
this.toXml = async function (tenderID) {
|
|
|
let eleData = await loadProject(tenderID);
|
|
|
+ this.datas = eleData;
|
|
|
+ //console.log(eleData);
|
|
|
if (!eleData) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -1683,8 +1982,8 @@ const XMLStandard = (function () {
|
|
|
xmlStr = `<?xml version="1.0" encoding="utf-8"?>${xmlStr}`;
|
|
|
//格式化
|
|
|
xmlStr = formatXml(xmlStr);
|
|
|
- let blob = new Blob([xmlStr], {type: 'text/plain;charset=uft-8'});
|
|
|
- saveAs(blob, '重庆标准交换数据.xml');
|
|
|
+ let blob = new Blob([xmlStr], {type: 'text/plain;charset=utf-8'});
|
|
|
+ saveAs(blob, '重庆标准交换数据.qtf');
|
|
|
}
|
|
|
}
|
|
|
})();
|