Browse Source

修复变更批量审批bug

ellisran 10 tháng trước cách đây
mục cha
commit
6f76f2bdaf
1 tập tin đã thay đổi với 8 bổ sung5 xóa
  1. 8 5
      app/view/change/modal.ejs

+ 8 - 5
app/view/change/modal.ejs

@@ -782,10 +782,10 @@
                 for (const c of cids) {
                     const cInfo = checkingList.find(item => item.cid === c);
                     if (cInfo) {
-                        $('#batch-sp-progress .change-progress').append(`<div id="change-${cInfo.cid}-progress"><div class="mt-3 progress">` +
+                        $('#batch-sp-progress .change-progress').append(`<div class="mt-3" id="change-${cInfo.cid}-progress"><div>变更令 <a href="/tender/${cInfo.tid}/change/${cInfo.cid}/information" target="_blank"><b>${cInfo.code}</b></a> :</div><div class="progress">` +
                             '<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>' +
                             '</div>' +
-                            `<div class="mt-1">变更令 <b>${cInfo.code}</b> <span class="progress-change-text">审批处理中...</span></div></div>`);
+                            `<div class="mt-1"><span class="progress-change-text">审批处理中...</span></div></div>`);
                         await checkAndChange(cInfo, changeListData, result.changeLedgerList, 'checking');
                     }
                 }
@@ -867,8 +867,8 @@
                                 break;
                             }
                         }
-                        const info = makePushBwmx(clinfo, listinfo, removeList, updateList);
-                        if (info) break;
+                        const [info, needUpdate] = makePushBwmx(clinfo, listinfo, removeList, updateList);
+                        if (needUpdate) break;
                         if (_.findIndex(changeLedgerList, { id: clinfo.gcl_id }) !== -1) {
                             // 可能因为升降级关系:细目,分部分项等会发生变化,更新清单
                             const updateInfo = {};
@@ -903,6 +903,7 @@
                 }
                 await sleep(2000);
                 if (updateList.length > 0 || removeList.length > 0) {
+                    console.log(updateList, removeList);
                     failProgress($('#change-' + cInfo.cid + '-progress .progress-bar'), `change-${cInfo.cid}`);
                     $('#change-' + cInfo.cid + '-progress .mt-1').addClass('text-danger');
                     $('#change-' + cInfo.cid + '-progress .progress-change-text').text('清单数据发生变化,需要进入到详情页处理');
@@ -1028,6 +1029,7 @@
         }
 
         function makePushBwmx(clinfo, listinfo, removeList, updateList) {
+            let info = '';
             let needUpdate = false;
             const checkKey = ['name', 'code', 'unit', 'unit_price'];
             const checkLeafKey = ['oamount', 'bwmx', 'code', 'dwgc', 'fbgc', 'fxgc', 'jldy'];
@@ -1089,12 +1091,13 @@
                     if (needUpdate) {
                         updateList.push(oneUpdate);
                     }
+                    info = leafInfo;
                 } else {
                     removeList.push(clinfo);
                     needUpdate = true;
                 }
             }
-            return needUpdate;
+            return [info, needUpdate];
         }
 
         function findDecimal(unit) {