Commit e7da7e30 by 宋祥

1.采购收货增加附件

parent 6052c324
......@@ -14,18 +14,20 @@ $(function () {
title: "操作",
template: function (item) {
let template = '';
if (!isBlank(item.id)) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(\'' + item.receiveNo + '\')" >详情</a>';
if (isBlank(item.id)) {
return template;
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ '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) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',2)" >确认收货</a>';
}
return template;
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',2)" >确认收货</a>';
}
}, {
return template;
}
}, {
field: "companyCode",
title: "公司编码",
template: function (dataItem) {
......@@ -385,6 +387,25 @@ function windowCallback() {
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) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
......
......@@ -4,15 +4,16 @@ $(function () {
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>';
let template = "";
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;
}
}],
loadComplete: function (grid) {
},
dataBound: function () {
}
}]
}
};
......@@ -43,40 +44,15 @@ var query = function (e) {
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGDM099A",
title: "<div style='text-align: center;'>附件上传</div>",
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);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
function uploadFile() {
let bizId = $("#inqu_status-0-bizId").val();
let bizType = $("#inqu_status-0-bizType").val();
CommonUtils.uploadFile(bizType, bizId, function (res) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
});
}
......
......@@ -7,10 +7,10 @@
<EF:EFPage title="附件清单">
<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"/>
<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>
</EF:EFRegion>
......@@ -19,6 +19,7 @@
<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="docType" cname="文件类型" enable="false" width="100"/>
<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"/>
......
......@@ -679,6 +679,7 @@ function loadChange(grid,e,field) {
// Base64转码
let urlEncode;
try {
docName = encodeURIComponent(docName);
urlEncode = encodeURIComponent(btoa(url + docName));
} catch (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