gaoluyang
15 小时以前 cb9cd49627b65a4c0e137e08063271a8cefe1826
src/views/erp/purchase/request/data.ts
@@ -1,9 +1,8 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from '../../../../packages/constants/src';
import { getDictOptions } from '../../../../packages/effects/hooks/src';
import { erpPriceInputFormatter } from '../../../../packages/utils/src';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { getSupplierSimpleList } from '#/api/erp/purchase/supplier';
import { getSimpleUserList } from '#/api/system/user';
@@ -14,10 +13,11 @@
/** 状态常量 */
export const PURCHASE_REQUEST_STATUS = {
  PENDING: 0, // 待审批
  APPROVED: 1, // 已审批
  REJECTED: 2, // 已拒绝
  CONVERTED: 3, // 已转订单
  DRAFT: 0, // 未提交(草稿)
  PROCESSING: 10, // 审批中
  APPROVED: 20, // 审核通过
  REJECTED: 30, // 审核不通过
  CANCELLED: 40, // 已取消
};
/** 表单的配置项 */
@@ -66,14 +66,51 @@
        valueField: 'id',
        disabled: formType === 'detail',
      },
      rules: 'required',
    },
    {
      fieldName: 'reason',
      fieldName: 'discountPercent',
      label: '优惠率(%)',
      component: 'InputNumber',
      componentProps: {
        placeholder: '请输入优惠率',
        min: 0,
        max: 100,
        precision: 2,
        disabled: formType === 'detail',
      },
    },
    {
      fieldName: 'depositPrice',
      label: '定金',
      component: 'InputNumber',
      componentProps: {
        placeholder: '请输入定金',
        min: 0,
        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',
@@ -111,28 +148,30 @@
      slots: { default: 'productId' },
    },
    {
      field: 'productBarCode',
      title: '条码',
      minWidth: 120,
    },
    {
      field: 'productUnitName',
      title: '单位',
      minWidth: 80,
    },
    {
      field: 'requestCount',
      title: '申请数量',
      field: 'count',
      title: '数量',
      minWidth: 120,
      fixed: 'right',
      slots: { default: 'requestCount' },
      slots: { default: 'count' },
    },
    {
      field: 'estimatedPrice',
      title: '预估单价',
      field: 'inCount',
      title: '入库数量',
      minWidth: 100,
      fixed: 'right',
      formatter: 'formatAmount6',
    },
    {
      field: 'productPrice',
      title: '单价(参考价)',
      minWidth: 120,
      fixed: 'right',
      slots: { default: 'estimatedPrice' },
      slots: { default: 'productPrice' },
    },
    {
      field: 'totalPrice',
@@ -142,17 +181,31 @@
      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',
      title: '备注',
      minWidth: 150,
      slots: { default: 'remark' },
    },
    {
      field: 'qcCheckFlag',
      title: '是否质检',
      minWidth: 80,
      fixed: 'right',
      slots: { default: 'qcCheckFlag' },
    },
    {
      title: '操作',
@@ -199,7 +252,7 @@
      },
    },
    {
      fieldName: 'requesterId',
      fieldName: 'requestUserId',
      label: '申请人',
      component: 'ApiSelect',
      componentProps: {
@@ -217,10 +270,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 +309,43 @@
      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: 'depositPrice',
      title: '定金',
      formatter: 'formatAmount2',
      minWidth: 120,
    },
    {
      field: 'productNames',
      title: '申请产品',
      minWidth: 150,
      showOverflow: 'tooltip',
    },
    {
      field: 'orderNo',
      title: '采购订单',
      minWidth: 180,
    },
    {
      field: 'status',
@@ -272,7 +354,13 @@
      slots: { default: 'status' },
    },
    {
      field: 'reason',
      field: 'inStatus',
      title: '入库状态',
      minWidth: 100,
      slots: { default: 'inStatus' },
    },
    {
      field: 'requestReason',
      title: '申请理由',
      minWidth: 150,
      showOverflow: 'tooltip',
@@ -285,7 +373,7 @@
    },
    {
      title: '操作',
      width: 200,
      width: 240,
      fixed: 'right',
      slots: { default: 'actions' },
    },