<!--pages/ticketRed/ticketRed.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>
<view class="searchWrap">
	<i class="iconfont icon-search"></i>
	<input bindconfirm="search" class="input shadow" placeholder="搜索发票号码" confirm-type="search" placeholder-class="placeholderStyle"></input>
</view>
<view class="topPlaceholder"></view>
<view wx:if="{{tabIndex===0}}" class="list">
	<view wx:for="{{list}}" wx:key="recordId" class="item selectItem shadow">
		<view class="name">购方名称：{{item.customerName}}</view>
		<view class="line">发票金额：￥{{item.totalAmount}}</view>
		<view class="line">开票时间：{{item.invoiceDate}}</view>
		<view wx:if="{{item.invoiceType==='0'}}" class="line">发票代码：{{item.invoiceCode}}</view>
		<view wx:if="{{item.invoiceType==='0'}}" class="line">发票号码：{{item.invoiceNumber}}</view>
		<view class="line">开票状态：<text class="black">已开票</text></view>
		<button bindtap="toAddred" data-index="{{index}}" class="redBtn">点击红冲</button>
	</view>
</view>
<view wx:if="{{tabIndex===1}}" class="list">
	<view bindtap="toDetail" data-index="{{index}}" wx:for="{{list}}" wx:key="recordId" class="item shadow">
		<view class="name">购方名称：{{item.customerName}}</view>
		<view class="line">红冲金额：￥{{item.totalAmountTaxes}}</view>
		<view class="line">开票时间：{{item.invoiceDate}}</view>
		<view wx:if="{{item.status===2}}" class="line">开票状态：<text class="warning">红冲中</text></view>
		<view wx:if="{{item.status===3}}" class="line">开票状态：<text class="danger">已红冲</text></view>
		<view wx:if="{{item.status===4}}" class="line">开票状态：<text class="blue">失败</text></view>
		<view wx:if="{{item.status===4}}" class="btnGroup">
			<button catchtap="refresh" data-invoiceno="{{item.invoiceReqFlowNo}}" data-index="{{index}}" class="btn fresh">刷新</button>
			<button catchtap="showRetry" data-invoiceno="{{item.invoiceReqFlowNo}}" data-index="{{index}}" class="btn ticket">点击重开</button>
		</view>
		<view wx:if="{{item.status===2}}" class="btnGroup">
			<button catchtap="refresh" data-invoiceno="{{item.invoiceReqFlowNo}}" data-index="{{index}}" class="btn fresh">刷新</button>
		</view>
	</view>
</view>
<loadmore loadmore="{{pages>0&&finish===false}}" finish="{{pages>0&&finish===true}}" nodata="{{pages===0}}"></loadmore>
<ipx-placeholder></ipx-placeholder>