浏览代码

过程结算,结算部位

MaiXinRong 1 年之前
父节点
当前提交
fbeea2c9e1

+ 31 - 15
app/controller/settle_controller.js

@@ -187,7 +187,7 @@ module.exports = app => {
 
         async index(ctx) {
             const status = auditConst.settle.status;
-            let url = (ctx.settle.status === status.uncheck || ctx.settle.status === status.checkNo) && (ctx.session.sessionUser.is_admin || ctx.session.sessionUser.accountId === ctx.settle.user_id)? 'select' : 'ledger';
+            let url = (ctx.settle.audit_status === status.uncheck || ctx.settle.audit_status === status.checkNo) && (ctx.session.sessionUser.is_admin || ctx.session.sessionUser.accountId === ctx.settle.user_id) ? 'select' : 'ledger';
             ctx.redirect(ctx.url + '/' + url);
         }
         async select(ctx) {
@@ -221,6 +221,12 @@ module.exports = app => {
             }
         }
 
+        async _loadLatestStage(ctx) {
+            if (ctx.settle.latestStage) return;
+            ctx.settle.latestStage = ctx.settle.final_sid
+                ? await this.ctx.service.stage.getDataById(ctx.settle.final_sid)
+                : await this.ctx.service.stage.getLastestCompleteStage(ctx.tender.id);
+        }
         async _getStageBillsData(ctx) {
             this.ledgerColumn = [
                 'id', 'tender_id', 'ledger_id', 'ledger_pid', 'level', 'order', 'full_path', 'is_leaf',
@@ -245,27 +251,25 @@ module.exports = app => {
         async _loadSettleDataByKey(ctx, key, hpack) {
             switch (key) {
                 case 'stageBills':
-                    if (!ctx.settle.latestStage)
-                        ctx.settle.latestStage = ctx.settle.final_sid
-                            ? await this.ctx.service.stage.getDataById(ctx.settle.final_sid)
-                            : await this.ctx.service.stage.getLastestCompleteStage(ctx.tender.id);
+                    await this._loadLatestStage(ctx);
                     const bills = await this._getStageBillsData(ctx);
-                    return hpack ? [this.ctx.helper.hpackArr(bills), 'stageBills'] : [bills, ''];
+                    return hpack ? [ctx.helper.hpackArr(bills), 'stageBills'] : [bills, ''];
                 case 'stagePos':
-                    if (!ctx.settle.latestStage)
-                        ctx.settle.latestStage = ctx.settle.final_sid
-                            ? await this.ctx.service.stage.getDataById(ctx.settle.final_sid)
-                            : await this.ctx.service.stage.getLastestCompleteStage(ctx.tender.id);
+                    await this._loadLatestStage(ctx);
                     const pos = await this._getStagePosData(ctx);
-                    return hpack ? [this.ctx.helper.hpackArr(pos), 'stagePos'] : [pos, ''];
+                    return hpack ? [ctx.helper.hpackArr(pos), 'stagePos'] : [pos, ''];
+                case 'settleChange':
+                    await this._loadLatestStage(ctx);
+                    const settleChange = await ctx.service.stageChangeFinal.getUnSettleChangeData(ctx.settle.latestStage);
+                    return hpack ? [ctx.helper.hpackArr(settleChange), key] : [settleChange, ''];
                 case 'settleBills':
                     const settleBills = await ctx.service.settleBills.getAllDataByCondition({ where: { settle_id: ctx.settle.id } });
-                    return hpack ? [this.ctx.helper.hpackArr(settleBills), 'settleBills'] : [settleBills, ''];
+                    return hpack ? [ctx.helper.hpackArr(settleBills), 'settleBills'] : [settleBills, ''];
                 case 'settlePos':
                     const settlePos = await ctx.service.settlePos.getAllDataByCondition({ where: { settle_id: ctx.settle.id } });
-                    return hpack ? [this.ctx.helper.hpackArr(settlePos), 'settlePos'] : [settlePos, ''];
+                    return hpack ? [ctx.helper.hpackArr(settlePos), 'settlePos'] : [settlePos, ''];
                 case 'settleSelect':
-                    const settleSelect = []; // await ctx.service.settleSelect.getAllDataByCondition({ where: { settle_id: ctx.settle.id } });
+                    const settleSelect = await ctx.service.settleSelect.getAllDataByCondition({ where: { settle_id: ctx.settle.id } });
                     return [settleSelect, ''];
                 case 'tag':
                     const tag = await ctx.service.ledgerTag.getDatas(ctx.tender.id, -1, ctx.settle.id);
@@ -290,7 +294,19 @@ module.exports = app => {
                 ctx.body = responseData;
             } catch (err) {
                 ctx.log(err);
-                ctx.body = { err: 1, msg: err.toString(), data: null };
+                ctx.ajaxErrorBody(err, '获取结算数据出错');
+            }
+        }
+
+        async updateSelect(ctx) {
+            try {
+                const data = JSON.parse(ctx.request.body.data);
+                if (!data.add && !data.del) throw '提交数据错误';
+                const result = await ctx.service.settleSelect.updateData(data);
+                ctx.body = { err: 0, msg: '', data: result };
+            } catch (err) {
+                ctx.log(err);
+                ctx.ajaxErrorBody(err, '提交结算数据出错');
             }
         }
 

+ 1 - 1
app/lib/rpt_data_analysis.js

@@ -1798,7 +1798,7 @@ const treeFilter = {
     defaultSetting: {
         table: 'mem_stage_bills',
         type: 'match/filter',
-        subType: 'all/posterity',
+        subType: 'all/posterity/leaf',
         condition: [
             { field: 'name', type: 'str', value: '建筑项目管理费', isPart: true },
         ],

+ 153 - 20
app/public/js/settle_select.js

@@ -107,6 +107,43 @@ $(document).ready(() => {
     ]);
     SpreadJsObj.initSheet(spSheet, posSpreadSetting);
 
+    // 0: 可结算,1: 合同未完成,2:
+    const settleCheck = {
+        _analysisPos(pos) {
+            pos.undoneDeal = pos.quantity ? !checkZero(ZhCalc.div(pos.end_contract_qty, pos.quantity)) : false;
+            pos.undone = pos.undoneDeal || pos.undoneChange;
+        },
+        _analysisNode(node) {
+            if (node.undoneDeal === undefined) node.undoneDeal = false;
+            if (node.undoneChange === undefined) node.undoneChange = false;
+            if (node.children && node.children.length > 0) {
+                for (const child of node.children) {
+                    this._analysisNode(child);
+                    if (child.undoneDeal) node.undoneDeal = true;
+                    if (child.undoneChange) node.undoneChange = true;
+                }
+                node.undone = !!node.undoneDeal || !!node.undoneChange;
+            } else {
+                const posRange = settlePos.getLedgerPos(node.id);
+                if (posRange && posRange.length > 0) {
+                    for (const pos of posRange) {
+                        this._analysisPos(pos);
+                        if (pos.undoneDeal) node.undoneDeal = true;
+                        if (pos.undoneChange) node.undoneChange = true;
+                    }
+                } else {
+                    node.undoneDeal = node.end_contract_qty ? !checkZero(ZhCalc.div(node.end_contract_qty, node.quantity)) : false;
+                    node.undone = !!node.undoneDeal || !!node.undoneChange;
+                }
+            }
+        },
+        init() {
+            for (const node of settleTree.children) {
+                this._analysisNode(node);
+            }
+        }
+    };
+
     const settleBillsObj = {
         loadRelaData: function() {
             SpreadJsObj.saveTopAndSelect(slSheet, ckBillsSpread);
@@ -128,34 +165,77 @@ $(document).ready(() => {
             if (col.field !== 'selected') return;
 
             const node = SpreadJsObj.getSelectObject(info.sheet);
-            node.selected = !node.selected;
-            if (node.children && node.children.length > 0) {
-                const posterity = tsObj.tenderSourceTree.getPosterity(node);
+            if (node.undone && !node.selected) {
+                let msg = '选择的节点不可结算';
+                if (node.undoneDeal) msg = msg + ',合同未计量完';
+                if (node.undoneChange) msg = msg + ',变更令未调用完';
+                toastr.warning(msg);
+                SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                return;
+            }
+            if (!node.selected) {
+                const parents = settleTree.getAllParents(node);
+                for (const p of parents) {
+                    if (p.selected) {
+                        toastr.warning(`父项${p.code || ''}以勾选,勿需重复勾选子项`);
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
+                    }
+                }
+            }
+
+            const update = {};
+            if (!node.selected) {
+                update.add = [{ lid: node.id }];
+                const posterity = settleTree.getPosterity(node);
                 for (const p of posterity) {
-                    p.selected = node.selected;
-                    if (!p.children || p.children.length === 0){
-                        if (p.selected) {
-                            tsObj._addTender(p);
-                        } else {
-                            tsObj._removeTender(p);
+                    if (p.selected) {
+                        if (!update.del) update.del = [];
+                        update.del.push({ lid: node.id });
+                    }
+                    if (!p.children || p.children.length === 0) {
+                        const posRange = settlePos.getLedgerPos(p.id);
+                        for (const p of posRange) {
+                            if (p.selected) {
+                                if (!update.del) update.del = [];
+                                update.del.push({ pid: p.id });
+                            }
                         }
                     }
                 }
-                SpreadJsObj.reLoadRowData(info.sheet, info.row, posterity.length + 1);
             } else {
-                if (node.selected) {
-                    tsObj._addTender(node);
-                } else {
-                    tsObj._removeTender(node);
-                }
-                SpreadJsObj.reLoadRowData(info.sheet, info.row, 1);
+                update.del = [{ lid: node.id }];
             }
-            tsObj.reloadResultData();
+            postData(window.location.pathname + '/update', update, result => {
+                node.selected = !node.selected;
+                if (result.del) {
+                    let refreshRow = [], refreshPos = false;
+                    for (const d of result.del) {
+                        if (d.lid) {
+                            const sbi = settleTree.nodes.findIndex(x => { return x.id === d.lid; });
+                            settleTree.nodes[sbi].selected = false;
+                            refreshRow.push(sbi);
+                        } else if (d.pid) {
+                            const sp = settlePos.getPos(d.pid);
+                            if (sp) {
+                                sp.selected = false;
+                                if (sp.lid === node.id) refreshPos = false;
+                            }
+                        }
+                    }
+                    if (refreshRow.length > 0) SpreadJsObj.reLoadRowsData(info.sheet, refreshRow);
+                    if (refreshPos) settlePosObj.loadCurPosData();
+                }
+            }, () => {
+                SpreadJsObj.reLoadRowData(info.sheet, info.row);
+            });
         },
     };
-    slSpread.bind(spreadNS.Events.ButtonClicked, stageTreeSpreadObj.buttonClicked);
     slSpread.bind(spreadNS.Events.SelectionChanged, settleBillsObj.selectionChanged);
     slSpread.bind(spreadNS.Events.TopRowChanged, settleBillsObj.topRowChanged);
+    if (!readOnly) {
+        slSpread.bind(spreadNS.Events.ButtonClicked, settleBillsObj.buttonClicked);
+    }
 
     const settlePosObj = {
         loadCurPosData: function() {
@@ -164,14 +244,58 @@ $(document).ready(() => {
                 spSheet.zh_setting.readOnly = readOnly;
                 const posRange = settlePos.getLedgerPos(billsNode.id) || [];
                 SpreadJsObj.loadSheetData(spSheet, SpreadJsObj.DataType.Data, posRange, readOnly);
+                if (posRange.length > 0) SpreadJsObj.locateData(spSheet, posRange[0]);
             } else {
                 spSheet.zh_setting.readOnly = true;
                 SpreadJsObj.loadSheetData(spSheet, SpreadJsObj.DataType.Data, [], true);
             }
-        }
+        },
+        buttonClicked: function(e, info) {
+            if (!info.sheet.zh_setting) return;
+
+            const col = info.sheet.zh_setting.cols[info.col];
+            if (col.field !== 'selected') return;
+
+            const node = SpreadJsObj.getSelectObject(info.sheet);
+            if (node.undone && !node.selected) {
+                let msg = '选择的节点不可结算';
+                if (node.undoneDeal) msg = msg + ',合同未计量完';
+                if (node.undoneChange) msg = msg + ',变更令未调用完';
+                toastr.warning(msg);
+                SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                return;
+            }
+            if (!node.selected) {
+                const billsNode = settleTree.nodes.find(x => { return x.id === node.lid });
+                const parents = settleTree.getAllParents(billsNode);
+                for (const p of parents) {
+                    if (p.selected) {
+                        toastr.warning(`所属清单的父项${p.code || ''}以勾选,勿需重复勾选计量单元`);
+                        SpreadJsObj.reLoadRowData(info.sheet, info.row);
+                        return;
+                    }
+                }
+            }
+
+            const update = {};
+            if (!node.selected) {
+                update.add = [{ lid: node.id }];
+            } else {
+                update.del = [{ lid: node.id }];
+            }
+            postData(window.location.pathname + '/update', update, result => {
+                node.selected = !node.selected;
+                SpreadJsObj.reLoadRowData(info.sheet, info.row);
+            }, () => {
+                SpreadJsObj.reLoadRowData(info.sheet, info.row);
+            });
+        },
     };
+    if (!readOnly) {
+        spSpread.bind(spreadNS.Events.ButtonClicked, settlePosObj.buttonClicked);
+    }
 
-    postData('load', {filter: 'stageBills;stagePos;settleSelect;tag'}, function(result) {
+    postData('load', {filter: 'stageBills;stagePos;settleSelect;tag;settleChange'}, function(result) {
         for (const select of result.settleSelect) {
             if (select.pid) {
                 const sp = result.stagePos.find(x => { return x.id === select.pid });
@@ -181,10 +305,19 @@ $(document).ready(() => {
                 if (sb) sb.selected = true;
             }
         }
+        for (const change of result.settleChange) {
+           const sb = result.stageBills.find(x => { return x.id === change.gcl_id });
+           if (sb) sb.undoneChange = true;
+           if (change.mx_id) {
+               const sp = result.stagePos.find(x => { return x.id === change.mx_id });
+               if (sp) sp.undoneChange = true;
+           }
+        }
         settleTree.loadDatas(result.stageBills);
         treeCalc.calculateAll(settleTree);
         settlePos.loadDatas(result.stagePos);
         settlePos.calculateAll();
+        settleCheck.init();
 
         SpreadJsObj.loadSheetData(slSheet, SpreadJsObj.DataType.Tree, settleTree);
         SpreadJsObj.loadTopAndSelect(slSpread.getActiveSheet(), ckBillsSpread);

+ 1 - 0
app/router.js

@@ -432,6 +432,7 @@ module.exports = app => {
     app.get('/tender/:id/settle/:sorder/select', sessionAuth, tenderCheck, uncheckTenderCheck, settleCheck, 'settleController.select');
     app.get('/tender/:id/settle/:sorder/ledger', sessionAuth, tenderCheck, uncheckTenderCheck, settleCheck, 'settleController.ledger');
     app.post('/tender/:id/settle/:sorder/load', sessionAuth, tenderCheck, uncheckTenderCheck, settleCheck, 'settleController.loadSettleData');
+    app.post('/tender/:id/settle/:sorder/select/update', sessionAuth, tenderCheck, uncheckTenderCheck, settleCheck, 'settleController.updateSelect');
     // 结算汇总
     app.get('/tender/:id/settle/gather', sessionAuth, tenderCheck, uncheckTenderCheck, 'settleController.gather');
     app.get('/tender/:id/settle/gather/load', sessionAuth, tenderCheck, uncheckTenderCheck, 'settleController.loadGatherData');

+ 9 - 9
app/service/settle.js

@@ -176,7 +176,7 @@ module.exports = app => {
             settle.curAssistsIds = this._.map(settle.curAssists, 'ass_user_id');
             settle.relaAssists = settle.assists.filter(x => { return x.user_id === accountId }); // 登录人的协同人
             // 当前参与人Id
-            settle.userIds = settle.status === settle.uncheck // 当前流程下全部参与人id
+            settle.userIds = settle.audit_status === settle.uncheck // 当前流程下全部参与人id
                 ? [settle.user_id, ...settle.userAssistIds]
                 : [settle.user_id, ...settle.userAssistIds, ...settle.auditorIds, ...settle.auditAssistIds];
         }
@@ -187,7 +187,7 @@ module.exports = app => {
             if (!settle.user) settle.user = await this.ctx.service.projectAccount.getAccountInfoById(settle.user_id);
             settle.auditHistory = await this.ctx.service.settleAudit.getAuditorHistory(settle.id, times);
             // 获取审批流程中左边列表
-            if (settle.status === auditConst.settle.status.checkNo && settle.user_id !== this.ctx.session.sessionUser.accountId) {
+            if (settle.audit_status === auditConst.settle.status.checkNo && settle.user_id !== this.ctx.session.sessionUser.accountId) {
                 const auditors = await this.ctx.service.settleAudit.getAuditors(settle.id, settle.audit_times - 1); // 全部参与的审批人
                 const auditorGroups = this.ctx.helper.groupAuditors(auditors);
                 settle.hisUserGroup = this.ctx.helper.groupAuditorsUniq(auditorGroups);
@@ -212,10 +212,10 @@ module.exports = app => {
             settle.cancancel = 0;
             // 获取当前审批人的上一个审批人,判断是否是当前登录人,并赋予撤回功能,(当审批人存在有审批过时,上一人不允许再撤回)
             const status = auditConst.settle.status;
-            if (settle.status === status.checked || settle.status === status.uncheck) return;
+            if (settle.audit_status === status.checked || settle.audit_status === status.uncheck) return;
 
             const accountId = this.ctx.session.sessionUser.accountId;
-            if (settle.status !== status.checkNo) {
+            if (settle.audit_status !== status.checkNo) {
                 // 找出当前操作人上一个审批人,包括审批完成的和退回上一个审批人的,同时当前操作人为第一人时,就是则为原报
                 if (settle.flowAuditors.find(x => { return x.status !== status.checking}) && settle.flowAuditorIds.indexOf(accountId) < 0) return; // 当前流程存在审批人审批通过时,不可撤回
                 const flowAssists = settle.auditAssists.filter(x => { return settle.flowAuditorIds.indexOf(x.user_id) >= 0; });
@@ -261,21 +261,21 @@ module.exports = app => {
             const accountId = this.ctx.session.sessionUser.accountId;
             const shareIds = [];
             // 是否只读
-            if (settle.status === status.uncheck || settle.status === status.checkNo) {
+            if (settle.audit_status === status.uncheck || settle.audit_status === status.checkNo) {
                 settle.readOnly = accountId !== settle.user_id && settle.userAssistIds.indexOf(accountId) < 0;
             } else {
                 settle.readOnly = true;
             }
             // 读取数据相关
-            settle.curTimes = settle.status === status.checkNo && settle.readOnly ? settle.times - 1 : settle.times;
+            settle.curTimes = settle.audit_status === status.checkNo && settle.readOnly ? settle.times - 1 : settle.times;
             // 协作人相关
 
-            if (settle.status === status.uncheck) {
+            if (settle.audit_status === status.uncheck) {
                 if (!settle.readOnly) {
                     settle.assist = settle.userAssists.find(x => { return x.ass_user_id === accountId; });
                 }
                 settle.curTimes = settle.times;
-            } else if (settle.status === status.checkNo) {
+            } else if (settle.audit_status === status.checkNo) {
                 if (!settle.readOnly) {
                     settle.assist = settle.userAssists.find(x => { return x.ass_user_id === accountId; });
                     settle.curTimes = settle.times;
@@ -300,7 +300,7 @@ module.exports = app => {
                 settle.filePermission = true;
             } else {
                 if (shareIds.indexOf(accountId) !== -1 || (permission !== null && permission.tender !== undefined && permission.tender.indexOf('2') !== -1)) {// 分享人
-                    if (settle.status === status.uncheck) throw '您无权查看该数据';
+                    if (settle.audit_status === status.uncheck) throw '您无权查看该数据';
                     settle.filePermission = false;
                 } else if (this.ctx.tender.isTourist || this.ctx.session.sessionUser.is_admin) {
                     settle.filePermission = this.ctx.tender.touristPermission.file || settle.auditorIds.indexOf(accountId) !== -1;

+ 27 - 0
app/service/settle_bills.js

@@ -0,0 +1,27 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Mai
+ * @date
+ * @version
+ */
+
+module.exports = app => {
+    class SettlePos extends app.BaseService {
+        /**
+         * 构造函数
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        constructor(ctx) {
+            super(ctx);
+            this.depart = 10;
+            this.tableName = 'settle_bills';
+        }
+    }
+
+    return SettlePos;
+};

+ 27 - 0
app/service/settle_pos.js

@@ -0,0 +1,27 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Mai
+ * @date
+ * @version
+ */
+
+module.exports = app => {
+    class SettlePos extends app.BaseService {
+        /**
+         * 构造函数
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        constructor(ctx) {
+            super(ctx);
+            this.depart = 20;
+            this.tableName = 'settle_pos';
+        }
+    }
+
+    return SettlePos;
+};

+ 62 - 0
app/service/settle_select.js

@@ -0,0 +1,62 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Mai
+ * @date
+ * @version
+ */
+
+module.exports = app => {
+    class SettleSelect extends app.BaseService {
+        /**
+         * 构造函数
+         *
+         * @param {Object} ctx - egg全局变量
+         * @return {void}
+         */
+        constructor(ctx) {
+            super(ctx);
+            this.tableName = 'settle_select';
+        }
+
+        async updateData(data) {
+            const result = {};
+            const conn = await this.db.beginTransaction();
+            try {
+                if (data.del && data.del.length > 0) {
+                    const lid = [], pid = [];
+                    for (const d of data.del) {
+                        if (d.lid) lid.push(d.lid);
+                        if (d.pid) pid.push(d.pid);
+                    }
+                    const delLibData = await this.getAllDataByCondition({ settle_id: this.ctx.settle.id, lid });
+                    const delPidData = await this.getAllDataByCondition({ settle_id: this.ctx.settle.id, pid });
+                    if (delLibData.length + delPidData.length !== data.del.length) throw '提交数据错误';
+                    const deleteData = [...delLibData, ...delPidData];
+                    await conn.delete(this.tableName, { id: deleteData.map(x => { return x.id }) });
+                    result.del = deleteData;
+                }
+                if (data.add && data.add.length > 0) {
+                    const addData = [];
+                    for (const d of data.add) {
+                        addData.push({
+                            tid: this.ctx.settle.tid, settle_id: this.ctx.settle.id, settle_order: this.ctx.settle.settle_order,
+                            lid: d.lid || '', pid: d.pid || '', user_id: this.ctx.session.sessionUser.accountId,
+                        });
+                    }
+                    await conn.insert(this.tableName, addData);
+                    result.add = addData;
+                }
+                await conn.commit();
+            } catch (err) {
+                await conn.rollback();
+                throw err;
+            }
+            return result;
+        }
+    }
+
+    return SettleSelect;
+};

+ 9 - 0
app/service/stage_change_final.js

@@ -148,6 +148,15 @@ module.exports = app => {
                 '  WHERE scf.tid = ? And scf.sorder <= ?';
             return await this.db.query(sql, [tid, stageOrder]);
         }
+
+        async getUnSettleChangeData(stage) {
+            const sql = 'SELECT cal.cid, cal.gcl_id, cal.mx_id, cal.code, cal.name, cal.unit, cal.unit_price, cal.checked_amount, scf.used_qty' +
+                `  FROM ${this.ctx.service.changeAuditList.tableName} cal ` +
+                `  LEFT JOIN (SELECT cbid, sum(qty) as used_qty FROM ${this.tableName} WHERE tid = ? and sorder <= ? GROUP BY cbid) scf ON cal.id = scf.cbid` +
+                '  WHERE cal.tid = ?';
+            const changeFinal = await this.db.query(sql, [stage.tid, stage.order, stage.tid]);
+            return changeFinal.filter(x => { return x.checked_amount > x.used_qty && !! x.gcl_id; });
+        }
     }
 
     return StageChangeFinal;

+ 7 - 4
app/view/settle/index.ejs

@@ -30,11 +30,11 @@
         <div class="row w-100 sub-content">
             <div id="left-view" class="c-body" style="width: 100%">
                 <!--上部分-->
-                <div class="sjs-height-1" id="stage-ledger">
+                <div class="sjs-height-1" id="settle-ledger">
                 </div>
                 <!--下部分-->
                 <div class="bcontent-wrap" id="main-bottom">
-                    <div id="main-resize" class="resize-y" r-Type="height" div1="#stage-bills" div2="#main-bottom" store-id="settle-main" store-version="1.0.0" min="100"></div>
+                    <div id="main-resize" class="resize-y" r-Type="height" div1="#settle-bills" div2="#main-bottom" store-id="settle-main" store-version="1.0.0" min="100"></div>
                     <div class="bc-bar mb-1">
                         <ul class="nav nav-tabs">
                             <li class="nav-item">
@@ -42,7 +42,7 @@
                             </li>
                         </ul>
                     </div>
-                    <div class="sp-wrap" id="stage-pos">
+                    <div class="sp-wrap" id="settle-pos">
                     </div>
                 </div>
             </div>
@@ -90,7 +90,10 @@
     </div>
 </div>
 <script>
+    const readOnly = <%- settle.readOnly %>;
+    const tenderInfo = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.tender.info)) %>'));
     const thousandth = <%- ctx.tender.info.display.thousandth %>;
+    const thirdParty = JSON.parse('<%- JSON.stringify(thirdParty) %>');
     const billsSpreadSetting = {
         cols: [
             {title: '结算状态', colSpan: '1', rowSpan: '2', field: 'settle_status', hAlign: 1, width: 60, formatter: '@', readOnly: true},
@@ -109,7 +112,7 @@
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_final_1_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
             {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-            {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip', true},
+            {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip', readOnly: true},
             <% if (ctx.session.sessionProject.gxby) { %>
             {title: '工序报验', colSpan: '1', rowSpan: '2', field: 'gxby', hAlign: 1, width: 80, formatter: '@', readOnly: true},
             <% } %>

+ 2 - 6
app/view/settle/select.ejs

@@ -70,8 +70,6 @@
                         <div id="search-result" class="sjs-sh-1">
                         </div>
                     </div>
-                    <div id="bills-tag" class="tab-pane tab-select-show">
-                    </div>
                 </div>
             </div>
         </div>
@@ -81,10 +79,6 @@
                 <li class="nav-item">
                     <a class="nav-link" content="#search" href="javascript: void(0);">查找定位</a>
                 </li>
-                <li class="nav-item">
-                    <a class="nav-link" content="#bills-tag" href="javascript: void(0);">书签</a>
-                </li>
-                </li>
             </ul>
         </div>
     </div>
@@ -135,6 +129,7 @@
         font: '12px 微软雅黑',
         frozenColCount: 5,
         frozenLineColor: '#93b5e4',
+        readOnly,
     };
     const posSpreadSetting = {
         cols: [
@@ -160,5 +155,6 @@
         defaultRowHeight: 21,
         headerFont: '12px 微软雅黑',
         font: '12px 微软雅黑',
+        readOnly,
     };
 </script>