Explorar el Código

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang hace 1 año
padre
commit
897c59ab2f

+ 1 - 1
app/controller/payment_controller.js

@@ -417,7 +417,7 @@ module.exports = app => {
                 }
                 const auditIdList = ctx.helper._.map(ctx.detail.auditors, 'aid');
                 const rptAuditIdList = ctx.helper._.map(ctx.detail.rptAudits, 'uid');
-                const uidList = ctx.helper._.uniq([...auditIdList, ...rptAuditIdList]);
+                const uidList = ctx.helper._.uniq([ctx.detail.uid, ...auditIdList, ...rptAuditIdList]);
 
                 // 获取附件列表
                 const attList = await ctx.service.paymentDetailAtt.getPaymentDetailAttachment(ctx.detail.id, 'desc');

+ 17 - 21
app/lib/ledger.js

@@ -971,30 +971,26 @@ class checkData {
         //     }
         // }
         if (isTz && posRange.length > 0) {
-            if (posRange.length > 0) {
-                for (const p of posRange) {
-                    const end_contract_qty = this.ctx.helper.add(p.pre_contract_qty, p.contract_qty);
-                    if (!p.quantity && !!end_contract_qty) return true;
-                    if (p.quantity > 0) {
-                        if (end_contract_qty > p.final_1_qty) return true;
-                    } else {
-                        if (end_contract_qty < p.final_1_qty || end_contract_qty > 0) return true;
-                    }
+            for (const p of posRange) {
+                const end_contract_qty = this.ctx.helper.add(p.pre_contract_qty, p.contract_qty);
+                if (!p.quantity && !!end_contract_qty) return true;
+                if (p.quantity > 0) {
+                    if (end_contract_qty > p.final_1_qty) return true;
+                } else {
+                    if (end_contract_qty < p.final_1_qty || end_contract_qty > 0) return true;
                 }
-                return false;
             }
+        }
+        const end_contract_qty = this.ctx.helper.add(bills.contract_qty, bills.pre_contract_qty);
+        const end_contract_tp = this.ctx.helper.add(bills.contract_tp, bills.pre_contract_tp);
+        if (bills.is_tp) {
+            const compare_tp = isTz ? bills.total_price : bills.deal_tp;
+            if (!compare_tp) return !!end_contract_tp;
+            return compare_tp >= 0 ? end_contract_tp > compare_tp : end_contract_tp < compare_tp || end_contract_tp > 0;
         } else {
-            const end_contract_qty = this.ctx.helper.add(bills.contract_qty, bills.pre_contract_qty);
-            const end_contract_tp = this.ctx.helper.add(bills.contract_tp, bills.pre_contract_tp);
-            if (bills.is_tp) {
-                const compare_tp = isTz ? bills.total_price : bills.deal_tp;
-                if (!compare_tp) return !!end_contract_tp;
-                return compare_tp >= 0 ? end_contract_tp > compare_tp : end_contract_tp < compare_tp || end_contract_tp > 0;
-            } else {
-                const compare_qty = isTz ? bills.final_1_qty : bills.deal_final_1_qty;
-                if (!compare_qty) return !!end_contract_qty;
-                return compare_qty >= 0 ? end_contract_qty > compare_qty : end_contract_qty < compare_qty || end_contract_qty > 0;
-            }
+            const compare_qty = isTz ? bills.final_1_qty : bills.deal_final_1_qty;
+            if (!compare_qty) return !!end_contract_qty;
+            return compare_qty >= 0 ? end_contract_qty > compare_qty : end_contract_qty < compare_qty || end_contract_qty > 0;
         }
     }
     checkOverRange() {

+ 5 - 5
app/public/js/file_detail.js

@@ -116,7 +116,7 @@ $(document).ready(function() {
             if (!filingObj.curFiling) return;
 
             filingObj.curTotalPage = Math.ceil(filingObj.curFiling.source_node.file_count / this.pageCount);
-            filingObj.curPage = Math.min(filingObj.curTotalPage, filingObj.curPage);
+            filingObj.curPage = Math.min(filingObj.curTotalPage, Math.max(filingObj.curPage, 1));
             $('#curPage').html(filingObj.curPage);
             $('#curTotalPage').html(filingObj.curTotalPage);
             if (filingObj.curTotalPage > 1) {
@@ -199,7 +199,7 @@ $(document).ready(function() {
             filingObj.filingTree.updateNode(filing);
             let parent = filing.getParentNode();
             while (!!parent) {
-                parent.source_node.total_file_count = parent.source_node.total_file_count + differ;
+                parent.source_node.total_file_count = parent.source_node.total_file_count ? parent.source_node.total_file_count + differ : differ;
                 parent.name = parent.source_node.name + (parent.source_node.total_file_count > 0 ? `(${parent.source_node.total_file_count})` : '');
                 filingObj.filingTree.updateNode(parent);
                 parent = parent.getParentNode();
@@ -228,8 +228,8 @@ $(document).ready(function() {
             postDataWithFile('file/upload', formData, function (data) {
                 filingObj.curFiling.source_node.files.unshift(...data.files);
                 filingObj.updateFilingFileCount(filingObj.curFiling, data.filing.file_count);
-                filingObj.refreshFilesTable();
                 filingObj.refreshPages();
+                filingObj.refreshFilesTable();
                 if (callback) callback();
             });
         }
@@ -248,8 +248,8 @@ $(document).ready(function() {
                 function(result) {
                     filingObj.curFiling.source_node.files.unshift(...result.files);
                     filingObj.updateFilingFileCount(filingObj.curFiling, result.filing.file_count);
-                    filingObj.refreshFilesTable();
                     filingObj.refreshPages();
+                    filingObj.refreshFilesTable();
                     if (callback) callback();
             });
 
@@ -999,7 +999,7 @@ $(document).ready(function() {
                 selectFiling.each((i, x) => { selectFilingId.push(x.value); });
                 self.syncFiling(self.curFiling, selectFilingId);
                 toastr.success('同步成功');
-                $('[name=cbft]').each((i, x) => { x.checked = false; });
+                $('[name=cbft]').removeAttr('checked');
                 $('#filing-select-all')[0].checked = false;
             });
             $('#batch-del-filing').click(() => {

+ 2 - 2
app/public/js/payment_safe.js

@@ -649,8 +649,8 @@ $(document).ready(function() {
             const html = [];
             if (curNode) {
                 const attIndex = this.billsIndexes[curNode.safe_id] || [];
-                const beginIndex = (this.allPageIndex - 1) * this.pageCount;
-                const endIndex = (this.allPageIndex) * this.pageCount - 1;
+                const beginIndex = (this.curPageIndex - 1) * this.pageCount;
+                const endIndex = (this.curPageIndex) * this.pageCount - 1;
                 for (const [i, ai] of attIndex.entries()) {
                     if (i < beginIndex) continue;
                     if (i > endIndex) continue;

+ 1 - 1
app/service/report_memory.js

@@ -1536,7 +1536,7 @@ module.exports = app => {
                 }
                 return sum;
             };
-            sortSumChildren(root, result, ['ContractPrice', 'ContractReturned', 'ContractPaid']);
+            sortSumChildren(root, result, ['ContractPrice', 'ContractReturned', 'ContractsPaid']);
             result.forEach(x => { delete x.children });
             return result;
         }

+ 0 - 2
app/view/file/file.ejs

@@ -35,9 +35,7 @@
                     <div class="d-flex flex-row">
                         <% if (canUpload) { %>
                         <div class="py-2 pr-2"><a href="#add-file" data-toggle="modal" data-target="#add-file">上传文件</a></div>
-                        <% if (ctx.app.config.is_debug) { %>
                         <div class="py-2 pr-2"><a href="#add-big-file" data-toggle="modal" data-target="#add-big-file">大文件上传</a></div>
-                        <% } %>
                         <div class="p-2" id="rela-file-btn"><a href="#rela-file" data-toggle="modal" data-target="#rela-file">导入文件</a></div>
                         <div class="p-2"><a href="javascript: void(0)" id="batch-del-file-btn">批量删除</a></div>
                         <% } %>