Commit 4548d92b by 宋祥

Merge branch 'dev' of http://129.211.46.84:8800/platform/hg-smart into master-dc

parents a2bce679 abfd56a0
...@@ -14,14 +14,16 @@ $(function () { ...@@ -14,14 +14,16 @@ $(function () {
title: "操作", title: "操作",
template: function (item) { template: function (item) {
let template = ''; let template = '';
if (!isBlank(item.id)) { if (isBlank(item.id)) {
return template;
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(\'' + item.receiveNo + '\')" >详情</a>'; + 'onclick="showDetail(\'' + item.receiveNo + '\')" >详情</a>';
} template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showFile(\'' + item.receiveNo + '\')" >附件</a>';
if (item.status == 0 && item.source == 1) { if (item.status == 0 && item.source == 1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
'onclick="updateStatus(' + item.id + ',2)" >确认收货</a>'; + 'onclick="updateStatus(' + item.id + ',2)" >确认收货</a>';
} }
return template; return template;
} }
...@@ -385,6 +387,25 @@ function windowCallback() { ...@@ -385,6 +387,25 @@ function windowCallback() {
JSColorbox.close(); JSColorbox.close();
} }
/**
* 附件清单
*
* @param bizId
*/
let showFile = function (bizId) {
let params = {
"inqu_status-0-bizId": bizId,
"inqu_status-0-bizType": "PUR_RECEIVE",
}
JSColorbox.open({
href: "HGDM099",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
params: params
});
}
function updateStatus(id,status) { function updateStatus(id,status) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id); inEiInfo.set("result-0-id", id);
......
...@@ -4,15 +4,16 @@ $(function () { ...@@ -4,15 +4,16 @@ $(function () {
columns: [{ columns: [{
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = "";
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>'; template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + CommonUtils.previewFile(item.docId, item.docName)
+ '" target="_blank">预览</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + CommonUtils.downloadFile(item.docId, false)
+ '" target="_blank">下载</a>';
return template; return template;
} }
}], }]
loadComplete: function (grid) {
},
dataBound: function () {
}
} }
}; };
...@@ -43,40 +44,15 @@ var query = function (e) { ...@@ -43,40 +44,15 @@ var query = function (e) {
/** /**
* 文件上传 * 文件上传
*
* @param id
*/ */
function uploadFile(id) { function uploadFile() {
JSColorbox.open({ let bizId = $("#inqu_status-0-bizId").val();
href: "HGDM099A", let bizType = $("#inqu_status-0-bizType").val();
title: "<div style='text-align: center;'>附件上传</div>", CommonUtils.uploadFile(bizType, bizId, function (res) {
width: "60%", // 刷新列表
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(e) {
let res = e.response;
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-bizId", $("#inqu_status-0-bizId").val());
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
inEiInfo.set("result-0-docId", res.docId);
inEiInfo.set("result-0-docName", res.docName);
EiCommunicator.send('HGDM099', 'upload', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}, // 关闭弹窗
onFail(errorMessage, status, e) { JSColorbox.close();
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}); });
} }
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<EF:EFPage title="附件清单"> <EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query"> <EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="业务ID" ename="bizId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="业务单号" ename="bizId" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/> <EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="100"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/> parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
......
...@@ -29,7 +29,11 @@ ...@@ -29,7 +29,11 @@
<EF:EFColumn ename="orgCname" cname="部门名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="orgCname" cname="部门名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userId" cname="用户账号" enable="false" width="100" align="center"/> <EF:EFColumn ename="userId" cname="用户账号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="userName" cname="用户姓名" enable="false" width="120" align="center"/> <EF:EFColumn ename="userName" cname="用户姓名" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="isProjectManager" cname="是否项目经理" width="100" align="center" <EF:EFComboColumn ename="isProjectManager" cname="是否项目经理" width="120" align="center"
required="true" copy="true">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="downloadFlag" cname="是否可以下载" width="120" align="center"
required="true" copy="true"> required="true" copy="true">
<EF:EFCodeOption codeName="hggp.common.yesNo"/> <EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -679,6 +679,7 @@ function loadChange(grid,e,field) { ...@@ -679,6 +679,7 @@ function loadChange(grid,e,field) {
// Base64转码 // Base64转码
let urlEncode; let urlEncode;
try { try {
docName = encodeURIComponent(docName);
urlEncode = encodeURIComponent(btoa(url + docName)); urlEncode = encodeURIComponent(btoa(url + docName));
} catch (e) { } catch (e) {
console.error("encodeURIComponent fail:", e) console.error("encodeURIComponent fail:", e)
......
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