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

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 15 16 17 18 19 20 21
  });
  const { initialState, setInitialState } = useModel("@@initialState");
  useEffect(() => {
    if (!value) {
      return
    }
    let newlist = Object.keys(value)?.map?.(it => {
      let id = it;
      let newArr = value[id]?.filter(it => typeof (it.id) == "number") ?? [];
      return {
        id,
krysent's avatar
krysent committed
22
        downloadList: newArr.map(its => {
krysent's avatar
krysent committed
23 24
          return {
            storePositionId: its?.storePositionId,
krysent's avatar
krysent committed
25 26 27 28
            outstroeNum: its?.outstroeNum,
            stockNum: its?.stockNum,
            remark: its?.remark,
            materieControlNo: its?.materieControlNo
krysent's avatar
krysent committed
29 30 31 32 33 34 35
          }
        })
      }
    }) ?? [];
    setInitialState(s => {
      return ({
        ...s,
krysent's avatar
krysent committed
36
        submits: {
krysent's avatar
krysent committed
37
          id: fid,
krysent's avatar
krysent committed
38
          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) : []
krysent's avatar
krysent committed
39 40 41
        }
      })
    })
krysent's avatar
krysent committed
42 43 44 45
  }, [value])

  return <EditTable
    rowKey="id"
krysent's avatar
krysent committed
46
    maxLength={1000}
krysent's avatar
krysent committed
47 48 49 50 51 52 53 54 55 56 57 58
    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
59 60 61
    style={{ marginLeft: 48 }}
    columns={[
      {
krysent's avatar
krysent committed
62
        title: "库位名称",
krysent's avatar
krysent committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
        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
82 83 84
        title: "批次号/SN号",
        dataIndex: "materieControlNo",
        key: "materieControlNo",
krysent's avatar
krysent committed
85
        search: false,
krysent's avatar
krysent committed
86 87 88 89 90
        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
        },
krysent's avatar
krysent committed
91 92 93
        editable: (text, record, index) => {
          return !record.materieOutstoreDetailId
        },
krysent's avatar
krysent committed
94 95 96 97 98 99 100 101 102 103 104 105
        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
krysent's avatar
krysent committed
106
        },
krysent's avatar
krysent committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
        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,
krysent's avatar
krysent committed
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
      },
      {
        title: "备注",
        dataIndex: "remark",
        key: "remark",
        search: false,
        editable: (text, record, index) => {
          return !record.materieOutstoreDetailId
        }
      },
      {
        title: "操作",
        valueType: "option",
        width: 70,
        render: (text, record, _, action) => [
krysent's avatar
krysent committed
144
          <a key="delete" onClick={() => { }}>
krysent's avatar
krysent committed
145 146 147 148 149 150
            删除
          </a>,
        ],
      }
    ]}
    value={value[record.id]}
krysent's avatar
krysent committed
151 152 153 154 155
    onChange={(vals) => {
      setvalue(s => ({
        ...s,
        [record.id]: vals
      }));
krysent's avatar
krysent committed
156 157 158 159 160 161
    }}
    pagination={false}
  />
}

