فهرست منبع

甘肃档案接口,同步台账

MaiXinRong 2 سال پیش
والد
کامیت
07956e418f
5فایلهای تغییر یافته به همراه22 افزوده شده و 0 حذف شده
  1. 2 0
      app/controller/ledger_controller.js
  2. 10 0
      app/public/js/ledger.js
  3. 6 0
      app/view/ledger/explode.ejs
  4. 2 0
      config/config.local.js
  5. 2 0
      config/config.qa.js

+ 2 - 0
app/controller/ledger_controller.js

@@ -130,6 +130,7 @@ module.exports = app => {
 
                 const whiteList = this.ctx.app.config.multipart.whitelist;
                 const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
+                const syncLedger = await this.ctx.service.specPull.syncLedger(this.ctx.session.sessionProject.id);
                 const renderData = {
                     tender: tender.data,
                     tenderInfo: tender.info,
@@ -151,6 +152,7 @@ module.exports = app => {
                     dealBillsPermission: this._canUpdateDealBills(tender.data, auditors.filter(x => {return x.audit_order > 0})),
                     shenpiConst,
                     categoryData,
+                    syncLedgerUrl: syncLedger ? `${ctx.app.config.url3f}/${syncLedger.pull_class}/sync-tz/${tender.id}` : '',
                 };
                 if ((tender.data.ledger_status === auditConst.status.uncheck || tender.data.ledger_status === auditConst.status.checkNo) && tender.data.user_id === ctx.session.sessionUser.accountId) {
                     // renderData.accountGroup = accountGroup;

+ 10 - 0
app/public/js/ledger.js

@@ -3487,6 +3487,16 @@ $(document).ready(function() {
 
         SpreadExcelObj.exportSimpleXlsxSheet(setting, data, "台账分解.xlsx");
     });
+    $('#sync-ledger').click(function () {
+        postData(syncLedgerUrl, {}, function (result) {
+            ledgerTree.loadDatas(result.bills);
+            treeCalc.calculateAll(ledgerTree);
+            SpreadJsObj.loadSheetData(ledgerSpread.getActiveSheet(), 'tree', ledgerTree);
+            pos.loadDatas(result.pos);
+            posOperationObj.loadCurPosData();
+            checkShowLast(result.bills.length);
+        });
+    });
 
     const dataChecker = DataChecker({
         checkUrl: window.location.pathname + '/check',

+ 6 - 0
app/view/ledger/explode.ejs

@@ -42,6 +42,11 @@
                 <div class="d-inline-block ml-3">
                     <a id="exportLedger" class="btn btn-primary btn-sm" href="javascript: void(0)">导出台账Excel</a>
                 </div>
+                <% if (syncLedgerUrl) { %>
+                <div class="d-inline-block ml-1">
+                    <a id="sync-ledger" class="btn btn-primary btn-sm" href="javascript: void(0)">同步台账</a>
+                </div>
+                <% } %>
             </div>
             <div class="ml-auto">
                 <a class="btn btn-sm btn-primary mr-1" id="ledger-check2" href="javascript: void(0);">数据检查</a>
@@ -348,6 +353,7 @@
             $('.modal-title').text('重新上报')
         }
     });
+    const syncLedgerUrl = '<%- syncLedgerUrl %>';
 </script>
 <% if ((tender.ledger_status === auditConst.status.uncheck || tender.ledger_status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === tender.user_id) { %>
 <script>

+ 2 - 0
config/config.local.js

@@ -124,5 +124,7 @@ module.exports = appInfo => {
     // 项目管理跳转路径
     config.managementPath = 'http://localhost:3000';
     config.managementProxyPath = 'http://192.168.1.76:2020';
+
+    config.url3f = 'http://127.0.0.1:7007';
     return config;
 };

+ 2 - 0
config/config.qa.js

@@ -86,5 +86,7 @@ module.exports = appInfo => {
     // 项目管理跳转路径
     config.managementPath = 'http://pmqa.smartcost.com.cn';
     config.managementProxyPath = 'http://192.168.1.76:2020';
+
+    config.url3f = 'http://jlqa.smartcost.com.cn:7007';
     return config;
 };