mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-10-31 10:18:43 +08:00 
			
		
		
		
	REVIEW OA 请假
This commit is contained in:
		| @@ -22,6 +22,6 @@ export const getLeave = async (id: number) => { | |||||||
| } | } | ||||||
|  |  | ||||||
| // 获得请假申请分页 | // 获得请假申请分页 | ||||||
| export const getLeavePage = async (params) => { | export const getLeavePage = async (params: PageParam) => { | ||||||
|   return await request.get({ url: '/bpm/oa/leave/page', params }) |   return await request.get({ url: '/bpm/oa/leave/page', params }) | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								src/types/auto-imports.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								src/types/auto-imports.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -6,6 +6,7 @@ export {} | |||||||
| declare global { | declare global { | ||||||
|   const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE'] |   const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE'] | ||||||
|   const EffectScope: typeof import('vue')['EffectScope'] |   const EffectScope: typeof import('vue')['EffectScope'] | ||||||
|  |   const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] | ||||||
|   const computed: typeof import('vue')['computed'] |   const computed: typeof import('vue')['computed'] | ||||||
|   const createApp: typeof import('vue')['createApp'] |   const createApp: typeof import('vue')['createApp'] | ||||||
|   const customRef: typeof import('vue')['customRef'] |   const customRef: typeof import('vue')['customRef'] | ||||||
|   | |||||||
| @@ -71,17 +71,6 @@ const open = async () => { | |||||||
|   modelVisible.value = true |   modelVisible.value = true | ||||||
|   resetForm() |   resetForm() | ||||||
| } | } | ||||||
|  |  | ||||||
| /** 重置表单 */ |  | ||||||
| const resetForm = () => { |  | ||||||
|   formData.value = { |  | ||||||
|     type: undefined, |  | ||||||
|     reason: undefined, |  | ||||||
|     startTime: undefined, |  | ||||||
|     endTime: undefined |  | ||||||
|   } |  | ||||||
|   formRef.value?.resetFields() |  | ||||||
| } |  | ||||||
| defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | ||||||
|  |  | ||||||
| /** 提交表单 */ | /** 提交表单 */ | ||||||
| @@ -95,7 +84,7 @@ const submitForm = async () => { | |||||||
|   formLoading.value = true |   formLoading.value = true | ||||||
|   try { |   try { | ||||||
|     const data = formData.value as unknown as LeaveApi.LeaveVO |     const data = formData.value as unknown as LeaveApi.LeaveVO | ||||||
|     await LeaveApi.createLeaveApi(data) |     await LeaveApi.createLeave(data) | ||||||
|     message.success('新增成功') |     message.success('新增成功') | ||||||
|     modelVisible.value = false |     modelVisible.value = false | ||||||
|     // 发送操作成功的事件 |     // 发送操作成功的事件 | ||||||
| @@ -104,4 +93,15 @@ const submitForm = async () => { | |||||||
|     formLoading.value = false |     formLoading.value = false | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | /** 重置表单 */ | ||||||
|  | const resetForm = () => { | ||||||
|  |   formData.value = { | ||||||
|  |     type: undefined, | ||||||
|  |     reason: undefined, | ||||||
|  |     startTime: undefined, | ||||||
|  |     endTime: undefined | ||||||
|  |   } | ||||||
|  |   formRef.value?.resetFields() | ||||||
|  | } | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| <template> | <template> | ||||||
|   <content-wrap> |   <ContentWrap> | ||||||
|     <!-- 搜索工作栏 --> |     <!-- 搜索工作栏 --> | ||||||
|     <el-form |     <el-form | ||||||
|       class="-mb-15px" |       class="-mb-15px" | ||||||
| @@ -56,15 +56,15 @@ | |||||||
|       <el-form-item> |       <el-form-item> | ||||||
|         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> |         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> | ||||||
|         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> | ||||||
|         <el-button @click="handleCreate()" |         <el-button type="primary" plain @click="handleCreate()"> | ||||||
|           ><Icon icon="ep:plus" class="mr-5px" /> 发起请假</el-button |           <Icon icon="ep:plus" class="mr-5px" /> 发起请假 | ||||||
|         > |         </el-button> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|     </el-form> |     </el-form> | ||||||
|   </content-wrap> |   </ContentWrap> | ||||||
|  |  | ||||||
|   <!-- 列表 --> |   <!-- 列表 --> | ||||||
|   <content-wrap> |   <ContentWrap> | ||||||
|     <el-table v-loading="loading" :data="list"> |     <el-table v-loading="loading" :data="list"> | ||||||
|       <el-table-column label="申请编号" align="center" prop="id" /> |       <el-table-column label="申请编号" align="center" prop="id" /> | ||||||
|       <el-table-column label="状态" align="center" prop="result"> |       <el-table-column label="状态" align="center" prop="result"> | ||||||
| @@ -99,36 +99,33 @@ | |||||||
|         width="180" |         width="180" | ||||||
|         :formatter="dateFormatter" |         :formatter="dateFormatter" | ||||||
|       /> |       /> | ||||||
|  |       <el-table-column label="操作" align="center" width="200"> | ||||||
|       <el-table-column |  | ||||||
|         label="操作" |  | ||||||
|         align="center" |  | ||||||
|         class-name="small-padding fixed-width" |  | ||||||
|         width="200" |  | ||||||
|       > |  | ||||||
|         <template #default="scope"> |         <template #default="scope"> | ||||||
|           <el-button |  | ||||||
|             link |  | ||||||
|             type="primary" |  | ||||||
|             @click="cancelLeave(scope.row)" |  | ||||||
|             v-hasPermi="['bpm:oa-leave:create']" |  | ||||||
|             v-if="scope.row.result === 1" |  | ||||||
|             >取消</el-button |  | ||||||
|           > |  | ||||||
|           <el-button |           <el-button | ||||||
|             link |             link | ||||||
|             type="primary" |             type="primary" | ||||||
|             @click="handleDetail(scope.row)" |             @click="handleDetail(scope.row)" | ||||||
|             v-hasPermi="['bpm:oa-leave:query']" |             v-hasPermi="['bpm:oa-leave:query']" | ||||||
|             >详情</el-button |  | ||||||
|           > |           > | ||||||
|  |             详情 | ||||||
|  |           </el-button> | ||||||
|           <el-button |           <el-button | ||||||
|             link |             link | ||||||
|             type="primary" |             type="primary" | ||||||
|             @click="handleProcessDetail(scope.row)" |             @click="handleProcessDetail(scope.row)" | ||||||
|             v-hasPermi="['bpm:oa-leave:query']" |             v-hasPermi="['bpm:oa-leave:query']" | ||||||
|             >进度</el-button |  | ||||||
|           > |           > | ||||||
|  |             进度 | ||||||
|  |           </el-button> | ||||||
|  |           <el-button | ||||||
|  |             link | ||||||
|  |             type="danger" | ||||||
|  |             @click="cancelLeave(scope.row)" | ||||||
|  |             v-hasPermi="['bpm:oa-leave:create']" | ||||||
|  |             v-if="scope.row.result === 1" | ||||||
|  |           > | ||||||
|  |             取消 | ||||||
|  |           </el-button> | ||||||
|         </template> |         </template> | ||||||
|       </el-table-column> |       </el-table-column> | ||||||
|     </el-table> |     </el-table> | ||||||
| @@ -139,28 +136,27 @@ | |||||||
|       v-model:limit="queryParams.pageSize" |       v-model:limit="queryParams.pageSize" | ||||||
|       @pagination="getList" |       @pagination="getList" | ||||||
|     /> |     /> | ||||||
|   </content-wrap> |   </ContentWrap> | ||||||
|  |  | ||||||
|   <!-- 表单弹窗:详情 --> |   <!-- 表单弹窗:详情 --> | ||||||
|   <LeaveDetail ref="detailRef" /> |   <LeaveDetail ref="detailRef" /> | ||||||
|  |  | ||||||
|   <!-- 表单弹窗:添加 --> |   <!-- 表单弹窗:添加 --> | ||||||
|   <LeaveForm ref="formRef" @success="getList" /> |   <LeaveForm ref="formRef" @success="getList" /> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts" name="OaLeave"> | <script setup lang="ts" name="BpmOALeave"> | ||||||
| import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' | import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' | ||||||
| import { dateFormatter } from '@/utils/formatTime' | import { dateFormatter } from '@/utils/formatTime' | ||||||
| import * as LeaveApi from '@/api/bpm/leave' | import * as LeaveApi from '@/api/bpm/leave' | ||||||
| import * as ProcessInstanceApi from '@/api/bpm/processInstance' | import * as ProcessInstanceApi from '@/api/bpm/processInstance' | ||||||
| import LeaveDetail from './detail.vue' | import LeaveDetail from './detail.vue' | ||||||
| import LeaveForm from './create.vue' | import LeaveForm from './create.vue' | ||||||
|  | const message = useMessage() // 消息弹窗 | ||||||
|  | const router = useRouter() // 路由 | ||||||
|  | const { t } = useI18n() // 国际化 | ||||||
|  |  | ||||||
| const loading = ref(true) // 列表的加载中 | const loading = ref(true) // 列表的加载中 | ||||||
| const total = ref(0) // 列表的总页数 | const total = ref(0) // 列表的总页数 | ||||||
| const list = ref([]) // 列表的数据 | const list = ref([]) // 列表的数据 | ||||||
|  |  | ||||||
| const message = useMessage() // 消息弹窗 |  | ||||||
| const router = useRouter() |  | ||||||
| const queryParams = reactive({ | const queryParams = reactive({ | ||||||
|   pageNo: 1, |   pageNo: 1, | ||||||
|   pageSize: 10, |   pageSize: 10, | ||||||
| @@ -175,7 +171,7 @@ const queryFormRef = ref() // 搜索的表单 | |||||||
| const getList = async () => { | const getList = async () => { | ||||||
|   loading.value = true |   loading.value = true | ||||||
|   try { |   try { | ||||||
|     const data = await LeaveApi.getLeavePageApi(queryParams) |     const data = await LeaveApi.getLeavePage(queryParams) | ||||||
|     list.value = data.list |     list.value = data.list | ||||||
|     total.value = data.total |     total.value = data.total | ||||||
|   } finally { |   } finally { | ||||||
| @@ -207,20 +203,23 @@ const handleDetail = (data: LeaveApi.LeaveVO) => { | |||||||
|   detailRef.value.open(data) |   detailRef.value.open(data) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 取消请假弹窗 | /** 取消请假操作 */ | ||||||
| const cancelLeave = (row) => { | const cancelLeave = async (row) => { | ||||||
|   ElMessageBox.prompt('请输入取消原因', '取消流程', { |   // 二次确认 | ||||||
|     confirmButtonText: '确定', |   const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', { | ||||||
|     cancelButtonText: '取消', |     confirmButtonText: t('common.ok'), | ||||||
|  |     cancelButtonText: t('common.cancel'), | ||||||
|     inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格 |     inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格 | ||||||
|     inputErrorMessage: '取消原因不能为空' |     inputErrorMessage: '取消原因不能为空' | ||||||
|   }).then(async ({ value }) => { |  | ||||||
|     await ProcessInstanceApi.cancelProcessInstanceApi(row.id, value) |  | ||||||
|     message.success('取消成功') |  | ||||||
|   }) |   }) | ||||||
|  |   // 发起取消 | ||||||
|  |   await ProcessInstanceApi.cancelProcessInstance(row.id, value) | ||||||
|  |   message.success('取消成功') | ||||||
|  |   // 刷新列表 | ||||||
|  |   await getList() | ||||||
| } | } | ||||||
|  |  | ||||||
| // 审批进度 | /** 审批进度 */ | ||||||
| const handleProcessDetail = (row) => { | const handleProcessDetail = (row) => { | ||||||
|   router.push({ |   router.push({ | ||||||
|     name: 'BpmProcessInstanceDetail', |     name: 'BpmProcessInstanceDetail', | ||||||
|   | |||||||
| @@ -182,7 +182,7 @@ | |||||||
|     </el-dialog> |     </el-dialog> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
| </template> | </template> | ||||||
| <script setup> | <script setup name="MpAutoReply"> | ||||||
| import { ref, reactive, onMounted, nextTick } from 'vue' | import { ref, reactive, onMounted, nextTick } from 'vue' | ||||||
| import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue' | import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue' | ||||||
| import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue' | import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV