|
|
@@ -95,6 +95,86 @@ const fixed_glj_types = [
|
|
|
{ Name: "利润(7)", Title: "", Value: 7 },
|
|
|
{ Name: "一般风险费(8)", Title: "", Value: 8 },
|
|
|
];
|
|
|
+const fixed_floor_bill_glj_types = [
|
|
|
+ { Name: "人工(1)", Title: "", Value: 1 },
|
|
|
+ { Name: "材料(2)", Title: "", Value: 2 },
|
|
|
+ { Name: "普通材料(201)", Title: "", Value: 201 },
|
|
|
+ { Name: "混凝土(202)", Title: "", Value: 202 },
|
|
|
+ { Name: "砂浆(203)", Title: "", Value: 203 },
|
|
|
+ { Name: "配合比(204)", Title: "", Value: 204 },
|
|
|
+ { Name: "商品混凝土(205)", Title: "", Value: 205 },
|
|
|
+ { Name: "商品砂浆(206)", Title: "", Value: 206 },
|
|
|
+ { Name: "其它材料(207)", Title: "", Value: 207 },
|
|
|
+ { Name: "外购砼构件(208)", Title: "", Value: 208 },
|
|
|
+ { Name: "绿化苗木(209)", Title: "", Value: 209 },
|
|
|
+ { Name: "机械(3)", Title: "", Value: 3 },
|
|
|
+ { Name: "机械台班(301)", Title: "", Value: 301 },
|
|
|
+ { Name: "机械组成物(302)", Title: "", Value: 302 },
|
|
|
+ { Name: "机上人工(303)", Title: "", Value: 303 },
|
|
|
+ { Name: "仪器仪表(304)", Title: "", Value: 304 },
|
|
|
+ { Name: "燃料动力费(305)", Title: "", Value: 305 },
|
|
|
+ { Name: "折旧费(306)", Title: "", Value: 306 },
|
|
|
+ { Name: "检修费(307)", Title: "", Value: 307 },
|
|
|
+ { Name: "维护费(308)", Title: "", Value: 308 },
|
|
|
+ { Name: "安拆费及场外运费(309)", Title: "", Value: 309 },
|
|
|
+ { Name: "校验费(310)", Title: "", Value: 310 },
|
|
|
+ { Name: "其他费用(311)", Title: "", Value: 311 },
|
|
|
+ { Name: "其他施工机具使用费(312)", Title: "", Value: 312 },
|
|
|
+ { Name: "主材(4)", Title: "", Value: 4 },
|
|
|
+ { Name: "设备(5)", Title: "", Value: 5 },
|
|
|
+ { Name: "企业管理费(6)", Title: "", Value: 6 },
|
|
|
+ { Name: "利润(7)", Title: "", Value: 7 },
|
|
|
+ { Name: "一般风险费(8)", Title: "", Value: 8 },
|
|
|
+ { Name: "人机(9)", Title: "", Value: 9 },
|
|
|
+ { Name: "基价(10)", Title: "", Value: 10 },
|
|
|
+ { Name: "软维(11)", Title: "", Value: 11 },
|
|
|
+ { Name: "计算项(9000)", Title: "", Value: 9000 },
|
|
|
+];
|
|
|
+// 默认不选择的项
|
|
|
+const floor_bill_glj_default_excluded_values = [];
|
|
|
+const getDefaultFloorBillGljTypes = function () {
|
|
|
+ return fixed_floor_bill_glj_types
|
|
|
+ .filter(
|
|
|
+ (item) => floor_bill_glj_default_excluded_values.indexOf(item.Value) < 0,
|
|
|
+ )
|
|
|
+ .map((item) => item.Value);
|
|
|
+};
|
|
|
+const getSelectedFloorBillGljTypes = function (existingValues) {
|
|
|
+ if (
|
|
|
+ typeof existingValues === "undefined" ||
|
|
|
+ existingValues === null ||
|
|
|
+ existingValues === ""
|
|
|
+ ) {
|
|
|
+ return getDefaultFloorBillGljTypes();
|
|
|
+ }
|
|
|
+ if (Array.isArray(existingValues)) {
|
|
|
+ if (existingValues.length === 0) {
|
|
|
+ return getDefaultFloorBillGljTypes();
|
|
|
+ }
|
|
|
+ return existingValues.map((item) => Number(item));
|
|
|
+ }
|
|
|
+ if (typeof existingValues === "string") {
|
|
|
+ let values = existingValues
|
|
|
+ .split(",")
|
|
|
+ .map((item) => Number(item.trim()))
|
|
|
+ .filter((item) => !Number.isNaN(item));
|
|
|
+ if (values.length === 0) {
|
|
|
+ return getDefaultFloorBillGljTypes();
|
|
|
+ }
|
|
|
+ return values;
|
|
|
+ }
|
|
|
+ return [Number(existingValues)];
|
|
|
+};
|
|
|
+const ensureFloorBillGljTypes = function (node) {
|
|
|
+ if (!node) {
|
|
|
+ return getDefaultFloorBillGljTypes();
|
|
|
+ }
|
|
|
+ if (typeof node[JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES] === "undefined") {
|
|
|
+ node[JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES] =
|
|
|
+ getDefaultFloorBillGljTypes();
|
|
|
+ }
|
|
|
+ return node[JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES];
|
|
|
+};
|
|
|
// const fixed_top_bills_nodes = [
|
|
|
// {Name: "分部分项工程(1)", Title: "", Value: 1}
|
|
|
// ,{Name: "措施项目(2)", Title: "", Value: 2}
|
|
|
@@ -597,6 +677,8 @@ let preHandleObj = {
|
|
|
Title: "",
|
|
|
映射数据对象: "",
|
|
|
预处理类型: preHandleType,
|
|
|
+ [JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES]:
|
|
|
+ getDefaultFloorBillGljTypes(),
|
|
|
};
|
|
|
break;
|
|
|
case JV.PROP_HANDLE_TYPE_LAND_COMPS:
|
|
|
@@ -685,6 +767,8 @@ let preHandleObj = {
|
|
|
case JV.PROP_HANDLE_TYPE_FX_GLJ:
|
|
|
break;
|
|
|
case JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ:
|
|
|
+ item[JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES] =
|
|
|
+ getDefaultFloorBillGljTypes();
|
|
|
break;
|
|
|
case JV.PROP_HANDLE_TYPE_LAND_COMPS:
|
|
|
break;
|
|
|
@@ -727,6 +811,10 @@ let preHandleObj = {
|
|
|
JV.PROP_HANDLE_TYPE_FLITE_ARTERIAL_HIGHWAY_RULE
|
|
|
) {
|
|
|
preHandleArterialHighwayRuleObj.copyNode(src, dest);
|
|
|
+ } else if (
|
|
|
+ src[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ
|
|
|
+ ) {
|
|
|
+ preHandleFloorBillGljObj.copyNode(src, dest);
|
|
|
}
|
|
|
},
|
|
|
private_set_title: function (node) {
|
|
|
@@ -778,6 +866,10 @@ let preHandleObj = {
|
|
|
preHandleQuantitiesBillsSortObj.refresh_node();
|
|
|
} else if (typeNode[JV.PROP_NAME] === "干线公路汇总规则") {
|
|
|
preHandleArterialHighwayRuleObj.refresh_node();
|
|
|
+ } else if (
|
|
|
+ typeNode[JV.PROP_NAME] === JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ
|
|
|
+ ) {
|
|
|
+ preHandleFloorBillGljObj.refresh_node();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -796,6 +888,7 @@ let preHandleObj = {
|
|
|
$("#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";
|
|
|
+ $("#div_floor_bill_glj_types_bar")[0].style.display = "none";
|
|
|
},
|
|
|
onPreHandleClick: function (event, treeId, treeNode) {
|
|
|
//点击预处理环节 节点
|
|
|
@@ -969,7 +1062,7 @@ let preHandleObj = {
|
|
|
rst.push(preHandleBillDataMoveObj.extractTabFields(handleObj));
|
|
|
break;
|
|
|
case JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ:
|
|
|
- rst.push(preHandleBillDataMoveObj.extractTabFields(handleObj));
|
|
|
+ rst.push(preHandleFloorBillGljObj.extractTabFields(handleObj));
|
|
|
break;
|
|
|
case JV.PROP_HANDLE_TYPE_LAND_COMPS:
|
|
|
rst.push(preHandleBillDataMoveObj.extractTabFields(handleObj));
|
|
|
@@ -1954,6 +2047,87 @@ let preHandleArterialHighwayRuleObj = {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
+let preHandleFloorBillGljObj = {
|
|
|
+ copyNode: function (src, dest) {
|
|
|
+ let values = getSelectedFloorBillGljTypes(ensureFloorBillGljTypes(src));
|
|
|
+ dest[JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES] = values.slice();
|
|
|
+ },
|
|
|
+ refresh_node: function () {
|
|
|
+ $("#div_floor_bill_glj_types_bar")[0].style.display = "";
|
|
|
+ if (preHandleObj.currentNode) {
|
|
|
+ ensureFloorBillGljTypes(preHandleObj.currentNode);
|
|
|
+ let container = $("#select_floor_bill_glj_types")[0];
|
|
|
+ container.innerHTML = "";
|
|
|
+ let selectedValues = getSelectedFloorBillGljTypes(
|
|
|
+ preHandleObj.currentNode[JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES],
|
|
|
+ );
|
|
|
+ for (let idx = 0; idx < fixed_floor_bill_glj_types.length; idx++) {
|
|
|
+ let item = fixed_floor_bill_glj_types[idx];
|
|
|
+ let label = document.createElement("label");
|
|
|
+ label.style.display = "inline-flex";
|
|
|
+ label.style.alignItems = "center";
|
|
|
+ label.style.margin = "0";
|
|
|
+ label.style.whiteSpace = "nowrap";
|
|
|
+ label.style.lineHeight = "1.4";
|
|
|
+ label.style.minWidth = "110px";
|
|
|
+
|
|
|
+ let checkbox = document.createElement("input");
|
|
|
+ checkbox.type = "checkbox";
|
|
|
+ checkbox.value = item.Value;
|
|
|
+ checkbox.checked = selectedValues.indexOf(item.Value) >= 0;
|
|
|
+ checkbox.style.margin = "0 4px 0 0";
|
|
|
+ checkbox.onchange = function () {
|
|
|
+ preHandleFloorBillGljObj.onFloorBillGljTypesChange(this);
|
|
|
+ };
|
|
|
+
|
|
|
+ let text = document.createElement("span");
|
|
|
+ text.textContent = item.Name;
|
|
|
+ text.style.fontSize = "12px";
|
|
|
+
|
|
|
+ label.appendChild(checkbox);
|
|
|
+ label.appendChild(text);
|
|
|
+ container.appendChild(label);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ extractTabFields: function (handleObj) {
|
|
|
+ let me = preHandleFloorBillGljObj,
|
|
|
+ rst = {};
|
|
|
+ me.copyNode(handleObj, rst);
|
|
|
+ rst = {
|
|
|
+ 预处理类型: JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ,
|
|
|
+ 映射数据对象: handleObj[JV.PROP_DATA_KEY] || "",
|
|
|
+ [JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES]: getSelectedFloorBillGljTypes(
|
|
|
+ ensureFloorBillGljTypes(handleObj),
|
|
|
+ ),
|
|
|
+ };
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ onFloorBillGljTypesChange: function (dom) {
|
|
|
+ let me = preHandleObj,
|
|
|
+ values = [],
|
|
|
+ candidates = [];
|
|
|
+ if (dom && dom.type === "checkbox") {
|
|
|
+ let container = dom.closest("#select_floor_bill_glj_types");
|
|
|
+ if (container) {
|
|
|
+ candidates = container.querySelectorAll('input[type="checkbox"]');
|
|
|
+ } else {
|
|
|
+ candidates = [dom];
|
|
|
+ }
|
|
|
+ } else if (dom && dom.id === "select_floor_bill_glj_types") {
|
|
|
+ candidates = dom.querySelectorAll('input[type="checkbox"]');
|
|
|
+ }
|
|
|
+ if (me.currentNode) {
|
|
|
+ for (let idx = 0; idx < candidates.length; idx++) {
|
|
|
+ if (candidates[idx].checked) {
|
|
|
+ values.push(Number(candidates[idx].value));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ me.currentNode[JV.PROP_HANDLE_TYPE_FLOOR_BILL_GLJ_TYPES] = values;
|
|
|
+ }
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
let preHandleFXGLJObj = {
|
|
|
copyNode: function (src, dest) {
|
|
|
//
|