|
@@ -23,7 +23,7 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-row style="padidng: 0 0 10px 0">
|
|
|
+ <el-row style="padding: 0 0 3px 0">
|
|
|
<el-col :span="8" style="width: 200px">
|
|
|
<el-input
|
|
|
placeholder="部门名称"
|
|
@@ -32,12 +32,17 @@
|
|
|
>
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" style="width: 210px; padding: 0 0 0 10px">
|
|
|
+ <el-col :span="8" style="width: 250px; padding: 0 0 0 10px">
|
|
|
<el-input
|
|
|
placeholder="员工姓名"
|
|
|
:size="searchSize"
|
|
|
v-model="parmValue.nickname"
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ slot="append"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="searchList"
|
|
|
+ ></el-button>
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
|
|
@@ -47,7 +52,7 @@
|
|
|
type="primary"
|
|
|
:size="searchSize"
|
|
|
style="float: right; margin-left: 5px"
|
|
|
- @click="restSearch"
|
|
|
+ @click="searchList"
|
|
|
>
|
|
|
刷新
|
|
|
</el-button>
|
|
@@ -56,7 +61,16 @@
|
|
|
type="success"
|
|
|
:size="searchSize"
|
|
|
style="float: right"
|
|
|
- @click="addEditFn(0, '0', 1, false, true, {})"
|
|
|
+ @click="
|
|
|
+ addEditFn(
|
|
|
+ 0,
|
|
|
+ parmValue && parmValue.pid!=='' ? parmValue.pid : '0',
|
|
|
+ 1,
|
|
|
+ false,
|
|
|
+ true,
|
|
|
+ {}
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
添加
|
|
|
</el-button>
|
|
@@ -91,6 +105,12 @@
|
|
|
@setUpEdit="setUpEdit"
|
|
|
/>
|
|
|
</el-col>
|
|
|
+ <div
|
|
|
+ class="no-data"
|
|
|
+ v-if="item && item.length === 0 && depart && depart.length === 0"
|
|
|
+ >
|
|
|
+ 暂无数据
|
|
|
+ </div>
|
|
|
</el-row>
|
|
|
|
|
|
<add-edit
|
|
@@ -102,7 +122,7 @@
|
|
|
:form-data="formData"
|
|
|
:type="parmValue.type"
|
|
|
:is-detail="isDetail"
|
|
|
- @refresh="submitRefresh"
|
|
|
+ @refresh="searchList"
|
|
|
@cancel="showModel = false"
|
|
|
/>
|
|
|
</div>
|
|
@@ -177,11 +197,9 @@ export default {
|
|
|
methods: {
|
|
|
restSearch() {
|
|
|
this.parmValue = {
|
|
|
- name: "", // 业务员名字
|
|
|
- username: "", // 账号
|
|
|
- status: "", //
|
|
|
- page: 1, // 页码
|
|
|
- size: 10, // 每页显示条数
|
|
|
+ pid: "", //父级部门ID
|
|
|
+ name: "", // 部门/公司名称
|
|
|
+ nickname: "", // 员工名称
|
|
|
};
|
|
|
this.searchList();
|
|
|
},
|
|
@@ -194,7 +212,15 @@ export default {
|
|
|
await this.searchList();
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ async openChildren(item) {
|
|
|
+ this.parmValue.pid = item.id;
|
|
|
+ let model = {
|
|
|
+ id: item.id,
|
|
|
+ titleName: item.name,
|
|
|
+ };
|
|
|
+ this.titleList.push(model);
|
|
|
+ await this.searchList();
|
|
|
+ },
|
|
|
openModal(id, isDetail, sitem) {
|
|
|
this.showModel = true;
|
|
|
this.modelId = id;
|
|
@@ -213,13 +239,12 @@ export default {
|
|
|
position: "2",
|
|
|
};
|
|
|
let res = await asyncRequest.userp(model);
|
|
|
-
|
|
|
if (res && res.code === 0) {
|
|
|
this.$notify.success({
|
|
|
title: "设置成功!",
|
|
|
message: "",
|
|
|
});
|
|
|
-
|
|
|
+ await this.searchList();
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|
|
|
} else {
|
|
@@ -229,30 +254,16 @@ export default {
|
|
|
this.$message.warning("该账户已是部门负责人!");
|
|
|
}
|
|
|
},
|
|
|
- addEditFn(id, parentIds, level, isDetail, isAdd, formData) {
|
|
|
+ addEditFn(id, pid, level, isDetail, isAdd, formData) {
|
|
|
this.showModel = true;
|
|
|
this.modelId = id;
|
|
|
this.level = level;
|
|
|
- this.parentIds = parentIds;
|
|
|
+ this.parentIds = pid;
|
|
|
this.isDetail = isDetail;
|
|
|
this.isAdd = isAdd;
|
|
|
this.formData = formData;
|
|
|
},
|
|
|
- submitRefresh(id, parentIds, level) {
|
|
|
- console.log(
|
|
|
- `openChildren-id, parentIds, level:${id}-${parentIds}-${level}`
|
|
|
- );
|
|
|
- if (level < 3) {
|
|
|
- this.restSearch();
|
|
|
- }
|
|
|
- // else if (level === 2) {
|
|
|
- // // this.parmValue.parentId = id;
|
|
|
- // this.concatData(id, parentIds, level);
|
|
|
- // }
|
|
|
- else {
|
|
|
- this.getchildList(parentIds);
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
async setstatus(id, parentIds, level, status) {
|
|
|
console.log(
|
|
|
`openChildren-id, parentIds, level:${id}-${parentIds}-${level}-${status}`
|
|
@@ -274,11 +285,7 @@ export default {
|
|
|
title: "修改成功!",
|
|
|
message: "",
|
|
|
});
|
|
|
- if (level === 3) {
|
|
|
- this.getchildList(parentIds);
|
|
|
- } else {
|
|
|
- this.restSearch();
|
|
|
- }
|
|
|
+ await this.searchList();
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|
|
|
} else {
|
|
@@ -310,7 +317,7 @@ export default {
|
|
|
title: "删除成功!",
|
|
|
message: "",
|
|
|
});
|
|
|
- await this.searchList()
|
|
|
+ await this.searchList();
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|
|
|
}
|
|
@@ -320,8 +327,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
async concatData(id, parentIds, level) {
|
|
|
console.log(id, parentIds, level);
|
|
|
this.loading = true;
|
|
@@ -424,6 +429,16 @@ export default {
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.organize {
|
|
|
+ .no-data {
|
|
|
+ padding: 25px 0;
|
|
|
+ text-align: center;
|
|
|
+ color: #909399;
|
|
|
+ margin: 30px 10px 0 10px;
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 1px solid #dfe6ec;
|
|
|
+ // border-right: 1px solid #dfe6ec;
|
|
|
+ // border-bottom: 1px solid #dfe6ec;
|
|
|
+ }
|
|
|
.my-breadcrumb {
|
|
|
.my-breadcrumb-item {
|
|
|
float: left;
|