Browse Source

新增:已办页面,新增查询调用消息提醒。

dev
zhangsiqi 1 month ago
parent
commit
b08a1d4e1b
  1. 21
      ruoyi-activiti/src/main/java/com/ruoyi/process/todoitem/controller/BizTodoItemController.java
  2. 166
      ruoyi-admin/src/main/java/com/ruoyi/remind/controller/RemindController.java
  3. 299
      ruoyi-admin/src/main/resources/templates/index.html
  4. 170
      ruoyi-admin/src/main/resources/templates/process/todoitem/doneitem.html
  5. 74
      ruoyi-admin/src/main/resources/templates/process/todoitem/todoList.html
  6. 111
      ruoyi-admin/src/main/resources/templates/process/todoitem/todoitem.html

21
ruoyi-activiti/src/main/java/com/ruoyi/process/todoitem/controller/BizTodoItemController.java

@ -9,10 +9,14 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.process.leave.domain.BizLeaveVo;
import com.ruoyi.process.leave.service.IBizLeaveService;
import com.ruoyi.process.todoitem.domain.BizTodoItem;
import com.ruoyi.process.todoitem.service.IBizTodoItemService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -42,6 +46,9 @@ public class BizTodoItemController extends BaseController {
// @Autowired
// private IBizLeaveService bizLeaveService;
@Autowired
private IBizLeaveService bizLeaveService;
@Autowired
private TaskService taskService;
@ -70,11 +77,11 @@ public class BizTodoItemController extends BaseController {
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
// String processInstanceId = task.getProcessInstanceId();
// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
// BizLeaveVo bizLeave = bizLeaveService.selectBizLeaveById(new Long(processInstance.getBusinessKey()));
// mmap.put("bizLeave", bizLeave);
//// BizLeaveVo bizLeave = bizLeaveService.selectBizLeaveById(new Long(processInstance.getBusinessKey()));
//// mmap.put("bizLeave", bizLeave);
// mmap.put("taskId", taskId);
//// String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
// return "process/" + module + "/" + formPageName;
// String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
// return prefix + "/task" + verifyName;
// }
@RequiresPermissions("process:todoitem:view")
@ -283,10 +290,4 @@ public class BizTodoItemController extends BaseController {
result.put("total", total);
return result;
}
}

166
ruoyi-admin/src/main/java/com/ruoyi/remind/controller/RemindController.java

@ -1,13 +1,27 @@
package com.ruoyi.remind.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.remind.domain.Remind;
import com.ruoyi.remind.mapper.RemindMapper;
import com.ruoyi.remind.service.RemindService;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -16,23 +30,147 @@ import java.util.Map;
* Created by sunzhenhu on 2021/5/28 10:52
*/
@RequestMapping("/remind")
public class RemindController {
@Controller
public class RemindController extends BaseController {
Logger logger = LoggerFactory.getLogger(getClass());
private String prefix = "remind";
@Autowired
private RemindService remindService;
// @Autowired
// private RemindMapper remindMapper;
@RequestMapping("/getRemindListNoPaging")
@ResponseBody
public List<Remind> getRemindListNoPaging(HttpServletRequest request) {
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put("receiver", ShiroUtils.getLoginName());
paraMap.put("isView", "0");
List<Remind> list = remindService.getRemindListNoPaging(paraMap);
return list;
}
@Autowired
private SysUserMapper userMapper;
@Autowired
private RemindMapper remindMapper;
@GetMapping()
public String remind(ModelMap mmap) {
mmap.put("currentUser", ShiroUtils.getSysUser());
return prefix + "/remind";
}
@GetMapping("/view/{id}")
public String edit(@PathVariable("id")String id, ModelMap mmap) {
System.out.println("id="+id);
mmap.put("id",id);
return prefix + "/view";
}
//
@RequestMapping("/getRemindList")
@ResponseBody
public Map<String, Object> getRemindList(Integer pageIndex, Integer pageSize, HttpServletRequest request) {
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Map<String, Object> paraMap = new HashMap<String, Object>();
// 分页参数
paraMap.put("pageIndex", pageIndex);
paraMap.put("pageSize", pageSize);
// 查询参数
String fromBegin = request.getParameter("fromBegin");
String toEnd = request.getParameter("toEnd");
String vague = request.getParameter("vague");
paraMap.put("fromBegin", fromBegin);
paraMap.put("toEnd", toEnd);
paraMap.put("vague", vague);
if (!SysUser.isAdmin(ShiroUtils.getUserId())) {
paraMap.put("receiver",ShiroUtils.getLoginName());
}
Map<String, Object> result = new HashMap<String, Object>();
List<Remind> list = remindService.getRemindList(paraMap);
for(Remind remind:list) {
SysUser remindUser = userMapper.selectUserByLoginName(remind.getRemind());
remind.setRemindName(remindUser.getUserName());
remind.setRemindDeptName(remindUser.getDept().getDeptName());
SysUser receiver = userMapper.selectUserByLoginName(remind.getReceiver());
remind.setReceiverName(receiver.getUserName());
}
long total = remindService.getRemindTotal(paraMap);
result.put("rows", list);
result.put("total", total);
return result;
}
@RequestMapping("/getRemindListNoPaging")
@ResponseBody
public List<Remind> getRemindListNoPaging(HttpServletRequest request) {
startPage();
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put("receiver",ShiroUtils.getLoginName());
paraMap.put("isView", "0");
paraMap.put("pageIndex", 1);
paraMap.put("pageSize", 11);
List<Remind> list = remindService.getRemindListNoPaging(paraMap);
return list;
}
}
// 结账资料申请单(浦东)主表查询单个对象
@RequestMapping("/getRemind")
@ResponseBody
public Remind getRemind(HttpServletRequest request) {
String id = request.getParameter("id");
Remind mc = remindService.getRemind(id);
SysUser remindUser = userMapper.selectUserByLoginName(mc.getRemind());
mc.setRemindName(remindUser.getUserName());
mc.setRemindDeptName(remindUser.getDept().getDeptName());
return mc;
}
//添
@RequestMapping("/edit")
@ResponseBody
public String edit(HttpServletRequest request) {
String id = request.getParameter("id");
String loginName = ShiroUtils.getLoginName();
Remind remind = remindService.getRemind(id);
if(remind.getReceiver().equals(loginName)) {
Remind remind2 = new Remind();
remind2.setId(Long.parseLong(id));
remind2.setIsView("1");
remindService.edit(remind2);
}
return "success";
}
/**
* 发票申请单 综合管理部节点推送消息给维保部负责人
* @param request
* @return
*/
@RequestMapping("/sendInvoiceRemind")
@ResponseBody
public Map<String,Object> sendInvoiceRemind(HttpServletRequest request){
Map<String,Object> result = new HashMap<String,Object>();
String msg = "";
String gmUserId = request.getParameter("gmUserId");
String keyNo = request.getParameter("keyNo");
String companyNames = request.getParameter("companyNames");
String formName = "发票申请单";
Integer remindCount = remindMapper.getRemindCountByCondi(formName, keyNo);
if(remindCount>0) {
msg = "这笔发票申请单的提醒已推送过维保部负责人,无法重复推送!";
}else {
Remind remind = new Remind();
remind.setRemind(gmUserId);
String wbDeptLeaderId = userMapper.selectUserByUniqueRolekey("wbDeptLeader");
remind.setReceiver(wbDeptLeaderId);
SysUser finance = userMapper.selectUserByLoginName(gmUserId);
remind.setRemindDept(finance.getDeptId()+"");
remind.setRemindDate(DateUtils.getTime());
remind.setFormUrl("invoiceForm/edit/" + keyNo);
remind.setFormName(formName);
remind.setRemindContent("公司名称为["+companyNames+"]的这些公司的发票到了,请来我这里拿发票!!!");
remind.setIsView("0");
int add = remindService.add(remind);
if(add<1) {
msg = "提醒推送失败,请联系系统管理员!";
}else {
msg = "提醒推送成功!";
}
}
result.put("msg", msg);
return result;
}
}

299
ruoyi-admin/src/main/resources/templates/index.html

@ -9,7 +9,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <link th:href="@{favicon.ico}" rel="shortcut icon"/>-->
<link rel="icon" href="../static/img/favicon.ico" type="image/x-icon" th:href="@{/img/favicon.ico}">
<link href="/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/bootstrapv4/bootstrap.min.css" th:href="@{/css/bootstrapv4/bootstrap.min.css}"
rel="stylesheet"/>
<link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
@ -142,7 +141,7 @@
<div class="noti-head">
<h6 class="d-inline-block m-b-0">待办任务</h6>
<div class="float-right">
<h8>你有<strong id="todoSize"></strong>任务</h8>
<h6>你有<strong id="todoSize"></strong>任务</h6>
<!-- <a href="javascript:;" onclick="viewAllTasks();">查看全部</a>-->
</div>
</div>
@ -151,7 +150,7 @@
<!-- <li class="n-title"><p class="m-b-0">更早时候</p></li>-->
</ul>
<div class="noti-footer">
<a href="javascript:" onclick="viewAllTasks();">查看全部</a>
<a href="javascript:">查看全部</a>
</div>
</div>
</div>
@ -168,16 +167,15 @@
<div class="float-right">
<h8>你有<strong id="remindSize"></strong>提醒</h8>
<!-- <a href="javascript:" class="m-r-10">已读</a>-->
<!-- <a href="javascript:">清除全部</a>-->
</div>
</div>
<ul class="noti-body" id="remindList">
<ul class="noti-body" id="remindList" style="height: 300px;overflow-y: scroll">
<li class="n-title"><p class="m-b-0">新的提醒</p></li>
<!-- <li class="n-title"><p class="m-b-0">更早之前</p></li>-->
</ul>
<div class="noti-footer">
<a href="javascript:">查看全部</a>
<a href="/remind"><i class="feather icon-bell"></i>查看全部</a>
</div>
</div>
</div>
@ -199,11 +197,11 @@
</div>
<ul class="pro-body">
<!--<li><a href="javascript:" class="dropdown-item menuItem"><i class="feather icon-settings"></i>个人中心</a></li>-->
<li><a href="javascript:" onclick="viewMyProfile()" class="dropdown-item menuItem"><i class="feather icon-user"></i>个人中心</a></li>
<li><a href="javascript:" onclick="viewAllRequestItem()" class="dropdown-item menuItem"><i class="feather icon-mail"></i>我的请求</a></li>
<li><a href="javascript:" onclick="viewAllRemind()" class="dropdown-item menuItem"><i class="feather icon-bell"></i>我的提醒</a></li>
<li><a href="javascript:;" onclick="viewAllTasks()" class="dropdown-item menuItem" id="todoBadge2"><i class="feather icon-rocket"></i>我的待办</a></li>
<li><a href="javascript:;" onclick="viewAllDoneTasks()" class="dropdown-item menuItem" id="todoBadge3"><i class="feather icon-rocket"></i>我的已办</a></li>
<li><a href="/system/user/profile" class="dropdown-item menuItem"><i class="feather icon-user"></i>个人中心</a></li>
<li><a href="/process/requestitem" class="dropdown-item menuItem"><i class="feather icon-mail"></i>我的请求</a></li>
<li><a href="/remind" class="dropdown-item menuItem"><i class="feather icon-bell"></i>我的提醒</a></li>
<li><a href="/process/todoitem" class="dropdown-item menuItem" id="todoBadge2"><i class="fa fa-rocket"></i>我的待办</a></li>
<li><a href="/process/doneitem" class="dropdown-item menuItem" id="todoBadge3"><i class="fa fa-fighter-jet"></i>我的已办</a></li>
</ul>
</div>
</div>
@ -259,9 +257,9 @@
<script th:src="@{/js/pcoded.min.js}"></script>
<script th:src="@{/ruoyi/index.js?v=20201208}"></script>
<script th:inline="javascript">var loginName = [[${user.loginName}]]</script>
<script th:inline="javascript">var ctx = [[@{/}]];</script>
<script th:inline="javascript">
window.history.forward(1);
var ctx = [[@{/}]];
var lockscreen = [[${session.lockscreen}]];
if (lockscreen) {window.top.location = ctx + "lockscreen";}
// 皮肤缓存
@ -441,252 +439,6 @@
})
}
//解决frame高度问题
function reinitIframe() {
var iframe = document.getElementById("erpFrame");
try {
//var bHeight = iframe.contentWindow.document.body.scrollHeight;
/* var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = height; */
// iframe.height = bHeight;
/* var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
if (iframeWin.document.body) {
iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
} */
//var bHeight = iframe.contentWindow.document.body.scrollHeight;
//var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
//var height = Math.min(bHeight, dHeight);
//iframe.height = height;
//iframe.height = iframe.document.body.scrollHeight;
//该方法有白边
/* var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.min(bHeight, dHeight);
iframe.height = height+50; */
/* var idoc = iframe.contentWindow && iframe.contentWindow.document || iframe.contentDocument;
var iheight = Math.min(idoc.body.scrollHeight, idoc.documentElement.scrollHeight); //取得其高
iframe.height = iheight+50; */
//有多余部分出现
// iframe.height=document.documentElement.clientHeight;
//显示不全
//iframe.height = iframe.document.body.scrollHeight;
//有多余部分出现
/* var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
if (iframeWin.document.body) {
iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
} */
//显示不全
/* if (document.getElementById)
{
if (iframe && !window.opera)
{
if (iframe.contentDocument && iframe.contentDocument.body.offsetHeight)
iframe.height = iframe.contentDocument.body.offsetHeight;
else if(iframe.Document && iframe.Document.body.scrollHeight)
iframe.height = iframe.Document.body.scrollHeight;
}
} */
/* alert(iframe.contentWindow.document.documentElement.scrollHeight);
alert(iframe.contentDocument.body.offsetHeight);
alert(iframe.contentWindow.document.body.scrollHeight); */
} catch (ex) {
}
}
//下拉项设置
$('.menuItem').click(function () {
var dataUrl = $(this).attr('href');
var itemText = $(this).text();
//console.log(dataUrl);
//console.log(itemText);
//设置frame路径
$('#erpFrame').attr("src", dataUrl);
//取消悬浮
$('.menu-dropdown').removeClass('open');
//修改导航条下面的内容
$('.page-title').find("h1").html(itemText + "<small></small>");
//修改菜单选中
//清除选中
clearActive();
//清除面包屑
$('.page-breadcrumb>li').remove();
//设置选中
$(this).parent().addClass("active");
//alert($(this).parent().parent().parent("li").length);
if ($(this).parent().parent().parent("li").length != 0) {
$(this).parent().parent().parent().addClass("active");
if ($(this).parent().parent().parent().parent().parent("li").length != 0) {
$(this).parent().parent().parent().parent().parent().addClass("active");
//alert($(this).parent().parent().parent().children("a").text().trim());
if ($(this).parent().parent().parent().parent().parent().parent().parent("li").length != 0) {
$(this).parent().parent().parent().parent().parent().parent().parent().addClass("active");
/* $('.page-breadcrumb').append(
'<li><a href='+ctx+'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">'
+ $(this).parent().parent().parent().parent().parent().children("a").text().trim() + '</a> <i class="fa fa-circle"></i></li><li class="active">'
+ itemText + '</li>'); */
$('.page-breadcrumb').append(
'<li><a href=' + ctx + 'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">'
+ $(this).parent().parent().parent().parent().parent().parent().parent().children("a").text().trim() + '</a> <i class="fa fa-circle"></i></li><li><a href="#">'
+ $(this).parent().parent().parent().parent().parent().children("a").text().trim() + '</a> <i class="fa fa-circle"></i></li><li><a href="#">'
+ $(this).parent().parent().parent().children("a").text().trim() + '</a> <i class="fa fa-circle"></i></li><li class="active">'
+ itemText + '</li>');
} else {
$('.page-breadcrumb').append(
'<li><a href=' + ctx + 'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">'
+ $(this).parent().parent().parent().parent().parent().children("a").text().trim() + '</a> <i class="fa fa-circle"></i></li><li><a href="#">'
+ $(this).parent().parent().parent().children("a").text().trim() + '</a> <i class="fa fa-circle"></i></li><li class="active">'
+ itemText + '</li>');
}
} else {
$('.page-breadcrumb').append(
'<li><a href=' + ctx + 'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">'
+ $(this).parent().parent().parent().children("a").text().trim() + '</a> <i class="fa fa-circle"></i></li><li class="active">'
+ itemText + '</li>');
}
} else {
//home和自己
$('.page-breadcrumb').append('<li><a href=' + ctx + 'index>Home</a><i class="fa fa-circle"></i></li><li class="active">' + itemText + '</li>');
}
$(".page-header .menu-toggler").click();
return false;
})
//查看所有待办任务
function viewAllTasks() {
//控制iframe跳转
$('#erpFrame').attr("src", ctx + "process/todoitem");
$('.page-title').find("h1").html("我的待办" + "<small></small>");
//清除面包屑
$('.page-breadcrumb>li').remove();
$('.page-breadcrumb').append(
'<li>' +'<a href=' + ctx + 'index' + '>Home</a><i class="fa fa-circle"></i></li>' +
' <li>' +'<a href="#">我的待办</a> ' +' <i class= "fa fa-circle"></i>' +'</li>' +'<li class="active">我的待办</li>'
);
//清除选中
clearActive();
//控制选中
/* $('#flowManager').addClass("active");
$('#myTodoParent').addClass("active");
$('#myTodo').addClass("active");*/
}
//查看所有提醒
function viewAllRemind() {
//控制iframe跳转
$('#erpFrame').attr("src", ctx + "remind");
$('.page-title').find("h1").html("我的提醒" + "<small></small>");
//清除面包屑
$('.page-breadcrumb>li').remove();
$('.page-breadcrumb').append(
'<li><a href=' + ctx + 'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">我的提醒</a> <i class="fa fa-circle"></i></li><li class="active">我的提醒</li>');
//清除选中
clearActive();
//控制选中
$('#flowManager').addClass("active");
$('#myRemindParent').addClass("active");
$('#myRemind').addClass("active");
}
//所需单据绑定回车键
$('#allSearch').bind('keydown', function (event) {
if (event.keyCode == "13") {
viewAllselect();
}
});
//查看所有提醒
function viewAllselect() {
//控制iframe跳转
var value = $('#allSearch').val();
$('#erpFrame').attr("src", ctx + "remind/");
$('.page-title').find("h1").html("我的提醒" + "<small></small>");
//清除面包屑
$('.page-breadcrumb>li').remove();
$('.page-breadcrumb').append(
'<li><a href='+ctx+'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">我的提醒</a> <i class="fa fa-circle"></i></li><li class="active">我的提醒</li>');
//清除选中
clearActive();
//控制选中
/*$('#flowManager').addClass("active");
$('#myRemindParent').addClass("active");
$('#myRemind').addClass("active"); */
}
//查看个人资料
function viewMyProfile() {
//控制iframe跳转
$('#erpFrame').attr("src", ctx + "system/user/profile");
$('.page-title').find("h1").html("我的个人资料" + "<small></small>");
//清除面包屑
$('.page-breadcrumb>li').remove();
$('.page-breadcrumb').append(
'<li><a href=' + ctx + 'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">我的个人资料</a> <i class="fa fa-circle"></i></li><li class="active">我的个人资料</li>');
//清除选中
clearActive();
}
//新建流程
//我的请求
function viewAllRequestItem() {
//控制iframe跳转
$('#erpFrame').attr("src", ctx + "process/requestitem");
$('.page-title').find("h1").html("我的请求" + "<small></small>");
//清除面包屑
$('.page-breadcrumb>li').remove();
$('.page-breadcrumb').append(
'<li><a href=' + ctx + 'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">我的请求</a> <i class="fa fa-circle"></i></li><li class="active">我的请求</li>');
//清除选中
clearActive();
//控制选中
/*$('#flowManager').addClass("active");
$('#myTodoParent').addClass("active");
$('#myTodo').addClass("active");*/
}
//我的已办
function viewAllDoneTasks() {
//控制iframe跳转
$('#erpFrame').attr("src", ctx + "process/doneitemView");
$('.page-title').find("h1").html("我的已办" + "<small></small>");
//清除面包屑
$('.page-breadcrumb>li').remove();
$('.page-breadcrumb').append(
'<li><a href=' + ctx + 'index>Home</a><i class="fa fa-circle"></i></li><li><a href="#">我的已办</a> <i class="fa fa-circle"></i></li><li class="active">我的已办</li>');
//清除选中
clearActive();
//控制选中
/*$('#flowManager').addClass("active");
$('#myTodoParent').addClass("active");
$('#myTodo').addClass("active");*/
}
//清除选中
function clearActive() {
$('.menuItem').parent().removeClass("active");
if ($('.menuItem').parent().parent().parent("li").length != 0) {
$('.menuItem').parent().parent().parent().removeClass("active");
if ($('.menuItem').parent().parent().parent().parent().parent("li").length != 0) {
$('.menuItem').parent().parent().parent().parent().parent().removeClass("active");
if ($('.menuItem').parent().parent().parent().parent().parent().parent().parent("li").length != 0) {
$('.menuItem').parent().parent().parent().parent().parent().parent().parent().removeClass("active");
}
}
}
}
// 计算耗时
function transDate(todoTime) {
date = new Date(todoTime);
@ -716,37 +468,6 @@
}
return result;
}
$('#todoItemList').on('click', 'li', function (e) {
var dataUrl = $(this).children('a').attr('href');
//console.log(aa);
$('#erpFrame').attr("src", dataUrl);
return false;
});
$('#remindList').on('click', 'li', function (e) {
var dataUrl = $(this).children('a').attr('href');
//console.log(aa);
$('#erpFrame').attr("src", dataUrl);
return false;
});
$(".notification").on("click", function () {
let id = $(this).val();
$.ajax({
url: ctx + "remind/getRemindListNoPaging",
type: "post",
dataType: "json",
data: {"id": id},
success: function (resp) {
$("li[value='"+id+"']").css("display","none")
},
error: function () {
$.modal.msgError("出错了!");
}
})
})
</script>
</body>
</html>

