You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

450 lines
15 KiB

<template>
<div class="bigone">
1 month ago
<!-- 标题 -->
<div class="containerheadone" id="listtop">
<Title :id="projectId"></Title>
1 month ago
<el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="goBack">
1 month ago
返回
</el-button>
</div>
4 weeks ago
<div style="display: flex;justify-content: center;">
4 weeks ago
<el-button type="primary" v-if="isSubmitted" disabled>已提交</el-button>
</div>
4 weeks ago
<div class="containerbody" v-if="isContainerVisible">
1 month ago
<!-- 目录 -->
<div class="containerhead">
1 month ago
<el-menu :default-active="activeSection" mode="horizontal" @select="scrollToSection"
class="custom-menu">
<el-menu-item v-for="(item, index) in sections" :key="index" :index="item.id"
class="custom-menu-item">
{{ item.label }}
</el-menu-item>
</el-menu>
</div>
<!-- 基本信息 -->
<div id="basic">
4 weeks ago
<Basic :action="action" :basicInfo="basicInformation"
@update-data="handleDataUpdate('basicInformation', $event)">
4 weeks ago
</Basic>
1 month ago
</div>
<!-- 规划信息 -->
<div id="programme">
4 weeks ago
<Programme :planInfo="planInformation" @update-data="handleDataUpdate('planInformation', $event)">
</Programme>
</div>
1 month ago
<!-- 建筑信息 -->
<div id="buildings">
4 weeks ago
<Buildings
:xmId="projectId"></Buildings>
1 month ago
</div>
<!-- 要素模型信息 -->
<div id="models">
4 weeks ago
<Models :wysmxInfo="wysmxInformations" @updata-data="handleDataUpdate('wysmxInformations', $event)">
</Models>
1 month ago
</div>
<!-- 月度进展信息 -->
<div id="months">
4 weeks ago
<Months></Months>
1 month ago
</div>
<!-- 企业入驻信息 -->
4 weeks ago
<div id="companyenter">
4 weeks ago
<Companyenter :qyrzInfo="qyrzInformation" @update-data="handleDataUpdate('qyrzInformation', $event)">
</Companyenter>
4 weeks ago
</div>
1 month ago
<!-- 项目画像 -->
<div id="projectpicture">
4 weeks ago
<Projectpicture></Projectpicture>
1 month ago
</div>
<!-- 项目图例 -->
<div id="projectpicturetwo">
4 weeks ago
<!-- <Projectpicturetwo :id="projectId"></Projectpicturetwo> -->
4 weeks ago
<Projectpicturetwo22 :xmId="projectId"> </Projectpicturetwo22>
</div>
1 month ago
<!-- 项目巡礼 -->
4 weeks ago
<div id="projectgift">
4 weeks ago
<!-- <Projectgift></Projectgift> -->
4 weeks ago
</div>
1 month ago
<!-- 现场实况 -->
<div id="liver">
4 weeks ago
<Liver></Liver>
1 month ago
</div>
<!-- 项目备忘录 -->
<div id="memo">
4 weeks ago
<!-- <Memo></Memo> -->
1 month ago
</div>
<!-- 其他信息 -->
1 month ago
<div class="bottombox" id="others">
4 weeks ago
<Others :anotherInfo="projectOtherInfos" @update-data="handleDataUpdate('projectOtherInfos', $event)">
</Others>
1 month ago
</div>
4 weeks ago
<div class="footer">
4 weeks ago
<el-button type="primary" v-if="checkRole(['admin', 'common'])" @click="aduitAll"></el-button>
<el-button type="primary"
v-if="(checkRole(['company']) && !isSubmitted && action === 'fill') || action === 'fill'"
4 weeks ago
@click="submitAll">提交审核</el-button>
</div>
</div>
<!-- 返回顶部按钮 -->
<el-button icon="el-icon-caret-top" circle id="back-to-top" @click="scrollToTop" plain></el-button>
</div>
</template>
<script>
4 weeks ago
import Title from '@/views/components/ProjectDetails/Title.vue';
import Basic from '@/views/components/ProjectDetails/Basic.vue';
import Buildings from '@/views/components/ProjectDetails/Buildings.vue';
import Companyenter from '@/views/components/ProjectDetails/Companyenter.vue';
import Liver from '@/views/components/ProjectDetails/Liver.vue';
import Memo from '@/views/components/ProjectDetails/Memo.vue';
import Models from '@/views/components/ProjectDetails/Models.vue';
import Months from '@/views/components/ProjectDetails/Months.vue';
import Programme from '@/views/components/ProjectDetails/Programme.vue';
import Projectgift from '@/views/components/ProjectDetails/Projectgift.vue';
import Projectpicture from '@/views/components/ProjectDetails/Projectpicture.vue';
import Projectpicturetwo from '@/views/components/ProjectDetails/Projectpicturetwo.vue';
4 weeks ago
import Projectpicturetwo22 from '@/views/components/ProjectDetails/Projectpicturetwo22.vue';
4 weeks ago
import Others from '@/views/components/ProjectDetails/Others.vue';
4 weeks ago
import { checkPermi, checkRole } from "@/utils/permission";
import { getBasicInformationById, fillBasicInformation, auditBasicInformation } from '@/api/ManageApi/index';
export default {
components: {
1 month ago
Title,
Basic,
2 months ago
Buildings,
4 weeks ago
Companyenter,
2 months ago
Liver,
Memo,
Models,
Months,
Programme,
4 weeks ago
Projectgift,
Projectpicture,
1 month ago
Projectpicturetwo,
4 weeks ago
Projectpicturetwo22,
4 weeks ago
Others,
},
data() {
return {
activeSection: 'basic',
sections: [
{ id: 'basic', label: '基本信息' },
{ id: 'programme', label: '规划信息' },
{ id: 'buildings', label: '建筑信息' },
{ id: 'models', label: '要素模型信息' },
{ id: 'months', label: '月度进展信息' },
{ id: 'companyenter', label: '企业入驻信息' },
{ id: 'projectpicture', label: '项目画像' },
{ id: 'projectpicturetwo', label: '项目图例' },
{ id: 'projectgift', label: '项目巡礼' },
{ id: 'liver', label: '现场实况' },
{ id: 'memo', label: '项目备忘录' },
{ id: 'others', label: '其他信息' }
],
4 weeks ago
projectId: null,
4 weeks ago
isContainerVisible: true,
isSubmitted: false,
basicInformation: {
acceptanceTime: "",
begainTime: "",
endTime: "",
fj: "",
introduction: "",
issuingTime: "",
jsdd: "",
jsjd: "",
jsms: 0,
label: "",
latitude: "",
longitude: "",
name: "",
nature: 0,
id: 0,
phone: "",
prioritize: "",
projectLeader: "",
sgdw: "",
sjdw: "",
ssgnq: 0,
status: 0,
tyshxydm: "",
unitIntroduction: "",
xmfrdwxz: "",
xzfl: 0,
zjzmj: 0,
ztze: 0,
zydmj: 0
},
planInformation: {
bzcjzmj: 0,
dsjzmj: 0,
dxjzmj: 0,
fhdj: "",
fjdctcw: 0,
ghwj: "",
jdctcw: 0,
jrjljzmj: 0,
jzds: 0,
jzmd: 0,
ldl: 0,
id: 0,
rjl: 0,
xmId: 0,
zgjzcs: 0,
zgjzgd: 0,
zjzmj: 0,
zydmj: 0
},
4 weeks ago
projectOtherInfos: [],
wysmxInformations: [],
4 weeks ago
qyrzInformation: {
gycfpjwyf: 0,
gycfpjzj: 0,
kzczmj: 0,
params: {},
remark: "",
rysl: 0,
id: 0,
rzl: 0,
rzqyhylx: "",
rzqys: 0,
xmId: 0,
yczmj: 0
},
// buildingInformation: [],
projectRemarks: []
};
},
created() {
// 从路由参数中获取 projectId
4 weeks ago
this.projectId = Number(this.$route.params.id);
this.loadData();
4 weeks ago
this.action = this.$route.query.action;
},
methods: {
4 weeks ago
checkPermi,
checkRole,
loadData() {
console.log('Loading data for project ID:', this.projectId);
4 weeks ago
getBasicInformationById(this.projectId).then(response => {
const data = response.data;
this.basicInformation = data.basicInformation;
this.planInformation = data.planInformation;
4 weeks ago
// this.buildingInformation = data.buildingInformation;
4 weeks ago
this.projectOtherInfos = data.projectOtherInfos;
this.wysmxInformations = data.wysmxResponses;
this.qyrzInformation = data.qyrzInformation;
4 weeks ago
this.projectRemarks = data.projectRemarks
4 weeks ago
console.log(data);
});
},
scrollToSection(id) {
this.activeSection = id;
const element = document.getElementById(id);
if (element) {
element.scrollIntoView({ behavior: 'smooth' });
}
},
scrollToTop() {
const basicSection = document.getElementById('listtop');
if (basicSection) {
basicSection.scrollIntoView({ behavior: 'smooth' });
}
},
goBack() {
this.$router.go(-1); // 返回上一个页面
},
4 weeks ago
// 处理来自子组件的数据更新
handleDataUpdate(dataKey, updatedData) {
if (dataKey === 'projectOtherInfos' || dataKey === 'wysmxInformations') {
if (Array.isArray(updatedData)) {
this[dataKey] = updatedData;
} else {
this[dataKey].push(updatedData);
}
} else {
this[dataKey] = updatedData;
}
console.log(`接收到 ${dataKey} 更新:`, updatedData);
},
4 weeks ago
// 提交数据
4 weeks ago
submitAll() {
4 weeks ago
const submitData = this.prepareSubmitData();
// 打印更详细的结构(方便调试)
console.log('提交的数据结构:', JSON.stringify(submitData, null, 2));
// 调用 fillBasicInformation 并处理结果
fillBasicInformation(submitData)
.then(response => {
console.log('提交成功:', response);
this.$message.success('数据提交成功');
this.isContainerVisible = false;
this.isSubmitted = true;
})
.catch(error => {
console.error('提交失败:', error);
this.$message.error('数据提交失败');
});
},
// 审核通过的提交数据
aduitAll() {
const submitData = this.prepareSubmitData();
// 打印更详细的结构(方便调试)
console.log('提交的数据结构:', JSON.stringify(submitData, null, 2));
auditBasicInformation(submitData)
.then(response => {
console.log('提交成功:', response);
this.$message.success('审核通过');
this.isContainerVisible = false;
this.isSubmitted = true;
})
.catch(error => {
console.error('提交失败:', error);
this.$message.error('数据提交失败');
});
},
// 准备提交的数据
prepareSubmitData() {
4 weeks ago
const submitData = {
basicInformation: this.basicInformation,
planInformation: this.planInformation,
projectOtherInfos: this.projectOtherInfos,
qyrzInformation: this.qyrzInformation
};
4 weeks ago
// 处理 wysmxInformations 数据,使其符合后端期望的格式
const formattedWysmxInformations = [];
this.wysmxInformations.forEach(item => {
item.list.forEach(listItem => {
formattedWysmxInformations.push({
createBy: "",
createId: 0,
createTime: this.formatDate(new Date()), // 设置当前时间
id: 0, // 设置为 0 让数据库自动生成
updateBy: "",
updateId: 0,
updateTime: this.formatDate(new Date()), // 设置当前时间
xmId: item.xmId,
ysmc: item.ysmc,
zdinfor: listItem.zdinfor,
zdname: listItem.zdname
});
});
});
// 将处理后的数据添加到 submitData 中
submitData.wysmxInformations = formattedWysmxInformations;
return submitData;
},
// 日期格式化方法
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
}
};
</script>
2 months ago
<style scoped>
.containerbody {
height: auto;
padding: .3rem .5rem;
display: flex;
flex-direction: column;
gap: 1rem;
position: relative;
overflow: auto;
}
1 month ago
.containerheadone {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
padding: 0 1rem 0 .7rem;
1 month ago
}
.containerhead {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
background-color: #FFFFFF;
box-shadow: 0rem 0.13rem 0.63rem 0rem rgba(177, 177, 177, 0.1);
border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
2 months ago
}
.custom-menu {
margin: 1rem;
display: flex;
gap: 1rem;
border: none;
}
.custom-menu-item {
color: #3D424C;
width: 7.25rem;
height: 2rem;
background: #F4F7FE;
border-radius: 0.25rem 0.25rem 0.25rem 0.25rem;
display: flex;
align-items: center;
justify-content: center;
}
/* 高亮 */
.custom-menu-item.is-active {
background-color: #2B62F1;
color: #fff !important;
}
/* 悬停 */
.custom-menu-item:hover {
background-color: #2B62F1;
color: #fff !important;
}
/* 默认的下划线 */
.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,
.el-menu--horizontal .el-menu-item:not(.is-disabled):hover {
background-color: #2B62F1;
border-bottom: none;
}
.bottombox {
margin-bottom: 2rem;
1 month ago
}
.bigone {
position: relative;
}
#back-to-top {
position: fixed;
bottom: 5px;
right: 5px;
z-index: 99;
font-size: 18px;
}
4 weeks ago
.footer {
display: flex;
padding: 0 0 2rem 0;
justify-content: center;
}
4 weeks ago
</style>