Commit c55430f9 by 宋祥

1.物料清单页面优化

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