Browse Source

调整标准库存储

MaiXinRong 5 năm trước cách đây
mục cha
commit
15712ebd3a

+ 12 - 116
app/base/base_tree_service.js

@@ -230,7 +230,7 @@ class TreeService extends Service {
     /**
      * 新增数据(新增为selectData的后项,该方法不可单独使用)
      *
-     * @param {Number} mid - 台账id
+     * @param {Number} mid - master-id
      * @param {Object} select - 选中节点的数据
      * @param {Object} data - 新增节点的初始数据
      * @return {Object} - 新增结果
@@ -259,7 +259,7 @@ class TreeService extends Service {
 
     /**
      * 新增节点
-     * @param {Number} mid - 台账id
+     * @param {Number} mid - master id
      * @param {Number} kid - 清单节点id
      * @returns {Promise<void>}
      */
@@ -292,8 +292,8 @@ class TreeService extends Service {
 
     /**
      * 删除节点
-     * @param {Number} tenderId - 标段id
-     * @param {Object} deleteData - 删除节点数据
+     * @param {Number} mid - master id
+     * @param {Object} deleteNode - 删除节点数据
      * @return {Promise<*>}
      * @private
      */
@@ -314,10 +314,10 @@ class TreeService extends Service {
     }
 
     /**
-     *  tenderId标段中, 删除选中节点及其子节点
+     *  删除选中节点及其子节点
      *
-     * @param {Number} tenderId - 标段id
-     * @param {Number} selectId - 选中节点id
+     * @param {Number} mid - master id
+     * @param {Number} kid - 选中节点id
      * @return {Array} - 被删除的数据
      */
     async deleteNode(mid, kid) {
@@ -521,8 +521,8 @@ class TreeService extends Service {
     /**
      * 升级节点
      *
-     * @param {Number} tenderId - 标段id
-     * @param {Number} selectId - 选中节点id
+     * @param {Number} mid - master id
+     * @param {Number} kid - 选中节点id
      * @return {Array} - 发生改变的数据
      */
     async upLevelNode(mid, kid) {
@@ -612,8 +612,8 @@ class TreeService extends Service {
     /**
      * 降级节点
      *
-     * @param {Number} tenderId - 标段id
-     * @param {Number} selectId - 选中节点id
+     * @param {Number} mid - master id
+     * @param {Number} kid - 选中节点id
      * @return {Array} - 发生改变的数据
      */
     async downLevelNode(mid, kid) {
@@ -682,7 +682,7 @@ class TreeService extends Service {
 
     /**
      * 提交多条数据 - 不影响计算等未提交项
-     * @param {Number} tenderId - 标段id
+     * @param {Number} mid - master id
      * @param {Array} datas - 提交数据
      * @return {Array} - 提交后的数据
      */
@@ -711,110 +711,6 @@ class TreeService extends Service {
         const resultData = await this.getDataById(this._.map(datas, 'id'));
         return resultData;
     }
-
-    async pasteBlockRelaData(relaData) {
-        if (!this.transaction) throw '更新数据错误';
-        // for (const id of relaData) {
-        //     await this.ctx.service.pos.copyBillsPosData(id.org, id.new, this.transaction);
-        // }
-    }
-
-    async getPasteBlockResult(select, copyNodes) {
-        const createData = await this.getDataByIds(newIds);
-        const updateData = await this.getNextsData(selectData[this.setting.mid], selectData[this.setting.pid], selectData[this.setting.order] + copyNodes.length);
-        //const posData = await this.ctx.service.pos.getPosData({ lid: newIds });
-        return {
-            ledger: { create: createData, update: updateData },
-            //pos: posData,
-        };
-    }
-
-    /**
-     * 复制粘贴整块
-     * @param {Number} tenderId - 标段Id
-     * @param {Number} selectId - 选中几点Id
-     * @param {Array} block - 复制节点Id
-     * @return {Object} - 提价后的数据(其中新增粘贴数据,只返回第一层)
-     */
-    async pasteBlock(mid, kid, block) {
-        if ((mid <= 0) || (kid <= 0)) return [];
-
-        const selectData = await this.getDataByNodeId(mid, kid);
-        if (!selectData) throw '数据错误';
-
-        const copyNodes = await this.getDataByNodeIds(mid, block);
-        if (!copyNodes || copyNodes.length <= 0)  throw '复制数据错误';
-        for (const node of copyNodes) {
-            if (node[this.setting.pid] !== copyNodes[0][this.setting.pid]) throw '复制数据错误:仅可操作同层节点';
-        }
-
-        const newParentPath = selectData[this.setting.fullPath].replace(selectData[this.setting.kid], '');
-        const orgParentPath = copyNodes[0][this.setting.fullPath].replace(copyNodes[0][this.setting.kid], '');
-        const newIds = [];
-        this.transaction = await this.db.beginTransaction();
-        try {
-            // 选中节点的所有后兄弟节点,order+粘贴节点个数
-            await this._updateSelectNextsOrder(selectData, copyNodes.length);
-            for (let iNode = 0; iNode < copyNodes.length; iNode++) {
-                const node = copyNodes[iNode];
-                let datas = await this.getDataByFullPath(mid, node[this.setting.fullPath] + '%');
-                datas = this._.sortBy(datas, 'level');
-
-                const maxId = await this._getMaxLid(mid);
-                this._cacheMaxLid(mid, maxId + datas.length);
-
-                const billsId = [];
-                // 计算粘贴数据中需更新部分
-                for (let index = 0; index < datas.length; index++) {
-                    const data = datas[index];
-                    const newId = maxId + index + 1;
-                    const idChange = {
-                        org: data.id,
-                    };
-                    data.id = this.uuid.v4();
-                    idChange.new = data.id;
-                    data[this.setting.mid] = mid;
-                    if (!data[this.setting.isLeaf]) {
-                        for (const children of datas) {
-                            children[this.setting.fullPath] = children[this.setting.fullPath].replace('.' + data[this.setting.kid], '.' + newId);
-                            if (children[this.setting.pid] === data[this.setting.kid]) {
-                                children[this.setting.pid] = newId;
-                            }
-                        }
-                    } else {
-                        data[this.setting.fullPath] = data[this.setting.fullPath].replace('.' + data[this.setting.kid], '.' + newId);
-                    }
-                    data[this.setting.kid] = newId;
-                    data[this.setting.fullPath] = data[this.setting.fullPath].replace(orgParentPath, newParentPath);
-                    if (data[this.setting.pid] === node[this.setting.pid]) {
-                        data[this.setting.pid] = selectData[this.setting.pid];
-                        data[this.setting.order] = selectData[this.setting.order] + iNode + 1;
-                    }
-                    data[this.setting.level] = data[this.setting.level] + selectData[this.setting.level] - copyNodes[0][this.setting.level];
-                    idChange.isLeaf = data[this.setting.isLeaf];
-                    billsId.push(idChange);
-                    newIds.push(data.id);
-                }
-                const newData = await this.transaction.insert(this.tableName, datas);
-                await this.pasteBlockRelaData(billsId);
-            }
-            // 数据库创建新增节点数据
-            await this.transaction.commit();
-        } catch (err) {
-            await this.transaction.rollback();
-            throw err;
-        }
-
-        // 查询应返回的结果
-        const createData = await this.getDataByIds(newIds);
-        const updateData = await this.getNextsData(selectData[this.setting.mid], selectData[this.setting.pid], selectData[this.setting.order] + copyNodes.length);
-        //const posData = await this.ctx.service.pos.getPosData({ lid: newIds });
-        return {
-            ledger: { create: createData, update: updateData },
-            //pos: posData,
-        };
-    }
-
 }
 
 module.exports = TreeService;

+ 4 - 4
app/controller/ledger_controller.js

@@ -345,12 +345,12 @@ module.exports = app => {
 
                 let stdLib, addType;
                 switch (data.stdType) {
-                    case 'chapter':
-                        stdLib = ctx.service.stdChapter;
+                    case 'xmj':
+                        stdLib = ctx.service.stdXmj;
                         addType = stdDataAddType.withParent;
                         break;
-                    case 'bills':
-                        stdLib = ctx.service.stdBills;
+                    case 'gcl':
+                        stdLib = ctx.service.stdGcl;
                         const selectNode = await ctx.service.ledger.getDataByNodeId(ctx.tender.id, data.id);
                         if (selectNode.b_code) {
                             addType = stdDataAddType.next;

+ 63 - 36
app/controller/standard_lib_controller.js

@@ -9,46 +9,73 @@
  */
 
 
-const BaseController = require('../base/base_controller');
 
+module.exports = app => {
+    class StandardLibController extends app.BaseController {
+        async getData(ctx) {
+            const responseData = {
+                err: 0,
+                msg: '',
+                data: [],
+            };
+            try {
+                const data = JSON.parse(ctx.request.body.data);
+                if (isNaN(data.list_id) || data.list_id <= 0) {
+                    throw '参数错误';
+                }
+                switch (data.stdType) {
+                    case 'gcl':
+                        responseData.data = await this.ctx.service.stdGcl.getData(data.list_id);
+                        break;
+                    case 'xmj':
+                        responseData.data = await this.ctx.service.stdXmj.getData(data.list_id);
+                        break;
+                    default:
+                        throw '查询的标准清单不存在';
+                }
+            } catch (error) {
+                responseData.err = 1;
+                responseData.msg = error;
+            }
+            ctx.body = responseData;
+        }
 
-class StandardLibController extends BaseController {
-
-    /**
-     * 构造函数
-     *
-     * @param {Object} ctx - egg全局变量
-     * @param {Object} model - 标准库名称
-     * @return {void}
-     */
-    constructor(ctx, model) {
-        super(ctx);
-        this.model = model;
-        this.app = null;
-    }
-
-    async getData(ctx) {
-        const responseData = {
-            err: 0,
-            msg: '',
-            data: [],
-        };
-        try {
-            const data = JSON.parse(ctx.request.body.data);
-            if (isNaN(data.list_id) || data.list_id <= 0) {
-                throw '参数错误';
+        /**
+         * 根据id获取子项
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        async getChildren(ctx) {
+            const responseData = {
+                err: 0,
+                msg: '',
+                data: [],
+            };
+            try {
+                const data = JSON.parse(ctx.request.body.data);
+                if (isNaN(data.pid) || data.pid <= 0 || isNaN(data.list_id) || data.list_id <= 0) {
+                    throw '参数错误';
+                }
+                const condition = { pid: data.pid, list_id: data.list_id };
+                switch (data.stdType) {
+                    case 'gcl':
+                        responseData.data = await this.ctx.service.stdGcl.getAllDataByCondition({ where: condition });
+                        break;
+                    case 'xmj':
+                        responseData.data = await this.ctx.service.stdXmj.getAllDataByCondition({ where: condition });
+                        break;
+                    default:
+                        throw '查询的标准清单不存在';
+                }
+            } catch (error) {
+                responseData.err = 1;
+                responseData.msg = error;
             }
-            const libData = await this.model.getData(data.list_id);
 
-            responseData.data = libData;
-        } catch (error) {
-            responseData.err = 1;
-            responseData.msg = error;
+            ctx.body = responseData;
         }
-
-        ctx.body = responseData;
     }
 
-}
-
-module.exports = StandardLibController;
+    return StandardLibController;
+};

+ 0 - 58
app/controller/std_bills_controller.js

@@ -1,58 +0,0 @@
-'use strict';
-
-/**
- * 标准清单控制器
- *
- * @author Mai
- * @date 2018/3/13
- * @version
- */
-const StandardLibController = require('./standard_lib_controller');
-
-module.exports = app => {
-    class StdBillsController extends StandardLibController {
-
-        /**
-         * 构造函数
-         *
-         * @param {Object} ctx - egg全局变量
-         * @return {void}
-         */
-        constructor(ctx) {
-            super(ctx, ctx.service.stdBills);
-            this.app = app;
-        }
-
-        /**
-         * 根据id获取子项
-         *
-         * @param {Object} ctx - egg全局变量
-         * @return {void}
-         */
-        async getChildren(ctx) {
-            const responseData = {
-                err: 0,
-                msg: '',
-                data: [],
-            };
-            try {
-                const data = JSON.parse(ctx.request.body.data);
-                if (isNaN(data.bill_id) || data.bill_id <= 0 || isNaN(data.list_id) || data.list_id <= 0) {
-                    throw '参数错误';
-                }
-                const condition = { pid: data.bill_id, list_id: data.list_id };
-                const libData = await this.model.getAllDataByCondition({ where: condition });
-
-                responseData.data = libData;
-            } catch (error) {
-                responseData.err = 1;
-                responseData.msg = error;
-            }
-
-            ctx.body = responseData;
-        }
-
-    }
-
-    return StdBillsController;
-};

+ 0 - 58
app/controller/std_chapter_controller.js

@@ -1,58 +0,0 @@
-'use strict';
-
-/**
- * 标准清单控制器
- *
- * @author Mai
- * @date 2018/3/13
- * @version
- */
-const StandardLibController = require('./standard_lib_controller');
-
-module.exports = app => {
-    class StdChapterController extends StandardLibController {
-
-        /**
-         * 构造函数
-         *
-         * @param {Object} ctx - egg全局变量
-         * @return {void}
-         */
-        constructor(ctx) {
-            super(ctx, ctx.service.stdChapter);
-            this.app = app;
-        }
-
-        /**
-         * 根据id获取子项
-         *
-         * @param {Object} ctx - egg全局变量
-         * @return {void}
-         */
-        async getChildren(ctx) {
-            const responseData = {
-                err: 0,
-                msg: '',
-                data: [],
-            };
-            try {
-                const data = JSON.parse(ctx.request.body.data);
-                if (isNaN(data.chapter_id) || data.chapter_id <= 0 || isNaN(data.list_id) || data.list_id <= 0) {
-                    throw '参数错误';
-                }
-                const condition = { pid: data.chapter_id, list_id: data.list_id };
-                const libData = await this.model.getAllDataByCondition({ where: condition });
-
-                responseData.data = libData;
-            } catch (error) {
-                responseData.err = 1;
-                responseData.msg = error;
-            }
-
-            ctx.body = responseData;
-        }
-
-    }
-
-    return StdChapterController;
-};

+ 17 - 17
app/public/js/ledger.js

@@ -1016,7 +1016,7 @@ $(document).ready(function() {
         SpreadJsObj.forbiddenSpreadContextMenu('#pos-spread', posSpread);
     }
 
-    let stdChapter, stdBills, dealBills, searchLedger;
+    let stdXmj, stdGcl, dealBills, searchLedger;
 
     $.divResizer({
         select: '#right-spr',
@@ -1025,11 +1025,11 @@ $(document).ready(function() {
             if (posSpread) {
                 posSpread.refresh();
             }
-            if (stdChapter) {
-                stdChapter.spread.refresh();
+            if (stdXmj) {
+                stdXmj.spread.refresh();
             }
-            if (stdBills) {
-                stdBills.spread.refresh();
+            if (stdGcl) {
+                stdGcl.spread.refresh();
             }
             if (dealBills) {
                 dealBills.spread.refresh();
@@ -1074,9 +1074,9 @@ $(document).ready(function() {
             $('.tab-content .tab-pane').removeClass('active');
             tabPanel.addClass('active');
             showSideTools(tab.hasClass('active'));
-            if (tab.attr('content') === '#std-chapter') {
-                if (!stdChapter) {
-                    stdChapter = new stdLib('#std-chapter', 'chapter', {
+            if (tab.attr('content') === '#std-xmj') {
+                if (!stdXmj) {
+                    stdXmj = new stdLib('#std-xmj', 'xmj', {
                         id: 'chapter_id',
                         pid: 'pid',
                         order: 'order',
@@ -1095,12 +1095,12 @@ $(document).ready(function() {
                         headRowHeight: [40],
                         defaultRowHeight: 21,
                     });
-                    stdChapter.loadLib($('select', '#std-chapter').val());
+                    stdXmj.loadLib($('select', '#std-xmj').val());
                 }
-                stdChapter.spread.refresh();
-            } else if (tab.attr('content') === '#std-bills') {
-                if (!stdBills) {
-                    stdBills = new stdLib('#std-bills', 'bills', {
+                stdXmj.spread.refresh();
+            } else if (tab.attr('content') === '#std-gcl') {
+                if (!stdGcl) {
+                    stdGcl = new stdLib('#std-gcl', 'gcl', {
                         id: 'bill_id',
                         pid: 'pid',
                         order: 'order',
@@ -1119,9 +1119,9 @@ $(document).ready(function() {
                         headRowHeight: [40],
                         defaultRowHeight: 21,
                     });
-                    stdBills.loadLib($('select', '#std-bills').val());
+                    stdGcl.loadLib($('select', '#std-gcl').val());
                 }
-                stdBills.spread.refresh();
+                stdGcl.spread.refresh();
             } else if (tab.attr('content') === '#deal-bills') {
                 if (!dealBills) {
                     dealBills = new DealBills('#deal-bills-spread', {
@@ -1182,7 +1182,7 @@ $(document).ready(function() {
         constructor(selector, stdType, treeSetting, spreadSetting) {
             const self = this;
             this.obj = $(selector + '-spread')[0];
-            this.url = '/std/' + stdType;
+            this.stdType = stdType;
             this.treeSetting = treeSetting;
             treeSetting.preUrl = this.url;
             this.spreadSetting = spreadSetting;
@@ -1233,7 +1233,7 @@ $(document).ready(function() {
                 SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'tree', this.pathTree);
             } else {
                 const self = this;
-                postData(this.url+'/get-data', {list_id: listId}, function (data) {
+                postData('/std-lib/get-data', {stdType: this.stdType, list_id: listId}, function (data) {
                     self.cacheLib.push({id: listId, data: data});
                     self.pathTree.loadDatas(data);
                     SpreadJsObj.loadSheetData(self.spread.getActiveSheet(), 'tree', self.pathTree);

+ 16 - 16
app/public/js/revise.js

@@ -321,7 +321,7 @@ $(document).ready(() => {
         constructor(selector, stdType, treeSetting, spreadSetting) {
             const self = this;
             this.obj = $(selector + '-spread')[0];
-            this.url = '/std/' + stdType;
+            this.stdType = stdType;
             this.treeSetting = treeSetting;
             treeSetting.preUrl = this.url;
             this.spreadSetting = spreadSetting;
@@ -364,7 +364,7 @@ $(document).ready(() => {
                 SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'tree', this.pathTree);
             } else {
                 const self = this;
-                postData(this.url+'/get-data', {list_id: listId}, function (data) {
+                postData('/std-lib/get-data', {stdType: this.stdType, list_id: listId}, function (data) {
                     self.cacheLib.push({id: listId, data: data});
                     self.pathTree.loadDatas(data);
                     SpreadJsObj.loadSheetData(self.spread.getActiveSheet(), 'tree', self.pathTree);
@@ -589,7 +589,7 @@ $(document).ready(() => {
             return result;
         }
     }
-    let stdChapter, stdBills, searchLedger;
+    let stdXmj, stdGcl, searchLedger;
     const dealBills = new DealBills('#deal-bills-spread', {
         cols: [
             {title: '清单编号', field: 'code', hAlign: 0, width: 120, formatter: '@', readOnly: true},
@@ -611,11 +611,11 @@ $(document).ready(() => {
             if (posSpread) {
                 posSpread.refresh();
             }
-            if (stdChapter) {
-                stdChapter.spread.refresh();
+            if (stdXmj) {
+                stdXmj.spread.refresh();
             }
-            if (stdBills) {
-                stdBills.spread.refresh();
+            if (stdGcl) {
+                stdGcl.spread.refresh();
             }
         }
     });
@@ -654,9 +654,9 @@ $(document).ready(() => {
             $('.tab-content .tab-pane').removeClass('active');
             tabPanel.addClass('active');
             showSideTools(tab.hasClass('active'));
-            if (tab.attr('content') === '#std-chapter') {
-                if (!stdChapter) {
-                    stdChapter = new stdLib('#std-chapter', 'chapter', {
+            if (tab.attr('content') === '#std-xmj') {
+                if (!stdXmj) {
+                    stdXmj = new stdLib('#std-xmj', 'xmj', {
                         id: 'chapter_id',
                         pid: 'pid',
                         order: 'order',
@@ -675,12 +675,12 @@ $(document).ready(() => {
                         headRowHeight: [40],
                         defaultRowHeight: 21,
                     });
-                    stdChapter.loadLib($('select', '#std-chapter').val());
+                    stdXmj.loadLib($('select', '#std-xmj').val());
                 }
-                stdChapter.spread.refresh();
+                stdXmj.spread.refresh();
             } else if (tab.attr('content') === '#std-bills') {
-                if (!stdBills) {
-                    stdBills = new stdLib('#std-bills', 'bills', {
+                if (!stdGcl) {
+                    stdGcl = new stdLib('#std-gcl', 'gcl', {
                         id: 'bill_id',
                         pid: 'pid',
                         order: 'order',
@@ -699,9 +699,9 @@ $(document).ready(() => {
                         headRowHeight: [40],
                         defaultRowHeight: 21,
                     });
-                    stdBills.loadLib($('select', '#std-bills').val());
+                    stdGcl.loadLib($('select', '#std-gcl').val());
                 }
-                stdBills.spread.refresh();
+                stdGcl.spread.refresh();
             } else if (tab.attr('content') === '#deal-bills') {
                 dealBills.loadData();
                 dealBills.spread.refresh();

+ 1 - 4
app/router.js

@@ -245,10 +245,7 @@ module.exports = app => {
     // app.get('/tender/:id/stage/:order/report', sessionAuth, tenderSelect, 'stageController.stageReport');
 
     // 标准库相关
-    app.post('/std/bills/get-data', sessionAuth, 'stdBillsController.getData');
-    app.post('/std/bills/get-children', sessionAuth, 'stdBillsController.getChildren');
-    app.post('/std/chapter/get-data', sessionAuth, 'stdChapterController.getData');
-    app.post('/std/chapter/get-children', sessionAuth, 'stdChapterController.getChildren');
+    app.post('/std-lib/get-data', sessionAuth, 'standardLibController.getData');
 
     // 查询
     app.post('/search/user', sessionAuth, 'projectController.searchAccount');

+ 26 - 0
app/service/stage_bills.js

@@ -88,6 +88,32 @@ module.exports = app => {
             }
         }
 
+        async getLastestStageData2(tid, sid, lid) {
+            let lidSql = '', result;
+            if (lid) {
+                if (lid instanceof Array) {
+                    lidSql = lid.length > 0 ? ' And lid in (' + this.ctx.helper.getInArrStrSqlFilter(lid) + ')' : '';
+                } else {
+                    lidSql = ' And lid in (' + this.db.escape(lid) + ')';
+                }
+            }
+            const sql = 'SELECT Bills.* FROM ' + this.tableName + ' As Bills ' +
+                '  INNER JOIN ( ' +
+                '    SELECT MAX(`times` * ' + timesLen + ' + `order`) As `progress`, `lid`, `sid` From ' + this.tableName +
+                '      WHERE tid = ? And sid = ?' + lidSql +
+                '      GROUP BY `lid`' +
+                '  ) As MaxFilter ' +
+                '  ON (Bills.times * ' + timesLen + ' + `order`) = MaxFilter.progress And Bills.lid = MaxFilter.lid And Bills.`sid` = MaxFilter.`sid`';
+            const sqlParam = [tid, sid];
+            if (!lid) {
+                return await this.db.query(sql, sqlParam);
+            } else if (lid instanceof Array) {
+                return await this.db.query(sql, sqlParam);
+            } else {
+                return await this.db.queryOne(sql, sqlParam);
+            }
+        }
+
         /**
          * 获取截止本期数据
          * @param {Number} tid - 标段id

+ 2 - 2
app/service/std_bills.js

@@ -29,8 +29,8 @@ module.exports = app => {
                 isLeaf: 'is_leaf',
                 fullPath: 'full_path',
                 keyPre: 'revise_bills_maxLid:'
-            }, 'bill');
-            this.stdType = 'bill';
+            }, 'std_gcl');
+            this.stdType = 'gcl';
         }
     }
 

+ 2 - 2
app/service/std_chapter.js

@@ -29,8 +29,8 @@ module.exports = app => {
                 isLeaf: 'is_leaf',
                 fullPath: 'full_path',
                 keyPre: 'revise_bills_maxLid:'
-            }, 'project_chapter');
-            this.stdType = 'chapter';
+            }, 'std_xmj');
+            this.stdType = 'xmj';
         }
 
     }

+ 1 - 1
app/service/tender_node_template.js

@@ -20,7 +20,7 @@ module.exports = app => {
          */
         constructor(ctx) {
             super(ctx);
-            this.tableName = 'tender_node_template';
+            this.tableName = 'bills_template';
         }
 
         /**

+ 2 - 2
app/service/valuation.js

@@ -41,11 +41,11 @@ module.exports = app => {
             const valuation = await this.getDataById(id);
             const billsId = this._.map(valuation.bill_id.split(','), this._.toInteger);
             const chaptersId = this._.map(valuation.chapter_id.split(','), this._.toInteger);
-            const billsList = await this.db.select('zh_bill_list', {
+            const billsList = await this.db.select('zh_std_gcl_list', {
                 where: {id: billsId},
                 columns: ['id', 'name'],
             });
-            const chapterList = await this.db.select('zh_project_chapter_list', {
+            const chapterList = await this.db.select('zh_std_xmj_list', {
                 where: {id: chaptersId},
                 columns: ['id', 'name'],
             });

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

@@ -98,7 +98,7 @@
                         <!--<div id="search-result" class="sjs-sh-1">-->
                         <!--</div>-->
                     </div>
-                    <div id="std-chapter" class="tab-pane">
+                    <div id="std-xmj" class="tab-pane">
                         <div class="sjs-bar-2">
                             <div class="pb-1">
                                 <select class="form-control form-control-sm">
@@ -108,10 +108,10 @@
                                 </select>
                             </div>
                         </div>
-                        <div id="std-chapter-spread" class="sjs-sh-2">
+                        <div id="std-xmj-spread" class="sjs-sh-2">
                         </div>
                     </div>
-                    <div id="std-bills" class="tab-pane">
+                    <div id="std-gcl" class="tab-pane">
                         <div class="sjs-bar-3">
                             <div class="pb-1">
                                 <select class="form-control form-control-sm">
@@ -121,7 +121,7 @@
                                 </select>
                             </div>
                         </div>
-                        <div id="std-bills-spread" class="sjs-sh-3">
+                        <div id="std-gcl-spread" class="sjs-sh-3">
                         </div>
                     </div>
                     <div id="deal-bills" class="tab-pane">
@@ -143,10 +143,10 @@
                     <a class="nav-link" content="#search" href="javascript: void(0);">查找定位</a>
                 </li>
                 <li class="nav-item">
-                    <a class="nav-link" content="#std-chapter" href="javascript: void(0);">项目节</a>
+                    <a class="nav-link" content="#std-xmj" href="javascript: void(0);">项目节</a>
                 </li>
                 <li class="nav-item">
-                    <a class="nav-link" content="#std-bills" href="javascript: void(0);">工程量清单</a>
+                    <a class="nav-link" content="#std-gcl" href="javascript: void(0);">工程量清单</a>
                 </li>
                 <li class="nav-item">
                     <a class="nav-link" content="#deal-bills" href="javascript: void(0);">签约清单</a>

+ 4 - 4
app/view/revise/info.ejs

@@ -111,22 +111,22 @@
                     </div>
                     <div id="search" class="tab-pane">
                     </div>
-                    <div id="std-chapter" class="tab-pane">
+                    <div id="std-xmj" class="tab-pane">
                         <div class="sjs-bar-3">
                             <div class="pb-1">
                                 <select class="form-control form-control-sm"><option>0号计量台帐部位参考(项目节)</option></select>
                             </div>
                         </div>
-                        <div id="std-chapter-spread" class="sjs-sh-3">
+                        <div id="std-gcl-spread" class="sjs-sh-3">
                         </div>
                     </div>
-                    <div id="std-bills" class="tab-pane">
+                    <div id="std-gcl" class="tab-pane">
                         <div class="sjs-bar-4">
                             <div class="pb-1">
                                 <select class="form-control form-control-sm"><option>0号计量台帐部位参考(工程量清單)</option></select>
                             </div>
                         </div>
-                        <div id="std-bills-spread" class="sjs-sh-4">
+                        <div id="std-gcl-spread" class="sjs-sh-4">
                         </div>
                     </div>
                     <div id="deal-bills" class="tab-pane">