|
|
@@ -39,6 +39,9 @@ const XMLStandard = (function () {
|
|
|
//加载数据间隔,减少服务器压力
|
|
|
const TIMEOUT_TIME = 500;
|
|
|
|
|
|
+ function isDef(v) {
|
|
|
+ return typeof v !== 'undefined' && v !== null;
|
|
|
+ }
|
|
|
/*
|
|
|
* 检查
|
|
|
* 创建节点时检查节点的数据
|
|
|
@@ -386,7 +389,7 @@ const XMLStandard = (function () {
|
|
|
{name: '定额编号', value: source.viewCode, required: true, minLen: 1, maxLen: 80, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
{name: '项目名称', value: source.name, required: true, minLen: 1, maxLen: 255, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
{name: '单位', value: source.unit, required: true, minLen: 1, maxLen: 20, whiteSpace: WHITE_SPACE.COLLAPSE},
|
|
|
- {name: '定额库编码', value: source.libCode, required: true}, //todo
|
|
|
+ {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.quantity, required: true, type: TYPE.DECIMAL},
|
|
|
@@ -490,7 +493,7 @@ const XMLStandard = (function () {
|
|
|
//技术措施清单定义
|
|
|
function JSCSBills(source) {
|
|
|
let attrs = [
|
|
|
- {name: '技术措施清单', value: getFee(source.fees, 'common.totalFee'), type: TYPE.NUM2, required: true},
|
|
|
+ {name: '金额', value: getFee(source.fees, 'common.totalFee'), type: TYPE.NUM2, required: true},
|
|
|
{name: '其中暂估价', value: getFee(source.fees, 'estimate.totalFee'), type: TYPE.NUM2, required: true},
|
|
|
];
|
|
|
element.call(this, '技术措施清单', attrs);
|
|
|
@@ -633,7 +636,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: !!source.isEstimate, type: TYPE.BOOL},
|
|
|
+ {name: '不计入合价标志', value: false, type: TYPE.BOOL},
|
|
|
+ {name: '招标人标志', value: true, type: TYPE.BOOL},
|
|
|
{name: '备注', value: source.remark, maxLen: 255}
|
|
|
];
|
|
|
element.call(this, '其他列项', attrs);
|
|
|
@@ -916,13 +920,22 @@ const XMLStandard = (function () {
|
|
|
//获取单位工程详细数据
|
|
|
let tenderDetail = PROJECT.createNew(tenderData.ID, userID);
|
|
|
await tenderDetail.loadDataSync();
|
|
|
+ //设置定额库编码
|
|
|
+ tenderDetail.rationLibMap = {};
|
|
|
+ let defaultLib = null;
|
|
|
+ if (tenderDetail.projectInfo.engineeringInfo && Array.isArray(tenderDetail.projectInfo.engineeringInfo.ration_lib)) {
|
|
|
+ defaultLib = tenderDetail.projectInfo.engineeringInfo.ration_lib.find(data => data.isDefault);
|
|
|
+ for (let lib of tenderDetail.projectInfo.engineeringInfo.ration_lib) {
|
|
|
+ tenderDetail.rationLibMap[lib.id] = lib;
|
|
|
+ }
|
|
|
+ }
|
|
|
//单位工程
|
|
|
let tenderSource = {
|
|
|
code: getIncreamentData('projectCode'),
|
|
|
name: tenderData.name,
|
|
|
engineeringName: tenderData.property.engineeringName,
|
|
|
summaryInfo: summaryInfo[tenderData.ID],
|
|
|
- defaultRationLibCode: tenderData.defaultRationLibCode,
|
|
|
+ defaultRationLibCode: defaultLib.libCode,
|
|
|
taxType: tenderData.property.taxType
|
|
|
};
|
|
|
let tender = curTenderEle = new Tender(tenderSource);
|
|
|
@@ -994,9 +1007,12 @@ const XMLStandard = (function () {
|
|
|
}
|
|
|
/*
|
|
|
* 加载清单项目
|
|
|
- * @param {Object}node(清单树节点) {Array}allRation(项目所有定额数据) {Array}allRationGlj(项目所有定额人材机数据) {Object}decimal(项目小数位数)
|
|
|
+ * @param {Object}node(清单树节点) {Object}detail
|
|
|
* */
|
|
|
- function loadBills(node, allRation, allRationGlj, decimal) {
|
|
|
+ function loadBills(node, detail) {// allRation, allRationGlj, decimal,
|
|
|
+ let allRation = detail.Ration.datas,
|
|
|
+ allRationGlj = detail.ration_glj.datas,
|
|
|
+ decimal = detail.projectInfo.property.decimal;
|
|
|
let source = {
|
|
|
code: node.data.code,
|
|
|
name: node.data.name,
|
|
|
@@ -1102,6 +1118,9 @@ const XMLStandard = (function () {
|
|
|
isSubcontract: rationData.isSubcontract,
|
|
|
remark: rationData.remark
|
|
|
};
|
|
|
+ if (rationData.from === 'std' && isDef(rationData.libID)) { //来自标准库,设置定额库编码
|
|
|
+ rationSource.libCode = detail.rationLibMap[rationData.libID].libCode;
|
|
|
+ }
|
|
|
let ration = new Ration(rationSource);
|
|
|
//创建工料分析
|
|
|
let gljAnalyze = new GljAnalyze();
|
|
|
@@ -1167,11 +1186,11 @@ const XMLStandard = (function () {
|
|
|
fbfxBills.children.push(fbBills);
|
|
|
//创建清单项目节点
|
|
|
for (let subNode of node.children) {
|
|
|
- let fx = loadBills(subNode, detail.Ration.datas, detail.ration_glj.datas, curPMData.tender.property.decimal);
|
|
|
+ let fx = loadBills(subNode, detail);
|
|
|
fbBills.children.push(fx);
|
|
|
}
|
|
|
} else {
|
|
|
- let fxBills = loadBills(node, detail.Ration.datas, detail.ration_glj.datas, curPMData.tender.property.decimal);
|
|
|
+ let fxBills = loadBills(node, detail);
|
|
|
fbfxBills.children.push(fxBills);
|
|
|
}
|
|
|
}
|
|
|
@@ -1249,7 +1268,7 @@ const XMLStandard = (function () {
|
|
|
parent.children.push(jscsClass);
|
|
|
loadJSCS(jscsClass, node.children);
|
|
|
} else { //清单项目
|
|
|
- parent.children.push(loadBills(node, detail.Ration.datas, detail.ration_glj.datas, curPMData.tender.property.decimal));
|
|
|
+ parent.children.push(loadBills(node, detail));
|
|
|
}
|
|
|
}
|
|
|
}
|