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
109
110
111
112
113
114
115
116
117
118
119
120
121
<script>
import imageUpload from '@/components/ImageUpload/index.vue'
import { batchException } from '@/api/ecw/order'
export default {
name: 'TurnException',
components: { imageUpload },
props:{
orderNo: {
type: String,
default: ''
},
orderId: {
type: [String, Number],
default: ''
}
},
data(){
return {
showDialog: false,
form: {
manualExceptionType: [],
exceptionUrls: "",
descZh: ''
}
}
},
computed:{
rules(){
return {
manualExceptionType: [
{ required: true, message: this.$t("请勾选原因类型"), trigger: "change" },
{
validator: (rule, value, callback) => {
if (value.length <= 0) {
callback(new Error("请勾选原因类型"));
}
callback();
},
trigger: "change",
},
],
}
}
},
methods:{
handleException(){
this.$refs.form.validate((valid) => {
if (valid) {
this.handleSubmit();
}
});
},
async handleSubmit(){
this.showDialog = false
await batchException({
orderNo: this.orderNo,
manualExceptionType: this.form.manualExceptionType.join(','),
exceptionUrls: this.form.exceptionUrls?.split(",") || [],
descZh: this.form.descZh,
orderIds: [this.orderId]
})
this.$message.success(this.$t('操作成功'))
this.$emit('done')
},
handleCancel(){
this.showDialog = false
this.$emit('cancel')
},
show(){
this.showDialog = true
// 初始化表单
for(const key in Object.keys(this.form)){
this.form[key] = this.form[key] instanceof Array ? [] : ''
}
}
}
}
</script>
<template>
<el-dialog
:title="orderNo + $t('订单转异')"
center
:visible="showDialog"
@close="handleCancel"
>
<el-form
label-position="top"
label-width="200"
ref="form"
:model="form"
:rules="rules"
>
<el-form-item :label="$t('原因类型')" prop="manualExceptionType">
<dict-selector
v-model="form.manualExceptionType"
form-type="checkbox"
:type="DICT_TYPE.MANUAL_EXCEPTION_TYPE"
multiple
></dict-selector>
</el-form-item>
<el-form-item :label="$t('附件')">
<image-upload v-model="form.exceptionUrls"></image-upload>
</el-form-item>
<el-form-item :label="$t('详细信息')">
<el-input v-model="form.descZh" type="textarea"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleException">{{
$t("确认转异")
}}</el-button>
<el-button @click="handleCancel">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
</template>
<style scoped lang="scss">
</style>