Forráskód Böngészése

变更令,部位明细字段变更,调用时,也应变更字段

MaiXinRong 5 éve
szülő
commit
3817f3cded
4 módosított fájl, 11 hozzáadás és 10 törlés
  1. 1 1
      app/extend/helper.js
  2. 5 5
      app/lib/analysis_excel.js
  3. 3 2
      app/public/js/stage.js
  4. 2 2
      app/service/change.js

+ 1 - 1
app/extend/helper.js

@@ -677,7 +677,7 @@ module.exports = {
      * @returns {*}
      */
     replaceReturn(str) {
-        return str ? str.replace(/[\r\n]/g, '') : str;
+        return (str && str instanceof String) ? str.replace(/[\r\n]/g, '') : str;
     },
 
     /**

+ 5 - 5
app/lib/analysis_excel.js

@@ -273,16 +273,16 @@ class AnalysisExcelTree {
      */
     _loadXmjNode(row) {
         const node = {};
-        node.code = this.ctx.helper.replaceReturn(row[this.colsDef.code] + '');
-        node.name = this.ctx.helper.replaceReturn(row[this.colsDef.name] + '');
-        node.unit = this.ctx.helper.replaceReturn(row[this.colsDef.unit] + '');
+        node.code = this.ctx.helper.replaceReturn(row[this.colsDef.code]);
+        node.name = this.ctx.helper.replaceReturn(row[this.colsDef.name]);
+        node.unit = this.ctx.helper.replaceReturn(row[this.colsDef.unit]);
         const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, node.unit);
         node.sgfh_qty = this.ctx.helper.round(this.toNumber(row[this.colsDef.sgfh_qty]), precision.value);
         node.dgn_qty1 = this.toNumber(row[this.colsDef.dgn_qty1]);
         node.dgn_qty2 = this.toNumber(row[this.colsDef.dgn_qty2]);
         node.unit_price = this.toNumber(row[this.colsDef.unit_price]);
-        node.drawing_code = this.ctx.helper.replaceReturn(row[this.colsDef.drawing_code] + '');
-        node.memo = this.ctx.helper.replaceReturn(row[this.colsDef.memo] + '');
+        node.drawing_code = this.ctx.helper.replaceReturn(row[this.colsDef.drawing_code]);
+        node.memo = this.ctx.helper.replaceReturn(row[this.colsDef.memo]);
         // if (node.sgfh_qty && node.unit_price) {
         //     node.sgfh_tp = this.ctx.helper.round(this.ctx.helper.mul(node.sgfh_qty, node.unit_price), this.ctx.tender.info.decimal.tp);
         // } else {

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

@@ -117,12 +117,13 @@ function getNodeList(node) {
 }
 
 $(document).ready(() => {
+    // 提示窗
     toastr.options = {
         "closeButton": false,
         "debug": false,
         "newestOnTop": false,
         "progressBar": false,
-        "positionClass": "toast-top-right",
+        "positionClass": "toast-top-center",
         "preventDuplicates": false,
         "onclick": null,
         "showDuration": "300",
@@ -405,7 +406,7 @@ $(document).ready(() => {
         _filterChange(filterEmpty, matchPosName) {
             for (const c of this.changes) {
                 const filterVisible = filterEmpty ? (c.vamount ? !checkZero(c.vamount) : false) : true;
-                const matchVisible = matchPosName && this.callData.pos ? c.b_detail === this.callData.pos.name : true;
+                const matchVisible = matchPosName && this.callData.pos ? c.b_bwmx === this.callData.pos.name : true;
                 c.visible = filterVisible && matchVisible;
             }
             SpreadJsObj.refreshTreeRowVisible(this.spread.getActiveSheet());

+ 2 - 2
app/service/change.js

@@ -682,10 +682,10 @@ module.exports = app => {
          * @returns {Promise<*>} - 可用的变更令列表
          */
         async getValidChanges(tid, bills, pos) {
-            const filter = 'cb.`code` = ' + this.db.escape(bills.b_code) + (pos ? ' And cb.`detail` = ' + this.db.escape(pos.name) : '');
+            const filter = 'cb.`code` = ' + this.db.escape(bills.b_code) + (pos ? ' And cb.`bwmx` = ' + this.db.escape(pos.name) : '');
             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.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 ' +
                         '    scb.used_amount' +
                         '  FROM ' + this.tableName + ' As c ' +
                         '  Left Join ' + this.ctx.service.changeAuditList.tableName +' As cb On c.cid = cb.cid ' +