tableData.tsx 17.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821
import { useOrderInfo } from '/@/hooks/component/order';
import { useOrderStoreWithOut } from '/@/store/modules/order';

export function getOrderColumns() {
  return [
    {
      title: '客户编码',
      width: 150,
      dataIndex: 'customerCode',
    },
    {
      title: '项目号',
      width: 150,
      dataIndex: 'projectNo',
    },
    {
      title: '生产科',
      width: 150,
      dataIndex: 'productionDepartment',
    },
    {
      title: '内部编号',
      width: 150,
      dataIndex: 'innerNo',
    },
    {
      title: '客户po号',
      width: 150,
      dataIndex: 'customerPo',
    },

    {
      title: '客户STYLE',
      width: 150,
      dataIndex: 'customerStyle',
    },

    {
      title: 'Modelo(REFERENCE)',
      width: 150,
      dataIndex: 'modeleLo',
    },

    {
      title: 'COLLECTION (style description)',
      width: 150,
      dataIndex: 'collection',
    },

    {
      title: 'PO COLOR',
      width: 150,
      dataIndex: 'poColor',
    },
    {
      title: '颜色中文',
      width: 150,
      dataIndex: 'cnColor',
    },

    {
      title: '图片',
      width: 150,
      dataIndex: 'picUrl',
    },
    {
      title: '生产要求',
      width: 150,
      dataIndex: 'productionComment',
    },
    {
      title: '数量',
      width: 150,
      dataIndex: 'orderCount',
    },
    {
      title: '订单成分',
      width: 150,
      dataIndex: 'orderComposition',
    },
    {
      title: '款式类型',
      width: 150,
      dataIndex: 'productStyle',
    },
    {
      title: '生成科拖货时间',
      width: 150,
      dataIndex: 'productionDepartmentConsignTime',
    },
    {
      title: '订单上HOD时间',
      width: 150,
      dataIndex: 'orderHodTime',
    },

    {
      title: '出库类型',
      width: 150,
      dataIndex: 'outboundType',
    },
    {
      title: '包装类型',
      width: 150,
      dataIndex: 'packetType',
    },
    // {
    //   title: 'id',
    //   width: 150,
    //   dataIndex: 'id',
    // },
    {
      title: '项目完成报告信息',
      width: 150,
      dataIndex: 'reportInfo',
      children: [
        {
          title: '想法来源',
          width: 150,
          dataIndex: 'reportInfo.ideaSource',
          customRender: (column) => {
            const { record } = column || {};
            return record?.reportInfo?.ideaSource;
          },
        },
        {
          title: '手工初型',
          width: 150,
          dataIndex: 'reportInfo.manualPreform',
          customRender: (column) => {
            const { record } = column || {};
            return record?.reportInfo?.manualPreform;
          },
        },
        {
          title: '想法和手工比例分配',
          width: 150,
          dataIndex: 'reportInfo.ideaManualRate',
          customRender: (column) => {
            const { record } = column || {};
            return record?.reportInfo?.ideaManualRate;
          },
        },
      ],
    },
    {
      title: '利润分析信息',
      width: 150,
      dataIndex: 'profitAnalysisInfo',
      children: [
        {
          title: '客户单价',
          width: 150,
          dataIndex: 'profitAnalysisInfo.customerPrice',
          customRender: (column) => {
            const { record } = column || {};
            return record?.profitAnalysisInfo?.customerPrice;
          },
        },
        {
          title: '客户总价',
          width: 150,
          dataIndex: 'profitAnalysisInfo.customerTotalPrice',
          customRender: (column) => {
            const { record } = column || {};
            return record?.profitAnalysisInfo?.customerTotalPrice;
          },
        },
        {
          title: '生成科单价',
          width: 150,
          dataIndex: 'profitAnalysisInfo.productionDepartmentPrice',
          customRender: (column) => {
            const { record } = column || {};
            return record?.profitAnalysisInfo?.productionDepartmentPrice;
          },
        },
        {
          title: '包装费用',
          width: 150,
          dataIndex: 'profitAnalysisInfo.packetPrice',
          customRender: (column) => {
            const { record } = column || {};
            return record?.profitAnalysisInfo?.packetPrice;
          },
        },
        {
          title: '包装费用合计',
          width: 150,
          dataIndex: 'profitAnalysisInfo.packetTotalPrice',
          customRender: (column) => {
            const { record } = column || {};
            return record?.profitAnalysisInfo?.packetTotalPrice;
          },
        },
        {
          title: '汇率',
          width: 150,
          dataIndex: 'profitAnalysisInfo.exchangeRate',
          customRender: (column) => {
            const { record } = column || {};
            return record?.profitAnalysisInfo?.exchangeRate;
          },
        },
        {
          title: '利润率',
          width: 150,
          dataIndex: 'profitAnalysisInfo.profitRate',
          customRender: (column) => {
            const { record } = column || {};
            return record?.profitAnalysisInfo?.profitRate;
          },
        },
      ],
    },
    {
      title: '跟单信息',
      width: 150,
      dataIndex: 'trackStageInfo',
      children: [
        {
          title: 'pp date',
          width: 150,
          dataIndex: 'ppTime',
        },
        {
          title: 'pp样品确认意见',
          width: 150,
          dataIndex: 'ppConfirmResult',
        },
        {
          title: 'EXTRA,SHOWROOM,ONLINE sample发送时间',
          width: 250,
          dataIndex: 'esoSampleSendTime',
        },
        {
          title: 'shippment sample 发送时间',
          width: 150,
          dataIndex: 'shippmentSampleSendTime',
        },
        {
          title: 'shipment sample确认意见',
          width: 150,
          dataIndex: 'shippmentSampleConfirmResult',
        },
        {
          title: '自测通过时间',
          width: 150,
          dataIndex: 'selfTestPassTime',
        },
        {
          title: 'Aitex测试发送时间',
          width: 150,
          dataIndex: 'aitexTestSendTime',
        },
        {
          title: 'Aitex测试结果',
          width: 150,
          dataIndex: 'aitexTestFinishResult',
        },
        {
          title: 'SGS测试发送时间',
          width: 150,
          dataIndex: 'sgsTestSendTime',
        },
        {
          title: 'SGS测试结果',
          width: 150,
          dataIndex: 'sgsTestFinishResult',
        },

        {
          title: 'Barcode sticker arrival time',
          width: 150,
          dataIndex: 'barcodeStickerArrivalTime',
        },
        {
          title: '最晚包材到货时间',
          width: 150,
          dataIndex: 'latestArrivalTime',
        },
        {
          title: '最晚订舱+报关资料时间',
          width: 150,
          dataIndex: 'latestBkTime',
        },
      ],
    },
    {
      title: '质检信息',
      width: 150,
      dataIndex: 'inspectionStageInfo',
      children: [
        {
          title: '中期验货申请时间',
          width: 150,
          dataIndex: 'endCheckApplyTime',
        },
        {
          title: '中期验货(功能性-拉力/跌落等、外观性-颜色/规格等、耐久性-烤厅等)',
          width: 300,
          dataIndex: 'midCheckComment',
        },
        {
          title: '中期验货结果PASS / FAIL',
          width: 150,
          dataIndex: 'midCheckResult',
        },
        {
          title: '尾期验货申请时间',
          width: 150,
          dataIndex: 'endCheckApplyTime',
        },

        {
          title: 'midCheckApplyTime',
          width: 150,
          dataIndex: 'midCheckApplyTime',
        },
        {
          title: '长度/规格',
          width: 150,
          dataIndex: 'specification',
        },
        {
          title: '功能性不良',
          width: 150,
          dataIndex: 'functionality',
        },
        {
          title: '电镀不良',
          width: 150,
          dataIndex: 'electroplate',
        },
        {
          title: '不良1',
          width: 150,
          dataIndex: 'value1',
        },

        {
          title: '不良2',
          width: 150,
          dataIndex: 'value2',
        },
        {
          title: '其他不良3',
          width: 150,
          dataIndex: 'value3',
        },
        {
          title: '包装:卡片、条码、箱贴,箱单	',
          width: 150,
          dataIndex: 'boxPacket',
        },
        {
          title: '尾期验货结果PASS / FAIL',
          width: 150,
          dataIndex: 'endCheckResult',
        },
      ],
    },
  ];
}
// 基本信息
export const FIELDS_BASE_INFO = [
  {
    field: 'customerCode',
    component: 'Select',
    label: '客户编码',
    rules: [{ required: true }],
  },
  {
    field: 'projectNo',
    component: 'Select',
    label: '项目号',
    rules: [{ required: true }],
  },
  {
    field: 'productionDepartment',
    component: 'Select',
    label: '生产科',
    rules: [{ required: true }],
  },
  {
    field: 'innerNo',
    component: 'Select',
    label: '内部编号',
    rules: [{ required: true }],
  },
  {
    field: 'customerPo',
    component: 'Input',
    label: '客户po号',
    rules: [{ required: true }],
  },
  {
    field: 'customerStyle',
    component: 'Input',
    label: '客户STYLE',
    rules: [{ required: true }],
  },
  {
    field: 'collection',
    component: 'Input',
    label: 'COLLECTION (style description)',
    rules: [{ required: true }],
  },
  {
    field: 'poColor',
    component: 'Select',
    label: 'PO COLOR',
    rules: [{ required: true }],
  },
  {
    field: 'cnColor',
    component: 'Select',
    label: '颜色中文',
    rules: [{ required: true }],
  },
  {
    field: 'picUrl',
    component: 'FieldUpload',
    label: '图片',
    rules: [{ required: true }],
  },
  {
    field: 'productionComment',
    component: 'Input',
    rules: [{ required: true }],
    label: '生产要求',
  },
  {
    field: 'orderCount',
    component: 'InputNumber',
    rules: [{ required: true }],
    label: '数量',
  },
  {
    field: 'orderComposition',
    component: 'Input',
    rules: [{ required: true }],
    label: '订单成分',
  },
  {
    field: 'productStyle',
    component: 'Select',
    rules: [{ required: true }],
    label: '款式类型',
  },
  {
    field: 'productionDepartmentConsignTime',
    component: 'DatePicker',
    label: '生成科拖货时间',
    rules: [{ required: true }],
  },
  {
    field: 'orderHodTime',
    component: 'DatePicker',
    label: '订单上HOD时间',

    rules: [{ required: true }],
  },
  {
    field: 'outboundType',
    component: 'Select',
    label: '出库类型',

    rules: [{ required: true }],
  },
  {
    field: 'packetType',
    component: 'Select',
    label: '包装类型',
    rules: [{ required: true }],
  },
];

