瀏覽代碼

style: 预付款数据、ui调整

lanjianrong 4 年之前
父節點
當前提交
6a3944314a
共有 3 個文件被更改,包括 38 次插入30 次删除
  1. 18 18
      app/view/advance/detail.ejs
  2. 12 3
      app/view/advance/index.ejs
  3. 8 9
      app/view/material/audit_modal.ejs

+ 18 - 18
app/view/advance/detail.ejs

@@ -30,51 +30,51 @@
                         <tbody id="pay-content">
                             <% if(isEdited && ctx.session.sessionUser.accountId === ctx.advance.uid) { %>
                             <tr>
-                                <th width="150">支付比例</th>
-                                <td class="text-right">
+                                <th width="150" class="text-center">支付比例</th>
+                                <td class="text-right" width="405">
                                     <div class="input-group input-group-sm">
                                         <input type="number" class="pay-input form-control nospin text-right"
                                             max="<%- max_pr %>" min="1" placeholder="请填写支付比例,将自动计算本期金额" data-type="0"
-                                            value="<%- advance.cur_amount && ctx.helper.mul(ctx.helper.div(advance.cur_amount, advancePayTotal), 100, 2) || 0 %>">
+                                            value="<%- advance.status === auditConst.status.uncheck || advance.status === auditConst.status.checkNo ? advance.pay_ratio : (advance.cur_amount && ctx.helper.mul(ctx.helper.div(advance.cur_amount, advancePayTotal), 100, 2) || 0) %>">
                                         <div class="input-group-append"><span class="input-group-text">%</span></div>
                                     </div>
                                 </td>
-                                <th width="150">本期金额</th>
-                                <td class="text-right">
+                                <th width="150" class="text-center">本期金额</th>
+                                <td class="text-right" width="405">
                                     <div class="input-group input-group-sm">
                                         <input type="number" class="pay-input form-control nospin text-right" min="1"
                                             placeholder="请填写本期金额,将自动计算支付比例" data-type="1"
-                                            value="<%- advance.cur_amount && advance.cur_amount.toFixed(decimal) %>">
+                                            value="<%- advance.status === auditConst.status.uncheck || advance.status === auditConst.status.checkNo ? ctx.helper.mul(advancePayTotal, ctx.helper.div(advance.pay_ratio, 100, decimal), decimal) : (advance.cur_amount && advance.cur_amount.toFixed(decimal)) %>">
                                         <div class="input-group-append"><span class="input-group-text">元</span></div>
                                     </div>
                                 </td>
                             </tr>
                             <% } else {%>
                             <tr>
-                                <th width="150">支付比例</th>
-                                <td class="text-right">
+                                <th width="150" class="text-center">支付比例</th>
+                                <td class="text-right" width="405">
                                     <%- advance.cur_amount && ctx.helper.mul(ctx.helper.div(advance.cur_amount, advancePayTotal), 100, 2) || 0 %>%
                                 </td>
-                                <th width="150">本期金额</th>
-                                <td class="text-right">
+                                <th width="150" class="text-center">本期金额</th>
+                                <td class="text-right" width="405">
                                     <%- ctx.helper.formatMoney((advance.cur_amount || 0), ',', decimal) %>
                                 </td>
                             </tr>
                             <% } %>
                             <tr>
-                                <th>截止上期</th>
-                                <td class="text-right" id="p_total1">
-                                    <%- ctx.helper.formatMoney((prevAdvance && prevAdvance.prev_total_amount || 0), ',', decimal) %>
+                                <th class="text-center">截止上期</th>
+                                <td class="text-right" id="p_total1" width="405">
+                                    <%- ctx.helper.formatMoney((prevAdvance && prevAdvance.prev_total_amount || 0), ',', decimal) %>
                                 </td>
-                                <th>截止本期金额</th>
-                                <td class="text-right" id="p_total2">
-                                    <%- ctx.helper.formatMoney((prevAdvance && prevAdvance.prev_total_amount + advance.cur_amount || (advance.cur_amount || 0)), ',', decimal) %>
+                                <th class="text-center">截止本期金额</th>
+                                <td class="text-right" id="p_total2" width="405">
+                                    <%- ctx.helper.formatMoney((prevAdvance && prevAdvance.prev_total_amount + advance.cur_amount || (advance.cur_amount || 0)), ',', decimal) %>
                                 </td>
                             </tr>
                             <tr>
