fields.js 28.8 KB
Newer Older
krysent's avatar
krysent committed
1 2 3 4
import { factorySelect, shopSelectByFactory } from "@/services/system";
import { doFetch } from "@/utils/doFetch";
import { Button, Table } from "antd";
import EditTable from "@/components/EditTable";
krysent's avatar
krysent committed
5 6
import { useEffect, useState } from "react";
import { useModel } from "umi";
krysent's avatar
krysent committed
7 8 9

const EditUpload = ({ record, fid, storeId }) => {
  const [value, setvalue] = useState({
krysent's avatar
krysent committed
10
    [record.id]: record.downloadList,
krysent's avatar
krysent committed
11 12 13 14
  });
  const { initialState, setInitialState } = useModel("@@initialState");
  useEffect(() => {
    if (!value) {
krysent's avatar
krysent committed
15
      return;
krysent's avatar
krysent committed
16
    }
krysent's avatar
krysent committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
    let newlist =
      Object.keys(value)?.map?.((it) => {
        let id = it;
        let newArr = value[id]?.filter((it) => typeof it.id == "number") ?? [];
        return {
          id,
          downloadList: newArr.map((its) => {
            return {
              storePositionId: its?.storePositionId,
              outstroeNum: its?.outstroeNum,
              stockNum: its?.stockNum,
              remark: its?.remark,
              materieControlNo: its?.materieControlNo,
            };
          }),
        };
      }) ?? [];
    setInitialState((s) => {
krysent's avatar
krysent committed
35 36 37 38
      return {
        ...s,
        submits: {
          id: fid,
krysent's avatar
krysent committed
39 40 41 42 43 44 45 46 47 48 49 50 51
          materialList:
            s.submits && s?.submits?.materialList
              ? s?.submits?.materialList
                  ?.filter(
                    (it) => newlist.map((item) => item.id).indexOf(it.id) == -1
                  )
                  ?.concat(newlist)
                  ?.filter((it) => it.downloadList?.length > 0)
              : [],
        },
      };
    });
  }, [value]);
krysent's avatar
krysent committed
52

krysent's avatar
krysent committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
  return (
    <EditTable
      rowKey="id"
      maxLength={1000}
      linkconfig={{
        urlchangeval: {
          database: (params) =>
            doFetch({
              url: "/ngic-workmanship/wmsMaterieStore/queryStoreOne",
              params,
            }),
          params: { storePositionId: "linked", materieControlNo: "linked" },
          effectresult: {
            supplierNo: "supplierNo",
            supplierName: "supplierName",
            stockNum: "stroeNum",
            materieControlNo: "materieControlNo",
          },
krysent's avatar
krysent committed
71
        },
krysent's avatar
krysent committed
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
      }}
      style={{ marginLeft: 48 }}
      columns={[
        {
          title: "库位名称",
          dataIndex: "storePositionName",
          key: "storePositionId",
          search: false,
          valueType: "select",
          request: async (params) => {
            let res = await doFetch({
              url: "/ngic-auth/sysStorePosition/queryByStoreId/selection",
              params: { storeId: params.storeId },
            });
            return res?.data?.dataList;
          },
          editable: (text, record, index) => {
            return !record.materieOutstoreDetailId;
          },
          params: { storeId: storeId },
          formItemProps: () => {
            return {
              rules: [{ required: true, message: "此项为必填项" }],
            };
          },
        },
        {
krysent's avatar
krysent committed
99
          title: "批次号",
krysent's avatar
krysent committed
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
          dataIndex: "materieControlNo",
          key: "materieControlNo",
          search: false,
          valueType: "select",
          request: async (params) => {
            let res = await doFetch({
              url: "/ngic-workmanship/wmsMaterieStore/queryPCList",
              params: {
                materieId: params.materieId,
                storePositionId: params.storePositionId,
              },
            });
            return res?.data?.dataList;
          },
          editable: (text, record, index) => {
            return !record.materieOutstoreDetailId;
          },
          params: (row) => {
            return {
              materieId: record.materieId,
              storePositionId: row.storePositionId,
            };
          },
          width: 200,
        },
        {
          title: "下架数量",
          dataIndex: "outstroeNum",
          key: "outstroeNum",
          search: false,
          editable: (text, record, index) => {
            return !record.materieOutstoreDetailId;
          },
          valueType: "digit",
        },
        {
          title: "供应商编号",
          dataIndex: "supplierNo",
          key: "supplierNo",
          search: false,
          readonly: true,
        },
        {
          title: "供应商名称",
          dataIndex: "supplierName",
          key: "supplierName",
          search: false,
          readonly: true,
        },
        {
          title: "库存数量",
          dataIndex: "stockNum",
          key: "stockNum",
          search: false,
          readonly: true,
        },
        {
          title: "备注",
          dataIndex: "remark",
          key: "remark",
          search: false,
          editable: (text, record, index) => {
            return !record.materieOutstoreDetailId;
          },
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
            <a key="delete" onClick={() => {}}>
              删除
            </a>,
          ],
        },
      ]}
      value={value[record.id]}
      onChange={(vals) => {
        setvalue((s) => ({
          ...s,
          [record.id]: vals,
        }));
      }}
      pagination={false}
    />
  );
};
krysent's avatar
krysent committed
187 188

