From 4a88b2ad2535451adb027c73f988a1b803787b4b Mon Sep 17 00:00:00 2001 From: erdanergou Date: Tue, 11 Jul 2023 13:37:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=91=E7=9A=84=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E3=80=81=E6=88=91=E7=9A=84=E7=94=B3=E8=AF=B7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/pages/application/my-apply.html | 369 +++++++++----- .../templates/pages/application/my-task.html | 478 ++++++++++-------- .../templates/pages/application/my-apply.html | 369 +++++++++----- .../templates/pages/application/my-task.html | 478 ++++++++++-------- 4 files changed, 996 insertions(+), 698 deletions(-) diff --git a/src/main/resources/templates/pages/application/my-apply.html b/src/main/resources/templates/pages/application/my-apply.html index d41a4dbe..9bf56583 100644 --- a/src/main/resources/templates/pages/application/my-apply.html +++ b/src/main/resources/templates/pages/application/my-apply.html @@ -25,13 +25,13 @@ *zoom: 1; } -
+
-
    -
  • 入库记录
  • -
  • 出库申请
  • -
  • 盘点申请
  • +
      +
    • 入库记录
    • +
    • 出库申请
    • +
    • 盘点申请
    @@ -53,164 +53,256 @@ //先声明 function openDetailIn(data) { - }; + } function openDetailOut(data) { - }; + } + function openDetailTaking(data){ - }; - layui.use(['flow', 'layer', 'util'], function () { + } + + function initApplicationIn(){ + + } + + function initApplicationOut() { + + } + + function initStockTaking(){ + + } + + layui.use(['flow', 'layer', 'util','element'], function () { var $ = layui.jquery, layer = layui.layer, flow = layui.flow, + element = layui.element, util = layui.util; let size = 8; let inpre = 0; let takingPre = 0; let outpre = 0; - flow.load({ - elem: '#LAY_floor_stockTaking' //流加载容器 - , scrollElem: '#LAY_floor_stockTaking' //滚动条所在元素,一般不用填,此处只是演示需要。 - , isAuto: false - , done: function (page, next) { //执行下一页的回调 - let result; - let lis1 = []; - $.get('/stockTaking/myApply?page=' + page + '&size=' + size, function (res) { - result = res.data; - var Width = "25%"; - if (isMobile()) { - Width = "50%"; - } - lis1.push("
    "); - for (let i=0;i

    ' - +result[i].originatorName+'的'); - lis1.push('盘点记录

    '); - lis1.push('
    ' - +result[i].createTime+'
    '); - } - lis1.push('
    '); - takingPre+=result.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis1.join(''), takingPre < res.count); - }); + + $(function() { + initApplicationIn(); + }); + + // 切换事件(绑定未完成任务的选项卡) + element.on('tab(myApplyTab)', function(obj){ + let layId = $(obj.elem.context).attr("lay-id"); + if(layId.includes("applicationIn")){ + initApplicationIn(); + }else if (layId.includes("applicationOut")){ + initApplicationOut(); + }else if(layId.includes("stockTaking")){ + initStockTaking(); } }); - flow.load({ - elem: '#LAY_floor_in' //流加载容器 - , scrollElem: '#LAY_floor_in' //滚动条所在元素,一般不用填,此处只是演示需要。 - , isAuto: false - , done: function (page, next) { //执行下一页的回调 - let lis = []; - let result; - $.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) { - result = res.data; - applicationIn = result["applicationIn"]; - InCount = result["InCount"]; - var Width = "25%"; - if (isMobile()) { - Width = "50%"; - } - lis.push("
    "); - for (let i = 0; i < applicationIn.length; i++) { - lis.push('
  • ' - + applicationIn[i].applicantName + '的入库记录

    ') - lis.push('
    ' - + applicationIn[i].applicantTime + '
  • '); - } - lis.push('
    '); - inpre += applicationIn.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis.join(''), inpre < InCount); - }); + initStockTaking =function() { + flow.load({ + elem: '#LAY_floor_stockTaking' //流加载容器 + , scrollElem: '#LAY_floor_stockTaking' //滚动条所在元素,一般不用填,此处只是演示需要。 + , isAuto: false + , done: function (page, next) { //执行下一页的回调 + let result; + let lis1 = []; + $.get('/stockTaking/myApply?page=' + page + '&size=' + size, function (res) { + result = res.data; + var Width = "25%"; + if (isMobile()) { + Width = "50%"; + } + lis1.push("
    "); + for (let i=0;i

    ' + +result[i].originatorName+'的'); + lis1.push('盘点记录

    '); + lis1.push('
    ' + +result[i].createTime+'
    '); + } + lis1.push('
    '); + takingPre+=result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis1.join(''), takingPre < res.count); + }); + } + }); + }; + initApplicationIn = function() { + flow.load({ + elem: '#LAY_floor_in' //流加载容器 + , scrollElem: '#LAY_floor_in' //滚动条所在元素,一般不用填,此处只是演示需要。 + , isAuto: false + , done: function (page, next) { //执行下一页的回调 + let lis = []; + let result; + $.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) { + result = res.data; + applicationIn = result["applicationIn"]; + InCount = result["InCount"]; + var Width = "25%"; + if (isMobile()) { + Width = "50%"; + } + lis.push("
    "); + for (let i = 0; i < applicationIn.length; i++) { + lis.push('
  • ' + + applicationIn[i].applicantName + '的入库记录

    ') + lis.push('
    ' + + applicationIn[i].applicantTime + '
  • '); + } + lis.push('
    '); + inpre += applicationIn.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), inpre < InCount); + }); - } - }); - flow.load({ - elem: '#LAY_floor_out' //流加载容器 - , scrollElem: '#LAY_floor_out' //滚动条所在元素,一般不用填,此处只是演示需要。 - , isAuto: false - , done: function (page, next) { //执行下一页的回调 - let lis = []; - let result; - lis.push("
    ") - $.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) { - result = res.data; - applicationOut = result["applicationOut"]; - OutCount = result["OutCount"]; - var Width = "25%"; - if (isMobile()) { - Width = "50%"; - } + + } + }); + }; + + + initApplicationOut = function() { + flow.load({ + elem: '#LAY_floor_out' //流加载容器 + , scrollElem: '#LAY_floor_out' //滚动条所在元素,一般不用填,此处只是演示需要。 + , isAuto: false + , done: function (page, next) { //执行下一页的回调 + let lis = []; + let result; lis.push("
    ") - for (let i = 0; i < applicationOut.length; i++) { + $.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) { + result = res.data; + applicationOut = result["applicationOut"]; + OutCount = result["OutCount"]; + var Width = "25%"; + if (isMobile()) { + Width = "50%"; + } + lis.push("
    ") + for (let i = 0; i < applicationOut.length; i++) { - lis.push('
  • ' - + applicationOut[i].applicantName + '的出库请求

    ') - lis.push('
    ' - + applicationOut[i].applicantTime + '
  • '); + lis.push('
  • ' + + applicationOut[i].applicantName + '的出库请求

    ') + lis.push('
    ' + + applicationOut[i].applicantTime + '
  • '); - } - lis.push('
    '); - outpre += applicationOut.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis.join(''), outpre < OutCount); + } + lis.push('
    '); + outpre += applicationOut.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), outpre < OutCount); + }); + } + }); + }; + + + + openDetailIn = function (item) { + + if(isMobile()){ + var index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/form_step_look?id=' + item, + }); + $(window).on("resize", function () { + layer.full(index); + }); + }else{ + layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + offset: 'r', + anim: 'slideLeft', // 从右往左 + shadeClose: true, + area: ['30%', '100%'], + content: '/form_step_look?id=' + item, }); } - }); - openDetailIn = 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, - }); - $(window).on("resize", function () { - layer.full(index); - }); + }; openDetailOut = function (item) { - var index = layer.open({ - title: '请求详情', - type: 2, - shade: 0.2, - maxmin: true, - shadeClose: true, - area: ['100%', '100%'], - content: '/ApplicationOutView?id=' + item, - }); - $(window).on("resize", function () { - layer.full(index); - }); + if(isMobile()){ + var index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/ApplicationOutView?id=' + item, + }); + $(window).on("resize", function () { + layer.full(index); + }); + }else{ + index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + offset: 'r', + anim: 'slideLeft', // 从右往左 + maxmin: true, + shadeClose: true, + area: ['40%', '100%'], + content: '/ApplicationOutView?id=' + item, + }); + } + }; 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); - }); + if(isMobile()){ + 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); + }); + }else{ + layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + offset: 'r', + anim: 'slideLeft', // 从右往左 + area: ['30%', '100%'], + content: '/StockTakingView?id='+data, + end:function () { + location.reload() + } + }); + } + }; //定义一个函数判断是手机端还是pc端 @@ -222,9 +314,6 @@ } } - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) }); diff --git a/src/main/resources/templates/pages/application/my-task.html b/src/main/resources/templates/pages/application/my-task.html index 8a91a95d..2986f09a 100644 --- a/src/main/resources/templates/pages/application/my-task.html +++ b/src/main/resources/templates/pages/application/my-task.html @@ -30,17 +30,17 @@
    -
    +
      -
    • 未完成任务
    • -
    • 已完成任务
    • +
    • 未完成任务
    • +
    • 已完成任务
    -
    -
      -
    • 审核任务
    • -
    • 出库任务
    • +
      +
        +
      • 审核任务
      • +
      • 出库任务
      @@ -53,9 +53,9 @@
      -
      +
        -
      • 审核任务
      • +
      • 审核任务
      @@ -115,226 +115,289 @@ } - layui.use(['flow', 'layer', 'table', 'util'], function () { + // 初始化未完成的审核任务 + function initIncompleteReview(){ + + } + // 初始化已完成的审核任务 + function initCompleteReview() { + + } + + // 初始化未完成的出库任务 + function initIncompleteOutTask() { + + } + + + layui.use(['flow', 'layer', 'table', 'util', 'element'], function () { var $ = layui.jquery, layer = layui.layer, flow = layui.flow, table = layui.table, + element = layui.element, 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("
      "); - if (isMobile()) { - Width = "50%"; - } - for (let i = 0; i < result.length; i++) { - lis.push('
    • ' - + result[i].applicantName + '的'); - lis.push('出库请求

      '); - lis.push('
      ' - + result[i].applicantTime + '
    • '); - } - lis.push('
      '); - 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("
      "); - if (isMobile()) { - Width = "50%"; - } - for (let i = 0; i < result.length; i++) { - lis2.push('
    • ' - + result[i].applicantName + '的'); - lis2.push('入库请求

      '); - lis2.push('
      ' - + result[i].applicantTime + '
    • '); - } - lis2.push('
      '); - 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("
      "); - if (isMobile()) { - Width = "50%"; - } - for (let i = 0; i < result.length; i++) { - lis1.push('
    • ' - + result[i].originatorName + '的'); - lis1.push('盘点记录

      '); - lis1.push('
      ' - + result[i].createTime + '
    • '); - } - lis1.push('
      '); - pre3 += result.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis1.join(''), pre3 < res.count); - }); + $(function() { + initIncompleteReview(); + }); + // 切换事件(绑定未完成任务的选项卡) + element.on('tab(incompleteTab)', function(obj){ + let layId = $(obj.elem.context).attr("lay-id"); + if(layId.includes("Approval")){ + initIncompleteReview(); + }else if (layId.includes("Out")){ + initIncompleteOutTask(); + } + }); + + // 切换事件(绑定已完成任务的选项卡) + element.on('tab(firstTab)', function(obj){ + let layId = $(obj.elem.context).attr("lay-id"); + if(layId.includes("incomplete")){ + initIncompleteReview(); + }else{ + initCompleteReview(); } }); - // 已完成任务-审核任务 - 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("
      "); - for (let i = 0; i < result.length; i++) { + + + // 未完成任务-审核任务 + initIncompleteReview = function(){ + 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("
      "); if (isMobile()) { Width = "50%"; } - lis.push('
    • ' - + result[i].applicantName + '的'); - lis.push('出库请求

      '); - lis.push('
      ' - + result[i].applicantTime + '
    • '); - } - lis.push("
      "); - 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("
      "); - for (let i = 0; i < result.length; i++) { + for (let i = 0; i < result.length; i++) { + lis.push('
    • ' + + result[i].applicantName + '的'); + lis.push('出库请求

      '); + lis.push('
      ' + + result[i].applicantTime + '
    • '); + } + lis.push('
      '); + 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("
      "); if (isMobile()) { Width = "50%"; } - lis2.push('
    • ' - + result[i].applicantName + '的'); - lis2.push('入库请求

      '); - lis2.push('
      ' - + result[i].applicantTime + '
    • '); - } - lis2.push("
      "); - 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("
      "); - if (isMobile()) { - Width = "50%"; - } - for (let i = 0; i < result.length; i++) { - lis1.push('
    • ' - + result[i].originatorName + '的'); - lis1.push('盘点记录

      '); - lis1.push('
      ' - + result[i].createTime + '
    • '); - } - lis1.push('
      '); - 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("
      "); - if (isMobile()) { - // 如果是移动端 - Width = "50%"; - redirectByIsMobile = "openDetail3_mobile("; - } else { - redirectByIsMobile = "openDetail3("; - } - for (let i = 0; i < keys.length; i++) { - - lis.push('
    • ' + - '
      ' + - '

      ' - + result[keys[i]][0].depositoryName + '

      ') - lis.push('
      ' - + result[keys[i]][0].applicantTime + '
    • '); - } - - lis.push("
      "); - pre2 += result.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis.join(''), pre2 < res.count); - }); - } - }); + for (let i = 0; i < result.length; i++) { + lis2.push('
    • ' + + result[i].applicantName + '的'); + lis2.push('入库请求

      '); + lis2.push('
      ' + + result[i].applicantTime + '
    • '); + } + lis2.push('
      '); + 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("
      "); + if (isMobile()) { + Width = "50%"; + } + for (let i = 0; i < result.length; i++) { + lis1.push('
    • ' + + result[i].originatorName + '的'); + lis1.push('盘点记录

      '); + lis1.push('
      ' + + result[i].createTime + '
    • '); + } + lis1.push('
      '); + pre3 += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis1.join(''), pre3 < 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() + // 已完成任务-审核任务 + initCompleteReview = function() { + 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("
      "); + for (let i = 0; i < result.length; i++) { + if (isMobile()) { + Width = "50%"; + } + lis.push('
    • ' + + result[i].applicantName + '的'); + lis.push('出库请求

      '); + lis.push('
      ' + + result[i].applicantTime + '
    • '); + } + lis.push("
      "); + 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("
      "); + for (let i = 0; i < result.length; i++) { + if (isMobile()) { + Width = "50%"; + } + lis2.push('
    • ' + + result[i].applicantName + '的'); + lis2.push('入库请求

      '); + lis2.push('
      ' + + result[i].applicantTime + '
    • '); + } + lis2.push("
      "); + 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("
      "); + if (isMobile()) { + Width = "50%"; + } + for (let i = 0; i < result.length; i++) { + lis1.push('
    • ' + + result[i].originatorName + '的'); + lis1.push('盘点记录

      '); + lis1.push('
      ' + + result[i].createTime + '
    • '); + } + lis1.push('
      '); + pre4 += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis1.join(''), pre4 < res.count); + }); } }); + }; - $(window).on("resize", function () { - layer.full(index); + // 未完成任务-出库任务 + initIncompleteOutTask = function() { + 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("
      "); + if (isMobile()) { + // 如果是移动端 + Width = "50%"; + redirectByIsMobile = "openDetail3_mobile("; + } else { + redirectByIsMobile = "openDetail3("; + } + for (let i = 0; i < keys.length; i++) { + + lis.push('
    • ' + + '
      ' + + '

      ' + + result[keys[i]][0].depositoryName + '

      ') + lis.push('
      ' + + result[keys[i]][0].applicantTime + '
    • '); + } + + lis.push("
      "); + pre2 += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), pre2 < res.count); + }); + } }); }; + + + + // 用于跳转到出库审核页面 + openDetailForOut = function (item) { + if(isMobile()){ + layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/application_review?id=' + item, + end: function () { + location.reload() + } + }); + }else{ + layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + offset: 'r', + anim: 'slideLeft', // 从右往左 + shadeClose: true, + area: ['30%', '100%'], + content: '/application_review?id=' + item, + end: function () { + flow.reload() + } + }); + } + }; // 用于跳转到入库审核页面 openDetailForIn = function (item) { var index = layer.open({ @@ -343,6 +406,7 @@ shade: 0.2, maxmin: true, shadeClose: true, + area: ['100%', '100%'], content: '/application_in_review?id=' + item, end: function () { @@ -516,10 +580,6 @@ return false; // PC端 } } - - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) }); \ No newline at end of file diff --git a/target/classes/templates/pages/application/my-apply.html b/target/classes/templates/pages/application/my-apply.html index d41a4dbe..9bf56583 100644 --- a/target/classes/templates/pages/application/my-apply.html +++ b/target/classes/templates/pages/application/my-apply.html @@ -25,13 +25,13 @@ *zoom: 1; } -
      +
      -
        -
      • 入库记录
      • -
      • 出库申请
      • -
      • 盘点申请
      • +
          +
        • 入库记录
        • +
        • 出库申请
        • +
        • 盘点申请
        @@ -53,164 +53,256 @@ //先声明 function openDetailIn(data) { - }; + } function openDetailOut(data) { - }; + } + function openDetailTaking(data){ - }; - layui.use(['flow', 'layer', 'util'], function () { + } + + function initApplicationIn(){ + + } + + function initApplicationOut() { + + } + + function initStockTaking(){ + + } + + layui.use(['flow', 'layer', 'util','element'], function () { var $ = layui.jquery, layer = layui.layer, flow = layui.flow, + element = layui.element, util = layui.util; let size = 8; let inpre = 0; let takingPre = 0; let outpre = 0; - flow.load({ - elem: '#LAY_floor_stockTaking' //流加载容器 - , scrollElem: '#LAY_floor_stockTaking' //滚动条所在元素,一般不用填,此处只是演示需要。 - , isAuto: false - , done: function (page, next) { //执行下一页的回调 - let result; - let lis1 = []; - $.get('/stockTaking/myApply?page=' + page + '&size=' + size, function (res) { - result = res.data; - var Width = "25%"; - if (isMobile()) { - Width = "50%"; - } - lis1.push("
        "); - for (let i=0;i

        ' - +result[i].originatorName+'的'); - lis1.push('盘点记录

        '); - lis1.push('
        ' - +result[i].createTime+'
        '); - } - lis1.push('
        '); - takingPre+=result.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis1.join(''), takingPre < res.count); - }); + + $(function() { + initApplicationIn(); + }); + + // 切换事件(绑定未完成任务的选项卡) + element.on('tab(myApplyTab)', function(obj){ + let layId = $(obj.elem.context).attr("lay-id"); + if(layId.includes("applicationIn")){ + initApplicationIn(); + }else if (layId.includes("applicationOut")){ + initApplicationOut(); + }else if(layId.includes("stockTaking")){ + initStockTaking(); } }); - flow.load({ - elem: '#LAY_floor_in' //流加载容器 - , scrollElem: '#LAY_floor_in' //滚动条所在元素,一般不用填,此处只是演示需要。 - , isAuto: false - , done: function (page, next) { //执行下一页的回调 - let lis = []; - let result; - $.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) { - result = res.data; - applicationIn = result["applicationIn"]; - InCount = result["InCount"]; - var Width = "25%"; - if (isMobile()) { - Width = "50%"; - } - lis.push("
        "); - for (let i = 0; i < applicationIn.length; i++) { - lis.push('
      • ' - + applicationIn[i].applicantName + '的入库记录

        ') - lis.push('
        ' - + applicationIn[i].applicantTime + '
      • '); - } - lis.push('
        '); - inpre += applicationIn.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis.join(''), inpre < InCount); - }); + initStockTaking =function() { + flow.load({ + elem: '#LAY_floor_stockTaking' //流加载容器 + , scrollElem: '#LAY_floor_stockTaking' //滚动条所在元素,一般不用填,此处只是演示需要。 + , isAuto: false + , done: function (page, next) { //执行下一页的回调 + let result; + let lis1 = []; + $.get('/stockTaking/myApply?page=' + page + '&size=' + size, function (res) { + result = res.data; + var Width = "25%"; + if (isMobile()) { + Width = "50%"; + } + lis1.push("
        "); + for (let i=0;i

        ' + +result[i].originatorName+'的'); + lis1.push('盘点记录

        '); + lis1.push('
        ' + +result[i].createTime+'
        '); + } + lis1.push('
        '); + takingPre+=result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis1.join(''), takingPre < res.count); + }); + } + }); + }; + initApplicationIn = function() { + flow.load({ + elem: '#LAY_floor_in' //流加载容器 + , scrollElem: '#LAY_floor_in' //滚动条所在元素,一般不用填,此处只是演示需要。 + , isAuto: false + , done: function (page, next) { //执行下一页的回调 + let lis = []; + let result; + $.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) { + result = res.data; + applicationIn = result["applicationIn"]; + InCount = result["InCount"]; + var Width = "25%"; + if (isMobile()) { + Width = "50%"; + } + lis.push("
        "); + for (let i = 0; i < applicationIn.length; i++) { + lis.push('
      • ' + + applicationIn[i].applicantName + '的入库记录

        ') + lis.push('
        ' + + applicationIn[i].applicantTime + '
      • '); + } + lis.push('
        '); + inpre += applicationIn.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), inpre < InCount); + }); - } - }); - flow.load({ - elem: '#LAY_floor_out' //流加载容器 - , scrollElem: '#LAY_floor_out' //滚动条所在元素,一般不用填,此处只是演示需要。 - , isAuto: false - , done: function (page, next) { //执行下一页的回调 - let lis = []; - let result; - lis.push("
        ") - $.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) { - result = res.data; - applicationOut = result["applicationOut"]; - OutCount = result["OutCount"]; - var Width = "25%"; - if (isMobile()) { - Width = "50%"; - } + + } + }); + }; + + + initApplicationOut = function() { + flow.load({ + elem: '#LAY_floor_out' //流加载容器 + , scrollElem: '#LAY_floor_out' //滚动条所在元素,一般不用填,此处只是演示需要。 + , isAuto: false + , done: function (page, next) { //执行下一页的回调 + let lis = []; + let result; lis.push("
        ") - for (let i = 0; i < applicationOut.length; i++) { + $.get('/depositoryRecord/myApply?page=' + page + '&size=' + size, function (res) { + result = res.data; + applicationOut = result["applicationOut"]; + OutCount = result["OutCount"]; + var Width = "25%"; + if (isMobile()) { + Width = "50%"; + } + lis.push("
        ") + for (let i = 0; i < applicationOut.length; i++) { - lis.push('
      • ' - + applicationOut[i].applicantName + '的出库请求

        ') - lis.push('
        ' - + applicationOut[i].applicantTime + '
      • '); + lis.push('
      • ' + + applicationOut[i].applicantName + '的出库请求

        ') + lis.push('
        ' + + applicationOut[i].applicantTime + '
      • '); - } - lis.push('
        '); - outpre += applicationOut.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis.join(''), outpre < OutCount); + } + lis.push('
        '); + outpre += applicationOut.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), outpre < OutCount); + }); + } + }); + }; + + + + openDetailIn = function (item) { + + if(isMobile()){ + var index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/form_step_look?id=' + item, + }); + $(window).on("resize", function () { + layer.full(index); + }); + }else{ + layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + offset: 'r', + anim: 'slideLeft', // 从右往左 + shadeClose: true, + area: ['30%', '100%'], + content: '/form_step_look?id=' + item, }); } - }); - openDetailIn = 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, - }); - $(window).on("resize", function () { - layer.full(index); - }); + }; openDetailOut = function (item) { - var index = layer.open({ - title: '请求详情', - type: 2, - shade: 0.2, - maxmin: true, - shadeClose: true, - area: ['100%', '100%'], - content: '/ApplicationOutView?id=' + item, - }); - $(window).on("resize", function () { - layer.full(index); - }); + if(isMobile()){ + var index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/ApplicationOutView?id=' + item, + }); + $(window).on("resize", function () { + layer.full(index); + }); + }else{ + index = layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + offset: 'r', + anim: 'slideLeft', // 从右往左 + maxmin: true, + shadeClose: true, + area: ['40%', '100%'], + content: '/ApplicationOutView?id=' + item, + }); + } + }; 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); - }); + if(isMobile()){ + 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); + }); + }else{ + layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + offset: 'r', + anim: 'slideLeft', // 从右往左 + area: ['30%', '100%'], + content: '/StockTakingView?id='+data, + end:function () { + location.reload() + } + }); + } + }; //定义一个函数判断是手机端还是pc端 @@ -222,9 +314,6 @@ } } - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) }); diff --git a/target/classes/templates/pages/application/my-task.html b/target/classes/templates/pages/application/my-task.html index 8a91a95d..2986f09a 100644 --- a/target/classes/templates/pages/application/my-task.html +++ b/target/classes/templates/pages/application/my-task.html @@ -30,17 +30,17 @@
        -
        +
          -
        • 未完成任务
        • -
        • 已完成任务
        • +
        • 未完成任务
        • +
        • 已完成任务
        -
        -
          -
        • 审核任务
        • -
        • 出库任务
        • +
          +
            +
          • 审核任务
          • +
          • 出库任务
          @@ -53,9 +53,9 @@
          -
          +
            -
          • 审核任务
          • +
          • 审核任务
          @@ -115,226 +115,289 @@ } - layui.use(['flow', 'layer', 'table', 'util'], function () { + // 初始化未完成的审核任务 + function initIncompleteReview(){ + + } + // 初始化已完成的审核任务 + function initCompleteReview() { + + } + + // 初始化未完成的出库任务 + function initIncompleteOutTask() { + + } + + + layui.use(['flow', 'layer', 'table', 'util', 'element'], function () { var $ = layui.jquery, layer = layui.layer, flow = layui.flow, table = layui.table, + element = layui.element, 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("
          "); - if (isMobile()) { - Width = "50%"; - } - for (let i = 0; i < result.length; i++) { - lis.push('
        • ' - + result[i].applicantName + '的'); - lis.push('出库请求

          '); - lis.push('
          ' - + result[i].applicantTime + '
        • '); - } - lis.push('
          '); - 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("
          "); - if (isMobile()) { - Width = "50%"; - } - for (let i = 0; i < result.length; i++) { - lis2.push('
        • ' - + result[i].applicantName + '的'); - lis2.push('入库请求

          '); - lis2.push('
          ' - + result[i].applicantTime + '
        • '); - } - lis2.push('
          '); - 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("
          "); - if (isMobile()) { - Width = "50%"; - } - for (let i = 0; i < result.length; i++) { - lis1.push('
        • ' - + result[i].originatorName + '的'); - lis1.push('盘点记录

          '); - lis1.push('
          ' - + result[i].createTime + '
        • '); - } - lis1.push('
          '); - pre3 += result.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis1.join(''), pre3 < res.count); - }); + $(function() { + initIncompleteReview(); + }); + // 切换事件(绑定未完成任务的选项卡) + element.on('tab(incompleteTab)', function(obj){ + let layId = $(obj.elem.context).attr("lay-id"); + if(layId.includes("Approval")){ + initIncompleteReview(); + }else if (layId.includes("Out")){ + initIncompleteOutTask(); + } + }); + + // 切换事件(绑定已完成任务的选项卡) + element.on('tab(firstTab)', function(obj){ + let layId = $(obj.elem.context).attr("lay-id"); + if(layId.includes("incomplete")){ + initIncompleteReview(); + }else{ + initCompleteReview(); } }); - // 已完成任务-审核任务 - 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("
          "); - for (let i = 0; i < result.length; i++) { + + + // 未完成任务-审核任务 + initIncompleteReview = function(){ + 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("
          "); if (isMobile()) { Width = "50%"; } - lis.push('
        • ' - + result[i].applicantName + '的'); - lis.push('出库请求

          '); - lis.push('
          ' - + result[i].applicantTime + '
        • '); - } - lis.push("
          "); - 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("
          "); - for (let i = 0; i < result.length; i++) { + for (let i = 0; i < result.length; i++) { + lis.push('
        • ' + + result[i].applicantName + '的'); + lis.push('出库请求

          '); + lis.push('
          ' + + result[i].applicantTime + '
        • '); + } + lis.push('
          '); + 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("
          "); if (isMobile()) { Width = "50%"; } - lis2.push('
        • ' - + result[i].applicantName + '的'); - lis2.push('入库请求

          '); - lis2.push('
          ' - + result[i].applicantTime + '
        • '); - } - lis2.push("
          "); - 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("
          "); - if (isMobile()) { - Width = "50%"; - } - for (let i = 0; i < result.length; i++) { - lis1.push('
        • ' - + result[i].originatorName + '的'); - lis1.push('盘点记录

          '); - lis1.push('
          ' - + result[i].createTime + '
        • '); - } - lis1.push('
          '); - 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("
          "); - if (isMobile()) { - // 如果是移动端 - Width = "50%"; - redirectByIsMobile = "openDetail3_mobile("; - } else { - redirectByIsMobile = "openDetail3("; - } - for (let i = 0; i < keys.length; i++) { - - lis.push('
        • ' + - '
          ' + - '

          ' - + result[keys[i]][0].depositoryName + '

          ') - lis.push('
          ' - + result[keys[i]][0].applicantTime + '
        • '); - } - - lis.push("
          "); - pre2 += result.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis.join(''), pre2 < res.count); - }); - } - }); + for (let i = 0; i < result.length; i++) { + lis2.push('
        • ' + + result[i].applicantName + '的'); + lis2.push('入库请求

          '); + lis2.push('
          ' + + result[i].applicantTime + '
        • '); + } + lis2.push('
          '); + 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("
          "); + if (isMobile()) { + Width = "50%"; + } + for (let i = 0; i < result.length; i++) { + lis1.push('
        • ' + + result[i].originatorName + '的'); + lis1.push('盘点记录

          '); + lis1.push('
          ' + + result[i].createTime + '
        • '); + } + lis1.push('
          '); + pre3 += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis1.join(''), pre3 < 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() + // 已完成任务-审核任务 + initCompleteReview = function() { + 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("
          "); + for (let i = 0; i < result.length; i++) { + if (isMobile()) { + Width = "50%"; + } + lis.push('
        • ' + + result[i].applicantName + '的'); + lis.push('出库请求

          '); + lis.push('
          ' + + result[i].applicantTime + '
        • '); + } + lis.push("
          "); + 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("
          "); + for (let i = 0; i < result.length; i++) { + if (isMobile()) { + Width = "50%"; + } + lis2.push('
        • ' + + result[i].applicantName + '的'); + lis2.push('入库请求

          '); + lis2.push('
          ' + + result[i].applicantTime + '
        • '); + } + lis2.push("
          "); + 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("
          "); + if (isMobile()) { + Width = "50%"; + } + for (let i = 0; i < result.length; i++) { + lis1.push('
        • ' + + result[i].originatorName + '的'); + lis1.push('盘点记录

          '); + lis1.push('
          ' + + result[i].createTime + '
        • '); + } + lis1.push('
          '); + pre4 += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis1.join(''), pre4 < res.count); + }); } }); + }; - $(window).on("resize", function () { - layer.full(index); + // 未完成任务-出库任务 + initIncompleteOutTask = function() { + 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("
          "); + if (isMobile()) { + // 如果是移动端 + Width = "50%"; + redirectByIsMobile = "openDetail3_mobile("; + } else { + redirectByIsMobile = "openDetail3("; + } + for (let i = 0; i < keys.length; i++) { + + lis.push('
        • ' + + '
          ' + + '

          ' + + result[keys[i]][0].depositoryName + '

          ') + lis.push('
          ' + + result[keys[i]][0].applicantTime + '
        • '); + } + + lis.push("
          "); + pre2 += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), pre2 < res.count); + }); + } }); }; + + + + // 用于跳转到出库审核页面 + openDetailForOut = function (item) { + if(isMobile()){ + layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/application_review?id=' + item, + end: function () { + location.reload() + } + }); + }else{ + layer.open({ + title: '请求详情', + type: 2, + shade: 0.2, + maxmin: true, + offset: 'r', + anim: 'slideLeft', // 从右往左 + shadeClose: true, + area: ['30%', '100%'], + content: '/application_review?id=' + item, + end: function () { + flow.reload() + } + }); + } + }; // 用于跳转到入库审核页面 openDetailForIn = function (item) { var index = layer.open({ @@ -343,6 +406,7 @@ shade: 0.2, maxmin: true, shadeClose: true, + area: ['100%', '100%'], content: '/application_in_review?id=' + item, end: function () { @@ -516,10 +580,6 @@ return false; // PC端 } } - - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) }); \ No newline at end of file