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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
| <template>
| <div class="flex_column">
| <div v-if="isDepartment" style="display: flex;justify-content: space-between;margin-bottom: 10px">
| <el-button size="small" type="primary" @click="getTableData">刷新</el-button>
| <el-button size="small" type="primary" icon="el-icon-plus" @click="openDialog">新增</el-button>
| </div>
| <lims-table :tableData="tableData" :column="columnData"
| @pagination="page" :height="'calc(100vh - 18em)'"
| :page="pagination" :tableLoading="loading"></lims-table>
| <Add ref="communicateModal" @submit="getTableData"></Add>
| </div>
| </template>
| <script>
| import CommunicateAdd from "../components/communicateAdd.vue"
| import limsTable from "@/components/Table/lims-table.vue";
| import {
| deletePersonCommunicationAbility, exportPersonCommunicationAbility,
| personPersonCommunicationAbilityPage
| } from "@/api/cnas/personal/personPersonCommunicationAbilityPage";
|
| export default {
| components: {
| limsTable,
| Add: CommunicateAdd
| },
| props: {
| departId: {
| type: Number,
| default: () => {
| return null;
| }
| },
| isDepartment: {
| type: Boolean,
| default: false
| }
| },
| data() {
| return {
| columnData: [
| {
| label: '沟通人',
| prop: 'userName'
| }, {
| label: '沟通时间',
| prop: 'communicationTime'
| }, {
| label: '沟通地点',
| prop: 'communicationPlace'
| }, {
| label: '沟通内容',
| prop: 'communicationContent'
| }, {
| label: '操作',
| dataType: 'action',
| operation: [
| {
| name: '编辑',
| type: 'text',
| clickFun: (row) => {
| this.openDialog(row, true)
| }
| }, {
| name: '导出',
| type: 'text',
| clickFun: (row) => {
| this.handleDown(row)
| }
| }, {
| name: '删除',
| type: 'text',
| color: '#f56c6c',
| clickFun: (row) => {
| this.delPerson(row.id)
| }
| }
| ]
| },
| ],
| tableData: [],
| pagination: {
| current: 1,
| size: 20,
| total: 0
| },
| loading: false
| }
| },
| mounted() {
| this.getTableData()
| },
| methods: {
| openDialog(row, type=false) {
| this.$refs.communicateModal.openDialog(row, type)
| },
| getTableData() {
| this.loading = true
| const params = this.isDepartment ? {
| departLimsId: this.departId,
| current: this.pagination.current,
| size: this.pagination.size
| } : {
| userId: this.departId,
| current: this.pagination.current,
| size: this.pagination.size
| }
| personPersonCommunicationAbilityPage(params).then(res => {
| this.loading = false
| this.tableData = res.data.records
| this.pagination.total = res.data.total
| }).catch(err => {
| this.loading = false
| })
| },
| page (page) {
| this.pagination.size = page.limit
| this.getTableData()
| },
| /**
| * @desc 删除沟通记录
| */
| delPerson(id) {
| this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| type: 'warning'
| }).then(async () => {
| deletePersonCommunicationAbility({id: id}).then(res => {
| this.$message.success('删除成功!');
| this.getTableData()
| })
| })
| },
| async handleDown(row){
| exportPersonCommunicationAbility({id:row.id}).then(res => {
| const blob = new Blob([res],{ type: 'application/octet-stream' });
| this.$download.saveAs(blob, row.userName+'-沟通记录'+'.docx');
| })
| }
| },
| watch: {
| departId: {
| handler(newId, oldId) {
| if (newId) {
| this.getTableData();
| }
| }
| }
| }
| }
| </script>
| <style scoped>
| </style>
|
|