Commit a634797c by 宋祥

1.委外加工增加文档选择功能

parent c2ca5d98
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC010D;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/10/21,11:07
*/
public class ServiceHGSC010D extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010D().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "委外加工", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
return super.query(inInfo, HGSC010D.QUERY, new HGSC010D());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HGSC010D> fSc010Ds = MapUtils.toDaoEPBases(inInfo, HGSC010D.class);
for (HGSC010D fSc010D : fSc010Ds) {
DaoUtils.insert(HGSC010D.DELETE, fSc010D.toMap());
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fSc010Ds.size() + "]条数据删除成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.sc.domain.HGSC010D;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/10/21,11:07
*/
public class ServiceHGSC010D1 extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010D().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "委外加工", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 未选择文件目录时,返回空
String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID);
if (StringUtils.isBlank(fileId)) {
return inInfo;
}
String parentId = MapUtils.getString(queryRow, HGWD001.FIELD_PARENT_ID);
String projCode = MapUtils.getString(queryRow, HGWD001.FIELD_PROJ_CODE);
// 判断是否备件制造图
boolean isSpare = HgWdUtils.HgWd001.isSpare(parentId, projCode);
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
// 管理员、开放目录不做权限验证
if (!(isSpare || HgWdUtils.HgWd009.isManager())) {
queryRow.put(User.FIELD_USER_ID, UserSessionUtils.getUserId());
}
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认
*
* @param inInfo
* @return
*/
public EiInfo confirm(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String contractCode = MapUtils.getString(queryMap, HGSC010D.FIELD_CONTRACT_CODE);
AssertUtils.isEmpty(contractCode, "请先选择委托单");
List<HGSC010D> fSc010Ds = MapUtils.toDaoEPBases(inInfo, HGSC010D.class);
for (HGSC010D fSc010D : fSc010Ds) {
fSc010D.setContractCode(contractCode);
fSc010D.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGSC010D.INSERT, fSc010D);
}
inInfo.setMsg("操作成功!本次对[" + fSc010Ds.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "新增失败");
}
return inInfo;
}
}
<?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="HGSC010D">
<sql id="column">
T.ID as "id", <!-- ID -->
T.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
T.DEP_CODE as "depCode", <!-- 部门编码 -->
T.CREATED_BY as "createdBy", <!-- 创建人 -->
T.CREATED_NAME as "createdName", <!-- 创建人名称 -->
T.CREATED_TIME as "createdTime", <!-- 创建时间 -->
T.UPDATED_BY as "updatedBy", <!-- 修改人 -->
T.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
T.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
T.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
T.CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
T.FILE_ID as "fileId", <!-- 目录ID -->
T.DOC_ID as "docId", <!-- 附件ID -->
T.DOC_NAME as "docName", <!-- 附件名称 -->
T.DOC_TYPE as "docType" <!-- 附件类型 -->
</sql>
<sql id="columnC">
C.PROJ_CODE as "projCode", <!-- 项目编码 -->
C.PROJ_NAME as "projName", <!-- 项目名称 -->
C.FILE_NAME as "fileName" <!-- 目录名称 -->
</sql>
<sql id="condition">
AND T.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
T.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
T.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
T.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
T.CONTRACT_CODE = #contractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
T.FILE_ID = #fileId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
T.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
T.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
T.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC010D">
SELECT
<include refid="column"/>,
<include refid="columnC"/>
FROM ${hggpSchema}.HGSC010D T, ${hggpSchema}.HGWD099 B, ${hggpSchema}.HGWD001 C
WHERE 1=1
AND T.DOC_ID = B.DOC_ID
AND B.BIZ_ID = C.FILE_ID
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGSC010D T, ${hggpSchema}.HGWD099 B, ${hggpSchema}.HGWD001 C
WHERE 1=1
AND T.DOC_ID = B.DOC_ID
AND B.FILE_ID = C.FILE_ID
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC010D (
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
CONTRACT_CODE, <!-- 委托单号 -->
FILE_ID, <!-- 目录ID -->
DOC_ID, <!-- 附件ID -->
DOC_NAME, <!-- 附件名称 -->
DOC_TYPE
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#,
#contractCode#, #fileId#, #docId#, #docName#, #docType#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGSC010D SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
</sqlMap>
$(function () {
IPLATUI.EFGrid.result = {
pageable: false,
columns: [{
field: "operator",
template: function (model) {
let param = "'" + model.fileId + "', '" + model.docId + "', '" + model.docType + "', '"
+ model.docName + "'";
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showPreview(' + param + ')" >预览</a>';
return template;
}
}]
}
// 查询
$("#QUERY").on("click", query);
// 选择
$("#SELECT_DOC").on("click", selectDoc);
// 删除
$("#REMOVE").on("click", remove);
// 下载
$("#DOWNLOAD").on("click", download);
});
/**
* 页面加载完执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 预览
*
* @param fileId
* @param docId
* @param docType
* @param docName
*/
let showPreview = function (fileId, docId, docType, docName) {
addRecordWindow(fileId, docId, docType, docName);
}
/**
* 删除
*/
let remove = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.submitGridsData("result", "HGSC010D", "remove", true);
}
/**
* 选择附件
*/
let selectDoc = function () {
let params = {
"inqu_status-0-contractCode": $("#inqu_status-0-contractCode").val()
}
JSColorbox.open({
href: "HGSC010D1",
title: "<div style='text-align: center;'>选择文档</div>",
width: "95%",
height: "95%",
params: params,
callbackName: selectDocCallBack
});
}
/**
* 回调
*/
let selectDocCallBack = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
\ 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}"/>
<EF:EFPage title="文档详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="contractCode" cname="委外单号" blockId="inqu_status" row="0" colWidth="3"
readonly="true"/>
<EF:EFInput ename="companyName" cname="公司名称" blockId="inqu_status" row="0" colWidth="3"
readonly="true"/>
<EF:EFInput ename="docName" cname="附件名称" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="结果集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="fielId" cname="目录ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="docType" cname="附件类型" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<jsp:include page="/HG/WD/HGWD002A1.jsp"/>
\ No newline at end of file
$(function () {
const init = () => {
$("#HGSC010D1").css("padding-bottom", "8px")
sessionStorage.removeItem("__user_id__")
setTimeout(() => {
let parendId = $("inqu_status-0-parentId").val();
if (!isBlank(parendId)) {
resultGrid.dataSource.page(1);
}
// 显示授权按钮
showAuthButton();
}, 1000);
// 分割线组件
(function () {
splitter = $("#splitter").kendoSplitter({
panes: [
{size: "30%", min: "25%", max: "75%", collapsible: true},
{},
{collapsible: true}
]
}).data("kendoSplitter");
// 当 EFRegion 的 fitHeight="true" 时,需要为 splitter 中的 k-splitbar 加上 class="i-fit-height"。
$("#splitter").find(".k-splitbar").addClass("i-fit-height");
//加下面的延迟是为了处理 多界面同时刷新 界面展示不全的问题
var interval01 = setInterval(splitterInterval, 200);
function splitterInterval() {
if (document.getElementById("splitter").getElementsByClassName("k-splitbar").length !== 1) {
$("#splitter").kendoSplitter({
panes: [
{size: "25%", min: "20%", max: "80%", collapsible: true},
{},
{collapsible: true}
]
});
} else {
clearInterval(interval01);
}
}
})();
// 抽屉组件
(function () {
$(".close-btn span").on("click", function () {
closeDrawer()
})
function closeDrawer() {
$(".drawer-wrapper").css("transform", "translateX(-100%)");
// 重置splitter
splitter.collapse(".k-pane:first")
splitter.expand(".k-pane:first")
}
function openDrawer(url, userId) {
$(".drawer-wrapper").css("transform", "translateX(0%)");
const lastId = sessionStorage.getItem("__user_id__")
if (lastId !== userId) {
sessionStorage.setItem("__user_id__", userId);
}
if ($(".drawer-wrapper iframe").attr("src") === '') {
$(".drawer-wrapper iframe").attr("src", url)
}
refreshUserDetail();
function refreshUserDetail() {
if ($("#iframeDrawer")?.get(0)?.contentWindow?.refreshWindow) {
$("#iframeDrawer").get(0).contentWindow.refreshWindow()
return
}
setTimeout(() => {
refreshUserDetail();
}, 50)
}
}
window.closeDrawer = closeDrawer;
window.openDrawer = openDrawer;
})();
}
init();
IPLATUI.EFTree = {
"docTree": {
query: function (inInfo, model) {
inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val());
return inInfo;
},
select: function (e) {
var _data = this.dataItem(e.node);
var labelValue = _data.label;
setTreeNodeValue(_data);
$("[name = 'inqu_status-0-parentId']").val(labelValue);
$("[name = 'inqu_status-0-fileId']").val(_data.id);
$("[name = 'inqu_status-0-leafLevel']").val(_data.leafLevel == null ? 0 : _data.leafLevel);
$("[name = 'inqu_status-0-projCode']").val(_data.projCode);
$("[name = 'inqu_status-0-fileName']").val(_data.text);
resultGrid.dataSource.page(1);
// 显示授权按钮
showAuthButton();
},
/*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) {
var item = node.item;
var title = item.text;
let icon = 'fa fa-globe'
if (item.label !== 'root') {
switch (item.leafType) {
case 'P':
icon = 'fa fa-clipboard'
break;
case 'C':
icon = 'fa fa-folder'
break;
}
}
return ' <span class="' + icon
+ '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label
+ '">' + title + '</span>'
},
loadComplete: function (options) {
},
selectTreeNode: {
fileId: '',
parentId: '',
projCode: '',
companyCode: '',
leafLevel: '',
isAuth: '1'
}
}
};
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "docVersion",
template: function (model) {
return "v" + model.docVersion;
}
}, {
field: "docType",
template: function (row) {
if (!isBlank(row.docType) && row.docType.startsWith(".")) {
return row.docType.substring(1);
}
return row.docType == null ? "" : row.docType;
}
}],
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 确认选择
$("#CONFIRM").on("click", confirm);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
// query();
});
/**
* 查询
*/
let query = function () {
let fileId = $("#inqu_status-0-fileId").val();
if (isBlank(fileId)) {
message("请选择文件目录,再进行查询");
return;
}
resultGrid.dataSource.page(1);
}
/**
* 设置树节点的值
*
* @param nodeData
*/
let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.docTree.selectTreeNode.fileId = nodeData.label;
IPLATUI.EFTree.docTree.selectTreeNode.parentId = nodeData.parentId;
IPLATUI.EFTree.docTree.selectTreeNode.fileName = nodeData.text;
IPLATUI.EFTree.docTree.selectTreeNode.companyCode = nodeData.companyCode;
IPLATUI.EFTree.docTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.docTree.selectTreeNode.leafLevel = nodeData.leafLevel;
IPLATUI.EFTree.docTree.selectTreeNode.isAuth = nodeData.isAuth;
}
/**
* 确认
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.submitGridsData("result", "HGSC010D1", "confirm", false,
function (res) {
if (res.status >= 0) {
parent.JSColorbox.setValueCallback();
}
}
);
}
\ 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}"/>
<EF:EFPage title="文档浏览">
<div id="splitter" class="i-fit-height">
<div id="left-pane" class="i-fit-height">
<EF:EFRegion title="文档目录树" id="tree" fitHeight="true">
<div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="docTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parentId" serviceName="HGWD001D" methodName="queryTree"
expandLevel="1">
</EF:EFTree>
</div>
</EF:EFRegion>
</div>
<div id="right-pane" class="i-fit-height">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="contractCode" cname="委托单号" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"
value="WD"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="附件分类" colWidth="3"
filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
<EF:EFInput cname="附件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="上传时间" endCname="至" blockId="inqu_status" row="0"
startName="createdDateFrom" endName="createdDateTo" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" showCount="true" height="73vh" sort="setted"
checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="120" align="center" sort="false"
hidden="true"/>
<EF:EFComboColumn ename="fileType" cname="附件分类" enable="false" width="90" align="center">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="220" sort="true"/>
<EF:EFColumn ename="docType" cname="附件后缀" enable="false" width="110" align="center"
sort="true"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center"
sort="true"/>
<EF:EFColumn ename="updatedTime" cname="上传时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"
dateFormat="yyyy-MM-dd HH:mm:ss" sort="true"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFPage>
/**
* 下载
*/
let download = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选要下载的数据!");
return;
}
if (rows.length == 1) {
singleDownload(rows[0]);
} else {
batchDownload();
}
}
/**
* 单个下载
*
* @param row
*/
let singleDownload = function (row) {
let inInfo = new EiInfo();
inInfo.set("result-0-fileId", row['fileId']);
inInfo.set("result-0-docId", row['docId']);
EiCommunicator.send("HGWD001C", "add", inInfo, {
onSuccess(res) {
if (res.status > -1) {
window.open(CommonUtils.downloadFile(row['docId'], false), '_blank');
} else {
message(res.msg);
}
}
}, {async: false})
}
/**
* 批量下载
*
* @param fileId
* @param docId
*/
let batchDownload = function () {
JSUtils.submitGridsData("result", "HGWD001C", "batchDownload", false,
function (res) {
if (res.status > -1) {
window.open(res.extAttr.downloadUrl, '_blank');
}
}
);
}
\ No newline at end of file
...@@ -299,55 +299,3 @@ let preview = function () { ...@@ -299,55 +299,3 @@ let preview = function () {
let showPreview = function (fileId, docId, docType, docName) { let showPreview = function (fileId, docId, docType, docName) {
addRecordWindow(fileId, docId, docType, docName); addRecordWindow(fileId, docId, docType, docName);
} }
/**
* 下载
*/
let download = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选要下载的数据!");
return;
}
if (rows.length == 1) {
singleDownload(rows[0]);
} else {
batchDownload();
}
}
/**
* 单个下载
*
* @param row
*/
let singleDownload = function (row) {
let inInfo = new EiInfo();
inInfo.set("result-0-fileId", row['fileId']);
inInfo.set("result-0-docId", row['docId']);
EiCommunicator.send("HGWD001C", "add", inInfo, {
onSuccess(res) {
if (res.status > -1) {
window.open(CommonUtils.downloadFile(row['docId'], false), '_blank');
} else {
message(res.msg);
}
}
}, {async: false})
}
/**
* 批量下载
*
* @param fileId
* @param docId
*/
let batchDownload = function () {
JSUtils.submitGridsData("result", "HGWD001C", "batchDownload", false,
function (res) {
if (res.status > -1) {
window.open(res.extAttr.downloadUrl, '_blank');
}
}
);
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<script src="${ctx}/common/docxjs/jszip.min.js"></script> <script src="${ctx}/common/docxjs/jszip.min.js"></script>
<script src="${ctx}/common/docxjs/docx-preview.js"></script> <script src="${ctx}/common/docxjs/docx-preview.js"></script>
<script src="${ctx}/common/js/xlsx.full.min.js"></script> <script src="${ctx}/common/js/xlsx.full.min.js"></script>
<script src="${ctx}/HG/WD/HGWD001C1.js"></script>
<script src="${ctx}/HG/WD/HGWD002A1.js"></script> <script src="${ctx}/HG/WD/HGWD002A1.js"></script>
<link rel="stylesheet" href="${ctx}/HG/WD/HGWD002A1.css"> <link rel="stylesheet" href="${ctx}/HG/WD/HGWD002A1.css">
......
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