<template>
	<div class="container" style="padding: 10px;">
		<el-form :inline="true" :model="model" class="demo-form-inline">
		  <el-form-item label="预约ID" v-if="false">
		    <el-input v-model="model.RecordId" placeholder="预约ID"></el-input>
		  </el-form-item>
		  <el-form-item label="用户ID">
		    <el-input v-model="model.UserId" placeholder="用户ID"></el-input>
		  </el-form-item>
		  <el-form-item label="用户名" >
		    <el-input v-model="model.KeyWord" placeholder="用户名"></el-input>
		  </el-form-item>
		  <el-form-item>
		    <el-button type="primary" @click="onSubmit">查询</el-button>
		  </el-form-item>
		</el-form>
		<el-table :data="DetailModel" border style="width: 100%">
			<el-table-column fixed prop="date" label="ID" v-if="false">
				<template slot-scope="scope">
					{{scope.row.id}}
				</template>
			</el-table-column>
			<el-table-column fixed prop="date" label="预约ID">
				<template slot-scope="scope">
					{{scope.row.RecordId}}
				</template>
			</el-table-column>
			<el-table-column prop="name" label="分成金额">
				<<template slot-scope="scope">
					￥{{scope.row.Money/100}}
				</template>
			</el-table-column>
			<el-table-column prop="province" label="用户">
				<<template slot-scope="scope">
					{{scope.row.OperatinUser}}
				</template>
			</el-table-column>
			<el-table-column prop="city" label="添加时间">
				<<template slot-scope="scope">
					{{scope.row.AddTime}}
				</template>
			</el-table-column>
			<el-table-column prop="address" label="用户ID">
				<<template slot-scope="scope">
					{{scope.row.UserId}}
				</template>
			</el-table-column>
		</el-table>
		<el-pagination background layout="prev, pager, next" :total="model.TotalCount" style="text-align: right;margin-top: 10px;" @current-page="Pages">
		</el-pagination>
	</div>
</template>

<script>
	import {
		GetListIncomeDetails
	} from '../../api/incomeDetails.js'
	import utils from '../../utils/utils.js'
	export default {
		data() {
			return {
		
				model: {
					"RecordId": 0,
					"UserId": 0,
					"KeyWord": "",
					"TotalCount": 0,
					"PageIndex": 1,
					"PageSize": 20,
					"Sort": [{
						"Field": "",
						"Type": 0
					}]
				},
				DetailModel:[],
				
			}
		},
		created() {
		this.ShowDetail()
		},
		methods: {
			// 提交查询
			onSubmit(){
				this.ShowDetail()
			},
			Pages(e){
				this.model.PageIndex=e
				this.ShowDetail()
			},
			handleClick(row) {
				console.log(row);
			},
			//查询所有分成数据
			ShowDetail() {
				GetListIncomeDetails(this.model).then(res => {
					console.log('分成数据', res)
					res.data.data.rows.forEach((item,index)=>{
						item.AddTime=utils.formatTime(item.AddTime,"yyyy-MM-dd HH:mm:ss")
					})
					this.DetailModel=res.data.data.rows
					this.model.TotalCount=res.data.data.total
				})
			}
		},

	}
</script>

<style>
</style>
