Commit 35b67767 by wuwenlong

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

parents 17737bc4 afb96ac9
...@@ -260,4 +260,17 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -260,4 +260,17 @@ public class ServiceHGCW002 extends ServiceBase {
} }
public EiInfo projectComboBox(EiInfo inInfo){
Map<String, Object> map = new HashMap<>();
if (StringUtils.isNotEmpty(inInfo.getString("reviewStatus"))) {
map.put("reviewStatus", inInfo.getString("reviewStatus"));
}
if (StringUtils.isNotEmpty(inInfo.getString("contractType"))) {
map.put("contractType", inInfo.getString("contractType"));
}
List<HGCW002> HGCW002List = dao.query("HGCW002.queryProjectComboBox", map);
inInfo.addBlock("projcet_combo_box").setRows(HGCW002List);
return inInfo;
}
} }
...@@ -3,7 +3,10 @@ package com.baosight.hggp.hg.cw.service; ...@@ -3,7 +3,10 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW004; import com.baosight.hggp.hg.cw.domain.HGCW004;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sb.domain.HGSB003; import com.baosight.hggp.hg.sb.domain.HGSB003;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
...@@ -14,6 +17,7 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -14,6 +17,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages; import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -75,6 +79,9 @@ public class ServiceHGCW004 extends ServiceBase { ...@@ -75,6 +79,9 @@ public class ServiceHGCW004 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGCW004 HGCW004 = new HGCW004(); HGCW004 HGCW004 = new HGCW004();
HGCW004.fromMap(resultRows.get(i)); HGCW004.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW004.setCompanyCode(userVO.getUsercode());
HGCW004.setCompanyName(userVO.getUsername());
if (HGCW004.getId() == null || HGCW004.getId() == 0) { if (HGCW004.getId() == null || HGCW004.getId() == 0) {
this.add(HGCW004); this.add(HGCW004);
} else { } else {
......
...@@ -460,7 +460,7 @@ ...@@ -460,7 +460,7 @@
<select id="queryComboBox" parameterClass="java.util.HashMap" <select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap"> resultClass="com.baosight.hggp.hg.cw.domain.HGCW002">
SELECT DISTINCT SELECT DISTINCT
CONTRACT_NUMBER as contractNumber, <!-- 合同号 --> CONTRACT_NUMBER as contractNumber, <!-- 合同号 -->
CONTRACT_NAME as contractName <!-- 合同名称 --> CONTRACT_NAME as contractName <!-- 合同名称 -->
...@@ -484,6 +484,34 @@ ...@@ -484,6 +484,34 @@
ORDER BY CONTRACT_NUMBER ORDER BY CONTRACT_NUMBER
</select> </select>
<select id="queryProjectComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
CONTRACT_NAME as "contractName", <!-- 合同名称 -->
PARTY_A as "partyA", <!-- 甲方名称 -->
PARTY_B as "partyB" <!-- 乙方名称 -->
FROM ${hggpSchema}.HGCW002
WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractType">
CONTRACT_TYPE = #contractType#
</isNotEmpty>
ORDER BY CONTRACT_NUMBER
</select>
<update id="submit"> <update id="submit">
UPDATE ${hggpSchema}.HGCW002 UPDATE ${hggpSchema}.HGCW002
......
...@@ -94,6 +94,8 @@ public class HGSC004A extends DaoEPBase { ...@@ -94,6 +94,8 @@ public class HGSC004A extends DaoEPBase {
public static final String BATCH_CHANGE_TYPE = "HGSC004A.changeType"; public static final String BATCH_CHANGE_TYPE = "HGSC004A.changeType";
public static final String QUERY_ALL = "HGSC004A.queryAll"; public static final String QUERY_ALL = "HGSC004A.queryAll";
public static final String UPDATE_PRODUCT_STATUS = "HGSC004A.updateProductStatus"; public static final String UPDATE_PRODUCT_STATUS = "HGSC004A.updateProductStatus";
public static final String MAX_ID = "HGSC004A.maxId";
public static final String QUERY_TECHFLOW_ID_BY_PRODUCTID = "HGSC004A.queryTechFlowIdByProductId";
......
...@@ -113,7 +113,7 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -113,7 +113,7 @@ public class ServiceHGSC004A extends ServiceBase {
//主表信息,用于取值 //主表信息,用于取值
Long materialId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id)); Long materialId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id));
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY,HGSC004A.FIELD_id,materialId); HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004A.FIELD_id,materialId);
if(Objects.nonNull(hgsc004)){ if(Objects.nonNull(hgsc004)){
hgsc004a.setCompanyCode(hgsc004.getCompanyCode()); hgsc004a.setCompanyCode(hgsc004.getCompanyCode());
hgsc004a.setCompanyName(hgsc004.getCompanyName()); hgsc004a.setCompanyName(hgsc004.getCompanyName());
...@@ -130,6 +130,8 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -130,6 +130,8 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.setLeaf(1); hgsc004a.setLeaf(1);
} }
this.checkSaveData(hgsc004a,hgsc003); this.checkSaveData(hgsc004a,hgsc003);
//蓝图信息,用于蓝图状态校验
HGSC004A flowHGSC004A = (HGSC004A) super.dao.get(HGSC004A.QUERY_TECHFLOW_ID_BY_PRODUCTID,HGSC004A.FIELD_product_id,hgsc004a.getProductId());
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){ if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){ if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.TH); hgsc004a.setChangeType(HGConstant.ChangeType.TH);
...@@ -140,6 +142,8 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -140,6 +142,8 @@ public class ServiceHGSC004A extends ServiceBase {
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType"); BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId()); hgsc005a.setMatDetailId(hgsc004a.getId());
hgsc005a.setMatId(hgsc004.getId()); hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setTechFlowId(flowHGSC004A.getTechFlowId());
hgsc005a.setFinishDate(hgsc004.getFinishDate());
if(hgsc004a.getLv().intValue() == 3){ if(hgsc004a.getLv().intValue() == 3){
hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode()); hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode());
}else{ }else{
...@@ -147,16 +151,22 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -147,16 +151,22 @@ public class ServiceHGSC004A extends ServiceBase {
} }
HGSCTools.THGSC005A.update(hgsc005a); HGSCTools.THGSC005A.update(hgsc005a);
}else { }else {
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){ if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.ZJ); hgsc004a.setChangeType(HGConstant.ChangeType.ZJ);
} }
hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ); hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ);
Map<String,Object> mapA = new HashMap<>();
Long maxID = (Long) dao.query(HGSC004A.MAX_ID,mapA, 0, -999999).get(0);
hgsc004a.setId(maxID+1);
DaoUtils.insert(HGSC004A.INSERT, hgsc004a); DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
//子表 //子表
HGSC005A hgsc005a = new HGSC005A(); HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType"); BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId()); hgsc005a.setMatDetailId(hgsc004a.getId());
hgsc005a.setMatId(hgsc004.getId()); hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setTechFlowId(flowHGSC004A.getTechFlowId());
hgsc005a.setFinishDate(flowHGSC004A.getFinishDate());
if(hgsc004a.getLv().intValue() == 3){ if(hgsc004a.getLv().intValue() == 3){
hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode()); hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode());
}else{ }else{
...@@ -246,7 +256,7 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -246,7 +256,7 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.fromMap(map); hgsc004a.fromMap(map);
DaoUtils.update(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004a); DaoUtils.update(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004a);
} }
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC001.FIELD_id,hgsc004a.getMaterialId()); HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004.FIELD_id,hgsc004a.getMaterialId());
if(Objects.nonNull(hgsc004)){ if(Objects.nonNull(hgsc004)){
Map<String,Object> mapA = new HashMap<>(); Map<String,Object> mapA = new HashMap<>();
......
...@@ -206,7 +206,22 @@ ...@@ -206,7 +206,22 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
</dynamic> </dynamic>
</select>
<select id="queryTechFlowIdByProductId" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A">
SELECT
b.flow_id as "techFlowId"
FROM ${hggpSchema}.hgpz005 b
WHERE 1=1
<isNotEmpty prepend=" AND " property="productId">
b.id = #productId#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select> </select>
...@@ -346,6 +361,11 @@ ...@@ -346,6 +361,11 @@
ORDER BY CREATED_TIME DESC ORDER BY CREATED_TIME DESC
</select> </select>
<select id="maxId" resultClass="long">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC004A
</select>
<delete id="batchDelete"> <delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC004A WHERE DELETE FROM ${hggpSchema}.HGSC004A WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
......
...@@ -30,28 +30,20 @@ $(function() { ...@@ -30,28 +30,20 @@ $(function() {
return template; return template;
} }
} },{
// { field: "projCode",
// field: "operator", attributes: {'class': 'i-input-readonly', required: true},
// title: "操作", title: "项目编号",
// template: function (item) { query: function (container, params) {
// let auditStatus = item.deviceStatus; var queryInfo = new EiInfo();
// let template = ''; // info.set("reviewStatus","3")
// if (item.companyCode && item.groupCode) { queryInfo.set("contractType","1")
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' return queryInfo;
// + 'onclick="showDetail(' + item.id + ',\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.groupCode + '\',\'' + item.groupName + '\',' + },
// '\'' + item.deviceType + '\',\'' + item.deviceName + '\')" >签证详情</a>'; init: function (e, options) {
// if (item.companyCode && item.groupCode) { console.log(e);
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' },
// + 'onclick="showDetail(' + item.id + ',\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.groupCode + '\',\'' + item.groupName + '\',' + },
// '\'' + item.deviceType + '\',\'' + item.deviceName + '\')" >附件详情</a>';
//
//
// }
// return template;
// }
// }
// }
], ],
onSave: function (e) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
...@@ -71,6 +63,7 @@ $(function() { ...@@ -71,6 +63,7 @@ $(function() {
} }
window.document.addEventListener("keyup",function (event) { window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){ if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid"); var grid = $("#ef_grid_result").data("kendoGrid");
...@@ -86,6 +79,8 @@ $(window).load(function () { ...@@ -86,6 +79,8 @@ $(window).load(function () {
query(); query();
}); });
/** /**
* 查询 * 查询
*/ */
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="主合同号" ename="contractNumber" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="主合同号" ename="contractNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="甲方名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="乙方名称" ename="partyB" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFDateSpan startCname="签订日期(从)" endCname="至" blockId="inqu_status" <EF:EFDateSpan startCname="签订日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date" startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyyMMdd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true"> format="yyyyMMdd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan> </EF:EFDateSpan>
<EF:EFInput cname="甲方名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="乙方名称" ename="partyB" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="主合同名称" ename="contractName" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="主合同名称" ename="contractName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains"> <EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
...@@ -34,38 +34,29 @@ ...@@ -34,38 +34,29 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false"> <EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" 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="companyName" cname="所属公司" <EF:EFColumn ename="companyName" cname="所属公司" width="120" enable="false" readonly="true" align="center"/>
columnTemplate="#=textField#" itemTemplate="#=textField#" <EF:EFPopupColumn ename="projCode" cname="项目编号" width="200"
textField="textField" valueField="valueField" serviceName="HGCW002" methodName="projectComboBox"
maxLength="16" readonly="true" width="120" required="true" resultId="projcet_combo_box" popupType="ServiceGrid"
align="center" filter="contains" sort="true"> valueField="projCode" textField="projCode"
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/> columnEnames="projCode,projName,contractNumber,contractName,partyA,partyB"
</EF:EFComboColumn> columnCnames="项目编码,项目名称,合同号,合同名称,甲方名称,乙方名称"
<EF:EFComboColumn ename="projCode" cname="项目编号" backFillColumnIds="projCode,projName,contractNumber,contractName,partyA,partyB"
columnTemplate="#=textField#" itemTemplate="#=textField#" backFillFieldIds="projCode,projName,contractNumber,contractName,partyA,partyB"
textField="textField" valueField="valueField" popupTitle="所属公司" popupWidth="800">
maxLength="16" readonly="true" width="120" required="true" </EF:EFPopupColumn>
align="center" filter="contains" sort="true"> <EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/> <EF:EFColumn ename="contractNumber" cname="主合同号" width="120" enable="false" readonly="true" align="center"/>
</EF:EFComboColumn> <EF:EFColumn ename="contractName" cname="主合同名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="projName" cname="项目名称" <EF:EFColumn ename="partyA" cname="甲方名称" width="120" enable="false" readonly="true" align="center"/>
columnTemplate="#=textField#" itemTemplate="#=textField#" <EF:EFColumn ename="partyB" cname="乙方名称" width="120" enable="false" readonly="true" align="center"/>
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="contractNumber" cname="主合同号" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="contractName" cname="主合同名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="partyA" cname="甲方名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="partyB" cname="乙方名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="projactDetail" cname="项目部位" width="120" enable="true" readonly="true" align="center" required="true"/> <EF:EFColumn ename="projactDetail" cname="项目部位" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="contractContent" cname="签证事由及内容" width="120" enable="true" readonly="true" align="center" required="true"/> <EF:EFColumn ename="contractContent" cname="签证事由及内容" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="含税金额" width="120" enable="true" readonly="true" align="center" required="true"/> <EF:EFColumn ename="totalContractPriceIncluding" cname="含税金额" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="signingDate" cname="签订日期" width="120" enable="true" readonly="true" align="center" editType="date" <EF:EFColumn ename="signingDate" cname="签订日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyyMMdd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" <EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" > columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/> <EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
loadComplete: function(grid){
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
},
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGSC099A?methodName=initLoad&inqu_status-0-bizType="+$("#inqu_status-0-bizType").val()+"&inqu_status-0-matId="+$("#inqu_status-0-matId").val(),
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
EiCommunicator.send('HGSC099', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC099", "delete", true);
}
})
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
console.log($("#fileDocId").val())
saveTemp(e);
try {
parent.JSColorbox.setValueCallback(docId);
} catch (e){
}
},
}
};
function saveTemp(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
let result = new EiInfo();
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HGDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件上传">
<EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_file11" path="HGSC"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment