Просмотр исходного кода

Merge branch '1.0.0_online' of http://192.168.1.12:3000/SmartCost/ConstructionCost into 1.0.0_online

TonyKang 6 лет назад
Родитель
Сommit
640256a1ac

+ 5 - 1
public/scHintBox.html

@@ -148,7 +148,11 @@
             $("#hintBox_form").modal('show');
 
         },
-        valueBox: function (title, value, doOK) {
+        valueBox: function (title, value, doOK,row) {
+            if(row && row>0){//默认为input,如果有row说明是要多行输入,把input换成textarea.
+                $('#hintBox_value').remove();
+                $("#hintBox_error").before(` <textarea id="hintBox_value" class="form-control" rows="${row}"></textarea>`);
+            }
             this.init();
             $('#hintBox_title').text(title);
             this.value = value;

+ 11 - 10
public/web/tree_sheet/tree_sheet_controller.js

@@ -83,25 +83,26 @@ var TREE_SHEET_CONTROLLER = {
                 }
             }
         };
-        controller.prototype.m_delete = function (nodes, beginRow = null) {//删除选中的多行节点
+        controller.prototype.m_delete = function (nodes, beginRow = null,selectNew = true) {//删除选中的多行节点,selectNew 为false时删除后不改变tree的选中节点
             var that = this, sels = this.sheet.getSelections();
             if (this.tree.selected) {
                 if (this.tree.m_delete(nodes)) {
                     TREE_SHEET_HELPER.massOperationSheet(this.sheet, function () {
                         let rowCount = 0;
+                        let delRow = beginRow?beginRow:sels[0].row;
                         for(let node of nodes){
                             rowCount = rowCount+node.posterityCount() + 1;
                         }
-                        if(beginRow){
-                            sels[0].row = beginRow;
+                        that.sheet.deleteRows(delRow, rowCount);
+                        if(selectNew == true){
+                            if(beginRow) sels[0].row = beginRow;
+                            if(sels[0].row >=  that.tree.items.length){
+                                sels[0].row = that.tree.items.length-1;
+                                sels[0].colCount = 1;
+                            }
+                            that.setTreeSelected(that.tree.items[sels[0].row]);
+                            that.sheet.setSelection(sels[0].row,sels[0].col,1,sels[0].colCount);
                         }
-                        that.sheet.deleteRows(sels[0].row, rowCount);
-                        if(sels[0].row >=  that.tree.items.length){
-                            sels[0].row = that.tree.items.length-1;
-                            sels[0].colCount = 1;
-                        }
-                        that.setTreeSelected(that.tree.items[sels[0].row]);
-                        that.sheet.setSelection(sels[0].row,sels[0].col,1,sels[0].colCount);
                     });
                     if(typeof cbTools !== 'undefined'){
                         cbTools.refreshFormulaNodes();

+ 11 - 0
web/building_saas/css/main.css

@@ -25,6 +25,17 @@ a{
 .text-indent {
     text-indent:26px;
 }
+.modal-header{
+    background:#f2f2f2;
+    border-bottom:1px solid #ccc;
+    padding:.8rem 1rem;
+}
+.modal-title{
+    font-size:1rem;
+}
+.modal-footer{
+    padding:.8rem 1rem;
+}
 /*自定义css*/
 .login-body,.login-html{
     height:100%;

+ 5 - 17
web/building_saas/main/js/views/mbzm_view.js

@@ -149,7 +149,8 @@ let mbzm_obj={
         let rations = {update:[],create:[],delete:[]},bills={update:[],create:[]};
         if(this.datas.length <= 0) return;
         for(let d of this.datas){
-            if((gljUtil.isDef(d.quantity)&& parseFloat(d.quantity)>0)||(d.coe && d.coe!="0")){
+            let ration = _.find(projectObj.project.Ration.datas,{'referenceRationID':selected.data.ID,'code':d.code});
+            if(ration||(gljUtil.isDef(d.quantity)&& parseFloat(d.quantity)>0)||(d.coe && d.coe!="0")){
                 if(this.positionChecking(createLocation,d) == false){//清单位置检查
                     alert(`请选择${d.code}生成的清单位置`);
                     return;
@@ -175,25 +176,11 @@ let mbzm_obj={
                     if(dRaNode){
                         parentsNodes.push(dRaNode.parent);
                         projectObj.project.Ration.deleteSubListOfRation({ID:d.ID});
-                        //_.remove(projectObj.project.Ration.datas)
-//project.Ration.datas
+                        _.remove(projectObj.project.Ration.datas,{'ID':d.ID});
+                        projectObj.mainController.m_delete([dRaNode],dRaNode.serialNo(),false)//这里删除关联子目生成的定额因为是离散的树节点,所以要这样分开处理
                     }
                 }
-
-
             }
-
-           /* if(updateData['ration']){
-                for(let r_key in updateData['ration']){//定额只有删除,没有更新
-                    _.remove(ration_datas,{'ID':r_key});
-                    project.Ration.deleteSubListOfRation({ID:r_key});
-                }
-            }
-            for(let r of refNodes){
-                controller.m_delete([r],r.serialNo())//这里删除关联子目生成的定额因为是离散的树节点,所以要这样分开处理
-            }
-            */
-
             let refreshNodes = projectObj.project.updateNodesCache(result.updateDatas);//更新要update的前端缓存,并返回要刷新的树节点
             let nodeDatas = {ration:{add:[]}, bills:{add:[]}};
             if(result.rationResult){
@@ -220,6 +207,7 @@ let mbzm_obj={
                 $.bootstrapLoading.end();
                 cbTools.refreshFormulaNodes();
                 //更新计算程序模板,并进行重新计算
+                if(parentsNodes.length > 0) calRations = calRations.concat(parentsNodes);//计算被删除的子目关联定额的父节点
                 projectObj.project.calcProgram.calcNodesAndSave(calRations,function () {
                     installationFeeObj.calcInstallationFee();
                 });

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

@@ -1936,7 +1936,7 @@ var projectObj = {
         hintBox.valueBox(infoText, node.data[fieldID], function () {
             let newValue = hintBox.value;
             projectObj.updateNodeField(node,newValue,fieldID);
-        });
+        },3);
     },
     ifItemCharHiden:function (setting) {//项目特征及内容列是否隐藏
         if(this.itemCol == null||this.itemCol == undefined){