<!--招标变更-->
<template>
	<div>
		<div v-if="isShow">
			<div class='base-info pb20 pt20'>
				<view class="content-title" :class="{'is-important':baseData.ISFORMAT}">{{baseData.COMPACT_NAME}}</view>
				<view class="box-top">
					<view class="item-title">{{baseData.ORGANIZER}}：<text style="color:#333;">{{baseData.ORGANIZER_LINKMAN}}</text></view>
					<view class="item-title">报审时间：<text style="color:#333;">{{baseData.HIGHWAYPROINST_CREATEDATE}}</text></view>
				</view> 
				<view class="main-card" v-if="baseData.OPERATION_TYPE== '310010'">
					<div class="base-body" >
						<p> 
							<i class="ico ico-pp"></i>
							<span class="item-title">经营品牌：</span>
							<span>{{baseData.BRAND_NAME}} </span>
						</p>
					</div>
					
					<div class="base-body" v-if="baseData.COOPERANT_TYPE==1000">
						<p>
							<i class="ico ico-htje"></i>
							<span class="item-title">租金总额：</span>
							<span class="item-price">{{baseData.COMPACT_AMOUNT}} 元</span>
							<span class="ml10 other-coast">{{baseData.GUARANTEERATIO}}元/日</span>
						</p>
						
					</div>
					<div class="base-body" v-else>
						<p>
							<i class="ico ico-htje"></i>
							<span class="item-title">保底总额：</span>
							<span class="item-price">{{baseData.COMPACT_AMOUNT}} 元</span>
							<span class="ml10 other-coast">提成 {{baseData.GUARANTEERATIO}}%</span>
						</p>
						
					</div>
					<div class="base-body" v-if="baseData.COMPACT_STARTDATE && baseData.COMPACT_ENDDATE">
						<p> 
							<i class="ico ico-sj"></i>
							<span class="item-title">起止时间：</span>
							<span>{{baseData.COMPACT_STARTDATE}} - {{baseData.COMPACT_ENDDATE}}</span>
						</p>
					</div>
					<div class="base-body" >
						<p> 
							<i class="ico ico-htlx"></i>
							<span class="item-title">合作模式：</span>
							<span>{{baseData.COOPERANT_TYPE_TEXT}} </span>
						</p>
						<p>
							<i class="ico ico-lx"></i>
							<span class="item-title">展销类型：</span>
							<span>{{baseData.COMPACT_TYPE_TEXT}} </span>
						</p>
					</div>
					<div class="base-body" >
						<p> 
							<i class="ico ico-ssqy"></i>
							<span class="item-title">所属区域：</span>
							<span>{{baseData.SERVERPARTREGION}} </span>
						</p>
						<p>
							<i class="ico ico-zdmj"></i>
							<span class="item-title">占地面积：</span>
							<span>{{baseData.FLOORSPACE}} m²</span>
						</p>
					</div>
					<div class="base-body">
						<p>
							<i class="ico ico-bzj"></i>
							<span class="item-title">保 证 金：</span>
							<span >{{baseData.SECURITYDEPOSIT}}</span>
							<span class="ml10"> 元</span>
						</p>
						<p>
							<i class="ico ico-dyj"></i>
							<span class="item-title">抵 押 金：</span>
							<span>{{baseData.SAFETYRISKMORTGAGE}}</span>
							<span class="ml10"> 元</span>
						</p>
					</div>
				</view>
				<view class="main-card" v-else>
					<div class="base-body" v-if="baseData.COMPACT_STARTDATE && baseData.COMPACT_ENDDATE">
						<p> 
							<i class="ico ico-sj"></i>
							<span class="item-title">起止时间：</span>
							<span>{{baseData.COMPACT_STARTDATE}} - {{baseData.COMPACT_ENDDATE}}</span>
						</p>
					</div>
					
					<div class="base-body" v-if="baseData.COMPACT_AMOUNT>0 && baseData.COMPACT_TYPE_TEXT!=='经营管理合同'">
						<p>
							<i class="ico ico-htje"></i>
							<span class="item-title">合同金额：</span>
							<span class="item-price">{{baseData.COMPACT_AMOUNT}} 万元</span>
							
						</p>
						
					</div>
					<div class="base-body" v-else>
						<p>
							<i class="ico ico-ndbz"></i>
							<span class="item-title">保底营业：</span>
							<span class="item-price">{{baseData.COMPACT_AMOUNT}} 万元</span>
							
						</p>
						<p v-if="baseData.GUARANTEERATIO">
							<i class="ico ico-tcbl"></i>
							<span class="item-title">提成比例：</span>
							<span >{{baseData.GUARANTEERATIO}}</span>
							<span class="ml10"> %</span>
						</p>
					</div>
					
					
					<div class="base-body" >
						<p>
							<i class="ico ico-htlx"></i>
							<span class="item-title">合同类型：</span>
							<span >{{baseData.COMPACT_TYPE_TEXT}}</span>
						</p>
						<p>
							<i class="ico ico-qdcx"></i>
							<span class="item-title">签订程序：</span>
							<span>{{baseData.SECONDPART_OBLIGOR_TEXT}}</span>
						</p>
					</div>
					<div class="base-body">
						<p>
							<i class="ico ico-bzj"></i>
							<span class="item-title">保 证 金：</span>
							<span >{{baseData.SECURITYDEPOSIT}}</span>
							<span class="ml10"> 万元</span>
						</p>
						<p>
							<i class="ico ico-dyj"></i>
							<span class="item-title">抵 押 金：</span>
							<span>{{baseData.SAFETYRISKMORTGAGE}}</span>
							<span class="ml10"> 万元</span>
						</p>
					</div>
				</view>
				
				<div class="main-card">
					<div class="card-title">
						<span class="card-header-text">甲方</span>
						{{baseData.FIRSTPART_NAME}}
					</div>
					<div class="card-content">
						<span class="man-name" style="flex:1;">{{baseData.FIRSTPART_LINKMAN}}</span>
						<span class="ico ico-dh" style="flex:2;">{{baseData.FIRSTPART_TEL}}</span>
						<span class="ico ico-mobile" style="flex:2;">{{baseData.FIRSTPART_MOBILE}}</span>
					</div>
				</div>
				<div class="main-card">
					<div class="card-title">
						<span class="card-header-text">乙方</span>
						{{baseData.SECONDPART_NAME}}
					</div>
					<div class="card-content">
						<span class="man-name" style="flex:1;">{{baseData.SECONDPART_LINKMAN}}</span>
						<span class="ico ico-dh" style="flex:2;">{{baseData.SECONDPART_TEL}}</span>
						<span class="ico ico-mobile" style="flex:2;">{{baseData.SECONDPART_MOBILE}}</span>
					</div>
				</div>
			
				<div class="main-card detail-other" v-if="baseData.COMPACT_DPDESC">
					<p class="item-title">
						<i class="ico ico-bz"></i>
						<span>备注说明：</span>
					</p>
					<p class="detail-cont">{{baseData.COMPACT_DPDESC}}</p>
				</div>
				
				<div class="main-card detail-other" v-if="baseData.FileList.length>0">
					<p class="item-title">
						<i class="ico ico-fj"></i>
						<span>附 件：</span>
					</p>
					<div class="imgBox">
						<filesUnit v-for="(file,i) in baseData.FileList" :fileItem="file" :key="i"></filesUnit>
						
					</div>
				</div>
					
			<!-- v-if="isResolve" -->
				<view class="button-box" v-if="baseData.USER_ID==users.UserId" >
					<span @tap="showPop(4000)"><image src="../../static/images/yj-btn.png" mode="aspectFit"></image> 移交 </span>
					<span @tap="showPop(2000)"><image src="../../static/images/sh-btn.png" mode="aspectFit"></image> 审核 </span>
					<span @tap="showPop(3000)" v-if="baseData.CAN_REJECT===1"><image src="../../static/images/bh-btn.png" mode="aspectFit"></image> 驳回</span>
				</view>
				
			</div>
			
			
			<view class="base-info" v-if="baseData.RejectList.length>0">
				<div class="uni-list-cell uni-collapse">
					<div class="cat-box uni-list-cell-navigate">
						<b>驳回意见</b>
					</div>
					<div class="process-box uni-collapse-content uni-active">
						<processUnit :item="baseData.RejectList[0]" :approveType="0"/>
					</div>
				</div>
			</view>
			<view class="base-info" v-if="baseData.ApprovedList.length>0">
				<div class="uni-list-cell uni-collapse">
					<div class="cat-box uni-list-cell-navigate" :class="cardShow ? ' uni-navigate-bottom' : 'uni-navigate-right'" @tap="cardShow =!cardShow">
						<b>审批流程</b>
					</div>
					<div class="process-box uni-collapse-content" :class="cardShow ? 'uni-active' : ''" v-show="cardShow">
						<processUnit v-for="item in baseData.ApprovedList" :item="item" :key="item.APPROVED_ID" :approveType="1"/>
					</div>
				</div>
			</view>
		</div>
		<block v-else>
			<noFound v-if="loadingType === 2" :foundType="foundType" />
		</block>
		
	</div>
