<!--招商审批-->
<template>
	<div>
		<div v-if="isShow">
			<div class='base-info pb20'>
				<view class="content-title">{{baseData.SERVERPART_NAME+baseData.PROJECT_NAME}}</view>
				<p class="box-top">
					<view class="item-title">经办人：<text style="color:#333;font-size:24rpx;">{{baseData.APPLY_STAFF}}</text></view>
					<view class="item-title">申报日期：<text style="color:#333;font-size:24rpx;">{{baseData.APPLY_DATE}}</text></view>
				</p> 
				<block v-if="baseData.OPERATION_TYPE==320200">
					<div class="main-card " v-if="baseData.BUSINESS_ORISITUATION">
						<div class="base-body">
							<p>
								<i class="ico ico-lxfs"></i>
								<span class="item-title">联系方式：</span>
								<span>{{baseData.MOBILEPHONE_NUM}}</span>
							</p>
						</div> 
						<div class="detail-other">
							
							<p class="item-title">
								<i class="ico ico-jyqk"></i>
								<span>原项目经营情况：</span>
							</p>
							<p class="detail-cont">{{baseData.BUSINESS_ORISITUATION}}</p>
						</div>
					</div>
					<view class="main-card">
						<div class="detail-other">
							<p class="item-title">
								<i class="ico ico-zxpp"></i>
								<span>新招商项目（品牌）信息：</span>
							</p>
							<div class="detail-cont"><text class="text-blue">{{baseData.BUSINESS_BRANDNAME}}:</text>{{baseData.BUSINESS_BRANDINTRO}}</div>
						</div>
						<div class="detail-other">
							<p class="item-title">
								<i class="ico ico-ssqy"></i>
								<span>店铺位置：</span>
							</p>
							<p class="detail-cont">{{baseData.SHOP_LOCATION}}</p>
						</div>
						<div class="detail-other">
							<p class="item-title">
								<i class="ico ico-htlx"></i>
								<span>新招商项目结果：</span>
							</p>
							<p class="detail-cont">{{baseData.BUSINESS_SITUATION}}</p>
						</div>
						<div class="detail-other" v-if="baseData.Mnangement_Plan.length>0">
							<p class="item-title">
								<i class="ico ico-qtyq"></i>
								<span>招商方案：</span>
							</p>
							<p class="detail-cont text-blue" v-for="(plan,index) in baseData.Mnangement_Plan" :key="index" @tap="toPage(plan)">
								{{plan.PROJECT_NAME}}
							</p>
						</div>
					</view>
				</block>
				<block v-else-if="baseData.OPERATION_TYPE==320100">
					
					<div class="main-card " >
						<div class="base-body">
							<p>
								<i class="ico ico-lxfs"></i>
								<span class="item-title">联系方式：</span>
								<span>{{baseData.MOBILEPHONE_NUM}}</span>
							</p>
						</div> 
						<div class="detail-other" v-if="baseData.BUSINESS_ORISITUATION">
							<p class="item-title">
								<i class="ico ico-jyqk"></i>
								<span>原项目经营情况：</span>
							</p>
							<p class="detail-cont">{{baseData.BUSINESS_ORISITUATION}}</p>
						</div>
					</div>
					<view class="main-card">
						<div class="detail-other">
							<p class="item-title">
								<i class="ico ico-htlx"></i>
								<span>招商方案：</span>
							</p>
							<p class="detail-cont">{{baseData.PROJEC_SYNOPSIS}}</p>
						</div>
						<div class="detail-other">
							<p class="item-title">
								<i class="ico ico-ssqy"></i>
								<span>业态布局调整位置：</span>
							</p>
							<p class="detail-cont">{{baseData.SHOP_LOCATION}}</p>
						</div>
						
					</view>
				
				</block>
				<!-- 方案调整 -->
				<block v-else-if="baseData.OPERATION_TYPE==320000">
					
					<view class="main-card">
						<div class="base-body">
							<p>
								<i class="ico ico-lxfs"></i>
								<span class="item-title">联系方式：</span>
								<span>{{baseData.MOBILEPHONE_NUM}}</span>
							</p>
						</div> 
						<div class="uni-flex ai-top" style="padding-left: 16rpx;padding-bottom: 12rpx;">
							
								<i class="ico ico-wz"></i>
								<span class="item-title">店铺位置：</span>
								<span style="font-size: 24rpx;">{{baseData.SHOP_LOCATION}}</span>
						</div>
						
						<div class="detail-other">
							<p class="item-title">
								<i class="ico ico-xmgk"></i>
								<span>项目概况</span>
							</p>
							<p class="detail-cont">{{baseData.PROJEC_SYNOPSIS}}</p>
						</div>
						
						
					</view>
				</block>
					<div class="main-card detail-other" v-if="baseData.BUSINESS_CONDITION">
						<p class="item-title">
							<i class="ico ico-swtj"></i>
							<span>商务条件</span>
						</p>
						<p class="detail-cont">{{baseData.BUSINESS_CONDITION}}</p>
					</div>
					<div class="main-card detail-other" v-if="baseData.MNANGEMENT_DESC">
						<p class="item-title">
							<i class="ico ico-ly"></i>
							<span>备注说明</span>
						</p>
						<p class="detail-cont">{{baseData.MNANGEMENT_DESC}}</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>
					
					<view class="button-box" v-if="!isSign && baseData.NOWSTAFF_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)" ><image src="/static/images/bh-btn.png" mode="aspectFit"></image> 驳回</span>
					</view>
					<view class="button-box" v-if="isSign">
						<span @tap="showPop"><i class="iconfont icon-shenhe"></i> 会签</span>
						<span @tap="showPop(3000)"><i class="iconfont icon-bohui"></i> 驳回</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 && 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>
		<div v-else-if="isLoading===false">
			<noFound :nodata="baseData.HIGHWAYPROINST_ID ? false : true"/>
		</div>
	
	</div>
