Переглянути джерело

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

MaiXinRong 1 місяць тому
батько
коміт
1f1f302107

+ 2 - 0
app/const/rpt_archive.js

@@ -17,6 +17,8 @@ const BusinessType = [
     { stageId: -303, type: 'change_apply' },
     { stageId: -400, type: 'advance' },
     { stageId: -500, type: 'material' },
+    { stageId: -600, type: 'contract' },
+    { stageId: -700, type: 'phase_pay' },
 ];
 const getStageId = function(type) {
     const bType = BusinessType.find(x => { return x.type === type; });

+ 1 - 1
app/controller/change_controller.js

@@ -971,7 +971,7 @@ module.exports = app => {
             const ledgerColumn = [
                 'id', 'tender_id', 'ledger_id', 'ledger_pid', 'level', 'order', 'full_path', 'is_leaf',
                 'code', 'b_code', 'name', 'unit', 'unit_price', 'quantity', 'total_price',
-                'sgfh_qty', 'sgfh_expr', 'sgfh_tp', 'memo', 'features', 'drawing_code', 'node_type', 'ex_qty1', 'ex_tp1', 'ccid'];
+                'sgfh_qty', 'sgfh_expr', 'sgfh_tp', 'memo', 'features', 'drawing_code', 'node_type', 'ex_qty1', 'ex_tp1', 'ccid', 'is_new_price'];
             if (tender.info.display.ledger.deal) ledgerColumn.push('deal_qty', 'deal_tp');
             if (tender.info.display.ledger.dgnQty) ledgerColumn.push('dgn_qty1', 'dgn_qty2');
             if (tender.info.display.ledger.clQty) ledgerColumn.push('sjcl_qty', 'qtcl_qty', 'sjcl_expr', 'qtcl_expr', 'sjcl_tp', 'qtcl_tp');

+ 130 - 0
app/controller/report_controller.js

@@ -898,6 +898,136 @@ module.exports = app => {
             }
         }
 
