ソースを参照

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuOperation

Tony Kang 1 週間 前
コミット
1ee4cb355e

+ 274 - 251
modules/users/models/engineering_lib_model.js

@@ -9,153 +9,160 @@ import mongoose from "mongoose";
 import BaseModel from "../../common/base/base_model";
 import CompilationModel from "./compilation_model";
 let stdRationLibModel = mongoose.model("std_ration_lib_map");
-import { default as EngineeringConst, List as EngineeringList } from "../../common/const/engineering";
+import {
+  default as EngineeringConst,
+  List as EngineeringList,
+} from "../../common/const/engineering";
 
 class EngineeringLibModel extends BaseModel {
-    /**
-     * 构造函数
-     *
-     * @return {void}
-     */
-    constructor() {
-        let parent = super();
-        parent.model = mongoose.model("engineering_lib");
-        parent.init();
+  /**
+   * 构造函数
+   *
+   * @return {void}
+   */
+  constructor() {
+    let parent = super();
+    parent.model = mongoose.model("engineering_lib");
+    parent.init();
+  }
+
+  /**
+   * 获取标准库数据
+   *
+   * @param {Object} data
+   * @param {Number} engineering
+   * @return {Promise}
+   */
+  async getLib(data, engineering) {
+    let result = {};
+    if (data.length <= 0) {
+      return result;
     }
-
-    /**
-     * 获取标准库数据
-     *
-     * @param {Object} data
-     * @param {Number} engineering
-     * @return {Promise}
-     */
-    async getLib(data, engineering) {
-        let result = {};
-        if (data.length <= 0) {
-            return result;
-        }
-        let id = '';
-        for (let tmp of data) {
-            if (tmp.engineering === engineering) {
-                id = tmp.engineering_id;
-                break;
-            }
-        }
-        if (id === '') {
-            return result;
-        }
-        let condition = { _id: id };
-        return this.findDataByCondition(condition);
+    let id = "";
+    for (let tmp of data) {
+      if (tmp.engineering === engineering) {
+        id = tmp.engineering_id;
+        break;
+      }
     }
-
-    async getLibsByValuationID(valuationID) {
-        return this.findDataByCondition({ valuationID: valuationID }, null, false);
+    if (id === "") {
+      return result;
     }
-
-    async deleteByValuationID(valuationID) {
-        return await this.db.delete({ valuationID: valuationID });
+    let condition = { _id: id };
+    return this.findDataByCondition(condition);
+  }
+
+  async getLibsByValuationID(valuationID) {
+    return this.findDataByCondition({ valuationID: valuationID }, null, false);
+  }
+
+  async deleteByValuationID(valuationID) {
+    return await this.db.delete({ valuationID: valuationID });
+  }
+
+  //添加空的默认的所有标准库
+  /**
+   * @param valuationID
+   * @returns {Promise.<*>}
+   */
+  async addStdLib(valuationID) {
+    let stdLibs = [];
+    for (let eng of EngineeringList) {
+      let tem = {
+        glj_col: { showAdjustPrice: false },
+        valuationID: valuationID,
+        name: eng.name,
+        engineering: eng.value,
+      };
+      stdLibs.push(tem);
     }
-
-
-    //添加空的默认的所有标准库
-    /**
-     * @param valuationID
-     * @returns {Promise.<*>}
-     */
-    async addStdLib(valuationID) {
-        let stdLibs = [];
-        for (let eng of EngineeringList) {
-            let tem = {
-                glj_col: { showAdjustPrice: false },
-                valuationID: valuationID,
-                name: eng.name,
-                engineering: eng.value
-            };
-            stdLibs.push(tem);
-        }
-        let result = await this.db.create(stdLibs);
-        return result;
+    let result = await this.db.create(stdLibs);
+    return result;
+  }
+
+  async addEngineer(data) {
+    data.glj_col = { showAdjustPrice: false };
+    if (data.compilationId && data.compilationId != "") {
+      data.ration_lib = [];
+      let rationList = await stdRationLibModel.find(
+        { compilationId: data.compilationId },
+        ["ID", "dispName"]
+      );
+      for (let i = 0; i < rationList.length; i++) {
+        let tem = {
+          id: rationList[i].ID,
+          name: rationList[i].dispName,
+          onlyProfession: false,
+          isDefault: false,
+        };
+        if (i == 0) tem.isDefault = true;
+        data.ration_lib.push(tem);
+      }
     }
-
-    async addEngineer(data) {
-        data.glj_col = { showAdjustPrice: false };
-        if (data.compilationId && data.compilationId != "") {
-            data.ration_lib = [];
-            let rationList = await stdRationLibModel.find({ compilationId: data.compilationId }, ['ID', 'dispName']);
-            for (let i = 0; i < rationList.length; i++) {
-                let tem = {
-                    id: rationList[i].ID,
-                    name: rationList[i].dispName,
-                    isDefault: false
-                };
-                if (i == 0) tem.isDefault = true;
-                data.ration_lib.push(tem);
-            }
-        }
-        let result = await this.db.create(data);
-        return result;
+    let result = await this.db.create(data);
+    return result;
+  }
+
+  // 拷贝工程专业
+  async copyEngineer(sourceID) {
+    const engineering = await this.db.findOne({ _id: sourceID });
+    const newEngineering = engineering._doc;
+    delete newEngineering._id;
+    newEngineering.visible = false;
+    await this.db.create(newEngineering);
+  }
+
+  /**
+   * 新增标准库
+   *
+   * @param {String} valuationId
+   * @param {Object} data
+   * @return {Promise}
+   */
+  async addLib(engineerId, data) {
+    if (data.glj_col) {
+      data.glj_col = JSON.parse(data.glj_col);
     }
-
-    // 拷贝工程专业
-    async copyEngineer(sourceID) {
-        const engineering = await this.db.findOne({ _id: sourceID });
-        const newEngineering = engineering._doc;
-        delete newEngineering._id;
-        newEngineering.visible = false;
-        await this.db.create(newEngineering);
+    data.isInstall == "true"
+      ? (data.isInstall = true)
+      : (data.isInstall = false);
+    let result = false;
+    data = this.filterLibData(data);
+    try {
+      let engineeringLib = await this.findDataByCondition({ _id: engineerId });
+      if (engineeringLib) {
+        // 存在则直接更新
+        delete data.id;
+        delete data.section;
+        let condition = { _id: engineerId };
+        result = await this.db.update(condition, data);
+        result = result.ok === 1;
+      } else {
+        throw new Error("找不到对应的工程专业");
+      }
+    } catch (error) {
+      console.log(error);
+      result = false;
     }
 
-    /**
-     * 新增标准库
-     *
-     * @param {String} valuationId
-     * @param {Object} data
-     * @return {Promise}
-     */
-    async addLib(engineerId, data) {
-        if (data.glj_col) {
-            data.glj_col = JSON.parse(data.glj_col);
-        }
-        data.isInstall == 'true' ? data.isInstall = true : data.isInstall = false;
-        let result = false;
-        data = this.filterLibData(data);
-        try {
-            let engineeringLib = await this.findDataByCondition({ _id: engineerId });
-            if (engineeringLib) {
-                // 存在则直接更新
-                delete data.id;
-                delete data.section;
-                let condition = { _id: engineerId };
-                result = await this.db.update(condition, data);
-                result = result.ok === 1;
-            } else {
-                throw new Error("找不到对应的工程专业");
-            }
-
-        } catch (error) {
-            console.log(error);
-            result = false;
-        }
-
-        return result;
+    return result;
+  }
+
+  /**
+   * 过滤计价数据
+   *
+   * @param {Object} data
+   * @return {Object}
+   */
+  filterLibData(data) {
+    if (Object.keys(data).length <= 0 || data.section === undefined) {
+      console.log("1");
+      throw "数据有误";
     }
-
-    /**
-     * 过滤计价数据
-     *
-     * @param {Object} data
-     * @return {Object}
-     */
-    filterLibData(data) {
-        if (Object.keys(data).length <= 0 || data.section === undefined) {
-            console.log('1');
-            throw '数据有误';
-        }
-        data.engineering = parseInt(data.engineering);
-        //需求修改,工程专业可以随便输入了
-        //检测专业工程是否合法
-        /*     let match = false;
+    data.engineering = parseInt(data.engineering);
+    //需求修改,工程专业可以随便输入了
+    //检测专业工程是否合法
+    /*     let match = false;
              for(let index in EngineeringConst) {
                  if (EngineeringConst[index] === data.engineering) {
                      match = true;
@@ -166,146 +173,162 @@ class EngineeringLibModel extends BaseModel {
                  throw '工程专业错误';
              }*/
 
-        // 判断标准清单
-        data.bill_lib = this._validLib(data.bill_lib);
+    // 判断标准清单
+    data.bill_lib = this._validLib(data.bill_lib);
 
-        // 判断定额库
-        data.ration_lib = this._validLib(data.ration_lib);
+    // 判断定额库
+    data.ration_lib = this._validLib(data.ration_lib);
 
-        //设置默认定额库
-        this.setDefaultRation(data);
+    //设置默认定额库
+    this.setDefaultRation(data);
 
-        // 判断工料机库
-        data.glj_lib = this._validLib(data.glj_lib);
+    // 判断工料机库
+    data.glj_lib = this._validLib(data.glj_lib);
 
-        // 判断清单指引库
-        data.billsGuidance_lib = this._validLib(data.billsGuidance_lib);
+    // 判断清单指引库
+    data.billsGuidance_lib = this._validLib(data.billsGuidance_lib);
 
-        /*// 判断费率标准
+    /*// 判断费率标准
         data.fee_lib = this._validLib(data.fee_lib);*/
 
-        // 判断人工系数
-        data.artificial_lib = this._validLib(data.artificial_lib);
+    // 判断人工系数
+    data.artificial_lib = this._validLib(data.artificial_lib);
 
-        //判断工程特征库
-        data.feature_lib = this._validLib(data.feature_lib);
+    //判断工程特征库
+    data.feature_lib = this._validLib(data.feature_lib);
 
-        //判断基本信息
-        data.info_lib = this._validLib(data.info_lib);
+    //判断基本信息
+    data.info_lib = this._validLib(data.info_lib);
 
-        //判断累进区间库
-        data.progressive_lib = this._validLib(data.progressive_lib);
+    //判断累进区间库
+    data.progressive_lib = this._validLib(data.progressive_lib);
 
-        //判断车船税
-        data.vvTax_lib = this._validLib(data.vvTax_lib);
+    //判断车船税
+    data.vvTax_lib = this._validLib(data.vvTax_lib);
 
-        //判断递延清单库
-        data.billCode_lib = this._validLib(data.billCode_lib);
+    //判断递延清单库
+    data.billCode_lib = this._validLib(data.billCode_lib);
 
-        //计税方式组合
-        data.tax_group = this._validLib(data.tax_group);
+    //计税方式组合
+    data.tax_group = this._validLib(data.tax_group);
 
-        return data;
-    }
+    return data;
+  }
 
-    /**
-     * 校验库数据
-     *
-     * @param {Object} libData
-     * @return {Object}
-     */
-    _validLib(libData) {
-        let result = [];
-        // 判断标准库
-        if (libData === undefined || libData === null || libData === '') {
-            return result;//throw '标准库不能为空'; 按新需求,标准库等不做非空判断
-        }
-        libData = libData instanceof Array ? libData : [libData];
-        for (let tmp in libData) {
-            result[tmp] = JSON.parse(libData[tmp]);
-        }
-        return result;
+  /**
+   * 校验库数据
+   *
+   * @param {Object} libData
+   * @return {Object}
+   */
+  _validLib(libData) {
+    let result = [];
+    // 判断标准库
+    if (libData === undefined || libData === null || libData === "") {
+      return result; //throw '标准库不能为空'; 按新需求,标准库等不做非空判断
     }
-
-    //设置默认定额库
-    setDefaultRation(data) {
-        if (data.ration_lib && data.ration_lib.length > 0) {
-            if (data.ration_isDefault && data.ration_isDefault != "") {
-                for (let r of data.ration_lib) {
-                    r.id.toString() == data.ration_isDefault ? r.isDefault = true : r.isDefault = false;
-                }
-            } else {
-                data.ration_lib[0].isDefault = true;
-            }
-        }
+    libData = libData instanceof Array ? libData : [libData];
+    for (let tmp in libData) {
+      result[tmp] = JSON.parse(libData[tmp]);
     }
-
-
-    /**
-     * 获取对应标准库数量
-     *
-     * @param {Object} valuationData
-     * @return {Object}
-     */
-    async getLibCount(valuationData) {
-        let result = {};
-        if (valuationData.engineering_list === undefined || valuationData.engineering_list.length <= 0) {
-            return result;
-        }
-
-        // 整理需要查找的数据
-        let findIdList = [];
-        for (let engineering of valuationData.engineering_list) {
-            findIdList.push(engineering.engineering_id);
-        }
-
-        let condition = { _id: { $in: findIdList } };
-        let libData = await this.findDataByCondition(condition, null, false);
-        if (libData === null) {
-            return result;
-        }
-
-        // 整理数据
-        let countData = {};
-        for (let tmp of libData) {
-            countData[tmp._id] = {
-                bill_count: tmp.bill_lib.length,
-                ration_count: tmp.ration_lib.length,
-                glj_count: tmp.glj_lib.length,
-                fee_count: tmp.fee_lib.length,
-                artificial_count: tmp.artificial_lib.length,
-                program_count: tmp.program_lib.length,
-            };
+    return result;
+  }
+
+  //设置默认定额库
+  setDefaultRation(data) {
+    if (data.ration_lib && data.ration_lib.length > 0) {
+      if (data.ration_isDefault && data.ration_isDefault != "") {
+        for (let r of data.ration_lib) {
+          r.id.toString() == data.ration_isDefault
+            ? (r.isDefault = true)
+            : (r.isDefault = false);
+          // 通过表单来识别那些定额库是专业版可用
+          data["ration_onlyProfession_" + r.id.toString()]
+            ? (r.onlyProfession = true)
+            : (r.onlyProfession = false);
         }
+      } else {
+        data.ration_lib[0].isDefault = true;
+      }
+    }
+  }
+
+  /**
+   * 获取对应标准库数量
+   *
+   * @param {Object} valuationData
+   * @return {Object}
+   */
+  async getLibCount(valuationData) {
+    let result = {};
+    if (
+      valuationData.engineering_list === undefined ||
+      valuationData.engineering_list.length <= 0
+    ) {
+      return result;
+    }
 
+    // 整理需要查找的数据
+    let findIdList = [];
+    for (let engineering of valuationData.engineering_list) {
+      findIdList.push(engineering.engineering_id);
+    }
 
-        for (let engineering of valuationData.engineering_list) {
-            if (countData[engineering.engineering_id] !== undefined) {
-                result[engineering.engineering] = countData[engineering.engineering_id];
-            }
-        }
+    let condition = { _id: { $in: findIdList } };
+    let libData = await this.findDataByCondition(condition, null, false);
+    if (libData === null) {
+      return result;
+    }
 
-        return result;
+    // 整理数据
+    let countData = {};
+    for (let tmp of libData) {
+      countData[tmp._id] = {
+        bill_count: tmp.bill_lib.length,
+        ration_count: tmp.ration_lib.length,
+        glj_count: tmp.glj_lib.length,
+        fee_count: tmp.fee_lib.length,
+        artificial_count: tmp.artificial_lib.length,
+        program_count: tmp.program_lib.length,
+      };
     }
 
-    async copyRationLibsToOthers(valuationID, engineeringID) {
-        const compilationModel = new CompilationModel();
-        const compilation = await compilationModel.model.findOne({ $or: [{ 'bill_valuation.id': valuationID }, { 'ration_valuation.id': valuationID }] });
-        if (!compilation) {
-            return;
-        }
-        const valuationIDList = [];
-        const allValuation = compilation.ration_valuation.concat(compilation.bill_valuation);
-        for (const valuation of allValuation) {
-            valuationIDList.push(valuation.id);
-        }
-        const engineering = await this.findDataByCondition({ _id: engineeringID });
-        if (!engineering) {
-            return;
-        }
-        await this.model.updateMany({ valuationID: { $in: valuationIDList } }, { $set: { ration_lib: engineering.ration_lib } });
+    for (let engineering of valuationData.engineering_list) {
+      if (countData[engineering.engineering_id] !== undefined) {
+        result[engineering.engineering] = countData[engineering.engineering_id];
+      }
     }
 
+    return result;
+  }
+
+  async copyRationLibsToOthers(valuationID, engineeringID) {
+    const compilationModel = new CompilationModel();
+    const compilation = await compilationModel.model.findOne({
+      $or: [
+        { "bill_valuation.id": valuationID },
+        { "ration_valuation.id": valuationID },
+      ],
+    });
+    if (!compilation) {
+      return;
+    }
+    const valuationIDList = [];
+    const allValuation = compilation.ration_valuation.concat(
+      compilation.bill_valuation
+    );
+    for (const valuation of allValuation) {
+      valuationIDList.push(valuation.id);
+    }
+    const engineering = await this.findDataByCondition({ _id: engineeringID });
+    if (!engineering) {
+      return;
+    }
+    await this.model.updateMany(
+      { valuationID: { $in: valuationIDList } },
+      { $set: { ration_lib: engineering.ration_lib } }
+    );
+  }
 }
 
 export default EngineeringLibModel;

+ 2 - 0
public/web/rpt_value_define.js

@@ -80,6 +80,8 @@ const JV = {
   PROP_HANDLE_TYPE_LAND_COMPS: "清单土地计算合并",
   PROP_HANDLE_TYPE_COST_TREE_BU_GLJ: "造价书插入补项工料机",
   PROP_HANDLE_TYPE_FLITE_XMJ_IS_BILL_BUDGET: "筛选清单预算项目节",
+  PROP_HANDLE_TYPE_FLITE_ARTERIAL_HIGHWAY_RULE: "干线公路汇总规则",
+  PROP_HANDLE_TYPE_ARTERIAL_HIGHWAY_RULE: "干线公路汇总规则类型",
 
   PROP_ADJUST_COLLECTION: "数据调整集",
   PROP_ADJUST_ACTION: "action",

+ 1 - 0
web/maintain/report/html/rpt_tpl_dtl_info.html

@@ -138,6 +138,7 @@
                         <option value="businessSummary">多个业务汇总</option>
                         <option value="changeProjectSummary">变更业务对比汇总</option>
                         <option value="changeProjectGljSummary">变更业务工料机对比汇总</option>
+                        <option value="compareConstruct">对比建设项目</option>
                     </select>
                     <label class="form-check-label" id="outputDesignDataBar" style="display: none;">
                         <input onchange="zTreeOprObj.onChangeFlag('outputDesignData', this)"  id="outputDesignData" type="checkbox">输出设计清单

+ 2 - 0
web/maintain/report/html/rpt_tpl_dtl_pre_hdl.html

@@ -35,6 +35,8 @@
             <%include ./rpt_tpl_dtl_pre_hdl_addDummy.html %>
             <!--工程量清单数据处理-->
             <%include ./rpt_tpl_dtl_pre_hdl_change_quantities_bills.html %>
+            <!--干线公路汇总规则数据处理-->
+            <%include ./rpt_tpl_dtl_pre_hdl_arterial_highway_rule.html%>
         </div>
     </div>
 </div>

+ 15 - 0
web/maintain/report/html/rpt_tpl_dtl_pre_hdl_arterial_highway_rule.html

@@ -0,0 +1,15 @@
+<div id="div_arterial_highway_rule_bar">
+    <div class="form-group row" id="div_arterial_highway_rule">
+        <div class="input-group col-5">
+            <div class="input-group-addon">汇总规则</div>
+            <select class="form-control input-sm" id="select_arterial_highway_rule"
+                onchange="preHandleArterialHighwayRuleObj.onArterialHighwayRuleChange(this)">
+                <option value="constructID">建设项目</option>
+                <option value="constructionUnitsAndRoadTechniqueGrade">养护管理单位名称和公路等级</option>
+                <option value="roadTechniqueGrade">公路技术等级</option>
+                <option value="routeName">养护路线名称</option>
+                <option value="constructionUnits">养护管理单位名称</option>
+            </select>
+        </div>
+    </div>
+</div>

+ 2 - 0
web/maintain/report/js/rpt_tpl_main.js

@@ -1307,6 +1307,8 @@ let zTreeOprObj = {
                   $("#element_sumLv_flags")[0].selectedIndex = 17;
                 else if (sumLvType === "changeProjectGljSummary")
                   $("#element_sumLv_flags")[0].selectedIndex = 18;
+                else if (sumLvType === "compareConstruct")
+                  $("#element_sumLv_flags")[0].selectedIndex = 19;
                 else {
                   $("#element_sumLv_flags")[0].selectedIndex = 0;
                 }

+ 52 - 2
web/maintain/report/js/rpt_tpl_pre_handle.js

@@ -467,7 +467,10 @@ let preHandleObj = {
       Name: JV.PROP_HANDLE_TYPE_FLITE_XMJ_IS_BILL_BUDGET,
       Title: "",
     });
-    types.push({ Name: JV.PROP_HANDLE_TYPE_BIND_AID_REPORT, Title: "" });
+    types.push({
+      Name: JV.PROP_HANDLE_TYPE_FLITE_ARTERIAL_HIGHWAY_RULE,
+      Title: "",
+    });
 
     // types.push({Name: "纯手工填写", Title: ""});
     me.typeTreeObj = $.fn.zTree.init(
@@ -601,7 +604,7 @@ let preHandleObj = {
           预处理类型: preHandleType,
         };
         break;
-      case JV.PROP_HANDLE_TYPE_BIND_AID_REPORT:
+      case JV.PROP_HANDLE_TYPE_FLITE_ARTERIAL_HIGHWAY_RULE:
         rst = {
           Name: "预处理环节",
           Title: "",
@@ -668,6 +671,9 @@ let preHandleObj = {
         break;
       case JV.PROP_HANDLE_TYPE_FLITE_XMJ_IS_BILL_BUDGET:
         break;
+      case JV.PROP_HANDLE_TYPE_FLITE_ARTERIAL_HIGHWAY_RULE:
+        item[JV.PROP_HANDLE_TYPE_ARTERIAL_HIGHWAY_RULE] = "constructID"; // 工程量清单排序
+        break;
       default:
         item[JV.PROP_HANDLE_TYPE] = JV.PROP_HANDLE_TYPE_SORT;
         item[JV.PROP_SORT_TYPE] = "normal";
@@ -695,6 +701,11 @@ let preHandleObj = {
       src[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_CHANGE_QUANTITIES_BILLS
     ) {
       preHandleQuantitiesBillsSortObj.copyNode(src, dest);
+    } else if (
+      src[JV.PROP_HANDLE_TYPE] ===
+      JV.PROP_HANDLE_TYPE_FLITE_ARTERIAL_HIGHWAY_RULE
+    ) {
+      preHandleArterialHighwayRuleObj.copyNode(src, dest);
     }
   },
   private_set_title: function (node) {
@@ -744,6 +755,8 @@ let preHandleObj = {
           preHandleAddDummyObj.refresh_node();
         } else if (typeNode[JV.PROP_NAME] === "转化工程量清单") {
           preHandleQuantitiesBillsSortObj.refresh_node();
+        } else if (typeNode[JV.PROP_NAME] === "干线公路汇总规则") {
+          preHandleArterialHighwayRuleObj.refresh_node();
         }
       }
     }
@@ -761,6 +774,7 @@ let preHandleObj = {
     $("#div_sort_tree")[0].style.display = "none";
     $("#div_sort_self_define")[0].style.display = "none";
     $("#div_quantities_bills_sort_bar")[0].style.display = "none";
+    $("#div_arterial_highway_rule_bar")[0].style.display = "none";
   },
   onPreHandleClick: function (event, treeId, treeNode) {
     //点击预处理环节 节点
@@ -942,6 +956,11 @@ let preHandleObj = {
           case JV.PROP_HANDLE_TYPE_FLITE_XMJ_IS_BILL_BUDGET:
             rst.push(preHandleBillDataMoveObj.extractTabFields(handleObj));
             break;
+          case JV.PROP_HANDLE_TYPE_FLITE_ARTERIAL_HIGHWAY_RULE:
+            rst.push(
+              preHandleArterialHighwayRuleObj.extractTabFields(handleObj)
+            );
+            break;
           default:
             break;
         }
@@ -1880,6 +1899,37 @@ let preHandleQuantitiesBillsSortObj = {
       dom.value;
   },
 };
+// 干线公路汇总规则
+let preHandleArterialHighwayRuleObj = {
+  copyNode: function (src, dest) {
+    dest[JV.PROP_HANDLE_TYPE_ARTERIAL_HIGHWAY_RULE] = src.combileRule;
+  },
+  refresh_node: function () {
+    $("#div_arterial_highway_rule_bar")[0].style.display = "";
+    if (preHandleObj.currentNode) {
+      $("#select_arterial_highway_rule")[0].value =
+        preHandleObj.currentNode[JV.PROP_HANDLE_TYPE_ARTERIAL_HIGHWAY_RULE] ||
+        "constructID";
+    }
+  },
+  extractTabFields: function (handleObj) {
+    let me = preHandleArterialHighwayRuleObj,
+      rst = {};
+    me.copyNode(handleObj, rst);
+    rst = {
+      预处理类型: "干线公路汇总规则",
+      映射数据对象: "bills",
+      combileRule: handleObj[JV.PROP_HANDLE_TYPE_ARTERIAL_HIGHWAY_RULE],
+    };
+    return rst;
+  },
+  onArterialHighwayRuleChange: function (dom) {
+    // 工程量清单排序类型
+    let me = preHandleObj;
+    me.currentNode[JV.PROP_HANDLE_TYPE_ARTERIAL_HIGHWAY_RULE] = dom.value;
+  },
+};
+
 let preHandleFXGLJObj = {
   copyNode: function (src, dest) {
     //

+ 4 - 0
web/users/js/compilation.js

@@ -209,11 +209,15 @@ $(document).ready(function () {
       const tem = {
         id: rationLib,
         name: rationLibString,
+        onlyProfession: false,
         isDefault: false,
       };
       htmlString += ` 
                 <tr class='ration_tr' draggable="true">
                     <td><span class="cursor-default">${tem.name}</span></td>
+                     <td><label class="form-check-label"> <input class="form-check-input" name="ration_onlyProfession"  value="${
+                       tem.id
+                     }" type="checkbox"></td> 
                     <td><label class="form-check-label"> <input class="form-check-input" name="ration_isDefault"  value="${
                       tem.id
                     }" type="radio"></td>  

+ 10 - 0
web/users/views/compilation/engineering.html

@@ -252,6 +252,7 @@
                                 <thead>
                                 <tr>
                                     <th>定额库名称</th>
+                                    <th>仅专业版可用</th>
                                     <th>默认</th>
                                     <th>操作</th>
                                 </tr>
@@ -263,6 +264,15 @@
                                     <td>
                                         <span class="cursor-default"><%= ration.name%></span>
                                     </td>
+                                    <td> 
+                                        <label class="form-check-label">
+                                            <% if(ration.onlyProfession==true){%>
+                                                <input  class="form-check-input"  name="ration_onlyProfession_<%= ration.id %>" type="checkbox" checked  value="<%= ration.id %>"> 
+                                            <% }else{ %>
+                                                <input  class="form-check-input"   name="ration_onlyProfession_<%= ration.id %>" type="checkbox"  value="<%= ration.id %>"> 
+                                            <% } %>
+                                        </label>
+                                    </td>
                                     <td>
                                         <label class="form-check-label">
                                             <% if(ration.isDefault == true){%>