'feat():完成HPSC002附件上传'

parent ba9092e4
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hpjx.hp.sc.domain.THPSC002; import com.baosight.hpjx.hp.sc.domain.THPSC002;
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;
import com.baosight.iplat4j.core.ei.EiInfo; 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.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -37,6 +39,12 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -37,6 +39,12 @@ public class ServiceHPSC002 extends ServiceBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/ /* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPSC002.query", new THPSC002()); EiInfo outInfo = super.query(inInfo, "HPSC002.query", new THPSC002());
//调用本地服务
// EiInfo eiInfo_update = new EiInfo();
// eiInfo_update.set(EiConstant.serviceName, "HPSC002");
// eiInfo_update.set(EiConstant.methodName, "delete");
// EiBlock eiBlock_update = new EiBlock(EiConstant.resultBlock);
// EiInfo outInfo_update = XLocalManager.call(eiInfo_update);
return outInfo; return outInfo;
} }
...@@ -59,13 +67,14 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -59,13 +67,14 @@ public class ServiceHPSC002 extends ServiceBase {
BigDecimal unitWt = hppz002.getUnitWt(); BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000"); DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue()))); BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
hppz002.setDelStatus(1);
hppz002.setTotalWt(totalWt); hppz002.setTotalWt(totalWt);
hppz002.setCreatedBy(UserSession.getUserId()); hppz002.setCreatedBy(UserSession.getUserId());
hppz002.setCreatedTime(sdf.format(new Date())); hppz002.setCreatedTime(sdf.format(new Date()));
hppz002.setUpdatedBy(null); hppz002.setUpdatedBy(null);
hppz002.setUpdatedTime(null); hppz002.setUpdatedTime(null);
this.dao.insert("HPSC002.insert", hppz002.toMap()); this.dao.insert("HPSC002.insert", hppz002.toMap());
if(!hppz002.getParentPrdtCode().equals("root")){ if (!hppz002.getParentPrdtCode().equals("root")) {
this.checkTreeNodeLeaf(new Long(hppz002.getParentPrdtCode())); this.checkTreeNodeLeaf(new Long(hppz002.getParentPrdtCode()));
} }
} }
...@@ -120,8 +129,10 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -120,8 +129,10 @@ public class ServiceHPSC002 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map); hppz002.fromMap(map);
this.dao.delete("HPSC002.delete", hppz002.toMap()); this.dao.delete("HPSC002.delete", hppz002.toMap());
this.checkTreeNodeLeaf(new Long(hppz002.getParentPrdtCode()));
//TODO 删除时 修改树结构
this.checkTreeNodeLeaf(new Long(hppz002.getId()));
} }
} catch (PlatException e) { } catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE); eiInfo.setStatus(EiConstant.STATUS_FAILURE);
...@@ -130,7 +141,6 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -130,7 +141,6 @@ public class ServiceHPSC002 extends ServiceBase {
logError("删除失败!", e.getMessage()); logError("删除失败!", e.getMessage());
return eiInfo; return eiInfo;
} }
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!"); eiInfo.setMsg("删除成功!");
return eiInfo; return eiInfo;
...@@ -141,30 +151,93 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -141,30 +151,93 @@ public class ServiceHPSC002 extends ServiceBase {
//1 获取参数 //1 获取参数
String pEname = inInfo.getCellStr(EiConstant.queryBlock, 0, "node"); String pEname = inInfo.getCellStr(EiConstant.queryBlock, 0, "node");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("pEname",pEname); queryMap.put("pEname", pEname);
//2 查询节点 //2 查询节点
List rows = dao.query("HPSC002.queryTree", queryMap); List rows = dao.query("HPSC002.queryTree", queryMap);
//3 增加节点block块 //3 增加节点block块
EiInfo outInfo = new EiInfo(); EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(pEname); EiBlock outBlock = outInfo.addBlock(BeanUtil.isEmpty(pEname) ? "" : pEname);
outBlock.addRows(rows); outBlock.addRows(rows);
return outInfo; return outInfo;
} }
/** /**
* 修改父级节点的LEAF状态为1 * 修改父级节点的LEAF状态为1
*
* @param id * @param id
*/ */
public void checkTreeNodeLeaf(Long id) { public void checkTreeNodeLeaf(Long id) {
EiInfo eiInfo = new EiInfo();
//1 获取参数 //1 获取参数
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("id", id); queryMap.put("id", id);
queryMap.put("leaf", "0"); List rows = this.dao.query("HPSC002.queryTreeNodeByParentPrtdCode", queryMap);
//2 查询节点 if(rows.size() > 0){
queryMap.put("leaf", "0");
}else{
queryMap.put("leaf", "1");
}
this.dao.update("HPSC002.updateTreeNodeLeaf", queryMap); this.dao.update("HPSC002.updateTreeNodeLeaf", queryMap);
} }
/**
* 审核 反审.
*/
public EiInfo check(EiInfo eiInfo) {
THPSC002 hppz002 = new THPSC002();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
Map sqlMap = new HashMap();
sqlMap.put("id",hppz002.getId());
if(hppz002.getStatus() == 0){
sqlMap.put("status",1);
}else{
sqlMap.put("status",0);
}
this.dao.update("HPSC002.check", hppz002.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
/**
* 审核 反审.
*/
public EiInfo bindDocIdById(EiInfo eiInfo) {
THPSC002 hppz002 = new THPSC002();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map);
Map sqlMap = new HashMap();
sqlMap.put("id",hppz002.getId());
sqlMap.put("filePath1",hppz002.getFilePath1());
this.dao.update("HPSC002.bindDocIdById", hppz002.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
} }
package com.baosight.hpjx.hp.sc.service;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
*
*/
public class ServiceHPSC099 extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
...@@ -68,8 +68,17 @@ ...@@ -68,8 +68,17 @@
REMARK as "remark" <!-- 备注 --> REMARK as "remark" <!-- 备注 -->
FROM hpjx.t_hpsc002 WHERE 1=1 FROM hpjx.t_hpsc002 WHERE 1=1
AND PARENT_PRDT_CODE NOT IN ('root') AND PARENT_PRDT_CODE NOT IN ('root')
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="parentPrdtCode">
ID = #id# PARENT_PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME LIKE CONCAT('%',CONCAT( #prdtName#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%',CONCAT( #projName#,'%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty> </isNotEmpty>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isEmpty property="orderBy"> <isEmpty property="orderBy">
...@@ -84,6 +93,9 @@ ...@@ -84,6 +93,9 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtCode">
PARENT_PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
</select> </select>
<!-- <!--
...@@ -249,8 +261,10 @@ ...@@ -249,8 +261,10 @@
<select id="queryTree" resultClass="java.util.HashMap"> <select id="queryTree" resultClass="java.util.HashMap">
SELECT SELECT
ID as "nodeId", ID as "nodeId",
PRDT_CODE as "prdtCode", <!-- 项目编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as projName,<!-- 项目名称 --> PRDT_name as "prdtName", <!-- 项目编码 -->
PROJ_NAME as "projName",<!-- 项目名称 -->
ID as "label", <!-- 名产品编码--> ID as "label", <!-- 名产品编码-->
PRDT_NAME as "text", <!-- 产品名称 --> PRDT_NAME as "text", <!-- 产品名称 -->
PARENT_PRDT_CODE as "pId", <!-- 父节点编码 --> PARENT_PRDT_CODE as "pId", <!-- 父节点编码 -->
...@@ -268,7 +282,49 @@ ...@@ -268,7 +282,49 @@
ORDER BY CREATED_TIME DESC ORDER BY CREATED_TIME DESC
</select> </select>
<select id="queryTreeNodeByParentPrtdCode" resultClass="java.util.HashMap">
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEPT_CODE as "deptCode", <!-- 部门编码 预留 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PARENT_PRDT_CODE as "parentPrdtCode", <!-- 父节点-产品编码 -->
PARENT_PRDT_NAME as "parentPrdtName", <!-- 父节点-产品名称 -->
TYPE as "type", <!-- 类别 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
ICON as "icon", <!-- 图片地址 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
NUM as "num", <!-- 数量 -->
UNIT_WT as "unitWt", <!-- 单重 -->
TOTAL_WT as "totalWt", <!-- 总重 -->
FILE_PATH1 as "filePath1", <!-- 文件地址1 -->
FILE_PATH2 as "filePath2", <!-- 文件地址2 -->
FILE_PATH3 as "filePath3", <!-- 文件地址3 -->
FILE_PATH4 as "filePath4", <!-- 文件地址4 -->
FILE_PATH5 as "filePath5", <!-- 文件地址5 -->
STATUS as "status", <!-- 状态 0-未审核,1-已审核 -->
DEL_STATUS as "delStatus", <!-- 状态 1未删除,0已删除 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
REMARK as "remark" <!-- 备注 -->
FROM hpjx.t_hpsc002 WHERE PARENT_PRDT_CODE = #id#
</select>
<update id="updateTreeNodeLeaf"> <update id="updateTreeNodeLeaf">
UPDATE hpjx.t_hpsc002 SET LEAF = #leaf# WHERE ID = #id# UPDATE hpjx.t_hpsc002 SET LEAF = #leaf# WHERE ID = #id#
</update> </update>
<update id="check">
UPDATE hpjx.t_hpsc002 SET status = #status# WHERE ID = #id#
</update>
<update id="bindDocIdById">
UPDATE hpjx.t_hpsc002 SET FILE_PATH1 = #filePath1# WHERE ID = #id#
</update>
</sqlMap> </sqlMap>
\ No newline at end of file
// 传递参数 将附件ID与当前记录ID进行绑定
let rowId = '';
let parentPrdtCode = '';
$(function () { $(function () {
IPLATUI.EFTree = { IPLATUI.EFTree = {
"materialTree": { "materialTree": {
ROOT: "root:项目列表", ROOT: "root:项目列表",
/** /**
* 树加载完成后的回调函数
* @param options: 树的配置项
*/
loadComplete: function (options) {
// 保持结点展开状态
var expanded = Cookies.get('expanded');
if (expanded) {
Cookies.remove('expanded');
expanded = JSON.parse(expanded);
$("#menu").data("kendoTreeView").expandPath(_.keys(expanded));
}
},
/**
* 选中树结点时触发的事件,注意点击树 折叠/展开 的图标不会触发此事件 * 选中树结点时触发的事件,注意点击树 折叠/展开 的图标不会触发此事件
* *
* @param e * @param e
...@@ -12,19 +28,23 @@ $(function () { ...@@ -12,19 +28,23 @@ $(function () {
select: function (e) { select: function (e) {
var nodeData = this.dataItem(e.node); var nodeData = this.dataItem(e.node);
IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId; IPLATUI.EFTree.materialTree.selectTreeNode.nodeId = nodeData.nodeId;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtCode = nodeData.prdtCode;
IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode; IPLATUI.EFTree.materialTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.materialTree.selectTreeNode.prdtName = nodeData.prdtName;
IPLATUI.EFTree.materialTree.selectTreeNode.projName = nodeData.projName; IPLATUI.EFTree.materialTree.selectTreeNode.projName = nodeData.projName;
// 重新查询EFGrid // 重新查询EFGrid
parentPrdtCode = nodeData.nodeId;
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}, },
selectTreeNode:{} selectTreeNode: {}
} }
}; };
$("#QUERY").on("click", function () { $("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
});
});
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
result: { result: {
...@@ -32,6 +52,44 @@ $(function () { ...@@ -32,6 +52,44 @@ $(function () {
pageSize: 10, pageSize: 10,
pageSizes: [10, 20, 50, 70, 100], pageSizes: [10, 20, 50, 70, 100],
}, },
loadComplete: function (grid) { // 在Grid加载完成后,才能给Grid上的按钮绑定事件
$("#SC02").on("click", function () {
if (grid.getCheckedBlockData().rows.length === 0) {
IPLAT.alert({
message: '<b>请勾选一项</b>',
okFn: function (e) {
},
title: '提示'
});
} else {
console.log(grid.getCheckedBlockData().rows[0][10]);
}
});
},
query: function () {
var ei = new EiInfo();
ei.set("inqu_status-0-projName",$("#inqu_status-0-projName").val());
ei.set("inqu_status-0-prdtName",$("#inqu_status-0-prdtName").val());
ei.set("inqu_status-0-status",$("#inqu_status-0-status").val());
ei.set("inqu_status-0-parentPrdtCode",parentPrdtCode);
return ei;
},
/**
* 点击行首checkbox,勾选行时触发的事件
* @param e kendo的Event对象
* e.sender kendoGrid对象,resultGrid
* e.fake 用于区分是手动点击的事件还是模拟的事件
* e.checked 用于区分是勾选还是取消勾选
* e.model 勾选或取消勾选的行数据,kendo.data.Model
* e.row 当前行的行号
* e.tr 行的tr,包括固定列和数据列 jquery对象
*/
onCheckRow: function (e) {
if (e.checked) {
console.log('选中');
}
},
/** /**
* EFGrid新增行之前触发的事件,可以根据业务逻辑控制是否进行新增 * EFGrid新增行之前触发的事件,可以根据业务逻辑控制是否进行新增
* @param e 事件对象 * @param e 事件对象
...@@ -61,11 +119,11 @@ $(function () { ...@@ -61,11 +119,11 @@ $(function () {
onAdd: function (e) { onAdd: function (e) {
// 动态设置默认邮箱 // 动态设置默认邮箱
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode; let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
$.each(e.items, function(index, item){ $.each(e.items, function (index, item) {
item['projCode'] = selectTreeNode.projCode; item['projCode'] = selectTreeNode.projCode;
item['projName'] = selectTreeNode.projName; item['projName'] = selectTreeNode.projName;
item['parentPrdtCode'] = selectTreeNode.nodeId; item['parentPrdtCode'] = selectTreeNode.nodeId;
item['parentPrdtName'] = selectTreeNode.projName; item['parentPrdtName'] = selectTreeNode.prdtName;
}); });
}, },
/** /**
...@@ -75,13 +133,7 @@ $(function () { ...@@ -75,13 +133,7 @@ $(function () {
*/ */
onSave: function (e) { onSave: function (e) {
// 不向后台保存 // 不向后台保存
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
}, },
/** /**
* 点击Grid删除按钮时触发的事件 * 点击Grid删除按钮时触发的事件
...@@ -90,13 +142,14 @@ $(function () { ...@@ -90,13 +142,14 @@ $(function () {
*/ */
onDelete: function (e) { onDelete: function (e) {
// 不向后台保存 // 不向后台保存
var tree = $("#materialTree").data("kendoTreeView"); console.log(e)
var inInfo = new EiInfo(); // var tree = $("#materialTree").data("kendoTreeView");
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数 // var inInfo = new EiInfo();
onSuccess: function (inInfo) { // EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
tree.reload("root");//更新树 // onSuccess: function (inInfo) {
} // tree.reload("root");//更新树
}); // }
// });
}, },
toolbarConfig: { toolbarConfig: {
hidden: false, // true时,不显示功能按钮,但保留setting导出按钮 hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
...@@ -104,27 +157,100 @@ $(function () { ...@@ -104,27 +157,100 @@ $(function () {
// cancel: false, // 不显示取消按钮 // cancel: false, // 不显示取消按钮
// save: false, // 不显示保存按钮 // save: false, // 不显示保存按钮
delete: true, // 显示删除按钮 delete: true, // 显示删除按钮
buttons: [ // 不允许覆盖默认的4个按钮,可以设置自定义的按钮 },
{ columns: [
name: "test", {
text: "测试", field: "operator",
front: "left", template: function (item) {
layout: "1", let auditStatus = item.status;
click: function () { let filePath1 = item.filePath1;
// 此处编写自定义功能 let template = '';
WindowUtil({ if (filePath1 === ' ') {
title: "定制", template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
content: "<div class='kendo-del-message'>测试</div>" 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
}); } else {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'href="'+ctx+'/EU/DM/EUDM06.jsp?docId=' + filePath1 + '" >下载</a>';
}
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',1)" >审核</a>';
} else {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="check(' + item.id + ',0)" >反审</a>';
}
return template;
}
}
],
},
};
// 关闭事件
IPLATUI.EFWindow = {
"uploadFile": {
close: function (e) {
let $iframe = uploadFileWindow.element.children("iframe");
let iframejQuery = $iframe[0].contentWindow.$; // 子窗口中的jQuery对象
let uploadFile = iframejQuery("#fileDocId").val();
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", rowId);
inEiInfo.set("result-0-filePath1", uploadFile);
EiCommunicator.send('HPSC002', 'bindDocIdById', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
} }
}, },
] {
async: false
}
);
},
}
};
});
function openUploadFile(id) {
uploadFileWindow.open().center();
rowId = id;
}
function donwloadFile(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPZL001', 'operator', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", auditStatus);
EiCommunicator.send('HPSC002', 'check', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
resultGrid.dataSource.page(1);
}, },
columns: [{ onFail(errorMessage, status, e) {
field: "filePath1", NotificationUtil("执行失败!", "error");
headerTemplate: "设计图纸", }
template: "<span style='display: flex;justify-content: center'><a class='i-btn-sm test' href=''>下载</a></span>", },
}], {
async: false
} }
} );
}); }
\ No newline at end of file \ No newline at end of file
...@@ -10,48 +10,67 @@ ...@@ -10,48 +10,67 @@
<EF:EFPage title="物料清单"> <EF:EFPage title="物料清单">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFInput ename="custType" cname="客商类型:" row="0"/> <EF:EFInput ename="projName" cname="项目名称" blockId="inqu_status" row="0"/>
<EF:EFSelect cname="分类:" optionLabel="全部" blockId="inqu_status" ename="custClassify" row="0"> <EF:EFInput ename="prdtName" cname="产品名称" blockId="inqu_status" row="0"/>
<EF:EFOption label="供应商" value="1"/> <EF:EFSelect cname="状态" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="客户" value="2"/> <EF:EFOption label="未审核" value="0"/>
</EF:EFSelect> <EF:EFOption label="已审核" value="1"/>
<EF:EFSelect cname="状态:" optionLabel="全部" blockId="inqu_status" ename="status" row="0">
<EF:EFOption label="启用" value="1"/>
<EF:EFOption label="停用" value="0"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<EF:EFInput ename="parentPrdtCode" blockId="inqu_status" hidden="true"/>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton> <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
</EF:EFRegion> </EF:EFRegion>
<div id="splitter" class="i-fit-height" style="display: inline"> <div id="splitter" class="i-fit-height" style="display: inline">
<div id="left-pane" class="i-fit-height" style="width: 20%;float:left;"> <div id="left-pane" class="i-fit-height" style="width: 20%;float:left;">
<EF:EFRegion id="projTree" title="BOM结构图" fitHeight="true"> <EF:EFRegion id="projTree" title="BOM结构图" fitHeight="true">
<EF:EFTree id="materialTree" valueField="label" textField="text" hasChildren="leaf" <EF:EFTree id="materialTree"
serviceName="HPSC002" methodName="queryTreeNode"> valueField="label"
textField="text"
hasChildren="leaf"
serviceName="HPSC002"
methodName="queryTreeNode">
</EF:EFTree> </EF:EFTree>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
<div id="right-pane" class="i-fit-height" style="width: 80%;float: right"> <div id="right-pane" class="i-fit-height" style="width: 80%;float: right">
<EF:EFRegion id="result" title="明细信息" > <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="no" > <EF:EFGrid blockId="result" autoDraw="no" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目编码"/> <EF:EFColumn enable="false" ename="projCode" cname="项目编码"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/> <EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
<EF:EFColumn ename="prdtCode" required="true" cname="产品编码"/> <EF:EFColumn ename="prdtCode" required="true" cname="产品编码"/>
<EF:EFColumn ename="prdtName" required="true" cname="产品名称"/> <EF:EFColumn ename="prdtName" required="true" cname="产品名称"/>
<EF:EFColumn enable="false" ename="parentPrdtCode" hidden="true" cname="上级产品名称"/> <EF:EFColumn enable="false" ename="parentPrdtCode" hidden="true" cname="上级产品名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" cname="上级产品名称"/> <EF:EFColumn enable="false" ename="parentPrdtName" cname="上级产品名称"/>
<EF:EFColumn ename="num" required="true" cname="数量"/> <EF:EFColumn ename="num" required="true" cname="数量"/>
<EF:EFColumn ename="unitWt" required="true" format="{0:N3}" cname="单重"/> <EF:EFColumn ename="unitWt" required="true" format="{0:N3}" cname="单重"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" cname="总重"/> <EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" cname="总重"/>
<EF:EFComboColumn enable="false" ename="status" align="center"
columnTemplate="#=textField#" optionLabel=" "
itemTemplate="#=textField#" textField="textField"
valueField="valueField" cname="审核状态">
<EF:EFOption label="未审核" value="0"></EF:EFOption>
<EF:EFOption label="已审核" value="1"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFComboColumn enable="false" ename="delStatus" align="center"
columnTemplate="#=textField#" optionLabel=" "
itemTemplate="#=textField#" textField="textField"
valueField="valueField" cname="删除标识">
<EF:EFOption label="" value="1"></EF:EFOption>
<EF:EFOption label="删除" value="0"></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn ename="operator" cname="操作" width="200" readonly="false"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
</div> </div>
<%-- EEDM8010页面加载时,不会加载EEDM6000 (lazyload="true") --%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
</EF:EFWindow>
</EF:EFPage> </EF:EFPage>
<script> <script>
var ctx = "${ctx}"; let ctx="${ctx}";
</script> </script>
<script src="${ctx}/HP/SC/HPSC002.js"></script> <script src="${ctx}/HP/SC/HPSC002.js"></script>
\ No newline at end of file
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
$("#fileDocId").val(e.response.docId);
NotificationUtil("附件上传成功");
console.log($("#fileDocId").val())
},
}
};
});
\ No newline at end of file
<!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}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="附件上传">
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_file11" path="A"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SC/HPSC099.js"></script>
\ No newline at end of file
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