data.tsx 4.34 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 { queryNoOptions } from '/@/api/project/order';
import { useOrderStoreWithOut } from '/@/store/modules/order';
import { useOrderInfo } from '/@/hooks/component/order';

const innerNoOptions = ref([]);
const projectNoOptions = ref([]);
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,
      mode: 'multiple',
      onSearch: async (value: any) => {
        projectNoOptions.value = await queryNoOptions('projectNo', value);
      },
      // onSearch: async (value: any) => {
      //   projectNoOptions.value = await queryNoOptions('projectNo', value);
      // },
    },
  },
  {
    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: 'settingValue',
//     width: 150,
//   },
//   {
//     title: '利润率',
//     dataIndex: 'relationValue',
//     width: 150,
//     editComponent: 'InputNumber',
//     editRow: true,
//     scopedSlots: { customRender: 'name' }
//   },
// ];
export const COLUMNS = [
  {
    title: '客户编码',
    dataIndex: 'customerCode',
    width: 150,
  },
  {
    title: '项目号',
    dataIndex: 'projectNo',
    width: 100,
  },
  {
    title: '生产科',
    dataIndex: 'productionDepartment',
    width: 100,
  },
  {
    title: '内部编号',
    dataIndex: 'innerNo',
    width: 100,
  },
  {
    title: '订单图片',
    dataIndex: 'picUrl',
    width: 100,
  },
  {
    title: '数量',
    dataIndex: 'orderCount',
    width: 100,
  },
  {
    title: '包装费用$',
    dataIndex: 'packetPrice',
    width: 120,
    customRender: (column) => {
      return column.record?.packetPrice?.toFixed(2);
    },
  },
  {
    title: '包装费用合计$',
    dataIndex: 'packetTotalPrice',
    width: 120,
    customRender: (column) => {
      return column.record?.packetTotalPrice?.toFixed(2);
    },
  },
  {
    title: '包装费用合计¥',
    dataIndex: 'packetRmbTotalPrice',
    width: 120,
    customRender: (column) => {
      return column.record?.packetRmbTotalPrice?.toFixed(2);
    },
  },
  {
    title: '包装费用实际金额¥',
    dataIndex: 'packetActualRmbTotalPrice',
    width: 150,
    customRender: (column) => {
      return column.record?.packetActualRmbTotalPrice?.toFixed(2);
    },
  },
  {
    title: '实际跟单单价¥',
    dataIndex: 'packetActualRmbPrice',
    width: 120,
    customRender: (column) => {
      return column.record?.packetActualRmbPrice?.toFixed(2);
    },
  },
  {
    title: '实际跟单单价折算美金$',
    dataIndex: 'packetActualPrice',
    width: 170,
    customRender: (column) => {
      return column.record?.packetActualPrice?.toFixed(2);
    },
  },
  {
    title: '包装费用收益¥',
    dataIndex: 'packetProfitRmbPrice',
    width: 120,
    customRender: (column) => {
      return column.record?.packetProfitRmbPrice?.toFixed(2);
    },
  },
  {
    title: '包装费用净利润率',
    dataIndex: 'packetProfitRate',
    width: 140,
    customRender: (column) => {
      if (column.record?.packetProfitRate) {
        return (column.record?.packetProfitRate * 100).toFixed(2) + '%';
      }
      return column.record?.packetProfitRate?.toFixed(2);
    },
  },
];