Commit 996ba97d by 宋祥

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

parent 73f603ab
......@@ -61,7 +61,7 @@ public class ServiceHGXT011B extends ServiceEPBase {
fXt011.setNoticeDate(DateUtils.formatShort(fXt011.getNoticeDate()));
fXt011.setExpireDate(DateUtils.formatShort(fXt011.getExpireDate()));
if (StringUtils.isBlank(fXt011.getNoticeNo())) {
this.add(fXt011);
fXt011 = this.add(fXt011);
} else {
this.modify(fXt011);
}
......@@ -81,11 +81,13 @@ public class ServiceHGXT011B extends ServiceEPBase {
*
* @param fXt011
*/
private void add(HGXT011 fXt011) {
private HGXT011 add(HGXT011 fXt011) {
fXt011.setNoticeNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.NOTICE_NO));
fXt011.setStatus(HGConstant.SubmitStatus.S0);
fXt011.setDeleteFlag(CommonConstant.YesNo.NO_0);
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>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
......
let INVENT_TYPE_BOX;
let INVENT_CODE_BOX;
let SPEC_BOX;
$(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 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 whRecordBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
......@@ -80,25 +83,10 @@ $(function() {
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(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)
}
}
});
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function (e) {
gridChange(grid, e);
});
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
......@@ -444,4 +432,48 @@ function detailCallback(result) {
$("#inqu_status-0-consWeight_textField").val(consWeight)
$("#inqu_status-0-consWeight").val(consWeight)
}
\ No newline at end of file
}
/**
* 表格变更事件
*/
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>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
......@@ -82,11 +75,12 @@
filter="contains">
</EF:EFComboColumn>
<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"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
columnTemplate="#=valueField#" itemTemplate="#=valueField#-#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="120"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="false" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......
let INVENT_TYPE_BOX;
let INVENT_CODE_BOX;
let SPEC_BOX;
$(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();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
var specIdBox = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
// 查询
$("#QUERY").on("click", query);
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(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) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
}
}
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [],
loadComplete: function(grid) {
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function (e) {
gridChange(grid, e);
});
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
}
}
})
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
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']);
}
}
}
......@@ -73,29 +73,34 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" required="true"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" 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"
displayType="0.000" sort="true" align="right"
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center" required="true"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=valueField#" itemTemplate="#=valueField#-#=textField#" readonly="false"
filter="contains">
</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"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center"
hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right"
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"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" width="120" enable="false" format="{0:N3}" editType="text"
......
......@@ -33,11 +33,12 @@
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" required="true"
blockName="invent_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货编码" enable="true" width="120" align="center" required="true"
blockName="invent_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=valueField#" itemTemplate="#=valueField#-#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="120"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_name_block_id" textField="textField" valueField="valueField"
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