Circulate.vue
2.1 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
<template>
<!-- 传阅 -->
<div>
<ApprovalDialog
ref="approvalDialog"
alias="circulate"
:dialog-title="$t('taskToCopyTo.ProcessCirculation')"
:user-label="$t('taskToCopyTo.CirculationPersonnel')"
:opinion-label="$t('taskToCopyTo.CirculationInstructions')"
:is-show-user-selector="true"
:is-get-approval-btn="isGetApprovalBtn"
@submit-form="handleSubmitForm"
/>
</div>
</template>
<script>
import ApprovalDialog from './ApprovalDialog'
import { transToMore } from '@/api/process'
import { mapState } from 'vuex'
export default {
name: 'Circulate',
components: {
ApprovalDialog,
},
props: {
taskId: {
type: String,
default: '',
},
instId: {
type: String,
default: '',
},
nodeId: {
type: String,
default: '',
},
noticeId: {
type: String,
default: '',
},
isGetApprovalBtn: {
type: Boolean,
default: false,
},
},
data() {
return {}
},
computed: {
...mapState('matter', ['currentShowDialogAlias']),
},
watch: {
currentShowDialogAlias(val) {
if (val && val !== 'circulate') {
this.$refs.approvalDialog.handleClose('autoClose')
}
},
},
methods: {
handleOpen() {
this.$refs.approvalDialog.openDialog()
},
handleSubmitForm(formData, cb) {
const { userId, files, opinion } = formData
const data = {
copyToType: '0',
messageType: 'inner',
files,
userId,
opinion,
taskId: this.taskId,
instanceId: this.instId,
selectNodeId: this.nodeId,
parentId: this.noticeId,
}
transToMore(data, (res) => {
if (res.state) {
this.$message.success(res.message)
cb?.()
this.$emit('submit-after')
} else {
this.$message.info(res.message)
cb?.()
}
})
},
},
}
</script>
<style lang="scss" scoped></style>