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

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

View File

@ -12,10 +12,23 @@ import { requestClient } from '#/api/request';
export function workOrdersTypeList(params?: WorkOrdersTypeQuery) {
return requestClient.get<PageResult<WorkOrdersTypeVO>>('/property/workOrdersType/list', { params });
}
/**
*
* @param params
* @returns
*/
export function workOrdersTypeListAll(params?: WorkOrdersTypeQuery) {
return requestClient.get<WorkOrdersTypeVO[]>('/property/workOrdersType/queryList', { params });
}
/**
*
* @param params
*/
export function workOrdersTypeTree(params?: WorkOrdersTypeQuery) {
return requestClient.get<WorkOrdersTypeVO[]>('/property/workOrdersType/typeTree', { params });
}
/**
*
* @param params

View File

@ -1,6 +1,7 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import {renderDict} from "#/utils/render";
export const querySchema: FormSchemaGetter = () => [
@ -69,19 +70,24 @@ export const querySchema: FormSchemaGetter = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '仓库id',
field: 'depotId',
title: '仓库',
field: 'depotName',
minWidth:150,
},
{
title: '资产id',
field: 'assetId',
title: '资产',
field: 'assetName',
width:180,
},
{
title: '流转类型',
field: 'type',
width:120,
slots:{
default:({row})=>{
return renderDict(row.type,'wy_cklzlx')
}
}
},
{
@ -95,8 +101,8 @@ export const columns: VxeGridProps['columns'] = [
width:150,
},
{
title: '操作人id',
field: 'userId',
title: '操作人',
field: 'userName',
width:150,
},
{

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([{
const options = await workOrdersTypeTree()
formApi.updateSchema([
{
componentProps: () => ({
options: options,
filterOption: filterOption,
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) => {