170
ruoyi-admin/src/main/resources/templates/process/todoitem/doneitem.html

@ -0,0 +1,170 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('已办事项列表')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<p>事项标题:</p>
<input type="text" name="itemName"/>
</li>
<li>
<p>模块名称:</p>
<input type="text" name="module"/>
</li>
<li>
<p>任务 ID:</p>
<input type="text" name="taskId"/>
</li>
<li>
<p>任务名称:</p>
<input type="text" name="taskName"/>
</li>
<li>
<p>待办人 ID:</p>
<input type="text" name="todoUserId"/>
</li>
<li>
<p>待办人名称:</p>
<input type="text" name="todoUserName"/>
</li>
<li>
<p>处理人 ID:</p>
<input type="text" name="handleUserId"/>
</li>
<li>
<p>处理人名称:</p>
<input type="text" name="handleUserName"/>
</li>
<li class="select-time">
<p>通知时间:</p>
<input type="text" class="time-input" id="todoItemStartTime" placeholder="开始时间" name="params[todoItemStartTime]"/>
<span>-</span>
<input type="text" class="time-input" id="todoItemEndTime" placeholder="结束时间" name="params[todoItemEndTime]"/>
</li>
<li class="select-time">
<p>处理时间:</p>
<input type="text" class="time-input" id="handleStartTime" placeholder="开始时间" name="params[handleStartTime]"/>
<span>-</span>
<input type="text" class="time-input" id="handleEndTime" placeholder="结束时间" name="params[handleEndTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="process:todoitem:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('process:todoitem:edit')}]];
var removeFlag = [[${@permission.hasPermi('process:todoitem:remove')}]];
var prefix = ctx + "process/todoitem";
$(function() {
var options = {
url: prefix + "/doneList",
exportUrl: prefix + "/doneExport",
modalName: "已办事项",
columns: [{
checkbox: true
},
{
field : 'id',
title : '主键 ID',
visible: false
},
{
field : 'itemName',
title : '事项标题'
},
{
field : 'itemContent',
title : '事项内容'
},
{
field : 'module',
title : '模块名称'
},
{
field : 'taskId',
title : '任务 ID'
},
{
field : 'taskName',
title : '任务名称'
},
{
field : 'isView',
title : '是否查看'
},
{
field : 'isHandle',
title : '是否处理'
},
{
field : 'todoUserId',
title : '待办人ID'
},
{
field : 'todoUserName',
title : '待办人名称'
},
{
field : 'handleUserId',
title : '处理人ID'
},
{
field : 'handleUserName',
title : '处理人名称'
},
{
field : 'todoTime',
title : '通知时间'
},
{
field : 'handleTime',
title : '处理时间'
},
{
field: 'nodeName',
title: '已办任务名称',
align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
}/*,
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i> 查看</a> ');
return actions.join('');
}
}*/]
};
$.table.init(options);
});
</script>
</body>
</html>

