Przeglądaj źródła

造价对比,汇总合同调整

MaiXinRong 10 godzin temu
rodzic
commit
0170690ca4
3 zmienionych plików z 6 dodań i 3 usunięć
  1. 2 2
      app/lib/budget_final.js
  2. 1 1
      app/service/budget.js
  3. 3 0
      sql/update.sql

+ 2 - 2
app/lib/budget_final.js

@@ -324,8 +324,8 @@ class BudgetFinal {
         const contractData = await this.ctx.service.contract.getAllDataByCondition({ where: { id: deal, spid: this.ctx.subProject.id, contract_type: 1 } });
 
         const paySqlParam = [];
-        const timeFilter = stage.type === 'month' ? `AND pay_time <= ? ` : '';
-        if (stage.type === 'month') {
+        const timeFilter = stage.type === 'under-month' ? `AND pay_time <= ? ` : '';
+        if (stage.type === 'under-month') {
             paySqlParam.push(this.ctx.moment(stage.month, 'YYYY-MM').endOf('month').format('YYYY-MM-DD HH:mm:ss'));
         }
         const checkedFilter = stage.checked && this.ctx.subProject.page_show.openContractPaySubProjectShenpi ? ' AND status = 3 ' : '';

+ 1 - 1
app/service/budget.js

@@ -286,7 +286,7 @@ module.exports = app => {
             try {
                 await conn.update(this.tableName, {id: budget.id, final_id: final.id, final_time: new Date() });
                 await conn.insert(this.ctx.service.budgetFinal.tableName, finalData);
-                await conn.update(this.ctx.service.budgetFinalList.tableName, { id: final.id, tender_info: JSON.stringify(final.tender_info), status: 3});
+                await conn.update(this.ctx.service.budgetFinalList.tableName, { id: final.id, tender_info: JSON.stringify(final.tender_info), contract: contract.join(','), status: 3});
                 await conn.commit();
                 return finalData;
             } catch (err) {

+ 3 - 0
sql/update.sql

@@ -109,6 +109,9 @@ CREATE TABLE `zh_cost_stage_duty` (
 ALTER TABLE `zh_cost_stage`
 ADD COLUMN `extra_info` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '附加信息' AFTER `calc_template`;
 
+ALTER TABLE `zh_budget_final_list`
+ADD COLUMN `contract` varchar(1000) NOT NULL DEFAULT ''  COMMENT '关联合同id(,分隔)' AFTER `status`;
+
 ------------------------------------
 -- 表数据
 ------------------------------------