|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="bigone">
|
|
|
|
|
<div class="containerbody" v-if="isContainerVisible">
|
|
|
|
|
<!-- 标题和目录 -->
|
|
|
|
|
<div fos>
|
|
|
|
|
<xiding>
|
|
|
|
|
<div style="padding: 0 0.9rem 0 0.5rem;">
|
|
|
|
|
<div class="containerheadone" id="listtop">
|
|
|
|
|
<Title :basicInfo="basicInformation"></Title>
|
|
|
|
|
<el-button type="primary" size="medium" plain
|
|
|
|
@ -21,6 +21,8 @@
|
|
|
|
|
</el-menu>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</xiding>
|
|
|
|
|
<div class="containerbody" v-if="isContainerVisible">
|
|
|
|
|
<!-- 基本信息 -->
|
|
|
|
|
<div id="basic">
|
|
|
|
|
<Basic :action="action" :basicInfo="basicInformation"
|
|
|
|
@ -79,8 +81,6 @@
|
|
|
|
|
@update-data="handleDataUpdate('projectOtherInfos', $event)">
|
|
|
|
|
</Others>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="footer" v-if="showCompanySection">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="footer" v-if="checkRole(['common']) && action === 'fill'">
|
|
|
|
|
<el-button type="primary" v-if="checkRole(['common'])" @click="aduitAll">审核通过</el-button>
|
|
|
|
|
</div>
|
|
|
|
@ -89,16 +89,19 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 返回顶部 -->
|
|
|
|
|
<!-- <el-button icon="el-icon-caret-top" circle id="back-to-top" @click="scrollToTop" plain></el-button> -->
|
|
|
|
|
<el-backtop target=".content-container" :visibility-height="0" :bottom="500" :right="10"></el-backtop>
|
|
|
|
|
<el-backtop target=".containerbody" :visibility-height="200" :bottom="50" :right="10" style="z-index: 1000;">
|
|
|
|
|
</el-backtop>
|
|
|
|
|
<!-- 消息提醒 -->
|
|
|
|
|
<div class="message-notice">
|
|
|
|
|
<el-tooltip class="item" effect="dark" content="新增智能提醒" placement="top-start">
|
|
|
|
|
<Supericon />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import xiding from "./index2.vue"
|
|
|
|
|
import Title from '@/views/components/ProjectDetails/Title.vue';
|
|
|
|
|
import Basic from '@/views/components/ProjectDetails/Basic.vue';
|
|
|
|
|
import Buildings from '@/views/components/ProjectDetails/Buildings.vue';
|
|
|
|
@ -118,6 +121,7 @@ import { getzwBasicInformationById, fillBasicInformation, auditBasicInformation,
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
xiding,
|
|
|
|
|
Title,
|
|
|
|
|
Basic,
|
|
|
|
|
Buildings,
|
|
|
|
@ -230,6 +234,12 @@ export default {
|
|
|
|
|
this.loadData();
|
|
|
|
|
this.action = this.$route.query.action;
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
window.addEventListener('scroll', this.handleScroll);
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
window.removeEventListener('scroll', this.handleScroll);
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
showCompanySection() {
|
|
|
|
|
const isCompany = this.checkRole(['company']);
|
|
|
|
@ -259,16 +269,9 @@ export default {
|
|
|
|
|
element.scrollIntoView({ behavior: 'smooth' });
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// scrollToTop() {
|
|
|
|
|
// const basicSection = document.getElementById('listtop');
|
|
|
|
|
// if (basicSection) {
|
|
|
|
|
// basicSection.scrollIntoView({ behavior: 'smooth' });
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
goBack() {
|
|
|
|
|
this.$router.go(-1); // 返回上一个页面
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
},
|
|
|
|
|
// 处理来自子组件的数据更新
|
|
|
|
|
handleDataUpdate(dataKey, updatedData) {
|
|
|
|
|
if (dataKey === 'projectOtherInfos' || dataKey === 'wysmxInformations') {
|
|
|
|
|
if (Array.isArray(updatedData)) {
|
|
|
|
@ -279,9 +282,7 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
this[dataKey] = updatedData;
|
|
|
|
|
}
|
|
|
|
|
// console.log(`接收到 ${dataKey} 更新:`, updatedData);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isDefault(obj, defaultObj) {
|
|
|
|
|
for (const key in defaultObj) {
|
|
|
|
|
if (obj[key] !== defaultObj[key]) {
|
|
|
|
@ -290,11 +291,9 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
// 暂存数据
|
|
|
|
|
saveAll() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const tempData = this.prepareSubmitData(); // 复用数据准备逻辑
|
|
|
|
|
// console.log('准备暂存的完整数据:', JSON.stringify(tempData, null, 2)); // 打印完整数据
|
|
|
|
|
const tempData = this.prepareSubmitData();
|
|
|
|
|
tempBasicInformation(tempData)
|
|
|
|
|
.then(response => {
|
|
|
|
|
this.$message.success('暂存成功');
|
|
|
|
@ -308,11 +307,9 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 提交数据
|
|
|
|
|
submitAll() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const submitData = this.prepareSubmitData();
|
|
|
|
|
// console.log('准备提交的完整数据:', JSON.stringify(submitData, null, 2)); // 打印完整数据
|
|
|
|
|
fillBasicInformation(submitData)
|
|
|
|
|
.then(response => {
|
|
|
|
|
this.$message.success('提交成功');
|
|
|
|
@ -323,51 +320,63 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 审核通过的提交数据
|
|
|
|
|
aduitAll() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const loading = this.$loading({
|
|
|
|
|
lock: true,
|
|
|
|
|
text: '正在提交审核...',
|
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const submitData = this.prepareSubmitData();
|
|
|
|
|
|
|
|
|
|
auditBasicInformation(submitData)
|
|
|
|
|
.then(response => {
|
|
|
|
|
// console.log('提交成功:', response);
|
|
|
|
|
this.$message.success('审核通过');
|
|
|
|
|
this.isSubmitted = true;
|
|
|
|
|
this.$router.push('/manage');
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
this.$message.error('审核失败');
|
|
|
|
|
console.error('审核错误:', error);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
loading.close();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 修改的提交数据
|
|
|
|
|
aduitAlltwo() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const loading = this.$loading({
|
|
|
|
|
lock: true,
|
|
|
|
|
text: '正在提交修改...',
|
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const submitData = this.prepareSubmitData();
|
|
|
|
|
|
|
|
|
|
auditBasicInformation(submitData)
|
|
|
|
|
.then(response => {
|
|
|
|
|
// console.log('提交成功:', response);
|
|
|
|
|
this.$message.success('修改成功');
|
|
|
|
|
this.isSubmitted = true;
|
|
|
|
|
this.$router.push('/manage');
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
this.$message.error('修改失败');
|
|
|
|
|
console.error('修改错误:', error);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
loading.close();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 准备数据(供暂存和提交共用)
|
|
|
|
|
prepareSubmitData() {
|
|
|
|
|
return {
|
|
|
|
|
basicInformation: this.basicInformation,
|
|
|
|
|
planInformation: this.planInformation,
|
|
|
|
|
projectOtherInfos: this.projectOtherInfos,
|
|
|
|
|
qyrzInformation: this.qyrzInformation,
|
|
|
|
|
wysmxInformations: this.formatWysmxData() // 格式化要素模型数据
|
|
|
|
|
wysmxInformations: this.formatWysmxData()
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 格式化要素模型数据
|
|
|
|
|
formatWysmxData() {
|
|
|
|
|
return this.wysmxInformations.flatMap(item =>
|
|
|
|
|
item.list.map(listItem => ({
|
|
|
|
@ -385,8 +394,6 @@ export default {
|
|
|
|
|
}))
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 日期格式化方法
|
|
|
|
|
formatDate(date) {
|
|
|
|
|
const year = date.getFullYear();
|
|
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
@ -396,20 +403,34 @@ export default {
|
|
|
|
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
|
|
},
|
|
|
|
|
handleScroll() {
|
|
|
|
|
const sections = this.sections;
|
|
|
|
|
const scrollPosition = window.scrollY + window.innerHeight / 2;
|
|
|
|
|
|
|
|
|
|
sections.forEach(section => {
|
|
|
|
|
const element = document.getElementById(section.id);
|
|
|
|
|
if (element) {
|
|
|
|
|
const rect = element.getBoundingClientRect();
|
|
|
|
|
if (rect.top <= scrollPosition && rect.bottom >= scrollPosition) {
|
|
|
|
|
this.activeSection = section.id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.containerbody {
|
|
|
|
|
height: 100%;
|
|
|
|
|
height: calc(100% - 7rem);
|
|
|
|
|
padding: .3rem .5rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
position: relative;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.containerheadone {
|
|
|
|
@ -417,8 +438,8 @@ export default {
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
width: 100%;
|
|
|
|
|
border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
|
|
|
|
|
padding: 0 1rem 0 .7rem;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.containerhead {
|
|
|
|
@ -427,8 +448,6 @@ export default {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.custom-menu {
|
|
|
|
@ -475,22 +494,15 @@ export default {
|
|
|
|
|
.bigone {
|
|
|
|
|
position: relative;
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#back-to-top {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 50%;
|
|
|
|
|
right: 5px;
|
|
|
|
|
z-index: 99;
|
|
|
|
|
font-size: 23px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.message-notice {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 40%;
|
|
|
|
|
right: 1%;
|
|
|
|
|
z-index: 99;
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
font-size: 23px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|