|
|
@@ -21,6 +21,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
getHan,
|
|
|
getFee,
|
|
|
getUnitFee,
|
|
|
+ getNodeByFlag,
|
|
|
generateHardwareId,
|
|
|
},
|
|
|
Element,
|
|
|
@@ -96,11 +97,11 @@ INTERFACE_EXPORT = (() => {
|
|
|
return getMarketPrice(glj);
|
|
|
}
|
|
|
|
|
|
+ const subTypeKeyArr = ['code', 'name', 'specs', 'unit', 'subType']
|
|
|
+
|
|
|
// 获取人工消耗量
|
|
|
const getLabourQuantity = (node) => {
|
|
|
- if (!+node.data.quantity) {
|
|
|
- return 0;
|
|
|
- }
|
|
|
+ const quantity = +node.data.quantity || 1;
|
|
|
let total = 0;
|
|
|
const posterity = node.getPosterity();
|
|
|
const rations = posterity.filter(item => calcTools.isRationItem(item));
|
|
|
@@ -114,7 +115,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
labourRations.forEach(labour => {
|
|
|
total = scMathUtil.roundForObj(total + +labour.data.tenderQuantity, qD);
|
|
|
});
|
|
|
- return total / +node.data.quantity;
|
|
|
+ return total / quantity;
|
|
|
}
|
|
|
|
|
|
// 获取主材费、辅材费
|
|
|
@@ -123,10 +124,8 @@ INTERFACE_EXPORT = (() => {
|
|
|
mainFee: 0,
|
|
|
assFee: 0,
|
|
|
};
|
|
|
- const quantity = calcTools.isBill(node) ? node.data.quantity : node.data.tenderQuantity;
|
|
|
- if (!+quantity) {
|
|
|
- return rst;
|
|
|
- }
|
|
|
+ let quantity = calcTools.isBill(node) ? node.data.quantity : node.data.tenderQuantity;
|
|
|
+ quantity = +quantity || 1;
|
|
|
const posterity = calcTools.isBill(node) ? node.getPosterity() : [node];
|
|
|
// 计算定额下的费用(限定材料)
|
|
|
const rations = posterity.filter(item => calcTools.isRationItem(item));
|
|
|
@@ -150,7 +149,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
// 计算工料机类型定额、量价(限定材料)
|
|
|
const materialRations = posterity.filter(item => calcTools.isGljRation(item) && isMaterial(item.data.subType));
|
|
|
materialRations.forEach(ration => {
|
|
|
- const key = gljUtil.getIndex(ration.data);
|
|
|
+ const key = gljUtil.getIndex(ration.data, subTypeKeyArr);
|
|
|
const projectGlj = curTender.projectGLJ.datas.gljMap[key];
|
|
|
if (projectGlj) {
|
|
|
if (projectGlj.is_main_material) {
|
|
|
@@ -242,7 +241,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
{ name: '总工期日历天', value: getValueByKey(info, 'timeLimit')},
|
|
|
{ name: '投标总价', value: constructionSummary.totalCost, type: TYPE.DECIMAL },
|
|
|
{ name: '投标下浮率', value: getValueByKey(info, 'downwardFloatingRateOfBid') },
|
|
|
- { name: '投标报价说明', value: getValueByKey(info, 'downwardFloatingRateOfBid') },
|
|
|
+ { name: '投标报价说明', value: getValueByKey(info, 'descriptionOfTenderOffer') },
|
|
|
{ name: '质量承诺', value: getValueByKey(info, 'qualityCommitment') },
|
|
|
{ name: '投标保证金', value: getValueByKey(info, 'bidBond') },
|
|
|
{ name: '项目经理或项目负责人', value: getValueByKey(info, 'projectManagers') },
|
|
|
@@ -285,26 +284,34 @@ INTERFACE_EXPORT = (() => {
|
|
|
|
|
|
// 获取清单章节
|
|
|
const getBillSection = (node) => {
|
|
|
- debugger;
|
|
|
- let cur = node;
|
|
|
- while (cur) {
|
|
|
- const sectionCode = (cur.data.name || '').replace(/[^0-9]/g, '');
|
|
|
- if (sectionCode) {
|
|
|
- return sectionCode;
|
|
|
+ const parentFlag = node.parent ? node.parent.getFlag() : null;
|
|
|
+ if (parentFlag !== fixedFlag.ONE_SEVEN_BILLS) {
|
|
|
+ let cur = node;
|
|
|
+ while (cur) {
|
|
|
+ if (cur.data.sectionCode) {
|
|
|
+ return cur.data.sectionCode;
|
|
|
+ }
|
|
|
+ cur = cur.parent;
|
|
|
}
|
|
|
- cur = cur.parent;
|
|
|
+ return (cur.data.name || '').replace(/[^0-9]/g, '');
|
|
|
+ } else {
|
|
|
+ const sectionCode = (node.data.name || '').replace(/[^0-9]/g, '');
|
|
|
+ node.data.sectionCode = sectionCode;
|
|
|
+ return sectionCode
|
|
|
}
|
|
|
- return '';
|
|
|
}
|
|
|
function GongCLQDMX(node) {
|
|
|
const { mainFee, assFee } = getMaterialFee(node);
|
|
|
const attrs = [
|
|
|
{name: '序号', value: billSeq ++ },
|
|
|
{name: 'GUID', value: node.data.ID },
|
|
|
- {name: '清单章节', value: getBillSection(node)},
|
|
|
+ {name: '清单章节', value: getBillSection(node), minLen: 1, enumeration: [
|
|
|
+ '100', '200', '300', '400', '500', '600', '700', '800', '900', '1000', '1100',
|
|
|
+ '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2000',
|
|
|
+ ]},
|
|
|
{name: '子目长编号', value: divideObj.getExeBillCode(node.data.ID, node. tree)},
|
|
|
- {name: '子目号', value: node.data.code},
|
|
|
- {name: '子目名称', value: node.data.name},
|
|
|
+ {name: '子目号', value: node.data.code, minLen: 1},
|
|
|
+ {name: '子目名称', value: node.data.name, minLen: 1},
|
|
|
{name: '单位', value: node.data.unit},
|
|
|
{name: '数量', value: node.data.quantity, type: TYPE.DECIMAL},
|
|
|
{name: '单价', value: getFee(node.data.fees, 'common.tenderUnitFee', exportKind), type: TYPE.DECIMAL},
|
|
|
@@ -317,15 +324,14 @@ INTERFACE_EXPORT = (() => {
|
|
|
{name: '主材费', value: mainFee, type: TYPE.DECIMAL},
|
|
|
{name: '辅材费', value: assFee, type: TYPE.DECIMAL},
|
|
|
{name: '设备费', value: getUnitFee(getFee(node.data.fees, 'equipment.tenderTotalFee', exportKind), node.data.quantity, fD), type: TYPE.DECIMAL},
|
|
|
- {name: '机械使用费', value: getFee(node.data.fees, 'machine.tenderTotalFee', exportKind), type: TYPE.DECIMAL},
|
|
|
+ {name: '机械使用费', value: getUnitFee(getFee(node.data.fees, 'machine.tenderTotalFee', exportKind), node.data.quantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '措施费1', value: getUnitFee(COMPILATION_NAME.includes('公路造价') ? getFee(node.data.fees, 'measure1.tenderTotalFee', exportKind) : getFee(node.data.fees, 'otherDirect.tenderTotalFee', exportKind), node.data.quantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '措施费2', value: getUnitFee(COMPILATION_NAME.includes('公路造价') ? getFee(node.data.fees, 'measure2.tenderTotalFee', exportKind) : getFee(node.data.fees, 'composite.tenderTotalFee', exportKind), node.data.quantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '企业管理费', value: getUnitFee(COMPILATION_NAME.includes('公路造价') ? getFee(node.data.fees, 'manage.tenderTotalFee', exportKind) : getFee(node.data.fees, 'local.tenderTotalFee', exportKind), node.data.quantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '规费', value: getUnitFee(COMPILATION_NAME.includes('公路造价') ? getFee(node.data.fees, 'force.tenderTotalFee', exportKind) : getFee(node.data.fees, 'indirect.tenderTotalFee', exportKind), node.data.quantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '利润', value: getUnitFee(getFee(node.data.fees, 'profit.tenderTotalFee', exportKind), node.data.quantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '税金', value: getUnitFee(getFee(node.data.fees, 'tax.tenderTotalFee', exportKind), node.data.quantity, fD), type: TYPE.DECIMAL},
|
|
|
- // TODO
|
|
|
- {name: '评审清单', value: '0'},
|
|
|
+ {name: '评审清单', value: isNaN(+node.data.appraisalBills) ? 0 : +node.data.appraisalBills},
|
|
|
];
|
|
|
Element.call(this, '工程量清单明细', attrs);
|
|
|
}
|
|
|
@@ -334,10 +340,10 @@ INTERFACE_EXPORT = (() => {
|
|
|
let mainMaterialSeq = 1;
|
|
|
function QDZCBMX(material) {
|
|
|
const attrs = [
|
|
|
- { name: '序号', value: mainMaterialSeq++ },
|
|
|
- { name: '材料编码', value: material.code },
|
|
|
- { name: '主材名称', value: material.name },
|
|
|
- { name: '单位', value: material.unit },
|
|
|
+ { name: '序号', value: mainMaterialSeq++, minLen: 1 },
|
|
|
+ { name: '材料编码', value: material.code, minLen: 1 },
|
|
|
+ { name: '主材名称', value: material.name, minLen: 1 },
|
|
|
+ { name: '单位', value: material.unit, minLen: 1 },
|
|
|
{ name: '主材消耗量', value: material.quantity, type: TYPE.DECIMAL },
|
|
|
{ name: '单价', value: material.unitPrice, type: TYPE.DECIMAL },
|
|
|
{ name: '合价', value: material.totalPrice , type: TYPE.DECIMAL},
|
|
|
@@ -359,8 +365,8 @@ INTERFACE_EXPORT = (() => {
|
|
|
{name: '序号', value: rationSeq ++ },
|
|
|
{name: 'GUID', value: node.data.ID },
|
|
|
{name: '定额编号', value: node.data.code},
|
|
|
- {name: '定额名称', value: node.data.name},
|
|
|
- {name: '单位', value: node.data.unit},
|
|
|
+ {name: '定额名称', value: node.data.name, minLen: 1 },
|
|
|
+ {name: '单位', value: node.data.unit, minLen: 1 },
|
|
|
{name: '数量', value: node.data.tenderQuantity, type: TYPE.DECIMAL},
|
|
|
{name: '单价', value: getFee(node.data.fees, 'common.tenderUnitFee', exportKind), type: TYPE.DECIMAL},
|
|
|
{name: '合价', value: getFee(node.data.fees, 'common.tenderTotalFee', exportKind), type: TYPE.DECIMAL},
|
|
|
@@ -370,7 +376,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
{name: '主材费', value: mainFee, type: TYPE.DECIMAL},
|
|
|
{name: '辅材费', value: assFee, type: TYPE.DECIMAL},
|
|
|
{name: '设备费', value: getUnitFee(getFee(node.data.fees, 'equipment.tenderTotalFee', exportKind), node.data.tenderQuantity, fD), type: TYPE.DECIMAL},
|
|
|
- {name: '机械使用费', value: getFee(node.data.fees, 'machine.tenderTotalFee', exportKind), type: TYPE.DECIMAL},
|
|
|
+ {name: '机械使用费', value: getUnitFee(getFee(node.data.fees, 'machine.tenderTotalFee', exportKind), node.data.tenderQuantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '措施费1', value: getUnitFee(COMPILATION_NAME.includes('公路造价') ? getFee(node.data.fees, 'measure1.tenderTotalFee', exportKind) : getFee(node.data.fees, 'otherDirect.tenderTotalFee', exportKind), node.data.tenderQuantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '措施费2', value: getUnitFee(COMPILATION_NAME.includes('公路造价') ? getFee(node.data.fees, 'measure2.tenderTotalFee', exportKind) : getFee(node.data.fees, 'composite.tenderTotalFee', exportKind), node.data.tenderQuantity, fD), type: TYPE.DECIMAL},
|
|
|
{name: '企业管理费', value: getUnitFee(COMPILATION_NAME.includes('公路造价') ? getFee(node.data.fees, 'manage.tenderTotalFee', exportKind) : getFee(node.data.fees, 'local.tenderTotalFee', exportKind), node.data.tenderQuantity, fD), type: TYPE.DECIMAL},
|
|
|
@@ -421,7 +427,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
const attrs = [
|
|
|
{name: '序号', value: hzSeq++ },
|
|
|
{name: '章次', value: getSection(node) },
|
|
|
- {name: '名称', value: node.data.name },
|
|
|
+ {name: '名称', value: node.data.name, minLen: 1 },
|
|
|
{name: '金额', value: getFee(node.data.fees, 'common.tenderTotalFee'), type: TYPE.DECIMAL },
|
|
|
{name: '类别', value: getLB(node) },
|
|
|
{name: '备注', value: node.data.remark },
|
|
|
@@ -454,16 +460,14 @@ INTERFACE_EXPORT = (() => {
|
|
|
if (glj.type === 4) {
|
|
|
return '7';
|
|
|
}
|
|
|
- if (glj.is_main_material) {
|
|
|
- return '8';
|
|
|
- }
|
|
|
+ return '2';
|
|
|
}
|
|
|
function RCJHZMXB(glj) {
|
|
|
const attrs = [
|
|
|
- {name: '人材机编号', value: glj.code },
|
|
|
- {name: '人材机名称', value: glj.name },
|
|
|
+ {name: '人材机编号', value: glj.code, minLen: 1 },
|
|
|
+ {name: '人材机名称', value: glj.name, minLen: 1 },
|
|
|
{name: '规格型号', value: glj.specs },
|
|
|
- {name: '单位', value: glj.unit },
|
|
|
+ {name: '单位', value: glj.unit, minLen: 1 },
|
|
|
{name: '数量', value: glj.tenderQuantity },
|
|
|
{name: '单价', value: glj.priceInfo.tenderPrice, type: TYPE.DECIMAL },
|
|
|
{name: '人材机类别', value: getGljLB(glj) },
|
|
|
@@ -566,7 +570,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
|
|
|
const gclqd = new Element('工程量清单表');
|
|
|
// 工程量清单明细为固定清单(第100章至700章清单)下所有清单
|
|
|
- const fixedNode = calcTools.getNodeByFlag(fixedFlag.ONE_SEVEN_BILLS)
|
|
|
+ const fixedNode = getNodeByFlag(curTender.mainTree, fixedFlag.ONE_SEVEN_BILLS)
|
|
|
gclqd.children.push(...setupGCLQDMX(fixedNode.children));
|
|
|
|
|
|
|
|
|
@@ -603,7 +607,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
}
|
|
|
function createJRGXXB() {
|
|
|
const jrgxxb = new Element('计日工信息表');
|
|
|
- const fixedNode = calcTools.getNodeByFlag(fixedFlag.DAYWORK_LABOR);
|
|
|
+ const fixedNode = getNodeByFlag(curTender.mainTree, fixedFlag.DAYWORK_LABOR);
|
|
|
function createJRG(node) {
|
|
|
// 计日工信息标题
|
|
|
const jrgxxbt = new Element('计日工信息标题', [
|
|
|
@@ -616,10 +620,10 @@ INTERFACE_EXPORT = (() => {
|
|
|
return jrgxxbt;
|
|
|
}
|
|
|
jrgxxbt.children = node.children.map(child => new Element('计日工信息明细', [
|
|
|
- { name: '编号', value: child.data.code },
|
|
|
- { name: '名称', value: child.data.name },
|
|
|
+ { name: '编号', value: child.data.code, minLen: 1 },
|
|
|
+ { name: '名称', value: child.data.name, minLen: 1 },
|
|
|
{ name: '数据类型', value: getJRGDataType(child) },
|
|
|
- { name: '单位', value: child.data.unit },
|
|
|
+ { name: '单位', value: child.data.unit, minLen: 1 },
|
|
|
{ name: '暂定数量', value: child.data.quantity, type: TYPE.DECIMAL },
|
|
|
{ name: '单价', value: getFee(child.data.fees, 'common.tenderUnitFee'), type: TYPE.DECIMAL },
|
|
|
{ name: '合价', value: getFee(child.data.fees, 'common.tenderTotalFee'), type: TYPE.DECIMAL },
|
|
|
@@ -656,8 +660,8 @@ INTERFACE_EXPORT = (() => {
|
|
|
function createGLBDGC(rawTender, seq){
|
|
|
// 标段属性
|
|
|
const tenderAttrs = [
|
|
|
- { name: '序号', value: seq },
|
|
|
- { name: '标段名称', value: rawTender.name },
|
|
|
+ { name: '序号', value: seq, minLen: 1 },
|
|
|
+ { name: '标段名称', value: rawTender.name, minLen: 1 },
|
|
|
{ name: '金额', value: isBidInvitation ? 0 : projectData.summaryInfo[rawTender.ID].totalCost },
|
|
|
{ name: '唯一标识-Guid', value: uuid.v1() }
|
|
|
];
|
|
|
@@ -712,6 +716,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
rationSeq = 1;
|
|
|
jrgSeq = 1;
|
|
|
hzSeq = 1;
|
|
|
+ debugger;
|
|
|
curTender = tenderDetailMap[tender.ID];
|
|
|
const {
|
|
|
gongLBDGC,
|