Просмотр исходного кода

中间计量,生成数据1.0

MaiXinRong 6 лет назад
Родитель
Сommit
b4e6f91071

+ 1 - 1
app/base/base_service.js

@@ -190,7 +190,7 @@ class BaseService extends Service {
     }
 
     round(value, decimal) {
-        this.ctx.helper.round(value, decimal);
+        return this.ctx.helper.round(value, decimal ? decimal : 8);
     }
 }
 module.exports = BaseService;

+ 0 - 1
app/controller/ledger_audit_controller.js

@@ -99,7 +99,6 @@ module.exports = app => {
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.ledger.audit),
                 await this.layout('ledger/audit.ejs', renderData, 'ledger/audit_modal.ejs');
             } catch (err) {
-                console.log(err);
                 this.log(err);
                 ctx.redirect('/tender/' + ctx.tender.id);
             }

+ 13 - 1
app/controller/stage_controller.js

@@ -222,7 +222,7 @@ module.exports = app => {
                 const data = JSON.parse(ctx.request.body.data);
                 await ctx.service.stage.buildDetailData(ctx.tender.id, ctx.stage.order, data);
 
-                ctx.redirect('/tender/'+ ctx.tender.id + '/measure/stage/' + ctx.stage.order + '/detail');
+                ctx.body = {err: 0, msg: '', data: null};
             } catch (err) {
                 this.log(err);
                 ctx.body = {err: 1, msg: err.toString(), data: null};
@@ -242,6 +242,18 @@ module.exports = app => {
                 if (data.loadType === 'ledger') {
                     const ledgerData = await ctx.service.ledger.getDataByTenderId(ctx.tender.id, -1);
                     ctx.body = {err: 0, msg: '', data: ledgerData };
+                } else if (data.loadType === 'all') {
+                    const ledger = await ctx.service.ledger.getDataByTenderId(ctx.tender.id, -1);
+                    const curStage = await ctx.service.stageBills.getLastestStageData(ctx.tender.id, ctx.stage.id);
+                    ctx.body = {
+                        err: 0,
+                        msg: '',
+                        data: {
+                            ledger,
+                            curStage,
+                            stageDetail: [],
+                        }
+                    };
                 }
             } catch (err) {
                 this.log(err);

+ 47 - 0
app/lib/stage_im.js

@@ -0,0 +1,47 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Mai
+ * @date
+ * @version
+ */
+
+const imType = require('../const/tender').imType;
+
+class Stage_IM {
+
+    async initData () {
+        this.ledgerData = await this.ctx.service.ledger.getDataByTenderId(this.ctx.tender.id);
+        this.stageBillsData = await this.ctx.service.stageBills.getAuditorStageData(this.ctx.tender.id, this.ctx.stage.id, this.ctx.stage.times, this.ctx.stage.order);
+        // to do
+        this.orgStageImData = [];
+    }
+
+    async buildTzImData () {
+
+    }
+
+    async buildTzImGatherData () {
+
+    }
+
+    async buildStageImData (ctx) {
+        this.ctx = ctx;
+        if (this.ctx.stage.im_type === imType.tz.value) {
+            if (this.ctx.stage.im_gather) {
+
+            } else {
+
+            }
+        } else if (this.ctx.stage.im_type === imType.zl.value) {
+            if (this.ctx.stage.im_gather) {
+
+            } else {
+
+            }
+        }
+    }
+}
+module.exports = Stage_IM;

+ 0 - 1
app/public/js/global.js

@@ -235,7 +235,6 @@ const postDataWithFile = function (url, formData, successCallback, errorCallBack
  * @returns {*}
  */
 function getQueryVariable(variable) {
-    console.log(window.location.pathname);
     var query = window.location.search.substring(1);
     var vars = query.split("&");
     for (var i=0;i<vars.length;i++) {

+ 0 - 3
app/public/js/ledger.js

@@ -620,9 +620,7 @@ $(document).ready(function() {
                 const col = info.sheet.zh_setting.cols[info.col];
                 const data = {};
                 if (col.field === 'name') {
-                    console.log(1);
                     if (info.editingText === '' && position) {
-                        console.log(2);
                         toast('部位名称不可为空', 'error', 'exclamation-circle');
                         info.cancel = true;
                         return;
@@ -1209,7 +1207,6 @@ $(document).ready(function() {
         const data = {
             auditorId: $('#addAuditor').attr('auditorId'),
         };
-        console.log(data);
         postData('/tender/' + getTenderId() + '/ledger/audit/add', data, (data) => {
             const html = [];
             html.push('<li class="list-group-item" auditorId="'+ data.audit_id +'"><a href="javascript: void(0)" class="text-danger pull-right">移除</a>');

+ 0 - 1
app/public/js/path_tree.bak.js

@@ -285,7 +285,6 @@ const createNewPathTree = function (setting) {
     proto.loadChildren = function (node, callback) {
         const self = this;
         const url = treeSetting.preUrl ? treeSetting.preUrl + '/get-children' : 'get-children';
-        console.log(url);
         postData(url, this.getNodeKeyData(node), function (data) {
             self._loadData(data);
             callback();

+ 0 - 2
app/public/js/path_tree.js

@@ -366,7 +366,6 @@ const createNewPathTree = function (type, setting) {
             datas.sort(function (a, b) {
                 return b.level - a.level;
             });
-            console.log(datas);
             const removeArrayData = function (array, data) {
                 const index = array.indexOf(data);
                 array.splice(index, 1);
@@ -635,7 +634,6 @@ const createNewPathTree = function (type, setting) {
         loadChildren (node, callback) {
             const self = this;
             const url = this.setting.preUrl ? this.setting.preUrl + '/get-children' : 'get-children';
-            console.log(url);
             postData(url, this.getNodeKeyData(node), function (data) {
                 self._loadData(data);
                 callback();

+ 0 - 1
app/public/js/spreadjs_rela/extend_celltype.js

@@ -232,7 +232,6 @@ SpreadJsExtendCellType = {
                         for (const child of posterity) {
                             hitinfo.sheet.setRowVisible(tree.nodes.indexOf(child), child.visible, hitinfo.sheetArea);
                         }
-                        console.log(new Date() - time);
                     });
                     hitinfo.sheet.repaint();
                 }

+ 0 - 3
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -466,9 +466,6 @@ const SpreadJsObj = {
                 if (fields.indexOf(col.field) !== -1) {
                     col.readOnly = readonly;
                     sheet.getRange(-1, i, -1, 1).locked(col.readOnly || sheet.zh_setting.readOnly || false);
-                    console.log(sheet.getCell(1, 0).locked());
-                    console.log(sheet.getCell(1, 0).text());
-                    console.log(sheet.getCell(1, 1).text());
                 }
             });
         }

+ 1 - 0
app/public/js/stage.js

@@ -68,6 +68,7 @@ $(document).ready(() => {
     stageTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
     stageTreeSetting.calcFun = function (node) {
         if (node.children && node.children.length === 0) {
+            node.gather_qty = _.toNumber(node.contract_qty) + _.toNumber(node.qc_qty);
             node.end_contract_qty = _.toNumber(node.pre_contract_qty) + _.toNumber(node.contract_qty);
             node.end_qc_qty = _.toNumber(node.pre_qc_qty) + _.toNumber(node.qc_qty);
             node.end_gather_qty = _.toNumber(node.pre_gather_qty) + _.toNumber(node.gather_qty);

+ 33 - 2
app/public/js/stage_detail.js

@@ -10,6 +10,37 @@
 
 $(document).ready(() => {
     let gsSpread, gsTree;
+    stageIm.init(stage, imType);
+
+    function reBuildImData() {
+        const imData = stageIm.buildImData();
+        const html = [];
+        for (const im of imData) {
+            html.push('<tr>');
+            html.push('<td>');
+            html.push(im.code);
+            html.push('</td>');
+            html.push('<td>');
+            html.push(im.im_code);
+            html.push('</td>');
+            html.push('<td>');
+            html.push(im.doc_code);
+            html.push('</td>');
+            html.push('<td>');
+            html.push(im.fbfx);
+            html.push('</td>');
+            html.push('<td align="right">');
+            html.push(im.jl);
+            html.push('</td>');
+            html.push('</tr>');
+        }
+        $('#im-list').html(html.join(''));
+    }
+
+    postData(window.location.pathname + '/load', { loadType: 'all' }, function (data) {
+        stageIm.loadData(data.ledger, data.curStage, data.stageDetail);
+        reBuildImData();
+    });
 
     let gatherComfirmPopover = {
         reBind: function (obj, eventName, fun) {
@@ -66,8 +97,9 @@ $(document).ready(() => {
         postData(window.location.pathname + '/build', data, function (result) {
             stage.im_type = data.im_type;
             stage.im_pre = data.im_pre;
-            $('#choose').modal('hide');
             // 加载生成数据
+            reBuildImData();
+            $('#choose').modal('hide');
         });
     });
     // 拉取树结构信息
@@ -116,7 +148,6 @@ $(document).ready(() => {
                         sheet.endEdit(true);
                     }
                 }
-
                 if (info.sheet.zh_setting) {
                     const col = info.sheet.zh_setting.cols[info.col];
                     if (col.field !== 'check') {

+ 317 - 0
app/public/js/stage_im.js

@@ -0,0 +1,317 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Mai
+ * @date
+ * @version
+ */
+
+// class Stage_IM {
+//
+//     /**
+//      *
+//      * @param stage
+//      * @param imType
+//      */
+//     constructor (stage, imType) {
+//         this.stage = stage;
+//         this.imType = imType;
+//         this.gsTreeSetting = {
+//             id: 'ledger_id',
+//             pid: 'ledger_pid',
+//             order: 'order',
+//             level: 'level',
+//             rootId: -1,
+//             keys: ['id', 'tender_id', 'ledger_id'],
+//         };
+//         this.gsTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'];
+//         this.gsTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
+//         this.gsTreeSetting.calcFun = function (node) {
+//             if (node.children && node.children.length === 0) {
+//                 node.end_contract_qty = _.toNumber(node.pre_contract_qty) + _.toNumber(node.contract_qty);
+//                 node.end_qc_qty = _.toNumber(node.pre_qc_qty) + _.toNumber(node.qc_qty);
+//                 node.end_gather_qty = _.toNumber(node.pre_gather_qty) + _.toNumber(node.gather_qty);
+//             }
+//             node.gather_tp = _.toNumber(node.contract_tp) + _.toNumber(node.qc_tp);
+//             node.end_contract_tp = _.toNumber(node.pre_contract_tp) + _.toNumber(node.contract_tp);
+//             node.end_qc_tp = _.toNumber(node.pre_qc_tp) + _.toNumber(node.qc_tp);
+//             node.end_gather_tp = _.toNumber(node.pre_gather_tp) + _.toNumber(node.gather_tp);
+//             if (checkZero(node.dgn_qty1)) {
+//                 node.dgn_price = _.round(node.total_price/node.dgn_qty1, 2);
+//             } else {
+//                 node.dgn_price = null;
+//             }
+//         };
+//         this.splitChar = '-';
+//     }
+//
+//     initCheck() {
+//         const gatherNodes = this.stage.im_gather_node ? _.map(this.stage.im_gather_node.split(','), _.toNumber) : [];
+//         for (const node of this.gsTree.datas) {
+//             node.check = gatherNodes.indexOf(node.id) !== -1;
+//         }
+//     }
+//
+//     initData (ledger, curStage, stageDetail) {
+//         this.gsTree = createNewPathTree('stage', this.gsTreeSetting);
+//         this.gsTree.loadDatas(ledger);
+//
+//         this.gsTree.loadCurStageData(curStage);
+//         // 根据设置 计算 台账树结构
+//         treeCalc.calculateAll(this.gsTree);
+//
+//         this.initCheck();
+//         this.stageDetail = stageDetail;
+//     }
+//
+//     getNumberFormat(num, length) {
+//         let s = '0000000000';
+//         s = s + count;
+//         return s.substr(s.length - length);
+//     }
+//
+//     getNewImCode () {
+//         return this.pre + this.getNumberFormat(this.stage.order, 2) + this.splitChar + this.getNumberFormat(this.ImData.length + 1, 3);
+//     }
+//
+//     getFbfx (node) {
+//         // to do
+//         return node.name;
+//     }
+//
+//     getJldy (node) {
+//         return '';
+//     }
+//
+//     getPeg (node) {
+//         return '';
+//     }
+//
+//     buildTzImData (nodes) {
+//         if (!nodes || nodes.length === 0) { return; }
+//
+//         for (const node of nodes) {
+//             if (!node.code || node.code === '') { continue; }
+//
+//             if (this.gsTree.isLeafXmj(node)) {
+//                 if (node.gather_tp) {
+//                     const im = {
+//                         code: node.code,
+//                         tp: node.gather_tp,
+//                         im_code: this.getNewImCode(),
+//                         fbfx: this.getFbfx(node),
+//                         jldy: this.getJldy(node),
+//                         peg: this.getPeg(node),
+//                         drawing_code: this.getDrawingCode(node),
+//                     };
+//                     this.ImData.push(im);
+//                 }
+//             } else {
+//                 this.buildTzImData(node.children);
+//             }
+//         }
+//     }
+//
+//     buildTzImGatherData (nodes) {
+//
+//     }
+//
+//     buildZlImData (nodes) {
+//
+//     };
+//
+//     buildZlImGatherData (nodes) {
+//
+//     };
+//
+//     buildImData () {
+//         this.ImData = [];
+//         this.pre = (this.stage.im_pre && this.stage.im_pre !== '') ? this.stage.im_pre + this.splitChar : '';
+//         if (this.stage.im_type === imType.tz.value) {
+//             if (this.ctx.stage.im_gather) {
+//                 this.initCheck();
+//                 this.buildTzImGatherData(this.gsTree.children);
+//             } else {
+//                 this.buildTzImData(this.gsTree.children);
+//             }
+//         } else if (this.stage.im_type === imType.zl.value) {
+//             if (this.stage.im_gather) {
+//                 this.initCheck();
+//                 this.buildZlImGatherData(this.gsTree.children);
+//             } else {
+//                 this.buildZlImData(this.gsTree.children);
+//             }
+//         }
+//     }
+// }
+
+const stageIm = (function () {
+    const splitChar = '-';
+    let stage, imType, details, ImData, pre;
+    const gsTreeSetting = {
+        id: 'ledger_id',
+        pid: 'ledger_pid',
+        order: 'order',
+        level: 'level',
+        rootId: -1,
+        keys: ['id', 'tender_id', 'ledger_id'],
+        stageId: 'id',
+    };
+    gsTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'];
+    gsTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
+    gsTreeSetting.calcFun = function (node) {
+        if (node.children && node.children.length === 0) {
+            node.gather_qty = _.toNumber(node.contract_qty) + _.toNumber(node.qc_qty);
+            node.end_contract_qty = _.toNumber(node.pre_contract_qty) + _.toNumber(node.contract_qty);
+            node.end_qc_qty = _.toNumber(node.pre_qc_qty) + _.toNumber(node.qc_qty);
+            node.end_gather_qty = _.toNumber(node.pre_gather_qty) + _.toNumber(node.gather_qty);
+        }
+        node.gather_tp = _.toNumber(node.contract_tp) + _.toNumber(node.qc_tp);
+        node.end_contract_tp = _.toNumber(node.pre_contract_tp) + _.toNumber(node.contract_tp);
+        node.end_qc_tp = _.toNumber(node.pre_qc_tp) + _.toNumber(node.qc_tp);
+        node.end_gather_tp = _.toNumber(node.pre_gather_tp) + _.toNumber(node.gather_tp);
+        if (checkZero(node.dgn_qty1)) {
+            node.dgn_price = _.round(node.total_price/node.dgn_qty1, 2);
+        } else {
+            node.dgn_price = null;
+        }
+    };
+    const gsTree = createNewPathTree('stage', gsTreeSetting);
+
+    function init (s, i) {
+        stage = s;
+        imType = i;
+    }
+
+    function initCheck () {
+        const gatherNodes = stage.im_gather_node ? _.map(stage.im_gather_node.split(','), _.toNumber) : [];
+        for (const node of gsTree.datas) {
+            node.check = gatherNodes.indexOf(node.id) !== -1;
+        }
+
+    }
+
+    function loadData (ledger, curStage, stageDetail) {
+        gsTree.loadDatas(ledger);
+
+        gsTree.loadCurStageData(curStage);
+        // 根据设置 计算 台账树结构
+        treeCalc.calculateAll(gsTree);
+
+        this.initCheck();
+        details = stageDetail;
+    }
+
+    function getNumberFormat(num, length) {
+        let s = '0000000000';
+        s = s + num;
+        return s.substr(s.length - length);
+    }
+
+    function getNewImCode () {
+        return pre + getNumberFormat(stage.order, 2) + splitChar + getNumberFormat(ImData.length + 1, 3);
+    }
+
+    function getFbfx (node) {
+        // to do
+        return node.name;
+    }
+
+    function getJldy (node) {
+        return '';
+    }
+
+    function getPeg (node) {
+        return '';
+    }
+
+    function getDrawingCode(node) {
+        return '';
+    }
+
+    function generateTzImData (node) {
+        if (node.gather_tp) {
+            const im = {
+                lid: node.id,
+                code: node.code,
+                jl: node.gather_tp,
+                im_code: getNewImCode(),
+                fbfx: getFbfx(node),
+                jldy: getJldy(node),
+                peg: getPeg(node),
+                drawing_code: getDrawingCode(node),
+            };
+            ImData.push(im);
+        }
+    }
+
+    function generateZlImData (node) {
+        const nodeImData = [], posterity = gsTree.getPosterity(node);
+        for (const p of posterity) {
+            if (p.children && p.children.length > 0 ) { continue; }
+            if (!p.b_code || p.b_code === '') { continue }
+            if (!p.gather_qty || p.gather_qty === 0 ) { continue; }
+            let im = nodeImData.find(function (d) {
+                return d.code === p.b_code && p.name === d.name && p.unit === d.unit && checkZero(p.unit_price - d.unit_price);
+            });
+            if (!im) {
+                im = {
+                    lid: node.lid,
+                    code: p.b_code,
+                    name: p.name,
+                    unit: p.unit,
+                    unit_price: p.unit_price,
+                    jl: 0,
+                    im_code: getNewImCode(),
+                    fbfx: getFbfx(node),
+                    jldy: getJldy(node),
+                    peg: getPeg(node),
+                    drawing_code: getDrawingCode(node),
+                };
+                nodeImData.push(im);
+                ImData.push(im);
+            }
+            im.jl = _.add(im.jl, p.gather_qty);
+        }
+    }
+
+    function recursiveBuildImData (nodes) {
+        if (!nodes || nodes.length === 0) { return; }
+        for (const node of nodes) {
+            if (gsTree.isLeafXmj(node) || (stage.im_gather && node.check)) {
+                if (stage.im_type === imType.tz.value) {
+                    generateTzImData(node);
+                } else {
+                    generateZlImData(node);
+                }
+            } else {
+                recursiveBuildImData(node.children);
+            }
+        }
+    }
+
+    function buildImData () {
+        ImData = [];
+        pre = (stage.im_pre && stage.im_pre !== '') ? stage.im_pre + splitChar : '';
+        if (stage.im_gather) {
+            initCheck();
+        }
+        recursiveBuildImData(gsTree.children);
+        return ImData;
+    }
+
+    return {
+        getGsTree: function () {
+            return gsTree;
+        },
+        init,
+        initCheck,
+        loadData,
+        buildImData,
+        getImData: function () {
+            return ImData;
+        },
+    }
+})();

+ 1 - 1
app/router.js

@@ -63,7 +63,7 @@ module.exports = app => {
     app.post('/list/update', sessionAuth, 'tenderController.updateTender');
     app.post('/list/del', sessionAuth, 'tenderController.deleteTender');
     // 标段概况
-    app.get('/tender/:id/info', sessionAuth, tenderCheck, 'tenderController.tenderInfo');
+    app.get('/tender/:id', sessionAuth, tenderCheck, 'tenderController.tenderInfo');
     app.get('/tender/:id/type', sessionAuth, 'tenderController.tenderType');
     app.post('/tender/:id/save', sessionAuth, tenderCheck, 'tenderController.saveTenderInfo');
     app.post('/tender/rule', sessionAuth, 'tenderController.rule');

+ 0 - 1
app/service/ledger.js

@@ -1435,7 +1435,6 @@ module.exports = app => {
                 }
                 await this.transaction.commit();
             } catch (err) {
-                console.log(err);
                 await this.transaction.rollback();
                 throw err;
             }

+ 2 - 3
app/service/stage_bills.js

@@ -166,18 +166,17 @@ module.exports = app => {
                 throw '提交数据错误';
             }
             const posGather = await this.ctx.service.stagePos.getPosGather(tid, sid, lid, transaction);
-            console.log(posGather);
             if (!posGather) { return; }
 
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, ledgerBills.unit);
             // 计算
             if (posGather.contract_qty !== undefined) {
                 posGather.contract_qty = this.round(posGather.contract_qty, precision.value);
-                posGather.contract_tp = posGather.contract_qty * ledgerBills.unit_price;
+                posGather.contract_tp = this.round(posGather.contract_qty * ledgerBills.unit_price);
             }
             if (posGather.qc_qty !== undefined) {
                 posGather.qc_qty = this.round(posGather.qc_qty, precision.value);
-                posGather.qc_tp = posGather.qc_qty * ledgerBills.unit_price;
+                posGather.qc_tp = this.round(posGather.qc_qty * ledgerBills.unit_price);
             }
             if (stageBills) {
                 if (stageBills.contract_qty === posGather.contract_qty && stageBills.qc_qty === posGather.qc_qty) {

+ 79 - 84
app/view/stage/detail.ejs

@@ -30,105 +30,100 @@
             <!--左栏-->
             <div class="c-body col-8">
                 <!--上部分-->
-                <div class="sjs-height-1">
+                <div class="sjs-height-0">
                     <table class="table table-sm table-bordered">
+                        <thead>
                         <tr><th>编号</th><th>中间计量表号</th><th>交工证书/凭证号</th><th>分部分项工程</th><th>本期计量数量/金额</th></tr>
-                        <tr><td>403-1-a</td><td>1-1</td><td></td><td>k0+236大桥</td><td>100</td></tr>
+                        </thead>
+                        <tbody id="im-list">
+                        </tbody>
                     </table>
                 </div>
-                <!--下部分-->
-                <div class="bcontent-wrap">
-                    <div class="bc-bar mb-1">
-                        <ul class="nav nav-tabs">
-                            <li class="nav-item">
-                                <a class="nav-link active" data-toggle="tab" href="#zhongjian" role="tab">中间计量数据</a>
-                            </li>
-                            <li class="nav-item">
-                                <a class="nav-link" data-toggle="tab" href="#caotu" role="tab">计算草图</a>
-                            </li>
-                        </ul>
-                    </div>
-                    <div class="tab-content">
-                        <div class="tab-pane active" id="zhongjian">
-                            <div class="sp-wrap" style="overflow: auto">
-                                <div class="d-flex justify-content-end mt-1 mr-1">
-                                    <a href="#" class="btn btn-sm btn-outline-primary">编辑</a>
-                                    <a href="#" class="btn btn-sm btn-outline-success mr-1">保存</a>
-                                    <a href="#" class="btn btn-sm btn-outline-secondary">取消</a>
-                                </div>
-                                <div class="form-group">
-                                    <label>变更令号:</label>
-                                    <input class="form-control form-control-sm" type="text" readonly="">
-                                </div>
-                                <div class="form-group">
-                                    <label>部位:</label>
-                                    <input class="form-control form-control-sm" type="text" readonly="" value="左3#中横梁">
-                                </div>
-                                <div class="form-group">
-                                    <label>起始桩号:</label>
-                                    <input class="form-control form-control-sm" type="text" readonly="" value="K170+170.0">
-                                </div>
-                                <div class="form-group">
-                                    <label>终止桩号:</label>
-                                    <input class="form-control form-control-sm" type="text" readonly="" value="K170+170.0">
-                                </div>
-                                <div class="form-group">
-                                    <label>计量单元:</label>
-                                    <input class="form-control form-control-sm" type="text" readonly="" value="光圆钢筋(HPB235、HPB300)">
-                                </div>
-                                <div class="form-group">
-                                    <label>图号:</label>
-                                    <input class="form-control form-control-sm" type="text" readonly="" value="XL-1-13(通用图1)">
-                                </div>
-                                <div class="form-group">
-                                    <label>计算式说明:</label>
-                                    <textarea class="form-control" readonly=""></textarea>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="tab-pane" id="caotu">
-                            <div class="sp-wrap" style="overflow: auto">
-                                <div class="d-flex justify-content-between my-3">
-                                    <label>计算草图:</label>
-                                    <a href="#edit-img" data-toggle="modal" data-target="#edit-img">添加草图</a>
-                                </div>
-                                <p><img src="img/sketch/2.png" class="d-100"></p>
-                            </div>
-                        </div>
-                    </div>
-                </div>
             </div>
             <!--右栏-->
             <div class="c-body col">
-                <div class="sjs-bar">
+                <div class="side-bar-1 sjs-bar">
                     <ul class="nav nav-tabs">
                         <li class="nav-item">
-                            <a class="nav-link active" data-toggle="tab" href="#qingdan" role="tab">项目节</a>
+                            <a class="nav-link active" data-toggle="tab" href="#zhongjian" role="tab">中间计量数据</a>
                         </li>
-                    </ul>
-                </div>
-                <div class="sjs-height-3">
-                    <table class="table table-bordered">
-                        <tr><th>编号</th><th>名称</th></tr>
-                        <tr><td>1-4-1-5-1</td><td>桥台桩基础</td></tr>
-                        <tr><td>1-4-1-5-2</td><td>桥台桩基础</td></tr>
-                    </table>
-                </div>
-                <div class="sjs-bottom">
-                    <ul class="nav nav-tabs">
                         <li class="nav-item">
-                            <a class="nav-link active">部位明细</a>
+                            <a class="nav-link" data-toggle="tab" href="#xmujmx" role="tab">项目节明细</a>
                         </li>
                     </ul>
-                    <div class="tab-content">
-                        <div class="tab-pane active">
-                            <div class="sjs-bottom-2">
-                                <table class="table table-sm table-bordered">
-                                    <tr><th>部位</th><th>台帐数量</th><th>本期计量数量</th></tr>
-                                    <tr><td>0#桥台1#桩</td><td>126</td><td>40</td></tr>
-                                    <tr><td>0#桥台2#桩</td><td>126</td><td>40</td></tr>
+                </div>
+                <div class="tab-content">
+                    <div class="tab-pane active" id="zhongjian">
+                        <div class="sjs-sh-1" style="overflow: auto;">
+                            <div class="d-flex justify-content-end mt-1 mr-1">
+                                <a href="#" class="btn btn-sm btn-outline-primary">编辑</a>
+                                <a href="#" class="btn btn-sm btn-outline-success mr-1">保存</a>
+                                <a href="#" class="btn btn-sm btn-outline-secondary">取消</a>
+                            </div>
+                            <div class="form-group">
+                                <label>变更令号:</label>
+                                <input class="form-control form-control-sm" type="text" readonly="">
+                            </div>
+                            <div class="form-group">
+                                <label>部位:</label>
+                                <input class="form-control form-control-sm" type="text" readonly="" value="左3#中横梁">
+                            </div>
+                            <div class="form-group">
+                                <label>起始桩号:</label>
+                                <input class="form-control form-control-sm" type="text" readonly="" value="K170+170.0">
+                            </div>
+                            <div class="form-group">
+                                <label>终止桩号:</label>
+                                <input class="form-control form-control-sm" type="text" readonly="" value="K170+170.0">
+                            </div>
+                            <div class="form-group">
+                                <label>计量单元:</label>
+                                <input class="form-control form-control-sm" type="text" readonly="" value="光圆钢筋(HPB235、HPB300)">
+                            </div>
+                            <div class="form-group">
+                                <label>图号:</label>
+                                <input class="form-control form-control-sm" type="text" readonly="" value="XL-1-13(通用图1)">
+                            </div>
+                            <div class="form-group">
+                                <label>计算式说明:</label>
+                                <textarea class="form-control" readonly=""></textarea>
+                            </div>
+                            <div class="form-group">
+                                <div class="d-flex justify-content-between my-3">
+                                    <label>计算草图:</label>
+                                    <a href="#edit-img" data-toggle="modal" data-target="#edit-img">添加草图</a>
+                                </div>
+                                <p><img src="img/sketch/2.png" class="d-100"></p>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="tab-pane" id="xmujmx">
+                        <div class="sjs-sh-1" style="overflow: auto;">
+                            <div class="sjs-height-3">
+                                <table class="table table-bordered">
+                                    <tr><th>编号</th><th>名称</th></tr>
+                                    <tr><td>1-4-1-5-1</td><td>桥台桩基础</td></tr>
+                                    <tr><td>1-4-1-5-2</td><td>桥台桩基础</td></tr>
                                 </table>
                             </div>
+                            <div class="sjs-bottom">
+                                <ul class="nav nav-tabs">
+                                    <li class="nav-item">
+                                        <a class="nav-link active">部位明细</a>
+                                    </li>
+                                </ul>
+                                <div class="tab-content">
+                                    <div class="tab-pane active">
+                                        <div class="sjs-bottom-2">
+                                            <table class="table table-sm table-bordered">
+                                                <tr><th>部位</th><th>台帐数量</th><th>本期计量数量</th></tr>
+                                                <tr><td>0#桥台1#桩</td><td>126</td><td>40</td></tr>
+                                                <tr><td>0#桥台2#桩</td><td>126</td><td>40</td></tr>
+                                            </table>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
                         </div>
                     </div>
                 </div>

+ 1 - 1
app/view/stage/detail_modal.ejs

@@ -26,7 +26,7 @@
                 </div>
                 <div class="form-group">
                     <label>中间计量表号前缀</label>
-                    <input type="text" class="form-control form-control-sm" value="<%- ctx.stage.im_pre ? ctx.stage.im_pre : '' %>" id="im-pre">
+                    <input type="text" class="form-control form-control-sm" value="<%- ctx.stage.im_pre ? ctx.stage.im_pre : '' %>" id="im-pre" maxlength="10">
                 </div>
                 <div class="form-group">
                     <label> </label>

+ 1 - 0
config/web.js

@@ -102,6 +102,7 @@ const JsFiles = {
                 mergeFiles: [
                     "/public/js/spreadjs_rela/spreadjs_zh.js",
                     "/public/js/path_tree.js",
+                    "/public/js/stage_im.js",
                     "/public/js/stage_detail.js",
                 ],
                 mergeFile: 'stage_detail',