data.tsx 6.06 KB
import { InputNumber, Tag } from 'ant-design-vue';
import { BasicColumn } from '@/components/Table';
import { func } from 'vue-types';
import { h, ref } from 'vue';
import { FilePptOutlined } from '@ant-design/icons-vue';
import axios from 'axios';
import { queryNoOptions } from '/@/api/project/order';
import { useOrderStoreWithOut } from '/@/store/modules/order';
import { useOrderInfo } from '/@/hooks/component/order';
import { useUserStoreWithOut } from '/@/store/modules/user';

const userStore = useUserStoreWithOut();
// export const COLUMNS = [
//   {
//     title: '客户编码',
//     dataIndex: 'settingValue',
//     width: 150,
//   },
//   {
//     title: '利润率',
//     dataIndex: 'relationValue',
//     width: 150,
//     editComponent: 'InputNumber',
//     editRow: true,
//     scopedSlots: { customRender: 'name' }
//   },
// ];
const innerNoOptions = ref([]);
const projectNoOptions = ref([]);
const allProjectNoOptions = ref<any[]>([]);
export { allProjectNoOptions };
const orderStore = useOrderStoreWithOut();
const {
  customerCode,
  productionDepartment,
} = useOrderInfo(orderStore);
export const searchFormSchema = [
  {
    field: 'customerCode',
    label: '客户编码',
    component: 'Select',
    colProps: { span: 8 },

    componentProps: {
      options: customerCode,
      showSearch: true,
      mode: 'multiple',
    },
  },
  {
    field: 'projectNo',
    label: '项目号',
    component: 'Select',
    colProps: { span: 8 },

    componentProps: {
      options: projectNoOptions,
      showSearch: true,
      filterOption: false,
      mode: 'multiple',
      onSearch: async (value: any) => {
        if (!value || value.trim() === '') {
          return;
        }
        const result = await queryNoOptions('projectNo', value);
        projectNoOptions.value = result;
        allProjectNoOptions.value = result;
      },
    },
  },
  {
    field: 'productionDepartment',
    label: '生产科',
    component: 'Select',
    colProps: { span: 8 },

    componentProps: {
      mode: 'multiple',

      options: productionDepartment,
      showSearch: true,
    },
  },
  {
    field: 'innerNo',
    label: '内部编号',
    component: 'Select',
    colProps: { span: 8 },

    componentProps: {
      options: innerNoOptions,
      showSearch: true,
      mode: 'multiple',
      onSearch: async (value: any) => {
        innerNoOptions.value = await queryNoOptions('innerNo', value);
      },
    },
  },
  {
    field: 'developmentStatus',
    label: '状态',
    component: 'Select',
    colProps: { span: 8 },

    componentProps: {
      options: [ {
        label: '未完成',
        value: -1,
      },{
        label: '待审核',
        value: 0,
      }, {
        label: '已发放',
        value: 1,
      }, {
        label: '应发但不发',
        value: 2,
      }],
    },
  },
  // {
  //   field: 'productionDepartment',
  //   label: '生产科',
  //   component: 'Select',
  //   colProps: { span: 8 },

  //   componentProps: {
  //     mode: 'multiple',

  //     options: productionDepartment,
  //     showSearch: true,
  //   },
  // },
  // {
  //   field: 'innerNo',
  //   label: '内部编号',
  //   component: 'Select',
  //   colProps: { span: 8 },

  //   componentProps: {
  //     options: innerNoOptions,
  //     showSearch: true,
  //     mode: 'multiple',
  //     onSearch: async (value: any) => {
  //       innerNoOptions.value = await queryNoOptions('innerNo', value);
  //     },
  //   },
  // },
]
export const COLUMNS = [
  {
    title: '客户编码',
    dataIndex: 'customerCode',
    width: 150,
  },
  {
    title: '项目号',
    dataIndex: 'projectNoPrefix',
    // dataIndex: 'projectNo',
    width: 140,
  },
  {
    title: '订单总数量',
    dataIndex: 'orderCount',
    width: 120,
    customRender: (column) => {
      return column.record?.orderCount;
    },
  },
  {
    title: '客户总金额¥',
    width: 150,
    dataIndex: 'customerTotalPrice',
    customRender: (column) => {
      return column.record?.customerRmbTotalPrice?.toFixed(2);
    },
  },
  {
    title: '客户总金额$',
    width: 150,
    dataIndex: 'customerTotalPrice',
    customRender: (column) => {
      return column.record?.customerTotalPrice?.toFixed(2);
    },
  },
  {
    title: '西班牙提成¥',
    dataIndex: 'spainRmbCommission',
    width: 150,
    customRender: (column) => {
      return column.record?.spainRmbCommission?.toFixed(2);
    },
  },
  {
    title: '已发提成¥',
    dataIndex: 'spainPaidRmbCommission',
    width: 120,
    customRender: (column) => {
      return column.record?.spainPaidRmbCommission?.toFixed(2);
    },
  },
  {
    title: '未发提成¥',
    dataIndex: 'spainUnpaidRmbCommission',
    width: 120,
    customRender: (column) => {
      return column.record?.spainUnpaidRmbCommission?.toFixed(2);
    },
  },
  {
    title: '中国团队提成¥',
    dataIndex: 'rmbCommission',
    width: 150,
    customRender: (column) => {
      return column.record?.rmbCommission?.toFixed(2);
    },
  },
  {
    title: '已发提成¥',
    dataIndex: 'paidRmbCommission',
    width: 120,
    customRender: (column) => {
      return column.record?.paidRmbCommission?.toFixed(2);
    },
  },
  {
    title: '未发提成¥',
    dataIndex: 'unpaidRmbCommission',
    width: 120,
    customRender: (column) => {
      return column.record?.unpaidRmbCommission?.toFixed(2);
    },
  },
  {
    title: '提成合计¥',
    dataIndex: 'rmbTotalExpense',
    width: 120,
    customRender: (column) => {
      return column.record?.rmbTotalExpense?.toFixed(2);
    },
  },
  {
    title: '状态',
    dataIndex: 'detailDevelopmentStatus',
    width: 120,
    customRender: (column) => {
      if (column.record?.detailDevelopmentStatus === null || column.record?.detailDevelopmentStatus === -1) {
        return '未完成';
      } else if (column.record?.detailDevelopmentStatus === 0) {
        return '待审核';
      } else if (column.record?.detailDevelopmentStatus === 1) {
        return '已发放';
      } else if (column.record?.detailDevelopmentStatus === 2) {
        return '应发但不发';
      }
    },
  },
];