From ab07a0d626cb44399172acea526609219e78f2e1 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Wed, 20 Mar 2024 09:03:53 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=B7=A5=E4=BD=8D=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=B7=A5=E7=BB=84=E3=80=81=E5=B7=A5=E5=BA=8F=E3=80=81=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=AD=89=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/workstationBind/index.ts | 3 + .../workstationBind/src/workstationBind.vue | 642 ++++++++++++++++++ src/utils/disposition/defaultButtons.ts | 26 +- src/views/mes/workstation/index.vue | 15 +- src/views/mes/workstation/workstation.data.ts | 39 +- 5 files changed, 701 insertions(+), 24 deletions(-) create mode 100644 src/components/workstationBind/index.ts create mode 100644 src/components/workstationBind/src/workstationBind.vue diff --git a/src/components/workstationBind/index.ts b/src/components/workstationBind/index.ts new file mode 100644 index 000000000..bbab7d7c3 --- /dev/null +++ b/src/components/workstationBind/index.ts @@ -0,0 +1,3 @@ +import workstationBind from './src/workstationBind.vue' +import detail from './src/Detail.vue' +export { workstationBind,detail } diff --git a/src/components/workstationBind/src/workstationBind.vue b/src/components/workstationBind/src/workstationBind.vue new file mode 100644 index 000000000..df08c7e94 --- /dev/null +++ b/src/components/workstationBind/src/workstationBind.vue @@ -0,0 +1,642 @@ + + + + + diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index b7f8ca791..0b59fdb7b 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -250,7 +250,18 @@ export function mainListDeleteBtn(option:any) { hasPermi: '' }) } - +// 主列表-绑定 +export function mainListBindBtn(option:any) { + return __defaultBtnOption(option,{ + label: '绑定', + name: 'bind', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 主列表-申请流程-关闭按钮 export function mainListCloseBtn(option:any) { return __defaultBtnOption(option,{ @@ -735,18 +746,7 @@ export function mainThawRequesttBtn(option:any) { hasPermi: '' }) } -// 主列表-绑定 -export function mainListBindBtn(option:any) { - return __defaultBtnOption(option,{ - label: '绑定', - name: 'bind', - hide: false, - type: 'primary', - color: '', - link: true, // 文本展现按钮 - hasPermi: '' - }) -} + // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 35f6f2dd1..83f02b07f 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -52,7 +52,8 @@ - + + @@ -65,7 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' - +import BindDetail from '@/components/workstationBind/src/workstationBind.vue' defineOptions({ name: 'Workstation' }) const message = useMessage() // 消息弹窗 @@ -144,11 +145,10 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 await handleDelete(row.id) - }else if (val == 'bind') { // 删除 - await detailRef.value.openDetail(row, '绑定', row.name, 'mesWorkstation') + }else if (val == 'bind') { // 绑定 + openBindDetail(row,row.name,row.code) } } - /** 添加/修改操作 */ const basicFormRef = ref() const openForm = (type: string, row?: any) => { @@ -184,6 +184,11 @@ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation') } +/** 绑定操作 */ +const bindDetailRef = ref() +const openBindDetail = (row: any, titleName: any, titleValue: any) => { + bindDetailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation') +} /** 删除按钮操作 */ const handleDelete = async (id: number) => { diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index 611194817..b4e7b8f1a 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -1,11 +1,28 @@ -import type { CrudSchema } from '@/hooks/web/useCrudSchemas' -import { dateFormatter } from '@/utils/formatTime' +import type {CrudSchema} from '@/hooks/web/useCrudSchemas' +import {dateFormatter} from '@/utils/formatTime' // 表单校验 export const WorkstationRules = reactive({ code: [required] }) +export const TabsList = [{ + label: "工组", + prop: 'Team', +}, + { + label: "设备", + prop: 'Equipment', + }, + { + label: "工序", + prop: 'Process', + }, + { + label: "产品", + prop: 'Production', + } +] export const Workstation = useCrudSchemas(reactive([ { @@ -46,26 +63,36 @@ export const Workstation = useCrudSchemas(reactive([ field: 'activeTime', sort: 'custom', formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, form: { component: 'DatePicker', componentProps: { + style: {width: '100%'}, type: 'datetime', - valueFormat: 'x' + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', } - } + }, }, { label: '失效时间', field: 'expireTime', sort: 'custom', formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, form: { component: 'DatePicker', componentProps: { + style: {width: '100%'}, type: 'datetime', - valueFormat: 'x' + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', } - } + }, }, { label: '操作',