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 website from '@/config/website';
import { useRouter } from 'vue-router';
import { getDeptTree } from '@/api/system/dept';
const router = useRouter()
export default {
@ -129,19 +130,36 @@ export default {
valueFormat: 'YYYY-MM-DD', // 👈
dataType: 'string' //
},
// {
// label: '',
// prop: 'deptId',
// search: true,
// type: 'tree',
// dicData: [], //
// props: {
// label: 'label',
// value: 'id',
// children: 'children'
// },
// // deptName row.deptName
// slot: true
// },
{
label: '接收部门',
prop: 'deptId',
dicData: [],
search: true,
type: 'tree',
dicData: [], //
props: {
label: 'label',
value: 'id',
children: 'children'
label: 'title',
},
// deptName row.deptName
slot: true
rules: [
{
required: false,
message: '请选择接收部门',
trigger: 'click',
},
],
},
{
label: '移交清单',
@ -254,15 +272,9 @@ export default {
});
},
loadDeptOptions() {
getDeptSelectApi().then(res => {
this.treeDataList = this.convertToVueTree(res.data.data);
// deptId dicData
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);
getDeptTree().then(res => {
const column = this.findObject(this.option.column, 'deptId');
column.dicData = res.data.data;
});
},
// -