From 1c784481c0a74074216be91ddfc3332517276332 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Thu, 4 Dec 2025 10:40:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E5=8A=9E=E4=BB=BB=E5=8A=A1=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E9=80=89=E6=8B=A9=E5=90=8E=E8=87=AA=E5=8A=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/rm/unFinishWorkList.jsp | 178 +++++++++--------- 1 file changed, 91 insertions(+), 87 deletions(-) diff --git a/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp b/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp index 5306a4d..6b28e46 100644 --- a/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp +++ b/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp @@ -26,32 +26,28 @@
  任务状态: - - - + + +
- + - +
- - + - @@ -60,13 +56,11 @@
- -
+
    - <%@include file="unFinishWorkListDetails.jsp" %> <%@include file="../dialog.jsp" %> @@ -78,34 +72,30 @@ console.log('开始移动端检测...'); console.log('用户代理:', navigator.userAgent); console.log('当前URL:', window.location.href); - - // 检测移动端并跳转 + const isMobile = MobileDetect.isMobile(); console.log('移动端检测结果:', isMobile); - + if (isMobile) { const currentUrl = window.location.href; console.log('当前URL分析:', currentUrl); - - // 避免无限重定向 - 检查是否已经在移动端页面 + if (currentUrl.indexOf('unFinishWorkList-mobile') !== -1) { console.log('已在移动端页面,跳过跳转'); return; } - - // 构建移动端页面URL - const baseUrl = currentUrl.split('?')[0]; // 去掉查询参数 - const queryParams = currentUrl.split('?')[1] || ''; // 保留查询参数 - - // 将 show 替换为 showMobile + + const baseUrl = currentUrl.split('?')[0]; + const queryParams = currentUrl.split('?')[1] || ''; + let mobileUrl = baseUrl.replace('/show', '/showMobile'); if (queryParams) { mobileUrl += '?' + queryParams; } - + console.log('准备跳转到移动端页面:', mobileUrl); console.log('执行跳转到移动端页面'); - + setTimeout(function() { window.location.href = mobileUrl; }, 100); @@ -117,45 +107,60 @@ function edit(id,definitionId){ cleanForm(); $.ajax({ - type : 'POST', - url : bonuspath + '/backstage/rm/taskRecord/findUnFinishContentDetails', - data : { + type: 'POST', + url: bonuspath + '/backstage/rm/taskRecord/findUnFinishContentDetails', + data: { id:id, definitionId: definitionId }, - success : function(data) { + success: function(data) { JY.Model.check("auDiv"); var list = data[0]; console.log("##########"); console.log(list); - console.log("##########"); assignment(list); }, - error : function(e) { + error: function(e) { }, - dataType : 'json' + dataType: 'json' }); } - document.addEventListener("visibilitychange", function () { + document.addEventListener("visibilitychange", function() { if (document.visibilityState === "visible") { - refreshTable(); // 页面激活时刷新表格 + refreshTable(); } }); function refreshTable() { console.log("页面重新激活,刷新任务列表..."); - getbaseList(1); // 重新请求表格数据 + getbaseList(1); } $(function() { - // 获取所有选中的 value(你可以绑定按钮触发) - $('#getSelectedBtn').on('click', function () { + // 页面加载完成后立即获取待办列表 + getbaseList(1); + + // 任务状态下拉框改变事件 - 自动触发查询 + $('#isFinish').change(function() { + console.log('任务状态改变为:', $(this).val()); + // 重置页码到第一页 + $('.pageNum').val(1); + // 自动触发查询 + getbaseList(1); + // 更新按钮状态 + toggleButton(); + }); + + // 初始化按钮状态 + toggleButton(); + + $('#getSelectedBtn').on('click', function() { let selectedValues = $('.rowCheck:checked') - .map(function () { + .map(function() { return $(this).val(); - }).get(); // 转为数组 + }).get(); if(selectedValues.length == 0){ JY.Model.info("您没有选择任何内容!"); return; @@ -168,95 +173,95 @@ traditional: true, data: { ids: selectedValues }, success: function(data) { - JY.Model.info("操作成功",function () { + JY.Model.info("操作成功", function() { getbaseList(1); }); - }, error: function(xhr) { console.error("请求失败,状态码:", xhr.status); console.error("响应内容:", xhr.responseText); } }); - - }); - getbaseList(1); - $(document).ready(function () { - // 下拉框改变时监听 - $('#isFinish').change(function () { - toggleButton(); - }); - $('.rowCheck').prop('checked', false); // 取消所有 rowCheck 的选中状态 - $('#checkAll').prop('checked', false); // 如果你还有全选框,也一并清除 - }); // 全选逻辑 - $('#checkAll').on('click', function (e) { - e.stopPropagation(); // ✅ 阻止冒泡 - }).on('change', function () { + $('#checkAll').on('click', function(e) { + e.stopPropagation(); + }).on('change', function() { let checked = $(this).is(':checked'); $('.rowCheck').prop('checked', checked); }); - // 行内 checkbox:阻止冒泡 + 同步全选框 - $(document).on('click', '.rowCheck', function (e) { - e.stopPropagation(); // ✅ 阻止冒泡 + // 行内checkbox事件处理 + $(document).on('click', '.rowCheck', function(e) { + e.stopPropagation(); }); - // 如果所有行都被勾选了,全选框也自动勾选;否则取消 - $(document).on('change', '.rowCheck', function () { + + $(document).on('change', '.rowCheck', function() { let all = $('.rowCheck').length; let checked = $('.rowCheck:checked').length; $('#checkAll').prop('checked', all === checked); }); + + // 关键词搜索框回车事件 $("#keyWord").keydown(function(e) { - keycode = e.which || e.keyCode; + var keycode = e.which || e.keyCode; if (keycode == 13) { search(); } }); - }); + // 搜索按钮点击事件 + $('#searchBtn').on('click', function() { + search(); + }); + }); function toggleButton() { var value = $('#isFinish').val(); if (value === '1') { - $('#getSelectedBtn').prop('disabled', true); // 禁用按钮 + $('#getSelectedBtn').prop('disabled', true).addClass('disabled'); } else { - $('#getSelectedBtn').prop('disabled', false); // 启用按钮 + $('#getSelectedBtn').prop('disabled', false).removeClass('disabled'); } } - function search(){ - $("#search").trigger("click"); + function search() { + $('.pageNum').val(1); + getbaseList(1); } function getbaseList(init) { - var isFinish =$("#isFinish").val(); - var data = {pageNum:init}; - data = {pageNum:init,pageSize:10 }; + var isFinish = $("#isFinish").val(); + var data = {pageNum: init, pageSize: 10}; var keyWord = $("#keyWord").val(); - console.log("keyw=",keyWord); + if(JY.Object.notNull(keyWord)){ data.keyWord = keyWord; } - data = Object.assign(data,obj); + + // 更新隐藏的页码输入框 + $('.pageNum').val(init); + JY.Model.loading(); $.ajax({ - type:"POST", - url:bonuspath +'/backstage/rm/taskRecord/findUnFinishContent?isFinish='+isFinish, - data: JSON.stringify(data ), - dataType:"html", - contentType:"application/json", - success:function(data){ - $('#checkAll').prop('checked', false); // 如果你还有全选框,也一并清除 + type: "POST", + url: bonuspath + '/backstage/rm/taskRecord/findUnFinishContent?isFinish=' + isFinish, + data: JSON.stringify(data), + dataType: "html", + contentType: "application/json", + success: function(data) { + $('#checkAll').prop('checked', false); $("#baseTable tbody").html(data); JY.Model.loadingClose(); + // 查询完成后更新按钮状态 + toggleButton(); }, - error:function(data){ + error: function(data) { console.log("ajax请求错误!"); + JY.Model.loadingClose(); } - }) + }); } function cleanForm() { @@ -264,19 +269,18 @@ $("#auForm input[id$='projectName']").val(""); $("#auForm input[id$='taskName']").val(""); $("#auForm input[id$='agreementCode']").val(""); - $("#auForm input[id$='personName']").val(""); $("#auForm input[id$='createTime']").val(""); $("#auForm input[id$='testLoad']").val(""); $("#auForm input[id$='holdingTime']").val(""); $("#auForm input[id$='operaTionName']").val(""); } - function assignment(data){ + + function assignment(data) { $("#auForm input[id$='unitName']").val(data.unitName); $("#auForm input[id$='projectName']").val(data.projectName); $("#auForm input[id$='taskName']").val(data.taskName); $("#auForm input[id$='agreementCode']").val(data.agreementCode); - $("#auForm input[id$='personName']").val(data.personName); $("#auForm input[id$='createTime']").val(data.createTime); $("#auForm input[id$='testLoad']").val(data.testLoad);
    - + 序号序号 任务名称 创建时间 任务单号 创建人