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