瀏覽代碼

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang 5 年之前
父節點
當前提交
e90009d2e0
共有 54 個文件被更改,包括 827 次插入699 次删除
  1. 3 3
      app/const/setting.js
  2. 15 15
      app/const/spread.js
  3. 4 1
      app/const/tender_info.js
  4. 2 2
      app/controller/deal_bills_controller.js
  5. 1 3
      app/controller/ledger_controller.js
  6. 1 1
      app/controller/material_controller.js
  7. 2 2
      app/controller/setting_controller.js
  8. 2 2
      app/middleware/gzip.js
  9. 20 3
      app/public/css/main.css
  10. 二進制
      app/public/deal_bills/template.xls
  11. 二進制
      app/public/deal_bills/签约清单示例.xlsx
  12. 14 14
      app/public/js/category.js
  13. 7 1
      app/public/js/change_set.js
  14. 119 18
      app/public/js/global.js
  15. 24 17
      app/public/js/ledger.js
  16. 4 3
      app/public/js/ledger_audit.js
  17. 12 2
      app/public/js/material_audit.js
  18. 16 25
      app/public/js/revise.js
  19. 1 1
      app/public/js/revise_history.js
  20. 11 5
      app/public/js/spreadjs_rela/spreadjs_zh.js
  21. 30 139
      app/public/js/stage.js
  22. 1 0
      app/public/js/stage_audit.js
  23. 3 2
      app/public/js/stage_detail.js
  24. 2 2
      app/public/js/stage_im.js
  25. 10 7
      app/public/js/tender.js
  26. 11 7
      app/public/js/tender_list.js
  27. 2 0
      app/public/js/tender_list_info.js
  28. 9 6
      app/public/js/tender_list_manage.js
  29. 2 0
      app/public/js/tender_list_progress.js
  30. 1 0
      app/service/change_audit.js
  31. 41 12
      app/service/ledger.js
  32. 1 1
      app/service/material_audit.js
  33. 1 1
      app/service/stage_audit.js
  34. 8 0
      app/service/tender_info.js
  35. 51 53
      app/view/change/info_modal.ejs
  36. 166 163
      app/view/dashboard/index.ejs
  37. 1 1
      app/view/ledger/explode.ejs
  38. 3 5
      app/view/ledger/explode_modal.ejs
  39. 2 1
      app/view/login/login.ejs
  40. 50 38
      app/view/material/audit_modal.ejs
  41. 1 1
      app/view/revise/info.ejs
  42. 14 3
      app/view/revise/modal.ejs
  43. 17 13
      app/view/setting/category.ejs
  44. 11 11
      app/view/setting/category_modal.ejs
  45. 35 32
      app/view/setting/info.ejs
  46. 42 39
      app/view/setting/user.ejs
  47. 39 36
      app/view/setting/user_permission.ejs
  48. 0 1
      app/view/stage/audit_modal.ejs
  49. 1 1
      app/view/stage/index.ejs
  50. 2 2
      app/view/tender/detail.ejs
  51. 3 1
      app/view/tender/index.ejs
  52. 3 1
      app/view/tender/info.ejs
  53. 3 1
      app/view/tender/manage.ejs
  54. 3 1
      app/view/tender/progress.ejs

+ 3 - 3
app/const/setting.js

@@ -10,15 +10,15 @@
 
 const cType = {
     dropDown: 1,
-    radio: 2,
+    // radio: 2,
 };
 const cTypeStr = [];
 cTypeStr[cType.dropDown] = '下拉菜单';
-cTypeStr[cType.radio] = '单选框';
+// cTypeStr[cType.radio] = '单选框';
 
 module.exports = {
     cType: {
         key: cType,
         text: cTypeStr,
     },
-}
+}

+ 15 - 15
app/const/spread.js

