Browse Source

refactor: 时间格式化到时分秒

lanjianrong 5 năm trước cách đây
mục cha
commit
ed29acdbce
2 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 4 4
      app/public/js/measure_stage.js
  2. 2 2
      app/view/stage/audit_modal.ejs

+ 4 - 4
app/public/js/measure_stage.js

@@ -39,14 +39,14 @@ $('a[data-target="#sp-list" ]').on('click', function () {
                    righthtml.push('<h5 class="card-title">');
                    righthtml.push('<i class="fa fa-play-circle fa-rotate-90 text-success"></i> '+ stageAuditor.name +' <small class="text-muted">'+ stageAuditor.role +'</small><span class="pull-right">原报</span></h5>');
                    righthtml.push('<div class="ml-3">');
-                   righthtml.push('<span class="text-success"><small>' + (ah[iA].begin_time ? moment(ah[iA].begin_time).format('YYYY-MM-DD') : '') + '</small> '+ (auditHistory.indexOf(ah) > 0 ? '重新' : '') + '上报</span></div></li>');
+                   righthtml.push('<span class="text-success"><small>' + (ah[iA].begin_time ? moment(ah[iA].begin_time).format('YYYY-MM-DD HH:mm:ss') : '') + '</small> '+ (auditHistory.indexOf(ah) > 0 ? '重新' : '') + '上报</span></div></li>');
                    righthtml.push('<li class="list-group-item">');
                    righthtml.push('<h5 class="card-title"><i class="fa '+ (iA === ah.length - 1 ? 'fa-stop-circle ' : 'fa-chevron-circle-down ') + auditConst.statusClass[ah[iA].status] +'"></i> '+ ah[iA].name +' <small class="text-muted">'+ ah[iA].role +'</small><span class="pull-right">' + (ah[iA].sort === ah[iA].max_sort ? '终' : transFormToChinese(ah[iA].sort)) + '审</span></h5>');
                    righthtml.push('<div class="ml-3">');
                    if (ah[iA].status !== auditConst.status.uncheck) {
                        let timeHtml = '';
                        if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
-                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small> ';
+                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD HH:mm:ss') : '') +'</small> ';
                        }
                        righthtml.push('<span class="' + auditConst.statusClass[ah[iA].status] +'">'+ timeHtml + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
                    }
@@ -59,7 +59,7 @@ $('a[data-target="#sp-list" ]').on('click', function () {
                    if (ah[iA].status !== auditConst.status.uncheck) {
                        let timeHtml = '';
                        if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
-                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small> ';
+                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD HH:mm:ss') : '') +'</small> ';
                        }
                        righthtml.push('<span class="' + auditConst.statusClass[ah[iA].status] +'">' + timeHtml + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
                    }
@@ -72,7 +72,7 @@ $('a[data-target="#sp-list" ]').on('click', function () {
                    if (ah[iA].status !== auditConst.status.uncheck) {
                        let timeHtml = '';
                        if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
-                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small> ';
+                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD HH:mm:ss') : '') +'</small> ';
                        }
                        righthtml.push('<span class="' + auditConst.statusClass[ah[iA].status] +'">'+ timeHtml + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
                    }

+ 2 - 2
app/view/stage/audit_modal.ejs

@@ -340,12 +340,12 @@
                                                         <p class="card-text"><%- auditors[iA].opinion %></p>
                                                     </div>
                                                 <% } else if (auditors[iA].status == auditConst.status.checking) { %>
-                                                    <span class="pull-right">审批中</span>
+                                                    <span class="pull-right" style="line-height: 1.2;">-审批中</span>
                                                     <h5 class="card-title">
                                                         <i class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[iA].name %> <small class="text-muted"><%- auditors[iA].role %></small><span class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
                                                     </h5>
                                                     <div class="ml-3">
-                                                        <span>审批中</span>
+                                                        <!-- <span>审批中</span> -->
                                                         <p class="card-text"><%- auditors[iA].opinion %></p>
                                                     </div>
                                                 <% } else if (auditors[iA].status === auditConst.status.checkNoPre) { %>