| | |
| | | import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; |
| | | import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | import type { MesQcIpqcApi } from '#/api/mes/qc/ipqc'; |
| | | import type { MesQcIpqcLineApi } from '#/api/mes/qc/ipqc/line'; |
| | |
| | | MesAutoCodeRuleCode, |
| | | MesProTaskStatusEnum, |
| | | MesProWorkOrderStatusEnum, |
| | | } from '..\..\..\..\packages\constants\src'; |
| | | import { getDictOptions } from '..\..\..\..\packages\effects\hooks\src'; |
| | | } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | |
| | | import { Button } from 'ant-design-vue'; |
| | | |
| | | import { generateAutoCode } from '#/api/mes/md/autocode/record'; |
| | | import { getTemplateItemOptionList } from '#/api/mes/qc/template/item'; |
| | | import { getSimpleUserList } from '#/api/system/user'; |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { MdWorkstationSelect } from '#/views/mes/md/workstation/components'; |
| | | import { ProTaskSelect } from '#/views/mes/pro/task/components'; |
| | |
| | | }, |
| | | { |
| | | fieldName: 'workOrderId', |
| | | label: '生产工单', |
| | | label: '生产订单', |
| | | component: markRaw(ProWorkOrderSelect), |
| | | componentProps: { |
| | | placeholder: '请选择生产工单', |
| | | placeholder: '请选择生产订单', |
| | | status: MesProWorkOrderStatusEnum.CONFIRMED, |
| | | // 工单变更时清空生产任务 |
| | | // 订单变更时清空生产任务 |
| | | onChange: () => formApi?.setFieldValue('taskId', undefined), |
| | | }, |
| | | rules: 'selectRequired', |
| | |
| | | triggerFields: ['sourceDocId'], |
| | | componentProps: (values) => ({ |
| | | disabled: !!values.sourceDocId, |
| | | placeholder: '请选择生产工单', |
| | | placeholder: '请选择生产订单', |
| | | status: MesProWorkOrderStatusEnum.CONFIRMED, |
| | | onChange: () => formApi?.setFieldValue('taskId', undefined), |
| | | }), |
| | |
| | | statuses: [MesProTaskStatusEnum.PREPARE], |
| | | workOrderId: values.workOrderId, |
| | | workstationId: values.workstationId, |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'templateId', |
| | | label: '质检方案', |
| | | component: 'ApiSelect', |
| | | componentProps: { |
| | | api: getTemplateItemOptionList, |
| | | autoSelect: 'first', |
| | | labelField: 'templateName', |
| | | valueField: 'templateId', |
| | | placeholder: '请选择质检方案', |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['workOrderId', 'taskId'], |
| | | componentProps: (values) => ({ |
| | | api: getTemplateItemOptionList, |
| | | autoSelect: 'first', |
| | | labelField: 'templateName', |
| | | valueField: 'templateId', |
| | | disabled: formType !== 'create' || !values.workOrderId, |
| | | params: values.workOrderId |
| | | ? { |
| | | qcType: 2, |
| | | workOrderId: values.workOrderId, |
| | | taskId: values.taskId, |
| | | } |
| | | : {}, |
| | | placeholder: values.workOrderId |
| | | ? '请选择质检方案' |
| | | : '请先选择生产订单', |
| | | }), |
| | | }, |
| | | }, |
| | |
| | | precision: 2, |
| | | }, |
| | | rules: 'required', |
| | | help: '不合格品数量大于0时,保存后将自动生成不合格处理单', |
| | | }, |
| | | { |
| | | fieldName: 'laborScrapQuantity', |
| | |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | placeholder: '请选择检测日期', |
| | | valueFormat: 'x', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | |
| | | }, |
| | | { |
| | | fieldName: 'workOrderId', |
| | | label: '生产工单', |
| | | label: '生产订单', |
| | | component: markRaw(ProWorkOrderSelect), |
| | | componentProps: { |
| | | placeholder: '请选择生产工单', |
| | | placeholder: '请选择生产订单', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'), |
| | | placeholder: '请选择检测结果', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'inspectDate', |
| | | label: '检测日期', |
| | | component: 'RangePicker', |
| | | componentProps: { |
| | | ...getRangePickerDefaultProps(), |
| | | }, |
| | | }, |
| | | ]; |
| | |
| | | }, |
| | | { |
| | | field: 'workOrderCode', |
| | | title: '生产工单编号', |
| | | title: '生产订单编号', |
| | | width: 140, |
| | | }, |
| | | { |