diff --git a/src/views/compilation/onecailiao-info/index.vue b/src/views/compilation/onecailiao-info/index.vue deleted file mode 100644 index fe60de4..0000000 --- a/src/views/compilation/onecailiao-info/index.vue +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/src/views/components/ProjectDetails/Basic.vue b/src/views/components/ProjectDetails/Basic.vue index 6a89fe0..464206a 100644 --- a/src/views/components/ProjectDetails/Basic.vue +++ b/src/views/components/ProjectDetails/Basic.vue @@ -145,7 +145,7 @@ - + ~ @@ -319,7 +319,15 @@ export default { ], introduction: [ { max: 1000, message: '项目简介长度不能超过1000个字', trigger: 'blur' } - ] + ], + tyshxydm: [ + { required: true, message: "请填写", trigger: "blur" }, + { + pattern: /^[a-zA-Z0-9]{18}$/, + message: "请输入正确格式的18位统一社会信用代码", + trigger: "blur", + }, + ], }, // select映射 ssgnqMap: { diff --git a/src/views/components/ProjectDetails/Buildings.vue b/src/views/components/ProjectDetails/Buildings.vue index bd6ac93..7fc962c 100644 --- a/src/views/components/ProjectDetails/Buildings.vue +++ b/src/views/components/ProjectDetails/Buildings.vue @@ -440,24 +440,31 @@ export default { this.selectedBuilding = building; // 直接使用传入的building对象 }, handleAddBuilding() { - const api = this.buildingForm.id ? updatejzxx : addjzxx; // 根据是否有ID判断是新增还是更新 - const form = { - ...this.buildingForm - }; - api(form) - .then(response => { - if (response.code === 200) { - this.$message.success(form.id ? '更新成功' : '新增成功'); - this.dialogVisible = false; - this.fetchBuildings(); // 刷新楼栋列表 - } else { - this.$message.error(form.id ? '更新失败' : '新增失败'); - } - }) - .catch(error => { - console.error(form.id ? '更新失败:' : '新增失败:', error); - this.$message.error(form.id ? '更新失败' : '新增失败'); - }); + this.$refs.buildingFormRef.validate((valid) => { + if (valid) { + const api = this.buildingForm.id ? updatejzxx : addjzxx; // 根据是否有ID判断是新增还是更新 + const form = { + ...this.buildingForm + }; + api(form) + .then(response => { + if (response.code === 200) { + this.$message.success(form.id ? '更新成功' : '新增成功'); + this.dialogVisible = false; + this.fetchBuildings(); // 刷新楼栋列表 + } else { + this.$message.error(form.id ? '更新失败' : '新增失败'); + } + }) + .catch(error => { + console.error(form.id ? '更新失败:' : '新增失败:', error); + this.$message.error(form.id ? '更新失败' : '新增失败'); + }); + } else { + this.$message.error('请填写完整的楼栋信息'); + return false; + } + }); }, handleDelete(id) { console.log('Deleting building with ID:', id); // 调试信息 diff --git a/src/views/components/ProjectDetails/Companyenter.vue b/src/views/components/ProjectDetails/Companyenter.vue index 0d37f77..f54d1a4 100644 --- a/src/views/components/ProjectDetails/Companyenter.vue +++ b/src/views/components/ProjectDetails/Companyenter.vue @@ -26,36 +26,35 @@
- - {{ form.rzqys }} + {{ tableData.length }} - {{ form.rzqyhylx }} + {{ form.rzqyhylx || "" }} - {{ form.rysl }} + {{ form.rysl || "" }} - {{ form.rzl }} + {{ form.rzl || "" }} - {{ form.yczmj }} + {{ form.yczmj || "" }} - {{ form.kzczmj }} + {{ form.kzczmj || "" }} - {{ form.gycfpjzj }} + {{ form.gycfpjzj || "" }} - {{ form.gycfpjwyf }} + {{ form.gycfpjwyf || "" }}
@@ -104,14 +103,9 @@
- +
@@ -198,7 +192,7 @@ export default { }; }, created() { - console.log('xmId:', this.xmId); + console.log('xmId:', this.xmId); this.fetchTableData(); }, watch: { @@ -218,7 +212,7 @@ export default { current: this.pagination.currentPage, size: this.pagination.pageSize }; - getqyBasicInformationPage(params).then(response => { + return getqyBasicInformationPage(params).then(response => { console.log('Fetched Data:', response.data.records); // 调试信息 this.tableData = response.data.records.map(item => ({ ...item, @@ -238,7 +232,7 @@ export default { save() { const formData = { ...this.form, - rzqys: Number(this.form.rzqys), + rzqys: this.tableData.length, rysl: Number(this.form.rysl), rzl: Number(this.form.rzl), yczmj: Number(this.form.yczmj), @@ -256,7 +250,6 @@ export default { }, saveRow(row) { row.isEditing = false; - // 这里可以调用更新接口,将修改后的数据发送到服务器 updateqyBasicInformation(row).then(response => { this.$modal.msgSuccess('保存成功'); }).catch(error => { @@ -270,7 +263,12 @@ export default { this.$modal.msgSuccess('删除成功'); this.tableData.splice(index, 1); // 重新获取表格数据以确保分页正确 - this.fetchTableData(); + this.fetchTableData().then(() => { + // 更新 form 数据 + this.form.rzqys = this.tableData.length; + // 调用 save 方法发送最新的数据 + this.save(); + }); }).catch(error => { console.error('删除失败:', error); this.$modal.msgError('删除失败'); @@ -294,19 +292,23 @@ export default { this.upload.isUploading = true; }, handleFileSuccess(response) { - this.upload.isUploading = false; - this.upload.open = false; - this.$refs.upload.clearFiles(); + this.upload.isUploading = false; + this.upload.open = false; + this.$refs.upload.clearFiles(); - if (response.code === 200) { + if (response.code === 200) { this.$modal.msgSuccess(response.msg); // 重新获取表格数据 - this.fetchTableData(); - this.$emit("refresh-data"); // 通知父组件刷新 - } else { + this.fetchTableData().then(() => { + // 更新 form 数据 + this.form.rzqys = this.tableData.length; + // 调用 save 方法发送最新的数据 + this.save(); + }); + } else { this.$modal.msgError(response.msg || "导入失败"); - } - }, + } +}, submitFileForm() { if (this.$refs.upload.uploadFiles.length === 0) { this.$modal.msgWarning("请先选择文件"); @@ -317,7 +319,7 @@ export default { formData.append('file', this.$refs.upload.uploadFiles[0].raw); formData.append('xmId', this.upload.data.xmId); - this.$refs.upload.submit(formData); // 提交表单数据 + this.$refs.upload.submit(formData); }, // 分页处理 diff --git a/src/views/components/ProjectDetails/Others.vue b/src/views/components/ProjectDetails/Others.vue index 5abb7c2..30151dd 100644 --- a/src/views/components/ProjectDetails/Others.vue +++ b/src/views/components/ProjectDetails/Others.vue @@ -152,10 +152,15 @@ export default { // 发送给父组件 this.$emit('update-info', updatedData); + // 更新 anotherInfo 数据 + this.anotherInfo = updatedData; + // 退出编辑模式 this.isEditMode = false; + this.$message.success('保存成功'); } catch (error) { console.error('保存失败:', error); + this.$message.error('保存失败: ' + (error.message || '请检查网络连接')); } finally { this.saveLoading = false; } @@ -186,10 +191,12 @@ export default { this.editedData = this.editedData.filter(i => i.id !== item.id); } + // 从 anotherInfo 中移除对应的数据 + this.anotherInfo = this.anotherInfo.filter(i => i.id !== item.id); + // 通知父组件更新数据 this.$emit('delete-info', item.id); this.$message.success('删除成功'); - location.reload(); // 直接刷新页面 } catch (error) { this.$message.error('删除失败: ' + (error.message || '请检查网络连接')); } @@ -225,10 +232,20 @@ export default { // 调用API新增数据 const response = await addxmqt(requestData); console.log('新增成功:', response); + + // 将新数据添加到 anotherInfo 数组中 + this.anotherInfo.push({ + id: response.data.id, // 假设响应中包含新增数据的ID + zdname: this.form.zdname, + zdinfor: this.form.zdinfor + }); + + // 关闭对话框 this.dialogVisible = false; this.$message.success('新增成功'); - location.reload(); // 直接刷新页面 - } catch (error) { } + } catch (error) { + this.$message.error('新增失败: ' + (error.message || '请检查网络连接')); + } }, // 删除数据 diff --git a/src/views/components/ProjectDetails/Programme.vue b/src/views/components/ProjectDetails/Programme.vue index 9315bc8..01a010e 100644 --- a/src/views/components/ProjectDetails/Programme.vue +++ b/src/views/components/ProjectDetails/Programme.vue @@ -135,7 +135,7 @@ export default { type: Object, required: true }, - xmId:{ + xmId: { type: Number, required: true }, @@ -176,7 +176,7 @@ export default { updateTime: null, }, rules: { - + } }; }, @@ -196,9 +196,9 @@ export default { /** 导出 */ handleExport() { this.download( - "/gysl/basicInformation/export", + "/gysl/planInformation/export", { - xmid: this.form.xmId + xmId: this.form.xmId }, `规划信息${new Date().getTime()}.xlsx` ); @@ -206,6 +206,7 @@ export default { // 打开编辑模式 edit() { this.isEditing = true; + document.addEventListener('click', this.handleClickOutside); }, // 保存数据 save() { @@ -214,18 +215,16 @@ export default { // 触发事件,将数据传递给父组件 this.$emit('update-data', formData); this.isEditing = false; + document.removeEventListener('click', this.handleClickOutside); } }, // 手动验证表单 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; - } + const requiredFields = ['zydmj', 'rjl', 'zjzmj', 'jzds', 'zgjzcs', 'fhdj']; + for (const field of requiredFields) { + if (!this.form[field]) { + this.$message.error('请填写完整的规划信息'); + return false; } } return true; @@ -249,6 +248,12 @@ export default { // 处理文件上传结果 handleFileUploaded(fileName) { this.form.ghwj = `${this.baseUrl}/${fileName}`; // 添加 baseURL 前缀 + }, + handleClickOutside(event) { + const saveButton = this.$el.querySelector('.el-button:contains("保存")'); + if (!this.$el.contains(event.target) || saveButton.contains(event.target)) { + return; + } } } }; diff --git a/src/views/components/ProjectDetails/Projectgift.vue b/src/views/components/ProjectDetails/Projectgift.vue index d89de22..572b3cd 100644 --- a/src/views/components/ProjectDetails/Projectgift.vue +++ b/src/views/components/ProjectDetails/Projectgift.vue @@ -19,7 +19,7 @@
- 项目图片 + 项目图片
@@ -28,7 +28,7 @@
{{ item.xmmc || '未命名项目' }}
-
{{ formatDate(item.createTime) }}
+
{{ item.sj }}
@@ -88,7 +88,7 @@ - + @@ -125,7 +125,7 @@ - + 无图片 @@ -137,6 +137,9 @@ + + + 关 闭 @@ -165,6 +168,7 @@ export default { }, data() { return { + baseUrl: process.env.VUE_APP_BASE_API, detailVisible: false, currentItem: {}, dialogVisible: false, @@ -195,7 +199,10 @@ export default { computed: { dialogTitle() { return this.isEditMode ? '编辑项目巡礼' : '新增项目巡礼'; - } + }, + fjFileName() { + return this.currentItem.fj ? this.currentItem.fj.split('/').pop() : '无附件'; + } }, created() { this.fetchProjectList(); @@ -260,7 +267,10 @@ export default { } } }, - + // 处理文件上传结果 + handleFileUploaded(fileName) { + this.form.fj = `${this.baseUrl}/${fileName}`; // 添加 baseURL 前缀 + }, // 打开新增对话框 openAddDialog() { this.isEditMode = false; @@ -366,6 +376,7 @@ export default { ...this.form, xmId: this.xmId, id: 0, + fj: "", createTime: "", createBy: "", createId: 0, diff --git a/src/views/components/ProjectDetails/excel表格解析.vue b/src/views/components/ProjectDetails/excel表格解析.vue deleted file mode 100644 index d7b715b..0000000 --- a/src/views/components/ProjectDetails/excel表格解析.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/components/analysis/allcompany.vue b/src/views/components/analysis/allcompany.vue index 931c1e9..3ccac51 100644 --- a/src/views/components/analysis/allcompany.vue +++ b/src/views/components/analysis/allcompany.vue @@ -1,51 +1,95 @@ @@ -56,18 +100,19 @@ import { allproject } from '@/api/ManageApi'; export default { data() { return { + selectedYear: new Date().getFullYear().toString(), projectData: { allProject: 0, // 项目总数 - allGrossArea: 0, //建筑面积 + allGrossArea: 0, //建筑面积 allBuilding1: 0, // 已建 allBuilding2: 0, // 在建 allBuilding3: 0 // 拟建 }, currentYearData: { - currentYearProject: 0, //总数 - currentYearGrossArea: 0, //面积 - currentYearBuilding1: 0, //已建 - currentBuilding2: 0 //在建 + currentYearProject: 0, //总数 + currentYearGrossArea: 0, //面积 + currentYearBuilding1: 0, // 已建 + currentBuilding2: 0 // 在建 }, loading: false, error: null @@ -77,25 +122,50 @@ export default { this.fetchProjectData(); }, methods: { + /** 导出按钮操作 */ + handleExport() { + this.download( + "/gysl/zwStats/exportBg", + { + years: this.selectedYear + }, + `项目整体情况${this.selectedYear}.docx` + ); + }, + + // Handle year change + handleYearChange(year) { + if (year) { + this.selectedYear = year; + this.fetchProjectData(); + } + }, + async fetchProjectData() { this.loading = true; try { - const response = await allproject(); + // 调用 API 时传入 years 参数 + const response = await allproject({ + years: this.selectedYear, + _t: Date.now() // 添加时间戳防止缓存 + }); this.projectData = { allProject: response.data.allProject || 0, allGrossArea: response.data.allGrossArea || 0, allBuilding1: response.data.allBuilding1 || 0, allBuilding2: response.data.allBuilding2 || 0, allBuilding3: response.data.allBuilding3 || 0 - }; + }; this.currentYearData = { currentYearProject: response.data.currentYearProject || 0, currentYearGrossArea: response.data.currentYearGrossArea || 0, currentYearBuilding1: response.data.currentYearBuilding1 || 0, currentBuilding2: response.data.currentBuilding2 || 0 }; - } - finally { + } catch (error) { + console.error("获取数据失败:", error); + this.$message.error("数据加载失败"); + } finally { this.loading = false; } } @@ -104,10 +174,16 @@ export default { \ No newline at end of file diff --git a/src/views/components/analysis/invest.vue b/src/views/components/analysis/invest.vue index b5e3fb9..6d17b65 100644 --- a/src/views/components/analysis/invest.vue +++ b/src/views/components/analysis/invest.vue @@ -16,6 +16,7 @@ export default { { value: 54, name: '国企', itemStyle: { color: '#36C3FB' } }, { value: 65, name: '民企', itemStyle: { color: '#5B76F9' } }, { value: 32, name: '外企', itemStyle: { color: '#FAC858' } }, + { value: 32, name: '其他', itemStyle: { color: '#50DFB3' } }, ], }; }, @@ -31,7 +32,7 @@ export default { } else {} }, processData(data) { - const names = ['国企', '民企', '外企']; + const names = ['国企', '民企', '外企','其他']; const counts = data.map(item => item.count); return names.map((name, index) => ({ value: counts[index] || 0, @@ -50,7 +51,7 @@ export default { orient: 'vertical', // 图例垂直排列 right: '20%', // 图例在右侧 top: 'center', // 图例垂直居中 - itemGap: 35, // 右侧间隔 + itemGap: 30, // 右侧间隔 formatter: function (name) { // 自定义图例显示格式 const item = this.chartData.find(item => item.name === name); diff --git a/src/views/components/analysis/map.vue b/src/views/components/analysis/map.vue index 2ef7b8f..748b3c2 100644 --- a/src/views/components/analysis/map.vue +++ b/src/views/components/analysis/map.vue @@ -26,7 +26,6 @@
{{ item.name }}
-
{{ item.address }}
@@ -167,20 +166,25 @@ export default { }); }, centerMap(item) { - this.searchBox = item.name; - this.searchList = []; - this.selectedProject = { - name: item.name, - projectLeader: item.projectLeader || '暂无', - phone: item.phone || '暂无', - ztze: item.ztze || '暂无', - xmfrdwxz: item.xmfrdwxz || '暂无', - xzfl: item.xzfl || '暂无' - }; + if (!item.jsdd) { + this.$message.warning('该项目未落图!'); + return; + } - this.showLocationIcon = true; - this.setRandomIconPosition(); - }, + this.searchBox = item.name; + this.searchList = []; + this.selectedProject = { + name: item.name, + projectLeader: item.projectLeader || '暂无', + phone: item.phone || '暂无', + ztze: item.ztze || '暂无', + xmfrdwxz: item.xmfrdwxz || '暂无', + xzfl: item.xzfl || '暂无' + }; + + this.showLocationIcon = true; + this.setRandomIconPosition(); + }, showDialog() { if (this.selectedProject.name) { this.dialogVisible = true; diff --git a/src/views/components/qiyexinxi/qiyexinxi.vue b/src/views/components/qiyexinxi/qiyexinxi.vue index 396fff1..4060c6d 100644 --- a/src/views/components/qiyexinxi/qiyexinxi.vue +++ b/src/views/components/qiyexinxi/qiyexinxi.vue @@ -31,12 +31,12 @@
- + diff --git a/src/views/components/zhengwuxinxi/zhengwuxinxi.vue b/src/views/components/zhengwuxinxi/zhengwuxinxi.vue index 8109db0..0bdc0a8 100644 --- a/src/views/components/zhengwuxinxi/zhengwuxinxi.vue +++ b/src/views/components/zhengwuxinxi/zhengwuxinxi.vue @@ -288,16 +288,20 @@ export default { }, `基本信息${new Date().getTime()}.xlsx` ); - + }, /** 单片材料导出按钮操作 */ handleExporttwo() { + if (this.ids.length === 0) { + this.$message.warning('请选择要导出的项目'); + return; + } + this.download( "/gysl/basicInformation/wordExport", { ids: this.ids.join(","), - }, `单片材料${new Date().getTime()}.zip` ); @@ -305,9 +309,10 @@ export default { /** 删除按钮操作 */ handleDelete(row) { + const projectName = row.name; // 获取项目名称 const ids = row.id || this.ids; this.$modal - .confirm('是否确认删除项目id为"' + ids + '"的数据项?') + .confirm(`是否确认删除项目"${projectName}"?`) .then(() => { return deleteBasicInformation(ids); }) diff --git a/src/views/evalute/evalist/index.vue b/src/views/evalute/evalist/index.vue index 11b785b..4df01f6 100644 --- a/src/views/evalute/evalist/index.vue +++ b/src/views/evalute/evalist/index.vue @@ -10,7 +10,7 @@ - + + + + + ~ + + @@ -67,7 +76,7 @@ @@ -83,13 +92,8 @@ - +
@@ -238,16 +242,13 @@ export default { const params = { current: this.queryParams.current, size: this.queryParams.size, - ...(this.queryParams.name && { name: this.queryParams.name }), - ...(this.queryParams.xzfl && { xzfl: this.queryParams.xzfl }), - ...(this.queryParams.pjdj && { pjdj: this.queryParams.pjdj }), - // 直接传递已格式化的月份值 - ...(this.queryParams.begainTime && { begainTime: this.queryParams.begainTime }), - ...(this.queryParams.endTime && { endTime: this.queryParams.endTime }) + name: this.queryParams.name, + xzfl: this.queryParams.xzfl, + pjdj: this.queryParams.pjdj, + begainTime: this.queryParams.begainTime || null, + endTime: this.queryParams.endTime || null }; - console.log('最终查询参数:', params); // 调试用 - getProjectEvaluationList(params) .then(response => { this.postList = response.data.records; @@ -293,8 +294,11 @@ export default { // 处理删除 }, formatMonthYear(date) { - if (!date) return ''; - return date.split('-').slice(0, 2).join('-'); + // if (!date) return ''; + return date; + // // 确保传入的是完整日期,然后只显示年月部分 + // const fullDate = date.includes('-') ? date : `${date}-01`; // 如果只有年月,补上日期 + // return fullDate.split('-').slice(0, 2).join('-'); } }, mounted() { diff --git a/src/views/manage-add/index.vue b/src/views/manage-add/index.vue index 32dbad7..7be620b 100644 --- a/src/views/manage-add/index.vue +++ b/src/views/manage-add/index.vue @@ -81,18 +81,12 @@ @@ -340,6 +334,22 @@ export default { .finally(() => { this.loading = false; }); + }, + // 修改的提交数据 + aduitAlltwo() { + this.loading = true; + const submitData = this.prepareSubmitData(); + + auditBasicInformation(submitData) + .then(response => { + console.log('提交成功:', response); + this.$message.success('修改成功'); + this.isSubmitted = true; + this.$router.push('/manage'); + }) + .finally(() => { + this.loading = false; + }); }, // 准备数据(供暂存和提交共用) prepareSubmitData() { diff --git a/src/views/manage-info/index.vue b/src/views/manage-info/index.vue index c605685..094d0fd 100644 --- a/src/views/manage-info/index.vue +++ b/src/views/manage-info/index.vue @@ -81,7 +81,6 @@