云
4 天以前 78caa769e452f63288743b8997f7b4c21bb06ce5
src/views/mes/pro/batch/data.ts
@@ -80,6 +80,8 @@
  existingBinding?: BindingMode,
): VbenFormSchema[] {
  const disabled = formType === 'detail';
  // 批次号仅在新增、补录时允许人工输入;留空由后端按「年份+3位流水」自动生成
  const codeEditable = formType === 'create' || formType === 'fill';
  return [
    {
      fieldName: 'id',
@@ -94,12 +96,9 @@
      label: '批次号',
      component: 'Input',
      componentProps: {
        disabled: true,
        placeholder: '补录后自动生成',
      },
      dependencies: {
        triggerFields: [''],
        show: () => formType !== 'create',
        disabled: !codeEditable,
        maxlength: 7,
        placeholder: codeEditable ? '留空自动生成,如 2026001' : '批次号自动生成',
      },
    },
    {
@@ -276,7 +275,6 @@
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
  return [
    { fieldName: 'businessCode', label: '业务码', component: 'Input', componentProps: { allowClear: true, placeholder: '请输入作业扫码业务码' } },
    {
      fieldName: 'code',
      label: '批次号',
@@ -346,7 +344,6 @@
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions<MesProBatchApi.Batch>['columns'] {
  return [
    { field: 'businessCode', title: '业务码(作业扫码)', minWidth: 210 },
    {
      field: 'code',
      title: '批次号',
@@ -354,6 +351,13 @@
      minWidth: 200,
      slots: { default: 'code' },
    },
    {
      field: 'palletCodes',
      title: '托盘码',
      minWidth: 200,
      showOverflow: 'tooltip',
      slots: { default: 'palletCodes' },
    },
    { field: 'itemName', title: '品种名称', minWidth: 150 },
    { field: 'itemCode', title: '品种编码', minWidth: 150 },
    {