pay.data.tsx 3.22 KB
import { FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
import { icon } from 'ant-design-vue';
import { FolderAddOutlined, FilePptOutlined } from '@ant-design/icons-vue';
import { size } from 'lodash-es';

export const searchFormSchema: FormSchema[] = [
  {
    field: 'checkNo',
    label: '生产科对账单号',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'productionDepartment',
    label: '生产科',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'status',
    label: '总经理审核',
    component: 'Select',
    colProps: { span: 8 },
    componentProps: {
      options: [
        { label: '未提交审核', value: -1 },
        { label: '待审核', value: 0 },
        { label: '审核通过', value: 1 },
        { label: '审核驳回', value: 2 },
      ],
    },
  },
  {
    field: 'customerCode',
    label: '客户编码',
    component: 'Input',
    colProps: {
      span: 8,
    },
  },
];

export const columns: BasicColumn[] = [
  {
    title: '生产科对账单号',
    dataIndex: 'checkNo',
    width: 120,
  },
  {
    title: '生产科应付款日期',
    dataIndex: 'payedDate',
    width: 140,
  },
  {
    title: '生产科扣款金额¥',
    dataIndex: 'deductAmount',
    width: 160,
  },
  {
    title: '扣款责任部门',
    dataIndex: 'deductDept',
    width: 120,
  },
  {
    title: '上传扣款单',
    dataIndex: 'deductUrl',
    width: 120,
    customRender: (column) => {
      const deductUrl = column.record.deductUrl;
      if (deductUrl == undefined) {
        return;
      }
      return <FilePptOutlined style="font-size:25px" onClick={() => window.open(deductUrl)} />;
    },
  },
  {
    title: '生产科实际应付金额¥',
    dataIndex: 'actualPayedAmount',
    width: 180,
  },
  {
    title: '生产科发票上传',
    dataIndex: 'invoiceUrl',
    width: 80,
    customRender: (column) => {
      const deductUrl = column.record.invoiceUrl;
      if (deductUrl == undefined) {
        return;
      }
      return <FilePptOutlined style="font-size:25px" />;
    },
  },
  {
    title: '实际付款金额1¥',
    dataIndex: 'actualPayedAmount1',
    width: 160,
  },
  {
    title: '实际付款金额2¥',
    dataIndex: 'actualPayedAmount2',
    width: 160,
  },
  {
    title: '实际付款金额3¥',
    dataIndex: 'actualPayedAmount3',
    width: 160,
  },
  {
    title: '生产科发票审核',
    dataIndex: 'departmentInvoiceStatus',
    width: 120,
    customRender: (column) => {
      if (column.record.departmentInvoiceStatus == 0) {
        return '待审核';
      } else if (column.record.departmentInvoiceStatus == 10) {
        return '审核通过';
      } else if (column.record.departmentInvoiceStatus == 20) {
        return '审核驳回';
      }
    },
  },
  {
    title: '总经理审核',
    dataIndex: 'status',
    width: 120,
    customRender: (column) => {
      if (column.record.status == -1) {
        return '未提交审核';
      } else if (column.record.status == 0) {
        return '待审核';
      } else if (column.record.status == 10) {
        return '审核通过';
      } else if (column.record.status == 20) {
        return '审核驳回';
      }
    },
  },
];