MaiXinRong hai 1 día
pai
achega
836fdca7a9

+ 1 - 2
app/service/cost_stage_analysis.js

@@ -114,7 +114,7 @@ module.exports = app => {
             }
             const detail = costStage.stage_type === 'book'
                 ? await this.ctx.service.costStageBookDetail.getEndData(costStage)
-                : await this.ctx.service.costStageDetail.getEndData(costStage.relaStage);
+                : await this.ctx.service.costStageDetail.getEndData(costStage);
             const ledger = new Ledger.baseTree(this.ctx, {
                 id: 'tree_id', pid: 'tree_pid', order: 'tree_order',
                 level: 'tree_level', isLeaf: 'tree_is_leaf', fullPath: 'tree_full_path',
@@ -281,7 +281,6 @@ module.exports = app => {
                         ln[prop] = 0;
                     }
                     for (const [i, d] of node.detail.entries()) {
-                        console.log(node.detail);
                         const ld = {
                             id: this.uuid.v4(), tender_id: stage.tid, stage_id: stage.id,
                             add_user_id: userId, update_user_id: userId,

+ 2 - 2
app/service/cost_stage_detail.js

@@ -104,14 +104,14 @@ module.exports = app => {
             return [...commonDetail, ...dealDetail];
         }
         async getEndData(stage) {
-            if (stage) return [];
+            if (!stage) return [];
             if (stage.stage_type !== 'ledger') throw '关联成本报审错误';
 
             const allStages = await this.db.query(`SELECT id FROM ${this.ctx.service.costStage.tableName} WHERE tid = ? AND stage_type = 'ledger' AND stage_order <= ?`, [stage.tid, stage.stage_order]);
             const relaStageIds = allStages.map(x => {
                 return x.id;
             });
-            await this.getEndDataByStageId(stage.tid, relaStageIds);
+            return await this.getEndDataByStageId(stage.tid, relaStageIds);
         }
 
         async _getLedgerUpdateData(data, ledger_id, details) {

+ 2 - 0
app/view/cost/analysis_list.ejs

@@ -21,6 +21,7 @@
                     <tr class="text-center">
                         <th width="80px">期数</th>
                         <th width="70px">报审月份</th>
+                        <th width="70px">关联成本</th>
                         <th width="70px">创建人</th>
                         <th width="200px">项目收入</th>
                         <th width="200px">项目支出</th>
@@ -37,6 +38,7 @@
                             <a href="/sp/<%- ctx.subProject.id %>/cost/tender/<%- ctx.tender.id %>/analysis/<%- s.stage_order %>/stage" target="_blank">第 <%- s.stage_order %> 期</a>
                         </td>
                         <td class="text-center"><%- s.stage_date %></td>
+                        <td class="text-center">第<%- s.rela_stage.sorder %>期</td>
                         <td class="text-center"><%- s.user_name %></td>
                         <td class="text-right"><%- s.stage_tp.in_tp %></td>
                         <td class="text-right"><%- s.stage_tp.out_tp %></td>

+ 1 - 1
config/config.default.js

@@ -276,6 +276,6 @@ module.exports = appInfo => {
         algorithm: 'aes-256-cbc',
     };
 
-    config.kkfileUrl = '/onlinePreview?url=';
+    config.kkfileUrl = 'preview/onlinePreview?url=';
     return config;
 };

+ 5 - 2
sql/update.sql

@@ -79,8 +79,8 @@ CREATE TABLE `zh_cost_stage`  (
   `audit_begin_time` timestamp NULL COMMENT '开始审批时间',
   `audit_end_time` timestamp NULL COMMENT '审批结束时间',
   `final_auditor_str` varchar(255) NOT NULL DEFAULT '' COMMENT '终审缓存信息',
-  `stage_tp` json NOT NULL COMMENT '金额',
-  `stage_pre_tp` json NOT NULL COMMENT '截止上期金额',
+  `stage_tp` json NULL COMMENT '金额',
+  `stage_pre_tp` json NULL COMMENT '截止上期金额',
   `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板',
   PRIMARY KEY (`id`),
   INDEX `idx_tid_type`(`tid`, `stage_type`) USING BTREE
@@ -579,6 +579,9 @@ CREATE TABLE `zh_contract_supplement_attachment` (
 
 ALTER TABLE `zh_sub_project`
 MODIFY COLUMN `fun_rela` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '功能设置(json.stringify)' AFTER `page_show`;
+
+ALTER TABLE `zh_calc_tmpl`
+ADD COLUMN `sub_spread_cache` json NULL COMMENT '子数据spreadjs表头设置缓存' AFTER `spread_cache`;
 ------------------------------------
 -- 表数据
 ------------------------------------