|
@@ -59,20 +59,16 @@ ProjectController = {
|
|
|
} else if (false) {
|
|
|
alert('当前清单已有公式计算,不能套用定额。');
|
|
|
} else {
|
|
|
- let firstChild = selected.firstChild();
|
|
|
- if (firstChild && firstChild.sourceType === project.VolumePrice.getSourceType()) {
|
|
|
- alert('当前位置已有量价,不能套用定额。');
|
|
|
+ if (std) {
|
|
|
+ newSource = project.Ration.insertStdRation(selected.source.getID(), null, std);
|
|
|
+ project.ration_glj.addRationGLJ(newSource,std);
|
|
|
} else {
|
|
|
- if (std) {
|
|
|
- newSource = project.Ration.insertStdRation(selected.source.getID(), null, std);
|
|
|
- project.ration_glj.addRationGLJ(newSource,std);
|
|
|
- } else {
|
|
|
- newSource = project.Ration.insertRation(selected.source.getID());
|
|
|
- }
|
|
|
+ newSource = project.Ration.insertRation(selected.source.getID());
|
|
|
}
|
|
|
+
|
|
|
newNode = project.mainTree.insert(selected.getID(), selected.tree.rootID());
|
|
|
}
|
|
|
- } else if (selected.sourceType === project.Ration.getSourceType()) {
|
|
|
+ } else if (selected.sourceType === project.Ration.getSourceType() || selected.sourceType === project.VolumePrice.getSourceType()) {
|
|
|
if (std) {
|
|
|
newSource = project.Ration.insertStdRation(selected.source[project.masterField.ration], selected.source, std);
|
|
|
project.ration_glj.addRationGLJ(newSource,std);
|
|
@@ -80,9 +76,7 @@ ProjectController = {
|
|
|
newSource = project.Ration.insertRation(selected.source[project.masterField.ration], selected.source);
|
|
|
}
|
|
|
newNode = project.mainTree.insert(selected.getParentID(), selected.getNextSiblingID());
|
|
|
- } else if (selected.sourceType === project.VolumePrice.getSourceType()) {
|
|
|
- alert('当前位置已有量价,不能套用定额。');
|
|
|
- }
|
|
|
+ };
|
|
|
if (newNode) {
|
|
|
newNode.source = newSource;
|
|
|
newNode.sourceType = project.Ration.getSourceType();
|
|
@@ -117,7 +111,7 @@ ProjectController = {
|
|
|
if (selected.sourceType === project.Bills.getSourceType() && selected.source.children.length === 0) {
|
|
|
newSource = project.VolumePrice.insertVolumePrice(selected.source.getID());
|
|
|
newNode = project.mainTree.insert(selected.getID(), selected.tree.rootID());
|
|
|
- } else if (selected.sourceType === project.VolumePrice.getSourceType()) {
|
|
|
+ } else if (selected.sourceType === project.Ration.getSourceType() || selected.sourceType === project.VolumePrice.getSourceType()) {
|
|
|
newSource = project.VolumePrice.insertVolumePrice(selected.source[project.masterField.volumePrice], selected.source);
|
|
|
newNode = project.mainTree.insert(selected.getParentID(), selected.getNextSiblingID());
|
|
|
}
|