<!DOCTYPE html>
< html lang = "en" xmlns:th = "http://www.thymeleaf.org" >
< head >
< meta charset = "utf-8" >
< title > layui< / title >
< meta name = "renderer" content = "webkit" >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" >
< meta name = "viewport" content = "width=device-width, initial-scale=1, maximum-scale=1" >
< link rel = "stylesheet" href = "/static/lib/layui-v2.6.3/css/layui.css" media = "all" >
< link rel = "stylesheet" href = "/static/css/public.css" media = "all" >
< link rel = "stylesheet" href = "/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media = "all" >
< / head >
< style >
.clearfix:after, .clearfix:before {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
< / style >
< body >
< div class = "layuimini-container" >
< div class = "layuimini-main" >
< div class = "layui-tab" >
< ul class = "layui-tab-title" >
< li class = "layui-this" > 未完成任务< / li >
< li > 已完成任务< / li >
< / ul >
< div class = "layui-tab-content" >
< div class = "layui-tab-item layui-show" >
< div class = "layui-tab layui-tab-card" >
< ul class = "layui-tab-title" >
< li class = "layui-this" > 审核任务< / li >
< li > 出库任务< / li >
< / ul >
< div class = "layui-tab-content" >
< div class = "layui-tab-item layui-show" >
< ul id = "LAY_floor1" class = "flow-default" style = "width: 100%" > < / ul >
< / div >
< div class = "layui-tab-item" >
< ul id = "LAY_floor3" class = "flow-default" style = "width: 100%" > < / ul >
< / div >
< / div >
< / div >
< / div >
< div class = "layui-tab-item" >
< div class = "layui-tab layui-tab-card" >
< ul class = "layui-tab-title" >
< li class = "layui-this" > 审核任务< / li >
< / ul >
< div class = "layui-tab-content" >
< div class = "layui-tab-item layui-show" >
< ul id = "LAY_floor2" class = "flow-default" style = "width: 100%" > < / ul >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / body >
< script src = "/static/lib/layui-v2.6.3/layui.js" charset = "utf-8" > < / script >
< script src = "/static/js/lay-config.js?v=1.0.4" charset = "utf-8" > < / script >
< script >
var data = {};
//先声明
function openDetailForOut(data) {
}
function openDetailForIn(data) {
}
//先声明
function openDetailForOutView(data) {
}
//先声明
function openDetailForInView(data) {
}
//先声明(用于pc端跳转)
function openDetail3(data) {
}
// 用于手机端跳转
function openDetail3_mobile(data) {
}
//先声明(用于pc端跳转)
function openDetail4(data) {
}
// 用于手机端跳转
function openDetail4_mobile(data) {
}
//先声明(用于pc端跳转)
function openDetailForTaking(data) {
}
function openDetailTaking(data) {
}
layui.use(['flow', 'layer', 'table', 'util'], function () {
var $ = layui.jquery,
layer = layui.layer,
flow = layui.flow,
table = layui.table,
util = layui.util;
//每页的数量
var size = 8;
let pre1 = 0, pre2 = 0, pre3 = 0, pre4 = 0, pre5 = 0, pre6 = 0;
// 未完成任务-审核任务
flow.load({
elem: '#LAY_floor1' //流加载容器
, scrollElem: '#LAY_floor1' //滚动条所在元素,一般不用填,此处只是演示需要。
, isAuto: false
, done: function (page, next) { //执行下一页的回调
let lis = [];
let lis1 = [];
let lis2 = [];
let result;
$.get('/depositoryRecord/myTaskOut?page=' + page + '& size=' + size + '& isDone=0', function (res) {
var Width = "25%";
result = res.data;
lis.push("< div class = 'clearfix' > ");
if (isMobile()) {
Width = "50%";
}
for (let i = 0; i < result.length ; i + + ) {
lis.push('< li style = "width:' + Width + ';float:left;" > < div class = "layui-card my-shadow my-card flow1" onclick = "openDetailForOut('
+ result[i].id + ')">< div class = "layui-card-header" > < h2 > '
+ result[i].applicantName + '的');
lis.push('出库请求< / h2 > < / div > ');
lis.push('< div class = "layui-col-md4 my-time" style = "margin-left: 15px; color: #999;font-size: 12px;" > '
+ result[i].applicantTime + '< / div > < / div > < / li > ');
}
lis.push('< / div > ');
pre1 += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), pre1 < res.count ) ;
});
$.get('/depositoryRecord/myTaskIn?page=' + page + '& size=' + size + '& isDone=0', function (res) {
var Width = "25%";
result = res.data;
lis2.push("< div class = 'clearfix' > ");
if (isMobile()) {
Width = "50%";
}
for (let i = 0; i < result.length ; i + + ) {
lis2.push('< li style = "width:' + Width + ';float:left;" > < div class = "layui-card my-shadow my-card flow1" onclick = "openDetailForIn('
+ result[i].id + ')">< div class = "layui-card-header" > < h2 > '
+ result[i].applicantName + '的');
lis2.push('入库请求< / h2 > < / div > ');
lis2.push('< div class = "layui-col-md4 my-time" style = "margin-left: 15px; color: #999;font-size: 12px;" > '
+ result[i].applicantTime + '< / div > < / div > < / li > ');
}
lis2.push('< / div > ');
pre5 += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis2.join(''), pre5 < res.count ) ;
});
$.get('/stockTaking/myTask?page=' + page + '& size=' + size + '& isDone=0', function (res) {
var Width = "25%";
result = res.data;
lis1.push("< div class = 'clearfix' > ");
if (isMobile()) {
Width = "50%";
}
for (let i = 0; i < result.length ; i + + ) {
lis1.push('< li style = "width:' + Width + ';float:left;" > < div class = "layui-card my-shadow my-card flow1" onclick = "openDetailForTaking('
+ result[i].id + ')">< div class = "layui-card-header" > < h2 > '
+ result[i].originatorName + '的');
lis1.push('盘点记录< / h2 > < / div > ');
lis1.push('< div class = "layui-col-md4 my-time" style = "margin-left: 15px; color: #999;font-size: 12px;" > '
+ result[i].createTime + '< / div > < / div > < / li > ');
}
lis1.push('< / div > ');
pre3 += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis1.join(''), pre3 < res.count ) ;
});
}
});
// 已完成任务-审核任务
flow.load({
elem: '#LAY_floor2' //流加载容器
, scrollElem: '#LAY_floor2' //滚动条所在元素,一般不用填,此处只是演示需要。
, isAuto: false
, done: function (page, next) { //执行下一页的回调
let lis = [];
let lis1 = [];
let lis2 = [];
let result;
$.get('/depositoryRecord/myTaskOut?page=' + page + '& size=' + size + '& isDone=1', function (res) {
var Width = "25%";
result = res.data;
lis.push("< div class = 'clearfix' > ");
for (let i = 0; i < result.length ; i + + ) {
if (isMobile()) {
Width = "50%";
}
lis.push('< li style = "width:' + Width + ';float:left;" > < div class = "layui-card my-shadow my-card flow1" onclick = "openDetailForOutView('
+ result[i].id + ')" >< div class = "layui-card-header" > < h2 > '
+ result[i].applicantName + '的');
lis.push('出库请求< / h2 > < / div > ');
lis.push('< div class = "layui-col-md4 my-time" style = "margin-left: 15px; color: #999;font-size: 12px;" > '
+ result[i].applicantTime + '< / div > < / div > < / li > ');
}
lis.push("< / div > ");
pre2 += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), pre2 < res.count ) ;
});
$.get('/depositoryRecord/myTaskIn?page=' + page + '& size=' + size + '& isDone=1', function (res) {
var Width = "25%";
result = res.data;
lis2.push("< div class = 'clearfix' > ");
for (let i = 0; i < result.length ; i + + ) {
if (isMobile()) {
Width = "50%";
}
lis2.push('< li style = "width:' + Width + ';float:left;" > < div class = "layui-card my-shadow my-card flow1" onclick = "openDetailForInView('
+ result[i].id + ')" >< div class = "layui-card-header" > < h2 > '
+ result[i].applicantName + '的');
lis2.push('入库请求< / h2 > < / div > ');
lis2.push('< div class = "layui-col-md4 my-time" style = "margin-left: 15px; color: #999;font-size: 12px;" > '
+ result[i].applicantTime + '< / div > < / div > < / li > ');
}
lis2.push("< / div > ");
pre6 += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis2.join(''), pre6 < res.count ) ;
});
$.get('/stockTaking/myTask?page=' + page + '& size=' + size + '& isDone=1', function (res) {
var Width = "25%";
result = res.data;
lis1.push("< div class = 'clearfix' > ");
if (isMobile()) {
Width = "50%";
}
for (let i = 0; i < result.length ; i + + ) {
lis1.push('< li style = "width:' + Width + ';float:left;" > < div class = "layui-card my-shadow my-card flow1" onclick = "openDetailTaking('
+ result[i].id + ')">< div class = "layui-card-header" > < h2 > '
+ result[i].originatorName + '的');
lis1.push('盘点记录< / h2 > < / div > ');
lis1.push('< div class = "layui-col-md4 my-time" style = "margin-left: 15px; color: #999;font-size: 12px;" > '
+ result[i].createTime + '< / div > < / div > < / li > ');
}
lis1.push('< / div > ');
pre4 += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis1.join(''), pre4 < res.count ) ;
});
}
});
// 未完成任务-出库任务
flow.load({
elem: '#LAY_floor3' //流加载容器
, scrollElem: '#LAY_floor3' //滚动条所在元素,一般不用填,此处只是演示需要。
, isAuto: false
, done: function (page, next) { //执行下一页的回调
let lis = [];
let result;
$.get('/depositoryRecord/myTashForScanQrCode?page=' + page + '& size=' + size + '& isDone=0', function (res) {
var Width = "25%";
result = res.data;
const keys = Object.keys(result); // 获取map中所有的键
let redirectByIsMobile = "";
lis.push("< div class = 'clearfix' > ");
if (isMobile()) {
// 如果是移动端
Width = "50%";
redirectByIsMobile = "openDetail3_mobile(";
} else {
redirectByIsMobile = "openDetail3(";
}
for (let i = 0; i < keys.length ; i + + ) {
lis.push('< li style = "width:' + Width + ';float:left;" > ' +
'< div class = "layui-card my-shadow my-card flow1" ' + " onclick = " + redirectByIsMobile + result[keys[i]][0].depositoryId + " ) " + ' > ' +
'< div class = "layui-card-header" > < h2 > '
+ result[keys[i]][0].depositoryName + '< / h2 > < / div > ')
lis.push('< div class = "layui-col-md4 my-time" style = "margin-left: 15px; color: #999;font-size: 12px;" > '
+ result[keys[i]][0].applicantTime + '< / div > < / div > < / li > ');
}
lis.push("< / div > ");
pre2 += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), pre2 < res.count ) ;
});
}
});
// 用于跳转到出库审核页面
openDetailForOut = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/application_review?id=' + item,
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
// 用于跳转到入库审核页面
openDetailForIn = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/application_in_review?id=' + item,
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
// 用于跳转到出库任务查看页面
openDetailForOutView = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/ApplicationOutView?id=' + item,
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
// 用于跳转到入库任务查看页面
openDetailForInView = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/form_step_look?id=' + item,
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
// 用于pc端跳转
openDetail3 = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/ApplicationOutMinByDid?depositoryId=' + item + "& state=0",
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
// 用于移动端跳转
openDetail3_mobile = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/ApplicationOutMinByDidForMobile?depositoryId=' + item + "& state=0",
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
// 用于pc端跳转
openDetail4 = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/ApplicationOutMinByDid?depositoryId=' + item + "& state=1",
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
// 用于移动端跳转
openDetail4_mobile = function (item) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/ApplicationOutMinByDidForMobile?depositoryId=' + item + "& state=1",
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
openDetailForTaking = function (data) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/StockTakingReview?id=' + data,
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
openDetailTaking = function (data) {
var index = layer.open({
title: '请求详情',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/StockTakingView?id=' + data,
end: function () {
location.reload()
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
//定义一个函数判断是手机端还是pc端
function isMobile() {
if (window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {
return true; // 移动端
} else {
return false; // PC端
}
}
$('body').on('click', '[data-refresh]', function () {
location.reload();
})
});
< / script >
< / html >