<!--pages/ticketQuery/ticketQuery.wxml-->
<view class="tabBar shadow">
	<view bindtap="switchTab" data-index="{{0}}" class="tabItem {{tabIndex===0?'active':''}}">全部</view>
	<view bindtap="switchTab" data-index="{{1}}" class="tabItem {{tabIndex===1?'active':''}}">开票中</view>
	<view bindtap="switchTab" data-index="{{2}}" class="tabItem {{tabIndex===2?'active':''}}">开票成功</view>
</view>
<view class="searchWrap">
	<i class="iconfont icon-search" />
	<input
	 bindconfirm="search"
	 class="input shadow"
	 placeholder="企业名称"
	 confirm-type="search"
	 placeholder-class="placeholderStyle"
	/>
</view>
<view class="pickerGroup">
	<picker
	 wx:if="{{tabIndex===0}}"
	 bindchange="setStatus"
	 value="{{statusIndex}}"
	 range="{{statusList}}"
	 class="picker shadow"
	>
		<view class="inner">
			<text wx:if="{{statusIndex!==''}}" class="text">{{statusList[statusIndex]}}</text>
			<text wx:if="{{statusIndex===''}}" class="text">全部状态</text>
			<view wx:if="{{statusIndex!==''}}" catchtap="clearStatus" class="iconfont icon-fail" />
		</view>
	</picker>
	<picker bindchange="setStart" mode="date" class="picker shadow">
		<view class="inner">
			<text wx:if="{{invoiceDateBegin}}" class="text">{{invoiceDateBegin}}</text>
			<text wx:if="{{invoiceDateBegin===''}}" class="text">开始时间</text>
			<view wx:if="{{invoiceDateBegin!==''}}" catchtap="clearStart" class="iconfont icon-fail" />
		</view>
	</picker>
	<picker bindchange="setEnd" mode="date" class="picker shadow">
		<view class="inner">
			<text wx:if="{{invoiceDateEnd}}" class="text">{{invoiceDateEnd}}</text>
			<text wx:if="{{invoiceDateEnd===''}}" class="text">结束时间</text>
			<view wx:if="{{invoiceDateEnd!==''}}" catchtap="clearEnd" class="iconfont icon-fail" />
		</view>
	</picker>
</view>
<view class="topPlaceholder" />
<view class="list">
	<view
	 bindtap="toDetail"
	 data-index="{{index}}"
	 data-hongchong="{{item.hongchongFlag}}"
	 wx:for="{{list}}"
	 wx:key="recordId"
	 class="item shadow"
	>
		<view class="name">购方名称：{{item.customerName}}</view>
		<view wx:if="{{item.invoiceType===0}}" class="line">发票类型：蓝字发票</view>
		<view wx:if="{{item.invoiceType===1}}" class="line">发票类型：红字发票</view>
		<view wx:if="{{item.invoiceType===2}}" class="line">发票类型：空白作废发票</view>
		<view wx:if="{{item.invoiceCategory===1}}" class="line">发票种类：增值税普通电子发票</view>
		<view wx:if="{{item.invoiceCategory===2}}" class="line">发票种类：增值税电子专用发票</view>
		<view wx:if="{{item.invoiceCategory===3}}" class="line">发票种类：增值税普通纸质发票</view>
		<view wx:if="{{item.invoiceCategory===4}}" class="line">发票种类：增值税专用纸质发票</view>
		<view wx:else class="line">发票金额：￥{{item.totalAmountTaxes}}</view>
		<view class="line">开票时间：{{item.invoiceDate}}</view>
		<view class="line">开票状态：{{item.invoiceStatusMemo}}</view>
		<view wx:if="{{item.status===3}}" class="btnGroup">
			<button
			wx:if="{{item.status===3 && (item.invoiceCategory===1 || item.invoiceCategory===3)}}"
			 catchtap="invoiceHongChong"
			 data-invoiceno="{{item}}"
			 data-index="{{index}}"
			 class="btn ticket"
			>立即红冲
			</button>
			<button
			wx:if="{{item.isInvalid===true && item.invoiceCategory===3}}"
			 catchtap="invoiceInvalid"
			 data-invoiceno="{{item}}"
			 data-index="{{index}}"
			 class="btn ticket"
			>发票作废
			</button>
		</view>
	</view>
</view>
<loadmore loadmore="{{pages>0&&finish===false}}" finish="{{pages>0&&finish===true}}" nodata="{{pages===0}}" />
<ipx-placeholder/>

