liu
4 天以前 ee7ac8df8bce38add1f75baf876b49de94b9e00a
src/views/wls/returnsales/data.ts
@@ -14,7 +14,6 @@
import { z } from '#/adapter/form';
import CrmCustomerSelect from '#/components/crm-customer-select.vue';
import { generateAutoCode } from '#/api/mes/md/autocode/record';
import { ErpSaleOrderSelect } from '#/views/erp/sale/order/components';
import { MdItemSelect } from '#/views/mes/md/item/components';
import { WmBatchSelect } from '#/views/wls/batch/components';
import {
@@ -88,31 +87,6 @@
      rules: 'required',
    },
    {
      fieldName: 'salesOrderCode',
      component: 'Input',
      dependencies: {
        triggerFields: [''],
        show: () => false,
      },
    },
    {
      fieldName: 'saleOrderId',
      label: '销售订单号',
      component: markRaw(ErpSaleOrderSelect),
      componentProps: {
        placeholder: '请选择销售订单',
        onChange: (item: any) => {
          if (formApi) {
            formApi.setFieldValue('salesOrderCode', item?.no ?? '');
            if (item?.customerId) {
              formApi.setFieldValue('clientId', item.customerId);
            }
          }
        },
      },
      rules: 'selectRequired',
    },
    {
      fieldName: 'clientId',
      label: '客户',
      component: markRaw(CrmCustomerSelect),
@@ -179,15 +153,6 @@
      },
    },
    {
      fieldName: 'salesOrderCode',
      label: '销售订单号',
      component: 'Input',
      componentProps: {
        allowClear: true,
        placeholder: '请输入销售订单号',
      },
    },
    {
      fieldName: 'clientId',
      label: '客户',
      component: markRaw(CrmCustomerSelect),
@@ -221,11 +186,6 @@
      field: 'name',
      title: '退货单名称',
      minWidth: 150,
    },
    {
      field: 'salesOrderCode',
      title: '销售订单号',
      minWidth: 140,
    },
    {
      field: 'clientCode',
@@ -339,10 +299,7 @@
}
/** 退货单行新增/修改的表单 */
export function useLineFormSchema(
  clientId?: number,
  salesOrderCode?: string,
): VbenFormSchema[] {
export function useLineFormSchema(clientId?: number): VbenFormSchema[] {
  return [
    {
      fieldName: 'itemId',
@@ -371,16 +328,16 @@
      component: markRaw(WmBatchSelect),
      componentProps: {
        clientId,
        disabled: true,
        placeholder: '请选择批次',
        salesOrderCode,
      },
      dependencies: {
        triggerFields: ['itemId'],
        componentProps: (values) => ({
          clientId,
          disabled: true,
          itemId: values.itemId,
          placeholder: '请选择批次',
          salesOrderCode,
        }),
      },
    },