gaoluyang
2026-07-01 7d5f9791941d0ef9cd6d2daae80b5ae391e18b43
src/views/erp/purchase/request/data.ts
@@ -14,10 +14,11 @@
/** 状态常量 */
export const PURCHASE_REQUEST_STATUS = {
  PENDING: 0, // 待审批
  APPROVED: 1, // 已审批
  REJECTED: 2, // 已拒绝
  CONVERTED: 3, // 已转订单
  DRAFT: 0, // 未提交(草稿)
  PROCESSING: 10, // 审批中
  APPROVED: 20, // 审核通过
  REJECTED: 30, // 审核不通过
  CANCELLED: 40, // 已取消
};
/** 表单的配置项 */
@@ -54,7 +55,7 @@
      rules: 'required',
    },
    {
      label: '供应商',
      label: '供应商(可选)',
      fieldName: 'supplierId',
      component: 'ApiSelect',
      componentProps: {
@@ -68,12 +69,37 @@
      },
    },
    {
      fieldName: 'reason',
      fieldName: 'discountPercent',
      label: '优惠率(%)',
      component: 'InputNumber',
      componentProps: {
        placeholder: '请输入优惠率',
        min: 0,
        max: 100,
        precision: 2,
        disabled: formType === 'detail',
      },
    },
    {
      fieldName: 'requestReason',
      label: '申请理由',
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入申请理由',
        autoSize: { minRows: 1, maxRows: 1 },
        disabled: formType === 'detail',
      },
      formItemClass: 'col-span-2',
    },
    {
      fieldName: 'fileUrl',
      label: '附件',
      component: 'FileUpload',
      componentProps: {
        placeholder: '请上传附件',
        maxNumber: 5,
        maxSize: 20,
        accept: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png'],
        disabled: formType === 'detail',
      },
      formItemClass: 'col-span-2',
@@ -121,18 +147,18 @@
      minWidth: 80,
    },
    {
      field: 'requestCount',
      title: '申请数量',
      field: 'count',
      title: '数量',
      minWidth: 120,
      fixed: 'right',
      slots: { default: 'requestCount' },
      slots: { default: 'count' },
    },
    {
      field: 'estimatedPrice',
      title: '预估单价',
      field: 'productPrice',
      title: '单价(参考价)',
      minWidth: 120,
      fixed: 'right',
      slots: { default: 'estimatedPrice' },
      slots: { default: 'productPrice' },
    },
    {
      field: 'totalPrice',
@@ -142,11 +168,18 @@
      formatter: 'formatAmount2',
    },
    {
      field: 'requiredDate',
      field: 'taxPercent',
      title: '税率(%)',
      minWidth: 100,
      fixed: 'right',
      slots: { default: 'taxPercent' },
    },
    {
      field: 'demandTime',
      title: '需求日期',
      minWidth: 140,
      fixed: 'right',
      slots: { default: 'requiredDate' },
      slots: { default: 'demandTime' },
    },
    {
      field: 'remark',
@@ -199,7 +232,7 @@
      },
    },
    {
      fieldName: 'requesterId',
      fieldName: 'requestUserId',
      label: '申请人',
      component: 'ApiSelect',
      componentProps: {
@@ -217,10 +250,11 @@
      component: 'Select',
      componentProps: {
        options: [
          { label: '待审批', value: 0 },
          { label: '已审批', value: 1 },
          { label: '已拒绝', value: 2 },
          { label: '已转订单', value: 3 },
          { label: '未提交', value: 0 },
          { label: '审批中', value: 10 },
          { label: '审核通过', value: 20 },
          { label: '审核不通过', value: 30 },
          { label: '已取消', value: 40 },
        ],
        placeholder: '请选择状态',
        allowClear: true,
@@ -255,15 +289,37 @@
      formatter: 'formatDate',
    },
    {
      field: 'requesterName',
      field: 'requestUserName',
      title: '申请人',
      minWidth: 120,
    },
    {
      field: 'estimatedAmount',
      field: 'requestDeptName',
      title: '申请部门',
      minWidth: 120,
    },
    {
      field: 'totalCount',
      title: '申请数量',
      minWidth: 120,
      formatter: 'formatAmount3',
    },
    {
      field: 'totalPrice',
      title: '预估金额',
      formatter: 'formatAmount2',
      minWidth: 120,
    },
    {
      field: 'productNames',
      title: '申请产品',
      minWidth: 150,
      showOverflow: 'tooltip',
    },
    {
      field: 'orderNo',
      title: '采购订单',
      minWidth: 180,
    },
    {
      field: 'status',
@@ -272,7 +328,7 @@
      slots: { default: 'status' },
    },
    {
      field: 'reason',
      field: 'requestReason',
      title: '申请理由',
      minWidth: 150,
      showOverflow: 'tooltip',
@@ -285,7 +341,7 @@
    },
    {
      title: '操作',
      width: 200,
      width: 240,
      fixed: 'right',
      slots: { default: 'actions' },
    },