Prechádzať zdrojové kódy

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang 3 rokov pred
rodič
commit
9ba1b7999e

+ 2 - 2
app/controller/change_controller.js

@@ -825,9 +825,9 @@ module.exports = app => {
                         break;
                     case 'paste_amount_rows':
                         await ctx.service.changeAuditList.saveDatas(data.updateData);
-                        let changeList = await ctx.service.changeAuditList.getList(ctx.change.cid);
+                        const changeList = await ctx.service.changeAuditList.getList(ctx.change.cid);
                         const auditList2 = await ctx.service.changeAudit.getListGroupByTimes(ctx.change.cid, ctx.change.times);
-                        changeList = JSON.parse(JSON.stringify(changeList.sort())).sort().sort();
+                        // changeList = JSON.parse(JSON.stringify(changeList.sort())).sort().sort();
                         for (const cl of changeList) {
                             const audit_amount = cl.audit_amount !== null && cl.audit_amount !== '' ? cl.audit_amount.split(',') : '';
                             // 清单表页赋值

+ 1 - 1
app/controller/dashboard_controller.js

@@ -75,7 +75,7 @@ module.exports = app => {
                 await ctx.service.materialAudit.getLastEndTimeByChecked(ctx.session.sessionUser.accountId),
             ];
             const last_time = ctx.app._.max(shenpi_lastime);
-            console.log(ctx.app._.max(shenpi_lastime), ctx.helper.calcDayNum(last_time));
+            // console.log(ctx.app._.max(shenpi_lastime), ctx.helper.calcDayNum(last_time));
             const renderData = {
                 auditTenders,
                 auditStages,

+ 2 - 1
app/controller/material_controller.js

@@ -732,7 +732,8 @@ module.exports = app => {
                     msg: '',
                     data: {},
                 };
-                if (ctx.session.sessionProject.page_show.openMaterialChecklist && ctx.app._.indexOf(['join', 'notjoin', 'self', 'noself', 'useOther'], data.type) === -1) {
+                const notControlList = ['join', 'notjoin', 'self', 'noself', 'useOther', 'add', 'del', 'update', 'paste'];
+                if (ctx.session.sessionProject.page_show.openMaterialChecklist && ctx.app._.indexOf(notControlList, data.type) === -1) {
                     throw '清单设置功能已启动,请前往清单设置页操作清单内容';
                 }
                 switch (data.type) {

+ 1 - 1
app/controller/stage_controller.js

@@ -504,7 +504,7 @@ module.exports = app => {
                 }
                 const bills = data.bills ? data.bills : await ctx.service.ledger.getDataById(data.pos.lid);
                 const pos = data.pos;
-                const changes = await ctx.service.change.getValidChanges(ctx.tender.id, ctx.stage.order, bills);
+                const changes = await ctx.service.change.getValidChanges(ctx.tender, ctx.stage, bills);
                 const useChanges = ctx.stage.readOnly
                     ? await ctx.service.stageChange.getAuditorStageData(ctx.tender.id, ctx.stage.id, ctx.stage.curTimes, ctx.stage.curOrder, bills.id, pos ? pos.id : -1)
                     : await ctx.service.stageChange.getLastestStageData(ctx.tender.id, ctx.stage.id, bills.id, pos ? pos.id : -1);

+ 4 - 2
app/controller/tender_controller.js

@@ -24,6 +24,7 @@ const scheduleConst = require('../const/schedule');
 const changeConst = require('../const/change');
 const tenderInfoModel = require('../lib/tender_info');
 const mapConst = require('../const/map');
+const advanceConst = require('../const/advance');
 
 module.exports = app => {
 
@@ -1409,12 +1410,13 @@ module.exports = app => {
                             break;
                         case 'advance':
                             const advance = await ctx.service.advance.getAllDataByCondition({
-                                columns: [ 'id', 'order', 'status', 'selected' ],
+                                columns: [ 'id', 'order', 'status', 'selected', 'type' ],
                                 where,
-                                orders: [['create_time', 'desc']],
+                                orders: [['type', 'asc'], ['create_time', 'desc']],
                             });
                             advance.forEach(x => {
                                 x.statusStr = auditConst.advance.statusString[x.status];
+                                x.typeStr = advanceConst.typeColMap[x.type].text;
                             });
                             responseData.data[f] = advance;
                             break;

+ 7 - 23
app/lib/stage_im.js

@@ -488,9 +488,6 @@ class StageIm {
             if (p.children && p.children.length > 0) {
                 continue;
             }
-            if ((!p.qc_tp || p.qc_tp === 0)) {
-                continue;
-            }
             const posRange = this.pos.getLedgerPos(p.id);
             if (!posRange) {
                 for (const c of this.changes) {
@@ -501,9 +498,6 @@ class StageIm {
                 this.import_changes.forEach(x => { if (x.lid === p.id) im.changes.push(x) });
             } else {
                 for (const pp of posRange) {
-                    if ((!pp.qc_qty || pp.qc_qty === 0)) {
-                        continue;
-                    }
                     for (const c of this.changes) {
                         if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
                             im.changes.push(c);
@@ -803,9 +797,6 @@ class StageIm {
         if (!im.changes) {
             im.changes = [];
         }
-        if ((!node.qc_qty || node.qc_qty === 0)) {
-            return;
-        }
         const posRange = this.pos.getLedgerPos(node.id);
         if (!posRange) {
             for (const c of this.changes) {
@@ -816,9 +807,6 @@ class StageIm {
             this.import_changes.forEach(x => { if (x.lid === node.id) im.changes.push(x) });
         } else {
             for (const p of posRange) {
-                if ((!p.qc_qty || p.qc_qty === 0)) {
-                    continue;
-                }
                 for (const c of this.changes) {
                     if (c.lid === node.id && c.pid === p.id && c.qty && c.qty !== 0) {
                         im.changes.push(c);
@@ -950,11 +938,9 @@ class StageIm {
                     im.end_qc_tp = this.ctx.helper.mul(im.end_qc_jl, im.unit_price, tp_decimal);
                     im.calc_memo = '本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                     this.ImData.push(im);
-                    if (pp.qc_qty && pp.qc_qty !== 0) {
-                        for (const c of this.changes) {
-                            if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
-                                im.changes.push(c);
-                            }
+                    for (const c of this.changes) {
+                        if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
+                            im.changes.push(c);
                         }
                     }
                 }
@@ -982,14 +968,12 @@ class StageIm {
                 };
                 im.calc_memo = '本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                 this.ImData.push(im);
-                if (p.qc_qty && p.qc_qty !== 0) {
-                    for (const c of this.changes) {
-                        if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {
-                            im.changes.push(c);
-                        }
+                for (const c of this.changes) {
+                    if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {
+                        im.changes.push(c);
                     }
-                    this.import_changes.forEach(x => { if (x.lid === p.id) im.changes.push(x) });
                 }
+                this.import_changes.forEach(x => { if (x.lid === p.id) im.changes.push(x) });
             }
         }
     }

BIN
app/public/images/erweima.jpg


+ 58 - 9
app/public/js/change_information_set.js

@@ -1136,7 +1136,7 @@ $(document).ready(() => {
     $('#list-input').on('blur', function () {
         const select = parseInt($('#select-list').val());
         const value = _.trim($(this).val());
-        const valueList = _.slice(_.without(_.uniq(value.split(' ')), ''), 0, 10);
+        const valueList = _.slice(_.without(_.uniq(_.replace(value, /\t/g, ' ').split(' ')), ''), 0, 10);
         console.log(valueList);
         // 判断是否存在多个分词,以换行或空格分隔,多个则显示左侧菜单
         if (value !== '' && valueList.length > 1) {
@@ -1145,14 +1145,15 @@ $(document).ready(() => {
             }
             $('#table-list').addClass('col-9').removeClass('col-12');
             $('#table-list').siblings('.col-3').show();
-            $('#list-search-keyword').html('<a href="javascript:void(0);" data-keyword="" class="list-group-item list-group-item-action active">全部</a>');
+            $('#list-search-keyword').html('<tr data-keyword="" class="text-white bg-primary"><td class="border-primary">全部</td></tr>');
             for (const v of valueList) {
-                $('#list-search-keyword').append(`<a href="javascript:void(0);" data-keyword="${v}" class="list-group-item list-group-item-action">${v}</a>`);
+                $('#list-search-keyword').append(`<tr data-keyword="${v}" class=""><td>${v}</td></tr>`);
             }
+            $('#list-input').val(valueList.join(' '));
         } else {
             $('#table-list').addClass('col-12').removeClass('col-9');
             $('#table-list').siblings('.col-3').hide();
-            $('#list-search-keyword').html('<a href="javascript:void(0);" data-keyword="" class="list-group-item list-group-item-action active">全部</a>');
+            $('#list-search-keyword').html('<tr data-keyword="" class="text-white bg-primary border-primary"><td class="border-primary">全部</td></tr>');
         }
         let showListData = changeListData;
         if (select === 1 && value !== '') {
@@ -1198,13 +1199,61 @@ $(document).ready(() => {
         $('#code-list').html('');
         $('#code-select-all').prop('checked', false);
     });
+    // 双击编辑搜索值
+    $('body').on('dblclick', '#list-search-keyword tr', function () {
+        if ($(this).attr('data-keyword') !== '') {
+            $(this).children('td').html(`<input class="form-control form-control-sm" value="">`);
+            $(this).find('input').focus();
+            $(this).find('input').val($(this).attr('data-keyword'));
+        }
+    });
+    // 光标离开
+    $('body').on('blur', '#list-search-keyword tr td input', function () {
+        let val = $(this).val();
+        const oldVal = $(this).parents('tr').attr('data-keyword');
+        if (_.trim(val) === '') {
+            toastr.warning('不能为空');
+            val = oldVal;
+        } else if (_.trim(val) === oldVal) {
+            val = oldVal;
+        } else {
+            const value = _.trim($('#list-input').val());
+            const valueList = _.slice(_.without(_.uniq(_.replace(value, /\t/g, ' ').split(' ')), ''), 0, 10);
+            console.log(_.indexOf(valueList, oldVal), valueList, val, oldVal);
+            if (_.indexOf(valueList, val) !== -1) {
+                toastr.warning('已存在相同的检索词');
+                val = oldVal;
+            }
+            valueList.splice(_.indexOf(valueList, oldVal), 1, val);
+            $('#list-input').val(valueList.join(' '));
+            const select = parseInt($('#select-list').val());
+            const showListData = _.filter(changeListData, function (c) {
+                return ((c.code && c.code.indexOf(val) !== -1) || (c.name && c.name.indexOf(val) !== -1)) && (select === 1 ? c.cid : 1);
+            });
+            makeListTable(changeListData, showListData);
+            $('#table-list-select tr').removeClass('table-warning');
+            $('#code-input').val('');
+            $('#code-input').siblings('a').hide();
+            $('#code-list').html('');
+            $('#code-select-all').prop('checked', false);
+        }
+        $(this).parents('tr').attr('data-keyword', val);
+        $(this).parents('td').html(`${val}`);
+    });
+    $('body').on('keypress', '#list-search-keyword tr td input', function () {
+        if(window.event.keyCode === 13) {
+            $(this).blur();
+        }
+    });
+    $("#addlist").draggable({ handle: '.modal-header, .modal-footer'});
     // 检索关键字切换
-    $('body').on('click', '#list-search-keyword a', function () {
-        if (!$(this).hasClass('active')) {
+    $('body').on('click', '#list-search-keyword tr', function () {
+        if (!$(this).hasClass('bg-primary')) {
             const keyword = $(this).attr('data-keyword');
-            console.log(keyword);
-            $(this).siblings().removeClass('active');
-            $(this).addClass('active');
+            $(this).siblings().removeClass('text-white bg-primary');
+            $(this).siblings().children('td').removeClass('border-primary');
+            $(this).addClass('text-white bg-primary');
+            $(this).children('td').addClass('border-primary');
             if (keyword === '') {
                 $('#list-input').blur();
             } else {

+ 4 - 8
app/public/js/material_list.js

@@ -457,7 +457,7 @@ $(document).ready(() => {
             if (type === 'del') {
                 flag = data.order === stage_order;
             }
-            return flag && !openMaterialChecklist;
+            return flag;
         }
     };
 
@@ -654,8 +654,6 @@ $(document).ready(() => {
                     type: type,
                     select: type === 'join' ? findNotJoinLeafXmj(select) : select,
                 };
-                console.log(iGclRow, iRow, nRow, select);
-                console.log(materialList);
                 // 添加到
                 postData(window.location.pathname + '/save', data, function (result) {
                     if (type === 'join') {
@@ -668,7 +666,7 @@ $(document).ready(() => {
                     calculateJiaCha(gclGatherData, iGclRow);
                     SpreadJsObj.reLoadRowData(sheet, nRow);
                     sheet.getRange(nRow, -1, 1, -1).backColor(color);
-                    loadMaterialData(iGclRow, 0);
+                    loadMaterialData(iGclRow);
                     SpreadJsObj.reLoadRowData(ledgerSpread.getActiveSheet(), iGclRow);
                 });
             },
@@ -679,8 +677,6 @@ $(document).ready(() => {
                     type: type,
                     select: type === 'noself' ? findSelfLeafXmj(select) : select,
                 };
-                console.log(iGclRow, iRow, nRow, select);
-                console.log(materialList);
                 // 添加到
                 postData(window.location.pathname + '/save', data, function (result) {
                     if (type === 'noself') {
@@ -716,10 +712,10 @@ $(document).ready(() => {
                         const sheet = leafXmjSpread.getActiveSheet();
                         const select = SpreadJsObj.getSelectObject(sheet);
                         const sel = sheet.getSelections()[0];
-                        const notx = findNotJoinLeafXmj(select);
                         if (!select || sel.rowCount !== 1) {
                             return false;
                         }
+                        const notx = findNotJoinLeafXmj(select);
                         if (!readOnly && select && notx === undefined) {
                             return true;
                         } else {
@@ -737,10 +733,10 @@ $(document).ready(() => {
                         const sheet = leafXmjSpread.getActiveSheet();
                         const select = SpreadJsObj.getSelectObject(sheet);
                         const sel = sheet.getSelections()[0];
-                        const notx = findNotJoinLeafXmj(select);
                         if (!select || sel.rowCount !== 1) {
                             return false;
                         }
+                        const notx = findNotJoinLeafXmj(select);
                         if (!readOnly && select && notx === undefined) {
                             return false;
                         } else {

+ 2 - 1
app/public/js/stage.js

@@ -531,11 +531,12 @@ $(document).ready(() => {
         _calculateAmount() {
             for (const c of this.changes) {
                 c.bamount = _.toNumber(c.b_amount);
-                c.vamount = ZhCalc.sub(c.bamount, c.used_amount);
+                c.vamount = ZhCalc.sub(ZhCalc.sub(c.bamount, c.used_amount), c.stage_used_amount);
                 const uc = _.find(this.useChanges, {cid: c.cid, cbid: c.cbid});
                 if (uc) {
                     c.org_uamount = uc.qty;
                     c.uamount = uc.qty;
+                    c.vamount = ZhCalc.add(c.vamount, uc.qty);
                 }
                 c.pre_amount = ZhCalc.sub(c.used_amount, c.uamount);
             }

+ 7 - 21
app/public/js/stage_im.js

@@ -507,9 +507,6 @@ const stageIm = (function () {
             if (p.children && p.children.length > 0) {
                 continue;
             }
-            if ((!p.qc_tp || p.qc_tp === 0)) {
-                continue;
-            }
             const posRange = gsPos.getLedgerPos(p.id);
             if (!posRange) {
                 for (const c of changes) {
@@ -520,9 +517,6 @@ const stageIm = (function () {
                 importChanges.forEach(x => { if (x.lid === p.id) im.changes.push(x); });
             } else {
                 for (const pp of posRange) {
-                    if ((!pp.qc_qty || pp.qc_qty === 0)) {
-                        continue;
-                    }
                     for (const c of changes) {
                         if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
                             im.changes.push(c);
@@ -778,9 +772,6 @@ const stageIm = (function () {
         if (!im.changes) {
             im.changes = [];
         }
-        if ((!node.qc_qty || node.qc_qty === 0)) {
-            return;
-        }
         const posRange = gsPos.getLedgerPos(node.id);
         if (!posRange) {
             for (const c of changes) {
@@ -791,7 +782,6 @@ const stageIm = (function () {
             importChanges.forEach(x => { if (x.lid === node.id) im.changes.push(x); });
         } else {
             for (const p of posRange) {
-                if ((!p.qc_qty || p.qc_qty === 0)) continue;
                 for (const c of changes) {
                     if (c.lid === node.id && c.pid === p.id && c.qty && c.qty !== 0) {
                         im.changes.push(c);
@@ -879,11 +869,9 @@ const stageIm = (function () {
                     };
                     im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                     ImData.push(im);
-                    if (pp.qc_qty && pp.qc_qty !== 0) {
-                        for (const c of changes) {
-                            if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
-                                im.changes.push(c);
-                            }
+                    for (const c of changes) {
+                        if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
+                            im.changes.push(c);
                         }
                     }
                 }
@@ -907,14 +895,12 @@ const stageIm = (function () {
                 };
                 im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                 ImData.push(im);
-                if (p.qc_qty && p.qc_qty !== 0) {
-                    for (const c of changes) {
-                        if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {
-                            im.changes.push(c);
-                        }
+                for (const c of changes) {
+                    if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {
+                        im.changes.push(c);
                     }
-                    importChanges.forEach(x => { if (x.lid === p.id) im.changes.push(x); });
                 }
+                importChanges.forEach(x => { if (x.lid === p.id) im.changes.push(x); });
             }
         }
     }

+ 4 - 3
app/public/report/js/rpt_other_stage.js

@@ -1,16 +1,17 @@
 const rptOtherStage = (function (){
     const info = {
-        advance: { title: '请选择预付款', colHeader: ['选择', '期', '审批状态'] },
+        advance: { title: '请选择预付款', colHeader: ['选择', '类型', '期', '审批状态'] },
     };
     const data = {};
     let curType = '';
     const initList = function () {
         const header = info[curType].colHeader;
-        $('#sos-header').html(`<tr class="text-center"><th>${header[0]}</th><th>${header[1]}</th><th>${header[2]}</th></tr>`);
+        const type = info[curType].type;
+        $('#sos-header').html(`<tr class="text-center"><th>${header[0]}</th><th>${header[1]}</th><th>${header[2]}</th><th>${header[3]}</th></tr>`);
         const html = [], arr = data[curType];
         for (const a of arr) {
             const checked = a.selected ? 'checked' : '';
-            html.push('<tr class="text-center">', `<td><input type="checkbox" name="sos-check" ${checked} value="${a.id}"></td>`, `<td>第${a.order}期</td>`, `<td>${a.statusStr}</td>`, '</tr>');
+            html.push('<tr class="text-center">', `<td><input type="checkbox" name="sos-check" ${checked} value="${a.id}"></td>`, `<td>${a.typeStr}</td>`, `<td>第${a.order}期</td>`, `<td>${a.statusStr}</td>`,  '</tr>');
         }
         $('#sos-list').html(html.join(''));
     };

+ 5 - 2
app/service/change.js

@@ -1190,7 +1190,7 @@ module.exports = app => {
          * @param pos - 查询的部位
          * @return {Promise<*>} - 可用的变更令列表
          */
-        async getValidChanges(tid, sorder, bills, pos) {
+        async getValidChanges(tender, stage, bills, pos) {
             const self = this;
             const getFilterPart = function(field, value) {
                 return value
@@ -1217,9 +1217,12 @@ module.exports = app => {
                 '  ) As scb ON cb.id = scb.cbid' +
                 '  WHERE c.tid = ? And c.status = ? And c.valid And ' + filter +
                 '  ORDER BY c.in_time';
-            const sqlParam = [tid, sorder, tid, audit.flow.status.checked];
+            const sqlParam = [tender.id, stage.order, tender.id, audit.flow.status.checked];
             const changes = await this.db.query(sql, sqlParam);
             for (const c of changes) {
+                const stageUsedData = await this.ctx.service.stageChange.getAllDataByCondition({ where: { sid: stage.id, cbid: c.cbid } });
+                const filter = this.ctx.helper.filterLastestData(stageUsedData, ['pid', 'lid'], 'stimes', 'sorder');
+                c.stage_used_amount = this.ctx.helper.sum(filter.map(x => { return x.qty }));
                 const aSql = 'SELECT ca.*, pa.name As u_name, pa.role As u_role ' +
                     '  FROM ?? As ca ' +
                     '  Left Join ?? As pa ' +

+ 4 - 3
app/service/change_audit_list.js

@@ -283,6 +283,7 @@ module.exports = app => {
             // 判断t_type是否为费用
             const transaction = await this.db.beginTransaction();
             try {
+                let usedList = [];
                 let order = null;
                 if (order_by) {
                     if (data) {
@@ -294,6 +295,9 @@ module.exports = app => {
                         order = order ? order + 1 : 1;
                     }
                 } else {
+                    const sql1 = 'SELECT a.* FROM ?? as b LEFT JOIN ?? as a ON b.cbid = a.id WHERE b.cid = ? GROUP BY b.cbid';
+                    const sqlParam1 = [this.ctx.service.stageChange.tableName, this.tableName, this.ctx.change.cid];
+                    usedList = await transaction.query(sql1, sqlParam1);
                     // 先删除原本的台账清单数据
                     const sql = 'DELETE FROM ?? WHERE cid = ? and lid != "0"';
                     const sqlParam = [this.tableName, this.ctx.change.cid];
@@ -312,9 +316,6 @@ module.exports = app => {
                 if (insertDatas.length > 0) await transaction.insert(this.tableName, insertDatas);
                 await this.calcCamountSum(transaction);
                 if (!order_by) {
-                    const sql1 = 'SELECT a.* FROM ?? as b LEFT JOIN ?? as a ON b.cbid = a.id WHERE b.cid = ? GROUP BY b.cbid';
-                    const sqlParam1 = [this.ctx.service.stageChange.tableName, this.tableName, this.ctx.change.cid];
-                    const usedList = await transaction.query(sql1, sqlParam1);
                     // 更新stage_change和stage_change_final的cbid
                     if (usedList.length > 0) {
                         const updateList = [];

+ 30 - 10
app/service/notice_push.js

@@ -7,7 +7,7 @@
  * @date 2017/11/16
  * @version
  */
-
+const auditConst = require('../const/audit');
 module.exports = app => {
     class NoticePush extends app.BaseService {
         /**
@@ -30,11 +30,31 @@ module.exports = app => {
         }
 
         /**
-         * 查询所有推送记录
+         * 查询所有推送记录(取每个审批类型的前20条再拼接)
          * @param {Integer} pid - 项目id
          * @param {Integer} uid - 查询人id
          */
         async getNotice(pid, uid = 0) {
+            // const noticeList = [];
+            // for (const type in auditConst.pushType) {
+            //     const wheres = { pid, type: auditConst.pushType[type] };
+            //     if (uid !== 0) {
+            //         wheres.uid = uid;
+            //     }
+            //     let notice = await this.db.select(this.tableName, {
+            //         where: wheres,
+            //         orders: [['create_time', 'desc']],
+            //         limit: 20,
+            //         offset: 0
+            //     });
+            //     notice = notice.map(v => {
+            //         const extra = JSON.parse(v.content);
+            //         delete v.content;
+            //         return { ...v, ...extra };
+            //     });
+            //     noticeList.push(...notice);
+            // }
+            // return this._.orderBy(noticeList, ['create_time'], ['desc']);
             const wheres = { pid };
             if (uid !== 0) {
                 wheres.uid = uid;
@@ -42,15 +62,15 @@ module.exports = app => {
             let notice = await this.db.select(this.tableName, {
                 where: wheres,
                 orders: [['create_time', 'desc']],
-                // limit: 10,
-                // offset: 0
-            })
+                limit: 30,
+                offset: 0
+            });
             notice = notice.map(v => {
-                const extra = JSON.parse(v.content)
-                delete v.content
-                return { ...v, ...extra }
-            })
-            return notice
+                const extra = JSON.parse(v.content);
+                delete v.content;
+                return { ...v, ...extra };
+            });
+            return notice;
         }
 
         /**

+ 2 - 1
app/service/stage_change.js

@@ -444,7 +444,8 @@ module.exports = app => {
 
         async getChangeWithUsedInfo(stage) {
             const change = await this.ctx.service.change.getAllDataByCondition({
-                where: { tid: stage.tid, status: audit.flow.status.checked }
+                where: { tid: stage.tid, status: audit.flow.status.checked },
+                orders: [['code', 'asc']],
             });
             if (change.length === 0) return [];
 

+ 12 - 7
app/view/change/information_modal.ejs

@@ -135,24 +135,29 @@
                         </div>
                         <div class="card-body">
                             <div class="row">
-                                <div class="col-3" style="display:none;">
+                                <div class="col-3" style="padding-right:0!important;display:none;">
                                     <div style="overflow-y:auto" class="sjs-biangeng-height">
-                                        <div class="card">
-                                            <div class="card-header">检索内容</div>
-                                            <ul class="list-group list-group-flush" id="list-search-keyword">
+                                        <!--<div class="card">-->
+                                            <table class="table table-bordered table-sm fixed_headers">
+                                                <thead><tr><th class="text-center">检索内容</th></tr></thead>
+                                                <tbody id="list-search-keyword" style="cursor: pointer">
+                                                </tbody>
+                                            </table>
+                                            <!--<div class="card-header" style="height: 28px;line-height: 5px">检索内容</div>-->
+                                            <!--<ul class="list-group list-group-flush" id="list-search-keyword">-->
                                                 <!--<a href="javascript:void(0);" data-keyword="" class="list-group-item list-group-item-action active">全部</a>-->
                                                 <!--<a href="javascript:void(0);" class="list-group-item list-group-item-action">203-1-a</a>-->
                                                 <!--<a href="javascript:void(0);" class="list-group-item list-group-item-action">钢筋</a>-->
                                                 <!--<a href="javascript:void(0);" class="list-group-item list-group-item-action">403-1-b</a>-->
                                                 <!--<a href="javascript:void(0);" class="list-group-item list-group-item-action">403-3-b</a>-->
-                                            </ul>
-                                        </div>
+                                            <!--</ul>-->
+                                        <!--</div>-->
                                     </div>
                                 </div>
                                 <div class="col-12" id="table-list">
                                     <div style="overflow-y:auto" class="sjs-biangeng-height">
                                         <table class="table table-striped table-bordered table-hover table-sm fixed_headers">
-                                            <thead><tr class="text-center"><th width="40">序号</th><th>清单编号</th><th>名称</th><th width="50">单位</th><th width="100">单价</th><th width="100">数量</th></tr></thead>
+                                            <thead><tr class="text-center"><th width="40">序号</th><th>清单编号</th><th>名称</th><th width="60">单位</th><th width="100">单价</th><th width="100">数量</th></tr></thead>
                                             <tbody id="table-list-select">
                                             </tbody>
                                         </table>

+ 2 - 2
app/view/dashboard/index.ejs

@@ -63,7 +63,7 @@
                                     <tr>
                                         <th class="pl-3">类型</th>
                                         <th>名称</th>
-                                        <th width="50">状态</th>
+                                        <th width="60">状态</th>
                                         <th width="120">创建时间</th>
                                         <th width="80">操作</th>
                                     </tr>
@@ -302,7 +302,7 @@
                                 <table class="table table-middle">
                                     <thead class="thead-light">
                                     <tr>
-                                        <th class="pl-3">类型</th>
+                                        <th width="110" class="pl-3">类型</th>
                                         <th>名称</th>
                                         <th width="150">审批人-职位</th>
                                         <th width="120">审批时间</th>

+ 1 - 1
app/view/material/checklist_modal.ejs

@@ -64,7 +64,7 @@
                 <div class="row">
                     <div class="col-12">
                         <div class="mb-2 col-6 p-0 search-group"><input id="tclist_search" class="form-control form-control-sm" placeholder="输入 清单编号、名称 检索" value=""><a href="javascript:void(0);" style="display: none" class="text-danger remove-btn" title="移除关键词"><i class="fa fa-times-circle "></i></a></div>
-                        <div style="overflow-y:auto" class="sjs-biangeng-height">
+                        <div style="overflow-y:auto" class="sjs-height-3">
                             <table class="table table-striped table-bordered table-hover table-sm">
                                 <thead class="text-center"><tr><th width="40">选择</th><th width="40">序号</th><th width="80">清单编号</th><th>名称</th><th width="50">单位</th><th width="100">单价</th><th width="100">数量</th><th width="100">金额</th></tr></thead>
                                 <tbody id="lists_data">

+ 1 - 1
app/view/report/rpt_all_popup.ejs

@@ -544,7 +544,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="sos-title">请选择变更令</h5>
+                <h5 class="modal-title" id="sos-title">请选择预付款</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">&times;</span>
                 </button>