qa-prevention-xgf-app/pages/employed_by/resignation_application.vue

71 lines
1.8 KiB
Vue
Raw Permalink Normal View History

2023-11-07 10:24:08 +08:00
<template>
<view class="content">
<view class="card">
<u-cell-group>
<u-cell title="离职申请单位" :value="RELEVANT_UNIT_NAME"></u-cell>
<u-cell title="离职原因">
<template #value>
<u--textarea v-model="form.LEAVE_REASON" placeholder="请输入离职原因" border="none"
autoHeight></u--textarea>
</template>
</u-cell>
<u-cell title="申请时间" :value="form.APPLY_TIME"></u-cell>
<u-cell title="申请人" :value="userInfo.NAME"></u-cell>
</u-cell-group>
2024-09-30 09:40:54 +08:00
<view class="mt-10">
<u-button type="primary" text="提交" @click="$u.debounce(fnSubmit, 1000,true)"></u-button>
</view>
2023-11-07 10:24:08 +08:00
</view>
</view>
</template>
<script>
import {setResignationApplication} from "../../api";
export default {
data() {
return {
2024-09-30 09:40:54 +08:00
EMPLOYMENT_APPLY_MANAGEMENT_ID: '',
RELEVANT_UNIT_NAME: '',
2023-11-07 10:24:08 +08:00
form: {
LEAVE_REASON: '',
APPLY_TIME: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
2024-09-30 09:40:54 +08:00
REVIEW_STATE: '1',
DEPART_STATE: '-1',
EMPLOYMENT_APPLY_MANAGEMENT_ID: ''
2023-11-07 10:24:08 +08:00
}
}
},
onLoad(query) {
this.EMPLOYMENT_APPLY_MANAGEMENT_ID = query.EMPLOYMENT_APPLY_MANAGEMENT_ID
this.RELEVANT_UNIT_NAME = query.RELEVANT_UNIT_NAME
},
computed: {
userInfo() {
return this.$store.getters.getUserInfo
}
},
methods: {
async fnSubmit() {
2024-09-30 09:40:54 +08:00
if (!this.form.LEAVE_REASON) {
2023-11-07 10:24:08 +08:00
uni.$u.toast('请填写离职原因')
return
}
2024-09-30 09:40:54 +08:00
this.form.EMPLOYMENT_APPLY_MANAGEMENT_ID = this.EMPLOYMENT_APPLY_MANAGEMENT_ID
2023-11-07 10:24:08 +08:00
await setResignationApplication({
...this.form,
2024-09-30 09:40:54 +08:00
OPERATOR: this.userInfo.USER_ID
2023-11-07 10:24:08 +08:00
})
uni.$u.toast('申请成功')
2024-09-30 09:40:54 +08:00
setTimeout(() => {
2023-11-07 10:24:08 +08:00
uni.navigateBack()
2024-09-30 09:40:54 +08:00
}, 2000)
2023-11-07 10:24:08 +08:00
}
},
}
</script>
<style scoped>
</style>