|
|
|
|
@ -8,32 +8,33 @@
|
|
|
|
|
<slot>
|
|
|
|
|
<div>
|
|
|
|
|
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
|
|
|
|
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
|
|
|
|
<DatePicker type="datetimerange" v-model="searchFields.dateRange" @on-ok="handleOk"
|
|
|
|
|
format="yyyy-MM-dd HH:mm" placeholder="事故的发生时间范围" style="width: 300px"></DatePicker>
|
|
|
|
|
|
|
|
|
|
<Button type="primary" @click="search" style="margin-left: 10px">查询</Button>
|
|
|
|
|
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</LxHeader>
|
|
|
|
|
</div>
|
|
|
|
|
<div ref="lxTable">
|
|
|
|
|
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
|
|
|
|
<el-table-column type="index" width="50" align="center"> </el-table-column>
|
|
|
|
|
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
|
|
|
|
:label="column.title" :width="column.width">
|
|
|
|
|
<div ref="lxTable" class="table-tree">
|
|
|
|
|
<el-table :data="tableData" class="v-table" :height="tableHeight" style="width: 100%">
|
|
|
|
|
<el-table-column type="index" fixed width="50" align="center"> </el-table-column>
|
|
|
|
|
<el-table-column :prop="column.field" :fixed="column.fixed" :align="column.align"
|
|
|
|
|
v-for="(column,index) in columns" :label="column.title" :width="column.width">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-if="column.type == 'img'">
|
|
|
|
|
<img v-for="(file, vIndex) in getFilePath( scope.row[column.field], column)" :key="vIndex"
|
|
|
|
|
@click="viewImg(scope.row, column, file.path)" class="table-img" :src="file.path" />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="column.type=='format'">
|
|
|
|
|
<div v-if="column.field=='task_departments_report'">
|
|
|
|
|
<el-link type="primary">
|
|
|
|
|
{{scope.row["safety_task_departments_count"]+"/"+scope.row["safety_task_departments_report_count"]}}
|
|
|
|
|
</el-link>
|
|
|
|
|
<div v-if="column.field=='hurt_count'">
|
|
|
|
|
{{"受伤"+scope.row["hurt_count"]+"人 死亡"+scope.row["die_count"]+"人 失踪"+scope.row["miss_count"]+"人"}}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="column.field=='task_departments'">
|
|
|
|
|
<el-tag v-for="(tag, tIndex) in scope.row['safety_task_departments']"
|
|
|
|
|
style="margin-right: 5px;margin-bottom: 5px;">
|
|
|
|
|
{{tag.departments.name}}
|
|
|
|
|
<div v-if="column.field=='is_fail'">
|
|
|
|
|
<el-tag>
|
|
|
|
|
{{scope.row["is_fail"]=="1"?"是":"否"}}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -56,42 +57,155 @@
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-dialog title="任务编辑" :visible.sync="dialogFormVisible" fullscreen width="90%">
|
|
|
|
|
<el-dialog title="事故编辑" :visible.sync="dialogFormVisible" fullscreen width="90%">
|
|
|
|
|
<div class="dialogConcent" :style="{height:clientHeight+'px'}">
|
|
|
|
|
<el-scrollbar style="flex: 1">
|
|
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-form-item label="任务名称" prop="title">
|
|
|
|
|
<el-input v-model="form.title" placeholder="请填写任务名称" autocomplete="off"></el-input>
|
|
|
|
|
<el-form :model="form" :rules="rules" ref="form">
|
|
|
|
|
<div style="padding: 20px 0px;" class="form-sub-title">
|
|
|
|
|
<span>基础信息
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="事发单位" prop="unit" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-input v-model="form.unit" placeholder="请填写事发单位" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="事发时间" prop="happen_date" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-date-picker v-model="form.happen_date" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
format="yyyy-MM-dd HH:mm:ss" placeholder="选择事发时间">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="事故类别" prop="type" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-select v-model="form.type" placeholder="请选择事故类别">
|
|
|
|
|
<el-option v-for="item in parameters.accidentType" :key="item.id" :label="item.value"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="上报时间" prop="report_date" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-date-picker v-model="form.report_date" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
format="yyyy-MM-dd HH:mm:ss" placeholder="选择上报时间">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="事发地点" prop="address" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-input v-model="form.address" placeholder="请填写事发地点" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="事故等级" prop="level" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-select v-model="form.level" placeholder="请选择事故等级">
|
|
|
|
|
<el-option v-for="item in parameters.accidentLevel" :key="item.id" :label="item.value"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="事故未遂" prop="is_fail" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-radio-group v-model="form.is_fail">
|
|
|
|
|
<el-radio :label="1">是</el-radio>
|
|
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="伤亡情况" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<div style="display: flex; align-items: center;">
|
|
|
|
|
<el-input v-model="form.hurt_count" style="width: 180px;" placeholder="人数" autocomplete="off">
|
|
|
|
|
<template slot="prepend">伤</template>
|
|
|
|
|
<template slot="append">人</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input v-model="form.die_count" style="width: 180px;margin-left: 20px;" placeholder="人数"
|
|
|
|
|
autocomplete="off">
|
|
|
|
|
<template slot="prepend">亡</template>
|
|
|
|
|
<template slot="append">人</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input v-model="form.miss_count" style="width: 240px;margin-left: 20px;" placeholder=" 人数"
|
|
|
|
|
autocomplete="off"> <template slot="prepend">下落不明</template>
|
|
|
|
|
<template slot="append">人</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="初步估算直接经济损失" prop="economic_loss">
|
|
|
|
|
<el-input v-model="form.economic_loss" placeholder="请填写金额" style="width: 180px;" autocomplete="off">
|
|
|
|
|
<template slot="append">元</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
<div style="padding: 20px 0px;" class="form-sub-title">
|
|
|
|
|
<span>详细信息
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="事发单位情况">
|
|
|
|
|
|
|
|
|
|
<el-input type="textarea" v-model="form.unit_overview" style="width: 98%;"></el-input>
|
|
|
|
|
|
|
|
|
|
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther"
|
|
|
|
|
action="/api/admin/upload-file" :on-remove="handleRemove" :before-remove="beforeRemove"
|
|
|
|
|
:on-exceed="handleExceed" :file-list="fileList.unit_overview_files_list">
|
|
|
|
|
<el-button size="small" type="primary" @click="toupload('unit_overview_files_list')">点击上传</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="任务日期" prop="daterange">
|
|
|
|
|
<el-date-picker type="datetimerange" v-model="form.daterange" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
<el-form-item label="事故发生的时间地点以及现场的情况">
|
|
|
|
|
|
|
|
|
|
<el-input type="textarea" v-model="form.scene_condition" style="width: 98%;"></el-input>
|
|
|
|
|
|
|
|
|
|
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther"
|
|
|
|
|
action="/api/admin/upload-file" :on-remove="handleRemove" :before-remove="beforeRemove"
|
|
|
|
|
:on-exceed="handleExceed" :file-list="fileList.scene_condition_files_list">
|
|
|
|
|
<el-button size="small" type="primary" @click="toupload('scene_condition_files_list')">点击上传</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="内容" prop="content">
|
|
|
|
|
<div style="width: 99.9%;">
|
|
|
|
|
<tinymce v-model="form.content" :height="300" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="事故已经造成或者可能造成的伤亡人数 ( 包括下落不明的人数 ) 和初步估计的直接经济损失">
|
|
|
|
|
|
|
|
|
|
<el-input type="textarea" v-model="form.consequence" style="width: 98%;"></el-input>
|
|
|
|
|
|
|
|
|
|
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther"
|
|
|
|
|
action="/api/admin/upload-file" :on-remove="handleRemove" :before-remove="beforeRemove"
|
|
|
|
|
:on-exceed="handleExceed" :file-list="fileList.consequence_file_list">
|
|
|
|
|
<el-button size="small" type="primary" @click="toupload('consequence_file_list')">点击上传</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="附件" prop="file_list">
|
|
|
|
|
|
|
|
|
|
<el-form-item label="已采取的措施">
|
|
|
|
|
|
|
|
|
|
<el-input type="textarea" v-model="form.measure" style="width: 98%;"></el-input>
|
|
|
|
|
|
|
|
|
|
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther"
|
|
|
|
|
action="/api/admin/upload-file" :on-remove="handleRemove" :before-remove="beforeRemove"
|
|
|
|
|
:on-exceed="handleExceed" :file-list="fileList">
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
:on-exceed="handleExceed" :file-list="fileList.measure_file_list">
|
|
|
|
|
<el-button size="small" type="primary" @click="toupload('measure_file_list')">点击上传</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="其他需要报告的情况">
|
|
|
|
|
|
|
|
|
|
<el-form-item label="科室" prop="department_list">
|
|
|
|
|
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
|
|
|
|
|
</el-checkbox>
|
|
|
|
|
<div style="margin: 15px 0;"></div>
|
|
|
|
|
<el-checkbox-group v-model="form.department_list" @change="handleCheckedDeptChange">
|
|
|
|
|
<el-checkbox v-for="dept in deptOptions" :label="dept.id" :key="dept.id">{{dept.name}}</el-checkbox>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
<el-input type="textarea" v-model="form.other" style="width: 98%;"></el-input>
|
|
|
|
|
|
|
|
|
|
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther"
|
|
|
|
|
action="/api/admin/upload-file" :on-remove="handleRemove" :before-remove="beforeRemove"
|
|
|
|
|
:on-exceed="handleExceed" :file-list="fileList.other_file_list">
|
|
|
|
|
<el-button size="small" type="primary" @click="toupload('other_file_list')">点击上传</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
</div>
|
|
|
|
|
@ -110,13 +224,16 @@
|
|
|
|
|
getToken
|
|
|
|
|
} from '@/utils/auth'
|
|
|
|
|
import LxHeader from "@/components/LxHeader/index.vue";
|
|
|
|
|
import Tinymce from '@/components/Tinymce'
|
|
|
|
|
import Tinymce from '@/components/Tinymce';
|
|
|
|
|
import {
|
|
|
|
|
getparameteritem
|
|
|
|
|
} from "../../api/system/dictionary.js"
|
|
|
|
|
import {
|
|
|
|
|
save,
|
|
|
|
|
store,
|
|
|
|
|
del,
|
|
|
|
|
get,
|
|
|
|
|
listtask
|
|
|
|
|
listaccident
|
|
|
|
|
|
|
|
|
|
} from "../../api/accident/index.js";
|
|
|
|
|
|
|
|
|
|
@ -130,27 +247,54 @@
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
touploadType: "",
|
|
|
|
|
checkAll: false,
|
|
|
|
|
isIndeterminate: true,
|
|
|
|
|
parameters: {
|
|
|
|
|
accidentType: [],
|
|
|
|
|
accidentLevel: []
|
|
|
|
|
},
|
|
|
|
|
paginations: {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 15,
|
|
|
|
|
total: 0
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
tableHeight: 0,
|
|
|
|
|
dialogFormVisible: false,
|
|
|
|
|
formLabelWidth: "120px",
|
|
|
|
|
clientHeight: 0,
|
|
|
|
|
form: {
|
|
|
|
|
title: "",
|
|
|
|
|
content: "",
|
|
|
|
|
file_list: "",
|
|
|
|
|
start_date: "",
|
|
|
|
|
end_date: "",
|
|
|
|
|
department_list: [],
|
|
|
|
|
daterange: null
|
|
|
|
|
id: "",
|
|
|
|
|
unit: "",
|
|
|
|
|
happen_date: "",
|
|
|
|
|
report_date: "",
|
|
|
|
|
address: "",
|
|
|
|
|
hurt_count: 0,
|
|
|
|
|
die_count: 0,
|
|
|
|
|
miss_count: 0,
|
|
|
|
|
economic_loss: "0",
|
|
|
|
|
level: "",
|
|
|
|
|
is_fail: 1,
|
|
|
|
|
type: "",
|
|
|
|
|
unit_overview: "",
|
|
|
|
|
scene_condition: "",
|
|
|
|
|
consequence: "",
|
|
|
|
|
measure: "",
|
|
|
|
|
other: "",
|
|
|
|
|
unit_overview_files_list: [],
|
|
|
|
|
scene_condition_files_list: [],
|
|
|
|
|
consequence_file_list: [],
|
|
|
|
|
measure_file_list: [],
|
|
|
|
|
other_file_list: [],
|
|
|
|
|
},
|
|
|
|
|
fileList: {
|
|
|
|
|
unit_overview_files_list: [],
|
|
|
|
|
scene_condition_files_list: [],
|
|
|
|
|
consequence_file_list: [],
|
|
|
|
|
measure_file_list: [],
|
|
|
|
|
other_file_list: []
|
|
|
|
|
},
|
|
|
|
|
fileList: [],
|
|
|
|
|
tableData: [],
|
|
|
|
|
rules: {
|
|
|
|
|
title: [{
|
|
|
|
|
@ -175,50 +319,74 @@
|
|
|
|
|
KeyWord: ""
|
|
|
|
|
},
|
|
|
|
|
columns: [{
|
|
|
|
|
field: "title",
|
|
|
|
|
title: "任务名称",
|
|
|
|
|
field: "unit",
|
|
|
|
|
title: "事发单位",
|
|
|
|
|
type: "string",
|
|
|
|
|
width: 280
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "start_date",
|
|
|
|
|
title: "开始时间",
|
|
|
|
|
field: "happen_date",
|
|
|
|
|
title: "事发时间",
|
|
|
|
|
type: "date",
|
|
|
|
|
width: 160,
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "end_date",
|
|
|
|
|
title: "结束时间",
|
|
|
|
|
field: "report_date",
|
|
|
|
|
title: "上报时间",
|
|
|
|
|
type: "date",
|
|
|
|
|
width: 160,
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "task_departments",
|
|
|
|
|
title: "科室",
|
|
|
|
|
type: "format",
|
|
|
|
|
align: "left"
|
|
|
|
|
field: "level",
|
|
|
|
|
title: "事故等级",
|
|
|
|
|
|
|
|
|
|
width: 100,
|
|
|
|
|
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
field: "task_departments_report",
|
|
|
|
|
title: "上报(全部/已上报)",
|
|
|
|
|
type: "format",
|
|
|
|
|
width: 180,
|
|
|
|
|
field: "type",
|
|
|
|
|
title: "事故类型",
|
|
|
|
|
|
|
|
|
|
width: 100,
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
field: "economic_loss",
|
|
|
|
|
title: "预估经济损失",
|
|
|
|
|
width: 100,
|
|
|
|
|
align: "right"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "hurt_count",
|
|
|
|
|
title: "伤亡情况",
|
|
|
|
|
type: "format",
|
|
|
|
|
width: 200,
|
|
|
|
|
align: "left"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "scene_condition",
|
|
|
|
|
title: "现场情况",
|
|
|
|
|
align: "left"
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
field: "操作",
|
|
|
|
|
title: "操作",
|
|
|
|
|
width: 220,
|
|
|
|
|
type: "opt",
|
|
|
|
|
fixed: "right"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
uploadOther: {
|
|
|
|
|
token: ""
|
|
|
|
|
},
|
|
|
|
|
deptOptions: []
|
|
|
|
|
deptOptions: [],
|
|
|
|
|
all_files: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
@ -229,6 +397,11 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleOk() {},
|
|
|
|
|
toupload(type) {
|
|
|
|
|
console.log(type)
|
|
|
|
|
this.touploadType = type;
|
|
|
|
|
},
|
|
|
|
|
loadDeptOptions() {
|
|
|
|
|
listdept().
|
|
|
|
|
then((res) => {
|
|
|
|
|
@ -260,24 +433,37 @@
|
|
|
|
|
var topHeight = 50; //页面 头部
|
|
|
|
|
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
|
|
|
|
that.tableHeight = tableHeight;
|
|
|
|
|
|
|
|
|
|
//加载自定义参数
|
|
|
|
|
getparameteritem("accidentLevel").then(res => {
|
|
|
|
|
this.parameters.accidentLevel = res.detail;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//加载自定义参数
|
|
|
|
|
getparameteritem("accidentType").then(res => {
|
|
|
|
|
this.parameters.accidentType = res.detail;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(page) {
|
|
|
|
|
this.paginations.page = page;
|
|
|
|
|
this.load();
|
|
|
|
|
},
|
|
|
|
|
search() {
|
|
|
|
|
this.paginations.page = 1;
|
|
|
|
|
this.load();
|
|
|
|
|
},
|
|
|
|
|
load() {
|
|
|
|
|
listtask({
|
|
|
|
|
page: this.paginations.page,
|
|
|
|
|
page_size: this.paginations.page_size,
|
|
|
|
|
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.tableData = response.data;
|
|
|
|
|
this.paginations.page_size = response.total;
|
|
|
|
|
listaccident({
|
|
|
|
|
page: this.paginations.page,
|
|
|
|
|
page_size: this.paginations.page_size
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.tableData = res.data;
|
|
|
|
|
this.paginations.total = res.total
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
del(obj) {
|
|
|
|
|
var that = this;
|
|
|
|
|
@ -309,18 +495,8 @@
|
|
|
|
|
get(obj.id).then(res => {
|
|
|
|
|
let result = Object.assign(that.form, res);
|
|
|
|
|
that.form = result;
|
|
|
|
|
let _files = [];
|
|
|
|
|
for (var mod of result.files) {
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.name = mod.original_name;
|
|
|
|
|
_files.push(m);
|
|
|
|
|
}
|
|
|
|
|
that.form.type = parseInt(result.type);
|
|
|
|
|
|
|
|
|
|
that.form.daterange = [res.start_date, res.end_date];
|
|
|
|
|
for (var m of res.safety_task_departments) {
|
|
|
|
|
that.form.department_list.push(m.department_id);
|
|
|
|
|
}
|
|
|
|
|
that.fileList = _files;
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
//reject(error)
|
|
|
|
|
})
|
|
|
|
|
@ -340,10 +516,7 @@
|
|
|
|
|
|
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
that.form.start_date = that.form.daterange[0];
|
|
|
|
|
that.form.end_date = that.form.daterange[1];
|
|
|
|
|
if (that.form.id) {
|
|
|
|
|
that.form.safety_task_id = that.form.id;
|
|
|
|
|
save(that.form).then(response => {
|
|
|
|
|
//console.log(response)
|
|
|
|
|
this.$Message.success('操作成功');
|
|
|
|
|
@ -363,7 +536,11 @@
|
|
|
|
|
//reject(error)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
that.fileList = [];
|
|
|
|
|
that.fileList.consequence_file_list = [];
|
|
|
|
|
that.fileList.measure_file_list = [];
|
|
|
|
|
that.fileList.other_file_list = [];
|
|
|
|
|
that.fileList.scene_condition_files_list = [];
|
|
|
|
|
that.fileList.unit_overview_files_list = [];
|
|
|
|
|
} else {
|
|
|
|
|
this.$Message.error('数据校验失败');
|
|
|
|
|
console.log('error submit!!');
|
|
|
|
|
@ -372,7 +549,10 @@
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
|
console.log(fileList);
|
|
|
|
|
var _touploadType = this.all_files.filter((x) => {
|
|
|
|
|
return x.uid == file.uid;
|
|
|
|
|
})[0].touploadType;
|
|
|
|
|
console.log(_touploadType)
|
|
|
|
|
let listUrl = [];
|
|
|
|
|
for (var m of fileList) {
|
|
|
|
|
if (m.response)
|
|
|
|
|
@ -380,23 +560,24 @@
|
|
|
|
|
else
|
|
|
|
|
listUrl.push(m.id);
|
|
|
|
|
}
|
|
|
|
|
this.form.file_list = listUrl;
|
|
|
|
|
this.form[_touploadType] = listUrl;
|
|
|
|
|
},
|
|
|
|
|
handleExceed(files, fileList) {},
|
|
|
|
|
beforeRemove(file, fileList) {
|
|
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
|
|
},
|
|
|
|
|
handlesuccess(response, file, fileList) {
|
|
|
|
|
console.log(fileList);
|
|
|
|
|
//console.log(response,file,fileList);
|
|
|
|
|
let listUrl = [];
|
|
|
|
|
for (var m of fileList) {
|
|
|
|
|
if (m.response)
|
|
|
|
|
listUrl.push(m.response.id);
|
|
|
|
|
else
|
|
|
|
|
listUrl.push(m.id);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.form.file_list = listUrl;
|
|
|
|
|
file.touploadType = this.touploadType;
|
|
|
|
|
this.all_files.push(file);
|
|
|
|
|
this.form[this.touploadType] = listUrl;
|
|
|
|
|
},
|
|
|
|
|
resetForm(formName) {
|
|
|
|
|
var that = this;
|
|
|
|
|
@ -410,5 +591,6 @@
|
|
|
|
|
<style>
|
|
|
|
|
.dialogConcent {
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
overflow-x: hidden !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|