|
|
@@ -149,7 +149,8 @@ let mbzm_obj={
|
|
|
let rations = {update:[],create:[],delete:[]},bills={update:[],create:[]};
|
|
|
if(this.datas.length <= 0) return;
|
|
|
for(let d of this.datas){
|
|
|
- if((gljUtil.isDef(d.quantity)&& parseFloat(d.quantity)>0)||(d.coe && d.coe!="0")){
|
|
|
+ let ration = _.find(projectObj.project.Ration.datas,{'referenceRationID':selected.data.ID,'code':d.code});
|
|
|
+ if(ration||(gljUtil.isDef(d.quantity)&& parseFloat(d.quantity)>0)||(d.coe && d.coe!="0")){
|
|
|
if(this.positionChecking(createLocation,d) == false){//清单位置检查
|
|
|
alert(`请选择${d.code}生成的清单位置`);
|
|
|
return;
|
|
|
@@ -175,25 +176,11 @@ let mbzm_obj={
|
|
|
if(dRaNode){
|
|
|
parentsNodes.push(dRaNode.parent);
|
|
|
projectObj.project.Ration.deleteSubListOfRation({ID:d.ID});
|
|
|
- //_.remove(projectObj.project.Ration.datas)
|
|
|
-//project.Ration.datas
|
|
|
+ _.remove(projectObj.project.Ration.datas,{'ID':d.ID});
|
|
|
+ projectObj.mainController.m_delete([dRaNode],dRaNode.serialNo(),false)//这里删除关联子目生成的定额因为是离散的树节点,所以要这样分开处理
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
- /* if(updateData['ration']){
|
|
|
- for(let r_key in updateData['ration']){//定额只有删除,没有更新
|
|
|
- _.remove(ration_datas,{'ID':r_key});
|
|
|
- project.Ration.deleteSubListOfRation({ID:r_key});
|
|
|
- }
|
|
|
- }
|
|
|
- for(let r of refNodes){
|
|
|
- controller.m_delete([r],r.serialNo())//这里删除关联子目生成的定额因为是离散的树节点,所以要这样分开处理
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
let refreshNodes = projectObj.project.updateNodesCache(result.updateDatas);//更新要update的前端缓存,并返回要刷新的树节点
|
|
|
let nodeDatas = {ration:{add:[]}, bills:{add:[]}};
|
|
|
if(result.rationResult){
|
|
|
@@ -220,6 +207,7 @@ let mbzm_obj={
|
|
|
$.bootstrapLoading.end();
|
|
|
cbTools.refreshFormulaNodes();
|
|
|
//更新计算程序模板,并进行重新计算
|
|
|
+ if(parentsNodes.length > 0) calRations = calRations.concat(parentsNodes);//计算被删除的子目关联定额的父节点
|
|
|
projectObj.project.calcProgram.calcNodesAndSave(calRations,function () {
|
|
|
installationFeeObj.calcInstallationFee();
|
|
|
});
|