Commit c55430f9 by 宋祥

1.物料清单页面优化

parent 3be9c7c8
......@@ -658,35 +658,31 @@ public class ServiceHPSC002 extends ServiceBase {
inInfo.set("root",root);
return inInfo;
}
@OperationLogAnnotation(operModul = "物料清单",operType = "查询",operDesc = "树查询服务")
//树查询服务
public EiInfo queryTreeNode(EiInfo inInfo) {
//1 获取参数
String pEname = inInfo.getCellStr(EiConstant.queryBlock, 0, "node");
if(StringUtils.equals("$",pEname)){
pEname = "root";
}
String proj = inInfo.get(CommonConstant.Field.PROJ_ID).toString();
Long projId = NumberUtils.toLong(proj.split("&")[0]);
Map queryMap = new HashMap();
queryMap.put("pEname", pEname);
if (projId != null) {
Map map = new HashMap();
map.put("id", projId);
List list = dao.query("HPSC001.queryDomainById", map);
if (list.size() > 0) {
String projCode = ((HPSC001)list.get(0)).getProjCode();
queryMap.put("projCode", projCode);
}
}
//2 查询节点
List rows = dao.query("HPSC002.queryTree", queryMap);
//3 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(BeanUtil.isEmpty(pEname) ? "" : pEname);
outBlock.addRows(rows);
return outInfo;
}
/**
* 查询树
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "物料清单", operType = "查询", operDesc = "树查询服务")
public EiInfo queryTreeNode(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryRow, "node");
Map map = new HashMap();
map.put("id", queryRow.get(CommonConstant.Field.PROJ_ID));
List<HPSC001> dbSc001s = dao.query("HPSC001.queryDomainById", map);
// 查询节点
Map queryMap = new HashMap();
queryMap.put("projCode", CollectionUtils.isEmpty(dbSc001s) ? "null" : dbSc001s.get(0).getProjCode());
queryMap.put("pEname", "$".equals(node) ? "root" : node);
List rows = dao.query("HPSC002.queryTree", queryMap);
// 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(node);
outBlock.addRows(rows);
return outInfo;
}
/**
* 修改节点状态,是叶子或非叶子节点
......@@ -864,7 +860,7 @@ public class ServiceHPSC002 extends ServiceBase {
}
return inInfo;
}
/**
* 部件类型下拉框
......
......@@ -185,7 +185,7 @@
$order$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
A.ID ASC
</isEmpty>
</dynamic>
</sql>
......@@ -335,7 +335,7 @@
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
ORDER BY ID ASC
</select>
......
var inventNameGlobalData = [];
var prdtNameGlobalData = [];
// 传递参数 将附件ID与当前记录ID进行绑定
// let rowId = '';
let parentId = '';
let projCode = '';
var strs;
var url = location.search; //获取url中"?"符后的字串
if (url.indexOf("?") != -1) { //判断是否有参数
var str = url.substr(1); //从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串
strs = str.split("="); //用等号进行分隔 (因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔)
// console.log('strs=' + strs) //直接弹出第一个参数 (如果有多个参数 还要进行循环的)
}
let inventNameGlobalData = [];
let prdtNameGlobalData = [];
$(function () {
IPLATUI.EFTree = {
"materialTree": {
ROOT: "root:项目列表",
// ROOT: "root:项目列表",
/**
* 树加载完成后的回调函数
* @param options: 树的配置项
*/
query: function (postEiInfo, model) {
postEiInfo.set("projId",strs?strs[1] : null);
return postEiInfo;
postEiInfo.set("inqu_status-0-projId", $("#inqu_status-0-projId").val());
return postEiInfo;
},
loadComplete: function (options) {
// 保持结点展开状态
......@@ -41,41 +32,39 @@ $(function () {
*/
select: function (e) {
var nodeData = this.dataItem(e.node);
let eiInfo = new EiInfo();
if (nodeData.lv == 1){
eiInfo.set("inqu_status-0-inventTypes", [4]);
}else if (nodeData.lv == 2){
eiInfo.set("inqu_status-0-inventTypes", [3]);
}
var dataSource;
EiCommunicator.send("HPPZ006", "queryPrdtComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_prdt_name_block_id").getMappedRows();
inventNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtCode = nodeData.prdtCode;
IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtName = nodeData.prdtName;
IPLATUI.EFTree.materialTree.selectTreeNode.projName = nodeData.projName;
IPLATUI.EFTree.materialTree.selectTreeNode.deliveryDate = nodeData.deliveryDate;
IPLATUI.EFTree.materialTree.selectTreeNode.lv = nodeData.lv;
// 重新查询EFGrid
parentId = nodeData.nodeId;
query();
// 选择最后一级时,自动点击上一级
if (nodeData.lv == 3) {
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.pId;
// 刷新树
refreshTree();
} else {
let eiInfo = new EiInfo();
if (nodeData.lv == 1) {
eiInfo.set("inqu_status-0-inventTypes", [4]);
} else if (nodeData.lv == 2) {
eiInfo.set("inqu_status-0-inventTypes", [3]);
}
var dataSource;
EiCommunicator.send("HPPZ006", "queryPrdtComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_prdt_name_block_id").getMappedRows();
inventNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
// 设置树节点的值
setTreeNodeValue(nodeData);
}
// 刷新列表数据
query();
// 动态显示列名
dynamicColumnName();
},
selectTreeNode: {}
}
};
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid = {
result: {
pageable: {
......@@ -97,33 +86,31 @@ $(function () {
});
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete'){
query();
refreshTree();
}
},
query: function () {
var ei = new EiInfo();
ei.set("inqu_status-0-prdtType",$("#inqu_status-0-prdtType").val());
ei.set("inqu_status-0-prdtCode",$("#inqu_status-0-prdtCode").val());
ei.set("inqu_status-0-status",$("#inqu_status-0-status").val());
ei.set("inqu_status-0-parentId",parentId? parentId : strs[1]);
// ei.set("inqu_status-0-parentId",-1);
return ei;
},
/**
* 点击行首checkbox,勾选行时触发的事件
* @param e kendo的Event对象
* e.sender kendoGrid对象,resultGrid
* e.fake 用于区分是手动点击的事件还是模拟的事件
* e.checked 用于区分是勾选还是取消勾选
* e.model 勾选或取消勾选的行数据,kendo.data.Model
* e.row 当前行的行号
* e.tr 行的tr,包括固定列和数据列 jquery对象
*/
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save'
|| e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
query: function () {
var ei = new EiInfo();
ei.set("inqu_status-0-prdtType", $("#inqu_status-0-prdtType").val());
ei.set("inqu_status-0-prdtCode", $("#inqu_status-0-prdtCode").val());
ei.set("inqu_status-0-status", $("#inqu_status-0-status").val());
let nodeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
ei.set("inqu_status-0-parentId", isBlank(nodeId) ? $("#inqu_status-0-projId").val() : nodeId);
return ei;
},
/**
* 点击行首checkbox,勾选行时触发的事件
* @param e kendo的Event对象
* e.sender kendoGrid对象,resultGrid
* e.fake 用于区分是手动点击的事件还是模拟的事件
* e.checked 用于区分是勾选还是取消勾选
* e.model 勾选或取消勾选的行数据,kendo.data.Model
* e.row 当前行的行号
* e.tr 行的tr,包括固定列和数据列 jquery对象
*/
onCheckRow: function (e) {
if (e.checked) {
console.log('选中');
......@@ -203,134 +190,134 @@ $(function () {
*/
onDelete: function (e) {
e.preventDefault();
deleteFunc();
deleteFunc();
},
toolbarConfig: {
hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
// cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮
delete: true, // 显示删除按钮
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.status;
let lv = item.lv
let template = '';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
}
if (lv === '3') {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
} /*else {
toolbarConfig: {
hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
// add: false, // 不显示新增按钮
// cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮
delete: true, // 显示删除按钮
},
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.status;
let lv = item.lv
let template = '';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
}
if (lv === '3') {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="check(' + item.id + ',1)" >提交</a>';
} /*else {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}*/
}
return template;
}
}, {
field: "prdtType",
title: "部件类型",
filter: function (options) {
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if(selectTreeNode.lv == 1) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(options.values, function (item) {
return item["valueField"]==4;
})
} else {
return _.filter(options.values, function (item) {
return item["valueField"]==2 || item["valueField"]==3;
})
}
}
},{
field: "prdtName",
title: "部件名称",
/*query: function (container, options) {
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
eiInfo.set("inqu_status-0-inventType", options.model["prdtType"]);
return eiInfo;
}*/
template: function (dataItem) {
for (let i = 0; i < prdtNameGlobalData.length; i++) {
if (prdtNameGlobalData[i]['textField'] === dataItem['prdtName']) {
//dataItem["prdtCode"] = prdtNameGlobalData[i]['valueField']
resultGrid.setCellValue(0, "prdtCode", prdtNameGlobalData[i]['valueField']);
return prdtNameGlobalData[i]['textField'];
}
}
return dataItem["prdtName"];
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if (selectTreeNode.lv == 1){
eiInfo.set("inventType", 4);
}else if (selectTreeNode.lv == 2){
eiInfo.set("inventTypes", [2,3]);
}else {
eiInfo.set("inventTypes", [3,4]);
}
eiInfo.set("isSplicingSymbol",false);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
prdtNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource,
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
}
}, {
field: "parentPrdtName",
template: function (dataItem) {
if(dataItem.lv > 2){
return dataItem['parentPrdtName'];
}
return "";
}
}
// {
// field: "inventRecordId",
// template: function (dataItem) {
// for (let i = 0; i < inventNameGlobalData.length; i++) {
// if (inventNameGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
// return inventNameGlobalData[i]['textField']+'-'+inventNameGlobalData[i]['param1Field'];
// }
// }
// return "";
// },
}
return template;
}
}, {
field: "prdtType",
title: "部件类型",
filter: function (options) {
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if (selectTreeNode.lv == 1) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(options.values, function (item) {
return item["valueField"] == 4;
})
} else {
return _.filter(options.values, function (item) {
return item["valueField"] == 2 || item["valueField"] == 3;
})
}
}
}, {
field: "prdtName",
// title: "部件名称",
/*query: function (container, options) {
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
eiInfo.set("inqu_status-0-inventType", options.model["prdtType"]);
return eiInfo;
}*/
template: function (dataItem) {
for (let i = 0; i < prdtNameGlobalData.length; i++) {
if (prdtNameGlobalData[i]['textField'] === dataItem['prdtName']) {
//dataItem["prdtCode"] = prdtNameGlobalData[i]['valueField']
resultGrid.setCellValue(0, "prdtCode", prdtNameGlobalData[i]['valueField']);
return prdtNameGlobalData[i]['textField'];
}
}
return dataItem["prdtName"];
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if (selectTreeNode.lv == 1) {
eiInfo.set("inventType", 4);
} else if (selectTreeNode.lv == 2) {
eiInfo.set("inventTypes", [2, 3]);
} else {
eiInfo.set("inventTypes", [3, 4]);
}
eiInfo.set("isSplicingSymbol", false);
var dataSource;
EiCommunicator.send("HPPZ004", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_name_block_id").getMappedRows();
prdtNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource,
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
}
}, {
field: "parentPrdtName",
template: function (dataItem) {
if (dataItem.lv > 2) {
return dataItem['parentPrdtName'];
}
return "";
}
}
// {
// field: "inventRecordId",
// template: function (dataItem) {
// for (let i = 0; i < inventNameGlobalData.length; i++) {
// if (inventNameGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
// return inventNameGlobalData[i]['textField']+'-'+inventNameGlobalData[i]['param1Field'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// var grid = container.closest(".k-grid").data("kendoGrid");
// var cellIndex = grid.cellIndex(container);
......@@ -363,6 +350,10 @@ $(function () {
]
},
};
// 查询
$("#QUERY").on("click", query);
/**
* 导入
*/
......@@ -387,104 +378,45 @@ $(function () {
});
e.preventDefault();
} else {
//uploadFileWindow.open();
var parentId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
var parentPrdtName = IPLATUI.EFTree.materialTree.selectTreeNode.prdtName;
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
var projName = IPLATUI.EFTree.materialTree.selectTreeNode.projName;
var deliveryDate = IPLATUI.EFTree.materialTree.selectTreeNode.deliveryDate;
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
JSColorbox.open({
href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_001&inqu_status-0-parentId=" + parentId+"&inqu_status-0-projCode="+projCode+"&inqu_status-0-projName="+projName+"&inqu_status-0-parentPrdtName="+parentPrdtName+"&inqu_status-0-deliveryDate="+deliveryDate,
title: "<div style='text-align: center;'>导入</div>",
width: "60%",
height: "50%",
callbackName: function () {
// 刷新列表
resultGrid.dataSource.page(1);
// 刷新树
updateTree();
// 关闭弹窗
JSColorbox.close();
}
});
var nodeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
var parentPrdtName = IPLATUI.EFTree.materialTree.selectTreeNode.prdtName;
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
var projName = IPLATUI.EFTree.materialTree.selectTreeNode.projName;
var deliveryDate = IPLATUI.EFTree.materialTree.selectTreeNode.deliveryDate;
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
JSColorbox.open({
href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_001&inqu_status-0-parentId="
+ nodeId + "&inqu_status-0-projCode=" + projCode + "&inqu_status-0-projName="
+ projName + "&inqu_status-0-parentPrdtName=" + parentPrdtName
+ "&inqu_status-0-deliveryDate=" + deliveryDate,
title: "<div style='text-align: center;'>导入</div>",
width: "60%",
height: "50%",
callbackName: function () {
// 刷新列表
resultGrid.dataSource.page(1);
// 刷新树
updateTree();
// 关闭弹窗
JSColorbox.close();
}
});
}
}
});
/* IPLATUI.EFUpload = {
fileUpload: {
showFileList: false,
upload: function (e) {
openFileWindow.close();
IPLAT.progress($("body"), true);
},
success: function (e) {
debugger;
var src;
var className;
if ("run" == projectEnv) {
//src = e.response.docUrl + e.response.docType
src = downloadHref(e.response.docId) + e.response.docType
className = e.response.groupId;
} else {
src = e.response.docUrl
//src = downloadHref(e.response.docId) + '.' + e.response.docUrl.split(".")[1];
className = e.response.docTag;
}
var parentId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
var parentPrdtName = IPLATUI.EFTree.materialTree.selectTreeNode.prdtName;
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
var projName = IPLATUI.EFTree.materialTree.selectTreeNode.projName;
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
var eiInfo = new EiInfo();
eiInfo.set("fileName", src);
eiInfo.set("className", className);
eiInfo.set("parentId", parentId);
eiInfo.set("parentPrdtName", parentPrdtName);
eiInfo.set("projCode", projCode);
eiInfo.set("projName", projName);
eiInfo.set("lv", lv);
EiCommunicator.send("HPFF001", "importDate", eiInfo, {
onSuccess: function (ei) {
if (ei.status == "-1") {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
refreshTree();
query();
}
},
onFail: function (ei) {
NotificationUtil("调用失败,原因[" + ei + "]", "error");
}
}, {
async: false
});
IPLAT.progress($("body"), false);
},
fail: function (e) {
IPLAT.NotificationUtil('导入失败!', "error");// 失败提示信息
}
}
}*/
$("#DOWNLOAD").on("click", function (e) {
var href = ctx + "\\HP\\template\\SC\\HPSC002_物料清单.xls";
window.location.href = href;
});
/**
* 生成模板
*/
$("#GENERATE").on("click", function () {
var projCode=strs[1];
var projCode = $("#inqu_status-0-projId").val();
var info = new EiInfo()
info.set("id", projCode);
info.set("id", $("#inqu_status-0-projId").val());
EiCommunicator.send("HPPZ015", "count", info, {
onSuccess: function (ei) {
if (ei["status"] == 1) {
......@@ -541,8 +473,8 @@ $(function () {
* 物料生成
*/
function assign() {
var projCode=strs[1];
var info = new EiInfo()
var projCode = $("#inqu_status-0-projId").val();
var info = new EiInfo()
info.set("id", projCode);
EiCommunicator.send("HPSC002", "count", info, {
onSuccess: function (ei) {
......@@ -616,7 +548,7 @@ $(function () {
}
// 关闭事件
// 关闭事件
IPLATUI.EFWindow = {
"uploadFile": {
close: function (e) {
......@@ -668,6 +600,7 @@ $(function () {
}, {async: false});
});
});
$(window).load(function () {
// 存货名称
let inInfo = new EiInfo();
......@@ -680,29 +613,14 @@ $(window).load(function () {
}
}, {async: false});
// 查
query();
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
let refreshTree = function () {
//更新树
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
}
function openUploadFile(id) {
uploadFileWindow.open().center();
// rowId = id;
resultGrid.dataSource.page(1);
}
/**
......@@ -720,25 +638,23 @@ function showUploadFile(id) {
}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPSC002', 'check', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPSC002', 'check', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
/**
* 删除
*/
......@@ -759,10 +675,15 @@ function deleteFunc() {
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002", "delete", true);
updateTree();
}
ok: function () {
JSUtils.submitGridsData("result", "HPSC002", "delete",
true, function (res) {
if (res.status > -1) {
refreshTree();
}
}
);
}
});
}
}
......@@ -809,24 +730,108 @@ function saveFunc() {
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002", "save", true);
updateTree();
JSUtils.submitGridsData("result", "HPSC002", "save",
true, function (res) {
if (res.status > -1) {
refreshTree();
}
}
);
}
});
}
}
//更新树
function updateTree() {
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
/**
* 刷新树
*/
let refreshTree = function () {
setTimeout(() => {
// 刷新树节点
const tree = $("#materialTree").data("kendoTreeView");
// 选中的节点
const treeId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
tree.reload(treeId)
// 展开成功后选中对应的树节点
expandTreeNode(tree, treeId);
// 展开成功后选中对应的树节点
selectTreeNode(tree, treeId);
}, 500);
}
/**
* 展开对应的树节点
*
* @param tree
* @param treeId
*/
let expandTreeNode = function (tree, treeId) {
if (!tree || treeId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeId);
if (barDataItem) {
tree.expandPath([treeId])
} else {
expandTreeNode(tree, treeId)
}
}, 300);
}
/**
* 选中树节点
*
* @param tree
* @param treeId
*/
let selectTreeNode = (tree, treeId) => {
if (!tree || treeId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeId);
if (barDataItem) {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
// 赋值
setTreeNodeValue(barDataItem);
} else {
selectTreeNode(tree, treeId)
}
}, 300)
}
/**
* 设置树节点的值
*
* @param nodeData
*/
let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId;
IPLATUI.EFTree.materialTree.selectTreeNode.pId = nodeData.pId;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtCode = nodeData.prdtCode;
IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtName = nodeData.prdtName;
IPLATUI.EFTree.materialTree.selectTreeNode.projName = nodeData.projName;
IPLATUI.EFTree.materialTree.selectTreeNode.deliveryDate = nodeData.deliveryDate;
IPLATUI.EFTree.materialTree.selectTreeNode.lv = nodeData.lv;
}
/**
* 动态显示列名
*/
let dynamicColumnName = function () {
// 根据叶子节点动态设置列名
let lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
let th = $("th[data-field='prdtName']");
if (lv == 2) {
th.html("<span class=\"i-input-required\">*</span>零件名称");
} else {
th.html("<span class=\"i-input-required\">*</span>部件名称");
}
}
......@@ -4,29 +4,27 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="物料清单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<%--<EF:EFSelect ename="inqu_status-0-prdtType" cname="部件类型" colWidth="3" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('3','4')"/>
</EF:EFSelect>--%>
<EF:EFSelect cname="部件名称" ename="inqu_status-0-prdtCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="状态" optionLabel="全部" ename="inqu_status-0-status" colWidth="3">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFSelect>
<EF:EFInput ename="inqu_status-0-projId" hidden="true"/>
</div>
<%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%>
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-projId" type="hidden"/>
<div class="row">
<%--<EF:EFSelect ename="inqu_status-0-prdtType" cname="部件类型" colWidth="3" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('3','4')"/>
</EF:EFSelect>--%>
<EF:EFSelect cname="部件名称" ename="inqu_status-0-prdtCode" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="状态" optionLabel="全部" ename="inqu_status-0-status" colWidth="3">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<div id="splitter" class="i-fit-height" style="display: inline">
<div id="left-pane" class="i-fit-height" style="width: 20%;float:left;">
<EF:EFRegion id="projTree" title="BOM结构图" fitHeight="true">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment