@@ -60,7 +60,6 @@ module.exports = app => {
const commonDetailSql =
'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 sbd.tender_id = ? AND sbd.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才支持
@@ -58,9 +58,8 @@ module.exports = app => {
return result;
}
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 ORDER BY sd.code ASC';
+ const commonDetailSql = 'SELECT cost_id, id AS source_id, code, name, tax, pay_tp, cut_tp, yf_tp, sf_tp, yf_excl_tax_tp, sf_excl_tax_tp ' +
+ ` FROM ${this.tableName} WHERE tender_id = ? AND stage_order <= ? AND is_deal = 0 ORDER BY code ASC`;
// 以下sql只有在mysqlV8.0以后才可使用
// const dealDetailSql =
@@ -382,7 +382,7 @@
</tr>
<% } %>
<% for (const acs of auditCostStageBook) { %>
- <tr data-type="16">
+ <tr data-type="17">
<td><span class="bg-new-coststage text-new-coststage badge text-width">财务账面</span></td>
<td><a href="/sp/<%- acs.spid %>/cost/tender/<%- acs.tid %>/book"><%- acs.name %></a> <a href="/sp/<%- acs.spid %>/cost/tender/<%- acs.tid %>/book/<%- acs.stage_order %>/stage">第<%- acs.stage_order %>期</a></td>
<td>第<%- acs.stage_order %>期</td>
@@ -391,7 +391,7 @@
<% for (const acs of auditCostStageAnalysis) { %>
+ <tr data-type="18">
<td><span class="bg-new-coststage text-new-coststage badge text-width">成本分析</span></td>
<td><a href="/sp/<%- acs.spid %>/cost/tender/<%- acs.tid %>/analysis"><%- acs.name %></a> <a href="/sp/<%- acs.spid %>/cost/tender/<%- acs.tid %>/analysis/<%- acs.stage_order %>/stage">第<%- acs.stage_order %>期</a></td>
@@ -692,7 +692,7 @@
<td class="<%- acCostStage.statusClass[notice.status] %>"><%- acCostStage.statusString[notice.status] %></td>
<td><%- notice.opinion ? notice.opinion : '' %></td>
- <% } else if(notice.type === pushType.costStageLedger && ctx.subProject.page_show.cost) { %>
+ <% } else if(notice.type === pushType.costStageBook && ctx.subProject.page_show.cost) { %>
<tr data-type="17">
<td><a href="/sp/<%- notice.spid %>/cost/tender/<%- notice.tid %>/book"><%- notice.name %></a> <a href="/sp/<%- notice.spid %>/cost/tender/<%- notice.tid %>/book/<%- notice.order %>/stage">第<%- notice.order %>期</a></td>