const one = {
krysent's avatar
krysent committed
162
  "materieOutstoreNo": {
krysent's avatar
krysent committed
163 164
    "value": null,
    "type": "input",
krysent's avatar
krysent committed
165
    "title": "出库单号",
krysent's avatar
krysent committed
166
    "name": [
krysent's avatar
krysent committed
167
      "materieOutstoreNo"
krysent's avatar
krysent committed
168 169
    ],
    "required": false,
krysent's avatar
krysent committed
170
    "placeholder": "不填写系统自动生成"
krysent's avatar
krysent committed
171 172 173 174
  },
  "storeId": {
    "value": null,
    "type": "select",
krysent's avatar
krysent committed
175
    "title": "出库仓库",
krysent's avatar
krysent committed
176 177 178 179 180 181 182 183
    "name": [
      "storeId"
    ],
    "required": true,
    "options": {
      database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
      params: {}
    },
krysent's avatar
krysent committed
184
    "linked": true
krysent's avatar
krysent committed
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
  },
  "businessNo": {
    "value": null,
    "type": "input",
    "title": "相关单号",
    "name": [
      "businessNo"
    ],
    "required": false
  },
  "remark": {
    "value": null,
    "type": "textarea",
    "title": "备注",
    "name": [
      "remark"
    ],
    "required": false,
    "col": {
      "span": 24
    }
  },
  "materialList": {
    value: [],
    title: "物料信息",
    type: "table",
    col: { span: 24 },
    name: ["materialList"],
    required: true,
    linkconfig: {
      urlchangeval: {//根据url接口 改变某个value
krysent's avatar
krysent committed
216
        database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne", params }),
krysent's avatar
krysent committed
217 218 219 220
        params: { "materieId": "linked" },
        effectresult: {
          "productionUnit": "productionUnit",//key 为列表更新值  value为response 返回值
          "productionUnitName": "productionUnitName",
krysent's avatar
krysent committed
221 222
          "usableNum": "usableNum",
          "outstroeNum": "outstroeNum"
krysent's avatar
krysent committed
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
        }
      }
    },
    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: '此项为必填项' }],
          };
        },
krysent's avatar
krysent committed
245
        editable: true
krysent's avatar
krysent committed
246 247
      },
      {
krysent's avatar
krysent committed
248 249 250
        "title": <span>出库数量 <b style={{ color: "red" }}>*</b></span>,
        "dataIndex": "outstroeNum",
        "key": "outstroeNum",
krysent's avatar
krysent committed
251 252 253 254
        "formItemProps": () => {
          return {
            rules: [{ required: true, message: '此项为必填项' }],
          };
krysent's avatar
krysent committed
255 256 257 258 259 260 261 262 263
        },
        valueType: "digit",
        editable: true
      },
      {
        "title": "可用库存",
        "dataIndex": "usableNum",
        "key": "usableNum",
        "readonly": 'usableNum'
krysent's avatar
krysent committed
264 265 266 267 268
      },
      {
        "title": "库存单位",
        "dataIndex": "productionUnitName",
        "key": "productionUnitName",
krysent's avatar
krysent committed
269
        "readonly": 'productionUnitName'
krysent's avatar
krysent committed
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
      },
      {
        title: "操作",
        valueType: "option",
        width: 70,
        render: (text, record, _, action) => [
          <a key="delete" onClick={() => { }}>
            删除
          </a>,
        ],
      },
    ],
    rowKey: "id",
  }
},
  two = {
krysent's avatar
krysent committed
286
    "materieOutstoreNo": {
krysent's avatar
krysent committed
287 288
      "value": null,
      "type": "input",
krysent's avatar
krysent committed
289
      "title": "出库单号",
krysent's avatar
krysent committed
290
      "name": [
krysent's avatar
krysent committed
291
        "materieOutstoreNo"
krysent's avatar
krysent committed
292 293 294 295 296 297 298
      ],
      "required": false,
      placeholder: "不填写系统自动生成"
    },
    "storeId": {
      "value": null,
      "type": "select",
krysent's avatar
krysent committed
299
      "title": "出库仓库",
krysent's avatar
krysent committed
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
      "name": [
        "storeId"
      ],
      "required": true,
      "options": {
        database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
        params: {}
      },
    },
    "businessNo": {
      "value": null,
      "type": "input",
      "title": "相关单号",
      "name": [
        "businessNo"
      ],
      "required": false
    },
    "remark": {
      "value": null,
      "type": "textarea",
      "title": "备注",
      "name": [
        "remark"
      ],
      "required": false,
      "col": {
        "span": 24
      }
    },
    "materialList": {
      value: [],
      title: "物料信息",
      type: "table",
      col: { span: 24 },
      name: ["materialList"],
      required: true,
      linkconfig: {
        urlchangeval: {//根据url接口 改变某个value
krysent's avatar
krysent committed
339
          database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne", params }),
krysent's avatar
krysent committed
340 341 342 343
          params: { "materieId": "linked" },
          effectresult: {
            "productionUnit": "productionUnit",//key 为列表更新值  value为response 返回值
            "productionUnitName": "productionUnitName",
krysent's avatar
krysent committed
344 345
            "usableNum": "usableNum",
            "outstroeNum": "outstroeNum"
krysent's avatar
krysent committed
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
          }
        }
      },
      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: '此项为必填项' }],
            };
          },
        },
        {
krysent's avatar
krysent committed
370 371 372
          "title": <span>出库数量 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "outstroeNum",
          "key": "outstroeNum",
krysent's avatar
krysent committed
373 374 375 376 377 378 379
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
          valueType: "digit"
        },
