|
@@ -489,22 +489,20 @@ var ration_glj = {
|
|
|
ration_glj.prototype.insertGLJAsRation = function (GLJSelection, selected, callback) {
|
|
|
let gljList = [];
|
|
|
let allGLJ = gljOprObj.AllRecode;
|
|
|
- let billsItemID = null;
|
|
|
- let serialNo = 0;
|
|
|
- let selectedSerialNo = null;
|
|
|
- let nextNodeID = null;
|
|
|
- let parentNodeID = null;
|
|
|
+ let billsItemID = null, serialNo = 0,selectedSerialNo = null,nextNodeID = null, parentNodeID = null, billNode = null;
|
|
|
let children = [];
|
|
|
if (selected.sourceType === project.Bills.getSourceType()) {
|
|
|
billsItemID = selected.data.ID;
|
|
|
parentNodeID = selected.getID();
|
|
|
nextNodeID = selected.tree.rootID();
|
|
|
+ billNode = selected;
|
|
|
} else {
|
|
|
billsItemID = selected.data.billsItemID;
|
|
|
serialNo = selected.data.serialNo;
|
|
|
selectedSerialNo = selected.data.serialNo;
|
|
|
nextNodeID = selected.getNextSiblingID();
|
|
|
parentNodeID = selected.getParentID();
|
|
|
+ billNode = selected.parent;
|
|
|
}
|
|
|
children = project.Ration.getBillsSortRation(billsItemID);
|
|
|
serialNo == 0 ? serialNo = children.length : "";
|
|
@@ -535,13 +533,20 @@ var ration_glj = {
|
|
|
materialType:glj.materialType,
|
|
|
materialCoe:glj.materialCoe,
|
|
|
repositoryId: glj.repositoryId
|
|
|
- }
|
|
|
+ };
|
|
|
if (glj.hasOwnProperty("compilationId")) {
|
|
|
new_glj.from = "cpt";
|
|
|
if (glj.code.indexOf('-') != -1) {//这条工料机是用户通过修改名称、规格、型号等保存到补充工料机库的
|
|
|
new_glj.original_code = glj.code.split('-')[0];//取-前的编号作为原始编号
|
|
|
}
|
|
|
}
|
|
|
+ if(optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan')){//需要根据清单转换工程量
|
|
|
+ new_glj.quantityEXP="QDL";
|
|
|
+ if(billNode.data.quantity){
|
|
|
+ new_glj.quantity = scMathUtil.roundForObj(billNode.data.quantity/FilterNumberFromUnit(glj.unit),getDecimal("glj.quantity"));
|
|
|
+ new_glj.contain = scMathUtil.roundForObj(new_glj.quantity/billNode.data.quantity,6);
|
|
|
+ }
|
|
|
+ }
|
|
|
gljList.push(new_glj);
|
|
|
}
|
|
|
}
|