<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>收款码</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
<script src="https://cdn.bootcss.com/dayjs/1.7.8/dayjs.min.js"></script>
<script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/5.0.1/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/5.0.1/js/fileinput.min.js"></script>
<script src="/js/common/common.js"></script>
<link href="/css/common/common.css" rel="stylesheet" type="text/css">
<style type="text/css">
.account-change {
	background-color: #fff;;
	margin-bottom: 1rem;
	display: flex;
	padding-left: 1.2rem;
	padding-right: 0.2rem;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}

.account-change-body {
	flex: 4;
	display: flex;
	flex-direction: column;
}

.account-change-body-item label {
	text-align: end;
	width: 5rem;
	margin-right: 0.5rem;
}

.account-change-body-item span {
	min-width: 5rem;
	display: inline-block;
}

.account-change-body-item button {
	width: 48%;
}

.account-change-body-item-highlight {
	color: #c3606a;
}

.page-link {
	color: #007bff !important
}
</style>
</head>

<body>
	<div th:replace="common/header::html"></div>
	<div id="gatheringCode" v-cloak>
		<div class="page-body" style="background: #f2f2f2;" v-show="showGatheringCodeFlag">
			<button type="button" style="margin-top: 0.3rem;" class="btn btn-outline-info btn-lg btn-block" v-on:click="showEditGatheringCodePage()">添加收款码</button>
			<div class="input-group" style="padding-bottom: 0.3rem; padding-top: 0.3rem;">
				<select class="form-control" style="width: 2.2rem; height: 3rem;" v-model="state">
					<option value="">状态</option>
					<option v-for="dictItem in gatheringCodeStateDictItems" :value="dictItem.dictItemCode">{{dictItem.dictItemName}}</option>
				</select> <select class="form-control" style="width: 6.2rem; height: 3rem;" v-model="gatheringChannelCode">
					<option value="">收款渠道</option>
					<option v-for="dictItem in gatheringChannelDictItems" :value="dictItem.dictItemCode">{{dictItem.dictItemName}}</option>
				</select>
				<div class="input-group-append">
					<button class="btn btn-outline-secondary" type="button" v-on:click="query">查询</button>
				</div>
			</div>
			<div class="account-change" v-for="gatheringCode in gatheringCodes">
				<div class="account-change-body">
					<div class="account-change-body-item">
						<label>创建时间:</label> <span>{{gatheringCode.createTime}}</span>
					</div>
					<div class="account-change-body-item">
						<label>收款渠道:</label> <span>{{gatheringCode.gatheringChannelName}}</span><label>状态:</label> <span>{{gatheringCode.stateName}}</span>
					</div>
					<div class="account-change-body-item">
						<label> 收款金额: </label> <span class="account-change-body-item-highlight">{{gatheringCode.fixedGatheringAmount ? gatheringCode.gatheringAmount + '元' : '不固定'}}</span><label>收款人:</label> <span class="account-change-body-item-highlight">{{gatheringCode.payee}}</span>
					</div>
					<div class="account-change-body-item">
						<button class="btn btn-outline-info btn-lg" type="button" v-on:click="showEditGatheringCodePage(gatheringCode.id)">编辑</button>
						<button class="btn btn-outline-danger btn-lg" type="button" v-on:click="delGatheringCode(gatheringCode.id)">删除</button>
					</div>
				</div>
			</div>
			<div style="padding-left: 13rem;">
				<ul class="pagination">
					<li class="page-item"><a class="page-link" v-show="totalPage > 0 && pageNum > 1" v-on:click="prePage">上一页</a></li>
					<li class="page-item"><a class="page-link" v-show="pageNum >= 1 && pageNum < totalPage" v-on:click="nextPage">下一页</a></li>
				</ul>
			</div>
		</div>
		<div class="page-body" style="background: #f2f2f2;" v-show="showEditGatheringCodeFlag">
			<div class="container" style="margin-top: 1.3rem;">
				<form>
					<div class="form-group">
						<label>收款渠道:</label> <select class="form-control" v-model="editGatheringCode.gatheringChannelCode">
							<option value="">请选择</option>
							<option v-for="dictItem in gatheringChannelDictItems" :value="dictItem.dictItemCode">{{dictItem.dictItemName}}</option>
						</select>
					</div>
					<div class="form-group">
						<label>状态:</label> <select class="form-control" v-model="editGatheringCode.state">
							<option value="">请选择</option>
							<option v-for="dictItem in gatheringCodeStateDictItems" :value="dictItem.dictItemCode">{{dictItem.dictItemName}}</option>
						</select>
					</div>
					<div class="form-group">
						<label> <span> 收款金额:</span>
							<div class="custom-control custom-checkbox custom-control-inline" v-on:click="switchGatheringAmountMode">
								<input type="checkbox" id="fixedGatheringAmount" class="custom-control-input" v-model="editGatheringCode.fixedGatheringAmount"> <label for="fixedGatheringAmount" class="custom-control-label">固定收款金额</label>
							</div>
						</label> <input type="number" class="form-control" v-model="editGatheringCode.gatheringAmount" :disabled="!editGatheringCode.fixedGatheringAmount">
					</div>
					<div class="form-group">
						<label>收款人:</label> <input type="text" class="form-control" v-model="editGatheringCode.payee">
					</div>
					<div class="form-group">
						<label>收款码:</label> <input type="file" class="form-control gathering-code-pic">
					</div>
					<button type="button" class="btn btn-danger btn-lg btn-block" v-on:click="addOrUpdateGatheringCode">保存</button>
					<button type="button" class="btn btn-light btn-lg btn-block" v-on:click="hideEditGatheringCodePage">返回</button>
				</form>
			</div>
		</div>
	</div>
	<div th:replace="common/footer::html"></div>
	<script type="text/javascript" src="/js/gathering-code.js"></script>
</body>
</html>