krysent's avatar
krysent committed
380 381 382 383 384 385
        {
          "title": "可用库存",
          "dataIndex": "usableNum",
          "key": "usableNum",
          "readonly": 'usableNum'
        },
krysent's avatar
krysent committed
386 387 388 389
        {
          "title": "库存单位",
          "dataIndex": "productionUnitName",
          "key": "productionUnitName",
krysent's avatar
krysent committed
390
          "readonly": 'productionUnitName'
krysent's avatar
krysent committed
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
            <a key="delete" onClick={() => { }}>
              删除
            </a>,
          ],
        },
      ],
      rowKey: "id",
    }
  },
  three = {
krysent's avatar
krysent committed
407
    "materieOutstoreNo": {
krysent's avatar
krysent committed
408 409
      "value": null,
      "type": "input",
krysent's avatar
krysent committed
410
      "title": "出库单号",
krysent's avatar
krysent committed
411
      "name": [
krysent's avatar
krysent committed
412
        "materieOutstoreNo"
krysent's avatar
krysent committed
413 414 415 416 417 418 419
      ],
      "required": false,
      placeholder: "不填写系统自动生成"
    },
    "storeId": {
      "value": null,
      "type": "select",
krysent's avatar
krysent committed
420
      "title": "出库仓库",
krysent's avatar
krysent committed
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
      "name": [
        "storeId"
      ],
      "required": true,
      "options": {
        database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
        params: {}
      },
    },
    "businessNo": {
      "value": null,
      "type": "input",
      "title": "相关单号",
      "name": [
        "businessNo"
      ],
      "required": false
    },
    "remark": {
      "value": null,
      "type": "textarea",
      "title": "备注",
      "name": [
        "remark"
      ],
      "required": false,
      "col": {
        "span": 24
      }
    },
    "materialList": {
      value: [],
      title: "物料信息",
      type: "table",
      col: { span: 24 },
      name: ["materialList"],
      required: true,
      linkconfig: {
        urlchangeval: {//根据url接口 改变某个value
krysent's avatar
krysent committed
460
          database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne", params }),
krysent's avatar
krysent committed
461 462 463 464
          params: { "materieId": "linked" },
          effectresult: {
            "productionUnit": "productionUnit",//key 为列表更新值  value为response 返回值
            "productionUnitName": "productionUnitName",
krysent's avatar
krysent committed
465 466
            "usableNum": "usableNum",
            "outstroeNum": "outstroeNum"
krysent's avatar
krysent committed
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
          }
        }
      },
      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: '此项为必填项' }],
            };
          },
        },
        {
krysent's avatar
krysent committed
491 492 493
          "title": <span>出库数量 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "outstroeNum",
          "key": "outstroeNum",
krysent's avatar
krysent committed
494 495 496 497 498
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
krysent's avatar
krysent committed
499
          valueType: "digit"
krysent's avatar
krysent committed
500 501
        },
        {
krysent's avatar
krysent committed
502 503 504 505
          "title": "可用库存",
          "dataIndex": "usableNum",
          "key": "usableNum",
          "readonly": 'usableNum'
krysent's avatar
krysent committed
506 507 508 509 510
        },
        {
          "title": "库存单位",
          "dataIndex": "productionUnitName",
          "key": "productionUnitName",
krysent's avatar
krysent committed
511
          "readonly": 'productionUnitName'
krysent's avatar
krysent committed
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
            <a key="delete" onClick={() => { }}>
              删除
            </a>,
          ],
        },
      ],
      rowKey: "id",
    }
  },
  four = {
krysent's avatar
krysent committed
528
    "materieOutstoreNo": {
krysent's avatar
krysent committed
529 530
      "value": null,
      "type": "input",
krysent's avatar
krysent committed
531
      "title": "出库单号",
krysent's avatar
krysent committed
532
      "name": [
krysent's avatar
krysent committed
533
        "materieOutstoreNo"
krysent's avatar
krysent committed
534 535 536 537 538 539 540
      ],
      "required": false,
      placeholder: "不填写系统自动生成"
    },
    "storeId": {
      "value": null,
      "type": "select",
krysent's avatar
krysent committed
541
      "title": "出库仓库",
krysent's avatar
krysent committed
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
      "name": [
        "storeId"
      ],
      "required": true,
      "options": {
        database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
        params: {}
      },
    },
    "businessNo": {
      "value": null,
      "type": "input",
      "title": "相关单号",
      "name": [
        "businessNo"
      ],
      "required": false
    },
    "remark": {
      "value": null,
      "type": "textarea",
      "title": "备注",
      "name": [
        "remark"
      ],
      "required": false,
      "col": {
        "span": 24
      }
    },
    "materialList": {
      value: [],
      title: "物料信息",
      type: "table",
      col: { span: 24 },
      name: ["materialList"],
      required: true,
      linkconfig: {
        urlchangeval: {//根据url接口 改变某个value
krysent's avatar
krysent committed
581
          database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne", params }),
krysent's avatar
krysent committed
582 583 584 585
          params: { "materieId": "linked" },
          effectresult: {
            "productionUnit": "productionUnit",//key 为列表更新值  value为response 返回值
            "productionUnitName": "productionUnitName",
krysent's avatar
krysent committed
586 587
            "usableNum": "usableNum",
            "outstroeNum": "outstroeNum"
krysent's avatar
krysent committed
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611
          }
        }
      },
      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: '此项为必填项' }],
            };
          },
        },
        {
krysent's avatar
krysent committed
612 613 614
          "title": <span>出库数量 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "outstroeNum",
          "key": "outstroeNum",
krysent's avatar
krysent committed
615 616 617 618 619
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
krysent's avatar
krysent committed
620
          valueType: "digit"
krysent's avatar
krysent committed
621 622
        },
        {
krysent's avatar
krysent committed
623 624 625 626
          "title": "可用库存",
          "dataIndex": "usableNum",
          "key": "usableNum",
          "readonly": 'usableNum'
krysent's avatar
krysent committed
627 628 629 630 631
        },
        {
          "title": "库存单位",
          "dataIndex": "productionUnitName",
          "key": "productionUnitName",
krysent's avatar
krysent committed
632
          "readonly": 'productionUnitName'
krysent's avatar
krysent committed
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
            <a key="delete" onClick={() => { }}>
              删除
            </a>,
          ],
        },
      ],
      rowKey: "id",
    }
  },
  detail = (setselected, dom) => ({
    totalCard: [
      //物料详情
      {
        cardTitle: "基本信息",
        itemData: [
          {
krysent's avatar
krysent committed
655 656
            title: "出库单号",
            key: "materieOutstoreNo",
krysent's avatar
krysent committed
657 658
          },
          {
krysent's avatar
krysent committed
659 660
            title: "出库类型",
            key: "outstoreTypeName",
krysent's avatar
krysent committed
661 662
          },
          {
krysent's avatar
krysent committed
663
            title: "出库仓库",
krysent's avatar
krysent committed
664 665 666 667 668 669 670 671 672 673 674 675 676
            key: "storeName",
          },
          {
            title: "相关单号",
            key: "businessNo",
          },
          {
            title: "创建人",
            key: "createUserName",
          },
          {
            title: "创建时间",
            key: "createTime",
krysent's avatar
krysent committed
677 678
          },
          {
krysent's avatar
krysent committed
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694
            title: "状态",
            key: "statusName",
          },
          {
            title: "完成时间",
            key: "finishTime",
          },
          {
            title: "备注",
            key: "remark",
            noshow: "100%",
          },
          {
            title: "工单条形码",
            key: "qrCodeUrl",
            type: "img",
krysent's avatar
krysent committed
695
            noshow: true,
krysent's avatar
krysent committed
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718
            width: 100,
          },
        ],
      },
      {
        cardTitle: "物料信息列表",
        extraContent: dom,
        itemData: [
          {
            key: "materialList",
            type: "table",
            col: { span: 24 },
            columns: [
              {
                title: "物料编码 - 名称",
                dataIndex: "materieName",
                key: "materieName",
                search: false,
                render: (dom, row) => {
                  return (row.materieCode ?? '') + " - " + (row.materieName ?? '')
                }
              },
              {
krysent's avatar
krysent committed
719 720 721
                title: "出库数量",
                dataIndex: "outstroeNum",
                key: "outstroeNum",
krysent's avatar
krysent committed
722 723 724
                search: false,
              },
              {
krysent's avatar
krysent committed
725 726 727
                title: "库存单位",
                dataIndex: "productionUnitName",
                key: "productionUnitName",
krysent's avatar
krysent committed
728 729 730
                search: false,
              },
              {
krysent's avatar
krysent committed
731
                title: "未下架数量",
krysent's avatar
krysent committed
732 733 734 735 736
                dataIndex: "remainderNums",
                key: "remainderNums",
                search: false,
              },
            ],
krysent's avatar
krysent committed
737 738
            pagination: "false",
            rowKey: "id",
krysent's avatar
krysent committed
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754
            expandable: {
              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
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772
                    title: "批次号/SN号",
                    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",
krysent's avatar
krysent committed
773 774
                    search: false,
                  }
krysent's avatar
krysent committed
775

krysent's avatar
krysent committed
776
                ]}
krysent's avatar
krysent committed
777
                dataSource={record.downloadList}
krysent's avatar
krysent committed
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
                pagination={false}
              />,
            },
            rowSelection: {
              onChange: (selectedRowKeys, selectedRows) => {
                setselected(selectedRows)
              },
            }
          },
        ],
      },
      {
        cardTitle: "强制关单信息",
        itemData: [
          {
            title: "关单人",
            key: "closeUserName",
          },
          {
            title: "关单时间",
            key: "closeTime",
          }
        ],
      },
      {
krysent's avatar
krysent committed
803
        cardTitle: "下架明细",
krysent's avatar
krysent committed
804 805 806
        noPrint: true,
        itemData: [
          {
krysent's avatar
krysent committed
807
            key: "materialDownloadList",
krysent's avatar
krysent committed
808 809 810 811 812 813 814 815 816 817 818 819 820
            type: "table",
            col: { span: 24 },
            columns: [
              {
                title: "物料编码 - 名称",
                dataIndex: "materieName",
                key: "materieName",
                search: false,
                render: (dom, row) => {
                  return (row.materieCode ?? '') + " - " + (row.materieName ?? '')
                }
              },
              {
krysent's avatar
krysent committed
821 822 823
                title: "出库数量",
                dataIndex: "outstroeNum",
                key: "outstroeNum",
krysent's avatar
krysent committed
824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849
                search: false,
              },
              {
                title: "库存单位",
                dataIndex: "productionUnitName",
                key: "productionUnitName",
                search: false,
              },
            ],
            expandable: {
              defaultExpandAllRows: true,
              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
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867
                    title: "批次号/SN号",
                    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",
krysent's avatar
krysent committed
868 869 870 871 872 873 874 875 876 877 878 879
                    search: false,
                  }
                  ,
                  {
                    title: "备注",
                    dataIndex: "remark",
                    key: "remark",
                    search: false,
                  }
                  ,
                  {
                    title: "操作人",
krysent's avatar
krysent committed
880 881
                    dataIndex: "downloadUserName",
                    key: "downloadUserName",
krysent's avatar
krysent committed
882 883 884 885 886
                    search: false,
                  }
                  ,
                  {
                    title: "操作时间",
krysent's avatar
krysent committed
887 888
                    dataIndex: "downloadTime",
                    key: "downloadTime",
krysent's avatar
krysent committed
889 890 891
                    search: false,
                  }
                ]}
krysent's avatar
krysent committed
892
                dataSource={record.downloadList}
krysent's avatar
krysent committed
893 894 895 896 897 898 899 900
                pagination={false}
              />,
            },
            pagination: "false"
          },
        ],
      },
    ]
