feat:工单池选择工单类型
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
parent
84140dc7e3
commit
01a71ea4c3
@ -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
|
||||
|
@ -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,
|
||||
},
|
||||
{
|
||||
|
@ -152,8 +152,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '工单类型',
|
||||
fieldName: 'type',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {},
|
||||
component: 'TreeSelect',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user