Communication.vue
1.94 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
//沟通
<template>
<div>
<allSimilarDialog
:title="'沟通'"
ref="allSimilarDialog"
:nodeId="nodeId"
:userSelectorIsSingle="userSelectorIsSingle"
:taskId="taskId"
:instId="instId"
:noticeId="noticeId"
@onClickRight="onClickRight"
></allSimilarDialog>
</div>
</template>
<script>
import matterButton from '@/mixins/matterButton.js'
import { communicate } from '@/api/process'
import allSimilarDialog from '@/views/matter/components/allSimilarDialog.vue'
export default {
name: 'Communication',
mixins: [matterButton],
components: { allSimilarDialog },
props: {
userSelectorIsSingle: {
type: Boolean,
default: false,
},
taskId: {
type: String,
default: '',
},
instId: {
type: String,
default: '',
},
nodeId: {
type: String,
default: '',
},
defId: {
type: String,
default: '',
},
noticeId: {
type: String,
default: '',
},
},
data() {
return {}
},
methods: {
showDialog() {
this.$refs.allSimilarDialog.showDialog()
},
onClickRight(val, cb) {
let { userId, files, opinion } = val
if (opinion.length > 500) {
opinion = opinion.substring(0, 500)
}
const data = {
files,
userId,
opinion,
defId: this.defId,
instId: this.instId,
nodeId: this.nodeId,
parentId: this.noticeId,
}
communicate(data, (res) => {
if (res.state) {
cb?.()
this.$emit('closePop')
this.$emit('submit-after')
this.$toast.success(res.message)
} else {
this.$toast.fail(res.message)
}
})
},
},
}
</script>
<style lang="scss" scoped>
@import '@/styles/matterButton.scss';
</style>