Skip to content

Commit 47b5ce2

Browse files
committed
REVIEW OA 请假
1 parent 50efd60 commit 47b5ce2

File tree

5 files changed

+54
-54
lines changed

5 files changed

+54
-54
lines changed

src/api/bpm/leave/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export const getLeave = async (id: number) => {
2222
}
2323

2424
// 获得请假申请分页
25-
export const getLeavePage = async (params) => {
25+
export const getLeavePage = async (params: PageParam) => {
2626
return await request.get({ url: '/bpm/oa/leave/page', params })
2727
}

src/types/auto-imports.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export {}
66
declare global {
77
const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE']
88
const EffectScope: typeof import('vue')['EffectScope']
9+
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
910
const computed: typeof import('vue')['computed']
1011
const createApp: typeof import('vue')['createApp']
1112
const customRef: typeof import('vue')['customRef']

src/views/bpm/oa/leave/create.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<Dialog title="发起OA请假流程" v-model="modelVisible">
2+
<Dialog title="发起 OA 请假流程" v-model="modelVisible">
33
<el-form
44
ref="formRef"
55
:model="formData"
@@ -71,17 +71,6 @@ const open = async () => {
7171
modelVisible.value = true
7272
resetForm()
7373
}
74-
75-
/** 重置表单 */
76-
const resetForm = () => {
77-
formData.value = {
78-
type: undefined,
79-
reason: undefined,
80-
startTime: undefined,
81-
endTime: undefined
82-
}
83-
formRef.value?.resetFields()
84-
}
8574
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
8675
8776
/** 提交表单 */
@@ -95,7 +84,7 @@ const submitForm = async () => {
9584
formLoading.value = true
9685
try {
9786
const data = formData.value as unknown as LeaveApi.LeaveVO
98-
await LeaveApi.createLeaveApi(data)
87+
await LeaveApi.createLeave(data)
9988
message.success('新增成功')
10089
modelVisible.value = false
10190
// 发送操作成功的事件
@@ -104,4 +93,15 @@ const submitForm = async () => {
10493
formLoading.value = false
10594
}
10695
}
96+
97+
/** 重置表单 */
98+
const resetForm = () => {
99+
formData.value = {
100+
type: undefined,
101+
reason: undefined,
102+
startTime: undefined,
103+
endTime: undefined
104+
}
105+
formRef.value?.resetFields()
106+
}
107107
</script>

src/views/bpm/oa/leave/index.vue

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<content-wrap>
2+
<ContentWrap>
33
<!-- 搜索工作栏 -->
44
<el-form
55
class="-mb-15px"
@@ -56,15 +56,15 @@
5656
<el-form-item>
5757
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
5858
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
59-
<el-button @click="handleCreate()"
60-
><Icon icon="ep:plus" class="mr-5px" /> 发起请假</el-button
61-
>
59+
<el-button type="primary" plain @click="handleCreate()">
60+
<Icon icon="ep:plus" class="mr-5px" /> 发起请假
61+
</el-button>
6262
</el-form-item>
6363
</el-form>
64-
</content-wrap>
64+
</ContentWrap>
6565

6666
<!-- 列表 -->
67-
<content-wrap>
67+
<ContentWrap>
6868
<el-table v-loading="loading" :data="list">
6969
<el-table-column label="申请编号" align="center" prop="id" />
7070
<el-table-column label="状态" align="center" prop="result">
@@ -99,36 +99,33 @@
9999
width="180"
100100
:formatter="dateFormatter"
101101
/>
102-
103-
<el-table-column
104-
label="操作"
105-
align="center"
106-
class-name="small-padding fixed-width"
107-
width="200"
108-
>
102+
<el-table-column label="操作" align="center" width="200">
109103
<template #default="scope">
110-
<el-button
111-
link
112-
type="primary"
113-
@click="cancelLeave(scope.row)"
114-
v-hasPermi="['bpm:oa-leave:create']"
115-
v-if="scope.row.result === 1"
116-
>取消</el-button
117-
>
118104
<el-button
119105
link
120106
type="primary"
121107
@click="handleDetail(scope.row)"
122108
v-hasPermi="['bpm:oa-leave:query']"
123-
>详情</el-button
124109
>
110+
详情
111+
</el-button>
125112
<el-button
126113
link
127114
type="primary"
128115
@click="handleProcessDetail(scope.row)"
129116
v-hasPermi="['bpm:oa-leave:query']"
130-
>进度</el-button
131117
>
118+
进度
119+
</el-button>
120+
<el-button
121+
link
122+
type="danger"
123+
@click="cancelLeave(scope.row)"
124+
v-hasPermi="['bpm:oa-leave:create']"
125+
v-if="scope.row.result === 1"
126+
>
127+
取消
128+
</el-button>
132129
</template>
133130
</el-table-column>
134131
</el-table>
@@ -139,28 +136,27 @@
139136
v-model:limit="queryParams.pageSize"
140137
@pagination="getList"
141138
/>
142-
</content-wrap>
139+
</ContentWrap>
143140

144141
<!-- 表单弹窗:详情 -->
145142
<LeaveDetail ref="detailRef" />
146-
147143
<!-- 表单弹窗:添加 -->
148144
<LeaveForm ref="formRef" @success="getList" />
149145
</template>
150-
<script setup lang="ts" name="OaLeave">
146+
<script setup lang="ts" name="BpmOALeave">
151147
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
152148
import { dateFormatter } from '@/utils/formatTime'
153149
import * as LeaveApi from '@/api/bpm/leave'
154150
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
155151
import LeaveDetail from './detail.vue'
156152
import LeaveForm from './create.vue'
153+
const message = useMessage() // 消息弹窗
154+
const router = useRouter() // 路由
155+
const { t } = useI18n() // 国际化
157156
158157
const loading = ref(true) // 列表的加载中
159158
const total = ref(0) // 列表的总页数
160159
const list = ref([]) // 列表的数据
161-
162-
const message = useMessage() // 消息弹窗
163-
const router = useRouter()
164160
const queryParams = reactive({
165161
pageNo: 1,
166162
pageSize: 10,
@@ -175,7 +171,7 @@ const queryFormRef = ref() // 搜索的表单
175171
const getList = async () => {
176172
loading.value = true
177173
try {
178-
const data = await LeaveApi.getLeavePageApi(queryParams)
174+
const data = await LeaveApi.getLeavePage(queryParams)
179175
list.value = data.list
180176
total.value = data.total
181177
} finally {
@@ -207,20 +203,23 @@ const handleDetail = (data: LeaveApi.LeaveVO) => {
207203
detailRef.value.open(data)
208204
}
209205
210-
// 取消请假弹窗
211-
const cancelLeave = (row) => {
212-
ElMessageBox.prompt('请输入取消原因', '取消流程', {
213-
confirmButtonText: '确定',
214-
cancelButtonText: '取消',
206+
/** 取消请假操作 */
207+
const cancelLeave = async (row) => {
208+
// 二次确认
209+
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
210+
confirmButtonText: t('common.ok'),
211+
cancelButtonText: t('common.cancel'),
215212
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
216213
inputErrorMessage: '取消原因不能为空'
217-
}).then(async ({ value }) => {
218-
await ProcessInstanceApi.cancelProcessInstanceApi(row.id, value)
219-
message.success('取消成功')
220214
})
215+
// 发起取消
216+
await ProcessInstanceApi.cancelProcessInstance(row.id, value)
217+
message.success('取消成功')
218+
// 刷新列表
219+
await getList()
221220
}
222221
223-
// 审批进度
222+
/** 审批进度 */
224223
const handleProcessDetail = (row) => {
225224
router.push({
226225
name: 'BpmProcessInstanceDetail',

src/views/mp/autoReply/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
</el-dialog>
183183
</ContentWrap>
184184
</template>
185-
<script setup>
185+
<script setup name="MpAutoReply">
186186
import { ref, reactive, onMounted, nextTick } from 'vue'
187187
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue'
188188
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue'

0 commit comments

Comments
 (0)