From 734dfe9eb0a2176103dce8245c69b1194574c68e Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 29 七月 2024 20:16:15 +0800
Subject: [PATCH] 代理新功能完善

---
 src/main/resources/static/admin/agent-withdraw-list.html |  218 +++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 149 insertions(+), 69 deletions(-)

diff --git a/src/main/resources/static/admin/agent-withdraw-list.html b/src/main/resources/static/admin/agent-withdraw-list.html
index 4c20fcf..bcc3e56 100644
--- a/src/main/resources/static/admin/agent-withdraw-list.html
+++ b/src/main/resources/static/admin/agent-withdraw-list.html
@@ -5,8 +5,9 @@
 		<meta charset="UTF-8">
 		<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,minimum-scale=1,maximum-scale=1,user-scalable=no" />
-		<title>璁惧鍒楄〃</title>
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<title>鎻愮幇鍒楄〃</title>
 		<link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
 		<link rel="stylesheet" type="text/css" href="css/admin.css" />
 		<style>
@@ -20,19 +21,32 @@
 		<div class="page-content-wrap">
 			<form class="layui-form" action="" lay-filter='search'>
 				<div class="layui-form-item">
-
 					<div class="layui-inline">
-						<input type="text" name="key" id="key" placeholder="鎸夋笭閬揑D/鍚嶇О鎼滅储" autocomplete="off" class="layui-input">
+						<input type="text" name="key" id="key" placeholder="鎸夋笭閬揑D鎼滅储" autocomplete="off"
+							class="layui-input">
 					</div>
 					<div class="layui-inline">
-						<input type="text" name="day" placeholder="鏃ユ湡" autocomplete="off" class="layui-input">
+						<input type="text" name="startTime" placeholder="寮�濮嬫椂闂�" autocomplete="off" class="layui-input">
 					</div>
-					<button class="layui-btn layui-btn-normal" lay-submit lay-filter="search" id="search"><i class="layui-icon layui-icon-search"></i>鎼滅储</button>
-					<a href="javascript:void();" class="layui-btn layui-btn-warm" onclick="add_agent()"><i class="layui-icon layui-icon-add-circle"></i> 寮�濮嬮缁撶畻</a>
+					<div class="layui-inline">
+						<input type="text" name="endTime" placeholder="缁撴潫鏃堕棿" autocomplete="off" class="layui-input">
+					</div>
+					<div class="layui-inline">
+						<select name="status">
+							<option value="-1">鍏ㄩ儴</option>
+							<option value="2">鏈鐞�</option>
+							<option value="3">宸查�氳繃</option>
+							<option value="4">宸查┏鍥�</option>
+						</select>
+					</div>
+					<button class="layui-btn layui-btn-normal" lay-submit lay-filter="search" id="search"><i
+							class="layui-icon layui-icon-search"></i>鎼滅储</button>
+					<a href="javascript:void();" class="layui-btn" id="pass"> 閫氳繃</a>
+					<a href="javascript:void();" class="layui-btn layui-btn-danger" id="reject"> 椹冲洖</a>
 				</div>
 			</form>
 			<div class="layui-form" id="table-list">
-				<table class="layui-table" lay-even lay-skin="nob" id="table">
+				<table class="layui-table" lay-even lay-skin="nob" id="table" lay-filter="table">
 
 				</table>
 			</div>
@@ -42,19 +56,30 @@
 		<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
 		<script src="js/http_api.js"></script>
 		<!-- <script src="js/common.js" type="text/javascript" charset="utf-8"></script> -->
