Browse Source

调整签名时间初始化逻辑

TonyKang 5 years ago
parent
commit
085f9ba63f

+ 1 - 1
app/controller/report_controller.js

@@ -177,7 +177,7 @@ module.exports = app => {
             // console.log(roleRel);
             await encodeSignatureDataUri(roleRel, this.app.baseDir);
             await encodeDummySignatureDataUri(pageRst, this.app.baseDir);
-            const stageFlow = await ctx.service.stageAudit.getAuditGroupByListWithOwner(params.stage_id, params.stage_times);
+            const stageFlow = await ctx.service.stageAudit.getAuditors(params.stage_id, 1);
 
             // console.log('encodeSignatureDataUri!');
             return {

+ 11 - 8
app/public/report/js/rpt_signature.js

@@ -291,15 +291,18 @@ let rptSignatureHelper = {
                 }
             }
         }
-        if (!hasAudit) {
-            for (const stg of STAGE_LIST) {
-                if (stg.id === current_stage_id && stg.period) {
-                    const period = stg.period.split(' ~ ');
-                    if (period.length === 2) {
-                        dftDate = period[1];
-                    }
-                }
+        if (!hasAudit && STAGE_FLOW && STAGE_FLOW.length > 0 && STAGE_FLOW[0].aid === userAccId) {
+            if (STAGE_FLOW[0].begin_time && STAGE_FLOW[0].begin_time !== '' && STAGE_FLOW[0].begin_time.length > 20) {
+                dftDate = (new Date(STAGE_FLOW[0].begin_time)).Format('yyyy-MM-dd');
             }
+            // for (const stg of STAGE_LIST) {
+            //     if (stg.id === current_stage_id && stg.period) {
+            //         const period = stg.period.split(' ~ ');
+            //         if (period.length === 2) {
+            //             dftDate = period[1];
+            //         }
+            //     }
+            // }
         }
         if (dftDate !== '') {
             elementsStrArr.push('<input id="' + idSuffixStr + '" class="form-control form-control-sm mt-0" placeholder="选择签名日期" type="date" value="' + dftDate + '"');

+ 1 - 1
app/service/tender_info.js

@@ -92,7 +92,7 @@ module.exports = app => {
             const info = list[0];
             const len = info.deal_info.length;
             info.deal_info = info.deal_info.slice(0, len - 1) + ',"name":"' + info.name + '"' + info.deal_info.slice(len - 1);
-            console.log(info);
+            // console.log(info);
             for (const pi of parseInfo) {
                 info[pi] = !info[pi] || info[pi] === '' ? defaultInfo[pi] : JSON.parse(info[pi]);
                 this.ctx.helper._.defaults(info[pi], defaultInfo[pi]);