From a742c7bee8d01d712f76884ef0729be6fb1ae0db Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期二, 23 八月 2022 15:49:27 +0800
Subject: [PATCH] Default Changelist

---
 src/views/specialWorkSystem/workTicket/myJobApply/index.vue |   91 +++++++++++++++++++++++++++++++--------------
 1 files changed, 62 insertions(+), 29 deletions(-)

diff --git a/src/views/specialWorkSystem/workTicket/myJobApply/index.vue b/src/views/specialWorkSystem/workTicket/myJobApply/index.vue
index 1a502f1..0a00e50 100644
--- a/src/views/specialWorkSystem/workTicket/myJobApply/index.vue
+++ b/src/views/specialWorkSystem/workTicket/myJobApply/index.vue
@@ -58,12 +58,12 @@
                 </div>
                 <el-dialog v-model="dialogDetails" title="作业申请详情" center>
                     <fire v-if="dialogType == 1" :details = details></fire>
-                    <space v-if="dialogType == 2" :details = details></space>
-                    <hoist v-if="dialogType == 3" :details = details></hoist>
-                    <ground v-if="dialogType == 4" :details = details></ground>
-                    <broken v-if="dialogType == 5" :details = details></broken>
-                    <height v-if="dialogType == 6" :details = details></height>
-                    <power v-if="dialogType == 7" :details = details></power>
+                    <space v-else-if="dialogType == 2" :details = details></space>
+                    <hoist v-else-if="dialogType == 3" :details = details></hoist>
+                    <ground v-else-if="dialogType == 4" :details = details></ground>
+                    <broken v-else-if="dialogType == 5" :details = details></broken>
+                    <height v-else-if="dialogType == 6" :details = details></height>
+                    <power v-else-if="dialogType == 7" :details = details></power>
                     <plate v-else :details = details></plate>
                     <template #footer>
                       <span class="dialog-footer">
@@ -73,7 +73,7 @@
                       </span>
                     </template>
                 </el-dialog>
-                <el-dialog v-model="dialogStatus" title="作业申请进度">
+                <el-dialog v-model="dialogStatus" title="作业申请进度" width="60%">
                     <el-form v-if="approveInfo.operators.length > 0" style="margin-bottom: 40px">
                         <el-form-item label="申请作业人">
                             <el-input v-model="approveInfo.operators" readonly type="textarea" />
@@ -102,12 +102,13 @@
                                     </div>
                                     <div class="approveItem">
                                         <div class="item-tit">
-                                            <span>审批项目</span><span>类型</span>
+                                            <span>审批项目</span>
+<!--                                            <span>类型</span>-->
                                             <div>措施标准</div>
                                         </div>
                                         <div class="item-cont" v-for="i in item.stepItems">
-                                            <span>{{ i.itemName }}</span
-                                            ><span>{{ i.typeDesc }}</span>
+                                            <span>{{ i.itemName }}</span>
+<!--                                            <span>{{ i.typeDesc }}</span>-->
                                             <div v-if="i.measure !== null">
                                                 <div>
                                                     <span>作业类型:</span><span>{{ i.measure.workTypeDesc }}</span>
@@ -196,6 +197,7 @@
 import { FormInstance, FormRules, ElMessage } from 'element-plus';
 import { workApplyApi } from '/@/api/specialWorkSystem/workApply';
 import type { TabsPaneContext } from 'element-plus';
+import {teamManageApi} from "/@/api/systemManage/basicDateManage/personShiftManage/teamManage";
 
 // 定义接口来定义对象的类型
 interface stateType {
@@ -218,14 +220,18 @@
     details: {};
     statusInfo: {};
     workType: Array<type>;
-    depType: Array<type>;
-    dialogType: number
+    dialogType: number | null;
+    departmentList: Array<any>;
+    departmentRecursionList: Array<DepartmentState>;
 }
 interface type {
     id: number;
     name: string;
 }
