<script setup lang="ts">
import {useRoute} from 'vue-router';
import layout from '/@/views/h5/layout/index.vue';
import {getMixedReformByProcessInstanceIdAPI} from "/@/api/investment/mixedReform";

interface showText {
	title?: string;
	label?: string;
	content?: string;
	key?: string;
	isFile?: boolean;
	isOneCol?:boolean;
	unit?: string;
	isTableTitle?: boolean;
	children?: showText[]
}
const showTextArray = reactive<showText[]>([
	{label:'项目名称',key:'projectName',isFile:false},
	{label:'年度',key:'projectYear',isFile:false},
	{label:'实施企业名称(全称)',key:'implementEnterprise',isFile:false,isOneCol:true},
	{label:'实施企业统一社会信用代码',key:'enterpriseCreditCode',isFile:false},
	{label:'混改方式',key:'mixedReformMethod',isFile:false},
	{label:'合作方性质',key:'partnerNature',isFile:false,isOneCol:true},
	{label:'合作方名称',key:'partnerName',isFile:false},
	{label:'混改类型',key:'mixedReformType',isFile:false},
	{label:'推进情况',key:'progressStatus',isFile:false,isOneCol:true},
	{label:'上报单位',key:'reportingUnit',isFile:false},
	{label:'最近更新时间',key:'updateTime',isFile:false},
	{label:'最近更新人',key:'updateBy',isFile:false},
	{label:'最近更新的报送状态',key:'pushStatus',isFile:false},
])
const testData = reactive({
	reportingUnit: 'XX市国资委',
	contactPerson: '张经理',
	contactPhone: '13800138000',
	groupBelonging: 'XX城市建设投资集团',
	projectYear: 2024,
	projectName: 'XX市智慧城市建设项目',
	implementEnterprise: 'XX市城市建设投资有限公司',
	enterpriseCreditCode: '91310000123456789A',
	mixedReformMethod: '股权转让+增资扩股',
	partnerNature: '民营企业',
	isIndustryLeader: '是',
	partnerName: 'XX科技集团有限公司',
	mixedReformType: '股权多元化',
	progressStatus: '已完成尽职调查，正在进行资产评估',
	projectStartTime: '2024-01-15',
	estimatedCompletionTime: '2024-12-31',
	actualCompletionTime: '',
	reformProgress: '已完成混改方案制定和内部决策程序，正在履行审批手续',
	mixedCompanyCategory: '有限责任公司',
	mixedCompanyIndustry: '信息技术服务业',
	mixedCompanyField: '智慧城市解决方案',
	industryChainCategory: '数字经济产业链',
	createBy: 'admin',
	createTime: '2024-09-20 14:30:00',
	updateBy: 'admin',
	updateTime: '2024-09-25 16:45:00',
	processInstanceId: 'PROCESS20240920001',
	status: '审核中',
	pushStatus: '已推送'
});
const route = useRoute();
const processInstanceId = ref(route.query.processInstanceId)
getMixedReformByProcessInstanceIdAPI(processInstanceId.value as string).then(res => {
	Object.assign(testData, res.data);
})
</script>

<template>
	<layout title="混改管理审批" task-id="" :process-instance-id="processInstanceId">
		<div class="investment-list" >
			<div class="investment-item" v-for="item in showTextArray" :key="item.key" :class="item.isOneCol ? 'one-col' : ''">
				<div class="title" v-if="item.title">{{item.title}}</div>
				<div class="label">{{item.label}}</div>
				<div class="content">
					<upload-file v-if="item.isFile" v-model="testData[item.key]" disabled/>
					<div v-else><span>{{testData[item.key]}}</span><span v-if="item.unit">{{item.unit}}</span></div>
				</div>
			</div>
		</div>
	</layout>
</template>

<style scoped lang="scss">
.investment-list {
	height: 100%;
	display: flex;
	flex-wrap: wrap;
	font-size: 14px;
	box-sizing: border-box;

}
.investment-list .investment-item {
	width: 50%;
	margin: 8px 0;
	box-sizing: border-box;
}
.investment-list .investment-item .title {
	width: 100%;
	font-size: 16px;
	font-weight: 700;
}
.investment-list .investment-item .label {
	color: #858585;
	padding: 0;
	margin-bottom: 5px;
	text-align: left;
	box-sizing: border-box;
}
.investment-list .investment-item .content {
	color: #333333;
	line-height: 1;
}
.investment-list .one-col {
	width: 100%;
}
</style>