Commit b5fbc749 by wuwenlong

Merge remote-tracking branch 'origin/dev' into dev

parents 0702b624 43e668a3
......@@ -205,7 +205,7 @@ public enum DdynamicEnum {
* 用途:组管理下拉框
* 编写:songx
*/
GROUP_RECORD_BLOCK_ID("group_record_block_id","orgId","orgCname","HGXSOrg.queryGroupComboBox"),
GROUP_RECORD_BLOCK_ID("group_record_block_id","orgId","orgCname","companyCode","companyName","HGXSOrg.queryGroupComboBox"),
/**
* 模块:组管理
......
package com.baosight.hggp.core.security;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.Org;
......@@ -75,7 +76,28 @@ public class UserSessionUtils extends UserSession {
}
return accountCode;
}
/**
获取用户所属公司 *
* @return
*/
public static UserVO getUserCompany() {
UserVO userVO = new UserVO();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
} else {
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
}
}
return userVO;
}
/**
* 获取登录用户的组织机构
*
......
<?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">
<sqlMap namespace="HPBI003">
<select id="querySbStatus" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
select
a.DEVICE_CODE,b.ORG_CNAME,a.DEVICE_NAME,a.DEVICE_MODEL,
case when c.LOG_VALUE = 2 then 1 else 0 end as DEVICE_STATUS,
case when c.LOG_VALUE = 2 then '运行状态'
when c.LOG_VALUE = 1 then '默认状态'
when c.LOG_VALUE = 3 then '暂停状态'
when c.LOG_VALUE = 4 then '复位状态'
when c.LOG_VALUE = 5 then '一级报警状态'
when c.LOG_VALUE = 6 then '二级报警状态'
else '异常状态' end as STATUS_DESC
from hpjx.t_hpsb003 a
join iplat.TXSOG01 b on a.GROUP_CODE = b.ORG_ID and b.IS_DELETED = 0
join hpjx.t_hpsb002 c on a.DEVICE_CODE=c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and c.EQUIPMENT_TYPE = 'STARUS_TYPE'
and a.COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
order by c.CREATED_TIME desc
limit 1
</select>
</sqlMap>
\ No newline at end of file
......@@ -43,19 +43,23 @@ public class ServiceHGSB001 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_FACTORY_CODE,companyCode);
}
return outInfo;
}
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org;
......@@ -43,17 +44,21 @@ public class ServiceHGSB002 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
qarma.put(HGSB002.FIELD_COMPANY_CODE,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "companyStr",companyCode);
}
return outInfo;
}
......
......@@ -48,7 +48,7 @@ public class ServiceHGSB003 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
......@@ -70,7 +70,11 @@ public class ServiceHGSB003 extends ServiceEPBase {
}
}
qarma.put(HGSB003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID), qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID));
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "companyStr",companyCode);
}
return outInfo;
}
......
......@@ -47,7 +47,7 @@ public class ServiceHGSB004 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
qarma.clear();
/*Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
......@@ -58,6 +58,10 @@ public class ServiceHGSB004 extends ServiceEPBase {
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "companyStr",companyCode);
}
return outInfo;
}
......
......@@ -41,13 +41,13 @@ public class ServiceHGSB004B extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
......
......@@ -44,14 +44,14 @@ public class ServiceHGSB005 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
qarma.clear();
Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
qarma.clear();
List<String> orgIds = HGSBTools.getOrgId();
......
......@@ -37,7 +37,7 @@ public class ServiceHGSB006 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
//outInfo.getBlock(EiConstant.queryBlock).removeCol(HGSB004.FIELD_CHECK_STATUS);
return outInfo;
......
......@@ -40,7 +40,7 @@ public class ServiceHGSB007 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID));
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),null);
return outInfo;
}
......
......@@ -116,9 +116,9 @@
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
<!--<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME LIKE CONCAT('%', #factoryName#, '%')
</isNotEmpty>
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
......@@ -40,11 +41,15 @@ public class ServiceHGSJ001 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID)); //COMPANY_RECORD_BOX_BLOCK_ID
qarma.clear();
List orgIds = getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
}
return outInfo;
}
......
......@@ -7,6 +7,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
......@@ -14,6 +15,7 @@ import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -40,10 +42,14 @@ public class ServiceHGSJ002 extends ServiceEPBase {
EiInfo outInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
/*if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
return outInfo;
}
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
......@@ -41,12 +42,12 @@ public class ServiceHGSJ003 extends ServiceEPBase {
EiInfo outInfo = super.query(inInfo, HGSJ003.QUERY, new HGSJ003());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
/*if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
if (CollectionUtils.isNotEmpty(orgList)){
/*if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
......@@ -59,8 +60,13 @@ public class ServiceHGSJ003 extends ServiceEPBase {
}else {
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org.getOrgId());
}
}
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID), qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
}
return outInfo;
}
......
......@@ -165,8 +165,9 @@
<!-- 查询子集组信息,仅包括生产组和下料组(递归) -->
<select id="queryGroupComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", CONCAT('[',T5.FACTORY_NAME,']',T3.ORG_CNAME) AS "orgCname",
T3.FACTORY_CODE AS "factoryCode", T5.FACTORY_NAME AS "factoryName"
T2.LEVEL AS "level", T3.ORG_ID AS "orgId", CONCAT(T3.ORG_CNAME,'[',T3.COMPANY_NAME,']') AS "orgCname",
T3.FACTORY_CODE AS "factoryCode", T5.FACTORY_NAME AS "factoryName",T3.COMPANY_CODE AS "companyCode",
T3.COMPANY_NAME AS "companyName"
FROM (
SELECT
@CODES AS CODES,
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -66,6 +66,15 @@ $(function () {
}, {
field: "companyCode",
title: "公司名称",
filter: function (option) {
let companyCode = $("#inqu_status-0-factoryCode").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
......@@ -78,11 +87,24 @@ $(function () {
},{
field: "groupCode",
title: "设备区域",
filter: function (option) {
let companyCode = option.model['companyCode'];
if (companyCode){
return _.filter(groupCodeBox, function (item) {
return item["param1Field"]==companyCode;
})
}else {
companyCode = $("#inqu_status-0-factoryCode").val();
return _.filter(groupCodeBox, function (item) {
return item["param1Field"]==companyCode;
})
}
},
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1]
return groupCodeBox[i]['textField'].split("]")[1];
dataItem['groupName'] = groupCodeBox[i]['textField'].split("[")[0]
return groupCodeBox[i]['textField'].split("[")[0];
}
}
return dataItem["groupCode"]
......@@ -105,7 +127,7 @@ $(function () {
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "groupCode") {
if (e.items[0].companyCode.length===0){
......
......@@ -21,7 +21,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains">
......@@ -35,6 +35,7 @@
<EF:EFDatePicker blockId="inqu_status" row="0" ename="purchaseDate" cname="购置日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceCode" cname="设备编码" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
......@@ -46,21 +47,21 @@
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="120" required="false"
maxLength="16" readonly="false" width="210" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="120" required="true"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="80" readonly="false" required="true"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType" />
</EF:EFComboColumn>
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
......@@ -82,6 +82,15 @@ $(function () {
}, {
field: "companyCode",
title: "公司名称",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyStr").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
......@@ -94,23 +103,24 @@ $(function () {
}, {
field: "groupCode",
title: "设备区域",
/*filter: function (options) {
var companyCode = options.model['companyCode'];
if(companyCode) {
// 返回我们过滤后的数据集
filter: function (options) {
let companyCode = options.model['companyCode'];
if (companyCode){
return _.filter(groupCodeBox, function (item) {
return item["param3Field"] === companyCode;
return item["param1Field"]==companyCode;
})
}else {
companyCode = $("#inqu_status-0-companyStr").val();
return _.filter(groupCodeBox, function (item) {
return item["param1Field"]==companyCode;
})
}
return groupCodeBox;
},*/
},
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1]
//dataItem['factoryCode'] = groupCodeBox[i]['param1Field']
//dataItem['factoryName'] = groupCodeBox[i]['param2Field']
return groupCodeBox[i]['textField'].split("]")[1];
dataItem['groupName'] = groupCodeBox[i]['textField'].split("[")[0]
return groupCodeBox[i]['textField'].split("[")[0];
}
}
return dataItem["groupCode"]
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains">
......@@ -39,6 +39,7 @@
startName="planStartDate" endName="planEndDate" row="0" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
<EF:EFInput blockId="inqu_status" row="0" ename="companyStr" cname="公司名称" type="hidden" colWidth="3"/>
<%--<EF:EFDatePicker blockId="inqu_status" row="0" ename="planStartDate" cname="计划开始日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="planEndDate" cname="计划结束日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>--%>
</div>
......@@ -54,12 +55,12 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="120" required="true"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
......
......@@ -37,8 +37,8 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1]
return groupCodeBox[i]['textField'].split("]")[1];
dataItem['groupName'] = groupCodeBox[i]['textField'].split("[")[0]
return groupCodeBox[i]['textField'].split("[")[0];
}
}
return dataItem["groupCode"]
......
......@@ -36,10 +36,10 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFComboColumn ename="groupCode" cname="设备区域" readonly="true"
<EF:EFComboColumn ename="groupCode" cname="设备区域" readonly="true" enable="false"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="220" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
......
$(function () {
var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -57,6 +57,15 @@ $(function () {
}, {
field: "companyCode",
title: "公司名称",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyStr").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
......
......@@ -21,13 +21,14 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="applyDate" cname="申请日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="checkItem" cname="检查项" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="applyUserName" cname="申请人" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyStr" cname="公司名称" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
......@@ -41,7 +42,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="applyDate" cname="申请日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
//var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
......@@ -72,6 +72,15 @@ $(function () {
}, {
field: "companyCode",
title: "公司名称",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyStr").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
......
......@@ -22,12 +22,13 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="inspecDate" cname="点检日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planCode" cname="计划单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inspecUserName" cname="点检人" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyStr" cname="公司名称" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
......@@ -42,7 +43,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inspecDate" cname="点检日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
......@@ -16,8 +16,8 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
dataItem['groupName'] = groupCodeBox[i]['textField'].split("]")[1]
return groupCodeBox[i]['textField'].split("]")[1];
dataItem['groupName'] = groupCodeBox[i]['textField'].split("[")[0]
return groupCodeBox[i]['textField'].split("[")[0];
}
}
return dataItem["groupCode"]
......
......@@ -25,7 +25,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区域" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="planDate" cname="计划日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
......@@ -45,9 +45,9 @@
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
$(function () {
var companyCodeBox = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
//var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="upkeepDate" cname="保养日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
......@@ -41,7 +41,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="upkeepDate" cname="保养日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="checkStatus" cname="点检状态" colWidth="3" filter="contains">
......@@ -37,7 +37,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
......
......@@ -18,7 +18,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="upkeepStatus" cname="保养状态" colWidth="3" filter="contains">
......@@ -37,7 +37,7 @@
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="planCode" cname="计划单号" width="120" align="center" readonly="true" required="true"/>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
......
$(function (){
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); //company_record_box_block_id
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -40,6 +40,15 @@ $(function (){
}
}, {
field: "factoryCode",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyCode").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
......@@ -101,6 +110,23 @@ $(function (){
}
}*/
},
/**
* EFGridtr
* @param e
* e.sender Grid
* e.preventDefault dataBoundtr
* e.index
* e.items ([Model,Model, ...])
*/
onAdd: function (e) {
let factoryCode = $("#inqu_status-0-companyCode").val();
$.each(e.items, function(index, item){
if (factoryCode != item['factoryCode']){
item['factoryCode'] = '';
}
item["processCode"] = ''
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="princName" cname="负责人" placeholder="模糊查询" colWidth="3"/>
......@@ -30,34 +30,35 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="processCode" cname="工序编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="processName" cname="工序名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" enable="true" readonly="false" align="center"/>
<EF:EFColumn ename="standardJob" cname="标准作业" width="120" enable="true" format="{0:N0}" editType="number"
<EF:EFColumn ename="standardJob" cname="标准作业" width="100" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right" required="true"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="standardDays" cname="标准人天" width="120" enable="true" format="{0:N0}" editType="number"
<EF:EFColumn ename="standardDays" cname="标准人天" width="100" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="standardNum" cname="标准工序人数" width="120" enable="true" format="{0:N0}" editType="number"
<EF:EFColumn ename="standardNum" cname="标准工序人数" width="100" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
......
$(function (){
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -41,6 +41,15 @@ $(function (){
}
},{
field: "factoryCode",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyCode").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
......@@ -61,6 +70,15 @@ $(function (){
},
afterEdit:function (e) {
},
onAdd: function (e) {
let factoryCode = $("#inqu_status-0-companyCode").val();
$.each(e.items, function(index, item){
if (factoryCode != item['factoryCode']){
item['factoryCode'] = '';
}
item["flowCode"] = ''
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
......
......@@ -17,27 +17,28 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="flowCode" cname="流程编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="flowName" cname="流程名称" width="120" enable="true" readonly="false" align="center" required="true"/>
......
......@@ -34,7 +34,7 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parendId" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<%--<EF:EFComboColumn ename="factoryCode" cname="工厂"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......
$(function (){
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var processCodes = __eiInfo.getBlock("processCode_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -40,6 +40,15 @@ $(function (){
}
}, {
field: "factoryCode",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyCode").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
......@@ -52,7 +61,7 @@ $(function (){
}, {
field: "processCode",
filter: function (options) {
var factoryCode = options.model['factoryCode'];
let factoryCode = options.model['factoryCode'];
if(factoryCode) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
......@@ -60,8 +69,9 @@ $(function (){
return item["param1Field"]==factoryCode && item["param4Field"]== "true" && item["param5Field"] == "false";
})
} else {
let companyCode = $("#inqu_status-0-companyCode").val();
return _.filter(processCodes, function (item) {
return item["param4Field"]== "true" && item["param5Field"] == "false";
return item["param1Field"]==companyCode && item["param4Field"]== "true" && item["param5Field"] == "false";
})
}
},
......@@ -131,6 +141,15 @@ $(function (){
}
}
},
onAdd: function (e) {
let factoryCode = $("#inqu_status-0-companyCode").val();
$.each(e.items, function(index, item){
if (factoryCode != item['factoryCode']){
item['factoryCode'] = '';
}
item['spec'] = '';
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="processCode" cname="工序名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
......@@ -28,25 +28,26 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="processCode" cname="工序名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="processCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
......
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