Browse Source

Merge branch '1.0.0_online' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost into 1.0.0_online

zhangweicheng 7 years ago
parent
commit
26966ea5bb

+ 6 - 0
modules/all_models/compilation.js

@@ -59,6 +59,12 @@ let modelSchema = {
     release_time: {
         type: Number,
         default: 0
+    },
+
+    // cld 办事处id
+    categoryID: {
+        type: Number,
+        default: 12 // 总部id
     }
 };
 mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));

+ 1 - 1
modules/pm/controllers/pm_controller.js

@@ -79,7 +79,7 @@ module.exports = {
     },
     updateProjects: async function (req, res) {
         let data = JSON.parse(req.body.data);
-        await ProjectsData.updateUserProjects(req.session.sessionUser.id, req.session.sessionCompilation._id, data.updateData, function (err, message, data) {
+        await ProjectsData.updateUserProjects(req.session.sessionUser.id, req.session.sessionCompilation._id, req.session.sessionCompilation.name, data.updateData, function (err, message, data) {
             if (err === 0) {
                 callback(req, res, err, message, data);
             } else {

+ 3 - 2
modules/pm/models/project_model.js

@@ -105,7 +105,7 @@ ProjectsDAO.prototype.getUserProject = function (userId, ProjId, callback) {
     });
 };
 
-ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId, datas, callback) {
+ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId, compilationName, datas, callback) {
     let data, project, updateLength = 0, hasError = false, deleteInfo = null, i, newProject;
     let updateAll = function (err) {
         if (!err) {
@@ -169,7 +169,8 @@ ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId
                     //data.updateData.property.basicInformation = basicInformation;
                     //工程特征
                     if(data.updateData.property.featureLibID){
-                        data.updateData.property.projectFeature = await pmFacade.getProjectFeature(data.updateData.property.featureLibID, data.updateData.property.engineeringName);
+                        //工程专业显示费用定额的名称
+                        data.updateData.property.projectFeature = await pmFacade.getProjectFeature(data.updateData.property.featureLibID, compilationName);
                     }
                     /*projectFeature[0]['value'] = data.updateData.property.engineeringName || '';
                     data.updateData.property.projectFeature = projectFeature;*/

+ 73 - 0
modules/users/controllers/cld_controller.js

@@ -0,0 +1,73 @@
+'use strict';
+
+/**
+ * CLD接口相关控制器
+ *
+ * @author EllisRan.
+ * @date 2018/9/25
+ * @version
+ */
+
+import CLDModel from "../models/cld_model";
+import UserModel from "../models/user_model"
+import CompilationModel from "../models/compilation_model";
+
+class CLDController {
+
+    /**
+     * 获取cld办事处人员信息
+     *
+     * @param request
+     * @param reponse
+     * @return {Promise.<void>}
+     */
+    async getCategoryStaff(request, response) {
+        let category = request.query.category;
+        try {
+            let cldModel = new CLDModel();
+            let result = await cldModel.getCategoryStaff(category);
+            response.json({error: 0, msg: 'success', data: JSON.parse(result)});
+        } catch (err) {
+            response.json({error: 1, msg: err});
+        }
+    }
+
+    /**
+     * cld 获取建筑用户和编办接口
+     *
+     * @param request
+     * @param response
+     * @return {Promise.<void>}
+     */
+    async getUsersAndCompilationList(request, response) {
+        let mobile = request.query.mobile;
+        try {
+            //获取用户信息
+            let userModel = new UserModel();
+            let userData = await userModel.findDataByMobile(mobile);
+            if (userData === null || userData === '') {
+                throw '不存在该建筑用户';
+            }
+
+            //获取编办列表
+            let compilationModel = new CompilationModel();
+            let compilationList = await compilationModel.getList();
+            if (userData.upgrade_list !== undefined) {
+                let userUpgradeList = userData.upgrade_list;
+                for (let index in userUpgradeList) {
+                    let oneCompilationIndex = compilationList.findIndex(function (item) {
+                        return item.id === userUpgradeList[index].compilationID;
+                    });
+                    if (oneCompilationIndex !== -1) {
+                        compilationList[oneCompilationIndex].isUpgrade = userUpgradeList[index].isUpgrade;
+                    }
+                }
+            }
+            response.json({error: 0, msg: 'success', data: { userInfo: userData, compilationList: compilationList }});
+        } catch (err) {
+            response.json({error: 1, msg: err});
+        }
+    }
+}
+
+export default CLDController;

+ 48 - 0
modules/users/models/cld_model.js

@@ -0,0 +1,48 @@
+'use strict';
+
+/**
+ * cld接口模型
+ *
+ * @author EllisRan.
+ * @date 2018/9/25
+ * @version
+ */
+
+import Request from "request";
+import BaseModel from "../../common/base/base_model";
+
+class CLDModel extends BaseModel {
+
+    CLDUrl = 'http://cld.smartcost.com.cn';
+
+    /**
+     * 获取办事处人员信息
+     *
+     * @param cid
+     * @return {Promise}
+     */
+    async getCategoryStaff(cid) {
+        let postData = {
+            url: this.CLDUrl + '/api/building/category/staff/' + cid,
+            encoding: 'utf8'
+        };
+        return new Promise(function (resolve, reject) {
+            try {
+                // 请求接口
+                Request.post(postData, function (err, postResponse, body) {
+                    if (err) {
+                        throw '请求错误';
+                    }
+                    if (postResponse.statusCode !== 200) {
+                        throw 'CLD通讯失败!';
+                    }
+                    resolve(body);
+                });
+            } catch (error) {
+                reject([]);
+            }
+        });
+    }
+}
+
+export default CLDModel;

+ 1 - 1
modules/users/models/compilation_model.js

@@ -28,7 +28,7 @@ class CompilationModel extends BaseModel {
      */
     async getList() {
         // 筛选字段
-        let field = {_id: 1, name: 1, is_release: 1, description: 1};
+        let field = {_id: 1, name: 1, is_release: 1, description: 1, categoryID: 1};
         let compilationData = await this.findDataByCondition({name: {$ne: ''}, is_release: true}, field, false);
 
         return compilationData === null ? [] : compilationData;

+ 24 - 0
modules/users/routes/cld_route.js

@@ -0,0 +1,24 @@
+'use strict';
+
+/**
+ * CLD接口路由
+ *
+ * @author EllisRan.
+ * @date 2018/9/25
+ * @version
+ */
+
+import express from "express";
+import CLDController from "../controllers/cld_controller";
+
+
+module.exports = function (app) {
+    let router = express.Router();
+    let cldController = new CLDController();
+    // 登录页面action
+    router.get('/getCategoryStaff', cldController.getCategoryStaff);
+
+    router.get('/getUsersAndCompilation', cldController.getUsersAndCompilationList);
+
+    app.use('/cld',router)
+};

+ 2 - 2
server.js

@@ -55,8 +55,8 @@ app.use(session({
 // 登录状态全局判断
 app.use(function (req, res, next) {
     let url = req.originalUrl;
-    if (/^\/login/.test(url) || /\.map|\.ico$/.test(url) || /^\/sms/.test(url)) {
-        // 如果是登录页面或短信接口则忽略判断数据
+    if (/^\/login/.test(url) || /\.map|\.ico$/.test(url) || /^\/sms/.test(url) || /^\/cld/.test(url)) {
+        // 如果是登录页面或短信接口或cld接口则忽略判断数据
         next();
     } else {
         try {

+ 12 - 3
web/building_saas/css/main.css

@@ -309,6 +309,18 @@ a{
 .bottom-content .tab-content .ovf-hidden{
     overflow: hidden;
 }
+.tn-nav{
+    width:30px;
+    height: 100%;
+    border-left:1px solid #dee2e6 ;
+}
+.tn-nav > span{
+    width:20px;
+}
+.tn-nav:hover{
+    background:#f7f7f9;
+    cursor: pointer;
+}
 .form-signin {
     max-width: 500px;
     margin: 150px auto;
@@ -399,9 +411,6 @@ a{
 .custom-file-input:lang(zh) ~ .custom-file-label::after {
     content: "浏览";
 }
-.custom-file-input{
-    cursor: pointer;
-}
 
 .message-box {
     position:absolute;

+ 1 - 1
web/building_saas/fee_rates/fee_rate.html

@@ -156,7 +156,7 @@
                 </div>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-primary" data-dismiss="modal" id="renameConfirm" disabled>确定</button>
+                <button type="button" class="btn btn-primary" id="renameConfirm">确定</button>
                 <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
             </div>
         </div>

+ 109 - 157
web/building_saas/main/html/main.html

@@ -173,174 +173,117 @@
                                       <div class="main-data-bottom ovf-hidden" style="display: none" id="comments">
                                           <textarea class="form-control" rows="8" readonly=""></textarea>
                                       </div>
-                                      <div id="tzjnrCon" class="main-data-bottom" style="background: #F1F1F1">
-                                          <div class="col-4" style="width: 33%; float: left; margin: 0; padding:0;">
-                                              <div class="main-data-bottom ovf-hidden" id="jobSpread">
-                                              </div>
-                                              <!--工具栏-->
-                                              <div class="bottom-tools btn-group position-absolute">
-                                                  <a href="javascript:void(0);" id="jobInsert" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
-                                                  <a href="javascript:void(0);" id="jobAdd" class="btn btn-sm " data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
-                                                  <a href="javascript:void(0);" id="jobDel" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
-                                                  <a href="javascript:void(0);" id="jobDown" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
-                                                  <a href="javascript:void(0);" id="jobUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
-                                              </div>
-                                          </div>
-                                          <div class="col-4" style="width: 33%; float: left; margin: 0; padding:0;">
-                                              <div class="main-data-bottom ovf-hidden"  id="itemSpread">
+                                      <div id="tzjnrCon" class="container-fluid main-data-bottom" style="background: #F1F1F1">
+                                          <div class="row" style="overflow: hidden">
+                                              <div class="col-4 p-0">
+                                                  <div class="main-data-bottom ovf-hidden" id="jobSpread">
+                                                  </div>
+                                                  <!--工具栏-->
+                                                  <div class="bottom-tools btn-group position-absolute">
+                                                      <a href="javascript:void(0);" id="jobInsert" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
+                                                      <a href="javascript:void(0);" id="jobAdd" class="btn btn-sm " data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
+                                                      <a href="javascript:void(0);" id="jobDel" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
+                                                      <a href="javascript:void(0);" id="jobDown" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
+                                                      <a href="javascript:void(0);" id="jobUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                                                  </div>
                                               </div>
-                                              <!--工具栏-->
-                                              <div class="bottom-tools btn-group position-absolute">
-                                                  <a href="javascript:void(0);" id="itemInsert" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
-                                                  <a href="javascript:void(0);" id="itemAdd" class="btn btn-sm " data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
-                                                  <a href="javascript:void(0);" id="itemDel" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
-                                                  <a href="javascript:void(0);" id="itemDown" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
-                                                  <a href="javascript:void(0);" id="itemUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                                              <div class="col-4 p-0">
+                                                  <div class="main-data-bottom ovf-hidden"  id="itemSpread">
+                                                  </div>
+                                                  <!--工具栏-->
+                                                  <div class="bottom-tools btn-group position-absolute">
+                                                      <a href="javascript:void(0);" id="itemInsert" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
+                                                      <a href="javascript:void(0);" id="itemAdd" class="btn btn-sm " data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加"><i class="fa fa-plus" aria-hidden="true"></i></a>
+                                                      <a href="javascript:void(0);" id="itemDel" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
+                                                      <a href="javascript:void(0);" id="itemDown" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
+                                                      <a href="javascript:void(0);" id="itemUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                                                  </div>
                                               </div>
-                                          </div>
-                                          <div class="col-4" style="width: 33%; float: left; margin: 0; padding:0;">
-                                              <div class="main-data-bottom" id="add-rule" style="display: none;">
-                                                  <div class="container-fluid my-2">
-                                                      <p style="text-align: center">
-                                                          <% if (projectData.property.lockBills == true) { %>
-                                                          <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-current">应用到选中清单</button>
-                                                          <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-all">应用到所有清单</button>
-                                                          <% } else { %>
-                                                          <button class="btn btn-primary btn-sm" type="button" id="use-to-current">应用到选中清单</button>
-                                                          <button class="btn btn-primary btn-sm" type="button" id="use-to-all">应用到所有清单</button>
-                                                          <% } %>
-                                                      </p>
-                                                      <div class="mb-1 row">
-                                                          <label class="col-5 px-0 col-form-label text-right">添加位置:</label>
-                                                          <div class="col-7">
-                                                              <select id="add-position" class="form-control form-control-sm">
-                                                                  <option value="1" selected="selected">添加到项目特征列</option>
-                                                                  <option value="2">添加到清单名称列</option>
-                                                                  <option value="3">添加到工作内容列</option>
-                                                                  <option value="4">分别添加到对应列</option>
-                                                              </select>
+                                              <!-- <div class="col-auto p-0">
+                                                   <div class="tn-nav d-flex align-items-start flex-column" data-toggle="tooltip" data-placement="left" title="" data-original-title="打开排版规则">
+                                                       <span class="mt-3 ml-2 text-primary">排版规则</span>
+                                                       <i class="fa fa-arrow-left mt-auto mb-3 text-primary ml-2"></i>
+                                                   </div>
+                                               </div>-->
+                                              <div class="col-4 p-0">
+                                                  <div class="main-data-bottom" id="add-rule" style="display: none;">
+                                                      <div class="container-fluid my-2">
+                                                          <p style="text-align: center">
+                                                              <% if (projectData.property.lockBills == true) { %>
+                                                              <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-current">应用到选中清单</button>
+                                                              <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-all">应用到所有清单</button>
+                                                              <% } else { %>
+                                                              <button class="btn btn-primary btn-sm" type="button" id="use-to-current">应用到选中清单</button>
+                                                              <button class="btn btn-primary btn-sm" type="button" id="use-to-all">应用到所有清单</button>
+                                                              <% } %>
+                                                          </p>
+                                                          <div class="mb-1 row">
+                                                              <label class="col-5 px-0 col-form-label text-right">添加位置:</label>
+                                                              <div class="col-7">
+                                                                  <select id="add-position" class="form-control form-control-sm">
+                                                                      <option value="1" selected="selected">添加到项目特征列</option>
+                                                                      <option value="2">添加到清单名称列</option>
+                                                                      <option value="3">添加到工作内容列</option>
+                                                                      <option value="4">分别添加到对应列</option>
+                                                                  </select>
+                                                              </div>
                                                           </div>
-                                                      </div>
-                                                      <div class="mb-1 row">
-                                                          <label class="col-sm-5 px-0 col-form-label text-right">添加内容:</label>
-                                                          <div class="col-sm-7">
-                                                              <select id="add-content" class="form-control form-control-sm">
-                                                                  <option value="">无</option>
-                                                                  <option value="1" selected="selected">项目特征+工作内容</option>
-                                                                  <option value="2">工作内容+项目特征</option>
-                                                                  <option value="3">项目特征</option>
-                                                                  <option value="4">工作内容</option>
-                                                                  <option value="5">定额子目</option>
-                                                              </select>
+                                                          <div class="mb-1 row">
+                                                              <label class="col-sm-5 px-0 col-form-label text-right">添加内容:</label>
+                                                              <div class="col-sm-7">
+                                                                  <select id="add-content" class="form-control form-control-sm">
+                                                                      <option value="">无</option>
+                                                                      <option value="1" selected="selected">项目特征+工作内容</option>
+                                                                      <option value="2">工作内容+项目特征</option>
+                                                                      <option value="3">项目特征</option>
+                                                                      <option value="4">工作内容</option>
+                                                                      <option value="5">定额子目</option>
+                                                                  </select>
+                                                              </div>
                                                           </div>
-                                                      </div>
-                                                      <div class="mb-1 row">
-                                                          <label class="col-5 px-0 col-form-label text-right">显示格式:</label>
-                                                          <div class="col-7">
-                                                              <select id="display-format" class="form-control form-control-sm">
-                                                                  <option value="1" selected="selected">换行分隔</option>
-                                                                  <option value="2">逗号分隔</option>
-                                                                  <option value="3">括号分隔</option>
-                                                              </select>
+                                                          <div class="mb-1 row">
+                                                              <label class="col-5 px-0 col-form-label text-right">显示格式:</label>
+                                                              <div class="col-7">
+                                                                  <select id="display-format" class="form-control form-control-sm">
+                                                                      <option value="1" selected="selected">换行分隔</option>
+                                                                      <option value="2">逗号分隔</option>
+                                                                      <option value="3">括号分隔</option>
+                                                                  </select>
+                                                              </div>
                                                           </div>
-                                                      </div>
-                                                      <div class="mb-1 row">
-                                                          <label class="col-5 px-0 col-form-label text-right">特征生成方式:</label>
-                                                          <div class="col-7">
-                                                              <select id="character-format" class="form-control form-control-sm">
-                                                                  <option value="1">特征值</option>
-                                                                  <option value="2" selected="selected">特征:特征值</option>
-                                                              </select>
+                                                          <div class="mb-1 row">
+                                                              <label class="col-5 px-0 col-form-label text-right">特征生成方式:</label>
+                                                              <div class="col-7">
+                                                                  <select id="character-format" class="form-control form-control-sm">
+                                                                      <option value="1">特征值</option>
+                                                                      <option value="2" selected="selected">特征:特征值</option>
+                                                                  </select>
+                                                              </div>
                                                           </div>
-                                                      </div>
-                                                      <div class="mb-1 row">
-                                                          <label class="col-5 px-0 col-form-label text-right">子目生成方式:</label>
-                                                          <div class="col-7">
-                                                              <select id="child-display-format" disabled="disabled" class="form-control form-control-sm">
-                                                                  <option value="1" selected="selected">编号+定额名称</option>
-                                                                  <option value="2">序号+定额名称</option>
-                                                              </select>
+                                                          <div class="mb-1 row">
+                                                              <label class="col-5 px-0 col-form-label text-right">子目生成方式:</label>
+                                                              <div class="col-7">
+                                                                  <select id="child-display-format" disabled="disabled" class="form-control form-control-sm">
+                                                                      <option value="1" selected="selected">编号+定额名称</option>
+                                                                      <option value="2">序号+定额名称</option>
+                                                                  </select>
+                                                              </div>
                                                           </div>
-                                                      </div>
-                                                      <div class="mb-1 row">
-                                                          <label class="col-5 px-0 col-form-label text-right">序号格式:</label>
-                                                          <div class="col-7">
-                                                              <select id="serial-type" class="form-control form-control-sm">
-                                                                  <option value="">无</option>
-                                                                  <option value="1" selected="selected">1.</option>
-                                                                  <option value="2">a.</option>
-                                                                  <option value="3">A.</option>
-                                                              </select>
+                                                          <div class="mb-1 row">
+                                                              <label class="col-5 px-0 col-form-label text-right">序号格式:</label>
+                                                              <div class="col-7">
+                                                                  <select id="serial-type" class="form-control form-control-sm">
+                                                                      <option value="">无</option>
+                                                                      <option value="1" selected="selected">1.</option>
+                                                                      <option value="2">a.</option>
+                                                                      <option value="3">A.</option>
+                                                                  </select>
+                                                              </div>
                                                           </div>
                                                       </div>
                                                   </div>
                                               </div>
                                           </div>
-                                          <!--<div id="add-rule" style="width: 34%;float: left;background: #EFEFEF; height: 100%;display: none; padding-left: 8px;">
-                                              <p style="text-align: center">添加规则</p>
-                                              <p>
-                                                  <label class="title">添加位置:</label>
-                                                  <select id="add-position">
-                                                      <option value="1" selected="selected">添加到项目特征列</option>
-                                                      <option value="2">添加到清单名称列</option>
-                                                      <option value="3">添加到工作内容列</option>
-                                                      <option value="4">分别添加到对应列</option>
-                                                  </select>
-                                              </p>
-                                              <p>
-                                                  <label class="title">添加内容:</label>
-                                                  <select id="add-content">
-                                                      <option value="">无</option>
-                                                      <option value="1" selected="selected">项目特征+工作内容</option>
-                                                      <option value="2">工作内容+项目特征</option>
-                                                      <option value="3">项目特征</option>
-                                                      <option value="4">工作内容</option>
-                                                      <option value="5">定额子目</option>
-                                                  </select>
-                                              </p>
-                                              <p>
-                                                  <label class="title">显示格式:</label>
-                                                  <select id="display-format">
-                                                      <option value="1" selected="selected">换行分隔</option>
-                                                      <option value="2">逗号分隔</option>
-                                                      <option value="3">括号分隔</option>
-                                                  </select>
-                                              </p>
-                                              <p>
-                                                  <label class="title">特征生成方式:</label>
-                                                  <select id="character-format">
-                                                      <option value="1">特征值</option>
-                                                      <option value="2" selected="selected">特征:特征值</option>
-                                                  </select>
-                                              </p>
-                                              <p>
-                                                  <label class="title">子目生成方式:</label>
-                                                  <select id="child-display-format" disabled="disabled">
-                                                      <option value="1" selected="selected">编号+定额名称</option>
-                                                      <option value="2">序号+定额名称</option>
-                                                  </select>
-                                              </p>
-                                              <p>
-                                                  <label class="title">序号格式:</label>
-                                                  <select id="serial-type">
-                                                      <option value="">无</option>
-                                                      <option value="1" selected="selected">1.</option>
-                                                      <option value="2">a.</option>
-                                                      <option value="3">A.</option>
-                                                  </select>
-                                              </p>
-                                              <p style="text-align: center">
-                                                  <% if (projectData.property.lockBills == true) { %>
-                                                  <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-current">应用到选中清单</button>
-                                                  <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-all">应用到所有清单</button>
-                                                  <% } else { %>
-                                                  <button class="btn btn-primary btn-sm" type="button" id="use-to-current">应用到选中清单</button>
-                                                  <button class="btn btn-primary btn-sm" type="button" id="use-to-all">应用到所有清单</button>
-                                                  <% } %>
-                                                  &lt;!&ndash;<button class="btn btn-primary btn-sm" type="button" id="use-to-current">应用到选中清单</button>
-                                                  <button class="btn btn-primary btn-sm" type="button" id="use-to-all">应用到所有清单</button>&ndash;&gt;
-                                              </p>
-                                          </div>-->
                                       </div>
                                   </div>
                               </div>
@@ -791,7 +734,7 @@
                                                 </label>
                                             </div>
                                         </fieldset>
-                                            <label style="margin-top: 320px">将影响所有建设项目</label>
+                                            <label style="margin-top: 320px">*将影响所有建设项目</label>
                                     </div>
                                 </div>
                             </div>
@@ -1508,6 +1451,15 @@
         </div>
     </div>
 
+    <img src="/web/dest/css/img/folder_open.png" id="folder_open_pic" style="display: none">
+    <img src="/web/dest/css/img/folder_close.png" id="folder_close_pic" style="display: none">
+    <img src="/web/dest/css/img/project.png" id="proj_pic" style="display: none">
+    <img src="/web/dest/css/img/engineering.png" id="eng_pic" style="display: none">
+    <img src="/web/dest/css/img/tender.png" id="tender_pic" style="display: none">
+
+    <img src="/web/dest/css/img/blockLib.png" id="blockLib_pic" style="display: none">
+    <img src="/web/dest/css/img/folder_open.png" id="folder_pic" style="display: none">
+    <img src="/web/dest/css/img/tender.png" id="block_pic" style="display: none">
 
         <!-- JS. -->
     <script src = "/lib/spreadjs/sheets/gc.spread.sheets.all.11.1.2.min.js"></script>

+ 257 - 150
web/building_saas/main/js/views/block_lib.js

@@ -2,185 +2,292 @@
  * Created by CSL on 2018-09-19.
  */
 var blockLibObj = {
-    datas: [],
     mainSpread: null,
     mainSheet: null,
+    mainTree: null,
+    mainTreeController: null,
     mainSetting: {
-        header:[
-            {headerName:"名称",headerWidth:400,dataCode:"name", dataType: "String"}
-        ],
-        view:{
-            comboBox:[],
-            lockColumns:[],
-            colHeaderHeight: CP_Col_Width.colHeader,
-            rowHeaderWidth: CP_Col_Width.rowHeader
-        }
+        "emptyRowHeader": true,
+        "rowHeaderWidth": 15,
+        "emptyRows":0,
+        "headRows":1,
+        "headRowHeight":[30],
+        "defaultRowHeight": 21,
+        "treeCol": 0,
+        "cols":[{
+            "width":400,
+            "readOnly": true,
+            "head":{
+                "titleNames":["名称"],
+                "spanCols":[1],
+                "spanRows":[1],
+                "vAlign":[1],
+                "hAlign":[1],
+                "font":["Arial"]
+            },
+            "data":{
+                "field":"name",
+                "vAlign":1,
+                "hAlign":0,
+                "font":"Arial"
+            }
+        }]
     },
-    buildSheet: function (){
+    mainDatas: [],
+    buildSheet: function () {
+        $.bootstrapLoading.start();
         let me = this;
-        me.datas = [];
+        me.mainDatas = [
+            {ID: 1, ParentID: -1, NextSiblingID: 8, name: '我的块模板库1', type: 0},
+            {ID: 2, ParentID: 1, NextSiblingID: 3, name: '分类1', type: 1},
+            {ID: 3, ParentID: 1, NextSiblingID: -1, name: '分类2', type: 1},
+            {ID: 4, ParentID: 2, NextSiblingID: 5, name: '子类A', type: 1},
+            {ID: 5, ParentID: 2, NextSiblingID: -1, name: '子类B', type: 1},
+            {ID: 6, ParentID: 4, NextSiblingID: 7, name: '块1', type: 2},
+            {ID: 7, ParentID: 4, NextSiblingID: -1, name: '块2', type: 2},
+            {ID: 8, ParentID: -1, NextSiblingID: -1, name: '我的块模板库2', type: 0}
+        ];
+
         if (me.mainSpread) {
             me.mainSpread.destroy();
             me.mainSpread = null;
         };
-
-        me.mainSpread = sheetCommonObj.buildSheet($('#div_block_tree')[0], me.mainSetting, me.datas.length);
-        sheetCommonObj.spreadDefaultStyle(me.mainSpread);
+        me.mainSpread = SheetDataHelper.createNewSpread($('#div_block_tree')[0]);
         me.mainSheet = me.mainSpread.getSheet(0);
-        // sheetCommonObj.showData(me.mainSheet, me.mainSetting, me.datas);
-    },
-    showData: function () {
-        let me = this;
-        let sheet =me.mainSheet;
-        let cols = me.mainSetting.header;
-        let datas = me.datas;
-        let fuc = function () {
-            sheet.setRowCount(datas.length);
-            me.initTree(true);
-            // sheet.setFormatter(-1, 1, '@');
-            for(let col = 0, cLen = cols.length; col < cLen; col++){
-                // sheet.getRange(-1, col, -1, 1).hAlign(GC.Spread.Sheets.HorizontalAlign[cols[col]['hAlign']]);
-                // sheet.getRange(-1, col, -1, 1).vAlign(GC.Spread.Sheets.VerticalAlign[cols[col]['vAlign']]);
-                for(let row = 0, rLen = datas.length; row < rLen; row++){
-                    sheet.setValue(row, col, datas[row][cols[col]['dataCode']]);
-                }
-            }
+        me.mainSheet.name('blockLibSheet');
+        sheetCommonObj.spreadDefaultStyle(me.mainSpread);
+        // me.mainSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onCellDoubleClick);
+
+        var showblockTree = function (datas) {
+            me.mainTree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1, autoUpdate: false});
+            me.mainTreeController = TREE_SHEET_CONTROLLER.createNew(me.mainTree, me.mainSheet, me.mainSetting);
+            me.mainTree.loadDatas(datas);
+            me.mainTreeController.showTreeData();
+            me.mainSheet.getRange(-1, 0, -1, 1).cellType(me.getTreeCell(me.mainTree));
+/*            me.mainTreeController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, function (node) {
+                rationLibObj.loadSectionRations(node && node.children.length === 0 ? node.getID() : null);
+            });
+            if (me.mainTree.firstNode() && me.mainTree.firstNode().length === 0) {
+                rationLibObj.loadSectionRations(me.mainTree.firstNode().getID());
+            } else {
+                rationLibObj.loadSectionRations();
+            };*/
         };
-        sheet.suspendPaint();
-        sheet.suspendEvent();
-        fuc();
-        sheet.resumePaint();
-        sheet.resumeEvent();
+
+/*        CommonAjax.post('/complementaryRation/api/getRationTree', {userId: userID, rationRepId: rationLibID}, function (datas) {
+            showblockTree(datas);
+            $.bootstrapLoading.end();
+        }, function () {
+            showblockTree([]);
+            $.bootstrapLoading.end();
+        });*/
+
+        showblockTree(me.mainDatas);
+        $.bootstrapLoading.end();
     },
-    initTree: function (collapse) {
+    getTreeCell: function (tree) {
         let me = this;
-        me.mainSheet.getRange(-1, 0, -1, 1).cellType(me.getTreeNodeCellType(me.datas));
-        for(let i =0, len = me.datas.length; i < len; i++){
-            if(me.datas[i].hasOwnProperty('items')){
-                let collapsed = false;
-                if(collapse){
-                    me.datas[i].collapsed = false;
-                    collapsed = true;
-                }else {
-                    collapsed = me.datas[i].collapsed == undefined ? true : me.datas[i].collapsed;
+        let indent = 20, levelIndent = -5, halfBoxLength = 5, halfExpandLength = 3, imgWidth = 14, imgHeight = 14;
+        let TreeCell = function () {};
+        TreeCell.prototype = new GC.Spread.Sheets.CellTypes.Text();
+        TreeCell.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
+            if (style.backColor) {
+                ctx.save();
+                ctx.fillStyle = style.backColor;
+                ctx.fillRect(x, y, w, h);
+                ctx.restore();
+            } else {
+                ctx.clearRect(x, y, w, h);
+            };
+
+            let drawLine = function (canvas, x1, y1, x2, y2, color) {
+                ctx.save();
+                ctx.translate(0.5, 0.5);
+                ctx.beginPath();
+                ctx.moveTo(x1, y1);
+                ctx.lineTo(x2, y2);
+                ctx.strokeStyle = color;
+                ctx.stroke();
+                ctx.restore();
+            };
+            let drawExpandBox = function (ctx, x, y, w, h, centerX, centerY, expanded) {
+                let rect = {}, h1, h2, offset = 1;
+                rect.top = centerY - halfBoxLength;
+                rect.bottom = centerY + halfBoxLength;
+                rect.left = centerX - halfBoxLength;
+                rect.right = centerX + halfBoxLength;
+
+                if (rect.left < x + w) {
+                    rect.right = Math.min(rect.right, x + w);
+
+                    ctx.save();
+                    ctx.translate(0.5, 0.5);
+                    ctx.strokeStyle = 'black';
+                    ctx.beginPath();
+                    ctx.moveTo(rect.left, rect.top);
+                    ctx.lineTo(rect.left, rect.bottom);
+                    ctx.lineTo(rect.right, rect.bottom);
+                    ctx.lineTo(rect.right, rect.top);
+                    ctx.lineTo(rect.left, rect.top);
+                    ctx.stroke();
+                    ctx.fillStyle = 'white';
+                    ctx.fill();
+                    ctx.restore();
+
+                    // Draw Horizontal Line
+                    h1 = centerX - halfExpandLength;
+                    h2 = Math.min(centerX + halfExpandLength, x + w);
+                    if (h2 > h1) {
+                        drawLine(ctx, h1, centerY, h2, centerY, 'black');
+                    }
+                    // Draw Vertical Line
+                    if (!expanded && (centerX < x + w)) {
+                        drawLine(ctx, centerX, centerY - halfExpandLength, centerX, centerY + halfExpandLength, 'black');
+                    }
                 }
-            }
-        }
-    },
-    getTreeNodeCellType: function (data) {
-        var ns = GC.Spread.Sheets;
-        var rectW = 10;
-        var rectH = 10;
-        var margin = 3;
-        function TreeNodeCellType() {
-        }
 
-        function drowRect(ctx,x,y,w,h) {///
-            ctx.save();
-            ctx.strokeStyle = "gray";
-            ctx.translate(0.5,0.5);
-            ctx.beginPath();
-            var rectX = x+margin;
-            var rectY =  y+ Math.round(h/2)-rectH/2;
-            ctx.moveTo(rectX, rectY);
-            ctx.lineTo(rectX, rectY+rectH);
-            ctx.lineTo(rectX+rectW, rectY+rectH);
-            ctx.lineTo(rectX+rectW, rectY);
-            ctx.lineTo(rectX, rectY);
-            ctx.moveTo(rectX+rectW, y+Math.round(h/2));
-            ctx.lineTo(rectX+rectW+5, y+Math.round(h/2));
-            ctx.stroke();
-            ctx.restore();
-        }
+            };
+
+            let node = tree.items[options.row];
+            if (!node) return;
+            let showTreeLine = true;
+            let centerX = Math.floor(x) + node.depth() * indent + node.depth() * levelIndent + indent / 2;
+            let x1 = centerX + indent / 2;
+            let centerY = Math.floor((y + (y + h)) / 2);
+            let y1;
 
-        function drowSymbol(ctx,x,y,w,h,collapsed) {
-            ctx.save();
-            ctx.strokeStyle = "#000000";
-            ctx.translate(0.5, 0.5);
-            ctx.beginPath();
-            ctx.moveTo(x+margin+2, y+Math.round(h/2));
-            ctx.lineTo(x+margin+8, y+Math.round(h/2));
-            var rectY =  y+ Math.round(h/2)-rectH/2;
-            if(collapsed){
-                ctx.moveTo(x+margin+rectW/2,rectY+2);
-                ctx.lineTo(x+margin+rectW/2,rectY+2+6);
+            // Draw Horizontal Line、Image、sibling Vertical Line
+            if (centerX < x + w) {
+                // Draw Horizontal Line
+                drawLine(ctx, centerX, centerY, Math.min(x1, x + w), centerY, 'gray');
+
+                // Draw Image
+                let imgId;
+                if (node.data.type === 0) imgId = 'blockLib_pic'
+                else if (node.data.type === 1) imgId = 'folder_pic'
+                else if (node.data.type === 2) {
+                    imgId = 'block_pic';
+                };
+                let img = document.getElementById(imgId);
+                ctx.drawImage(img, centerX+indent/2+3, centerY - 7, imgWidth, imgHeight);
+
+                // Draw Vertical Line
+                y1 = node.isLast() ? centerY : y + h;
+                if (node.isFirst() && !node.parent/*.parent*/) {
+                    drawLine(ctx, centerX, centerY, centerX, y1, 'gray');
+                } else {
+                    drawLine(ctx, centerX, y, centerX, y1, 'gray');
+                }
             }
-            ctx.stroke();
-            ctx.restore();
-        }
 
-        function drowSubItem(ctx,x,y,w,h,offset,nextItem) {
-            offset+=6;
-            ctx.save();
-            ctx.strokeStyle = "gray";
-            ctx.translate(0.5, 0.5);
-            ctx.beginPath();
-            ctx.moveTo(x+offset, y);
-            ctx.lineTo(x+offset, y+Math.round(h/2));
-            offset+=9;
-            ctx.lineTo(x+offset, y+Math.round(h/2));
-            if(nextItem&&!nextItem.hasOwnProperty('items')){
-                ctx.moveTo(x+offset-9, y+Math.round(h/2));
-                ctx.lineTo(x+offset-9, y+h);
+            // Draw Expand Box
+            if (node.children.length > 0) {
+                drawExpandBox(ctx, x, y, w, h, centerX, centerY, node.expanded);
             }
-            ctx.stroke();
-            ctx.restore();
-            return offset;
-        }
 
-        TreeNodeCellType.prototype = new ns.CellTypes.Text();
-        TreeNodeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
-            if(value!=null){
-                var offset = margin+rectW+6;
-                var recode = data[options.row];
-                if(recode&&recode.hasOwnProperty('items')){
-                    drowRect(ctx,x,y,w,h);
-                    var collapsed = recode.collapsed==undefined?true:recode.collapsed;//options.sheet.getTag(options.row,options.col);
-                    drowSymbol(ctx,x,y,w,h,collapsed);
-                }else if(recode&&!recode.hasOwnProperty('items')){
-                    offset= drowSubItem(ctx,x,y,w,h,offset,data[options.row+1]);
-                    offset+=1;
+            // Draw Parent Line
+            var curNode = node.parent, parentCenterX = centerX - indent - levelIndent;
+            while (curNode) {
+                if (!curNode.isLast()) {
+                    if (parentCenterX < x + w) {
+                        drawLine(ctx, parentCenterX, y, parentCenterX, y + h, 'gray');
+                    }
                 }
-                arguments[2] = x + offset;
-                arguments[4] = w - offset;
-                GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
+                curNode = curNode.parent;
+                parentCenterX -= (indent + levelIndent);
+            }
 
+            // Draw Text
+            x = x + (node.depth() + 1) * indent +  node.depth() * levelIndent + imgWidth + 3;
+            w = w - (node.depth() + 1) * indent - node.depth() * levelIndent - imgWidth - 3;
+            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
+        };
+        TreeCell.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
+            let info = {x: x, y: y, row: context.row, col: context.col, cellStyle: cellStyle, cellRect: cellRect, sheetArea: context.sheetArea};
+            let node = tree.items[info.row];
+            let offset = -1;
+            let centerX = info.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
+            let text = context.sheet.getText(info.row, info.col);
+            let value = context.sheet.getValue(info.row, info.col);
+            let acStyle = context.sheet.getActualStyle(info.row, info.col),
+                zoom = context.sheet.zoom();
+            let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: context.sheet, row: info.row, col: info.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
+            if(info.x > centerX + halfBoxLength && info.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength){
+                info.isReservedLocation = true;
             }
+            return info;
         };
-        TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
-            return {
-                x: x,
-                y: y,
-                row: context.row,
-                col: context.col,
-                cellStyle: cellStyle,
-                cellRect: cellRect,
-                sheetArea: context.sheetArea
-            };
-        }
-        TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
-            var recode = data[hitinfo.row];
-            if(recode&&recode.hasOwnProperty('items')){
-                var hoffset= hitinfo.cellRect.x+3;
-                if (hitinfo.x > hoffset && hitinfo.x < hoffset + 10){
-                    var collapsed = recode.collapsed==undefined?true:recode.collapsed;
-                    collapsed = !collapsed
-                    recode.collapsed=collapsed;
-                    //hitinfo.sheet.setTag(hitinfo.row,hitinfo.col,collapsed);
-                    hitinfo.sheet.getRange(hitinfo.row+1, -1, recode.items.length, -1).visible(!collapsed);
+        TreeCell.prototype.processMouseDown = function (hitinfo) {
+            let offset = -1;
+            let node = tree.items[hitinfo.row];
+            let centerX = hitinfo.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
+            let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
+            let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
+            let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
+            let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
+                zoom = hitinfo.sheet.zoom();
+            let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
+            //(图标+名字)区域
+            function withingClickArea(){
+                return hitinfo.x > centerX + halfBoxLength && hitinfo.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength;
+            }
+
+            if (hitinfo.x > centerX - halfBoxLength && hitinfo.x < centerX + halfBoxLength && hitinfo.y > centerY - halfBoxLength && hitinfo.y < centerY + halfBoxLength) {
+                node.setExpanded(!node.expanded);
+                TREE_SHEET_HELPER.massOperationSheet(hitinfo.sheet, function () {
+                    let iCount = node.posterityCount(), i, child;
+                    for (i = 0; i < iCount; i++) {
+                        child = tree.items[hitinfo.row + i + 1];
+                        hitinfo.sheet.setRowVisible(hitinfo.row + i + 1, child.visible, hitinfo.sheetArea);
+                    }
                     hitinfo.sheet.invalidateLayout();
-                    hitinfo.sheet.repaint();
-                }
+                });
+                hitinfo.sheet.repaint();
+            }
+        };
+        TreeCell.prototype.processMouseMove = function (hitInfo) {
+            let sheet = hitInfo.sheet;
+            let div = sheet.getParent().getHost();
+            let canvasId = div.id + "vp_vp";
+            let canvas = $(`#${canvasId}`)[0];
+            //改变鼠标图案
+            if (sheet && hitInfo.isReservedLocation) {
+                canvas.style.cursor='pointer';
+                return true;
+            }else{
+                canvas.style.cursor='default';
             }
+            return false;
         };
-        return new TreeNodeCellType();
+        TreeCell.prototype.processMouseEnter = function (hitinfo) {
+            let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
+            let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
+            let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
+            let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
+                zoom = hitinfo.sheet.zoom();
+            let node = me.mainTree.items[hitinfo.row];
+            let nodeIndent = node ? (node.depth() + 1) * indent +  node.depth() * levelIndent + imgWidth + 3 : 0;
+            let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
+            let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
+            if(textLength > cellWidth - nodeIndent){
+                TREE_SHEET_HELPER.showTipsDiv(text,{pos: {}},hitinfo);
+            }
+        };
+        TreeCell.prototype.processMouseLeave = function (hitinfo) {
+            let me = this;
+            TREE_SHEET_HELPER.tipDiv = 'hide';
+            if (TREE_SHEET_HELPER._toolTipElement) {
+                $(TREE_SHEET_HELPER._toolTipElement).hide();
+                TREE_SHEET_HELPER._toolTipElement = null;
+            };
+            TREE_SHEET_HELPER.tipDivCheck();//延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
+        }
+        return new TreeCell();
     }
 };
 
 $(document).ready(function(){
-/*    if (!blockLibObj.mainSpread){
-        blockLibObj.buildSheet();
-        blockLibObj.showData();
-    }*/
-
+    // if (!blockLibObj.mainSpread){
+    //     blockLibObj.buildSheet();
+    // }
 });

+ 1 - 0
web/building_saas/main/js/views/calc_base_view.js

@@ -130,6 +130,7 @@ let calcBaseView = {
                 me.inputExpr.val(insertStr);
             }
         }
+        me.workBook.focus(false);
         me.inputExpr.focus();
     },
     isDef: function (v) {

+ 32 - 6
web/building_saas/main/js/views/fee_rate_view.js

@@ -786,14 +786,29 @@ var feeRateObject={
             alert("请选择一个费率文件!");
             return;
         }
-        var currentOption = _.find(this.changeInfo.currentProject.currentOptions,{name:name})
+        var callback=function (data) {
+            if(data){
+                //$('#renameConfirm').attr("disabled","disabled");
+                $('#renameError').text("本建设项目中已存在同名费率文件。").show();
+                $('#rename-lv').modal('show');
+                $("#newFeeRateID").val(feeRateFileID);
+                $("#newFeeRateName").val(name);
+            }else {
+                //$('#renameConfirm').removeAttr("disabled");
+                $('#renameError').hide();
+                feeRateObject.changeFeeRateFileConfirm(feeRateFileID,name);
+            }
+        };
+        projectObj.project.FeeRate.checkFeeRateName(name,callback);
+
+       /* var currentOption = _.find(this.changeInfo.currentProject.currentOptions,{name:name})
         if(currentOption){
             $("#rename-lv").modal({show:true});
             $("#newFeeRateID").val(feeRateFileID);
             $("#newFeeRateName").val(name);
         }else {
             this.changeFeeRateFileConfirm(feeRateFileID,name);
-        }
+        }*/
     },
     changeFeeRateFileConfirm:function(feeRateFileID,name){
         $.bootstrapLoading.start();
@@ -941,16 +956,16 @@ $(function(){
     $('#newFeeRateName').change(function () {
         var newName = $(this).val();
         if(!newName||newName==""){
-            $('#renameConfirm').attr("disabled","disabled");
+            //$('#renameConfirm').attr("disabled","disabled");
             $('#renameError').text("请输入文件名称。").show();
             return;
         }
         var callback=function (data) {
             if(data){
-                $('#renameConfirm').attr("disabled","disabled");
+                //$('#renameConfirm').attr("disabled","disabled");
                 $('#renameError').text("本建设项目中已存在同名费率文件。").show();
             }else {
-                $('#renameConfirm').removeAttr("disabled");
+                //$('#renameConfirm').removeAttr("disabled");
                 $('#renameError').hide();
             }
         };
@@ -988,7 +1003,18 @@ $(function(){
     $('#renameConfirm').bind('click',function (){
         var feeRateFileID= $("#newFeeRateID").val();
         var name = $("#newFeeRateName").val();
-        feeRateObject.changeFeeRateFileConfirm(feeRateFileID,name);
+        var callback=function (data) {
+            if(data){
+                $('#renameError').text("已存在同名费率文件。").show();
+                $("#newFeeRateID").val(feeRateFileID);
+                $("#newFeeRateName").val(name);
+            }else {
+                $('#renameError').hide();
+                $('#rename-lv').modal('hide');
+                feeRateObject.changeFeeRateFileConfirm(feeRateFileID,name);
+            }
+        };
+        projectObj.project.FeeRate.checkFeeRateName(name,callback);
     })
 
 

+ 1 - 1
web/building_saas/pm/html/project-management-Recycle.html

@@ -20,7 +20,7 @@
                 </button>
             </div>
             <div class="modal-body">
-                <p><i class="fa fa-cubes"></i> 汽车生产车间 下的单位工程都将恢复都将恢复,恢复后将重命名为</p>
+                <p><i class="fa fa-cubes"></i> 汽车生产车间 下的单位工程都将恢复,恢复后将重命名为</p>
                 <p><b>建筑工程2(10-25 14:33:15恢复)</b>、<b>建筑工程3(10-25 14:33:15恢复)</b></p>
                 <p> 点“确定”按钮,确认从回收站中恢复。</p>
             </div>

+ 2 - 2
web/building_saas/pm/html/project-management.html

@@ -73,12 +73,12 @@
                         <li class="nav-item" data-original-title="分享" data-placement="right" data-toggle="tooltip">
                             <a class="nav-link" href="#pm_share" id="tab_pm_share" data-toggle="tab"><i class="fa fa-share-alt"></i></a>
                         </li>
-                        <li class="nav-item" data-original-title="协同工作" data-placement="right" data-toggle="tooltip">
+                        <!--<li class="nav-item" data-original-title="协同工作" data-placement="right" data-toggle="tooltip">
                             <a class="nav-link" href="javascript:void(0);"><i class="fa fa-users"></i></a>
                         </li>
                         <li class="nav-item" data-original-title="归档" data-placement="right" data-toggle="tooltip">
                             <a class="nav-link" href="javascript:void(0);"><i class="fa fa-book"></i></a>
-                        </li>
+                        </li>-->
                         <li class="nav-item" data-original-title="回收站" data-placement="right" data-toggle="tooltip">
                             <a class="nav-link" href="#pm_gc" id="tab_pm_gc" data-toggle="tab"><i class="fa fa-trash"></i></a>
                         </li>

+ 3 - 3
web/building_saas/pm/js/pm_gc.js

@@ -615,10 +615,10 @@ function v_getMoBody(type, oprNode, nodes){
         }
         else {
             if(oprNode.data.projType === projectType.project){
-                html += '<p><i class="fa fa-cubes"></i> ' + oprNode.data.name + '下的单位工程都将恢复都将恢复,恢复后将重命名为</p>';
+                html += '<p><i class="fa fa-cubes"></i> ' + oprNode.data.name + '下的单位工程都将恢复,恢复后将重命名为</p>';
             }
             else if(oprNode.data.projType === projectType.engineering){
-                html += '<p><i class="fa fa-cube"></i> ' + oprNode.data.name + '下的单位工程都将恢复都将恢复,恢复后将重命名为</p>';
+                html += '<p><i class="fa fa-cube"></i> ' + oprNode.data.name + '下的单位工程都将恢复,恢复后将重命名为</p>';
             }
             html += ('<p>');
             for(let i = 0, len = nodes.length; i < len; i++){
@@ -650,7 +650,7 @@ function v_getFiles(type, files, tenders, opr = null){
         return false;
     }
     for(let i = 0, len = files.length; i < len; i ++){
-        let recName = type === fileType.unitPriceFile ?  files[i].name + '单价文件' : files[i].name + '费率文件';
+        let recName = type === fileType.unitPriceFile ?  files[i].name : files[i].name;
         let fileId = type === fileType.unitPriceFile ? files[i].id : files[i].ID;
         let recTimeA = formatDate(new Date(files[i].deleteInfo.deleteDateTime), 'yyyy-MM-dd');
         let recTimeB = formatDate(new Date(files[i].deleteInfo.deleteDateTime), 'HH:mm:ss');

BIN
web/dest/css/img/block.png


BIN
web/dest/css/img/blocklib.png


+ 1 - 1
web/users/html/login.html

@@ -14,7 +14,7 @@
 <body>
     <div class="container">
         <form class="form-signin" method="post" onsubmit="return false">
-            <h1 class="d-flex justify-content-center">Smartcost</h1>
+            <h1 class="d-flex justify-content-center">纵横云计价</h1>
             <h4 class="d-flex justify-content-center mb-2">用户登录</h4>
             <div class="form-group">
                 <input id="inputEmail" class="form-control " name="inputEmail" placeholder="通行账号 邮箱/手机" autofocus="" />

+ 5 - 90
web/users/html/user-buy.html

@@ -88,9 +88,9 @@
                                         <li class="list-group-item d-flex justify-content-between">
                                             <%= compilation.name %>
                                             <% if (compilation.isUpgrade === undefined || compilation.isUpgrade !== true) { %>
-                                            <a class="btn btn-primary btn-sm" href="activ" data-toggle="modal" data-target="#activ">立即激活</a>
+                                            <a href="javascript:void(0);" class="btn btn-primary btn-sm getcategory" data-upgrade="<%= compilation.isUpgrade %>" data-category="<%= compilation.categoryID %>">立即激活</a>
                                             <% } else { %>
-                                            <a class="btn btn-outline-secondary btn-sm" href="activ2" data-toggle="modal" data-target="#activ2"><i class="fa fa-check"></i> 已激活</a>
+                                            <a href="javascript:void(0);" class="btn btn-outline-secondary btn-sm getcategory" data-title="<%= compilation.name %>" data-upgrade="<%= compilation.isUpgrade %>" data-category="<%= compilation.categoryID %>"><i class="fa fa-check"></i> 已激活</a>
                                             <% } %>
                                         </li>
                                         <% }) %>
@@ -108,18 +108,18 @@
             </div>
         </div>
     </div>
-    <!--激活产品-->
+    <!--激活产品 & 售后服务-->
     <div class="modal fade" id="activ" data-backdrop="static" style="display: none;" aria-hidden="true">
         <div class="modal-dialog modal-lg" role="document">
             <div class="modal-content">
                 <div class="modal-header">
-                  <h5 class="modal-title">联系销售代表激活</h5>
+                  <h5 class="modal-title" id="upgrade-title">联系销售代表激活</h5>
                   <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">×</span>
                   </button>
                 </div>
                 <div class="modal-body">
-                  <div class="row px-3">
+                  <div class="row px-3" id="staffList">
                     <div class="col-4 mb-4">
                       <div class="card">
                         <div class="card-body">
@@ -206,91 +206,6 @@
             </div>
         </div>
     </div>
-    <!--售后服务-->
-    <div class="modal fade" id="activ2" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog modal-lg" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">重庆(2015)售后服务</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <div class="row px-3">
-                    <div class="col-4 mb-4">
-                      <div class="card">
-                        <div class="card-body">
-                          <h4 class="card-title">王星植</h4>
-                          <h6 class="card-subtitle mb-2 text-muted">重庆办</h6>
-                        </div>
-                        <ul class="list-group list-group-flush">
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="腾讯QQ"><i class="fa fa-qq"></i> 914630468</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="手机号码"><i class="fa fa-tablet"></i> 15812644017</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="固定电话"><i class="fa fa-phone"></i> 0756-3850891</li>
-                        </ul>
-                      </div>
-                    </div>
-                    <div class="col-4 mb-4">
-                      <div class="card">
-                        <div class="card-body">
-                          <h4 class="card-title">张文远</h4>
-                          <h6 class="card-subtitle mb-2 text-muted">重庆办</h6>
-                        </div>
-                        <ul class="list-group list-group-flush">
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="腾讯QQ"><i class="fa fa-qq"></i> 914630468</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="手机号码"><i class="fa fa-tablet"></i> 15812644017</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="固定电话"><i class="fa fa-phone"></i> 0756-3850891</li>
-                        </ul>
-                      </div>
-                    </div>
-                    <div class="col-4 mb-4">
-                      <div class="card">
-                        <div class="card-body">
-                          <h4 class="card-title">李清学</h4>
-                          <h6 class="card-subtitle mb-2 text-muted">重庆办</h6>
-                        </div>
-                        <ul class="list-group list-group-flush">
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="腾讯QQ"><i class="fa fa-qq"></i> 914630468</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="手机号码"><i class="fa fa-tablet"></i> 15812644017</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="固定电话"><i class="fa fa-phone"></i> 0756-3850891</li>
-                        </ul>
-                      </div>
-                    </div>
-                    <div class="col-4 mb-4">
-                      <div class="card">
-                        <div class="card-body">
-                          <h4 class="card-title">周洪波</h4>
-                          <h6 class="card-subtitle mb-2 text-muted">重庆办</h6>
-                        </div>
-                        <ul class="list-group list-group-flush">
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="腾讯QQ"><i class="fa fa-qq"></i> 914630468</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="手机号码"><i class="fa fa-tablet"></i> 15812644017</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="固定电话"><i class="fa fa-phone"></i> 0756-3850891</li>
-                        </ul>
-                      </div>
-                    </div>
-                    <div class="col-4 mb-4">
-                      <div class="card">
-                        <div class="card-body">
-                          <h4 class="card-title">邹芝达</h4>
-                          <h6 class="card-subtitle mb-2 text-muted">重庆办</h6>
-                        </div>
-                        <ul class="list-group list-group-flush">
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="腾讯QQ"><i class="fa fa-qq"></i> 914630468</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="手机号码"><i class="fa fa-tablet"></i> 15812644017</li>
-                          <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="固定电话"><i class="fa fa-phone"></i> 0756-3850891</li>
-                        </ul>
-                      </div>
-                    </div>
-                  </div>
-                </div>
-                <div class="modal-footer">
-                  <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
-                </div>
-            </div>
-        </div>
-    </div>
     <!-- JS. -->
   <script src="/web/building_saas/js/global.js"></script>
   <script src="/web/users/js/user.js"></script>

+ 43 - 0
web/users/js/user.js

@@ -16,6 +16,49 @@ $(document).ready(function() {
     $("input").blur(function () {
         cleanError();
     });
+
+    //获取cld接口手机号码和数据
+    $('.getcategory').on('click', function () {
+        let category = $(this).attr('data-category');
+        let isupgrade = $(this).attr('data-upgrade');
+        if (isupgrade === 'true') {
+            $('#upgrade-title').text($(this).attr('data-title') + ' 售后服务');
+        } else {
+            $('#upgrade-title').text('联系销售代表激活');
+        }
+        $.ajax({
+            type: 'get',
+            url: '/cld/getCategoryStaff?category=' + category,
+            dataType: 'json',
+            timeout: 5000,
+            success: function (response) {
+                if (response.error !== 0) {
+                    alert('获取CLD人员信息失败!');
+                } else {
+                    let staffList = response.data;
+                    let staffhtml = '';
+                    $.each(staffList, function (key, staff) {
+                        staffhtml += '<div class="col-4 mb-4"> ' +
+                            '<div class="card"> ' +
+                            '<div class="card-body"> ' +
+                            '<h4 class="card-title">' + staff.username + '</h4> ' +
+                            '<h6 class="card-subtitle mb-2 text-muted">' + staff.category + '</h6> ' +
+                            '</div> ' +
+                            '<ul class="list-group list-group-flush"> ' +
+                            '<li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="腾讯QQ"><i class="fa fa-qq"></i> ' + staff.qq + '</li> ' +
+                            '<li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="手机号码"><i class="fa fa-tablet"></i> ' + staff.telephone + '</li> ' +
+                            '<li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="固定电话"><i class="fa fa-phone"></i> ' + staff.phone + '</li> ' +
+                            '</ul> </div> </div>';
+                    });
+                    $('#staffList').html(staffhtml);
+                    $('#activ').modal('show');
+                }
+            },
+            error: function () {
+                console.log('请求超时');
+            }
+        })
+    })
 });
 
 /**