| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </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> |
| | | <template #footer> |
| | |
| | | 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: {}; |
| | |
| | | departmentList: [], |
| | | departmentRecursionList: [], |
| | | chosenIndex: null, |
| | | searchWord: '', |
| | | searchWord: null, |
| | | searchDep: null, |
| | | searchDate: '', |
| | | searchDate: [], |
| | | applyData: [], |
| | | workTimeList: [], |
| | | multipleSelection: [], |
| | |
| | | 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', |
| | |
| | | } |
| | | }; |
| | | |
| | | 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) => { |
| | |
| | | |
| | | // 关键词查询记录 |
| | | const searchRecord = async () => { |
| | | if (state.searchWord == ''&& state.searchDep == null && state.searchDate == '') { |
| | | if (state.searchWord == null && state.searchDep == null && state.searchDate == '') { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请输入查询关键词' |
| | |
| | | }; |
| | | // 重置搜索 |
| | | const clearSearch = async () => { |
| | | state.searchWord = ''; |
| | | state.searchWord = null; |
| | | state.searchDep = null; |
| | | state.searchDate = '' |
| | | getListByPage(); |
| | | }; |
| | | |
| | | // 查看进度 |
| | | const viewStatus = (row) => { |
| | | getStatus({ workApplyId: row.workApplyId }); |
| | | state.dialogStatus = true; |
| | | }; |
| | | |
| | | // 查询进度方法 |
| | |
| | | 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', |
| | |
| | | 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; |
| | | }; |
| | | |
| | | // 导出图表 |
| | |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | message: '导出失败' |
| | | }); |
| | | } |
| | | }) |
| | |
| | | viewStatus, |
| | | deleteRecordBtn, |
| | | downLoadBtn, |
| | | conFirmDelete, |
| | | conFirmDownLoad, |
| | | getListByPage, |
| | | handleSizeChange1, |