flat: 增加 所属机构

This commit is contained in:
Apcallover
2024-04-17 16:59:33 +08:00
parent 0fb5b70df5
commit 9cb647d53e
8 changed files with 353 additions and 179 deletions

View File

@@ -19,7 +19,8 @@
</template>
<script>
import { transferDept } from "@/api/tenant/talents";
import {getDeptMyTree, transferDept} from "@/api/tenant/talents";
export default {
props: {
ids: String,
@@ -30,12 +31,32 @@ export default {
groupId: "",
box: false,
form: {},
option: {
deptId: '',
depTree: []
};
},
computed: {
option() {
return {
menuPosition: "right",
menuBtn: true,
submitBtn: true,
emptyBtn: false,
column: [
{
label: "所属机构",
prop: "deptId",
type: "tree",
multiple: false,
dicData: this.depTree,
props: {
label: "title",
},
checkStrictly: true,
slot: true,
span: 24,
change: this.deptChange
},
{
label: "所属分组",
prop: "groupId",
@@ -62,11 +83,28 @@ export default {
placeholder: "请选择分组",
},
],
},
};
}
}
},
created() {
this.getDept()
},
computed: {},
methods: {
deptChange({value, column}) {
this.deptId = value
console.log(value)
},
async getDept() {
let params = {
tenantId: '000000'
}
let resData = await getDeptMyTree(params)
if (resData.data.code === 200) {
this.depTree = resData.data.data
console.log(this.depTree)
}
},
closed() {
this.form = {};
if (this.$refs.groups) {
@@ -76,7 +114,7 @@ export default {
}
},
openDialog() {
this.title = "转移分组";
this.title = "转移推送";
this.box = true;
if (this.$refs.groups) {
this.$refs.groups.init();
@@ -86,7 +124,7 @@ export default {
},
handleSubmit(form, done) {
//提交转移分组接口
transferDept(this.form.groupId, this.ids).then(
transferDept(this.form.groupId, this.ids, this.deptId).then(
() => {
this.box = false;
this.$message({