Commit ea2c1e3b by liuyang

2024-04-11 企业管理功能优化

parent de7e1581
$(function () {
IPLATUI.EFGrid.result = {
copyToAdd:false,
pageable: {
pageSize: 20,
pageSize: 10,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "docIdPc",
title: "PC端log",
template: function (item) {
let docId = item.docIdPc;
let template = '';
if (docId!= null && docId.length>0){
let src = downloadHref(docId);
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;background-color: #e7e7e7" '
+ 'href="' + src + '" target="_blank">' +
'<img src="'+src+'" style="width:200px;height:50px;background-image: none;" alt="APP端log"/></a>';
}
return template;
}
},
{
field: "docIdApp",
title: "APP端log",
template: function (item) {
let docId = item.docIdApp;
let template = '';
if (docId!= null && docId.length>0){
let src = downloadHref(docId);
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;background-color: #e7e7e7" '
+ 'href="' + src + '" target="_blank">' +
'<img src="'+src+'" style="width:200px;height:50px;background-image: none;" alt="APP端log"/></a>';
}
return template;
}
}
],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
......@@ -14,6 +47,7 @@ $(function () {
$("#type").val("insert")
$("#companyName").val("");
$("#loginPrefix").val("");
$("#loginPrefix").removeAttr("readonly");
$("#validFlag").val(1);
$("#PCfileDocId").val("");
$("#APPfileDocId").val("");
......@@ -28,7 +62,7 @@ $(function () {
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
//save();
updateCompany();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
......@@ -44,21 +78,7 @@ $(function () {
* e.tr tr, jquery
*/
onRowClick: function (e) {
let app = $("#app-img"),
pc = $("#pc-img");
$("#type").val("update");
$("#companyCode").val(e.model.companyCode);
$("#companyName").val(e.model.companyName);
$("#loginPrefix").val(e.model.loginPrefix);
$("#validFlag").val(e.model.validFlag);
$("#PCfileDocId").val(e.model.docIdPc);
$("#APPfileDocId").val(e.model.docIdApp);
$("#remark").val(e.model.remark);
$("#id").val(e.model.id);
addImgLabel(app,e.model.docIdApp);
addImgLabel(pc,e.model.docIdPc);
$("#insertGroup_wnd_title").text("修改企业管理");
addCompany($("#insertGroup"));
/*WindowUtil({
"title": "",
"content": "<div class='kendo-del-message'>" + e.row + "</div>"
......@@ -86,6 +106,11 @@ $(function () {
localization: {
invalidFileExtension: "文件格式不支持, 上传失败"
},
loadComplete: function(e) {
var uploader = e.sender.uploader;
uploader.clearAllFiles();
// 清空所有历史上传文件
},
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
......@@ -108,6 +133,11 @@ $(function () {
localization: {
invalidFileExtension: "文件格式不支持, 上传失败"
},
loadComplete: function(e) {
var uploader = e.sender.uploader;
uploader.clearAllFiles();
// 清空所有历史上传文件
},
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
......@@ -157,6 +187,7 @@ let save = function (){
onSuccess: function (ei) {
btnNode.attr("disabled", false);
$("#insertGroup").data("kendoWindow").close();
// 清除上传队列
resultGrid.dataSource.page(1);
// onFail 表示失败回掉函数
}, onFail: function (ei) {
......@@ -168,52 +199,6 @@ let save = function (){
};
/**
* 保存
*/
/*let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length = 1) {
$("#type").val("update")
}
let result = new EiInfo();
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;
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);
EiCommunicator.send("HPXS003", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
resultGrid.dataSource.page(1);
},
onFail: function (ei) {
// 发生异常
NotificationUtil("执行失败,原因[" + ei + "]", "error");
}
}, {
async: false
});
/!*JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ009", "save", true);
}
});*!/
}*/
/**
* 删除
*/
let deleteFunc = function () {
......@@ -236,11 +221,36 @@ let deleteFunc = function () {
* @param id
*/
function addCompany(id) {
let rows = resultGrid.getCheckedRows();
//打开弹窗
$(".k-upload-status-total").remove();
id.data("kendoWindow").open().center();
}
function updateCompany() {
//获取grid选中数据
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let app = $("#app-img"),
pc = $("#pc-img");
$("#type").val("update");
$("#companyCode").val(rows[0]["companyCode"]);
$("#companyName").val(rows[0]["companyName"]);
$("#loginPrefix").val(rows[0]["loginPrefix"]);
$("#loginPrefix").attr("readonly","true");
$("#validFlag").val(rows[0]["validFlag"]);
$("#PCfileDocId").val(rows[0]["docIdPc"]);
$("#APPfileDocId").val(rows[0]["docIdApp"]);
$("#remark").val(rows[0]["remark"]);
$("#id").val(rows[0]["id"]);
addImgLabel(app,rows[0]["docIdApp"]);
addImgLabel(pc,rows[0]["docIdPc"]);
$("#insertGroup_wnd_title").text("修改企业管理");
addCompany($("#insertGroup"));
}
$("#update").click(function () {
var btnNode = $(this);
btnNode.attr("disabled", true);
......@@ -261,6 +271,7 @@ $("#update").click(function () {
}
});
});
/**
* 附件上传回调
*
......
......@@ -15,12 +15,14 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdPc" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdApp" cname="主键" hidden="true"/>
<EF:EFColumn cname="企业编码" ename="companyCode" enable="false" width="120" align="center"/>
<EF:EFColumn cname="企业名称" ename="companyName" width="140" required="true"/>
<EF:EFColumn cname="登录前缀" ename="loginPrefix" width="100" align="center" readonly="true"/>
<EF:EFComboColumn cname="是否启用" ename="validFlag" width="80" align="center" required="true">
<%--<EF:EFColumn ename="docIdPc" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdApp" cname="主键" hidden="true"/>--%>
<EF:EFColumn cname="企业编码" ename="companyCode" enable="false" width="120" height="50" align="center"/>
<EF:EFColumn cname="企业名称" ename="companyName" width="140" align="center" required="true"/>
<EF:EFColumn cname="登录前缀" ename="loginPrefix" width="80" align="center" readonly="true"/>
<EF:EFColumn cname="PC端log" ename="docIdPc" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="APP端log" ename="docIdApp" align="center" width="200" readonly="true" enable="false"/>
<EF:EFComboColumn cname="是否启用" ename="validFlag" width="70" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hppz.validFlag"/>
</EF:EFComboColumn>
<EF:EFColumn cname="备注" ename="remark" width="150" editType="textarea"/>
......
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