-
+interface DepartmentState {
+    depId: number;
+    depName: string;
+}
 export default defineComponent({
     name: 'myApply',
     components: {
@@ -248,6 +254,8 @@
             totalSize1: 0,
             dialogType: null,
             activeName: '1',
+            departmentList: [],
+            departmentRecursionList: [],
             chosenIndex: null,
             searchWord: '',
             applyData: [],
@@ -274,12 +282,6 @@
                 { id: 6, name: '高处作业' },
                 { id: 7, name: '临时用电作业' },
                 { id: 8, name: '盲板抽堵作业' }
-            ],
-            depType: [
-                { id: 1, name: '部门一' },
-                { id: 2, name: '部门二' },
-                { id: 3, name: '部门三' },
-                { id: 4, name: '部门四' }
             ]
         });
         interface User {
@@ -296,7 +298,7 @@
         // 填写表单
         const toApply = () => {
             router.push({
-                path: 'workTicket'
+                path: 'workApply'
             });
         };
 
@@ -304,10 +306,35 @@
             console.log(tab, event);
         };
 
+        // 获取部门列表
+        const getAllDepartment = async () => {
+            let res = await teamManageApi().getAllDepartment();
+            if (res.data.code === '200') {
+                state.departmentList = JSON.parse(JSON.stringify(res.data.data))
+                recursion(state.departmentList);
+            } else {
+                ElMessage({
+                    type: 'warning',
+                    message: res.data.msg
+                });
+            }
+        };
+
+        const recursion = (value: any) => {
+            for (let i of value) {
+                if (i.children.length !== 0) {
+                    state.departmentRecursionList.push(i);
+                    recursion(i.children);
+                } else {
+                    state.departmentRecursionList.push(i);
+                }
+            }
+        };
+
         // 分页获取工作时间组列表
         const getListByPage = async () => {
             const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord } };
-            let res = await workApplyApi().getApplyListtPage(data);
+            let res = await workApplyApi().getApplyListPage(data);
             if (res.data.code === '200') {
                 state.applyData = JSON.parse(JSON.stringify(res.data.data));
                 state.applyData = state.applyData.map((item) => {
@@ -319,7 +346,6 @@
                     return item;
                 });
                 state.totalSize1 = res.data.total;
-                console.log( state.applyData,'0212121');
             } else {
                 ElMessage({
                     type: 'warning',
@@ -422,7 +448,6 @@
         // 查看记录
         const viewRecord = (row: any) => {
             state.dialogType = row.workType
-            console.log(state.dialogType,'工作类型')
             state.details = JSON.parse(JSON.stringify(row));
             if(state.details.workDetail.otherSpecialWork == '' || !state.details.workDetail.otherSpecialWork){
                 state.details.workDetail.otherSpecialWork=[]
@@ -440,7 +465,7 @@
             else {
                 const a = state.details.workDetail.involvedDepIds
                 state.details.workDetail.involvedDepIds = a.split(',').map((item) => {
-                    return state.depType.find((i: { id: number }) => i.id === Number(item))?.name;
+                    return state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(item))?.depName;
                 });
             }
             console.log(state.details,'details')
@@ -457,6 +482,7 @@
         // 页面载入时执行方法
         onMounted(() => {
             getListByPage();
+            getAllDepartment()
         });
 
         return {
@@ -623,9 +649,12 @@
 
                         & > span {
                             flex: 1;
+                            &:last-of-type{
+                                text-align: center;
+                            }
                         }
                         & > div {
-                            flex: 2;
+                            flex: 1;
                             text-align: center;
                         }
                     }
@@ -639,9 +668,12 @@
 
                         & > span {
                             flex: 1;
+                            &:last-of-type{
+                                text-align: center;
+                            }
                         }
                         & > div {
-                            flex: 2;
+                            flex: 1;
                             text-align: center;
 
                             & > div {
@@ -708,11 +740,12 @@
                                 width: 100%;
                                 display: flex;
                                 justify-content: center;
-                                align-items: center;
+                                align-items: flex-start;
+                                margin-bottom: 10px;
                                 span {
-                                    width: 45%;
+                                    width: 50%;
                                     &:first-of-type {
-                                        width: 30%;
+                                        width: 25%;
                                     }
                                 }
                             }

--
Gitblit v1.9.2