|
|
@@ -3,291 +3,277 @@
|
|
3
|
3
|
<el-row :gutter="24">
|
|
4
|
4
|
<el-col :span="6">
|
|
5
|
5
|
<el-alert :closable="false" title="部门列表" type="success" />
|
|
6
|
|
- <el-input v-model="filterText" placeholder="请输入部门名称" class="filter-item" style="margin-top: 10px;" size="small"
|
|
|
6
|
+ <el-input
|
|
|
7
|
+ v-model="filterText"
|
|
|
8
|
+ placeholder="请输入部门名称"
|
|
|
9
|
+ class="filter-item"
|
|
|
10
|
+ style="margin-top: 10px;"
|
|
|
11
|
+ size="small"
|
|
7
|
12
|
clearable />
|
|
8
|
|
- <el-tree ref="treeRef" :props="defaultProps" :data="treelists" node-key="id" :highlight-current='true'
|
|
9
|
|
- :default-expand-all='false' @node-click="handleNodeClick" :filter-node-method="filterNode" />
|
|
|
13
|
+ <el-tree
|
|
|
14
|
+ ref="treeRef"
|
|
|
15
|
+ :props="defaultProps"
|
|
|
16
|
+ :data="treelists"
|
|
|
17
|
+ :highlight-current="true"
|
|
|
18
|
+ :default-expand-all="false"
|
|
|
19
|
+ :filter-node-method="filterNode"
|
|
|
20
|
+ node-key="id"
|
|
|
21
|
+ @node-click="handleNodeClick" />
|
|
10
|
22
|
</el-col>
|
|
11
|
23
|
<el-col :span="18">
|
|
12
|
24
|
<el-alert :closable="false" title="部门信息" type="success" style="margin-bottom: 5px;" />
|
|
13
|
|
- <table class="tabdept" cellspacing="0" cellpadding="0" v-if="selectdeptid&&selectpid!='-1'">
|
|
|
25
|
+ <table v-if="clickType !== 1" class="tabdept" cellspacing="0" cellpadding="0">
|
|
14
|
26
|
<tr>
|
|
15
|
27
|
<th>部门:</th>
|
|
16
|
|
- <td>{{tabdata.F_DeptName}}</td>
|
|
|
28
|
+ <td>{{ tabdata.F_DeptName }}</td>
|
|
17
|
29
|
<th>编码:</th>
|
|
18
|
|
- <td>{{tabdata.F_DeptCode}}</td>
|
|
|
30
|
+ <td>{{ tabdata.F_DeptCode }}</td>
|
|
19
|
31
|
<th>办公电话:</th>
|
|
20
|
|
- <td>{{tabdata.F_OfficeTelephone}}</td>
|
|
|
32
|
+ <td>{{ tabdata.F_OfficeTelephone }}</td>
|
|
21
|
33
|
</tr>
|
|
22
|
34
|
<tr>
|
|
23
|
35
|
<th>位置:</th>
|
|
24
|
|
- <td colspan="3">{{tabdata.F_Location}}</td>
|
|
|
36
|
+ <td colspan="3">{{ tabdata.F_Location }}</td>
|
|
25
|
37
|
<th>排序:</th>
|
|
26
|
|
- <td>{{tabdata.F_Sort}}</td>
|
|
|
38
|
+ <td>{{ tabdata.F_Sort }}</td>
|
|
27
|
39
|
</tr>
|
|
28
|
40
|
</table>
|
|
29
|
41
|
<el-button v-permission="'add_department'" size="medium" type="primary" @click="btn_add()">增加子部门</el-button>
|
|
30
|
|
- <el-button v-permission="'edit_department'" v-if="selectdeptid&&selectpid!='-1'" size="medium" type="primary" @click="btn_edit()">编辑</el-button>
|
|
31
|
|
- <el-button v-permission="'delete_department'" v-if="selectdeptid&&selectpid!='-1'" size="medium" type="danger" @click="btn_delete()">删除</el-button>
|
|
|
42
|
+ <el-button v-permission="'edit_department'" v-if="clickType !== 1" size="medium" type="primary" @click="btn_edit()">编辑</el-button>
|
|
|
43
|
+ <el-button v-permission="'delete_department'" v-if="clickType !== 1" size="medium" type="danger" @click="btn_delete()">删除</el-button>
|
|
32
|
44
|
</el-col>
|
|
33
|
45
|
</el-row>
|
|
34
|
46
|
</div>
|
|
35
|
47
|
</template>
|
|
36
|
48
|
<script>
|
|
37
|
|
- import {
|
|
38
|
|
- getScoreList,
|
|
39
|
|
- deleteType,
|
|
40
|
|
- deleteScore,
|
|
41
|
|
- getDepartmentList,
|
|
42
|
|
- getTypeDetail
|
|
43
|
|
- } from '@/api/systemSetup/roleSetting/department'
|
|
44
|
|
- import addOrEditDepartment from './component/addOrEdit'
|
|
45
|
|
- import {
|
|
46
|
|
- getListyqlistall
|
|
47
|
|
- } from '@/api/faultRepair/faultRepair'
|
|
48
|
|
- import {
|
|
49
|
|
- getDeptTree
|
|
50
|
|
- } from '@/api/systemSetup/roleSetting/userManage'
|
|
51
|
|
- import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
|
|
52
|
|
- export default {
|
|
53
|
|
- name: 'Department',
|
|
54
|
|
- components: {
|
|
55
|
|
- Pagination
|
|
|
49
|
+import {
|
|
|
50
|
+ deleteType,
|
|
|
51
|
+ getDepartmentList,
|
|
|
52
|
+ getTypeDetail
|
|
|
53
|
+} from '@/api/systemSetup/roleSetting/department'
|
|
|
54
|
+import addOrEditDepartment from './component/addOrEdit'
|
|
|
55
|
+
|
|
|
56
|
+import {
|
|
|
57
|
+ getDeptTree
|
|
|
58
|
+} from '@/api/systemSetup/roleSetting/userManage'
|
|
|
59
|
+import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
|
|
|
60
|
+export default {
|
|
|
61
|
+ name: 'Department',
|
|
|
62
|
+ components: {
|
|
|
63
|
+ Pagination
|
|
|
64
|
+ },
|
|
|
65
|
+ filters: {
|
|
|
66
|
+ judgmentLockName(status) {
|
|
|
67
|
+ const statusMap = {
|
|
|
68
|
+ 0: '未锁定',
|
|
|
69
|
+ 1: '锁定'
|
|
|
70
|
+ }
|
|
|
71
|
+ return statusMap[status]
|
|
56
|
72
|
},
|
|
57
|
|
- filters: {
|
|
58
|
|
- judgmentLockName(status) {
|
|
59
|
|
- const statusMap = {
|
|
60
|
|
- 0: '未锁定',
|
|
61
|
|
- 1: '锁定'
|
|
62
|
|
- }
|
|
63
|
|
- return statusMap[status]
|
|
|
73
|
+ judgmentTargetMoney(status) {
|
|
|
74
|
+ if (status === 0) {
|
|
|
75
|
+ return ''
|
|
|
76
|
+ } else {
|
|
|
77
|
+ return status
|
|
|
78
|
+ }
|
|
|
79
|
+ }
|
|
|
80
|
+ },
|
|
|
81
|
+ data() {
|
|
|
82
|
+ return {
|
|
|
83
|
+ ruleForm: {
|
|
|
84
|
+ keyword: '',
|
|
|
85
|
+ hosid: ''
|
|
64
|
86
|
},
|
|
65
|
|
- judgmentTargetMoney(status) {
|
|
66
|
|
- if (status === 0) {
|
|
67
|
|
- return ''
|
|
68
|
|
- } else {
|
|
69
|
|
- return status
|
|
70
|
|
- }
|
|
|
87
|
+ filterText: '',
|
|
|
88
|
+ teamkeyword: '',
|
|
|
89
|
+ clickId: 1,
|
|
|
90
|
+ clickType: 1,
|
|
|
91
|
+ // selectedId: '',
|
|
|
92
|
+ // addParentid: '',
|
|
|
93
|
+ listGrade: 1,
|
|
|
94
|
+ listPid: 0,
|
|
|
95
|
+ // addPid: 0,
|
|
|
96
|
+ depId: 0, // 最后一级部门id
|
|
|
97
|
+ loading: false,
|
|
|
98
|
+ hospitals: [], // 院区
|
|
|
99
|
+ pageParams: {
|
|
|
100
|
+ pageindex: 1, // 当前第几页
|
|
|
101
|
+ pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
|
|
|
102
|
+ total: 0 // 总共多少数据
|
|
|
103
|
+ },
|
|
|
104
|
+ pageParamsSecond: {
|
|
|
105
|
+ pageindex: 1, // 当前第几页
|
|
|
106
|
+ pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
|
|
|
107
|
+ total: 0 // 总共多少数据
|
|
|
108
|
+ },
|
|
|
109
|
+ pageParamsThird: {
|
|
|
110
|
+ pageindex: 1, // 当前第几页
|
|
|
111
|
+ pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
|
|
|
112
|
+ total: 0 // 总共多少数据
|
|
|
113
|
+ },
|
|
|
114
|
+ defaultProps: {
|
|
|
115
|
+ children: 'children',
|
|
|
116
|
+ label: 'text',
|
|
|
117
|
+ value: 'id'
|
|
|
118
|
+ },
|
|
|
119
|
+ tabdata: {
|
|
|
120
|
+ name: '总部/综合保障中心',
|
|
|
121
|
+ code: 'ZHBZZX',
|
|
|
122
|
+ phone: '0371-888888888',
|
|
|
123
|
+ address: '东区一楼501',
|
|
|
124
|
+ sort: '9'
|
|
|
125
|
+ },
|
|
|
126
|
+ selectdeptid: '',
|
|
|
127
|
+ selectpid: '',
|
|
|
128
|
+ treelists: [], // 菜单树数据
|
|
|
129
|
+ dataLists: [], // 中心管理列表数据
|
|
|
130
|
+ teamLists: [], // 小组列表数据
|
|
|
131
|
+ departmentDataLists: [] // 部门列表数据
|
|
|
132
|
+ }
|
|
|
133
|
+ },
|
|
|
134
|
+ watch: {
|
|
|
135
|
+ filterText(val) {
|
|
|
136
|
+ this.$refs.treeRef.filter(val)
|
|
|
137
|
+ }
|
|
|
138
|
+ },
|
|
|
139
|
+ created() {
|
|
|
140
|
+ this.getTreeList()
|
|
|
141
|
+ document.onkeyup = (e) => {
|
|
|
142
|
+ if (e.keyCode === 13) {
|
|
|
143
|
+ // this.getdepts()
|
|
71
|
144
|
}
|
|
|
145
|
+ }
|
|
|
146
|
+ },
|
|
|
147
|
+ methods: {
|
|
|
148
|
+ filterNode(value, data) {
|
|
|
149
|
+ if (!value) return true
|
|
|
150
|
+ return data.text.indexOf(value) !== -1
|
|
72
|
151
|
},
|
|
73
|
|
- data() {
|
|
74
|
|
- return {
|
|
75
|
|
- ruleForm: {
|
|
76
|
|
- keyword: '',
|
|
77
|
|
- hosid: ''
|
|
78
|
|
- },
|
|
79
|
|
- filterText:'',
|
|
80
|
|
- teamkeyword: '',
|
|
81
|
|
- selectedId: '',
|
|
82
|
|
- addParentid:'',
|
|
83
|
|
- listGrade: 1,
|
|
84
|
|
- listPid: 0,
|
|
85
|
|
- addPid: 0,
|
|
86
|
|
- depId: 0, // 最后一级部门id
|
|
87
|
|
- loading: false,
|
|
88
|
|
- clickId: '', // 中心点击id
|
|
89
|
|
- hospitals: [], // 院区
|
|
90
|
|
- pageParams: {
|
|
91
|
|
- pageindex: 1, // 当前第几页
|
|
92
|
|
- pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
|
|
93
|
|
- total: 0 // 总共多少数据
|
|
94
|
|
- },
|
|
95
|
|
- pageParamsSecond: {
|
|
96
|
|
- pageindex: 1, // 当前第几页
|
|
97
|
|
- pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
|
|
98
|
|
- total: 0 // 总共多少数据
|
|
99
|
|
- },
|
|
100
|
|
- pageParamsThird: {
|
|
101
|
|
- pageindex: 1, // 当前第几页
|
|
102
|
|
- pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
|
|
103
|
|
- total: 0 // 总共多少数据
|
|
104
|
|
- },
|
|
105
|
|
- defaultProps: {
|
|
106
|
|
- children: 'children',
|
|
107
|
|
- label: 'text',
|
|
108
|
|
- value: 'id'
|
|
109
|
|
- },
|
|
110
|
|
- tabdata: {
|
|
111
|
|
- name: '总部/综合保障中心',
|
|
112
|
|
- code: 'ZHBZZX',
|
|
113
|
|
- phone: '0371-888888888',
|
|
114
|
|
- address: '东区一楼501',
|
|
115
|
|
- sort: '9'
|
|
116
|
|
- },
|
|
117
|
|
- selectdeptid: '',
|
|
118
|
|
- selectpid:'',
|
|
119
|
|
- treelists: [], // 菜单树数据
|
|
120
|
|
- dataLists: [], // 中心管理列表数据
|
|
121
|
|
- teamLists: [], // 小组列表数据
|
|
122
|
|
- departmentDataLists: [] // 部门列表数据
|
|
|
152
|
+ // 部门分类
|
|
|
153
|
+ getDepList(listPid) {
|
|
|
154
|
+ if (listPid != null) {
|
|
|
155
|
+ this.depId = listPid
|
|
|
156
|
+ this.listGrade--
|
|
123
|
157
|
}
|
|
|
158
|
+ this.loading = true
|
|
|
159
|
+ return new Promise((resolve) => {
|
|
|
160
|
+ const params = {
|
|
|
161
|
+ pageindex: this.pageParams.pageindex, // 第几页
|
|
|
162
|
+ pagesize: this.pageParams.pagesize, // 每页几条信息
|
|
|
163
|
+ pid: this.depId,
|
|
|
164
|
+ keyword: this.ruleForm.keyword.trim(),
|
|
|
165
|
+ hosid: this.ruleForm.hosid
|
|
|
166
|
+ }
|
|
|
167
|
+ getDepartmentList(params)
|
|
|
168
|
+ .then((response) => {
|
|
|
169
|
+ this.loading = false
|
|
|
170
|
+ this.departmentDataLists = response.rows
|
|
|
171
|
+ this.pageParams.total = response.total
|
|
|
172
|
+ })
|
|
|
173
|
+ .catch((result) => {
|
|
|
174
|
+ this.loading = false
|
|
|
175
|
+ this.departmentDataLists = []
|
|
|
176
|
+ })
|
|
|
177
|
+ resolve()
|
|
|
178
|
+ })
|
|
|
179
|
+ },
|
|
|
180
|
+ getdepts() {
|
|
|
181
|
+
|
|
124
|
182
|
},
|
|
125
|
|
- watch: {
|
|
126
|
|
- filterText(val) {
|
|
127
|
|
- this.$refs.treeRef.filter(val);
|
|
|
183
|
+ // 添加
|
|
|
184
|
+ btn_add() {
|
|
|
185
|
+ if (this.clickId === '') {
|
|
|
186
|
+ this.$message.warning('请选择父级部门')
|
|
|
187
|
+ return
|
|
128
|
188
|
}
|
|
|
189
|
+ this.$layer.iframe({
|
|
|
190
|
+ content: {
|
|
|
191
|
+ content: addOrEditDepartment, // 传递的组件对象
|
|
|
192
|
+ parent: this, // 当前的vue对象
|
|
|
193
|
+ data: {
|
|
|
194
|
+ clickId: this.clickId,
|
|
|
195
|
+ clickType: this.clickType
|
|
|
196
|
+ } // props//该方法会自动添加一个key为layerid的值, 该值为创建层的id, 可以直接使用
|
|
|
197
|
+ },
|
|
|
198
|
+ area: ['50%', '55%'],
|
|
|
199
|
+ shadeClose: false,
|
|
|
200
|
+ title: '添加部门分类'
|
|
|
201
|
+ })
|
|
129
|
202
|
},
|
|
130
|
|
- created() {
|
|
131
|
|
- this.getTreeList()
|
|
132
|
|
- document.onkeyup = (e) => {
|
|
133
|
|
- if (e.keyCode === 13) {
|
|
134
|
|
- // this.getdepts()
|
|
135
|
|
- }
|
|
|
203
|
+
|
|
|
204
|
+ btn_edit() {
|
|
|
205
|
+ if (this.clickType === 1 || !this.clickId) {
|
|
|
206
|
+ this.$message.warning('请选择部门进行编辑')
|
|
|
207
|
+ return
|
|
136
|
208
|
}
|
|
137
|
|
- // getTypeDetail(1).then((response) => {
|
|
138
|
|
- // if (response.state.toLowerCase() === 'success') {
|
|
139
|
|
- // this.tabdata = response.data
|
|
140
|
|
- // }
|
|
141
|
|
- // })
|
|
|
209
|
+ this.$layer.iframe({
|
|
|
210
|
+ content: {
|
|
|
211
|
+ content: addOrEditDepartment, // 传递的组件对象
|
|
|
212
|
+ parent: this, // 当前的vue对象
|
|
|
213
|
+ data: {
|
|
|
214
|
+ rowid: this.clickId,
|
|
|
215
|
+ clickId: this.clickId,
|
|
|
216
|
+ clickType: this.clickType
|
|
|
217
|
+ } // props//该方法会自动添加一个key为layerid的值, 该值为创建层的id, 可以直接使用
|
|
|
218
|
+ },
|
|
|
219
|
+ area: ['50%', '55%'],
|
|
|
220
|
+ shadeClose: false,
|
|
|
221
|
+ title: '编辑部门分类'
|
|
|
222
|
+ })
|
|
|
223
|
+ this.F_DeptId = ''
|
|
142
|
224
|
},
|
|
143
|
|
- methods: {
|
|
144
|
|
- filterNode(value, data) {
|
|
145
|
|
- if (!value) return true;
|
|
146
|
|
- return data.text.indexOf(value) !== -1;
|
|
147
|
|
- },
|
|
148
|
|
- // 部门分类
|
|
149
|
|
- getDepList(listPid) {
|
|
150
|
|
- if (listPid != null) {
|
|
151
|
|
- this.depId = listPid
|
|
152
|
|
- this.listGrade--
|
|
153
|
|
- }
|
|
154
|
|
- this.loading = true
|
|
155
|
|
- return new Promise((resolve) => {
|
|
156
|
|
- const params = {
|
|
157
|
|
- pageindex: this.pageParams.pageindex, // 第几页
|
|
158
|
|
- pagesize: this.pageParams.pagesize, // 每页几条信息
|
|
159
|
|
- pid: this.depId,
|
|
160
|
|
- keyword: this.ruleForm.keyword.trim(),
|
|
161
|
|
- hosid: this.ruleForm.hosid
|
|
162
|
|
- }
|
|
163
|
|
- getDepartmentList(params)
|
|
164
|
|
- .then((response) => {
|
|
165
|
|
- this.loading = false
|
|
166
|
|
- this.departmentDataLists = response.rows
|
|
167
|
|
- this.pageParams.total = response.total
|
|
168
|
|
- })
|
|
169
|
|
- .catch((result) => {
|
|
170
|
|
- this.loading = false
|
|
171
|
|
- this.departmentDataLists = []
|
|
172
|
|
- })
|
|
173
|
|
- resolve()
|
|
|
225
|
+ // 删除
|
|
|
226
|
+ btn_delete() {
|
|
|
227
|
+ this.$confirm('您确定要删除吗?', '提示', {
|
|
|
228
|
+ confirmButtonText: '确定',
|
|
|
229
|
+ cancelButtonText: '取消',
|
|
|
230
|
+ type: 'warning'
|
|
|
231
|
+ })
|
|
|
232
|
+ .then(() => {
|
|
|
233
|
+ deleteType(this.clickId).then((response) => {
|
|
|
234
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
235
|
+ this.$message.success('删除成功!')
|
|
|
236
|
+ this.tabdata = {}
|
|
|
237
|
+ this.getTreeList()
|
|
|
238
|
+ }
|
|
|
239
|
+ })
|
|
174
|
240
|
})
|
|
175
|
|
- },
|
|
176
|
|
- getdepts() {
|
|
177
|
|
-
|
|
178
|
|
- },
|
|
179
|
|
- // 添加
|
|
180
|
|
- btn_add() {
|
|
181
|
|
- if(this.selectdeptid==''){
|
|
182
|
|
- this.$message.warning('请选择一行添加子部门')
|
|
183
|
|
- return;
|
|
184
|
|
- }
|
|
185
|
|
- this.$layer.iframe({
|
|
186
|
|
- content: {
|
|
187
|
|
- content: addOrEditDepartment, // 传递的组件对象
|
|
188
|
|
- parent: this, // 当前的vue对象
|
|
189
|
|
- data: {
|
|
190
|
|
- addPid: this.selectdeptid.toString(),
|
|
191
|
|
- addParentid:this.addParentid.toString()
|
|
192
|
|
- } // props//该方法会自动添加一个key为layerid的值, 该值为创建层的id, 可以直接使用
|
|
193
|
|
- },
|
|
194
|
|
- area: ['50%', '55%'],
|
|
195
|
|
- shadeClose: false,
|
|
196
|
|
- title: '添加部门分类'
|
|
|
241
|
+ .catch(() => {
|
|
|
242
|
+ this.$message.info('已取消删除')
|
|
197
|
243
|
})
|
|
198
|
|
- },
|
|
199
|
|
-
|
|
200
|
|
- btn_edit() {
|
|
201
|
|
- // this.F_DeptId = F_DeptId
|
|
202
|
|
- // if (F_DeptId === '') {
|
|
203
|
|
- // this.$message({
|
|
204
|
|
- // message: '请选择一行编辑!',
|
|
205
|
|
- // type: 'warning'
|
|
206
|
|
- // })
|
|
207
|
|
- // return
|
|
208
|
|
- // }
|
|
209
|
|
- if(this.selectdeptid==''||this.selectpid=='-1'){
|
|
210
|
|
- this.$message.warning('请选择部门进行编辑')
|
|
211
|
|
- return;
|
|
212
|
|
- }
|
|
213
|
|
- this.$layer.iframe({
|
|
214
|
|
- content: {
|
|
215
|
|
- content: addOrEditDepartment, // 传递的组件对象
|
|
216
|
|
- parent: this, // 当前的vue对象
|
|
217
|
|
- data: {
|
|
218
|
|
- rowid: this.selectdeptid.toString()
|
|
219
|
|
- } // props//该方法会自动添加一个key为layerid的值, 该值为创建层的id, 可以直接使用
|
|
220
|
|
- },
|
|
221
|
|
- area: ['50%', '55%'],
|
|
222
|
|
- shadeClose: false,
|
|
223
|
|
- title: '编辑部门分类'
|
|
|
244
|
+ },
|
|
|
245
|
+ // 树
|
|
|
246
|
+ getTreeList() {
|
|
|
247
|
+ return new Promise((resolve) => {
|
|
|
248
|
+ getDeptTree(this.parentid).then((response) => {
|
|
|
249
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
250
|
+ this.treelists = response.data
|
|
|
251
|
+ }
|
|
224
|
252
|
})
|
|
225
|
|
- this.F_DeptId = ''
|
|
226
|
|
- },
|
|
227
|
|
- // // 删除
|
|
228
|
|
- // btn_delete() {
|
|
229
|
|
- // this.F_DeptId = F_DeptId
|
|
230
|
|
- // if (this.F_DeptId === '') {
|
|
231
|
|
- // this.$message({
|
|
232
|
|
- // message: '没有可删除的选项!',
|
|
233
|
|
- // type: 'warning'
|
|
234
|
|
- // })
|
|
235
|
|
- // } else {
|
|
236
|
|
- // const id = F_DeptId
|
|
237
|
|
- // this.deleteType(F_DeptId)
|
|
238
|
|
- // }
|
|
239
|
|
- // this.F_DeptId = ''
|
|
240
|
|
- // },
|
|
241
|
|
- // 删除
|
|
242
|
|
- btn_delete() {
|
|
243
|
|
- this.$confirm('您确定要删除吗?', '提示', {
|
|
244
|
|
- confirmButtonText: '确定',
|
|
245
|
|
- cancelButtonText: '取消',
|
|
246
|
|
- type: 'warning'
|
|
247
|
|
- })
|
|
248
|
|
- .then(() => {
|
|
249
|
|
- deleteType(this.selectdeptid).then((response) => {
|
|
250
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
251
|
|
- this.$message.success('删除成功!')
|
|
252
|
|
- this.tabdata = {}
|
|
253
|
|
- this.getTreeList()
|
|
254
|
|
- }
|
|
255
|
|
- })
|
|
256
|
|
- })
|
|
257
|
|
- .catch(() => {
|
|
258
|
|
- this.$message.info('已取消删除')
|
|
259
|
|
- })
|
|
260
|
|
- },
|
|
261
|
|
- //树
|
|
262
|
|
- getTreeList() {
|
|
|
253
|
+ resolve()
|
|
|
254
|
+ })
|
|
|
255
|
+ },
|
|
|
256
|
+ handleNodeClick(data) {
|
|
|
257
|
+ console.log(data)
|
|
|
258
|
+ // this.selectdeptid = data.id
|
|
|
259
|
+ // this.selectpid = data.parentid
|
|
|
260
|
+ // this.addParentid = data.parentid
|
|
|
261
|
+ this.clickId = data.id
|
|
|
262
|
+ this.clickType = data.TypeId
|
|
|
263
|
+ if (this.clickType !== 1) {
|
|
|
264
|
+ // this.selectdeptid = data.id
|
|
263
|
265
|
return new Promise((resolve) => {
|
|
264
|
|
- getDeptTree(this.parentid).then((response) => {
|
|
|
266
|
+ getTypeDetail(this.clickId).then((response) => {
|
|
265
|
267
|
if (response.state.toLowerCase() === 'success') {
|
|
266
|
|
- this.treelists = response.data
|
|
|
268
|
+ this.tabdata = response.data
|
|
267
|
269
|
}
|
|
268
|
270
|
})
|
|
269
|
271
|
resolve()
|
|
270
|
272
|
})
|
|
271
|
|
- },
|
|
272
|
|
- handleNodeClick(data) {
|
|
273
|
|
- console.log(data)
|
|
274
|
|
- this.selectdeptid = data.id
|
|
275
|
|
- this.selectpid = data.parentid
|
|
276
|
|
- this.addParentid = data.parentid
|
|
277
|
|
- if (data.TypeId != 1) {
|
|
278
|
|
- this.selectdeptid = data.id
|
|
279
|
|
- return new Promise((resolve) => {
|
|
280
|
|
- getTypeDetail(data.id).then((response) => {
|
|
281
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
282
|
|
- this.tabdata = response.data
|
|
283
|
|
- }
|
|
284
|
|
- })
|
|
285
|
|
- resolve()
|
|
286
|
|
- })
|
|
287
|
|
- }
|
|
288
|
273
|
}
|
|
289
|
274
|
}
|
|
290
|
275
|
}
|
|
|
276
|
+}
|
|
291
|
277
|
</script>
|
|
292
|
278
|
<style lang="scss" scoped>
|
|
293
|
279
|
.search {
|