Browse Source

数字带 元 问题

laiguoran 2 years ago
parent
commit
5bb17ab45e
3 changed files with 8 additions and 3 deletions
  1. 4 1
      app/service/stage.js
  2. 1 1
      app/view/payment/detail.ejs
  3. 3 1
      sql/update.sql

+ 4 - 1
app/service/stage.js

@@ -763,10 +763,13 @@ module.exports = app => {
 
         async getStageByDataCollect(tenderId) {
             const stages = await this.db.select(this.tableName, {
-                columns: ['s_time', 'contract_tp', 'qc_tp', 'pc_tp', 'pre_contract_tp', 'pre_qc_tp'],
+                columns: ['status', 's_time', 'contract_tp', 'qc_tp', 'pc_tp', 'pre_contract_tp', 'pre_qc_tp'],
                 where: { tid: tenderId },
                 orders: [['order', 'desc']],
             });
+            if (stages.length > 0 && stages[0].status === auditConst.status.uncheck) {
+                stages.splice(0, 1);
+            }
             for (const s of stages) {
                 s.tp = this.ctx.helper.sum([s.contract_tp, s.qc_tp, s.pc_tp]);
                 s.pre_tp = this.ctx.helper.add(s.pre_contract_tp, s.pre_qc_tp);

+ 1 - 1
app/view/payment/detail.ejs

@@ -42,7 +42,7 @@
                                 <% if (item.type === 'textarea') { %>
                                     <textarea <% if (ctx.detail.readOnly) { %>readonly<% } %> class="form-control form-control-sm" data-index="<%- item.index %>"><%- item.value %></textarea>
                                 <% } else { %>
-                                    <input <% if (ctx.detail.readOnly) { %>readonly<% } %> type="<%- item.type %>" value="<%- item.value %>"  data-index="<%- item.index %>" class="form-control form-control-sm" placeholder="请输入">
+                                    <input <% if (ctx.detail.readOnly) { %>readonly<% } %> type="<%- item.type %>" value="<%- item.type === 'number' && ctx.helper._.indexOf(item.value, '元') !== -1 ? parseFloat(item.value) : item.value %>"  data-index="<%- item.index %>" class="form-control form-control-sm" placeholder="请输入">
                                 <% } %>
                             </div>
                             <% } %>

+ 3 - 1
sql/update.sql

@@ -15,4 +15,6 @@ UPDATE `zh_sub_project` p LEFT JOIN `zh_budget` b ON p.budget_id = b.id SET p.st
 UPDATE `zh_sub_project` p LEFT JOIN `zh_budget_std` bs ON p.std_id = bs.id SET p.std_name = IFNULL(bs.name, '');
 
 -- index
-ALTER TABLE `zh_material_bills_history` ADD INDEX `idx_mbid_mid_mspread` (`mb_id`, `mid`, `m_spread`);
+ALTER TABLE `zh_material_bills_history` ADD INDEX `idx_mbid_mid_mspread` (`mb_id`, `mid`, `m_spread`);
+
+ALTER TABLE `zh_project` ADD `payment_setting` JSON NULL DEFAULT NULL COMMENT '支付审批模块设置' AFTER `fun_set`;