|
@@ -138,7 +138,7 @@ |
|
@@ -138,7 +138,7 @@ |
|
138
|
</template>
|
138
|
</template>
|
|
139
|
|
139
|
|
|
140
|
<script>
|
140
|
<script>
|
|
141
|
-import { listDept, getDept, delDept, addDept, updateDept } from "@/api/system/dept";
|
141
|
+import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
|
|
142
|
import Treeselect from "@riophae/vue-treeselect";
|
142
|
import Treeselect from "@riophae/vue-treeselect";
|
|
143
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
143
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
144
|
|
144
|
|
|
@@ -220,12 +220,6 @@ export default { |
|
@@ -220,12 +220,6 @@ export default { |
|
220
|
children: node.children
|
220
|
children: node.children
|
|
221
|
};
|
221
|
};
|
|
222
|
},
|
222
|
},
|
|
223
|
- /** 查询部门下拉树结构 */
|
|
|
|
224
|
- getTreeselect() {
|
|
|
|
225
|
- listDept().then(response => {
|
|
|
|
226
|
- this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
227
|
- });
|
|
|
|
228
|
- },
|
|
|
|
229
|
// 字典状态字典翻译
|
223
|
// 字典状态字典翻译
|
|
230
|
statusFormat(row, column) {
|
224
|
statusFormat(row, column) {
|
|
231
|
return this.selectDictLabel(this.statusOptions, row.status);
|
225
|
return this.selectDictLabel(this.statusOptions, row.status);
|
|
@@ -256,22 +250,26 @@ export default { |
|
@@ -256,22 +250,26 @@ export default { |
|
256
|
/** 新增按钮操作 */
|
250
|
/** 新增按钮操作 */
|
|
257
|
handleAdd(row) {
|
251
|
handleAdd(row) {
|
|
258
|
this.reset();
|
252
|
this.reset();
|
|
259
|
- this.getTreeselect();
|
|
|
|
260
|
if (row != undefined) {
|
253
|
if (row != undefined) {
|
|
261
|
this.form.parentId = row.deptId;
|
254
|
this.form.parentId = row.deptId;
|
|
262
|
}
|
255
|
}
|
|
263
|
this.open = true;
|
256
|
this.open = true;
|
|
264
|
this.title = "添加部门";
|
257
|
this.title = "添加部门";
|
|
|
|
258
|
+ listDept().then(response => {
|
|
|
|
259
|
+ this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
260
|
+ });
|
|
265
|
},
|
261
|
},
|
|
266
|
/** 修改按钮操作 */
|
262
|
/** 修改按钮操作 */
|
|
267
|
handleUpdate(row) {
|
263
|
handleUpdate(row) {
|
|
268
|
this.reset();
|
264
|
this.reset();
|
|
269
|
- this.getTreeselect();
|
|
|
|
270
|
getDept(row.deptId).then(response => {
|
265
|
getDept(row.deptId).then(response => {
|
|
271
|
this.form = response.data;
|
266
|
this.form = response.data;
|
|
272
|
this.open = true;
|
267
|
this.open = true;
|
|
273
|
this.title = "修改部门";
|
268
|
this.title = "修改部门";
|
|
274
|
});
|
269
|
});
|
|
|
|
270
|
+ listDeptExcludeChild(row.deptId).then(response => {
|
|
|
|
271
|
+ this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
272
|
+ });
|
|
275
|
},
|
273
|
},
|
|
276
|
/** 提交按钮 */
|
274
|
/** 提交按钮 */
|
|
277
|
submitForm: function() {
|
275
|
submitForm: function() {
|