Browse Source

改版第一次提交

MaiXinRong 6 years ago
parent
commit
fbeb5e727c

+ 1 - 1
app/base/base_controller.js

@@ -10,7 +10,7 @@
 const moment = require('moment');
 const moment = require('moment');
 const messageType = require('../const/message_type');
 const messageType = require('../const/message_type');
 const Controller = require('egg').Controller;
 const Controller = require('egg').Controller;
-const menuList = require('../../config/menu');
+const menuList = require('../../config/menu').menu;
 class BaseController extends Controller {
 class BaseController extends Controller {
 
 
     /**
     /**

+ 24 - 0
app/const/setting.js

@@ -0,0 +1,24 @@
+'use strict';
+
+/**
+ * 项目设置 相关常量
+ *
+ * @author Mai
+ * @date 2018/9/25
+ * @version
+ */
+
+const cType = {
+    dropDown: 1,
+    radio: 2,
+};
+const cTypeStr = [];
+cTypeStr[cType.dropDown] = '下拉菜单';
+cTypeStr[cType.radio] = '单选框';
+
+module.exports = {
+    cType: {
+        key: cType,
+        text: cTypeStr,
+    },
+}

+ 6 - 0
app/controller/ledger_controller.js

@@ -436,6 +436,12 @@ module.exports = app => {
             ctx.body = responseData;
             ctx.body = responseData;
         }
         }
 
 
+        /**
+         * 获取全部子节点
+         *
+         * @param ctx
+         * @returns {Promise<void>}
+         */
         async posterity(ctx) {
         async posterity(ctx) {
             const responseData = {
             const responseData = {
                 err: 0,
                 err: 0,

+ 186 - 0
app/controller/setting_controller.js

@@ -0,0 +1,186 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Mai
+ * @date
+ * @version
+ */
+
+const officeList = require('../const/cld_office').list;
+const settingConst = require('../const/setting.js');
+const settingMenu = require('../../config/menu').settingMenu;
+
+module.exports = app => {
+
+    class SettingController extends app.BaseController {
+
+        /**
+         * 构造函数
+         *
+         * @param {Object} ctx - egg全局context
+         * @return {void}
+         */
+        constructor(ctx) {
+            super(ctx);
+            ctx.subMenu = settingMenu;
+        }
+
+        /**
+         * 项目信息页面
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        async info(ctx) {
+            try {
+                // 获取项目数据
+                const projectId = ctx.session.sessionProject.id;
+                const projectData = await ctx.service.project.getDataById(projectId);
+                if (projectData === null) {
+                    throw '没有对应的项目数据';
+                }
+
+                // 获取销售人员数据
+                const salesmanData = await ctx.service.manager.getDataById(projectData.manager_id);
+
+                // 数据规则
+                const rule = ctx.service.project.rule('saveInfo');
+                const jsValidator = await this.jsValidator.convert(rule).build();
+
+                const renderData = {
+                    projectData,
+                    salesmanData,
+                    officeList,
+                    jsValidator,
+                };
+                await this.layout('setting/info.ejs', renderData);
+            } catch (error) {
+                console.log(error);
+                ctx.redirect('/dashboard');
+            }
+        }
+
+        async user(ctx) {
+            try {
+                // 获取项目数据
+                const projectId = ctx.session.sessionProject.id;
+                const projectData = await ctx.service.project.getDataById(projectId);
+                if (projectData === null) {
+                    throw '没有对应的项目数据';
+                }
+
+                const renderData = {
+                    projectData,
+                };
+                await this.layout('setting/user.ejs', renderData, 'setting/user_modal.ejs');
+            } catch (error) {
+                console.log(error);
+                ctx.redirect('/dashboard');
+            }
+        }
+
+        async category(ctx) {
+            try {
+                // 获取项目数据
+                const projectId = ctx.session.sessionProject.id;
+                const projectData = await ctx.service.project.getDataById(projectId);
+                if (projectData === null) {
+                    throw '没有对应的项目数据';
+                }
+
+                const categoryData = await ctx.service.category.getAllCategory({ where: { pid: projectId } });
+                const renderData = {
+                    projectData,
+                    categoryType: settingConst.cType,
+                    categoryData,
+                };
+                await this.layout('setting/category.ejs', renderData, 'setting/category_modal.ejs');
+            } catch (error) {
+                console.log(error);
+                ctx.redirect('/dashboard');
+            }
+        }
+
+        async addCategory(ctx) {
+            try {
+                const projectId = ctx.session.sessionProject.id;
+                const responseData = {
+                    err: 0, msg: '', data: null,
+                };
+
+                const data = JSON.parse(ctx.request.body.data);
+                if (!data.name || !data.type) {
+                    throw '提交数据错误';
+                }
+
+                responseData.data = await ctx.service.category.addCategory(projectId, data.name, data.type);
+                ctx.body = responseData;
+            } catch (err) {
+                console.log(err);
+                ctx.body = {err: 1, msg: err.toString(), data: null};
+            }
+        }
+
+        async updateCategory(ctx) {
+            try {
+                const projectId = ctx.session.sessionProject.id;
+                const responseData = {
+                    err: 0, msg: '', data: null,
+                }
+
+                const data = JSON.parse(ctx.request.body.data);
+                if (!data.id) {
+                    throw '提交数据错误';
+                }
+                if (data.name) {
+                    const count = await ctx.service.category.count({pid: projectId, name: data.name});
+                    if (count >= 1) {
+                        throw '存在同名类别';
+                    }
+                }
+
+                if (data.value) {
+                    data.value = JSON.stringify(data.value)
+                }
+                const result = await ctx.service.category.update(data, {id: data.id});
+                if (!result) {
+                    throw '提交数据失败'
+                }
+
+                responseData.data = await ctx.service.category.getCategory({id: data.id});
+                ctx.body = responseData;
+            } catch (err) {
+                console.log(err);
+                ctx.body = {err: 1, msg: err.toString(), data: null};
+            }
+        }
+
+        async deleteCategory(ctx) {
+            try {
+                const projectId = ctx.session.sessionProject.id;
+                const responseData = {
+                    err: 0, msg: '', data: null,
+                };
+
+                const data = JSON.parse(ctx.request.body.data);
+                if (!data.id) {
+                    throw '提交数据错误';
+                }
+
+                const result = await ctx.service.category.deleteById(data.id);
+                if (!result) {
+                    throw '提交数据失败'
+                }
+
+                ctx.body = responseData;
+            } catch(err) {
+                console.log(err);
+                ctx.body = {err: 1, msg: err.toString(), data: null};
+            }
+        }
+    }
+
+    return SettingController;
+};

+ 36 - 10
app/controller/tender_controller.js

@@ -10,6 +10,8 @@
 
 
 const tenderConst = require('../const/tender');
 const tenderConst = require('../const/tender');
 const codeRuleConst = require('../const/code_rule');
 const codeRuleConst = require('../const/code_rule');
+const settingConst = require('../const/setting.js');
+
 module.exports = app => {
 module.exports = app => {
 
 
     class TenderController extends app.BaseController {
     class TenderController extends app.BaseController {
@@ -27,30 +29,54 @@ module.exports = app => {
         }
         }
 
 
         /**
         /**
-         * 标段列表页
+         * 标段概况
          *
          *
          * @param {object} ctx - egg全局变量
          * @param {object} ctx - egg全局变量
          * @return {void}
          * @return {void}
          */
          */
         async index(ctx) {
         async index(ctx) {
-            // 获取新增标段的规则
-            const rule = ctx.service.tender.rule('add');
-            const jsValidator = await this.jsValidator.convert(rule).build();
-
-            let tenderType = ctx.query.type;
-
             // 根据项目id获取标段数据
             // 根据项目id获取标段数据
-            const tenderList = await ctx.service.tender.getList(tenderType);
+            const tenderList = await ctx.service.tender.getList();
+            const categoryData = await ctx.service.category.getAllCategory({
+                where: { pid: ctx.session.sessionProject.id }
+            });
+
             const renderData = {
             const renderData = {
                 tenderList,
                 tenderList,
                 tenderConst,
                 tenderConst,
-                jsValidator,
-                tenderType
+                settingConst,
+                categoryData,
             };
             };
             await this.layout('tender/index.ejs', renderData, 'tender/modal.ejs');
             await this.layout('tender/index.ejs', renderData, 'tender/modal.ejs');
         }
         }
 
 
         /**
         /**
+         * 计量进度
+         *
+         * @param ctx
+         * @returns {Promise<void>}
+         */
+        async progress(ctx) {
+            const renderData = {
+
+            };
+            await this.layout('tender/progress.ejs', renderData);
+        }
+
+        /**
+         * 标段管理
+         *
+         * @param ctx
+         * @returns {Promise<void>}
+         */
+        async manage(ctx) {
+            const renderData = {
+
+            };
+            await this.layout('tender/manage.ejs', renderData, 'tender/manage_modal.ejs');
+        }
+
+        /**
          * 添加标段操作
          * 添加标段操作
          *
          *
          * @param {Object} ctx - egg全局变量
          * @param {Object} ctx - egg全局变量

BIN
app/public/css/logo.png


+ 124 - 127
app/public/css/main.css

@@ -1,44 +1,58 @@
 /*building SAAS 0.1*/
 /*building SAAS 0.1*/
 /*bootstrap 初始化*/
 /*bootstrap 初始化*/
 body {
 body {
-  font-size: 0.9rem;
-  overflow: hidden;
-  background: #e4e7ea
+    font-size: 0.9rem;
+    overflow: hidden;
+    background: #e4e7ea
 }
 }
 .dropdown-menu {
 .dropdown-menu {
-  font-size: 0.9rem
+    font-size: 0.9rem
 }
 }
 .btn.disabled, .btn:disabled {
 .btn.disabled, .btn:disabled {
   color:#999
   color:#999
 }
 }
+.btn,.btn-group {
+  vertical-align: baseline;
+}
+.nav-pills .nav-link.active, .nav-pills .show > .nav-link{
+  background-color: #e4e7ea;
+  color:#333;
+  font-weight: 600
+}
 /*自定义css*/
 /*自定义css*/
+.in-1{padding-left:5px!important}
+.in-2{padding-left:21px!important}
+.in-3{padding-left:42px!important}
+.in-4{padding-left:63px!important}
+.in-5{padding-left:84px!important}
+.in-6{padding-left:105px!important}
 /*滚动条*/
 /*滚动条*/
 /* 滚动条 */
 /* 滚动条 */
 ::-webkit-scrollbar-thumb:horizontal { /*水平滚动条的样式*/
 ::-webkit-scrollbar-thumb:horizontal { /*水平滚动条的样式*/
-  width: 5px;
-  background-color: #ddd;
-  -webkit-border-radius: 6px;
+	width: 5px;
+	background-color: #ddd;
+	-webkit-border-radius: 6px;
 }
 }
 ::-webkit-scrollbar-track-piece {
 ::-webkit-scrollbar-track-piece {
-  background-color: #fff; /*滚动条的背景颜色*/
-  -webkit-border-radius: 0; /*滚动条的圆角宽度*/
+	background-color: #fff; /*滚动条的背景颜色*/
+	-webkit-border-radius: 0; /*滚动条的圆角宽度*/
 }
 }
 ::-webkit-scrollbar {
 ::-webkit-scrollbar {
-  width: 10px; /*滚动条的宽度*/
-  height: 8px; /*滚动条的高度*/
+	width: 10px; /*滚动条的宽度*/
+	height: 8px; /*滚动条的高度*/
 }
 }
 ::-webkit-scrollbar-thumb:vertical { /*垂直滚动条的样式*/
 ::-webkit-scrollbar-thumb:vertical { /*垂直滚动条的样式*/
-  height: 50px;
-  background-color: #ddd;
-  -webkit-border-radius: 6px;
-  outline: 1px solid #fff;
-  outline-offset: -1px;
-  border: 1px solid #fff;
+	height: 50px;
+	background-color: #ddd;
+	-webkit-border-radius: 6px;
+	outline: 1px solid #fff;
+	outline-offset: -1px;
+	border: 1px solid #fff;
 }
 }
 ::-webkit-scrollbar-thumb:hover { /*滚动条的hover样式*/
 ::-webkit-scrollbar-thumb:hover { /*滚动条的hover样式*/
-  height: 50px;
-  background-color: #999;
-  -webkit-border-radius: 6px;
+	height: 50px;
+	background-color: #999;
+	-webkit-border-radius: 6px;
 }
 }
 .sjs-height-1,.sjs-height-2{
 .sjs-height-1,.sjs-height-2{
   overflow: hidden;
   overflow: hidden;
@@ -55,46 +69,46 @@ body {
   overflow-y: auto;
   overflow-y: auto;
 }
 }
 .form-signin {
 .form-signin {
-  max-width: 500px;
-  margin: 150px auto;
+    max-width: 500px;
+    margin: 150px auto;
 }
 }
 .has-danger {
 .has-danger {
-  -webkit-animation: shake 1s .2s ease both;
-  -moz-animation: shake 1s .2s ease both;
-  animation: shake 1s .2s ease both;
+    -webkit-animation: shake 1s .2s ease both;
+    -moz-animation: shake 1s .2s ease both;
+    animation: shake 1s .2s ease both;
 }
 }
 @-webkit-keyframes shake {
 @-webkit-keyframes shake {
-  0%, 100% {
-    -webkit-transform: translateX(0);
-  }
-  10%, 30%, 50%, 70%, 90% {
-    -webkit-transform: translateX(-10px);
-  }
-  20%, 40%, 60%, 80% {
-    -webkit-transform: translateX(10px);
-  }
+    0%, 100% {
+        -webkit-transform: translateX(0);
+    }
+    10%, 30%, 50%, 70%, 90% {
+        -webkit-transform: translateX(-10px);
+    }
+    20%, 40%, 60%, 80% {
+        -webkit-transform: translateX(10px);
+    }
 }
 }
 @-moz-keyframes shake {
 @-moz-keyframes shake {
-  0%, 100% {
-    -moz-transform: translateX(0);
-  }
-  10%, 30%, 50%, 70%, 90% {
-    -moz-transform: translateX(-10px);
-  }
-  20%, 40%, 60%, 80% {
-    -moz-transform: translateX(10px);
-  }
+    0%, 100% {
+        -moz-transform: translateX(0);
+    }
+    10%, 30%, 50%, 70%, 90% {
+        -moz-transform: translateX(-10px);
+    }
+    20%, 40%, 60%, 80% {
+        -moz-transform: translateX(10px);
+    }
 }
 }
 @keyframes shake {
 @keyframes shake {
-  0%, 100% {
-    transform: translateX(0);
-  }
-  10%, 30%, 50%, 70%, 90% {
-    transform: translateX(-10px);
-  }
-  20%, 40%, 60%, 80% {
-    transform: translateX(10px);
-  }
+    0%, 100% {
+        transform: translateX(0);
+    }
+    10%, 30%, 50%, 70%, 90% {
+        transform: translateX(-10px);
+    }
+    20%, 40%, 60%, 80% {
+        transform: translateX(10px);
+    }
 }
 }
 /*2.主体框架*/
 /*2.主体框架*/
 .header {
 .header {
@@ -113,14 +127,14 @@ body {
 .main-nav {
 .main-nav {
   position: fixed;
   position: fixed;
   z-index: 99;
   z-index: 99;
-  width:120px;
+  width:55px;
   left: 0;
   left: 0;
   top: 0;
   top: 0;
   height: 100%;
   height: 100%;
   background: #33425b;
   background: #33425b;
 }
 }
 .main-panel{
 .main-panel{
-  padding-left:120px;
+  padding-left:55px;
   box-sizing: border-box;
   box-sizing: border-box;
 }
 }
 .panel-sidebar{
 .panel-sidebar{
@@ -129,13 +143,13 @@ body {
   position: fixed;
   position: fixed;
   height: 100%;
   height: 100%;
   z-index: 4;
   z-index: 4;
-  left:120px;
-  padding-top: 100px;
+  left:55px;
+  padding-top:50px;
   border-right: 1px solid #ddd;
   border-right: 1px solid #ddd;
-  width: 250px;
+  width: 200px;
 }
 }
 .panel-content{
 .panel-content{
-  padding:115px 0 0;
+  padding:65px 0 0;
   position: relative;
   position: relative;
   z-index: 3;
   z-index: 3;
   box-sizing: border-box;
   box-sizing: border-box;
@@ -146,7 +160,7 @@ body {
   margin:0 15px 15px;
   margin:0 15px 15px;
 }
 }
 .panel-sidebar+.panel-content{
 .panel-sidebar+.panel-content{
-  padding: 115px 0 0 250px;
+  padding: 65px 0 0 200px;
 }
 }
 .panel-title, .panel-title>.title-bar {
 .panel-title, .panel-title>.title-bar {
   height:50px;
   height:50px;
@@ -154,7 +168,7 @@ body {
 }
 }
 .panel-title{
 .panel-title{
   position: fixed;
   position: fixed;
-  top: 50px;
+  top:0px;
   z-index: 98;
   z-index: 98;
   width: 100%;
   width: 100%;
   box-sizing: border-box;
   box-sizing: border-box;
@@ -163,17 +177,17 @@ body {
   border-top: 1px solid #ddd;
   border-top: 1px solid #ddd;
 }
 }
 .panel-sidebar .panel-title{
 .panel-sidebar .panel-title{
-  width:250px;
+  width:200px;
   border-right: 1px solid #ddd;
   border-right: 1px solid #ddd;
   box-shadow: 0 1px 3px rgba(0,0,0,.1);
   box-shadow: 0 1px 3px rgba(0,0,0,.1);
 }
 }
 .panel-content .panel-title{
 .panel-content .panel-title{
   left: 0;
   left: 0;
-  padding-left: 370px;
+  padding-left: 255px;
   padding-right: 20px;
   padding-right: 20px;
 }
 }
 .panel-content .panel-title.fluid{
 .panel-content .panel-title.fluid{
-  padding-left:120px
+  padding-left:55px
 }
 }
 .panel-title>.title-bar{
 .panel-title>.title-bar{
   padding-left: 20px
   padding-left: 20px
@@ -200,7 +214,7 @@ body {
 .side-menu{
 .side-menu{
   position: fixed;
   position: fixed;
   right:15px;
   right:15px;
-  top:116px
+  top:66px
 }
 }
 .side-menu .nav-link{
 .side-menu .nav-link{
   line-height: 16px;
   line-height: 16px;
@@ -212,24 +226,32 @@ body {
 .pr-46{
 .pr-46{
   padding-right:46px
   padding-right:46px
 }
 }
+.bcontent-wrap{
+    height: 350px
+  }
+@media only screen and (max-height: 768px) {
+  .bcontent-wrap{
+    height: 250px
+  }
+}
 /*滚动*/
 /*滚动*/
 .scrollbar-auto {
 .scrollbar-auto {
-  overflow-y: auto;
-  position: absolute;
-  bottom: 0;
-  left: 0;
-  top: 0;
-  right: 0;
+    overflow-y: auto;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    top: 0;
+    right: 0;
 }
 }
 .panel-sidebar .scrollbar-auto{
 .panel-sidebar .scrollbar-auto{
-  padding-top: 20px;
-  box-sizing: border-box;
+    padding-top: 20px;
+    box-sizing: border-box;
 }
 }
 .panel-sidebar .scrollbar-auto {
 .panel-sidebar .scrollbar-auto {
-  height: 100%;
-  width: 100%;
-  overflow-y: auto;
-  position: static;
+    height: 100%;
+    width: 100%;
+    overflow-y: auto;
+    position: static;
 }
 }
 /*头部*/
 /*头部*/
 .header .logo {
 .header .logo {
@@ -314,16 +336,23 @@ body {
   margin-top:15%
   margin-top:15%
 }
 }
 /*侧栏主菜单*/
 /*侧栏主菜单*/
-.nav-top{
-  padding-top: 50px
+.nav-top,.nav-bottom{
+  width: 55px
 }
 }
 .bg-nav a{
 .bg-nav a{
   color:#7786ab;
   color:#7786ab;
-  width:120px;
-  height: 55px;
-  line-height: 55px;
+  width:55px;
+  text-align: center;
   display: inline-block;
   display: inline-block;
-  padding:0 0 0 10px
+  padding:15px 0;
+  font-size: 12px
+}
+.bg-nav a i{
+  font-size:22px;
+}
+
+.bg-nav a span{
+  display: none;
 }
 }
 .bg-nav > li{
 .bg-nav > li{
   width:120px
   width:120px
@@ -340,8 +369,11 @@ body {
   color:#f2f2f2;
   color:#f2f2f2;
   text-decoration: none;
   text-decoration: none;
 }
 }
+.bg-nav > li.active a span{
+  display: block;
+  }
 .bg-nav > li + li {
 .bg-nav > li + li {
-  margin-top:0;
+    margin-top:0;
 }
 }
 .bg-nav .sub-menu {
 .bg-nav .sub-menu {
   list-style:none;
   list-style:none;
@@ -367,7 +399,10 @@ body {
   border-bottom: 1px solid #e2eaec;
   border-bottom: 1px solid #e2eaec;
   padding-right: 15px;
   padding-right: 15px;
   margin-bottom: 10px;
   margin-bottom: 10px;
-  margin-left: 20px
+  margin-left: 17px
+}
+.nav-box > .sub-list > li > a{
+  padding-left: 40px
 }
 }
 .nav-list li a{
 .nav-list li a{
   color: #333;
   color: #333;
@@ -414,7 +449,7 @@ body {
   color:#f90000
   color:#f90000
 }
 }
 .bg-gray {
 .bg-gray {
-  background-color:#bbb!important;
+ background-color:#bbb!important;
 }
 }
 .datepickers-container {
 .datepickers-container {
   z-index: 9999
   z-index: 9999
@@ -423,6 +458,10 @@ body {
   height:500px;
   height:500px;
   overflow: hidden
   overflow: hidden
 }
 }
+.modal-height-300{
+  height:300px;
+  overflow:auto
+}
 .modal-lgx {
 .modal-lgx {
   max-width:1000px
   max-width:1000px
 }
 }
@@ -505,45 +544,3 @@ body {
   width:inherit;
   width:inherit;
   height: inherit;
   height: inherit;
 }
 }
-.toast{
-  position: absolute;
-  top: 0;
-  width: 65%;
-  left: 0;
-  right: 0;
-  margin: 0 auto;
-  opacity: 0.8;
-  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
-  z-index: 999;
-  padding: 15px;
-  border-radius: 3px;
-  color: #ffffff;
-  display: none;
-}
-.toast .message{
-  padding-left: 50px;
-  display: inline-block;
-  font-size: 14px;
-}
-.toast i.icon{
-  font-size: 25px;
-  position: absolute;
-  left: 23px;
-  top: 13px;
-}
-.toast.success{
-  background: rgba(16, 196, 105, 0.8);
-  border: 2px solid #10c469
-}
-.toast.error{
-  background-color: rgba(255, 91, 91, 0.8);
-  border: 2px solid #ff5b5b;
-}
-.toast.warning {
-  background-color: rgba(249, 200, 81, 0.8);
-  border: 2px solid #f9c851;
-}
-.toast.info {
-  background-color: rgba(53, 184, 224, 0.8);
-  border: 2px solid #35b8e0;
-}

+ 42 - 0
app/public/css/toast.css

@@ -0,0 +1,42 @@
+.toast{
+    position: absolute;
+    top: 0;
+    width: 65%;
+    left: 0;
+    right: 0;
+    margin: 0 auto;
+    opacity: 0.8;
+    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
+    z-index: 999;
+    padding: 15px;
+    border-radius: 3px;
+    color: #ffffff;
+    display: none;
+}
+.toast .message{
+    padding-left: 50px;
+    display: inline-block;
+    font-size: 14px;
+}
+.toast i.icon{
+    font-size: 25px;
+    position: absolute;
+    left: 23px;
+    top: 13px;
+}
+.toast.success{
+    background: rgba(16, 196, 105, 0.8);
+    border: 2px solid #10c469
+}
+.toast.error{
+    background-color: rgba(255, 91, 91, 0.8);
+    border: 2px solid #ff5b5b;
+}
+.toast.warning {
+    background-color: rgba(249, 200, 81, 0.8);
+    border: 2px solid #f9c851;
+}
+.toast.info {
+    background-color: rgba(53, 184, 224, 0.8);
+    border: 2px solid #35b8e0;
+}

+ 187 - 0
app/public/js/category.js

@@ -0,0 +1,187 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Mai
+ * @date 2018/9/26
+ * @version
+ */
+
+function InitCategoryData(category) {
+    const data = category instanceof Array ? category : [category];
+    for (const d of data) {
+       // d.valueArr = d.value && d.value !== '' ? JSON.parse(d.value) : [];
+        d.typeStr = cType.text[d.type];
+    }
+}
+
+function getTypeHtml() {
+    const html = [];
+    for (const k in cType.key) {
+        const value = cType.key[k];
+        html.push('<div class="form-check form-check-inline">');
+        html.push('<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio' + value + '" value="' + value + '">');
+        html.push('<label class="form-check-label" for="inlineRadio' + value + '">', cType.text[value], '</label>');
+        html.push('</div>');
+    }
+    return html.join('');
+}
+
+function getCategoryHtml(category) {
+    const data = category instanceof Array ? category : [category];
+    const html = [];
+    for (const d of data) {
+        html.push('<tr ', d.value && d.value.length > 0 ? '' : 'class="table-warning"', 'cid="' + d.id + '">');
+        html.push('<td>', d.name, '</td>');
+        html.push('<td>', d.typeStr, '</td>');
+        html.push('<td>');
+        for (const v of d.value) {
+            html.push('<span class="h5"><span class="badge badge-secondary">', v, '</span></span>\n');
+        }
+        html.push('</td>');
+        html.push('<td>');
+        html.push('<a href="javasrcipt: void(0);" name="add" class="btn btn-sm btn-outline-primary"', 'cid="' + d.id, '">添加值</a>\n');
+        html.push('<a href="javasrcipt: void(0);" name="edit-cate" class="btn btn-sm btn-outline-primary"', 'cid="' + d.id + '">编辑</a>\n');
+        html.push('<a href="javasrcipt: void(0);" name="del" class="btn btn-sm btn-outline-danger"', 'cid="' + d.id + '">删除</a> ');
+        html.push('</td>');
+        html.push('<tr>');
+    }
+    return html.join('');
+}
+
+function getValueHtml(value) {
+    const html = [];
+    for (const v of value) {
+        html.push('<tr name="value">');
+        html.push('<td><input class="form-control form-control-sm" name="value" placeholder="请输入值" value="' + v + '"></td>');
+        html.push('<td><a href="javasrcipt: void(0);" class="text-danger">删除</a></td>');
+        html.push('</tr>');
+    }
+    return html.join('');
+}
+
+function findCategory(cid) {
+    for (const c of cData) {
+        if (c.id === cid) {
+            return c;
+        }
+    }
+}
+
+function bindCategoryControl() {
+    // 弹出添加值
+    $('a[name=add]').bind('click', function () {
+        const id = parseInt($(this).attr('cid'));
+        const category = findCategory(id);
+        $('#add-ok').attr('cid', id);
+        if (category) {
+            const list = $('#value-list');
+            list.html(getValueHtml(category.value) + '<tr id="add-value-row"><td colspan="2"><a href="javascript: void(0);">添加新值</a></td></tr>');
+            $('#add-value-row').click(function () {
+                $(this).before('<tr><td><input class="form-control form-control-sm" name="value" placeholder="请输入值"></td><td><a href="javasrcipt: void(0);" class="text-danger">删除</a></td></tr>');
+            });
+            $('#add').modal('show');
+        }
+    });
+    // 弹出 编辑
+    $('a[name=edit-cate]').bind('click', function () {
+        const id = parseInt($(this).attr('cid'));
+        const category = findCategory(id);
+        $('input[name=name]', '#edit-cate').val(category.name);
+        $('div[name=type]', '#edit-cate').html(getTypeHtml());
+        $('#inlineRadio' + category.type, '#edit-cate')[0].checked = true;
+        $('#edit-cate-ok').attr('cid', $(this).attr('cid'));
+        $('#edit-cate').modal('show');
+    });
+    // 弹出 删除类别
+    $('a[name=del]').bind('click', function () {
+        $('#del-cate-ok').attr('cid', $(this).attr('cid'));
+        $('#del-cate').modal('show');
+    });
+}
+
+$(document).ready(() => {
+    InitCategoryData(cData);
+    $('#categoryList').html(getCategoryHtml(cData));
+    bindCategoryControl();
+    $('div[name=type]', '#add-cate').html(getTypeHtml());
+    // 新增分类
+    $('#add-cate-ok').click(function () {
+        const name = $('input[name=name]', '#add-cate');
+        const type = $('input[type=radio]:checked', '#add-cate');
+        const data = {
+            name: name.val(),
+            type: parseInt(type.val()),
+        };
+        postData('/setting/category/add', data, function (data) {
+            InitCategoryData(data);
+            $('#categoryList').append(getCategoryHtml(data));
+            bindCategoryControl();
+            cData.push(data);
+            $('#add-cate').modal('hide');
+            name.val('');
+            type[0].checked = false;
+        }, function (msg) {
+            $('#add-cate').modal('hide');
+        });
+    });
+    // 添加值
+    $('#add-ok').click(function () {
+        const valueArr = [];
+        const value = $('input[name=value]');
+        for (const v of value) {
+            if (v.value !== '') {
+                valueArr.push(v.value);
+            }
+        }
+        const data = {
+            id: $(this).attr('cid'),
+            value: valueArr,
+        }
+        postData('/setting/category/update', data, function (data) {
+            const category = findCategory(data.id);
+            for (const c in data) {
+                category[c] = data[c];
+            }
+            InitCategoryData(category);
+            $('tr[cid=' + data.id + ']')[0].outerHTML = getCategoryHtml(category);
+            $('#add').modal('hide');
+        }, function () {
+            $('#add').modal('hide');
+        });
+    });
+    // 编辑
+    $('#edit-cate-ok').click(function () {
+        const name = $('input[name=name]', '#edit-cate');
+        const type = $('input[type=radio]:checked', '#edit-cate');
+        const data = {
+            id: parseInt($(this).attr('cid')),
+            name: name.val(),
+            type: parseInt(type.val()),
+        }
+        postData('/setting/category/update', data, function (data) {
+            const category = findCategory(data.id);
+            for (const c in data) {
+                category[c] = data[c];
+            }
+            InitCategoryData(category);
+            $('tr[cid=' + data.id + ']')[0].outerHTML = getCategoryHtml(category);
+            $('#edit-cate').modal('hide');
+        }, function () {
+            $('#edit-cate').modal('hide');
+        });
+    });
+    // 删除类别
+    $('#del-cate-ok').click(function () {
+        const data = {
+            id: parseInt($(this).attr('cid')),
+        }
+        postData('/setting/category/del', data, function () {
+            $('tr[cid=' + data.id + ']').remove();
+            $('#del-cate').modal('hide');
+        }, function () {
+            $('#del-cate').modal('hide');
+        });
+    });
+});

+ 23 - 9
app/public/js/ledger.js

@@ -98,21 +98,28 @@ $(document).ready(function() {
                     }
                     }
                 }
                 }
                 // 处理新增
                 // 处理新增
+                let cTime = new Date();
                 if (data.create) {
                 if (data.create) {
                     const newNodes = data.create;
                     const newNodes = data.create;
                     if (newNodes) {
                     if (newNodes) {
+                        let sTime = new Date();
                         newNodes.sort(function (a, b) {
                         newNodes.sort(function (a, b) {
-                            const aIndex = tree.nodes.indexOf(a);
-                            const bIndex = tree.nodes.indexOf(b);
-                            return aIndex - bIndex;
+                            return a.index - b.index;
                         });
                         });
+                        sTime = new Date() - sTime;
+                        console.log('sort: ' + sTime);
+
+                        let lTime = new Date();
                         for (const node of newNodes) {
                         for (const node of newNodes) {
-                            const index = tree.nodes.indexOf(node);
-                            sheet.addRows(index, 1);
-                            SpreadJsObj.reLoadRowData(sheet, index, 1);
+                            sheet.addRows(node.index, 1);
+                            SpreadJsObj.reLoadRowData(sheet, tree.nodes.indexOf(node), 1);
                         }
                         }
+                        lTime = new Date() - lTime;
+                        console.log('load: '+ lTime);
                     }
                     }
                 }
                 }
+                cTime = new Date() - cTime;
+                console.log('refreshNewNode: ' + cTime);
                 // 处理更新
                 // 处理更新
                 if (data.update) {
                 if (data.update) {
                     const rows = [];
                     const rows = [];
@@ -123,10 +130,14 @@ $(document).ready(function() {
                 }
                 }
                 // 处理展开
                 // 处理展开
                 if (data.expand) {
                 if (data.expand) {
+                    const expanded = [];
                     for (const e of data.expand) {
                     for (const e of data.expand) {
-                        const posterity = tree.getPosterity(e);
-                        for (const p of posterity) {
-                            sheet.setRowVisible(tree.nodes.indexOf(p), p.visible);
+                        if (expanded.indexOf(e) === -1) {
+                            const posterity = tree.getPosterity(e);
+                            for (const p of posterity) {
+                                sheet.setRowVisible(tree.nodes.indexOf(p), p.visible);
+                                expanded.push(p);
+                            }
                         }
                         }
                     }
                     }
                 }
                 }
@@ -559,8 +570,11 @@ $(document).ready(function() {
                         const row = selection[0].row;
                         const row = selection[0].row;
                         const select = ledgerTree.nodes[row];
                         const select = ledgerTree.nodes[row];
                         ledgerTree.postData('posterity', null, {id: ledgerTree.getNodeKey(select)}, function (result) {
                         ledgerTree.postData('posterity', null, {id: ledgerTree.getNodeKey(select)}, function (result) {
+                            let time = new Date();
                             select.expanded = true;
                             select.expanded = true;
                             treeOperationObj.refreshTree(sheet, result);
                             treeOperationObj.refreshTree(sheet, result);
+                            time = new Date() - time;
+                            console.log('refreshSpreadView: '+ time);
                             treeOperationObj.refreshOperationValid(sheet, sheet.getSelections());
                             treeOperationObj.refreshOperationValid(sheet, sheet.getSelections());
                         });
                         });
                     }
                     }

+ 17 - 17
app/public/js/path_tree.js

@@ -35,6 +35,7 @@ const createNewPathTree = function (type, setting) {
                 if (!nodes) { return }
                 if (!nodes) { return }
                 for (let i = 0; i < nodes.length; i++) {
                 for (let i = 0; i < nodes.length; i++) {
                     self.nodes.push(nodes[i]);
                     self.nodes.push(nodes[i]);
+                    nodes[i].index = self.nodes.length - 1;
                     if (!isResort) {
                     if (!isResort) {
                         nodes[i].children = self.getChildren(nodes[i]);
                         nodes[i].children = self.getChildren(nodes[i]);
                     }
                     }
@@ -141,10 +142,11 @@ const createNewPathTree = function (type, setting) {
             if (!node.children) {
             if (!node.children) {
                 node.children = this.getChildren(node);
                 node.children = this.getChildren(node);
             }
             }
-            const children = node.children;
-            for (const child of children) {
-                child.visible = node.expanded && node.visible;
-                this._refreshChildrenVisible(child);
+            if (node.children && node.children.length > 0) {
+                for (const child of node.children) {
+                    child.visible = node.expanded && node.visible;
+                    this._refreshChildrenVisible(child);
+                }
             }
             }
         };
         };
         /**
         /**
@@ -378,10 +380,8 @@ const createNewPathTree = function (type, setting) {
             }
             }
             this.sortTreeNode(true);
             this.sortTreeNode(true);
             for (const node of loadedData) {
             for (const node of loadedData) {
-                const children = node.children;
-                if (!node.expanded && children && children.length > 0) {
-                    node.expanded = true;
-                    this._refreshChildrenVisible(node);
+                if (!node.expanded) {
+                    this.setExpanded(node, true);
                 }
                 }
             }
             }
             return loadedData;
             return loadedData;
@@ -418,7 +418,6 @@ const createNewPathTree = function (type, setting) {
          * @private
          * @private
          */
          */
         _loadExpandData (datas) {
         _loadExpandData (datas) {
-            console.log(datas);
             const loadedData = [], existData = [], expandData = [], resortData = [];
             const loadedData = [], existData = [], expandData = [], resortData = [];
             for (const data of datas) {
             for (const data of datas) {
                 let node = this.getItems(data[this.setting.id]);
                 let node = this.getItems(data[this.setting.id]);
@@ -442,14 +441,12 @@ const createNewPathTree = function (type, setting) {
                     }
                     }
                 }
                 }
             }
             }
-            //this.sortTreeNode();
             for (const node of resortData) {
             for (const node of resortData) {
                 node.children = this.getChildren(node);
                 node.children = this.getChildren(node);
             }
             }
             this.sortTreeNode(true);
             this.sortTreeNode(true);
             for (const node of loadedData) {
             for (const node of loadedData) {
-                const children = node.children;
-                if (!node.expanded && children.length > 0) {
+                if (!node.expanded) {
                     this.setExpanded(node, true);
                     this.setExpanded(node, true);
                 }
                 }
             }
             }
@@ -457,14 +454,14 @@ const createNewPathTree = function (type, setting) {
                 const parent = this.getItems(node[this.setting.pid]);
                 const parent = this.getItems(node[this.setting.pid]);
                 if (expandData.indexOf(parent) === -1) {
                 if (expandData.indexOf(parent) === -1) {
                     expandData.push(parent);
                     expandData.push(parent);
-                    const children = parent.children;
-                    if (!parent.expanded && children.length > 0) {
+                    if (!parent.expanded) {
                         this.setExpanded(parent, true);
                         this.setExpanded(parent, true);
                     }
                     }
                 }
                 }
-                this.setExpanded(node, true);
+                if (!node.expanded) {
+                    this.setExpanded(node, true);
+                }
             }
             }
-            console.log(expandData);
             return [loadedData, expandData];
             return [loadedData, expandData];
         };
         };
 
 
@@ -576,7 +573,8 @@ const createNewPathTree = function (type, setting) {
             }
             }
             postData(url, data, function (datas) {
             postData(url, data, function (datas) {
                 const result = {};
                 const result = {};
-                console.log(datas);
+                console.log('childrenCount: ' + datas.expand.length);
+                let time = new Date();
                 if (datas.update) {
                 if (datas.update) {
                     result.update = self._updateData(datas.update);
                     result.update = self._updateData(datas.update);
                 }
                 }
@@ -591,6 +589,8 @@ const createNewPathTree = function (type, setting) {
                     result.create = result.create ? result.create.concat(create) : create;
                     result.create = result.create ? result.create.concat(create) : create;
                     result.expand = update;
                     result.expand = update;
                 }
                 }
+                time = new Date() - time;
+                console.log('analysisData: ' + time);
                 callback(result);
                 callback(result);
             });
             });
         };
         };

+ 19 - 31
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -243,6 +243,21 @@ const SpreadJsObj = {
             this.endMassOperation(sheet);
             this.endMassOperation(sheet);
         }
         }
     },
     },
+    _loadRowData: function (sheet, data, row) {
+        // 单元格重新写入数据
+        if (!data) { return }
+        sheet.zh_setting.cols.forEach(function (col, j) {
+            const cell = sheet.getCell(row, j);
+            if (col.field !== '' && data[col.field]) {
+                cell.value(data[col.field]).locked(col.readOnly || sheet.zh_setting.readOnly || false).vAlign(1).hAlign(col.hAlign);
+            } else {
+                cell.locked(col.readOnly || sheet.zh_setting.readOnly || false).vAlign(1).hAlign(col.hAlign);
+            }
+            if (col.formatter) {
+                cell.formatter(col.formatter);
+            }
+        });
+    },
     /**
     /**
      * 重新加载部分数据行
      * 重新加载部分数据行
      * @param {GC.Spread.Sheets.Worksheet} sheet
      * @param {GC.Spread.Sheets.Worksheet} sheet
@@ -271,23 +286,7 @@ const SpreadJsObj = {
                         cell.formatter(col.formatter);
                         cell.formatter(col.formatter);
                     }
                     }
                 });
                 });
-            };
-            // 设置列单元格格式
-            sheet.zh_setting.cols.forEach(function (col, j) {
-                if (!col.cellType) { return; }
-
-                if (col.cellType === 'tree') {
-                    if (!sheet.extendCellType.tree) {
-                        sheet.extendCellType.tree = self.CellType.getTreeNodeCellType();
-                    }
-                    sheet.getRange(row, j, count, 1).cellType(sheet.extendCellType.tree);
-                } else if (col.cellType === 'tip') {
-                    if (!sheet.extendCellType.tip) {
-                        sheet.extendCellType.tip = self.CellType.getTipCellType();
-                    }
-                    sheet.getRange(row, j, count, 1).cellType(sheet.extendCellType.tip);
-                }
-            });
+            }
             this.endMassOperation(sheet);
             this.endMassOperation(sheet);
         } catch (err) {
         } catch (err) {
             this.endMassOperation(sheet);
             this.endMassOperation(sheet);
@@ -321,19 +320,6 @@ const SpreadJsObj = {
                     if (col.formatter) {
                     if (col.formatter) {
                         cell.formatter(col.formatter);
                         cell.formatter(col.formatter);
                     }
                     }
-                    if (col.cellType) {
-                        if (col.cellType === 'tree') {
-                            if (!sheet.extendCellType.tree) {
-                                sheet.extendCellType.tree = self.CellType.getTreeNodeCellType();
-                            }
-                            sheet.getRange(row, j, 1, 1).cellType(sheet.extendCellType.tree);
-                        } else if (col.cellType === 'tip') {
-                            if (!sheet.extendCellType.tip) {
-                                sheet.extendCellType.tip = self.CellType.getTipCellType();
-                            }
-                            sheet.getRange(row, j, 1, 1).cellType(sheet.extendCellType.tip);
-                        }
-                    }
                 });
                 });
             };
             };
             this.endMassOperation(sheet);
             this.endMassOperation(sheet);
@@ -342,11 +328,13 @@ const SpreadJsObj = {
         }
         }
     },
     },
     reLoadNodesData: function (sheet, nodes) {
     reLoadNodesData: function (sheet, nodes) {
+        this.beginMassOperation(sheet);
         nodes = nodes instanceof Array ? nodes : [nodes];
         nodes = nodes instanceof Array ? nodes : [nodes];
         for (const node of nodes) {
         for (const node of nodes) {
             const sortData = sheet.zh_dataType === 'tree' ? sheet.zh_tree.nodes : sheet.zh_data;
             const sortData = sheet.zh_dataType === 'tree' ? sheet.zh_tree.nodes : sheet.zh_data;
-            this.reLoadRowData(sheet, sortData.indexOf(node), 1);
+            this._loadRowData(sheet, node, sortData.indexOf(node));
         }
         }
+        this.endMassOperation(sheet);
     },
     },
     /**
     /**
      * 根据data加载sheet数据,合并了一般数据和树结构数据的加载
      * 根据data加载sheet数据,合并了一般数据和树结构数据的加载

+ 7 - 0
app/public/js/tender.js

@@ -128,6 +128,13 @@ option = {
 myChart.setOption(option);
 myChart.setOption(option);
 //3 标段计量分布//
 //3 标段计量分布//
 
 
+function getEmptyHtml() {
+    const html = '<div class="jumbotron">\n' +
+                 '    <h3 class="display-6">还没有标段数据</h3>\n' +
+                 '</div>';
+    return html;
+}
+
 $(document).ready(function() {
 $(document).ready(function() {
     //标段类型选择
     //标段类型选择
     $('#tender_type_select').change(function () {
     $('#tender_type_select').change(function () {

+ 31 - 8
app/router.js

@@ -24,6 +24,20 @@ module.exports = app => {
     // 控制面板相关
     // 控制面板相关
     app.get('/dashboard', sessionAuth, 'dashboardController.index');
     app.get('/dashboard', sessionAuth, 'dashboardController.index');
 
 
+    /**
+     * 项目设置
+     */
+    // 项目信息
+    app.get('/setting/info', sessionAuth, 'settingController.info');
+    // 账号设置
+    app.get('/setting/user', sessionAuth, 'settingController.user');
+    // 标段自定义类别
+    app.get('/setting/category', sessionAuth, 'settingController.category');
+    app.post('/setting/category/add', sessionAuth, 'settingController.addCategory');
+    app.post('/setting/category/del', sessionAuth, 'settingController.deleteCategory');
+    app.post('/setting/category/del', sessionAuth, 'settingController.deleteCategory');
+    app.post('/setting/category/update', sessionAuth, 'settingController.updateCategory');
+
     // 项目相关
     // 项目相关
     app.get('/project/info', sessionAuth, 'projectController.info');
     app.get('/project/info', sessionAuth, 'projectController.info');
     app.get('/project/account', sessionAuth, projectManagerCheck, 'accountController.index');
     app.get('/project/account', sessionAuth, projectManagerCheck, 'accountController.index');
@@ -33,6 +47,23 @@ module.exports = app => {
     app.get('/project/switch/:projectId', sessionAuth, projectManagerCheck, 'projectController.switchProject');
     app.get('/project/switch/:projectId', sessionAuth, projectManagerCheck, 'projectController.switchProject');
     app.post('/project/info', sessionAuth, 'projectController.saveInfo');
     app.post('/project/info', sessionAuth, 'projectController.saveInfo');
 
 
+    /**
+     * 标段管理
+     */
+    // 金额概况
+    app.get('/tender', sessionAuth, 'tenderController.index');
+    // 计量进度
+    app.get('/tender/progress', sessionAuth, 'tenderController.progress');
+    // 管理标段
+    app.get('/tender/manage', sessionAuth, 'tenderController.manage');
+    // 标段管理相关
+    app.post('/tender/add', sessionAuth, datetimeFill, 'tenderController.add');
+    app.get('/tender/switch/:tenderId', sessionAuth, 'tenderController.switchTender');
+    app.post('/tender/save', sessionAuth, datetimeFill, 'tenderController.save');
+    app.post('/tender/delete', sessionAuth, datetimeFill, 'tenderController.delete');
+    app.post('/tender/rule', sessionAuth, 'tenderController.rule');
+
+
     // 台账管理相关
     // 台账管理相关
     app.get('/ledger/explode', sessionAuth, tenderSelect, 'ledgerController.explode');
     app.get('/ledger/explode', sessionAuth, tenderSelect, 'ledgerController.explode');
     app.post('/ledger/get-children', sessionAuth, 'ledgerController.getChildren');
     app.post('/ledger/get-children', sessionAuth, 'ledgerController.getChildren');
@@ -70,14 +101,6 @@ module.exports = app => {
     app.post('/profile/code', sessionAuth, 'profileController.getCode');
     app.post('/profile/code', sessionAuth, 'profileController.getCode');
     app.post('/profile/bind', sessionAuth, 'profileController.bindMobile');
     app.post('/profile/bind', sessionAuth, 'profileController.bindMobile');
 
 
-    // 标段管理相关
-    app.get('/tender', sessionAuth, 'tenderController.index');
-    app.post('/tender/add', sessionAuth, datetimeFill, 'tenderController.add');
-    app.get('/tender/switch/:tenderId', sessionAuth, 'tenderController.switchTender');
-    app.post('/tender/save', sessionAuth, datetimeFill, 'tenderController.save');
-    app.post('/tender/delete', sessionAuth, datetimeFill, 'tenderController.delete');
-    app.post('/tender/rule', sessionAuth, 'tenderController.rule');
-
     // 中间计量 - 计量编制相关
     // 中间计量 - 计量编制相关
     app.get('/measure/wlist', sessionAuth, tenderSelect, 'measureController.list');
     app.get('/measure/wlist', sessionAuth, tenderSelect, 'measureController.list');
 
 

+ 65 - 0
app/service/category.js

@@ -0,0 +1,65 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Mai
+ * @date 2018/9/26
+ * @version
+ */
+
+const settingConst = require('../const/setting.js');
+
+module.exports = app => {
+    class Category extends app.BaseService {
+        /**
+         * 构造函数
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        constructor(ctx) {
+            super(ctx);
+            this.tableName = 'category';
+        }
+
+        async addCategory(pid, name, type) {
+            const count = await this.count({pid: pid, name: name});
+            if (count > 0) {
+                throw '存在同名类别';
+            }
+
+            const category = {
+                pid: pid,
+                name: name,
+                type: type,
+            };
+            const result = await this.db.insert(this.tableName, category);
+            if (result.affectedRows !== 1) {
+                throw '提交数据失败';
+            } else {
+                category.id = result.insertId;
+            }
+
+            category.value = category.value && category.value !== '' ? JSON.parse(category.value) : [];
+            return category;
+        }
+
+        async getCategory(condition) {
+            const data = await this.getDataByCondition(condition);
+            data.value = data.value && data.value !== '' ? JSON.parse(data.value) : [];
+            return data;
+        }
+
+        async getAllCategory(condition) {
+            const data = await this.getAllDataByCondition(condition);
+            for (const d of data) {
+                d.value = d.value && d.value !== '' ? JSON.parse(d.value) : [];
+            }
+            return data;
+        }
+
+    }
+
+    return Category;
+};

+ 2 - 10
app/service/tender.js

@@ -70,10 +70,9 @@ module.exports = app => {
         /**
         /**
          * 获取标段列表
          * 获取标段列表
          *
          *
-         * @param {Object} type - 标段类型
          * @return {Array} - 返回标段数据
          * @return {Array} - 返回标段数据
          */
          */
-        async getList(type = 0) {
+        async getList() {
             // 获取当前项目信息
             // 获取当前项目信息
             const sessionProject = this.ctx.session.sessionProject;
             const sessionProject = this.ctx.session.sessionProject;
             this.initSqlBuilder();
             this.initSqlBuilder();
@@ -81,14 +80,7 @@ module.exports = app => {
                 value: sessionProject.id,
                 value: sessionProject.id,
                 operate: '=',
                 operate: '=',
             });
             });
-            if(type !== 0) {
-                this.sqlBuilder.setAndWhere('type', {
-                    value: type,
-                    operate: '=',
-                });
-            }
-            this.sqlBuilder.limit = 10;
-            this.sqlBuilder.columns = ['id', 'name', 'status', 'type'];
+            this.sqlBuilder.columns = ['id', 'name', 'status', 'type', 'ledger_times', 'ledger_status'];
             const [sql, sqlParam] = this.sqlBuilder.build(this.tableName);
             const [sql, sqlParam] = this.sqlBuilder.build(this.tableName);
 
 
             return await this.db.query(sql, sqlParam);
             return await this.db.query(sql, sqlParam);

+ 4 - 37
app/view/layout/layout.ejs

@@ -8,6 +8,7 @@
     <title><%= ctx.menu.name === undefined ? '主页' : ctx.menu.name %>-计量支付</title>
     <title><%= ctx.menu.name === undefined ? '主页' : ctx.menu.name %>-计量支付</title>
     <link rel="stylesheet" href="/public/css/bootstrap/bootstrap.min.css">
     <link rel="stylesheet" href="/public/css/bootstrap/bootstrap.min.css">
     <link rel="stylesheet" href="/public/css/main.css">
     <link rel="stylesheet" href="/public/css/main.css">
+    <link rel="stylesheet" href="/public/css/toast.css">
     <link rel="stylesheet" href="/public/css/font-awesome/font-awesome.min.css">
     <link rel="stylesheet" href="/public/css/font-awesome/font-awesome.min.css">
     <link rel="stylesheet" href="/public/css/spreadjs/sheets/gc.spread.sheets.excelsmartcost.css">
     <link rel="stylesheet" href="/public/css/spreadjs/sheets/gc.spread.sheets.excelsmartcost.css">
     <link rel="stylesheet" href="/public/css/jquery-contextmenu/jquery.contextMenu.min.css">
     <link rel="stylesheet" href="/public/css/jquery-contextmenu/jquery.contextMenu.min.css">
@@ -27,46 +28,12 @@
 </head>
 </head>
 
 
 <body>
 <body>
-<div class="header">
-    <h1 class="logo"><a>主页-纵横变更管理系统</a></h1>
-    <% if(ctx.showProject) { %>
-    <% include ./project_list.ejs %>
-    <% } %>
-    <% if(ctx.showTender) { %>
-    <% include ./tender_list.ejs %>
-    <% } %>
-    <% if(ctx.showTitle) { %>
-    <div class="poj-name">
-        <span class="name"><%= ctx.title %></span>
-    </div>
-    <% } %>
-    <div class="header-box">
-        <div class="header-nav"></div>
-        <div class="header-user pull-right">
-            <div class="avatar btn-group">
-                <a class="dropdown-toggle" data-toggle="dropdown">
-                    <span class="pic"><img src="/public/images/avatar.png"></span>
-                    <span><%= ctx.session.sessionUser.account %></span>
-                    <span class="caret"></span>
-                </a>
-                <div class="dropdown-menu">
-                    <a href="/profile/info" class="dropdown-item">账号资料</a>
-                    <a href="#" class="dropdown-item">账号安全</a>
-                    <div class="dropdown-divider"></div>
-                    <a href="#" class="dropdown-item">帮助中心</a>
-                    <a href="/logout" class="dropdown-item">退出登录</a>
-                </div>
-            </div>
-            <div class="msg">
-                <a>
-                    <i class="fa fa-bell"></i><sup>0</sup>
-                </a>
-            </div>
-        </div>
-    </div>
+<div>
+
 </div>
 </div>
 <div class="main">
 <div class="main">
     <% include ./menu.ejs %>
     <% include ./menu.ejs %>
+
     <div class="main-panel">
     <div class="main-panel">
         <%- content %>
         <%- content %>
     </div>
     </div>

+ 25 - 15
app/view/layout/menu.ejs

@@ -1,25 +1,35 @@
-<div class="main-nav">
+<div class="main-nav d-flex align-items-start flex-column">
+    <div class="logo"><img src="/public/css/logo.png"></div>
     <div class="nav-top">
     <div class="nav-top">
-        <ul class="nav nav-pills flex-column bg-nav">
+        <ul class="nav nav-pills nav-stacked bg-nav">
             <% for (const index in ctx.menuList) { %>
             <% for (const index in ctx.menuList) { %>
             <% if (ctx.menuList[index].display === undefined || !ctx.menuList[index].display) { continue } %>
             <% if (ctx.menuList[index].display === undefined || !ctx.menuList[index].display) { continue } %>
-            <li class="nav-item <% if(ctx.controllerName === index) { %>active<% } %>">
-                <a href="<%= ctx.menuList[index].children === null ? ctx.menuList[index].url : 'javascript:void(0);' %>" data-toggle="tooltip" data-placement="right" title="<%= ctx.menuList[index].name %>">
-                    <i class="fa <%= ctx.menuList[index].icon %>"></i>
-                    <span><%= ctx.menuList[index].name %></span>
-                    <% if (ctx.menuList[index].children !== null) { %>
-                    <i class="fa fa-angle-down pull-right menu-arrow"></i>
+            <li <% if(ctx.controllerName === index) { %>class="active"<% } %>>
+                <a href="<%- ctx.menuList[index].url %>" data-toggle="tooltip" data-placement="right" title="" data-original-title="<%- ctx.menuList[index].name %>">
+                    <i class="fa <%- ctx.menuList[index].icon %>"></i>
+                    <% if (ctx.menuList[index].caption) { %>
+                    <span><%- ctx.menuList[index].caption %></span>
                     <% } %>
                     <% } %>
                 </a>
                 </a>
-                <% if (ctx.menuList[index].children !== null) { %>
-                <ul class="sub-menu" <% if(ctx.controllerName === index) { %>style="display: block;"<% }%>>
-                    <% for (const childIndex in ctx.menuList[index].children) { %>
-                    <li><a href="<%= ctx.menuList[index].children[childIndex].url %>"><%= ctx.menuList[index].children[childIndex].name %></a></li>
-                    <% } %>
-                </ul>
-                <% } %>
             </li>
             </li>
             <% } %>
             <% } %>
         </ul>
         </ul>
     </div>
     </div>
+    <div class="nav-bottom mt-auto">
+        <ul class="nav nav-pills nav-stacked bg-nav">
+            <li><a href="/setting/info" data-toggle="tooltip" data-placement="right" title="" data-original-title="项目设置"><i class="fa fa-cogs"></i><span>项目设置</span></a></li>
+        </ul>
+        <div class="dropright mb-1 ml-1">
+            <a href="" class="btn btn-sm btn-light" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">
+                <%- ctx.session.sessionUser.name %>
+            </a>
+            <div class="dropdown-menu">
+                <a href="/profile/info" class="dropdown-item">账号资料</a>
+                <a href="#" class="dropdown-item">账号安全</a>
+                <div class="dropdown-divider"></div>
+                <a href="#" class="dropdown-item">帮助中心</a>
+                <a href="/logout" class="dropdown-item">退出登录</a>
+            </div>
+        </div>
+    </div>
 </div>
 </div>

+ 31 - 0
app/view/setting/category.ejs

@@ -0,0 +1,31 @@
+<% include ./sub_menu.ejs %>
+<div class="panel-content">
+    <div class="panel-title">
+        <div class="title-main">
+            <h2>标段自定义类别
+                <a href="#add-cate" data-toggle="modal" data-target="#add-cate" class="btn btn-primary btn-sm pull-right">添加类别</a>
+            </h2>
+        </div>
+    </div>
+    <div class="content-wrap">
+        <div class="c-body">
+            <table class="table table-hover table-bordered table-sm">
+                <thead>
+                <tr>
+                    <th>名称</th>
+                    <th>类型</th>
+                    <th>值</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tbody id="categoryList">
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>
+<script>
+    let cData = JSON.parse('<%- JSON.stringify(categoryData) %>');
+    const cType = JSON.parse('<%- JSON.stringify(categoryType) %>');
+</script>
+<script src="/public/js/category.js"></script>

+ 90 - 0
app/view/setting/category_modal.ejs

@@ -0,0 +1,90 @@
+<!--弹出添加类别-->
+<div class="modal fade" id="add-cate" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">添加类别</h5>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label>类别名称</label>
+                    <input class="form-control"  placeholder="请使用简短的名称" type="text" name="name">
+                </div>
+                <div class="form-group">
+                    <label>类型</label>
+                    <div name="type">
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary" id="add-cate-ok">确认添加</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--弹出编辑类别-->
+<div class="modal fade" id="edit-cate" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">编辑类别</h5>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label>类别名称</label>
+                    <input class="form-control"  placeholder="请使用简短的名称" value="年份" type="text" name="name">
+                </div>
+                <div class="form-group">
+                    <label>类型</label>
+                    <div name="type">
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary" id="edit-cate-ok">确认</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--弹出添加值-->
+<div class="modal fade" id="add" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">添加值</h5>
+            </div>
+            <div class="modal-body">
+                <table class="table table-bordered">
+                    <thead>
+                    <tr><th>值</th><th>删除</th></tr>
+                    </thead>
+                    <tbody id="value-list">
+                    </tbody>
+                </table>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary" id="add-ok">确认</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--弹出删除-->
+<div class="modal fade" id="del-cate" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">删除类别</h5>
+            </div>
+            <div class="modal-body">
+                <h5>删除后,数据无法恢复,请谨慎操作。</h5>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-danger" id="del-cate-ok">确认删除</button>
+            </div>
+        </div>
+    </div>
+</div>

+ 50 - 0
app/view/setting/info.ejs

@@ -0,0 +1,50 @@
+<% include ./sub_menu.ejs %>
+<div class="panel-content">
+    <div class="panel-title">
+        <div class="title-main">
+            <h2>项目信息
+                <a href="#" class="btn btn-primary btn-sm pull-right">保存修改</a>
+            </h2>
+        </div>
+    </div>
+    <div class="content-wrap">
+        <div class="c-body">
+            <div class="row">
+                <div class="col-5">
+                    <form>
+                        <div class="form-group">
+                            <label>项目编号</label>
+                            <input class="form-control" value="170002" type="text" readonly>
+                        </div>
+                        <div class="form-group">
+                            <label>项目名称</label>
+                            <input class="form-control" placeholder="请输入项目名称" value="项目A" type="text">
+                        </div>
+                        <div class="form-group">
+                            <label>管理员</label>
+                            <input class="form-control" value="158****4017(陈特)" type="text" readonly>
+                        </div>
+                        <div class="form-group">
+                            <label>销售负责人</label>
+                            <div class="card w-50">
+                                <div class="card-body">
+                                    <h4 class="card-title">张三</h4>
+                                    <h6 class="card-subtitle mb-2 text-muted">广东办</h6>
+                                </div>
+                                <ul class="list-group list-group-flush">
+                                    <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="腾讯QQ"><i class="fa fa-qq"></i> 914630468</li>
+                                    <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="手机号码"><i class="fa fa-tablet"></i> 15812644017</li>
+                                    <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="固定电话"><i class="fa fa-phone"></i> 0756-3850891</li>
+                                </ul>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label>创建时间</label>
+                            <input class="form-control" value="2017-06-05" type="text" readonly>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 20 - 0
app/view/setting/sub_menu.ejs

@@ -0,0 +1,20 @@
+<div class="panel-sidebar">
+    <div class="panel-title">
+        <div class="title-bar">
+            <h2>项目设置</h2>
+        </div>
+    </div>
+    <div class="scrollbar-auto">
+        <div class="nav-box">
+            <ul class="nav-list list-unstyled">
+                <% for (const index in ctx.subMenu) { %>
+                <li <% if (ctx.url === ctx.subMenu[index].url) { %>class="active"<% } %>>
+                    <a href="<%- ctx.subMenu[index].url %>">
+                        <span><%- ctx.subMenu[index].caption %></span>
+                    </a>
+                </li>
+                <% } %>
+            </ul>
+        </div>
+    </div>
+</div>

+ 104 - 0
app/view/setting/user.ejs

@@ -0,0 +1,104 @@
+<% include ./sub_menu.ejs %>
+<div class="panel-content">
+    <div class="panel-title">
+        <div class="title-main">
+            <h2>账号管理
+                <a href="#ver" data-toggle="modal" data-target="#add-user" class="btn btn-primary btn-sm pull-right">添加账号</a>
+            </h2>
+        </div>
+    </div>
+    <div class="content-wrap">
+        <div class="c-body">
+            <nav class="nav nav-tabs mb-3" role="tablist">
+                <a class="nav-item nav-link active" data-toggle="tab" href="#user-list" role="tab">账号列表</a>
+                <a class="nav-item nav-link" data-toggle="tab" href="#user-purview" role="tab">账号权限</a>
+            </nav>
+            <div class="tab-content">
+                <div id="user-list" class="tab-pane active">
+                    <table class="table table-hover table-bordered table-sm">
+                        <thead>
+                        <tr>
+                            <th>账号</th>
+                            <th>姓名</th>
+                            <th>单位</th>
+                            <th>职位</th>
+                            <th>手机</th>
+                            <th>电话</th>
+                            <th class="text-center">操作</th></tr>
+                        </thead>
+                        <tbody>
+                        <tr>
+                            <td>chente</td>
+                            <td>陈特</td>
+                            <td>珠海纵横创新软件有限公司</td>
+                            <td>产品经理</td>
+                            <td>15812644017</td>
+                            <td>0765-3850891</td>
+                            <td class="text-center"><a href="#edit-user" data-toggle="modal" data-target="#edit-user" class="btn btn-sm btn-outline-primary">编辑</a>
+                                <a href="" class="btn btn-sm btn-outline-danger">停用</a></td>
+                        </tr>
+                        <tr class="table-danger">
+                            <td>chente2</td>
+                            <td>陈特2</td>
+                            <td>珠海纵横创新软件有限公司</td>
+                            <td>产品经理</td>
+                            <td>15812644017</td>
+                            <td>0765-3850891</td>
+                            <td class="text-center"><a href="#edit-user" data-toggle="modal" data-target="#edit-user" class="btn btn-sm btn-outline-primary">编辑</a>
+                                <a href="" class="btn btn-sm btn-outline-success">启用</a></td>
+                        </tr>
+                        <tr>
+                            <td>chente3</td>
+                            <td>陈特3</td>
+                            <td>珠海纵横创新软件有限公司</td>
+                            <td>产品经理</td>
+                            <td>15812644017</td>
+                            <td>0765-3850891</td>
+                            <td class="text-center"><a href="#edit-user" data-toggle="modal" data-target="#edit-user" class="btn btn-sm btn-outline-primary">编辑</a>
+                                <a href="" class="btn btn-sm btn-outline-danger">停用</a></td>
+                        </tr>
+                        <tr>
+                            <td>chente4</td>
+                            <td>陈特4</td>
+                            <td>珠海纵横创新软件有限公司</td>
+                            <td>产品经理</td>
+                            <td>15812644017</td>
+                            <td>0765-3850891</td>
+                            <td class="text-center"><a href="#edit-user" data-toggle="modal" data-target="#edit-user" class="btn btn-sm btn-outline-primary">编辑</a>
+                                <a href="" class="btn btn-sm btn-outline-danger">停用</a></td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+                <div id="user-purview" class="tab-pane">
+                    <table class="table table-hover table-bordered table-sm">
+                        <thead>
+                        <tr>
+                            <th>账号</th>
+                            <th>姓名</th>
+                            <th>单位</th>
+                            <th>职位</th>
+                            <th>权限</th>
+                        </thead>
+                        <tbody>
+                        <tr>
+                            <td>chente</td>
+                            <td>陈特</td>
+                            <td>珠海纵横创新软件有限公司</td>
+                            <td>产品经理</td>
+                            <td>标段管理(创建标段)<a href="#edit-user2" data-toggle="modal" data-target="#edit-user2" class="btn btn-sm">编辑</a></td>
+                        </tr>
+                        <tr>
+                            <td>chente</td>
+                            <td>陈特</td>
+                            <td>珠海纵横创新软件有限公司</td>
+                            <td>产品经理</td>
+                            <td><a href="#edit-user2" data-toggle="modal" data-target="#edit-user2" class="btn btn-sm">编辑</a></td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 155 - 0
app/view/setting/user_modal.ejs

@@ -0,0 +1,155 @@
+<!--弹出添加帐号-->
+<div class="modal fade" id="add-user" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">添加账号</h5>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label>登录账号<b class="text-danger">*</b></label>
+                    <input class="form-control"  placeholder="支持英文数字组合" type="text">
+                </div>
+                <div class="form-group">
+                    <label>姓名<b class="text-danger">*</b></label>
+                    <input class="form-control" value="" type="text">
+                </div>
+                <div class="form-group">
+                    <label>单位名称</label>
+                    <input class="form-control" value="" type="text">
+                </div>
+                <div class="form-group">
+                    <label>职位名称</label>
+                    <input class="form-control" value="" type="text">
+                </div>
+                <div class="form-group">
+                    <label>手机</label>
+                    <input class="form-control" value="" type="">
+                </div>
+                <div class="form-group">
+                    <label>电话</label>
+                    <input class="form-control" placeholder="格式000-0000000" type="">
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">确定添加</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--弹出编辑帐号-->
+<div class="modal fade" id="edit-user" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">编辑账号</h5>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label>登录账号</label>
+                    <input class="form-control" value="chente"  placeholder="支持英文数字组合" type="text">
+                </div>
+                <div class="form-group">
+                    <label>姓名</label>
+                    <input class="form-control" value="陈特" type="text">
+                    <small class="form-text text-muted">修改姓名,将影响所有该账号参与数据</small>
+                </div>
+                <div class="form-group">
+                    <label>单位名称</label>
+                    <input class="form-control" value="珠海纵横创新软件有限公司" type="text">
+                </div>
+                <div class="form-group">
+                    <label>职位名称</label>
+                    <input class="form-control" value="产品经理" type="text">
+                </div>
+                <div class="form-group">
+                    <label>手机</label>
+                    <input class="form-control" value="1812644017" type="">
+                </div>
+                <div class="form-group">
+                    <label>电话</label>
+                    <input class="form-control" value="0756-3850891" placeholder="格式000-0000000" type="">
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-outline-danger" data-dismiss="modal">删除账号</button>
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">提交修改</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--弹出编辑权限-->
+<div class="modal fade" id="edit-user2" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">编辑权限</h5>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label><i class="fa fa-list-ul"></i> 标段管理</label>
+                    <div>
+                        <div class="form-check form-check-inline">
+                            <input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1">
+                            <label class="form-check-label" for="inlineCheckbox1">创建标段</label>
+                        </div>
+                        <div class="form-check form-check-inline">
+                            <input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2">
+                            <label class="form-check-label" for="inlineCheckbox2">查看项目下所有标段</label>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group">
+                    <label><i class="fa fa-list-alt"></i> 0号台帐</label>
+                    <div>
+                        <div class="form-check form-check-inline">
+                            <input class="form-check-input" type="checkbox" id="inlineCheckbox4" value="option1">
+                            <label class="form-check-label" for="inlineCheckbox4">编制台帐</label>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group">
+                    <label><i class="fa fa-list-alt"></i> 计量台帐(台帐管理)</label>
+                    <div>
+                        <div class="form-check form-check-inline">
+                            <input class="form-check-input" type="checkbox" id="inlineCheckbox8" value="option1">
+                            <label class="form-check-label" for="inlineCheckbox8">查看</label>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group">
+                    <label><i class="fa fa-calendar-check-o"></i> 计量台帐</label>
+                    <div>
+                        <div class="form-check form-check-inline">
+                            <input class="form-check-input" type="checkbox" id="inlineCheckbox9" value="option1">
+                            <label class="form-check-label" for="inlineCheckbox9">编制计量台帐</label>
+                        </div>
+                        <div class="form-check form-check-inline">
+                            <input class="form-check-input" type="checkbox" id="inlineCheckbox11" value="option1">
+                            <label class="form-check-label" for="inlineCheckbox11">查阅标段下所有中间计量</label>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group">
+                    <label><i class="fa fa-calendar-check-o"></i> 变更令</label>
+                    <div>
+                        <div class="form-check form-check-inline">
+                            <input class="form-check-input" type="checkbox" id="inlineCheckbox12" value="option1">
+                            <label class="form-check-label" for="inlineCheckbox12">编制期计量</label>
+                        </div>
+                        <div class="form-check form-check-inline">
+                            <input class="form-check-input" type="checkbox" id="inlineCheckbox14" value="option1">
+                            <label class="form-check-label" for="inlineCheckbox14">查阅标段下所有期计量</label>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">提交修改</button>
+            </div>
+        </div>
+    </div>
+</div>

+ 79 - 112
app/view/tender/index.ejs

@@ -1,72 +1,29 @@
 <div class="panel-content">
 <div class="panel-content">
-    <div class="panel-title fluid">
-        <div class="title-main  d-flex justify-content-between">
-            <div>
-                <div class="btn-group mr-2">
-                    <select class="form-control form-control-sm m-0" id="tender_type_select">
-                        <option value="0">标段类型筛选</option>
-                        <% for(const index in tenderConst.typeString) { %>
-                        <option value="<%= index %>"<% if(tenderType == index) { %> selected<% } %>><%= tenderConst.typeString[index] %></option>
-                        <% } %>
-                    </select>
-                </div>
-                <div class="btn-group">
-                    <div class="form-check-inline">
-                        <label class="form-check-label">
-                            <input class="form-check-input" type="checkbox">
-                            查看计量进度
-                        </label>
-                    </div>
-                </div>
-                <div class="btn-group">
-                    <div class="form-check-inline">
-                        <label class="form-check-label">
-                            <input class="form-check-input" type="checkbox">
-                            管理标段
-                        </label>
-                    </div>
-                </div>
-            </div>
-            <div>
-                <a href="#add-bd" data-toggle="modal" data-target="#add-bd" class="btn btn-sm btn-primary pull-right">新建标段</a>
-            </div>
-        </div>
-    </div>
+    <% include ./sub_menu.ejs %>
     <div class="content-wrap">
     <div class="content-wrap">
         <div class="c-body">
         <div class="c-body">
-            <!--图表-->
-            <div class="row mb-5">
-                <div class="col-4">
-                    <!--图表1-->
-                    <div id="chartContainer1" style="width:100%;height:300px"></div>
-                </div>
-                <div class="col-8">
-                    <!--图表2-->
-                    <div id="chartContainer2" style="width:100%;height:300px"></div>
-                </div>
+            <!--没有标段数据-->
+            <div class="jumbotron">
+                <h3 class="display-6">还没有标段数据</h3>
             </div>
             </div>
             <!--默认-->
             <!--默认-->
-            <table class="table table-bordered table-sm">
+            <table class="table table-bordered">
                 <thead>
                 <thead>
                 <th>名称</th>
                 <th>名称</th>
-                <th>标段类型</th>
                 <th>计量期数</th>
                 <th>计量期数</th>
                 <th>审批状态</th>
                 <th>审批状态</th>
                 <th>0号台帐合同</th>
                 <th>0号台帐合同</th>
                 <th>本期完成</th>
                 <th>本期完成</th>
                 <th>截止本期合同</th>
                 <th>截止本期合同</th>
                 <th>截止本期变更</th>
                 <th>截止本期变更</th>
-                <th>接着本期完成</th>
+                <th>截止本期完成</th>
                 <th>截止上期完成</th>
                 <th>截止上期完成</th>
                 <th>本期应付</th>
                 <th>本期应付</th>
                 </thead>
                 </thead>
-                <% if(tenderList.length > 0) { %>
-                <% tenderList.forEach(function(tender) { %>
                 <tr>
                 <tr>
-                    <td><a href="/measure/stage/?tenderId=<%= tender.id %>"><%= tender.name %></a></td>
-                    <td><%= tenderConst.typeString[tender.type] %></td>
-                    <td>15</td>
-                    <td><%= tenderConst.statusString[tender.status] %></td>
+                    <td class="in-1"><i class="fa fa-folder-o"></i>&nbsp;2019</td>
+                    <td></td>
+                    <td></td>
                     <td>0</td>
                     <td>0</td>
                     <td>0</td>
                     <td>0</td>
                     <td>0</td>
                     <td>0</td>
@@ -75,72 +32,82 @@
                     <td>0</td>
                     <td>0</td>
                     <td>0</td>
                     <td>0</td>
                 </tr>
                 </tr>
-                <% }) %>
-                <% } %>
-            </table>
-            <!--查看计量进度-->
-            <table class="table table-bordered table-sm">
-                <thead>
-                <th>名称</th>
-                <th width="120">标段类型</th>
-                <th width="120">完成期数</th>
-                <th>累计合同计量</th>
-                <th>截止本期累计完成/本期完成/未完成</th>
-                </thead>
-                <% if(tenderList.length > 0) { %>
-                <% tenderList.forEach(function(tender) { %>
                 <tr>
                 <tr>
-                    <td><a href="/measure/stage/?tenderId=<%= tender.id %>"><%= tender.name %></a></td>
-                    <td><%= tenderConst.typeString[tender.type] %></td>
-                    <td>15</td>
-                    <td>¥5,000,000.00</td>
-                    <td>
-                        <div class="progress">
-                            <div class="progress-bar bg-success" style="width: 45%;" data-placement="bottom"
-                                 data-toggle="tooltip" data-original-title="截止本期累计完成:¥731,121,121.00">45%
-                            </div>
-                            <div class="progress-bar bg-info" style="width:25%;" data-placement="bottom"
-                                 data-toggle="tooltip" data-original-title="本期完成:¥31,121,121.00">25%
-                            </div>
-                            <div class="progress-bar bg-gray" style="width:30%;" data-placement="bottom"
-                                 data-toggle="tooltip" data-original-title="未完成:¥71,121,121.00">30%
-                            </div>
-                        </div>
-                    </td>
+                    <td class="in-1"><i class="fa fa-folder-o"></i>&nbsp;2018</td>
+                    <td></td>
+                    <td></td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                </tr>
+                <tr>
+                    <td class="in-2"><i class="fa fa-folder-o"></i>&nbsp;土建</td>
+                    <td></td>
+                    <td></td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                </tr>
+                <tr>
+                    <td class="in-3"><span class="text-muted mr-2">├</span><a href="biaoduan-panel.html">WWUJ-1</a></td>
+                    <td>共15期</td>
+                    <td>审批中</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                </tr>
+                <tr>
+                    <td class="in-2"><i class="fa fa-folder-o"></i>&nbsp;绿化</td>
+                    <td></td>
+                    <td></td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                </tr>
+                <tr>
+                    <td class="in-3"><span class="text-muted mr-2">├</span><a href="biaoduan-panel.html">WWUJ-2</a></td>
+                    <td>共15期</td>
+                    <td>审批中</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
                 </tr>
                 </tr>
-                <% }) %>
-                <% } %>
-            </table>
-            <!--管理标段-->
-            <table class="table table-bordered table-sm">
-                <thead>
-                <th>名称</th>
-                <th width="120">标段类型</th>
-                <th width="120">完成期数</th>
-                <th>操作</th>
-                </thead>
-                <% if(tenderList.length > 0) { %>
-                <% tenderList.forEach(function(tender) { %>
                 <tr>
                 <tr>
-                    <td><a href="/measure/stage/?tenderId=<%= tender.id %>"><%= tender.name %></a></td>
-                    <td><%= tenderConst.typeString[tender.type] %></td>
+                    <td class="in-3"><span class="text-muted mr-2">└</span><a href="biaoduan-panel.html">WWUJ-3</a></td>
                     <td>共15期</td>
                     <td>共15期</td>
-                    <td>
-                        <a tender-id="<%= tender.id %>" tender-name="<%= tender.name %>" tender-type="<%= tender.type %>" href="#save-bd" data-toggle="modal" data-target="#save-bd" class="save-btn btn btn-outline-primary btn-sm">编辑</a>
-                        <a tender-id="<%= tender.id %>" href="#del-bd" data-toggle="modal" data-target="#del-bd" class="del-btn btn btn-outline-danger btn-sm">删除</a>
-                    </td>
+                    <td>审批中</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
+                    <td>0</td>
                 </tr>
                 </tr>
-                <% }) %>
-                <% } %>
             </table>
             </table>
         </div>
         </div>
     </div>
     </div>
 </div>
 </div>
-<%- jsValidator %>
-<script type="text/javascript">
-    let tenderList = '<%- JSON.stringify(tenderList) %>';
-    tenderList = JSON.parse(tenderList);
-
-</script>
-<script src=/public/js/echarts/echarts.min.js></script>
-<script src="/public/js/tender.js"></script>
+<script>
+    const tenders = JSON.parse('<%- JSON.stringify(tenderList) %>');
+</script>

+ 61 - 0
app/view/tender/manage.ejs

@@ -0,0 +1,61 @@
+<div class="panel-content">
+    <% include ./sub_menu.ejs %>
+    <div class="content-wrap">
+        <div class="c-body">
+            <!--没有标段数据-->
+            <div class="jumbotron">
+                <h3 class="display-6">还没有标段数据</h3>
+            </div>
+            <!--管理标段-->
+            <table class="table table-bordered">
+                <thead>
+                <th>名称</th>
+                <th width="120">完成期数</th>
+                <th>操作</th>
+                </thead>
+                <tr>
+                    <td class="in-1"><i class="fa fa-folder-o"></i>&nbsp;2019</td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td class="in-1"><i class="fa fa-folder-o"></i>&nbsp;2018</td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td class="in-2"><i class="fa fa-folder-o"></i>&nbsp;土建</td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td class="in-3"><span class="text-muted mr-2">└</span><a href="biaoduan-panel.html">WWUJ-1</a></td>
+                    <td>共15期</td>
+                    <td>
+                        <a href="#add-bd" data-toggle="modal" data-target="#add-bd" class="btn btn-outline-primary btn-sm">编辑</a>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="in-3"><span class="text-muted mr-2">├</span><a href="biaoduan-panel.html">WWUJ-2</a></td>
+                    <td>共15期</td>
+                    <td>
+                        <a href="#add-bd" data-toggle="modal" data-target="#add-bd" class="btn btn-outline-primary btn-sm">编辑</a>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="in-2"><i class="fa fa-folder-o"></i>&nbsp;绿化</td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td class="in-3"><span class="text-muted mr-2">└</span><a href="biaoduan-panel.html">WWUJ-3</a></td>
+                    <td>共0期</td>
+                    <td>
+                        <a href="#add-bd" data-toggle="modal" data-target="#add-bd" class="btn btn-outline-primary btn-sm">编辑</a>
+                        <a href="#del-bd" data-toggle="modal" data-target="#del-bd" class="btn btn-outline-danger btn-sm">删除</a>
+                    </td>
+                </tr>
+            </table>
+        </div>
+    </div>
+</div>

+ 157 - 0
app/view/tender/manage_modal.ejs

@@ -0,0 +1,157 @@
+<!--弹出添加标段-->
+<div class="modal fade" id="add-bd" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">添加新标段</h5>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label>标段名称<b class="text-danger">*</b></label>
+                    <input class="form-control"  placeholder="输入标段名称" type="text">
+                </div>
+                <div class="form-group">
+                    <label>年份</label>
+                    <select class="form-control">
+                        <option>2018</option>
+                        <option>2019</option>
+                    </select>
+                </div>
+                <div class="form-group">
+                    <label>标段类型</label>
+                    <div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" value="option1" checked>
+                            <label class="form-check-label" for="exampleRadios1">
+                                土建
+                            </label>
+                        </div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios2" value="option2">
+                            <label class="form-check-label" for="exampleRadios2">
+                                绿化
+                            </label>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group">
+                    <label>公路等级</label>
+                    <div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios2" id="exampleRadios31" value="option3" checked>
+                            <label class="form-check-label" for="exampleRadios3">
+                                一级
+                            </label>
+                        </div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios2" id="exampleRadios4" value="option4">
+                            <label class="form-check-label" for="exampleRadios4">
+                                二级
+                            </label>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">确定添加</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--弹出编辑标段-->
+<div class="modal fade" id="add-bd" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">编辑标段</h5>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label>标段名称<b class="text-danger">*</b></label>
+                    <input class="form-control"  placeholder="输入标段名称" type="text">
+                </div>
+                <div class="form-group">
+                    <label>年份</label>
+                    <select class="form-control">
+                        <option>2018</option>
+                        <option>2019</option>
+                    </select>
+                </div>
+                <div class="form-group">
+                    <label>标段类型</label>
+                    <div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" value="option1" checked>
+                            <label class="form-check-label" for="exampleRadios1">
+                                土建
+                            </label>
+                        </div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios2" value="option2">
+                            <label class="form-check-label" for="exampleRadios2">
+                                绿化
+                            </label>
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group">
+                    <label>公路等级</label>
+                    <div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios2" id="exampleRadios31" value="option3" checked>
+                            <label class="form-check-label" for="exampleRadios3">
+                                一级
+                            </label>
+                        </div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios2" id="exampleRadios4" value="option4">
+                            <label class="form-check-label" for="exampleRadios4">
+                                二级
+                            </label>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">确定修改</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--删除标段-->
+<div class="modal fade" id="del-bd" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">确认删除标段</h5>
+            </div>
+            <div class="modal-body">
+                <h5>删除后,数据无法恢复,请谨慎操作。</h5>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-danger">确定删除</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--弹出分类设置-->
+<div class="modal fade" id="cate-set" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">分类设置</h5>
+            </div>
+            <div class="modal-body">
+                <div class="modal-height-300">
+                    <ul id="treeDemo2" class="ztree"></ul>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">确定添加</button>
+            </div>
+        </div>
+    </div>

+ 69 - 71
app/view/tender/modal.ejs

@@ -1,86 +1,84 @@
 <!--弹出添加标段-->
 <!--弹出添加标段-->
 <div class="modal fade" id="add-bd" data-backdrop="static">
 <div class="modal fade" id="add-bd" data-backdrop="static">
     <div class="modal-dialog" role="document">
     <div class="modal-dialog" role="document">
-        <form method="post" action="/tender/add">
-            <div class="modal-content">
-                <div class="modal-header">
-                    <h5 class="modal-title">添加新标段</h5>
-                </div>
-                <div class="modal-body">
-                    <div class="form-group">
-                        <label>标段名称<b class="text-danger">*</b></label>
-                        <input class="form-control"  placeholder="输入标段名称" type="text" name="name" />
-                    </div>
-                    <div class="form-group">
-                        <label>标段类型</label>
-                        <select class="form-control" name="type">
-                            <% for(const index in tenderConst.typeString) { %>
-                            <option value="<%= index %>"<% if(tenderType == index) { %> selected<% } %>><%= tenderConst.typeString[index] %></option>
-                            <% } %>
-                        </select>
-                    </div>
-                </div>
-                <div class="modal-footer">
-                    <input type="hidden" name="_csrf" value="<%= ctx.csrf %>"/>
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
-                    <button type="submit" class="btn btn-primary">确定添加</button>
-                </div>
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">添加新标段</h5>
             </div>
             </div>
-        </form>
-    </div>
-</div>
-
-<!--弹出编辑标段-->
-<div class="modal fade" id="save-bd" data-backdrop="static">
-    <div class="modal-dialog" role="document">
-        <form method="post" action="/tender/save">
-            <div class="modal-content">
-                <div class="modal-header">
-                    <h5 class="modal-title">编辑标段</h5>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label>标段名称<b class="text-danger">*</b></label>
+                    <input class="form-control"  placeholder="输入标段名称" type="text">
                 </div>
                 </div>
-                <div class="modal-body">
-                    <div class="form-group">
-                        <label>标段名称<b class="text-danger">*</b></label>
-                        <input class="form-control" value="" id="savename" name="name" placeholder="输入标段名称" type="text">
-                    </div>
-                    <div class="form-group">
-                        <label>标段类型</label>
-                        <select class="form-control" name="type" id="savetype">
-                            <% for(const index in tenderConst.typeString) { %>
-                            <option value="<%= index %>"<% if(tenderType == index) { %> selected<% } %>><%= tenderConst.typeString[index] %></option>
-                            <% } %>
-                        </select>
+                <div class="form-group">
+                    <label>年份</label>
+                    <select class="form-control">
+                        <option>2018</option>
+                        <option>2019</option>
+                    </select>
+                </div>
+                <div class="form-group">
+                    <label>标段类型</label>
+                    <div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" value="option1" checked>
+                            <label class="form-check-label" for="exampleRadios1">
+                                土建
+                            </label>
+                        </div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios2" value="option2">
+                            <label class="form-check-label" for="exampleRadios2">
+                                绿化
+                            </label>
+                        </div>
                     </div>
                     </div>
                 </div>
                 </div>
-                <div class="modal-footer">
-                    <input type="hidden" name="_csrf" value="<%= ctx.csrf %>"/>
-                    <input type="hidden" name="tenderId" value="" id="saveid">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
-                    <button type="submit" class="btn btn-primary">确定修改</button>
+                <div class="form-group">
+                    <label>公路等级</label>
+                    <div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios2" id="exampleRadios31" value="option3" checked>
+                            <label class="form-check-label" for="exampleRadios3">
+                                一级
+                            </label>
+                        </div>
+                        <div class="form-check-inline">
+                            <input class="form-check-input" type="radio" name="exampleRadios2" id="exampleRadios4" value="option4">
+                            <label class="form-check-label" for="exampleRadios4">
+                                二级
+                            </label>
+                        </div>
+                    </div>
                 </div>
                 </div>
             </div>
             </div>
-        </form>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">确定添加</button>
+            </div>
+        </div>
     </div>
     </div>
 </div>
 </div>
-
-<!--删除标段-->
-<div class="modal fade" id="del-bd" data-backdrop="static">
+<!--弹出分类设置-->
+<div class="modal fade" id="cate-set" data-backdrop="static">
     <div class="modal-dialog" role="document">
     <div class="modal-dialog" role="document">
-        <form method="post" action="/tender/delete">
-            <div class="modal-content">
-                <div class="modal-header">
-                    <h5 class="modal-title">确认删除标段</h5>
-                </div>
-                <div class="modal-body">
-                    <h5>删除后,数据无法恢复,请谨慎操作。</h5>
-                </div>
-                <div class="modal-footer">
-                    <input type="hidden" name="_csrf" value="<%= ctx.csrf %>"/>
-                    <input type="hidden" name="tenderId" value="" id="delid">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
-                    <button type="submit" class="btn btn-danger">确定删除</button>
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">分类设置</h5>
+            </div>
+            <div class="modal-body">
+                <div class="modal-height-300">
+                    <ul id="treeLevel" class="ztree"></ul>
                 </div>
                 </div>
             </div>
             </div>
-        </form>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary">确定添加</button>
+            </div>
+        </div>
     </div>
     </div>
-</div>
+</div>
+<script>
+    const settingConst = JSON.parse('<%- JSON.stringify(settingConst) %>');
+    const category = JSON.parse('<%- JSON.stringify(category) %>');
+</script>

+ 80 - 0
app/view/tender/progress.ejs

@@ -0,0 +1,80 @@
+<div class="panel-content">
+    <% include ./sub_menu.ejs %>
+    <div class="content-wrap">
+        <div class="c-body">
+            <!--没有标段数据-->
+            <div class="jumbotron">
+                <h3 class="display-6">还没有标段数据</h3>
+            </div>
+            <!--计量进度-->
+            <table class="table table-bordered">
+                <thead>
+                <th>名称</th>
+                <th width="120">完成期数</th>
+                <th>累计合同计量</th>
+                <th>截止本期累计完成/本期完成/未完成</th>
+                </thead>
+                <tr>
+                    <td class="in-1"><i class="fa fa-folder-o"></i>&nbsp;2019</td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td class="in-1"><i class="fa fa-folder-o"></i>&nbsp;2018</td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td class="in-2"><i class="fa fa-folder-o"></i>&nbsp;土建</td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td class="in-3"><span class="text-muted mr-2">└</span><a href="biaoduan-panel.html">WWUJ-1</a></td>
+                    <td>共15期</td>
+                    <td>¥5,000,000.00</td>
+                    <td>
+                        <div class="progress">
+                            <div class="progress-bar bg-success" style="width: 45%;" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期累计完成:¥731,121,121.00">45%</div>
+                            <div class="progress-bar bg-info" style="width:25%;" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥31,121,121.00">25%</div>
+                            <div class="progress-bar bg-gray" style="width:30%;" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥71,121,121.00">30%</div>
+                        </div>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="in-2"><i class="fa fa-folder-o"></i>&nbsp;绿化</td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                <tr>
+                    <td class="in-3"><span class="text-muted mr-2">├</span><a href="biaoduan-panel.html">WWUJ-2</a></td>
+                    <td>共15期</td>
+                    <td>¥5,000,000.00</td>
+                    <td>
+                        <div class="progress">
+                            <div class="progress-bar bg-success" style="width: 45%;" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期累计完成:¥731,121,121.00">45%</div>
+                            <div class="progress-bar bg-info" style="width:25%;" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥31,121,121.00">25%</div>
+                            <div class="progress-bar bg-gray" style="width:30%;" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥71,121,121.00">30%</div>
+                        </div>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="in-3"><span class="text-muted mr-2">└</span><a href="biaoduan-panel.html">WWUJ-3</a></td>
+                    <td>共15期</td>
+                    <td>¥5,000,000.00</td>
+                    <td>
+                        <div class="progress">
+                            <div class="progress-bar bg-success" style="width: 45%;" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期累计完成:¥731,121,121.00">45%</div>
+                            <div class="progress-bar bg-info" style="width:25%;" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥31,121,121.00">25%</div>
+                            <div class="progress-bar bg-gray" style="width:30%;" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥71,121,121.00">30%</div>
+                        </div>
+                    </td>
+                </tr>
+            </table>
+        </div>
+    </div>
+</div>

+ 30 - 0
app/view/tender/sub_menu.ejs

@@ -0,0 +1,30 @@
+<div class="panel-title fluid">
+    <div class="title-main  d-flex justify-content-between">
+        <div>
+            <div class="d-inline-block mr-2">
+                <button href="#cate-set" class="btn btn-sm btn-light" data-toggle="modal" data-target="#cate-set"><i class="fa fa-sitemap fa-rotate-270"></i> 分类</button>
+            </div>
+            <div class="d-inline-block">
+                <div class="btn-group btn-group-toggle" data-toggle="buttons">
+                    <label class="btn btn-sm btn-light <% if (ctx.url === '/tender') { %>active<% } %>" onclick="window.location.href='/tender'">
+                        <input type="radio" name="options" id="option1" autocomplete="off"> 金额概况
+                    </label>
+                    <label class="btn btn-sm btn-light  <% if (ctx.url === '/tender/progress') { %>active<% } %>" onclick="window.location.href='/tender/progress'">
+                        <input type="radio" name="options" id="option2" autocomplete="off"> 计量进度
+                    </label>
+                </div>
+            </div>
+            <div class="d-inline-block ml-3">
+                <div class="form-check-inline">
+                    <label class="form-check-label" onclick="window.location.href='/tender/manage'">
+                        <input class="form-check-input" type="checkbox" <% if (ctx.url === '/tender/manage') { %>checked="checked"<% } %>>
+                        管理标段
+                    </label>
+                </div>
+            </div>
+        </div>
+        <div>
+            <a href="#add-bd" data-toggle="modal" data-target="#add-bd" class="btn btn-sm btn-primary pull-right">新建标段</a>
+        </div>
+    </div>
+</div>

+ 33 - 94
config/menu.js

@@ -11,10 +11,11 @@
 const menu = {
 const menu = {
     dashboard: {
     dashboard: {
         name: '待办事项',
         name: '待办事项',
-        icon: 'fa-dashboard',
+        icon: 'fa-check-square-o',
         display: true,
         display: true,
         url: '/dashboard',
         url: '/dashboard',
         children: null,
         children: null,
+        caption: '待办',
     },
     },
     tender: {
     tender: {
         name: '标段管理',
         name: '标段管理',
@@ -22,107 +23,45 @@ const menu = {
         display: true,
         display: true,
         url: '/tender',
         url: '/tender',
         children: null,
         children: null,
+        caption: '项目',
     },
     },
-    project: {
-        name: '项目设置',
-        icon: null,
-        display: false,
-        children: {
-            info: {
-                name: '项目信息',
-                url: '/project/info',
-            },
-            account: {
-                name: '账号设置',
-                url: '/project/account',
-            },
-            approvalSetting: {
-                name: '审批设置',
-                url: '/project/approval',
-            },
-        },
-    },
-    ledger: {
-        name: '台帐管理',
-        icon: 'fa-list-alt',
-        display: true,
-        url: '',
-        children: {
-            explode: {
-                name: '台账分解',
-                url: '/ledger/explode',
-            },
-            change: {
-                name: '台账修订',
-                url: '/ledger/change',
-            },
-            index: {
-                name: '计量台账',
-                url: '/ledger/index',
-            },
-        },
-    },
-    // measure: {
-    //     name: '中间计量',
-    //     icon: 'fa-calendar-check-o',
-    //     display: true,
-    //     url: '',
-    //     children: {
-    //         middle: {
-    //             name: '计量编制',
-    //             url: '/measure/wlist',
-    //         },
-    //         list: {
-    //             name: '计量审批',
-    //             url: '/measure/alist',
-    //         }
-    //     },
-    // },
-    stage: {
-        name: '期计量',
-        icon: 'fa-calendar-check-o',
+    sum: {
+        name: '总分包',
+        icon: 'fa-sitemap',
         display: true,
         display: true,
+        url: '/sum',
         children: null,
         children: null,
-        url: '/stage',
+        caption: '',
     },
     },
-    change: {
-        name: '变更管理',
-        icon: 'fa-retweet',
+};
+
+const tenderMenu = {
+
+};
+
+const settingMenu = {
+    info: {
+        name: '项目信息',
         display: true,
         display: true,
-        children: null,
-        url: '/change',
+        url: '/setting/info',
+        caption: '项目信息',
     },
     },
-    contract: {
-        name: '合同管理',
-        icon: 'fa-handshake-o',
+    user: {
+        name: '账号设置',
         display: true,
         display: true,
-        children: null,
-        url: '/contract',
+        url: '/setting/user',
+        caption: '账号设置',
     },
     },
-    profile: {
-        name: '账号相关',
-        icon: '',
-        display: false,
-        children: {
-            info: {
-                name: '账号资料',
-                url: '/profile/info',
-            },
-            safe: {
-                name: '账号安全',
-                url: '/profile/safe',
-            },
-            guide: {
-                name: '新手指引',
-                url: '/profile/guide',
-            },
-            help: {
-                name: '帮助中心',
-                url: '/profile/help',
-            },
-        },
-        url: '/profile',
+    category: {
+        name: '标段自定义类别',
+        display: true,
+        url: '/setting/category',
+        caption: '标段自定义类别',
     },
     },
 };
 };
 
 
-module.exports = menu;
+module.exports = {
+    menu,
+    tenderMenu,
+    settingMenu,
+};