增加附件多选下载勾选功能,修复收藏功能bug,修复撤转功能选择多人后只能发给一个人

master
孙亮 6 months ago
parent 8e859a4e9d
commit 2ce18f7689

@ -31,7 +31,7 @@ var CommonConfig = {
//附件信息配置
IsOnlinePreviewOfAth: true, //是否在线预览
//@BKGY
PreviewPathOfAth: "http://172.15.89.222:8012",//附件预览服务器地址,在上传附件后预览时可配置此处的预览服务器地址
PreviewPathOfAth: "https://craft.dayesteel.com.cn:8017/",//附件预览服务器地址,在上传附件后预览时可配置此处的预览服务器地址
IsHideMobileBack: false,//是否隐藏移动端返回标签
RichTextType: 'tinymce',
IsClearSearchCond: true,//是否清空查询条件

@ -17,6 +17,7 @@ var PreviewPathOfAth = getConfigByKey("PreviewPathOfAth", "");
*/
function AthTable_Init(athchment, athDivID, refPKVal) {
debugger;
if (typeof athchment != "object" && typeof athchment == "string")
athchment = new Entity("BP.Sys.FrmAttachment", athchment);
if (refPKVal == null || refPKVal == undefined || refPKVal == 0)
@ -199,6 +200,8 @@ function InitAthPage(athDivID, uploadUrl) {
}
$("#" + athDivID).show();
layui.form.render("select");
layui.form.render('checkbox');
}
@ -233,6 +236,7 @@ function FileShowWayTable(athDesc, dbs, uploadUrl) {
var colstyle = "line-height:30px;border: 1px solid #ddd;background-color:white;";
colstyle = "background-color:#FAFAFA !important; ";
_html += "<th align='center' width='12%' style='height: 42px;' ><input lay-filter='allChecks' type='checkbox' id='allChecks' onclick='ckAll();' /></th>";
_html += "<th style='" + colstyle + "width:50px;'>序号</th>";
if (isHaveSort == true)
_html += "<th style='" + colstyle + "width:120px' nowrap=true >" + sortColoum + "</th>";
@ -317,7 +321,9 @@ function FileShowWayTable(athDesc, dbs, uploadUrl) {
athIdx++;
_html += "<tr class='athInfo'>";
//①序号
//①复选框
_html += "<td align='center' width='12%'> <input type='checkbox' name='child' class='fileId' lay-filter='clickChild' value='" + db.MyPK + "' /></td>";
//序号
_html += "<td class='Idx' nowrap>" + athIdx + "</td>";
//增加类别列,有可能跨多行
@ -395,6 +401,12 @@ function FileShowWayTable(athDesc, dbs, uploadUrl) {
if (IsExistFile == false || (athDesc.IsExpCol == 1 && athDesc.IsUpload == true && pageData.IsReadonly != "1")) {
athIdx++;
//复选框
if (db != undefined && db != "") {
_html += "<td align='center' width='12%'> <input type='checkbox' name='child' class='fileId' lay-filter='clickChild' value='" + db.MyPK + "' /></td>";
}
//①序号
_html += "<td class='Idx'>" + athIdx + "</td>";
@ -493,6 +505,66 @@ function GFDoDown(mypk, fk_framAttachment) {
AthTable_Init(fk_framAttachment, "Div_" + fk_framAttachment, pageData.WorkID);
//Reload();
}
layui.use(['form', 'layer', 'laydate'], function () {
var form = layui.form, $ = layui.jquery, laydate = layui.laydate;
form.on('checkbox(allChecks)', function (data) {
var child = $("input[type='checkbox']");
child.each(function (index, item){
item.checked = data.elem.checked;
});
form.render('checkbox');
});
//选中子项
form.on('checkbox(clickChild)', function (data) {
var childs = $(".fileId");
for (var i = 0; i < childs.length; i++) {
if (childs[i].checked == false) {
$("#allChecks").prop("checked", false);
form.render('checkbox');
break;
}
}
//
var all = childs.length;
for (var i = 0; i < childs.length;i++) {
if (childs[i].checked == true) {
all--;
}
}
if (all == 0) {
$("#allChecks").prop("checked", true);
form.render('checkbox');
}
});
});
//全选
function ckAll() {
var status = document.getElementById('allChecks').checked;
var childs = document.getElementById('child');
for (var i = 0; i < childs.length; i++) {
childs[i].checked = status;
}
}
function clickChild() {
var childs = document.getElementByName('child');
var count = childs.length;
var CheckedCount = 0;
for (var i = 0; i < childs.length; i++) {
if (childs[i].checked == true) {
CheckedCount++;
}
}
//若子选项全选,则全选也选中
if (count == CheckedCount) {
document.getElementById('allChecks').checked == true;
} else {
document.getElementById('allChecks').checked == false;
}
}
// 修改文件名.
function ChangeFileName(mypk) {
@ -624,16 +696,75 @@ function Down2018(mypk) {
link.click();
}
//打包下载
function DownZipBatch(fk_frmattachment, PKVal) {
var ids = new Array();//选中的附件
//获取选中的附件复选框
var childs = $(".fileId");
for (var i = 0; i < childs.length; i++) {
if (childs[i].checked == true) {
var id = childs[i].value;
ids.push(id);
}
}
if (ids.length == 0) {
alert("请先选中要下载的文件。");
return;
}
var httpHandler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
httpHandler.AddUrlData();
httpHandler.AddPara("Ids", ids);
httpHandler.AddPara("FK_FrmAttachment", fk_frmattachment);
httpHandler.AddPara("PKVal", PKVal)
var data = httpHandler.DoMethodReturnString("AttachmentUpload_DownZip");
if (data.indexOf('err@') == 0) {
alert(data); //如果是异常,就提提示.
return;
}
if (data.indexOf('url@') == 0) {
data = data.replace('url@', ''); //如果返回url就直接转向.
var i = data.indexOf('\DataUser');
var str = '/' + data.substring(i);
str = str.replace('\\\\', '\\');
if (plant != 'CCFlow') {
var currentPath = GetHrefUrl();
var path = currentPath.substring(0, currentPath.indexOf('/WF') + 1);
str = path + str;
} else {
str = basePath + str;
}
SetHref(str);
}
}
/**
* 打包下载
* @param fk_frmattachment 附件属性MyPK
* @param PKVal 附件控制权限的ID
*/
function DownZip(fk_frmattachment, PKVal) {
var ids = new Array();//选中的附件
//获取选中的附件复选框
var childs = $(".fileId");
for (var i = 0; i < childs.length; i++) {
if (childs[i].checked == true) {
var id = childs[i].value;
ids.push(id);
}
}
if (ids.length == 0) {
alert("请先选中要下载的文件。");
return;
}
var httpHandler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
httpHandler.AddUrlData();
httpHandler.AddPara("Ids", ids);
httpHandler.AddPara("FK_FrmAttachment", fk_frmattachment);
httpHandler.AddPara("PKVal", PKVal)
var data = httpHandler.DoMethodReturnString("AttachmentUpload_DownZip");

@ -694,6 +694,8 @@ function SetFrmReadonly() {
$("#WorkCheck_Doc").removeAttr("readonly");
$("#WorkCheck_Doc").removeAttr("disabled");
}
$("#allChecks").attr('disabled', false);;
$(".fileId").attr('disabled', false);;
$('#Btn_Save').attr('disabled', true);
}

@ -1588,11 +1588,11 @@ function SaveEnd(formType) {
function FocusBtn(btn, workid) {
btn = $('[name=Focus]');
if (btn.length == 1) {
if (btn[0].innerText.trim() == "关注") {
btn[0].innerHTML = "<img src='Img/Btn/Focus.png' width='22px' height='22px'>&nbsp;取消关注";
if (btn[0].innerText.trim() == "收藏") {
btn[0].innerHTML = "<img src='Img/Btn/Focus.png' width='22px' height='22px'>&nbsp;取消收藏";
}
else {
btn[0].innerHTML = "<img src='Img/Btn/Focus.png' width='22px' height='22px'>&nbsp;关注";
btn[0].innerHTML = "<img src='Img/Btn/Focus.png' width='22px' height='22px'>&nbsp;收藏";
}
var handler = new HttpHandler("BP.WF.HttpHandler.WF_MyFlow");

@ -47,9 +47,30 @@
function DBTemplate_Init(data, SeachType) {
var dbTemplate = data['DBTemplate'];
var history = data['History'];
var dbSeach = data['DBSeach'];
if (dbSeach == undefined) {
dbSeach = [];
}
var idx = 0;
var html = "<table style='width:93%;'>";
html += "<tr id='dbSeach'>";
html += "<th colspan=3 >查询结果</th>";
html += "</tr>";
for (var i = 0; i < dbSeach.length; i++) {
var en = dbSeach[i];
var idx = i + 1;
html += "<tr>";
html += "<td>" + idx + ". " + "</td>";
html += "<td><a style='color:#5053f1;' href=\"javascript:Start('" + en.WorkID + "');\" >" + en.Title + "</td>";
html += "</tr>";
}
html += "<tr>";
html += "<th colspan=3 >模版数据</th>";
html += "</tr>";
@ -65,9 +86,6 @@
var idx = i + 1;
html += "<tr>";
html += "<td>" + idx + ". " + "</td>";
if (SeachType != "0")
html += "<td><a style='color:#5053f1;' href=\"javascript:Start('" + en.WorkID + "');\" >" + en.Title + "</td>";
else
html += "<td><a href=\"javascript:Start('" + en.WorkID + "');\" >" + en.Title + "</td>";
html += "<td><a href=\"javascript:DBTemplate_DeleteDBTemplate('" + en.WorkID + "');\" >删除</a></td>";
@ -87,8 +105,9 @@
for (var i = 0; i < history.length; i++) {
var en = history[i];
var idx = i + 1;
html += "<tr>";
html += "<td>" + i + "</td>";
html += "<td>" + idx + ". " + "</td>";
html += "<td><a href=\"javascript:Start('" + en.WorkID + "');\" >" + en.Title + "</td>";
html += "<td><a href=\"javascript:AddToTemplate('" + en.WorkID + "','" + en.Title + "');\" >设置模版</a></td>";
html += "</tr>";
@ -96,6 +115,12 @@
html += "<table>";
document.getElementById("Msg").innerHTML = html;
if (dbSeach.length == 0) {
var row = document.getElementById('dbSeach');
row.style.display = 'none';
}
}
function DBTemplate_DeleteDBTemplate(workid) {

@ -112,7 +112,7 @@
var u = new WebUser();
ccs_fk_dept = u.FK_Dept;
}
$('#iframeSelectEmpsForm').attr('src', "SelectEmps.htm?FK_Dept=" + ccs_fk_dept + "&FK_Node=" + GetQueryString("FK_Node") + "&s=" + Math.random());
$('#iframeSelectEmpsForm').attr('src', "SelectEmps.htm?IsSelectMore=1&FK_Dept=" + ccs_fk_dept + "&FK_Node=" + GetQueryString("FK_Node") + "&s=" + Math.random());
$('#BtnSelectEmps').bind('click', function () { $('#selectEmpsModal').modal().show(); });
$("section").show();
@ -139,7 +139,9 @@
var data = handler.DoMethodReturnString("Shift_Save");
data = data.replace("@null", "");
if (data == "") {
alert("移交成功");
}
if (window.parent != null && window.parent.WindowCloseReloadPage != null && typeof window.parent.WindowCloseReloadPage === "function") {
window.parent.WindowCloseReloadPage(data);

Loading…
Cancel
Save