From 2b4328392746fc59f5edf98fed629f8db2804e18 Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期三, 27 七月 2022 09:29:23 +0800 Subject: [PATCH] 对接 --- src/views/contingencyManagement/contingency/index.vue | 203 ++++++++++++++++++-------------------------------- 1 files changed, 73 insertions(+), 130 deletions(-) diff --git a/src/views/contingencyManagement/contingency/index.vue b/src/views/contingencyManagement/contingency/index.vue index 197e49c..3efb4cd 100644 --- a/src/views/contingencyManagement/contingency/index.vue +++ b/src/views/contingencyManagement/contingency/index.vue @@ -4,10 +4,10 @@ <div class="system-user-search mb15"> <el-form :inline="true" :model="formInline" class="demo-form-inline"> <el-form-item> - <el-input size="default" v-model="formInline.teamName" placeholder="队伍名称"> </el-input> + <el-input size="default" v-model="formInline.searchParams.teamName" placeholder="队伍名称"> </el-input> </el-form-item> <el-form-item> - <el-select size="default" v-model="formInline.teamType" placeholder="请选择队伍级别"> + <el-select size="default" v-model="formInline.searchParams.teamType" placeholder="请选择队伍级别"> <el-option label="公司" value="shanghai"></el-option> <el-option label="分厂-车间" value="beijing"></el-option> <el-option label="工序-班组等" value="beijing"></el-option> @@ -17,7 +17,7 @@ <el-button size="default" type="primary" class="ml10" @click="onSubmit"> 查询 </el-button> - <el-button size="default" class="ml10" @click="submitReset"> + <el-button size="default" class="ml10"> 重置 </el-button> </el-form-item> @@ -25,7 +25,7 @@ </div> <div class="button_Line"> <div class="button_Left"> - <el-button size="default" type="primary" @click="onOpenAdd('新建')"> + <el-button size="default" type="primary" @click="onOpenAdd('新建','')"> <el-icon> <Plus /> </el-icon>新建 @@ -42,17 +42,17 @@ </el-button> </div> <div class="button_Right"> - <el-button @click="upButton"> + <el-button size="default" @click="upButton"> <el-icon> <Upload /> </el-icon> </el-button> - <el-button> + <el-button size="default"> <el-icon> <Download /> </el-icon> </el-button> - <el-button> + <el-button size="default"> <el-icon> <Refresh /> </el-icon> @@ -70,17 +70,17 @@ /> <el-table-column prop="teamName" label="队伍名称" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="teamLevel" label="队伍级别" show-overflow-tooltip sortable></el-table-column> - <el-table-column prop="teamDescription" label="队伍描述" show-overflow-tooltip sortable></el-table-column> - <el-table-column prop="teamPhone" label="负责人手机" show-overflow-tooltip sortable></el-table-column> + <el-table-column prop="teamDesc" label="队伍描述" show-overflow-tooltip sortable></el-table-column> + <el-table-column prop="principalPhone" label="负责人手机" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="attachments" label="相关附件" show-overflow-tooltip sortable></el-table-column> <el-table-column label="操作" width="200" align="center" fixed="right"> <template #default="scope"> - <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenSee(scope.row)"> + <el-button size="small" text type="primary" @click="onOpenAdd('查看',scope.row)"> <el-icon style="margin-right: 5px;"> <View /> </el-icon>查看 </el-button> - <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenEdit(scope.row)"> + <el-button size="small" text type="primary" @click="onOpenAdd('修改',scope.row)"> <el-icon style="margin-right: 5px;"> <EditPen /> </el-icon>修改 @@ -93,23 +93,24 @@ </template> </el-table-column> </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="formInline.pageIndex" - background - v-model:page-size="formInline.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="tableData.total" - > - </el-pagination> + <div class="pages"> + <el-pagination + @size-change="onHandleSizeChange" + @current-change="onHandleCurrentChange" + class="mt15" + :pager-count="5" + :page-sizes="[10, 20, 30]" + v-model:current-page="formInline.pageIndex" + background + v-model:page-size="formInline.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="tableData.total" + > + </el-pagination> + </div> </el-card> - <OpenSee ref="seeRef" /> - <OpenAdd ref="addRef" /> - <OpenEdit ref="editRef" /> + <OpenAdd ref="addRef" @refreshRoleList="initTableData"/> + <OpenSee ref="seeRef" @refreshRoleList="initTableData"/> <upData ref="upShow"></upData> </div> </template> @@ -137,20 +138,17 @@ EditPen, } from '@element-plus/icons-vue' import OpenAdd from '/@/views/contingencyManagement/contingency/component/openAdd.vue'; -import OpenEdit from '/@/views/contingencyManagement/contingency/component/openEdit.vue'; import OpenSee from '/@/views/contingencyManagement/contingency/component/openSee.vue'; import UpData from '/@/views/contingencyManagement/contingency/component/upData.vue'; import {contingencyApi} from "/@/api/contingency"; -import {Session} from "/@/utils/storage"; -import {initBackEndControlRoutes} from "/@/router/backEnd"; // 定义表格数据类型 interface User { teamName: string teamLevel: string - teamDescription: string - teamPhone: string + teamDesc: string + principalPhone: string telephone: string; describe: string; responsibleDepartment: string @@ -160,11 +158,7 @@ // 定义接口来定义对象的类型 interface TableDataRow { - // teamName: string; - // teamLevel: string; - // teamDescription: string; - // teamPhone: string; - // attachments: string; + } // @@ -173,10 +167,6 @@ data: Array<TableDataRow>; total: number; loading: boolean; - param: { - pageIndex: number; - pageSize: number; - } }; } export default defineComponent({ @@ -184,7 +174,6 @@ components: { OpenAdd, OpenSee, - OpenEdit, View, EditPen, Plus, @@ -208,16 +197,16 @@ }) // 搜索按钮 const onSubmit = async () => { - // let res = await contingencyApi().getTeamManagementList(formInline) - // if(res.data.code === '200'){ - // state.tableData.data = res.data.data; - // state.tableData.total = state.tableData.data.length; - // }else{ - // ElMessage({ - // type:'warning', - // message:res.data.msg - // }) - // } + let res = await contingencyApi().getTeamManagementList(formInline) + if(res.data.code === '200'){ + state.tableData.data = res.data.data; + state.tableData.total = state.tableData.data.length; + }else{ + ElMessage({ + type:'warning', + message:res.data.msg + }) + } } const multipleTableRef = ref<InstanceType<typeof ElTable>>() @@ -249,84 +238,38 @@ }) } }; - // const tableData: User[] = [ - // { - // teamName: '应急救援组', - // teamLevel: '公司', - // teamDescription: '实施抢险抢险的应急方案和措施实施 ;', - // telephone: '051383830321', - // teamPhone: '13603812900', - // describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + - // '(2)负责现场被困人员、受伤人员抢救工作;\n' + - // '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + - // '(4)抢险抢修或救援结束后,对结果进行复查和评估。', - // responsibleDepartment: '仪表班', - // teamLeader: '王磊', - // }, - // { - // teamName: '应急救援组', - // teamLevel: '公司', - // teamDescription: '实施抢险抢险的应急方案和措施实施 ;', - // telephone: '051383830321', - // teamPhone: '13603812900', - // describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + - // '(2)负责现场被困人员、受伤人员抢救工作;\n' + - // '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + - // '(4)抢险抢修或救援结束后,对结果进行复查和评估。', - // responsibleDepartment: '仪表班', - // teamLeader: '王磊', - // }, - // { - // teamName: '应急救援组', - // teamLevel: '公司', - // teamDescription: '实施抢险抢险的应急方案和措施实施 ;', - // telephone: '051383830321', - // teamPhone: '13603812900', - // describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + - // '(2)负责现场被困人员、受伤人员抢救工作;\n' + - // '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + - // '(4)抢险抢修或救援结束后,对结果进行复查和评估。', - // responsibleDepartment: '仪表班', - // teamLeader: '王磊', - // }, - // { - // teamName: '应急救援组', - // teamLevel: '公司', - // teamDescription: '实施抢险抢险的应急方案和措施实施 ;', - // telephone: '051383830321', - // teamPhone: '13603812900', - // describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + - // '(2)负责现场被困人员、受伤人员抢救工作;\n' + - // '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + - // '(4)抢险抢修或救援结束后,对结果进行复查和评估。', - // responsibleDepartment: '仪表班', - // teamLeader: '王磊', - // } - // ] //查看用户弹窗 const seeRef = ref(); - const onOpenSee = (row: TableDataRow) => { - seeRef.value.openDialog(row); + const onOpenSee = (type: string, value: any) => { + seeRef.value.openDialog(type, value); }; - // 打开新增用户弹窗 + // 打开新增应急队伍弹窗 const addRef = ref(); - const onOpenAdd = () => { - addRef.value.openDialog(); - }; - // 打开修改用户弹窗 - const editRef = ref(); - const onOpenEdit = (row: TableDataRow) => { - editRef.value.openDialog(row); + const onOpenAdd = (type: string, value: any) => { + addRef.value.openDialog(type, value); }; // 删除用户 - const onRowDel = (row: TableDataRow) => { - ElMessageBox.confirm(`此操作将永久删除账户名称:“${row}”,是否继续?`, '提示', { + const onRowDel = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除队伍名称:“${row}”,是否继续?`, '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', }) - .then(() => { - ElMessage.success('删除成功'); + .then(async () => { + let res = await contingencyApi().deleteEmergencyTeam({principalUid:row.principalUid}) + if(res.data.code ==='200'){ + ElMessage({ + type:'success', + duration:2000, + message:'删除成功' + }) + await initTableData() + }else{ + ElMessage({ + type:'warning', + message:res.data.msg + }) + } }) .catch(() => {}); }; @@ -337,7 +280,6 @@ const onHandleCurrentChange = (val: number) => { formInline.pageIndex = val; }; - // // 分页改变 // 页面加载时 onMounted(() => { initTableData(); @@ -352,10 +294,9 @@ upButton, upShow, // tableData, + initTableData, onOpenSee, //查看 seeRef, - onOpenEdit, //编辑 - editRef, onOpenAdd, //新增 addRef, onRowDel, @@ -379,14 +320,16 @@ display: flex; flex-direction: row; justify-content: space-between; + margin-bottom: 10px; } - .pages{ - padding-top: 20px; - display: flex; - justify-content: flex-end; - } -.el-form .el-form-item:last-of-type{ - margin-bottom: 22px!important; +//分页 +.pages{ + display: flex; + justify-content: flex-end; + margin-top: 15px; +} +.el-form .el-form-item{ + margin-bottom: 0px!important; } //弹窗底部边框线 ::v-deep .el-dialog__footer{ -- Gitblit v1.9.2