Commit f771d876 by liuyang

2024-03-23 调整生产报工管理下拉框显示样式

parent e8bad34a
......@@ -272,6 +272,26 @@ public enum DdynamicEnum {
*/
FACTORY_CODE1_BLOCK_ID("factory_code1_block_id","factoryCode","factoryName", "HPSC008.queryFactoryCode"),
/**
* 模块:系统管理
* 用途:用户查询
* 编写:ly
*/
USER_NAME_BLOCK_ID("user_name_block_id","userId","userName","factoryCode","groupCode", "HPSC008.queryUserName"),
/**
* 模块:系统管理
* 用途:生产组查询
* 编写:ly
*/
GROUP_NAME_BLOCK_ID("group_name_block_id","groupCode","groupName","factoryCode", "HPSC008.queryGroupName"),
/**
* 模块:系统管理
* 用途:厂区查询
* 编写:ly
*/
FACTORY_NAME_BLOCK_ID("factory_name_block_id","factoryCode","factoryName", "HPSC008.queryFactoryCode"),
/**
* 模块:巡检填报APP下拉
......
......@@ -67,6 +67,7 @@ public class HPSC008 extends DaoEPBase {
public static final String INSERT = "HPSC008.insert";
public static final String UPDATE = "HPSC008.update";
public static final String DELETE = "HPSC008.delete";
public static final String DELETE_FLAG = "HPSC008.deleteFlag";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
......
......@@ -8,12 +8,14 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
......@@ -27,22 +29,39 @@ import java.util.Map;
*/
public class ServiceHPSC008 extends ServiceEPBase {
final public static String GROUP_TYPE = "prodGroup";
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC008.QUERY, new HPSC008());
final String companyCode = UserSessionUtils.getCompanyCode();
//拼接名称 包含逻辑删除数据
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_ID_BLOCK_ID,DdynamicEnum.GROUP_CODE_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{put(HPSC008.FIELD_COMPANY_CODE,companyCode);}}
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_GROUP_TYPE,GROUP_TYPE);
}}
);
//拼接名称 不包含逻辑删除数据
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_ID1_BLOCK_ID,DdynamicEnum.GROUP_CODE1_BLOCK_ID,DdynamicEnum.FACTORY_CODE1_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_GROUP_TYPE,GROUP_TYPE);
put(HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}
);
//outEiInfo.getBlock(EiConstant.resultBlock).getRows().clear();
//无拼接名称 包含逻辑删除数据
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_NAME_BLOCK_ID,DdynamicEnum.GROUP_NAME_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_GROUP_TYPE,GROUP_TYPE);
//put(HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}
);
return outEiInfo;
}
......@@ -57,70 +76,111 @@ public class ServiceHPSC008 extends ServiceEPBase {
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC008.QUERY,new HPSC008());
}
@OperationLogAnnotation(operModul = "报工管理",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
return super.delete(inInfo, HPSC008.DELETE);
int i = 0;
try {
HPSC008 hpxs001 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs001.fromMap(map);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_FLAG, hpxs001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "报工管理",operType = "修改",operDesc = "修改操作")
@Override
public EiInfo update(EiInfo inInfo) {
return super.update(inInfo, HPSC008.UPDATE);
int i = 0;
try {
HPSC008 hpxs002 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC008.UPDATE, hpxs002);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "报工管理",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
HPSC008 hpxs001 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs001.fromMap(map);
hpxs001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPSC008.INSERT, hpxs001.toMap());
DaoUtils.insert(HPSC008.INSERT, hpxs001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return query(inInfo);
//return super.insert(inInfo,HPXS001.INSERT);
return inInfo;
}
public EiInfo queryFactoryCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString(HPPZ013.FIELD_FACTORY_CODE);
String factoryCode = inInfo.getString(HPSC008.FIELD_FACTORY_CODE);
String groupType = inInfo.getString(HPSC008.FIELD_GROUP_TYPE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_FACTORY_CODE,factoryCode);
put(HPSC008.FIELD_GROUP_TYPE,groupType);
}});
return inInfo;
}
public EiInfo queryGroupCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString(HPPZ013.FIELD_FACTORY_CODE);
String factoryCode = inInfo.getString(HPSC008.FIELD_FACTORY_CODE);
String groupCode = inInfo.getString(HPSC008.FIELD_GROUP_CODE);
String groupType = inInfo.getString(HPSC008.FIELD_GROUP_TYPE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.USER_ID_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_FACTORY_CODE,factoryCode);
put(HPSC008.FIELD_GROUP_CODE,groupCode);
put(HPSC008.FIELD_GROUP_TYPE,groupType);
}});
return inInfo;
}
......
......@@ -227,6 +227,23 @@
</isNotEmpty>
</delete>
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPXS001
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXS001
SET
......@@ -258,39 +275,97 @@
</update>
<select id="queryFactoryCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
SELECT
FACTORY_CODE as "factoryCode",
FACTORY_NAME as "factoryName"
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
FROM ${hpjxSchema}.T_HPPZ013
WHERE 1=1
and length(FACTORY_CODE)>0
and length(FACTORY_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
GROUP BY FACTORY_CODE,FACTORY_NAME
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryGroupCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
GROUP_CODE as "groupCode",
GROUP_NAME as "groupName",
FACTORY_CODE AS factoryCode
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
SELECT
A.GROUP_CODE as "groupCode",
CONCAT('[',A.FACTORY_NAME,']',A.GROUP_NAME) as "groupName",
A.FACTORY_CODE AS factoryCode
FROM ${hpjxSchema}.T_HPPZ013 A
LEFT JOIN ${platSchema}.TXSOG01 B ON A.COMPANY_CODE = B.COMPANY_CODE AND A.GROUP_CODE = B.ORG_ENAME
WHERE 1=1
and length(A.FACTORY_CODE)>0
and length(A.FACTORY_NAME)>0
and length(A.GROUP_CODE)>0
and length(A.GROUP_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = 'prodGroup'
</isEmpty>
<isNotEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = #groupType#
</isNotEmpty>
GROUP BY A.GROUP_CODE,A.GROUP_NAME,A.FACTORY_CODE,A.FACTORY_NAME
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.FACTORY_CODE,B.SORT_INDEX ASC
</isEmpty>
</dynamic>
</select>
<select id="queryUserId" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
USER_ID as "userId",
CONCAT('[',FACTORY_NAME,' - ',GROUP_NAME,']',USER_NAME) as "userName",
FACTORY_CODE AS factoryCode,
GROUP_CODE as "groupCode"
FROM ${hpjxSchema}.T_HPPZ013
WHERE 1=1
and STATUS = '1'
and length(FACTORY_CODE)>0
and length(FACTORY_NAME)>0
and length(GROUP_CODE)>0
and length(GROUP_NAME)>0
and length(USER_ID)>0
and length(USER_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
......@@ -300,24 +375,72 @@
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
GROUP BY USER_ID,USER_NAME,FACTORY_CODE,FACTORY_NAME,GROUP_CODE,GROUP_NAME
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryUserId" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
<select id="queryGroupName" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
A.GROUP_CODE as "groupCode",
A.GROUP_NAME as "groupName",
A.FACTORY_CODE AS factoryCode
FROM ${hpjxSchema}.T_HPPZ013 A
LEFT JOIN ${platSchema}.TXSOG01 B ON A.COMPANY_CODE = B.COMPANY_CODE AND A.GROUP_CODE = B.ORG_ENAME
WHERE 1=1
and length(A.FACTORY_CODE)>0
and length(A.FACTORY_NAME)>0
and length(A.GROUP_CODE)>0
and length(A.GROUP_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = 'prodGroup'
</isEmpty>
<isNotEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = #groupType#
</isNotEmpty>
GROUP BY A.GROUP_CODE,A.GROUP_NAME,A.FACTORY_CODE
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.FACTORY_CODE,B.SORT_INDEX ASC
</isEmpty>
</dynamic>
</select>
<select id="queryUserName" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
USER_ID as "userId",
USER_NAME as "userName",
FACTORY_CODE AS factoryCode,
GROUP_CODE as "groupCode"
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1 and STATUS = '1'
FROM ${hpjxSchema}.T_HPPZ013
WHERE 1=1
and STATUS = '1'
and length(FACTORY_CODE)>0
and length(FACTORY_NAME)>0
and length(GROUP_CODE)>0
and length(GROUP_NAME)>0
and length(USER_ID)>0
and length(USER_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
......@@ -336,12 +459,13 @@
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
GROUP BY USER_ID,USER_NAME,FACTORY_CODE,GROUP_CODE
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......
......@@ -3,6 +3,9 @@ package com.baosight.hpjx.util;
import com.baosight.hpjx.common.ErrorCodeEnum;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.util.ExceptionUtil;
/**
* ErrorCodeUtils
......@@ -99,6 +102,25 @@ public class ErrorCodeUtils {
return detail;
}
public static void handleDeleteException(EiInfo inInfo, int i, Exception ex) {
inInfo.setMsgByKey("ep.0002", new String[]{String.valueOf(i + 1), I18nMessages.getText("label.delete", "删除"), ExceptionUtil.getRootCauseMessage(ex)});
inInfo.setDetailMsg(ex.toString());
throw new PlatException("E_Plat_DeleteError", ex, inInfo);
}
public static void handleUpdateException(EiInfo inInfo, int i, Exception ex) {
inInfo.setMsgByKey("ep.0002", new String[]{String.valueOf(i + 1), I18nMessages.getText("label.update", "修改"), ExceptionUtil.getRootCauseMessage(ex)});
inInfo.setDetailMsg(ex.toString());
throw new PlatException("E_Plat_UpdateError", ex, inInfo);
}
public static void handleInsertException(EiInfo inInfo, int i, Exception ex) {
inInfo.setMsgByKey("ep.0002", new String[]{String.valueOf(i + 1), I18nMessages.getText("label.insert", "新增"), ExceptionUtil.getRootCauseMessage(ex)});
inInfo.setDetailMsg(ex.toString());
throw new PlatException("E_Plat_InsertError", ex, inInfo);
}
private static final String SQL_ERROR_WORD1 = "SQLCODE=";
private static final String SQL_ERROR_WORD2 = "Error Code:";
}
\ No newline at end of file
$(function () {
var factoryCodes = __eiInfo.getBlock("factory_code_block_id").getMappedRows();
var groupCodes = __eiInfo.getBlock("group_code_block_id").getMappedRows();
var userIds = __eiInfo.getBlock("user_id_block_id").getMappedRows();
var groupCodes = __eiInfo.getBlock("group_code1_block_id").getMappedRows();
var userIds = __eiInfo.getBlock("user_id1_block_id").getMappedRows();
var factoryCode = __eiInfo.getBlock("factory_code1_block_id").getMappedRows();
var groupName = __eiInfo.getBlock("group_name_block_id").getMappedRows();
var userName = __eiInfo.getBlock("user_name_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -45,6 +48,9 @@ $(function () {
},{
field: "factoryCode",
title: "工厂",
filter: function (options) {
return factoryCode;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
......@@ -61,21 +67,21 @@ $(function () {
if(province) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(options.values, function (item) {
return _.filter(groupCodes, function (item) {
return item["param1Field"]==province;
})
} else {
return [];
return groupCodes;
}
},
template: function (dataItem) {
for (let i = 0; i < groupCodes.length; i++) {
if (groupCodes[i]['valueField'] === dataItem['groupCode']) {
return groupCodes[i]['textField'];
for (let i = 0; i < groupName.length; i++) {
if (groupName[i]['valueField'] === dataItem['groupCode']) {
return groupName[i]['textField'];
}
}
return dataItem["groupCode"];
}
},
},{
field: "userId",
title: "员工",
......@@ -84,22 +90,21 @@ $(function () {
var groupCode = options.model['groupCode'];
if(province) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(options.values, function (item) {
return _.filter(userIds, function (item) {
return item["param1Field"]==province && item["param2Field"]==groupCode;
})
} else {
return [];
return userIds;
}
},
template: function (dataItem) {
for (let i = 0; i < userIds.length; i++) {
if (userIds[i]['valueField'] === dataItem['userId']) {
return userIds[i]['textField'];
for (let i = 0; i < userName.length; i++) {
if (userName[i]['valueField'] === dataItem['userId']) {
return userName[i]['textField'];
}
}
return dataItem["userId"];
}
},
}],
loadComplete: function(grid) {
// 此 grid 对象
......@@ -108,12 +113,39 @@ $(function () {
// 判断父级节点是否发生变化
if (e.field == "factoryCode") {
loadChange(grid,e,"groupCode");
} else if (e.field == "groupCode") {
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}
else if (e.field == "groupCode") {
loadChange(grid,e,"userId");
}else if (e.field == "userId"){
if (e.items[0].groupCode.length===0){
loadChange(grid,e,"groupCode");
}
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}
}
});
},
afterEdit:function (e) {
if (e.field === "groupCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < groupName.length; i++) {
if (e.model[e.field] === groupName[i]["valueField"]){
e.model["factoryCode"]=groupName[i]["param1Field"]
break;
}
}
}else if (e.field === "userId" && e.model["groupCode"].length === 0){
for (let i = 0; i < userName.length; i++) {
if (e.model[e.field] === userName[i]["valueField"]){
//e.model["factoryCode"]=userName[i]["param1Field"]
e.model["groupCode"]=userName[i]["param2Field"]
break;
}
}
}
},
onAdd: function (e) {
//e.sender.dataSource.options.fields[4].values = factoryCode;
//e.sender.dataSource.options.fields[5].values = groupCode
......@@ -133,9 +165,7 @@ $(function () {
//saveResult(btnNode);
},
onSuccess: function (e) {
console.log("onSuccess:"+e)
if (e.eiInfo.extAttr.methodName == 'update'
|| e.eiInfo.extAttr.methodName == 'insert') {
if (e.eiInfo.extAttr.methodName == 'update' || e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
......@@ -163,6 +193,7 @@ $(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSC008", "queryFactoryCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
......@@ -186,6 +217,7 @@ $(function () {
inInfo.set("factoryCode",factoryCode);
var groupCode=$("#inqu_status-0-groupCode").val();
inInfo.set("groupCode",groupCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSC008", "queryGroupCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-userId");
......
......@@ -48,38 +48,38 @@
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code1_block_id"
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_code1_block_id"
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_name_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="userId" cname="员工" blockName="user_id1_block_id"
<EF:EFComboColumn ename="userId" cname="员工" blockName="user_name_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="100" required="true"
maxLength="16" readonly="true" width="160" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="生产类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="100" required="true"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center" required="true"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="150" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn ename="remark" cname="备注" enable="true" width="200"/>
<EF:EFColumn ename="remark" cname="备注" enable="true" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
......
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