| | |
| | | import { FunctionType } from '/@/api/tigerapi/model/systemModel'; |
| | | import { SaveEntity, getEntity } from '/@/api/tigerapi/system'; |
| | | import { GetEnum, SaveEntity, getEntity } from '/@/api/tigerapi/system'; |
| | | import { FormSchema } from '/@/components/Table'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { uploadApi } from '/@/api/sys/upload'; |
| | | import { notification } from 'ant-design-vue'; |
| | | import { useLocale } from '/@/locales/useLocale'; |
| | | import { unref } from 'vue'; |
| | | |
| | | const { t } = useI18n(); |
| | | const { getLocale } = useLocale(); |
| | | |
| | | export const getFns: Record<string, FunctionType> = { |
| | | handleSubmit: async (e, ...args) => { |
| | |
| | | |
| | | export const woCfgformSchema: FormSchema[] = [ |
| | | { |
| | | field: 'field1', |
| | | field: 'ORDER_NO', |
| | | component: 'Input', |
| | | label: '字段1', |
| | | label: '工单号', |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | | componentProps: { |
| | | placeholder: '自定义placeholder', |
| | | placeholder: '请输入工单号', |
| | | onChange: (e: any) => { |
| | | console.log(e); |
| | | }, |
| | | }, |
| | | dynamicDisabled: true, |
| | | }, |
| | | { |
| | | field: 'field2', |
| | | field: 'ORDER_TYPE', |
| | | component: 'Select', |
| | | label: '工单类型', |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | | defaultValue: 'Normal', |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: '正常', |
| | | value: 'Normal', |
| | | }, |
| | | { |
| | | label: '返工', |
| | | value: 'Rework', |
| | | }, |
| | | ], |
| | | }, |
| | | dynamicDisabled: true, |
| | | }, |
| | | { |
| | | field: 'PLAN_QTY', |
| | | component: 'Input', |
| | | label: '字段2', |
| | | label: '计划数量', |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'field3', |
| | | component: 'DatePicker', |
| | | label: '字段3', |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | | dynamicDisabled: true, |
| | | }, |
| | | ]; |
| | | |
| | | export const prodCfgformSchema: FormSchema[] = [ |
| | | { |
| | | field: 'field4', |
| | | field: 'ITEM_CODE', |
| | | component: 'Input', |
| | | label: '字段1', |
| | | label: '物料编码', |
| | | required: true, |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | | componentProps: { |
| | | placeholder: '自定义placeholder', |
| | | placeholder: '请输入物料编码', |
| | | onChange: (e: any) => { |
| | | console.log(e); |
| | | }, |
| | | }, |
| | | dynamicDisabled: true, |
| | | }, |
| | | { |
| | | field: 'field5', |
| | | field: 'ITEM_TYPE', |
| | | component: 'Input', |
| | | label: '字段2', |
| | | label: '物料类型', |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | field: 'field7', |
| | | label: '工艺路线', |
| | | field: 'ROUTE_CODE', |
| | | component: 'Input', |
| | | label: '字段4', |
| | | required: true, |
| | | colProps: { |
| | | span: 8, |
| | | span: 12, |
| | | }, |
| | | componentProps: { |
| | | placeholder: '自定义placeholder', |
| | | onChange: (e: any) => { |
| | | console.log(e); |
| | | }, |
| | | }, |
| | | { |
| | | field: 'addRot', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'addRot', |
| | | defaultValue: 'MES_ROUTE', |
| | | colProps: { |
| | | span: 1, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'setRot', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'setRot', |
| | | defaultValue: 'MES_ROUTE', |
| | | colProps: { |
| | | span: 1, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | component: 'Input', |
| | | label: '字段5', |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'field9', |
| | | component: 'DatePicker', |
| | | label: '字段6', |
| | | colProps: { |
| | | span: 8, |
| | | span: 10, |
| | | }, |
| | | }, |
| | | ]; |
| | |
| | | }, |
| | | }, |
| | | { |
| | | field: 'field11', |
| | | field: 'ROUTE_CODE', |
| | | component: 'Input', |
| | | label: '字段2', |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'add', |
| | | component: 'Input', |
| | | label: '1', |
| | | colSlot: 'add', |
| | | defaultValue: 'MES_ROUTE', |
| | | colProps: { |
| | | span: 1, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | }; |
| | | } |
| | | |
| | | export function woCustFn(openItemModal: Fn, slotName: string, others: Fn[], ...args) { |
| | | /* 自定义模态框打开方法 */ |
| | | export function woCustFn(openModal: Fn, slotName: string, others: Fn[], ...args) { |
| | | switch (slotName) { |
| | | case 'add': |
| | | openItemModal(true, { |
| | | case 'addRot': |
| | | openModal(true, { |
| | | title: '工艺路线列表', |
| | | schemas: [ |
| | | { |
| | |
| | | }); |
| | | break; |
| | | case 'set': |
| | | case 'setRot': |
| | | // notification.success({ |
| | | // message: '点击了设置按钮', |
| | | // description: `OK`, |
| | | // duration: 3, |
| | | // }); |
| | | others[0](true, { rotId: args[0][0], slotName: 'set' }); |
| | | others[0](true, { rotId: args[0][0], slotName: slotName }); |
| | | break; |
| | | default: |
| | | () => {}; |