Commit 98f1ce71 by 江和松

材料计划bug修改

parent 9b4e2a5d
......@@ -92,7 +92,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框 (不默认状态)
* 编写:
*/
INVENT_RECORD_BOX_BLOCK_ID("invent_record_box_block_id","inventCode","inventName","status","id","inventType","spec","material","unit","HGPZ005.queryInventCodeBox"),
INVENT_RECORD_BOX_BLOCK_ID("invent_record_box_block_id","inventCode","inventName","status","id","inventType","spec","material","unit", "length", "width", "thick","HGPZ005.queryInventCodeBox"),
/**
* 模块:存货档案
......
......@@ -324,6 +324,9 @@
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit",
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
STATUS as "status"
FROM ${hggpSchema}.HGPZ005
WHERE DELETE_FLAG = 0
......
......@@ -4,21 +4,21 @@
Version : 1.0
schema : hggp
tableName : HGSC009
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PLAN_MATERIAL_CODE VARCHAR,
PLAN_MATERIAL_NAME VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PLAN_MATERIAL_CODE VARCHAR,
PLAN_MATERIAL_NAME VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HGSC009">
......@@ -102,7 +102,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......@@ -113,57 +113,6 @@
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planMaterialCode">
PLAN_MATERIAL_CODE = #planMaterialCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planMaterialName">
PLAN_MATERIAL_NAME = #planMaterialName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSJ003 (ID, <!-- 主键id -->
......
......@@ -21,15 +21,16 @@ $(function () {
if (item.companyCode && item.projCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.projCode + '\',\'' + item.projName + '\'' +
',\'' + item.planMaterialCode + '\',\'' + item.planMaterialName + '\')" >计划详情</a>';
',\'' + item.planMaterialCode + '\',\'' + item.planMaterialName + '\',\'' + item.status + '\')" >计划详情</a>';
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
} else if (auditStatus == 1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >已提交</a>';
}
// if (auditStatus == 1) {
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
// 'onclick="updateStatus(' + item.id + ',1)" >已提交</a>';
// }
}
return template;
}
......@@ -39,7 +40,6 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']) {
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
}
}
......@@ -56,19 +56,34 @@ $(function () {
}
}
return dataItem["projCode"];
}
},
{
field: "projName",
title: "项目名称",
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['textField'] === dataItem['projName']) {
dataItem['projCode'] = groupCodeBox[i]['valueField']
return groupCodeBox[i]['textField'];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}
return dataItem["projName"];
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#",
filter: "contains"
});
}
}, {
field: "createdTime",
......@@ -86,12 +101,21 @@ $(function () {
$("#INSERTCG").on("click", INSERTCG);
grid.dataSource.bind("change", function (e) {
if (e.field == "companyCode") {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === e.items[0]['companyCode']) {
resultGrid.setCellValue(e.items[0],"companyName",companyCodeBox[i]['textField']);
}
}
loadChange(grid, e, "projCode");
}
// 判断父级节点是否发生变化
if (e.field == "projCode") {
loadChange(grid, e, "projName");
loadChange(grid, e, "planMaterialName");
} else if (e.field == "projName") {
loadChange(grid, e, "projCode");
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === e.items[0]['projCode']) {
resultGrid.setCellValue(e.items[0],"projName",groupCodeBox[i]['textField']);
}
}
loadChange(grid, e, "planMaterialName");
}
});
......@@ -155,7 +179,7 @@ $(function () {
*
* @param id
*/
function showUploadFile(companyCode,companyName,projCode,projName,planMaterialCode,planMaterialName) {
function showUploadFile(companyCode,companyName,projCode,projName,planMaterialCode,planMaterialName,status) {
JSColorbox.open({
href: "HGSC009A?methodName=initLoad&" +
"inqu_status-0-companyCode=" + companyCode +
......@@ -163,7 +187,8 @@ function showUploadFile(companyCode,companyName,projCode,projName,planMaterialCo
"&inqu_status-0-planMaterialCode=" + planMaterialCode +
"&inqu_status-0-planMaterialName="+ planMaterialName +
"&inqu_status-0-projCode=" + projCode +
"&inqu_status-0-projName=" + projName ,
"&inqu_status-0-projName=" + projName +
"&inqu_status-0-status=" + status ,
title: "<div style='text-align: center;'>材料计划清单</div>",
width: "80%",
height: "80%",
......
......@@ -19,7 +19,7 @@
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="提交状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......@@ -35,21 +35,24 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" cname="项目编码"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projName" cname="项目名称" width="100" enable="true" readonly="true" align="center">
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center" hidden="true" />
<%-- <EF:EFComboColumn ename="projCode" cname="项目编码"--%>
<%-- columnTemplate="#=textField#" itemTemplate="#=textField#"--%>
<%-- textField="textField" valueField="valueField"--%>
<%-- maxLength="16" width="120"--%>
<%-- align="center" filter="contains" sort="true">--%>
<%-- <EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>--%>
<%-- </EF:EFComboColumn>--%>
<%-- <EF:EFComboColumn ename="projName" cname="项目名称" width="100" enable="true" readonly="true" align="center">--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="createdTime" cname="材料计划日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planMaterialCode" cname="材料计划编码" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="planMaterialName" cname="材料计划名称" width="120" enable="true" readonly="false" align="center"/>
<EF:EFComboColumn ename="status" cname="提交状态" width="80" enable="true" readonly="false" align="center" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
<EF:EFComboColumn ename="status" cname="提交状态" width="80" enable="true" readonly="true" align="center" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -2,6 +2,8 @@ let InventNameGlobalData = [];
let inventAllGlobalData = [];
$(function () {
var inventRecordBoxBlockId = __eiInfo.getBlock("invent_record_box_block_id").getMappedRows();
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
......@@ -10,51 +12,49 @@ $(function () {
columns: [{
field: "inventCode",
filter: function (options) {
return _.filter(InventNameGlobalData, function (item) {
return _.filter(inventAllBlockId, function (item) {
return item["param1Field"] == "true";
})
},
template: function (dataItem) {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
dataItem['inventName'] = InventNameGlobalData[i]['textField'];
return InventNameGlobalData[i]['textField'];
template: function (item) {
let template = "";
if(item.inventCode){
for(let i=0;i<inventRecordBoxBlockId.length;i++){
if(item.inventCode === inventRecordBoxBlockId[i]['valueField']){
template = inventRecordBoxBlockId[i]['valueField'];
}else{
template = item.inventCode;
}
}
}
return dataItem['inventCode'];
return template;
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-isSplicingSymbol", true);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, {
field: "spec",
filter: function (options) {
return _.filter(inventAllGlobalData, function (item) {
return item["param7Field"] == "true";
})
},
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['spec']) {
return inventAllGlobalData[i]['textField'];
let dataSource = inventRecordBoxBlockId;
EiCommunicator.send("HGPZ005", "queryInventCodeBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_record_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryInventBoxAll");
inInfo.set("blockId", "invent_all_box_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
minLength: 0,
dataTextField: "valueField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#",
filter: "contains"
});
}
}],
loadComplete: function (grid) {
......@@ -74,22 +74,14 @@ $(function () {
}
}
if (e.field === "inventCode") {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === e.items[0].inventCode) {
resultGrid.setCellValue(e.items[0], 'inventName', InventNameGlobalData[i]['textField'])
}
}
loadChange(grid, e, "spec");
} else if (e.field == "spec") {
var tr, index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field'])
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field'])
for (let i = 0; i < inventRecordBoxBlockId.length; i++) {
if (inventRecordBoxBlockId[i]['valueField'] === e.items[0].inventCode) {
resultGrid.setCellValue(e.items[0], 'inventName', inventRecordBoxBlockId[i]['textField'])
resultGrid.setCellValue(e.items[0], 'spec', inventRecordBoxBlockId[i]['param4Field'])
resultGrid.setCellValue(e.items[0], 'material', inventRecordBoxBlockId[i]['param5Field'])
resultGrid.setCellValue(e.items[0], 'length', inventRecordBoxBlockId[i]['param7Field'])
resultGrid.setCellValue(e.items[0], 'width', inventRecordBoxBlockId[i]['param8Field'])
resultGrid.setCellValue(e.items[0], 'thick', inventRecordBoxBlockId[i]['param9Field'])
}
}
}
......@@ -111,6 +103,14 @@ $(function () {
*/
$(window).load(function () {
query();
let submitStatus = $("#inqu_status-0-status").val();
//只有手动录入的才能修改
if(submitStatus==1){
$(".k-grid-add").hide();
$(".k-grid-save-changes").hide();
$(".k-grid-cancel-changes").hide();
$(".k-grid-delete").hide();
}
});
/**
......
......@@ -8,11 +8,13 @@
<EF:EFPage title="材料计划详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<%-- <EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFInput cname="状态" ename="status" blockId="inqu_status" row="0" readonly="true" type="hidden" colWidth="3" />
<EF:EFInput cname="公司编码" ename="companyCode" blockId="inqu_status" row="0" readonly="true" type="hidden" colWidth="3" />
<EF:EFInput cname="公司名称" ename="companyName" blockId="inqu_status" row="0" readonly="true" type="hidden" colWidth="3" />
<EF:EFInput cname="计划编号" ename="planMaterialCode" blockId="inqu_status" row="0" readonly="true" colWidth="3" />
......@@ -37,14 +39,15 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>--%>
<EF:EFComboColumn ename="inventCode" cname="存货编码" width="120" align="center" required="true"
blockName="invent_record_block_id" textField="valueField" valueField="valueField"
columnTemplate="#=valueField#" itemTemplate="#=valueField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<%-- <EF:EFComboColumn ename="inventCode" cname="存货编码" width="120" align="center" required="true"--%>
<%-- blockName="invent_record_block_id" textField="valueField" valueField="valueField"--%>
<%-- columnTemplate="#=valueField#" itemTemplate="#=valueField#" readonly="false"--%>
<%-- filter="contains">--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="inventCode" required="true" cname="产品编号" />
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false" readonly="true" required="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false" readonly="true" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" required="true" readonly="true" enable="false"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
......
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