Explorar o código

支付审批报表调整

Tony Kang hai 1 ano
pai
achega
0f8ffcfa63
Modificáronse 2 ficheiros con 24 adicións e 5 borrados
  1. 15 5
      app/controller/report_controller.js
  2. 9 0
      app/service/payment_detail.js

+ 15 - 5
app/controller/report_controller.js

@@ -333,7 +333,7 @@ module.exports = app => {
                 await this._getStageAuditViewData(ctx);
                 const pageShow = ctx.session.sessionProject.page_show;
                 pageShow.showArchive = 1;
-                pageShow.closeWatermark = 1;
+                // pageShow.closeWatermark = 1;
                 pageShow.showArchive = 0;
                 const tenderId = ctx.params.id;
                 const paymentDetail_id = ctx.params.did;
@@ -385,10 +385,20 @@ module.exports = app => {
                 const materialList = await ctx.service.material.getValidMaterials();
 
                 const stage_id = -100;
-                const stage_order = -1;
-                const sorder = -1;
-                const stage_times = -1;
-                const stage_status = -1;
+                let stage_order = -1;
+                let sorder = -1;
+                let stage_times = -1;
+                let stage_status = -1;
+
+                const paymentDetailList = await ctx.service.paymentDetail.getDetail(paymentDetail_id);
+                if (paymentDetailList && paymentDetailList.length > 0) {
+                    const payment = paymentDetailList[0];
+                    stage_status = payment.status;
+                    stage_order = payment.order;
+                    sorder = stage_order;
+                    stage_times = payment.times;
+                    stageList.push({ user_id: payment.uid, status: payment.status });
+                }
 
                 for (const prjAcc of prjAccList) {
                     prjAcc.account_group = accountGroup[prjAcc.account_group];

+ 9 - 0
app/service/payment_detail.js

@@ -34,6 +34,15 @@ module.exports = app => {
             return details;
         }
 
+        async getDetail(id) {
+            const details = await this.db.select(this.tableName, {
+                column: ['id', 'in_time', 'tr_id', 'uid', 'status', 'order', 'times', 'code', 's_time'],
+                where: { id },
+                orders: [['order', 'desc']],
+            });
+            return details;
+        }
+
         async hadDetail(trId) {
             const result = await this.count({ tr_id: trId });
             return result !== 0;