| | |
| | | |
| | | import { h, markRaw } from 'vue'; |
| | | |
| | | import { DICT_TYPE, MesAutoCodeRuleCode } from '../../../packages/constants/src'; |
| | | import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants'; |
| | | |
| | | import { Button } from 'ant-design-vue'; |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | import { generateAutoCode } from '#/api/mes/md/autocode/record'; |
| | | import { getItemPage } from '#/api/mdm/item'; |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { MdVendorSelect } from '#/views/mes/md/vendor/components'; |
| | | import { ErpPurchaseOrderSelect } from '#/views/erp/purchase/order/components'; |
| | | |
| | |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'vendorName', |
| | | label: '', |
| | | component: 'Input', |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => false, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'purchaseOrderId', |
| | | label: '采购订单', |
| | | component: markRaw(ErpPurchaseOrderSelect), |
| | | componentProps: { |
| | | placeholder: '请选择采购订单', |
| | | onChange: (item: any) => { |
| | | if (item?.supplierId && formApi) { |
| | | formApi.setFieldValue('vendorId', item.supplierId); |
| | | formApi.setFieldValue('vendorName', item.supplierName); |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | component: markRaw(MdVendorSelect), |
| | | componentProps: { |
| | | placeholder: '请选择供应商', |
| | | disabled: true, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['vendorName'], |
| | | componentProps: (values) => ({ |
| | | placeholder: '请选择供应商', |
| | | disabled: true, |
| | | vendorName: values.vendorName as string, |
| | | }), |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | field: 'iqcCheckResult', |
| | | title: '质检结果', |
| | | width: 100, |
| | | slots: { default: 'iqcCheckResult' }, |
| | | }, |
| | | { |
| | | field: 'qualifiedQuantity', |
| | | title: '合格数量', |
| | | width: 100, |
| | |
| | | field: 'iqcCode', |
| | | title: '检验单号', |
| | | minWidth: 140, |
| | | slots: { default: 'iqcCode' }, |
| | | }, |
| | | { |
| | | field: 'remark', |
| | |
| | | { |
| | | fieldName: 'itemId', |
| | | label: '物料', |
| | | component: markRaw(MdItemSelect), |
| | | component: 'ApiSelect', |
| | | componentProps: { |
| | | placeholder: '请选择物料', |
| | | allowClear: true, |
| | | showSearch: true, |
| | | api: getItemPage, |
| | | resultField: 'list', |
| | | labelField: 'name', |
| | | valueField: 'id', |
| | | optionRender: (option: any) => { |
| | | const item = option.data; |
| | | return `${item.code} - ${item.name}`; |
| | | }, |
| | | }, |
| | | rules: 'selectRequired', |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'arrivalQuantity', |