Просмотр исходного кода

合同支付,基数计算相关

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

+ 1 - 1
app/service/stage_bonus.js

@@ -232,7 +232,7 @@ module.exports = app => {
         async getSumTp(stage) {
             const stages = stage instanceof Array ? stage : [stage];
             const condition = {};
-            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; }).join(',');
+            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; });
             const sql = `SELECT SUM(IF(tp > 0, tp, 0)) AS positive_tp, SUM(IF(tp < 0, tp, 0)) AS negative_tp, SUM(IF(b_type = '奖金', tp, 0)) AS reward_tp, SUM(IF(b_type = '罚金', tp, 0)) AS forfeit_tp, SUM(tp) AS sum_tp From ${this.tableName} ` + this.ctx.helper.whereSql(condition);
             return await this.db.queryOne(sql);
         }

+ 1 - 1
app/service/stage_jgcl.js

@@ -320,7 +320,7 @@ module.exports = app => {
         async getSumTp(stage) {
             const stages = stage instanceof Array ? stage : [stage];
             const condition = {};
-            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; }).join(',');
+            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; });
             const sql = `SELECT SUM(arrive_tp) AS arrive_tp, SUM(deduct_tp) AS deduct_tp FROM ${this.tableName} ` + this.ctx.helper.whereSql(condition);
             return await this.db.queryOne(sql);
         }

+ 1 - 1
app/service/stage_other.js

@@ -284,7 +284,7 @@ module.exports = app => {
         async getSumTp(stage) {
             const stages = stage instanceof Array ? stage : [stage];
             const condition = {};
-            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; }).join(',');
+            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; });
             const sql = `SELECT SUM(tp) AS sum_tp FROM ${this.tableName} ` + this.ctx.helper.whereSql(condition);
             return await this.db.queryOne(sql);
         }

+ 1 - 1
app/service/stage_safe_prod.js

@@ -319,7 +319,7 @@ module.exports = app => {
         async getSumTp(stage) {
             const stages = stage instanceof Array ? stage : [stage];
             const condition = {};
-            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; }).join(',');
+            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; });
             const sql = `SELECT SUM(tp) AS sum_tp FROM ${this.tableName} ` + this.ctx.helper.whereSql(condition);
             return await this.db.queryOne(sql);
         }

+ 1 - 1
app/service/stage_temp_land.js

@@ -288,7 +288,7 @@ module.exports = app => {
         async getSumTp(stage) {
             const stages = stage instanceof Array ? stage : [stage];
             const condition = {};
-            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; }).join(',');
+            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; });
             const sql = `SELECT SUM(tp) AS sum_tp FROM ${this.tableName} ` + this.ctx.helper.whereSql(condition);
             return await this.db.queryOne(sql);
         }

+ 8 - 0
app/service/stage_yjcl.js

@@ -295,6 +295,14 @@ module.exports = app => {
             }
             await transaction.updateRows(this.tableName, updateDatas);
         }
+
+        async getSumTp(stage) {
+            const stages = stage instanceof Array ? stage : [stage];
+            const condition = {};
+            condition.sid = stage.length === 1 ? stage[0].id : stages.map(x => { return x.id; });
+            const sql = `SELECT SUM(tp) AS sum_tp FROM ${this.tableName} ` + this.ctx.helper.whereSql(condition);
+            return await this.db.queryOne(sql);
+        }
     }
 
     return StageYjcl;

+ 4 - 0
app/view/phase_pay/detail.ejs

@@ -19,6 +19,10 @@
                     </div>
                 </div>
             </div>
+            <div class="ml-auto" style="display: none;">
+                <div class="d-inline-block"><button class="btn btn-sm btn-primary" id="calc-all">计算</button></div>
+                <div class="d-inline-block"><button class="btn btn-sm btn-primary" id="reload-calc-base">重算基数</button></div>
+            </div>
         </div>
     </div>
     <div class="content-wrap pr-46">