Commit 4358a893 by liuyang

物料清单页面优化

parent 7fb9eb76
......@@ -127,6 +127,26 @@ public class ServiceHPSC003 extends ServiceBase {
Map<?, ?> map = eiBlock.getRow(i);
HPSC004.fromMap(map);
DaoUtils.update("HPSC004.updateHPSC0004", HPSC004.toMap());
List list = this.dao.query("HPSC004.query", new HashMap<String,Object>(){{
put("companyCode",HPSC004.getCompanyCode());
put("projCode",HPSC004.getProjCode());
put("parentId",HPSC004.getParentId());
put("planCommentDate"," ");
put("planCompletionDate"," ");
}});
if (list.size() == 0) {
List<HPSC004> list1 = this.dao.query("HPSC004.queryDate", new HashMap<String,Object>(){{
put("companyCode",HPSC004.getCompanyCode());
put("projCode",HPSC004.getProjCode());
put("parentId",HPSC004.getParentId());
}});
HPSC003 HPSC003 = new HPSC003();
HPSC003.setCompanyCode(HPSC004.getCompanyCode());
HPSC003.setProjCode(HPSC004.getProjCode());
HPSC003.setPlanInfoNo(HPSC004.getParentId());
HPSC003.setPlanCompletionDate(list1.get(0).getPlanCompletionDate());
DaoUtils.update("HPSC003.updateDate", HPSC003.toMap());
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
......
......@@ -57,26 +57,6 @@ public class ServiceHPSC004 extends ServiceBase {
Map<?, ?> map = eiBlock.getRow(i);
HPSC004.fromMap(map);
DaoUtils.insert("HPSC004.insert", HPSC004.toMap());
List list = this.dao.query("HPSC004.query", new HashMap<String,Object>(){{
put("companyCode",HPSC004.getCompanyCode());
put("projCode",HPSC004.getPrdtCode());
put("parentId",HPSC004.getParentId());
put("planCommentDate","");
put("planCompletionDate","");
}});
if (list == null) {
List<Map> list1 = this.dao.query("HPSC004.query", new HashMap<String,Object>(){{
put("companyCode",HPSC004.getCompanyCode());
put("projCode",HPSC004.getPrdtCode());
put("parentId",HPSC004.getParentId());
}});
HPSC003 HPSC003 = new HPSC003();
HPSC003.setCompanyCode(HPSC004.getCompanyCode());
HPSC003.setPrdtCode(HPSC004.getPrdtCode());
HPSC003.setPlanInfoNo(HPSC004.getParentId());
HPSC003.setPlanCompletionDate(list1.get(0).get("planCompletionDate").toString());
DaoUtils.update("HPSC003.updateDate", HPSC003.toMap());
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
......
var inventNameGlobalData = [];
var prdtNameGlobalData = [];
// 传递参数 将附件ID与当前记录ID进行绑定
// let rowId = '';
let parentId = '';
......@@ -41,7 +42,11 @@ $(function () {
select: function (e) {
var nodeData = this.dataItem(e.node);
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
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) {
......@@ -56,6 +61,7 @@ $(function () {
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.lv = nodeData.lv;
// 重新查询EFGrid
parentId = nodeData.nodeId;
query();
......@@ -150,11 +156,18 @@ $(function () {
onAdd: function (e) {
// 动态设置默认邮箱
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
//e.items[0]['prdtType'] = selectTreeNode.lv = 4;
$.each(e.items, function (index, item) {
item['projCode'] = selectTreeNode.projCode;
item['projName'] = selectTreeNode.projName;
item['parentId'] = selectTreeNode.nodeId;
item['parentPrdtName'] = selectTreeNode.prdtName;
if (selectTreeNode.lv == 1){
item['prdtType'] = 4;
}else if (selectTreeNode.lv == 2){
item['prdtType'] = 3;
}
//item['id'] = null
});
},
/**
......@@ -205,26 +218,69 @@ $(function () {
let template = '';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</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 {
} /*else {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}
}*/
}
return template;
}
},{
field: "prdtName",
query: function (container, options) {
/*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();
eiInfo.set("inventType", 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",
......@@ -274,22 +330,7 @@ $(function () {
// });
// }
// }
],
loadComplete: function (grid) {
// 此grid对象
// grid.dataSource.bind("change", function(e) {
// if (e.field == "inventRecordId") {
// var tr,index;
// // 获取此model元素信息
// var item = e.items[0];
// for (let i = 0; i < inventNameGlobalData.length; i++) {
// if (inventNameGlobalData[i]['valueField'] === item.inventRecordId) {
// resultGrid.setCellValue(item, 'prdtCode', inventNameGlobalData[i]['textField'])
// }
// }
// }
// });
}
]
},
};
......
......@@ -10,11 +10,11 @@
<EF:EFPage title="物料清单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect ename="inqu_status-0-prdtType" cname="部件类型" colWidth="3" filter="contains"
<%--<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>--%>
<EF:EFSelect cname="部件名称" ename="inqu_status-0-prdtCode" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
......@@ -46,23 +46,33 @@
<EF:EFColumn ename="level" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目编码"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
<EF:EFComboColumn cname="部件类型" ename="prdtType" width="90" align="center" required="true">
<%--<EF:EFComboColumn cname="部件类型" ename="prdtType" width="90" align="center" required="true"
columnTemplate="#=textField#"
itemTemplate="#=textField#"
textField="textField"
valueField="valueField">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('3','4')"/>
</EF:EFComboColumn>--%>
<EF:EFComboColumn ename="prdtType" cname="部件类型" align="center" required="true"
filter="contains" width="90">
<EF:EFOption label="零部件" value="3"/>
<EF:EFOption label="部件" value="4"/>
</EF:EFComboColumn>
<EF:EFPopupColumn ename="prdtName" cname="部件名称" width="200" popupType="ServiceGrid"
<%--<EF:EFPopupColumn ename="prdtName" cname="部件名称" width="200" popupType="ServiceGrid"
popupTitle="部件信息" serviceName="HPPZ006" methodName="queryPrdtComboBox" resultId="invent_prdt_name_block_id"
columnEnames="param1Field,textField"
columnCnames="部件名称,部件编码"
backFillColumnIds="param1Field,textField"
backFillFieldIds="prdtName,prdtCode"
valueField="param1Field" textField="param1Field"/>
<EF:EFColumn ename="prdtCode" cname="部件编码"/>
valueField="param1Field" textField="param1Field"/>--%>
<EF:EFColumn ename="prdtName" cname="部件名称" width="200" align="center" maxLength="50"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" hidden = 'true'/>
<EF:EFColumn ename="length" cname="长" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" />
<EF:EFColumn enable="false" ename="parentId" hidden="true" cname="上级部件名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" cname="上级部件名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" hidden="true" cname="上级部件名称"/>
<EF:EFColumn ename="num" required="true" cname="数量"/>
<EF:EFColumn ename="unitWt" required="true" format="{0:N3}" cname="单重"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" cname="总重"/>
......
......@@ -27,10 +27,10 @@ $(function () {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
}
else {
/*else {
template += '<a hidden="hidden" style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}
}*/
return template;
}
},
......
......@@ -41,7 +41,7 @@
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" readonly="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true"/>
<EF:EFComboColumn ename="prdtType" cname="部件类型" width="90" align="center" enable="false">
<EF:EFComboColumn ename="prdtType" cname="部件类型" hidden = 'true' width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="部件编码" readonly="true" hidden = "true"/>
......@@ -63,12 +63,14 @@
<EF:EFRegion id="detail" title="明细信息">
<EF:EFGrid blockId="detail" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="父ID" hidden="true"/>
<EF:EFComboColumn ename="prdtType" cname="零件类型" width="90" align="center" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="零件编码" hidden = "true"/>
<EF:EFColumn enable="false" ename="prdtName" readonly="true" cname="零件名称"/>
<EF:EFColumn enable="false" ename="prdtCode" cname="零件编码" hidden = "true"/>
<EF:EFColumn enable="false" ename="prdtName" readonly="true" cname="零件名称"/>
<EF:EFColumn enable="false" ename="spec" cname="规格" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<%-- <EF:EFComboColumn enable="false" ename="delStatus" cname="状态">--%>
......
......@@ -211,10 +211,10 @@ $(function () {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
} else {
} /*else {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',0)" >撤回</a>';
}
}*/
}
return template;
}
......
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