GZMachinesWeb/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp

292 lines
8.4 KiB
Plaintext
Raw Normal View History

2025-06-20 17:47:53 +08:00
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html >
<html lang="en">
<head>
2025-07-10 17:58:32 +08:00
<%@include file="../baseset.jsp" %>
<%@include file="../systemset.jsp" %>
<link rel="stylesheet" href="${bonuspath}/static/plugins/zTree/3.5/zTreeStyle.css" />
<script src="${bonuspath}/static/plugins/zTree/3.5/jquery.ztree.all.min.js"></script>
2025-07-16 18:26:36 +08:00
<script src="${bonuspath}/static/js/mobile-detect.js"></script>
2025-07-10 17:58:32 +08:00
<style type="text/css">
.orgTree {
width:100% !important;
height:500px !important;
background: none repeat scroll 0 0 #fff !important;
border:1px solid #ddd !important
}
</style>
2025-06-20 17:47:53 +08:00
</head>
<body>
<div class="page-content">
2025-07-10 17:58:32 +08:00
<div class="row-fluid">
<div class="col-xs-12">
<form id="baseForm" class="form-inline" method="POST" onsubmit="return false;">
<div class="row">
<div class="widget-main">
2025-06-20 17:47:53 +08:00
&emsp;&nbsp;<font>任务状态:</font>
2025-07-10 17:58:32 +08:00
<select id="isFinish" name="isFinishs">
<option selected="selected" value="0">待办</option>
<option value="1">已办</option>
2025-07-10 17:58:32 +08:00
</select>
<input type="text" id="keyWord" name="keyWord" placeholder="这里输入关键词" class="input-large">
<button id='searchBtn' class="btn btn-warning btn-sm" title="过滤" type="button" onclick="getbaseList(1)"><i class="icon-search bigger-110 icon-only"></i></button>
<button id='getSelectedBtn' class="btn btn-success btn-sm" title="过滤" type="button">批量审批</button>
2025-06-20 17:47:53 +08:00
</div>
2025-07-10 17:58:32 +08:00
</div>
<input type='hidden' class='pageNum' name='pageNum' value='1'/>
<input type='hidden' class='pageSize' name='pageSize' value='10'/>
2025-07-10 17:58:32 +08:00
</form>
<table id="baseTable" class="table table-striped table-bordered table-hover">
2025-07-10 17:58:32 +08:00
<thead>
<tr>
2025-07-16 14:31:33 +08:00
<th style="width:3%" class="center">
<label><input type="checkbox" class="ace" id="checkAll"><span class="lbl"></span></label>
2025-07-16 14:31:33 +08:00
</th>
<th style="width:5%" class="center hidden-480">序号</th>
2025-07-16 14:31:33 +08:00
<th style="width:25%" class="center">任务名称</th>
<th style="width:25%" class="center">创建时间</th>
<th style="width:25%" class="center">任务单号</th>
<th style="width:25%" class="center">创建人</th>
2025-07-10 17:58:32 +08:00
</tr>
</thead>
<tbody></tbody>
</table>
<div class="row">
<div class="col-sm-4">
</div>
<div class="col-sm-8">
<div id="pageing" class="dataTables_paginate paging_bootstrap">
2025-07-10 17:58:32 +08:00
<ul class="pagination"></ul>
2025-06-20 17:47:53 +08:00
</div>
2025-07-10 17:58:32 +08:00
</div>
</div>
2025-06-20 17:47:53 +08:00
<%@include file="unFinishWorkListDetails.jsp" %>
2025-07-10 17:58:32 +08:00
<%@include file="../dialog.jsp" %>
2025-06-20 17:47:53 +08:00
</div>
</div>
2025-07-10 17:58:32 +08:00
</div>
2025-06-20 17:47:53 +08:00
<script type="text/javascript">
2025-07-16 18:26:36 +08:00
// 移动端检测和跳转
$(document).ready(function() {
console.log('开始移动端检测...');
console.log('用户代理:', navigator.userAgent);
console.log('当前URL:', window.location.href);
const isMobile = MobileDetect.isMobile();
2025-07-16 18:26:36 +08:00
console.log('移动端检测结果:', isMobile);
2025-07-16 18:26:36 +08:00
if (isMobile) {
const currentUrl = window.location.href;
2025-07-16 18:26:36 +08:00
console.log('当前URL分析:', currentUrl);
2025-07-16 18:26:36 +08:00
if (currentUrl.indexOf('unFinishWorkList-mobile') !== -1) {
console.log('已在移动端页面,跳过跳转');
return;
}
const baseUrl = currentUrl.split('?')[0];
const queryParams = currentUrl.split('?')[1] || '';
let mobileUrl = baseUrl.replace('/show', '/showMobile');
2025-07-16 18:26:36 +08:00
if (queryParams) {
mobileUrl += '?' + queryParams;
}
2025-07-16 18:26:36 +08:00
console.log('准备跳转到移动端页面:', mobileUrl);
console.log('执行跳转到移动端页面');
2025-07-16 18:26:36 +08:00
setTimeout(function() {
window.location.href = mobileUrl;
}, 100);
} else {
console.log('桌面设备,不进行跳转');
}
});
2025-07-10 17:58:32 +08:00
function edit(id,definitionId){
cleanForm();
$.ajax({
type: 'POST',
url: bonuspath + '/backstage/rm/taskRecord/findUnFinishContentDetails',
data: {
2025-07-10 17:58:32 +08:00
id:id,
definitionId: definitionId
},
success: function(data) {
2025-07-10 17:58:32 +08:00
JY.Model.check("auDiv");
var list = data[0];
console.log("##########");
console.log(list);
console.log("##########");
assignment(list);
},
error: function(e) {
2025-07-10 17:58:32 +08:00
},
dataType: 'json'
2025-07-10 17:58:32 +08:00
});
}
document.addEventListener("visibilitychange", function() {
2025-07-10 17:58:32 +08:00
if (document.visibilityState === "visible") {
refreshTable();
2025-06-20 17:47:53 +08:00
}
});
2025-07-10 17:58:32 +08:00
function refreshTable() {
console.log("页面重新激活,刷新任务列表...");
getbaseList(1);
2025-07-10 17:58:32 +08:00
}
2025-07-16 14:31:33 +08:00
$(function() {
// 页面加载完成后立即获取待办列表
getbaseList(1);
// 任务状态下拉框改变事件 - 自动触发查询
$('#isFinish').change(function() {
console.log('任务状态改变为:', $(this).val());
// 重置页码到第一页
$('.pageNum').val(1);
// 自动触发查询
getbaseList(1);
// 更新按钮状态
toggleButton();
});
// 初始化按钮状态
toggleButton();
$('#getSelectedBtn').on('click', function() {
2025-07-16 14:31:33 +08:00
let selectedValues = $('.rowCheck:checked')
.map(function() {
2025-07-16 14:31:33 +08:00
return $(this).val();
}).get();
2025-07-16 14:31:33 +08:00
if(selectedValues.length == 0){
JY.Model.info("您没有选择任何内容!");
return;
}
console.log("selectedValues:", selectedValues);
$.ajax({
type: 'POST',
url: bonuspath + '/backstage/rm/taskRecord/batchApproval',
traditional: true,
data: { ids: selectedValues },
success: function(data) {
JY.Model.info("操作成功", function() {
2025-07-16 14:31:33 +08:00
getbaseList(1);
});
},
error: function(xhr) {
console.error("请求失败,状态码:", xhr.status);
console.error("响应内容:", xhr.responseText);
}
});
});
2025-07-10 17:58:32 +08:00
2025-07-16 14:31:33 +08:00
// 全选逻辑
$('#checkAll').on('click', function(e) {
e.stopPropagation();
}).on('change', function() {
2025-07-16 14:31:33 +08:00
let checked = $(this).is(':checked');
$('.rowCheck').prop('checked', checked);
});
// 行内checkbox事件处理
$(document).on('click', '.rowCheck', function(e) {
e.stopPropagation();
2025-07-16 14:31:33 +08:00
});
$(document).on('change', '.rowCheck', function() {
2025-07-16 14:31:33 +08:00
let all = $('.rowCheck').length;
let checked = $('.rowCheck:checked').length;
$('#checkAll').prop('checked', all === checked);
});
// 关键词搜索框回车事件
2025-07-10 17:58:32 +08:00
$("#keyWord").keydown(function(e) {
var keycode = e.which || e.keyCode;
2025-07-10 17:58:32 +08:00
if (keycode == 13) {
search();
}
});
2025-06-20 17:47:53 +08:00
// 搜索按钮点击事件
$('#searchBtn').on('click', function() {
search();
});
});
2025-07-16 14:31:33 +08:00
function toggleButton() {
var value = $('#isFinish').val();
if (value === '1') {
$('#getSelectedBtn').prop('disabled', true).addClass('disabled');
2025-07-16 14:31:33 +08:00
} else {
$('#getSelectedBtn').prop('disabled', false).removeClass('disabled');
2025-07-16 14:31:33 +08:00
}
}
function search() {
$('.pageNum').val(1);
getbaseList(1);
2025-06-20 17:47:53 +08:00
}
2025-07-10 17:58:32 +08:00
function getbaseList(init) {
var isFinish = $("#isFinish").val();
var data = {pageNum: init, pageSize: 10};
2025-07-10 17:58:32 +08:00
var keyWord = $("#keyWord").val();
2025-07-10 17:58:32 +08:00
if(JY.Object.notNull(keyWord)){
data.keyWord = keyWord;
2025-06-20 17:47:53 +08:00
}
// 更新隐藏的页码输入框
$('.pageNum').val(init);
2025-07-10 17:58:32 +08:00
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);
2025-07-10 17:58:32 +08:00
$("#baseTable tbody").html(data);
JY.Model.loadingClose();
// 查询完成后更新按钮状态
toggleButton();
2025-07-10 17:58:32 +08:00
},
error: function(data) {
2025-07-10 17:58:32 +08:00
console.log("ajax请求错误!");
JY.Model.loadingClose();
2025-07-10 17:58:32 +08:00
}
});
2025-07-10 17:58:32 +08:00
}
2025-07-10 17:58:32 +08:00
function cleanForm() {
$("#auForm input[id$='unitName']").val("");
$("#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) {
2025-07-10 17:58:32 +08:00
$("#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);
$("#auForm input[id$='holdingTime']").val(data.holdingTime);
$("#auForm input[id$='operaTionName']").val(data.operaTionName);
}
</script>
2025-06-20 17:47:53 +08:00
</body>
</html>