const one = {
krysent's avatar
krysent committed
189 190 191 192 193 194 195
    materieOutstoreNo: {
      value: null,
      type: "input",
      title: "出库单号",
      name: ["materieOutstoreNo"],
      required: false,
      placeholder: "不填写系统自动生成",
krysent's avatar
krysent committed
196
    },
krysent's avatar
krysent committed
197 198 199 200 201 202 203 204 205 206 207 208 209
    storeId: {
      value: null,
      type: "select",
      title: "出库仓库",
      name: ["storeId"],
      required: true,
      options: {
        database: () =>
          doFetch({
            url: "/ngic-auth/sysStore/selectionBox",
            params: { factoryIdList: [] },
          }),
        params: {},
krysent's avatar
krysent committed
210
      },
krysent's avatar
krysent committed
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
      linked: true,
    },
    businessNo: {
      value: null,
      type: "input",
      title: "相关单号",
      name: ["businessNo"],
      required: false,
    },
    remark: {
      value: null,
      type: "textarea",
      title: "备注",
      name: ["remark"],
      required: false,
      col: {
        span: 24,
krysent's avatar
krysent committed
228
      },
krysent's avatar
krysent committed
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
    },
    materialList: {
      value: [],
      title: "物料信息",
      type: "table",
      col: { span: 24 },
      name: ["materialList"],
      required: true,
      linkconfig: {
        urlchangeval: {
          //根据url接口 改变某个value
          database: (params) =>
            doFetch({
              url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne",
              params,
            }),
          params: { materieId: "linked" },
          effectresult: {
            productionUnit: "productionUnit", //key 为列表更新值  value为response 返回值
            productionUnitName: "productionUnitName",
            usableNum: "usableNum",
            outstroeNum: "outstroeNum",
          },
        },
krysent's avatar
krysent committed
253
      },
krysent's avatar
krysent committed
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
      columns: [
        {
          title: (
            <span>
              物料编码-名称 <b style={{ color: "red" }}>*</b>
            </span>
          ),
          dataIndex: "materieId",
          key: "materieId",
          valueType: "select",
          request: async () => {
            let res = await doFetch({
              url: "/ngic-workmanship/pmMaterie/query/selectbox",
              params: {},
            });
            return res?.data?.dataList;
          },
          fieldProps: {
            allowClear: true,
            showSearch: true,
          },
          formItemProps: () => {
            return {
              rules: [{ required: true, message: "此项为必填项" }],
            };
          },
          editable: true,
        },
        {
          title: (
            <span>
              出库数量 <b style={{ color: "red" }}>*</b>
            </span>
          ),
          dataIndex: "outstroeNum",
          key: "outstroeNum",
          formItemProps: () => {
            return {
              rules: [{ required: true, message: "此项为必填项" }],
            };
          },
          valueType: "digit",
          editable: true,
        },
        {
          title: "可用库存",
          dataIndex: "usableNum",
          key: "usableNum",
          readonly: "usableNum",
        },
        {
          title: "库存单位",
          dataIndex: "productionUnitName",
          key: "productionUnitName",
          readonly: "productionUnitName",
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
            <a key="delete" onClick={() => {}}>
              删除
            </a>,
          ],
        },
krysent's avatar
krysent committed
320
      ],
krysent's avatar
krysent committed
321
      rowKey: "id",
krysent's avatar
krysent committed
322
    },
