Browse Source

变更和首页推送bug修复

laiguoran 6 years ago
parent
commit
6cde7cdd8b
3 changed files with 12 additions and 9 deletions
  1. 8 5
      app/public/js/change_set.js
  2. 1 1
      app/view/change/info_modal.ejs
  3. 3 3
      app/view/dashboard/index.ejs

+ 8 - 5
app/public/js/change_set.js

@@ -19,12 +19,13 @@ $(document).ready(() => {
     let list_index = 1;
     for (const gcl of gclGatherData) {
         const quantity = gcl.quantity !== undefined ? gcl.quantity : 0;
+        const unit_price = gcl.unit_price !== null && gcl.unit_price !== undefined ? gcl.unit_price : 0;
         listHtml += '<tr data-lid="' + list_index + '" data-gcl="' + (list_index-1) + '" data-index="' + list_index + '" data-detail="">' +
             '<td>' + list_index + '</td>' +
             '<td>' + gcl.b_code + '</td>' +
             '<td>' + gcl.name + '</td>' +
             '<td>' + gcl.unit + '</td>' +
-            '<td>' + roundnum(gcl.unit_price, totalPriceUnit) + '</td>' +
+            '<td>' + roundnum(unit_price, totalPriceUnit) + '</td>' +
             '<td>' + roundnum(quantity, findDecimal(gcl.unit)) + '</td>' +
             // '<td>' + roundnum(parseFloat(gcl.unit_price).mul(parseFloat(gcl.quantity)), totalPriceUnit) + '</td>' +
             '</tr>';
@@ -33,12 +34,13 @@ $(document).ready(() => {
     // 再加载签约清单
     for (const db of dealBillList) {
         const quantity = db.quantity !== undefined ? db.quantity : 0;
+        const unit_price = db.unit_price !== null && db.unit_price !== undefined ? db.unit_price : 0;
         listHtml += '<tr data-lid="' + db.id + '" data-index="' + list_index + '" data-detail="">' +
             '<td>' + list_index + '</td>' +
             '<td>' + db.code + '</td>' +
             '<td>' + db.name + '</td>' +
             '<td>' + db.unit + '</td>' +
-            '<td>' + roundnum(db.unit_price, totalPriceUnit) + '</td>' +
+            '<td>' + roundnum(unit_price, totalPriceUnit) + '</td>' +
             '<td>' + roundnum(quantity, findDecimal(db.unit)) + '</td>' +
             // '<td>' + roundnum(parseFloat(db.unit_price).mul(parseFloat(db.quantity)), totalPriceUnit) + '</td>' +
             '</tr>';
@@ -256,10 +258,10 @@ $(document).ready(() => {
         const isCheck = $(this).hasClass('table-success') ? true : false;
         const data_detail = $(this).attr('data-detail').split('$#$');
         const isDeal = $(this).data('gcl') !== undefined ? true : false;
-        let codeHtml = '<tr quantity="0"><td colspan="3">自行编辑变更详情</td><td><input type="checkbox"></td></tr>';
+        let codeHtml = '<tr quantity="0"><td colspan="4">自行编辑变更详情</td><td><input type="checkbox"></td></tr>';
         if (isDeal) {
             const gcl = gclGatherData[$(this).data('gcl')];
-            codeHtml = '<tr quantity="0"><td colspan="3">自行编辑变更详情</td><td><input type="checkbox" ';
+            codeHtml = '<tr quantity="0"><td colspan="4">自行编辑变更详情</td><td><input type="checkbox" ';
             // 判断自行编辑变更详情是否已选中
             codeHtml += data_detail.indexOf('0;0') !== -1 && isCheck ? 'checked' : '';
             codeHtml += '></td></tr>';
@@ -270,11 +272,12 @@ $(document).ready(() => {
                 codeHtml += '<tr quantity="' + quantity + '"><td>' + leaf.code + '</td>' +
                     '<td>' + leaf.jldy + '</td>' +
                     '<td>' + bwmx + '</td>' +
+                    '<td>' + roundnum(quantity, findDecimal(gcl.unit)) + '</td>' +
                     '<td><input type="checkbox"' + isChecked +
                     '></td></tr>';
             }
         } else if (!isDeal && isCheck) {
-            codeHtml = '<tr quantity="0"><td colspan="3">自行编辑变更详情</td><td><input type="checkbox" checked></td></tr>';
+            codeHtml = '<tr quantity="0"><td colspan="4">自行编辑变更详情</td><td><input type="checkbox" checked></td></tr>';
         }
         $('#code-list').attr('data-index', $(this).children('td').eq(0).text());
         $('#code-list').html(codeHtml);

+ 1 - 1
app/view/change/info_modal.ejs

@@ -118,7 +118,7 @@
                         <div style="height:400px;overflow-y:auto">
                             <table class="table table-sm table-bordered">
                                 <thead>
-                                <tr><th>项目节编号</th><th>名称</th><th>部位明细</th><th>选择</th></tr>
+                                <tr><th>项目节编号</th><th>名称</th><th>部位明细</th><th>部位数量</th><th>选择</th></tr>
                                 </thead>
                                 <tbody id="code-list" data-index="">
                                 </tbody>

+ 3 - 3
app/view/dashboard/index.ejs

@@ -47,9 +47,9 @@
                             <% } %>
                             需要您
                             <a href="/tender/<%- change.tid %>/change/<%- change.cid %>/info">
-                                <% if (change.status === acChange.status.checking) { %>
+                                <% if (change.cstatus === acChange.status.checking) { %>
                                 审批
-                                <% } else if (change.sstatus === acChange.status.backnew && ctx.session.sessionUser.accountId !== change.cuid) { %>
+                                <% } else if (change.cstatus === acChange.status.backnew && ctx.session.sessionUser.accountId !== change.user_id) { %>
                                 重新审批
                                 <% } else { %>
                                 重新上报
@@ -67,4 +67,4 @@
         <div class="c-body">
         </div>
     </div>
-</div>
+</div>