Explorar o código

导入计量数据相关

MaiXinRong hai 7 meses
pai
achega
4e40d41d8c

+ 6 - 0
app/public/js/measure_compare.js

@@ -500,4 +500,10 @@ $(document).ready(() => {
         gclSpread.refresh();
         leafXmjSpread.refresh();
     });
+    $('#select-qi-all').click(function() {
+        const check = this.checked;
+        $('input', 'tr[stage-id]').each((i, x) => {
+            x.checked = check;
+        })
+    });
 });

+ 4 - 2
app/service/stage_bills.js

@@ -563,8 +563,10 @@ module.exports = app => {
                 const his = await this.ctx.service.sumLoadHistory.saveStageHistory(this.ctx.tender.id, this.ctx.stage.id, lid, tenders, result.errors, cover);
                 if (updateStageBills.length > 0) await conn.updateRows(this.tableName, updateStageBills);
                 if (insertStageBills.length > 0) await conn.insert(this.tableName, insertStageBills);
-                await conn.delete(this.ctx.service.stageImportChange.tableName, { import_lid: lid, sid: this.ctx.stage.id });
-                if (result.qc_detail.length > 0) await conn.insert(this.ctx.service.stageImportChange.tableName, result.qc_detail);
+                if (loadChange) {
+                    await conn.delete(this.ctx.service.stageImportChange.tableName, { import_lid: lid, sid: this.ctx.stage.id });
+                    if (result.qc_detail.length > 0) await conn.insert(this.ctx.service.stageImportChange.tableName, result.qc_detail);
+                }
                 await conn.commit();
                 return { curStageData: result.update, sumLoadHis: his };
             } catch (err) {

+ 6 - 2
app/view/measure/compare_modal.ejs

@@ -5,8 +5,8 @@
             <div class="modal-header">
                 <h5 class="modal-title">选择参与比较的期</h5>
             </div>
-            <div class="modal-body">
-                <table class="table table-sm">
+            <div class="modal-body scroll-y" style="height: 600px">
+                <table class="table table-sm" >
                     <tr><th>期</th><th width="90">选择</th></tr>
                     <% for (const s of stages) { %>
                     <tr stage-id="<%- s.id %>"><td><%- s.order %>期</td><td><input type="checkbox"></td></tr>
@@ -14,6 +14,10 @@
                 </table>
             </div>
             <div class="modal-footer">
+                <div class="form-check form-check-inline">
+                    <input class="form-check-input" type="checkbox" id="select-qi-all">
+                    <label class="form-check-label" for="select-qi-all">全选</label>
+                </div>
                 <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
                 <button type="button" class="btn btn-primary btn-sm" id="select-qi-ok">确认</button>
             </div>

+ 1 - 1
app/view/shares/batch_import_modal.ejs

@@ -20,7 +20,7 @@
                                 <label class="form-check-label" for="bi-ignore">以本标段清单为准</label>
                             </div>
                             <div class="form-check form-check-inline">
-                                <input class="form-check-input" type="checkbox" id="bi-change">
+                                <input class="form-check-input" type="checkbox" id="bi-change" checked>
                                 <label class="form-check-label" for="bi-change">含变更</label>
                             </div>
                         </div>