krysent's avatar
krysent committed
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
  },
  two = {
    materieOutstoreNo: {
      value: null,
      type: "input",
      title: "出库单号",
      name: ["materieOutstoreNo"],
      required: false,
      placeholder: "不填写系统自动生成",
    },
    storeId: {
      value: null,
      type: "select",
      title: "出库仓库",
      name: ["storeId"],
      required: true,
      options: {
        database: () =>
          doFetch({
            url: "/ngic-auth/sysStore/selectionBox",
            params: { factoryIdList: [] },
          }),
        params: {},
krysent's avatar
krysent committed
346 347
      },
    },
krysent's avatar
krysent committed
348 349 350 351 352 353
    businessNo: {
      value: null,
      type: "input",
      title: "相关单号",
      name: ["businessNo"],
      required: false,
krysent's avatar
krysent committed
354
    },
krysent's avatar
krysent committed
355 356 357 358 359 360 361 362 363
    remark: {
      value: null,
      type: "textarea",
      title: "备注",
      name: ["remark"],
      required: false,
      col: {
        span: 24,
      },
krysent's avatar
krysent committed
364
    },
krysent's avatar
krysent committed
365
    materialList: {
krysent's avatar
krysent committed
366 367 368 369 370 371 372
      value: [],
      title: "物料信息",
      type: "table",
      col: { span: 24 },
      name: ["materialList"],
      required: true,
      linkconfig: {
krysent's avatar
krysent committed
373 374 375 376 377 378 379 380
        urlchangeval: {
          //根据url接口 改变某个value
          database: (params) =>
            doFetch({
              url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne",
              params,
            }),
          params: { materieId: "linked" },
krysent's avatar
krysent committed
381
          effectresult: {
krysent's avatar
krysent committed
382 383 384 385 386 387
            productionUnit: "productionUnit", //key 为列表更新值  value为response 返回值
            productionUnitName: "productionUnitName",
            usableNum: "usableNum",
            outstroeNum: "outstroeNum",
          },
        },
krysent's avatar
krysent committed
388 389 390
      },
      columns: [
        {
krysent's avatar
krysent committed
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
          title: (
            <span>
              物料编码-名称 <b style={{ color: "red" }}>*</b>
            </span>
          ),
          dataIndex: "materieId",
          key: "materieId",
          valueType: "select",
          request: async () => {
            let res = await doFetch({
              url: "/ngic-workmanship/pmMaterie/query/selectbox",
              params: {},
            });
            return res?.data?.dataList;
          },
          fieldProps: {
krysent's avatar
krysent committed
407
            allowClear: true,
krysent's avatar
krysent committed
408
            showSearch: true,
krysent's avatar
krysent committed
409
          },
krysent's avatar
krysent committed
410
          formItemProps: () => {
krysent's avatar
krysent committed
411
            return {
krysent's avatar
krysent committed
412
              rules: [{ required: true, message: "此项为必填项" }],
krysent's avatar
krysent committed
413 414 415 416
            };
          },
        },
        {
krysent's avatar
krysent committed
417 418 419 420 421 422 423 424
          title: (
            <span>
              出库数量 <b style={{ color: "red" }}>*</b>
            </span>
          ),
          dataIndex: "outstroeNum",
          key: "outstroeNum",
          formItemProps: () => {
krysent's avatar
krysent committed
425
            return {
krysent's avatar
krysent committed
426
              rules: [{ required: true, message: "此项为必填项" }],
krysent's avatar
krysent committed
427 428
            };
          },
krysent's avatar
krysent committed
429
          valueType: "digit",
krysent's avatar
krysent committed
430 431
        },
        {
krysent's avatar
krysent committed
432 433 434 435
          title: "可用库存",
          dataIndex: "usableNum",
          key: "usableNum",
          readonly: "usableNum",
krysent's avatar
krysent committed
436 437
        },
        {
krysent's avatar
krysent committed
438 439 440 441
          title: "库存单位",
          dataIndex: "productionUnitName",
          key: "productionUnitName",
          readonly: "productionUnitName",
krysent's avatar
krysent committed
442 443 444 445 446 447
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
krysent's avatar
krysent committed
448
            <a key="delete" onClick={() => {}}>
krysent's avatar
krysent committed
449 450 451 452 453 454
              删除
            </a>,
          ],
        },
      ],
      rowKey: "id",
krysent's avatar
krysent committed
455
    },
