|
|
|
@ -1,94 +1,104 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="bigone">
|
|
|
|
|
<!-- 标题 -->
|
|
|
|
|
<div class="containerheadone" id="listtop">
|
|
|
|
|
<Title :id="projectId"></Title>
|
|
|
|
|
<el-button type="primary" size="medium" plain
|
|
|
|
|
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="goBack">
|
|
|
|
|
返回
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex;justify-content: center;">
|
|
|
|
|
<el-button type="primary" v-if="isSubmitted" disabled>已提交</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="containerbody" v-if="isContainerVisible">
|
|
|
|
|
<!-- 目录 -->
|
|
|
|
|
<div class="containerhead">
|
|
|
|
|
<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">
|
|
|
|
|
<Basic :action="action" :basicInfo="basicInformation"
|
|
|
|
|
@update-data="handleDataUpdate('basicInformation', $event)">
|
|
|
|
|
</Basic>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 规划信息 -->
|
|
|
|
|
<div id="programme">
|
|
|
|
|
<Programme :action="action" :planInfo="planInformation"
|
|
|
|
|
@update-data="handleDataUpdate('planInformation', $event)">
|
|
|
|
|
</Programme>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 建筑信息 -->
|
|
|
|
|
<div id="buildings">
|
|
|
|
|
<Buildings :action="action" :xmId="projectId"></Buildings>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 要素模型信息 -->
|
|
|
|
|
<div id="models">
|
|
|
|
|
<Models :action="action" :wysmxInfo="wysmxInformations"
|
|
|
|
|
@updata-data="handleDataUpdate('wysmxInformations', $event)">
|
|
|
|
|
</Models>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 月度进展信息 -->
|
|
|
|
|
<div id="months">
|
|
|
|
|
<Months :action="action"></Months>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 企业入驻信息 -->
|
|
|
|
|
<div id="companyenter">
|
|
|
|
|
<Companyenter :id="projectId" :action="action" :qyrzInfo="qyrzInformation"
|
|
|
|
|
@update-data="handleDataUpdate('qyrzInformation', $event)">
|
|
|
|
|
</Companyenter>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 项目画像 -->
|
|
|
|
|
<div id="projectpicture">
|
|
|
|
|
<Projectpicture :action="action" :id="projectId"></Projectpicture>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 项目图例 -->
|
|
|
|
|
<div id="projectpicturetwo">
|
|
|
|
|
<Projectpicturetwo22 :action="action" :xmId="projectId"> </Projectpicturetwo22>
|
|
|
|
|
<div>
|
|
|
|
|
<!-- 企业端 -->
|
|
|
|
|
<div class="bigone" v-if="showCompanySection">
|
|
|
|
|
<!-- 标题 -->
|
|
|
|
|
<div class="containerheadone" id="listtop">
|
|
|
|
|
<Title :basicInfo="basicInformation"></Title>
|
|
|
|
|
<el-button type="primary" size="medium" plain
|
|
|
|
|
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="goBack">
|
|
|
|
|
返回
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 项目巡礼 -->
|
|
|
|
|
<div id="projectgift">
|
|
|
|
|
<Projectgift :action="action" :xmId="projectId"></Projectgift>
|
|
|
|
|
<div style="display: flex;justify-content: center;">
|
|
|
|
|
<el-button type="primary" v-if="isSubmitted" disabled>已提交</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 现场实况 -->
|
|
|
|
|
<div id="liver">
|
|
|
|
|
<Liver :action="action"></Liver>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 项目备忘录 -->
|
|
|
|
|
<div id="memo">
|
|
|
|
|
<Memo :action="action" :xmId="projectId"></Memo>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 其他信息 -->
|
|
|
|
|
<div class="bottombox" id="others">
|
|
|
|
|
<Others :action="action" :xmId="projectId" :anotherInfo="projectOtherInfos"
|
|
|
|
|
@update-data="handleDataUpdate('projectOtherInfos', $event)">
|
|
|
|
|
</Others>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="footer">
|
|
|
|
|
<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'"
|
|
|
|
|
@click="submitAll">提交审核</el-button>
|
|
|
|
|
<div class="containerbody" v-if="isContainerVisible">
|
|
|
|
|
<!-- 目录 -->
|
|
|
|
|
<div class="containerhead">
|
|
|
|
|
<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">
|
|
|
|
|
<Basic :action="action" :basicInfo="basicInformation"
|
|
|
|
|
@update-data="handleDataUpdate('basicInformation', $event)">
|
|
|
|
|
</Basic>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 规划信息 -->
|
|
|
|
|
<div id="programme">
|
|
|
|
|
<Programme :action="action" :planInfo="planInformation"
|
|
|
|
|
@update-data="handleDataUpdate('planInformation', $event)">
|
|
|
|
|
</Programme>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 建筑信息 -->
|
|
|
|
|
<div id="buildings">
|
|
|
|
|
<Buildings :action="action" :xmId="projectId"></Buildings>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 要素模型信息 -->
|
|
|
|
|
<div id="models">
|
|
|
|
|
<Models :action="action" :wysmxInfo="wysmxInformations"
|
|
|
|
|
@updata-data="handleDataUpdate('wysmxInformations', $event)">
|
|
|
|
|
</Models>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 月度进展信息 -->
|
|
|
|
|
<div id="months">
|
|
|
|
|
<Months :action="action"></Months>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 企业入驻信息 -->
|
|
|
|
|
<div id="companyenter">
|
|
|
|
|
<Companyenter :id="projectId" :action="action" :qyrzInfo="qyrzInformation"
|
|
|
|
|
@update-data="handleDataUpdate('qyrzInformation', $event)">
|
|
|
|
|
</Companyenter>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 项目画像 -->
|
|
|
|
|
<div id="projectpicture">
|
|
|
|
|
<Projectpicture :action="action" :id="projectId"></Projectpicture>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 项目图例 -->
|
|
|
|
|
<div id="projectpicturetwo">
|
|
|
|
|
<Projectpicturetwo22 :action="action" :xmId="projectId"> </Projectpicturetwo22>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 项目巡礼 -->
|
|
|
|
|
<div id="projectgift">
|
|
|
|
|
<Projectgift :action="action" :xmId="projectId"></Projectgift>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 现场实况 -->
|
|
|
|
|
<div id="liver">
|
|
|
|
|
<Liver :action="action"></Liver>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 项目备忘录 -->
|
|
|
|
|
<div id="memo">
|
|
|
|
|
<Memo :action="action" :xmId="projectId"></Memo>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 其他信息 -->
|
|
|
|
|
<div class="bottombox" id="others">
|
|
|
|
|
<Others :action="action" :xmId="projectId" :anotherInfo="projectOtherInfos"
|
|
|
|
|
@update-data="handleDataUpdate('projectOtherInfos', $event)">
|
|
|
|
|
</Others>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="footer">
|
|
|
|
|
<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'"
|
|
|
|
|
@click="submitAll">提交审核</el-button>
|
|
|
|
|
<el-button type="primary"
|
|
|
|
|
v-if="(checkRole(['company']) && !isSubmitted && action === 'fill') || action === 'fill'"
|
|
|
|
|
@click="saveAll">暂存</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 返回顶部 -->
|
|
|
|
|
<el-button icon="el-icon-caret-top" circle id="back-to-top" @click="scrollToTop" plain></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 政务端 -->
|
|
|
|
|
<div class="bigone" v-if="checkRole(['common'])">
|
|
|
|
|
123
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 返回顶部按钮 -->
|
|
|
|
|
<el-button icon="el-icon-caret-top" circle id="back-to-top" @click="scrollToTop" plain></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -107,7 +117,7 @@ import Projectpicture from '@/views/components/ProjectDetails/Projectpicture.vue
|
|
|
|
|
import Projectpicturetwo22 from '@/views/components/ProjectDetails/Projectpicturetwo22.vue';
|
|
|
|
|
import Others from '@/views/components/ProjectDetails/Others.vue';
|
|
|
|
|
import { checkPermi, checkRole } from "@/utils/permission";
|
|
|
|
|
import { getBasicInformationById, fillBasicInformation, auditBasicInformation } from '@/api/ManageApi/index';
|
|
|
|
|
import { getBasicInformationById, fillBasicInformation, auditBasicInformation, tempBasicInformation } from '@/api/ManageApi/index';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
@ -212,7 +222,6 @@ export default {
|
|
|
|
|
xmId: 0,
|
|
|
|
|
yczmj: 0
|
|
|
|
|
},
|
|
|
|
|
// buildingInformation: [],
|
|
|
|
|
projectRemarks: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
};
|
|
|
|
@ -223,6 +232,14 @@ export default {
|
|
|
|
|
this.loadData();
|
|
|
|
|
this.action = this.$route.query.action;
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
showCompanySection() {
|
|
|
|
|
const isCompany = this.checkRole(['company']);
|
|
|
|
|
const isCommon = this.checkRole(['common']);
|
|
|
|
|
// 如果两个角色都存在,则隐藏企业端
|
|
|
|
|
return isCompany && !isCommon;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
checkPermi,
|
|
|
|
|
checkRole,
|
|
|
|
@ -232,12 +249,10 @@ export default {
|
|
|
|
|
const data = response.data;
|
|
|
|
|
this.basicInformation = data.basicInformation;
|
|
|
|
|
this.planInformation = data.planInformation;
|
|
|
|
|
// this.buildingInformation = data.buildingInformation;
|
|
|
|
|
this.projectOtherInfos = data.projectOtherInfos;
|
|
|
|
|
this.wysmxInformations = data.wysmxResponses;
|
|
|
|
|
this.qyrzInformation = data.qyrzInformation;
|
|
|
|
|
this.projectRemarks = data.projectRemarks
|
|
|
|
|
console.log(data);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
scrollToSection(id) {
|
|
|
|
@ -269,34 +284,60 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
console.log(`接收到 ${dataKey} 更新:`, updatedData);
|
|
|
|
|
},
|
|
|
|
|
//判断是否填写
|
|
|
|
|
isDefault(obj, defaultObj) {
|
|
|
|
|
for (const key in defaultObj) {
|
|
|
|
|
if (obj[key] !== defaultObj[key]) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
// 暂存数据
|
|
|
|
|
saveAll() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const tempData = this.prepareSubmitData(); // 复用数据准备逻辑
|
|
|
|
|
|
|
|
|
|
tempBasicInformation(tempData)
|
|
|
|
|
.then(response => {
|
|
|
|
|
this.$message.success('暂存成功');
|
|
|
|
|
console.log('暂存数据:', response);
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
this.$message.error('暂存失败');
|
|
|
|
|
console.error('暂存错误:', error);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 提交数据
|
|
|
|
|
submitAll() {
|
|
|
|
|
this.loading = true; // 显示加载动画
|
|
|
|
|
const submitData = this.prepareSubmitData();
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const submitData = this.prepareSubmitData(); // 复用同一数据格式
|
|
|
|
|
|
|
|
|
|
// 打印更详细的结构(方便调试)
|
|
|
|
|
console.log('提交的数据结构:', JSON.stringify(submitData, null, 2));
|
|
|
|
|
// 验证逻辑(保持不变)
|
|
|
|
|
if (this.isDefault(this.planInformation, this.defaultPlanInformation)) {
|
|
|
|
|
this.$message.error('规划信息未填写');
|
|
|
|
|
this.scrollToSection('programme');
|
|
|
|
|
this.loading = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 调用 fillBasicInformation 并处理结果
|
|
|
|
|
fillBasicInformation(submitData)
|
|
|
|
|
.then(response => {
|
|
|
|
|
console.log('提交成功:', response);
|
|
|
|
|
this.$message.success('数据提交成功');
|
|
|
|
|
this.isContainerVisible = false;
|
|
|
|
|
this.$message.success('提交成功');
|
|
|
|
|
this.isSubmitted = true;
|
|
|
|
|
this.$router.push('/manage');
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
console.error('提交失败:', error);
|
|
|
|
|
this.$message.error('数据提交失败');
|
|
|
|
|
this.$router.push('/manage');
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 审核通过的提交数据
|
|
|
|
|
aduitAll() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const submitData = this.prepareSubmitData();
|
|
|
|
|
|
|
|
|
|
auditBasicInformation(submitData)
|
|
|
|
@ -305,42 +346,37 @@ export default {
|
|
|
|
|
this.$message.success('审核通过');
|
|
|
|
|
this.isContainerVisible = false;
|
|
|
|
|
this.isSubmitted = true;
|
|
|
|
|
his.$router.push('/manage');
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 准备提交的数据
|
|
|
|
|
// 准备数据(供暂存和提交共用)
|
|
|
|
|
prepareSubmitData() {
|
|
|
|
|
const submitData = {
|
|
|
|
|
return {
|
|
|
|
|
basicInformation: this.basicInformation,
|
|
|
|
|
planInformation: this.planInformation,
|
|
|
|
|
projectOtherInfos: this.projectOtherInfos,
|
|
|
|
|
qyrzInformation: this.qyrzInformation
|
|
|
|
|
qyrzInformation: this.qyrzInformation,
|
|
|
|
|
wysmxInformations: this.formatWysmxData() // 格式化要素模型数据
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 处理 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;
|
|
|
|
|
// 格式化要素模型数据
|
|
|
|
|
formatWysmxData() {
|
|
|
|
|
return this.wysmxInformations.flatMap(item =>
|
|
|
|
|
item.list.map(listItem => ({
|
|
|
|
|
createTime: this.formatDate(new Date()),
|
|
|
|
|
updateTime: this.formatDate(new Date()),
|
|
|
|
|
xmId: this.projectId,
|
|
|
|
|
ysmc: item.ysmc,
|
|
|
|
|
zdinfor: listItem.zdinfor,
|
|
|
|
|
zdname: listItem.zdname,
|
|
|
|
|
id: 0, // 新增数据设为0
|
|
|
|
|
createBy: "",
|
|
|
|
|
updateBy: "",
|
|
|
|
|
createId: 0,
|
|
|
|
|
updateId: 0
|
|
|
|
|
}))
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 日期格式化方法
|
|
|
|
@ -397,7 +433,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
.custom-menu-item {
|
|
|
|
|
color: #3D424C;
|
|
|
|
|
width: 7.25rem;
|
|
|
|
|
width: auto;
|
|
|
|
|
height: 2rem;
|
|
|
|
|
background: #F4F7FE;
|
|
|
|
|
border-radius: 0.25rem 0.25rem 0.25rem 0.25rem;
|
|
|
|
|