Selaa lähdekoodia

Merge branch 'master' into GuangdongTax

Conflicts:
	web/building_saas/main/js/views/character_content_view.js
zhangweicheng 5 vuotta sitten
vanhempi
commit
580423612e

+ 4 - 1
package.json

@@ -64,6 +64,9 @@
     "start": "C:\\Users\\mai\\AppData\\Roaming\\npm\\babel-node.cmd server.js",
     "server": "node --max-old-space-size=2048 server.js",
     "socket": "node socket.js",
-    "import": "node --max-old-space-size=2048 importserver.js"
+    "import": "node --max-old-space-size=2048 importserver.js",
+    "dev_server":"SET NODE_ENV=qa&& babel-node server.js",
+    "dev_socket":"SET NODE_ENV=qa&& babel-node socket.js",
+    "dev_import":"SET NODE_ENV=qa&& babel-node importserver.js"
   }
 }

+ 39 - 1
public/web/headerOpr.js

@@ -1,4 +1,4 @@
-                                                                                                                                                                                                                                      'use strict';
+'use strict';
 
 /**
  *
@@ -51,12 +51,20 @@ const CommonHeader = (function () {
             }
         })
     }
+
+    // 推荐给朋友
+    const copyDom = $('#copy_link');
+
     //绑定事件
     //@return {void}
     function addEventListener(){
         csDom.click(function () {
             getCategoryList(-1, '联系客服');
         });
+        copyDom.click(function () {
+            copy('大司空市政云计价,正版软件永久免费\r\nhttps://yun.smartcost.com.cn');
+            $('#show_share_msg').show();
+        })
     }
     //取消浏览器自带右键
     //@return {void}
@@ -76,6 +84,36 @@ const CommonHeader = (function () {
             }
         }
     }
+
+    /**
+     * 复制字符串到剪贴板的函数
+     * @param {String} value 需要被复制的字符串
+     * @returns {Boolean} 操作结果
+     */
+    function copy(value){
+        var currentFocus = document.activeElement;// 保存当前活动节点
+
+        let input = document.createElement('textarea');// 创建一个texterea标签
+        document.body.appendChild(input);// 把标签添加给body
+        input.style.opacity = 0;//设置input标签设置为透明(不可见)
+        input.value = value;// 把需要复制的值放到input上
+
+        // 记录当前滚动位置, 因为添加节点并选中的时候回影响页面滚动
+        let scrollY = window.scrollY;
+
+        input.focus();// input节点获取焦点
+        input.setSelectionRange(0, input.value.length);// 选中input框中的所有文字
+
+        var res = document.execCommand('copy');// 复制文字并获取结果
+
+        currentFocus.focus();// 之前活动节点获得焦点
+        document.body.removeChild(input);// 删除添加的input节点
+
+        // 页面滚动到之前位置
+        window.scrollTo(0, scrollY);
+
+        return res;// 返回操作结果
+    }
     return {getCategoryList, addEventListener, banNavigatorContextMenu};
 })();
 

+ 3 - 3
public/web/sheet/sheet_common.js

