From 674aef62d298f9fbce41b9b1725c71d056dfd55b Mon Sep 17 00:00:00 2001 From: LSH Date: 星期三, 03 四月 2024 10:26:32 +0800 Subject: [PATCH] #周计划 --- src/main/webapp/static/js/weekly/weekly.js | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 110 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/static/js/weekly/weekly.js b/src/main/webapp/static/js/weekly/weekly.js index a79ee16..47d267b 100644 --- a/src/main/webapp/static/js/weekly/weekly.js +++ b/src/main/webapp/static/js/weekly/weekly.js @@ -5,6 +5,20 @@ var htmlCstmrData; var indexS = "9999,8888"; var indexDelSign = 0; +let nowUserId2 = 0; +fWeekly(); +function fWeekly() { + layui.jquery.ajax({ + url: baseUrl + "/dashboard/user/id/popup/auth", + data:{token : localStorage.getItem('token')}, + method: 'GET', + success: function (res) { + if (res.code === 200) { + nowUserId2 = res.data; + } + } + }) +} layui.config({ base: baseUrl + "/static/layui/lay/modules/" }).extend({ @@ -21,6 +35,8 @@ admin = layui.admin; $('#organization').html(localStorage.getItem('nickname') + ' <i class="layui-icon"></i>'); + $(".laytable-cell-2-0-7").css('color', 'rgba(0, 0, 0, 0)'); + // 閮ㄩ棬浜哄憳 绛涢�� dropdown.render({ @@ -97,7 +113,6 @@ ,{field: 'deptId$', align: 'center',title: '鎵�灞為儴闂�',hide : true} ,{field: 'cstmrIdsReality', align: 'center',title: '瀹為檯鐢叉柟鍗曚綅ID闆嗗悎',hide : true} ,{field: 'status$', align: 'center',title: '鐘舵��',hide : false} - ,{field: 'settle$', align: 'center',title: '杩涘害',hide : false} ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害',hide : true} ,{field: 'weeklyDailyPlan', align: 'center',title: '鏃ヨ鍒�',hide : false, toolbar: '#tbLookPlan'} ,{field: 'weeklyDailyReality', align: 'center',title: '鏃ヨ绋�',hide : false, toolbar: '#tbLookReality'} @@ -107,12 +122,16 @@ ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳',hide : true} ,{field: 'updateTime$', align: 'center',title: 'update_time',hide : true} ,{field: 'memo', align: 'center',title: '澶囨敞锛�50瀛楋級',hide : false} - ,{field: 'director$', align: 'center',title: '瀹℃壒浜�',hide : true} + ,{field: 'director$', align: 'center',title: '瀹℃牳鑺傜偣',hide : true} + ,{field: 'director', align: 'center',title: '瀹℃牳鑺傜偣',hide : true} + ,{field: 'settle', align: 'center',title: '杩涘害',hide : true} ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害',hide : true} + ,{field: 'settle$', align: 'center',title: '杩涘害', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害',hide : true} ,{field: 'cstmrIdsPlan', align: 'center',title: '璁″垝鐢叉柟鍗曚綅ID闆嗗悎',hide : true} ,{field: 'weeklyAll', align: 'center',title: '鍛ㄦ暟',hide : true} ,{field: 'weeklyNowMonth', align: 'center',title: '褰撴湀绗嚑鍛�',hide : true} + ,{field: 'nowUserId', align: 'center', title: 'nowUserId', hide: true, templet:function(){ return nowUserId2 }} ,{field: 'weeklyYear', align: 'center',title: '骞�',hide : true} ,{field: 'weeklyMonth', align: 'center',title: '鏈�',hide : true} ,{field: 'weeklyDay', align: 'center',title: '鏃�',hide : true} @@ -288,7 +307,6 @@ url: baseUrl+"/weekly/delete/auth", headers: {'token': localStorage.getItem('token')}, data: {ids: data.id}, - method: 'POST', traditional:true, success: function (res) { if (res.code === 200){ @@ -336,7 +354,7 @@ cols: [[ {type: 'numbers'} ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'} - ,{field: 'dailyTime$', align: 'center',title: '鏃ユ湡'} + ,{field: 'dailyTime$',width : 120, align: 'center',title: '鏃ユ湡'} ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false} ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false} ,{field: 'comment', title: '璇勮', edit:false} @@ -399,7 +417,7 @@ cols: [[ {type: 'numbers'} ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'} - ,{field: 'dailyTime$', align: 'center',title: '鏃ユ湡'} + ,{field: 'dailyTime$',width : 120, align: 'center',title: '鏃ユ湡'} ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false} ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false} ,{field: 'comment', title: '璇勮', edit:false} @@ -435,8 +453,84 @@ } }); break; + case 'approval': + layer.confirm('瀹℃壒閫氳繃锛�', { + skin: 'layui-layer-admin', + shade: .1, + offset: '200px', + title: data.name + }, function (i) { + layer.close(i); + approval(data.id); + }); + break; + case 'approvalEnd': + layer.confirm('瀹℃壒鎷掔粷锛�', { + skin: 'layui-layer-admin', + shade: .1, + offset: '200px', + title: data.name + }, function (i) { + layer.close(i); + approvalEnd(data.id); + }); + break; } }); + + function approvalEnd(weeklyId, plannerId, dIdx) { + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl+"/weekly/approvalEnd/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + weeklyId: weeklyId, + plannerId: plannerId + }, + method: 'POST', + success: function (res) { + if (dIdx) { + layer.close(dIdx); + } + layer.close(loadIndex); + if (res.code === 200){ + layer.msg(res.msg, {icon: 1}); + tableReload(); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}); + } + } + }) + } + + function approval(weeklyId, plannerId, dIdx) { + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl+"/weekly/approval/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + weeklyId: weeklyId, + plannerId: plannerId + }, + method: 'POST', + success: function (res) { + if (dIdx) { + layer.close(dIdx); + } + layer.close(loadIndex); + if (res.code === 200){ + layer.msg(res.msg, {icon: 1}); + tableReload(); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}); + } + } + }) + } // 鎼滅储 form.on('submit(search)', function (data) { @@ -504,7 +598,12 @@ } } }) + location.reload(); + return false; + }); + $('#cancelBtn').on('click', function () { + location.reload(); }); // 鏄庣粏琛ㄦ牸 var xxDataList = []; @@ -520,6 +619,7 @@ ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'} ,{field: 'workContent', title: '宸ヤ綔鍐呭', style: 'color: blue;font-weight: bold', edit:true} ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', style: 'color: blue;font-weight: bold', edit:true} + ,{field: 'addr', title: '鍦板潃', style: 'color: blue;font-weight: bold', edit:true} ,{field: 'comment', title: '璇勮', style: 'color: blue;font-weight: bold', edit:true} ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', style: 'color: blue;font-weight: bold', edit:true} // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'} @@ -541,7 +641,7 @@ }, done: function (res, curr, count) { $(".layui-table-cell").css('overflow', 'visible');//瑙e喅layui鏁版嵁琛ㄦ牸涓祵濂椾笅鎷夋鏄剧ず闂 - $(".laytable-cell-2-0-6").css('color', 'rgba(0, 0, 0, 0)'); + $(".laytable-cell-2-0-7").css('color', 'rgba(0, 0, 0, 0)'); $(layero).find('.layui-table-view').css('margin', '0'); var options = this; @@ -832,6 +932,7 @@ } } }) + location.reload(); return false; }); // 鏄庣粏琛ㄦ牸 @@ -848,6 +949,7 @@ ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'} ,{field: 'workContent', title: '宸ヤ綔鍐呭', style: 'color: blue;font-weight: bold', edit:true} ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', style: 'color: blue;font-weight: bold', edit:true} + ,{field: 'addr', title: '鍦板潃', style: 'color: blue;font-weight: bold', edit:true} ,{field: 'comment', title: '璇勮', style: 'color: blue;font-weight: bold', edit:true} ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', style: 'color: blue;font-weight: bold', edit:true} // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'} @@ -1130,8 +1232,10 @@ // 鍏抽棴鍔ㄤ綔 $(document).on('click','#data-detail-close', function () { parent.layer.closeAll(); + location.reload(); }); + function tableReload(child) { var searchData = {}; $.each($('#search-box [name]').serializeArray(), function() { -- Gitblit v1.9.1