krysent's avatar
krysent committed
456 457
  },
  three = {
krysent's avatar
krysent committed
458 459 460 461 462 463 464
    materieOutstoreNo: {
      value: null,
      type: "input",
      title: "出库单号",
      name: ["materieOutstoreNo"],
      required: false,
      placeholder: "不填写系统自动生成",
krysent's avatar
krysent committed
465
    },
krysent's avatar
krysent committed
466 467 468 469 470 471 472 473 474 475 476 477 478
    storeId: {
      value: null,
      type: "select",
      title: "出库仓库",
      name: ["storeId"],
      required: true,
      options: {
        database: () =>
          doFetch({
            url: "/ngic-auth/sysStore/selectionBox",
            params: { factoryIdList: [] },
          }),
        params: {},
krysent's avatar
krysent committed
479 480
      },
    },
krysent's avatar
krysent committed
481 482 483 484 485 486
    businessNo: {
      value: null,
      type: "input",
      title: "相关单号",
      name: ["businessNo"],
      required: false,
krysent's avatar
krysent committed
487
    },
krysent's avatar
krysent committed
488 489 490 491 492 493 494 495 496
    remark: {
      value: null,
      type: "textarea",
      title: "备注",
      name: ["remark"],
      required: false,
      col: {
        span: 24,
      },
krysent's avatar
krysent committed
497
    },
krysent's avatar
krysent committed
498
    materialList: {
krysent's avatar
krysent committed
499 500 501 502 503 504 505
      value: [],
      title: "物料信息",
      type: "table",
      col: { span: 24 },
      name: ["materialList"],
      required: true,
      linkconfig: {
krysent's avatar
krysent committed
506 507 508 509 510 511 512 513
        urlchangeval: {
          //根据url接口 改变某个value
          database: (params) =>
            doFetch({
              url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne",
              params,
            }),
          params: { materieId: "linked" },
krysent's avatar
krysent committed
514
          effectresult: {
krysent's avatar
krysent committed
515 516 517 518 519 520
            productionUnit: "productionUnit", //key 为列表更新值  value为response 返回值
            productionUnitName: "productionUnitName",
            usableNum: "usableNum",
            outstroeNum: "outstroeNum",
          },
        },
krysent's avatar
krysent committed
521 522 523
      },
      columns: [
        {
krysent's avatar
krysent committed
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539
          title: (
            <span>
              物料编码-名称 <b style={{ color: "red" }}>*</b>
            </span>
          ),
          dataIndex: "materieId",
          key: "materieId",
          valueType: "select",
          request: async () => {
            let res = await doFetch({
              url: "/ngic-workmanship/pmMaterie/query/selectbox",
              params: {},
            });
            return res?.data?.dataList;
          },
          fieldProps: {
krysent's avatar
krysent committed
540
            allowClear: true,
krysent's avatar
krysent committed
541
            showSearch: true,
krysent's avatar
krysent committed
542
          },
krysent's avatar
krysent committed
543
          formItemProps: () => {
krysent's avatar
krysent committed
544
            return {
krysent's avatar
krysent committed
545
              rules: [{ required: true, message: "此项为必填项" }],
krysent's avatar
krysent committed
546 547 548 549
            };
          },
        },
        {
krysent's avatar
krysent committed
550 551 552 553 554 555 556 557
          title: (
            <span>
              出库数量 <b style={{ color: "red" }}>*</b>
            </span>
          ),
          dataIndex: "outstroeNum",
          key: "outstroeNum",
          formItemProps: () => {
krysent's avatar
krysent committed
558
            return {
krysent's avatar
krysent committed
559
              rules: [{ required: true, message: "此项为必填项" }],
krysent's avatar
krysent committed
560 561
            };
          },
krysent's avatar
krysent committed
562
          valueType: "digit",
krysent's avatar
krysent committed
563 564
        },
        {
krysent's avatar
krysent committed
565 566 567 568
          title: "可用库存",
          dataIndex: "usableNum",
          key: "usableNum",
          readonly: "usableNum",
krysent's avatar
krysent committed
569 570
        },
        {
krysent's avatar
krysent committed
571 572 573 574
          title: "库存单位",
          dataIndex: "productionUnitName",
          key: "productionUnitName",
          readonly: "productionUnitName",
krysent's avatar
krysent committed
575 576 577 578 579 580
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
krysent's avatar
krysent committed
581
            <a key="delete" onClick={() => {}}>
krysent's avatar
krysent committed
582 583 584 585 586 587
              删除
            </a>,
          ],
        },
      ],
      rowKey: "id",
krysent's avatar
krysent committed
588
    },
