费用审核
parent
a145108480
commit
8e6812a539
@ -0,0 +1,112 @@
|
||||
<!--
|
||||
* @Description: 审核审批 -> 费用提交驳回窗口
|
||||
* @Author: lijj
|
||||
* @Date: 2024-04-29 11:53:37
|
||||
-->
|
||||
<template>
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
:use-wrapper="true"
|
||||
title="驳回提交"
|
||||
width="50%"
|
||||
@register="registerModal"
|
||||
@ok="handleSave"
|
||||
>
|
||||
<!-- 表单 -->
|
||||
<BasicForm @register="registerForm" class="reject-form">
|
||||
</BasicForm>
|
||||
<!--右下角按钮-->
|
||||
<template #footer>
|
||||
<a-button
|
||||
pre-icon="ant-design:close-outlined"
|
||||
type="warning"
|
||||
:loading="loading"
|
||||
ghost
|
||||
style="margin-right: 0.8rem"
|
||||
@click="closeModal"
|
||||
>
|
||||
取消
|
||||
</a-button>
|
||||
<a-button
|
||||
pre-icon="ant-design:check-circle-outlined"
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
@click="handleSave(true)"
|
||||
>
|
||||
确定
|
||||
</a-button>
|
||||
</template>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref, reactive } from 'vue'
|
||||
import { Audit } from '../api'
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal'
|
||||
import { BasicForm, useForm } from '/@/components/Form/index'
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
const { createMessage } = useMessage()
|
||||
const formSchema = [
|
||||
{
|
||||
field: 'reason',
|
||||
label: '驳回原因',
|
||||
defaultValue: '',
|
||||
component: 'InputTextArea',
|
||||
required: true,
|
||||
colProps: { span: 24 },
|
||||
componentProps: {
|
||||
rows: 4
|
||||
}
|
||||
}
|
||||
]
|
||||
// 声明Emits
|
||||
const emit = defineEmits(['success'])
|
||||
|
||||
const loading = ref(false)
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
|
||||
useForm({
|
||||
labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
})
|
||||
const params = reactive({
|
||||
ids: null,
|
||||
businessType: null
|
||||
})
|
||||
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
|
||||
resetFields()
|
||||
console.log(data.ids)
|
||||
params.ids = data.ids
|
||||
params.businessType = data.businessType
|
||||
})
|
||||
|
||||
async function handleSave(exit) {
|
||||
try {
|
||||
const values = await validate()
|
||||
loading.value = true
|
||||
setModalProps({ confirmLoading: true, loading: true })
|
||||
const postData = {
|
||||
result: 2,
|
||||
remark: values.reason,
|
||||
ids: params.ids,
|
||||
businessType: params.businessType
|
||||
}
|
||||
const res = await Audit(postData)
|
||||
loading.value = false
|
||||
if (res.succeeded) {
|
||||
createMessage.success(res.message)
|
||||
emit('success')
|
||||
}
|
||||
exit && closeModal()
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false, loading: false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.reject-form {
|
||||
#form_item_reason {
|
||||
height: 170px;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue