|
@@ -7,8 +7,8 @@ const condition_types = ["==", "===", ">", ">=", "<", "<=", "!=", "in", "not in"
|
|
|
const pre_handle_data_objects = ["bills", "ration", "ration_glj"];
|
|
|
const pre_handle_data_objects_name = ["清单", "定额", "定额工料机"];
|
|
|
const exposed_bills_properties = [
|
|
|
- {Name: "清单_ID", Title: "", Key: "ID", Order: "ascend"}
|
|
|
- ,{Name: "清单_所属项目ID", Title: "", Key: "projectID", Order: "ascend"}
|
|
|
+ {Name: "清单_所属项目ID", Title: "", Key: "projectID", Order: "ascend"}
|
|
|
+ ,{Name: "清单_ID", Title: "", Key: "ID", Order: "ascend"}
|
|
|
,{Name: "清单_层次", Title: "", Key: "treeLevel", Order: "ascend"}
|
|
|
,{Name: "清单_标记", Title: "", Key: "flags.flag", Order: "ascend"}
|
|
|
// ,{Name: "清单_项目编码", Title: "", Key: "code", Order: "ascend"}
|
|
@@ -22,8 +22,9 @@ const exposed_bills_properties = [
|
|
|
];
|
|
|
const exposed_ration_properties = [
|
|
|
{Name: "定额_工程内部ID", Title: "", Key: "ID", Order: "ascend"}
|
|
|
- ,{Name: "定额_所属清单ID", Title: "", Key: "billsItemID", Order: "ascend"}
|
|
|
,{Name: "定额_所属项目ID", Title: "", Key: "projectID", Order: "ascend"}
|
|
|
+ ,{Name: "定额_所属清单ID", Title: "", Key: "billsItemID", Order: "ascend"}
|
|
|
+ ,{Name: "定额_清单内顺序", Title: "", Key: "serialNo", Order: "ascend"}
|
|
|
// ,{Name: "定额_编号", Title: "", Key: "code", Order: "ascend"}
|
|
|
// ,{Name: "定额_项目名称", Title: "", Key: "caption", Order: "ascend"}
|
|
|
// ,{Name: "定额_单位", Title: "", Key: "unit", Order: "ascend"}
|
|
@@ -301,11 +302,13 @@ let preHandleObj = {
|
|
|
//更改(或选择)预处理环节中的 数据依据(就是说报表想预处理什么数据)
|
|
|
let me = preHandleObj;
|
|
|
if (oprType === "top") {
|
|
|
+ preHandleObj.currentNode[JV.PROP_DATA_KEY] = dom.value;
|
|
|
preHandleSortObj.childTreeObj = $.fn.zTree.init($("#child_sorting_keys"), sortingKeysSetting, exposed_properties_arr[dom.selectedIndex]);
|
|
|
preHandleSortObj.treeObj = $.fn.zTree.init($("#pre_handle_sort_keys_reversed"), sortingKeysSetting, exposed_properties_arr[dom.selectedIndex]);
|
|
|
preHandleFilterObj.treeObj = $.fn.zTree.init($("#pre_handle_filter_keys_reversed"), filterKeysSetting, exposed_properties_arr[dom.selectedIndex]);
|
|
|
} else if (oprType === "accord_to_parent") {
|
|
|
preHandleSortObj.parentTreeObj = $.fn.zTree.init($("#parent_sorting_keys"), sortingKeysSetting, exposed_properties_arr[dom.selectedIndex]);
|
|
|
+ preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_DATA_KEY] = dom.value;
|
|
|
}
|
|
|
},
|
|
|
onBeforeDrop: function(treeId, treeNodes, targetNode, moveType){
|
|
@@ -355,6 +358,7 @@ let preHandleSortObj = {
|
|
|
parentTreeObj: null,
|
|
|
childTreeObj: null,
|
|
|
topBillsTreeObj: null,
|
|
|
+ otherBillsTreeObj: null,
|
|
|
copyNode: function (src, dest) {
|
|
|
dest[JV.PROP_SORT_TYPE] = src[JV.PROP_SORT_TYPE];
|
|
|
switch (sort_types.indexOf(src[JV.PROP_SORT_TYPE])) {
|
|
@@ -377,6 +381,11 @@ let preHandleSortObj = {
|
|
|
billKeys = billKeys.concat(src[JV.PROP_FILTER_TOP_BILLS_NODES]);
|
|
|
}
|
|
|
dest[JV.PROP_FILTER_TOP_BILLS_NODES] = billKeys;
|
|
|
+ let otherBillKeys = [];
|
|
|
+ if (src[JV.PROP_FILTER_OTHER_BILLS_NODES] && src[JV.PROP_FILTER_OTHER_BILLS_NODES].length > 0) {
|
|
|
+ otherBillKeys = otherBillKeys.concat(src[JV.PROP_FILTER_OTHER_BILLS_NODES]);
|
|
|
+ }
|
|
|
+ dest[JV.PROP_FILTER_OTHER_BILLS_NODES] = otherBillKeys;
|
|
|
break;
|
|
|
case 2 :
|
|
|
//according to parent
|
|
@@ -391,17 +400,19 @@ let preHandleSortObj = {
|
|
|
for (let item of src[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS]) {
|
|
|
dest[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS].push(item);
|
|
|
}
|
|
|
- for (let subSort of src[JV.PROP_OTHER_SUB_SORT]) {
|
|
|
- let st = {};
|
|
|
- st[JV.PROP_SORT_TYPE] = subSort[JV.PROP_SORT_TYPE];
|
|
|
- if (subSort[JV.PROP_SORT_TYPE] === "normal") {
|
|
|
- st[JV.PROP_SORT_KEYS] = [];
|
|
|
- for (let item of subSort[JV.PROP_SORT_KEYS]) {
|
|
|
- let di = {key: item.key, order: item.order};
|
|
|
- st[JV.PROP_SORT_KEYS].push(di);
|
|
|
+ if (src[JV.PROP_OTHER_SUB_SORT] !== null && src[JV.PROP_OTHER_SUB_SORT] !== undefined) {
|
|
|
+ for (let subSort of src[JV.PROP_OTHER_SUB_SORT]) {
|
|
|
+ let st = {};
|
|
|
+ st[JV.PROP_SORT_TYPE] = subSort[JV.PROP_SORT_TYPE];
|
|
|
+ if (subSort[JV.PROP_SORT_TYPE] === "normal") {
|
|
|
+ st[JV.PROP_SORT_KEYS] = [];
|
|
|
+ for (let item of subSort[JV.PROP_SORT_KEYS]) {
|
|
|
+ let di = {key: item.key, order: item.order};
|
|
|
+ st[JV.PROP_SORT_KEYS].push(di);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //其他暂时不实现,目前没那么复杂
|
|
|
}
|
|
|
- } else {
|
|
|
- //其他暂时不实现,目前没那么复杂
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -457,6 +468,20 @@ let preHandleSortObj = {
|
|
|
} else {
|
|
|
preHandleObj.currentNode[JV.PROP_FILTER_TOP_BILLS_NODES] = [];
|
|
|
}
|
|
|
+ me.otherBillsTreeObj = $.fn.zTree.init($("#bills_other_nodes"), sortingTreeSetting2, fixed_other_bills_types);
|
|
|
+ let otherBillnodes = me.otherBillsTreeObj.getNodes();
|
|
|
+ if (preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES]) {
|
|
|
+ for (let otherBillsNodeId of preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES]) {
|
|
|
+ for (let otherBillsNode of otherBillnodes) {
|
|
|
+ if (otherBillsNode.Value === otherBillsNodeId) {
|
|
|
+ me.otherBillsTreeObj.checkNode(otherBillsNode, true, false, false);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES] = [];
|
|
|
+ }
|
|
|
break;
|
|
|
case 2 :
|
|
|
//according to parent
|
|
@@ -493,9 +518,9 @@ let preHandleSortObj = {
|
|
|
onCheck: function(event,treeId,treeNode) {
|
|
|
let me = preHandleSortObj;
|
|
|
if (treeId.indexOf("parent_sorting_keys") >= 0) {
|
|
|
- //preHandleObj.currentNode
|
|
|
+ me.resetParentSort();
|
|
|
} else if (treeId.indexOf("child_sorting_keys") >= 0) {
|
|
|
- //
|
|
|
+ me.resetChildSort();
|
|
|
} else {
|
|
|
me.resetNormalSort();
|
|
|
}
|
|
@@ -513,6 +538,37 @@ let preHandleSortObj = {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ onOtherBillsNodeCheck: function (event,treeId,treeNode) {
|
|
|
+ let me = preHandleSortObj;
|
|
|
+ if (treeNode.checked) {
|
|
|
+ if (preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES].indexOf(treeNode.Value) < 0) {
|
|
|
+ preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES].push(treeNode.Value);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let idx = preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES].indexOf(treeNode.Value);
|
|
|
+ if (idx >= 0) {
|
|
|
+ preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES].splice(idx, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ resetParentSort: function () {
|
|
|
+ let me = preHandleSortObj;
|
|
|
+ let nodes = me.parentTreeObj.getCheckedNodes();
|
|
|
+ let sortKeys = [];
|
|
|
+ for (let node of nodes) {
|
|
|
+ sortKeys.push(node.Key);
|
|
|
+ }
|
|
|
+ preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_SORT_KEYS] = sortKeys;
|
|
|
+ },
|
|
|
+ resetChildSort: function () {
|
|
|
+ let me = preHandleSortObj;
|
|
|
+ let nodes = me.childTreeObj.getCheckedNodes();
|
|
|
+ let sortKeys = [];
|
|
|
+ for (let node of nodes) {
|
|
|
+ sortKeys.push(node.Key);
|
|
|
+ }
|
|
|
+ preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS] = sortKeys;
|
|
|
+ },
|
|
|
resetNormalSort: function() {
|
|
|
let me = preHandleSortObj;
|
|
|
let nodes = me.normalTreeObj.getCheckedNodes();
|
|
@@ -551,6 +607,7 @@ let preHandleSortObj = {
|
|
|
me.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_DATA_KEY] = pre_handle_data_objects[0];
|
|
|
me.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_SORT_KEYS] = [];
|
|
|
me.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS] = [];
|
|
|
+ me.currentNode[JV.PROP_OTHER_SUB_SORT] = [];
|
|
|
} else if (dom.selectedIndex === 0) {
|
|
|
$("#div_sort_type_normal")[0].style.display = "";
|
|
|
preHandleSortObj.normalTreeObj = $.fn.zTree.init($("#pre_handle_sort_keys_reversed"), sortingKeysSetting, exposed_properties_arr[data_dom.selectedIndex]);
|
|
@@ -577,9 +634,11 @@ let preHandleSortObj = {
|
|
|
case 1 :
|
|
|
//tree
|
|
|
rst[JV.PROP_FILTER_TOP_BILLS_NODES] = handleObj[JV.PROP_FILTER_TOP_BILLS_NODES];
|
|
|
+ rst[JV.PROP_FILTER_OTHER_BILLS_NODES] = handleObj[JV.PROP_FILTER_OTHER_BILLS_NODES];
|
|
|
break;
|
|
|
case 2 :
|
|
|
//according to parent
|
|
|
+ rst[JV.PROP_PARENT_CHILD_SORT_KEY] = handleObj[JV.PROP_PARENT_CHILD_SORT_KEY];
|
|
|
break;
|
|
|
case 3 :
|
|
|
//self define
|