1091 lines
38 KiB
Vue
1091 lines
38 KiB
Vue
<template>
|
||
<div class="dangerousBigProject">
|
||
<div v-if="dialogFormVisible">
|
||
<div class="search-box">
|
||
<el-input
|
||
:placeholder="$t('message.dangerousBigProject.searchNamePlaceholder')"
|
||
class="search-input"
|
||
v-model="engineeringName"
|
||
size="small"
|
||
>
|
||
<!-- 请输入危大工程名称进行搜索 -->
|
||
<el-button
|
||
slot="append"
|
||
@click="initData()"
|
||
icon="el-icon-search"
|
||
></el-button>
|
||
</el-input>
|
||
<el-button v-permission="{key: 'wdgc_add', menuPath: '/project/dangerousBigProject/parameter'}" type="primary" @click="showAddDialog()" size="small">
|
||
<!-- 新增 -->
|
||
{{ $t('message.dangerousBigProject.add') }}
|
||
</el-button>
|
||
<!-- <el-button type="danger" size="small">批量删除</el-button> -->
|
||
</div>
|
||
<div class="table-box">
|
||
<el-table
|
||
class="tables"
|
||
:data="tableData"
|
||
size="small"
|
||
@cell-click="previewDetail"
|
||
@selection-change="handleSelectionChange"
|
||
:header-cell-style="{'text-align':'center'}"
|
||
>
|
||
<!-- <el-table-column type="selection" align="center" width="60px"></el-table-column> -->
|
||
<el-table-column label="序号" type="index" align="center" width="60"></el-table-column>
|
||
|
||
<el-table-column align="center" width="200"
|
||
:label="$t('message.dangerousBigProject.category')"
|
||
show-overflow-tooltip
|
||
>
|
||
<!-- 类别 -->
|
||
<template slot-scope="scope">
|
||
<div
|
||
class="table-category-item"
|
||
@click="viewData(scope.$index, tableData)"
|
||
style="display:flex;justify-content:center;"
|
||
>
|
||
<div style="display:flex;text-overflow: ellipsis;overflow: hidden; ">
|
||
<div class="item-status" v-if="scope.row.issuperdanger">
|
||
<img src="@/assets/images/yu.png" alt="">
|
||
<span>超危</span>
|
||
</div>
|
||
<p class="item-title">{{ scope.row.engineeringTypeName }}</p>
|
||
</div>
|
||
<!-- <p>{{ scope.row.describeName }}</p> -->
|
||
<!-- <span class="item-status" v-if="scope.row.dangerType == 2">
|
||
超危
|
||
{{ $t('message.dangerousBigProject.superDanger') }}
|
||
</span> -->
|
||
<!-- <span class="status-none" v-else></span> -->
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<!-- 危大工程 -->
|
||
<el-table-column align="center"
|
||
:label="$t('message.dangerousBigProject.dangerProject')"
|
||
>
|
||
<template slot-scope="scope">
|
||
<div class="" style="display: flex;justify-content:center;font-weight:bold">
|
||
<div style="display: flex;justify-content:center">
|
||
<el-tag type="danger" effect="dark" size="mini" v-if="scope.row.isoverdue === '1'" >超期</el-tag>
|
||
<!-- <el-tag type="danger" effect="dark" size="mini">超期</el-tag> -->
|
||
<p class="item-title" style="margin-left:5px">{{ scope.row.engineeringName }}</p>
|
||
</div>
|
||
<!-- <p>{{scope.row.people}}识别于:{{ scope.row.date }}</p> -->
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<!-- 施工部位 -->
|
||
<el-table-column align="center"
|
||
prop="constructionLocation"
|
||
:label="$t('message.dangerousBigProject.buildPart')"
|
||
></el-table-column>
|
||
<!-- 施工时间 -->
|
||
<!-- <el-table-column align="center"
|
||
:label="$t('message.dangerousBigProject.buildTime')"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<div class="table-item">
|
||
<p v-if="scope.row.buildStartTime">
|
||
{{ scope.row.buildStartTime
|
||
}}{{ $t('message.dangerousBigProject.to')
|
||
}}{{ scope.row.buildEndTime }}
|
||
</p>
|
||
</div>
|
||
</template>
|
||
</el-table-column> -->
|
||
<!-- 计划时间 -->
|
||
<el-table-column align="center"
|
||
:label="$t('message.dangerousBigProject.planTime')"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<div class="table-item">
|
||
<!-- 至 -->
|
||
<p v-if="scope.row.planStartTime">
|
||
{{ scope.row.planStartTime
|
||
}}{{ $t('message.dangerousBigProject.to')
|
||
}}{{ scope.row.planEndTime }}
|
||
</p>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<!-- 责任人 -->
|
||
<el-table-column align="center"
|
||
prop="personLiable"
|
||
:label="$t('message.dangerousBigProject.dutyPeople')"
|
||
></el-table-column>
|
||
<!-- 分包单位 -->
|
||
<el-table-column align="center"
|
||
prop="responsibilityCompany"
|
||
:label="$t('message.dangerousBigProject.subpackageUnit')"
|
||
></el-table-column>
|
||
<!-- 施工进度 -->
|
||
<el-table-column
|
||
:label="$t('message.dangerousBigProject.buildSchedule')"
|
||
align="center"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<div class="table-item">
|
||
<p v-if="scope.row.progressrecord" style="text-align: left">
|
||
{{ scope.row.progressrecord.progressDescribe }}
|
||
</p>
|
||
<!-- 记录于 -->
|
||
<p v-if="scope.row.progressrecord" style="text-align: left">
|
||
{{ scope.row.progressrecord.createUserName
|
||
}}{{ $t('message.dangerousBigProject.record')
|
||
}}{{ scope.row.progressrecord.createTime }}
|
||
</p>
|
||
<p v-if="scope.row.progressrecord" style="text-align: left">
|
||
<i class="el-icon-picture"></i> {{
|
||
scope.row.progressrecord.imageUrl.split(',').length
|
||
}}
|
||
</p>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<!-- 安全状态 -->
|
||
<el-table-column
|
||
:label="$t('message.dangerousBigProject.safeStatus')"
|
||
align="center"
|
||
>
|
||
<template slot-scope="scope">
|
||
<div class="table-item">
|
||
<p
|
||
:style="{
|
||
color: scope.row.hiddenDangerNum > 0 ? '#F56C6C' : '',
|
||
}"
|
||
>
|
||
{{
|
||
scope.row.hiddenDangerNum
|
||
? scope.row.hiddenDangerNum +
|
||
$t('message.dangerousBigProject.item')
|
||
: $t('message.dangerousBigProject.nothing')
|
||
}}{{ $t('message.dangerousBigProject.noRemoveDanger') }}
|
||
</p>
|
||
<!-- 条:无 未消隐患-->
|
||
<p v-if="scope.row.controlItemCount">
|
||
<!-- 管控要点 -->
|
||
{{ $t('message.dangerousBigProject.controlGist') }}:{{
|
||
scope.row.controlItemCount.yes_num
|
||
}}/{{ scope.row.controlItemCount.total_item_num }}
|
||
</p>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<!-- 状态 -->
|
||
<el-table-column
|
||
:label="$t('message.dangerousBigProject.finalAcceptanceStatus')"
|
||
align="center"
|
||
>
|
||
<template slot-scope="scope">
|
||
<span v-if="scope.row.finalAcceptanceStatus === 1" style="color:#DAA520;font-weight:bold;">进行中</span>
|
||
<span v-if="scope.row.finalAcceptanceStatus === 2" style="color:#008000;font-weight:bold;">已闭合</span>
|
||
</template>
|
||
</el-table-column>
|
||
<!-- 操作 -->
|
||
<el-table-column align="center"
|
||
:label="$t('message.dangerousBigProject.operation')"
|
||
width="120"
|
||
>
|
||
<template slot-scope="scope">
|
||
<!-- <el-button
|
||
@click.native.prevent="viewData(scope.$index, tableData)"
|
||
type="text"
|
||
size="small">
|
||
查看
|
||
</el-button> -->
|
||
<!-- <el-button
|
||
@click.native.prevent="editData(scope.$index, tableData)"
|
||
type="text"
|
||
size="small">
|
||
编辑
|
||
</el-button> -->
|
||
<el-button
|
||
v-permission="{key: 'wdgc_edit', menuPath: '/project/dangerousBigProject/parameter'}"
|
||
@click.stop="editRow(scope.$index, tableData)"
|
||
type="text"
|
||
size="small"
|
||
>
|
||
<i class="el-icon-edit"></i>
|
||
</el-button>
|
||
<el-button
|
||
v-permission="{key: 'wdgc_delete', menuPath: '/project/dangerousBigProject/parameter'}"
|
||
@click.stop="deleteRow(scope.$index, tableData)"
|
||
type="text"
|
||
size="small"
|
||
>
|
||
<i class="el-icon-delete"></i>
|
||
</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<el-pagination
|
||
style="margin-right: 800px;"
|
||
class="pagerBox"
|
||
background
|
||
@size-change="handleSizeChange"
|
||
@current-change="handleCurrentChange"
|
||
:current-page.sync="pageNo"
|
||
layout="sizes, prev, pager, next"
|
||
:page-sizes="[10, 20, 30, 40]"
|
||
:page-size="pageSize"
|
||
:total="Number(total)"
|
||
>
|
||
</el-pagination>
|
||
</div>
|
||
|
||
<!-- <el-dialog :modal-append-to-body="false" :title="dialogTitle" :visible.sync="dialogFormVisible" class="add-dialog">
|
||
<div class="form-title">基础信息</div>
|
||
<el-form :model="addForm">
|
||
<el-row :gutter="40">
|
||
<el-col :span="12">
|
||
<el-form-item label="危大工程名称:" required :label-width="formLabelWidth">
|
||
<el-input v-model="addForm.name" :disabled="isEditDisabled" placeholder="请输入危大工程名称" autocomplete="off"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="危大工程类别:" required :label-width="formLabelWidth">
|
||
<el-select v-model="addForm.category" :disabled="isEditDisabled" @change="changeType" placeholder="请选择危大工程类别">
|
||
<el-option v-for="item in typeOptions"
|
||
:key="item.value"
|
||
:label="item.label"
|
||
:value="item.value"
|
||
>
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<el-row :gutter="40">
|
||
<el-col :span="12">
|
||
<el-form-item label="危大工程概况:" :label-width="formLabelWidth">
|
||
<el-input v-model="addForm.points" :disabled="isDisabled" placeholder="请输入危大工程概况" autocomplete="off"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="类别描述:" required :label-width="formLabelWidth">
|
||
<el-select v-model="addForm.describe" :disabled="isEditDisabled" placeholder="请选择类别描述">
|
||
<el-option v-for="item in describeOptions"
|
||
:key="item.value"
|
||
:label="item.label"
|
||
:value="item.value">
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<el-row :gutter="40">
|
||
<el-col :span="12">
|
||
<el-form-item label="施工部位:" :label-width="formLabelWidth">
|
||
<el-input v-model="addForm.address" :disabled="isDisabled" placeholder="请输入施工部位" autocomplete="off"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="施工计划:" :label-width="formLabelWidth">
|
||
<el-date-picker
|
||
:disabled="isDisabled"
|
||
v-model="addForm.date"
|
||
type="daterange"
|
||
range-separator="至"
|
||
value-format="yyyy-MM-dd"
|
||
start-placeholder="开始日期"
|
||
end-placeholder="结束日期">
|
||
</el-date-picker>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<el-row :gutter="40">
|
||
<el-col :span="12">
|
||
<el-form-item label="责任人:" :label-width="formLabelWidth">
|
||
<el-input v-model="addForm.people" :disabled="isDisabled" placeholder="请输入责任人" autocomplete="off"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="责任分包单位:" :label-width="formLabelWidth">
|
||
<el-cascader
|
||
:disabled="isDisabled"
|
||
v-model="addForm.unit"
|
||
placeholder="请选择责任分包单位"
|
||
:options="options"
|
||
:props="props"
|
||
clearable>
|
||
</el-cascader>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
</el-form>
|
||
<div class="form-title">危大工程资料</div>
|
||
<div class="upload-box">
|
||
<div class="upload-file">
|
||
<div class="upload-item">
|
||
<span>安全技术交底:</span>
|
||
<el-switch v-model="safeStatus" :disabled="isDisabled" >
|
||
</el-switch>
|
||
<span v-if="safeStatus" class="switch-check">已完成</span>
|
||
<span v-else class="switch-uncheck">未完成</span>
|
||
</div>
|
||
<div v-if="dialogTitle == '查看' && file1">{{fileName1}}<a :href="file1">下载</a></div>
|
||
<el-upload
|
||
class="uploadBox"
|
||
:action='$store.state.UPLOADURL'
|
||
:on-preview="handlePreview"
|
||
:on-remove="handleRemove"
|
||
:before-remove="beforeRemove"
|
||
:on-success="uploadSuccess"
|
||
:on-error="uploadError"
|
||
:limit="1"
|
||
multiple
|
||
name="files"
|
||
accept=".doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf"
|
||
:file-list="fileList">
|
||
<el-button v-if="dialogTitle == '新增' || dialogTitle == '编辑'" size="small" type="primary">点击上传</el-button>
|
||
</el-upload>
|
||
</div>
|
||
<div class="upload-file">
|
||
<div class="upload-item">
|
||
<span>安全专项施工方案及附件:</span>
|
||
<el-switch v-model="safeStatus2" :disabled="isDisabled">
|
||
</el-switch>
|
||
<span v-if="safeStatus2" class="switch-check">已完成</span>
|
||
<span v-else class="switch-uncheck">未完成</span>
|
||
|
||
</div>
|
||
<div v-if="dialogTitle == '查看' && fileName2">{{fileName2}}<a :href="file2">下载</a></div>
|
||
<el-upload
|
||
class="uploadBox"
|
||
:action='$store.state.UPLOADURL'
|
||
:on-preview="handlePreview2"
|
||
:on-remove="handleRemove2"
|
||
:before-remove="beforeRemove2"
|
||
:on-success="uploadSuccess2"
|
||
:on-error="uploadError2"
|
||
:limit="1"
|
||
multiple
|
||
name="files"
|
||
accept=".doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf"
|
||
:file-list="fileList2">
|
||
<el-button v-if="dialogTitle == '新增' || dialogTitle == '编辑'" size="small" type="primary">点击上传</el-button>
|
||
</el-upload>
|
||
</div>
|
||
<div class="upload-file">
|
||
<div class="upload-item">
|
||
<span>专项施工方案交底:</span>
|
||
<el-switch v-model="safeStatus3" :disabled="isDisabled">
|
||
</el-switch>
|
||
<span v-if="safeStatus3" class="switch-check">已完成</span>
|
||
<span v-else class="switch-uncheck">未完成</span>
|
||
</div>
|
||
<div v-if="dialogTitle == '查看' && fileName3">{{fileName3}}<a :href="file3">下载</a></div>
|
||
<el-upload
|
||
class="uploadBox"
|
||
:action='$store.state.UPLOADURL'
|
||
:on-preview="handlePreview3"
|
||
:on-remove="handleRemove3"
|
||
:before-remove="beforeRemove3"
|
||
:on-success="uploadSuccess3"
|
||
:on-error="uploadError3"
|
||
:limit="1"
|
||
multiple
|
||
name="files"
|
||
accept=".doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf"
|
||
:file-list="fileList3">
|
||
<el-button v-if="dialogTitle == '新增' || dialogTitle == '编辑'" size="small" type="primary">点击上传</el-button>
|
||
</el-upload>
|
||
</div>
|
||
</div>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||
<el-button type="primary" @click="addData()">确 定</el-button>
|
||
</div>
|
||
</el-dialog> -->
|
||
<!-- 提示 -->
|
||
<el-dialog
|
||
:modal-append-to-body="false"
|
||
:title="$t('message.dangerousBigProject.hint')"
|
||
:visible.sync="deleteDialog"
|
||
width="30%"
|
||
>
|
||
<span>
|
||
<!-- 是否确定删除该条记录? -->
|
||
{{ $t('message.dangerousBigProject.hintContent') }}
|
||
</span>
|
||
<span slot="footer" class="dialog-footer">
|
||
<el-button @click="deleteDialog = false">
|
||
<!-- 取 消 -->
|
||
{{ $t('message.dangerousBigProject.cancel') }}
|
||
</el-button>
|
||
<el-button type="primary" @click="checkDelete">
|
||
<!-- 确 定 -->
|
||
{{ $t('message.dangerousBigProject.confirm') }}
|
||
</el-button>
|
||
</span>
|
||
</el-dialog>
|
||
</div>
|
||
<div style="height: 100%" v-else>
|
||
<el-page-header
|
||
@back="goBack"
|
||
:content="dialogTitle"
|
||
class="backText"
|
||
:class="{ dark: styleType == 2 }"
|
||
></el-page-header>
|
||
<addPlan @cancleSave="goBack" v-if="isAdd"></addPlan>
|
||
<detail :id="detailId" :isSuperDanger="isSuperDanger" @cancleSave="goBack" v-if="isEdit"></detail>
|
||
<editPlan :title="operateTitle" :editId="editId" @cancleSave="goBack" v-if="isUpdate"></editPlan>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import moment from 'moment'
|
||
import addPlan from './addPlan.vue'
|
||
import detail from './detail.vue'
|
||
import editPlan from './editPlan.vue'
|
||
import {
|
||
selectDangerousEngineeringRecordApi,
|
||
addDangerousEngineeringRecordApi,
|
||
deleteDangerousEngineeringRecordApi,
|
||
selectDangerousEngineeringTypeApi,
|
||
editDangerousEngineeringRecordApi
|
||
} from "@/assets/js/api/dangerousBigProject"
|
||
import { getCooperatorListApi } from "@/assets/js/api/cooperationUnit";
|
||
export default {
|
||
components: {
|
||
addPlan,
|
||
detail,
|
||
editPlan
|
||
},
|
||
data() {
|
||
return {
|
||
operateTitle: "新增",
|
||
isAdd: false,
|
||
isEdit: false,
|
||
isDisabled: false,
|
||
engineeringName: "",
|
||
detailId: "",
|
||
isSuperDanger: false,
|
||
tableData: [],
|
||
dialogFormVisible: true,
|
||
multipleSelection: [],
|
||
addForm: {
|
||
name: "",
|
||
category: "",
|
||
points: "",
|
||
describe: "",
|
||
address: "",
|
||
date: [],
|
||
people: "",
|
||
unit: []
|
||
},
|
||
props: {
|
||
multiple: true
|
||
},
|
||
typeOptions: [],
|
||
describeOptions: [],
|
||
options: [{
|
||
label: 111,
|
||
value: 12
|
||
}],
|
||
formLabelWidth: "110px",
|
||
safeStatus: false,
|
||
safeStatus2: false,
|
||
safeStatus3: false,
|
||
fileList: [],
|
||
fileList2: [],
|
||
fileList3: [],
|
||
dialogTitle: "",
|
||
pageNo: 1,
|
||
pageSize: 10,
|
||
total: 10,
|
||
projectSn: "",
|
||
enterpriseTypeId: 1,
|
||
cooperatorList: [],
|
||
file3: "",
|
||
file2: "",
|
||
file1: "",
|
||
deleteId: "",
|
||
editId: "",
|
||
deleteDialog: false,
|
||
isEditDisabled: false,
|
||
editParms: [],
|
||
fileName1: "",
|
||
fileName2: "",
|
||
fileName3: "",
|
||
styleType: 1,
|
||
isUpdate: false
|
||
}
|
||
},
|
||
mounted() {
|
||
this.projectSn = this.$store.state.projectSn
|
||
this.styleType = this.$store.state.userInfo.styleType;
|
||
// this.getCooperatorList()
|
||
// this.getType()
|
||
this.initData();
|
||
},
|
||
methods: {
|
||
editRow(index, rows) {
|
||
if(rows[index].finalAcceptanceStatus === 2){
|
||
this.$message.warning('该项危大工程已闭合,请勿操作')
|
||
return
|
||
}
|
||
// console.log(index,rows[index].id)
|
||
this.editId = rows[index].id
|
||
this.operateTitle = "编辑"
|
||
this.dialogTitle = "编辑"
|
||
this.dialogFormVisible = false
|
||
this.isEdit = false
|
||
this.isAdd = false
|
||
this.isUpdate = true;
|
||
},
|
||
goBack() {
|
||
this.dialogFormVisible = true
|
||
this.initData()
|
||
this.isAdd = false
|
||
this.isEdit = false
|
||
this.isUpdate = false;
|
||
},
|
||
showAddDialog() {
|
||
this.dialogFormVisible = false
|
||
this.isEdit = false
|
||
this.isUpdate = false;
|
||
this.isAdd = true
|
||
// "新增"
|
||
this.dialogTitle = this.$t('message.dangerousBigProject.add')
|
||
// this.clearData()
|
||
// if(this.isDisabled){
|
||
// this.isDisabled = false
|
||
// }
|
||
// if(this.isEditDisabled){
|
||
// this.isEditDisabled = false
|
||
// }
|
||
},
|
||
initData() {
|
||
let data = {
|
||
engineeringName: this.engineeringName,
|
||
pageNo: this.pageNo,
|
||
pageSize: this.pageSize,
|
||
projectSn: this.projectSn
|
||
}
|
||
selectDangerousEngineeringRecordApi(data).then((res) => {
|
||
if (res.result) {
|
||
console.log(res.result.records, 1)
|
||
res.result.records.forEach((item) => {
|
||
if (item.planStartTime && item.planEndTime) {
|
||
item.plan = item.planStartTime + "至" + item.planEndTime
|
||
}
|
||
if (item.responsibilityCompany.split(",").length > 0 && item.responsibilityCompany !== "") {
|
||
let arr = []
|
||
for (let i = 0; i < this.options.length; i++) {
|
||
let itm = this.options[i].value
|
||
for (let j = 0; j < item.responsibilityCompany.split(",").length; j++) {
|
||
if (itm == item.responsibilityCompany.split(",")[j]) {
|
||
arr.push(this.options[i].label)
|
||
}
|
||
}
|
||
}
|
||
item.subpackageUnit = arr.join(",")
|
||
}
|
||
})
|
||
// console.log(this.options)
|
||
this.tableData = res.result.records
|
||
this.total = res.result.total
|
||
}
|
||
});
|
||
},
|
||
editData(index, val) {
|
||
this.viewData(index, val)
|
||
// "编辑"
|
||
this.dialogTitle = this.$t('message.dangerousBigProject.edit')
|
||
this.editParms = val[index]
|
||
if (this.file1) {
|
||
let obj = {
|
||
name: this.file1.split("/")[this.file1.split("/").length - 1],
|
||
url: this.file1
|
||
}
|
||
this.fileList.push(obj)
|
||
}
|
||
if (this.file2) {
|
||
let obj2 = {
|
||
name: this.file2.split("/")[this.file2.split("/").length - 1],
|
||
url: this.file2
|
||
}
|
||
this.fileList2.push(obj2)
|
||
}
|
||
if (this.file3) {
|
||
let obj3 = {
|
||
name: this.file3.split("/")[this.file3.split("/").length - 1],
|
||
url: this.file3
|
||
}
|
||
this.fileList3.push(obj3)
|
||
}
|
||
this.isDisabled = false
|
||
this.isEditDisabled = true
|
||
// console.log(this.editId)
|
||
},
|
||
viewData(index, val) {
|
||
this.clearData()
|
||
this.dialogFormVisible = true
|
||
// "查看"
|
||
this.dialogTitle = this.$t('message.dangerousBigProject.view')
|
||
this.isDisabled = true
|
||
this.isEditDisabled = true
|
||
this.addForm = {
|
||
name: val[index].engineeringName,
|
||
category: val[index].engineeringTypeId,
|
||
points: val[index].engineeringSurvey,
|
||
describe: val[index].describeName,
|
||
address: val[index].constructionLocation,
|
||
date: [val[index].planStartTime, val[index].planEndTime],
|
||
people: val[index].personLiable,
|
||
unit: val[index].responsibilityCompany
|
||
}
|
||
this.safeStatus = val[index].securityConstructionSchemeType == 2 ? true : false
|
||
this.safeStatus2 = val[index].specialConstructionSchemeType == 2 ? true : false
|
||
this.safeStatus3 = val[index].technicalDisclosureType == 2 ? true : false
|
||
this.file1 = val[index].securityConstructionSchemeFile
|
||
this.file2 = val[index].specialConstructionSchemeFile
|
||
this.file3 = val[index].technicalDisclosureFile
|
||
this.fileName1 = this.file1 ? this.file1.split("/")[this.file1.split("/").length - 1] : ""
|
||
this.fileName2 = this.file2 ? this.file2.split("/")[this.file2.split("/").length - 1] : ""
|
||
this.fileName3 = this.file3 ? this.file3.split("/")[this.file3.split("/").length - 1] : ""
|
||
},
|
||
clearData() {
|
||
this.addForm = {
|
||
name: "",
|
||
category: "",
|
||
points: "",
|
||
describe: "",
|
||
address: "",
|
||
date: [],
|
||
people: "",
|
||
unit: ""
|
||
},
|
||
this.safeStatus = false
|
||
this.safeStatus2 = false
|
||
this.safeStatus3 = false
|
||
this.file1 = ""
|
||
this.file2 = ""
|
||
this.file3 = ""
|
||
this.fileList = []
|
||
this.fileList2 = []
|
||
this.fileList3 = []
|
||
},
|
||
// 选择类别
|
||
changeType(value) {
|
||
this.typeOptions.forEach(item => {
|
||
if (item.id == value) {
|
||
item.describeList.forEach(item => {
|
||
item.value = item.id
|
||
if (item.describeName.length > 40) {
|
||
item.label = item.describeName.substring(0, 40) + '...'
|
||
} else {
|
||
item.label = item.describeName
|
||
}
|
||
})
|
||
this.describeOptions = item.describeList
|
||
}
|
||
})
|
||
console.log(value)
|
||
},
|
||
//获取责任分包单位
|
||
getCooperatorList() {
|
||
let data = {
|
||
projectSn: this.projectSn,
|
||
pageNo: this.pageNo,
|
||
pageSize: this.pageSize,
|
||
enterpriseTypeId: this.enterpriseTypeId,
|
||
enterpriseName: "",
|
||
};
|
||
getCooperatorListApi(data).then((res) => {
|
||
if (res.code == 200) {
|
||
|
||
if (res.result.records.length > 0) {
|
||
this.cooperatorList = JSON.parse(JSON.stringify(res.result.records));
|
||
this.cooperatorList.forEach((item) => {
|
||
item.value = item.enterpriseLegalPerson
|
||
item.label = item.enterpriseName
|
||
})
|
||
this.options = this.cooperatorList
|
||
// console.log(this.options)
|
||
}
|
||
}
|
||
});
|
||
},
|
||
// 获取类别
|
||
getType() {
|
||
selectDangerousEngineeringTypeApi({ sn: JSON.parse(window.sessionStorage.getItem("vuex")).userInfo.headquartersSn }).then((res) => {
|
||
if (res.result) {
|
||
// console.log(res.result)
|
||
res.result.forEach(item => {
|
||
item.label = item.typeName
|
||
item.value = item.id
|
||
})
|
||
this.typeOptions = res.result
|
||
}
|
||
})
|
||
},
|
||
addData() {
|
||
if (this.addForm.name == "") {
|
||
// 请输入危大工程名称
|
||
this.$message.error(this.$t('message.dangerousBigProject.verifyMessage1'))
|
||
return
|
||
} else if (this.addForm.category == "") {
|
||
// 请选择危大工程类别
|
||
this.$message.error(this.$t('message.dangerousBigProject.verifyMessage2'))
|
||
return
|
||
} else if (this.addForm.describe == "") {
|
||
// 请选择类别描述
|
||
this.$message.error(this.$t('message.dangerousBigProject.verifyMessage3'))
|
||
return
|
||
}
|
||
// console.log(this.addForm)
|
||
let nowDate = new Date()
|
||
let data = {
|
||
constructionLocation: this.addForm.address,
|
||
createTime: moment(nowDate).format('YYYY-MM-DD HH:mm:ss'),
|
||
engineeringName: this.addForm.name,
|
||
engineeringSurvey: this.addForm.points,
|
||
engineeringTypeId: this.addForm.category,
|
||
personLiable: this.addForm.people,
|
||
planEndTime: this.addForm.date[1],
|
||
planStartTime: this.addForm.date[0],
|
||
projectSn: this.projectSn,
|
||
securityConstructionSchemeFile: this.fileList.length > 0 ? this.file1 : "", //安全专项施工方案附件
|
||
securityConstructionSchemeType: this.safeStatus ? 2 : 1,//是否完成安全专项施工方案交底,1未完成,2完成
|
||
specialConstructionSchemeFile: this.fileList2.length > 0 ? this.file2 : '',//专项施工方案附件
|
||
specialConstructionSchemeType: this.safeStatus2 ? 2 : 1,//是否完成专项施工方案交底,1未完成,2完成
|
||
technicalDisclosureFile: this.fileList3.length > 0 ? this.file3 : '',//技术交底文件
|
||
technicalDisclosureType: this.safeStatus3 ? 2 : 1,//是否完成安全技术交底,1未完成,2完成
|
||
typeDescribeId: this.addForm.describe,//危大工程类别描述
|
||
addForm: this.addForm
|
||
}
|
||
// "新增"
|
||
if (this.dialogTitle == this.$t('message.dangerousBigProject.add')) {
|
||
console.log(data)
|
||
data.responsibilityCompany = this.addForm.unit ? this.addForm.unit.join(',') : ""
|
||
addDangerousEngineeringRecordApi(data).then((res) => {
|
||
if (res.code = 200) {
|
||
this.$message.success(this.$t('message.dangerousBigProject.add') + this.$t('message.dangerousBigProject.success') + "!")
|
||
this.initData()
|
||
}
|
||
console.log(res)
|
||
})
|
||
} else if (this.dialogTitle == this.$t('message.dangerousBigProject.edit')) {
|
||
// "编辑"
|
||
data.id = this.editParms.id
|
||
data.typeDescribeId = this.editParms.typeDescribeId
|
||
if (this.addForm.unit && Array.isArray(this.addForm.unit)) {
|
||
data.responsibilityCompany = this.addForm.unit.join(',')
|
||
} else {
|
||
data.responsibilityCompany = this.addForm.unit
|
||
}
|
||
editDangerousEngineeringRecordApi(data).then((res) => {
|
||
if (res.code = 200) {
|
||
// "修改成功!"
|
||
this.$message.success(this.$t('message.dangerousBigProject.editSuccess'))
|
||
this.initData()
|
||
}
|
||
console.log(res)
|
||
})
|
||
}
|
||
this.dialogFormVisible = false
|
||
},
|
||
handleSelectionChange(val) {
|
||
this.multipleSelection = val;
|
||
},
|
||
deleteRow(index, rows) {
|
||
if(rows[index].finalAcceptanceStatus === 2){
|
||
this.$message.warning('该项危大工程已闭合,请勿操作')
|
||
return
|
||
}
|
||
// console.log(index,rows[index].id)
|
||
this.deleteId = rows[index].id
|
||
this.deleteDialog = true
|
||
},
|
||
checkDelete() {
|
||
deleteDangerousEngineeringRecordApi({ id: this.deleteId }).then((res) => {
|
||
console.log(res)
|
||
if (res.code == 200) {
|
||
this.$message.success(res.message)
|
||
this.initData()
|
||
}
|
||
})
|
||
this.deleteDialog = false
|
||
},
|
||
handleSizeChange() {
|
||
this.initData()
|
||
},
|
||
handleCurrentChange() {
|
||
this.initData()
|
||
},
|
||
handleRemove(file, fileList) {
|
||
console.log(fileList);
|
||
this.fileList = fileList;
|
||
},
|
||
handlePreview(file) {
|
||
console.log(file);
|
||
},
|
||
beforeRemove(file, fileList) {
|
||
// 确定移除
|
||
return this.$confirm(this.$t('message.dangerousBigProject.confirmRemove') + ` ${file.name}?`);
|
||
},
|
||
uploadSuccess(response, file, fileList) {
|
||
console.log('fileList')
|
||
console.log(fileList)
|
||
this.fileList = fileList;
|
||
this.file1 = this.$store.state.FILEURL + fileList[0].response.data[0].imageUrl
|
||
},
|
||
uploadError(err, file, fileList) {
|
||
// 上传失败!
|
||
this.$message.error(this.$t('message.dangerousBigProject.uploadFail'));
|
||
},
|
||
handleRemove2(file, fileList) {
|
||
console.log(fileList);
|
||
this.fileList2 = fileList;
|
||
},
|
||
handlePreview2(file) {
|
||
console.log(file);
|
||
},
|
||
beforeRemove2(file, fileList) {
|
||
// 确定移除
|
||
return this.$confirm(this.$t('message.dangerousBigProject.confirmRemove') + `${file.name}?`);
|
||
},
|
||
uploadSuccess2(response, file, fileList) {
|
||
console.log('fileList')
|
||
console.log(fileList)
|
||
this.fileList2 = fileList;
|
||
this.file2 = this.$store.state.FILEURL + fileList[0].response.data[0].imageUrl
|
||
},
|
||
uploadError2(err, file, fileList) {
|
||
// 上传失败!
|
||
this.$message.error(this.$t('message.dangerousBigProject.uploadFail'));
|
||
},
|
||
handleRemove3(file, fileList) {
|
||
console.log(fileList);
|
||
this.fileList3 = fileList;
|
||
},
|
||
handlePreview3(file) {
|
||
console.log(file);
|
||
},
|
||
beforeRemove3(file, fileList) {
|
||
// 确定移除
|
||
return this.$confirm(this.$t('message.dangerousBigProject.confirmRemove') + `${file.name}?`);
|
||
},
|
||
uploadSuccess3(response, file, fileList) {
|
||
console.log('fileList')
|
||
console.log(fileList)
|
||
this.fileList3 = fileList;
|
||
this.file3 = this.$store.state.FILEURL + fileList[0].response.data[0].imageUrl
|
||
},
|
||
uploadError3(err, file, fileList) {
|
||
// 上传失败!
|
||
this.$message.error(this.$t('message.dangerousBigProject.uploadFail'));
|
||
},
|
||
previewDetail(val) {
|
||
console.log(val)
|
||
this.dialogFormVisible = false
|
||
this.isEdit = true
|
||
this.isAdd = false
|
||
this.isUpdate = false
|
||
// 详细
|
||
this.dialogTitle = this.$t('message.dangerousBigProject.detailed')
|
||
this.detailId = val.id
|
||
this.isSuperDanger = val.issuperdanger
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="less" scoped>
|
||
.dangerousBigProject {
|
||
padding-bottom: 20px;
|
||
height: 100%;
|
||
background: #fff;
|
||
padding: 0 10px;
|
||
padding-top: 20px;
|
||
box-sizing: border-box;
|
||
>div{
|
||
height: 100%;
|
||
.search-box {
|
||
display: flex;
|
||
margin-bottom: 20px;
|
||
.search-input {
|
||
width: 260px;
|
||
margin-right: 20px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.el-icon-delete {
|
||
color: #f56c6c;
|
||
}
|
||
.table-box{
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: calc(100% - 72px);
|
||
.tables{
|
||
margin-bottom: auto;
|
||
}
|
||
}
|
||
.table-item {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-start;
|
||
p {
|
||
width: 100%;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
// .item-status {
|
||
// background: #f56c6c;
|
||
// display: block;
|
||
// color: #fff;
|
||
// border-radius: 4px;
|
||
// padding: 0 4px;
|
||
// height: 20px;
|
||
// }
|
||
.item-status {
|
||
display: flex;
|
||
align-items: center;
|
||
img{
|
||
width: 15px;
|
||
height: 15px;
|
||
}
|
||
span{
|
||
font-size: 14px;
|
||
color: #EA3941;
|
||
}
|
||
}
|
||
.status-none {
|
||
height: 20px;
|
||
}
|
||
.item-title {
|
||
font-weight: 600;
|
||
}
|
||
}
|
||
.table-category-item{
|
||
display: flex;
|
||
p {
|
||
width: 100%;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
// .item-status {
|
||
// background: #f56c6c;
|
||
// display: block;
|
||
// color: #fff;
|
||
// border-radius: 4px;
|
||
// padding: 0 4px;
|
||
// height: 20px;
|
||
// }
|
||
.item-status {
|
||
display: flex;
|
||
align-items: center;
|
||
margin-right: 3px;
|
||
img{
|
||
width: 15px;
|
||
height: 15px;
|
||
margin-right: 3px;
|
||
}
|
||
span{
|
||
font-size: 14px;
|
||
color: #EA3941;
|
||
}
|
||
}
|
||
.status-none {
|
||
height: 20px;
|
||
}
|
||
.item-title {
|
||
font-weight: 600;
|
||
}
|
||
}
|
||
.add-dialog {
|
||
/deep/ .el-dialog {
|
||
width: 80%;
|
||
}
|
||
.form-title {
|
||
margin-bottom: 20px;
|
||
}
|
||
/deep/ .el-form-item__label {
|
||
text-align: left;
|
||
white-space: nowrap;
|
||
}
|
||
/deep/ .el-form {
|
||
padding-left: 36px;
|
||
padding-right: 26px;
|
||
margin-bottom: 20px;
|
||
}
|
||
/deep/ .el-select {
|
||
width: 100%;
|
||
}
|
||
/deep/ .el-date-editor.el-input {
|
||
width: 100%;
|
||
}
|
||
/deep/ .el-date-editor {
|
||
width: 100%;
|
||
}
|
||
/deep/ .el-cascader {
|
||
width: 100%;
|
||
}
|
||
.upload-item {
|
||
display: flex;
|
||
margin-bottom: 10px;
|
||
align-items: center;
|
||
span {
|
||
margin-right: 16px;
|
||
}
|
||
.switch-check {
|
||
margin-left: 8px;
|
||
color: #409eff;
|
||
line-height: 20px;
|
||
}
|
||
.switch-uncheck {
|
||
margin-left: 8px;
|
||
line-height: 20px;
|
||
}
|
||
}
|
||
.upload-file {
|
||
width: 50%;
|
||
padding-left: 26px;
|
||
box-sizing: border-box;
|
||
margin-bottom: 20px;
|
||
a {
|
||
color: #409eff;
|
||
text-decoration: none;
|
||
margin-left: 6px;
|
||
}
|
||
}
|
||
.upload-box {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
}
|
||
}
|
||
.el-pagination {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
margin-top: 20px;
|
||
}
|
||
.backText {
|
||
padding: 8px 0;
|
||
padding-left: 10px;
|
||
/deep/.el-page-header__content {
|
||
font-size: 14px;
|
||
}
|
||
}
|
||
.dark {
|
||
/deep/.el-page-header__content {
|
||
color: #fff;
|
||
}
|
||
/deep/ .print-btn {
|
||
background: none;
|
||
color: #262d47;
|
||
font-size: 14px;
|
||
}
|
||
}
|
||
</style>
|