|
|
@@ -862,10 +862,10 @@ let ration_glj = {
|
|
|
if (selectCode == gljOprObj.getIndex(oldData, gljKeyArray)) {
|
|
|
return callback(null);
|
|
|
}
|
|
|
- //如果是从混凝土改成商品混凝土,并且混凝土的定额消耗量不为空,则原混凝土的自定义消耗改成0,插入一条新的商品混凝土自定义消耗量为原自定义或定额消耗
|
|
|
+ //如果是从混凝土改成商品混凝土,并且混凝土的定额消耗量不为空,则原混凝土的自定义消耗改成0,插入一条新的商品混凝土自定义消耗量为原定额计算后的消耗量
|
|
|
if(gljUtil.isAddCommercialForReplace(oldData.type,glj.gljType,oldData.rationItemQuantity)){
|
|
|
let originalID = oldData.ID;
|
|
|
- let customQuantity = gljUtil.isDef(oldData.customQuantity)? oldData.customQuantity:oldData.rationItemQuantity;
|
|
|
+ let customQuantity = gljUtil.isDef(oldData.quantity)? oldData.quantity:0;
|
|
|
oldData = this.getAddDataByStd(glj,oldData.rationID,oldData.billsItemID,oldData.projectID);
|
|
|
oldData.toCommercial=true;
|
|
|
oldData.originalID = originalID;
|
|
|
@@ -908,7 +908,7 @@ let ration_glj = {
|
|
|
tem_doc = {'customQuantity':'0'};
|
|
|
//插入一条新的定额,这里的更新自定义消耗量操作由task完成了,不用像单条替换那样做标记,修改等
|
|
|
let newDoc = this.getAddDataByStd(glj,d.rationID,d.billsItemID,d.projectID);
|
|
|
- let customQuantity = gljUtil.isDef(d.customQuantity)? d.customQuantity:d.rationItemQuantity;
|
|
|
+ let customQuantity = gljUtil.isDef(d.quantity)? d.quantity:0;
|
|
|
newDoc.customQuantity = customQuantity;
|
|
|
let tTask = {insertOne:{document: newDoc}};
|
|
|
tasks.push(tTask);
|