zhongzewei 7 роки тому
батько
коміт
9391ca1b63

+ 32 - 11
modules/complementary_ration_lib/controllers/compleViewController.js

@@ -11,34 +11,55 @@ let callback = function (req, res, err, msg, data) {
 };
 
 class CompleViewController extends BaseController{
-    redirectMain(req, res){
-        res.render('building_saas/complementary_ration_lib/html/main.html', {
-            userID: req.session.sessionUser.id,
-            compilationId: req.session.sessionCompilation._id
-        });
-    }
-
     redirectRation(req, res){
+        const repId = req.query.repository;
+        const redirectGlj = `/complementaryRation/glj?repository=${repId}`;
+        const redirectCoe = `/complementaryRation/coe?repository=${repId}`;
+        const redirectInstallation = `/complementaryRation/installation?repository=${repId}`;
         res.render('building_saas/complementary_ration_lib/html/dinge.html', {
-            userID: req.session.sessionUser.id
+            userID: req.session.sessionUser.id,
+            redirectGlj: redirectGlj,
+            redirectCoe: redirectCoe,
+            redirectInstallation: redirectInstallation
         });
     }
 
     redirectGljList(req, res){
+        const repId = req.query.repository;
+        const redirectRation = `/complementaryRation/ration?repository=${repId}`;
+        const redirectCoe = `/complementaryRation/coe?repository=${repId}`;
+        const redirectInstallation = `/complementaryRation/installation?repository=${repId}`;
         res.render('building_saas/complementary_ration_lib/html/gongliao.html', {
-            userID: req.session.sessionUser.id
+            userID: req.session.sessionUser.id,
+            redirectRation: redirectRation,
+            redirectCoe: redirectCoe,
+            redirectInstallation: redirectInstallation
         });
     }
 
     redirectCoeList(req, res){
+        const repId = req.query.repository;
+        const redirectRation = `/complementaryRation/ration?repository=${repId}`;
+        const redirectGlj = `/complementaryRation/glj?repository=${repId}`;
+        const redirectInstallation = `/complementaryRation/installation?repository=${repId}`;
         res.render('building_saas/complementary_ration_lib/html/fuzhu.html', {
-            userID: req.session.sessionUser.id
+            userID: req.session.sessionUser.id,
+            redirectRation: redirectRation,
+            redirectGlj: redirectGlj,
+            redirectInstallation: redirectInstallation
         });
     }
 
     redirectInstallation(req, res){
+        const repId = req.query.repository;
+        const redirectRation = `/complementaryRation/ration?repository=${repId}`;
+        const redirectGlj = `/complementaryRation/glj?repository=${repId}`;
+        const redirectCoe = `/complementaryRation/coe?repository=${repId}`;
         res.render('building_saas/complementary_ration_lib/html/anzhuang.html', {
-            userID: req.session.sessionUser.id
+            userID: req.session.sessionUser.id,
+            redirectRation: redirectRation,
+            redirectGlj: redirectGlj,
+            redirectCoe: redirectCoe
         });
     }
 

+ 0 - 1
modules/complementary_ration_lib/routes/routes.js

@@ -17,7 +17,6 @@ let gljController = new GljController();
 let searchController = new SearchController();
 
 module.exports = function (app) {
-    //app.get('/complementaryRation/main', compleViewController.init, compleViewController.redirectMain);
     app.get('/complementaryRation/ration', compleViewController.init, compleViewController.redirectRation);
     app.get('/complementaryRation/glj', compleViewController.init, compleViewController.redirectGljList);
     app.get('/complementaryRation/coe', compleViewController.init, compleViewController.redirectCoeList);

+ 3 - 2
public/web/commonAlert.js

@@ -9,8 +9,9 @@
  */
 
 window.alert = function(str) {
-    $('#commonAlert').find('p').text(str);
-    $('#commonAlert').modal('show');
+    /*$('#commonAlert').find('p').text(str);
+     $('#commonAlert').modal('show');*/
+    hintBox.infoBox('系统提示', str, 1);
 };
 
 

+ 3 - 3
web/building_saas/complementary_ration_lib/html/anzhuang.html

@@ -33,13 +33,13 @@
         <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
               <ul class="nav nav-tabs" role="tablist">
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="dinge" href="dinge.html">定额</a>
+                      <a class="nav-link px-3" id="dinge" href="<%= redirectRation %>">定额</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="gongliao" href="gongliao.html">人材机</a>
+                      <a class="nav-link px-3" id="gongliao" href="<%= redirectGlj %>">人材机</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="fuzhu" href="fuzhu.html">子目换算</a>
+                      <a class="nav-link px-3" id="fuzhu" href="<%= redirectCoe %>">子目换算</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link active px-3" >安装增加费</a>

+ 3 - 3
web/building_saas/complementary_ration_lib/html/dinge.html

@@ -37,13 +37,13 @@
                 <a class="nav-link active px-3" id ="dinge" >定额</a>
             </li>
             <li class="nav-item">
-                <a class="nav-link px-3" id="gongliao" href="#">人材机</a>
+                <a class="nav-link px-3" id="gongliao" href="<%= redirectGlj %>">人材机</a>
             </li>
             <li class="nav-item">
-                <a class="nav-link px-3" id="fuzhu" href="#">子目换算</a>
+                <a class="nav-link px-3" id="fuzhu" href="<%= redirectCoe %>">子目换算</a>
             </li>
             <li class="nav-item">
-                <a class="nav-link px-3" id="anzhuang" href="#">安装增加费</a>
+                <a class="nav-link px-3" id="anzhuang" href="<%= redirectInstallation %>">安装增加费</a>
             </li>
         </ul>
     </nav>

+ 3 - 3
web/building_saas/complementary_ration_lib/html/fuzhu.html

@@ -32,16 +32,16 @@
         <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
               <ul class="nav nav-tabs" role="tablist">
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="drirect-dinge" href="javascript:void(0);">定额</a>
+                      <a class="nav-link px-3" id="drirect-dinge" href="<%= redirectRation %>">定额</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="gongliao" href="javascript:void(0);">人材机</a>
+                      <a class="nav-link px-3" id="gongliao" href="<%= redirectGlj %>">人材机</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link active px-3">子目换算</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="anzhuang" href="javascript:void(0);">安装增加费</a>
+                      <a class="nav-link px-3" id="anzhuang" href="<%= redirectInstallation %>">安装增加费</a>
                   </li>
 
                   <li class="nav-item">

Різницю між файлами не показано, бо вона завелика
+ 4 - 3
web/building_saas/complementary_ration_lib/html/gongliao.html


+ 0 - 11
web/building_saas/complementary_ration_lib/js/coe.js

@@ -8,17 +8,6 @@ var pageObj = {
     libID: null,
     gljLibID: null,
     initPage: function (){
-        $("#drirect-dinge").click(function(){
-            $(this).attr('href', "/complementaryRation/ration" + "?repository=" + getQueryString("repository"))
-        });
-
-        $("#gongliao").click(function(){
-            $(this).attr('href', "/complementaryRation/glj" + "?repository=" + getQueryString("repository"))
-        });
-
-        $("#anzhuang").click(function(){
-            $(this).attr('href', "/complementaryRation/installation" + "?repository=" + getQueryString("repository"))
-        });
         var libID = getQueryString("repository");
         let me = this;
         CommonAjax.post('/complementaryRation/api/getRationLibs', {ids: [libID]}, function (rstData) {

+ 0 - 12
web/building_saas/complementary_ration_lib/js/installation.js

@@ -1,18 +1,6 @@
 /**
  * Created by Zhong on 2018/1/19.
  **/
-$("#gongliao").click(function(){
-    $(this).attr('href', "/complementaryRation/glj" + "?repository=" + getQueryString("repository"))
-});
-
-$("#fuzhu").click(function(){
-    $(this).attr('href', "/complementaryRation/coe" + "?repository=" + getQueryString("repository"))
-});
-
-$("#dinge").click(function(){
-    $(this).attr('href', "/complementaryRation/ration" + "?repository=" + getQueryString("repository"))
-});
-
 $(document).ready(function () {
     feeItemObj.buildSheet();
 });

+ 0 - 12
web/building_saas/complementary_ration_lib/js/ration.js

@@ -1,18 +1,6 @@
 /**
  * Created by Tony on 2017/4/28.
  */
-
-$("#gongliao").click(function(){
-    $(this).attr('href', "/complementaryRation/glj" + "?repository=" + getQueryString("repository"))
-});
-
-$("#fuzhu").click(function(){
-    $(this).attr('href', "/complementaryRation/coe" + "?repository=" + getQueryString("repository"))
-});
-
-$("#anzhuang").click(function(){
-    $(this).attr('href', "/complementaryRation/installation" + "?repository=" + getQueryString("repository"))
-});
 const digital = {
     gljPrc: -3,//计算定额基价时单个工料机价格取三位
     rationBasePrc: -2,

+ 1 - 12
web/building_saas/complementary_ration_lib/js/repository_glj.js

@@ -2,22 +2,11 @@
  * Created by Tony on 2017/5/5.
  */
 
-$("#drirect-dinge").click(function(){
-    $(this).attr('href', "/complementaryRation/ration" + "?repository=" + getQueryString("repository"))
-});
-
-$("#fuzhu").click(function(){
-    $(this).attr('href', "/complementaryRation/coe" + "?repository=" + getQueryString("repository"))
-});
-
-$("#anzhuang").click(function(){
-    $(this).attr('href', "/complementaryRation/installation" + "?repository=" + getQueryString("repository"))
-});
-
 var pageOprObj = {
     rationLibName : null,
     rationLibId: null,
     initPage : function(container) {
+        $.bootstrapLoading.start();
         var me = this, rationLibId = getQueryString("repository");//获取定额库参数
         me.rationLibId = rationLibId;
         //getRationLibName

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

@@ -596,8 +596,8 @@
                     </div>
                 </div>
                 <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                     <a href="javascript:void(0);" class="btn btn-primary" id="property_ok" data-dismiss="modal">确定</a>
+                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 </div>
             </div>
         </div>
@@ -1120,8 +1120,8 @@
                     <button type="button" class="btn btn-primary" id="uploadExample">示例</button>
                 </div>
                 <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                     <a href="javascript:void(0);" class="btn btn-primary" id="uploadConfirm">确定导入</a>
+                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                 </div>
             </div>
         </div>

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

@@ -998,6 +998,89 @@ var projectObj = {
         if (selectedArea.colCount <= 1 && selectedArea.rowCount <= 1) {
             return false;
         }
+        //获取最左最右坐标
+        let maxCell = {row: selectedArea.row, col: selectedArea.col + selectedArea.colCount};
+        let maxCellX = sheet.getCellRect(maxCell.row, maxCell.col).x ? sheet.getCellRect(maxCell.row, maxCell.col).x : sheet.getCellRect(maxCell.row, maxCell.col - 1).x;
+        let minCell = {row: selectedArea.row, col: selectedArea.col};
+        let minCellX = sheet.getCellRect(minCell.row, minCell.col).x ? sheet.getCellRect(minCell.row, minCell.col).x : sheet.getCellRect(minCell.row, minCell.col + 1).x;
+        // 获取鼠标位置
+        let x = window.event.clientX;
+        let y = window.event.clientY;
+
+        // 匹配数字或小数
+        const regular = /^([0-9]+[.]{1}[0-9]+)$|^([1-9]{1}\d*)$/;
+        // 小数点最高位数
+        let max = 0;
+        let total = 0;
+        let counter = 0;
+        for (let col = selectedArea.col; col < (selectedArea.colCount + selectedArea.col); col++) {
+            for (let row = selectedArea.row; row < (selectedArea.rowCount + selectedArea.row); row++) {
+                const value = sheet.getCell(row, col).text();
+                if (!regular.test(value)) {
+                    continue;
+                }
+                counter++;
+                // 获取当前数据小数位数
+                let pointPosition = value.toString().indexOf(".");
+                pointPosition = pointPosition < 0 ? pointPosition : pointPosition + 1;
+                const current = pointPosition > 0 ? value.toString().substring(pointPosition, value.toString().length).length : 0;
+                max = current > max ? current : max;
+                total += parseFloat(value);
+            }
+        }
+        // 如果不为0则悬浮显示
+        if (total > 0 && counter > 1) {
+            const div = $('<div id="total-tips"><p>合计: <input type="text" id="total" readonly="readonly" style="border: none;"/></p><p><a href="javascript:void(0);">复制</a></p></div>');
+            div.css({
+                position: "absolute",
+                border: "1px #C0C0C0 solid",
+                background: "#fff",
+                boxShadow: "1px 2px 5px rgba(0,0,0,0.4)",
+            });
+            div.children("p").css({
+                textAlign: "center",
+                padding: 8,
+                marginBottom: 2,
+            });
+            div.children("p").first().css({
+                borderBottom: "1px #C0C0C0 solid"
+            });
+            const totalString = total.toFixed(max);
+            // input长度
+            const inputWidth = totalString.length * 8;
+            // 计算是否会超出显示范围
+            const baseWidth = 48;
+            const baseHeight = 81;
+            const canvasWidth = $("#billsSpreadvp_vp").width();
+            const canvasHeight = $("#billsSpreadvp_vp").height();
+            //x = x + baseWidth + inputWidth > canvasWidth ? x - baseWidth - inputWidth : x;
+            x = maxCellX + baseWidth + inputWidth > canvasWidth ? minCellX - baseWidth - inputWidth : maxCellX + baseWidth;
+            y = y + baseHeight > canvasHeight ? y - baseHeight : y;
+            //test
+            let testT = sheet.getParent().hitTest(x, y);
+            //test
+            div.css({
+                left: x,
+                top: y,
+            });
+
+            div.children().children("#total").width(inputWidth).val(totalString);
+            $("body").append(div);
+            // 用于判断是否要关闭窗体
+            setTimeout(function() {
+                isTotalShowing = true;
+            }, 200);
+        };
+    },
+    /*amountAreaNumber: function(e, info) {
+        if (info.newSelections === undefined || info.newSelections.length <= 0) {
+            return false;
+        }
+        const selectedArea = info.newSelections[0];
+        const sheet = info.sheet;
+        if (selectedArea.colCount <= 1 && selectedArea.rowCount <= 1) {
+            return false;
+        }
         // 获取鼠标位置
         let x = window.event.clientX;
         let y = window.event.clientY;
@@ -1050,6 +1133,10 @@ var projectObj = {
             const canvasHeight = $("#billsSpreadvp_vp").height();
             x = x + baseWidth + inputWidth > canvasWidth ? x - baseWidth - inputWidth : x;
             y = y + baseHeight > canvasHeight ? y - baseHeight : y;
+            //test
+            let testT = sheet.getParent().hitTest(x, y);
+            console.log(sheet.getCellRect(0, 0));
+            //test
             div.css({
                 left: x,
                 top: y,
@@ -1062,7 +1149,7 @@ var projectObj = {
                 isTotalShowing = true;
             }, 200);
         };
- },
+ },*/
 
     onButtonClick: function (e, info) {
         let colSetting = projectObj.mainController.setting.cols[info.col];

+ 2 - 0
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -567,10 +567,12 @@ const billsGuidance = (function () {
                         bills.controller.setTreeSelected(result[0]);
                         billsSheet.setSelection(result[0].serialNo(), sel[0].col, 1, 1);
                         billsInitSel(result[0].serialNo());
+                        billsSheet.showRow(result[0].serialNo(), GC.Spread.Sheets.VerticalPosition.bottom);
                     } else {
                         bills.controller.setTreeSelected(result[resultIndex + 1]);
                         billsSheet.setSelection(result[resultIndex + 1].serialNo(), sel[0].col, 1, 1);
                         billsInitSel(result[resultIndex + 1].serialNo());
+                        billsSheet.showRow(result[resultIndex + 1].serialNo(), GC.Spread.Sheets.VerticalPosition.bottom);
                     }
                 });
             } else {

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

@@ -278,7 +278,7 @@ var billsLibObj = {
                     } else {
                         stdBillsTreeController.setTreeSelected(result[resultIndex + 1]);
                         billsLibObj.stdBillsSpread.getActiveSheet().setSelection(result[resultIndex + 1].serialNo(), sel[0].col, 1, 1);
-                        billsLibObj.stdBillsSpread.getActiveSheet().showRow(result[resultIndex + 1].serialNo(), GC.Spread.Sheets.VerticalPosition.top);
+                        billsLibObj.stdBillsSpread.getActiveSheet().showRow(result[resultIndex + 1].serialNo(), GC.Spread.Sheets.VerticalPosition.bottom);
                     }
                 });
             } else {

+ 7 - 7
web/building_saas/pm/html/project-management.html

@@ -229,8 +229,8 @@
                 </form>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 <a href="javascript:void(0);" class="btn btn-primary" id="addProjOk">确定</a>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
     </div>
@@ -256,8 +256,8 @@
                 </form>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 <a href="javascript:void(0);" class="btn btn-primary" id="add-engineering-confirm">确定</a>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
     </div>
@@ -342,8 +342,8 @@
                 </form>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 <a href="javascript:void(0);" class="btn btn-primary" id="add-tender-confirm">确定</a>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
     </div>
@@ -369,8 +369,8 @@
                 </form>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 <a href="javascript:void(0);" class="btn btn-primary" id="add-folder-confirm">确定</a>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
     </div>
@@ -394,8 +394,8 @@
                 </form>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 <a href="javascript:void(0);" class="btn btn-primary" id="rename-confirm">确定</a>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
     </div>
@@ -416,8 +416,8 @@
                 <p class="" id = 'restoreHint'>删除后,你可以在回收站找到它。</p>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 <a href="javascript:void(0);" class="btn btn-danger" id="delete-confirm">删除</a>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
     </div>
@@ -458,8 +458,8 @@
                 </div>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 <a href="javacript:void(0);" class="btn btn-primary disabled" id="copy-to-confirm" >确定</a>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>
     </div>

+ 2 - 2
web/building_saas/pm/js/pm_newMain.js

@@ -803,9 +803,9 @@ const projTreeObj = {
         let fuc = function(){
             sheet.setRowCount(0);
             sheet.setRowCount(nodes.length);
+            let treeNodeCell = me.getTreeNodeCell(tree);
+            sheet.getRange(-1, 0, -1, 1).cellType(treeNodeCell);
             for(let i = 0; i < nodes.length; i++){
-                let treeNodeCell = me.getTreeNodeCell(tree);
-                sheet.getCell(i, 0).cellType(treeNodeCell);
                 for(let j = 0; j < headers.length; j++){
                     sheet.getRange(-1, j, -1, 1).hAlign(GC.Spread.Sheets.HorizontalAlign[headers[j]['hAlign']]);
                     sheet.getRange(-1, j, -1, 1).vAlign(GC.Spread.Sheets.VerticalAlign[headers[j]['vAlign']]);

+ 1 - 1
web/common/html/header.html

@@ -1,5 +1,5 @@
 <nav class="navbar navbar-expand-lg p-0 d-flex">
-    <a class="header-logo px-2" href="/pm" style="text-decoration: none;">纵横云价</a>
+    <a class="header-logo px-2" href="/pm" style="text-decoration: none;">纵横云价</a>
     <ul class="nav navbar-nav px-1" id="header-menu" style="display: none;">
         <li class="nav-item">
             <a class="nav-link" href="#" aria-expanded="false" data-toggle="modal" data-target="#poj-set"><i class="fa fa-cube"></i> 项目属性</a>