xuhongjie
严飞永 1 month ago
parent bb639e9fe4
commit 979fd3b332

@ -15,6 +15,30 @@ export function getBasicInformationById(id) {
method: 'get' method: 'get'
}); });
} }
// 企业端提交填报
export function fillBasicInformation(data) {
return request({
url: '/gysl/basicInformation/fill',
method: 'post',
data: data
})
}
// 政务端审核通过
export function auditBasicInformation(data) {
return request({
url: '/gysl/basicInformation/audit',
method: 'post',
data: data
})
}
// 基本信息删除数据
export function deleteBasicInformation(idList) {
return request({
url: '/gysl/basicInformation/delete',
method: 'delete',
params: { idList }
})
}
// 企业--基本信息==修改 // 企业--基本信息==修改
export function updateBasicInformation(data) { export function updateBasicInformation(data) {
@ -391,21 +415,22 @@ export function deletexmtl(idList) {
}) })
} }
//修改数据 //修改数据
export function updatexmtll(data) { export function editxmtl(data) {
return request({ return request({
url: '/gysl/projectLegend/edit', url: '/gysl/projectLegend/edit',
method: 'put', method: 'put',
data data: data
}) })
} }
//分页查询所有数据根据xmid //根据项目ID查询数据// 修正后的API定义
export function getxmtlPageByxmid(params) { export function getxmtlPageByxmId(params) {
return request({ return request({
url: '/gysl/projectLegend/page', url: '/gysl/projectLegend/page',
method: 'get', method: 'get',
params params // 注意这里改为paramsGET请求会自动拼接到URL
}) })
} }
//通过主键查询单条数据 //通过主键查询单条数据
export function getxmtlById(id) { export function getxmtlById(id) {
return request({ return request({

@ -7,7 +7,7 @@
<span>基本信息</span> <span>基本信息</span>
</div> </div>
<div class="topright"> <div class="topright">
<el-button type="primary" size="medium" plain <el-button type="primary" size="medium" plain v-if="action === 'fill' || !action"
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="edit"> style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="edit">
<img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="编辑" <img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="编辑"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;"> style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
@ -215,6 +215,10 @@ export default {
basicInfo: { basicInfo: {
type: Object, type: Object,
required: true required: true
},
action:{
type: String,
required: true
} }
}, },
data() { data() {
@ -233,6 +237,7 @@ export default {
sgdw: '', sgdw: '',
sjdw: '', sjdw: '',
ztze: 0, ztze: 0,
id: 0,
ssgnq: 0, ssgnq: 0,
begainTime: '', begainTime: '',
endtime: '', endtime: '',
@ -321,38 +326,36 @@ export default {
}, },
// //
saveForm() { saveForm() {
if (this.validateForm()) {
const formData = this.prepareFormData(this.form); const formData = this.prepareFormData(this.form);
// //
this.$emit('update-data', formData); this.$emit('update-data', formData);
this.dialogVisible = false; this.dialogVisible = false;
}
},
//
validateForm() {
for (const field in this.rules) {
const rules = this.rules[field];
const value = this.form[field];
for (const rule of rules) {
if (rule.required && !value) {
this.$message.error(rule.message);
return false;
}
}
}
return true;
}, },
// //
prepareFormData() { prepareFormData(formData) {
const [startDate, endDate] = this.formatDateRange(this.form.begainTime); // begainTime endTime
const [begainTime, endTime] = this.formatDateRange(formData.begainTime);
return { return {
id: this.id, ...formData, //
name: this.form.name, begainTime, //
xmfrdwxz: this.form.xmfrdwxz, endTime, //
nature: parseInt(this.form.nature),
sgdw: this.form.sgdw,
sjdw: this.form.sjdw,
ztze: parseFloat(this.form.ztze),
ssgnq: parseInt(this.form.ssgnq),
begainTime: startDate,
endTime: endDate,
xzfl: parseInt(this.form.xzfl),
jsdd: this.form.jsdd,
prioritize: this.form.prioritize,
jsms: parseInt(this.form.jsms),
label: this.form.label,
projectLeader: this.form.projectLeader,
phone: this.form.phone,
issuingTime: this.form.issuingTime,
acceptanceTime: this.form.acceptanceTime,
unitIntroduction: this.form.unitIntroduction,
jsjd: this.form.jsjd,
introduction: this.form.introduction,
fj: this.form.fj,
createBy: '', createBy: '',
createId: 0, createId: 0,
createTime: '', createTime: '',
@ -363,10 +366,20 @@ export default {
}, },
// //
formatDateRange(dateRange) { formatDateRange(dateRange) {
if (!dateRange || dateRange.length !== 2) return ['', '']; if (!dateRange || dateRange.length !== 2) return ['', '']; //
const startDate = dateRange[0].toISOString().split('T')[0];
const endDate = dateRange[1].toISOString().split('T')[0]; // YYYY-MM-DD
return [startDate, endDate]; const formatDate = (date) => {
if (!date) return '';
// Date Date
const d = date instanceof Date ? date : new Date(date);
return d.toISOString().split('T')[0]; // YYYY-MM-DD
};
return [
formatDate(dateRange[0]), //
formatDate(dateRange[1]) //
];
}, },
// //
handleAttachmentSuccess(response, file) { handleAttachmentSuccess(response, file) {
@ -412,12 +425,12 @@ export default {
height: auto; height: auto;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: .7rem 0;
padding:.5rem; padding:.5rem;
border-bottom: 1px solid #E5E5E5; border-bottom: 1px solid #E5E5E5;
} }
.topleft { .topleft {
height: 2rem;
width: 8rem; width: 8rem;
display: flex; display: flex;
gap: 0.4rem; gap: 0.4rem;

@ -35,8 +35,7 @@
</div> </div>
<!-- 栋数楼栋名称 --> <!-- 栋数楼栋名称 -->
<div class="tagdiv"> <div class="tagdiv">
<div class="tagitem" v-for="building in buildings" :key="building.id" @click="selectBuilding(building.id)" <div class="tagitem" v-for="building in buildings" :key="building.id" @click="selectBuilding(building.id)":class="getTagItemClass(building)">
:class="getTagItemClass(building)">
<img src="@/assets/images/detailsicon/icon-楼栋@2x.png" alt=""> <img src="@/assets/images/detailsicon/icon-楼栋@2x.png" alt="">
<span>{{ building.name }}</span> <span>{{ building.name }}</span>
<img src="@/assets/images/detailsicon/icon-gb@2x.png" alt="" @click.stop="handleDelete(building.id)"> <img src="@/assets/images/detailsicon/icon-gb@2x.png" alt="" @click.stop="handleDelete(building.id)">
@ -205,7 +204,10 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getjzxxinformationByxmId, getjzxxById, addjzxx, updatejzxx, deletejzxx } from '@/api/ManageApi/index';
export default { export default {
dicts: ['isno'], dicts: ['isno'],
props: { props: {
@ -213,8 +215,8 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
buildingInfo: { xmId: {
type: Array, type: [Number, String],
required: true required: true
} }
}, },
@ -235,9 +237,9 @@ export default {
name: '', name: '',
scdmhz: 0, scdmhz: 0,
scgd: 0, scgd: 0,
sfwzyld: 0, sfwzyld: 2,
sfydzk: 0, sfydzk: 2,
sfyqcpd: 0, sfyqcpd: 2,
totalBuildingHeight: 0, totalBuildingHeight: 0,
twoAndFourCg: 0, twoAndFourCg: 0,
twoAndThreeLmhz: 0, twoAndThreeLmhz: 0,
@ -249,24 +251,8 @@ export default {
} }
}; };
}, },
created() {
watch: { this.fetchBuildings();
buildingInfo: {
handler(newVal) {
this.buildings = newVal;
if (this.buildings.length > 0) {
this.selectedBuilding = this.buildings[0];
} else {
this.selectedBuilding = null;
}
},
immediate: true,
deep: true
}
},
mounted() {
// buildingInfo
console.log('buildingInfo in Buildings component:', this.buildingInfo);
}, },
methods: { methods: {
//12 //12
@ -294,9 +280,9 @@ export default {
name: '', name: '',
scdmhz: 0, scdmhz: 0,
scgd: 0, scgd: 0,
sfwzyld: 0, sfwzyld: 2,
sfydzk: 0, sfydzk: 2,
sfyqcpd: 0, sfyqcpd: 2,
totalBuildingHeight: 0, totalBuildingHeight: 0,
twoAndFourCg: 0, twoAndFourCg: 0,
twoAndThreeLmhz: 0, twoAndThreeLmhz: 0,
@ -307,27 +293,57 @@ export default {
zj: 0 zj: 0
}; };
}, },
fetchBuildings() {
console.log('Fetching data for xmId:', this.xmId);
getjzxxinformationByxmId({ xmId: this.xmId })
.then(response => {
console.log('API response:', response);
if (response.code === 200 && response.data) {
this.buildings = Object.values(response.data); //
console.log('Buildings data after assignment:', this.buildings);
} else {
console.error('数据格式不正确:', response);
}
})
.catch(error => {
console.error('数据获取失败:', error);
});
},
selectBuilding(id) { selectBuilding(id) {
console.log('Selected building ID:', id); console.log('Selected building ID:', id);
this.selectedBuilding = this.buildings.find(building => building.id === id); getjzxxById(id)
.then(response => {
console.log('Building details response:', response);
if (response.code === 200 && response.data) {
this.selectedBuilding = response.data; // selectedBuilding
console.log('Selected building data:', this.selectedBuilding);
} else {
console.error('数据格式不正确:', response);
}
})
.catch(error => {
console.error('数据获取失败:', error);
});
}, },
handleAddBuilding() { handleAddBuilding() {
// const api = this.buildingForm.id ? updatejzxx : addjzxx; // ID
this.$message.success(this.buildingForm.id ? '更新成功' : '新增成功'); const form = {
...this.buildingForm
};
api(form)
.then(response => {
if (response.code === 200) {
this.$message.success(form.id ? '更新成功' : '新增成功');
this.dialogVisible = false; this.dialogVisible = false;
// buildings selectedBuilding this.fetchBuildings(); //
if (this.buildingForm.id) {
//
const index = this.buildings.findIndex(building => building.id === this.buildingForm.id);
if (index !== -1) {
this.buildings.splice(index, 1, { ...this.buildingForm });
}
} else { } else {
// this.$message.error(form.id ? '更新失败' : '新增失败');
this.buildingForm.id = this.buildings.length + 1; // ID
this.buildings.push({ ...this.buildingForm });
} }
this.selectedBuilding = { ...this.buildingForm }; })
.catch(error => {
console.error(form.id ? '更新失败:' : '新增失败:', error);
this.$message.error(form.id ? '更新失败' : '新增失败');
});
}, },
handleDelete(id) { handleDelete(id) {
console.log('Deleting building with ID:', id); // console.log('Deleting building with ID:', id); //
@ -337,13 +353,19 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// deletejzxx([id]) // ID
.then(response => {
if (response.code === 200) {
this.$message.success('删除成功'); this.$message.success('删除成功');
// this.fetchBuildings(); //
this.buildings = this.buildings.filter(building => building.id !== id); } else {
if (this.selectedBuilding && this.selectedBuilding.id === id) { this.$message.error('删除失败');
this.selectedBuilding = null;
} }
})
.catch(error => {
console.error('删除失败:', error);
this.$message.error('删除失败');
});
}).catch(() => { }).catch(() => {
this.$message.info('已取消删除'); this.$message.info('已取消删除');
}); });
@ -442,7 +464,6 @@ export default {
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
.important-building { .important-building {
background-color: rgba(43,98,241,0.1); background-color: rgba(43,98,241,0.1);
} }

@ -58,12 +58,76 @@
<span v-else>{{ form.gycfpjwyf }}</span> <span v-else>{{ form.gycfpjwyf }}</span>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<div class="btnarea">
<el-button type="primary" size="mini" @click="handleImport">
批量导入
</el-button>
</div>
<!-- 表格显示区 -->
<div class="contenttwo">
<div class="descriptionsdiv">
<el-table :data="tableData" style="width: 98%">
<el-table-column prop="address" label="序号" width="200">
</el-table-column>
<el-table-column prop="name" label="企业名称" width="300">
<template slot-scope="scope">
<span style="color: #2B62F1;">{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="number" label="统一社会信用代码" width="300">
</el-table-column>
<el-table-column prop="name" label="所属行业" width="300">
</el-table-column>
<el-table-column prop="data" label='租金价格' width="250">
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.isEditing" size="mini" type="text" icon="el-icon-check"></el-button>
<el-button v-else size="mini" type="text" icon="el-icon-edit">编辑</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" style="color: #F25353;">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<div style="visibility: hidden;"></div>
<el-pagination :current-page="4" :page-sizes="[100, 200, 300, 400]" :page-size="100"
layout="total, prev, pager, next, jumper" :total="400">
</el-pagination>
</div>
</div>
</div>
<!-- 导入弹窗 -->
<el-dialog title="数据导入" :visible.sync="upload.open" width="400px" append-to-body :close-on-click-modal="false">
<el-upload ref="upload" :limit="1" accept=".xlsx,.xls" :headers="upload.headers" :action="upload.url"
:disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
:auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<!-- <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button @click="upload.open = false"> </el-button>
<el-button type="primary" @click="submitFileForm" :loading="upload.isUploading">
</el-button>
</div>
</el-dialog>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getToken } from "@/utils/auth";
import { download } from "@/utils/request";
export default { export default {
props: { props: {
qyrzInfo: { qyrzInfo: {
@ -87,7 +151,48 @@ export default {
form: { form: {
...this.qyrzInfo ...this.qyrzInfo
}, },
rules: { tableData: [
{
date: '2016-05-02',
name: '大众电脑生成制造基地',
number: 123456,
address: ' 1',
data: '1000',
status: '在建'
},
{
date: '2016-05-04',
name: '大众电脑生成制造基地',
address: ' 2',
number: 123456,
data: '1500',
status: '拟建'
},
{
date: '2016-05-01',
name: '大众电脑生成制造基地',
address: ' 3',
number: 123456,
data: '2000',
status: '已建'
},
{
date: '2016-05-03',
name: '大众电脑生成制造基地',
address: ' 4',
number: 123456,
data: '2500',
status: '在建'
}
],
upload: {
open: false,
isUploading: false,
updateSupport: 0,
headers: {
Authorization: "Bearer " + getToken()
},
url: process.env.VUE_APP_BASE_API + "/api/enterprise/import" //
} }
}; };
}, },
@ -101,29 +206,57 @@ export default {
} }
}, },
methods: { methods: {
// /
edit() { edit() {
this.isEditing = true; this.isEditing = true;
}, },
//
save() { save() {
const formData = this.prepareFormData(this.form); const formData = {
// ...this.form,
rzqys: Number(this.form.rzqys),
rysl: Number(this.form.rysl),
rzl: Number(this.form.rzl),
yczmj: Number(this.form.yczmj),
kzczmj: Number(this.form.kzczmj),
gycfpjzj: Number(this.form.gycfpjzj),
gycfpjwyf: Number(this.form.gycfpjwyf)
};
this.$emit('update-data', formData); this.$emit('update-data', formData);
this.isEditing = false; this.isEditing = false;
}, },
prepareFormData() {
return { //
...this.form, handleImport() {
createBy: '', this.upload.open = true;
createId: 0, },
createTime: '', importTemplate() {
updateBy: '', download(
updateId: 0, "/api/enterprise/template", //
updateTime: '' {},
}; `企业入驻模板_${new Date().getTime()}.xlsx`
);
},
handleFileUploadProgress() {
this.upload.isUploading = true;
},
handleFileSuccess(response) {
this.upload.isUploading = false;
this.upload.open = false;
this.$refs.upload.clearFiles();
if (response.code === 200) {
this.$modal.msgSuccess(response.msg);
this.$emit("refresh-data"); //
} else {
this.$modal.msgError(response.msg || "导入失败");
}
}, },
handleExport() { submitFileForm() {
// if (this.$refs.upload.uploadFiles.length === 0) {
this.$modal.msgWarning("请先选择文件");
return;
}
this.$refs.upload.submit();
} }
} }
}; };
@ -184,4 +317,20 @@ export default {
margin-left: 1rem; margin-left: 1rem;
height: auto; height: auto;
} }
.contenttwo {
margin-top: 1rem;
margin-left: -1rem;
}
.btnarea {
margin-top: 1rem;
}
.block {
width: 98%;
display: flex;
justify-content: space-between;
margin-top: 1rem;
}
</style> </style>

@ -61,30 +61,29 @@
</template> </template>
<script> <script>
import { addxmmmb, deletexmmmb, updatexmmmb, getxmmmbPage } from '@/api/ManageApi/index';
export default { export default {
props: { props: {
xmId: { Remark: {
type: Number, type: Array,
required: true required: true
} }
}, },
data() { data() {
return { return {
form: { form: {
date1: null, createBy:"",
createTime:"",
createId:0,
updateBy:"",
updateId:0,
updateTime:"",
id:0,
xmId:0,
remark:""
}, },
dialogVisible: false, dialogVisible: false,
dialogTitle: '新增备忘录', dialogTitle: '新增备忘录',
newMemo: {
id: null,
remark: '',
xmId: this.xmId,
createTime: '',
createBy: '',
},
memos: [],
}; };
}, },
created() { created() {
@ -95,23 +94,6 @@ export default {
console.log('submit!'); console.log('submit!');
console.log(this.form); console.log(this.form);
}, },
//
fetchMemos() {
const params = {
xmId: this.xmId,
};
getxmmmbPage(params)
.then(response => {
if (response.code === 200 && response.data) {
this.memos = response.data; //
} else {
console.error("获取备忘录失败:数据为空");
}
})
.catch(error => {
console.error("获取备忘录失败:", error);
});
},
// //
handleAdd() { handleAdd() {
this.dialogTitle = '新增备忘录'; this.dialogTitle = '新增备忘录';

@ -8,8 +8,7 @@
</div> </div>
<div class="topright"> <div class="topright">
<el-button type="primary" size="medium" plain <el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="toggleEditAll">
@click="toggleEditAll">
<img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="编辑" <img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="编辑"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;"> style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
{{ isEditingAll ? '保存' : '编辑' }} {{ isEditingAll ? '保存' : '编辑' }}
@ -59,7 +58,10 @@ export default {
wysmxInfo: { wysmxInfo: {
immediate: true, immediate: true,
handler(newVal) { handler(newVal) {
console.log('接收到的 wysmxInfo 数据:', newVal);
this.form = newVal.map(item => ({ this.form = newVal.map(item => ({
id: item.id,
xmId: item.xmId,
ysmc: item.ysmc, ysmc: item.ysmc,
list: item.list.map(subItem => ({ list: item.list.map(subItem => ({
zdname: subItem.zdname, zdname: subItem.zdname,
@ -72,20 +74,31 @@ export default {
}, },
methods: { methods: {
toggleEditAll() { toggleEditAll() {
this.isEditingAll = !this.isEditingAll; if (this.isEditingAll) {
// isEditing
const cleanedForm = this.form.map(row => ({
ysmc: row.ysmc,
id: row.id,
xmId: row.xmId,
list: row.list.map(item => ({
zdname: item.zdname,
zdinfor: item.zdinfor,
}))
}));
this.$emit('updata-data', cleanedForm); //
} else {
//
this.form.forEach(row => { this.form.forEach(row => {
row.list.forEach(item => { row.list.forEach(item => {
item.isEditing = this.isEditingAll; item.isEditing = true;
}); });
}); });
}, }
saveEdit(rowIndex, itemIndex) { this.isEditingAll = !this.isEditingAll;
this.form[rowIndex].list[itemIndex].isEditing = false;
this.$emit('updata-data', this.form);
} }
}, },
created() { created() {
console.log('wysmxInfo 内容:', this.wysmxInfo); console.log('wysmxInfo 内容:', this.wysmxInfo); //
} }
}; };
</script> </script>

@ -7,18 +7,20 @@
<span>其他信息</span> <span>其他信息</span>
</div> </div>
<div class="topright"> <div class="topright">
<el-button type="primary" size="medium" plain <el-button type="primary" size="medium" plain v-if="checkRole(['admin','common'])"
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="openDialog('add')"> style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="openDialog('add')">
<img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="新增" <img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="新增"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;"> style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
新增 新增
</el-button> </el-button>
<!-- <el-button type="primary" size="medium" plain <el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="openDialog('edit')"> style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;"
@click="toggleEditMode"
:loading="saveLoading">
<img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="编辑" <img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="编辑"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;"> style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
编辑 {{ isEditMode ? '保存' : '编辑' }}
</el-button> --> </el-button>
<el-button type="primary" size="medium" plain <el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;"> style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;">
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出" <img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出"
@ -39,13 +41,18 @@
<div class="descriptionsdiv"> <div class="descriptionsdiv">
<el-descriptions class="margin-top" :column="4" border> <el-descriptions class="margin-top" :column="4" border>
<el-descriptions-item v-for="(item, index) in anotherInfo" :key="index" :label="item.zdname"> <el-descriptions-item v-for="(item, index) in anotherInfo" :key="index" :label="item.zdname">
<template v-if="isEditMode">
<el-input v-model="item.zdinfor" size="small" @change="handleFieldChange(item)"></el-input>
</template>
<template v-else>
{{ item.zdinfor }} {{ item.zdinfor }}
</template>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
</div> </div>
<!-- 表单弹窗 --> <!-- 新增表单弹窗 -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="30%"> <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="30%">
<el-form :model="form" label-width="80px"> <el-form :model="form" label-width="80px">
<el-form-item label="字段名称"> <el-form-item label="字段名称">
@ -64,11 +71,14 @@
</template> </template>
<script> <script>
import { checkPermi, checkRole } from "@/utils/permission";
export default { export default {
props: { props: {
anotherInfo: { anotherInfo: {
type: Array, type: Array,
required: true, required: true,
default: () => []
} }
}, },
created() { created() {
@ -78,64 +88,106 @@ export default {
return { return {
dialogVisible: false, // dialogVisible: false, //
dialogTitle: '', // dialogTitle: '', //
form: { // form: {
zdname: '', zdname: '',
zdinfor: '' zdinfor: ''
}, },
isEditMode: false // isEditMode: false, //
saveLoading: false, //
editedData: [] //
}; };
}, },
methods: { methods: {
// checkPermi,
openDialog(mode) { checkRole,
if (mode === 'add') {
this.dialogTitle = '新增'; //
this.isEditMode = false; openDialog(type) {
this.form = { zdname: '', zdinfor: '' }; // if (type === 'add') {
} else if (mode === 'edit') { this.dialogTitle = '新增信息';
this.dialogTitle = '编辑'; this.form = {
this.isEditMode = true; zdname: '',
// zdinfor: ''
if (this.anotherInfo.length > 0) { };
this.form = { ...this.anotherInfo[0] }; this.dialogVisible = true;
}
},
//
toggleEditMode() {
if (this.isEditMode) {
//
this.saveChanges();
} else { } else {
this.form = { zdname: '', zdinfor: '' }; //
this.isEditMode = true;
//
this.editedData = JSON.parse(JSON.stringify(this.anotherInfo));
} }
},
//
handleFieldChange(item) {
const index = this.editedData.findIndex(i => i.zdname === item.zdname);
if (index !== -1) {
this.editedData[index] = { ...item };
} }
this.dialogVisible = true;
}, },
//
prepareFormData(form) { //
return { saveChanges() {
zdname: form.zdname, this.saveLoading = true;
zdinfor: form.zdinfor
}; try {
//
const updatedData = this.editedData.map(item => ({
...item,
}));
//
this.$emit('update-info', updatedData);
// 退
this.isEditMode = false;
} catch (error) {
console.error('保存失败:', error);
} finally {
this.saveLoading = false;
}
}, },
//
//
submitForm() { submitForm() {
const formData = this.prepareFormData(this.form); const newItem = {
if (this.isEditMode) { zdname: this.form.zdname,
// zdinfor: this.form.zdinfor,
// createTime: new Date().toISOString(),
if (this.anotherInfo.length > 0) { //
this.anotherInfo[0] = { ...formData }; };
this.$message.success('编辑成功');
} //
} else { this.$emit('add-info', newItem);
//
this.anotherInfo.push({ ...formData }); // zdname zdinfor this.dialogVisible = false;
this.$message.success('新增成功');
}
//
this.$emit('update-data', formData);
this.dialogVisible = false; //
}, },
//
//
deleteData() { deleteData() {
this.$message.warning('删除功能暂未实现'); this.$confirm('确定要删除这些信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('delete-info');
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
} }
} }
};
</script> </script>
<style scoped> <style scoped>

@ -32,59 +32,59 @@
<div class="descriptionsdiv"> <div class="descriptionsdiv">
<el-descriptions class="margin-top" :column="4" border> <el-descriptions class="margin-top" :column="4" border>
<el-descriptions-item label="总用地面积(平方米)"> <el-descriptions-item label="总用地面积(平方米)">
<el-input v-if="isEditing" v-model.number="form.zydmj" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.zydmj" style="width: 100%;"></el-input>
<span v-else>{{ form.zydmj }}</span> <span v-else>{{ form.zydmj }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="容积率"> <el-descriptions-item label="容积率">
<el-input v-if="isEditing" v-model.number="form.rjl" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.rjl" style="width: 100%;"></el-input>
<span v-else>{{ form.rjl }}</span> <span v-else>{{ form.rjl }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="总建筑面积(平方米)"> <el-descriptions-item label="总建筑面积(平方米)">
<el-input v-if="isEditing" v-model.number="form.zjzmj" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.zjzmj" style="width: 100%;"></el-input>
<span v-else>{{ form.zjzmj }}</span> <span v-else>{{ form.zjzmj }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="标准层建筑面积(平方米)"> <el-descriptions-item label="标准层建筑面积(平方米)">
<el-input v-if="isEditing" v-model.number="form.bzcjzmj" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.bzcjzmj" style="width: 100%;"></el-input>
<span v-else>{{ form.bzcjzmj }}</span> <span v-else>{{ form.bzcjzmj }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="计容积率建筑面积(平方米)"> <el-descriptions-item label="计容积率建筑面积(平方米)">
<el-input v-if="isEditing" v-model.number="form.jrjljzmj" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.jrjljzmj" style="width: 100%;"></el-input>
<span v-else>{{ form.jrjljzmj }}</span> <span v-else>{{ form.jrjljzmj }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="建筑密度(%)"> <el-descriptions-item label="建筑密度(%)">
<el-input v-if="isEditing" v-model.number="form.jzmd" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.jzmd" style="width: 100%;"></el-input>
<span v-else>{{ form.jzmd }}</span> <span v-else>{{ form.jzmd }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="绿地率(%)"> <el-descriptions-item label="绿地率(%)">
<el-input v-if="isEditing" v-model.number="form.ldl" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.ldl" style="width: 100%;"></el-input>
<span v-else>{{ form.ldl }}</span> <span v-else>{{ form.ldl }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="建筑栋数(栋)"> <el-descriptions-item label="建筑栋数(栋)">
<el-input v-if="isEditing" v-model.number="form.jzds" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.jzds" style="width: 100%;"></el-input>
<span v-else>{{ form.jzds }}</span> <span v-else>{{ form.jzds }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="地上建筑面积(平方米)"> <el-descriptions-item label="地上建筑面积(平方米)">
<el-input v-if="isEditing" v-model.number="form.dsjzmj" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.dsjzmj" style="width: 100%;"></el-input>
<span v-else>{{ form.dsjzmj }}</span> <span v-else>{{ form.dsjzmj }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="地下建筑面积(平方米)"> <el-descriptions-item label="地下建筑面积(平方米)">
<el-input v-if="isEditing" v-model.number="form.dxjzmj" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.dxjzmj" style="width: 100%;"></el-input>
<span v-else>{{ form.dxjzmj }}</span> <span v-else>{{ form.dxjzmj }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="最高建筑层数(层)"> <el-descriptions-item label="最高建筑层数(层)">
<el-input v-if="isEditing" v-model.number="form.zgjzcs" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.zgjzcs" style="width: 100%;"></el-input>
<span v-else>{{ form.zgjzcs }}</span> <span v-else>{{ form.zgjzcs }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="最高建筑高度(米)"> <el-descriptions-item label="最高建筑高度(米)">
<el-input v-if="isEditing" v-model.number="form.zgjzgd" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.zgjzgd" style="width: 100%;"></el-input>
<span v-else>{{ form.zgjzgd }}</span> <span v-else>{{ form.zgjzgd }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="机动车停车位(辆)"> <el-descriptions-item label="机动车停车位(辆)">
<el-input v-if="isEditing" v-model.number="form.jdctcw" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.jdctcw" style="width: 100%;"></el-input>
<span v-else>{{ form.jdctcw }}</span> <span v-else>{{ form.jdctcw }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="非机动车停车位(辆)"> <el-descriptions-item label="非机动车停车位(辆)">
<el-input v-if="isEditing" v-model.number="form.fjdctcw" style="width: 100%;"></el-input> <el-input v-if="isEditing" v-model="form.fjdctcw" style="width: 100%;"></el-input>
<span v-else>{{ form.fjdctcw }}</span> <span v-else>{{ form.fjdctcw }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="防火等级"> <el-descriptions-item label="防火等级">

@ -2,10 +2,6 @@
<div class="container"> <div class="container">
<!-- 顶部操作栏 --> <!-- 顶部操作栏 -->
<div class="containertop"> <div class="containertop">
<div class="topleft">
<img src="../../../assets/images/detailsicon/1.png" alt="">
<span>项目图例</span>
</div>
<div class="topright"> <div class="topright">
<el-button type="primary" size="medium" plain <el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleAdd"> style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleAdd">
@ -22,45 +18,18 @@
</div> </div>
</div> </div>
<!-- 内容区域 -->
<div class="main-content">
<!-- 上侧三张图 -->
<div class="image-row">
<div v-for="(item, index) in carousel1Items.slice(0, 3)" :key="index" class="image-item">
<img :src="item.imageUrl" :alt="'Image ' + (index + 1)" />
<div class="classify">
类型A
</div>
<el-input v-if="dialogVisible" v-model="form.images[index]" placeholder="请输入图片URL"></el-input>
</div>
</div>
<!-- 下侧三张图 -->
<div class="image-row">
<div v-for="(item, index) in carousel2Items.slice(0, 3)" :key="index" class="image-item">
<img :src="item.imageUrl" :alt="'Image ' + (index + 1)" />
<div class="classify">
类型B
</div>
<el-input v-if="dialogVisible" v-model="form.images[index + 3]" placeholder="请输入图片URL"></el-input>
</div>
</div>
</div>
<!-- 编辑/新增对话框 --> <!-- 编辑/新增对话框 -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="500px"> <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="500px">
<el-form :model="form" label-width="120px"> <el-form :model="form" label-width="120px" :rules="rules" ref="formRef">
<el-form-item label="类型"> <el-form-item label="类型" prop="imgType">
<el-select v-model="form.type" placeholder="请选择类型"> <el-select v-model="form.imgType" placeholder="请选择类型" @change="handleTypeChange">
<el-option v-for="dict in dict.type.tplx" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.tplx" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option> :value="parseInt(dict.value)">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="图片上传"> <el-form-item label="图片上传" prop="img">
<div v-for="(image, index) in form.images" :key="index" style="margin-bottom: 10px;"> <ImageUpload v-model="form.img" :file-list="currentTypeFileList" :multiple="true" />
<ImageUpload v-model="form.images[index]" />
<el-input v-model="form.images[index]" placeholder="请输入图片URL"></el-input>
</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -68,12 +37,54 @@
<el-button type="primary" @click="handleSubmit"></el-button> <el-button type="primary" @click="handleSubmit"></el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 图片展示区 - 默认轮播图样式 -->
<div class="main-content">
<template v-if="legendsData && legendsData.length > 0">
<div v-for="(legend, index) in legendsData" :key="index">
<!-- 类型1轮播图 -->
<div v-if="legend.type1 && legend.type1.images && legend.type1.images.length > 0">
<h3 class="type-title">类型1</h3>
<div class="fixed-carousel-container">
<el-carousel height="12.44rem" indicator-position="outside" class="fixed-carousel">
<el-carousel-item v-for="(img, imgIndex) in legend.type1.images"
:key="'type1-' + imgIndex">
<div class="carousel-item-wrapper">
<img :src="img" :alt="'类型1图片' + imgIndex" class="fixed-carousel-image">
<div class="classify">类型1</div>
</div>
</el-carousel-item>
</el-carousel>
</div>
</div>
<!-- 类型2轮播图 -->
<div v-if="legend.type2 && legend.type2.images && legend.type2.images.length > 0">
<h3 class="type-title">类型2</h3>
<div class="fixed-carousel-container">
<el-carousel height="12.44rem" indicator-position="outside" class="fixed-carousel">
<el-carousel-item v-for="(img, imgIndex) in legend.type2.images"
:key="'type2-' + imgIndex">
<div class="carousel-item-wrapper">
<img :src="img" :alt="'类型2图片' + imgIndex" class="fixed-carousel-image">
<div class="classify">类型2</div>
</div>
</el-carousel-item>
</el-carousel>
</div>
</div>
</div>
</template>
<div v-else class="no-data">
暂无图例数据
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import ImageUpload from '@/components/ImageUpload'; import ImageUpload from '@/components/ImageUpload';
import { getxmtlPageByxmid, addxmtl, updatexmtll } from '@/api/ManageApi/index'; import { addxmtl, getxmtlPageByxmId } from '@/api/ManageApi/index';
export default { export default {
components: { ImageUpload }, components: { ImageUpload },
@ -86,92 +97,157 @@ export default {
}, },
data() { data() {
return { return {
carousel1Items: [], // A
carousel2Items: [], // B
dialogVisible: false, dialogVisible: false,
dialogTitle: '', dialogTitle: '新增图例',
legendsData: [],
currentTypeFileList: [],
form: { form: {
type: '', imgType: 1,
images: ['', '', '', '', '', ''] // img: [],
xmId: this.xmId
},
rules: {
imgType: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
img: [
{ required: true, message: '请上传图片', trigger: 'blur' }
]
} }
}; };
}, },
created() { created() {
this.fetchProjectLegends(); this.fetchLegendsData();
}, },
methods: { methods: {
// //
fetchProjectLegends() { async fetchLegendsData() {
console.log('Fetching data for xmId:', this.xmId); try {
if (this.xmId === null || this.xmId === undefined) { if (!this.xmId) {
console.error('xmId is null or undefined'); this.$message.error('项目ID不能为空');
return; return;
} }
getxmtlPageByxmid({ xmId: this.xmId })
.then(response => { const response = await getxmtlPageByxmId({
if (response.code === 200 && response.data.length > 0) { xmId: this.xmId,
const data = response.data[0]; // pageNum: 1,
// A pageSize: 10
this.carousel1Items = data.type1.images.map(imageUrl => ({ imageUrl }));
// B
this.carousel2Items = data.type2.images.map(imageUrl => ({ imageUrl }));
}
})
.catch(error => {
console.error("获取项目图例数据失败:", error);
}); });
if (response.code === 200) {
this.legendsData = response.data || [];
} else {
this.$message.error(response.msg || '获取图例数据失败');
}
} catch (error) {
console.error('获取图例数据失败:', error);
this.$message.error('获取图例数据失败');
}
},
updateCurrentTypeFileList() {
if (!this.legendsData || this.legendsData.length === 0) {
this.currentTypeFileList = [];
return;
}
const firstLegend = this.legendsData[0];
let images = [];
if (this.form.imgType === 1 && firstLegend.type1) {
images = firstLegend.type1.images || [];
} else if (this.form.imgType === 2 && firstLegend.type2) {
images = firstLegend.type2.images || [];
}
this.currentTypeFileList = images.map(url => ({
url: url,
name: url.split('/').pop(),
status: 'success'
}));
this.form.img = [...images];
},
handleTypeChange() {
this.updateCurrentTypeFileList();
}, },
//
handleAdd() { handleAdd() {
this.dialogTitle = '新增'; this.dialogTitle = '新增图例';
this.form = { type: '', images: ['', '', '', '', '', ''] }; // this.form = {
imgType: 1,
img: [],
xmId: this.xmId
};
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => {
if (this.$refs.formRef) {
this.$refs.formRef.clearValidate();
}
this.updateCurrentTypeFileList();
});
}, },
//
handleEdit() { handleEdit() {
this.dialogTitle = '编辑'; this.dialogTitle = '编辑图例';
//
this.form = { this.form = {
type: '', // imgType: 1,
images: [ img: [],
this.carousel1Items[0] ? this.carousel1Items[0].imageUrl : '', xmId: this.xmId
this.carousel1Items[1] ? this.carousel1Items[1].imageUrl : '',
this.carousel1Items[2] ? this.carousel1Items[2].imageUrl : '',
this.carousel2Items[0] ? this.carousel2Items[0].imageUrl : '',
this.carousel2Items[1] ? this.carousel2Items[1].imageUrl : '',
this.carousel2Items[2] ? this.carousel2Items[2].imageUrl : ''
]
}; };
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => {
if (this.$refs.formRef) {
this.$refs.formRef.clearValidate();
}
this.updateCurrentTypeFileList();
});
}, },
//
handleSubmit() { handleSubmit() {
if (this.dialogTitle === '新增') { this.$refs.formRef.validate(valid => {
// API if (valid) {
addxmtl({ ...this.form, xmId: this.xmId }) this.submitForm();
.then(response => {
if (response.code === 200) {
this.$message.success('新增成功');
this.fetchProjectLegends(); //
} }
})
.catch(error => {
console.error("新增失败:", error);
}); });
} else if (this.dialogTitle === '编辑') { },
// API
updatexmtll({ ...this.form, xmId: this.xmId }) async submitForm() {
.then(response => { const loading = this.$loading({
if (response.code === 200) { lock: true,
this.$message.success('编辑成功'); text: '提交中...',
this.fetchProjectLegends(); // spinner: 'el-icon-loading',
} background: 'rgba(0, 0, 0, 0.7)'
})
.catch(error => {
console.error("编辑失败:", error);
}); });
try {
if (!this.xmId) {
this.$message.error('项目ID不能为空');
return;
} }
const submitData = {
...this.form,
imgType: parseInt(this.form.imgType),
xmId: this.xmId
};
const response = await addxmtl(submitData);
if (response.code === 200) {
this.$message.success(this.dialogTitle === '新增图例' ? '新增成功' : '更新成功');
this.dialogVisible = false; this.dialogVisible = false;
await this.fetchLegendsData();
this.$emit('refresh');
} else {
this.$message.error(response.msg || '操作失败');
}
} catch (error) {
this.$message.error('操作失败,请重试');
console.error('操作失败:', error);
} finally {
loading.close();
}
} }
} }
}; };
@ -200,24 +276,35 @@ export default {
.main-content { .main-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1.5rem;
padding: 1rem; padding: 1rem;
width: 25rem;
} }
.image-row { .type-title {
display: flex; margin: 1rem 0 0.5rem;
justify-content: space-between; font-size: 1rem;
gap: 1rem; color: #333;
}
/* 默认轮播图样式 */
.block {
padding: 0 20px;
} }
.image-item { .el-carousel {
border-radius: 4px;
}
.carousel-content {
position: relative; position: relative;
width: calc(33.33% - 0.67rem); /* 三张图片每张占三分之一减去间隔 */ height: 100%;
width: 100%;
} }
.image-item img { .carousel-image {
width: 100%; width: 100%;
height: 12rem; height: 100%;
object-fit: cover; object-fit: cover;
} }
@ -225,15 +312,74 @@ export default {
width: 2.81rem; width: 2.81rem;
height: 1.38rem; height: 1.38rem;
background-color: rgba(43, 98, 241, 0.8); background-color: rgba(43, 98, 241, 0.8);
border-radius: 0.69rem 0.69rem 0.69rem 0.69rem; border-radius: 0.69rem;
color: white; color: white;
position: absolute; position: absolute;
bottom: .5rem; bottom: 1rem;
left: .5rem; left: 1rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: .7rem; font-size: .7rem;
z-index: 98; z-index: 98;
} }
.no-data {
text-align: center;
padding: 2rem;
color: #999;
}
/* 轮播图指示器样式 */
.el-carousel__indicator {
padding: 8px 4px;
}
.el-carousel__button {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #c0c4cc;
}
.el-carousel__indicator.is-active .el-carousel__button {
background-color: #2B62F1;
}
/* 轮播图箭头样式 */
.el-carousel__arrow {
background-color: rgba(43, 98, 241, 0.3);
color: #2B62F1;
}
.el-carousel__arrow:hover {
background-color: rgba(43, 98, 241, 0.5);
}
/* 固定尺寸轮播图样式 */
.fixed-carousel-container {
width: 21.75rem;
height: 12.44rem;
margin: 0 auto;
position: relative;
}
.fixed-carousel {
width: 21.75rem;
height: 12.44rem;
border-radius: 0.5rem;
overflow: hidden;
box-shadow: 0 0.13rem 0.63rem rgba(177, 177, 177, 0.1);
}
.fixed-carousel-image {
width: 21.75rem;
height: 12.44rem;
object-fit: cover;
display: block;
}
/* 调整指示器位置 */
.el-carousel__indicators {
bottom: -1.5rem;
}
</style> </style>

@ -0,0 +1,444 @@
<template>
<div class="container">
<!-- 顶部信息 -->
<div class="containertop">
<div class="topleft">
<img src="../../../assets/images/detailsicon/1.png" alt="">
<span>建筑信息</span>
</div>
<div class="topright">
<el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="addBuildingTag">
<img src="../../../assets/images/detailsicon/icon-xz@2x.png" alt="新增"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
新增
</el-button>
<el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;"
@click="handleEdit(selectedBuilding)">
<img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="编辑"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
编辑
</el-button>
<el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;">
<i class="el-icon-download" style="width: 0.6rem; height: 0.6rem; margin-right: 4px;"></i>
导入
</el-button>
<el-button type="primary" size="medium" plain
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;">
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
导出
</el-button>
</div>
</div>
<!-- 栋数楼栋名称 -->
<div class="tagdiv">
<div v-for="building in buildings" :key="building.id" @click="selectBuilding(building.id)"
:class="['tagitem', { 'important-building': building.sfwzyld === 1 }]">
<img src="@/assets/images/detailsicon/icon-楼栋@2x.png" alt="">
<span>{{ building.name }}</span>
<img src="@/assets/images/detailsicon/icon-gb@2x.png" alt="删除" @click.stop="handleDelete(building.id)">
</div>
</div>
<!-- 内容区 -->
<div class="content" v-if="selectedBuilding">
<div class="descriptionsdiv">
<el-descriptions class="margin-top" :column="4" border>
<el-descriptions-item>
<template slot="label">是否为重要楼栋</template>
{{ getTextForBoolean(selectedBuilding.sfwzyld) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">层数</template>
{{ selectedBuilding.floor }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">总建筑高度</template>
{{ selectedBuilding.totalBuildingHeight }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">首层高度平方米</template>
{{ selectedBuilding.scgd }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">2至4层层高</template>
{{ selectedBuilding.twoAndFourCg }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">4层以上层高()</template>
{{ selectedBuilding.fourYscg }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">首层地面荷载(/)</template>
{{ selectedBuilding.scdmhz }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">二至三层楼面荷载(/平方米)</template>
{{ selectedBuilding.twoAndThreeLmhz }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">标准层面积(千平方米)</template>
{{ selectedBuilding.bzcmj }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">柱距</template>
{{ selectedBuilding.zj }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">是否有吊装口</template>
{{ getTextForBoolean(selectedBuilding.sfydzk) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">是否有汽车盘道</template>
{{ getTextForBoolean(selectedBuilding.sfyqcpd) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">四层及以上楼面荷载(/平方米)</template>
{{ selectedBuilding.fourYslmhz }}
</el-descriptions-item>
</el-descriptions>
</div>
</div>
<!-- 新增楼栋弹窗 -->
<el-dialog title="新增楼栋" :visible.sync="dialogVisible" width="65%">
<el-form :model="buildingForm" label-width="230px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="楼栋名称:">
<el-input v-model="buildingForm.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否为重要楼栋:">
<el-select v-model="buildingForm.sfwzyld" placeholder="请选择" style="width: 22.5rem;">
<el-option v-for="dict in dict.type.isno" :key="dict.value" :label="dict.label"
:value="parseInt(dict.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="首层高度(米):">
<el-input v-model="buildingForm.scgd"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="层数:">
<el-input v-model="buildingForm.floor"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="4层以上层高">
<el-input v-model="buildingForm.fourYscg"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柱距:">
<el-input v-model="buildingForm.zj"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="2至4层层高">
<el-input v-model="buildingForm.twoAndFourCg"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="总建筑高度(米):">
<el-input v-model="buildingForm.totalBuildingHeight"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="首层地面荷载(吨/平方米):">
<el-input v-model="buildingForm.scdmhz"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二至三层楼面荷载(吨/平方米):">
<el-input v-model="buildingForm.twoAndThreeLmhz"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="标准层面积(千平方米):">
<el-input v-model="buildingForm.bzcmj"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否有汽车盘道:">
<el-select v-model="buildingForm.sfyqcpd" placeholder="请选择" style="width: 22.5rem;">
<el-option v-for="dict in dict.type.isno" :key="dict.value" :label="dict.label"
:value="parseInt(dict.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="是否有吊装口:">
<el-select v-model="buildingForm.sfydzk" placeholder="请选择" style="width: 22.5rem;">
<el-option v-for="dict in dict.type.isno" :key="dict.value" :label="dict.label"
:value="parseInt(dict.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="四层及以上楼面荷载(吨/平方米):">
<el-input v-model="buildingForm.fourYslmhz"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handleAddBuilding"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
dicts: ['isno'],
props: {
size: {
type: String,
default: ''
},
buildingInfo: {
type: Array,
required: true
}
},
data() {
return {
dialogVisible: false,
buildings: [],
selectedBuilding: null,
buildingForm: {
bzcmj: 0,
createBy: '',
createId: 0,
createTime: '',
floor: 0,
fourYscg: 0,
fourYslmhz: 0,
id: 0,
name: '',
scdmhz: 0,
scgd: 0,
sfwzyld: 0,
sfydzk: 0,
sfyqcpd: 0,
totalBuildingHeight: 0,
twoAndFourCg: 0,
twoAndThreeLmhz: 0,
updateBy: '',
updateId: 0,
updateTime: '',
xmId: 0,
zj: 0
}
};
},
watch: {
buildingInfo: {
handler(newVal) {
this.buildings = newVal || [];
//
this.selectedBuilding = this.buildings.length > 0
? this.buildings[0]
: null;
},
immediate: true,
deep: true
}
},
methods: {
// 12
getTextForBoolean(value) {
return value === 1 ? '是' : '否';
},
//
getTagItemClass(building) {
return {
'important-building': building.sfwzyld === 1,
};
},
//
addBuildingTag() {
this.dialogVisible = true;
this.buildingForm = {
bzcmj: 0,
createBy: '',
createId: 0,
createTime: '',
floor: 0,
fourYscg: 0,
fourYslmhz: 0,
id: 0,
name: '',
scdmhz: 0,
scgd: 0,
sfwzyld: 0,
sfydzk: 0,
sfyqcpd: 0,
totalBuildingHeight: 0,
twoAndFourCg: 0,
twoAndThreeLmhz: 0,
updateBy: '',
updateId: 0,
updateTime: '',
xmId: this.xmId,
zj: 0
};
},
selectBuilding(id) {
console.log('Selected building ID:', id);
this.selectedBuilding = this.buildings.find(building => building.id === id);
},
handleAddBuilding() {
//
this.$message.success(this.buildingForm.id ? '更新成功' : '新增成功');
this.dialogVisible = false;
// buildings selectedBuilding
if (this.buildingForm.id) {
//
const index = this.buildings.findIndex(building => building.id === this.buildingForm.id);
if (index !== -1) {
this.buildings.splice(index, 1, { ...this.buildingForm });
}
} else {
//
this.buildingForm.id = this.buildings.length + 1; // ID
this.buildings.push({ ...this.buildingForm });
}
this.selectedBuilding = { ...this.buildingForm };
},
handleDelete(id) {
console.log('Deleting building with ID:', id); //
this.$confirm('你确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
this.$message.success('删除成功');
//
this.buildings = this.buildings.filter(building => building.id !== id);
if (this.selectedBuilding && this.selectedBuilding.id === id) {
this.selectedBuilding = null;
}
}).catch(() => {
this.$message.info('已取消删除');
});
},
handleEdit(building) {
this.dialogVisible = true;
this.buildingForm = { ...building }; //
}
}
};
</script>
<style scoped>
.container {
display: flex;
flex-direction: column;
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;
}
.content {
padding: 1rem;
display: flex;
}
.containertop {
height: auto;
display: flex;
justify-content: space-between;
padding: .7rem 0;
padding: .5rem;
border-bottom: 1px solid #E5E5E5;
}
.topleft {
width: 8rem;
display: flex;
gap: 0.4rem;
align-items: center;
}
.topleft img {
width: 0.81rem;
height: 0.81rem;
}
.topleft span {
width: auto;
height: 0.88rem;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 500;
font-size: 0.88rem;
color: #3D424C;
line-height: 0.88rem;
text-align: right;
font-style: normal;
text-transform: none;
}
.descriptionsdiv {
width: 100%;
margin-left: 1rem;
height: auto;
}
.tagdiv {
padding: 1rem 2rem 1rem 2rem;
display: flex;
}
.tagdiv img {
width: 1.4rem;
height: 1.5rem;
}
.tagdiv span {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 0.88rem;
color: #808080;
line-height: 0.88rem;
text-align: right;
font-style: normal;
text-transform: none;
}
.tagitem {
width: 6.25rem;
height: 2rem;
background: #FAFAFA;
border-radius: 2.13rem 2.13rem 2.13rem 2.13rem;
display: flex;
justify-content: space-around;
align-items: center;
cursor: pointer;
}
.important-building {
background-color: rgba(43, 98, 241, 0.1);
}
</style>

@ -91,14 +91,15 @@
<el-table-column label="总用地面积(平方米)" align="center" prop="zydmj" /> <el-table-column label="总用地面积(平方米)" align="center" prop="zydmj" />
<el-table-column label="当前状态" align="center" prop="status"> <el-table-column label="当前状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<span :style="{ color: statusColors[scope.row.status] }">{{ scope.row.status }}</span> <span :style="{ color: statusColors[statusMap[scope.row.status]] }">{{
statusMap[scope.row.status] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="getInfo(scope.row)"></el-button> <el-button size="mini" type="text" @click="getInfo(scope.row, 'fill')"
<el-button size="mini" type="text" @click="handleDelete(scope.row)" v-if="statusMap[scope.row.status] === '待填报'">填报</el-button>
style="color: #F25353;">删除</el-button> <el-button size="mini" type="text" @click="getInfo(scope.row, 'detail')">详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -137,6 +138,17 @@ export default {
'待填报': '#FFBF6B', '待填报': '#FFBF6B',
'待审核': '#7693D8' '待审核': '#7693D8'
}, },
//
statusMap: {
1: '待填报',
2: '待审核',
3: '审核通过'
},
// xzflMap:{
// 1:'',
// 2:'',
// 3:''
// },
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -220,25 +232,11 @@ export default {
); );
}, },
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除项目id为"' + ids + '"的数据项?')
.then(() => {
return delBasicInformation(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => { });
},
/** 详情按钮操作 */ /** 详情按钮操作 */
getInfo(row) { getInfo(row, type) {
this.$store.commit("SET_CRUMBS", this.$route.meta.title + "详情"); this.$store.commit("SET_CRUMBS", this.$route.meta.title + "详情");
const id = row.id || this.ids[0]; const id = row.id || this.ids[0];
this.$router.push({ path: `/manage-info/${id}` }); this.$router.push({ path: `/manage-info/${id}`, query: { action: type } });
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {

@ -3,7 +3,8 @@
<!-- 政务端页面 --> <!-- 政务端页面 -->
<!-- 表单查询项 --> <!-- 表单查询项 -->
<div class="headerbox"> <div class="headerbox">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="200"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="200">
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="项目名称政务端" prop="postName" style="width: 100%;"> <el-form-item label="项目名称政务端" prop="postName" style="width: 100%;">
@ -13,15 +14,16 @@
</el-col> </el-col>
<el-col :span="9"> <el-col :span="9">
<el-form-item label="项目建设起止时间" prop=""> <el-form-item label="项目建设起止时间" prop="">
<el-date-picker type="daterange" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :style="{ width: '100%' }" <el-date-picker type="daterange" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
start-placeholder="开始日期" end-placeholder="结束日期" range-separator="至" clearable :style="{ width: '100%' }" start-placeholder="开始日期" end-placeholder="结束日期"
v-model="queryParams.dateRange"></el-date-picker> range-separator="至" clearable v-model="queryParams.dateRange"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="现状分类"> <el-form-item label="现状分类">
<el-select v-model="queryParams.postCode" placeholder="现状分类" clearable> <el-select v-model="queryParams.postCode" placeholder="现状分类" clearable>
<el-option v-for="dict in dict.type.xzfl" :key="dict.value" :label="dict.label" :value="dict.value" /> <el-option v-for="dict in dict.type.xzfl" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -35,7 +37,8 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini"
@click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -49,7 +52,7 @@
<div class="headtitle"><span>项目清单</span></div> <div class="headtitle"><span>项目清单</span></div>
<div class="headbtn"> <div class="headbtn">
<el-button type="primary" icon="el-icon-download" @click="importTemplate"></el-button> <el-button type="primary" icon="el-icon-download" @click="importTemplate"></el-button>
<el-button type="primary" size="mini" @click="handleImport"></el-button> <!-- 导入按钮 --> <el-button type="primary" size="mini" @click="handleImport"></el-button>
</div> </div>
</div> </div>
<!-- 导入弹窗 --> <!-- 导入弹窗 -->
@ -72,7 +75,8 @@
<div class="tablebtntwo"> <div class="tablebtntwo">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" icon="el-icon-upload2" size="medium" @click="handleExport"></el-button> <el-button type="primary" icon="el-icon-upload2" size="medium"
@click="handleExport">导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-dropdown @command=""> <el-dropdown @command="">
@ -100,31 +104,32 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="总投资额(万元)" align="center" width="130" prop="ztze" /> <el-table-column label="总投资额(万元)" align="center" width="130" prop="ztze" />
<el-table-column label="总用地面积(平方米)" align="center" prop="totalLandArea" /> <el-table-column label="总用地面积(平方米)" align="center" prop="zydmj" />
<el-table-column label="当前状态" align="center" prop="status"> <el-table-column label="当前状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<span :style="{ color: statusColors[scope.row.status] }">{{ scope.row.status }}</span> <span :style="{ color: statusColors[statusMap[scope.row.status]] }">{{
statusMap[scope.row.status] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="getInfo(scope.row)"></el-button> <el-button size="mini" type="text" @click="getInfo(scope.row)"></el-button>
<el-button size="mini" type="text" @click="handleDelete(scope.row)" style="color: #F25353;">删除</el-button> <el-button size="mini" type="text" @click="handleDelete(scope.row)"
style="color: #F25353;">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
@pagination="getList" /> :limit.sync="queryParams.pageSize" @pagination="getList" />
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getBasicInformationPage } from "@/api/ManageApi/index"; import { getBasicInformationPage, deleteBasicInformation } from "@/api/ManageApi/index";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { checkPermi, checkRole } from "@/utils/permission"; import { checkPermi, checkRole } from "@/utils/permission";
export default { export default {
name: "Post",
dicts: ["xzfl"], dicts: ["xzfl"],
data() { data() {
return { return {
@ -148,6 +153,12 @@
'待填报': '#FFBF6B', '待填报': '#FFBF6B',
'待审核': '#7693D8' '待审核': '#7693D8'
}, },
//
statusMap: {
1: '待填报',
2: '待审核',
3: '审核通过'
},
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -238,14 +249,13 @@
`项目列表${new Date().getTime()}.xlsx` `项目列表${new Date().getTime()}.xlsx`
); );
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal this.$modal
.confirm('是否确认删除项目id为"' + ids + '"的数据项?') .confirm('是否确认删除项目id为"' + ids + '"的数据项?')
.then(() => { .then(() => {
return delBasicInformation(ids); return deleteBasicInformation(ids); // API
}) })
.then(() => { .then(() => {
this.getList(); this.getList();

@ -24,7 +24,8 @@
</div> </div>
<!-- 基本信息 --> <!-- 基本信息 -->
<div id="basic"> <div id="basic">
<Basic :basicInfo="basicInformation" @update-data="handleDataUpdate('basicInformation', $event)"> <Basic :action="action" :basicInfo="basicInformation"
@update-data="handleDataUpdate('basicInformation', $event)">
</Basic> </Basic>
</div> </div>
<!-- 规划信息 --> <!-- 规划信息 -->
@ -34,7 +35,8 @@
</div> </div>
<!-- 建筑信息 --> <!-- 建筑信息 -->
<div id="buildings"> <div id="buildings">
<!-- <Buildings :buildingInfo="buildingInformation"></Buildings> --> <Buildings
:xmId="projectId"></Buildings>
</div> </div>
<!-- 要素模型信息 --> <!-- 要素模型信息 -->
<div id="models"> <div id="models">
@ -43,7 +45,7 @@
</div> </div>
<!-- 月度进展信息 --> <!-- 月度进展信息 -->
<div id="months"> <div id="months">
<!-- <Months></Months> --> <Months></Months>
</div> </div>
<!-- 企业入驻信息 --> <!-- 企业入驻信息 -->
<div id="companyenter"> <div id="companyenter">
@ -52,11 +54,12 @@
</div> </div>
<!-- 项目画像 --> <!-- 项目画像 -->
<div id="projectpicture"> <div id="projectpicture">
<!-- <Projectpicture></Projectpicture> --> <Projectpicture></Projectpicture>
</div> </div>
<!-- 项目图例 --> <!-- 项目图例 -->
<div id="projectpicturetwo"> <div id="projectpicturetwo">
<!-- <Projectpicturetwo :id="projectId"></Projectpicturetwo> --> <!-- <Projectpicturetwo :id="projectId"></Projectpicturetwo> -->
<Projectpicturetwo22 :xmId="projectId"> </Projectpicturetwo22>
</div> </div>
<!-- 项目巡礼 --> <!-- 项目巡礼 -->
<div id="projectgift"> <div id="projectgift">
@ -64,11 +67,11 @@
</div> </div>
<!-- 现场实况 --> <!-- 现场实况 -->
<div id="liver"> <div id="liver">
<!-- <Liver></Liver> --> <Liver></Liver>
</div> </div>
<!-- 项目备忘录 --> <!-- 项目备忘录 -->
<div id="memo"> <div id="memo">
<!-- <Memo :xmId="projectId"></Memo> --> <!-- <Memo></Memo> -->
</div> </div>
<!-- 其他信息 --> <!-- 其他信息 -->
<div class="bottombox" id="others"> <div class="bottombox" id="others">
@ -76,8 +79,9 @@
</Others> </Others>
</div> </div>
<div class="footer"> <div class="footer">
<el-button type="primary" v-if="checkRole(['admin', 'common']) && !isSubmitted"></el-button> <el-button type="primary" v-if="checkRole(['admin', 'common'])" @click="aduitAll"></el-button>
<el-button type="primary" v-if="checkRole(['admin', 'company']) && !isSubmitted" <el-button type="primary"
v-if="(checkRole(['company']) && !isSubmitted && action === 'fill') || action === 'fill'"
@click="submitAll">提交审核</el-button> @click="submitAll">提交审核</el-button>
</div> </div>
</div> </div>
@ -99,9 +103,10 @@ import Programme from '@/views/components/ProjectDetails/Programme.vue';
import Projectgift from '@/views/components/ProjectDetails/Projectgift.vue'; import Projectgift from '@/views/components/ProjectDetails/Projectgift.vue';
import Projectpicture from '@/views/components/ProjectDetails/Projectpicture.vue'; import Projectpicture from '@/views/components/ProjectDetails/Projectpicture.vue';
import Projectpicturetwo from '@/views/components/ProjectDetails/Projectpicturetwo.vue'; import Projectpicturetwo from '@/views/components/ProjectDetails/Projectpicturetwo.vue';
import Projectpicturetwo22 from '@/views/components/ProjectDetails/Projectpicturetwo22.vue';
import Others from '@/views/components/ProjectDetails/Others.vue'; import Others from '@/views/components/ProjectDetails/Others.vue';
import { checkPermi, checkRole } from "@/utils/permission"; // import { checkPermi, checkRole } from "@/utils/permission";
import { getBasicInformationById } from '@/api/ManageApi/index'; import { getBasicInformationById, fillBasicInformation, auditBasicInformation } from '@/api/ManageApi/index';
export default { export default {
components: { components: {
@ -117,6 +122,7 @@ export default {
Projectgift, Projectgift,
Projectpicture, Projectpicture,
Projectpicturetwo, Projectpicturetwo,
Projectpicturetwo22,
Others, Others,
}, },
data() { data() {
@ -137,19 +143,84 @@ export default {
{ id: 'others', label: '其他信息' } { id: 'others', label: '其他信息' }
], ],
projectId: null, projectId: null,
isContainerVisible: true, // containerbody isContainerVisible: true,
isSubmitted: false, // isSubmitted: false,
basicInformation: {}, basicInformation: {
planInformation: {}, 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
},
projectOtherInfos: [], projectOtherInfos: [],
wysmxInformations: [], wysmxInformations: [],
qyrzInformation: {}, 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() { created() {
// projectId // projectId
this.projectId = Number(this.$route.params.id); this.projectId = Number(this.$route.params.id);
this.loadData(); this.loadData();
this.action = this.$route.query.action;
}, },
methods: { methods: {
checkPermi, checkPermi,
@ -160,10 +231,11 @@ export default {
const data = response.data; const data = response.data;
this.basicInformation = data.basicInformation; this.basicInformation = data.basicInformation;
this.planInformation = data.planInformation; this.planInformation = data.planInformation;
this.buildingInformation = data.buildingInformation; // this.buildingInformation = data.buildingInformation;
this.projectOtherInfos = data.projectOtherInfos; this.projectOtherInfos = data.projectOtherInfos;
this.wysmxInformations = data.wysmxResponses; this.wysmxInformations = data.wysmxResponses;
this.qyrzInformation = data.qyrzInformation; this.qyrzInformation = data.qyrzInformation;
this.projectRemarks = data.projectRemarks
console.log(data); console.log(data);
}); });
}, },
@ -186,11 +258,9 @@ export default {
// //
handleDataUpdate(dataKey, updatedData) { handleDataUpdate(dataKey, updatedData) {
if (dataKey === 'projectOtherInfos' || dataKey === 'wysmxInformations') { if (dataKey === 'projectOtherInfos' || dataKey === 'wysmxInformations') {
// updatedData
if (Array.isArray(updatedData)) { if (Array.isArray(updatedData)) {
this[dataKey] = updatedData; this[dataKey] = updatedData;
} else { } else {
// updatedData
this[dataKey].push(updatedData); this[dataKey].push(updatedData);
} }
} else { } else {
@ -200,22 +270,91 @@ export default {
}, },
// //
submitAll() { submitAll() {
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() {
const submitData = { const submitData = {
basicInformation: this.basicInformation, basicInformation: this.basicInformation,
planInformation: this.planInformation, planInformation: this.planInformation,
projectOtherInfos: this.projectOtherInfos, projectOtherInfos: this.projectOtherInfos,
wysmxInformations: this.wysmxInformations,
qyrzInformation: this.qyrzInformation qyrzInformation: this.qyrzInformation
// ...
}; };
console.log('提交的数据:', submitData); // wysmxInformations 使
this.$message.success('数据已打印到控制台'); const formattedWysmxInformations = [];
// containerbody this.wysmxInformations.forEach(item => {
this.isContainerVisible = false; item.list.forEach(listItem => {
// formattedWysmxInformations.push({
this.isSubmitted = true; 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> </script>

Loading…
Cancel
Save