浏览代码

1. 资金划拨月份,分页显示
2. 部位台账,不计价显示相关

MaiXinRong 1 周之前
父节点
当前提交
47f7112dff

+ 14 - 1
app/controller/financial_controller.js

@@ -189,7 +189,19 @@ module.exports = app => {
                 if (!transferInfo) {
                     throw '该资金划拨信息不存在';
                 }
-                const transferTenderList = await ctx.service.financialTransferTender.getList(trid);
+                const transferTenderList = await ctx.service.financialTransferTender.getList(trid, true);
+                const total = await ctx.service.financialTransferTender.count({ trid });
+                // 分页相关
+                const page = ctx.page;
+                const pageSize = ctx.pageSize;
+                const pageInfo = {
+                    page,
+                    pageSizeSelect: 1,
+                    pageSize,
+                    total_num: total,
+                    total: Math.ceil(total / pageSize),
+                    queryData: JSON.stringify(ctx.urlInfo.query),
+                };
                 const tenders = await ctx.service.tender.getAllDataByCondition({ where: { spid: ctx.subProject.id, filter_fund: 0 } });
                 for (const tt of transferTenderList) {
                     const tenderIndex = ctx.helper._.findIndex(tenders, { id: tt.tid });
@@ -224,6 +236,7 @@ module.exports = app => {
                     preUrl: '/sp/' + ctx.subProject.id + '/financial/transfer',
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.financial.transferTender),
                     whiteList: ctx.app.config.multipart.whitelist,
+                    pageInfo,
                 };
                 await this.layout('financial/transfer_tender.ejs', renderData, 'financial/transfer_tender_modal.ejs');
             } catch (err) {

+ 2 - 0
app/controller/stage_controller.js

@@ -1634,6 +1634,8 @@ module.exports = app => {
                 renderData.ex_memo1 = sjsRela.ledgerCol.find(x => { return x.field === 'ex_memo1'; });
                 renderData.ex_memo2 = sjsRela.ledgerCol.find(x => { return x.field === 'ex_memo2'; });
                 renderData.ex_memo3 = sjsRela.ledgerCol.find(x => { return x.field === 'ex_memo3'; });
+                const projectFunInfo = this.ctx.subProject.fun_rela;
+                renderData.minusNoValue = projectFunInfo.minusNoValue && ctx.tender.info.fun_rela.stage_change.minusNoValue;
                 await this.layout('stage/bwtz.ejs', renderData, 'stage/audit_modal.ejs');
             } catch (err) {
                 this.log(err);

+ 8 - 2
app/service/financial_transfer_tender.js

@@ -21,8 +21,14 @@ module.exports = app => {
             this.tableName = 'financial_transfer_tender';
         }
 
-        async getList(trid) {
-            const sql = 'SELECT ftt.*, t.`name` as name FROM ?? as ftt LEFT JOIN ?? as t ON ftt.`tid` = t.`id` WHERE ftt.`trid` = ?';
+        async getList(trid, pageLimit = 0) {
+            let sql = 'SELECT ftt.*, t.`name` as name FROM ?? as ftt LEFT JOIN ?? as t ON ftt.`tid` = t.`id` WHERE ftt.`trid` = ?';
+            if (pageLimit) {
+                const limit = this.ctx.pageSize ? this.ctx.pageSize : this.app.config.pageSize;
+                const offset = limit * (this.ctx.page - 1);
+                const limitString = offset >= 0 ? offset + ',' + limit : limit;
+                sql += ' LIMIT ' + limitString;
+            }
             const sqlParams = [this.tableName, this.ctx.service.tender.tableName, trid];
             const list = await this.db.query(sql, sqlParams);
             for (const l of list) {

+ 2 - 0
app/view/financial/transfer_tender.ejs

@@ -60,6 +60,8 @@
                     <% } %>
                     </tbody>
                 </table>
+                <!--翻页-->
+                <% include ../layout/page.ejs %>
             </div>
         </div>
     </div>

+ 2 - 2
app/view/stage/bwtz.ejs

@@ -236,7 +236,7 @@
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number', visible: <%- minusNoValue %> },
             {title: '|变更令', colSpan: '|1', rowSpan: '|1', field: 'bgl_code', hAlign: 2, width: 60, formatter: '@', cellType: 'ellipsisAutoTip'},
             <% if ( ctx.tender.info.display.stage.priceDiff ) { %>
             { title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number', getValue(data) { return data.pc_tp ? data.org_price : null},  },
@@ -248,7 +248,7 @@
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_contract_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '截止本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_qc_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number', visible: <%- minusNoValue %>},
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '|完成率(%)', colSpan: '|1', rowSpan: '|1', field: 'end_final_1_percent', hAlign: 2, width: 80, type: 'Number'},