You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
529 lines
17 KiB
Vue
529 lines
17 KiB
Vue
<template>
|
|
<div class="app-container">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<!--<el-form-item label="上报部门" prop="deptId" v-show="deptShow" label-width="88px">
|
|
<el-select v-model="queryParams.deptId" filterable placeholder="请选择部门" clearable>
|
|
<el-option
|
|
v-for="dict in allDeptList"
|
|
:key="dict.deptId"
|
|
:label="dict.deptName"
|
|
:value="dict.deptId"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>-->
|
|
<el-form-item label="所属单位" prop="unit" v-show="deptShow" label-width="88px">
|
|
<el-select v-model="queryParams.unit" allow-create filterable placeholder="请选择单位" clearable>
|
|
<el-option
|
|
v-for="dict in allDeptList"
|
|
:key="dict.deptName"
|
|
:label="dict.deptName"
|
|
:value="dict.deptName"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="队伍名称" prop="teamName">
|
|
<el-input
|
|
v-model="queryParams.teamName"
|
|
placeholder="请输入队伍名称"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="队伍级别" prop="teamLevel">
|
|
<el-select v-model="queryParams.teamLevel" allow-create filterable placeholder="请输入队伍级别" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.team_level"
|
|
:key="dict.label"
|
|
:label="dict.label"
|
|
:value="dict.label"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="负责人" prop="dutyer">
|
|
<el-input
|
|
v-model="queryParams.dutyer"
|
|
placeholder="请输入负责人名称"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="联系电话" prop="phone">
|
|
<el-input
|
|
v-model="queryParams.phone"
|
|
placeholder="请输入联系人电话"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="驻地" prop="station">
|
|
<el-input
|
|
v-model="queryParams.station"
|
|
placeholder="请输入驻地"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="队伍属性" prop="teamProperty">
|
|
<el-select v-model="queryParams.teamProperty" placeholder="请选择队伍属性" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.team_property"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
icon="el-icon-plus"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
v-hasPermi="['ehs:ehsRescueTeam:add']"
|
|
>新增</el-button>
|
|
</el-col>
|
|
<!-- <el-col :span="1.5">
|
|
<el-button
|
|
type="success"
|
|
plain
|
|
icon="el-icon-edit"
|
|
size="mini"
|
|
:disabled="single"
|
|
@click="handleUpdate"
|
|
v-hasPermi="['ehs:ehsRescueTeam:edit']"
|
|
>修改</el-button>
|
|
</el-col>-->
|
|
<!-- <el-col :span="1.5">
|
|
<el-button
|
|
type="danger"
|
|
plain
|
|
icon="el-icon-delete"
|
|
size="mini"
|
|
:disabled="multiple"
|
|
@click="handleDelete"
|
|
v-hasPermi="['ehs:ehsRescueTeam:remove']"
|
|
>删除</el-button>
|
|
</el-col>-->
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="warning"
|
|
plain
|
|
icon="el-icon-download"
|
|
size="mini"
|
|
@click="handleExport"
|
|
v-hasPermi="['ehs:ehsRescueTeam:export']"
|
|
>导出</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="info"
|
|
plain
|
|
icon="el-icon-upload2"
|
|
size="mini"
|
|
@click="handleImport"
|
|
>批量导入</el-button
|
|
>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
|
|
<el-table v-loading="loading" :data="ehsRescueTeamList" @selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<!-- <el-table-column label="主键" align="center" prop="id" />-->
|
|
<el-table-column label="序号" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ Number(scope.$index) + 1 }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="队伍名称" align="center" prop="teamName" />
|
|
<el-table-column label="队伍级别" align="center" prop="teamLevel" >
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.team_level" :value="scope.row.teamLevel"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="负责人" align="center" prop="dutyer" />
|
|
<el-table-column label="联系电话" align="center" prop="phone" />
|
|
<el-table-column label="所属单位" align="center" prop="unit" />
|
|
<el-table-column label="驻地" align="center" prop="station" />
|
|
<el-table-column label="队伍属性" align="center" prop="teamProperty">
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.team_property" :value="scope.row.teamProperty"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="救援人员数量" align="center" prop="rescueWorkerNum" />
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<template slot-scope="scope" v-if="curDeptId == scope.row.deptId">
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-edit"
|
|
@click="getWorker(scope.row)"
|
|
>人员信息</el-button>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-edit"
|
|
@click="handleUpdate(scope.row)"
|
|
v-hasPermi="['ehs:ehsRescueTeam:edit']"
|
|
>修改</el-button>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
@click="handleDelete(scope.row)"
|
|
v-hasPermi="['ehs:ehsRescueTeam:remove']"
|
|
>删除</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<pagination
|
|
v-show="total>0"
|
|
:total="total"
|
|
:page.sync="queryParams.pageNum"
|
|
:limit.sync="queryParams.pageSize"
|
|
@pagination="getList"
|
|
/>
|
|
|
|
<!-- 添加或修改应急救援队伍管理对话框 -->
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form-item label="队伍名称" prop="teamName">
|
|
<el-input v-model="form.teamName" placeholder="请输入队伍名称" />
|
|
</el-form-item>
|
|
<el-form-item label="队伍级别" prop="teamLevel">
|
|
<!--<el-input v-model="form.teamLevel" placeholder="请输入队伍级别" />-->
|
|
<el-select v-model="form.teamLevel" allow-create filterable placeholder="请选择队伍级别" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.team_level"
|
|
:key="dict.label"
|
|
:label="dict.label"
|
|
:value="dict.label"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item label="负责人" prop="dutyer">
|
|
<el-input v-model="form.dutyer" placeholder="请输入负责人" />
|
|
</el-form-item>
|
|
<el-form-item label="联系电话" prop="phone">
|
|
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
|
</el-form-item>
|
|
|
|
<el-form-item label="所属单位" prop="unit">
|
|
<el-select v-model="form.unit" allow-create filterable placeholder="请选择所属单位" clearable>
|
|
<el-option
|
|
v-for="dict in partDeptInfo"
|
|
:key="dict.deptName"
|
|
:label="dict.deptName"
|
|
:value="dict.deptName"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item label="驻地" prop="station">
|
|
<el-input v-model="form.station" placeholder="请输入驻地" />
|
|
</el-form-item>
|
|
|
|
<el-form-item label="队伍属性" prop="teamProperty">
|
|
<el-select v-model="form.teamProperty" placeholder="请选择队伍属性">
|
|
<el-option
|
|
v-for="dict in dict.type.team_property"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="parseInt(dict.value)"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<el-drawer
|
|
title="人员信息管理"
|
|
:visible.sync="drawer1"
|
|
size="70%"
|
|
v-if="drawer1"
|
|
>
|
|
<tdh :id="id" @rescue="rescue"></tdh>
|
|
</el-drawer>
|
|
|
|
<!-- 导入 -->
|
|
<importUpload
|
|
ref="uploadRef"
|
|
@ok="upLoadOk"
|
|
downUrl="/ehs/ehsRescueTeam/importTemplate"
|
|
temName="应急救援队伍导入模板"
|
|
></importUpload>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listEhsRescueTeam, getEhsRescueTeam, delEhsRescueTeam, addEhsRescueTeam, updateEhsRescueTeam } from "@/api/ehs/ehsRescueTeam";
|
|
import { listEhsRescueTeamWorker, getEhsRescueTeamWorker, delEhsRescueTeamWorker, addEhsRescueTeamWorker, updateEhsRescueTeamWorker } from "@/api/ehs/ehsRescueTeamWorker";
|
|
import importUpload from "@/components/upload/upload";
|
|
import tdh from "../ehsRescueTeamWorker/index.vue"
|
|
import {listAllDept,selectPartDept } from "@/api/system/dept";
|
|
export default {
|
|
name: "EhsRescueTeam",
|
|
dicts: ['team_property','team_level'],
|
|
components: {
|
|
importUpload,
|
|
tdh,
|
|
},
|
|
data() {
|
|
return {
|
|
// 遮罩层
|
|
loading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
curDeptId:-1,//当前部门
|
|
// 总条数
|
|
total: 0,
|
|
// 应急救援队伍管理表格数据
|
|
ehsRescueTeamList: [],
|
|
//是否显示部门列表查询条件
|
|
deptShow: false,
|
|
//所有部门列表字典
|
|
allDeptList: [],
|
|
// 部分部门数据(根据客户需求查询部分的部门数据)
|
|
partDeptInfo: [],
|
|
// 弹出层标题
|
|
title: "",
|
|
// 是否显示弹出层
|
|
open: false,
|
|
// teamId
|
|
id: "",
|
|
drawer1: false,
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
teamName: null,
|
|
teamLevel: null,
|
|
dutyer: null,
|
|
phone: null,
|
|
unit: null,
|
|
station: null,
|
|
deptId: null,
|
|
teamProperty: null,
|
|
},
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
teamName: [
|
|
{ required: true, message: "队伍名称不能为空", trigger: "blur" }
|
|
],
|
|
phone: [
|
|
{ required: true, message: "电话不能为空", trigger: "blur" }
|
|
/*{ pattern:/^((0\d{2,3}-\d{7,8})|(1[345678]\d{9}))$/, message: "联系方式必须是手机或固话(区号-固话)", trigger: "change" }*/
|
|
],
|
|
teamLevel: [
|
|
{ required: true, message: "队伍级别不能为空", trigger: "blur" }
|
|
],
|
|
dutyer: [
|
|
{ required: true, message: "负责人不能为空", trigger: "blur" }
|
|
],
|
|
unit: [
|
|
{ required: true, message: "所属单位不能为空", trigger: "blur" }
|
|
],
|
|
teamProperty: [
|
|
{ required: true, message: "队伍属性不能为空", trigger: "blur" }
|
|
],
|
|
station: [
|
|
{ required: true, message: "驻地不能为空", trigger: "blur" }
|
|
]
|
|
}
|
|
};
|
|
},
|
|
created() {
|
|
this.getList();
|
|
this.getListAllDept();
|
|
this.getPartDeptInfo();
|
|
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
|
|
this.curDeptId = this.$store.state.user.deptId;
|
|
},
|
|
methods: {
|
|
rescue() {
|
|
this.resetQuery();
|
|
},
|
|
/** 查询应急救援队伍管理列表 */
|
|
getList() {
|
|
this.loading = true;
|
|
listEhsRescueTeam(this.queryParams).then(response => {
|
|
this.ehsRescueTeamList = response.rows;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
});
|
|
},
|
|
/** 单位信息列表,查询所有部门的数据 */
|
|
getListAllDept() {
|
|
console.log(this.$store.state.user.deptId);
|
|
this.loading = true;
|
|
listAllDept().then(response => {
|
|
this.allDeptList = response.data;
|
|
this.allDeptList.push({"deptName":"其他"})
|
|
this.loading = false;
|
|
});
|
|
},
|
|
|
|
/** 部分部门数据(根据客户需求查询部分部门的数据) */
|
|
getPartDeptInfo() {
|
|
// console.log(this.$store.state.user.deptId);
|
|
this.loading = true;
|
|
selectPartDept().then(response => {
|
|
this.partDeptInfo = response.data;
|
|
this.loading = false;
|
|
});
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.open = false;
|
|
this.reset();
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
id: null,
|
|
teamName: null,
|
|
teamLevel: null,
|
|
rescueWorkerNum: null,
|
|
teamProperty: null,
|
|
createBy: null,
|
|
createTime: null,
|
|
updateBy: null,
|
|
updateTime: null,
|
|
remark: null,
|
|
deptId: null,
|
|
createUserId: null,
|
|
updateUserId: null,
|
|
dutyer: null,
|
|
phone: null,
|
|
unit: null,
|
|
station: null,
|
|
};
|
|
this.resetForm("form");
|
|
},
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
this.queryParams.pageNum = 1;
|
|
this.getList();
|
|
},
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
this.resetForm("queryForm");
|
|
this.handleQuery();
|
|
},
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
this.ids = selection.map(item => item.id)
|
|
this.single = selection.length!==1
|
|
this.multiple = !selection.length
|
|
},
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
this.reset();
|
|
this.open = true;
|
|
this.title = "添加应急救援队伍管理";
|
|
if (this.curDeptId != 100){
|
|
console.log("hello:"+this.partDeptInfo[0]);
|
|
this.form.unit = this.partDeptInfo[0].deptName;
|
|
}
|
|
},
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
this.reset();
|
|
const id = row.id || this.ids
|
|
getEhsRescueTeam(id).then(response => {
|
|
this.form = response.data;
|
|
this.open = true;
|
|
this.title = "修改应急救援队伍管理";
|
|
});
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
updateEhsRescueTeam(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.getList();
|
|
});
|
|
} else {
|
|
addEhsRescueTeam(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.getList();
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
this.$modal.confirm('是否确认删除应急救援队伍管理编号为"' + ids + '"的数据项?').then(function() {
|
|
return delEhsRescueTeam(ids);
|
|
}).then(() => {
|
|
this.getList();
|
|
this.$modal.msgSuccess("删除成功");
|
|
}).catch(() => {});
|
|
},
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
this.download('ehs/ehsRescueTeam/export', {
|
|
...this.queryParams
|
|
}, `应急救援队伍信息_${new Date().getTime()}.xlsx`)
|
|
},
|
|
/** 批量导入 */
|
|
handleImport() {
|
|
console.log(this.$refs.uploadRef.upload);
|
|
this.$refs.uploadRef.upload.open = true;
|
|
this.$refs.uploadRef.upload.title = "应急救援队伍导入";
|
|
this.$refs.uploadRef.upload.url =
|
|
process.env.VUE_APP_BASE_API + "/ehs/ehsRescueTeam/importData";
|
|
},
|
|
/** 导入成功 */
|
|
upLoadOk() {
|
|
// console.log("导入成功")
|
|
this.getList();
|
|
},
|
|
/** 人员信息 */
|
|
getWorker(row) {
|
|
this.id = row.id;// 即teamId
|
|
console.log(this.id);
|
|
this.drawer1 = true;
|
|
},
|
|
|
|
|
|
|
|
}
|
|
};
|
|
</script>
|