</template>

<script>
	import {mapGetters} from 'vuex'
	import processUnit from '@/components/auditingProcess/item.vue'
	import filesUnit from '@/components/filesComponent/fileUnit.vue'
	export default {
		data() {

			return {
				baseData: {
					
				},
				isShow: false,
				loadingType: 1,
				foundType:0,
				
				rejectApproved:[],
				approveList: [],
				FileList:[],
				cardShow:true,
				isSign: false,
				isResolve: false,
				signInfo: {
					
				}
			}
		},
		components:{
			processUnit,
			filesUnit
		},
		computed: {
			...mapGetters({'users':'getUser'}),
			
		},
		methods: {
			
			getDetail (id) {
				let _this = this
				_this.$request.$get('GetCompactDetail',{
				// _this.$request.$webGet('BusinessProcess/GetCompactFlowDetail',{
					HighWayProinstId: id
				}).then(rs => {
					if(!rs.ResultCode ||rs.ResultCode!='100') {
					// if(!rs.Result_Code ||rs.Result_Code!='100') {
						_this.foundType = 2
						
					}else{
						_this.isShow = true
					}
					uni.hideLoading()
					
					_this.baseData = rs.Data// rs.Result_Data
					_this.baseData.COMPACT_STARTDATE = _this.baseData.COMPACT_STARTDATE!='' ? _this.$util.cutDate(_this.baseData.COMPACT_STARTDATE, 'YYYY.MM.DD'): ''
					_this.baseData.COMPACT_ENDDATE = _this.baseData.COMPACT_ENDDATE !='' ? _this.$util.cutDate(_this.baseData.COMPACT_ENDDATE, 'YYYY.MM.DD'): ''
					_this.baseData.HIGHWAYPROINST_CREATEDATE = _this.$util.cutDate(_this.baseData.HIGHWAYPROINST_CREATEDATE, 'YYYY.MM.DD')
					// _this.baseData.BUDGET_AMOUNT = _this.$util.fmoney(_this.baseData.BUDGET_AMOUNT)
					
					_this.baseData.FileList.map(v => {
						let name= v.ATTACHMENT_DESC.split('.')
						v.type = name[name.length-1]
						v.name = v.ATTACHMENT_DESC
						v.path = v.ATTACHMENT_URL
					})
					if(_this.baseData.USER_ID==_this.users.UserId) { // 判断是否是当前审核人
						_this.isResolve= true
					}
						
					
				})
			},
			showPop(type) {
				let _this = this
				let url = ''
				switch (type) {
					case 4000: 
							url = '/pages/auditingPop/transfer?businessType=1000&PROINST_ID='+_this.baseData.HIGHWAYPROINST_ID+'&NOWACTINST_ID='+_this.baseData.NOWACTINST_ID
						break;
					case 2000:
							url = '/pages/auditingPop/toExamine?businessType=1000&PROINST_ID='+_this.baseData.HIGHWAYPROINST_ID+'&NOWACTINST_ID='+_this.baseData.NOWACTINST_ID+'&ApproName='+_this.baseData.ACTINST_NAME+'&NeedApproved='+_this.baseData.NeedApproved
						break;
					case 3000:
							url = '/pages/auditingPop/reject?businessType=1000&PROINST_ID='+_this.baseData.HIGHWAYPROINST_ID+'&NOWACTINST_ID='+_this.baseData.NOWACTINST_ID
						break;
					
				}
				this.$util.toNextRoute('navigateTo', url)
			}
		},
		onLoad(option) {
	
			uni.showLoading({
				title:'正在加载'
			})
			this.getDetail(option.id)
			let _this = this
			
			uni.$on('1000', function (data){
				if(data) {
					uni.showLoading({
						title:'正在加载'
					})
					_this.getDetail(_this.baseData.HIGHWAYPROINST_ID)
				}
			});
		},
		onShow() {
			
		},
		onUnload() {
			this.$util.addUserBehavior()
			uni.$off('1000');
		},
		onHide() {
		
			
		}
	}
