2022-12-14 18:31:34 +08:00

578 lines
19 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<!-- 施工日志列表 -->
<div class="diaryList" v-if="type == 1">
<div class="whiteBlock title">
<el-form
:inline="true"
size="medium"
:model="formInline"
class="demo-form-inline"
>
<!-- 日志名称 -->
<el-form-item :label="$t('message.buildersDiary.logName')">
<el-input
v-model="formInline.buildName"
:placeholder="$t('message.buildersDiary.placeholderText')"
></el-input>
</el-form-item>
<!-- 创建时间 -->
<el-form-item :label="$t('message.buildersDiary.createTime')">
<el-date-picker
@change="changeTime"
v-model="startTime"
type="daterange"
value-format="yyyy-MM-dd"
:range-separator="$t('message.buildersDiary.to')"
:start-placeholder="$t('message.buildersDiary.startTime')"
:end-placeholder="$t('message.buildersDiary.endTime')"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<!-- 查询 -->
<el-button type="primary" @click="onSubmit" plain>{{$t('message.buildersDiary.search')}}</el-button>
<!-- 刷新 -->
<el-button type="warning" @click="refreshBtn" plain>{{$t('message.buildersDiary.refresh')}}</el-button>
</el-form-item>
</el-form>
</div>
<div class="content whiteBlock">
<vue-scroll style="height: 100%">
<el-table class="tables" :data="tableList">
<el-table-column
width="200"
prop="id"
align="center"
:label="$t('message.safeManage.safeRocordList.number')"
></el-table-column>
<!-- 单位工程名称 -->
<el-table-column prop="buildName" :label="$t('message.buildersDiary.unitProjectName')" align="center">
<template slot-scope="scope">
<el-tooltip
class="item"
effect="dark"
:content="scope.row.buildName"
placement="top"
>
<div class="ellipsis">{{ scope.row.buildName }}</div>
</el-tooltip>
</template>
</el-table-column>
<!-- 施工部门 -->
<el-table-column
prop="buildProjectDept"
:label="$t('message.buildersDiary.constructionDepartment')"
align="center"
>
<template slot-scope="scope">
<el-tooltip
class="item"
effect="dark"
:content="scope.row.buildProjectDept"
placement="top"
>
<div class="ellipsis">{{ scope.row.buildProjectDept }}</div>
</el-tooltip>
</template>
</el-table-column>
<!-- 创建时间 -->
<el-table-column
prop="buildTime"
:label="$t('message.buildersDiary.createTime')"
align="center"
></el-table-column>
<!-- 施工部位 -->
<el-table-column
prop="buildPlace"
width="200"
:label="$t('message.buildersDiary.constructionPart')"
align="center"
>
<template slot-scope="scope">
<el-tooltip
class="item"
effect="dark"
:content="scope.row.buildPlace"
placement="top"
>
<div class="ellipsis">{{ scope.row.buildPlace }}</div>
</el-tooltip>
</template>
</el-table-column>
<!-- 施工班组 -->
<el-table-column prop="taskTeam" :label="$t('message.buildersDiary.constructionGroup')" align="center">
</el-table-column>
<el-table-column
:label="$t('message.safeManage.safeRocordList.operation')"
align="center"
width="380"
>
<template slot-scope="scope">
<div class="tableBtns">
<div @click="detailsBtn(scope.row)" class="operationText">
<i
class="el-icon-tickets"
style="color: #8dacfa; font-size: 16px; margin-right: 2px"
></i>
<!-- 详情 -->
<span>{{$t('message.buildersDiary.details')}}</span>
</div>
<div @click="editBtn(scope.row)" class="operationText">
<i
class="el-icon-edit"
style="color: #8dacfa; font-size: 16px; margin-right: 2px"
></i>
<!-- 编辑 -->
<span>{{$t('message.buildersDiary.edit')}}</span>
</div>
<div @click="deleteBtn(scope.row)" class="operationText">
<i
class="el-icon-delete"
style="color: #eb5760; font-size: 16px; margin-right: 2px"
></i>
<!-- 删除 -->
<span>{{$t('message.buildersDiary.remove')}}</span>
</div>
<div @click="downloadBtn(scope.row)" class="operationText">
<i
class="el-icon-download"
style="color: #8dacfa; font-size: 16px; margin-right: 2px"
></i>
<!-- 下载打印 -->
<span>{{$t('message.buildersDiary.downLoadPrint')}}</span>
</div>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
class="pagerBox"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="$store.state.PAGESIZRS"
:page-size="pageSize"
layout="total, sizes, prev, pager, next"
:total="Number(total)"
></el-pagination>
</vue-scroll>
</div>
<!-- 施工日志详情 -->
<el-dialog
:modal-append-to-body="false"
class="projectDialog"
:title="$t('message.buildersDiary.constructionLogDetail')"
:visible.sync="downloadDialog"
width="60%"
:close-on-click-modal="false"
>
<div class="dialog_content" style="padding: 0 100px">
<div class="table_wrap" ref="downloadContent">
<table>
<tr>
<th colspan="10" style="text-align: center">
<!-- 单位工程施工日志 -->
<h3>{{$t('message.buildersDiary.unitConstructionLog')}}</h3>
</th>
</tr>
<tr>
<!-- 单位工程名称 -->
<td colspan="2" class="setTd site">{{$t('message.buildersDiary.unitProjectName')}}</td>
<td colspan="3" class="setTd">{{ downloadData.buildName }}</td>
<!-- 施工项目部门 -->
<td colspan="2" class="setTd site">{{$t('message.buildersDiary.constructionProjectDepartment')}}</td>
<td colspan="3" class="setTd">
{{ downloadData.buildProjectDept }}
</td>
</tr>
<tr>
<!-- 项目负责人 -->
<td colspan="2" class="setTd site">{{$t('message.buildersDiary.projectDutyPeople')}}</td>
<td colspan="3" class="setTd">
{{ downloadData.projectDirector }}
</td>
<!-- 单位工程施工员 -->
<td colspan="2" class="setTd site">{{$t('message.buildersDiary.unitConstructionPeople')}}</td>
<td colspan="3" class="setTd">
{{ downloadData.constructionCrew }}
</td>
</tr>
<tr>
<td colspan="2" class="site2">{{ downloadData.buildTime }}</td>
<td colspan="2" class="site2">{{ downloadData.buildWeek }}</td>
<td colspan="1" class="site2">
<!-- 上午天气 -->
{{$t('message.buildersDiary.AMWeather')}} {{ downloadData.morningWeather }}
</td>
<td colspan="2" class="site2">
<!-- 下午天气 -->
{{$t('message.buildersDiary.PMWeather')}} {{ downloadData.afternoonWeather }}
</td>
<td colspan="3" class="site2">
<!-- 气温 -->
{{$t('message.buildersDiary.temperature')}} {{ downloadData.temperature }}
</td>
</tr>
<tr>
<!-- 分项工程施工部位 -->
<td colspan="2" class="site2">{{$t('message.buildersDiary.subdivisionalWork')}}</td>
<!-- 作业班组类型 -->
<td colspan="2" class="site2">{{$t('message.buildersDiary.workGroupType')}}</td>
<!-- 作业单位班组名称 -->
<td colspan="1" class="site2">{{$t('message.buildersDiary.workUnitGroupName')}}</td>
<!-- 作业人数 -->
<td colspan="2" class="site2">{{$t('message.buildersDiary.workPeopleNum')}}</td>
<!-- 作业情况 -->
<td colspan="3" class="site2">{{$t('message.buildersDiary.workStatus')}}</td>
</tr>
<tr>
<td rowspan="2" colspan="1" class="site2" style="width: 10px">
<!-- 当日施工作业面情况 -->
{{$t('message.buildersDiary.toDayConstructionStatus')}}
</td>
<td rowspan="2" colspan="1" class="site2">
{{ downloadData.buildPlace }}
</td>
<td rowspan="2" colspan="2" class="site2">
{{ downloadData.taskTeamType }}
</td>
<td rowspan="2" colspan="1" class="site2">
{{ downloadData.taskTeam }}
</td>
<!-- 上午 -->
<td colspan="1" class="site2">{{$t('message.buildersDiary.AM')}}</td>
<!-- 下午 -->
<td colspan="1" class="site2">{{$t('message.buildersDiary.PM')}}</td>
<td rowspan="2" colspan="3" class="site2">
{{ downloadData.taskCondition }}
</td>
</tr>
<tr>
<td class="site2">{{ downloadData.morningPersonNum }}</td>
<td class="site2">{{ downloadData.afternoonPersonNum }}</td>
</tr>
<tr>
<th colspan="10">
<!-- 现场分部分项施工进度情况(交底情况劳动力配置情况机械运行情况进度计划情况质量特殊过程关键部位施工旁站情况) -->
1{{$t('message.buildersDiary.formLabel')}}:
</th>
</tr>
<tr>
<td colspan="10">{{ downloadData.buildProgress }}</td>
</tr>
<tr>
<th colspan="10">
<!-- 作业面安全文明施工情况(工完场清材料堆码) 安全自检情况 -->
2{{$t('message.buildersDiary.formLabel2')}}:
</th>
</tr>
<tr>
<td colspan="10">{{ downloadData.safeBuildCondition }}</td>
</tr>
<tr>
<th colspan="10">
<!-- 材料进场情况(规格数量使用部位验收情况堆放位置) -->
3{{$t('message.buildersDiary.formLabel3')}}:
</th>
</tr>
<tr>
<td colspan="10">{{ downloadData.materialEnter }}</td>
</tr>
<tr>
<!-- 设计变更洽商指令单,技术交底情况 -->
<th colspan="10">4{{$t('message.buildersDiary.formLabel4')}}:</th>
</tr>
<tr>
<td colspan="10">{{ downloadData.technicalInterpretation }}</td>
</tr>
<tr>
<th colspan="10">
<!-- 现场验收情况(部位时间参与人验收情况及结果)工程资料填写交接归档情况 -->
5{{$t('message.buildersDiary.formLabel5')}}:
</th>
</tr>
<tr>
<td colspan="10">{{ downloadData.sceneInspected }}</td>
</tr>
<tr>
<th colspan="10">
<!-- 上级单位外部单位人员到项目检查指导情况(对工程提出的决定建议,要求解决处理的问题) -->
6{{$t('message.buildersDiary.formLabel6')}}:
</th>
</tr>
<tr>
<td colspan="10">{{ downloadData.inspectGuidance }}</td>
</tr>
<tr>
<!-- 现场协调情况工作面移交情况 -->
<th colspan="10">7{{$t('message.buildersDiary.formLabel7')}}:</th>
</tr>
<tr>
<td colspan="10">{{ downloadData.sceneCoordinate }}</td>
</tr>
<tr>
<th colspan="10">
<!-- 其它特殊情况记录(停电,停窝工等,原材料,劳务力等其它影响施工情况) -->
8{{$t('message.buildersDiary.formLabel8')}}:
</th>
</tr>
<tr>
<td colspan="10">{{ downloadData.otherSpecial }}</td>
</tr>
<tr>
<!-- 附件 -->
<th colspan="10">{{$t('message.buildersDiary.formLabel9')}}</th>
</tr>
<tr>
<td colspan="10">
<span
v-for="(item, index) in downloadData.fileList"
:key="index"
>{{ item.name }}</span
>
</td>
</tr>
</table>
</div>
<div class="dialog-footer" style="text-align: center">
<!-- 下载打印 -->
<el-button
type="primary"
icon="el-icon-download"
size="medium"
@click="confirmDownload('editProjectForm')"
>{{$t('message.buildersDiary.downLoadPrint')}}</el-button
>
</div>
</div>
</el-dialog>
</div>
<diaryMod
v-else
@setType="setType"
:status="operationStatus"
:data="detailsData"
></diaryMod>
</template>
<script>
import diaryMod from "./diaryMod";
import {
getListDataApi,
deleteBuildersDiaryApi,
} from "@/assets/js/api/buildersDiary.js";
import html2canvas from "html2canvas";
export default {
components: {
diaryMod,
},
data() {
return {
type: 1,
operationStatus: "", //操作状态
projectSn: "",
startTime: [],
formInline: {
endTime: "",
startTime: "",
buildName: "",
},
detailsData: {}, //详情
downloadData: {}, //下载数据
tableList: [],
pageNo: 1,
pageSize: 3,
total: 0,
downloadDialog: false, //下载打印弹窗
};
},
created() {
this.projectSn = this.$store.state.projectSn;
this.getListData();
},
methods: {
//关闭详情页面
setType(val) {
this.type = val;
this.getListData();
},
//获取列表数据
getListData() {
let data = this.formInline;
data.pageNo = this.pageNo;
data.pageSize = this.pageSize;
data.projectSn = this.projectSn;
getListDataApi(data).then((res) => {
if (res.code == 200) {
this.tableList = res.result.records;
this.total = res.result.total;
} else {
this.$message.error(res.message);
}
});
},
//切换时间
changeTime(val) {
if (val && val.length > 0) {
this.formInline.startTime = val[0];
this.formInline.endTime = val[1];
} else {
this.formInline.startTime = "";
this.formInline.endTime = "";
}
},
//查询按钮
onSubmit() {
this.pageNo = 1;
this.getListData();
},
//刷新按钮
refreshBtn() {
this.pageNo = 1;
this.pageSize = 10;
this.formInline = {
endTime: "",
startTime: "",
buildName: "",
};
this.startTime = [];
this.getListData();
},
//详情按钮
detailsBtn(val) {
this.type = 2; //显示详情页
this.operationStatus = "detail";
this.detailsData = val;
},
//编辑按钮
editBtn(val) {
this.type = 2; //显示编辑页
this.operationStatus = "edit";
this.detailsData = val;
},
//删除按钮
deleteBtn(val) {
// "确定删除", "提示"
this.$confirm(this.$t('message.buildersDiary.hintText'),this.$t('message.buildersDiary.hint'), {
confirmButtonText: this.$t('message.buildersDiary.confirm'),
cancelButtonText: this.$t('message.buildersDiary.cancel'),
type: "warning",
})
.then(() => {
let data = {
id: val.id,
};
deleteBuildersDiaryApi(data).then((res) => {
if (res.code == 200) {
// "删除成功!"
this.$message({
type: "success",
message: this.$t('message.buildersDiary.removeSuccess'),
});
if(this.tableList.length==0 && this.pageNo>1){
this.pageNo = this.pageNo-1;
}
this.getListData();
} else {
this.$message.error(res.message);
}
});
})
.catch(() => {
// "已取消删除"
this.$message({
type: "info",
message: this.$t('message.buildersDiary.cancelRemove'),
});
});
},
//下载打印按钮
downloadBtn(val) {
console.log(val);
this.downloadDialog = true;
this.downloadData = JSON.parse(JSON.stringify(val));
this.downloadData.fileList = val.imgUrl ? JSON.parse(val.imgUrl) : [];
},
//确定下载
confirmDownload() {
html2canvas(this.$refs.downloadContent).then((canvas) => {
let saveUrl = canvas.toDataURL("image/png");
let a = document.createElement("a");
document.body.appendChild(a);
a.href = saveUrl;
// "施工日志"
a.download = this.$t('message.buildersDiary.constructionLog');
a.click();
this.downloadDialog = false;
});
},
handleSizeChange(val) {
this.pageSize = val;
this.getListData();
},
handleCurrentChange(val) {
this.pageNo = val;
this.getListData();
},
},
};
</script>
<style lang="less" scoped>
.diaryList {
width: 100%;
height: 100%;
}
.title {
padding: 20px 15px 0;
width: 100%;
}
.content {
margin-top: 15px;
height: calc(100% - 93px);
}
.table_wrap {
width: 100%;
height: 100%;
padding: 15px 20px;
}
table {
border-collapse: collapse;
}
table,
td,
th {
border: 1px solid #dde5f9;
text-align: left;
// height: 35px;
// line-height: 35px;
padding: 10px 15px;
}
.setTd {
width: 25%;
}
.site {
text-align: right;
}
.site2 {
text-align: center;
}
.ellipsis {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>