Admin
2022-08-20 006cedaa4188d5bd5f99ef0721572a24c89d7ce4
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">
@@ -196,6 +196,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 {
@@ -219,13 +220,18 @@
    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: [],
@@ -304,6 +312,32 @@
            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);
                console.log(state.departmentRecursionList,'99999999999')
            } 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 } };
@@ -319,7 +353,6 @@
                    return item;
                });
                state.totalSize1 = res.data.total;
                console.log( state.applyData,'0212121');
            } else {
                ElMessage({
                    type: 'warning',
@@ -422,7 +455,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 +472,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 +489,7 @@
        // 页面载入时执行方法
        onMounted(() => {
            getListByPage();
            getAllDepartment()
        });
        return {