<template>
    <div class="root">
        <div class="form-box">
            <el-form ref="formRef" :model="form" label-position="right" label-width="150px" style="padding-right: 50px"
                :rules="rules">
                <el-row>
                    <h4 style="margin:0 0 20px 50px;">基本信息</h4>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="区县名称" prop="区县名称">
                            <el-input disabled v-model="form.districtName"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="路线编码" prop="路线编码">
                            <el-input disabled v-model="form.routeNo"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="实施里程" prop="实施里程">
                            <el-input-number disabled v-model="form.implementMileage" :controls="false">
                                <template #suffix>
                                    <span>公里</span>
                                </template>
                            </el-input-number>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="塌方及损失" prop="塌方及损失">
                            <el-input-number disabled v-model="form.earthworkLoss" :controls="false">
                                <template #suffix>
                                    <span>方/万元</span>
                                </template>
                            </el-input-number>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="起点桩号" prop="起点桩号">
                            <el-input disabled v-model="form.startStakeNo"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="止点桩号" prop="止点桩号">
                            <el-input disabled v-model="form.endStakeNo"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="路况位置" prop="路况位置">
                            <el-input disabled v-model="form.roadLocation"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="阻断点小地名" prop="阻断点小地名">
                            <el-input disabled v-model="form.blockedPointName"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="灾害类型" prop="灾害类型">
                            <el-input disabled v-model="form.disasterType"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="预估费用" prop="预估费用">
                            <el-input-number disabled v-model="form.estimatedCost" :controls="false">
                                <template #suffix>
                                    <span>万元</span>
                                </template>
                            </el-input-number>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="技术等级" prop="技术等级">
                            <el-select disabled v-model="form.technicalGrade">
                                <el-option
                                    v-for="item in [{ value: '三级', label: '三级' }, { value: '二级', label: '二级' }, { value: '一级', label: '一级' }]"
                                    :key="item.value" :label="item.label" :value="item.value" />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="资金来源" prop="资金来源">
                            <el-input disabled v-model="form.fundingSource"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="处置灾毁处数" prop="处置灾毁处数">
                            <el-input-number disabled v-model="form.disposalCount" :controls="false"></el-input-number>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="已完工处数" prop="已完工处数">
                            <el-input-number disabled v-model="form.completedCount" :controls="false"></el-input-number>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="总投资" prop="总投资">
                            <el-input-number disabled v-model="form.totalInvestment" :controls="false">
                                <template #suffix>
                                    <span>万元</span>
                                </template>
                            </el-input-number>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="项目费用类型" prop="项目费用类型">
                            <el-radio-group disabled v-model="form.projectExpenseType">
                                <el-radio value="自费重修">自费重修</el-radio>
                                <el-radio value="申报重修">申报重修</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <h4 style="margin:0 0 20px 50px;">实施情况</h4>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="主要建设内容" prop="主要建设内容">
                            <el-input type="textarea" v-model="form.mainConstructionContent" clearable>
                            </el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="开工或预计开工时间" prop="开工或预计开工时间">
                            <el-date-picker type="date" v-model="form.startTime" clearable format="YYYY-MM-DD"
                                value-format="YYYY-MM-DD">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="完工或预计完工时间" prop="完工或预计完工时间">
                            <el-date-picker type="date" v-model="form.endTime" clearable format="YYYY-MM-DD"
                                value-format="YYYY-MM-DD">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="是否在部交通统计报表管理系统报送投资" prop="是否在部交通统计报表管理系统报送投资" label-width="300px">
                            <el-radio-group v-model="form.isReportedToMinistry">
                                <el-radio value="0">是</el-radio>
                                <el-radio value="1">否</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="已报送投资额" prop="已报送投资额">
                            <el-input-number v-model="form.reportedInvestment" :controls="false">
                                <template #suffix>
                                    <span>万元</span>
                                </template>
                            </el-input-number>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="项目实施进度" prop="项目实施进度">
                            <el-select v-model="form.projectProgress">
                                <el-option v-for="item in [
                                    { value: '立项', label: '立项' },
                                    { value: '财政评审', label: '财政评审' },
                                    { value: '开展施工图设计', label: '开展施工图设计' },
                                    { value: '完成施设于批复', label: '完成施设于批复' }
                                ]" 
                                :key="item.value" 
                                :label="item.label" 
                                :value="item.value" />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="建设单位名称" prop="建设单位名称">
                            <el-input v-model="form.constructionUnit"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="建设单位联系人" prop="建设单位联系人">
                            <el-input v-model="form.constructionUnitContact"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="建设单位联系人电话" prop="建设单位联系人电话">
                            <el-input v-model="form.constructionUnitPhone"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="施工单位名称" prop="施工单位名称">
                            <el-input v-model="form.executionUnit"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="施工单位联系人" prop="施工单位联系人">
                            <el-input v-model="form.designUnitContact"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="施工单位联系电话" prop="施工单位联系电话">
                            <el-input v-model="form.executionUnitPhone"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="设计单位名称" prop="设计单位名称">
                            <el-input v-model="form.designUnit"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="设计单位联系人" prop="设计单位联系人">
                            <el-input v-model="form.designUnitContact"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="设计单位联系人电话" prop="设计单位联系人电话">
                            <el-input v-model="form.designUnitPhone"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="监理单位名称" prop="监理单位名称">
                            <el-input v-model="form.supervisionUnit"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="监理单位联系人" prop="监理单位联系人">
                            <el-input v-model="form.supervisionUnitContact"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="监理单位联系电话" prop="监理单位联系电话">
                            <el-input v-model="form.supervisionUnitPhone"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="施工图批复时间" prop="施工图批复时间">
                            <el-date-picker type="date" v-model="form.designApprovalTime" clearable format="YYYY-MM-DD"
                                value-format="YYYY-MM-DD">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="监理单位联系电话" prop="监理单位联系电话">
                            <el-input v-model="form.supervisionUnitPhone"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </div>
        <div class="button-box">
            <el-button type="primary" size="large">提交</el-button>
        </div>
    </div>
</template>

<script setup>

import { ref, onMounted, watch, reactive, toRaw } from 'vue'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
const form = ref({})
const formRef = ref(null)

onMounted(() => {
    if (route.params.data) {
        const data = JSON.parse(decodeURIComponent(route.params.data));
        form.value = data
        // console.log('@@@@跳转过来了data', data);
    } else {

    }
})

</script>

<style scoped>
.root {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.form-box {
    width: 100%;
    height: 90%;
    overflow-y: auto;
    padding: 20px;
}

.button-box {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}
</style>