<template>
	<!-- <el-descriptions title="详情信息">
    <el-descriptions-item label="姓名">{{tableData.name}}</el-descriptions-item>
    <el-descriptions-item label="id">{{tableData.id}}</el-descriptions-item>
    <el-descriptions-item label="起始时间">{{tableData.createdAt}}</el-descriptions-item>
		<el-descriptions-item label="结束时间">{{tableData.updatedAt}}</el-descriptions-item>
    <el-descriptions-item label="银行账户">{{tableData.bankAccount}}</el-descriptions-item>
    <el-descriptions-item label="银行名称">{{tableData.bankName}}</el-descriptions-item>
		<el-descriptions-item label="deletedAt">{{tableData.deletedAt}}</el-descriptions-item>
		<el-descriptions-item label="isDeleted">{{tableData.isDeleted}}</el-descriptions-item>
</el-descriptions> -->
	<div class="form">
		<el-descriptions title="详情信息">
			<el-descriptions-item label="id">{{tableData.id}}</el-descriptions-item>
			<el-descriptions-item label="起始时间">{{tableData.createdAt}}</el-descriptions-item>
			<el-descriptions-item label="状态">{{tableData.statusText}}</el-descriptions-item>
		</el-descriptions>
		<el-form ref="form" :model="tableData" label-width="80px">
			<el-form-item label="姓名" prop="tableData.name">
				<el-input v-model="tableData.name" style="width: 300px;"></el-input>
			</el-form-item>
			<el-form-item label="银行账户" prop="tableData.bankAccount">
				<el-input v-model="tableData.bankAccount" style="width: 300px;"></el-input>
			</el-form-item>
			<el-form-item label="银行名称" prop="tableData.bankName">
				<el-input v-model="tableData.bankName" style="width: 300px;"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" @click="onSubmit">提交修改</el-button>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				tableData: {
					name: '',
					bankAccount: '',
					bankName: '',
					id: '',
					createdAt:'',
					status:'',
					statusText:'',
					
				},
			}
		},
		mounted() {
			let id = this.$route.query.id
			this.$request({
				url: '/api/Drawer/' + id,
				method: 'get',
			}).then((res) => {
				this.tableData = res.data
				this.talbeData = this.$route.query.id
			})
		},
		methods: {
			onSubmit() {
				this.$request({
					url: '/api/Drawer/update',
					method: 'post',
					data: this.tableData
				}).then((res) => {
					if (res.code == 200) {
						this.$message({
							type: 'success',
							message: '修改成功!'
						})
					} else {
						this.$message({
							type: 'danger',
							message: '修改失败!'
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.form{
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
</style>
