Parcourir la source

工料机类型修改

zhongzewei il y a 8 ans
Parent
commit
51d99a70ea

+ 9 - 3
web/maintain/std_glj_lib/js/glj.js

@@ -30,7 +30,7 @@ let repositoryGljObj = {
     currentCache: null,
     parentNodeIds: {},
     gljList: [],
-    allowComponent: [202, 203, 204, 3],//可带组成物类型:混凝土、砂浆、配合比、机械
+    allowComponent: [202, 203, 204, 301],//可带组成物类型:混凝土、砂浆、配合比、机械台班
     distTypeTree: null,//add
     setting: {
 
@@ -81,7 +81,7 @@ let repositoryGljObj = {
                 && distTypeObj.data.fullName !== '机上人工'){
                 distTypeTree.comboDatas.push({text: distTypeObj.data.fullName, value: distTypeObj.data.ID});
             }*/
-            if(distTypeObj.data.fullName !== '材料'){
+            if(distTypeObj.data.fullName !== '材料' && distTypeObj.data.fullName !== '机械'){
                 distTypeTree.comboDatas.push({text: distTypeObj.data.fullName, value: distTypeObj.data.ID});
             }
         });
@@ -380,6 +380,11 @@ let repositoryGljObj = {
                         if(me.currentGlj){
                             rObj.component = me.currentGlj.component;
                         }
+                        if(me.allowComponent.indexOf(rObj.gljType) !== -1){
+                            rObj.basePrice = 0;
+                        }
+                        console.log(me.currentGlj);
+                        console.log(rObj);
                         updateArr.push(rObj);
                         break;
                     }
@@ -406,6 +411,7 @@ let repositoryGljObj = {
             }
             //update basePrice of ration when editting gljType of glj
             if(me.currentEditingGlj.gljType !== rObj.gljType){
+
                 let gljTypeObj = {gljId: me.currentEditingGlj.ID, gljType: rObj.gljType, basePrice: rObj.basePrice};
                 updateBasePrcArr.push(gljTypeObj);
                 if(me.rationLibs.length > 0){
@@ -422,7 +428,7 @@ let repositoryGljObj = {
             if(isCanSav){
                 me.addGljObj = null;
                 rObj.component = [];
-                //如果类型为混凝土、砂浆、配合比、机械时,添加时填写的单价清空
+                //如果类型为混凝土、砂浆、配合比、机械台班时,添加时填写的单价清空
                 if(me.allowComponent.indexOf(rObj.gljType) !== -1){
                     rObj.basePrice = 0;
                 }

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

@@ -150,7 +150,7 @@ let gljComponentOprObj = {
                     if(gljList[i].code === args.editingText){//有效的组成物
                         hasCode = true;
                         if((materialComponent.indexOf(that.currentGlj.gljType) !== -1 && gljList[i].gljType === 201)
-                            || (that.currentGlj.gljType === 3 && machineComponent.indexOf(gljList[i].gljType) !== -1 )){//普通材料
+                            || (that.currentGlj.gljType === 301 && machineComponent.indexOf(gljList[i].gljType) !== -1 )){//普通材料
                             //是否与原有组成物不同
                             let isExist = false;
                             for(let j = 0; j < component.length; j++){
@@ -267,7 +267,7 @@ let gljComponentOprObj = {
                 for(let j = 0; j < gljCache.length; j++){
                     if(items[i].code === gljCache[j].code){
                         if((materialComponent.indexOf(that.currentGlj.gljType) !== -1 && gljCache[j].gljType === 201)
-                            || (that.currentGlj.gljType === 3 && machineComponent.indexOf(gljCache[j].gljType) !== -1 )){
+                            || (that.currentGlj.gljType === 301 && machineComponent.indexOf(gljCache[j].gljType) !== -1 )){
                             //是否与原有组成物不同
                             let isExist = false;
                             for(let k = 0; k < component.length; k++){