</script>

<style scoped>
	@import url("../../common/css/tenderingDetail.css");
	.pt30 {
		padding-top: 32rpx;
	}
	.is-important:after {
		content: '重要';
		padding: 0rpx 8rpx;
		border: 1rpx solid #E5A06E;
		color: #E5A06E;
		font-size: 22rpx;
		margin-left: 16rpx;
		border-radius: 8rpx;
	}
	.card-title {
		display: flex;
		color: #333;
		font-size: 26rpx;
		justify-content: flex-start; 
		align-items: baseline;
		padding: 0 24rpx;
	}
	.card-header-text {
		background-color: #A6AECA;
		color: #fff;
		min-width: 80rpx;
		text-align: center;
		border-radius: 8rpx;  
		margin-right: 16rpx;
		font-size: 26rpx;
		line-height: 1.6;
	}
	.card-content {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 16rpx;
		padding: 0 24rpx;
		
	}
	.card-content span {
		display: flex;
		align-items: center;
		font-size: 26rpx;
	}
	.man-name {
		color: #63A0E5;
		font-size: 26rpx;
	}
	.other-coast {
		color: #AE875F;
		background: linear-gradient(to top, #ebddcf , #fcfbf8);
		border-radius: 6rpx;
		font-size: 20rpx;
		padding: 0 10rpx;
		margin-left: 16rpx;
	}
	.ico-sj:before  {
		background-image: url('/static/images/contract/htsp_sj.png')
	}
	.ico-pp:before  {
		background-image: url('/static/images/contract/htsp_zxpp.png')
	}
	.ico-lx:before  {
		background-image: url('/static/images/contract/htsp_zxlx.png')
	}
	.ico-zdmj:before  {
		background-image: url('/static/images/contract/htsp_zdmj.png')
	}
	.ico-ssqy:before  {
		background-image: url('/static/images/contract/htsp_ssqy.png')
	}
	.ico-htje:before {
		background-image: url('/static/images/contract/htsp_je.png')
	}
	.ico-ndbz:before {
		background-image: url('/static/images/contract/htsp_yye.png')
	}
	.ico-tcbl:before {
		background-image: url('/static/images/contract/htsp_tcbl.png')
	}
	.ico-htlx:before {
		background-image: url('/static/images/contract/htsp_htlx.png')
	}
	.ico-qdcx:before {
		background-image: url('/static/images/contract/htsp_qdcx.png')
	}
	.ico-bzj:before {
		background-image: url('/static/images/contract/htsp_bxj.png')
	}
	.ico-dyj:before {
		background-image: url('/static/images/contract/htsp_dyj.png')
	}
	.ico-dh:before {
		background-image: url('/static/images/contract/htsp_dh.png')
	}
	.ico-mobile:before {
		background-image: url('/static/images/contract/htsp_mobile.png')
	}
</style>
