Explorar o código

feat: 造价书右键“按清单名称插入材料”,移动至“插入量价”之后,并且默认给工程量“QDL”。

zhangweicheng %!s(int64=5) %!d(string=hai) anos
pai
achega
c5b1642548

+ 2 - 1
web/building_saas/main/js/models/ration.js

@@ -533,10 +533,11 @@ var Ration = {
             }
         };
         ration.prototype.insertVolumePrice = function(type,ext){
+            let isEmpty = ext?false:true;
             this.addNewRation(null,rationType.volumePrice,function (newNode) {//插入人工不需要自动定位到编号列
                 projectObj.selectColAndFocus(newNode,null);
                 projectObj.refreshBaseActn(projectObj.project.mainTree);
-            },true,type,true,ext);
+            },isEmpty,type,true,ext);
         };
 
 

+ 18 - 18
web/building_saas/main/js/views/project_view.js

@@ -1395,24 +1395,6 @@ var projectObj = {
                         return false
                     }
                 },
-                "insertMaterial": {
-                    name: "按清单名称插入材料",//插入量价不需要自动定位到编号列
-                    icon: 'fa-sign-in',
-                    disabled: function () {
-                        if (projectReadOnly) {
-                            return true;
-                        }
-                        return !project.Ration.canAdd(project.mainTree.selected);
-                    },
-                    callback: function (key, opt) {
-                        //名称取清单名称,单位取清单单位
-                        let selected = project.mainTree.selected;
-                        let billNode = selected;
-                        if(selected.sourceType==project.Ration.getSourceType()) billNode = selected.parent;
-                        let ext = {name:billNode.data.name,unit:billNode.data.unit};
-                        project.Ration.insertVolumePrice(gljType.GENERAL_MATERIAL,ext);
-                    },
-                },
 
                 "insertLJ": {
                     name: "插入量价",//插入量价不需要自动定位到编号列
@@ -1452,6 +1434,24 @@ var projectObj = {
                         }
                     }
                 },
+                "insertMaterial": {
+                    name: "按清单名称插入材料",//插入量价不需要自动定位到编号列
+                    icon: 'fa-sign-in',
+                    disabled: function () {
+                        if (projectReadOnly) {
+                            return true;
+                        }
+                        return !project.Ration.canAdd(project.mainTree.selected);
+                    },
+                    callback: function (key, opt) {
+                        //名称取清单名称,单位取清单单位
+                        let selected = project.mainTree.selected;
+                        let billNode = selected;
+                        if(selected.sourceType==project.Ration.getSourceType()) billNode = selected.parent;
+                        let ext = {name:billNode.data.name,unit:billNode.data.unit};
+                        project.Ration.insertVolumePrice(gljType.GENERAL_MATERIAL,ext);
+                    },
+                },
                 "insertEquipment": {
                     name: "插入设备",
                     icon: 'fa-sign-in',