</template>

<script>
	import processUnit from '@/components/auditingProcess/item.vue'
	import filesUnit from '@/components/filesComponent/fileUnit.vue'
	import { mapGetters } from 'vuex'
	export default {
		data() {
		
			return {
				baseData: {
					
				},
				isShow: false,
				isLoading: true,
				rejectApproved:[],
				approveList: [],
				FileList:[],
				cardShow:true,
				isSign: false,
				isResolve: false,
				signInfo: {
					
				}
			}
		},
		components:{
			processUnit,
			filesUnit
		},
		computed: {
			
			...mapGetters({'users':'getUser'})
		},
		methods: {
			// 文件下载
			toPage(item){
				this.$util.toNextRoute('navigateTo',"/pages/investment/investmentDetail?id=" + item.HIGHWAYPROINST_ID)
			},
			getDetail (id) {
				let _this = this
				_this.$request.$get('GetMnangementFlowDetail',{
					HighWayProinstId: id
				}).then(rs => {
					if(!rs.ResultCode ||rs.ResultCode!='100'){
						_this.isShow  = false
					}else{
						
						_this.baseData =  rs.Data
						_this.baseData.APPLY_DATE = _this.$util.cutDate(_this.baseData.APPLY_DATE, 'YYYY-MM-DD')
						
						rs.Data.FileList.map(v => {
							let types = v.ATTACHMENT_DESC.split('.')
							v.type = types[types.length-1]
							v.name = v.ATTACHMENT_DESC
							v.path = v.ATTACHMENT_URL
						})
						
						if(_this.baseData.NOWSTAFF_ID==_this.users.UserId) {
							_this.isResolve=true
						}
					}
					uni.setNavigationBarTitle({
						title: rs.Data.PRODEF_NAME
					})
					_this.$forceUpdate()
					uni.hideLoading()
					setTimeout(function(){
						
						_this.isShow  = true
						_this.isLoading  = false
					},500)
					
				})
			},
			showPop(type) {
				let _this = this
				let url = ''
				switch (type) {
					case 4000: 
							url = '/pages/auditingPop/transfer?businessType=6000&PROINST_ID='+_this.baseData.HIGHWAYPROINST_ID+'&NOWACTINST_ID='+_this.baseData.NOWACTINST_ID
						
						break;
					case 2000:
							url = '/pages/auditingPop/toExamine?businessType=6000&PROINST_ID='+_this.baseData.HIGHWAYPROINST_ID+'&NOWACTINST_ID='+_this.baseData.NOWACTINST_ID+'&ApproName='+_this.baseData.ApproName+'&NeedApproved='+_this.baseData.NeedApproved
						
						break;
					case 3000:
							url = '/pages/auditingPop/reject?businessType=6000&PROINST_ID='+_this.baseData.HIGHWAYPROINST_ID+'&NOWACTINST_ID='+_this.baseData.NOWACTINST_ID
						
						break;
					default:
							url = '/pages/auditingPop/jointlySign?businessType=6000&PROINST_ID='+_this.baseData.HIGHWAYPROINST_ID+'&NOWACTINST_ID='+_this.baseData.NOWACTINST_ID+'&ApproName='+_this.baseData.ApproName+'&ACTDEF_ID='+_this.baseData.ACTDEF_ID
						
						break;
				}
				this.$util.toNextRoute('navigateTo', url)
			}
		},
		onLoad(option) {
			uni.showLoading({
				title:'正在加载'
			})
			this.isLoading = true
			this.getDetail(option.id)
			let _this = this
			uni.$on('6000', function (data){
				if(data) {
					uni.showLoading({
						title:'正在加载'
					})
					_this.isShow = false
					_this.isLoading = true
					_this.getDetail(_this.baseData.HIGHWAYPROINST_ID)
				}
			});
		},
		onUnload() {
			this.$util.addUserBehavior()
			uni.$off('6000');
		},
		onShow() {
			
		},
		onHide() {
			
		}
	}
</script>

<style scoped>
	@import url("/common/css/tenderingDetail.css");
	.text-blue {
		color: #63A0E5;
		text-decoration: underline;
	}
	/* 招商审批 */
	.ico-swtj:before{
		background-image: url('/static/images/investment/swtj.png');
	}
	.ico-wz:before{
		background-image: url('/static/images/investment/wz.png');
	}
	.ico-jyqk:before {
		background-image: url('/static/images/investment/jyqk.png')
	}
	
	.ico-htlx:before {
		background-image: url('/static/images/contract/htsp_htlx.png')
	}
	.ico-zxpp:before {
		background-image: url('/static/images/contract/htsp_zxpp.png')
	}
	.ico-ssqy:before {
		background-image: url('/static/images/contract/htsp_ssqy.png')
	}
	.ico-ly:before {
		background-image: url('/static/images/expense/ly.png')
	}
	
	
</style>