krysent's avatar
krysent committed
589 590
  },
  four = {
krysent's avatar
krysent committed
591 592 593 594 595 596 597
    materieOutstoreNo: {
      value: null,
      type: "input",
      title: "出库单号",
      name: ["materieOutstoreNo"],
      required: false,
      placeholder: "不填写系统自动生成",
krysent's avatar
krysent committed
598
    },
krysent's avatar
krysent committed
599 600 601 602 603 604 605 606 607 608 609 610 611
    storeId: {
      value: null,
      type: "select",
      title: "出库仓库",
      name: ["storeId"],
      required: true,
      options: {
        database: () =>
          doFetch({
            url: "/ngic-auth/sysStore/selectionBox",
            params: { factoryIdList: [] },
          }),
        params: {},
krysent's avatar
krysent committed
612 613
      },
    },
krysent's avatar
krysent committed
614 615 616 617 618 619
    businessNo: {
      value: null,
      type: "input",
      title: "相关单号",
      name: ["businessNo"],
      required: false,
krysent's avatar
krysent committed
620
    },
krysent's avatar
krysent committed
621 622 623 624 625 626 627 628 629
    remark: {
      value: null,
      type: "textarea",
      title: "备注",
      name: ["remark"],
      required: false,
      col: {
        span: 24,
      },
krysent's avatar
krysent committed
630
    },
krysent's avatar
krysent committed
631
    materialList: {
krysent's avatar
krysent committed
632 633 634 635 636 637 638
      value: [],
      title: "物料信息",
      type: "table",
      col: { span: 24 },
      name: ["materialList"],
      required: true,
      linkconfig: {
krysent's avatar
krysent committed
639 640 641 642 643 644 645 646
        urlchangeval: {
          //根据url接口 改变某个value
          database: (params) =>
            doFetch({
              url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne",
              params,
            }),
          params: { materieId: "linked" },
krysent's avatar
krysent committed
647
          effectresult: {
krysent's avatar
krysent committed
648 649 650 651 652 653
            productionUnit: "productionUnit", //key 为列表更新值  value为response 返回值
            productionUnitName: "productionUnitName",
            usableNum: "usableNum",
            outstroeNum: "outstroeNum",
          },
        },
krysent's avatar
krysent committed
654 655 656
      },
      columns: [
        {
krysent's avatar
krysent committed
657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672
          title: (
            <span>
              物料编码-名称 <b style={{ color: "red" }}>*</b>
            </span>
          ),
          dataIndex: "materieId",
          key: "materieId",
          valueType: "select",
          request: async () => {
            let res = await doFetch({
              url: "/ngic-workmanship/pmMaterie/query/selectbox",
              params: {},
            });
            return res?.data?.dataList;
          },
          fieldProps: {
krysent's avatar
krysent committed
673
            allowClear: true,
krysent's avatar
krysent committed
674
            showSearch: true,
krysent's avatar
krysent committed
675
          },
krysent's avatar
krysent committed
676
          formItemProps: () => {
krysent's avatar
krysent committed
677
            return {
krysent's avatar
krysent committed
678
              rules: [{ required: true, message: "此项为必填项" }],
krysent's avatar
krysent committed
679 680 681 682
            };
          },
        },
        {
krysent's avatar
krysent committed
683 684 685 686 687 688 689 690
          title: (
            <span>
              出库数量 <b style={{ color: "red" }}>*</b>
            </span>
          ),
          dataIndex: "outstroeNum",
          key: "outstroeNum",
          formItemProps: () => {
krysent's avatar
krysent committed
691
            return {
krysent's avatar
krysent committed
692
              rules: [{ required: true, message: "此项为必填项" }],
krysent's avatar
krysent committed
693 694
            };
          },
krysent's avatar
krysent committed
695
          valueType: "digit",
krysent's avatar
krysent committed
696 697
        },
        {
krysent's avatar
krysent committed
698 699 700 701
          title: "可用库存",
          dataIndex: "usableNum",
          key: "usableNum",
          readonly: "usableNum",
krysent's avatar
krysent committed
702 703
        },
        {
krysent's avatar
krysent committed
704 705 706 707
          title: "库存单位",
          dataIndex: "productionUnitName",
          key: "productionUnitName",
          readonly: "productionUnitName",
krysent's avatar
krysent committed
708 709 710 711 712 713
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
krysent's avatar
krysent committed
714
            <a key="delete" onClick={() => {}}>
krysent's avatar
krysent committed
715 716 717 718 719 720
              删除
            </a>,
          ],
        },
      ],
      rowKey: "id",
krysent's avatar
krysent committed
721
    },
