Browse Source

调用变更令,匹配部位台账调整

MaiXinRong 3 years ago
parent
commit
34cfb0995c
3 changed files with 7 additions and 5 deletions
  1. 4 2
      app/public/js/stage.js
  2. 2 2
      app/service/change.js
  3. 1 1
      app/service/ledger_audit.js

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

@@ -603,7 +603,9 @@ $(document).ready(() => {
             this.displayChanges = [];
             for (const c of this.changes) {
                 const filterVisible = filterEmpty ? (c.vamount ? !checkZero(c.vamount) : false) : true;
-                const matchVisible = matchPosName && this.callData.pos ? c.b_bwmx === this.callData.pos.name : true;
+                const matchVisible = matchPosName && this.callData.pos
+                    ? (c.gcl_id === this.callData.bills.id && c.b_bwmx === this.callData.pos.name)
+                    : true;
                 if ((filterVisible && matchVisible) || (c.org_uamount)) {
                     this.displayChanges.push(c);
                 }
@@ -3757,7 +3759,7 @@ $(document).ready(() => {
                             const changeBills = SpreadJsObj.getSelectObject(self.changeBillsSheet);
                             if (changeBills.gcl_id) {
                                 const node = stageTree.nodes.find(x => {return x.id === changeBills.gcl_id});
-                                SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id);
+                                SpreadJsObj.locateTreeNode(slSpread.getActiveSheet(), node.ledger_id, true);
                                 stagePosSpreadObj.loadCurPosData();
                             } else {
                                 const cb = {

+ 2 - 2
app/service/change.js

@@ -1141,7 +1141,7 @@ module.exports = app => {
             const sql =
                 'SELECT c.cid, c.code, c.name, c.w_code, c.p_code, c.peg, c.org_name, c.org_code, c.new_name, c.new_code,' +
                 '    c.content, c.basis, c.memo, c.type, c.class, c.quality, c.company, c.charge, ' +
-                '    cb.id As cbid, cb.code As b_code, cb.name As b_name, cb.unit As b_unit, cb.samount As b_amount, cb.detail As b_detail, cb.bwmx As b_bwmx, ' +
+                '    cb.id As cbid, cb.code As b_code, cb.name As b_name, cb.unit As b_unit, cb.samount As b_amount, cb.detail As b_detail, cb.bwmx As b_bwmx, cb.gcl_id, ' +
                 '    scb.used_amount' +
                 '  FROM ' + this.tableName + ' As c ' +
                 '  Left Join ' + this.ctx.service.changeAuditList.tableName + ' As cb On c.cid = cb.cid ' +
@@ -1189,7 +1189,7 @@ module.exports = app => {
             const sql =
                 'SELECT c.cid, c.code, c.name, c.w_code, c.p_code, c.peg, c.org_name, c.org_code, c.new_name, c.new_code,' +
                 '    c.content, c.basis, c.memo, c.type, c.class, c.quality, c.company, c.charge, ' +
-                '    cb.id As cbid, cb.code As b_code, cb.name As b_name, cb.unit As b_unit, cb.samount As b_amount, cb.detail As b_detail, cb.bwmx As b_bwmx, ' +
+                '    cb.id As cbid, cb.code As b_code, cb.name As b_name, cb.unit As b_unit, cb.samount As b_amount, cb.detail As b_detail, cb.bwmx As b_bwmx, cb.gcl_id, ' +
                 '    scb.used_amount' +
                 '  FROM ' + this.tableName + ' As c ' +
                 '  Left Join ' + this.ctx.service.changeAuditList.tableName + ' As cb On c.cid = cb.cid ' +

+ 1 - 1
app/service/ledger_audit.js

@@ -255,7 +255,7 @@ module.exports = app => {
             await this.ctx.app.hisOss.put(this.ctx.app.config.hisOssPath + billsHis, Buffer.from(JSON.stringify(bills), 'utf8'));
 
             const posHis = `${this.ctx.session.sessionProject.id}/${this.ctx.tender.id}/pos${timestamp}.json`;
-            const pos = await this.ctx.service.pos.getData(this.ctx.tender.id);
+            const pos = await this.ctx.service.pos.getAllDataByCondition({tid: this.ctx.tender.id});
             await this.ctx.app.hisOss.put(this.ctx.app.config.hisOssPath + posHis, Buffer.from(JSON.stringify(pos), 'utf8'));
 
             return [billsHis, posHis];