tableData.tsx 2.25 KB
import { ref } from 'vue';
import { ROLE } from '../../../financeList/type.d';
import { queryNoOptions } from '/@/api/project/order';
import { useOrderInfo } from '/@/hooks/component/order';
import { useOrderStoreWithOut } from '/@/store/modules/order';
import { formatToDate } from '/@/utils/dateUtil';

// 角色
// 业务员- 查看all,编辑-利润分析,报告书
// 跟单员- 查看利润分析(单价和总金额),跟单,质检,编辑
// 质检员- 查看跟单,质检,编辑质检

const innerNoOptions = ref([]);
const projectNoOptions = ref([]);
const orderStore = useOrderStoreWithOut();
// const { productionDepartment: productionDepartmentOptions } = useOrderInfo(orderStore);

/**
 * drawer面板的字段
 */
// 基本信息
export const FIELDS_BASE_INFO = [
  {
    field: 'customerCode',
    component: 'Select',
    labelWidth: 150,
    label: '客户编码',
    rules: [{ required: true }],
  },
  {
    field: 'projectNo',
    component: 'Input',
    labelWidth: 150,
    label: '项目号',
    rules: [{ required: true }],
  },
  {
    field: 'productionDepartment',
    component: 'Select',
    // componentProps: {
    //   options: productionDepartmentOptions,
    // },
    labelWidth: 150,
    label: '生产科',
    rules: [{ required: true }],
  },

  {
    field: 'innerNo',
    component: 'Input',
    labelWidth: 150,
    label: '内部编号',
    rules: [
      { required: true },
      {
        validator: async (rule, value) => {
          if (value.includes(' ')) {
            return Promise.reject();
          }
          return Promise.resolve();
        },
        message: '内容存在空格,请检查',
        trigger: ['change', 'blur'],
      },
    ],
  },
  {
    field: 'customerPo',
    component: 'Input',
    labelWidth: 150,
    label: '客户po号',
    rules: [{ required: true }],
  },
  {
    field: 'customerStyle',
    component: 'Input',
    labelWidth: 150,
    label: '客户STYLE',
    rules: [
      { required: true },
      {
        validator: async (rule, value) => {
          if (value.includes(' ')) {
            return Promise.reject();
          }
          return Promise.resolve();
        },
        message: '内容存在空格,请检查',
        trigger: ['change', 'blur'],
      },
    ],
  },
];