<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"
					@tap.stop="$navigateTo('/subPages/indexPage/invoiceDetail/invoiceDetail?invoiceId='+item.id)">
					<view class="title">{{item.name}}</view>
					<view class="date">{{item.createTime}}</view>
					<view class="other">
						<view class="item">
							<view class="label">纳税人识别号</view>
							<view class="value">{{item.taxpayerIdentificationNumber}}</view>
						</view>
						<view class="item">
							<view class="label">发票金额</view>
							<view class="value color-error">{{item.amount || '-'}}</view>
						</view>
					</view>
					<view class="state">
						<view class="tag">
							<view class="status-tag info" v-if="!item.state">开具中</view>
							<view class="status-tag success" v-else>已开具</view>
						</view>
						<view class="tag">
							<view class="status-tag primary"
								@tap.stop="$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="15">
						</uni-icons>
					</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	import {
		getInvoiceListByQueryAndPage
	} 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 getInvoiceListByQueryAndPage(index, size, {
					organizationId: 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>