
--- client/resources/api/bsrp.js
+++ client/resources/api/bsrp.js
... | ... | @@ -28,4 +28,9 @@ |
28 | 28 |
// 출장 정보, 출장 품의 삭제 |
29 | 29 |
export const deleteBsrpProc = data => { |
30 | 30 |
return apiClient.delete(`/bsrp/${data}/deleteBsrp.json`); |
31 |
+} |
|
32 |
+ |
|
33 |
+// 출장 정보, 출장 품의 재신청 |
|
34 |
+export const reapplyBsrpProc = (id, data) => { |
|
35 |
+ return apiClient.post(`/bsrp/${id}/reapplyBsrp.json`, data); |
|
31 | 36 |
}(파일 끝에 줄바꿈 문자 없음) |
--- client/resources/api/bsrpRport.js
+++ client/resources/api/bsrpRport.js
... | ... | @@ -23,4 +23,9 @@ |
23 | 23 |
// 출장 복명 삭제 |
24 | 24 |
export const deleteBsrpRportProc = data => { |
25 | 25 |
return apiClient.delete(`/bsrpRport/${data}/deleteBsrpRport.json`); |
26 |
+} |
|
27 |
+ |
|
28 |
+// 출장 복명 재신청 |
|
29 |
+export const reapplyBsrpRport = data => { |
|
30 |
+ return fileClient.post('/bsrpRport/reapplyBsrpRport.file', data); |
|
26 | 31 |
}(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/Manager/attendance/BsrpInsert.vue
+++ client/views/pages/Manager/attendance/BsrpInsert.vue
... | ... | @@ -126,7 +126,8 @@ |
126 | 126 |
<button type="button" class="btn sm btn-red" @click="handleLoadLastApprovers">이전 승인자 불러오기</button> |
127 | 127 |
<button type="button" class="btn sm primary" v-if="$isEmpty(pageId)" @click="handleSave">신청</button> |
128 | 128 |
<template v-else> |
129 |
- <button type="button" class="btn sm primary" @click="handleUpdate"> {{ submitButtonText }} </button> |
|
129 |
+ <button type="button" class="btn sm primary" v-if="isReapplyMode" @click="handleReapply">재신청</button> |
|
130 |
+ <button type="button" class="btn sm primary" v-else @click="handleUpdate">수정</button> |
|
130 | 131 |
<button type="button" class="btn sm secondary" @click="handleCancel">취소</button> |
131 | 132 |
</template> |
132 | 133 |
</div> |
... | ... | @@ -141,7 +142,7 @@ |
141 | 142 |
import SanctnList from '../../../component/Sanctn/SanctnFormList.vue'; |
142 | 143 |
import EditorComponent from '../../../component/editor/EditorComponent.vue'; |
143 | 144 |
// API |
144 |
-import { saveBsrpProc, findBsrpProc, updateBsrpProc, findLastBsrpCnsulProc } from '../../../../resources/api/bsrp'; |
|
145 |
+import { saveBsrpProc, findBsrpProc, updateBsrpProc, findLastBsrpCnsulProc, reapplyBsrpProc } from '../../../../resources/api/bsrp'; |
|
145 | 146 |
|
146 | 147 |
export default { |
147 | 148 |
name: 'BsrpInsert', |
... | ... | @@ -209,11 +210,6 @@ |
209 | 210 |
isReapplyMode() { |
210 | 211 |
return this.pageMode === 'reapply'; |
211 | 212 |
}, |
212 |
- |
|
213 |
- // 재신청 여부에 따른 등록 버튼 변경 |
|
214 |
- submitButtonText() { |
|
215 |
- return this.isReapplyMode ? '재신청' : '수정'; |
|
216 |
- } |
|
217 | 213 |
}, |
218 | 214 |
|
219 | 215 |
async created() { |
... | ... | @@ -291,8 +287,25 @@ |
291 | 287 |
let data = this.buildSendData("update"); |
292 | 288 |
|
293 | 289 |
const response = await updateBsrpProc(this.pageId, data); |
294 |
- const message = this.isReapplyMode ? "재신청되었습니다." : "수정되었습니다."; |
|
295 |
- alert(message); |
|
290 |
+ alert("수정되었습니다."); |
|
291 |
+ |
|
292 |
+ this.handleNavigation('view', response.data.data.pageId); |
|
293 |
+ } catch (error) { |
|
294 |
+ this.handleError(error); |
|
295 |
+ } |
|
296 |
+ }, |
|
297 |
+ |
|
298 |
+ // 재신청 핸들러 |
|
299 |
+ async handleReapply() { |
|
300 |
+ try { |
|
301 |
+ if (!this.validateForm()) { |
|
302 |
+ return; |
|
303 |
+ } |
|
304 |
+ |
|
305 |
+ let data = this.buildSendData("insert"); |
|
306 |
+ |
|
307 |
+ const response = await reapplyBsrpProc(this.pageId, data); |
|
308 |
+ alert("재신청되었습니다."); |
|
296 | 309 |
|
297 | 310 |
this.handleNavigation('view', response.data.data.pageId); |
298 | 311 |
} catch (error) { |
--- client/views/pages/Manager/attendance/BsrpRportInsert.vue
+++ client/views/pages/Manager/attendance/BsrpRportInsert.vue
... | ... | @@ -100,9 +100,10 @@ |
100 | 100 |
</div> |
101 | 101 |
<div class="buttons"> |
102 | 102 |
<button type="button" class="btn sm btn-red" @click="handleLoadLastApprovers">이전 승인자 불러오기</button> |
103 |
- <button type="button" class="btn sm primary" v-if="!this.hasBsrpRport" @click="handleSave">신청</button> |
|
103 |
+ <button type="button" class="btn sm primary" v-if="!hasBsrpRport" @click="handleSave">신청</button> |
|
104 | 104 |
<template v-else> |
105 |
- <button type="button" class="btn sm primary" @click="handleUpdate"> {{ submitButtonText }} </button> |
|
105 |
+ <button type="button" class="btn sm primary" v-if="isReapplyMode" @click="handleReapply">재신청</button> |
|
106 |
+ <button type="button" class="btn sm primary" v-else @click="handleUpdate">수정</button> |
|
106 | 107 |
<button type="button" class="btn sm secondary" @click="handleCancel">취소</button> |
107 | 108 |
</template> |
108 | 109 |
</div> |
... | ... | @@ -116,7 +117,7 @@ |
116 | 117 |
import EditorComponent from '../../../component/editor/EditorComponent.vue'; |
117 | 118 |
// API |
118 | 119 |
import { findBsrpProc } from '../../../../resources/api/bsrp'; |
119 |
-import { findBsrpRportProc, saveBsrpRportProc, updateBsrpRport, findLastBsrpRportProc } from '../../../../resources/api/bsrpRport'; |
|
120 |
+import { findBsrpRportProc, saveBsrpRportProc, updateBsrpRport, findLastBsrpRportProc, reapplyBsrpRport } from '../../../../resources/api/bsrpRport'; |
|
120 | 121 |
|
121 | 122 |
export default { |
122 | 123 |
name: 'BsrpRportInsert', |
... | ... | @@ -159,11 +160,6 @@ |
159 | 160 |
isReapplyMode() { |
160 | 161 |
return this.pageMode === 'reapply'; |
161 | 162 |
}, |
162 |
- |
|
163 |
- // 재신청 여부에 따른 등록 버튼 변경 |
|
164 |
- submitButtonText() { |
|
165 |
- return this.isReapplyMode ? '재신청' : '수정'; |
|
166 |
- } |
|
167 | 163 |
}, |
168 | 164 |
|
169 | 165 |
async created() { |
... | ... | @@ -264,7 +260,8 @@ |
264 | 260 |
}); |
265 | 261 |
|
266 | 262 |
await saveBsrpRportProc(formData); |
267 |
- alert('출장 복명서가 등록되었습니다.'); |
|
263 |
+ alert("등록되었습니다."); |
|
264 |
+ |
|
268 | 265 |
this.handleNavigation('view', this.pageId); |
269 | 266 |
} catch (error) { |
270 | 267 |
alert(error.response?.data?.message || '저장에 실패했습니다.'); |
... | ... | @@ -296,8 +293,7 @@ |
296 | 293 |
}); |
297 | 294 |
|
298 | 295 |
await updateBsrpRport(formData); |
299 |
- const message = this.isReapplyMode ? "재신청되었습니다." : "수정되었습니다."; |
|
300 |
- alert(message); |
|
296 |
+ alert("수정되었습니다."); |
|
301 | 297 |
|
302 | 298 |
this.handleNavigation('view', this.pageId); |
303 | 299 |
} catch (error) { |
... | ... | @@ -305,6 +301,28 @@ |
305 | 301 |
} |
306 | 302 |
}, |
307 | 303 |
|
304 |
+ // 재신청 핸들러 |
|
305 |
+ async handleReapply() { |
|
306 |
+ if (!this.validateForm()) return; |
|
307 |
+ |
|
308 |
+ try { |
|
309 |
+ const formData = this.buildFormData(); |
|
310 |
+ |
|
311 |
+ this.bsrpRport.bsrpTrvctList.forEach(item => { |
|
312 |
+ if (item.file) { |
|
313 |
+ formData.append('files', item.file); |
|
314 |
+ } |
|
315 |
+ }); |
|
316 |
+ |
|
317 |
+ await reapplyBsrpRport(formData); |
|
318 |
+ alert("재신청되었습니다."); |
|
319 |
+ |
|
320 |
+ this.handleNavigation('view', this.pageId); |
|
321 |
+ } catch (error) { |
|
322 |
+ alert(error.response?.data?.message || '저장에 실패했습니다.'); |
|
323 |
+ } |
|
324 |
+ }, |
|
325 |
+ |
|
308 | 326 |
// 승인자 추가 핸들러 |
309 | 327 |
handleApproverAdd(user) { |
310 | 328 |
this.bsrpRport.sanctnList.push({ |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?