Commit bc0804a5 by liuyang

2024-06-20 修复工序复制bug

parent 64d215fe
...@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant; ...@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; 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.HGSJ001;
import com.baosight.hggp.hg.sj.domain.HGSJ002; import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A; import com.baosight.hggp.hg.sj.domain.HGSJ002A;
...@@ -40,11 +41,15 @@ public class ServiceHGSJ001 extends ServiceEPBase { ...@@ -40,11 +41,15 @@ public class ServiceHGSJ001 extends ServiceEPBase {
if (orgList.size()>0) { if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId()); 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(); qarma.clear();
List orgIds = getOrgId(); List orgIds = getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds); qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma); 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; return outInfo;
} }
......
...@@ -7,6 +7,7 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -7,6 +7,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; 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.sj.domain.HGSJ002;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
...@@ -14,6 +15,7 @@ import com.baosight.hggp.hg.xs.tools.HGXSTools; ...@@ -14,6 +15,7 @@ import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -40,10 +42,14 @@ public class ServiceHGSJ002 extends ServiceEPBase { ...@@ -40,10 +42,14 @@ public class ServiceHGSJ002 extends ServiceEPBase {
EiInfo outInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002()); EiInfo outInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
Map qarma = new HashMap(); Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser(); List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) { /*if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId()); 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; return outInfo;
} }
......
...@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant; ...@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils; 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.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A; import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.domain.HGSJ003; import com.baosight.hggp.hg.sj.domain.HGSJ003;
...@@ -41,12 +42,12 @@ public class ServiceHGSJ003 extends ServiceEPBase { ...@@ -41,12 +42,12 @@ public class ServiceHGSJ003 extends ServiceEPBase {
EiInfo outInfo = super.query(inInfo, HGSJ003.QUERY, new HGSJ003()); EiInfo outInfo = super.query(inInfo, HGSJ003.QUERY, new HGSJ003());
Map qarma = new HashMap(); Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser(); List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) { /*if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId()); 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(); qarma.clear();
if (CollectionUtils.isNotEmpty(orgList)){ /*if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0); Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) { if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级 //如果不是公司公司,则找到上一级
...@@ -59,8 +60,13 @@ public class ServiceHGSJ003 extends ServiceEPBase { ...@@ -59,8 +60,13 @@ public class ServiceHGSJ003 extends ServiceEPBase {
}else { }else {
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org.getOrgId()); qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org.getOrgId());
} }
} }*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID), qarma); 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; return outInfo;
} }
......
$(function (){ $(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(); var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
...@@ -40,6 +40,15 @@ $(function (){ ...@@ -40,6 +40,15 @@ $(function (){
} }
}, { }, {
field: "factoryCode", 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) { template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) { for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) { if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
...@@ -101,6 +110,23 @@ $(function (){ ...@@ -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) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
e.preventDefault(); e.preventDefault();
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="row"> <div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <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>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" placeholder="模糊查询" colWidth="3"/> <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"/> <EF:EFInput blockId="inqu_status" row="0" ename="princName" cname="负责人" placeholder="模糊查询" colWidth="3"/>
...@@ -30,34 +30,35 @@ ...@@ -30,34 +30,35 @@
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/> <EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="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:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称" <EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" width="120" required="true" maxLength="16" width="200" required="true"
align="center" filter="contains" sort="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>
<EF:EFColumn ename="factoryName" cname="公司名称" hidden="true"/> <EF:EFColumn ename="factoryName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="processCode" cname="工序编码" enable="false" width="100" align="center"/> <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="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="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" displayType="0" sort="true" align="right" required="true"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15" data-regex="/^-?[0-9]{1,15}?$/" maxLength="15"
data-errorprompt="请输入数字,该值最大可设置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" displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/> 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" displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/> data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
......
$(function (){ $(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"); $(".row").children().attr("class", "col-md-3");
...@@ -41,6 +41,15 @@ $(function (){ ...@@ -41,6 +41,15 @@ $(function (){
} }
},{ },{
field: "factoryCode", 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) { template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) { for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) { if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
...@@ -61,6 +70,15 @@ $(function (){ ...@@ -61,6 +70,15 @@ $(function (){
}, },
afterEdit:function (e) { 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) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
e.preventDefault(); e.preventDefault();
......
...@@ -17,27 +17,28 @@ ...@@ -17,27 +17,28 @@
<div class="row"> <div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <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>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/> <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:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/> <EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="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:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称" <EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" width="120" required="true" maxLength="16" width="200" required="true"
align="center" filter="contains" sort="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>
<EF:EFColumn ename="flowCode" cname="流程编码" enable="false" width="100" align="center"/> <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"/> <EF:EFColumn ename="flowName" cname="流程名称" width="120" enable="true" readonly="false" align="center" required="true"/>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parendId" cname="上级ID" 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="工厂" <%--<EF:EFComboColumn ename="factoryCode" cname="工厂"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
......
$(function (){ $(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(); var processCodes = __eiInfo.getBlock("processCode_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
...@@ -40,6 +40,15 @@ $(function (){ ...@@ -40,6 +40,15 @@ $(function (){
} }
}, { }, {
field: "factoryCode", 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) { template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) { for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) { if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
...@@ -52,7 +61,7 @@ $(function (){ ...@@ -52,7 +61,7 @@ $(function (){
}, { }, {
field: "processCode", field: "processCode",
filter: function (options) { filter: function (options) {
var factoryCode = options.model['factoryCode']; let factoryCode = options.model['factoryCode'];
if(factoryCode) { if(factoryCode) {
// 返回我们过滤后的数据集 // 返回我们过滤后的数据集
/*return options.values[0][province];*/ /*return options.values[0][province];*/
...@@ -60,8 +69,9 @@ $(function (){ ...@@ -60,8 +69,9 @@ $(function (){
return item["param1Field"]==factoryCode && item["param4Field"]== "true" && item["param5Field"] == "false"; return item["param1Field"]==factoryCode && item["param4Field"]== "true" && item["param5Field"] == "false";
}) })
} else { } else {
let companyCode = $("#inqu_status-0-companyCode").val();
return _.filter(processCodes, function (item) { 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 (){ ...@@ -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) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
e.preventDefault(); e.preventDefault();
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="row"> <div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <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>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="processCode" cname="工序名称" colWidth="3" filter="contains"> <%--<EF:EFSelect blockId="inqu_status" row="0" ename="processCode" cname="工序名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
...@@ -28,25 +28,26 @@ ...@@ -28,25 +28,26 @@
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/> <EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="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:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称" <EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" width="120" required="true" maxLength="16" width="200" required="true"
align="center" filter="contains" sort="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>
<EF:EFComboColumn ename="processCode" cname="工序名称" <EF:EFComboColumn ename="processCode" cname="工序名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" width="120" required="true" maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="processCode_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="processCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </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