Browse Source

机械组成物添加组成物修改为:
机械台班可添加普通材料

zhongzewei 6 years ago
parent
commit
beb9eabd29

+ 4 - 4
public/web/tools_const.js

@@ -10,14 +10,14 @@
 //允许使用的工料机类型:人工、普通材料、混凝土、砂浆、配合比、商品混凝土、商品砂浆、机械台班、机械组成物、机上人工、设备
 let allowGljType = [1, 201, 202, 203, 204, 205, 206, 301, 302, 303,5];
 
-//允许含有组成物的工料机类型:混凝土、砂浆、配合比、机械台班、机械组成物(普通材料)
-let allowComponent = [202, 203, 204, 301, 302];
+//允许含有组成物的工料机类型:混凝土、砂浆、配合比、机械台班
+let allowComponent = [202, 203, 204, 301];
 //可以作为组成物的工料机类型:普通材料、机械组成物、机上人工
 let componentType = [201, 302, 303];
 //允许含有组成物的机械工料机类型:机械台班
 let machineAllowComponent = [301];
-//可以作为机械工料机组成物的工料机类型:机械组成物、机上人工
-let machineComponent = [302, 303];
+//可以作为机械工料机组成物的工料机类型:机械组成物、机上人工、普通材料
+let machineComponent = [201, 302, 303];
 //允许含有组成物的材料工料机类型:混凝土、砂浆、配合比
 let materialAllowComponent = [202, 203, 204];
 //可以作为材料工料机组成物的工料机类型:普通材料

+ 2 - 3
web/maintain/std_glj_lib/js/components.js

@@ -116,8 +116,7 @@ let componentOprObj = {
         let that = repositoryGljObj, me = componentOprObj;
         for(let i = 0; i < gljList.length; i++){
             if(machineAllowComponent.includes(that.currentGlj.gljType) && machineComponent.includes(gljList[i].gljType) ||
-                materialAllowComponent.includes(that.currentGlj.gljType) && gljList[i].gljType === 201||
-                that.currentGlj.gljType === 302 && gljList[i].gljType === 201){//机械组成物,应可选择无组成物的普通材料
+                materialAllowComponent.includes(that.currentGlj.gljType) && gljList[i].gljType === 201){
                 let isExist = false;
                 for(let j = 0; j < that.currentComponent.length; j++){
                     if(that.currentComponent[j].ID === gljList[i].ID){
@@ -214,7 +213,7 @@ let componentOprObj = {
                         newComponent.push(newComponentObj);
                     }
                 }
-                newComponent = newComponent.concat(gljComponent);
+                newComponent = gljComponent.concat(newComponent);
             }
             else if(me.insertType === 'batchClear'){//去除消耗量为0的组成物
                 for(let gljPerComponent of gljComponent){

+ 2 - 5
web/maintain/std_glj_lib/js/gljComponent.js

@@ -341,7 +341,6 @@ let gljComponentOprObj = {
     },
     onCellEditStart: function(sender, args) {
         let me = gljComponentOprObj, that = repositoryGljObj;
-        console.log(me.colMapping);
         if(me.isPending){
             args.cancel = true;
         }
@@ -373,8 +372,7 @@ let gljComponentOprObj = {
                 if(gljList[i].code === args.editingText){//有效的组成物
                     hasCode = true;
                     if((materialAllowComponent.includes(that.currentGlj.gljType) && gljList[i].gljType === 201)
-                        || (machineAllowComponent.includes(that.currentGlj.gljType) && machineComponent.includes(gljList[i].gljType))
-                        || (that.currentGlj.gljType === 302 && gljList[i].gljType === 201)){
+                        || (machineAllowComponent.includes(that.currentGlj.gljType) && machineComponent.includes(gljList[i].gljType))){
                         //是否与原有组成物不同
                         let isExist = false;
                         for(let j = 0; j < component.length; j++){
@@ -516,8 +514,7 @@ let gljComponentOprObj = {
                     if(items[i].code === gljCache[j].code){
                         existCode = true;
                         if((materialAllowComponent.includes(that.currentGlj.gljType) && gljCache[j].gljType === 201)
-                            || (machineAllowComponent.includes(that.currentGlj.gljType) && machineComponent.includes(gljCache[j].gljType))
-                            || (that.currentGlj.gljType === 302 && gljCache[j].gljType === 201)){
+                            || (machineAllowComponent.includes(that.currentGlj.gljType) && machineComponent.includes(gljCache[j].gljType))){
                             //是否与原有组成物不同
                             let isExist = false;
                             for(let k = 0; k < component.length; k++){