Commit 996ba97d by 宋祥

1.fixBug:发货明细增加存货编码

parent 73f603ab
...@@ -61,7 +61,7 @@ public class ServiceHGXT011B extends ServiceEPBase { ...@@ -61,7 +61,7 @@ public class ServiceHGXT011B extends ServiceEPBase {
fXt011.setNoticeDate(DateUtils.formatShort(fXt011.getNoticeDate())); fXt011.setNoticeDate(DateUtils.formatShort(fXt011.getNoticeDate()));
fXt011.setExpireDate(DateUtils.formatShort(fXt011.getExpireDate())); fXt011.setExpireDate(DateUtils.formatShort(fXt011.getExpireDate()));
if (StringUtils.isBlank(fXt011.getNoticeNo())) { if (StringUtils.isBlank(fXt011.getNoticeNo())) {
this.add(fXt011); fXt011 = this.add(fXt011);
} else { } else {
this.modify(fXt011); this.modify(fXt011);
} }
...@@ -81,11 +81,13 @@ public class ServiceHGXT011B extends ServiceEPBase { ...@@ -81,11 +81,13 @@ public class ServiceHGXT011B extends ServiceEPBase {
* *
* @param fXt011 * @param fXt011
*/ */
private void add(HGXT011 fXt011) { private HGXT011 add(HGXT011 fXt011) {
fXt011.setNoticeNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.NOTICE_NO)); fXt011.setNoticeNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.NOTICE_NO));
fXt011.setStatus(HGConstant.SubmitStatus.S0); fXt011.setStatus(HGConstant.SubmitStatus.S0);
fXt011.setDeleteFlag(CommonConstant.YesNo.NO_0); fXt011.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGXT011.INSERT, fXt011); DaoUtils.insert(HGXT011.INSERT, fXt011);
// 返回带ID的实体类
return HgXtTools.HgXt011.get(fXt011.getNoticeNo());
} }
/** /**
......
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/4
Time: 10:45
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html> <!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %> <%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
......
let INVENT_TYPE_BOX;
let INVENT_CODE_BOX;
let SPEC_BOX;
$(function() { $(function() {
/*$(".row").children().attr("class", "col-md-3");*/ INVENT_TYPE_BOX = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
INVENT_CODE_BOX = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
SPEC_BOX = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
var companyBox = __eiInfo.getBlock("roleCompany").getMappedRows(); var companyBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projRecordBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows(); var projRecordBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
var specIdBox = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
var customerAllBox = __eiInfo.getBlock("customer_record_all_block_id").getMappedRows(); var customerAllBox = __eiInfo.getBlock("customer_record_all_block_id").getMappedRows();
var whRecordBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows(); var whRecordBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
...@@ -80,24 +83,9 @@ $(function() { ...@@ -80,24 +83,9 @@ $(function() {
} }
}], }],
loadComplete: function(grid) { loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化 // 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function (e) {
// 判断父级节点是否发生变化 gridChange(grid, e);
if (e.field === "quantity"){
for (let i = 0; i < e.items.length; i++) {
let quantity = e.items[i]["quantity"];
let unitWeight = e.items[i]["unitWeight"];
let weight = quantity*unitWeight;
resultGrid.setCellValue(e.items[i],"weight",weight);
$("#inqu_status-0-consQuantity_textField").val(quantity)
$("#inqu_status-0-consQuantity").val(quantity)
$("#inqu_status-0-consWeight_textField").val(weight)
$("#inqu_status-0-consWeight").val(weight)
}
}
}); });
}, },
onSuccess: function (e) { onSuccess: function (e) {
...@@ -445,3 +433,47 @@ function detailCallback(result) { ...@@ -445,3 +433,47 @@ function detailCallback(result) {
$("#inqu_status-0-consWeight_textField").val(consWeight) $("#inqu_status-0-consWeight_textField").val(consWeight)
$("#inqu_status-0-consWeight").val(consWeight) $("#inqu_status-0-consWeight").val(consWeight)
} }
/**
* 表格变更事件
*/
let gridChange = function (grid, e) {
if (e.field === "quantity") {
gridChangeQuantity(grid, e);
} else if (e.field === "inventCode") {
gridChangeInventCode(grid, e);
}
}
/**
* 数量变更事件
*
* @param grid
* @param e
*/
let gridChangeQuantity = function (grid, e) {
for (let i = 0; i < e.items.length; i++) {
let quantity = e.items[i]["quantity"];
let unitWeight = e.items[i]["unitWeight"];
let weight = quantity * unitWeight;
resultGrid.setCellValue(e.items[i], "weight", weight);
$("#inqu_status-0-consQuantity_textField").val(quantity)
$("#inqu_status-0-consQuantity").val(quantity)
$("#inqu_status-0-consWeight_textField").val(weight)
$("#inqu_status-0-consWeight").val(weight)
}
}
/**
* 存货编码变更事件
*
* @param grid
* @param e
*/
let gridChangeInventCode = function (grid, e) {
for (let i = 0; i < INVENT_CODE_BOX.length; i++) {
if (INVENT_CODE_BOX[i]['valueField'] === e.items[0]["inventCode"]) {
resultGrid.setCellValue(e.items[0], "inventName", INVENT_CODE_BOX[i]['textField']);
}
}
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/4
Time: 10:46
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html> <!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %> <%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
...@@ -82,11 +75,12 @@ ...@@ -82,11 +75,12 @@
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/> <EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center" required="true" <EF:EFComboColumn ename="inventCode" cname="存货编码" enable="false" width="120" align="center" required="true"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField" blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=valueField#" itemTemplate="#=valueField#-#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="120"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="false" width="120" align="center" required="true" <EF:EFComboColumn ename="spec" cname="规格" enable="false" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField" blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......
let INVENT_TYPE_BOX;
let INVENT_CODE_BOX;
let SPEC_BOX;
$(function () { $(function () {
$(".row").children().attr("class", "col-md-3"); // 初始化数据
INVENT_TYPE_BOX = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
INVENT_CODE_BOX = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
SPEC_BOX = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows(); $(".row").children().attr("class", "col-md-3");
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
var specIdBox = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
...@@ -15,37 +20,9 @@ $(function () { ...@@ -15,37 +20,9 @@ $(function () {
}, },
columns: [], columns: [],
loadComplete: function(grid) { loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化 // 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function (e) {
// 判断父级节点是否发生变化 gridChange(grid, e);
if (e.field === "spec"){
for (let i = 0; i < specIdBox.length; i++) {
if (specIdBox[i]['param7Field'] === e.items[0]["inventRecordId"]){
e.items[0]["length"] = specIdBox[i]['param1Field'];
e.items[0]["width"] = specIdBox[i]['param2Field'];
e.items[0]["thick"] = specIdBox[i]['param3Field'];
e.items[0]["quantity"] = specIdBox[i]['param4Field'];
resultGrid.setCellValue(e.items[0],"unitWeight",specIdBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"weight",specIdBox[i]['param6Field']);
//e.items[0]["unitWeight"] = specIdBox[i]['param5Field'];
//e.items[0]["weight"] = specIdBox[i]['param6Field'];
}
}
loadChange(grid,e,"length");
loadChange(grid,e,"width");
loadChange(grid,e,"thick");
//loadChange(grid,e,"unitWeight");
//loadChange(grid,e,"weight");
loadChange(grid,e,"quantity");
}else if (e.field === "quantity"){
if (e.items[0].quantity != 0 && e.items[0].unitWeight > 0){
e.items[0].weight = e.items[0].unitWeight*e.items[0].quantity;
resultGrid.setCellValue(e.items[0],"weight",e.items[0].unitWeight*e.items[0].quantity);
}
}else if (e.field === "inventCode"){
loadChange(grid,e,"spec");
}
}); });
}, },
onSuccess: function (e) { onSuccess: function (e) {
...@@ -67,6 +44,77 @@ $(function () { ...@@ -67,6 +44,77 @@ $(function () {
} }
}) })
/**
* 查询
*/
let query = function () { let query = function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
} }
/**
* 表格更改事件
*/
let gridChange = function (grid, e) {
if (e.field === "spec") {
gridChangeSpec(grid, e);
} else if (e.field === "quantity") {
gridChangeQuantity(grid, e);
} else if (e.field === "inventCode") {
gridChangeInventCode(grid, e);
}
}
/**
* 规格变更事件
*
* @param grid
* @param e
*/
let gridChangeSpec = function (grid, e) {
for (let i = 0; i < SPEC_BOX.length; i++) {
if (SPEC_BOX[i]['param7Field'] === e.items[0]["inventRecordId"]) {
e.items[0]["length"] = SPEC_BOX[i]['param1Field'];
e.items[0]["width"] = SPEC_BOX[i]['param2Field'];
e.items[0]["thick"] = SPEC_BOX[i]['param3Field'];
e.items[0]["quantity"] = SPEC_BOX[i]['param4Field'];
resultGrid.setCellValue(e.items[0], "unitWeight", SPEC_BOX[i]['param5Field']);
resultGrid.setCellValue(e.items[0], "weight", SPEC_BOX[i]['param6Field']);
//e.items[0]["unitWeight"] = specIdBox[i]['param5Field'];
//e.items[0]["weight"] = specIdBox[i]['param6Field'];
}
}
loadChange(grid, e, "length");
loadChange(grid, e, "width");
loadChange(grid, e, "thick");
//loadChange(grid,e,"unitWeight");
//loadChange(grid,e,"weight");
loadChange(grid, e, "quantity");
}
/**
* 数量变更事件
*
* @param grid
* @param e
*/
let gridChangeQuantity = function (grid, e) {
if (e.items[0].quantity != 0 && e.items[0].unitWeight > 0) {
e.items[0].weight = e.items[0].unitWeight * e.items[0].quantity;
resultGrid.setCellValue(e.items[0], "weight", e.items[0].unitWeight * e.items[0].quantity);
}
}
/**
* 存货编码变更事件
*
* @param grid
* @param e
*/
let gridChangeInventCode = function (grid, e) {
loadChange(grid, e, "spec");
for (let i = 0; i < INVENT_CODE_BOX.length; i++) {
if (INVENT_CODE_BOX[i]['valueField'] === e.items[0]["inventCode"]) {
resultGrid.setCellValue(e.items[0], "inventName", INVENT_CODE_BOX[i]['textField']);
}
}
}
...@@ -80,20 +80,25 @@ ...@@ -80,20 +80,25 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" required="true" <EF:EFComboColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center" required="true"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField" blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=valueField#" itemTemplate="#=valueField#-#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" enable="false" readonly="true"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true" <EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField" blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" maxLength="50"/> <EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center"
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/> hidden="true" maxLength="50"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/> <EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right"
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/> format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right"
format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right"
format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text" <EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
......
...@@ -33,11 +33,12 @@ ...@@ -33,11 +33,12 @@
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/> <EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" required="true" <EF:EFComboColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center" required="true"
blockName="invent_record_block_id" textField="textField" valueField="valueField" blockName="invent_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true" columnTemplate="#=valueField#" itemTemplate="#=valueField#-#=textField#" readonly="true"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="120"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true" <EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_name_block_id" textField="textField" valueField="valueField" blockName="spec_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="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