krysent's avatar
krysent committed
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
  },
  detail = (setselected, dom) => ({
    totalCard: [
      //物料详情
      {
        cardTitle: "基本信息",
        itemData: [
          {
            title: "出库单号",
            key: "materieOutstoreNo",
          },
          {
            title: "出库类型",
            key: "outstoreTypeName",
          },
          {
            title: "出库仓库",
            key: "storeName",
          },
          {
            title: "相关单号",
            key: "businessNo",
          },
          {
            title: "创建人",
            key: "createUserName",
          },
          {
            title: "创建时间",
            key: "createTime",
          },
          {
            title: "状态",
            key: "statusName",
          },
          {
            title: "完成时间",
            key: "finishTime",
          },
          {
            title: "备注",
            key: "remark",
            noshow: "100%",
          },
          {
            title: "工单条形码",
            key: "qrCodeUrl",
            type: "img",
            noshow: true,
            width: 100,
          },
        ],
      },
      {
        cardTitle: "物料信息列表",
krysent's avatar
krysent committed
777 778
        extraContent: "",

krysent's avatar
krysent committed
779 780 781 782 783 784 785 786 787 788 789 790
        itemData: [
          {
            key: "materialList",
            type: "table",
            col: { span: 24 },
            columns: [
              {
                title: "物料编码 - 名称",
                dataIndex: "materieName",
                key: "materieName",
                search: false,
                render: (dom, row) => {
krysent's avatar
krysent committed
791 792 793 794
                  return (
                    (row.materieCode ?? "") + " - " + (row.materieName ?? "")
                  );
                },
krysent's avatar
krysent committed
795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817
              },
              {
                title: "出库数量",
                dataIndex: "outstroeNum",
                key: "outstroeNum",
                search: false,
              },
              {
                title: "库存单位",
                dataIndex: "productionUnitName",
                key: "productionUnitName",
                search: false,
              },
              {
                title: "未下架数量",
                dataIndex: "remainderNums",
                key: "remainderNums",
                search: false,
              },
            ],
            pagination: "false",
            rowKey: "id",
            expandable: {
krysent's avatar
krysent committed
818 819 820 821 822 823 824 825 826 827 828 829 830 831
              expandedRowRender: (record) => (
                <Table
                  style={{ marginLeft: 48 }}
                  columns={[
                    {
                      title: "库位名称",
                      dataIndex: "storePositionName",
                      key: "storePositionName",
                      search: false,
                      formItemProps: () => {
                        return {
                          rules: [{ required: true, message: "此项为必填项" }],
                        };
                      },
krysent's avatar
krysent committed
832
                    },
krysent's avatar
krysent committed
833
                    {
krysent's avatar
krysent committed
834
                      title: "批次号",
krysent's avatar
krysent committed
835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862
                      dataIndex: "materieControlNo",
                      key: "materieControlNo",
                      search: false,
                    },
                    {
                      title: "供应商编号-名称",
                      dataIndex: "supplierNo",
                      key: "supplierNo",
                      search: false,
                      render: (dom, row) => {
                        return (
                          (row?.supplierNo ?? "") +
                          " - " +
                          (row?.supplierName ?? "")
                        );
                      },
                    },
                    {
                      title: "下架数量",
                      dataIndex: "outstroeNum",
                      key: "outstroeNum",
                      search: false,
                    },
                  ]}
                  dataSource={record.downloadList}
                  pagination={false}
                />
              ),
krysent's avatar
krysent committed
863 864 865
            },
            rowSelection: {
              onChange: (selectedRowKeys, selectedRows) => {
krysent's avatar
krysent committed
866
                setselected(selectedRows);
krysent's avatar
krysent committed
867
              },
krysent's avatar
krysent committed
868
            },
krysent's avatar
krysent committed
869 870 871 872 873 874 875 876 877 878 879 880 881
          },
        ],
      },
      {
        cardTitle: "强制关单信息",
        itemData: [
          {
            title: "关单人",
            key: "closeUserName",
          },
          {
            title: "关单时间",
            key: "closeTime",
krysent's avatar
krysent committed
882
          },
krysent's avatar
krysent committed
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899
        ],
      },
      {
        cardTitle: "下架明细",
        noPrint: true,
        itemData: [
          {
            key: "materialDownloadList",
            type: "table",
            col: { span: 24 },
            columns: [
              {
                title: "物料编码 - 名称",
                dataIndex: "materieName",
                key: "materieName",
                search: false,
                render: (dom, row) => {
krysent's avatar
krysent committed
900 901 902 903
                  return (
                    (row.materieCode ?? "") + " - " + (row.materieName ?? "")
                  );
                },
krysent's avatar
krysent committed
904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919
              },
              {
                title: "出库数量",
                dataIndex: "outstroeNum",
                key: "outstroeNum",
                search: false,
              },
              {
                title: "库存单位",
                dataIndex: "productionUnitName",
                key: "productionUnitName",
                search: false,
              },
            ],
            expandable: {
              defaultExpandAllRows: true,
krysent's avatar
krysent committed
920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935
              expandedRowRender: (record) => (
                <Table
                  style={{ marginLeft: 48 }}
                  columns={[
                    {
                      title: "库位名称",
                      dataIndex: "storePositionName",
                      key: "storePositionName",
                      search: false,
                      formItemProps: () => {
                        return {
                          rules: [{ required: true, message: "此项为必填项" }],
                        };
                      },
                    },
                    {
krysent's avatar
krysent committed
936
                      title: "批次号",
krysent's avatar
krysent committed
937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970
                      dataIndex: "materieControlNo",
                      key: "materieControlNo",
                      search: false,
                    },
                    {
                      title: "供应商编号 - 名称",
                      dataIndex: "supplierNo",
                      key: "supplierNo",
                      search: false,
                      render: (dom, row) => {
                        return (
                          (row.supplierNo ?? "") +
                          " - " +
                          (row.supplierName ?? "")
                        );
                      },
                    },
                    {
                      title: "下架数量",
                      dataIndex: "outstroeNum",
                      key: "outstroeNum",
                      search: false,
                    },
                    {
                      title: "备注",
                      dataIndex: "remark",
                      key: "remark",
                      search: false,
                    },
                    {
                      title: "操作人",
                      dataIndex: "downloadUserName",
                      key: "downloadUserName",
                      search: false,
krysent's avatar
krysent committed
971
                    },
krysent's avatar
krysent committed
972 973 974 975 976 977 978 979 980 981 982
                    {
                      title: "操作时间",
                      dataIndex: "downloadTime",
                      key: "downloadTime",
                      search: false,
                    },
                  ]}
                  dataSource={record.downloadList}
                  pagination={false}
                />
              ),
krysent's avatar
krysent committed
983
            },
krysent's avatar
krysent committed
984
            pagination: "false",
krysent's avatar
krysent committed
985 986 987
          },
        ],
      },
krysent's avatar
krysent committed
988
    ],
krysent's avatar
krysent committed
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025
  }),
  dooutside = (fid, storeId) => ({
    totalCard: [
      //物料详情
      {
        cardTitle: "基本信息",
        itemData: [
          {
            title: "出库单号",
            key: "materieOutstoreNo",
          },
          {
            title: "出库类型",
            key: "outstoreTypeName",
          },
          {
            title: "出库仓库",
            key: "storeName",
          },
          {
            title: "相关单号",
            key: "businessNo",
          },
          {
            title: "备注",
            key: "remark",
          },
          {
            title: "创建人",
            key: "createUserName",
          },
          {
            title: "创建时间",
            key: "createTime",
          },
          {
            title: "状态",
krysent's avatar
krysent committed
1026 1027
            key: "statusName",
          },
krysent's avatar
krysent committed
1028 1029 1030 1031 1032 1033
        ],
      },
      {
        cardTitle: "物料信息列表",
        extra: true,
        extrapath: "/ngic-workmanship/wmsMaterieOutstore/download",
krysent's avatar
krysent committed
1034
        extrakey: "submits", //redux key
krysent's avatar
krysent committed
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
        itemData: [
          {
            key: "materialList",
            type: "table",
            col: { span: 24 },
            columns: [
              {
                title: "物料编码 - 名称",
                dataIndex: "materieName",
                key: "materieName",
                search: false,
                render: (dom, row) => {
krysent's avatar
krysent committed
1047 1048 1049 1050
                  return (
                    (row.materieCode ?? "") + " - " + (row.materieName ?? "")
                  );
                },
krysent's avatar
krysent committed
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068
              },
              {
                title: "出库数量",
                dataIndex: "outstroeNum",
                key: "outstroeNum",
                search: false,
              },
              {
                title: "库存单位",
                dataIndex: "productionUnitName",
                key: "productionUnitName",
                search: false,
              },
              {
                title: "未下架数量",
                dataIndex: "remainderNums",
                key: "remainderNums",
                search: false,
krysent's avatar
krysent committed
1069
              },
krysent's avatar
krysent committed
1070 1071
            ],
            expandable: {
krysent's avatar
krysent committed
1072 1073 1074 1075
              expandedRowRender: (record) => (
                <EditUpload record={record} fid={fid} storeId={storeId} />
              ),
            },
krysent's avatar
krysent committed
1076 1077 1078
          },
        ],
      },
krysent's avatar
krysent committed
1079
    ],
krysent's avatar
krysent committed
1080 1081 1082 1083 1084 1085 1086 1087
  });

export default {
  one,
  two,
  three,
  four,
  detail,
krysent's avatar
krysent committed
1088
  dooutside,
krysent's avatar
krysent committed
1089
};