//项目完成报告信息
export const FIELDS_REPORT_INFO = [
  {
    field: 'ideaSource',
    component: 'Select',
    optionField: 'ideaSource',
    label: '想法来源',
    rules: [{ required: true }],
  },
  {
    field: 'manualPreform',
    component: 'Select',
    optionField: 'manualPreform',
    label: '手工初型',
    rules: [{ required: true }],
  },
  {
    field: 'ideaManualRate',
    component: 'Input',
    label: '想法和手工比例分配',
    rules: [{ required: true }],
  },
];

// 跟单信息
export const FIELDS_TRACK_STAGE_INFO = [
  {
    field: 'ppTime',
    component: 'DatePicker',
    label: 'pp date',
  },
  {
    field: 'ppConfirmResult',
    component: 'Select',
    componentProps: {
      options: [
        {
          label: 'ok',
          value: 'ok',
        },
      ],
    },
    label: 'pp样品确认意见	',
  },
  {
    field: 'esoSampleSendTime',
    component: 'DatePicker',
    label: 'EXTRA,SHOWROOM,ONLINE sample发送时间',
  },
  {
    field: 'shippmentSampleSendTime',
    component: 'DatePicker',
    label: 'shippment sample 发送时间',
  },
  {
    field: 'shippmentSampleConfirmResult',
    component: 'Select',
    componentProps: {
      options: [
        {
          label: 'ok',
          value: 'ok',
        },
      ],
    },
    label: 'shipment sample确认意见',
  },
  {
    field: 'selfTestPassTime',
    component: 'DatePicker',
    label: '自测通过时间',
  },
  {
    field: 'aitexTestSendTime',
    component: 'DatePicker',
    label: 'Aitex测试发送时间',
  },
  {
    field: 'aitexTestFinishResult',
    component: 'Select',
    label: 'Aitex测试结果',
    componentProps: {
      options: [
        {
          label: 'ok',
          value: 'ok',
        },
      ],
    },
  },
  {
    field: 'sgsTestSendTime',
    component: 'DatePicker',
    label: 'SGS测试发送时间',
  },
  {
    field: 'sgsTestFinishResult',
    component: 'Select',
    label: 'SGS测试结果',
    componentProps: {
      options: [
        {
          label: 'ok',
          value: 'ok',
        },
      ],
    },
  },
  {
    field: 'barcodeStickerArrivalTime',
    component: 'DatePicker',
    label: 'Barcode sticker arrival time',
    componentProps: {
      options: [
        {
          label: 'ok',
          value: 'ok',
        },
      ],
    },
  },
  {
    field: 'latestArrivalTime',
    component: 'Select',
    componentProps: {
      options: [
        {
          label: 'ok',
          value: 'ok',
        },
      ],
    },
    label: '最晚包材到货时间',
  },
  {
    field: 'latestBkTime',
    component: 'Select',
    componentProps: {
      options: [
        {
          label: 'ok',
          value: 'ok',
        },
      ],
    },
    label: '最晚订舱+报关资料时间',
  },
];

