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 |  193 +++++++++++++++++------------------------------
 1 files changed, 71 insertions(+), 122 deletions(-)

diff --git a/src/views/contingencyManagement/contingency/index.vue b/src/views/contingencyManagement/contingency/index.vue
index 68f6335..3efb4cd 100644
--- a/src/views/contingencyManagement/contingency/index.vue
+++ b/src/views/contingencyManagement/contingency/index.vue
@@ -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,7 +138,6 @@
   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";
@@ -147,8 +147,8 @@
 interface User {
   teamName: string
   teamLevel: string
-  teamDescription: string
-  teamPhone: string
+  teamDesc: string
+  principalPhone: string
   telephone: string;
   describe: string;
   responsibleDepartment: string
@@ -158,11 +158,7 @@
 
 // 定义接口来定义对象的类型
 interface TableDataRow {
-  // teamName: string;
-  // teamLevel: string;
-  // teamDescription: string;
-  // teamPhone: string;
-  // attachments: string;
+
 }
 
 //
@@ -178,7 +174,6 @@
   components: {
     OpenAdd,
     OpenSee,
-    OpenEdit,
     View,
     EditPen,
     Plus,
@@ -202,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>>()
@@ -243,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(() => {});
     };
@@ -331,7 +280,6 @@
     const onHandleCurrentChange = (val: number) => {
       formInline.pageIndex = val;
     };
-    // // 分页改变
     // 页面加载时
     onMounted(() => {
       initTableData();
@@ -346,10 +294,9 @@
       upButton,
       upShow,
       // tableData,
+      initTableData,
       onOpenSee, //查看
       seeRef,
-      onOpenEdit,  //编辑
-      editRef,
       onOpenAdd,  //新增
       addRef,
       onRowDel,
@@ -373,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