ProcessingAppealForm.vue
5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<template>
<a-spin :spinning="submitted">
<a-descriptions :bordered="false" :column="2" size="small">
<a-descriptions-item label="申诉时间" name="createTime">
{{ appeal.createTime }}
</a-descriptions-item>
<a-descriptions-item label="申诉原因" name="appealReason">
{{ appeal.appealReason?.label }}
</a-descriptions-item>
<a-descriptions-item label="补充描述" name="appealContent" :span="2">
{{ appeal.appealContent }}
</a-descriptions-item>
<a-descriptions-item label="申诉凭证" name="appealContent" :span="2">
<a-image-preview-group>
<a-image :width="180" v-for="image in appeal.attachments" :src="image.url" :key="image.uid"/>
</a-image-preview-group>
</a-descriptions-item>
</a-descriptions>
<a-divider>平台处理</a-divider>
<a-form v-if="formState" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol" ref="formRef">
<a-form-item label="申诉裁决结果" name="appealResult" @change="formState.solution='DEPOSIT'">
<a-radio-group v-model:value="formState.appealResult">
<a-radio v-for="appealResult in appealResults" :value="appealResult" :key="appealResult">{{ $t('enum.appeal.appealResult.' + appealResult) }}</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="处理方式" name="solution" :rules="[{ required: true, message: '请选择处理方式!' }]">
<a-radio-group v-model:value="formState.solution">
<template v-for="solution in solutions">
<a-radio :value="solution" :key="solution" v-if="!((solution === 'COMPENSATION'||solution === 'RETURN') && formState.appealResult === 'BUYER') ">
{{ $t('enum.appeal.solution.' + solution) }}
</a-radio>
</template>
</a-radio-group>
<a-alert v-if="formState.solution==='RETURN'" type="warning" description="选择此项将启动退车流程,车款及保证金将按平台规则原路退还给买家,请确认已与买卖双方沟通一致。" show-icon
class="mt-8"></a-alert>
</a-form-item>
<a-form-item v-sec="'appeal_14'" v-if="formState.solution==='COMPENSATION'" label="补偿金额" name="compensationAmount" :rules="[{ required: false, message: '请输入补偿金额!' }]">
<a-input-number v-model:value="formState.compensationAmount" :min="0" :step="1" :maxlength="8" :max="99999999" addon-after="元" placeholder="如需补偿,请填写金额"/>
</a-form-item>
<a-form-item v-if="formState.solution==='DEPOSIT'" label="扣除保证金" name="compensationAmount" :rules="[{ required: false, message: '请输入补偿金额!' }]">
<a-input-number v-model:value="formState.compensationAmount" :min="0" :step="1" :maxlength="8" :max="99999999" addon-after="元" placeholder="如需补偿,请填写金额"/>
</a-form-item>
<a-form-item v-if="formState.solution==='RETURN'" label="退款金额" name="compensationAmount" :rules="[{ required: false, message: '请输入补偿金额!' }]">
<a-input-number v-model:value="formState.compensationAmount" :min="0" :step="1" :maxlength="8" :max="99999999" addon-after="元" placeholder="如需补偿,请填写金额"/>
</a-form-item>
<a-form-item label="裁决详情" name="solutionDesc" :rules="[{max: 1024, required: false, message: '请填写裁决详情!' }]">
<a-textarea v-model:value="formState.solutionDesc" rows="6" placeholder="请详细记录裁决依据、沟通结论、责任划分比例等"/>
</a-form-item>
</a-form>
</a-spin>
</template>
<script lang="ts">
import {Component, Prop} from 'vue-facing-decorator';
import {Appeal, APPEAL_APPEAL_RESULTS, APPEAL_SOLUTIONS} from "lib/src/entity/auction/entity/Appeal";
import {EnhanceFormComponent} from "@/core/form/EnhanceFormComponent";
import {createVNode, reactive} from "vue";
import {message, Modal} from "ant-design-vue";
import {AppealController} from "@/api/AppealController";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
@Component({})
export default class ProcessingAppealForm extends EnhanceFormComponent<Appeal> {
@Prop({required: true})
appeal: Appeal;
solutions = APPEAL_SOLUTIONS;
appealResults = APPEAL_APPEAL_RESULTS;
created(): void {
this.formState = reactive<Appeal>(new Appeal());
this.formState.appealResult = 'SELLER';
this.formState.solution = 'REJECT';
}
/**
* 在实例挂载后调用
*/
mounted() {
}
onValidSuccess(formValue: Appeal): void {
formValue.appealId = this.appeal.appealId;
Modal.confirm({
title: '确认提交裁决?',
icon: createVNode(ExclamationCircleOutlined),
content: '提交后将执行相关款项操作且无法修改。',
okText: '确认提交',
cancelText: '取消',
onOk: () => {
AppealController.processingAppeal(this.axios, formValue).then(response => {
message.success('提交成功');
this.$emit('handleOk', response.data);
});
},
onCancel: () => {
this.submitted = false;
console.log('Cancel');
},
});
}
}
</script>
<style scoped lang="less">
</style>