// 利润分析
export const FIELDS_PROFIT_INFO = [
  {
    field: 'customerPrice',
    component: 'InputNumber',
    label: '客户单价',
    rules: [{ required: true }],
  },
  {
    field: 'customerCurrency',
    component: 'Select',
    label: '客户单价单位',
    rules: [{ required: true }],
    componentProps: {
      options: [
        { label: '$', value: '$' },
        { label: '¥', value: '¥' },
      ],
    },
  },
  {
    field: 'customerTotalPrice',
    component: 'InputNumber',
    label: '客户总价',
    rules: [{ required: true }],
  },
  {
    field: 'customerTotalCurrency',
    component: 'Select',
    label: '客户总价单位',
    rules: [{ required: true }],
    componentProps: {
      options: [
        { label: '$', value: '$' },
        { label: '¥', value: '¥' },
      ],
    },
  },
  {
    field: 'productionDepartmentPrice',
    component: 'InputNumber',
    label: '生成科单价¥',
    rules: [{ required: true }],
  },
  // {
  //   field: 'productionDepartmentPrice',
  //   component: 'InputNumber',
  //   label: '生成科总价¥',
  //   rules: [{ required: true }],
  // },
  // {
  //   label: '包装费用$',
  //   component: 'InputNumber',
  //   field: 'packetPrice',
  //   rules: [{ required: true }],
  // },
  {
    label: '包装费用合计$',
    component: 'InputNumber',
    field: 'packetTotalPrice',
    rules: [{ required: true }],
  },
  {
    label: '包装费用合计单位',
    component: 'Select',
    field: 'packetCurrency',
    rules: [{ required: true }],
    componentProps: {
      options: [
        { label: '$', value: '$' },
        { label: '¥', value: '¥' },
      ],
    },
  },
  {
    label: '汇率',
    component: 'InputNumber',
    field: 'exchangeRate',
    rules: [{ required: true }],
  },
  // {
  //   label: '利润率',
  //   component: 'Input',
  //   field: 'profitRate',
  //   rules: [{ required: true }],
  // },
];

