Explorar o código

签名日期调整

TonyKang %!s(int64=5) %!d(string=hai) anos
pai
achega
e9988d0c55
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      app/public/report/js/rpt_signature.js

+ 12 - 0
app/public/report/js/rpt_signature.js

@@ -278,9 +278,11 @@ let rptSignatureHelper = {
         // 日期控件存在页面高度不过高无法选中bug,先不用
         // elementsStrArr.push('<input id="' + idSuffixStr + '" class="datepicker-here form-control form-control-sm mt-0" placeholder="选择签名日期" data-language="zh" data-position="right bottom" type="text" readonly="true"');
         let dftDate = '';
+        let hasAudit = false;
         if (STAGE_AUDIT && STAGE_AUDIT.length > 0) {
             for (const stga of STAGE_AUDIT) {
                 if (stga.aid === userAccId) {
+                    hasAudit = true;
                     if (stga.end_time && stga.end_time !== '' && stga.end_time.length > 20) {
                         // let dt = new Date(stga.end_time);
                         dftDate = (new Date(stga.end_time)).Format('yyyy-MM-dd');
@@ -289,6 +291,16 @@ 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 (dftDate !== '') {
             elementsStrArr.push('<input id="' + idSuffixStr + '" class="form-control form-control-sm mt-0" placeholder="选择签名日期" type="date" value="' + dftDate + '"');
         } else {