This commit is contained in:
liang.chao 2025-12-01 16:13:36 +08:00
parent 3cb13ef70d
commit 95d0223133
1 changed files with 27 additions and 15 deletions

View File

@ -76,6 +76,7 @@ import { getDeptSelectApi } from '@/api/select';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import website from '@/config/website'; import website from '@/config/website';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { getDeptTree } from '@/api/system/dept';
const router = useRouter() const router = useRouter()
export default { export default {
@ -129,19 +130,36 @@ export default {
valueFormat: 'YYYY-MM-DD', // 👈 valueFormat: 'YYYY-MM-DD', // 👈
dataType: 'string' // dataType: 'string' //
}, },
// {
// label: '',
// prop: 'deptId',
// search: true,
// type: 'tree',
// dicData: [], //
// props: {
// label: 'label',
// value: 'id',
// children: 'children'
// },
// // deptName row.deptName
// slot: true
// },
{ {
label: '接收部门', label: '接收部门',
prop: 'deptId', prop: 'deptId',
dicData: [],
search: true, search: true,
type: 'tree', type: 'tree',
dicData: [], //
props: { props: {
label: 'label', label: 'title',
value: 'id',
children: 'children'
}, },
// deptName row.deptName rules: [
slot: true {
required: false,
message: '请选择接收部门',
trigger: 'click',
},
],
}, },
{ {
label: '移交清单', label: '移交清单',
@ -254,15 +272,9 @@ export default {
}); });
}, },
loadDeptOptions() { loadDeptOptions() {
getDeptSelectApi().then(res => { getDeptTree().then(res => {
this.treeDataList = this.convertToVueTree(res.data.data); const column = this.findObject(this.option.column, 'deptId');
// deptId dicData column.dicData = res.data.data;
const deptColumn = this.option.column.find(col => col.prop === 'deptId');
if (deptColumn) {
deptColumn.dicData = this.treeDataList; // Vue 3 Vue 2 this.$set
}
}).catch(err => {
console.error('加载部门列表失败', err);
}); });
}, },
// - // -