|
|
|
@ -6,9 +6,13 @@
|
|
|
|
|
<img src="../../../assets/images/detailsicon/1.png" alt="">
|
|
|
|
|
<span>月度进展信息</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="topright" style="visibility: hidden;">
|
|
|
|
|
<el-button></el-button>
|
|
|
|
|
<el-button></el-button>
|
|
|
|
|
<div class="topright" v-if="action === 'fill' || !action || action === 'okay'">
|
|
|
|
|
<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="handleExport">
|
|
|
|
|
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出"
|
|
|
|
|
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
|
|
|
|
|
导出
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 内容区 -->
|
|
|
|
@ -22,21 +26,21 @@
|
|
|
|
|
<span :style="getStatusColor(scope.row.status)">{{ scope.row.status }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="monthlyInvestment" label="当月完成投资" align="center">
|
|
|
|
|
<el-table-column prop="monthDoneAmount" label="当月完成投资" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-if="scope.row.isEditing" v-model.number="scope.row.monthlyInvestment"
|
|
|
|
|
<el-input v-if="scope.row.isEditing" v-model.number="scope.row.monthDoneAmount"
|
|
|
|
|
style="width: 100%;"></el-input>
|
|
|
|
|
<span v-else>{{ scope.row.monthlyInvestment }}</span>
|
|
|
|
|
<span v-else>{{ scope.row.monthDoneAmount }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="cumulativeInvestment" label="累计完成投资" align="center">
|
|
|
|
|
<el-table-column prop="totalDoneAmount" label="累计完成投资" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-if="scope.row.isEditing" v-model.number="scope.row.cumulativeInvestment"
|
|
|
|
|
<el-input v-if="scope.row.isEditing" v-model.number="scope.row.totalDoneAmount"
|
|
|
|
|
style="width: 100%;"></el-input>
|
|
|
|
|
<span v-else>{{ scope.row.cumulativeInvestment }}</span>
|
|
|
|
|
<span v-else>{{ scope.row.totalDoneAmount }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="cumulativeArea" label='截止目前累计建成面积(平方米)' align="center">
|
|
|
|
|
<el-table-column prop="cumulativeArea" label='截止目前累计建成面积(平方米)' align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-if="scope.row.isEditing" v-model.number="scope.row.cumulativeArea"
|
|
|
|
|
style="width: 100%;"></el-input>
|
|
|
|
@ -49,13 +53,12 @@
|
|
|
|
|
<span v-else>{{ scope.row.progressDetails }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button v-if="scope.row.isEditing" type="text" icon="el-icon-check"
|
|
|
|
|
<el-button v-if="scope.row.isEditing" type="text" icon="el-icon-check"
|
|
|
|
|
@click="handleSave(scope.row)">保存</el-button>
|
|
|
|
|
<el-button v-else type="text" icon="el-icon-edit"
|
|
|
|
|
@click="handleEdit(scope.row)">编辑</el-button>
|
|
|
|
|
<el-button type="text" icon="el-icon-delete" style="color: #F25353;"
|
|
|
|
|
<el-button v-else type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
|
|
<el-button type="text" icon="el-icon-delete" style="color: #F25353;"
|
|
|
|
|
@click="handleDelete(scope.row)">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
@ -72,7 +75,11 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// import { getMonthInformationPage } from "@/api/ManageApi/index";
|
|
|
|
|
// 查看详情信息
|
|
|
|
|
import { getMonthInformationPage } from "@/api/ManageApi/index";
|
|
|
|
|
//在Apitwo里
|
|
|
|
|
import { updateProjectProgress, deletemonth } from "@/api/manageApitwo/index";
|
|
|
|
|
import { checkPermi, checkRole } from "@/utils/permission";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
@ -87,13 +94,25 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
tableData: [],
|
|
|
|
|
tableData: [],
|
|
|
|
|
current: 1,
|
|
|
|
|
size: 10,
|
|
|
|
|
total: 0,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
checkPermi,
|
|
|
|
|
checkRole,
|
|
|
|
|
/** 导出 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download(
|
|
|
|
|
"/gysl/projectProgress/export",
|
|
|
|
|
{
|
|
|
|
|
xmId: this.xmId
|
|
|
|
|
},
|
|
|
|
|
`月度信息${new Date().getTime()}.xlsx`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
getStatusColor(status) {
|
|
|
|
|
switch (status) {
|
|
|
|
|
case "未更新":
|
|
|
|
@ -101,37 +120,82 @@ export default {
|
|
|
|
|
case "已更新":
|
|
|
|
|
return "color: #2B62F1;";
|
|
|
|
|
default:
|
|
|
|
|
return "";
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleEdit(row) {
|
|
|
|
|
row.originalData = { ...row };
|
|
|
|
|
row.isEditing = true;
|
|
|
|
|
},
|
|
|
|
|
handleSave(row) {
|
|
|
|
|
row.isEditing = false;
|
|
|
|
|
console.log("保存:", row);
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "保存成功!",
|
|
|
|
|
});
|
|
|
|
|
async handleSave(row) {
|
|
|
|
|
try {
|
|
|
|
|
const updateData = {
|
|
|
|
|
id: row.id,
|
|
|
|
|
monthDoneAmount: row.monthDoneAmount,
|
|
|
|
|
totalDoneAmount: row.totalDoneAmount,
|
|
|
|
|
cumulativeArea: row.cumulativeArea,
|
|
|
|
|
progressDetails: row.progressDetails,
|
|
|
|
|
};
|
|
|
|
|
const response = await updateProjectProgress(updateData);
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "更新成功!",
|
|
|
|
|
});
|
|
|
|
|
row.isEditing = false;
|
|
|
|
|
row.status = "已更新";
|
|
|
|
|
|
|
|
|
|
this.getMonthInformationPage();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.msg || "更新失败");
|
|
|
|
|
Object.assign(row, row.originalData);
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("更新失败:", error);
|
|
|
|
|
this.$message.error("更新失败");
|
|
|
|
|
Object.assign(row, row.originalData);
|
|
|
|
|
} finally {
|
|
|
|
|
delete row.originalData;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
this.$confirm("你确定要删除此条记录吗?", "提示", {
|
|
|
|
|
this.$confirm("确定要删除此条月度进展记录吗?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
if (Array.isArray(this.tableData)) {
|
|
|
|
|
const index = this.tableData.indexOf(row);
|
|
|
|
|
if (index !== -1) {
|
|
|
|
|
this.tableData.splice(index, 1);
|
|
|
|
|
.then(async () => {
|
|
|
|
|
try {
|
|
|
|
|
// 调用删除接口
|
|
|
|
|
const response = await deletemonth([row.id]);
|
|
|
|
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "删除成功!",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 从本地数据中移除已删除项
|
|
|
|
|
const index = this.tableData.findIndex(item => item.id === row.id);
|
|
|
|
|
if (index !== -1) {
|
|
|
|
|
this.tableData.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新总数
|
|
|
|
|
this.total -= 1;
|
|
|
|
|
|
|
|
|
|
// 如果当前页没有数据且不是第一页,则返回上一页
|
|
|
|
|
if (this.tableData.length === 0 && this.current > 1) {
|
|
|
|
|
this.current -= 1;
|
|
|
|
|
this.getMonthInformationPage();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.msg || "删除失败");
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("删除失败:", error);
|
|
|
|
|
this.$message.error("删除失败,请稍后重试");
|
|
|
|
|
}
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "删除成功!",
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
@ -140,26 +204,26 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// async getMonthInformationPage() {
|
|
|
|
|
// try {
|
|
|
|
|
// const response = await getMonthInformationPage({ xmId: this.xmId });
|
|
|
|
|
|
|
|
|
|
// if (Array.isArray(response.data.records) && response.data.records.length > 0) {
|
|
|
|
|
// this.tableData = response.data.records;
|
|
|
|
|
// this.total = response.data.total || 0;
|
|
|
|
|
// } else {
|
|
|
|
|
// // 空数组保留为空数组
|
|
|
|
|
// this.tableData = [];
|
|
|
|
|
// this.total = 0;
|
|
|
|
|
// }
|
|
|
|
|
// } catch (error) {
|
|
|
|
|
// console.error("获取月度进展信息失败:", error);
|
|
|
|
|
// this.$message.error("获取月度进展信息失败");
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
async getMonthInformationPage() {
|
|
|
|
|
try {
|
|
|
|
|
const response = await getMonthInformationPage({ xmId: this.xmId });
|
|
|
|
|
|
|
|
|
|
if (Array.isArray(response.data.records) && response.data.records.length > 0) {
|
|
|
|
|
this.tableData = response.data.records;
|
|
|
|
|
this.total = response.data.total || 0;
|
|
|
|
|
} else {
|
|
|
|
|
// 空数组保留为空数组
|
|
|
|
|
this.tableData = [];
|
|
|
|
|
this.total = 0;
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("获取月度进展信息失败:", error);
|
|
|
|
|
this.$message.error("获取月度进展信息失败");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// this.getMonthInformationPage();
|
|
|
|
|
this.getMonthInformationPage();
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
@ -174,6 +238,7 @@ export default {
|
|
|
|
|
border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
padding: 1rem;
|
|
|
|
|
display: flex;
|
|
|
|
@ -189,6 +254,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
.topleft {
|
|
|
|
|
width: 8rem;
|
|
|
|
|
height: 2rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 0.4rem;
|
|
|
|
|
align-items: center;
|
|
|
|
@ -200,16 +266,16 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.topleft span {
|
|
|
|
|
width: auto;
|
|
|
|
|
height: 1rem;
|
|
|
|
|
font-family: aliregular;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
color: #3D424C;
|
|
|
|
|
line-height: 1rem;
|
|
|
|
|
text-align: right;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
text-transform: none;
|
|
|
|
|
width: auto;
|
|
|
|
|
height: 1rem;
|
|
|
|
|
font-family: aliregular;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
color: #3D424C;
|
|
|
|
|
line-height: 1rem;
|
|
|
|
|
text-align: right;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
text-transform: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.picturediv {
|
|
|
|
|