<template>
	<view>
		<view class="body">
			<uni-collapse :accordion="true">
				<uni-list>
					<view v-for="(equipmentApply,index) in equipmentApplyList" :key="index">
						<uni-list-item :title="equipmentApply.adminUserName" :note="equipmentApply.clientId" 
						:rightText="equipmentApply.managerId" clickable
							@click="onClick(equipmentApply)" />
					</view>
				</uni-list>
			</uni-collapse>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions,
		mapMutations
	} from 'vuex';
	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue';
	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue';
	import uniList from '../../uni_modules/uni-list/components/uni-list/uni-list.vue';
	import uniListItem from '../../uni_modules/uni-list/components/uni-list-item/uni-list-item.vue';
	import uniIcons from '../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue';
	export default {
		data() {
			return {
				equipmentApplyList: [],
				searchClientId: null
			}
		},
		onShow() {
			var token = uni.getStorageSync("token");
			this.globalUser = uni.getStorageSync("globalUser");
			if (token.length > 1) {
				// this.getEquipmentListData();
				// this.getParam();
				this.findEquipmentList();
			} else {
				uni.reLaunch({
					url: '../Login/Login',
				});
			}

		},
		methods: {
			findEquipmentList(){
				var token = uni.getStorageSync("token");
				uni.request({
					url: this.serverurl + '/TEquipmentApply/findEquipmentList',
					header: {
						'token': token
					},
					method: "POST",
					success: (res) => {
						this.equipmentApplyList = res.data.data;
					},
				});
			},
			onClick(equipmentApply){
				uni.navigateTo({
					url: 'lianjieDesc?equipmentApply='+ encodeURIComponent(JSON.stringify(equipmentApply)),
				});
			}
		}
	}
</script>

<style>

</style>
