瀏覽代碼

定额库编辑器附注条件。

Chenshilong 8 年之前
父節點
當前提交
0e6500c9a3

+ 9 - 0
server.js

@@ -152,6 +152,15 @@ app.get('/rationRepository/lmm', function(req, res) {
             userID: req.session.userID
         });
 });
+
+app.get('/rationRepository/coeList', function(req, res) {
+    res.render('rationLibEditor/fuzhu.html',
+        {
+            userAccount: req.session.userAccount,
+            userID: req.session.userID
+        });
+});
+
 app.use("/rationRepository/api",rationRepository_Router);
 
 app.get("/stdBillsmain", function(req, res){

+ 2 - 2
web/rationLibEditor/dinge.html

@@ -28,10 +28,10 @@
                       <a class="nav-link active px-3" id ="dinge" >定额</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="gongliao" href="/rationLibEditor/lmm">工料机</a>
+                      <a class="nav-link px-3" id="gongliao" href="#">工料机</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" id="fuzhu" href="/rationLibEditor/fuzhu">附注条件</a>
+                      <a class="nav-link px-3" id="fuzhu" href="#">附注条件</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link px-3" href="#maz">安装增加费</a>

+ 64 - 144
web/rationLibEditor/fuzhu.html

@@ -7,29 +7,29 @@
     <meta http-equiv="x-ua-compatible" content="ie=edge">
     <title>定额库编辑器</title>
     <link rel="stylesheet" href="/web/css/bootstrap/bootstrap.min.css">
-    <link rel="stylesheet" href="/web/css/bootstrap/themes.css">
     <link rel="stylesheet" href="/web/css/main.css">
     <link rel="stylesheet" href="/web/css/font-awesome/font-awesome.min.css">
+    <link rel="stylesheet" href="/web/css/spreadjs/gc.spread.sheets.10.0.1.css" type="text/css">
     <!--zTree-->
-  	<link rel="stylesheet" href="/web/css/ztree/zTreeStyle.css" type="text/css">
+    <link rel="stylesheet" href="/web/css/ztree/zTreeStyle.css" type="text/css">
 </head>
 
 <body>
     <div class="header">
         <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
             <span class="header-logo px-2">Smartcost</span>
-            <div id="rationname" class="navbar-text"><a href="main.html">定额库</a><i class="fa fa-angle-right fa-fw"></i>XXX定额库</div>
+            <div class="navbar-text"><a href="main.html">定额库</a><i class="fa fa-angle-right fa-fw"></i>XXX定额库</div>
         </nav>
         <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
               <ul class="nav nav-tabs" role="tablist">
                   <li class="nav-item">
-                      <a class="nav-link px-3" href="dinge.html">定额</a>
+                      <a class="nav-link px-3" id="drirect-dinge" href="javascript:void(0);">定额</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" href="gongliao.html">工料机</a>
+                      <a class="nav-link px-3" id="gongliao" href="javascript:void(0);">工料机</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link active px-3" href="fuzhu.html">附注条件</a>
+                      <a class="nav-link active px-3">附注条件</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link px-3" href="#maz">安装增加费</a>
@@ -42,7 +42,8 @@
             <div class="container-fluid">
                 <div class="row">
                   <div class="main-side col-lg-7 p-0">
-                    <table class="table table-sm table-bordered m-0">
+                    <div class="main-data" id="mainSpread" style="height: 600px;">
+                   <!-- <table class="table table-sm table-bordered m-0">
                       <thead>
                         <tr>
                           <th></th>
@@ -76,12 +77,32 @@
                           <td>深6m以内</td>
                           <td>人工×26.72</td>
                         </tr>
+                        <tr>
+                          <td>5</td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
+                        </tr>
+                        <tr>
+                          <td>6</td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
+                        </tr>
+                        <tr>
+                          <td>7</td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
+                        </tr>
                       </tbody>
-                    </table>
+                    </table>-->
+                    </div>
                   </div>
                   <div class="main-content col-lg-5 p-0">
-                    <div class="m-2">
-                      <p><div class="form-check"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios" id="optionsRadios1" value="option1" checked> 工料机整体调整</label></div></p>
+                      <div id="contentSpread" style="height: 400px;">
+                    <!--<div class="m-2">
+                      <p><div class="form-check"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios" id="optionsRadios1" value="option1" checked> 工料机整体调整</label>&nbsp;&nbsp;<label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios" id="optionsRadios1" value="option1"> 单个工料机调整</label></div></p>
                     </div>
                     <table class="table table-sm table-bordered m-0">
                       <thead>
@@ -89,7 +110,6 @@
                           <th>名称</th>
                           <th>操作符</th>
                           <th>数量</th>
-                          <th>操作</th>
                         </tr>
                       </thead>
                       <tbody>
@@ -97,24 +117,21 @@
                           <td>人工</td>
                           <td>*</td>
                           <td>1.18</td>
-                          <td><a href="javacript:void(0);" data-toggle="modal" data-target="#editZgl" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td>
                         </tr>
                         <tr>
                           <td>材料</td>
                           <td></td>
                           <td></td>
-                          <td><a href="javacript:void(0);" data-toggle="modal" data-target="#editZgl" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td>
                         </tr>
                         <tr>
                           <td>机械</td>
                           <td></td>
                           <td></td>
-                          <td><a href="javacript:void(0);" data-toggle="modal" data-target="#editZgl" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td>
                         </tr>
                       </tbody>
                     </table>
                     <div class="m-2">
-                      <p><div class="form-check"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios1" id="optionsRadios" value="option1" checked> 单个工料机调整</label></div></p>
+                      <p><div class="form-check"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios1" id="optionsRadios" value="option1"> 工料机整体调整</label>&nbsp;&nbsp;<label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios1" id="optionsRadios" value="option1" checked> 单个工料机调整</label></div></p>
                     </div>
                     <table class="table table-sm table-bordered m-0">
                       <thead>
@@ -124,7 +141,6 @@
                           <th>名称</th>
                           <th>操作符</th>
                           <th>数量</th>
-                          <th>选择</th>
                         </tr>
                       </thead>
                       <tbody>
@@ -134,148 +150,52 @@
                           <td>人工</td>
                           <td>*</td>
                           <td>1.18</td>
-                          <td><a href="javacript:void(0);" data-toggle="modal" data-target="#editDgl" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td>
+                        </tr>
+                        <tr>
+                          <td>2</td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
+                        </tr>
+                        <tr>
+                          <td>3</td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
+                        </tr>
+                        <tr>
+                          <td>4</td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
+                          <td></td>
                         </tr>
                       </tbody>
-                    </table>
-                    <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#add" class="btn btn-primary btn-sm">添加</a></div>
+                    </table>-->
                   </div>
                 </div>
             </div>
         </div>
     </div>
 
-    <!--弹出添加-->
-    <div class="modal fade" id="add" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">添加单个工料机</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>操作符</label>
-                      <select class="form-control"><option>选择操作符</option><option>*</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>数量</label>
-                      <input class="form-control" placeholder="输入数量" type="number">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">确定</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出编辑-->
-    <div class="modal fade" id="editZgl" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">编辑整体工料机</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>操作符</label>
-                      <select class="form-control"><option>选择操作符</option><option>*</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>数量</label>
-                      <input class="form-control" placeholder="输入数量" type="number">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">确定</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <div class="modal fade" id="editDgl" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">编辑单个工料机</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>操作符</label>
-                      <select class="form-control"><option>选择操作符</option><option>*</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>数量</label>
-                      <input class="form-control" placeholder="输入数量" type="number">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">确定</a>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!--弹出删除-->
-    <div class="modal fade" id="del" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">删除确认</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                    <h5 class="text-danger">删除后无法恢复,确认是否删除?</h5>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-danger">删除</a>
-                </div>
-            </div>
-        </div>
-    </div>
     <!-- JS. -->
     <script src="/lib/jquery/jquery.min.js"></script>
     <script src="/lib/tether/tether.min.js"></script>
     <script src="/lib/bootstrap/bootstrap.min.js"></script>
     <script src="/lib/global.js"></script>
     <!-- zTree -->
-  	<script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>
-  	<script type="text/javascript" src="/lib/ztree/jquery.ztree.excheck.js"></script>
+    <script src = "/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
+    <script>GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";</script>
+    <script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>
+    <script type="text/javascript" src="/lib/ztree/jquery.ztree.excheck.js"></script>
+    <script type="text/javascript" src="/lib/ztree/jquery.ztree.exedit.js"></script>
+    <script type="text/javascript" src="/public/web/treeDataHelper.js"></script>
+    <script type="text/javascript" src="/public/QueryParam.js"></script>
+    <script type="text/javascript" src="/web/rationLibEditor/js/coeList.js"></script>
+    <!--<script type="text/javascript" src="/web/rationLibEditor/js/zTreeCommon.js"></script>-->
+    <!--<script type="text/javascript" src="/web/rationLibEditor/js/sheetCommon.js"></script>-->
     <SCRIPT type="text/javascript">
   		<!--
   		var setting = {

+ 1 - 1
web/rationLibEditor/gongliao.html

@@ -29,7 +29,7 @@
                       <a class="nav-link active px-3">工料机</a>
                   </li>
                   <li class="nav-item">
-                      <a class="nav-link px-3" href="/rationLibEditor/fuzhu">附注条件</a>
+                      <a class="nav-link px-3" id="fuzhu" href="javascript:void(0);">附注条件</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link px-3" href="#maz">安装增加费</a>

+ 92 - 0
web/rationLibEditor/js/coeList.js

@@ -0,0 +1,92 @@
+/**
+ * Created by CSL on 2017-05-18.
+ */
+
+$("#drirect-dinge").click(function(){
+    $(this).attr('href', "/rationRepository/ration" + "?repository=" + getQueryString("repository"))
+});
+
+$("#gongliao").click(function(){
+    $(this).attr('href', "/rationRepository/lmm" + "?repository=" + getQueryString("repository"))
+});
+
+pObj = {
+    spread: null,
+
+    createSheet: function (container, colDef, datas){
+        var me = this;
+        me.spread = new GC.Spread.Sheets.Workbook(container, {sheetCount:1});
+        me.spread.suspendPaint();
+
+        me.spread.options.tabStripVisible = false;
+        me.spread.options.showHorizontalScrollbar = false;
+
+        var sheet = me.spread.getSheet(0);
+        var sheetArea = GC.Spread.Sheets.SheetArea;
+        sheet.setRowHeight(0, 30, sheetArea.colHeader);
+        sheet.autoGenerateColumns = false;
+        sheet.setDataSource(datas);
+        sheet.bindColumns(colDef);
+        sheet.getRange(-1, 2, -1, 1).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
+
+        me.spread.resumePaint();
+    }
+};
+
+
+var colDefMain = [
+    {name: "ID", displayName: "编号", size: 100},
+    {name: "name", displayName: "名称", size: 200},
+    {name: "content", displayName: "内容", size: 250}
+];
+
+var colDefContent = [
+    {name: "coeType", displayName: "类型", size: 100},
+    {name: "gljID", displayName: "工料机ID", size: 100},
+    {name: "operator", displayName: "操作符", size: 60},
+    {name: "amount", displayName: "数量", size: 80}
+];
+
+pObj.createSheet($('#mainSpread')[0], colDefMain, createDatas(50));
+pObj.createSheet($('#contentSpread')[0], colDefContent, createContents(10));
+
+
+function createDatas(counts){
+    var datas = [];
+    var names = ['洞内排水量15m3/h以内', '二级以上松土', '三四级石方', '灌注桩,水平泵送混凝土距离100m', '用于拆除工程'];
+    for (var i = 0; i < counts; i++) {
+        var data = new Object();
+        data.ID = i;
+        data.name = names[i % names.length] + i;
+        data.content = '附注条件' + data.name + '之内容部分';
+        datas.push(data);
+    };
+    return datas;
+}
+
+function createContents(counts){
+    var datas = [];
+    var types = ['人工类', '材料类', '机械类','单GLJ','全部'];
+    var operators = ['+', '-', '*', '/', '='];
+    for (var i = 0; i < counts; i++) {
+        var data = new Object();
+        data.coeType = types[i % types.length];
+        data.gljID = (data.coeType == '单GLJ') ? Math.floor(Math.random() * 1000) : 0;
+        data.operator = operators[i % operators.length];
+        data.amount = Math.floor(Math.random() * 1000) / 100;
+        datas.push(data);
+    };
+    return datas;
+}
+
+function testObj2(obj) {
+    var str = "";
+    var spr = "";
+    for (var x in obj) {
+        if (obj.hasOwnProperty(x)) {
+            if(str == ''){ spr = '' } else { spr = ', '};
+            str += spr + x + ':' + obj[x];
+        }
+    }
+    return str;
+};

+ 4 - 0
web/rationLibEditor/js/ration.js

@@ -6,6 +6,10 @@ $("#gongliao").click(function(){
     $(this).attr('href', "/rationRepository/lmm" + "?repository=" + getQueryString("repository"))
 });
 
+$("#fuzhu").click(function(){
+    $(this).attr('href', "/rationRepository/coeList" + "?repository=" + getQueryString("repository"))
+});
+
 var rationOprObj = {
     workBook: null,
     currentRations: {},

+ 4 - 0
web/rationLibEditor/js/repositoryGLJ.js

@@ -6,6 +6,10 @@ $("#drirect-dinge").click(function(){
     $(this).attr('href', "/rationRepository/ration" + "?repository=" + getQueryString("repository"))
 });
 
+$("#fuzhu").click(function(){
+    $(this).attr('href', "/rationRepository/coeList" + "?repository=" + getQueryString("repository"))
+});
+
 var pageOprObj = {
     rationLibName : null,
     initPage : function(container) {