<!-- 费用报销 -->
<template>
	<view v-if="ExpenseBill">
	
		<h4>{{ExpenseBill.DEPT_NAME}}</h4>
		<h3>{{ExpenseBill.ACCEPT_NAME}}</h3>
		<view class="detail-top-base">
			<view class="span24"><text class="text-title">{{ExpenseBill.ExpenseBill.DEPARTMENT_NAME}}</text><text>：</text><text >{{ExpenseBill.STAFF_NAME}}</text></view>
			<text>{{$util.cutDate(ExpenseBill.FINANCEPROINST_CREATEDATE)}}</text>
		</view>
		<view class="detail-top-box">
			<view class="detail-top-bottom ">
				<view class="uni-flex ai-center jc-between" >
					<view class="uni-flex span24" style="align-items: center;" >
						<view class="detail-title">
							<i class="ico ico-ndbz"></i><text class="text-title">报销总额： </text>
							
						</view>
						<text style="color:#ec8538;">￥{{ $util.fmoney(ExpenseBill.PAYMENT_LOWER,2)}}</text>
					</view>
					
				</view>
				<view class="uni-flex span24" style="align-items: top;" v-if="ExpenseBill.ExpenseBill.EXPENDBILL_DETILS">
					<view class="detail-title">
						<i class="ico ico-jfmc"></i><text class="text-title">支付方式：</text> 
						
					</view>
					<text>
						{{ExpenseBill.ExpenseBill.EXPENDBILL_DETILS}}
					</text>
					
				</view>
				<view class="line-block between-circle"></view>
				<view>
					<view class="cost-unit-card" v-for="(item,index) in ExpenseBill.ExpenseDetail" :key="index">
						<view style="line-height: 1.2;">
							<text class="span24 widthAuto">{{item.EXPENSE_ITEM}}：</text>
							<text class="span24 text-title" >{{item.EXPENSE_DETAIL}}</text>
						</view>
						<view class="uni-flex span24 mt20" style="align-items: center;">
							<view class="uni-flex span24" style="align-items: center;">
								
								<i class="ico ico-ndbz"></i>
								<text class="text-title">报销金额：</text>
								<text style="color:#ec8538;">
									￥{{$util.fmoney(item.EXPENSEDETAIL_AMOUNT)}}
								</text>
							</view>
					
							<view class="uni-flex span24 ml36" style="align-items: center;">
								<i class="ico ico-pj"></i>
								<!-- <text class="text-title">
									票据：
								</text> -->
								<text>
									{{item.EXPENSEDETAIL_COUNT}}张
								</text>
							</view>
						</view>
						<view class="uni-flex span24 mt20" style="align-items: center;" v-if="preSubscribefeeMap && preSubscribefeeMap[item.EXPENSEDETAIL_DESC]">
							<i class="ico ico-xmgl"></i>
							<text class="text-title">项目关联：</text>
							<text class="linkText" @tap="clickGetSubscribefee(item.EXPENSEDETAIL_DESC)">{{preSubscribefeeMap[item.EXPENSEDETAIL_DESC].ACCEPT_NAME}}</text>
						</view>
					</view>
				</view>
			</view>

			<ul class="detail-middle-box" v-if="ExpenseBill.FileList || ExpenseBill.ImageList">
				
				<li class="attachment" v-if="ExpenseBill.FileList && ExpenseBill.FileList.length>0">
					<p class="detail-title">
						<i class="ico ico-fj"></i>
						<span>附 件</span>
					</p>
					<div class="imgBox">
						<filesUnit v-for="(file,i) in ExpenseBill.FileList" :fileItem="file" :key="i"></filesUnit>
						
					</div>
				</li>
				<li class="attachment" v-if="ExpenseBill.ImageList && ExpenseBill.ImageList.length>0">
					<div class="detail-title">
						<i class="ico ico-tp"></i>
						<text class="text-title">图 片</text>
					</div>
					<div class="imgBox">
						<image v-for="(arr,i) in ExpenseBill.ImageList" :key="i" :src="arr.IMAGE_URL" @tap="showImg(i)" mode="aspectFill" lazy-load/>
					</div>
				</li>
			
			</ul>
		</view>
		
	</view>

</template>

<script>
	
	import filesUnit from '@/components/filesComponent/fileUnit.vue'
	// import popUp from '@/components/uni-popup.vue'
	export default {
		
		props: ['ExpenseBill'],
		data() {
			return {
				// showPopupMiddle: false
			}
		},
		methods:{
			clickGetSubscribefee(id){
				this.$emit('click',id)
			},
			
			showImg (index){
				this.$emit('showImg',index)
			}
			
		},
		components:{
			filesUnit
		}
	}
</script>

<style scoped>
	@import url("/common/css/expensesTop.css");

	.mt20 {
		margin-top: 20upx;
	}
	.cost-unit-card {
		border-top: none;
		display: flex;
		flex-direction: column;
		/* padding: 0 8upx 0 8upx; */
	}
	.cost-unit-card+.cost-unit-card {
		border-top: 2upx dashed #eee ;
		padding-top: 24upx;
		margin-top: 24upx;
	}
	.linkText {
		margin-left: 16upx;
		text-decoration: underline;
		color: #72aaea;
	}
</style>
