Your Name
2022-09-28 0dac7ba33f77342d2a9a1392c820d10d3b72d76c
src/views/specialWorkSystem/workTicket/allApplys/index.vue
@@ -23,13 +23,17 @@
                                <el-cascader v-model="searchDep" :options="departmentList" :props="casProps" :show-all-levels="false"/>
                            </div>
                        </el-col>
                        <el-col :span="5" style="display:flex;align-items: center;">
                        <el-col :span="8" style="display:flex;align-items: center;">
                            <span style="white-space: nowrap;margin-left: 20px">申请时间:</span>
                            <div class="grid-content topInfo">
                                <el-date-picker
                                        v-model="searchDate"
                                        type="date"
                                        format="YYYY-MM-DD" value-format="YYYY-MM-DD"
                                        type="daterange"
                                        unlink-panels
                                        range-separator="至"
                                        start-placeholder="开始日期"
                                        end-placeholder="结束日期"
                                        format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss"
                                />
                            </div>
                        </el-col>
@@ -63,7 +67,6 @@
                                    <template #default="scope">
                                        <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button>
                                        <el-button link type="success" size="small" :icon="Finished" @click="viewStatus(scope.row)">进度</el-button>
                                        <el-button link type="warning" size="small" :icon="Delete" @click="deleteRecordBtn(scope.row)">取消</el-button>
                                        <el-button link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出</el-button>
                                    </template>
                                </el-table-column>
@@ -106,7 +109,10 @@
                                        审批结果:<span>{{ item.approvalResultDesc }}</span>
                                    </div>
                                    <div class="text">
                                        审批类型:<span>{{ item.typeDesc }}</span>
                                        审批层级:<span>{{ item.typeDesc }}</span>
                                    </div>
                                    <div class="text" v-if="item.auditTypeDesc">
                                        审批类型:<span>{{ item.auditTypeDesc }}</span>
                                    </div>
                                    <div class="text" v-show="item.startApprovalTime != null">
                                        开始时间:<span>{{ item.startApprovalTime }}</span>
@@ -155,15 +161,6 @@
                            </div>
                        </div>
                    </div>
                </el-dialog>
                <el-dialog v-model="deleteDialog" title="提示" width="30%" center>
                    <span>您确定要取消该条申请吗?</span>
                    <template #footer>
                        <span class="dialog-footer">
                            <el-button @click="deleteDialog = false" size="default">取消</el-button>
                            <el-button type="primary" @click="conFirmDelete" size="default">确认</el-button>
                        </span>
                    </template>
                </el-dialog>
                <el-dialog v-model="downLoadDialog" title="提示" width="30%" center>
                    <span>您确定要导出该条记录吗?</span>
@@ -246,9 +243,9 @@
    deleteId: null | number;
    downLoadId: null | number;
    downLoadName: string;
    searchWord: string;
    searchWord: number | null;
    searchDep: number | null;
    searchDate: string;
    searchDate: Array<any>,
    totalSize1: number;
    activeName: string;
    addRecord: {};
@@ -292,9 +289,9 @@
            departmentList: [],
            departmentRecursionList: [],
            chosenIndex: null,
            searchWord: '',
            searchWord: null,
            searchDep: null,
            searchDate: '',
            searchDate: [],
            applyData: [],
            workTimeList: [],
            multipleSelection: [],
@@ -357,7 +354,7 @@
            let res = await teamManageApi().getAllDepartment();
            if (res.data.code === '200') {
                state.departmentList = JSON.parse(JSON.stringify(res.data.data))
                recursion(state.departmentList);
                // recursion(state.departmentList);
            } else {
                ElMessage({
                    type: 'warning',
@@ -366,21 +363,23 @@
            }
        };
        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 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().getApplyListPage(data);
            const dateRange = JSON.parse(JSON.stringify(state.searchDate))
            if(dateRange[1]){dateRange[1] = dateRange[1].replace('00:00:00','23:59:59')}
            const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord, applyDepId: state.searchDep,applyStartTime: dateRange[0],applyEndTime: dateRange[1]} };
            let res = await workApplyApi().getApplyList(data);
            if (res.data.code === '200') {
                state.applyData = JSON.parse(JSON.stringify(res.data.data));
                state.applyData = state.applyData.map((item) => {
@@ -419,7 +418,7 @@
        // 关键词查询记录
        const searchRecord = async () => {
            if (state.searchWord == ''&& state.searchDep == null && state.searchDate == '') {
            if (state.searchWord == null && state.searchDep == null && state.searchDate == '') {
                ElMessage({
                    type: 'warning',
                    message: '请输入查询关键词'
@@ -430,14 +429,15 @@
        };
        // 重置搜索
        const clearSearch = async () => {
            state.searchWord = '';
            state.searchWord = null;
            state.searchDep = null;
            state.searchDate = ''
            getListByPage();
        };
        // 查看进度
        const viewStatus = (row) => {
            getStatus({ workApplyId: row.workApplyId });
            state.dialogStatus = true;
        };
        // 查询进度方法
@@ -446,6 +446,7 @@
            if (res.data.code === '200') {
                state.approveInfo = JSON.parse(JSON.stringify(res.data.data));
                state.approveInfo.operators = Array.from(state.approveInfo.operators, ({ operatorUname }) => operatorUname);
                state.dialogStatus = true;
            } else {
                ElMessage({
                    type: 'warning',
@@ -457,28 +458,6 @@
        const deleteRecordBtn = (row) => {
            state.deleteId = row.workApplyId;
            state.deleteDialog = true;
        };
        // 取消申请方法
        const deleteRecord = async (data: any) => {
            let res = await workApplyApi().cancelApply(data);
            if (res.data.code === '200') {
                ElMessage({
                    type: 'success',
                    message: '删除成功!'
                });
                getListByPage();
            } else {
                ElMessage({
                    type: 'warning',
                    message: res.data.msg
                });
            }
        };
        const conFirmDelete = () => {
            deleteRecord({ workApplyId: state.deleteId });
            state.deleteDialog = false;
        };
        // 导出图表
@@ -504,7 +483,7 @@
                } else {
                    ElMessage({
                        type: 'warning',
                        message: res.data.msg
                        message: '导出失败'
                    });
                }
            })
@@ -596,7 +575,6 @@
            viewStatus,
            deleteRecordBtn,
            downLoadBtn,
            conFirmDelete,
            conFirmDownLoad,
            getListByPage,
            handleSizeChange1,