-
+
{{ item.monthDoneAmount }}
@@ -70,7 +129,11 @@
-
+
{{ item.totalDoneAmount }}
@@ -80,7 +143,7 @@
-
+
{{ item.jzmqjc }}
@@ -90,7 +153,7 @@
-
+
{{ formattedXmjzxq(item.xmjzxq) }}
@@ -99,10 +162,27 @@
- 编辑
- 保存
- 删除
+ 编辑
+ 保存
+ 删除
@@ -114,13 +194,22 @@
-
+
-
-
+
+
@@ -128,22 +217,36 @@
-
+
-
+
-
+
-
+
@@ -155,6 +258,109 @@
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+
+
+
+ 项目名称:{{ selectedProject.projectName || "暂无" }}
+
+
+
+
+
+
+ 项目单位:{{ selectedProject.companyName || "暂无" }}
+
+
+
+
+ 联系人:{{ selectedProject.contactName || "暂无" }}
+
+
+
+
+ 联系电话:{{ selectedProject.contactPhone || "暂无" }}
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确定
+
+
+
@@ -165,45 +371,64 @@
// 查看详情信息
import { getMonthInformationPage } from "@/api/ManageApi/index";
// 在Apitwo里
-import { updateProjectProgress, deletemonth, addmonth } from "@/api/manageApitwo/index";
+import {
+ updateProjectProgress,
+ deletemonth,
+ addmonth,
+ bindProject,
+ searchProjects,
+} from "@/api/manageApitwo/index";
+
import { checkPermi, checkRole } from "@/utils/permission";
// 投资
-import yuedutouzi from '@/views/components/analysis/yuedutouzi.vue'
-
+import yuedutouzi from "@/views/components/analysis/yuedutouzi.vue";
export default {
components: { yuedutouzi },
props: {
action: {
type: String,
- required: true
+ required: true,
},
xmId: {
type: Number,
- required: true
- }
+ required: true,
+ },
+ basicInfo: {
+ type: Object,
+ required: true,
+ },
},
data() {
return {
+ formDialog: {
+ name: "",
+ },
+ userInput: "", // 新增,记录用户输入
tableData: [], // 表格数据
dialogVisible: false, // 控制弹窗显示
+ bindDialogVisible: false, //用于绑定的弹窗
+ bindText: "绑定项目", // 初始状态为“绑定项目”
+ bindSuccess: false, // 新增:是否已绑定
+ bindForm: {
+ projectName: "",
+ },
+ selectedProject: null, // 绑定的项目对象
form: {
month: "", // 进度月份
status: "已更新", // 状态固定为“已更新”
monthDoneAmount: "", // 当月完成投资
totalDoneAmount: "", // 累计完成投资
jzmqjc: "", // 截止目前累计建成面积
- xmjzxq: "" // 项目进展详情
+ xmjzxq: "", // 项目进展详情
},
rules: {
- month: [
- { required: true, message: "请选择月份", trigger: "change" }
- ],
+ month: [{ required: true, message: "请选择月份", trigger: "change" }],
monthDoneAmount: [
{ required: true, message: "请输入当月完成投资", trigger: "blur" },
{
validator: (rule, value, callback) => {
- if (value === '' || value === null) {
+ if (value === "" || value === null) {
callback(new Error("请输入数字"));
} else if (isNaN(value)) {
callback(new Error("只能输入数字"));
@@ -211,14 +436,14 @@ export default {
callback();
}
},
- trigger: 'blur'
- }
+ trigger: "blur",
+ },
],
totalDoneAmount: [
{ required: true, message: "请输入累计完成投资", trigger: "blur" },
{
validator: (rule, value, callback) => {
- if (value === '' || value === null) {
+ if (value === "" || value === null) {
callback(new Error("请输入数字"));
} else if (isNaN(value)) {
callback(new Error("只能输入数字"));
@@ -226,23 +451,91 @@ export default {
callback();
}
},
- trigger: 'blur'
- }
- ]
- }
+ trigger: "blur",
+ },
+ ],
+ },
};
},
computed: {
formattedXmjzxq() {
return (text) => {
- return text === 'etry' ? '' : text;
+ return text === "etry" ? "" : text;
};
- }
+ },
+ },
+ watch: {
+ basicInfo: {
+ handler(newVal) {
+ if (newVal && newVal.name) {
+ this.formDialog = {
+ ...this.formDialog,
+ name: newVal.name,
+ };
+ }
+ },
+ immediate: true,
+ deep: true,
+ },
},
methods: {
checkPermi,
checkRole,
-
+ async searchProjects() {
+ const userInput = this.bindForm.projectName.trim();
+ this.userInput = userInput;
+ if (!userInput) {
+ this.$message.warning("请输入项目名称");
+ this.selectedProject = null;
+ return;
+ }
+ try {
+ const res = await searchProjects({ projectName: userInput });
+ // 这里修正为 res.data 是数组
+ if (
+ res.code === 200 &&
+ Array.isArray(res.data) &&
+ res.data.length > 0
+ ) {
+ this.selectedProject = res.data[0];
+ } else {
+ this.selectedProject = null;
+ this.$message.warning("未查询到相关项目");
+ }
+ } catch (error) {
+ this.$message.error("查询失败,请稍后再试");
+ this.selectedProject = null;
+ }
+ },
+ async confirmBinding() {
+ if (!this.selectedProject) {
+ this.$message.warning("请先查询固投平台项目");
+ return;
+ }
+ try {
+ const res = await bindProject({
+ id: this.xmId,
+ projectId: this.selectedProject.projectId,
+ });
+ if (res.code === 200) {
+ this.$message.success("绑定成功");
+ this.bindText = `已绑定 ${this.selectedProject.projectName} 项目`;
+ this.bindForm.projectName = this.selectedProject.projectName;
+ this.bindSuccess = true;
+ this.bindDialogVisible = false;
+ } else {
+ this.$message.error(res.msg || "绑定失败");
+ }
+ } catch (error) {
+ this.$message.error("绑定失败,请稍后再试");
+ }
+ },
+ handleBindProject() {
+ this.bindForm.projectName = "";
+ this.selectedProject = null;
+ this.bindSuccess = false;
+ this.bindDialogVisible = true;
+ },
// 新增按钮点击
handleAdd() {
this.form = {
@@ -251,22 +544,22 @@ export default {
monthDoneAmount: "",
totalDoneAmount: "",
jzmqjc: "",
- xmjzxq: ""
+ xmjzxq: "",
};
this.dialogVisible = true;
},
// 提交新增表单
submitForm() {
- this.$refs.formRef.validate(valid => {
+ this.$refs.formRef.validate((valid) => {
if (valid) {
const payload = {
...this.form,
- xmId: this.xmId
+ xmId: this.xmId,
};
addmonth(payload)
- .then(response => {
+ .then((response) => {
if (response.code === 200) {
this.$message.success("新增成功");
this.dialogVisible = false;
@@ -275,7 +568,7 @@ export default {
this.$message.error(response.msg || "新增失败");
}
})
- .catch(error => {
+ .catch((error) => {
console.error("新增失败:", error);
this.$message.error("新增失败,请稍后再试");
});
@@ -291,7 +584,7 @@ export default {
this.download(
"/gysl/projectProgress/export",
{
- xmId: this.xmId
+ xmId: this.xmId,
},
`月度信息${new Date().getTime()}.xlsx`
);
@@ -304,13 +597,13 @@ export default {
if (Array.isArray(response.data) && response.data.length > 0) {
// 接口返回的数据处理:统一 status 为 “已更新”
- this.tableData = response.data.map(item => ({
+ this.tableData = response.data.map((item) => ({
...item,
- status: '已更新',
+ status: "已更新",
monthDoneAmount: item.monthDoneAmount ?? 0,
totalDoneAmount: item.totalDoneAmount ?? 0,
- jzmqjc: item.jzmqjc ?? '',
- xmjzxq: item.xmjzxq ?? ''
+ jzmqjc: item.jzmqjc ?? "",
+ xmjzxq: item.xmjzxq ?? "",
}));
} else {
this.tableData = [];
@@ -324,8 +617,8 @@ export default {
// 编辑某一行
handleEdit(row) {
// 设置当前行为可编辑状态
- this.tableData.forEach(item => {
- this.$set(item, 'isEditing', item.id === row.id);
+ this.tableData.forEach((item) => {
+ this.$set(item, "isEditing", item.id === row.id);
});
},
@@ -338,14 +631,14 @@ export default {
monthDoneAmount: row.monthDoneAmount,
totalDoneAmount: row.totalDoneAmount,
jzmqjc: row.jzmqjc,
- xmjzxq: row.xmjzxq
+ xmjzxq: row.xmjzxq,
};
const response = await updateProjectProgress(updateData);
if (response.code === 200) {
this.$message.success("更新成功");
- this.$set(row, 'isEditing', false);
+ this.$set(row, "isEditing", false);
} else {
this.$message.error(response.msg || "更新失败");
}
@@ -360,7 +653,7 @@ export default {
this.$confirm("确定要删除此条月度进展记录吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning"
+ type: "warning",
})
.then(async () => {
try {
@@ -369,11 +662,13 @@ export default {
if (response.code === 200) {
this.$message({
type: "success",
- message: "删除成功!"
+ message: "删除成功!",
});
// 从本地数据中移除
- const index = this.tableData.findIndex(item => item.id === row.id);
+ const index = this.tableData.findIndex(
+ (item) => item.id === row.id
+ );
if (index !== -1) {
this.tableData.splice(index, 1);
}
@@ -388,7 +683,7 @@ export default {
.catch(() => {
this.$message({
type: "info",
- message: "已取消删除"
+ message: "已取消删除",
});
});
},
@@ -403,11 +698,11 @@ export default {
default:
return "";
}
- }
+ },
},
created() {
this.getMonthInformationPage();
- }
+ },
};
@@ -416,7 +711,7 @@ export default {
display: flex;
flex-direction: column;
width: 100%;
- background-color: #FFFFFF;
+ background-color: #ffffff;
box-shadow: 0rem 0.13rem 0.63rem 0rem rgba(177, 177, 177, 0.1);
border-radius: 0.5rem;
}
@@ -425,12 +720,12 @@ export default {
height: auto;
display: flex;
justify-content: space-between;
- padding: .5rem;
- border-bottom: 1px solid #E5E5E5;
+ padding: 0.5rem;
+ border-bottom: 1px solid #e5e5e5;
}
.topleft {
- width: 8rem;
+ width: 50%;
height: 2rem;
display: flex;
gap: 0.4rem;
@@ -442,29 +737,36 @@ export default {
height: 0.81rem;
}
-.topleft span {
+.lefttitle {
font-family: aliregular;
font-weight: 500;
font-size: 1rem;
- color: #3D424C;
+ color: #3d424c;
line-height: 1rem;
}
+.bind-project {
+ font-size: 0.88rem;
+ color: #1890ff;
+ cursor: pointer;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 200px;
+}
.content {
padding: 1rem 1rem 1rem 2rem;
}
-/* 自定义表格样式 */
.custom-table-container {
width: 100%;
- border: 1px solid #EBEEF5;
+ border: 1px solid #ebeef5;
overflow: hidden;
}
.custom-table-header {
display: flex;
background-color: #f5f7fa;
- /* font-weight: bold; */
font-size: 0.88rem;
padding: 0.5rem 0;
}
@@ -480,7 +782,7 @@ export default {
display: flex;
align-items: center;
padding: 0.5rem 0;
- border-bottom: 1px solid #EBEEF5;
+ border-bottom: 1px solid #ebeef5;
}
.table-cell {
@@ -498,9 +800,18 @@ export default {
color: #999;
font-size: 0.875rem;
}
-.yuedu{
+.yuedu {
width: 100%;
height: 100%;
padding: 0rem 1rem 1rem 2rem;
}
-
\ No newline at end of file
+.grid-content {
+ min-height: 36px;
+ display: flex;
+ align-items: center; /* 垂直居中 */
+ font-size: 0.875rem;
+ color: #666;
+ padding: 8px 12px;
+ border-radius: 4px;
+}
+
diff --git a/src/views/manage-add/index.vue b/src/views/manage-add/index.vue
index 968afb4..7caf08b 100644
--- a/src/views/manage-add/index.vue
+++ b/src/views/manage-add/index.vue
@@ -87,7 +87,7 @@
-
+
diff --git a/src/views/manage-info/index.vue b/src/views/manage-info/index.vue
index 3c65829..8e2e006 100644
--- a/src/views/manage-info/index.vue
+++ b/src/views/manage-info/index.vue
@@ -81,7 +81,7 @@
-
+