|
|
@@ -1,52 +1,92 @@
|
|
|
<!-- 驳回弹窗 -->
|
|
|
<template>
|
|
|
- <simple-form-modal title="驳回提示" :items="formItems" ref="editRef" :baseUrl="baseUrl" :formatData="formatData"
|
|
|
- @success="(data) => emit('success', data)"></simple-form-modal>
|
|
|
+ <ele-modal
|
|
|
+ form
|
|
|
+ :width="540"
|
|
|
+ v-model="visible"
|
|
|
+ title="驳回提示"
|
|
|
+ @open="handleOpen"
|
|
|
+ >
|
|
|
+ <SimpleForm
|
|
|
+ :items="formItems"
|
|
|
+ labelWidth="80"
|
|
|
+ ref="formRef"
|
|
|
+ :initKeys="form"
|
|
|
+ ></SimpleForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="handleCancel">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handleSumbit">确定</el-button>
|
|
|
+ </template>
|
|
|
+ </ele-modal>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { reactive, ref, defineEmits, computed } from 'vue';
|
|
|
-import SimpleFormModal from '@/components/CommonPage/SimpleFormModal.vue';
|
|
|
+ import { ref, reactive, nextTick, computed } from 'vue';
|
|
|
+ import SimpleForm from '@/components/CommonPage/SimpleForm.vue';
|
|
|
+ import request from '@/utils/request';
|
|
|
|
|
|
-const emit = defineEmits(['success']);
|
|
|
+ /** 弹窗是否打开 */
|
|
|
+ const visible = defineModel({ type: Boolean });
|
|
|
|
|
|
-const formItems = computed(() => {
|
|
|
+ /** 关闭弹窗 */
|
|
|
+ const handleCancel = () => {
|
|
|
+ visible.value = false;
|
|
|
+ nextTick(() => {
|
|
|
+ formRef.value?.resetForm();
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ const form = ref({
|
|
|
+ id: '',
|
|
|
+ checkStatus: 3,
|
|
|
+ refusalReson: ''
|
|
|
+ });
|
|
|
+
|
|
|
+ /** 弹窗打开事件 */
|
|
|
+ const handleOpen = (id) => {
|
|
|
+ if (!id) return;
|
|
|
+ visible.value = true;
|
|
|
+ nextTick(() => {
|
|
|
+ form.value.id = id;
|
|
|
+ formRef.value?.setData(form.value);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ const formItems = computed(() => {
|
|
|
return [
|
|
|
- {
|
|
|
- type: 'dictSelect',
|
|
|
- label: '驳回原因',
|
|
|
- prop: 'refusalReson',
|
|
|
- props: { code: 'audit_reject_reason', class: 'custom-select' },
|
|
|
+ {
|
|
|
+ type: 'dictSelect',
|
|
|
+ label: '驳回原因',
|
|
|
+ prop: 'refusalReson',
|
|
|
+ required: true,
|
|
|
+ props: {
|
|
|
+ code: 'audit_reject_reason',
|
|
|
+ class: 'custom-select'
|
|
|
}
|
|
|
+ }
|
|
|
];
|
|
|
-});
|
|
|
+ });
|
|
|
|
|
|
-//默认值
|
|
|
-const baseUrl = reactive({
|
|
|
- add: '/order/orderInfo/exceptcheck',
|
|
|
- update: '/order/orderInfo/exceptcheck'
|
|
|
-});
|
|
|
+ const formRef = ref();
|
|
|
|
|
|
-const formData = ref({
|
|
|
- id: '',
|
|
|
- checkStatus: 3
|
|
|
-});
|
|
|
-
|
|
|
-const formatData = (data) => {
|
|
|
- return {
|
|
|
- id: formData.value.id,
|
|
|
- checkStatus: formData.value.checkStatus,
|
|
|
+ const emit = defineEmits(['refresh']);
|
|
|
+ const handleSumbit = () => {
|
|
|
+ formRef.value?.submitForm().then((data) => {
|
|
|
+ const formattedData = {
|
|
|
+ id: form.value.id,
|
|
|
+ checkStatus: form.value.checkStatus,
|
|
|
refusalReson: data.refusalReson,
|
|
|
refusalResonCode: data.refusalReson
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const editRef = ref(null);
|
|
|
-
|
|
|
-function handleOpen(id) {
|
|
|
- formData.value.id = id;
|
|
|
- editRef.value?.handleOpen(formData.value);
|
|
|
-}
|
|
|
+ };
|
|
|
+ request.post('/order/orderInfo/exceptcheck', formattedData).then(() => {
|
|
|
+ visible.value = false;
|
|
|
+ ElMessage.success('驳回成功');
|
|
|
+ emit('refresh', formattedData);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
-defineExpose({ handleOpen });
|
|
|
-</script>
|
|
|
+ defineExpose({
|
|
|
+ handleOpen
|
|
|
+ });
|
|
|
+</script>
|