|
@@ -551,10 +551,10 @@ var Ration = {
|
|
let selected = project.mainTree.selected, newSource = null, newNode = null,pre=null,br=null;
|
|
let selected = project.mainTree.selected, newSource = null, newNode = null,pre=null,br=null;
|
|
let billItemID = null,serialNo=1,nextID=null;
|
|
let billItemID = null,serialNo=1,nextID=null;
|
|
let needInstall = false;
|
|
let needInstall = false;
|
|
- if (selected === null) { return; }
|
|
|
|
|
|
+ if (selected === null) { return null; }
|
|
if (selected.sourceType === project.Bills.getSourceType() && selected.depth() > 0) {
|
|
if (selected.sourceType === project.Bills.getSourceType() && selected.depth() > 0) {
|
|
if(selected.data.type === billType.FB){
|
|
if(selected.data.type === billType.FB){
|
|
- return;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
else if (selected.source.children.length > 0) {
|
|
else if (selected.source.children.length > 0) {
|
|
alert('当前清单已有清单子项,不能套用定额。');
|
|
alert('当前清单已有清单子项,不能套用定额。');
|
|
@@ -574,7 +574,8 @@ var Ration = {
|
|
pre = selected.source;
|
|
pre = selected.source;
|
|
};
|
|
};
|
|
if(billItemID){
|
|
if(billItemID){
|
|
- let newData = me.getTempRationData(me.getNewRationID(), billItemID, serialNo, rationType);
|
|
|
|
|
|
+ let newID = me.getNewRationID();
|
|
|
|
+ let newData = me.getTempRationData(newID, billItemID, serialNo, rationType);
|
|
let calQuantity = isEmpty===true?false:optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan');
|
|
let calQuantity = isEmpty===true?false:optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS, 'rationQuanACToBillsQuan');
|
|
let brUpdate = [];
|
|
let brUpdate = [];
|
|
//更新兄弟节点的序列号
|
|
//更新兄弟节点的序列号
|
|
@@ -590,6 +591,9 @@ var Ration = {
|
|
needInstall = project.Bills.isFBFX(billsNode);//在分部分项插入的定额才需要定额安装增加费
|
|
needInstall = project.Bills.isFBFX(billsNode);//在分部分项插入的定额才需要定额安装增加费
|
|
}
|
|
}
|
|
$.bootstrapLoading.start();
|
|
$.bootstrapLoading.start();
|
|
|
|
+ newNode = project.mainTree.insert(billItemID, nextID, newID);
|
|
|
|
+ newNode.sourceType = project.Ration.getSourceType();
|
|
|
|
+ newNode.data = newData;
|
|
CommonAjax.post("/ration/addNewRation",{itemQuery:itemQuery,newData:newData,firstLibID: rationLibObj.getFirstStdRationLibID(),calQuantity:calQuantity,brUpdate:brUpdate,needInstall:needInstall},function (data) {
|
|
CommonAjax.post("/ration/addNewRation",{itemQuery:itemQuery,newData:newData,firstLibID: rationLibObj.getFirstStdRationLibID(),calQuantity:calQuantity,brUpdate:brUpdate,needInstall:needInstall},function (data) {
|
|
//更新缓存
|
|
//更新缓存
|
|
me.datas.push(data.ration);
|
|
me.datas.push(data.ration);
|
|
@@ -599,12 +603,12 @@ var Ration = {
|
|
|
|
|
|
//插入树节点
|
|
//插入树节点
|
|
newSource = data.ration;
|
|
newSource = data.ration;
|
|
- newNode = project.mainTree.insert(billItemID, nextID, newSource.ID);
|
|
|
|
|
|
+ // newNode = project.mainTree.insert(billItemID, nextID, newSource.ID); 上移到post方法外部。批量粘贴时,先插入空行,前端等不了,先生成树结点,效果同清单处理方式。
|
|
newNode.source = newSource;
|
|
newNode.source = newSource;
|
|
- newNode.sourceType = project.Ration.getSourceType();
|
|
|
|
|
|
+ // newNode.sourceType = project.Ration.getSourceType();
|
|
newNode.data = newSource;
|
|
newNode.data = newSource;
|
|
project.projectGLJ.loadData(function () {
|
|
project.projectGLJ.loadData(function () {
|
|
- ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
|
|
|
|
+ // ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
project.ration_glj.addToMainTree(data.ration_gljs);
|
|
project.ration_glj.addToMainTree(data.ration_gljs);
|
|
projectObj.mainController.refreshTreeNode([newNode], false);
|
|
projectObj.mainController.refreshTreeNode([newNode], false);
|
|
project.calcProgram.calcAndSave(newNode,function () {
|
|
project.calcProgram.calcAndSave(newNode,function () {
|
|
@@ -620,7 +624,10 @@ var Ration = {
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
});
|
|
});
|
|
})
|
|
})
|
|
|
|
+ ProjectController.syncDisplayNewNode(sheetController, newNode);
|
|
|
|
+ return newNode;
|
|
}
|
|
}
|
|
|
|
+ else return null;
|
|
|
|
|
|
};
|
|
};
|
|
ration.prototype.deleteSubListOfRation = function(ration){
|
|
ration.prototype.deleteSubListOfRation = function(ration){
|