Commit 4a3009c3 by 徐澳

存货档案

parent 5ba56f3b
/**
* Generate time : 2024-01-10 15:43:22
* Version : 1.0
*/
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THppz006
*
*/
public class THppz006 extends DaoEPBase {
private Long id = 0L;
private String companyCode = " "; /* 企业编码 预留*/
private String inventName = " "; /* 存货名称*/
private String inventCode = " "; /* 存货编码*/
private int inventType; /* 存货类型*/
private int status; /* 状态 0未启用 1启用*/
private String spec = " "; /* 规格*/
private String length = " "; /* 长*/
private String wide = " "; /* 宽*/
private String thick = " "; /* 厚*/
private String material = " "; /* 材质*/
private String coefficient = " "; /* 系数*/
private String unit = " "; /* 单位*/
private String createdBy = " "; /* 创建人*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
private String depCode = " "; /* 部门编码*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventName");
eiColumn.setDescName("存货名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventCode");
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("inventType");
eiColumn.setDescName("存货类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("status");
eiColumn.setDescName("状态 0未启用 1启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("spec");
eiColumn.setDescName("规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("length");
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("wide");
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("thick");
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("material");
eiColumn.setDescName("材质");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("coefficient");
eiColumn.setDescName("系数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("unit");
eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("depCode");
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public THppz006() {
initMetaData();
}
/**
* get the id
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the inventName - 存货名称
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 存货名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the inventCode - 存货编码
* @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 存货编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventType - 存货类型
* @return the inventType
*/
public int getInventType() {
return this.inventType;
}
/**
* set the inventType - 存货类型
*/
public void setInventType(int inventType) {
this.inventType = inventType;
}
/**
* get the status - 状态 0未启用 1启用
* @return the status
*/
public int getStatus() {
return this.status;
}
/**
* set the status - 状态 0未启用 1启用
*/
public void setStatus(int status) {
this.status = status;
}
/**
* get the spec - 规格
* @return the spec
*/
public String getSpec() {
return this.spec;
}
/**
* set the spec - 规格
*/
public void setSpec(String spec) {
this.spec = spec;
}
/**
* get the length - 长
* @return the length
*/
public String getLength() {
return this.length;
}
/**
* set the length - 长
*/
public void setLength(String length) {
this.length = length;
}
/**
* get the wide - 宽
* @return the wide
*/
public String getWide() {
return this.wide;
}
/**
* set the wide - 宽
*/
public void setWide(String wide) {
this.wide = wide;
}
/**
* get the thick - 厚
* @return the thick
*/
public String getThick() {
return this.thick;
}
/**
* set the thick - 厚
*/
public void setThick(String thick) {
this.thick = thick;
}
/**
* get the material - 材质
* @return the material
*/
public String getMaterial() {
return this.material;
}
/**
* set the material - 材质
*/
public void setMaterial(String material) {
this.material = material;
}
/**
* get the coefficient - 系数
* @return the coefficient
*/
public String getCoefficient() {
return this.coefficient;
}
/**
* set the coefficient - 系数
*/
public void setCoefficient(String coefficient) {
this.coefficient = coefficient;
}
/**
* get the unit - 单位
* @return the unit
*/
public String getUnit() {
return this.unit;
}
/**
* set the unit - 单位
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the depCode - 部门编码
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("inventName")), inventName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("inventCode")), inventCode));
setInventType(NumberUtils.toint(StringUtils.toString(map.get("inventType")), inventType));
setStatus(NumberUtils.toint(StringUtils.toString(map.get("status")), status));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("spec")), spec));
setLength(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("length")), length));
setWide(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("wide")), wide));
setThick(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("thick")), thick));
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("material")), material));
setCoefficient(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("coefficient")), coefficient));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("unit")), unit));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("inventName",StringUtils.toString(inventName, eiMetadata.getMeta("inventName")));
map.put("inventCode",StringUtils.toString(inventCode, eiMetadata.getMeta("inventCode")));
map.put("inventType",StringUtils.toString(inventType, eiMetadata.getMeta("inventType")));
map.put("status",StringUtils.toString(status, eiMetadata.getMeta("status")));
map.put("spec",StringUtils.toString(spec, eiMetadata.getMeta("spec")));
map.put("length",StringUtils.toString(length, eiMetadata.getMeta("length")));
map.put("wide",StringUtils.toString(wide, eiMetadata.getMeta("wide")));
map.put("thick",StringUtils.toString(thick, eiMetadata.getMeta("thick")));
map.put("material",StringUtils.toString(material, eiMetadata.getMeta("material")));
map.put("coefficient",StringUtils.toString(coefficient, eiMetadata.getMeta("coefficient")));
map.put("unit",StringUtils.toString(unit, eiMetadata.getMeta("unit")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
return map;
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.hp.pz.domain.THppz006;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Map;
/**
* @author xuao
* @date 2024年01月10日 15:51
*/
public class ServiceHPPZ006 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
THppz006 hppz006 = new THppz006();
EiInfo outInfo = new EiInfo();
outInfo.addBlock(EiConstant.resultBlock);
outInfo.getBlock(EiConstant.resultBlock).addBlockMeta(hppz006.eiMetadata);
return outInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPPZ006.query", new THppz006());
return outInfo;
}
/**
* 新增操作.
*/
@Override
public EiInfo insert(EiInfo inInfo) {
try {
CommonMethod.creatorInfo(inInfo,EiConstant.resultBlock);
super.insert(inInfo,"HPPZ006.insert");
// THppz002 hppz002 = new THppz002();
// EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
// for (int i = 0; i < eiBlock.getRowCount(); i++) {
// Map<?, ?> map = eiBlock.getRow(i);
// hppz002.fromMap(map);
//
// this.dao.insert("HPPZ002.insert", hppz002.toMap());
// }
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 修改操作.
*/
public EiInfo update(EiInfo inInfo) {
try {
THppz006 hppz006 = new THppz006();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz006.fromMap(map);
this.dao.update("HPPZ006.update", hppz006.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 删除操作.
*/
public EiInfo delete(EiInfo eiInfo) {
THppz006 hppz006 = new THppz006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz006.fromMap(map);
this.dao.delete("HPPZ006.delete", hppz006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}
......@@ -123,7 +123,7 @@
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
STATUS = #status#, <!-- 状态 0未启用 1启用 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 15:43:22
Version : 1.0
tableName :hpjx.t_hppz006
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
INVENT_CODE VARCHAR NOT NULL,
INVENT_TYPE TINYINT NOT NULL,
STATUS TINYINT NOT NULL,
SPEC VARCHAR NOT NULL,
LENGTH VARCHAR NOT NULL,
WIDE VARCHAR NOT NULL,
THICK VARCHAR NOT NULL,
MATERIAL VARCHAR NOT NULL,
COEFFICIENT VARCHAR NOT NULL,
UNIT VARCHAR NOT NULL,
CREATED_BY VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPPZ006">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.THppz006">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
STATUS as "status", <!-- 状态 0未启用 1启用 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
WIDE as "wide", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
MATERIAL as "material", <!-- 材质 -->
COEFFICIENT as "coefficient", <!-- 系数 -->
UNIT as "unit", <!-- 单位 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM hpjx.t_hppz006 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hppz006 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="wide">
WIDE = #wide#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="coefficient">
COEFFICIENT = #coefficient#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hppz006 (
COMPANY_CODE, <!-- 企业编码 预留 -->
INVENT_NAME, <!-- 存货名称 -->
INVENT_CODE, <!-- 存货编码 -->
INVENT_TYPE, <!-- 存货类型 -->
STATUS, <!-- 状态 0未启用 1启用 -->
SPEC, <!-- 规格 -->
LENGTH, <!-- 长 -->
WIDE, <!-- 宽 -->
THICK, <!-- 厚 -->
MATERIAL, <!-- 材质 -->
COEFFICIENT, <!-- 系数 -->
UNIT, <!-- 单位 -->
CREATED_BY, <!-- 创建人 -->
CREATED_TIME, <!-- 创建时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES ( #companyCode#, #inventName#, #inventCode#, #inventType#, #status#, #spec#, #length#, #wide#, #thick#, #material#, #coefficient#, #unit#, #createdBy#, #createdTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hppz006 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hppz006
SET
INVENT_NAME = #inventName#, <!-- 存货名称 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
STATUS = #status#, <!-- 状态 0未启用 1启用 -->
SPEC = #spec#, <!-- 规格 -->
LENGTH = #length#, <!-- 长 -->
WIDE = #wide#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
MATERIAL = #material#, <!-- 材质 -->
COEFFICIENT = #coefficient#, <!-- 系数 -->
UNIT = #unit#, <!-- 单位 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
......@@ -45,9 +45,11 @@
<EF:EFOption label="启用" value="1"></EF:EFOption>
<EF:EFOption label="禁用" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="createdBy" cname="创建人" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="updatedBy" cname="更新人" width="100" readonly="true" disabled="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -40,9 +40,11 @@
<EF:EFOption label="启用" value="1"></EF:EFOption>
<EF:EFOption label="禁用" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="createdBy" cname="创建人" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="updatedBy" cname="更新人" width="100" readonly="true" disabled="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
$(function() {
// 查询
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
});
IPLATUI.EFGrid = {
"result": {
loadComplete: function (grid) {
// 新增
$("#BTN_INSERT").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPPZ006"), "HPPZ006", "insert", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
// 绑定grid
resultGrid.setEiInfo(ei);
NotificationUtil({
msg: '新增成功'
});
}
//释放禁用按钮
btnNode.attr("disabled", false);
resultGrid.dataSource.page(1);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
// 修改
$("#BTN_UPDATE").on("click", function () {
var rowCount = resultGrid.getCheckedRows();
// 检验是否选中数据
if (rowCount == null || rowCount == "") {
NotificationUtil({
msg : '请选择一条或多条数据'
}, "warning");
return false;
}
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
IPLAT.submitNode($("#HPPZ006"), "HPPZ006", "update", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '修改成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) { // onFail 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
//删除
$("#DELETE").on("click", function () {
var btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
var dataItems = resultGrid.getCheckedRows();
if (dataItems == null || dataItems == "") {
NotificationUtil({
msg: '选择要删除的数据'
}, "warning");
//释放禁用按钮
btnNode.attr("disabled", false);
return false;
}
IPLAT.submitNode($("#HPPZ006"), "HPPZ006", "delete", {
onSuccess: function (ei) {
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
} else {
NotificationUtil({
msg: '删除成功'
});
// 绑定grid
resultGrid.setEiInfo(ei);
}
//释放禁用按钮
btnNode.attr("disabled", false);
},
onFail: function (ei) {// onFail
// 表示失败回调函数
// 发生异常
console.log(ei);
//释放禁用按钮
btnNode.attr("disabled", false);
}
});
});
}
},
};
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="存货档案">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-inventName" cname="存货名称" colWidth="4" readonly="false"/>
<EF:EFSelect ename="inqu_status-0-inventType" cname="存货类型" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-status" cname="状态" colWidth="4">
<EF:EFOption label="--请选择--" value=""/>
<EF:EFOption label="启用" value="1"></EF:EFOption>
<EF:EFOption label="未启用" value="0"></EF:EFOption>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="false" isFloat="true" autoFit="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="100" readonly="false" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="待定" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="spec" cname="规格" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="length" cname="长" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="wide" cname="宽" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="thick" cname="厚" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="material" cname="材质" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="100" readonly="false" required="true"/>
<EF:EFColumn ename="unit" cname="单位" width="100" readonly="false" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" align="center" columnTemplate="#=valueField#-#=textField#" optionLabel=" "
itemTemplate="#=valueField#-#=textField#" textField="textField"
valueField="valueField" width="100" required="true">
<EF:EFOption label="--请选择--" value=""></EF:EFOption>
<EF:EFOption label="启用" value="1"></EF:EFOption>
<EF:EFOption label="禁用" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="createdBy" cname="创建人" width="100" readonly="true" disabled="true"/>
<EF:EFColumn ename="updatedTime" cname="更新时间" readonly="true" width="100" align="center" enable="false"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" hidden ="true" />
<EF:EFColumn ename="updatedBy" cname="更新人" width="100" readonly="true" disabled="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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