-		<script>	
-			function delete_agent(id) {
+		<script>
+			function passWidthdraw() {
+				var checkStatus = table.checkStatus('table'); 
+				if(checkStatus.data.length<=0){
+						layer.msg("灏氭湭閫変腑鏁版嵁");
+					return;
+				}
+				console.log(checkStatus.data) //鑾峰彇閫変腑琛岀殑鏁版嵁
+				let ids=[];
+				checkStatus.data.forEach(function(e){
+					ids.push(e.id);
+				});
+
 				layer.confirm('鎮ㄧ‘瀹氳鎵ц姝ゆ搷浣滃悧锛�', {
 					icon: 3,
 					title: '鎻愮ず'
 				}, function(index) {
 					// 纭鎿嶄綔
 					layer.close(index);
-					$.post("/admin/api/agentsettle/delete", {
-						"id": id
+					$.post("/admin/api/agentsettle/pass", {
+						"ids": JSON.stringify(ids)
 					}, function(response) {
 						if (response.code == 0) {
-							layer.msg("鍒犻櫎鎴愬姛");
+							layer.msg("鎵ц鎴愬姛");
 							$("#search").click();
 						} else {
 							layer.msg(response.msg);
@@ -65,41 +90,65 @@
 					});
 				}.bind(this));
 			}
-			
-			function add_agent(){
+
+			function rejectWidthdraw() {
+
+				var checkStatus = table.checkStatus('table');
+				if(checkStatus.data.length<=0){
+						layer.msg("灏氭湭閫変腑鏁版嵁");
+					return;
+				}
+				console.log(checkStatus.data) //鑾峰彇閫変腑琛岀殑鏁版嵁
+				let ids=[];
+				checkStatus.data.forEach(function(e){
+					ids.push(e.id);
+				});
 				
-				if($("input[name=day]").val().length<1){
-						layer.msg("璇烽�夋嫨鏃ユ湡");
-						return false;
-					}
-					
-					$.post("/admin/api/agentsettle/startSettle",$("input[name=day]").val(), function(response) {
+				layer.confirm('鎮ㄧ‘瀹氳鎵ц姝ゆ搷浣滃悧锛�', {
+					icon: 3,
+					title: '鎻愮ず'
+				}, function(index) {
+					// 纭鎿嶄綔
+					layer.close(index);
+					$.post("/admin/api/agentsettle/reject", {
+						"ids": JSON.stringify(ids)
+					}, function(response) {
 						if (response.code == 0) {
-							layer.msg("棰勭粨绠楁垚鍔�");
+							layer.msg("鎵ц鎴愬姛");
+							$("#search").click();
 						} else {
 							layer.msg(response.msg);
 						}
 					}, 'json').fail(function(jqXHR, textStatus, errorThrown) {
+						layer.close(index);
 						layer.msg("缃戠粶璇锋眰澶辫触");
 					});
+				}.bind(this));
 			}
-			
+
 			layui.use(['form', 'jquery', 'layer', 'table', 'laydate'], function() {
 				var table = layui.table;
 				var form = layui.form;
 				var $ = layui.jquery;
 				var laydate = layui.laydate;
-				
-			laydate.render({
-                    elem: "input[name=day]",
-                    type: "date",
-                    value: new Date(),
-                    isInitValue:false
-                });
-				
+
+				laydate.render({
+					elem: "input[name=startTime]",
+					type: "datetime",
+					value: new Date(),
+					isInitValue: false
+				});
+				laydate.render({
+					elem: "input[name=endTime]",
+					type: "datetime",
+					value: new Date(),
+					isInitValue: false
+				});
+
 				let table_option = {
+					id: "table",
 					elem: '#table',
-					url: '/admin/api/agentsettle/list', //鏁版嵁鎺ュ彛
+					url: '/admin/api/agentsettle/listWithdraw', //鏁版嵁鎺ュ彛
 					where: {
 						'key': $("#key").val(),
 						'day': $("input[name=day]").val(),
@@ -135,71 +184,102 @@
 					cols: [
 						[ //琛ㄥご
 							{
+								checkbox: true
+							},
+							{
 								field: 'id',
 								title: 'ID',
 								width: 100,
-								fixed: 'left'
-							},{
+							}, {
 								field: 'agentId',
 								title: '娓犻亾',
 								width: 100,
 								sort: false,
 								templet: function(d) {
-								  return d["agent.name"]+"("+d["agent.id"]+")";		
+									return d["agent.name"] + "<br>" + d["agent.id"];
 								}
-							},  {
+							},
+							{
 								field: 'settleDay',
-								title: '鏃ユ湡',
-								width: 120
-							}, {
-								field: 'settleMoney',
-								title: '棰勭粨绠楅噾棰�',
+								title: '璁㈠崟鍙戠敓鏃ユ湡',
+								width: 100,
+								sort: false,
+							},
+							{
+								field: 'actualSettleMoney',
+								title: '鎻愮幇閲戦',
 								width: 100,
 								sort: false,
 							}, {
-								field: 'createTime',
-								title: '棰勭粨绠楁椂闂�',
+								field: 'alipayName',
+								title: '鏀粯瀹濆鍚�',
+								width: 100,
+								sort: false,
+							}, {
+								field: 'alipayAccount',
+								title: '鏀粯瀹濊处鍙�',
+								width: 100,
+								sort: false,
+							},
+							{
+								field: 'withDrawApplyTime',
+								title: '鍙戣捣鎻愮幇鏃堕棿',
 								width: 180,
-							}, {
-								field: 'actualSettleMoney',
-								title: '瀹為檯缁撶畻閲戦',
-								width: 100,
-								sort: false
-							}, {
-								field: 'settleTime',
-								title: '瀹為檯缁撶畻鏃堕棿',
-								width: 100,
-								sort: false
-							}, {
-								field: 'statusDesc',
+							},
+							{
+								field: '',
 								title: '鐘舵��',
 								width: 100,
+								sort: false,
+								templet: function(d) {
+									switch (d.status) {
+										case 2:
+											return "鏈鐞�";
+										case 3:
+											return "鏀粯鎴愬姛";
+										case 4:
+											return "琚┏鍥�";
+										default:
+											return "鏈煡";
+									}
+								}
+							},
+							{
+								field: 'withDrawProcessTime',
+								title: '澶勭悊鏃堕棿',
+								width: 100,
 								sort: false
-							},  {
+							},
+							{
 								field: '',
 								title: '鎿嶄綔',
 								sort: false,
 								templet: function(d) {
 									var html = "";
-									html += "<div><a href='javascript:void' onclick='delete_agent(" + d.id + ")' class='layui-table-link'>鍒犻櫎</a></div>";
+									html += "<div><a href='javascript:void' onclick='delete_agent(" + d.id +
+										")' class='layui-table-link'>鍒犻櫎</a></div>";
 									return html;
 								}
 							}
 						]
 					]
 				};
-				var key = http_util.getQueryString("key");
-				if (key != null && key != undefined) {
-					form.val("search", {
-						"key": key
-					});
-					table_option.data = [];
-					setTimeout(function() {
-						$("#search").click();
-					}, 100);
-				}
 				//绗竴涓疄渚�
 				let tableIns = table.render(table_option);
+				table.on('checkbox(table)', function(obj) {
+					console.log(obj)
+					// 鏌ヨ鏄惁瑕侀�変腑
+					var checkStatus = table.checkStatus('table');
+					if (checkStatus.data.length <= 0) {
+						$("#pass").addClass("disabled");
+						$("#reject").addClass("disabled");
+					} else {
+						$("#pass").removeClass("disabled");
+						$("#reject").removeClass("disabled");
+					}
+
+				});
+
 				//鐩戝惉鎻愪氦
 				form.on('submit(search)', function(data) {
 					tableIns.reload({
@@ -210,9 +290,9 @@
 					});
 					return false;
 				});
-	
+
 			});
 		</script>
 	</body>
 
-</html>
\ No newline at end of file
+</html>

--
Gitblit v1.8.0