-
- {{ 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 || "" }}
@@ -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 @@
-
+
@@ -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 @@