Explorar el Código

Merge branch '1.0.0_online' of http://smartcost.f3322.net:3000/SmartCost/ConstructionOperation into 1.0.0_online

TonyKang hace 7 años
padre
commit
ea19be4384

+ 5 - 0
modules/all_models/manager.js

@@ -55,6 +55,11 @@ let modelSchema = {
         type: Number,
         type: Number,
         default: 0
         default: 0
     },
     },
+    //职称
+    position: {
+        type: String,
+        default: ''
+    },
     // 超级管理员 1为超级管理员
     // 超级管理员 1为超级管理员
     super_admin: {
     super_admin: {
         type: Number,
         type: Number,

+ 2 - 0
modules/all_models/stdRation_coe.js

@@ -12,6 +12,8 @@ const coeSchema = new Schema({
     amount: String,                 // 调整的量
     amount: String,                 // 调整的量
     gljCode: String,
     gljCode: String,
     gljName: String,
     gljName: String,
+    replaceCode:String,
+    replaceName:String,
     _id: false
     _id: false
 });
 });
 
 

+ 11 - 6
modules/users/models/manager_model.js

@@ -25,7 +25,7 @@ class ManagerModel extends BaseModel {
      * @var
      * @var
      */
      */
     permission = {
     permission = {
-        'manager': '用户管理',
+        'user': '用户管理',
         'notify': '通知管理',
         'notify': '通知管理',
         'stdBillsmain': '清单规则编辑器',
         'stdBillsmain': '清单规则编辑器',
         'rationRepository': '定额编辑器',
         'rationRepository': '定额编辑器',
@@ -132,17 +132,17 @@ class ManagerModel extends BaseModel {
         let managerData = await this.findDataByCondition({username: username});
         let managerData = await this.findDataByCondition({username: username});
 
 
         // 没有找到对应数据
         // 没有找到对应数据
-        if (managerData === null || managerData._id === undefined) {
+        /*if (managerData === null || managerData._id === undefined) {
             throw {code: 44001, err: '用户名或密码错误'};
             throw {code: 44001, err: '用户名或密码错误'};
-        }
+        }*/
 
 
         // 是否禁止登录
         // 是否禁止登录
-        if (managerData.can_login !== 1) {
+        if (managerData && managerData.can_login !== 1) {
             throw {code: 44002, err: '用户名不存在'};
             throw {code: 44002, err: '用户名不存在'};
         }
         }
 
 
         // 如果不是超级管理员登录则走CLD接口登录流程
         // 如果不是超级管理员登录则走CLD接口登录流程
-        if (username !== this.adminUsername) {
+        if (managerData === null || managerData._id === undefined || username !== this.adminUsername) {
             let CLDLoginInfo = await this.CLDLogin(username, password, managerData);
             let CLDLoginInfo = await this.CLDLogin(username, password, managerData);
             managerData = CLDLoginInfo;
             managerData = CLDLoginInfo;
         } else {
         } else {
@@ -196,6 +196,7 @@ class ManagerModel extends BaseModel {
         // 不存在则新增
         // 不存在则新增
         this.setScene('cldInsert');
         this.setScene('cldInsert');
         let current = new Date().getTime();
         let current = new Date().getTime();
+        //cld账号登录的统一设置可以看到用户管理和允许登录
         let insertData = {
         let insertData = {
             username: username,
             username: username,
             password: '',
             password: '',
@@ -203,7 +204,9 @@ class ManagerModel extends BaseModel {
             create_time: current,
             create_time: current,
             last_login: current,
             last_login: current,
             office: responseData.office,
             office: responseData.office,
-            can_login: 0
+            position: responseData.position,
+            permission: 'user',
+            can_login: 1
         };
         };
         result = this.db.create(insertData);
         result = this.db.create(insertData);
 
 
@@ -220,6 +223,8 @@ class ManagerModel extends BaseModel {
         return new Promise(function(resolve, reject) {
         return new Promise(function(resolve, reject) {
             // 发起请求
             // 发起请求
             Request.post(postOption, function(error, response, body) {
             Request.post(postOption, function(error, response, body) {
+                console.log(`body`);
+                console.log(body);
                 if (error || response.statusCode !== 200) {
                 if (error || response.statusCode !== 200) {
                     console.log(response.statusCode + ':' + error);
                     console.log(response.statusCode + ':' + error);
                     reject({code: 44002, err: '接口请求出错'});
                     reject({code: 44002, err: '接口请求出错'});

+ 14 - 5
web/common/js/slideResize.js

@@ -35,9 +35,11 @@ function slideResize(eles, limit, type, callback) {
     let navSize = 0;
     let navSize = 0;
     let nEleChangeSize = 0;
     let nEleChangeSize = 0;
     let fEleChangeSize = 0;
     let fEleChangeSize = 0;
+    let limitMax = 0;
 
 
     // 鼠标点下时
     // 鼠标点下时
     resizeElement.mousedown(function(e) {
     resizeElement.mousedown(function(e) {
+        limitMax = eval(limit.max);
         mouseMoveCount = 0;
         mouseMoveCount = 0;
         drag = true;
         drag = true;
         startP = type === 'height' ? e.clientY : e.clientX;
         startP = type === 'height' ? e.clientY : e.clientX;
@@ -59,11 +61,11 @@ function slideResize(eles, limit, type, callback) {
             // 判断拖动范围不能超出
             // 判断拖动范围不能超出
             nEleChangeSize = nEleSize + moveSize;
             nEleChangeSize = nEleSize + moveSize;
             nEleChangeSize = nEleChangeSize < limit.min ? limit.min : nEleChangeSize;
             nEleChangeSize = nEleChangeSize < limit.min ? limit.min : nEleChangeSize;
-            nEleChangeSize = nEleChangeSize > limit.max ? limit.max + 9 : nEleChangeSize;
+            nEleChangeSize = nEleChangeSize > limitMax ? limitMax + 9 : nEleChangeSize;
 
 
             fEleChangeSize = fEleSize - moveSize;
             fEleChangeSize = fEleSize - moveSize;
             fEleChangeSize = fEleChangeSize < limit.min ? limit.min : fEleChangeSize;
             fEleChangeSize = fEleChangeSize < limit.min ? limit.min : fEleChangeSize;
-            fEleChangeSize = fEleChangeSize > limit.max ? limit.max + 9 : fEleChangeSize;
+            fEleChangeSize = fEleChangeSize > limitMax ? limitMax + 9 : fEleChangeSize;
 
 
             if(type === 'width'){
             if(type === 'width'){
                 if(eles.totalWidth) {
                 if(eles.totalWidth) {
@@ -157,9 +159,15 @@ function setSizeWithPercent(tag,eles,nearSize,farSize,type) {
     farSize = parseFloat(farSize);
     farSize = parseFloat(farSize);
     if(type !== 'width') {
     if(type !== 'width') {
         let headerHeight = $(".header").height();
         let headerHeight = $(".header").height();
-        let toolsbarHeight = $(".toolsbar").height();
+        let toolsbarHeight = $(".toolsbar").height() ? $(".toolsbar").height() : 0;
+        let resizeHeight = 12;
         let exand = tag == "#main" ? 1:50;
         let exand = tag == "#main" ? 1:50;
-        let totalHeight = $(window).height() - headerHeight - toolsbarHeight-exand;
+        if (tag === '#stdRationSub') {
+            exand = 35;
+        } else if (tag === '#stdZmhsAdj'){
+            exand = 0;
+        }
+        let totalHeight = $(window).height() - headerHeight - toolsbarHeight - exand - resizeHeight;
         const navSize = eles.nav ? eles.nav[type]() + 4 : 0;
         const navSize = eles.nav ? eles.nav[type]() + 4 : 0;
         totalHeight = totalHeight - navSize;
         totalHeight = totalHeight - navSize;
         nearSize = (nearSize/(nearSize + farSize))* totalHeight;
         nearSize = (nearSize/(nearSize + farSize))* totalHeight;
@@ -176,7 +184,8 @@ function setDefaultSize(tag,eles,type) {
         let headerHeight = $(".header").height();
         let headerHeight = $(".header").height();
         let toolsbarHeight = $(".toolsbar").height();
         let toolsbarHeight = $(".toolsbar").height();
         let exand = tag == "#main" ? 1:50;
         let exand = tag == "#main" ? 1:50;
-        let totalHeight = $(window).height() - headerHeight - toolsbarHeight-exand;
+        let resizeHeight = 12;
+        let totalHeight = $(window).height() - headerHeight - toolsbarHeight-exand - resizeHeight;
         const navSize = eles.nav ? eles.nav[type]() + 4 : 0;
         const navSize = eles.nav ? eles.nav[type]() + 4 : 0;
         totalHeight = totalHeight - navSize;
         totalHeight = totalHeight - navSize;
         let nearSize = (o_nearSize/(o_nearSize + o_farSize))* totalHeight;
         let nearSize = (o_nearSize/(o_nearSize + o_farSize))* totalHeight;

+ 12 - 0
web/maintain/ration_repository/css/main.css

@@ -281,3 +281,15 @@ body {
 .btn.disabled, .btn:disabled {
 .btn.disabled, .btn:disabled {
     color: #999;
     color: #999;
 }
 }
+div.resize-y{
+    height: 12px;
+    background: #f7f7f9;
+    width: 100%;
+    cursor: s-resize;
+}
+div.resize-x{
+    width: 12px;
+    background: #f7f7f9;
+    height: 100%;
+    cursor: w-resize;
+}

+ 4 - 2
web/maintain/ration_repository/dinge.html

@@ -98,7 +98,8 @@
                                 <!--定额top-->
                                 <!--定额top-->
                                 <div id="rationItemsSheet" class="main-data-top"></div>
                                 <div id="rationItemsSheet" class="main-data-top"></div>
                                 <!--定额bottom-->
                                 <!--定额bottom-->
-                                <div class="bottom-content">
+                                <div class="resize-y" id="rationSubResize"></div>
+                                <div class="bottom-content" id="subContent">
                                     <!-- 标签 -->
                                     <!-- 标签 -->
                                     <ul class="nav nav-tabs" role="tablist">
                                     <ul class="nav nav-tabs" role="tablist">
                                         <li class="nav-item">
                                         <li class="nav-item">
@@ -176,10 +177,11 @@
                         </div>
                         </div>
                     </div>
                     </div>
                     <div class="main-side p-0 main-side-right" id="zmhsContent" style="width: 25%; display: none">
                     <div class="main-side p-0 main-side-right" id="zmhsContent" style="width: 25%; display: none">
-                        <div class="resize" id="sideResize" style="width: 1%; height: 100%; resize:horizontal; cursor: w-resize; float: left; background: #F1F1F1"></div>
+                        <div class="resize" id="slideResizeRight" style="width: 1%; height: 100%; resize:horizontal; cursor: w-resize; float: left; background: #F1F1F1"></div>
                         <div style="width: 99%; float: left">
                         <div style="width: 99%; float: left">
                             <div class="main-data-top-fluid" id="mainSpread">
                             <div class="main-data-top-fluid" id="mainSpread">
                             </div>
                             </div>
+                            <div class="resize-y" id="zmhsAdjResize"></div>
                             <div class="bottom-content" id="contentSpread">
                             <div class="bottom-content" id="contentSpread">
                             </div>
                             </div>
                         </div>
                         </div>

+ 138 - 31
web/maintain/ration_repository/js/coe.js

@@ -4,50 +4,137 @@
 //modiyied by zhong on 2017/9/21
 //modiyied by zhong on 2017/9/21
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-    //子目换算左右拖动
-    let sideResizeEles = {};
-    sideResizeEles.totalWidth = 0.75;
-    sideResizeEles.id = 'stdCoe';
-    sideResizeEles.resize = $('#sideResize');
-    sideResizeEles.evFixedSize = `$(window).width()-$('.main-nav').width()-5`;
-    sideResizeEles.nearElement = $('.main-content');
-    sideResizeEles.nearSpread = $('.main-content');
-    sideResizeEles.farElement = $('.main-side-right');
-    sideResizeEles.farSpread = $('.main-side-right');
-    sideResizeEles.nav = null;
-    slideResize(sideResizeEles, {min: 250, max: $('.content').width()-260}, 'width', function(){
-        if (sideResizeEles.id === 'stdCoe') {
-            coeOprObj.workBook.refresh();
-            gljAdjOprObj.workBook.refresh();
+    function refreshALlWorkBook() {
+        if (sectionTreeObj.workBook) {
+            sectionTreeObj.workBook.refresh();
+        }
+        if (rationOprObj.workBook) {
             rationOprObj.workBook.refresh();
             rationOprObj.workBook.refresh();
+        }
+        if (rationGLJOprObj.sheet && rationGLJOprObj.sheet.getParent()) {
             rationGLJOprObj.sheet.getParent().refresh();
             rationGLJOprObj.sheet.getParent().refresh();
         }
         }
+        if (coeOprObj.workBook) {
+            coeOprObj.workBook.refresh();
+        }
+        if (gljAdjOprObj.workBook) {
+            gljAdjOprObj.workBook.refresh();
+        }
+    }
+    const moduleName = 'stdRation';
+    //定额章节树与定额表
+    let leftElesObj = {};
+    leftElesObj.resize = $('#slideResizeLeft');
+    leftElesObj.parent = $('#dataRow');
+    leftElesObj.left = $('#leftContent');
+    leftElesObj.right = $('#mainContent');
+    let maxEval = `$('#zmhsContent').is(':visible') ? $('#dataRow').width() - $('#zmhsContent').width() - 300 : $('#dataRow').width()  - 300`;
+    horizontalSlide(moduleName, leftElesObj, {min: 300, max: maxEval}, function () {
+        refreshALlWorkBook();
     });
     });
+    loadHorizonWidth(moduleName, [$('#leftContent'), $('#mainContent')], function () {
+        //refreshAfterZmhs(false);
+        let leftContentWidth = parseFloat($('#leftContent')[0].style.width.replace('%', '')),
+            mainContentWidth = parseFloat($('#mainContent')[0].style.width.replace('%', ''));
+        let surplus = 100 - leftContentWidth - mainContentWidth;
+        $('#leftContent').css('width', `${leftContentWidth + surplus / 2}%`);
+        $('#mainContent').css('width', `${mainContentWidth + surplus / 2}%`);
 
 
+        refreshALlWorkBook();
+    });
+    //定额表与子目换算表
+    let rightElesObj = {};
+    rightElesObj.resize = $('#slideResizeRight');
+    rightElesObj.parent = $('#dataRow');
+    rightElesObj.left = $('#mainContent');
+    rightElesObj.right = $('#zmhsContent');
+    let maxEvalRight = `$('#dataRow').width() - $('#leftContent').width() - 200`;
+    horizontalSlide(moduleName, rightElesObj, {min: 200, max: maxEvalRight}, function () {
+        refreshALlWorkBook();
+    });
+
+    function refreshAfterZmhs(visible) {
+        const min = 20;
+        //宽度比例localstorage key
+        let leftContentKey = `${moduleName}${$('#leftContent').attr('id')}Width`,
+            mainContentKey = `${moduleName}${$('#mainContent').attr('id')}Width`,
+            zmhsContentKey = `${moduleName}${$('#zmhsContent').attr('id')}Width`;
+        let zmhsWidth = getLocalCache(zmhsContentKey) ? getLocalCache(zmhsContentKey) :$('#zmhsContent')[0].style.width,
+            mainContentWidth = $('#mainContent')[0].style.width,
+            leftContentWidth;
+        zmhsWidth = parseFloat(zmhsWidth.replace('%', ''));
+        mainContentWidth = parseFloat(mainContentWidth.replace('%', ''));
+        if (visible) {
+            mainContentWidth = mainContentWidth - zmhsWidth / 2 < min ? min : mainContentWidth - zmhsWidth / 2;
+            if (100 - mainContentWidth - zmhsWidth < min) {
+                leftContentWidth = min;
+                zmhsWidth = 100 - mainContentWidth - leftContentWidth;
+            } else {
+                leftContentWidth = 100 - mainContentWidth - zmhsWidth;
+            }
+        } else {
+            mainContentWidth += zmhsWidth / 2;
+            leftContentWidth = 100 - mainContentWidth;
+        }
+        $('#leftContent').css('width', `${leftContentWidth}%`);
+        setLocalCache(leftContentKey, `${leftContentWidth}%`);
+        $('#mainContent').css('width', `${mainContentWidth}%`);
+        setLocalCache(mainContentKey, `${mainContentWidth}%`);
+        $('#zmhsContent').css('width', `${zmhsWidth}%`);
+        setLocalCache(zmhsContentKey, `${zmhsWidth}%`);
+    }
     $('#zmhs').click(function () {
     $('#zmhs').click(function () {
         if(!$(this).hasClass('active')){
         if(!$(this).hasClass('active')){
             $(this).addClass('active');
             $(this).addClass('active');
-            $('#mainContent').css('width', '50%');
+            refreshAfterZmhs(true);
             $('#zmhsContent').show();
             $('#zmhsContent').show();
-            loadSize(sideResizeEles, 'width', function(){
-
-            });
             if(!coeOprObj.workBook){
             if(!coeOprObj.workBook){
                 pageObj.initPage();
                 pageObj.initPage();
             }
             }
-            coeOprObj.workBook.refresh();
-            gljAdjOprObj.workBook.refresh();
-            rationOprObj.workBook.refresh();
-            rationGLJOprObj.sheet.getParent().refresh();
+            refreshALlWorkBook();
         } else {
         } else {
             $(this).removeClass('active');
             $(this).removeClass('active');
-            $('#mainContent').css('width', '75%')
+            refreshAfterZmhs(false);
             $('#zmhsContent').hide();
             $('#zmhsContent').hide();
-            rationOprObj.workBook.refresh();
-            rationGLJOprObj.sheet.getParent().refresh();
+            refreshALlWorkBook();
         }
         }
     });
     });
+    //子目换算和调整表上下拖动
+    let zmhsAdjResize = getZmhsAdjResize();
+    slideResize(zmhsAdjResize, {min: 150, max: `$('#zmhsContent').height() - 140`}, 'height', function () {
+        if (coeOprObj.workBook) {
+            coeOprObj.workBook.refresh();
+        }
+        if (gljAdjOprObj.workBook) {
+            gljAdjOprObj.workBook.refresh();
+        }
+    });
+    loadZmhsAdjSize(zmhsAdjResize);
 });
 });
+function getZmhsAdjResize() {
+    let zmhsAdjResize = {};
+    zmhsAdjResize.id = '#stdZmhsAdj';
+    zmhsAdjResize.resize = $('#zmhsAdjResize')
+    zmhsAdjResize.nearElement = $('#mainSpread');
+    zmhsAdjResize.nearSpread = $('#mainSpread');
+    zmhsAdjResize.farElement = $('#contentSpread')
+    zmhsAdjResize.farSpread = $('#contentSpread');
+    zmhsAdjResize.nav = null;
+    return zmhsAdjResize;
+}
+function loadZmhsAdjSize(resizeObj) {
+    if (!resizeObj) {
+        resizeObj = getZmhsAdjResize();
+    }
+    loadSize(resizeObj, 'height', function () {
+        if (coeOprObj.workBook) {
+            coeOprObj.workBook.refresh();
+        }
+        if (gljAdjOprObj.workBook) {
+            gljAdjOprObj.workBook.refresh();
+        }
+    });
+}
 var pageObj = {
 var pageObj = {
     libID: null,
     libID: null,
     gljLibID: null,
     gljLibID: null,
@@ -413,10 +500,12 @@ let gljAdjOprObj = {
             {headerName:"名称", headerWidth:100, dataCode:"gljName", dataType: "String", hAlign: "center", vAlign: "center", readOnly: true},
             {headerName:"名称", headerWidth:100, dataCode:"gljName", dataType: "String", hAlign: "center", vAlign: "center", readOnly: true},
             {headerName:"操作符", headerWidth:60, dataCode:"operator", dataType: "String", hAlign: "center", vAlign: "center", readOnly: false},
             {headerName:"操作符", headerWidth:60, dataCode:"operator", dataType: "String", hAlign: "center", vAlign: "center", readOnly: false},
             {headerName:"数量", headerWidth:80, dataCode:"amount", dataType: "String", hAlign: "center", vAlign: "center" , readOnly: false},
             {headerName:"数量", headerWidth:80, dataCode:"amount", dataType: "String", hAlign: "center", vAlign: "center" , readOnly: false},
+            {headerName:"替换为编码", headerWidth:80, dataCode:"replaceCode", dataType: "String", formatter: '@', hAlign: "center", vAlign: "center", readOnly: false},
+            {headerName:"替换为名称", headerWidth:100, dataCode:"replaceName", dataType: "String", hAlign: "center", vAlign: "center", readOnly: true}
         ],
         ],
         comboItems: {
         comboItems: {
             //调整类型下拉菜单
             //调整类型下拉菜单
-            coeType: ['定额', '人工', '材料', '机械', '主材', '设备', '单个工料机'],
+            coeType: ['定额', '人工', '材料', '机械', '主材', '设备', '单个工料机','替换人材机'],
             //操作符下拉菜单
             //操作符下拉菜单
             operator: ['+', '-', '*', '/', '=']
             operator: ['+', '-', '*', '/', '=']
         }
         }
@@ -463,8 +552,16 @@ let gljAdjOprObj = {
     },
     },
     onEditStart: function (sender, args) {
     onEditStart: function (sender, args) {
         let me = gljAdjOprObj;
         let me = gljAdjOprObj;
-        if(!coeOprObj.currentCoe || args.row >= me.currentGljAdjList.length && args.col === 1
-            || args.row < me.currentGljAdjList.length && args.col === 1 && me.currentGljAdjList[args.row].coeType !== '单个工料机'){
+        let dataCode = me.setting.header[args.col].dataCode;
+        if(!coeOprObj.currentCoe || args.row >= me.currentGljAdjList.length  ){//超出编辑范围
+            if(dataCode=== 'gljCode' || dataCode=== 'replaceCode') args.cancel = true;
+            return;
+        }
+        if(dataCode=== 'gljCode' && me.currentGljAdjList[args.row].coeType !== '单个工料机'&& me.currentGljAdjList[args.row].coeType !== '替换人材机'){ //单个人才机和替换人材机,编码才能编辑
+            args.cancel = true;
+            return;
+        }
+        if(dataCode=== 'replaceCode' && me.currentGljAdjList[args.row].coeType !== '替换人材机'){//替换人材机类型 替换编码才能编辑
             args.cancel = true;
             args.cancel = true;
         }
         }
     },
     },
@@ -481,14 +578,22 @@ let gljAdjOprObj = {
                 //update
                 //update
                 if(args.row < me.currentGljAdjList.length && args.editingText.toString().trim() !== me.currentGljAdjList[args.row][dataCode]){
                 if(args.row < me.currentGljAdjList.length && args.editingText.toString().trim() !== me.currentGljAdjList[args.row][dataCode]){
                     let updateObj = me.currentGljAdjList[args.row];
                     let updateObj = me.currentGljAdjList[args.row];
-                    if(dataCode === 'gljCode' && typeof updateObj.coeType !== 'undefined' && updateObj.coeType === '单个工料机'){
+                    if(dataCode === 'gljCode' && typeof updateObj.coeType !== 'undefined' && (updateObj.coeType === '单个工料机'||updateObj.coeType === '替换人材机')){
                         let gljName = me.getGljName(args.editingText, me.gljList);
                         let gljName = me.getGljName(args.editingText, me.gljList);
                         if(gljName){
                         if(gljName){
                             updateObj.gljCode = args.editingText;
                             updateObj.gljCode = args.editingText;
                             updateObj.gljName = gljName;
                             updateObj.gljName = gljName;
                             isUpdate = true;
                             isUpdate = true;
+                        } else {
+                            alert("不存在编号为"+ args.editingText +"的工料机");
                         }
                         }
-                        else {
+                    }else if(dataCode === 'replaceCode' && typeof updateObj.coeType !== 'undefined' && updateObj.coeType === '替换人材机'){
+                        let gljName = me.getGljName(args.editingText, me.gljList);
+                        if(gljName){
+                            updateObj.replaceCode = args.editingText;
+                            updateObj.replaceName = gljName;
+                            isUpdate = true;
+                        } else {
                             alert("不存在编号为"+ args.editingText +"的工料机");
                             alert("不存在编号为"+ args.editingText +"的工料机");
                         }
                         }
                     }
                     }
@@ -497,6 +602,8 @@ let gljAdjOprObj = {
                         updateObj[dataCode] = args.editingText;
                         updateObj[dataCode] = args.editingText;
                         updateObj.gljCode = '';
                         updateObj.gljCode = '';
                         updateObj.gljName = '';
                         updateObj.gljName = '';
+                        updateObj.replaceCode = '';
+                        updateObj.replaceName = '';
                     }
                     }
                     else if(dataCode !== 'gljCode') {
                     else if(dataCode !== 'gljCode') {
                         isUpdate = true;
                         isUpdate = true;

+ 2 - 0
web/maintain/ration_repository/js/global.js

@@ -25,6 +25,8 @@ function autoFlashHeight(){
     $('#explanationShow').height($(window).height()-headerHeight-toolsBar-100);
     $('#explanationShow').height($(window).height()-headerHeight-toolsBar-100);
 //计算规则
 //计算规则
     $('#ruleTextShow').height($(window).height()-headerHeight-toolsBar-100);
     $('#ruleTextShow').height($(window).height()-headerHeight-toolsBar-100);
+    typeof loadRationSubSize !== 'undefined' ? loadRationSubSize() : '';
+    typeof loadZmhsAdjSize !== 'undefined' ? loadZmhsAdjSize() : '';
 };
 };
 $(window).resize(autoFlashHeight);
 $(window).resize(autoFlashHeight);
 /*全局自适应高度结束*/
 /*全局自适应高度结束*/

+ 46 - 1
web/maintain/ration_repository/js/ration.js

@@ -2,6 +2,51 @@
  * Created by Tony on 2017/4/28.
  * Created by Tony on 2017/4/28.
  */
  */
 
 
+$(document).ready(function () {
+   //定额表与下方子表上下拖动
+    let rationSubResize = getRationSubResize();
+    slideResize(rationSubResize, {min: 150, max:`$('#tde').height() - 150 -20`}, 'height', function () {
+        if (rationOprObj.workBook) {
+            rationOprObj.workBook.refresh();
+        }
+        if (rationGLJOprObj.sheet && rationGLJOprObj.sheet.getParent()) {
+            rationGLJOprObj.sheet.getParent().refresh();
+        }
+    });
+    loadSize(rationSubResize, 'height', function () {
+        if (rationOprObj.workBook) {
+            rationOprObj.workBook.refresh();
+        }
+        if (rationGLJOprObj.sheet && rationGLJOprObj.sheet.getParent()) {
+            rationGLJOprObj.sheet.getParent().refresh();
+        }
+    });
+});
+function getRationSubResize() {
+    let rationSubResize = {};
+    rationSubResize.id = '#stdRationSub';
+    rationSubResize.resize = $('#rationSubResize');
+    rationSubResize.nearElement = $('#rationItemsSheet');
+    rationSubResize.nearSpread = $('#rationItemsSheet');
+    rationSubResize.farElement = $('#subContent');
+    rationSubResize.farSpread = $('#rdSpread');
+    rationSubResize.nav = rationSubResize.farElement.children('ul.nav');
+    return rationSubResize;
+}
+function loadRationSubSize(resizeObj) {
+    if (!resizeObj) {
+        resizeObj = getRationSubResize();
+    }
+    loadSize(resizeObj, 'height', function () {
+        if (rationOprObj.workBook) {
+            rationOprObj.workBook.refresh();
+        }
+        if (rationGLJOprObj.sheet && rationGLJOprObj.sheet.getParent()) {
+            rationGLJOprObj.sheet.getParent().refresh();
+        }
+    });
+}
+
 const digital = {
 const digital = {
     gljPrc: -3,//计算定额基价时单个工料机价格取三位
     gljPrc: -3,//计算定额基价时单个工料机价格取三位
     rationBasePrc: -2,
     rationBasePrc: -2,
@@ -784,4 +829,4 @@ let rationOprObj = {
             }
             }
         }
         }
     }
     }
-}
+}

+ 1 - 0
web/users/js/login.js

@@ -16,6 +16,7 @@ let rules = {
     }
     }
 };
 };
 $(document).ready(function() {
 $(document).ready(function() {
+    console.log($('#password').val());
     $("#login-form").validate({
     $("#login-form").validate({
         rules: rules,
         rules: rules,
         errorPlacement: function(error, element) {
         errorPlacement: function(error, element) {

+ 2 - 2
web/users/views/login/index.html

@@ -27,13 +27,13 @@
                 <div class="form-group">
                 <div class="form-group">
                     <div class="input-group">
                     <div class="input-group">
                         <div class="input-group-addon"><i class="glyphicon glyphicon-user"></i></div>
                         <div class="input-group-addon"><i class="glyphicon glyphicon-user"></i></div>
-                        <input  class="form-control input-lg" placeholder="输入账号" name="username" id="username" value="admin">
+                        <input  class="form-control input-lg" placeholder="输入账号" name="username" id="username" value="">
                     </div>
                     </div>
                 </div>
                 </div>
                 <div class="form-group">
                 <div class="form-group">
                     <div class="input-group">
                     <div class="input-group">
                         <div class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></div>
                         <div class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></div>
-                        <input type="password" class="form-control input-lg"  placeholder="输入密码" id="password" name="password" value="">
+                        <input type="password" class="form-control input-lg"  placeholder="输入密码" autocomplete="new-password" id="password" name="password" value="">
                     </div>
                     </div>
                 </div>
                 </div>
                 <a class="btn btn-primary btn-lg btn-block" href="javascript:void(0);" id="login">登录</a>
                 <a class="btn btn-primary btn-lg btn-block" href="javascript:void(0);" id="login">登录</a>

+ 1 - 1
web/users/views/manager/index.html

@@ -66,7 +66,7 @@
                     <label>权限</label>
                     <label>权限</label>
                     <div class="checkbox">
                     <div class="checkbox">
                         <label>
                         <label>
-                            <input type="checkbox" name="permission[]" data-permission="manager"> 用户管理
+                            <input type="checkbox" name="permission[]" data-permission="user"> 用户管理
                         </label>&nbsp;
                         </label>&nbsp;
                         <label>
                         <label>
                             <input type="checkbox" name="permission[]" data-permission="notify"> 通知管理
                             <input type="checkbox" name="permission[]" data-permission="notify"> 通知管理