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:
@@ -42,6 +42,14 @@ export function applicationAdd(data: ApplicationForm) {
|
||||
return requestClient.postWithMsg<void>('/property/application', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 领用审核
|
||||
* @param data
|
||||
*/
|
||||
export function applicationVerified(data: ApplicationForm) {
|
||||
return requestClient.postWithMsg<void>('/property/application/verified', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新资产领用
|
||||
* @param data
|
||||
|
@@ -12,6 +12,9 @@ import { requestClient } from '#/api/request';
|
||||
export function workOrdersTypeList(params?: WorkOrdersTypeQuery) {
|
||||
return requestClient.get<PageResult<WorkOrdersTypeVO>>('/property/workOrdersType/list', { params });
|
||||
}
|
||||
export function workOrdersTypeListAll(params?: WorkOrdersTypeQuery) {
|
||||
return requestClient.get<WorkOrdersTypeVO[]>('/property/workOrdersType/queryList', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工单类型管理列表
|
||||
|
@@ -34,7 +34,9 @@ export interface WorkOrdersTypeVO {
|
||||
/**
|
||||
* 是否支持转单(0支持,1不支持)
|
||||
*/
|
||||
isTransfers: number;
|
||||
isTransfers: string;
|
||||
|
||||
excludeId: string;
|
||||
}
|
||||
|
||||
export interface WorkOrdersTypeForm extends BaseEntity {
|
||||
@@ -72,6 +74,11 @@ export interface WorkOrdersTypeForm extends BaseEntity {
|
||||
* 是否支持转单(0支持,1不支持)
|
||||
*/
|
||||
isTransfers?: number;
|
||||
|
||||
/**
|
||||
* 上级类型id
|
||||
*/
|
||||
parentId?: string;
|
||||
}
|
||||
|
||||
export interface WorkOrdersTypeQuery extends PageQuery {
|
||||
@@ -109,4 +116,9 @@ export interface WorkOrdersTypeQuery extends PageQuery {
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
|
||||
/**
|
||||
* 是否过滤子级
|
||||
*/
|
||||
filterSubNodes?: boolean;
|
||||
}
|
||||
|
@@ -109,6 +109,7 @@ async function setupPackageSelect() {
|
||||
const assets = await assetList({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
params: {stock: 1} //库存不为0
|
||||
});
|
||||
assetsData.value = assets.rows
|
||||
const options = users.rows.map((item) => ({
|
||||
@@ -145,7 +146,8 @@ async function setupPackageSelect() {
|
||||
if (assetInfo) {
|
||||
formApi.updateSchema([{
|
||||
componentProps: {
|
||||
max:assetInfo.stock
|
||||
max: assetInfo.stock,
|
||||
min: 1
|
||||
},
|
||||
fieldName: 'number',
|
||||
}])
|
||||
|
@@ -28,7 +28,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
options:getDictOptions(DictEnum.WY_ZCSHZT)
|
||||
},
|
||||
fieldName: 'state',
|
||||
label: '领用状态',
|
||||
label: '审核状态',
|
||||
},
|
||||
// {
|
||||
// component: 'Input',
|
||||
@@ -78,7 +78,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'applicationTime',
|
||||
},
|
||||
{
|
||||
title: '领用状态',
|
||||
title: '审核状态',
|
||||
field: 'state',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
|
@@ -14,7 +14,7 @@ import {
|
||||
import {
|
||||
applicationExport,
|
||||
applicationList,
|
||||
applicationRemove, applicationUpdate,
|
||||
applicationRemove, applicationVerified,
|
||||
} from '#/api/property/assetManage/application';
|
||||
import type {ApplicationForm} from '#/api/property/assetManage/application/model';
|
||||
import {commonDownloadExcel} from '#/utils/file/download';
|
||||
@@ -98,7 +98,7 @@ async function handleAudit(row: Required<ApplicationForm>, status: number) {
|
||||
info.state = status
|
||||
info.acceptanceTime = new Date()
|
||||
info.acceptanceUserId = userStore.userInfo?.userId
|
||||
await applicationUpdate(info)
|
||||
await applicationVerified(info)
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
|
@@ -4,11 +4,11 @@ import {renderDict} from "#/utils/render";
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'orderTypeNo',
|
||||
label: '工单类型编号',
|
||||
},
|
||||
// {
|
||||
// component: 'Input',
|
||||
// fieldName: 'orderTypeNo',
|
||||
// label: '工单类型编号',
|
||||
// },
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'orderTypeName',
|
||||
@@ -25,7 +25,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
// { type: 'checkbox', width: 60 },
|
||||
// {
|
||||
// title: '工单类型编号',
|
||||
// field: 'orderTypeNo',
|
||||
@@ -33,6 +33,8 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '类型名称',
|
||||
field: 'orderTypeName',
|
||||
treeNode: true,
|
||||
minWidth:180,
|
||||
},
|
||||
{
|
||||
title: '运作模式',
|
||||
@@ -42,15 +44,17 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.operationMode, 'pro_operation_pattern');
|
||||
},
|
||||
},
|
||||
minWidth:'120'
|
||||
width:180,
|
||||
},
|
||||
{
|
||||
title: '排序值',
|
||||
field: 'sort',
|
||||
width:180,
|
||||
},
|
||||
{
|
||||
title: '累计工单数量',
|
||||
field: 'number',
|
||||
width:180,
|
||||
},
|
||||
{
|
||||
title: '是否支持转单',
|
||||
@@ -60,7 +64,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.isTransfers, 'support_transferring_orders');
|
||||
},
|
||||
},
|
||||
minWidth:'120'
|
||||
width:180,
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@@ -87,6 +91,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '父级类型',
|
||||
fieldName: 'parentId',
|
||||
component: 'Select',
|
||||
},
|
||||
{
|
||||
label: '运作模式',
|
||||
fieldName: 'operationMode',
|
||||
|
@@ -8,13 +8,14 @@ import {
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
import {
|
||||
workOrdersTypeList,
|
||||
workOrdersTypeListAll,
|
||||
workOrdersTypeRemove,
|
||||
} from '#/api/property/businessManagement/workOrdersType';
|
||||
import type { WorkOrdersTypeForm } from '#/api/property/businessManagement/workOrdersType/model';
|
||||
import workOrdersTypeModal from './workOrdersType-modal.vue';
|
||||
import workOrdersTypeDetail from './workOrdersType-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {ref} from "vue";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -39,21 +40,27 @@ const gridOptions: VxeGridProps = {
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
pagerConfig: {
|
||||
enabled:false,
|
||||
},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await workOrdersTypeList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
query: async (_, formValues = {}) => {
|
||||
const resp = await workOrdersTypeListAll({
|
||||
...formValues,
|
||||
});
|
||||
return { rows: resp };
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
treeConfig: {
|
||||
parentField: 'parentId',
|
||||
rowField: 'id',
|
||||
transform: true,
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-workOrdersType-index'
|
||||
};
|
||||
@@ -111,14 +118,14 @@ function handleMultiDelete() {
|
||||
<BasicTable table-title="工单类型列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:workOrdersType:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<!-- <a-button-->
|
||||
<!-- :disabled="!vxeCheckboxChecked(tableApi)"-->
|
||||
<!-- danger-->
|
||||
<!-- type="primary"-->
|
||||
<!-- v-access:code="['property:workOrdersType:remove']"-->
|
||||
<!-- @click="handleMultiDelete">-->
|
||||
<!-- {{ $t('pages.common.delete') }}-->
|
||||
<!-- </a-button>-->
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:workOrdersType:add']"
|
||||
|
@@ -30,9 +30,9 @@ async function handleOpenChange(open: boolean) {
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="工单类型信息" class="w-[70%]">
|
||||
<Descriptions v-if="workOrdersTypeInfoDetail" size="small" :column="2" bordered :labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="工单类型编号">
|
||||
{{ workOrdersTypeInfoDetail.orderTypeNo }}
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="工单类型编号">-->
|
||||
<!-- {{ workOrdersTypeInfoDetail.orderTypeNo }}-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="类型名称">
|
||||
{{ workOrdersTypeInfoDetail.orderTypeName }}
|
||||
</DescriptionsItem>
|
||||
|
@@ -4,7 +4,11 @@ import { useVbenModal } from '@vben/common-ui';
|
||||
import {$t} from '@vben/locales';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import { workOrdersTypeAdd, workOrdersTypeInfo, workOrdersTypeUpdate } from '#/api/property/businessManagement/workOrdersType';
|
||||
import {
|
||||
workOrdersTypeAdd,
|
||||
workOrdersTypeInfo, workOrdersTypeListAll,
|
||||
workOrdersTypeUpdate
|
||||
} from '#/api/property/businessManagement/workOrdersType';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
import {modalSchema} from './data';
|
||||
|
||||
@@ -40,7 +44,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[60%]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@@ -50,10 +54,9 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
await initTypeOptions(id)
|
||||
if (isUpdate.value && id) {
|
||||
const record = await workOrdersTypeInfo(id);
|
||||
record.operationMode = record.operationMode?.toString();
|
||||
@@ -90,6 +93,25 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
async function initTypeOptions(id:string) {
|
||||
let params = {
|
||||
excludeId:id,
|
||||
filterSubNodes: true //过滤子级
|
||||
}
|
||||
const typeList = await workOrdersTypeListAll(params)
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: typeList,
|
||||
showSearch: true,
|
||||
optionFilterProp: 'orderTypeName',
|
||||
fieldNames: {label: 'orderTypeName', value: 'id'},
|
||||
allowClear: true,
|
||||
}),
|
||||
fieldName: 'parentId',
|
||||
},
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Reference in New Issue
Block a user