MaiXinRong 1 день назад
Родитель
Сommit
e12eaea529

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

@@ -382,7 +382,6 @@ $(document).ready(function() {
                     {title: '合同编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 160, formatter: '@', readOnly: true},
                     {title: '合同名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 160, formatter: '@', readOnly: true},
                     {title: '乙方', colSpan: '1', rowSpan: '1', field: 'party_b', hAlign: 0, width: 150, formatter: '@', readOnly: true},
-                    {title: '合同金额', colSpan: '1', rowSpan: '1', field: 'deal_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '税率(%)', colSpan: '1', rowSpan: '1', field: 'tax', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '实付金额', colSpan: '1', rowSpan: '1', field: 'sf_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '入账金额', colSpan: '1', rowSpan: '1', field: 'in_tp', hAlign: 2, width: 80, type: 'Number'},

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

@@ -113,7 +113,7 @@ $(document).ready(() => {
             {title: '分项工程', colSpan: '1', rowSpan: '1', field: 'fxgc', hAlign: 0, width: 100, formatter: '@', visible: false},
             {title: '细目', colSpan: '1', rowSpan: '1', field: 'jldy', hAlign: 0, width: 100, formatter: '@', visible: false},
             {title: '计量单元', colSpan: '1', rowSpan: '1', field: 'bwmx', hAlign: 0, width: 100, formatter: '@'},
-            {title: '位置', colSpan: '1', rowSpan: '1', field: 'position', hAlign: 0, width: 100, formatter: '@'},
+            {title: '位置', colSpan: '1', rowSpan: '1', field: 'position', hAlign: 0, width: 100, formatter: '@', visible: false},
             {title: '台账数量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 80, type: 'Number'},
         ],
         emptyRows: 0,

+ 1 - 0
app/service/cost_stage_analysis.js

@@ -280,6 +280,7 @@ 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,

+ 1 - 1
app/service/cost_stage_analysis_detail.js

@@ -16,7 +16,7 @@ const costFields = {
     readFields: ['calc_read'],
     hisFields: ['calc_his'],
     taxFields: ['tax'],
-    baseFields: ['id', 'cost_id', 'tender_id', 'stage_id', 'ledger_id', 'source_id', 'is_deal'],
+    baseFields: ['id', 'cost_id', 'tender_id', 'stage_id', 'ledger_id', 'source_id', 'is_deal', 'd_order'],
 };
 costFields.sumFields = [...costFields.calcFields, ...costFields.selfCalcFields];
 costFields.preCopyFields = [...costFields.selfTextFields, ...costFields.calcFields, ...costFields.selfCalcFields, ...costFields.taxFields];

+ 3 - 2
app/service/cost_stage_book_detail.js

@@ -61,7 +61,7 @@ module.exports = app => {
                 'SELECT sd.cost_id, sd.code, sd.name, sd.tax, sd.is_deal, sd.id AS source_cid, sd.pay_tp, sd.cut_tp, sd.yf_tp, sd.sf_tp, sd.yf_excl_tax_tp, sd.sf_excl_tax_tp, sbd.in_tp, sbd.in_excl_tax_tp ' +
                 `  FROM ${this.ctx.service.costStageDetail.tableName} sd LEFT JOIN ${this.tableName} sbd ON sbd.detail_id = sd.id` +
                 `    LEFT JOIN ${this.ctx.service.costStage.tableName} cs ON sd.stage_id = cs.id` +
-                '  WHERE cs.tid = ? AND cs.stage_order <= ? AND sd.is_deal = 0';
+                '  WHERE cs.tid = ? AND cs.stage_order <= ? AND sd.is_deal = 0 ORDER BY sd.code ASC';
             const commonDetail = await this.db.query(commonDetailSql, [stage.tid, stage.stage_order]);
             // 以下sql需要8.0的mysql才支持
             // const dealDetailSql =
@@ -94,7 +94,8 @@ module.exports = app => {
                 '        sum(csbd.in_tp) AS in_tp, sum(csbd.in_excl_tax_tp) As in_excl_tax_tp' +
                 '      FROM zh_cost_stage_detail csd LEFT JOIN zh_cost_stage_book_detail csbd ON csd.id = csbd.detail_id' +
                 '      WHERE csd.tender_id = ? AND csd.stage_order <= ? AND csd.is_deal = 1 GROUP BY csd.cost_id, csd.source_cid' +
-                '  ) b ON a.cost_id = b.cost_id AND a.source_cid = b.source_cid';
+                '  ) b ON a.cost_id = b.cost_id AND a.source_cid = b.source_cid' +
+                '  ORDER BY a.code ASC';
             const dealDetail = await this.db.query(dealDetailSql, [stage.tid, stage.stage_order, stage.tid, stage.stage_order]);
             return [...commonDetail, ...dealDetail];
         }

+ 3 - 2
app/service/cost_stage_detail.js

@@ -60,7 +60,7 @@ module.exports = app => {
         async getEndData(stage) {
             const commonDetailSql = 'SELECT sd.cost_id, sd.id AS source_id, sd.code, sd.name, sd.tax, sd.pay_tp, sd.cut_tp, sd.yf_tp, sd.sf_tp, sd.yf_excl_tax_tp, sd.sf_excl_tax_tp ' +
                 `  FROM ${this.tableName} sd LEFT JOIN ${this.ctx.service.costStage.tableName} cs ON sd.stage_id = cs.id` +
-                '  WHERE cs.tid = ? AND cs.stage_order <= ? AND sd.is_deal = 0';
+                '  WHERE cs.tid = ? AND cs.stage_order <= ? AND sd.is_deal = 0 ORDER BY sd.code ASC';
             const commonDetail = await this.db.query(commonDetailSql, [stage.tid, stage.stage_order]);
             // 以下sql只有在mysqlV8.0以后才可使用
             // const dealDetailSql =
@@ -88,7 +88,8 @@ module.exports = app => {
                 '        sum(yf_tp) AS yf_tp, sum(sf_tp) AS sf_tp, ' +
                 '        sum(yf_excl_tax_tp) AS yf_excl_tax_tp, sum(sf_excl_tax_tp) AS sf_excl_tax_tp' +
                 '      FROM zh_cost_stage_detail WHERE tender_id = ? AND stage_order <= ? AND is_deal = 1 GROUP BY cost_id, source_cid' +
-                ') b ON a.cost_id = b.cost_id AND a.source_cid = b.source_cid';
+                ') b ON a.cost_id = b.cost_id AND a.source_cid = b.source_cid' +
+                '  ORDER BY a.code ASC';
             const dealDetail = await this.db.query(dealDetailSql, [stage.tid, stage.stage_order, stage.tid, stage.stage_order]);
             return [...commonDetail, ...dealDetail];
         }

+ 5 - 5
app/view/cost/analysis_list.ejs

@@ -22,11 +22,11 @@
                         <th width="80px">期数</th>
                         <th width="70px">报审月份</th>
                         <th width="70px">创建人</th>
-                        <th>项目收入</th>
-                        <th>项目支出</th>
-                        <th>利润</th>
-                        <th>利润率</th>
-                        <th width="180px">审批进度</th>
+                        <th width="150px">项目收入</th>
+                        <th width="150px">项目支出</th>
+                        <th width="150px">利润</th>
+                        <th width="150px">利润率</th>
+                        <th>审批进度</th>
                         <th width="100px">操作</th>
                     </tr>
                     </thead>

+ 5 - 5
app/view/cost/book_list.ejs

@@ -23,11 +23,11 @@
                         <th width="70px">报审月份</th>
                         <th width="70px">关联成本</th>
                         <th width="70px">创建人</th>
-                        <th>本期入账金额</th>
-                        <th>截止本期入账金额</th>
-                        <th>本期入账金额(不含税)</th>
-                        <th>截止本期入账金额(不含税)</th>
-                        <th width="180px">审批进度</th>
+                        <th width="150px">本期入账金额</th>
+                        <th width="150px">截止本期入账金额</th>
+                        <th width="150px">本期入账金额(不含税)</th>
+                        <th width="150px">截止本期入账金额(不含税)</th>
+                        <th>审批进度</th>
                         <th width="100px">操作</th>
                     </tr>
                     </thead>

+ 9 - 9
app/view/cost/ledger_list.ejs

@@ -23,18 +23,18 @@
                         <th width="70px" rowspan="2">报审月份</th>
                         <th colspan="4">本期金额</th>
                         <th colspan="4">截止本期金额</th>
-                        <th width="120px" rowspan="2">审批进度</th>
+                        <th rowspan="2">审批进度</th>
                         <th width="100px" rowspan="2">操作</th>
                     </tr>
                     <tr class="text-center">
-                        <th>付款</th>
-                        <th>扣款</th>
-                        <th>应付</th>
-                        <th>实付</th>
-                        <th>付款</th>
-                        <th>扣款</th>
-                        <th>应付</th>
-                        <th>实付</th>
+                        <th width="150px">付款</th>
+                        <th width="150px">扣款</th>
+                        <th width="150px">应付</th>
+                        <th width="150px">实付</th>
+                        <th width="150px">付款</th>
+                        <th width="150px">扣款</th>
+                        <th width="150px">应付</th>
+                        <th width="150px">实付</th>
                     </tr>
                     </thead>
                     <tbody>