From e98bc0517a668fdc3ce5e24cdb31a44bde6bbc8a Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 8 Mar 2024 14:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=85=B7=E7=95=8C=E9=9D=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/basic/location/index.ts | 5 ++ src/api/eam/basic/supplier/index.ts | 5 ++ .../eam/basic/fixedAssets/fixedAssets.data.ts | 33 ++++++- .../deviceAccounts/deviceAccounts.data.ts | 1 + .../mold/moldAccounts/moldAccounts.data.ts | 89 +++++++++++-------- 5 files changed, 94 insertions(+), 39 deletions(-) diff --git a/src/api/eam/basic/location/index.ts b/src/api/eam/basic/location/index.ts index d94f360..66eab6e 100644 --- a/src/api/eam/basic/location/index.ts +++ b/src/api/eam/basic/location/index.ts @@ -48,3 +48,8 @@ export const exportLocation = async (params) => { return await request.download({ url: `/eam/location/export-excel`, params }) } + +// 查询库位列表 +export const getLocationNoPage = async (params) => { + return await request.get({ url: `/eam/location/noPage`, params }) +} diff --git a/src/api/eam/basic/supplier/index.ts b/src/api/eam/basic/supplier/index.ts index 80e86b7..f09e101 100644 --- a/src/api/eam/basic/supplier/index.ts +++ b/src/api/eam/basic/supplier/index.ts @@ -52,3 +52,8 @@ export const exportSupplier = async (params) => { return await request.download({ url: `/eam/supplier/export-excel`, params }) } +// 查询供应商列表 +export const getSupplierNoPage = async (params) => { + return await request.get({ url: `/eam/supplier/noPage`, params }) +} + diff --git a/src/views/eam/basic/fixedAssets/fixedAssets.data.ts b/src/views/eam/basic/fixedAssets/fixedAssets.data.ts index 1f3a90c..67d230f 100644 --- a/src/views/eam/basic/fixedAssets/fixedAssets.data.ts +++ b/src/views/eam/basic/fixedAssets/fixedAssets.data.ts @@ -1,6 +1,11 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator' +import * as LocationApi from '@/api/eam/basic/location' +import * as SupplierApi from '@/api/eam/basic/supplier' + +const localtionList = await LocationApi.getLocationNoPage() +const supplierList = await SupplierApi.getSupplierNoPage() // 表单校验 export const FixedAssetsRules = reactive({ @@ -79,13 +84,24 @@ export const FixedAssets = useCrudSchemas(reactive([ }, }, { - label: '库位编号', + label: '库位', field: 'locationNumber', sort: 'custom', table: { width: '150', }, - isSearch: true + isSearch: true, + form:{ + component: 'Select', + componentProps: { + options: localtionList, + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + placeholder: "请选择库位" + } + } }, { label: '购买时间', @@ -112,12 +128,23 @@ export const FixedAssets = useCrudSchemas(reactive([ }, }, { - label: '供应商编号', + label: '供应商', field: 'supplierNumber', sort: 'custom', table: { width: '150', }, + form:{ + component: 'Select', + componentProps: { + options: supplierList, + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + placeholder: "请选择供应商" + } + } }, { label: '出厂日期', diff --git a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts index 1998ec6..1ae7349 100644 --- a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts +++ b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts @@ -106,6 +106,7 @@ export const DeviceAccounts = useCrudSchemas(reactive([ }, isSearch: false, isForm: true, + isTable: true, dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictClass: 'string', form: { diff --git a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts index 9e4f235..925ba2f 100644 --- a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts +++ b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts @@ -1,17 +1,34 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import { selectAllFactoryArea } from '@/api/system/dept' +import * as SupplierApi from '@/api/eam/basic/supplier' +import { validateHanset,validateNumDot, validateEmail,validateNum } from '@/utils/validator' const factoryList = await selectAllFactoryArea() +const supplierList = await SupplierApi.getSupplierNoPage() // 表单校验 export const MoldAccountsRules = reactive({ - // number: [required], - name: [required], - // factoryAreaNumber: [required], - // purchaseTime: [required], - // deptId: [required], - // purchaser: [required], - // supplierNumber: [required], - concurrencyStamp: [required] + number: [ + required, + { max: 20, message: '不得超过20个字符', trigger: 'blur' }, + ], + name: [ + required, + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + ], + factoryAreaNumber: [required], + purchaseDept: [ + { max: 100, message: '不得超过100个字符', trigger: 'blur' }, + ], + purchaser: [ + { max: 60, message: '不得超过60个字符', trigger: 'blur' }, + ], + purchasePrice: [ + { max: 20, message: '不得超过20个字符', trigger: 'blur' }, + { validator:validateNumDot, message: '请输入数字格式', trigger: 'blur'} + ], + beat:[ + { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} + ] }) export const MoldAccounts = useCrudSchemas(reactive([ @@ -38,8 +55,19 @@ export const MoldAccounts = useCrudSchemas(reactive([ field: 'type', sort: 'custom', isSearch: false, + isForm: true, + isTable: true, + dictType: DICT_TYPE.DEVICE_MOLD_TYPE, + dictClass: 'string', form: { - component: 'Select' + value: 'MOLD', + component: 'Select', + componentProps: { + disabled: true, + } + }, + search: { + value: 'MOLD' } }, { @@ -114,9 +142,23 @@ export const MoldAccounts = useCrudSchemas(reactive([ } }, { - label: '供应商编号', + label: '供应商', field: 'supplierNumber', - sort: 'custom' + sort: 'custom', + table:{ + width:150 + }, + form:{ + component: 'Select', + componentProps: { + options: supplierList, + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + placeholder: "请选择供应商" + } + } }, { label: '出厂日期', @@ -146,15 +188,6 @@ export const MoldAccounts = useCrudSchemas(reactive([ dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', }, - { - label: '生产次数', - field: 'frequency', - sort: 'custom', - isForm: false, - form: { - component: 'InputNumber', - } - }, { label: '节拍', field: 'beat', @@ -164,22 +197,6 @@ export const MoldAccounts = useCrudSchemas(reactive([ component: 'Input', } }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isForm: false - }, - - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - }, - { label: '维修状态', field: 'status',