|
@@ -580,19 +580,7 @@ var projectObj = {
|
|
|
icon: 'fa-sign-in',
|
|
|
disabled: function () {
|
|
|
var selected = project.mainTree.selected;
|
|
|
- if (selected) {// Vincent, 2018-01-02
|
|
|
- if(selected.sourceType === project.Ration.getSourceType()){ // 焦点行是定额/量价/工料机,有效显示。
|
|
|
- return false;
|
|
|
- }else if(selected.sourceType === project.Bills.getSourceType()){
|
|
|
- if(selected.data.type == billType.FX){//焦点行是分项,有效显示。
|
|
|
- return false
|
|
|
- }
|
|
|
- if(selected.data.type == billType.BILL && selected.source.children.length === 0){//焦点行是清单,且没有子项,有效显示。
|
|
|
- return false
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
+ return project.Ration.addRationChecking(selected); // Vincent, 2018-01-02
|
|
|
},
|
|
|
callback: function (key, opt) {
|
|
|
ProjectController.addRation(project, controller, rationType.ration);
|
|
@@ -611,16 +599,18 @@ var projectObj = {
|
|
|
icon: 'fa-sign-in',
|
|
|
disabled: function () {
|
|
|
var selected = project.mainTree.selected;
|
|
|
- if (selected) {
|
|
|
- if ( // CSL, 2017-11-28
|
|
|
- selected.sourceType === project.Ration.getSourceType() ||
|
|
|
- (selected.sourceType === project.Bills.getSourceType() && selected.source.children.length === 0)
|
|
|
- ) return false
|
|
|
- else return true
|
|
|
- } else return true
|
|
|
+ return project.Ration.addRationChecking(selected); // Vincent, 2018-01-02
|
|
|
},
|
|
|
callback: function (key, opt) {
|
|
|
ProjectController.addRation(project, controller, rationType.volumePrice);
|
|
|
+ },
|
|
|
+ visible: function(key, opt){
|
|
|
+ var selected = project.mainTree.selected;
|
|
|
+ if(selected.sourceType == ModuleNames.bills&&selected.data.type == billType.DXFY){
|
|
|
+ return false
|
|
|
+ }else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
"insertGLJ": {
|
|
@@ -628,11 +618,27 @@ var projectObj = {
|
|
|
icon: 'fa-sign-in',
|
|
|
disabled: function () {
|
|
|
var selected = project.mainTree.selected;
|
|
|
- var readOnly = MainTreeCol.readOnly;
|
|
|
- return readOnly.billsParent(selected)||(readOnly.bills(selected)&&!readOnly.forCalcBase(selected))||readOnly.glj(selected);
|
|
|
+ return project.Ration.addRationChecking(selected); // Vincent, 2018-01-02
|
|
|
},
|
|
|
callback: function (key, opt) {
|
|
|
+ var selected = project.mainTree.selected;
|
|
|
+ if(selected.sourceType == ModuleNames.bills){
|
|
|
+ if(selected.data.type == billType.FX||selected.data.type ==billType.BILL){
|
|
|
+ if(selected.data.calcBase&&selected.data.calcBase!=""){
|
|
|
+ alert("当前有基数计算不能插入子项。");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
getGLJData('insert');// ProjectController.addRation(project, controller, rationType.volumePrice);
|
|
|
+ },
|
|
|
+ visible: function(key, opt){
|
|
|
+ var selected = project.mainTree.selected;
|
|
|
+ if(selected.sourceType == ModuleNames.bills&&selected.data.type == billType.DXFY){
|
|
|
+ return false
|
|
|
+ }else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
"spr1": '--------',
|