74
ruoyi-admin/src/main/resources/templates/process/todoitem/todoList.html

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('时间轴')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div th:if="${#lists.isEmpty(todoItemList)}" style="text-align: center; height: 500px; line-height: 500px;">暂无任务</div>
<div th:unless="${#lists.isEmpty(todoItemList)}" class="row animated fadeInRight">
<div class="ibox float-e-margins">
<div id="ibox-content">
<div id="vertical-timeline" class="vertical-container light-timeline">
<div th:each="todoItem: ${todoItemList}" class="vertical-timeline-block">
<div class="vertical-timeline-icon navy-bg">
<i class="fa fa-file-text"></i>
</div>
<div class="vertical-timeline-content">
<h2>【[[${ todoItem.nodeName }]]】[[${ todoItem.itemName }]]</h2>
<p>[[${ todoItem.itemContent }]]
</p>
<a href="javascript:void(0)" class="btn btn-sm btn-primary" th:onclick="showVerifyDialog([[${todoItem.taskId}]], [[${todoItem.module}]], [[${todoItem.taskName}]], [[${todoItem.nodeName}]])"> 办理</a>
<span class="vertical-date">
<!--今天--><!--<span id="todoTimeSpan" th:text="${#dates.format(todoItem.todoTime, 'yyyy-MM-dd HH:mm:ss')}"></span>--> <br>
<small th:text="${#dates.format(todoItem.todoTime, 'yyyy-MM-dd HH:mm:ss')}"></small>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var prefix = ctx + "process/todoitem";
function showVerifyDialog(taskId, module, pageName, nodeName) {
var url = prefix + "/showVerifyDialog/" + taskId + "?module=" + module + "&formPageName=" + pageName;
$.modal.open(nodeName, url);
}
function transDate() {
var $time =document.getElementById("todoTimeSpan");
var date = $time.innerHTML.trim();
date = new Date(date);
var tt = date;
var days = parseInt((new Date().getTime() - date) / 86400000);
var today = new Date().getDate();
var year = tt.getFullYear();
var mouth = tt.getMonth() + 1;
var day = tt.getDate();
var time = tt.getHours() < 10 ? "0" + tt.getHours() : tt.getHours();
var min = tt.getMinutes() < 10 ? "0" + tt.getMinutes() : tt.getMinutes();
var result, offset;
offset = Math.abs(today - day);
if (days < 4&&offset<4) {
if (offset === 0) {
result = "今天" + time + ":" + min;
} else if (offset === 1) {
result = "昨天" + time + ":" + min;
} else if (offset === 2) {
result = "前天" + time + ":" + min;
} else if (offset === 2) {
result = "3天前" + time + ":" + min;
}
} else {
// result = year + "-" + mouth + "-" + day + " " + time + ":" + min;
result = "3天以前";
}
$time.innerHTML = result;
}
</script>
</body>
</html>

