<template>
	<view class="order-list">
		<z-paging ref="paging" v-model="dataList" @query="queryList">
			<view class="common-list">
				<view class="common-item" v-for="(item,index) in dataList" :key="item.id">
					<view class="title">{{item.contractName}}</view>
					<view class="date">{{item.createDate}}</view>
					<view class="other">
						<view class="item">
							<view class="label">订单编号</view>
							<view class="value">{{item.orderNo}}</view>
						</view>
						<view class="item">
							<view class="label">签约时间</view>
							<view class="value">{{item.updateDate || '-'}}</view>
						</view>
					</view>
					<view class="state">
						<view class="tag">
							<view class="status-tag info" v-if="!item.state">待客户确认</view>
							<view class="status-tag warning" v-if="item.state === 1">服务商签署</view>
							<view class="status-tag warning" v-if="item.state === 2">待客户签署</view>
							<view class="status-tag success" v-if="item.state === 3">已签约</view>
						</view>
						<view class="tag">
							<view class="status-tag primary"
								@tap="$navigateTo('/subPages/indexPage/orderDetail/orderDetail?orderNo='+item.orderNo)">
								查看订单
							</view>
						</view>
					</view>
					<view class="icon">
						<uni-icons custom-prefix="iconfont" :type="menu.iconClass" color="#08979c" size="30">
						</uni-icons>
					</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	import {
		getContractListByQueryAndPage
	} from '@/request/api/workark.js'
	export default {
		data() {
			return {
				dataList: [],
				productLevelId: ''
			}
		},
		onLoad(body) {
			this.productLevelId = body.productLevelId;
		},
		methods: {
			async queryList(index, size) {
				let orderData = await getContractListByQueryAndPage(index, size, {
					payOrganizationId: this.$store.getters.organization.id
				})
				if (orderData.state) return this.$refs.paging.complete(orderData.data.dataList);
				this.$refs.paging.complete(false);
			}
		}
	}
</script>

<style lang="scss" scoped></style>