Commit c52075a2 by 江和松

物料增加长宽厚字段

parent 7f654c5f
......@@ -91,7 +91,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框,带id名称等信息
* 编写:
*/
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","HGPZ005.queryProductComboBox"),
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","HGPZ005.queryProductComboBox"),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
......
......@@ -345,6 +345,9 @@
a.INVENT_TYPE as "inventType",
a.INVENT_CODE as "inventCode",
a.INVENT_NAME as "inventName",
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
b.PAR_INVENT_TYPE as "parInventType"
FROM ${hggpSchema}.HGPZ005 a
left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0
......
......@@ -40,6 +40,9 @@ public class HGSC004A extends DaoEPBase {
public static final String FIELD_product_name = "productName"; /* 产品名称*/
public static final String FIELD_product_type = "productType"; /* 产品type*/
public static final String FIELD_invent_type = "inventType"; /* 档案类型*/
public static final String FIELD_length = "length"; /* 长*/
public static final String FIELD_width = "width"; /* 宽*/
public static final String FIELD_thick = "thick"; /* 厚*/
public static final String FIELD_product_status = "productStatus"; /* 产品状态 0:未提交,1:已提交*/
public static final String FIELD_change_type = "changeType"; /* 变更类型:默认0,1:增加,2:替换,3:删除*/
public static final String FIELD_quantity = "quantity"; /* 数量*/
......@@ -72,6 +75,9 @@ public class HGSC004A extends DaoEPBase {
public static final String COL_product_name = "product_name"; /* 产品名称*/
public static final String COL_product_type = "product_type"; /* 产品类型*/
public static final String COL_invent_type = "invent_type"; /* 档案类型*/
public static final String COL_length = "length"; /* 长*/
public static final String COL_width = "width"; /* 宽*/
public static final String COL_thick = "thick"; /* 厚*/
public static final String COL_product_status = "product_status"; /* 产品状态 0:未提交,1:已提交*/
public static final String COL_change_type = "change_type"; /* 变更类型:默认0,1:增加,2:替换,3:删除*/
public static final String COL_quantity = "quantity"; /* 数量*/
......@@ -119,6 +125,9 @@ public class HGSC004A extends DaoEPBase {
private String productName = " "; /* 产品名称*/
private String productType = " "; /* 产品类型*/
private String inventType = " "; /* 档案类型*/
private BigDecimal length = new BigDecimal("0"); /* 长*/
private BigDecimal width = new BigDecimal("0"); /* 宽*/
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private Integer productStatus = new Integer(0); /* 产品状态 0:未提交,1:已提交*/
private Integer changeType = new Integer(0); /* 变更类型:默认0,1:增加,2:替换,3:删除*/
private Integer quantity = new Integer(0); /* 数量*/
......@@ -234,6 +243,27 @@ public class HGSC004A extends DaoEPBase {
eiColumn.setDescName("档案类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_length);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_width);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_thick);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_status);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
......@@ -786,6 +816,30 @@ public class HGSC004A extends DaoEPBase {
this.inventType = inventType;
}
public BigDecimal getLength() {
return length;
}
public void setLength(BigDecimal length) {
this.length = length;
}
public BigDecimal getWidth() {
return width;
}
public void setWidth(BigDecimal width) {
this.width = width;
}
public BigDecimal getThick() {
return thick;
}
public void setThick(BigDecimal thick) {
this.thick = thick;
}
/**
* get the value from Map.
*
......@@ -812,6 +866,9 @@ public class HGSC004A extends DaoEPBase {
setProductId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_product_id)), productId));
setProductType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_type)), productType));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_invent_type)), inventType));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_length)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_width)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_thick)), thick));
setProductStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_status)), productStatus));
setChangeType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_change_type)), changeType));
setQuantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_quantity)), quantity));
......@@ -852,6 +909,9 @@ public class HGSC004A extends DaoEPBase {
map.put(FIELD_product_id, StringUtils.toString(productId, eiMetadata.getMeta(FIELD_product_id)));
map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_invent_type, StringUtils.toString(inventType, eiMetadata.getMeta(FIELD_invent_type)));
map.put(FIELD_length, StringUtils.toString(length, eiMetadata.getMeta(FIELD_length)));
map.put(FIELD_width, StringUtils.toString(width, eiMetadata.getMeta(FIELD_width)));
map.put(FIELD_thick, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_thick)));
map.put(FIELD_product_status, StringUtils.toString(productStatus, eiMetadata.getMeta(FIELD_product_status)));
map.put(FIELD_change_type, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_change_type)));
map.put(FIELD_quantity, StringUtils.toString(quantity, eiMetadata.getMeta(FIELD_quantity)));
......
......@@ -18,6 +18,9 @@
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
invent_type as "inventType", <!-- 档案类型 -->
length as "length", <!-- 长 -->
width as "width", <!-- 宽 -->
thick as "thick", <!-- 厚 -->
product_status as "productStatus", <!-- 产品状态 0:未提交,1:已提交 -->
change_type as "changeType", <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity as "quantity", <!-- 数量 -->
......@@ -129,6 +132,15 @@
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
length = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
width = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
thick = #thick#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -178,6 +190,9 @@
a.product_code as "productCode", <!-- 产品编号 -->
a.product_name as "productName", <!-- 产品名称 -->
a.invent_type as "inventType", <!-- 档案类型 -->
a.length as "length", <!-- 长 -->
a.width as "width", <!-- 宽 -->
a.thick as "thick", <!-- 厚 -->
a.product_status as "productStatus", <!-- 产品状态 0:未提交,1:已提交 -->
a.change_type as "changeType", <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
a.quantity as "quantity", <!-- 数量 -->
......@@ -267,13 +282,16 @@
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
updated_time, <!-- 更新时间 -->
length, <!-- 长 -->
width, <!-- 宽 -->
thick <!-- 厚 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#,
#parentProdCode#, #parentProdName#,#leaf#,#sort#,#lv#, #materialId#, #productId#,#productType#,
#productCode#, #productName#,#inventType#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#,
#approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#)
#updatedName#, #updatedTime#, #length#, #width#, #thick#)
</insert>
<delete id="delete">
......@@ -300,6 +318,9 @@
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
invent_type = #inventType#, <!-- 档案类型 -->
length = #length#, <!-- 长 -->
width = #width#, <!-- 宽 -->
thick = #thick#, <!-- 厚 -->
product_status = #productStatus#, <!-- 产品状态 0:未提交,1:已提交 -->
change_type = #changeType#, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity = #quantity#, <!-- 数量 -->
......
let projCode = '';
var companyCode='';
var rowNum=0;
$(function () {
var productCodeBox = __eiInfo.getBlock("product_block_id").getMappedRows();
......@@ -128,6 +127,29 @@ $(function () {
}
},
{
field: "changeType",
title: "变更类型",
template: function (item) {
let changeType = item.changeType;
let template = '';
if (item.id){
if(changeType == 1){
//新增
template += '<div style="display:flex;justify-content: center;align-items: center; position: absolute;top: 0;left: 0; width:100%;height:100%;background-color: green;">增加</div>'
}
if(changeType == 2){
//替换
template += '<div style="display:flex;justify-content: center;align-items: center; position: absolute;top: 0;left: 0; width:100%;height:100%;background-color: yellow;">替换</div>'
}
if(changeType == 3){
//删除
template += '<div style="display:flex;justify-content: center;align-items: center; position: absolute;top: 0;left: 0; width:100%;height:100%;background-color: red;">删除</div>'
}
}
return template;
}
},
{
field: "productCode",
template: function (item) {
let template = "";
......@@ -137,6 +159,9 @@ $(function () {
item['productName'] = productCodeBox[i]['textField'];
item['productId'] = productCodeBox[i]['param1Field'];
item['inventType'] = productCodeBox[i]['param2Field'];
item['length'] = productCodeBox[i]['param3Field'];
item['width'] = productCodeBox[i]['param4Field'];
item['thick'] = productCodeBox[i]['param5Field'];
console.log(item)
template = productCodeBox[i]['valueField'];
}else{
......@@ -203,22 +228,6 @@ $(function () {
console.log(grid.getCheckedBlockData());
}
});
//给变更类型的颜色处理
let rows = grid.eiBlock.rows;
for (let i = 0; i < rows.length; i++) {
var tdId = "datacell_"+i+"_8";
if (rows[i][19] === "1") {
//新增
document.getElementById(tdId).style.backgroundColor="green";
}else if (rows[i][19] === "2"){
//替换
document.getElementById(tdId).style.backgroundColor="yellow";
}else if (rows[i][19] === "3"){
//删除
document.getElementById(tdId).style.backgroundColor="red";
}
}
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
......
......@@ -4,7 +4,11 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<style>
td{
position: relative;
}
</style>
<EF:EFPage title="物料清单详情">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-materialId" type="hidden"/>
......@@ -50,6 +54,9 @@
</EF:EFComboColumn>
<EF:EFColumn ename="productCode" required="true" cname="产品编号" />
<EF:EFColumn ename="productName" cname="产品名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="length" cname="长(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量"/>
<EF:EFColumn ename="singleWeight" required="true" format="{0:N3}" cname="单重(kg)"/>
<EF:EFColumn enable="true" required="true" format="{0:N3}" ename="totalWeight" cname="总重(kg)"/>
......
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