+        async indexForPhasePay(ctx) {
+            // 计量管理
+            try {
+                await this.ctx.service.phasePay.loadAuditViewData(ctx.phasePay);
+                const pageShow = ctx.session.sessionProject.page_show;
+                pageShow.closeWatermark = 1;
+                pageShow.showArchive = 1;
+                pageShow.closeShowAllCustomized = 0;
+                pageShow.isPreset = 0;
+                const tenderId = ctx.params.id || -1; // 在router定义的
+                const bglObj = {};
+                // const bglObj = { status: stage_status };
+                bglObj.BUSINESS_ID = ctx.phasePay.id;
+                const stage = null;
+                const stage_order = -1;
+                const sorder = -1;
+                const stage_times = -1;
+                // const stage_status = -1;
+                const stage_status = 3; // 目前强制为通过,等后续审核逻辑完善后再改
+                const project_id = ctx.tender.data.project_id;
+                const { treeNodes, custCfg, commonArrs, allTreeItems, allIndivTreeItems } = await this._createNodes(ctx, sourceTypeConst.sourceType.phase_pay, project_id);
+                const cust_select_keys = JSON.stringify(['common', 'customize']); // 因其他地方也有可能保存用户报表的显示选择项,因当初设计问题,不好改数据库结构了,但可以调节内部json来满足需求
+                const rpt_tpl_items = { customize: [], common: [] };
+                commonArrs.forEach(item => {
+                    rpt_tpl_items.common.push(item.name);
+                });
+                if (treeNodes && treeNodes.length > 0) {
+                    for (let tIdx = treeNodes.length - 1; tIdx >= 0; tIdx--) {
+                        if (treeNodes[tIdx].name !== '通用报表') {
+                            rpt_tpl_items.customize.push(treeNodes[tIdx].name);
+                        }
+                    }
+                }
+
+                // 获取所有项目参与者
+                const { accountList, newAccountGroup, advance } = await this._getInvolveAcc(ctx, tenderId);
+                const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } }); // 找公司章用的
+                const roleList = await ctx.service.signatureRole.getSignatureRolesByTenderId(tenderId);
+                const usedList = await ctx.service.signatureUsed.getSignatureUsedByTenderId(tenderId);
+                const isAdmin = ctx.session.sessionUser.is_admin;
+                const prjAccList = await this._getPrjAccList(ctx, pageShow);
+                this._resetAccCompanySignPath(ctx, prjAccList);
+                for (const prjAcc of prjAccList) {
+                    prjAcc.account_group = prjAcc.company;
+                }
+                // 分类列表
+                const categoryData = await this.ctx.service.category.getAllCategory(ctx.subProject);
+                // // 获取用户权限
+                const accountInfo = await this.ctx.service.projectAccount.getDataById(this.ctx.session.sessionUser.accountId);
+                const tenderList = [];
+                const cid = this.ctx.helper._.map(treeNodes, 'id');
+                const customSelects = null;
+                const dataSelects = {};
+                dataSelects.material_select = await ctx.service.rptCustomDefine.getDataSelectByRpt(cid,
+                    reportConst.rptDataType[JV.NODE_CUS_MATERIAL_SELECT]);
+
+                // const materialList = await ctx.service.material.getValidMaterials(ctx.tenderId);
+                // const materialAdjAuditList = await ctx.service.materialAudit.getAuditorsByTender(tenderId);
+
+                const renderData = {
+                    accountGroup: newAccountGroup,
+                    accountList,
+                    unitList: JSON.stringify(unitList),
+                    tender: null,
+                    tenderInfo: null,
+                    rpt_tpl_data: JSON.stringify(treeNodes),
+                    cust_tpl_data: JSON.stringify(rpt_tpl_items),
+                    all_common_tpl_data: JSON.stringify(allTreeItems),
+                    all_indivi_tpl_data: JSON.stringify(allIndivTreeItems),
+                    // all_common_tpl_data: JSON.stringify([]),
+                    // all_indivi_tpl_data: JSON.stringify([]),
+                    cust_select_keys,
+                    cust_cfg: JSON.stringify(custCfg),
+                    project_id,
+                    tender_id: tenderId,
+                    budget_id: -1,
+                    sp_id: -1,
+                    tender_name: ctx.tender.data.name,
+                    detail_id: -1,
+                    stg_id: -700,
+                    stg_order: stage_order,
+                    cur_order: sorder,
+                    stg_times: stage_times,
+                    stg_status: stage_status,
+                    stage_list: '[]',
+                    prj_account_list: JSON.stringify(prjAccList),
+                    role_list: JSON.stringify(roleList),
+                    used_list: JSON.stringify(usedList),
+                    tenderMenu,
+                    // preUrl,
+                    // thisUrl,
+                    measureType,
+                    categoryData,
+                    tenderList,
+                    auditConst: auditConst.stage,
+                    ledgerAuditConst: auditConst.ledger,
+                    jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.report.main),
+                    customSelects,
+                    rptCustomType: reportConst.rptCustomType,
+                    advanceList: JSON.stringify([]),
+                    advanceAuditList: JSON.stringify([]),
+                    materialAdjList: JSON.stringify([]),
+                    materialAdjAuditList: JSON.stringify([]),
+                    materialList: [],
+                    stages: [],
+                    dataSelects,
+                    pageShow,
+                    authMobile: accountInfo.auth_mobile,
+                    shenpiConst,
+                    archiveList: [],
+                    lastAuditor: null,
+                    rpt_id: ctx.query.rpt_id,
+                    isAdmin,
+                    prePay: JSON.stringify(advance),
+                    OSS_PATH: ctx.app.config.fujianOssPath,
+                    viewPmData: PermissionCheck.viewPmData(this.ctx.session.sessionUser.permission),
+                    source_type: sourceTypeConst.sourceType.phase_pay,
+                    bglObj: JSON.stringify(bglObj),
+                    changes: 'null',
+                    otherChangeList: 'null',
+                    otherHintName: '',
+                    bizId: bglObj.BUSINESS_ID,
+                    permissions: '[]',
+                };
+                await this.layout('report/index.ejs', renderData, 'report/rpt_all_popup.ejs');
+            } catch (err) {
+                this.log(err);
+            }
+        }
+
         async _indexForBGL(ctx, source_type, stage_id) {
             // 变更令、变更方案、变更立项、变更申请 报表入口
             try {

+ 105 - 27
app/public/js/change_information.js

@@ -578,6 +578,7 @@ $(document).ready(() => {
     const changeSpreadSetting = {
         cols: [
             {title: '计价', colSpan: '1', rowSpan: '2', field: 'is_valuation', hAlign: 1, width: 50, cellType: 'checkbox', readOnly: 'readOnly.isValuation'},
+            {title: '新增单价', colSpan: '1', rowSpan: '2', field: 'is_new_price', hAlign: 1, width: 35, cellType: 'checkbox', readOnly: 'readOnly.isNewPrice'},
             {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 80, formatter: '@', readOnly: 'readOnly.isEdit'},
             {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 120, formatter: '@', readOnly: 'readOnly.isEdit'},
             {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: 'readOnly.isEdit', cellType: 'unit', comboItems: changeUnits, comboEdit: true},
@@ -699,6 +700,13 @@ $(document).ready(() => {
             },
             isSettle2: function (data) {
                 return !(!readOnly && ((data.id && !checkIsSettle(data)) || (data.children && data.children.length === 1 && !checkIsSettle(data.children[0]))));
+            },
+            isNewPrice: function (data) {
+                if (!data || readOnly) return true;
+                if (!readOnly && data.is_add_list) {
+                    return false;
+                }
+                return true;
             }
         },
     };
@@ -897,6 +905,11 @@ $(document).ready(() => {
             let i = 0;
             // 重算金额和数量汇总
             for (const node of newChangeList) {
+                if (node.gcl_id && _.findIndex(changeLedgerList, { id: node.gcl_id }) !== -1) {
+                    node.is_add_list = 1;
+                    const ledger = _.find(changeLedgerList, { id: node.gcl_id });
+                    node.is_new_price = ledger ? ledger.is_new_price : 0;
+                }
                 if (node.children && node.children.length > 0) {
                     changeSpreadObj.calcOneSum(node);
                     node.order = i + 1;
@@ -1336,7 +1349,7 @@ $(document).ready(() => {
                 return;
             }
             const col = info.sheet.zh_setting.cols[info.col];
-            if (col.field === 'is_valuation') {
+            if (col.field === 'is_valuation' || col.field === 'is_new_price') {
                 return;
             }
             let validText = is_numeric(info.editingText) && _.indexOf(numField, col.field) !== -1 ? parseFloat(info.editingText) : (info.editingText ? trimInvalidChar(info.editingText) : '');
@@ -1588,21 +1601,21 @@ $(document).ready(() => {
         };
         changeSpreadObj.buttonClicked = function(e, info) {
             if (info.sheet.zh_setting) {
-                const select = SpreadJsObj.getSelectObject(info.sheet);
-                if (!select || !select.id) {
-                    changeSpreadObj.reloadRow(info.sheet, info.row);
-                    return;
-                }
-                const cInfo = _.find(changeList, { id: select.id });
-                if (!cInfo) {
-                    toastr.error('数据错误,请刷新页面重试');
-                    changeSpreadObj.reloadRow(info.sheet, info.row);
-                    return;
+                if (info.sheet.isEditing()) {
+                    info.sheet.endEdit(true);
                 }
+                const select = SpreadJsObj.getSelectObject(info.sheet);
                 const col = info.sheet.zh_setting.cols[info.col];
                 if (col.field === 'is_valuation') {
-                    if (info.sheet.isEditing()) {
-                        info.sheet.endEdit(true);
+                    if (!select || !select.id) {
+                        changeSpreadObj.reloadRow(info.sheet, info.row);
+                        return;
+                    }
+                    const cInfo = _.find(changeList, { id: select.id });
+                    if (!cInfo) {
+                        toastr.error('数据错误,请刷新页面重试');
+                        changeSpreadObj.reloadRow(info.sheet, info.row);
+                        return;
                     }
                     if (_.findIndex(changeUsedData, { cbid: select.id }) !== -1) {
                         return;
@@ -1623,6 +1636,32 @@ $(document).ready(() => {
                         cInfo.is_valuation = select.is_valuation;
                         changeSpreadObj.reloadRow(info.sheet, info.row);
                     });
+                } else if (col.field === 'is_new_price') {
+                    // 判断是否为新增清单,是新增清单允许修改此项
+                    if (changeCol.readOnly.isNewPrice(select)) {
+                        changeSpreadObj.reloadRow(info.sheet, info.row);
+                        return;
+                    }
+                    select.is_new_price = info.sheet.getValue(info.row, info.col) ? 0 : 1;
+                    const c = _.find(changeLedgerList, { id: select.gcl_id });
+                    const data = {
+                        id: c.id,
+                        tender_id: c.tender_id,
+                        ledger_id: c.ledger_id,
+                        is_new_price: select.is_new_price,
+                    };
+                    // 单独更新到新增部位
+                    postData(window.location.pathname + '/revise/update', { postType: 'update', postData: data }, function (result) {
+                        c.is_new_price = select.is_new_price;
+                        const ledger = _.find(ledgerList, { id: c.id });
+                        if (ledger) {
+                            ledger.is_new_price = select.is_new_price;
+                        }
+                        changeSpreadObj.reloadRow(info.sheet, info.row);
+                    }, function () {
+                        select.is_new_price = info.sheet.getValue(info.row, info.col) ? 1 : 0;
+                        changeSpreadObj.reloadRow(info.sheet, info.row);
+                    });
                 }
             }
         };
@@ -2763,6 +2802,7 @@ $(document).ready(() => {
     const ledgerSpreadSetting = {
         cols: [
             {title: '计价', colSpan: '1', rowSpan: '2', field: 'is_valuation', hAlign: 1, width: 50, cellType: 'checkbox', getValue: 'getValue.is_valuation', readOnly: 'readOnly.isValuation'},
+            {title: '新增单价', colSpan: '1', rowSpan: '2', field: 'is_new_price', hAlign: 1, width: 35, cellType: 'checkbox', readOnly: 'readOnly.isNewPrice'},
             {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true, cellType: 'tree' },
             {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: 'readOnly.isEdit2'},
             {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 120, formatter: '@', readOnly: 'readOnly.isEdit2'},
@@ -2890,6 +2930,13 @@ $(document).ready(() => {
             },
             isSettle2: function (data) {
                 return !(!readOnly && data.clid && !checkIsSettle(data));
+            },
+            isNewPrice: function (data) {
+                if (!data || readOnly) return true;
+                if (!readOnly && data.is_leaf === 1 && _.findIndex(changeLedgerList, { id: data.id }) !== -1) {
+                    return false;
+                }
+                return true;
             }
         },
     };
@@ -3445,7 +3492,7 @@ $(document).ready(() => {
                 return;
             }
             const col = info.sheet.zh_setting.cols[info.col];
-            if (col.field === 'is_valuation') {
+            if (col.field === 'is_valuation' || col.field === 'is_new_price') {
                 return;
             }
             const sortData = info.sheet.zh_dataType === 'tree' ? info.sheet.zh_tree.nodes : info.sheet.zh_data;
@@ -3736,21 +3783,21 @@ $(document).ready(() => {
         };
         ledgerTreeSpreadObj.buttonClicked = function(e, info) {
             if (info.sheet.zh_setting) {
-                const select = SpreadJsObj.getSelectObject(info.sheet);
-                if (!select || !select.clid) {
-                    SpreadJsObj.reLoadRowData(info.sheet, info.row);
-                    return;
-                }
-                const cInfo = _.find(changeList, { id: select.clid });
-                if (!cInfo) {
-                    toastr.error('数据错误,请刷新页面重试');
-                    SpreadJsObj.reLoadRowData(info.sheet, info.row);
-                    return;
+                if (info.sheet.isEditing()) {
+                    info.sheet.endEdit(true);
                 }
+                const select = SpreadJsObj.getSelectObject(info.sheet);
                 const col = info.sheet.zh_setting.cols[info.col];
                 if (col.field === 'is_valuation') {
-                    if (info.sheet.isEditing()) {
-                        info.sheet.endEdit(true);
+                    if (!select || !select.clid) {
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
+                    }
+                    const cInfo = _.find(changeList, { id: select.clid });
+                    if (!cInfo) {
+                        toastr.error('数据错误,请刷新页面重试');
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
                     }
                     if (_.findIndex(changeUsedData, { cbid: select.clid }) !== -1) {
                         return;
@@ -3770,6 +3817,37 @@ $(document).ready(() => {
                         cInfo.is_valuation = select.is_valuation;
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     });
+                } else if (col.field === 'is_new_price') {
+                    if (ledgerCol.readOnly.isNewPrice(select)) {
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
+                    }
+                    select.is_new_price = info.sheet.getValue(info.row, info.col) ? 0 : 1;
+                    const c = _.find(changeLedgerList, { id: select.id });
+                    const data = {
+                        id: c.id,
+                        tender_id: c.tender_id,
+                        ledger_id: c.ledger_id,
+                        is_new_price: select.is_new_price,
+                    };
+                    // 单独更新到新增部位
+                    postData(window.location.pathname + '/revise/update', { postType: 'update', postData: data }, function (result) {
+                        c.is_new_price = select.is_new_price;
+                        const ledger = _.find(ledgerList, { id: c.id });
+                        if (ledger) {
+                            ledger.is_new_price = select.is_new_price;
+                        }
+                        const loadResult = {
+                            update: [select],
+                        };
+                        const refreshData = ledgerTree.loadPostData(loadResult);
+                        console.log(select, loadResult, refreshData);
+                        ledgerTreeSpreadObj.refreshTree(ledgerSheet, refreshData);
+                    }, function () {
+                        select.is_new_price = info.sheet.getValue(info.row, info.col) ? 1 : 0;
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                    });
+
                 }
             }
         };
@@ -5514,7 +5592,7 @@ $(document).ready(() => {
         ledgerTree.loadDatas(changeLedgers);
         pos.loadDatas(changePoss);
         treeCalc.calculateAll(ledgerTree);
-        console.log(ledgerTree);
+        console.log(changeLedgers, ledgerTree);
         SpreadJsObj.loadSheetData(ledgerSheet, SpreadJsObj.DataType.Tree, ledgerTree);
         ledgerTree.expandByCustom(() => { return true; });
         SpreadJsObj.refreshTreeRowVisible(ledgerSheet);

+ 32 - 1
app/public/js/change_revise.js

@@ -122,6 +122,7 @@ $(document).ready(() => {
             }
         }
     };
+    console.log(billsSpreadSetting.cols);
     const posCol = {
         getValue: {
             isChange: function (data) {
@@ -825,6 +826,36 @@ $(document).ready(() => {
                         cInfo.is_valuation = select.is_valuation;
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     });
+                } else if (col.field === 'is_new_price') {
+                    if (info.sheet.isEditing()) {
+                        info.sheet.endEdit(true);
+                    }
+                    if (billsCol.readOnly.isChangeAdd(select)) {
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
+                    }
+                    if (select && select.is_leaf === 0) {
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
+                    }
+                    const is_new_price = info.sheet.getValue(info.row, info.col) ? 1 : 0;
+                    select.is_new_price = is_new_price;
+                    const data = {
+                        id: select.id,
+                        tender_id: select.tender_id,
+                        ledger_id: select.ledger_id,
+                        is_new_price: is_new_price,
+                    };
+                    postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) {
+                        changeList = result.changeList;
+                        const refreshNode = billsTree.loadPostData(result);
+                        for (const u of refreshNode.update) {
+                            billsTreeSpreadObj.reCalcCamount(u);
+                        }
+                        billsTreeSpreadObj.refreshTree(info.sheet, refreshNode);
+                        billsTreeSpreadObj.refreshPosData();
+                        changeGclData = true;
+                    });
                 }
             }
         },
@@ -836,7 +867,7 @@ $(document).ready(() => {
         editEnded: function (e, info) {
             if (info.sheet.zh_setting) {
                 const col = info.sheet.zh_setting.cols[info.col];
-                if (col.field === 'is_change' || col.field === 'is_valuation') {
+                if (col.field === 'is_change' || col.field === 'is_valuation' || col.field === 'is_new_price') {
                     return;
                 }
                 const sortData = info.sheet.zh_dataType === 'tree' ? info.sheet.zh_tree.nodes : info.sheet.zh_data;

+ 5 - 0
app/public/report/js/rpt_main.js

@@ -519,6 +519,11 @@ let zTreeOprObj = {
             params.tid = params.tender_id;
             params.safe_stage_id = BGL_OBJ.BUSINESS_ID;
         }
+        if (STAGE_ID === -700) {
+            url =  `/tender/${TENDER_ID}/phase/report_api/getReport`;
+            params.tid = params.tender_id;
+            params.phase_pay_id = BUSINESS_ID;
+        }
         $.bootstrapLoading.start();
         CommonAjax.postXsrfEx(url, params, 300000, true, getCookie('csrfToken_j'),
             async function(result){

+ 5 - 6
app/router.js

@@ -911,13 +911,13 @@ module.exports = app => {
     app.get('/tender/:id/change/project/:cprjid/report', sessionAuth, tenderCheck, subProjectCheck, uncheckTenderCheck, 'reportController.indexForChangeProject');
     app.get('/tender/:id/change/apply/:caid/report', sessionAuth, tenderCheck, subProjectCheck, uncheckTenderCheck, 'reportController.indexForChangeApply');
     app.get('/tender/:id/measure/stage/:order/report', sessionAuth, tenderCheck, subProjectCheck, uncheckTenderCheck, stageCheck, 'reportController.index');
-    // app.get('/sp/:prjid/contract/report', sessionAuth, subProjectCheck, 'reportController.indexForProjectContract');
-    // app.get('/sp/:id/contract/panel', sessionAuth, subProjectCheck, contractCheck, 'contractController.panel');
     app.get('/sp/:id/contract/report', sessionAuth, subProjectCheck, contractCheck, 'reportController.indexForProjectContract');
     app.get('/sp/:id/contract/tender/:tid/report', sessionAuth, subProjectCheck, contractCheck, 'reportController.indexForTenderContract');
-    // app.get('/sp?/contract/report', sessionAuth, tenderCheck, subProjectCheck, uncheckTenderCheck, 'reportController.indexForTenderContract');
     app.get('/sp/:id/payment/:pid/safe/:did/report', sessionAuth, subProjectCheck, paymentTenderCheck, paymentDetailCheck, 'reportController.indexForPaymentSafe');
     app.get('/budget/:id/report', sessionAuth, budgetCheck, 'reportController.indexForDynamicGrandTotal');
+    // app.get('/tender/:id/pay/:order/detail', sessionAuth, tenderCheck, subProjectCheck, phasePayCheck, 'payController.detail');
+    // app.get('/tender/:id/pay/:order/report', sessionAuth, tenderCheck, subProjectCheck, phasePayCheck, 'reportController.indexForPhasePay'); // 计量管理
+    app.get('/tender/:id/pay/:order/report', sessionAuth, tenderCheck, subProjectCheck, phasePayCheck, 'reportController.indexForPhasePay'); // 计量管理(无 phasePayCheck)
     app.get('/tender/:id/archiveReport', sessionAuth, tenderCheck, subProjectCheck, 'reportArchiveController.index');
     app.post('/tender/report_api/getReportArchive', sessionAuth, 'reportArchiveController.getReportArchive');
     app.post('/tender/report_api/getReportArchive4bz', sessionAuth, 'reportArchiveController.getReportArchive4bz');
@@ -927,10 +927,9 @@ module.exports = app => {
     app.get('/printReport/:size', sessionAuth, 'reportController.showPrintPage');
     app.get('/individualReport/:size', sessionAuth, 'reportController.showIndividualPage');
     app.post('/tender/report_api/getReport', sessionAuth, subProjectCheck, 'reportController.getReport');
+    // app.post('/phase/report_api/getReport', sessionAuth, tenderCheck, subProjectCheck, 'reportController.getReport');
+    app.post('/tender/:id/phase/report_api/getReport', sessionAuth, tenderCheck, subProjectCheck, 'reportController.getReport');
     app.post('/contract/report_api/getReport', sessionAuth, subProjectCheck, 'reportController.getReport');
-    // app.post('/sp/contract/report_api/getReport', sessionAuth, subProjectCheck, 'reportController.getReport');
-    // /sp/:id
-    // app.post('/safe_calc/report_api/getReport', sessionAuth, subProjectCheck, tenderCheck, tenderPermissionCheck, safeStageCheck, 'reportController.getReport');
     app.post('/safe_calc/report_api/getReport', sessionAuth, subProjectCheck, 'reportController.getReport');
     app.post('/report_api/getReport', sessionAuth, 'reportController.getReport');
     app.post('/report_api/getReportTemplate', sessionAuth, 'reportController.getReportTemplate');

+ 1 - 0
app/view/phase_pay/sub_menu_list.ejs

@@ -1,3 +1,4 @@
 <nav-menu title="返回" url="/tender/<%= ctx.tender.id %>/pay" tclass="text-primary" ml="1" icon="fa-chevron-left"></nav-menu>
 <nav-menu title="支付明细" url="/tender/<%= ctx.tender.id %>/pay/<%= ctx.phasePay.phase_order + '/detail'%>" ml="3" active="<%= (ctx.url.indexOf('detail') >= 0 ? 1 : -1) %>"></nav-menu>
+<nav-menu title="输出报表" url="/tender/<%= ctx.tender.id %>/pay/<%= ctx.phasePay.phase_order + '/report'%>" ml="3" active="<%= (ctx.url.indexOf('report') >= 0 ? 1 : -1) %>"></nav-menu>
 <% include ./audit_btn.ejs %>

+ 7 - 5
app/view/report/index.ejs

@@ -10,6 +10,8 @@
     <% include ../tender/tender_sub_menu.ejs %>
 <% } else if ([-600].includes(stg_id)) { %>
     <% include ../contract/sub_menu.ejs %>
+<% } else if ([-700].includes(stg_id)) { %>
+    <% include ../phase_pay/sub_menu.ejs %>
 <% } else { %>
     <% include ../stage/stage_sub_menu.ejs %>
 <% } %>
@@ -18,7 +20,7 @@
         <div class="title-main d-flex">
             <% if(stg_id === -1) { %>
                 <% include ../tender/tender_sub_mini_menu.ejs %>
-            <% } else if ([-100, -150, -200, -300, -301, -302, -303, -600].includes(stg_id)) { %>
+            <% } else if ([-100, -150, -200, -300, -301, -302, -303, -600, -700].includes(stg_id)) { %>
             <% } else { %>
                 <% include ../stage/stage_sub_mini_menu.ejs %>
             <% } %>
@@ -50,7 +52,7 @@
                     </div>
                 </div>
                 <% } %>
-                <% if (false || ![-100, -150, -200, -300, -301, -302, -303, -600].includes(stg_id)) { %>
+                <% if (false || ![-100, -150, -200, -300, -301, -302, -303, -600, -700].includes(stg_id)) { %>
                 <div class="d-inline-block" id="divSelectableBizs_up">
                     <div class="dropdown" id="divSelectableStages">
                         <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="btnCurrentStage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
@@ -66,7 +68,7 @@
                     </div>
                 </div>
                 <% } %>
-                <% if (stg_id === -200 || ![-100, -150, -300, -301, -302, -303, -600].includes(stg_id)) { %>
+                <% if (stg_id === -200 || ![-100, -150, -300, -301, -302, -303, -600, -700].includes(stg_id)) { %>
                 <div class="d-inline-block" id="report_selects_div">
                     <ul class="nav nav-pills m-0" id="report_selects_ul">
                         <% if (ctx.session.sessionUser.is_admin || ctx.session.sessionProject.page_show.isCommonSetup) { %>
@@ -128,7 +130,7 @@
                 </div>
                 <% } %>
                 <% } %>
-                <% if (isAdmin && ![-150, -600].includes(stg_id)) { %>
+                <% if (isAdmin && ![-150, -600, -700].includes(stg_id)) { %>
                 <div class="d-inline-block">
                     <a href="/tender/<%- tender_id %>/report/format/setup" class=" btn btn-light btn-sm  text-primary">设置</a>
                 </div>
@@ -697,7 +699,7 @@
         current_stage_status = STAGE_LIST[STAGE_LIST.length - 1].status;
     }
 
-    <% if (false || ![-100, -150, -200, -300, -301, -302, -303, -600].includes(stg_id)) { %>
+    <% if (false || ![-100, -150, -200, -300, -301, -302, -303, -600, -700].includes(stg_id)) { %>
     buildStageSelection();
     <% } %>
     setupSignature();

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

@@ -814,7 +814,7 @@
     </div>
 </div>
 
-<% if (![-100, -150, -200, -300, -301, -302, -303, -600].includes(stg_id)) { %>
+<% if (![-100, -150, -200, -300, -301, -302, -303, -600, -700].includes(stg_id)) { %>
 <% include ../stage/audit_modal.ejs %>
 <% } %>
 <% if (stg_id === -150) { %>
@@ -825,7 +825,7 @@
     zTreeOprObj.getCustomerCfg();
     zTreeOprObj.iniFontCfgDom(CUST_CFG);
     
-    <% if (![-100, -150, -300, -301, -302, -303, -600].includes(stg_id)) { %>
+    <% if (![-100, -150, -300, -301, -302, -303, -600, -700].includes(stg_id)) { %>
     buildCustRptCommon('report_cust_group_common', ORG_TOP_TREE_NODES[1], CUST_TREE_NODES.common, 'true');
     buildCustRptCommon('report_cust_group_individual', ORG_TOP_TREE_NODES[0], CUST_TREE_NODES.customize, 'false');
     <% } %>

+ 3 - 0
sql/update.sql

@@ -312,6 +312,9 @@ CREATE TABLE `zh_pos_calc_detail`  (
 ALTER TABLE `zh_material_list`
 ADD COLUMN `qty` decimal(30, 8) NULL DEFAULT NULL COMMENT '本期调差数量' AFTER `gather_qty`;
 
+ALTER TABLE `zh_change_ledger`
+ADD COLUMN `is_new_price` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '新增单价' AFTER `ex_tp1`;
+
 ------------------------------------
 -- 表数据
 ------------------------------------