laiguoran 5 лет назад
Родитель
Сommit
f246d6e4d7
3 измененных файлов с 8 добавлено и 5 удалено
  1. 4 2
      app/public/js/change_set.js
  2. 3 3
      app/service/change_audit.js
  3. 1 0
      app/view/wap/shenpi_change.ejs

+ 4 - 2
app/public/js/change_set.js

@@ -374,11 +374,13 @@ $(document).ready(() => {
         const isDeal = $(this).data('gcl') !== undefined ? true : false;
         let codeHtml = '<tr quantity="'+ $(this).children('td').eq(5).text() +'"><td colspan="4" class="colspan_1">&nbsp;</td><td class="colspan_2"><input type="checkbox"></td></tr>';
         if (isDeal) {
-            // const gcl = gclGatherData[$(this).data('gcl')];
             const lid = $(this).data('lid');
-            const gcl = _.find(gclGatherData, function (item) {
+            let gcl = _.find(gclGatherData, function (item) {
                 return item.leafXmjs && item.leafXmjs[0].gcl_id === lid;
             });
+            if (!gcl) {
+                gcl = gclGatherData[$(this).data('gcl')];
+            }
             codeHtml = '';
             for (const leaf of gcl.leafXmjs) {
                 const quantity = leaf.quantity !== undefined && leaf.quantity !== null ? leaf.quantity : 0;

+ 3 - 3
app/service/change_audit.js

@@ -206,9 +206,9 @@ module.exports = app => {
          * @return {object} 返回结果
          */
         async getListGroupByTimes(cid, times) {
-            const sql = 'SELECT * FROM ?? WHERE ' +
-                'cid = ? AND times = ? GROUP BY usite';
-            const sqlParam = [this.tableName, cid, times];
+            const sql = 'SELECT * FROM ?? where id in (SELECT MAX(id) FROM ?? WHERE ' +
+                'cid = ? AND times = ? GROUP BY usite)';
+            const sqlParam = [this.tableName, this.tableName, cid, times];
             const list = await this.db.query(sql, sqlParam);
             return list;
         }

+ 1 - 0
app/view/wap/shenpi_change.ejs

@@ -275,6 +275,7 @@
                         <div class="custom-control custom-radio custom-control-inline">
                             <input class="custom-control-input" type="radio" name="status" id="change-backnew" value="<%- auditConst.auditStatus.backnew %>" checked>
                             <label class="custom-control-label" for="change-backnew">退回上一审批人 <%- auditGroupList[checkingAudit.usite-1].name %></label>
+                            <input type="hidden" name="audit_last_id" value="<%= auditGroupList[checkingAudit.usite-1].id %>">
                         </div>
                     <% } %>
                 </div>