liu
5 天以前 ee7ac8df8bce38add1f75baf876b49de94b9e00a
src/views/wls/productsales/data.ts
@@ -13,15 +13,16 @@
  DICT_TYPE,
  MesAutoCodeRuleCode,
  MesWmSalesNoticeStatusEnum,
} from '../../../packages/constants/src';
import { getDictOptions } from '../../../packages/effects/hooks/src';
  MesWmWarehouseTypeEnum,
} from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
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 { getRangePickerDefaultProps } from '#/utils';
import { MdClientSelect } from '#/views/mes/md/client/components';
import { MdItemSelect } from '#/views/mes/md/item/components';
import { WmMaterialStockSelect } from '#/views/wls/materialstock/components';
import {
@@ -124,26 +125,16 @@
      component: markRaw(WmSalesNoticeSelect),
      componentProps: {
        disabled: isHeaderReadonly(formType),
        // 选择发货通知单后,自动回填销售订单号、客户、收货人信息
        // 选择发货通知单后,自动回填客户、收货人信息
        onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => {
          await formApi?.setValues({
            clientId: notice?.clientId,
            contactAddress: notice?.recipientAddress,
            contactName: notice?.recipientName,
            contactTelephone: notice?.recipientTelephone,
            salesOrderCode: notice?.salesOrderCode,
          });
        },
        status: MesWmSalesNoticeStatusEnum.APPROVED,
      },
    },
    {
      fieldName: 'salesOrderCode',
      label: '销售订单编号',
      component: 'Input',
      componentProps: {
        disabled: isHeaderReadonly(formType),
        placeholder: '请输入销售订单编号',
      },
    },
    {
@@ -155,14 +146,14 @@
        disabled: isHeaderReadonly(formType),
        format: 'YYYY-MM-DD',
        placeholder: '请选择出库日期',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD',
      },
      rules: 'required',
    },
    {
      fieldName: 'clientId',
      label: '客户',
      component: markRaw(MdClientSelect),
      component: markRaw(CrmCustomerSelect),
      componentProps: {
        disabled: isHeaderReadonly(formType),
        placeholder: '请选择客户',
@@ -258,18 +249,9 @@
      },
    },
    {
      fieldName: 'salesOrderCode',
      label: '销售订单编号',
      component: 'Input',
      componentProps: {
        allowClear: true,
        placeholder: '请输入销售订单编号',
      },
    },
    {
      fieldName: 'clientId',
      label: '客户',
      component: markRaw(MdClientSelect),
      component: markRaw(CrmCustomerSelect),
      componentProps: {
        placeholder: '请选择客户',
      },
@@ -316,11 +298,6 @@
    {
      field: 'noticeCode',
      title: '发货通知单号',
      minWidth: 160,
    },
    {
      field: 'salesOrderCode',
      title: '销售订单编号',
      minWidth: 160,
    },
    {
@@ -543,6 +520,23 @@
): VxeTableGridOptions<MesWmProductSalesDetailApi.ProductSalesDetail>['columns'] {
  return [
    {
      field: 'itemName',
      title: '物料',
      minWidth: 140,
    },
    {
      field: 'batchCode',
      title: '批次号',
      minWidth: 130,
    },
    {
      field: 'bagCodeId',
      title: '扫码来源',
      minWidth: 110,
      formatter: ({ row }) =>
         row.bagCodeId ? `袋码 #${row.bagCodeId}${row.palletCodeId ? ` / 托盘 #${row.palletCodeId}` : ''}` : row.palletCodeId ? `托盘码 #${row.palletCodeId}` : '手工拣货',
    },
    {
      field: 'warehouseName',
      title: '仓库名称',
      minWidth: 100,
@@ -562,6 +556,7 @@
      title: '数量',
      width: 100,
    },
    { field: 'remark', title: '袋码与扫码来源', minWidth: 240 },
    ...(stockable
      ? [
          {
@@ -607,6 +602,8 @@
      label: '选择库存',
      component: markRaw(WmMaterialStockSelect),
      componentProps: {
        // 只从合格仓库(type=20)选择可拣货库存
        warehouseType: MesWmWarehouseTypeEnum.QUALIFIED,
        // 选择库存记录后,自动回填仓库/库区/库位/批次/数量
        onChange: async (stock?: MesWmMaterialStockApi.MaterialStock) => {
          await formApi?.setValues({