//质量检测信息
export const FIELDS_INSPECTION_INFO = [
  {
    field: 'inspectionStageInfo.midCheckApplyTime',
    component: 'DatePicker',
    label: '中期验货申请时间',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.midCheckComment',
    component: 'Input',
    label: '中期验货(功能性-拉力/跌落等、外观性-颜色/规格等、耐久性-烤厅等)',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.midCheckResult',
    component: 'Select',
    optionField: 'midCheckResult',

    label: '中期验货结果PASS / FAIL',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.specification',
    component: 'Input',
    label: '长度/规格',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.functionality',
    component: 'Input',
    label: '功能性不良',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.electroplate',
    component: 'Input',
    label: '电镀不良',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.value1',
    component: 'Input',
    label: '不良1',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.value2',
    component: 'Input',
    label: '不良2',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.value3',
    component: 'Input',
    label: '其他不良3',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.boxPacket',
    component: 'Input',
    label: '包装:卡片、条码、箱贴,箱单',
    rules: [{ required: true }],
  },
  {
    field: 'inspectionStageInfo.endCheckResult',
    component: 'Select',
    label: '尾期验货结果PASS / FAIL',
    optionField: 'endCheckResult',
    rules: [{ required: true }],
  },
];

export function getFormConfig(): Partial<FormProps> {
  const orderStore = useOrderStoreWithOut();

  const {
    customerCode,
    projectNo,
    productionDepartment,
    innerNo,
    poColor,
    cnColor,
    productStyle,
    outboundType,
    packetType,
  } = useOrderInfo(orderStore);

  return {
    labelWidth: 100,
    schemas: [
      {
        field: `customerCode`,
        label: `客户编码`,
        component: 'Select',
        colProps: {
          xl: 12,
          xxl: 8,
        },
        componentProps: {
          options: customerCode,
        },
      },
    ],
  };
}