From dd4b9a42a56af2c2da40d7c1d6b2cf0074afa1f3 Mon Sep 17 00:00:00 2001 From: zhousq Date: Mon, 29 Apr 2024 16:21:30 +0800 Subject: [PATCH] =?UTF-8?q?2024-04-29=20=E4=BF=AE=E6=94=B9=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E7=9A=84=E6=98=8E=E7=BB=86=E5=88=97=E8=A1=A8=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/workScheduling/workScheduling.data.ts | 119 ++++++++++++------ 1 file changed, 83 insertions(+), 36 deletions(-) diff --git a/src/views/mes/workScheduling/workScheduling.data.ts b/src/views/mes/workScheduling/workScheduling.data.ts index 1ed99d358..242940602 100644 --- a/src/views/mes/workScheduling/workScheduling.data.ts +++ b/src/views/mes/workScheduling/workScheduling.data.ts @@ -1,5 +1,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import { ElTag } from 'element-plus' // 表单校验 export const WorkSchedulingRules = reactive({ @@ -48,6 +49,13 @@ export const WorkScheduling = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, isForm: true, + form:{ + component: 'Input', + componentProps: { + placeholder: '请输入计划编号', + disabled:true + } + } }, { label: '工单编号', @@ -88,7 +96,7 @@ export const WorkScheduling = useCrudSchemas(reactive([ label: '计划数量', field: 'planCount', sort: 'custom', - isForm: true, + isForm: false, }, { label: '完工数量', @@ -143,7 +151,7 @@ export const WorkScheduling = useCrudSchemas(reactive([ label: '工单模式', field: 'formType', sort: 'custom', - isForm: true, + isForm: false, dictType: DICT_TYPE.MES_WORKBILL_MODEL, dictClass: 'string', form: { @@ -173,7 +181,7 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ field: 'id', sort: 'custom', isSearch: false, - isTable: false, + isTable: true, isForm:false, isDetail:false, }, @@ -186,15 +194,7 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ isForm:false, isDetail:false, }, - { - label: '备注', - field: 'remark', - sort: 'custom', - isSearch: false, - isTable: false, - isForm:false, - isDetail:false, - }, + { label: '创建时间', field: 'createTime', @@ -219,16 +219,16 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, }, - { - label: '任务ID', - field: 'schedulingId', - sort: 'custom', - isSearch: true, - form: { - component: 'InputNumber', - value: 0 - }, - }, + // { + // label: '任务ID', + // field: 'schedulingId', + // sort: 'custom', + // isSearch: true, + // form: { + // component: 'InputNumber', + // value: 0 + // }, + // }, { label: '任务序号', field: 'taskSort', @@ -247,30 +247,55 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ { label: '允许工位', field: 'workstationValidate', + formatter: (_: Recordable, __: TableColumn, cellValue: String) => { + return h( + ElTag, + { + type:'primary' + }, + () => + JSON.parse(cellValue).map((item: any) => { + return '['+item.name+']' + }).join('\r\n') + ) + }, sort: 'custom', }, { label: '允许设备', field: 'deviceValidate', + formatter: (_: Recordable, __: TableColumn, cellValue: String) => { + return h( + ElTag, + { + type:'primary' + }, + () => + JSON.parse(cellValue).map((item: any) => { + return '['+item.name+']' + }).join('\r\n') + ) + }, sort: 'custom', }, { label: '允许人员', field: 'personValidate', + formatter: (_: Recordable, __: TableColumn, cellValue: String) => { + return h( + ElTag, + { + type:'primary' + }, + () => + JSON.parse(cellValue).map((item: any) => { + return '['+item.name+']' + }).join('\r\n') + ) + }, sort: 'custom', }, - { - label: '报工人', - field: 'reportPerson', - sort: 'custom', - isSearch: true, - }, - { - label: '生产人', - field: 'receivePerson', - sort: 'custom', - isSearch: true, - }, + { label: '计划数量', field: 'planCount', @@ -280,6 +305,12 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ value: 0 }, }, + { + label: '报工人', + field: 'reportPerson', + sort: 'custom', + isSearch: true, + }, { label: '报工数量', field: 'reportCount', @@ -328,10 +359,26 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, }, + + { + label: '生产人', + field: 'receivePerson', + sort: 'custom', + isSearch: true, + }, + // { + // label: '生产物料', + // field: 'materialValidate', + // sort: 'custom', + // }, { - label: '生产物料', - field: 'materialValidate', + label: '备注', + field: 'remark', sort: 'custom', + isSearch: false, + isTable: false, + isForm:false, + isDetail:false, }, { label: '操作',