| | |
| | | import { Button } from 'ant-design-vue'; |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | import CrmCustomerSelect from '#/components/crm-customer-select.vue'; |
| | | import { generateAutoCode } from '#/api/mes/md/autocode/record'; |
| | | import { MdClientSelect } from '#/views/mes/md/client/components'; |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { WmBatchSelect } from '#/views/wls/batch/components'; |
| | | import { |
| | |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'salesOrderCode', |
| | | label: '销售订单号', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请输入销售订单号', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'clientId', |
| | | label: '客户', |
| | | component: markRaw(MdClientSelect), |
| | | component: markRaw(CrmCustomerSelect), |
| | | componentProps: { |
| | | placeholder: '请选择客户', |
| | | }, |
| | |
| | | class: '!w-full', |
| | | format: 'YYYY-MM-DD', |
| | | placeholder: '请选择退货日期', |
| | | valueFormat: 'x', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'salesOrderCode', |
| | | label: '销售订单号', |
| | | component: 'Input', |
| | | componentProps: { |
| | | allowClear: true, |
| | | placeholder: '请输入销售订单号', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'clientId', |
| | | label: '客户', |
| | | component: markRaw(MdClientSelect), |
| | | component: markRaw(CrmCustomerSelect), |
| | | componentProps: { |
| | | placeholder: '请选择客户', |
| | | }, |
| | |
| | | field: 'name', |
| | | title: '退货单名称', |
| | | minWidth: 150, |
| | | }, |
| | | { |
| | | field: 'salesOrderCode', |
| | | title: '销售订单号', |
| | | minWidth: 140, |
| | | }, |
| | | { |
| | | field: 'clientCode', |
| | |
| | | } |
| | | |
| | | /** 退货单行新增/修改的表单 */ |
| | | export function useLineFormSchema( |
| | | clientId?: number, |
| | | salesOrderCode?: string, |
| | | ): VbenFormSchema[] { |
| | | export function useLineFormSchema(clientId?: number): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'itemId', |
| | |
| | | component: markRaw(WmBatchSelect), |
| | | componentProps: { |
| | | clientId, |
| | | disabled: true, |
| | | placeholder: '请选择批次', |
| | | salesOrderCode, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['itemId'], |
| | | componentProps: (values) => ({ |
| | | clientId, |
| | | disabled: true, |
| | | itemId: values.itemId, |
| | | placeholder: '请选择批次', |
| | | salesOrderCode, |
| | | }), |
| | | }, |
| | | }, |