-                                <th>备注</th>
+                                <th class="text-center" >备注</th>
                                 <td colspan="3">
-                                    <textarea id="ad-remark" class="form-control form-control-sm"
+                                    <textarea id="ad-remark" class="form-control form-control-sm" rows="2"
                                         <%- isEdited && ctx.session.sessionUser.accountId === ctx.advance.uid ? '' : 'disabled' %>></textarea>
                                 </td>
                             </tr>

+ 12 - 3
app/view/advance/index.ejs

@@ -59,10 +59,19 @@
                         <% advanceList.forEach(item => { %>
                             <tr>
                                 <td><a href="/tender/<%- ctx.tender.id %>/advance/<%- item.id %>/detail" data-id="<%- item.id %>">第<%- item.order %>期</a></td>
-                                <td><%- item.cur_amount && ctx.helper.mul(ctx.helper.div(item.cur_amount, advancePayTotal), 100).toFixed(2) || 0%>%</td>
-                                <td class="text-right"><%- ctx.helper.formatMoney(item.cur_amount, ',', decimal)%></td>
+                                <% if (item.status === auditConst.status.uncheck || item.status === auditConst.status.checkNo) { %>
+                                    <td><%- item.pay_ratio %>%</td>
+                                    <td class="text-right"><%- ctx.helper.mul(advancePayTotal, ctx.helper.div(item.pay_ratio, 100, decimal), decimal)%></td>
+                                <% } else {%>
+                                    <td><%- item.cur_amount && ctx.helper.mul(ctx.helper.div(item.cur_amount, advancePayTotal), 100).toFixed(2) || 0%>%</td>
+                                    <td class="text-right"><%- ctx.helper.formatMoney(item.cur_amount, ',', decimal)%></td>
+                                <% } %>
                                 <td class="text-right"><%- ctx.helper.formatMoney(item.prev_amount, ',', decimal)%></td>
-                                <td class="text-right"><%- ctx.helper.formatMoney(item.prev_total_amount, ',', decimal)%></td>
+                                <% if (item.status === auditConst.status.uncheck || item.status === auditConst.status.checkNo) { %>
+                                    <td class="text-right"><%- ctx.helper.formatMoney(ctx.helper.add(ctx.helper.mul(advancePayTotal, ctx.helper.div(item.pay_ratio, 100, decimal), decimal), item.prev_amount), ',', decimal)%></td>
+                                <% } else {%>
+                                    <td class="text-right"><%- ctx.helper.formatMoney(item.prev_total_amount, ',', decimal)%></td>
+                                <% } %>
                                 <td><a class="btn btn-sm" href="#file" data-toggle="modal" data-target="#file" data-id="<%- item.id %>"><i
                                             class="fa fa-paperclip"></i> <%- item.fileList.length %></a></td>
                                 <td>

+ 8 - 9
app/view/material/audit_modal.ejs

@@ -103,10 +103,14 @@
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
                         <% ctx.material.auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                        <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                        <% } %>
                         <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
-                            <div class="text-center text-muted"
-                                <%- idx === ctx.material.auditHistory.length - 1 ? `id="end-target"` : "" %>>
-                                <%- idx === ctx.material.auditHistory.length - 1 ? 1 : idx+1 %>#</div>
+                            <div class="text-center text-muted"><%- idx+1 %>#</div>
                             <ul class="timeline-list list-unstyled mt-2">
                                 <% auditors.forEach((auditor, index) => { %>
                                 <% if (index === 0) { %>
@@ -227,12 +231,7 @@
                                 <% }) %>
                             </ul>
                         </div>
-                        <!-- 展开/收起历史流程 -->
-                        <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
-                            <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
-                                    data-idx="<%- idx + 1 %>">展开历史审批流程</a>
-                            </div>
-                        <% } %>
+
                         <% }) %>
                     </div>
                 </div>