feat:工单池选择工单类型
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
2025-08-06 14:33:02 +08:00
parent 84140dc7e3
commit 01a71ea4c3
4 changed files with 49 additions and 28 deletions

View File

@@ -152,8 +152,7 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '工单类型',
fieldName: 'type',
component: 'ApiSelect',
componentProps: {},
component: 'TreeSelect',
rules: 'selectRequired',
},
{

View File

@@ -14,9 +14,7 @@ import {
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
import {modalSchema} from './data';
import {personList} from "#/api/property/resident/person";
import {renderDictValue} from "#/utils/render";
import {workOrdersTypeList} from "#/api/property/businessManagement/workOrdersType";
import {workOrdersTypeTree} from "#/api/property/businessManagement/workOrdersType";
const emit = defineEmits<{ reload: [] }>();
@@ -107,23 +105,28 @@ async function handleClosed() {
}
async function queryWorkOrdersType() {
let params = {
pageSize: 1000,
pageNum: 1
}
const res = await tree(params)
const options = res.rows.map((item) => ({
label: item.orderTypeName,
value: item.id,
}));
formApi.updateSchema([{
componentProps: () => ({
options: options,
filterOption: filterOption,
showSearch:true,
}),
fieldName: 'type',
}])
const options = await workOrdersTypeTree()
formApi.updateSchema([
{
componentProps: () => ({
class: 'w-full',
fieldNames: {
key: 'id',
label: 'orderTypeName',
value: 'id',
children: 'children',
},
placeholder: '请选择工单类型',
showSearch: true,
treeData: options,
treeDefaultExpandAll: true,
treeLine: { showLeafIcon: false },
treeNodeFilterProp: 'orderTypeName',
treeNodeLabelProp: 'orderTypeName',
}),
fieldName: 'type',
},
]);
}
const filterOption = (input: string, option: any) => {