111
ruoyi-admin/src/main/resources/templates/process/todoitem/todoitem.html

@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('待办事项列表')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li><p>事项标题:</p><input type="text" name="itemName"/></li>
<li><p>模块名称:</p><input type="text" name="module"/></li>
<li><p>任务 ID:</p><input type="text" name="taskId"/></li>
<li><p>任务名称:</p><input type="text" name="taskName"/></li>
<!-- <li><p>待办人 ID:</p><input type="text" name="todoUserId"/></li>-->
<li><p>待办人名称:</p><input type="text" name="todoUserName"/></li>
<li><p>处理人 ID:</p><input type="text" name="handleUserId"/></li>
<li><p>处理人名称:</p><input type="text" name="handleUserName"/></li>
<li class="select-time">
<p>通知时间:</p>
<input type="text" class="time-input" id="todoItemStartTime" placeholder="开始时间" name="params[todoItemStartTime]"/>
<span>-</span>
<input type="text" class="time-input" id="todoItemEndTime" placeholder="结束时间" name="params[todoItemEndTime]"/>
</li>
<li class="select-time">
<p>处理时间:</p>
<input type="text" class="time-input" id="handleStartTime" placeholder="开始时间" name="params[handleStartTime]"/>
<span>-</span>
<input type="text" class="time-input" id="handleEndTime" placeholder="结束时间" name="params[handleEndTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="process:todoitem:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var removeFlag = [[${@permission.hasPermi('process:todoitem:remove')}]];
var prefix = ctx + "process/todoitem";
var currentUser = [[${currentUser}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "待办事项",
columns: [
{checkbox: true},
{field : 'id', title : '主键 ID', visible: false},
{field : 'itemName', title : '事项标题'},
{field : 'itemContent', title : '事项内容'},
{field : 'module', title : '模块名称'},
{field : 'taskId', title : '任务 ID',visible: false},
{field : 'taskName', title : '任务名称'},
{field : 'isView', title : '是否查看'},
{field : 'isHandle', title : '是否处理'},
{field : 'todoUserId', title : '待办人ID',visible: false},
{field : 'todoUserName', title : '待办人名称'},
{field : 'handleUserId', title : '处理人ID'},
{field : 'handleUserName', title : '处理人名称'},
{field : 'todoTime', title : '通知时间'},
{field : 'handleTime', title : '处理时间'},
{field: 'nodeName', title: '待办任务名称', align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{title: '操作', align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + row.taskId + '\', \'' + row.module + '\', \'' + row.taskName + '\', \'' + row.nodeName + '\', \'' + row.todoUserId + '\')"><i class="fa fa-edit"></i> 办理</a> ');
return actions.join('');
}
}
]
};
$.table.init(options);
});
function showVerifyDialog(taskId, module, pageName, nodeName, todoUserId) {
if (todoUserId !== currentUser.loginName) {
$.modal.alertWarning("不允许非待办人办理待办事项!");
return;
}
var url = prefix + "/showVerifyDialog/" + taskId + "?module=" + module + "&formPageName=" + pageName;
$.modal.open(nodeName, url);
}
</script>
</body>
</html>
Loading…
Cancel
Save