@@ -16,9 +16,9 @@ const stageDgnCols = ['deal_dgn_qty1', 'deal_dgn_qty2', 'c_dgn_qty1', 'c_dgn_qty
 const withCl = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
             {title: '设计数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
@@ -64,9 +64,9 @@ const withCl = {
 const withoutCl = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
             {title: '设计数量|数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
@@ -104,9 +104,9 @@ const withoutCl = {
 const stageTz = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: true, cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', readOnly: true, cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@', readOnly: true},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@', readOnly: true},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: true, cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
@@ -165,9 +165,9 @@ const stageTz = {
 const stageCl = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: true, cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', readOnly: true, cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@', readOnly: true},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@', readOnly: true},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: true, cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '签约|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deal_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
@@ -232,9 +232,9 @@ const stageCl = {
 const stageNoCl = {
     ledger: {
         cols: [
-            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: true, cellType: 'tree'},
-            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+            {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 145, formatter: '@', readOnly: true, cellType: 'tree'},
+            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@', readOnly: true},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@', readOnly: true},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: true, cellType: 'unit'},
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '签约|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deal_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},

+ 4 - 1
app/const/tender_info.js

@@ -8,7 +8,8 @@
  * @version
  */
 
-const parseInfo = ['deal_info', 'construction_unit', 'tech_param', 'decimal', 'precision', 'deal_param', 'display', 'chapter'];
+const parseInfo = ['deal_info', 'construction_unit', 'tech_param', 'decimal', 'precision', 'deal_param', 'display'];
+const arrayInfo = ['chapter'];
 const defaultInfo = {
     // 合同信息
     deal_info: {
@@ -76,6 +77,7 @@ const defaultInfo = {
         ke: { unit: '棵', value: 0 },
         zu: { unit: '组', value: 0 },
         xitong: { unit: '系统', value: 0 },
+        zonge: { unit: '总额', value: 0 },
         other: { value: 3 },
     },
     // 合同参数
@@ -111,5 +113,6 @@ const defaultInfo = {
 
 module.exports = {
     parseInfo,
+    arrayInfo,
     defaultInfo,
 };

+ 2 - 2
app/controller/deal_bills_controller.js

@@ -103,8 +103,8 @@ module.exports = app => {
             if (file) {
                 try {
                     let fileName;
-                    if (file === 'template.xls') {
-                        fileName = this.app.baseDir + '/app/public/deal_bills/签约清单示例.xlsx';
+                    if (file === '签约清单导入格式.xls') {
+                        fileName = this.app.baseDir + '/app/public/deal_bills/template.xls';
                     } else {
                         const create_time = Date.parse(new Date()) / 1000;
                         fileName = this.app.baseDir + '/app/public/deal_bills/downloads/' + ctx.tender.id + '-' + create_time + '.xlsx';

+ 1 - 3
app/controller/ledger_controller.js

@@ -475,9 +475,7 @@ module.exports = app => {
                 const data = JSON.parse(LzString.decompressFromUTF16(compressData));
                 const responseData = { err: 0, msg: '', data: {}, };
                 const templateId = await this.ctx.service.valuation.getValuationTemplate(this.ctx.tender.data.valuation);
-                await ctx.service.ledger.importExcel(templateId, data);
-                responseData.data.bills = await ctx.service.ledger.getData(ctx.tender.id);
-                responseData.data.pos = await ctx.service.pos.getPosData({tid: this.ctx.tender.id});
+                responseData.data = await ctx.service.ledger.importExcel(templateId, data);
                 ctx.body = responseData;
             } catch (err) {
                 this.log(err);

+ 1 - 1
app/controller/material_controller.js

@@ -199,7 +199,7 @@ module.exports = app => {
             ctx.material.user = await ctx.service.projectAccount.getAccountInfoById(ctx.material.user_id);
             ctx.material.auditHistory = [];
             if (ctx.material.times > 1) {
-                for (let i = 1; i < ctx.material.times; i++) {
+                for (let i = 1; i <= times; i++) {
                     ctx.material.auditHistory.push(await ctx.service.materialAudit.getAuditors(ctx.material.id, i));
                 }
             }

+ 2 - 2
app/controller/setting_controller.js

@@ -364,11 +364,11 @@ module.exports = app => {
                 };
 
                 const data = JSON.parse(ctx.request.body.data);
-                if (!data.name || !data.type) {
+                if (!data.name) {
                     throw '提交数据错误';
                 }
 
-                responseData.data = await ctx.service.category.addCategory(projectId, data.name, data.type);
+                responseData.data = await ctx.service.category.addCategory(projectId, data.name, settingConst.cType.key.dropDown);
                 ctx.body = responseData;
             } catch (err) {
                 this.log(err);

+ 2 - 2
app/middleware/gzip.js

@@ -18,12 +18,12 @@ module.exports = options => {
         // 后续中间件执行完成后将响应体转换成 gzip
         let body = ctx.body;
         if (!body) return;
-        if (isJSON(body)) return;
+        //if (isJSON(body)) return;
 
         // 支持 options.threshold
         if (options.threshold && ctx.length < options.threshold) return;
 
-        //if (isJSON(body)) body = JSON.stringify(body);
+        if (isJSON(body)) body = JSON.stringify(body);
 
         // 设置 gzip body,修正响应头
         const stream = zlib.createGzip();

+ 20 - 3
app/public/css/main.css

@@ -60,6 +60,14 @@ font-size: .875rem;
 .bs-popover-auto[x-placement^="bottom"] .arrow::after, .bs-popover-bottom .arrow::after{
   border-bottom-color:#000;
 }
+/*在谷歌下移除input[number]的上下箭头*/
+input.nospin[type='number']::-webkit-outer-spin-button,
+input.nospin[type='number']::-webkit-inner-spin-button{
+    -webkit-appearance: none !important;
+    margin: 0;
+}
+/*在firefox下移除input[number]的上下箭头*/
+input.nospin[type="number"]{-moz-appearance:textfield;}
 /*自定义css*/
 .in-1{padding-left:5px!important}
 .in-2{padding-left:21px!important}
@@ -103,9 +111,14 @@ font-size: .875rem;
 }
 .sjs-bar-1,.sjs-bar-2,.sjs-bar-3,.sjs-bar-4{
   height:30px;
+  padding-top:3px;
 }
 .sjs-bar{
   height:30px;
+  padding-top:3px;
+}
+.sjs-bar .nav {
+  margin-top:-3px;
 }
 .sjs-bottom{
   height:400px;
@@ -364,7 +377,7 @@ font-size: .875rem;
   width:5px;
   height:100%;
   float: left;
-  margin-left:-15px;
+  margin-left:-5px;
   cursor: w-resize;
   z-index: 999
 }
@@ -564,7 +577,7 @@ font-size: .875rem;
   padding:0 0 5px
 }
 .c-body{
-  padding:6px 6px 4px 6px;
+  padding:1px;
   background:#fff;
 }
 .right-nav{
@@ -741,7 +754,7 @@ body{
 }
 .panel-content{
   padding-top:35px;
-  overflow-x: hidden
+  overflow: hidden
 }
 .panel-content .content-wrap{
  margin:0;
@@ -809,6 +822,7 @@ label{
 }
 .panel-sidebar + .panel-content{
   padding:35px 0 0 120px;
+  overflow: hidden;
 }
 .contarl-box{
   padding:1rem 1rem;
@@ -890,4 +904,7 @@ legend {
   font-size:10px;
   padding:.2em .4em;
   top:0;
+}
+.custom-switch .custom-control-label::after{
+  top:.25rem;
 }

二進制
app/public/deal_bills/template.xls


二進制
app/public/deal_bills/签约清单示例.xlsx


+ 14 - 14
app/public/js/category.js

@@ -34,7 +34,7 @@ function getCategoryHtml(category) {
     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>', d.typeStr, '</td>');
         html.push('<td>');
         if (d.value && d.value.length > 0) {
             for (const v of d.value) {
@@ -182,8 +182,8 @@ function bindCategoryControl() {
         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;
+        // $('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');
     });
@@ -195,26 +195,26 @@ function bindCategoryControl() {
 }
 
 $(document).ready(() => {
-    InitCategoryData(cData);
+    // InitCategoryData(cData);
     $('#categoryList').html(getCategoryHtml(cData));
     bindCategoryControl();
-    $('div[name=type]', '#add-cate').html(getTypeHtml());
+    // $('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 type = $('input[type=radio]:checked', '#add-cate');
         const data = {
             name: name.val(),
-            type: parseInt(type.val()),
+            // type: parseInt(type.val()),
         };
         postData('/setting/category/add', data, function (data) {
-            InitCategoryData(data);
+            // InitCategoryData(data);
             $('#categoryList').append(getCategoryHtml(data));
             bindCategoryControl();
             cData.push(data);
             $('#add-cate').modal('hide');
             name.val('');
-            type[0].checked = false;
+            // type[0].checked = false;
         }, function (msg) {
             $('#add-cate').modal('hide');
         });
@@ -250,7 +250,7 @@ $(document).ready(() => {
             tenders = data.tenders;
             const category = findCategory(data.category.id);
             category.value = data.category.value;
-            InitCategoryData(category);
+            // InitCategoryData(category);
             $('tr[cid=' + data.category.id + ']')[0].outerHTML = getCategoryHtml(category);
             bindCategoryControl();
             $('#add').modal('hide');
@@ -261,18 +261,18 @@ $(document).ready(() => {
     // 编辑
     $('#edit-cate-ok').click(function () {
         const name = $('input[name=name]', '#edit-cate');
-        const type = $('input[type=radio]:checked', '#edit-cate');
+        // const type = $('input[type=radio]:checked', '#edit-cate');
         const data = {
             id: parseInt($(this).attr('cid')),
             name: name.val(),
-            type: parseInt(type.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);
+            // InitCategoryData(category);
             $('tr[cid=' + data.id + ']')[0].outerHTML = getCategoryHtml(category);
             bindCategoryControl();
             $('#edit-cate').modal('hide');
@@ -292,4 +292,4 @@ $(document).ready(() => {
             $('#del-cate').modal('hide');
         });
     });
-});
+});

+ 7 - 1
app/public/js/change_set.js

@@ -264,8 +264,11 @@ $(document).ready(() => {
                 // 添加新审批人
                 const addhtml2 = '<li class="list-group-item" data-auditid="' + accountInfo.id + '" >' +
                     '<i class="fa fa-stop-circle"></i>' +
-                    accountInfo.name + ' <small class="text-muted">' + accountInfo.role + '</small>' +
+                    accountInfo.name + ' <small class="text-muted">' + accountInfo.role + '</small><span class="pull-right">终审</span>' +
                     '</li>';
+                for (let i = 0; i < $('#shenpi-audit-list li').length; i++) {
+                    $('#shenpi-audit-list li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
+                }
                 $('#shenpi-audit-list').append(addhtml2);
             } else {
                 toastr.error('审批流程中已存在该用户!');
@@ -293,6 +296,9 @@ $(document).ready(() => {
             $('#shenpi-audit-list li').eq($('#shenpi-audit-list li').length-1).children('i')
                 .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
         }
+        for (let i = 0; i < $('#shenpi-audit-list li').length; i++) {
+            $('#shenpi-audit-list li').eq(i).find('.pull-right').text((i+1 === $('#shenpi-audit-list li').length ? '终' : transFormToChinese(i+1)) + '审');
+        }
     });
 
     // 打开签约清单modal并删除之前的操作

+ 119 - 18
app/public/js/global.js

@@ -18,19 +18,19 @@ function autoFlashHeight(){
     var pBarz = getObjHeight($(".toolsbar-f"));
     var bdtopc = getObjHeight($(".body-height-top"));
     var bcontent = getObjHeight($(".bcontent-wrap"));
-    $(".sjs-height-0").height($(window).height()-cHeader-90+45);
-    $(".sjs-height-1").height($(window).height()-cHeader-bcontent-90+45);
-    $(".sjs-height-2").height($(window).height()-cHeader-sBarz-110);
-    $(".sjs-height-3").height($(window).height()-cHeader-sBar-492+15);/*492*/
-    $(".sjs-height-4").height($(window).height()-cHeader-pBarz-110+65);
-    $(".sjs-height-5").height($(window).height()-cHeader-sBar-492+45);/*492*/
-    $(".sp-wrap").height(bcontent-40);
+    $(".sjs-height-0").height($(window).height()-cHeader-90+53);
+    $(".sjs-height-1").height($(window).height()-cHeader-bcontent-90+53);
+    $(".sjs-height-2").height($(window).height()-cHeader-sBarz-120);
+    $(".sjs-height-3").height($(window).height()-cHeader-sBar-492+25);/*492*/
+    $(".sjs-height-4").height($(window).height()-cHeader-pBarz-110+75);
+    $(".sjs-height-5").height($(window).height()-cHeader-sBar-492+55);/*492*/
+    $(".sp-wrap").height(bcontent-30);
     /*侧栏高度*/
-    $(".sjs-sh-1").height($(window).height()-cHeader-sBar1-92+45);
-    $(".sjs-sh-2").height($(window).height()-cHeader-sBar2-92+45);
-    $(".sjs-sh-3").height($(window).height()-cHeader-sBar3-92+45);
-    $(".sjs-sh-4").height($(window).height()-cHeader-sBar4-92+45);
-    $(".sjs-sh-5").height($(window).height()-cHeader-sBar5-92+45);
+    $(".sjs-sh-1").height($(window).height()-cHeader-sBar1-92+55);
+    $(".sjs-sh-2").height($(window).height()-cHeader-sBar2-92+55);
+    $(".sjs-sh-3").height($(window).height()-cHeader-sBar3-92+55);
+    $(".sjs-sh-4").height($(window).height()-cHeader-sBar4-92+55);
+    $(".sjs-sh-5").height($(window).height()-cHeader-sBar5-92+55);
 };
 $(window).resize(autoFlashHeight);
 /*全局自适应高度结束*/
@@ -136,7 +136,7 @@ const postData = function (url, data, successCallback, errorCallBack, showWaitin
         data: {'data': JSON.stringify(data)},
         dataType: 'json',
         cache: false,
-        timeout: 40000,
+        timeout: 60000,
         beforeSend: function(xhr) {
             let csrfToken = Cookies.get('csrfToken');
             xhr.setRequestHeader('x-csrf-token', csrfToken);
@@ -171,20 +171,22 @@ const postData = function (url, data, successCallback, errorCallBack, showWaitin
  * @param {function} successCallback - 返回成功回调
  * @param {function} errorCallBack - 返回失败回调
  */
-const postDataCompress = function (url, data, successCallback, errorCallBack, showWaiting = true) {
-    if (showWaiting) showWaitingView();
+const postDataCompress = function (url, data, successCallback, errorCallBack, htype = 'progress') {
+    if (htype === 'wait') showWaitingView();
+    if (htype === 'progress') showProgress();
     $.ajax({
         type:"POST",
         url: url,
         data: {'data': LZString.compressToUTF16(JSON.stringify(data))},
         dataType: 'json',
         cache: false,
-        timeout: 60000, // 导入清单Excel(10w行)预计需要时间
+        timeout: 80000, // 导入清单Excel(10w行)预计需要时间
         beforeSend: function(xhr) {
             let csrfToken = Cookies.get('csrfToken');
             xhr.setRequestHeader('x-csrf-token', csrfToken);
         },
         success: function(result){
+            if (htype === 'progress') doneProgress();
             if (result.err === 0) {
                 if (successCallback) {
                     successCallback(result.data);
@@ -195,14 +197,16 @@ const postDataCompress = function (url, data, successCallback, errorCallBack, sh
                     errorCallBack(result.msg);
                 }
             }
-            if (showWaiting) closeWaitingView();
+            if (htype === 'wait') closeWaitingView();
+            if (htype === 'progress') closeProgress();
         },
         error: function(jqXHR, textStatus, errorThrown){
             toastr.error('error: ' + textStatus + " " + errorThrown);
             if (errorCallBack) {
                 errorCallBack();
             }
-            if (showWaiting) closeWaitingView();
+            if (htype === 'wait') closeWaitingView();
+            if (htype === 'progress') closeProgress();
         }
     });
 };
@@ -340,6 +344,99 @@ function showWaitingView() {
     }, 1000);
 }
 
+let progressInterval;
+function showProgress() {
+    var sWidth, sHeight;
+    sWidth = document.body.clientWidth;
+    sHeight = document.body.clientHeight;
+    //背景遮罩层div
+    var bgObj = document.createElement("div");
+    bgObj.setAttribute('id', 'bgDiv');
+    bgObj.style.zIndex = '9998';
+    bgObj.style.position = "absolute";
+    bgObj.style.top = "0px";
+    bgObj.style.background = "#888";
+    bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
+    bgObj.style.opacity = "0.6";
+    bgObj.style.left = "0px";
+    bgObj.style.width = sWidth + "px";
+    bgObj.style.height = sHeight + "px";
+    document.body.appendChild(bgObj);
+
+    //信息提示层div
+    var msgObj = document.createElement("div");
+    msgObj.classList.add('progress');
+    msgObj.style.zIndex = '9999';
+    msgObj.style.position = "absolute";
+    msgObj.setAttribute("id", "progressDiv");
+    msgObj.style.height = "2px";
+    msgObj.style.width = "600px";
+    msgObj.style.top = (document.documentElement.scrollTop + sHeight / 2) + "px";
+    msgObj.style.left = (sWidth - 600) / 2 + "px";
+    document.body.appendChild(msgObj);
+    msgObj.innerHTML = '<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>';
+    const processObj = $('.progress-bar');
+
+    let count = 0;
+    progressInterval = setInterval(function () {
+        const pos = parseInt(processObj.attr('aria-valuenow'));
+        if (pos < 20) {                                       // 1
+            processObj.attr('aria-valuenow', pos + 2);
+            processObj.width((pos + 2) + '%');
+        } else if (pos < 40) {                                // 2
+            processObj.attr('aria-valuenow', pos + 1);
+            processObj.width((pos + 1) + '%');
+        } else if (pos < 60) {                         // 4
+            count += 1;
+            if (count % 2 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+                processObj.width((pos + 1) + '%');
+            }
+        } else if (pos < 80) {                         // 10
+            count += 1;
+            if (count % 5 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+                processObj.width((pos + 1) + '%');
+            }
+        } else if (pos < 90) {                        // 15
+            count += 1;
+            if (count % 15 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+                processObj.width((pos + 1) + '%');
+            }
+        }  else if (pos < 95) {                       // 20
+            count += 1;
+            if (count % 40 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+                processObj.width((pos + 1) + '%');
+            }
+        } else if (pos < 100) {                       // 30
+            count += 1;
+            if (count % 60 === 0) {
+                processObj.attr('aria-valuenow', pos + 1);
+            }
+        }
+    }, 100);
+}
+function doneProgress() {
+    clearInterval(progressInterval);
+    $('.progress-bar').attr('aria-valuenow', 100).width('100%');
+}
+function closeProgress() {
+    setTimeout(function () {
+        var bgDiv = document.getElementById("bgDiv");
+        var msgDiv = document.getElementById("progressDiv");
+        //移除背景遮罩层div
+        if(bgDiv != null){
+            document.body.removeChild(bgDiv);
+        }
+        //移除中间信息提示层div
+        if(msgDiv != null){
+            document.body.removeChild(msgDiv);
+        }
+    }, 500);
+}
+
 /**
  * 设置本地缓存
  *
@@ -435,3 +532,7 @@ function toastMessageUniq (obj) {
         obj.once = true;
     }
 }
+
+function trimInvalidChar(str) {
+    return $.trim(str).replace('\n', '').replace('\r', '').replace('\t', '');
+}

+ 24 - 17
app/public/js/ledger.js

@@ -412,7 +412,8 @@ $(document).ready(function() {
                 };
                 // 未改变值则不提交
                 const orgValue = node[col.field];
-                if (orgValue == info.editingText || ((!orgValue || orgValue === '') && (info.editingText === ''))) {
+                const newValue = trimInvalidChar(info.editingText);
+                if (orgValue == info.editingText || ((!orgValue || orgValue === '') && (newValue === ''))) {
                     return;
                 }
                 // 台账模式,检查计量单元相关
@@ -440,13 +441,13 @@ $(document).ready(function() {
                 }
                 // 获取更新数据
                 if (col.type === 'Number') {
-                    if (info.editingText) {
-                        const num = _.toNumber(info.editingText);
+                    if (newValue) {
+                        const num = _.toNumber(newValue);
                         if (num) {
                             data[col.field] = num;
                         } else {
                             try {
-                                data[col.field] = math.evaluate(transExpr(info.editingText));
+                                data[col.field] = math.evaluate(transExpr(newValue));
                             } catch(err) {
                                 toastr.error('输入的表达式非法');
                                 SpreadJsObj.reLoadRowData(info.sheet, info.row);
@@ -457,7 +458,7 @@ $(document).ready(function() {
                         data[col.field] = null;
                     }
                 } else {
-                    data[col.field] = info.editingText;
+                    data[col.field] = newValue;
                 }
                 // 更新至服务器
                 postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) {
@@ -489,7 +490,7 @@ $(document).ready(function() {
                         for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
                             const curCol = info.cellRange.col + iCol;
                             const colSetting = info.sheet.zh_setting.cols[curCol];
-                            const value = info.sheet.getText(curRow, curCol).replace('\n', '');
+                            const value = trimInvalidChar(info.sheet.getText(curRow, curCol));
                             const lPos = pos.getLedgerPos(node.id);
                             if (lPos && lPos.length > 0) {
                                 if (value === '' && colSetting.field === 'b_code') {
@@ -519,6 +520,7 @@ $(document).ready(function() {
                                         data[colSetting.field] = math.evaluate(transExpr(value));
                                         bPaste = true;
                                     } catch(err) {
+                                        delete data[colSetting.field];
                                         if (!bHint) {
                                             toastr.warning('输入的表达式非法');
                                             bHint = true;
@@ -778,9 +780,9 @@ $(document).ready(function() {
             }
 
             if (datas.length > 0) {
+                callback();
                 postData(window.location.pathname + '/update', {postType: 'update', postData: datas}, function (result) {
                     const refreshNode = sheet.zh_tree.loadPostData(result);
-                    callback();
                     treeOperationObj.refreshTree(sheet, refreshNode);
                 });
             }
@@ -873,7 +875,7 @@ $(document).ready(function() {
             const expr = $(this);
             const sheet = ledgerSpread.getActiveSheet();
             const select = SpreadJsObj.getSelectObject(sheet);
-            const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val();
+            const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = trimInvalidChar(expr.val());
             if (orgValue === newValue || (!orgValue && newValue == '')) { return; }
 
             const data = {
@@ -1109,7 +1111,7 @@ $(document).ready(function() {
                 const posData = info.sheet.zh_data ? info.sheet.zh_data[info.row] : null;
                 const col = info.sheet.zh_setting.cols[info.col];
                 const orgText = posData ? posData[col.field] : null;
-                const newText = info.sheet.getCell(info.row, info.col).text();
+                const newText = trimInvalidChar(info.sheet.getCell(info.row, info.col).text());
                 if (orgText === newText || ((!orgText || orgText === '') && (newText === ''))) {
                     return;
                 }
@@ -1305,7 +1307,7 @@ $(document).ready(function() {
                     for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
                         const curCol = info.cellRange.col + iCol;
                         const colSetting = info.sheet.zh_setting.cols[curCol];
-                        posData[colSetting.field] = info.sheet.getText(curRow, curCol);
+                        posData[colSetting.field] = trimInvalidChar(info.sheet.getText(curRow, curCol));
 
                         if (colSetting.type === 'Number') {
                             const num = _.toNumber(posData[colSetting.field]);
@@ -1317,6 +1319,7 @@ $(document).ready(function() {
                                     posData[colSetting.field] = math.evaluate(transExpr(posData[colSetting.field]));
                                     bPaste = true;
                                 } catch(err) {
+                                    delete posData[colSetting.field];
                                     toastr.warning('粘贴了表达式非法,已过滤');
                                 }
                             }
@@ -1366,7 +1369,7 @@ $(document).ready(function() {
             const expr = $(this);
             const posSheet = posSpread.getActiveSheet();
             const select = SpreadJsObj.getSelectObject(posSheet);
-            const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val(), row = expr.attr('row');
+            const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val(), row = trimInvalidChar(expr.attr('row'));
             if (orgValue === newValue || (!orgValue && newValue == '')) { return; }
 
             const data = {id: select.id};
@@ -1509,7 +1512,7 @@ $(document).ready(function() {
                     }, {
                         cols: [
                             {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
                         ],
                         treeCol: 0,
@@ -1519,6 +1522,7 @@ $(document).ready(function() {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     stdXmj.loadLib($('select', '#std-xmj').val());
                 }
@@ -1535,7 +1539,7 @@ $(document).ready(function() {
                     }, {
                         cols: [
                             {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
                         ],
                         treeCol: 0,
@@ -1545,6 +1549,7 @@ $(document).ready(function() {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     stdGcl.loadLib($('select', '#std-gcl').val());
                 }
@@ -1553,8 +1558,8 @@ $(document).ready(function() {
                 if (!dealBills) {
                     dealBills = new DealBills('#deal-bills-spread', {
                         cols: [
-                            {title: '清单编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '清单编号', field: 'code', hAlign: 0, width: 85, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true},
                             {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                             {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
@@ -1566,6 +1571,7 @@ $(document).ready(function() {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     dealBills.loadData();
                 }
@@ -1579,7 +1585,7 @@ $(document).ready(function() {
                             cols: [
                                 {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
                                 {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
                                 {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
                                 {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                                 {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
@@ -2033,6 +2039,7 @@ $(document).ready(function() {
                 $('#auditors-list li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
                 for (let i = 0; i < $('#auditors-list li').length; i++) {
                     $('#auditors-list li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
+                    $('#auditors-list2 li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
                 }
                 // 添加新审批人
                 auditorshtml.push('<li class="list-group-item" data-auditid="' + data.audit_id + '">');
@@ -2141,7 +2148,7 @@ $(document).ready(function() {
                 pos.loadDatas(result.pos);
                 posOperationObj.loadCurPosData();
                 $('#upload-ledger').modal('hide');
-            }, null, true);
+            }, null);
         }
     });
     $('#upload-ledger').bind('hidden.bs.modal', function () {

+ 4 - 3
app/public/js/ledger_audit.js

@@ -154,8 +154,8 @@ $(document).ready(() => {
             if (tab.attr('content') === '#deal-bills' && !dealBills) {
                 dealBills = new DealBills($('#deal-bills-spread')[0], {
                     cols: [
-                        {title: '清单编号', field: 'code', width: 120, formatter: '@', readOnly: true},
-                        {title: '名称', field: 'name', width: 230, formatter: '@', readOnly: true},
+                        {title: '清单编号', field: 'code', width: 85, formatter: '@', readOnly: true},
+                        {title: '名称', field: 'name', width: 150, formatter: '@', readOnly: true},
                         {title: '单位', field: 'unit', width: 50, formatter: '@', readOnly: true},
                         {title: '单价', field: 'unit_price', width: 50, readOnly: true},
                         {title: '数量', field: 'quantity', width: 50, readOnly: true},
@@ -167,6 +167,7 @@ $(document).ready(() => {
                     defaultRowHeight: 21,
                     headerFont: '12px 微软雅黑',
                     font: '12px 微软雅黑',
+                    headColWidth: [0],
                 });
                 dealBills.loadData();
             } else if (tab.attr('content') === '#search' && !searchLedger) {
@@ -178,7 +179,7 @@ $(document).ready(() => {
                             cols: [
                                 {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
                                 {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
                                 {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
                                 {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                                 {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},

+ 12 - 2
app/public/js/material_audit.js

@@ -84,10 +84,15 @@ $(document).ready(function () {
                 const auditorshtml = [];
                 // 重新上报时。令其它的审批人流程图标转换
                 $('#auditors-list li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
+                for (let i = 0; i < $('#auditors-list li').length; i++) {
+                    $('#auditors-list li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
+                    $('#auditors-list2 li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
+                }
                 // 添加新审批人
                 auditorshtml.push('<li class="list-group-item" data-auditid="' + data.aid + '">');
                 auditorshtml.push('<i class="fa fa-stop-circle"></i> ');
                 auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
+                auditorshtml.push('<span class="pull-right">终审</span>');
                 auditorshtml.push('</li>');
                 $('#auditors-list').append(auditorshtml.join(''));
 
@@ -97,8 +102,9 @@ $(document).ready(function () {
                 // 添加新审批人
                 auditorshtml2.push('<li class="list-group-item" data-auditid="' + data.aid + '">');
                 auditorshtml2.push('<h5 class="card-title"><i class="fa fa-stop-circle"></i> ');
-                auditorshtml2.push(data.name + ' <small class="text-muted">' + data.role + '</small></h5>');
-                auditorshtml2.push('</li>');
+                auditorshtml2.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
+                auditorshtml2.push('<span class="pull-right">终审</span>');
+                auditorshtml2.push('</h5></li>');
                 $('#auditors-list2').append(auditorshtml2.join(''));
             });
         }
@@ -128,6 +134,10 @@ $(document).ready(function () {
                 $('#auditors-list2 li').eq($('#auditors-list2 li').length-1).children('i')
                     .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
             }
+            for (let i = 0; i < $('#auditors-list').length; i++) {
+                $('#auditors-list').eq(i).find('.pull-right').text((i+1 === $('#auditors-list').length ? '终' : transFormToChinese(i+1)) + '审');
+                $('#auditors-list2').eq(i).find('.pull-right').text((i+1 === $('#auditors-list2').length ? '终' : transFormToChinese(i+1)) + '审');
+            }
         });
     });
     // 退回选择修改审批人流程

+ 16 - 25
app/public/js/revise.js

@@ -315,7 +315,8 @@ $(document).ready(() => {
                 };
                 // 未改变值则不提交
                 const orgValue = node[col.field];
-                if (orgValue == info.editingText || ((!orgValue || orgValue === '') && (info.editingText === ''))) {
+                const newValue = trimInvalidChar(info.editingText);
+                if (orgValue == info.editingText || ((!orgValue || orgValue === '') && (newValue === ''))) {
                     return;
                 }
                 // 台账模式,检查计量单元相关
@@ -332,7 +333,7 @@ $(document).ready(() => {
                             }
                         }
                     }
-                    if (col.field === 'b_code' && (info.editingText === '' || !info.editingText)) {
+                    if (col.field === 'b_code' && (newValue === '' || !newValue)) {
                         const lPos = pos.getLedgerPos(node.id);
                         if (lPos && lPos.length > 0) {
                             toastr.error('清单含有计量单元,请先删除计量单元,再删除清单编号');
@@ -343,7 +344,7 @@ $(document).ready(() => {
                 }
                 // 获取更新数据
                 if (info.editingText) {
-                    const text = info.editingText.replace('\n', '');
+                    const text = newValue;
                     if (node.used && (col.field === 'code' || col.field ==='b_code') && orgValue !== '' && text === '') {
                         toastr.error('节点已计量,请勿删除编号');
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
@@ -417,7 +418,7 @@ $(document).ready(() => {
                     for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
                         const curCol = info.cellRange.col + iCol;
                         const colSetting = info.sheet.zh_setting.cols[curCol];
-                        const value = info.sheet.getText(curRow, curCol).replace('\n', '');
+                        const value = trimInvalidChar(info.sheet.getText(curRow, curCol));
                         const lPos = pos.getLedgerPos(node.id);
                         if (lPos && lPos.length > 0) {
                             if (value === '' && colSetting.field === 'b_code') {
@@ -568,7 +569,7 @@ $(document).ready(() => {
 
             const expr = $(this);
             const select = SpreadJsObj.getSelectObject(billsSheet);
-            const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val();
+            const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = trimInvalidChar(expr.val());
             if (orgValue === newValue || (!orgValue && newValue == '')) { return; }
 
             const data = {
@@ -634,12 +635,6 @@ $(document).ready(() => {
                         }
                         $('#batch').modal('show');
                     }
-                },
-                'debug': {
-                    name: 'debug',
-                    callback: function (key, opt) {
-                        console.log(SpreadJsObj.getSelectObject(billsSheet));
-                    }
                 }
             }
         });
@@ -676,7 +671,7 @@ $(document).ready(() => {
             const posData = info.sheet.zh_data ? info.sheet.zh_data[info.row] : null;
             const col = info.sheet.zh_setting.cols[info.col];
             const orgText = posData ? posData[col.field] : null;
-            const newText = info.sheet.getCell(info.row, info.col).text();
+            const newText = trimInvalidChar(info.sheet.getCell(info.row, info.col).text());
             if (orgText === newText || ((!orgText || orgText === '') && (newText === ''))) return;
 
             const node = posSpreadObj.billsNode;
@@ -886,7 +881,7 @@ $(document).ready(() => {
                 for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
                     const curCol = info.cellRange.col + iCol;
                     const colSetting = info.sheet.zh_setting.cols[curCol];
-                    posData[colSetting.field] = info.sheet.getText(curRow, curCol);
+                    posData[colSetting.field] = trimInvalidChar(info.sheet.getText(curRow, curCol));
                     if (colSetting.type === 'Number') {
                         const num = _.toNumber(posData[colSetting.field]);
                         if (num) {
@@ -948,7 +943,7 @@ $(document).ready(() => {
 
             const expr = $(this);
             const select = SpreadJsObj.getSelectObject(posSheet);
-            const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val();
+            const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = trimInvalidChar(expr.val());
             if (orgValue === newValue || (!orgValue && newValue == '')) { return; }
 
             const data = {id: select.id};
@@ -1002,12 +997,6 @@ $(document).ready(() => {
                     callback: function (key, opt) {
                         posSpreadObj.deletePos(posSheet);
                     }
-                },
-                'debug': {
-                    name: 'debug',
-                    callback: function (key, opt) {
-                        console.log(SpreadJsObj.getSelectObject(posSheet));
-                    }
                 }
             }
 
@@ -1336,8 +1325,8 @@ $(document).ready(() => {
     }
     const dealBills = new DealBills('#deal-bills-spread', {
         cols: [
-            {title: '清单编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+            {title: '清单编号', field: 'code', hAlign: 0, width: 85, formatter: '@', readOnly: true},
+            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true},
             {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
             {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
@@ -1459,7 +1448,7 @@ $(document).ready(() => {
                     }, {
                         cols: [
                             {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
                         ],
                         treeCol: 0,
@@ -1469,6 +1458,7 @@ $(document).ready(() => {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     stdXmj.loadLib($('select', '#std-xmj').val());
                 }
@@ -1485,7 +1475,7 @@ $(document).ready(() => {
                     }, {
                         cols: [
                             {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree'},
-                            {title: '名称', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+                            {title: '名称', field: 'name', hAlign: 0, width: 150, formatter: '@', readOnly: true},
                             {title: '单位', field: 'unit', hAlign: 1, width: 50, formatter: '@', readOnly: true}
                         ],
                         treeCol: 0,
@@ -1495,6 +1485,7 @@ $(document).ready(() => {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
+                        headColWidth: [0],
                     });
                     stdGcl.loadLib($('select', '#std-gcl').val());
                 }
@@ -1511,7 +1502,7 @@ $(document).ready(() => {
                             cols: [
                                 {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
                                 {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
                                 {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
                                 {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                                 {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},

+ 1 - 1
app/public/js/revise_history.js

@@ -221,7 +221,7 @@ $(document).ready(() => {
                             cols: [
                                 {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
                                 {title: '清单编号', field: 'b_code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@', readOnly: true},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
                                 {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
                                 {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
                                 {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},

+ 11 - 5
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -90,11 +90,11 @@ const SpreadJsObj = {
     addCutEvents: function (spread, fun) {
         const cut = spreadNS.Commands.cut.execute;
         spreadNS.Commands.cut.execute = function (context, options, isUndo) {
-            const self = this, sheet = context.getActiveSheet();
+            const sheet = context.getActiveSheet();
             const sels = sheet.getSelections();
             const sel = sels ? sels[0] : null;
             if (sel) {
-                return fun(sheet,  sel, function () {
+                return fun(sheet, sel, function () {
                     cut(context, options, isUndo);
                 });
             }
@@ -319,6 +319,11 @@ const SpreadJsObj = {
         this.beginMassOperation(sheet);
         setting.pos = sheet.getParent().pos;
         sheet.zh_setting = setting;
+        if (sheet.zh_setting.headColWidth) {
+            for (const [i, w] of sheet.zh_setting.headColWidth.entries()) {
+                sheet.setColumnWidth(i, w, spreadNS.SheetArea.rowHeader);
+            }
+        }
         this._initSheetDeafult(sheet);
         this._initSheetHeader(sheet);
         sheet.setRowCount(sheet.zh_setting.emptyRows);
@@ -831,6 +836,7 @@ const SpreadJsObj = {
          * @returns {TreeNodeCellType}
          */
         getTreeNodeCellType: function () {
+            const xOffset = 2 + 5;
             const indent = 20;
             const levelIndent = -5;
             const halfBoxLength = 5;
@@ -969,7 +975,7 @@ const SpreadJsObj = {
                     const node = options.row < tree.nodes.length ? tree.nodes[options.row] : null;
                     if (node) {
                         const showTreeLine = true;
-                        const centerX = Math.floor(x) + (node.level) * indent + (node.level) * levelIndent + indent / 2;
+                        const centerX = Math.floor(x) + (node.level - 1) * indent + (node.level) * levelIndent + indent / 2 + xOffset;
                         const centerY = Math.floor((y + (y + h)) / 2);
                         // Draw Sibling Line
                         if (showTreeLine) {
@@ -1012,7 +1018,7 @@ const SpreadJsObj = {
                             }
                         };
                         // 重定位x
-                        const move = (node.level + 1) * indent + (node.level) * levelIndent;
+                        const move = (node.level) * indent + (node.level) * levelIndent + xOffset;
                         x = x + move;
                         w = w - move;
                     }
@@ -1054,7 +1060,7 @@ const SpreadJsObj = {
                 const node = tree.nodes[hitinfo.row];
                 if (!node) { return; }
 
-                let centerX = hitinfo.cellRect.x + offset + (node.level) * indent + (node.level) * levelIndent + indent / 2;
+                let centerX = hitinfo.cellRect.x + offset + (node.level - 1) * indent + (node.level) * levelIndent + indent / 2 + xOffset;
                 let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
 
                 // 点击展开节点时,如果已加载子项,则展开,反之这加载子项,展开

+ 30 - 139
app/public/js/stage.js

@@ -518,7 +518,7 @@ $(document).ready(() => {
                 const node = sortData[info.row], updateData = {};
 
                 const orgValue = node[col.field];
-                let newValue = info.editingText;
+                let newValue = trimInvalidChar(info.editingText);
                 if (orgValue == newValue || ((!orgValue || orgValue === '') && (!newValue || newValue === ''))) {
                     return;
                 }
@@ -708,7 +708,7 @@ $(document).ready(() => {
                             if (nodePos && nodePos.length > 0) continue;
                         }
 
-                        const text = sheet.getText(curRow, curCol);
+                        const text = trimInvalidChar(sheet.getText(curRow, curCol));
                         if (setting.dgnUpFields.indexOf(col.field) !== -1) {
                             const num = _.toNumber(text);
                             if (num) {
@@ -837,117 +837,6 @@ $(document).ready(() => {
     slSpread.bind(spreadNS.Events.ClipboardPasted, stageTreeSpreadObj.clipboardPasted);
     slSpread.bind(spreadNS.Events.TopRowChanged, stageTreeSpreadObj.topRowChanged);
     SpreadJsObj.addDeleteBind(slSpread, stageTreeSpreadObj.deletePress);
-    $.contextMenu({
-        selector: '#stage-ledger',
-        build: function ($trigger, e) {
-            const target = SpreadJsObj.safeRightClickSelection($trigger, e, slSpread);
-            return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
-        },
-        items: {
-            'measureAll': {
-                name: '计量其下所有计量单元',
-                icon: 'fa-rocket',
-                callback: function (key, opt) {
-                    const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    stageTreeSpreadObj.measureAllPosInNode(node);
-                },
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                }
-            },
-            'measureAllFiveTenth': {
-                name: '计量其下所有计量单元(计量50%)',
-                icon: 'fa-plane',
-                callback: function (key, opt) {
-                    const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    stageTreeSpreadObj.measureAllPosInNode(node, 0.5);
-                },
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                }
-            },
-            'measureAllOneTenth': {
-                name: '计量其下所有计量单元(计量10%)',
-                icon: 'fa-car',
-                callback: function (key, opt) {
-                    const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    stageTreeSpreadObj.measureAllPosInNode(node, 0.1);
-                },
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                }
-            },
-            'hint1': {
-                name: '最多计量200条清单下1000条计量单元',
-                className: 'text-danger',
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                },
-                disabled: function (key, opt) {
-                    return true;
-                }
-            },
-            'hint1_1': {
-                name: '(计数以清单为准,会计完清单下全部部位)',
-                className: 'text-danger',
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                },
-                disabled: function (key, opt) {
-                    return true;
-                }
-            },
-            'hint2': {
-                name: '可再次使用该功能计量剩下的节点',
-                className: 'text-danger',
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                },
-                disabled: function (key, opt) {
-                    return true;
-                }
-            },
-            'hint2_2': {
-                name: '(凡是计量的部位,不论计量多少,均不再计量)',
-                className: 'text-danger',
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                },
-                disabled: function (key, opt) {
-                    return true;
-                }
-            },
-            'hint3': {
-                name: '如提示数据过多后,未成功,请缩小范围再试',
-                className: 'text-danger',
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                },
-                disabled: function (key, opt) {
-                    return true;
-                }
-            },
-            'hint4': {
-                name: '该功能仅供测试用,请勿滥用,可能导致服务挂掉',
-                className: 'text-danger',
-                visible: function (key, opt) {
-                    const select = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
-                    return select;
-                },
-                disabled: function (key, opt) {
-                    return true;
-                }
-            },
-        }
-    });
     if (!readOnly) {
         $('#bills-expr').bind('change mouseleave', function () {
             if (this.readOnly) return;
@@ -1033,7 +922,8 @@ $(document).ready(() => {
                 const posData = sortData ? sortData[info.row] : null;
                 const col = info.sheet.zh_setting.cols[info.col];
                 const orgText = posData ? posData[col.field] : null;
-                if (orgText === info.editingText || ((!orgText || orgText === '') && (info.editingText === ''))) {
+                const newText = trimInvalidChar(info.editingText);
+                if (orgText === info.editingText || ((!orgText || orgText === '') && (newText === ''))) {
                     return;
                 }
                 // 台账模式下,不可新增
@@ -1049,11 +939,11 @@ $(document).ready(() => {
                     toastr.warning('数据错误, 请刷新页面后再试');
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
-                } else if (info.editingText !== '' && node.children && node.children > 0) {
+                } else if (newText !== '' && node.children && node.children > 0) {
                     toastr.error('父节点不可插入计量单元');
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
-                } else if (info.editingText !== '' && !node.b_code || node.b_code === '') {
+                } else if (newText !== '' && !node.b_code || node.b_code === '') {
                     toastr.error('项目节不可插入计量单元');
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
@@ -1061,22 +951,22 @@ $(document).ready(() => {
                 // 生成提交数据
                 const data = {};
                 if (col.field === 'name') {
-                    if ((!info.editingText || info.editingText === '') && posData) {
+                    if ((!newText || newText === '') && posData) {
                         toastr.error('部位名称不可为空');
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         return;
                     } else if (!posData) {
-                        if (info.editingText !== '') {
+                        if (newText !== '') {
                             data.updateType = 'add';
                             const order = (!sortData || sortData.length === 0) ? 1 : Math.max(sortData[sortData.length - 1].porder + 1, sortData.length + 1);
-                            data.updateData = {name: info.editingText, lid: node.id, tid: tender.id, porder: order};
+                            data.updateData = {name: newText, lid: node.id, tid: tender.id, porder: order};
                         } else {
                             SpreadJsObj.reLoadRowData(info.sheet, info.row);
                             return;
                         }
                     } else {
                         data.updateType = 'update';
-                        data.updateData = {pid: posData.id, lid: posData.lid, name: info.editingText};
+                        data.updateData = {pid: posData.id, lid: posData.lid, name: newText};
                     }
                 } else if (!posData) {
                     toastr.warning('新增部位请先输入名称');
@@ -1084,12 +974,12 @@ $(document).ready(() => {
                     data.updateType = 'update';
                     data.updateData = {pid: posData.id, lid: posData.lid};
                     if (col.type === 'Number') {
-                        const num = _.toNumber(info.editingText);
+                        const num = _.toNumber(newText);
                         if (num) {
                             data.updateData[col.field] = num;
                         } else {
                             try {
-                                data.updateData[col.field] = math.evaluate(transExpr(info.editingText));
+                                data.updateData[col.field] = math.evaluate(transExpr(newText));
                             } catch(err) {
                                 toastr.error('输入的表达式非法');
                                 SpreadJsObj.reLoadRowData(info.sheet, info.row);
@@ -1097,7 +987,7 @@ $(document).ready(() => {
                             }
                         }
                     } else {
-                        data.updateData[col.field] = info.editingText;
+                        data.updateData[col.field] = newText;
                     }
                 }
                 // 提交数据到服务器
@@ -1164,14 +1054,15 @@ $(document).ready(() => {
                         self.loadCurPosData();
                         return;
                     }
+                    const lastOrder = sortData.length > 0 ? sortData[sortData.length - 1].porder + 1 : 1;
                     for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
                         const curRow = info.cellRange.row + iRow;
-                        const newData = {lid: node.id};
+                        const newData = {lid: node.id, porder: lastOrder + curRow - sortData.length};
                         for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
                             const curCol = info.cellRange.col + iCol;
                             const colSetting = info.sheet.zh_setting.cols[curCol];
-                            newData[colSetting.field] = info.sheet.getText(curRow, curCol);
-                            if (col.type === 'Number') {
+                            newData[colSetting.field] = trimInvalidChar(info.sheet.getText(curRow, curCol));
+                            if (colSetting.type === 'Number') {
                                 const num = _.toNumber(newData[colSetting.field]);
                                 if (num) {
                                     newData[colSetting.field] = num;
@@ -1199,8 +1090,8 @@ $(document).ready(() => {
                             for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
                                 const curCol = info.cellRange.col + iCol;
                                 const colSetting = info.sheet.zh_setting.cols[curCol];
-                                newData[colSetting.field] = info.sheet.getText(curRow, curCol);
-                                if (col.type === 'Number') {
+                                newData[colSetting.field] = trimInvalidChar(info.sheet.getText(curRow, curCol));
+                                if (colSetting.type === 'Number') {
                                     const num = _.toNumber(newData[colSetting.field]);
                                     if (num) {
                                         newData[colSetting.field] = num;
@@ -1219,7 +1110,6 @@ $(document).ready(() => {
                         }
                     }
                 }
-                console.log(data);
                 postData(window.location.pathname + '/update', {pos: data}, function (result) {
                     if (result.pos) {
                         stagePos.updateDatas(result.pos.pos);
@@ -1513,7 +1403,7 @@ $(document).ready(() => {
                 cols: [
                     {title: '项目节编号', field: 'code', hAlign: 0, width: 120, formatter: '@'},
                     {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
-                    {title: '名称', field: 'name', width: 230, hAlign: 0, formatter: '@'},
+                    {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
                     {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
                     {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
                     {title: '数量', field: 'quantity', hAlign: 2, width: 50},
@@ -1796,11 +1686,11 @@ $(document).ready(() => {
             this.spreadSetting = {
                 cols: [
                     {title: '编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-                    {title: '中间计量表号', colSpan: '1', rowSpan: '1', field: 'im_code', hAlign: 0, width: 150, formatter: '@', readOnly: true},
-                    {title: '交工证书/凭证号', colSpan: '1', rowSpan: '1', field: 'doc_code', hAlign: 0, width: 180, formatter: '@'},
+                    {title: '中间计量表号', colSpan: '1', rowSpan: '1', field: 'im_code', hAlign: 0, width: 85, formatter: '@', readOnly: true},
+                    {title: '交工证书/凭证号', colSpan: '1', rowSpan: '1', field: 'doc_code', hAlign: 0, width: 110, formatter: '@'},
                     {
                         title: stage.im_type === imType.tz.value ? '本期计量金额' : '本期计量数量',
-                        colSpan: '1', rowSpan: '1', field: 'jl', hAlign: 2, width: 220, formatter: '@', readOnly: true
+                        colSpan: '1', rowSpan: '1', field: 'jl', hAlign: 2, width: 85, formatter: '@', readOnly: true
                     },
                 ],
                 headRows: 1,
@@ -1830,7 +1720,7 @@ $(document).ready(() => {
                         }
                         const data = SpreadJsObj.getSelectObject(info.sheet);
                         if (data) {
-                            const updateData = {lid: data.lid};
+                            const updateData = {lid: data.lid, pid: data.pid};
                             if (data.uuid) {
                                 updateData.uuid = data.uuid;
                             } else {
@@ -1869,7 +1759,7 @@ $(document).ready(() => {
                             const curRow = info.cellRange.row + iRow;
                             const data = info.sheet.zh_data[curRow];
                             if (data) {
-                                const updateData = {lid: data.lid};
+                                const updateData = {lid: data.lid, pid: data.pid};
                                 if (data.uuid) {
                                     updateData.uuid = data.uuid;
                                 } else {
@@ -2322,7 +2212,7 @@ $(document).ready(() => {
                     const itemStyle = 'top:' + item.top + ';' + 'left:' + item.left + ';' + 'width:' + item.width + ';' + 'height:' + item.height + ';';
                     html.push('<div class="img-item" style="' + itemStyle + '">');
                     html.push('<div class="img-bar">');
-                    html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove"></i></a>');
+                    html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove" style="font-size: 24px"></i></a>');
                     html.push('</div>');
                     html.push('<div class="focus" style="width:100%; height:100%"><img src="', item.src, '" id="draggable" style="width:100%; height:100%"></div>');
                     html.push('</div>');
@@ -2350,13 +2240,14 @@ $(document).ready(() => {
                         const html = [];
                         html.push('<div class="img-item">');
                         html.push('<div class="img-bar">');
-                        html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove"></i></a>');
+                        html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove" style="font-size: 24px"></i></a>');
                         html.push('</div>');
                         html.push('<div class="focus" style="width:100%; height:100%"><img src="', '/' + result, '" id="draggable" style="width:100%; height:100%"></div>');
                         html.push('</div>');
                         $('.img-view').append(html.join(''));
                         $('.img-bar').click(removeImageItem);
                         setdraggrable();
+                        $('#upload-img-file').val('');
                     });
                 }
             });
@@ -2392,7 +2283,7 @@ $(document).ready(() => {
                         ctx.drawImage(img, pos.left, pos.top, img.width, img.height);
                     }
                     // 生成上传数据
-                    const updateData = {updateType: 'update', lid: data.lid};
+                    const updateData = {updateType: 'update', lid: data.lid, pid: data.pid};
                     if (data.uuid) {
                         updateData.uuid = data.uuid;
                     } else {
@@ -2409,7 +2300,7 @@ $(document).ready(() => {
                         $('#edit-img').modal('hide');
                     });
                 } else if (data.calc_img) {
-                    postData(window.location.pathname + '/detail/merge-img', {updateType: 'clear', lid: data.lid, uuid: data.uuid}, function (result) {
+                    postData(window.location.pathname + '/detail/merge-img', {updateType: 'clear', lid: data.lid, pid: data.pid, uuid: data.uuid}, function (result) {
                         _.assign(data, result);
                         self.reLoadDetailData();
                         $('#edit-img').modal('hide');

+ 1 - 0
app/public/js/stage_audit.js

@@ -86,6 +86,7 @@ $(document).ready(function () {
                 $('#auditors-list li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
                 for (let i = 0; i < $('#auditors-list li').length; i++) {
                     $('#auditors-list li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
+                    $('#auditors-list2 li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
                 }
                 // 添加新审批人
                 auditorshtml.push('<li class="list-group-item" data-auditid="' + data.aid + '">');

+ 3 - 2
app/public/js/stage_detail.js

@@ -648,7 +648,7 @@ $(document).ready(() => {
             const itemStyle = 'top:' + item.top + ';' + 'left:' + item.left + ';' + 'width:' + item.width + ';' + 'height:' + item.height + ';';
             html.push('<div class="img-item" style="' + itemStyle + '">');
             html.push('<div class="img-bar">');
-            html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove"></i></a>');
+            html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove" style="font-size: 24px"></i></a>');
             html.push('</div>');
             html.push('<div class="focus" style="width:100%; height:100%"><img src="', item.src, '" id="draggable" style="width:100%; height:100%"></div>');
             html.push('</div>');
@@ -677,7 +677,7 @@ $(document).ready(() => {
                 const html = [];
                 html.push('<div class="img-item">');
                 html.push('<div class="img-bar">');
-                html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove"></i></a>');
+                html.push('<a href="javascript: void(0);" class="text-danger" title="删除"><i class="fa fa-remove" style="font-size: 24px"></i></a>');
                 html.push('</div>');
                 html.push('<div class="focus" style="width:100%; height:100%"><img src="', '/' + result, '" id="draggable" style="width:100%; height:100%"></div>');
                 html.push('</div>');
@@ -686,6 +686,7 @@ $(document).ready(() => {
                 $('.img-bar').click(removeImageItem);
                 setdraggrable();
                 needCheckDetail();
+                $('#upload-img-file').val('');
             });
         }
     });

+ 2 - 2
app/public/js/stage_im.js

@@ -403,7 +403,7 @@ const stageIm = (function () {
         if (node.gather_tp) {
             const peg = getPegNode(node);
             const im = {
-                lid: node.id, code: node.code,
+                lid: node.id, pid: '', code: node.code,
                 jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp,
                 im_code: getNewImCode(),
                 peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(node),
@@ -506,7 +506,7 @@ const stageIm = (function () {
             if (!im) {
                 const peg = getPegNode(node);
                 im = {
-                    lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
+                    lid: node.id, pid: '', code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
                     jl: 0, contract_jl: 0, qc_jl: 0,
                     im_code: getNewImCode(),
                     peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(node),

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

@@ -138,7 +138,7 @@ $(document).ready(function() {
         SpreadJsObj.massOperationSheet(sheet, function () {
             sheet.defaults.rowHeight = 25;
             sheet.setColumnCount(3);
-            sheet.setRowCount(14);
+            sheet.setRowCount(15);
             sheet.setColumnWidth(0, 1);
             sheet.setColumnWidth(1, 100);
             sheet.setColumnWidth(2, 60);
@@ -157,10 +157,11 @@ $(document).ready(function() {
             sheet.setText(10, 1, '棵');
             sheet.setText(11, 1, '组');
             sheet.setText(12, 1, '系统');
-            sheet.setText(13, 1, '其他未列单位');
+            sheet.setText(13, 1, '总额');
+            sheet.setText(14, 1, '其他未列单位');
             const lineBorder = new spreadNS.LineBorder('#6a696e', spreadNS.LineStyle.thin);
-            sheet.getRange(0, 0, 14, 3).setBorder(lineBorder, {all: true});
-            sheet.getRange(0, 0, 14, 3).formatter('@');
+            sheet.getRange(0, 0, 15, 3).setBorder(lineBorder, {all: true});
+            sheet.getRange(0, 0, 15, 3).formatter('@');
             sheet.setSelection(1, 2, 1, 1);
         });
 
@@ -231,10 +232,11 @@ $(document).ready(function() {
             sheet.setValue(10, 2, property.precision.ke.value);
             sheet.setValue(11, 2, property.precision.zu.value);
             sheet.setValue(12, 2, property.precision.xitong.value);
-            sheet.setValue(13, 2, property.precision.other.value);
+            sheet.setValue(13, 2, property.precision.zonge.value);
+            sheet.setValue(14, 2, property.precision.other.value);
         }
         function setReadOnly(readOnly) {
-            sheet.getRange(1, 2, 14, 1).locked(readOnly);
+            sheet.getRange(1, 2, 15, 1).locked(readOnly);
         }
         function getNewPrecisionData() {
             const precision = JSON.parse(JSON.stringify(property.precision));
@@ -250,7 +252,8 @@ $(document).ready(function() {
             precision.ke.value = _.toNumber(sheet.getText(10, 2));
             precision.zu.value = _.toNumber(sheet.getText(11, 2));
             precision.xitong.value = _.toNumber(sheet.getText(12, 2));
-            precision.other.value = _.toNumber(sheet.getText(13, 2));
+            precision.zonge.value = _.toNumber(sheet.getText(13, 2));
+            precision.other.value = _.toNumber(sheet.getText(14, 2));
             return precision;
         }
         function checkPrecisionMinLimit(precision, limit) {

+ 11 - 7
app/public/js/tender_list.js

@@ -77,6 +77,7 @@ function onDropNode(event, treeId, treeNodes, targetNode, moveType) {
     }
     resetFixNode(1);
     resetFixNode(2);
+    console.log(targetNode);
     if (targetNode.lid === 1 && treeNodes[0].children && treeNodes[0].children.length !== 0) {
         moveChildren(treeNodes[0].children, zTree.getNodeByParam('lid', 1));
     } else if (targetNode.lid !== 1) {
@@ -140,8 +141,9 @@ function getCategoryHtml() {
     function getSelectCategoryHtml (cate) {
         const html = [];
         html.push('<div class="form-group" cate-id="' + cate.id + '">');
-        html.push('<lable>', cate.name, '</lable>');
-        html.push('<select class="form-control">');
+        html.push('<label>', cate.name, '</label>');
+        html.push('<select class="form-control form-control-sm">');
+        html.push('<option value="0">不选</option>');
         for (const v of cate.value) {
             html.push('<option value="' + v.id + '">', v.value, '</option>');
         }
@@ -152,7 +154,7 @@ function getCategoryHtml() {
     function getRadioCategoryHtml (cate) {
         const html = [];
         html.push('<div class="form-group" cate-id="' + cate.id + '">');
-        html.push('<lable>', cate.name, '</lable>');
+        html.push('<label>', cate.name, '</label>');
         html.push('<div>');
         for (const iV in cate.value) {
             const v = cate.value[iV];
@@ -167,11 +169,11 @@ function getCategoryHtml() {
     }
     const html = [];
     for (const c of category) {
-        if (c.type === categoryType.key.dropDown) {
+        // if (c.type === categoryType.key.dropDown) {
             html.push(getSelectCategoryHtml(c));
-        } else if (c.type === categoryType.key.radio) {
-            html.push(getRadioCategoryHtml(c));
-        }
+        // } else if (c.type === categoryType.key.radio) {
+            // html.push(getRadioCategoryHtml(c));
+        // }
     }
     return html.join('');
 }
@@ -192,6 +194,7 @@ function initTenderTree () {
         let cate = findCategoryNode(category.id, value, array);
         if (!cate) {
             const cateValue = findNode('id', value, category.value);
+            if (!cateValue) return null;
             cate = {
                 cid: category.id,
                 vid: value,
@@ -325,6 +328,7 @@ function bindTenderUrl() {
 }
 
 $(document).ready(() => {
+    autoFlashHeight();
     sortCategory();
     // 初始化分类数据
     initCategoryLevelNode();

+ 2 - 0
app/public/js/tender_list_info.js

@@ -192,6 +192,7 @@ function initTenderTree () {
         let cate = findCategoryNode(category.id, value, array);
         if (!cate) {
             const cateValue = findNode('id', value, category.value);
+            if (!cateValue) return null;
             cate = {
                 cid: category.id,
                 vid: value,
@@ -361,6 +362,7 @@ function bindTenderUrl() {
 }
 
 $(document).ready(() => {
+    autoFlashHeight();
     sortCategory();
     // 初始化分类数据
     initCategoryLevelNode();

+ 9 - 6
app/public/js/tender_list_manage.js

@@ -140,8 +140,9 @@ function getCategoryHtml() {
     function getSelectCategoryHtml (cate) {
         const html = [];
         html.push('<div class="form-group" cate-id="' + cate.id + '">');
-        html.push('<lable>', cate.name, '</lable>');
-        html.push('<select class="form-control">');
+        html.push('<label>', cate.name, '</label>');
+        html.push('<select class="form-control form-control-sm">');
+        html.push('<option value="0">不选</option>');
         for (const v of cate.value) {
             html.push('<option value="' + v.id + '">', v.value, '</option>');
         }
@@ -167,11 +168,11 @@ function getCategoryHtml() {
     }
     const html = [];
     for (const c of category) {
-        if (c.type === categoryType.key.dropDown) {
+        // if (c.type === categoryType.key.dropDown) {
             html.push(getSelectCategoryHtml(c));
-        } else if (c.type === categoryType.key.radio) {
-            html.push(getRadioCategoryHtml(c));
-        }
+        // } else if (c.type === categoryType.key.radio) {
+        //     html.push(getRadioCategoryHtml(c));
+        // }
     }
     return html.join('');
 }
@@ -192,6 +193,7 @@ function initTenderTree () {
         let cate = findCategoryNode(category.id, value, array);
         if (!cate) {
             const cateValue = findNode('id', value, category.value);
+            if (!cateValue) return null;
             cate = {
                 cid: category.id,
                 vid: value,
@@ -337,6 +339,7 @@ function bindTenderUrl() {
 }
 
 $(document).ready(() => {
+    autoFlashHeight();
     sortCategory();
     // 初始化分类数据
     initCategoryLevelNode();

+ 2 - 0
app/public/js/tender_list_progress.js

@@ -192,6 +192,7 @@ function initTenderTree () {
         let cate = findCategoryNode(category.id, value, array);
         if (!cate) {
             const cateValue = findNode('id', value, category.value);
+            if (!cateValue) return null;
             cate = {
                 cid: category.id,
                 vid: value,
@@ -338,6 +339,7 @@ function bindTenderUrl() {
 }
 
 $(document).ready(() => {
+    autoFlashHeight();
     sortCategory();
     // 初始化分类数据
     initCategoryLevelNode();

+ 1 - 0
app/service/change_audit.js

@@ -240,6 +240,7 @@ module.exports = app => {
                 value: times,
                 operate: '!=',
             });
+            this.sqlBuilder.orderBy = [['usort', 'ASC']];
             const [sql, sqlParam] = this.sqlBuilder.build(this.tableName);
             const result = await this.db.query(sql, sqlParam);
 

+ 41 - 12
app/service/ledger.js

@@ -727,7 +727,7 @@ module.exports = app => {
                     newIds.push(qd.id);
                     if (data[i].pos.length > 0) {
                         await this.ctx.service.pos.insertLedgerPosData(this.transaction, tenderId, qd, data[i].pos);
-                        await this._calcNode(qd, this.transaction);
+                        await this.calcNode(qd, this.transaction);
                     }
                 }
                 this._cacheMaxLid(tenderId, maxId + data.length);
@@ -812,6 +812,7 @@ module.exports = app => {
                 });
             }
             await transaction.insert(this.tableName, datas);
+            return datas;
         }
 
         /**
@@ -820,32 +821,60 @@ module.exports = app => {
          * @returns {Promise<void>}
          */
         async importExcel(templateId, excelData) {
-            //console.time('analysis');
+            console.time('analysis');
             const AnalysisExcel = require('../lib/analysis_excel');
             const analysisExcel = new AnalysisExcel(this.ctx);
             const tempData = await this.ctx.service.tenderNodeTemplate.getData(templateId, true);
             const cacheTree = analysisExcel.analysisData(excelData, tempData);
             const cacheKey = keyPre + this.ctx.tender.id;
             const orgMaxId = parseInt(await this.cache.get(cacheKey));
-            //console.timeEnd('analysis');
+            console.timeEnd('analysis');
             const transaction = await this.db.beginTransaction();
             try {
-                //console.time('deleteBills');
+                console.time('deleteBills');
                 await transaction.delete(this.tableName, {tender_id: this.ctx.tender.id});
-                //console.timeEnd('deleteBills');
-                //console.time('deletePos');
+                console.timeEnd('deleteBills');
+                console.time('deletePos');
                 await transaction.delete(this.ctx.service.pos.tableName, {tid: this.ctx.tender.id});
-                //console.timeEnd('deletePos');
-                //console.time('insertBills');
-                await this._importCacheTreeNodes(transaction, cacheTree.items);
-                //console.timeEnd('insertBills');
-                //console.time('insertPos');
+                console.timeEnd('deletePos');
+                console.time('insertBills');
+                //const bills = await this._importCacheTreeNodes(transaction, cacheTree.items);
+                const datas = [];
+                for (const node of cacheTree.items) {
+                    datas.push({
+                        id: node.id,
+                        tender_id: this.ctx.tender.id,
+                        ledger_id: node.ledger_id,
+                        ledger_pid: node.ledger_pid,
+                        level: node.level,
+                        order: node.order,
+                        is_leaf: !node.children || node.children.length === 0,
+                        full_path: node.full_path,
+                        code: node.code,
+                        b_code: node.b_code,
+                        name: node.name,
+                        unit: node.unit,
+                        sgfh_qty: node.sgfh_qty,
+                        sgfh_tp: node.sgfh_tp,
+                        quantity: node.quantity,
+                        unit_price: node.unit_price,
+                        total_price: node.total_price,
+                        dgn_qty1: node.dgn_qty1,
+                        dgn_qty2: node.dgn_qty2,
+                        memo: node.memo,
+                        drawing_code: node.drawing_code,
+                    });
+                }
+                await transaction.insert(this.tableName, datas);
+                console.timeEnd('insertBills');
+                console.time('insertPos');
                 if (cacheTree.pos && cacheTree.pos.length > 0) {
                     await transaction.insert(this.ctx.service.pos.tableName, cacheTree.pos);
                 }
-                //console.timeEnd('insertPos');
+                console.timeEnd('insertPos');
                 await transaction.commit();
                 this.cache.set(cacheKey, cacheTree.items.length + 1, 'EX', this.ctx.app.config.cacheTime);
+                return {bills: datas, pos: cacheTree.pos}
             } catch (err) {
                 await transaction.rollback();
                 if (orgMaxId) {

+ 1 - 1
app/service/material_audit.js

@@ -325,7 +325,7 @@ module.exports = app => {
             if (!audit) {
                 throw '审核数据错误';
             }
-            const sql = 'SELECT `tid`, `mid`, `aid`, `order` FROM ?? WHERE `mid` = ? and `times` = ? GROUP BY `aid`';
+            const sql = 'SELECT `tid`, `mid`, `aid`, `order` FROM ?? WHERE `mid` = ? and `times` = ? GROUP BY `aid` ORDER BY `id` ASC';
             const sqlParam = [this.tableName, materialId, times];
             const auditors = await this.db.query(sql, sqlParam);
             let order = 1;

+ 1 - 1
app/service/stage_audit.js

@@ -327,7 +327,7 @@ module.exports = app => {
                 throw '审核数据错误';
             }
             const tpData = await this.ctx.service.stageBills.getSumTotalPrice(this.ctx.stage);
-            const sql = 'SELECT `tid`, `sid`, `aid`, `order` FROM ?? WHERE `sid` = ? and `times` = ? GROUP BY `aid`';
+            const sql = 'SELECT `tid`, `sid`, `aid`, `order` FROM ?? WHERE `sid` = ? and `times` = ? GROUP BY `aid` ORDER BY `id` ASC';
             const sqlParam = [this.tableName, stageId, times];
             const auditors = await this.db.query(sql, sqlParam);
             let order = 1;

+ 8 - 0
app/service/tender_info.js

@@ -10,6 +10,7 @@
 
 const infoConst = require('../const/tender_info');
 const parseInfo = infoConst.parseInfo;
+const arrayInfo = infoConst.arrayInfo;
 const defaultInfo = infoConst.defaultInfo;
 
 module.exports = app => {
@@ -42,6 +43,9 @@ module.exports = app => {
             for (const pi of parseInfo) {
                 info[pi] = JSON.stringify(info[pi])
             }
+            for (const pi of arrayInfo) {
+                info[pi] = JSON.stringify(info[pi])
+            }
 
             if (transaction) {
                 await transaction.insert(this.tableName, info);
@@ -64,6 +68,10 @@ module.exports = app => {
             }
             for (const pi of parseInfo) {
                 info[pi] = !info[pi] || info[pi] === '' ? defaultInfo[pi] : JSON.parse(info[pi]);
+                this.ctx.helper._.defaults(info[pi], defaultInfo[pi]);
+            }
+            for (const ai of arrayInfo) {
+                info[ai] = !info[ai] || info[ai] === '' ? defaultInfo[ai] : JSON.parse(info[ai]);
             }
             return info;
         }

+ 51 - 53
app/view/change/info_modal.ejs

@@ -94,7 +94,7 @@
 <script src="/public/js/change_company.js"></script>
 
 <!--添加清单-->
-<div class="modal fade " tabindex="-1" role="dialog" aria-hidden="true" id="addlist">
+<div class="modal fade " tabindex="-1" role="dialog" aria-hidden="true" id="addlist" data-backdrop="static">
     <style>
         /* 设置滚动条的样式 */
         .fixed_headers ::-webkit-scrollbar, .fixed_headers2 ::-webkit-scrollbar {
@@ -235,11 +235,11 @@
                             <a href="#sub-ap" data-toggle="modal" data-category="" data-target="#sub-ap" id="hideSp">修改审批流程</a>
                             <div class="card mt-3">
                                 <ul class="list-group list-group-flush">
-                                    <% for (const audit of auditList) { %>
+                                    <% for (const [index, audit] of auditList.entries()) { %>
                                         <% if (audit.usite === 0) { %>
                                             <li class="list-group-item">
                                                 <i class="fa fa-play-circle fa-rotate-90"></i>
-                                                <%= audit.name %>  <small class="text-muted"><%= audit.jobs %></small>
+                                                <%= audit.name %>  <small class="text-muted"><%= audit.jobs %></small><span class="pull-right">原报</span>
                                             </li>
                                         <% } %>
                                     <% } %>
@@ -253,7 +253,7 @@
                                                 <% } else if (index+1 === auditList.length) { %>
                                                     <i class="fa fa-stop-circle"></i>
                                                 <% } %>
-                                                <%= a.name %>  <small class="text-muted"><%= a.jobs %></small>
+                                                <%= a.name %>  <small class="text-muted"><%= a.jobs %></small><span class="pull-right"><%= index+1 === auditList.length ? '终' : ctx.helper.transFormToChinese(index) %>审</span>
                                             </li>
                                         <% }%>
                                     <% } %>
@@ -267,19 +267,6 @@
                                     <ul class="list-group list-group-flush">
                                         <% for (const [aindex,al] of auditList3[time].entries()) { %>
                                             <li class="list-group-item">
-                                                <% if (al.usite === 0 && al.status === 2) { %>
-                                                    <span class="pull-right">重新上报中</span>
-                                                <% } else if (al.usite === 0 && al.status === 3) { %>
-                                                    <span class="text-success pull-right">上报</span>
-                                                <% } else if (al.usite !== 0 && al.status === 2) { %>
-                                                    <span class="pull-right">审批中</span>
-                                                <% } else if (al.usite !== 0 && al.status === 3) { %>
-                                                    <span class="text-success pull-right">审批通过</span>
-                                                <% } else if (al.usite !== 0 && al.status === 4) { %>
-                                                    <span class="text-danger pull-right">审批终止</span>
-                                                <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
-                                                    <span class="text-warning pull-right">审批退回 </span>
-                                                <% } %>
                                                 <h5 class="card-title">
                                                     <% if (al.usite === 0 && al.status === 2 ) { %>
                                                         <i class="fa fa-play-circle fa-rotate-90"></i>
@@ -294,14 +281,26 @@
                                                     <% } else if (al.status === 5 || al.status === 6) { %>
                                                         <i class="fa <% if (aindex+1 === auditList3[time].length) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> text-warning"></i>
                                                     <% } %>
-                                                    <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small>
+                                                    <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (aindex+1 === auditList3[time].length ? '终审' : ctx.helper.transFormToChinese(al.usite) + '审') %></span>
                                                 </h5>
-                                                <% if (al.sdesc !== '' && al.sdesc !== null) { %>
-                                                    <p class="card-text mb-1"><%= al.sdesc %></p>
-                                                <% } %>
-                                                <% if (al.sin_time !== null) { %>
-                                                    <p class="card-text"><small class="text-muted"><%= moment(al.sin_time).format('YYYY-MM-DD') %></small></p>
-                                                <% } %>
+                                                <div class="ml-3">
+                                                    <% if (al.usite === 0 && al.status === 2) { %>
+                                                        <span>重新上报中</span>
+                                                    <% } else if (al.usite === 0 && al.status === 3) { %>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>上报</span>
+                                                    <% } else if (al.usite !== 0 && al.status === 2) { %>
+                                                        <span>审批中</span>
+                                                    <% } else if (al.usite !== 0 && al.status === 3) { %>
+                                                        <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                                    <% } else if (al.usite !== 0 && al.status === 4) { %>
+                                                        <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                                    <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
+                                                        <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 </span>
+                                                    <% } %>
+                                                    <% if (al.sdesc !== '' && al.sdesc !== null) { %>
+                                                        <p class="card-text"><%= al.sdesc %></p>
+                                                    <% } %>
+                                                </div>
                                             </li>
                                         <% } %>
                                     </ul>
@@ -344,7 +343,7 @@
                                         <% } else if (index+1 === auditList2.length) { %>
                                             <i class="fa fa-stop-circle"></i>
                                         <% } %>
-                                        <%= a.name %>  <small class="text-muted"><%= a.jobs %></small>
+                                        <%= a.name %>  <small class="text-muted"><%= a.jobs %></small><span class="pull-right"><%= a.usite === 0 ? '原报' : (index+1 === auditList2.length ? '终审' : ctx.helper.transFormToChinese(a.usite) + '审') %></span>
                                     </li>
                                 <% } %>
                             </ul>
@@ -356,23 +355,6 @@
                             <ul class="list-group list-group-flush">
                                 <% for (const [aindex,al] of auditList3[time].entries()) { %>
                                 <li class="list-group-item">
-                                    <% if (al.usite === 0 && al.status === 2) { %>
-                                    <span class="pull-right">重新上报中</span>
-                                    <% } else if (al.usite === 0 && al.status === 3 && al.times === 1) { %>
-                                    <span class="text-success pull-right">上报</span>
-                                    <% } else if (al.usite === 0 && al.status === 3 && al.times !== 1) { %>
-                                    <span class="text-success pull-right">重新上报</span>
-                                    <% } else if (al.usite !== 0 && al.status === 2) { %>
-                                    <span class="pull-right">审批中</span>
-                                    <% } else if (al.usite !== 0 && al.status === 3) { %>
-                                    <span class="text-success pull-right">审批通过</span>
-                                    <% } else if (al.usite !== 0 && al.status === 4) { %>
-                                    <span class="text-danger pull-right">审批终止</span>
-                                    <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
-                                    <span class="text-warning pull-right">审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
-                                    <% } else if (al.usite !== 0 && al.status === 7) { %>
-                                        <span class="text-warning pull-right">重新审批</span>
-                                    <% } %>
                                     <h5 class="card-title">
                                         <% if (al.usite === 0 && al.status === 2 ) { %>
                                         <i class="fa fa-play-circle fa-rotate-90"></i>
@@ -389,14 +371,30 @@
                                         <% } else if (al.status === 7) { %>
                                         <i class="fa fa-chevron-circle-down text-warning"></i>
                                         <% } %>
-                                        <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small>
+                                        <%= al.name %>&nbsp;<small class="text-muted"><%= al.jobs %></small><span class="pull-right"><%= al.usite === 0 ? '原报' : (aindex+1 === auditList3[time].length ? '终审' : ctx.helper.transFormToChinese(aindex) + '审')  %></span>
                                     </h5>
-                                        <% if (al.sdesc !== '' && al.sdesc !== null) { %>
-                                            <p class="card-text mb-1"><%= al.sdesc %></p>
+                                    <div class="ml-3">
+                                        <% if (al.usite === 0 && al.status === 2) { %>
+                                            <span>重新上报中</span>
+                                        <% } else if (al.usite === 0 && al.status === 3 && al.times === 1) { %>
+                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>上报</span>
+                                        <% } else if (al.usite === 0 && al.status === 3 && al.times !== 1) { %>
+                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新上报</span>
+                                        <% } else if (al.usite !== 0 && al.status === 2) { %>
+                                            <span>审批中</span>
+                                        <% } else if (al.usite !== 0 && al.status === 3) { %>
+                                            <span class="text-success"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批通过</span>
+                                        <% } else if (al.usite !== 0 && al.status === 4) { %>
+                                            <span class="text-danger"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批终止</span>
+                                        <% } else if (al.usite !== 0 && (al.status === 5 || al.status === 6)) { %>
+                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>审批退回 <% if (al.status === 5) {%><%= auditList3[time][0].name %><% } %></span>
+                                        <% } else if (al.usite !== 0 && al.status === 7) { %>
+                                            <span class="text-warning"><% if (al.sin_time !== null) { %><small><%= moment(al.sin_time).format('YYYY-MM-DD') %></small> <% } %>重新审批</span>
                                         <% } %>
-                                        <% if (al.sin_time !== null) { %>
-                                            <p class="card-text"><small class="text-muted"><%= moment(al.sin_time).format('YYYY-MM-DD') %></small></p>
+                                        <% if (al.sdesc !== '' && al.sdesc !== null) { %>
+                                            <p class="card-text"><%= al.sdesc %></p>
                                         <% } %>
+                                    </div>
                                 </li>
                                 <% } %>
                             </ul>
@@ -427,11 +425,11 @@
                         <ul class="list-group list-group-flush">
                             <% for (const [index,a] of auditList.entries()) { %>
                             <li class="list-group-item">
-                                <% if (a.status === 3 && a.usort === 0 && a.times === 1) { %>
+                                <% if (a.status === 3 && a.usite === 0 && a.times === 1) { %>
                                 <span class="text-success pull-right">上报</span>
-                                <% } else if (a.status === 3 && a.usort === 0 && a.times !== 1) { %>
+                                <% } else if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>
                                 <span class="text-success pull-right">重新上报</span>
-                                <% } else if (a.status === 3 && a.usort !== 0) { %>
+                                <% } else if (a.status === 3 && a.usite !== 0) { %>
                                 <span class="text-success pull-right">审批通过</span>
                                 <% } else if (a.status === 2) { %>
                                 <span class="pull-right">审批中</span>
@@ -498,11 +496,11 @@
                         <ul class="list-group list-group-flush">
                             <% for (const [index,a] of auditList.entries()) { %>
                                 <li class="list-group-item">
-                                    <% if (a.status === 3 && a.usort === 0 && a.times === 1) { %>
+                                    <% if (a.status === 3 && a.usite === 0 && a.times === 1) { %>
                                         <span class="text-success pull-right">上报</span>
-                                    <% } else if (a.status === 3 && a.usort === 0 && a.times !== 1) { %>
+                                    <% } else if (a.status === 3 && a.usite === 0 && a.times !== 1) { %>
                                         <span class="text-success pull-right">重新上报</span>
-                                    <% } else if (a.status === 3 && a.usort !== 0) { %>
+                                    <% } else if (a.status === 3 && a.usite !== 0) { %>
                                         <span class="text-success pull-right">审批通过</span>
                                     <% } else if (a.status === 2) { %>
                                         <span class="pull-right">审批中</span>

+ 166 - 163
app/view/dashboard/index.ejs

@@ -1,175 +1,178 @@
 <div class="panel-content">
     <div class="panel-title fluid">
-        <div class="title-main"><h2>主页</h2></div>
+        <div class="title-main"><h2><%= ctx.session.sessionProject.name %> 待办事项</h2></div>
     </div>
     <div class="content-wrap">
-        <div class="c-header mt-3">
-            <h4>需要你处理</h4>
-        </div>
-        <div class="c-body">
-            <ul class="list-unstyled m-0">
-                <% for (const t of auditTenders) { %>
-                <% if (t.ledger_status === acLedger.status.checking) { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- t.begin_time.toLocaleString() %></span>
-                        <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- role %></small></h5>
-                        <p><a href="/tender/<%- t.id %>"><%- t.name %></a> 台帐 需要您 <a href="/tender/<%- t.id %>/ledger/audit">审批</a>。</p>
-                    </div>
-                </li>
-                <% } else { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- t.end_time.toLocaleString() %></span>
-                        <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- role %></small></h5>
-                        <p><a href="/tender/<%- t.id %>"><%- t.name %></a> 台帐 需要您 <a href="/tender/<%- t.id %>/ledger">重新上报</a>。</p>
-                    </div>
-                </li>
-                <% } %>
-                <% } %>
-                <% for (const revise of auditRevise) { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- (revise.end_time ? revise.end_time.toLocaleString() : '') %></span>
-                        <h5 class="mt-0"><%- revise.audit_name %><small class="ml-3 text-muted"><%- revise.audit_role %></small></h5>
-                        <p>
-                            <a href="/tender/<%- revise.t_id %>"><%- revise.t_name %></a>
-                            台账修订(第<%- revise.corder %>次)
-                            <% if (revise.status === acRevise.status.checkNo) { %>
-                            <span style="color: indianred">被退回</span>
+        <div class="sjs-height-0">
+            <div class="row m-4">
+                <div class="col-6">
+                    <div class="card">
+                        <div class="card-header">需要你处理</div>
+                        <div class="card-body">
+                            <% if (auditTenders.length !== 0 || auditRevise.length !== 0 || auditStages.length !== 0 || auditChanges.length !== 0) { %>
+                                <ul class="list-unstyled m-0">
+                                    <% for (const t of auditTenders) { %>
+                                        <% if (t.ledger_status === acLedger.status.checking) { %>
+                                            <li class="media">
+                                                <img class="mr-3" src="public/images/avatar.png">
+                                                <div class="media-body">
+                                                    <span class="pull-right text-muted"><%- t.begin_time.toLocaleString() %></span>
+                                                    <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- role %></small></h5>
+                                                    <p><a href="/tender/<%- t.id %>"><%- t.name %></a> 台帐 需要您 <a href="/tender/<%- t.id %>/ledger/audit" class="btn btn-sm btn-primary">审批</a>。</p>
+                                                </div>
+                                            </li>
+                                        <% } else { %>
+                                            <li class="media">
+                                                <img class="mr-3" src="public/images/avatar.png">
+                                                <div class="media-body">
+                                                    <span class="pull-right text-muted"><%- t.end_time.toLocaleString() %></span>
+                                                    <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- role %></small></h5>
+                                                    <p><a href="/tender/<%- t.id %>"><%- t.name %></a> 台帐 需要您 <a href="/tender/<%- t.id %>/ledger" class="btn btn-sm btn-primary">重新上报</a>。</p>
+                                                </div>
+                                            </li>
+                                        <% } %>
+                                    <% } %>
+                                    <% for (const revise of auditRevise) { %>
+                                        <li class="media">
+                                            <img class="mr-3" src="public/images/avatar.png">
+                                            <div class="media-body">
+                                                <span class="pull-right text-muted"><%- (revise.end_time ? revise.end_time.toLocaleString() : '') %></span>
+                                                <h5 class="mt-0"><%- revise.audit_name %><small class="ml-3 text-muted"><%- revise.audit_role %></small></h5>
+                                                <p>
+                                                    <a href="/tender/<%- revise.t_id %>"><%- revise.t_name %></a>
+                                                    台账修订(第<%- revise.corder %>次)
+                                                    <% if (revise.status === acRevise.status.checkNo) { %>
+                                                        <span style="color: indianred">被退回</span>
+                                                    <% } %>
+                                                    需要您
+                                                    <a href="/tender/<%- revise.t_id %>/revise/info" class="btn btn-sm btn-primary"><% if (revise.status === acRevise.status.checking) { %>审批<% } else if (revise.status === acRevise.status.checkNo) { %>重新上报<% } %></a>。
+                                                </p>
+                                            </div>
+                                        </li>
+                                    <% } %>
+                                    <% for (const audit of auditStages) { %>
+                                        <% if (audit.sstatus !== acStage.status.checkNo) { %>
+                                            <li class="media">
+                                                <img class="mr-3" src="public/images/avatar.png">
+                                                <div class="media-body">
+                                                    <span class="pull-right text-muted"><%- audit.begin_time.toLocaleString() %></span>
+                                                    <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- role %></small></h5>
+                                                    <p><a href="/tender/<%- audit.tid %>"><%- audit.name %></a>
+                                                        第<%- audit.sorder %>期 <% if (audit.sstatus === acStage.status.checkNoPre) { %><span style="color: indianred">被退回</span> <% } %> 需要您
+                                                        <a href="/tender/<%- audit.tid %>/measure/stage/<%- audit.sorder %>" class="btn btn-sm btn-primary"><% if (audit.sstatus === acStage.status.checkNoPre) { %>重新<% } %>审批</a>。
+                                                    </p>
+                                                </div>
+                                            </li>
+                                        <% } else { %>
+                                            <li class="media">
+                                                <img class="mr-3" src="public/images/avatar.png">
+                                                <div class="media-body">
+                                                    <span class="pull-right text-muted"><%- audit.end_time.toLocaleString() %></span>
+                                                    <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- role %></small></h5>
+                                                    <p><a href="/tender/<%- audit.tid %>"><%- audit.name %></a>
+                                                        第<%- audit.sorder %>期 <% if (audit.sstatus === acStage.status.checkNoPre) { %><span style="color: indianred">被退回</span> <% } %> 需要您
+                                                        <a href="/tender/<%- audit.tid %>/measure/stage/<%- audit.sorder %>" class="btn btn-sm btn-primary">重新上报</a>。
+                                                    </p>
+                                                </div>
+                                            </li>
+                                        <% } %>
+                                    <% } %>
+                                    <% for (const change of auditChanges) { %>
+                                        <li class="media">
+                                            <img class="mr-3" src="public/images/avatar.png">
+                                            <div class="media-body">
+                                                <span class="pull-right text-muted"><%- (change.sin_time ? change.sin_time.toLocaleString() : '') %></span>
+                                                <h5 class="mt-0"><%- change.caname %><small class="ml-3 text-muted"><%- role %></small></h5>
+                                                <p>
+                                                    <a href="/tender/<%- change.tid %>"><%- change.name %></a>
+                                                    变更令 <%- change.ccode %>
+                                                    <% if (change.cstatus === acChange.status.backnew || change.cstatus === acChange.status.back) { %>
+                                                        <span style="color: indianred">被退回</span>
+                                                    <% } %>
+                                                    需要您
+                                                    <a href="/tender/<%- change.tid %>/change/<%- change.cid %>/info" class="btn btn-sm btn-primary"><% if (change.cstatus === acChange.status.checking) { %>审批<% } else if (change.cstatus === acChange.status.backnew) { %>重新审批<% } else { %>重新上报<% } %></a>。
+                                                </p>
+                                            </div>
+                                        </li>
+                                    <% } %>
+                            </ul>
+                            <% } else { %>
+                            <!--没有处理信息-->
+                            <p class="text-center text-muted">暂时没有需要你处理的事项。</p>
                             <% } %>
-                            需要您
-                            <a href="/tender/<%- revise.t_id %>/revise/info">
-                                <% if (revise.status === acRevise.status.checking) { %>
-                                审批
-                                <% } else if (revise.status === acRevise.status.checkNo) { %>
-                                重新上报
-                                <% } %>
-                            </a>。
-                        </p>
+                        </div>
                     </div>
-                </li>
-                <% } %>
-                <% for (const audit of auditStages) { %>
-                <% if (audit.sstatus !== acStage.status.checkNo) { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- audit.begin_time.toLocaleString() %></span>
-                        <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- role %></small></h5>
-                        <p><a href="/tender/<%- audit.tid %>"><%- audit.name %></a>
-                            第<%- audit.sorder %>期 <% if (audit.sstatus === acStage.status.checkNoPre) { %><span style="color: indianred">被退回</span> <% } %> 需要您
-                            <a href="/tender/<%- audit.tid %>/measure/stage/<%- audit.sorder %>">
-                                <% if (audit.sstatus === acStage.status.checkNoPre) { %>重新<% } %>审批
-                            </a>。
-                        </p>
-                    </div>
-                </li>
-                <% } else { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- audit.end_time.toLocaleString() %></span>
-                        <h5 class="mt-0"><%- ctx.session.sessionUser.name %><small class="ml-3 text-muted"><%- role %></small></h5>
-                        <p><a href="/tender/<%- audit.tid %>"><%- audit.name %></a>
-                            第<%- audit.sorder %>期 <% if (audit.sstatus === acStage.status.checkNoPre) { %><span style="color: indianred">被退回</span> <% } %> 需要您
-                            <a href="/tender/<%- audit.tid %>/measure/stage/<%- audit.sorder %>">
-                                重新上报
-                            </a>。
-                        </p>
-                    </div>
-                </li>
-                <% } %>
-                <% } %>
-                <% for (const change of auditChanges) { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- (change.sin_time ? change.sin_time.toLocaleString() : '') %></span>
-                        <h5 class="mt-0"><%- change.caname %><small class="ml-3 text-muted"><%- role %></small></h5>
-                        <p>
-                            <a href="/tender/<%- change.tid %>"><%- change.name %></a>
-                            变更令 <%- change.ccode %>
-                            <% if (change.cstatus === acChange.status.backnew || change.cstatus === acChange.status.back) { %>
-                            <span style="color: indianred">被退回</span>
-                            <% } %>
-                            需要您
-                            <a href="/tender/<%- change.tid %>/change/<%- change.cid %>/info">
-                                <% if (change.cstatus === acChange.status.checking) { %>
-                                审批
-                                <% } else if (change.cstatus === acChange.status.backnew) { %>
-                                重新审批
+                </div>
+                <div class="col-6">
+                    <div class="card">
+                        <div class="card-header">需要你关注</div>
+                        <div class="card-body">
+                            <% if (noticeLedger.length !== 0 || noticeRevise.length !== 0 || noticeStage.length !== 0 || noticeChange.length !== 0) { %>
+                                <ul class="list-unstyled m-0">
+                                    <% for (const nl of noticeLedger) { %>
+                                        <li class="media">
+                                            <img class="mr-3" src="public/images/avatar.png">
+                                            <div class="media-body">
+                                                <span class="pull-right text-muted"><%- nl.end_time.toLocaleString() %></span>
+                                                <h5 class="mt-0"><%- nl.lu_name %><small class="ml-3 text-muted"><%- nl.lu_role %></small></h5>
+                                                <p><a href="/tender/<%- nl.id %>"><%- nl.name %></a> 台帐 <%- acLedger.statusString[nl.status]%>。</p>
+                                            </div>
+                                        </li>
+                                    <% } %>
+                                    <% for (const nr of noticeRevise) { %>
+                                        <li class="media">
+                                            <img class="mr-3" src="public/images/avatar.png">
+                                            <div class="media-body">
+                                                <span class="pull-right text-muted"><%- (nr.end_time ? nr.end_time.toLocaleString() : '') %></span>
+                                                <h5 class="mt-0"><%- nr.ru_name %><small class="ml-3 text-muted"><%- nr.ru_role %></small></h5>
+                                                <p>
+                                                    <a href="/tender/<%- nr.id %>"><%- nr.name %></a>
+                                                    <a href="/tender/<%- nr.t_id %>/revise/info">台账修订(第<%- nr.corder %>次)</a>
+                                                    <%- acRevise.statusString[nr.status]%>。
+                                                </p>
+                                            </div>
+                                        </li>
+                                    <% } %>
+                                    <% for (const ns of noticeStage) { %>
+                                        <li class="media">
+                                            <img class="mr-3" src="public/images/avatar.png">
+                                            <div class="media-body">
+                                                <span class="pull-right text-muted"><%- ns.end_time.toLocaleString() %></span>
+                                                <h5 class="mt-0"><%- ns.su_name %><small class="ml-3 text-muted"><%- ns.su_role %></small></h5>
+                                                <p>
+                                                    <a href="/tender/<%- ns.tid %>"><%- ns.name %></a>
+                                                    <a href="/tender/<%- ns.tid %>/measure/stage/<%- ns.s_order %>">第<%- ns.s_order %>期 </a>
+                                                    <%- acStage.statusString[ns.status]%>。
+                                                </p>
+                                            </div>
+                                        </li>
+                                    <% } %>
+                                    <% for (const nc of noticeChange) { %>
+                                        <li class="media">
+                                            <img class="mr-3" src="public/images/avatar.png">
+                                            <div class="media-body">
+                                                <span class="pull-right text-muted"><%- nc.cu_time.toLocaleString() %></span>
+                                                <h5 class="mt-0"><%- nc.cu_name %><small class="ml-3 text-muted"><%- nc.cu_role %></small></h5>
+                                                <p>
+                                                    <a href="/tender/<%- nc.id %>"><%- nc.name %></a>
+                                                    <a href="/tender/<%- nc.id %>/change/<%- nc.cid %>/info"><%- nc.c_code %> </a>
+                                                    <%- acChange.statusString[nc.cu_status]%>。
+                                                </p>
+                                            </div>
+                                        </li>
+                                    <% } %>
+                                </ul>
                                 <% } else { %>
-                                重新上报
+                                <!--没有关注信息-->
+                                <p class="text-center text-muted">暂时没有需要你关注的事项。</p>
                                 <% } %>
-                            </a>。
-                        </p>
-                    </div>
-                </li>
-                <% } %>
-            </ul>
-        </div>
-        <div class="c-header mt-4">
-            <h4>需要你关注</h4>
-        </div>
-        <div class="c-body">
-            <ul class="list-unstyled m-0">
-                <% for (const nl of noticeLedger) { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- nl.end_time.toLocaleString() %></span>
-                        <h5 class="mt-0"><%- nl.lu_name %><small class="ml-3 text-muted"><%- nl.lu_role %></small></h5>
-                        <p><a href="/tender/<%- nl.id %>"><%- nl.name %></a> 台帐 <%- acLedger.statusString[nl.status]%>。</p>
-                    </div>
-                </li>
-                <% } %>
-                <% for (const nr of noticeRevise) { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- (nr.end_time ? nr.end_time.toLocaleString() : '') %></span>
-                        <h5 class="mt-0"><%- nr.ru_name %><small class="ml-3 text-muted"><%- nr.ru_role %></small></h5>
-                        <p>
-                            <a href="/tender/<%- nr.id %>"><%- nr.name %></a>
-                            <a href="/tender/<%- nr.t_id %>/revise/info">台账修订(第<%- nr.corder %>次)</a>
-                            <%- acRevise.statusString[nr.status]%>。
-                        </p>
-                    </div>
-                </li>
-                <% } %>
-                <% for (const ns of noticeStage) { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- ns.end_time.toLocaleString() %></span>
-                        <h5 class="mt-0"><%- ns.su_name %><small class="ml-3 text-muted"><%- ns.su_role %></small></h5>
-                        <p>
-                            <a href="/tender/<%- ns.tid %>"><%- ns.name %></a>
-                            <a href="/tender/<%- ns.tid %>/measure/stage/<%- ns.s_order %>">第<%- ns.s_order %>期 </a>
-                            <%- acStage.statusString[ns.status]%>。
-                        </p>
-                    </div>
-                </li>
-                <% } %>
-                <% for (const nc of noticeChange) { %>
-                <li class="media">
-                    <img class="mr-3" src="public/images/avatar.png">
-                    <div class="media-body">
-                        <span class="pull-right text-muted"><%- nc.cu_time.toLocaleString() %></span>
-                        <h5 class="mt-0"><%- nc.cu_name %><small class="ml-3 text-muted"><%- nc.cu_role %></small></h5>
-                        <p>
-                            <a href="/tender/<%- nc.id %>"><%- nc.name %></a>
-                            <a href="/tender/<%- nc.id %>/change/<%- nc.cid %>/info"><%- nc.c_code %> </a>
-                            <%- acChange.statusString[nc.cu_status]%>。
-                        </p>
+                        </div>
                     </div>
-                </li>
-                <% } %>
-            </ul>
+                </div>
+            </div>
         </div>
     </div>
 </div>
+<script>
+    autoFlashHeight();
+</script>

+ 1 - 1
app/view/ledger/explode.ejs

@@ -146,7 +146,7 @@
                     <a class="nav-link" content="#std-xmj" href="javascript: void(0);">项目节</a>
                 </li>
                 <li class="nav-item">
-                    <a class="nav-link" content="#std-gcl" href="javascript: void(0);">工程量清单</a>
+                    <a class="nav-link" content="#std-gcl" href="javascript: void(0);">标准清单</a>
                 </li>
                 <li class="nav-item">
                     <a class="nav-link" content="#deal-bills" href="javascript: void(0);">签约清单</a>

+ 3 - 5
app/view/ledger/explode_modal.ejs

@@ -8,9 +8,7 @@
             <div class="modal-body">
                 <p>请上传符合格式的 <b>0号台帐</b> 格式的 .xls和.xlsx 文件,<a id="downloadLedgerTemplate" href="/tender/<%- ctx.tender.id %>/ledger/download/template">下载示例</a>。</p>
                 <div class="form-group">
-                    <div>
-                        <label for="exampleFormControlFile1">选择文件</label><i class="fa fa-spinner fa-pulse fa-lg fa-fw text-primary" id="select-excel-loading" style="display: none;"></i>
-                    </div>
+                    <label for="exampleFormControlFile1">选择文件</label><i class="fa fa-spinner fa-pulse fa-lg fa-fw text-primary" id="select-excel-loading" style="display: none;"></i>
                     <input type="file" class="form-control-file" id="upload-ledger-file" accept="*.xls">
                 </div>
                 <div id="upload-ledger-sheets" style="display: none;">
@@ -35,11 +33,11 @@
             <div class="modal-body">
                 <div class="form-group">
                     <label for="exampleFormControlFile1">Excel模板</label>
-                    <div class="form-control form-control-sm"><a id="downloadDealTemplate" href="/tender/<%- ctx.tender.id %>/deal/download/template.xls" class="btn btn-sm btn-link">下载</a></div>
+                    <div class="form-control form-control-plaintext"><a id="downloadDealTemplate" href="/tender/<%- ctx.tender.id %>/deal/download/签约清单导入格式.xls" class="btn btn-sm btn-link">下载模板</a></div>
                 </div>
                 <div class="form-group">
                     <label for="exampleFormControlFile1">上传签约清单Excel文件</label>
-                    <div class="form-control form-control-sm"><input type="file" class="form-control-file" id="deal-bills-file"></div>
+                    <input type="file" class="form-control-file" id="deal-bills-file">
                 </div>
             </div>
             <div class="modal-footer">

+ 2 - 1
app/view/login/login.ejs

@@ -13,7 +13,7 @@
 <div class="container">
     <!--演示版-->
     <form class="form-signin" method="post" action="/login">
-        <h1 class="d-flex justify-content-center mb-4">计量支付</h1>
+        <h4 class="d-flex justify-content-center mb-4">纵横云计量</h4>
         <!--<nav class="nav nav-tabs nav-justified mb-3" role="tablist" id="login-tab">-->
             <!--<a class="nav-item nav-link" data-toggle="tab" data-type="1" href="#preview" role="tab">演示版登录</a>-->
             <!--<a class="nav-item nav-link active" data-toggle="tab" data-type="2" href="#paid" role="tab">项目版登录</a>-->
@@ -55,6 +55,7 @@
         <!--</div>-->
     </form>
     <!--项目版-->
+    <div class="text-white fixed-bottom"><p class="text-center mb-1">Copyright © 2018 <a href="https://smartcost.com.cn" target="_blank" class="text-white">珠海纵横创新软件有限公司</a>.All Rights Reserved.<a class="text-white ml-2" href="http://www.miitbeian.gov.cn" target="_blank">粤ICP备14032472号</a></p></div>
 </div>
 <!-- JS. -->
 <script src="/public/js/jquery/jquery-3.2.1.min.js"></script>

+ 50 - 38
app/view/material/audit_modal.ejs

@@ -65,7 +65,7 @@
                         <div class="card mt-3">
                             <ul class="list-group list-group-flush">
                                 <li class="list-group-item">
-                                    <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %>  <small class="text-muted"><%- ctx.material.user.role %></small><div class="pull-right">原报</div>
+                                    <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %>  <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                 </li>
                                 <% for (let i = 0; i < ctx.material.auditors2.length; i++) { %>
                                 <li class="list-group-item">
@@ -84,7 +84,7 @@
                             <ul class="list-group list-group-flush">
                                 <li class="list-group-item">
                                     <h5 class="card-title">
-                                        <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small>
+                                        <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
                                     </h5>
                                     <div class="ml-3">
                                         <span class="text-success"><small><%- ctx.material.auditors[0].begin_time.toLocaleDateString() %></small> 上报</span>
@@ -171,8 +171,12 @@
                         <div class="card mt-3">
                             <ul class="list-group list-group-flush">
                                 <li class="list-group-item">
-                                    <span class="text-success pull-right"><small><%- ctx.material.auditors[0].begin_time.toLocaleDateString() %></small> 上报</span>
-                                    <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
+                                    <h5 class="card-title">
+                                        <i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span>
+                                    </h5>
+                                    <div class="ml-3">
+                                        <span class="text-success"><small><%- ctx.material.auditors[0].begin_time.toLocaleDateString() %></small> 上报</span>
+                                    </div>
                                 </li>
                                 <% for (let iA = 0; iA < ctx.material.auditors.length; iA++) { %>
                                 <% const auditors = ctx.material.auditors; %>
@@ -322,7 +326,7 @@
                                 </li>
                                 <li class="list-group-item">
                                     <h5 class="card-title">
-                                        <i class="fa <%if (iA === auditors.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><%- auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                        <i class="fa <%if (iA === auditors.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%- auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
                                     </h5>
                                     <div class="ml-3">
                                         <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
@@ -346,7 +350,7 @@
                                 <% } else { %>
                                 <li class="list-group-item">
                                     <h5 class="card-title">
-                                        <i class="fa <%if (iA === auditors.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><%- auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
+                                        <i class="fa <%if (iA === auditors.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[auditors[iA].status] %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%- auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
                                     </h5>
                                     <div class="ml-3">
                                         <% if (auditors[iA].status !== auditConst.status.uncheck) { %>
@@ -591,41 +595,45 @@
                                         <% for (let iA = 0; iA < ah.length; iA++) { %>
                                             <% if (iA === 0) { %>
                                                 <li class="list-group-item">
-                                                    <span class="text-success pull-right"><% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
-                                                    <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
-                                                    <p class="card-text"><small class="text-muted"><%- ah[iA].begin_time.toLocaleDateString() %></small></p>
+                                                    <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90 text-success"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span></h5>
+                                                    <div class="ml-3">
+                                                        <span class="text-success"><small><%- ah[iA].begin_time.toLocaleDateString() %></small> <% if (ctx.material.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
+                                                        <p class="card-text"></p>
+                                                    </div>
+
                                                 </li>
                                                 <li class="list-group-item">
-                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
-                                                    <% } %>
-                                                    <h5 class="card-title"><i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
-                                                    <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
-                                                        <p class="card-text mb-1"><%- ah[iA].opinion %></p>
-                                                        <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
-                                                    <% } %>
+                                                    <h5 class="card-title">
+                                                        <i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                    </h5>
+                                                    <div class="ml-3">
+                                                        <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                        <% } %>
+                                                        <p class="card-text"><%- ah[iA].opinion %></p>
+                                                    </div>
                                                 </li>
                                             <% } else if (iA === ah.length - 1) { %>
                                                 <li class="list-group-item">
-                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
-                                                    <% } %>
-                                                    <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
-                                                    <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
-                                                        <p class="card-text mb-1"><%- ah[iA].opinion %></p>
-                                                        <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
-                                                    <% } %>
+                                                    <h5 class="card-title"><i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right">终审</span></h5>
+                                                    <div class="ml-3">
+                                                        <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                        <% } %>
+                                                        <p class="card-text"><%- ah[iA].opinion %></p>
+                                                    </div>
                                                 </li>
                                             <% } else { %>
                                                 <li class="list-group-item">
-                                                    <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                                        <span class="<%- auditConst.statusClass[ah[iA].status] %> pull-right"><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
-                                                    <% } %>
-                                                    <h5 class="card-title"><i class="fa fa-chevron-circle-down <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small></h5>
-                                                    <% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %>
-                                                        <p class="card-text mb-1"><%- ah[iA].opinion %></p>
-                                                        <p class="card-text"><small class="text-muted"><%- ah[iA].end_time.toLocaleDateString() %></small></p>
-                                                    <% } %>
+                                                    <h5 class="card-title">
+                                                        <i class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i> <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
+                                                    </h5>
+                                                    <div class="ml-3">
+                                                        <% if (ah[iA].status !== auditConst.status.uncheck) { %>
+                                                            <span class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ah[iA].end_time.toLocaleDateString() %></small> <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %> <%- ctx.material.user.name %><% } %></span>
+                                                        <% } %>
+                                                        <p class="card-text"><%- ah[iA].opinion %></p>
+                                                    </div>
                                                 </li>
                                             <% } %>
                                         <% } %>
@@ -636,9 +644,11 @@
                                 <div class="card mt-3">
                                     <ul class="list-group list-group-flush">
                                         <li class="list-group-item">
-                                            <span class="pull-right">重新上报中</span>
-                                            <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small></h5>
-                                            <p class="card-text"><small class="text-muted"></small></p>
+                                            <h5 class="card-title"><i class="fa fa-play-circle fa-rotate-90"></i> <%- ctx.material.user.name %> <small class="text-muted"><%- ctx.material.user.role %></small><span class="pull-right">原报</span></h5>
+                                            <div class="ml-3">
+                                                <span>重新上报中</span>
+                                                <p class="card-text"><small class="text-muted"></small></p>
+                                            </div>
                                         </li>
                                     </ul>
                                     <ul class="list-group list-group-flush" id="auditors-list2">
@@ -646,11 +656,13 @@
                                         <% for (let iA = 0; iA < auditorList.length; iA++) { %>
                                             <% if (iA === auditorList.length - 1) { %>
                                                 <li class="list-group-item" data-auditid="<%- auditorList[iA].aid %>">
-                                                    <h5 class="card-title"><i class="fa fa-stop-circle"></i> <%- auditorList[iA].name %> <small class="text-muted"><%- auditorList[iA].role %></small></h5>
+                                                    <h5 class="card-title"><i class="fa fa-stop-circle"></i> <%- auditorList[iA].name %> <small class="text-muted"><%- auditorList[iA].role %></small><span class="pull-right">终审</span></h5>
                                                 </li>
                                             <% } else { %>
                                                 <li class="list-group-item" data-auditid="<%- auditorList[iA].aid %>">
-                                                    <h5 class="card-title"><i class="fa fa-chevron-circle-down"></i> <%- auditorList[iA].name %> <small class="text-muted"><%- auditorList[iA].role %></small></h5>
+                                                    <h5 class="card-title">
+                                                        <i class="fa fa-chevron-circle-down"></i> <%- auditorList[iA].name %> <small class="text-muted"><%- auditorList[iA].role %></small><span class="pull-right"><%= ctx.helper.transFormToChinese(iA+1) %>审</span>
+                                                    </h5>
                                                 </li>
                                             <% } %>
                                         <% } %>

+ 1 - 1
app/view/revise/info.ejs

@@ -174,7 +174,7 @@
                     <a class="nav-link" content="#std-xmj" href="javascript: void(0);">项目节</a>
                 </li>
                 <li class="nav-item">
-                    <a class="nav-link" content="#std-gcl" href="javascript: void(0);">工程量清单</a>
+                    <a class="nav-link" content="#std-gcl" href="javascript: void(0);">标准清单</a>
                 </li>
                 <li class="nav-item">
                     <a class="nav-link" content="#deal-bills" href="javascript: void(0);">签约清单</a>

+ 14 - 3
app/view/revise/modal.ejs

@@ -1,6 +1,6 @@
 <!--弹出新建台帐修订-->
 <div class="modal fade" id="add-bg" data-backdrop="static">
-    <form class="modal-dialog" role="document" action="<%- preUrl + '/revise/add' %>" method="post">
+    <form class="modal-dialog" role="document" action="<%- preUrl + '/revise/add' %>" method="post" onsubmit="return dbClick();">
         <div class="modal-content">
             <div class="modal-header">
                 <h5 class="modal-title">新建修订</h5>
@@ -11,7 +11,7 @@
             <div class="modal-footer">
                 <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
                 <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
-                <button type="submit" class="btn btn-primary btn-sm">确定新建</button>
+                <button id="add-ok" type="submit" class="btn btn-primary btn-sm">确定新建</button>
             </div>
         </div>
     </form>
@@ -43,4 +43,15 @@
         </div>
     </form>
 </div>
-<% } %>
+<% } %>
+
+<script>
+    let dbClickFlag = true;
+    function dbClick() {
+        if(dbClickFlag){
+            dbClickFlag = false;
+            return true;
+        }
+        return dbClickFlag;
+    }
+</script>

+ 17 - 13
app/view/setting/category.ejs

@@ -9,18 +9,21 @@
     </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 class="sjs-height-0">
+                <div class="m-3">
+                    <table class="table table-hover table-bordered table-sm">
+                        <thead>
+                        <tr>
+                            <th>名称</th>
+                            <th>值</th>
+                            <th>操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="categoryList">
+                        </tbody>
+                    </table>
+                </div>
+            </div>
         </div>
     </div>
 </div>
@@ -29,4 +32,5 @@
     const cType = JSON.parse('<%- JSON.stringify(categoryType) %>');
     let tenders = JSON.parse('<%- JSON.stringify(tenderData) %>');
 </script>
-<script src="/public/js/category.js"></script>
+<script src="/public/js/category.js"></script>
+<script>autoFlashHeight();</script>

+ 11 - 11
app/view/setting/category_modal.ejs

@@ -10,11 +10,11 @@
                     <label>类别名称</label>
                     <input class="form-control form-control-sm"  placeholder="请使用简短的名称" type="text" name="name">
                 </div>
-                <div class="form-group">
-                    <label>类型</label>
-                    <div name="type">
-                    </div>
-                </div>
+                <!--<div class="form-group">-->
+                    <!--<label>类型</label>-->
+                    <!--<div name="type">-->
+                    <!--</div>-->
+                <!--</div>-->
             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
@@ -35,11 +35,11 @@
                     <label>类别名称</label>
                     <input class="form-control form-control-sm"  placeholder="请使用简短的名称" value="年份" type="text" name="name">
                 </div>
-                <div class="form-group">
-                    <label>类型</label>
-                    <div name="type">
-                    </div>
-                </div>
+                <!--<div class="form-group">-->
+                    <!--<label>类型</label>-->
+                    <!--<div name="type">-->
+                    <!--</div>-->
+                <!--</div>-->
             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
@@ -120,4 +120,4 @@
             </div>
         </div>
     </div>
-</div>
+</div>

+ 35 - 32
app/view/setting/info.ejs

@@ -9,40 +9,42 @@
     </div>
     <div class="content-wrap">
         <div class="c-body">
-            <div class="row">
-                <div class="col-5">
-                    <% if (projectData.user_account === ctx.session.sessionUser.account) { %><form id="info-form" action="/<%= ctx.controllerName %>/updateinfo/<%= projectData.id === undefined ? 0 : projectData.id %>?_csrf=<%= ctx.csrf %>" method="post"><% } %>
-                        <div class="form-group">
-                            <label>项目编号</label>
-                            <input class="form-control form-control-sm" value="<%= projectData.code%>" type="text" readonly>
-                        </div>
-                        <div class="form-group">
-                            <label>项目名称</label>
-                            <input class="form-control form-control-sm" value="<%= projectData.name%>" type="text" <% if (projectData.user_account !== ctx.session.sessionUser.account) { %>readonly<% } else { %>name="name" id="name" placeholder="请输入项目名称"<% } %>>
-                        </div>
-                        <div class="form-group">
-                            <label>管理员</label>
-                            <input class="form-control form-control-sm" value="<%= projectData.user_account %>" type="text" readonly>
-                        </div>
-                        <div class="form-group">
-                            <label>负责人</label>
-                            <div class="card w-50">
-                                <div class="card-body">
-                                    <h4 class="card-title"><%= salesmanData.username %></h4>
-                                    <h6 class="card-subtitle mb-2 text-muted" ><%= officeName%></h6>
+            <div class="sjs-height-0">
+                <div class="row m-0 mt-3">
+                    <div class="col-5">
+                        <% if (projectData.user_account === ctx.session.sessionUser.account) { %><form id="info-form" action="/<%= ctx.controllerName %>/updateinfo/<%= projectData.id === undefined ? 0 : projectData.id %>?_csrf=<%= ctx.csrf %>" method="post"><% } %>
+                            <div class="form-group">
+                                <label>项目编号</label>
+                                <input class="form-control form-control-sm" value="<%= projectData.code%>" type="text" readonly>
+                            </div>
+                            <div class="form-group">
+                                <label>项目名称</label>
+                                <input class="form-control form-control-sm" value="<%= projectData.name%>" type="text" <% if (projectData.user_account !== ctx.session.sessionUser.account) { %>readonly<% } else { %>name="name" id="name" placeholder="请输入项目名称"<% } %>>
+                            </div>
+                            <div class="form-group">
+                                <label>管理员</label>
+                                <input class="form-control form-control-sm" value="<%= projectData.user_account %>" type="text" readonly>
+                            </div>
+                            <div class="form-group">
+                                <label>负责人</label>
+                                <div class="card w-50">
+                                    <div class="card-body">
+                                        <h4 class="card-title"><%= salesmanData.username %></h4>
+                                        <h6 class="card-subtitle mb-2 text-muted" ><%= officeName%></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> <%=salesmanData.qq%></li>
+                                        <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="手机号码"><i class="fa fa-tablet"></i> <%=salesmanData.telephone%></li>
+                                        <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="固定电话"><i class="fa fa-phone"></i> <%=salesmanData.fixedphone%></li>
+                                    </ul>
                                 </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> <%=salesmanData.qq%></li>
-                                    <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="手机号码"><i class="fa fa-tablet"></i> <%=salesmanData.telephone%></li>
-                                    <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="固定电话"><i class="fa fa-phone"></i> <%=salesmanData.fixedphone%></li>
-                                </ul>
                             </div>
-                        </div>
-                        <div class="form-group">
-                            <label>创建时间</label>
-                            <input class="form-control form-control-sm" value=<%= dateStr%> type="text" readonly>
-                        </div>
-                        <% if (projectData.user_account === ctx.session.sessionUser.account) { %></form><% } %>
+                            <div class="form-group">
+                                <label>创建时间</label>
+                                <input class="form-control form-control-sm" value=<%= dateStr%> type="text" readonly>
+                            </div>
+                            <% if (projectData.user_account === ctx.session.sessionUser.account) { %></form><% } %>
+                    </div>
                 </div>
             </div>
         </div>
@@ -50,6 +52,7 @@
 </div>
 <% if (projectData.user_account === ctx.session.sessionUser.account) { %>
 <script type="text/javascript">
+    autoFlashHeight();
     function updateinfo()
     {
         $("#info-form").submit();

+ 42 - 39
app/view/setting/user.ejs

@@ -13,48 +13,51 @@
     </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" href="/setting/user">账号列表</a>
-                <a class="nav-item nav-link" href="/setting/user/permission/set">账号权限</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>
-                        <% for (const account of accountData) { %>
-                        <tr <% if (account.enable !== 1) { %> class="table-danger"<% } %>>
-                            <td><%= account.account %><% if (account.is_admin === 1) { %> <span data-toggle="tooltip" data-placement="bottom" title="" data-original-title="管理员"><i class="fa fa-user-circle-o"></i></span><% } %></td>
-                            <td><%= account.name %></td>
-                            <td><%= account.company %></td>
-                            <td><%= account.role %></td>
-                            <td><%= account.mobile %></td>
-                            <td><%= account.telephone %></td>
-                            <td class="text-center"><a href="#edit-user" data-account="<%= JSON.stringify(account) %>" data-toggle="modal" data-target="#edit-user" class="btn btn-sm btn-outline-primary">编辑</a>
-                                <% if (account.is_admin !== 1) { %>
-                                    <% if (account.enable !== 1) { %>
-                                        <a href="" class="btn btn-sm btn-outline-success account-switch-btn" data-account="<%= account.id %>">启用</a>
-                                    <% } else { %>
-                                        <a href="" class="btn btn-sm btn-outline-danger account-switch-btn" data-account="<%= account.id %>">停用</a>
-                                    <% } %>
-                                <% } %>
-                            </td>
-                        </tr>
-                        <% } %>
-                        </tbody>
-                    </table>
+            <div class="sjs-height-0">
+                <nav class="nav nav-tabs m-3" role="tablist">
+                    <a class="nav-item nav-link active" href="/setting/user">账号列表</a>
+                    <a class="nav-item nav-link" href="/setting/user/permission/set">账号权限</a>
+                </nav>
+                <div class="tab-content m-3">
+                    <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>
+                            <% for (const account of accountData) { %>
+                                <tr <% if (account.enable !== 1) { %> class="table-danger"<% } %>>
+                                    <td><%= account.account %><% if (account.is_admin === 1) { %> <span data-toggle="tooltip" data-placement="bottom" title="" data-original-title="管理员"><i class="fa fa-user-circle-o"></i></span><% } %></td>
+                                    <td><%= account.name %></td>
+                                    <td><%= account.company %></td>
+                                    <td><%= account.role %></td>
+                                    <td><%= account.mobile %></td>
+                                    <td><%= account.telephone %></td>
+                                    <td class="text-center"><a href="#edit-user" data-account="<%= JSON.stringify(account) %>" data-toggle="modal" data-target="#edit-user" class="btn btn-sm btn-outline-primary">编辑</a>
+                                        <% if (account.is_admin !== 1) { %>
+                                            <% if (account.enable !== 1) { %>
+                                                <a href="" class="btn btn-sm btn-outline-success account-switch-btn" data-account="<%= account.id %>">启用</a>
+                                            <% } else { %>
+                                                <a href="" class="btn btn-sm btn-outline-danger account-switch-btn" data-account="<%= account.id %>">停用</a>
+                                            <% } %>
+                                        <% } %>
+                                    </td>
+                                </tr>
+                            <% } %>
+                            </tbody>
+                        </table>
+                    </div>
                 </div>
             </div>
         </div>
     </div>
 </div>
 <script src="/public/js/setting.js"></script>
+<script>autoFlashHeight();</script>

+ 39 - 36
app/view/setting/user_permission.ejs

@@ -13,46 +13,49 @@
     </div>
     <div class="content-wrap">
         <div class="c-body">
-            <nav class="nav nav-tabs mb-3" role="tablist">
-                <a class="nav-item nav-link" href="/setting/user">账号列表</a>
-                <a class="nav-item nav-link active" href="/setting/user/permission/set">账号权限</a>
-            </nav>
-            <div class="tab-content">
-                <div id="user-purview" 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>
-                        </thead>
-                        <tbody>
-                        <% for (const account of accountData) { %>
-                        <tr>
-                            <td><%= account.account %><% if (account.is_admin === 1) { %> <span data-toggle="tooltip" data-placement="bottom" title="" data-original-title="管理员"><i class="fa fa-user-circle-o"></i></span><% } %></td>
-                            <td><%= account.name %></td>
-                            <td><%= account.company %></td>
-                            <td><%= account.role %></td>
-                            <td><% if (account.cooperation === 1) { %>启用<% } %></td>
-                            <td><% if (account.permission !== '' && account.permission !== null && JSON.parse(account.permission).tender !== undefined) { %>
-                                <% const tenderPermission = JSON.parse(account.permission).tender; %>
-                                    <% for (const tc in permission.tender.children) { %>
-                                        <% if (tenderPermission.indexOf(permission.tender.children[tc].value.toString()) !== -1) { %>
-                                            <%= permission.tender.children[tc].title %>
+            <div class="sjs-height-0">
+                <nav class="nav nav-tabs m-3" role="tablist">
+                    <a class="nav-item nav-link" href="/setting/user">账号列表</a>
+                    <a class="nav-item nav-link active" href="/setting/user/permission/set">账号权限</a>
+                </nav>
+                <div class="tab-content m-3">
+                    <div id="user-purview" 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>
+                            </thead>
+                            <tbody>
+                            <% for (const account of accountData) { %>
+                                <tr>
+                                    <td><%= account.account %><% if (account.is_admin === 1) { %> <span data-toggle="tooltip" data-placement="bottom" title="" data-original-title="管理员"><i class="fa fa-user-circle-o"></i></span><% } %></td>
+                                    <td><%= account.name %></td>
+                                    <td><%= account.company %></td>
+                                    <td><%= account.role %></td>
+                                    <td><% if (account.cooperation === 1) { %>启用<% } %></td>
+                                    <td><% if (account.permission !== '' && account.permission !== null && JSON.parse(account.permission).tender !== undefined) { %>
+                                            <% const tenderPermission = JSON.parse(account.permission).tender; %>
+                                            <% for (const tc in permission.tender.children) { %>
+                                                <% if (tenderPermission.indexOf(permission.tender.children[tc].value.toString()) !== -1) { %>
+                                                    <%= permission.tender.children[tc].title %>
+                                                <% } %>
+                                            <% } %>
                                         <% } %>
-                                    <% } %>
-                                <% } %>
-                                    <a href="#edit-user2" data-account="<%= JSON.stringify(account) %>" data-toggle="modal" data-target="#edit-user2" class="btn btn-sm btn-outline-primary pull-right">编辑</a></td>
-                        </tr>
-                        <% } %>
-                        </tbody>
-                    </table>
+                                        <a href="#edit-user2" data-account="<%= JSON.stringify(account) %>" data-toggle="modal" data-target="#edit-user2" class="btn btn-sm btn-outline-primary pull-right">编辑</a></td>
+                                </tr>
+                            <% } %>
+                            </tbody>
+                        </table>
+                    </div>
                 </div>
             </div>
         </div>
     </div>
 </div>
 <script src="/public/js/setting.js"></script>
+<script>autoFlashHeight();</script>

+ 0 - 1
app/view/stage/audit_modal.ejs

@@ -789,7 +789,6 @@
                                     <div class="card mt-3">
                                         <ul class="list-group list-group-flush">
                                             <li class="list-group-item">
-                                                <span class="pull-right">重新上报中</span>
                                                 <h5 class="card-title">
                                                     <i class="fa fa-play-circle fa-rotate-90"></i> <%- ctx.stage.user.name %> <small class="text-muted"><%- ctx.stage.user.role %></small><span class="pull-right">原报</span>
                                                 </h5>

+ 1 - 1
app/view/stage/index.ejs

@@ -57,7 +57,7 @@
                             <li class="nav-item">
                                 <div class="ml-2">
                                     <div class="input-group input-group-sm">
-                                        <div class="input-group-prepend">
+                                        <div class="input-group-prepend" style="display: none;">
                                             <div class="input-group-text">
                                                 <div class="form-group form-check mb-0">
                                                     <input type="checkbox" class="form-check-input group-checkbox" id="pos-over-search">

+ 2 - 2
app/view/tender/detail.ejs

@@ -112,7 +112,7 @@
                                 <div class="nav flex-column nav-pills" >
                                     <a class="nav-link active" data-toggle="pill" href="#v-pills-1" role="tab">标段属性</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-2" role="tab">小数位数</a>
-                                    <a class="nav-link"  data-toggle="pill" href="#v-pills-3" role="tab">清单精度</a>
+                                    <a class="nav-link"  data-toggle="pill" href="#v-pills-3" role="tab">数量精度</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-4" role="tab">合同参数</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-5" role="tab">显示设置</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-6" role="tab">章节设置</a>
@@ -465,7 +465,7 @@
                                             </div>
                                         </div>
                                         <% } %>
-                                        <legend class="mt-3">清单精度</legend>
+                                        <legend class="mt-3">数量精度</legend>
                                         <!--默认显示-->
                                         <div class="form-group" id="precision-spread" style="height: 365px; width: 600px;">
                                         </div>

+ 3 - 1
app/view/tender/index.ejs

@@ -1,7 +1,9 @@
 <div class="panel-content">
     <% include ./sub_menu.ejs %>
     <div class="content-wrap">
-        <div class="c-body">
+        <div class="sjs-height-0">
+            <div class="c-body">
+            </div>
         </div>
     </div>
 </div>

+ 3 - 1
app/view/tender/info.ejs

@@ -1,7 +1,9 @@
 <div class="panel-content">
     <% include ./sub_menu.ejs %>
     <div class="content-wrap">
-        <div class="c-body">
+        <div class="sjs-height-0">
+            <div class="c-body">
+            </div>
         </div>
     </div>
 </div>

+ 3 - 1
app/view/tender/manage.ejs

@@ -1,7 +1,9 @@
 <div class="panel-content">
     <% include ./sub_menu.ejs %>
     <div class="content-wrap">
-        <div class="c-body">
+        <div class="sjs-height-0">
+            <div class="c-body">
+            </div>
         </div>
     </div>
 </div>

+ 3 - 1
app/view/tender/progress.ejs

@@ -1,7 +1,9 @@
 <div class="panel-content">
     <% include ./sub_menu.ejs %>
     <div class="content-wrap">
-        <div class="c-body">
+        <div class="sjs-height-0">
+            <div class="c-body">
+            </div>
         </div>
     </div>
 </div>