From d81f679afc9a80e1e131f8078e02d99001d43a41 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Mon, 4 Mar 2024 14:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=85=B7=E5=8F=B0=E8=B4=A6=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mold/moldAccounts/moldAccounts.data.ts | 74 +++++++++++++++++-- 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts index 1a2ec94..cb17928 100644 --- a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts +++ b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts @@ -1,6 +1,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' - +import { selectAllFactoryArea } from '@/api/system/dept' +const factoryList = await selectAllFactoryArea() // 表单校验 export const MoldAccountsRules = reactive({ // number: [required], @@ -15,11 +16,11 @@ export const MoldAccountsRules = reactive({ export const MoldAccounts = useCrudSchemas(reactive([ { - label: '编号唯一标识', + label: '模具编号', field: 'number', sort: 'custom', isSearch: true, - isForm: false, + isForm: true, }, { label: '名称', @@ -33,7 +34,7 @@ export const MoldAccounts = useCrudSchemas(reactive([ sort: 'custom' }, { - label: '设备类型', + label: '模具类型', field: 'type', sort: 'custom', isSearch: true, @@ -42,9 +43,40 @@ export const MoldAccounts = useCrudSchemas(reactive([ } }, { - label: '所属厂区编号', + label: '所属厂区', field: 'factoryAreaNumber', - sort: 'custom' + sort: 'custom', + isSearch: false, + table: { + width: '150', + }, + api: () => factoryList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return factoryList.find((account) => account.id == cellValue)?.name + }, + search: { + show: true, + component: 'Select', + api: () => factoryList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + }, + form: { + component: 'Select', + api: () => factoryList, + componentProps: { + disabled: false, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + placeholder: "请选择设备" + }, + } }, { label: '采购时间', @@ -100,10 +132,38 @@ export const MoldAccounts = useCrudSchemas(reactive([ } }, { - label: '价格', + label: '购买价格', field: 'purchasePrice', sort: 'custom' }, + { + label: '是否客户资产', + field: 'isClientAssets', + sort: 'custom', + form: { + component: 'Select', + }, + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + }, + { + label: '生产次数', + field: 'frequency', + sort: 'custom', + isForm: false, + form: { + component: 'InputNumber', + } + }, + { + label: '节拍', + field: 'beat', + sort: 'custom', + isForm: true, + form: { + component: 'Input', + } + }, { label: '创建时间', field: 'createTime',