krysent's avatar
krysent committed
901 902
  }),
  dooutside = (fid, storeId) => ({
krysent's avatar
krysent committed
903 904 905 906 907 908
    totalCard: [
      //物料详情
      {
        cardTitle: "基本信息",
        itemData: [
          {
krysent's avatar
krysent committed
909 910
            title: "出库单号",
            key: "materieOutstoreNo",
krysent's avatar
krysent committed
911 912
          },
          {
krysent's avatar
krysent committed
913 914
            title: "出库类型",
            key: "outstoreTypeName",
krysent's avatar
krysent committed
915 916
          },
          {
krysent's avatar
krysent committed
917
            title: "出库仓库",
krysent's avatar
krysent committed
918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937
            key: "storeName",
          },
          {
            title: "相关单号",
            key: "businessNo",
          },
          {
            title: "备注",
            key: "remark",
          },
          {
            title: "创建人",
            key: "createUserName",
          },
          {
            title: "创建时间",
            key: "createTime",
          },
          {
            title: "状态",
krysent's avatar
krysent committed
938
            key: "statusName"
krysent's avatar
krysent committed
939 940 941 942 943 944
          }
        ],
      },
      {
        cardTitle: "物料信息列表",
        extra: true,
krysent's avatar
krysent committed
945 946
        extrapath: "/ngic-workmanship/wmsMaterieOutstore/download",
        extrakey: "submits",//redux key
krysent's avatar
krysent committed
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962
        itemData: [
          {
            key: "materialList",
            type: "table",
            col: { span: 24 },
            columns: [
              {
                title: "物料编码 - 名称",
                dataIndex: "materieName",
                key: "materieName",
                search: false,
                render: (dom, row) => {
                  return (row.materieCode ?? '') + " - " + (row.materieName ?? '')
                }
              },
              {
krysent's avatar
krysent committed
963 964 965
                title: "出库数量",
                dataIndex: "outstroeNum",
                key: "outstroeNum",
krysent's avatar
krysent committed
966 967 968
                search: false,
              },
              {
krysent's avatar
krysent committed
969 970 971
                title: "库存单位",
                dataIndex: "productionUnitName",
                key: "productionUnitName",
krysent's avatar
krysent committed
972 973 974
                search: false,
              },
              {
krysent's avatar
krysent committed
975
                title: "未下架数量",
krysent's avatar
krysent committed
976 977 978
                dataIndex: "remainderNums",
                key: "remainderNums",
                search: false,
krysent's avatar
krysent committed
979
              }
krysent's avatar
krysent committed
980 981 982
            ],
            expandable: {
              expandedRowRender: record => <EditUpload record={record} fid={fid} storeId={storeId} />,
krysent's avatar
krysent committed
983
            }
krysent's avatar
krysent committed
984 985 986 987 988 989 990 991 992 993 994 995 996 997 998
          },
        ],
      },
    ]
  });




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