@@ -307,9 +307,6 @@ var sheetCommonObj = {
         for (var row = 0; row < data.length; row++) {
             //var cell = sheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport);
             this.showRowData(sheet,setting,row,data,distTypeTree);
-            if(setting.getStyle && setting.getStyle(data[row])){
-                sheet.setStyle(row, -1, setting.getStyle(data[row]));
-            }
         }
         if(setting.emptyRowHeader){
             let rowCount = sheet.getRowCount();
@@ -399,6 +396,9 @@ var sheetCommonObj = {
 
             sheet.autoFitRow(row);
         }
+        if(setting.getStyle && setting.getStyle(data[row],row,sheet.getActiveRowIndex())){
+          sheet.setStyle(row, -1, setting.getStyle(data[row]));
+        }
     },
     checkData : function(col,setting, value) {
         let result = true;

+ 1 - 1
web/building_saas/main/html/main.html

@@ -110,7 +110,7 @@
                 </span>
                       <% } %>
                     <!--<a href="javascript:void(0)" class="btn btn-light btn-sm" id="insertRation" data-toggle="tooltip" data-placement="bottom" data-original-title="插入定额"><i class="fa fa-sign-in" aria-hidden="true"></i></a>-->
-                    <!--2018-11-15 隐藏删除按钮   <a href="javascript:void(0)" class="btn btn-light btn-sm" id="delete" data-toggle="tooltip" data-placement="bottom" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>-->
+                    <a href="javascript:void(0)" class="btn btn-light btn-sm" id="delete" data-toggle="tooltip" data-placement="bottom" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
                     <a href="javascript:void(0)" class="btn btn-light btn-sm" id="upLevel" data-toggle="tooltip" data-placement="bottom" data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
                     <a href="javascript:void(0)"  class="btn btn-light btn-sm" id="downLevel" data-toggle="tooltip" data-placement="bottom" data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
                       <a href="javascript:void(0)" class="btn btn-light btn-sm" id="upMove" data-toggle="tooltip" data-placement="bottom" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>

+ 1 - 0
web/building_saas/main/js/models/bills.js

@@ -976,6 +976,7 @@ var Bills = {
             if(!billID){
                 billID = uuid.v1();
             }
+            if(!code) code = "BAZF";//2019-07-12  需求的修改,改成计算的时候不判断是否计取,直接按定额下的安装增加费的设置改了需求后,有可能造成选取位置为空的情况,这时code为undefinded
             let data = {
                 ID:billID,
                 projectID: parseInt(projectObj.project.ID()),

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

@@ -184,7 +184,7 @@ let contentOprObj = {
         if (!billsNode || !Array.isArray(billsNode.data.jobContent)) {
             return '';
         }
-        return billsNode.data.jobContent[0] && billsNode.data.jobContent[0].content || '';
+         return billsNode.data.jobContent.length>0?billsNode.data.jobContent[0].content:"";
     },
     // 从清单节点获取工作内容文本数据
     getContentTexts: function (billsNode) {

+ 7 - 1
web/building_saas/main/js/views/glj_col.js

@@ -70,7 +70,13 @@ let gljCol = {
             lockColumns: ["code","name","specs","unit","short_name","tenderPrice","adjustPrice","quantity","tenderQuantity"]
         },
         frozenCols:4,
-        headRows:2
+        headRows:2,
+        getStyle:function (data,row,activeRow) {
+          if(row == activeRow){//选中黄色显示
+              return {backColor:"#FFFACD"};
+          }
+          return null;
+      },
     },
     mixRatio_Setting:{
         header:[

+ 2 - 2
web/building_saas/main/js/views/glj_view.js

@@ -348,7 +348,7 @@ var gljOprObj = {
             gljOprObj.initSelection({row: gljOprObj.gljLibSheet.getActiveRowIndex()});
         });
     },
-    getSelStyle: function (selected,settingStyle) {
+    getSelStyle: function (selected,settingStyle,rcolor) {
         let style = new GC.Spread.Sheets.Style();
         if(settingStyle){
             for(let key in settingStyle){
@@ -361,7 +361,7 @@ var gljOprObj = {
         style.borderBottom = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
         let colorOpts = optionsOprObj.getOption(optionsOprObj.optionsTypes.COLOROPTS);
         let selectedColor = colorOpts.SELECTED.backColor,
-            recColor = 'White';
+            recColor =  rcolor?rcolor:'White';
         style.backColor = selected ? selectedColor : recColor;
         return style;
     },

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

@@ -291,7 +291,7 @@ let MainTreeCol = {
                 field === 'jobContentText') {
                 return false;
             }
-            return !MainTreeCol.readOnly.bills(node) || (node.data.type !== billType.BILL && node.data.type !== billType.FX);
+            return !MainTreeCol.readOnly.bills(node) || (node.data.type !== billType.BILL && node.data.type !== billType.FX && node.data.type !== billType.BX);
         },
         forRuleText: function (node) {
             if(MainTreeCol.readOnly.bills(node)){

+ 26 - 16
web/building_saas/main/js/views/project_glj_view.js

@@ -213,19 +213,19 @@ let projectGljObject={
             gljId = null
         }
         projectObj.project.projectGLJ.getRatioData(gljId,function (data) {
-            if(gljId !== projectObj.project.projectGLJ.getRatioId){//两个id不一致说明不是最新的请求,不用往下执行。
-                return;
-            }
-            let ratioList =[];
-            for(let glj of data){
-                ratioList.push(me.getMixRatioSheetData(glj)) ;
-            }
-            ratioList = gljUtil.sortRationGLJ(ratioList);
-            me.mixRatioData = ratioList;
-            me.mixRatioSheet.setRowCount(0);
-            sheetCommonObj.showData(me.mixRatioSheet, me.mixRatioSetting,me.mixRatioData);
-            me.mixRatioSheet.setRowCount(me.mixRatioData.length);
-            me.mixRatioSheet.setSelection(oldSel.row==-1?0:oldSel.row,oldSel.col,oldSel.rowCount,oldSel.colCount);
+          if(gljId !== projectObj.project.projectGLJ.getRatioId){//两个id不一致说明不是最新的请求,不用往下执行。
+              return;
+          }
+          let ratioList =[];
+          for(let glj of data){
+              ratioList.push(me.getMixRatioSheetData(glj)) ;
+          }
+          ratioList = gljUtil.sortRationGLJ(ratioList);
+          me.mixRatioData = ratioList;
+          me.mixRatioSheet.setRowCount(0);
+          sheetCommonObj.showData(me.mixRatioSheet, me.mixRatioSetting,me.mixRatioData);
+          me.mixRatioSheet.setRowCount(me.mixRatioData.length);
+          me.mixRatioSheet.setSelection(oldSel.row==-1?0:oldSel.row,oldSel.col,oldSel.rowCount,oldSel.colCount);
         })
     },
     getMixRatioSheetData:function (glj) {
@@ -303,10 +303,20 @@ let projectGljObject={
         let me = projectGljObject;
         let newSel = args.newSelections[0];
         let oldSel = args.oldSelections?args.oldSelections[0]:{};
+        me.projectGljSheet.suspendPaint();
+        me.projectGljSheet.suspendEvent();
         if(newSel.row != oldSel.row){
-           me.projectGljRowChang();
-        }
-        me.projectGljSheet.repaint();
+          let style = gljOprObj.getSelStyle(true,{});
+          me.projectGljSheet.setStyle(newSel.row, -1, style);
+          let orow = oldSel.row==''||oldSel.row==-1?0:oldSel.row;
+          let tstyle = gljOprObj.getSelStyle(false,{},me.projectGljSheetData[orow].bgColour);
+          me.projectGljSheet.setStyle(orow, -1, tstyle);
+          me.projectGljRowChang();
+        }else{
+          me.projectGljSheet.repaint();
+        }
+        me.projectGljSheet.resumeEvent();
+        me.projectGljSheet.resumePaint();
     },
     projectGljRowChang:function(row){
         let me = projectGljObject;

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

@@ -1660,9 +1660,6 @@ var projectObj = {
                     name: '删除',
                     icon: 'fa-remove',
                     disabled: function () {
-                        if (projectReadOnly) {
-                            return true;
-                        }
                         return !ifCanDelete();
                     },
                     callback: function () {
@@ -2871,6 +2868,9 @@ function isSingleSelect() {//是否选中造价书中的单行
     return false;
 }
 function ifCanDelete() {
+    if (projectReadOnly) {
+      return false;
+    }
     let selections = projectObj.mainSpread.getActiveSheet().getSelections();
     let tree = projectObj.project.mainTree;
     let selected = projectObj.project.mainTree.selected;

+ 25 - 0
web/common/html/header.html

@@ -17,6 +17,9 @@
     <div class="navbar-text p-0 navbar-expand-sm">
         <!--大屏菜单-->
         <ul class="nav navbar-nav" id="fluid-menu">
+            <li class="nav-item" >
+                <a class="nav-link" href="#send2friends" data-toggle="modal" data-target="#send2friends" ><i class="fa fa-share-alt"></i> 推荐给朋友</a>
+            </li>
             <li class="nav-item dropdown" id="showqqgroup" >
                 <a class="nav-link" href="#"><i class="fa fa-qq" ></i> 群</a>
                 <div class="dropdown-menu p-3 dropdown-menu-right" id="qqgroup" style="width: 200px;top:36px">
@@ -280,6 +283,28 @@
         </div>
     </div>
 </div>
+<!--推荐给朋友-->
+<div class="modal fade" id="send2friends" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">推荐给朋友</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <div class="input-group mb-3">
+                    <input type="text" class="form-control " value="https://yun.smartcost.com.cn" disabled>
+                    <div class="input-group-append">
+                        <button class="btn btn-outline-secondary" id="copy_link">复制链接</button>
+                    </div>
+                </div>
+                <div id="show_share_msg" style="display: none" class="alert alert-success">地址复制成功,快去发给朋友试试吧。</div>
+            </div>
+        </div>
+    </div>
+</div>
 <div style="display: none">
     <%include dataStatistics.html %>
 </div>