|
|
@@ -22,6 +22,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
施工辅助: "SGFZFFL",
|
|
|
基本费用: "JBFYFL",
|
|
|
主副食运费补贴: "ZFSYFBTFL",
|
|
|
+ 综合里程: "ZFSYFBTFL",
|
|
|
职工探亲路费: "ZGTQLFFL",
|
|
|
职工探亲: "ZGTQLFFL",
|
|
|
职工取暖补贴: "ZGQNBTFL",
|
|
|
@@ -75,6 +76,27 @@ INTERFACE_EXPORT = (() => {
|
|
|
'rationCommon': 'DEJAF'
|
|
|
};
|
|
|
|
|
|
+ function getBasePrice(projectGLJID, tenderProject) {
|
|
|
+ let glj = _.find(tenderProject.projectGLJ.datas.gljList, {
|
|
|
+ id: projectGLJID
|
|
|
+ })
|
|
|
+ return glj ? gljUtil.getBasePrice(glj, null, null, null, decimalObj, false, _, scMathUtil) : 0;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ function getFeeRate(programID, fieldName, tenderProject) {
|
|
|
+ let rate = 0;
|
|
|
+ let template = tenderProject.calcProgram.compiledTemplates;
|
|
|
+ if (template[programID]) {
|
|
|
+ let item = _.find(template[programID].calcItems, {
|
|
|
+ fieldName: fieldName
|
|
|
+ })
|
|
|
+ if (item) rate = item.feeRate;
|
|
|
+ }
|
|
|
+ return rate
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param {String} areaKey - 地区标识,如:'安徽@马鞍山',有些地区的接口只是取值上有不同,共有一个接口脚本, 需要通过地区标识确定一些特殊处理
|
|
|
@@ -253,8 +275,8 @@ INTERFACE_EXPORT = (() => {
|
|
|
});
|
|
|
if (value == -1) value = 0;
|
|
|
}
|
|
|
- if (sname == '利润') tenderProject.ProfitRate = value;
|
|
|
- if (sname == '税金') tenderProject.TaxRate = value;
|
|
|
+ /* if (sname == '利润') tenderProject.ProfitRate = value;
|
|
|
+ if (sname == '税金') tenderProject.TaxRate = value; */
|
|
|
RateParams.children.push(new RateParam(feeRateMap[sname], value));
|
|
|
}
|
|
|
}
|
|
|
@@ -622,8 +644,8 @@ INTERFACE_EXPORT = (() => {
|
|
|
let totalItem = null;
|
|
|
let proItem = null; //暂列金额项
|
|
|
for (let b of bills) {
|
|
|
- if (b.flagsIndex.fixed.flag == fixedFlag.TOTAL_COST) totalItem = b;
|
|
|
- if (b.flagsIndex.fixed.flag == fixedFlag.PROVISIONAL) proItem = b;
|
|
|
+ if (b.flagsIndex && b.flagsIndex.fixed && b.flagsIndex.fixed.flag == fixedFlag.TOTAL_COST) totalItem = b;
|
|
|
+ if (b.flagsIndex && b.flagsIndex.fixed && b.flagsIndex.fixed.flag == fixedFlag.PROVISIONAL) proItem = b;
|
|
|
}
|
|
|
|
|
|
const attrs = [{
|
|
|
@@ -640,8 +662,104 @@ INTERFACE_EXPORT = (() => {
|
|
|
this.children.push(new MakeInfo(tenderProject));
|
|
|
this.children.push(new Params(tenderProject));
|
|
|
this.children.push(new getBillsItems(tenderProject));
|
|
|
+ this.children.push(new getIndexs(tenderProject));
|
|
|
+ let bidEvaluationMainMaterials = getBidEvaluationMainMaterial(tenderProject);
|
|
|
+ if(bidEvaluationMainMaterials.length > 0) this.children.push(...bidEvaluationMainMaterials);
|
|
|
+ }
|
|
|
+
|
|
|
+ function getBidEvaluationMainMaterial(tenderProject) {
|
|
|
+ let bidMaterials = [];
|
|
|
+ let i = 1;
|
|
|
+ for (let b of tenderProject.bidMaterialData) {
|
|
|
+ bidMaterials.push(new BidEvaluationMainMaterial(b, i));
|
|
|
+ i++
|
|
|
+ }
|
|
|
+ return bidMaterials;
|
|
|
+ function BidEvaluationMainMaterial(b, index) {
|
|
|
+ const attrs = [{
|
|
|
+ name: "Code",
|
|
|
+ value: index,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Number",
|
|
|
+ value: b.code
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Name",
|
|
|
+ value: b.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Specification",
|
|
|
+ value: b.specs
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Unit",
|
|
|
+ value: b.unit
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Price",
|
|
|
+ value: b.tenderPrice
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "LimitedPrice",
|
|
|
+ value: b.tenderPrice
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Quantity",
|
|
|
+ value: b.quantity
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Total",
|
|
|
+ value: b.totalPrice
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Remark",
|
|
|
+ value: b.remark
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ Element.call(this, "BidEvaluationMainMaterial", attrs);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function getIndexs(tenderProject) {
|
|
|
+ let Indexs = new emptyElement('Indexs');
|
|
|
+ let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
|
|
|
+ for (let f of feature) {
|
|
|
+ if (f.code) Indexs.children.push(new IndexItem(f))
|
|
|
+ }
|
|
|
+ return Indexs;
|
|
|
+
|
|
|
+ function IndexItem(fea) {
|
|
|
+ const attrs = [{
|
|
|
+ name: "Code",
|
|
|
+ value: fea.code,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Name",
|
|
|
+ value: fea.dispName,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Unit",
|
|
|
+ value: fea.unit,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Value",
|
|
|
+ value: fea.value,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Remark",
|
|
|
+ value: fea.remark,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ Element.call(this, "IndexItem", attrs);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
function getBillsItems(tenderProject) {
|
|
|
let items = new emptyElement("Items");
|
|
|
let rootNodes = tenderProject.mainTree.roots;
|
|
|
@@ -707,7 +825,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
},
|
|
|
{
|
|
|
name: "Price",
|
|
|
- value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.unitFee : "",
|
|
|
+ value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "",
|
|
|
},
|
|
|
{
|
|
|
name: "Rate",
|
|
|
@@ -715,7 +833,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
},
|
|
|
{
|
|
|
name: "Sum",
|
|
|
- value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.totalFee : "",
|
|
|
+ value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "",
|
|
|
},
|
|
|
{
|
|
|
name: "ChapterKind",
|
|
|
@@ -787,15 +905,116 @@ INTERFACE_EXPORT = (() => {
|
|
|
for (let r of bNode.children) {
|
|
|
if (r.data.type == rationType.ration) {
|
|
|
Norms.push(new Ration(r.data));
|
|
|
+ } else {
|
|
|
+ Costs.push(new Cost(r.data));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
- return CostComposition;
|
|
|
+ if (Norms.length > 0) CostComposition.children.push(...Norms);
|
|
|
+ if (Costs.length > 0) CostComposition.children.push(...Costs);
|
|
|
+ if (bNode.data.calcBase) CostComposition.children.push(new Formula(bNode.data));
|
|
|
+ return CostComposition.children.length > 0 ? CostComposition : null;
|
|
|
|
|
|
|
|
|
+ function Formula(bills) {
|
|
|
+ const attrs = [{
|
|
|
+ name: "Name",
|
|
|
+ value: bills.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Formulas",
|
|
|
+ value: bills.calcBase
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Ratio",
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Sum",
|
|
|
+ value: bills.feesIndex && bills.feesIndex.common ? bills.feesIndex.common.tenderTotalFee : "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "Remarks",
|
|
|
+ value: bills.remark
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ Element.call(this, "Formula", attrs);
|
|
|
|
|
|
+ // 1.Name
|
|
|
+ // 名称/描述。取清单的名称。
|
|
|
+ // 2.Formulas
|
|
|
+ // 计算式。读取计算基数的文本。
|
|
|
+ // 取基数计算窗口内容,基数直接转换为金额?参考标准文档的 7.11 及 7.12 节。
|
|
|
+ // 7.11是定额的费用,7.12是清单累进基数,主要是估概预算中用到,清单里的不同,所以中山的接口直接输出基数文本。
|
|
|
+ // 3.Ratio
|
|
|
+ // 系数。输出为1,非必填。
|
|
|
+ // 4.Sum
|
|
|
+ // 取金额。
|
|
|
+ // 5.Remarks
|
|
|
+ }
|
|
|
|
|
|
+ function Cost(item) {
|
|
|
+ let BasePrice = 0;
|
|
|
+ if (item.type == rationType.volumePrice) { // 当插入的是量价时,基价读取单价列。
|
|
|
+ BasePrice = item.feesIndex && item.feesIndex.common ? item.feesIndex.common.tenderUnitFee : 0
|
|
|
+ } else {
|
|
|
+ BasePrice = getBasePrice(item.projectGLJID, tenderProject)
|
|
|
+ }
|
|
|
+ let calcMap = tenderProject.calcProgram.compiledTemplateMaps
|
|
|
+ let CostTypeNo = '';
|
|
|
+ if (feeRateMap[calcMap[item.programID]]) CostTypeNo = feeRateMap[calcMap[item.programID]];
|
|
|
+ const attrs = [{
|
|
|
+ name: "Code",
|
|
|
+ value: item.code,
|
|
|
+ }, {
|
|
|
+ name: 'Name',
|
|
|
+ value: item.name
|
|
|
+ }, {
|
|
|
+ name: 'Spec',
|
|
|
+ value: item.specs
|
|
|
+ }, {
|
|
|
+ name: 'Unit',
|
|
|
+ value: item.unit
|
|
|
+ }, {
|
|
|
+ name: 'Num',
|
|
|
+ value: item.tenderQuantity
|
|
|
+ }, {
|
|
|
+ name: 'BasePrice',
|
|
|
+ value: BasePrice
|
|
|
+ }, {
|
|
|
+ name: 'Price',
|
|
|
+ value: item.feesIndex && item.feesIndex.common ? item.feesIndex.common.tenderUnitFee : 0
|
|
|
+ }, {
|
|
|
+ name: 'IsEquipment',
|
|
|
+ value: item.subType == gljType.EQUIPMENT ? 1 : 0
|
|
|
+ }, {
|
|
|
+ name: 'CostTypeNo',
|
|
|
+ value: CostTypeNo
|
|
|
+ }, {
|
|
|
+ name: 'ProfitRate',
|
|
|
+ value: getFeeRate(item.programID, 'profit', tenderProject)
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'TaxRate',
|
|
|
+ value: getFeeRate(item.programID, 'tax', tenderProject)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'MpRatio',
|
|
|
+ value: item.subType == gljType.LABOUR ? 100 : 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'MaterialRatio',
|
|
|
+ value: item.subType == gljType.GENERAL_MATERIAL ? 100 : 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'MechRatio',
|
|
|
+ value: item.subType == gljType.GENERAL_MACHINE ? 100 : 0
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ Element.call(this, "Cost", attrs);
|
|
|
+ this.children.push(CostStructure(item));
|
|
|
+ }
|
|
|
|
|
|
|
|
|
function Ration(ration) {
|
|
|
@@ -824,11 +1043,11 @@ INTERFACE_EXPORT = (() => {
|
|
|
},
|
|
|
{
|
|
|
name: 'ProfitRate',
|
|
|
- value: tenderProject.ProfitRate
|
|
|
+ value: getFeeRate(ration.programID, 'profit', tenderProject) //tenderProject.ProfitRate
|
|
|
},
|
|
|
{
|
|
|
name: 'TaxRate',
|
|
|
- value: tenderProject.TaxRate
|
|
|
+ value: getFeeRate(ration.programID, 'tax', tenderProject) //tenderProject.TaxRate
|
|
|
},
|
|
|
{
|
|
|
name: 'FabricationCost',
|
|
|
@@ -840,32 +1059,31 @@ INTERFACE_EXPORT = (() => {
|
|
|
}
|
|
|
]
|
|
|
Element.call(this, "Norm", attrs);
|
|
|
- this.children.push(CostStructure(ration))
|
|
|
+ this.children.push(CostStructure(ration));
|
|
|
+ this.children.push(Consume(ration));
|
|
|
}
|
|
|
- // 1.NormLibNo
|
|
|
- // 定额库编码。根据后台设置读取。
|
|
|
- // 2.DisplayCode
|
|
|
- // 定额子目编码。
|
|
|
- // 3.Name
|
|
|
- // 定额子目名称。
|
|
|
- // 4.Unit
|
|
|
- // 定额子目单位。
|
|
|
- // 5.Num
|
|
|
- // 定额的工程量。
|
|
|
- // 6.CostTypeNo
|
|
|
- // 取费类别编号。如土方编号为“TF”。
|
|
|
- // 7.ProfitRate
|
|
|
- // 取利润率。取费率界面右侧的利润参数值。
|
|
|
- // 8.TaxRate
|
|
|
- // 取税率。取费率界面右侧的税率参数值。
|
|
|
- // 9.FabricationCost
|
|
|
- // 金额合计。取造价书界面定额的调价后金额。
|
|
|
- // 10.AdjustStatus
|
|
|
- // 定额调整状态。输出目前造价书显示的定额调整文本。
|
|
|
}
|
|
|
|
|
|
+ function Consume(ration) {
|
|
|
+ let consume = new emptyElement('Consume');
|
|
|
+ for (let rg of ration.rationGLJList) {
|
|
|
+ consume.children.push(new ConsumeItem(rg));
|
|
|
+ }
|
|
|
+ return consume;
|
|
|
+
|
|
|
+ function ConsumeItem(rg) {
|
|
|
+ const attrs = [{
|
|
|
+ name: "Code",
|
|
|
+ value: rg.code,
|
|
|
+ }, {
|
|
|
+ name: "Consumption",
|
|
|
+ value: rg.tenderQuantity
|
|
|
+ }];
|
|
|
+ Element.call(this, "ConsumeItem", attrs);
|
|
|
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
function CostStructure(item) {
|