fields.js 28.8 KB
Newer Older
wuhao's avatar
wuhao committed
1
import { factorySelect, shopSelectByFactory } from "@/services/system";
wuhao's avatar
wuhao committed
2
import { doFetch } from "@/utils/doFetch";
wuhao's avatar
wuhao committed
3 4 5 6
import { Button, Table } from "antd";
import { EditableProTable } from "@ant-design/pro-table";
import { useEffect, useState } from 'react'
import { useModel } from 'umi'
wuhao's avatar
wuhao committed
7

左玲玲's avatar
左玲玲 committed
8
const EditUpload = ({ record, fid, storeId }) => {
wuhao's avatar
wuhao committed
9 10 11
  const [value, setvalue] = useState({
    [record.id]: record.uploadList
  });
wuhao's avatar
wuhao committed
12 13 14 15 16
  const { initialState, setInitialState } = useModel("@@initialState");
  useEffect(() => {
    if (!value) {
      return
    }
左玲玲's avatar
左玲玲 committed
17 18 19 20 21 22
    let newlist = Object.keys(value)?.map?.(it => {
      let id = it;
      let newArr = value[id]?.filter(it => typeof (it.id) == "number") ?? [];
      return {
        id,
        uploadList: newArr.map(its => {
wuhao's avatar
wuhao committed
23
          return {
左玲玲's avatar
左玲玲 committed
24 25 26
            storePositionId: its?.storePositionId,
            instroeNum: its?.instroeNum,
            remark: its?.remark
wuhao's avatar
wuhao committed
27 28 29
          }
        })
      }
左玲玲's avatar
左玲玲 committed
30 31 32 33 34 35
    }) ?? [];
    setInitialState(s => {
      return ({
        ...s,
        submit: {
          id: fid,
wuhao's avatar
wuhao committed
36
          materialList: (s.submit && s?.submit?.materialList) ? s?.submit?.materialList?.filter(it => newlist.map(item => item.id).indexOf(it.id) == -1)?.concat(newlist)?.filter(it => it.uploadList?.length > 0) : []
左玲玲's avatar
左玲玲 committed
37 38 39
        }
      })
    })
左玲玲's avatar
左玲玲 committed
40
  }, [value]);
wuhao's avatar
wuhao committed
41
  return <EditableProTable
左玲玲's avatar
左玲玲 committed
42
    rowKey={"id"}
wuhao's avatar
wuhao committed
43 44 45 46
    maxLength={1000}
    style={{ marginLeft: 48 }}
    columns={[
      {
wuhao's avatar
wuhao committed
47
        title: <span>库位名称 <b style={{ color: "red" }}>*</b></span>,
wuhao's avatar
wuhao committed
48
        dataIndex: "storePositionName",
wuhao's avatar
wuhao committed
49
        key: "storePositionId",
wuhao's avatar
wuhao committed
50 51
        search: false,
        valueType: "select",
左玲玲's avatar
左玲玲 committed
52
        request: async (params) => {
wuhao's avatar
wuhao committed
53
          let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params: { storeId: params.storeId } });
wuhao's avatar
wuhao committed
54 55 56 57
          return res?.data?.dataList
        },
        editable: (text, record, index) => {
          return !record.materieOutstoreDetailId
左玲玲's avatar
左玲玲 committed
58
        },
wuhao's avatar
wuhao committed
59 60 61 62 63 64
        params: { storeId: storeId },
        "formItemProps": () => {
          return {
            rules: [{ required: true, message: '此项为必填项' }],
          };
        },
wuhao's avatar
wuhao committed
65 66
      },
      {
wuhao's avatar
wuhao committed
67
        title: <span>上架数量 <b style={{ color: "red" }}>*</b></span>,
wuhao's avatar
wuhao committed
68 69 70 71 72
        dataIndex: "instroeNum",
        key: "instroeNum",
        search: false,
        editable: (text, record, index) => {
          return !record.materieOutstoreDetailId
左玲玲's avatar
左玲玲 committed
73
        },
wuhao's avatar
wuhao committed
74 75 76 77 78 79
        valueType: "digit",
        "formItemProps": () => {
          return {
            rules: [{ required: true, message: '此项为必填项' }],
          };
        },
wuhao's avatar
wuhao committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
      },
      {
        title: "备注",
        dataIndex: "remark",
        key: "remark",
        search: false,
        editable: (text, record, index) => {
          return !record.materieOutstoreDetailId
        }
      },
      {
        title: "操作",
        valueType: "option",
        width: 70,
        render: (text, record, _, action) => [
左玲玲's avatar
左玲玲 committed
95
          typeof (record.id) == "number" && <a key="delete" onClick={() => { }}>
wuhao's avatar
wuhao committed
96 97 98 99 100
            删除
          </a>,
        ],
      }
    ]}
wuhao's avatar
wuhao committed
101
    value={value[record.id]}
wuhao's avatar
wuhao committed
102 103 104 105 106 107 108 109 110 111 112 113
    recordCreatorProps={{
      newRecordType: "dataSource",
      record: () => ({
        id: Date.now(),
      }),
    }}
    editable={{
      type: "multiple",
      actionRender: (row, config, defaultDoms) => {
        return [defaultDoms.delete];
      },
      onValuesChange: async (records, recordList) => {
左玲玲's avatar
左玲玲 committed
114 115 116 117 118 119
        setvalue(s => {
          return ({
            ...s,
            [record.id]: recordList
          })
        });
wuhao's avatar
wuhao committed
120 121 122 123 124
      },
    }}
    pagination={false}
  />
}
wuhao's avatar
wuhao committed
125 126 127 128 129 130 131 132 133

const one = {
  "materieInstoreNo": {
    "value": null,
    "type": "input",
    "title": "入库单号",
    "name": [
      "materieInstoreNo"
    ],
左玲玲's avatar
左玲玲 committed
134
    "required": false,
左玲玲's avatar
左玲玲 committed
135
    placeholder: "不填写系统自动生成"
wuhao's avatar
wuhao committed
136
  },
wuhao's avatar
wuhao committed
137 138 139
  "storeId": {
    "value": null,
    "type": "select",
wuhao's avatar
wuhao committed
140
    "title": "入库仓库",
wuhao's avatar
wuhao committed
141 142 143 144 145 146 147 148
    "name": [
      "storeId"
    ],
    "required": true,
    "options": {
      database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
      params: {}
    },
wuhao's avatar
wuhao committed
149
  },
wuhao's avatar
wuhao committed
150 151 152 153 154 155 156 157 158
  "supplierId": {
    "value": null,
    "type": "select",
    "title": "供应商",
    "name": [
      "supplierId"
    ],
    "required": true,
    "options": {
wuhao's avatar
wuhao committed
159
      database: () => doFetch({ url: "/ngic-auth/sysSupplier/query/selection", params: {} }),
wuhao's avatar
wuhao committed
160
      params: {}
wuhao's avatar
wuhao committed
161 162
    },
  },
wuhao's avatar
wuhao committed
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
  "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"],
wuhao's avatar
wuhao committed
190
    required: true,
wuhao's avatar
wuhao committed
191 192 193 194 195 196
    linkconfig: {
      urlchangeval: {//根据url接口 改变某个value
        database: (params) => doFetch({ url: "/ngic-workmanship/pmMaterie/queryUnitByMaterieId", params }),
        params: { "materieId": "linked" },
        effectresult: {
          "productionUnit": "productionUnit",//key 为列表更新值  value为response 返回值
左玲玲's avatar
左玲玲 committed
197 198 199
          "productionUnitName": "productionUnitName",
          "materieControlNo": "materialCode",
          "instroeNum": "instroeNum"
wuhao's avatar
wuhao committed
200 201 202
        }
      }
    },
wuhao's avatar
wuhao committed
203 204
    columns: [
      {
wuhao's avatar
wuhao committed
205
        "title": <span>物料编码-名称 <b style={{ color: "red" }}>*</b></span>,
wuhao's avatar
wuhao committed
206 207
        "dataIndex": "materieId",
        "key": "materieId",
wuhao's avatar
wuhao committed
208 209 210 211
        "valueType": "select",
        "width": 300,
        "request": async () => {
          let res = await doFetch({ url: "/ngic-workmanship/pmMaterie/query/selectbox", params: {} })
wuhao's avatar
wuhao committed
212 213
          return res?.data?.dataList
        },
wuhao's avatar
wuhao committed
214
        "fieldProps": {
wuhao's avatar
wuhao committed
215
          allowClear: true,
wuhao's avatar
wuhao committed
216 217 218 219 220 221 222
          showSearch: true
        },
        "formItemProps": () => {
          return {
            rules: [{ required: true, message: '此项为必填项' }],
          };
        },
wuhao's avatar
wuhao committed
223 224
      },
      {
wuhao's avatar
wuhao committed
225 226 227
        "title": "批次号/SN号",
        "dataIndex": "materieControlNo",
        "key": "materieControlNo"
wuhao's avatar
wuhao committed
228 229
      },
      {
wuhao's avatar
wuhao committed
230
        "title": <span>入库数量 <b style={{ color: "red" }}>*</b></span>,
wuhao's avatar
wuhao committed
231
        "dataIndex": "instroeNum",
wuhao's avatar
wuhao committed
232
        "key": "instroeNum",
左玲玲's avatar
左玲玲 committed
233
        valueType: "digit",
wuhao's avatar
wuhao committed
234 235 236 237
        "formItemProps": () => {
          return {
            rules: [{ required: true, message: '此项为必填项' }],
          };
左玲玲's avatar
左玲玲 committed
238
        }
wuhao's avatar
wuhao committed
239 240
      },
      {
wuhao's avatar
wuhao committed
241
        "title": "库存单位",
wuhao's avatar
wuhao committed
242 243 244
        "dataIndex": "productionUnitName",
        "key": "productionUnitName",
        "readonly": 'productionUnitName',
wuhao's avatar
wuhao committed
245
        "width": 88
wuhao's avatar
wuhao committed
246 247 248 249 250 251 252 253 254 255
      },
      {
        title: "操作",
        valueType: "option",
        width: 70,
        render: (text, record, _, action) => [
          <a key="delete" onClick={() => { }}>
            删除
          </a>,
        ],
wuhao's avatar
wuhao committed
256 257
      },
    ],
wuhao's avatar
wuhao committed
258 259
    rowKey: "id",
  }
wuhao's avatar
wuhao committed
260 261 262 263 264 265 266 267 268
},
  two = {
    "materieInstoreNo": {
      "value": null,
      "type": "input",
      "title": "入库单号",
      "name": [
        "materieInstoreNo"
      ],
左玲玲's avatar
左玲玲 committed
269
      "required": false,
左玲玲's avatar
左玲玲 committed
270
      placeholder: "不填写系统自动生成"
wuhao's avatar
wuhao committed
271
    },
wuhao's avatar
wuhao committed
272 273 274
    "storeId": {
      "value": null,
      "type": "select",
wuhao's avatar
wuhao committed
275
      "title": "入库仓库",
wuhao's avatar
wuhao committed
276 277 278 279 280 281 282 283
      "name": [
        "storeId"
      ],
      "required": true,
      "options": {
        database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
        params: {}
      },
wuhao's avatar
wuhao committed
284
    },
wuhao's avatar
wuhao committed
285
    "supplierId": {
wuhao's avatar
wuhao committed
286
      "value": "2022070124566476657",
wuhao's avatar
wuhao committed
287 288 289 290 291 292
      "type": "select",
      "title": "供应商",
      "name": [
        "supplierId"
      ],
      "required": true,
wuhao's avatar
wuhao committed
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
      "disabled": true,
      "options": [
        {
          value: "2022070124566476657",
          label: "南高(默认)"
        }
      ],
    },
    "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"],
wuhao's avatar
wuhao committed
328
      required: true,
wuhao's avatar
wuhao committed
329 330 331 332 333 334
      linkconfig: {
        urlchangeval: {//根据url接口 改变某个value
          database: (params) => doFetch({ url: "/ngic-workmanship/pmMaterie/queryUnitByMaterieId", params }),
          params: { "materieId": "linked" },
          effectresult: {
            "productionUnit": "productionUnit",//key 为列表更新值  value为response 返回值
左玲玲's avatar
左玲玲 committed
335 336 337
            "productionUnitName": "productionUnitName",
            "materieControlNo": "materialCode",
            "instroeNum": "instroeNum"
wuhao's avatar
wuhao committed
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
          }
        }
      },
      columns: [
        {
          "title": <span>物料编码-名称 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "materieId",
          "key": "materieId",
          "valueType": "select",
          "width": 300,
          "request": async () => {
            let res = await doFetch({ url: "/ngic-workmanship/pmMaterie/query/selectbox", params: {} })
            return res?.data?.dataList
          },
          "fieldProps": {
wuhao's avatar
wuhao committed
353
            allowClear: true,
wuhao's avatar
wuhao committed
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
            showSearch: true
          },
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
        },
        {
          "title": "批次号/SN号",
          "dataIndex": "materieControlNo",
          "key": "materieControlNo"
        },
        {
          "title": <span>入库数量 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "instroeNum",
          "key": "instroeNum",
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
左玲玲's avatar
左玲玲 committed
376
          valueType: "digit"
wuhao's avatar
wuhao committed
377 378
        },
        {
wuhao's avatar
wuhao committed
379
          "title": "库存单位",
wuhao's avatar
wuhao committed
380 381 382
          "dataIndex": "productionUnitName",
          "key": "productionUnitName",
          "readonly": 'productionUnitName',
wuhao's avatar
wuhao committed
383
          "width": 88
wuhao's avatar
wuhao committed
384 385 386 387 388 389 390 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 = {
    "materieInstoreNo": {
      "value": null,
      "type": "input",
      "title": "入库单号",
      "name": [
        "materieInstoreNo"
      ],
左玲玲's avatar
左玲玲 committed
407
      "required": false,
左玲玲's avatar
左玲玲 committed
408
      placeholder: "不填写系统自动生成"
wuhao's avatar
wuhao committed
409 410 411 412
    },
    "storeId": {
      "value": null,
      "type": "select",
wuhao's avatar
wuhao committed
413
      "title": "入库仓库",
wuhao's avatar
wuhao committed
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
      "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"],
wuhao's avatar
wuhao committed
450
      required: true,
wuhao's avatar
wuhao committed
451 452 453 454 455 456
      linkconfig: {
        urlchangeval: {//根据url接口 改变某个value
          database: (params) => doFetch({ url: "/ngic-workmanship/pmMaterie/queryUnitByMaterieId", params }),
          params: { "materieId": "linked" },
          effectresult: {
            "productionUnit": "productionUnit",//key 为列表更新值  value为response 返回值
左玲玲's avatar
左玲玲 committed
457 458 459 460
            "productionUnitName": "productionUnitName",
            "materieControlNo": "materialCode",
            "instroeNum": "instroeNum",
            "supplierId": "supplierId"
wuhao's avatar
wuhao committed
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
          }
        }
      },
      columns: [
        {
          "title": <span>物料编码-名称 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "materieId",
          "key": "materieId",
          "valueType": "select",
          "width": 300,
          "request": async () => {
            let res = await doFetch({ url: "/ngic-workmanship/pmMaterie/query/selectbox", params: {} })
            return res?.data?.dataList
          },
          "fieldProps": {
wuhao's avatar
wuhao committed
476
            allowClear: true,
wuhao's avatar
wuhao committed
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
            showSearch: true
          },
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
        },
        {
          "title": <span>供应商编号-名称 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "supplierId",
          "key": "supplierId",
          "valueType": "select",
          "width": 300,
          "request": async () => {
            let res = await doFetch({ url: "/ngic-auth/sysSupplier/query/selection/withNo", params: {} })
            return res?.data?.dataList
          },
          "fieldProps": {
wuhao's avatar
wuhao committed
496
            allowClear: true,
wuhao's avatar
wuhao committed
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
            showSearch: true
          },
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
        },
        {
          "title": "批次号/SN号",
          "dataIndex": "materieControlNo",
          "key": "materieControlNo"
        },
        {
          "title": <span>入库数量 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "instroeNum",
          "key": "instroeNum",
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
左玲玲's avatar
左玲玲 committed
519
          valueType: "digit"
wuhao's avatar
wuhao committed
520 521
        },
        {
wuhao's avatar
wuhao committed
522
          "title": "库存单位",
wuhao's avatar
wuhao committed
523 524 525
          "dataIndex": "productionUnitName",
          "key": "productionUnitName",
          "readonly": 'productionUnitName',
wuhao's avatar
wuhao committed
526
          "width": 88
wuhao's avatar
wuhao committed
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
            <a key="delete" onClick={() => { }}>
              删除
            </a>,
          ],
        },
      ],
      rowKey: "id",
    }
  },
  four = {
    "materieInstoreNo": {
      "value": null,
      "type": "input",
      "title": "入库单号",
      "name": [
        "materieInstoreNo"
      ],
左玲玲's avatar
左玲玲 committed
550
      "required": false,
左玲玲's avatar
左玲玲 committed
551
      placeholder: "不填写系统自动生成"
wuhao's avatar
wuhao committed
552 553 554 555
    },
    "storeId": {
      "value": null,
      "type": "select",
wuhao's avatar
wuhao committed
556
      "title": "入库仓库",
wuhao's avatar
wuhao committed
557 558 559 560
      "name": [
        "storeId"
      ],
      "required": true,
wuhao's avatar
wuhao committed
561
      "options": {
wuhao's avatar
wuhao committed
562
        database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
wuhao's avatar
wuhao committed
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
        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"],
wuhao's avatar
wuhao committed
593
      required: true,
wuhao's avatar
wuhao committed
594 595 596 597 598 599
      linkconfig: {
        urlchangeval: {//根据url接口 改变某个value
          database: (params) => doFetch({ url: "/ngic-workmanship/pmMaterie/queryUnitByMaterieId", params }),
          params: { "materieId": "linked" },
          effectresult: {
            "productionUnit": "productionUnit",//key 为列表更新值  value为response 返回值
左玲玲's avatar
左玲玲 committed
600 601 602 603
            "productionUnitName": "productionUnitName",
            "materieControlNo": "materialCode",
            "instroeNum": "instroeNum",
            "supplierId": "supplierId"
wuhao's avatar
wuhao committed
604 605 606
          }
        }
      },
wuhao's avatar
wuhao committed
607 608
      columns: [
        {
wuhao's avatar
wuhao committed
609 610 611 612 613 614 615 616 617 618
          "title": <span>物料编码-名称 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "materieId",
          "key": "materieId",
          "valueType": "select",
          "width": 300,
          "request": async () => {
            let res = await doFetch({ url: "/ngic-workmanship/pmMaterie/query/selectbox", params: {} })
            return res?.data?.dataList
          },
          "fieldProps": {
wuhao's avatar
wuhao committed
619
            allowClear: true,
wuhao's avatar
wuhao committed
620 621 622 623 624 625 626
            showSearch: true
          },
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
wuhao's avatar
wuhao committed
627 628
        },
        {
wuhao's avatar
wuhao committed
629 630 631 632 633 634 635 636 637 638
          "title": <span>供应商编号-名称 <b style={{ color: "red" }}>*</b></span>,
          "dataIndex": "supplierId",
          "key": "supplierId",
          "valueType": "select",
          "width": 300,
          "request": async () => {
            let res = await doFetch({ url: "/ngic-auth/sysSupplier/query/selection/withNo", params: {} })
            return res?.data?.dataList
          },
          "fieldProps": {
wuhao's avatar
wuhao committed
639
            allowClear: true,
wuhao's avatar
wuhao committed
640 641 642 643 644 645 646
            showSearch: true
          },
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
wuhao's avatar
wuhao committed
647 648 649 650 651 652 653
        },
        {
          "title": "批次号/SN号",
          "dataIndex": "materieControlNo",
          "key": "materieControlNo"
        },
        {
wuhao's avatar
wuhao committed
654
          "title": <span>入库数量 <b style={{ color: "red" }}>*</b></span>,
wuhao's avatar
wuhao committed
655
          "dataIndex": "instroeNum",
wuhao's avatar
wuhao committed
656 657 658 659 660 661
          "key": "instroeNum",
          "formItemProps": () => {
            return {
              rules: [{ required: true, message: '此项为必填项' }],
            };
          },
左玲玲's avatar
左玲玲 committed
662
          valueType: "digit"
wuhao's avatar
wuhao committed
663 664
        },
        {
wuhao's avatar
wuhao committed
665
          "title": "库存单位",
wuhao's avatar
wuhao committed
666 667 668
          "dataIndex": "productionUnitName",
          "key": "productionUnitName",
          "readonly": 'productionUnitName',
wuhao's avatar
wuhao committed
669
          "width": 88
wuhao's avatar
wuhao committed
670 671 672 673 674 675 676 677 678 679 680 681 682
        },
        {
          title: "操作",
          valueType: "option",
          width: 70,
          render: (text, record, _, action) => [
            <a key="delete" onClick={() => { }}>
              删除
            </a>,
          ],
        },
      ],
      rowKey: "id",
wuhao's avatar
wuhao committed
683 684
    }
  },
wuhao's avatar
wuhao committed
685
  detail = (setselected, dom) => ({
wuhao's avatar
wuhao committed
686 687
    totalCard: [
      //物料详情
wuhao's avatar
wuhao committed
688
      {
wuhao's avatar
wuhao committed
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
        cardTitle: "基本信息",
        itemData: [
          {
            title: "入库单号",
            key: "materieInstoreNo",
          },
          {
            title: "入库类型",
            key: "instoreTypeName",
          },
          {
            title: "入库仓库",
            key: "storeName",
          },
          {
            title: "相关单号",
            key: "businessNo",
          },
          {
            title: "创建人",
            key: "createUserName",
          },
          {
            title: "创建时间",
            key: "createTime",
左玲玲's avatar
左玲玲 committed
714
          }, {
左玲玲's avatar
左玲玲 committed
715 716
            title: "状态",
            key: "statusName",
wuhao's avatar
wuhao committed
717
          },
左玲玲's avatar
左玲玲 committed
718 719 720 721
          {
            title: "完成时间",
            key: "finishTime",
          },
wuhao's avatar
wuhao committed
722 723 724
          {
            title: "备注",
            key: "remark",
wuhao's avatar
wuhao committed
725
            noshow: "100%",
wuhao's avatar
wuhao committed
726
          },
727
          {
wuhao's avatar
wuhao committed
728
            title: "工单条形码",
wuhao's avatar
wuhao committed
729
            noshow: true,
730
            key: "qrCodeUrl",
左玲玲's avatar
左玲玲 committed
731 732
            type: "img",
            width: 100,
733
          },
wuhao's avatar
wuhao committed
734
        ],
wuhao's avatar
wuhao committed
735 736
      },
      {
wuhao's avatar
wuhao committed
737
        cardTitle: "物料信息列表",
wuhao's avatar
wuhao committed
738
        extraContent: dom,
wuhao's avatar
wuhao committed
739 740 741 742 743 744 745
        itemData: [
          {
            key: "materialList",
            type: "table",
            col: { span: 24 },
            columns: [
              {
wuhao's avatar
wuhao committed
746
                title: "物料编码 - 名称",
wuhao's avatar
wuhao committed
747 748 749
                dataIndex: "materieName",
                key: "materieName",
                search: false,
wuhao's avatar
wuhao committed
750 751 752
                render: (dom, row) => {
                  return (row.materieCode ?? '') + " - " + (row.materieName ?? '')
                }
wuhao's avatar
wuhao committed
753 754
              },
              {
wuhao's avatar
wuhao committed
755 756 757 758 759 760 761 762 763 764 765 766
                title: "供应商编号 - 名称",
                dataIndex: "supplierNo",
                key: "supplierNo",
                search: false,
                render: (dom, row) => {
                  return (row.supplierNo ?? '') + " - " + (row.supplierName ?? '')
                }
              },
              {
                title: "批次号/SN号",
                dataIndex: "materieControlNo",
                key: "materieControlNo",
wuhao's avatar
wuhao committed
767 768 769 770 771 772 773 774
                search: false,
              },
              {
                title: "入库数量",
                dataIndex: "instroeNum",
                key: "instroeNum",
                search: false,
              },
左玲玲's avatar
左玲玲 committed
775 776 777 778 779 780
              {
                title: "未上架数量",
                dataIndex: "remainderNums",
                key: "remainderNums",
                search: false,
              },
wuhao's avatar
wuhao committed
781
              {
wuhao's avatar
wuhao committed
782
                title: "库存单位",
wuhao's avatar
wuhao committed
783 784 785 786 787 788
                dataIndex: "productionUnitName",
                key: "productionUnitName",
                search: false,
              },
            ],
            expandable: {
wuhao's avatar
wuhao committed
789
              defaultExpandAllRows: true,
wuhao's avatar
wuhao committed
790
              expandedRowRender: record => <Table
wuhao's avatar
wuhao committed
791
                style={{ marginLeft: 48 }}
wuhao's avatar
wuhao committed
792 793 794
                columns={[
                  {
                    title: "库位名称",
wuhao's avatar
wuhao committed
795 796
                    dataIndex: "storePositionName",
                    key: "storePositionName",
wuhao's avatar
wuhao committed
797
                    search: false,
wuhao's avatar
wuhao committed
798 799 800 801 802
                    "formItemProps": () => {
                      return {
                        rules: [{ required: true, message: '此项为必填项' }],
                      };
                    },
wuhao's avatar
wuhao committed
803 804 805 806 807
                  },
                  {
                    title: "上架数量",
                    dataIndex: "instroeNum",
                    key: "instroeNum",
wuhao's avatar
wuhao committed
808 809 810 811 812 813
                    search: false,
                    "formItemProps": () => {
                      return {
                        rules: [{ required: true, message: '此项为必填项' }],
                      };
                    },
wuhao's avatar
wuhao committed
814 815
                  }
                ]}
wuhao's avatar
wuhao committed
816
                dataSource={record.uploadList}
wuhao's avatar
wuhao committed
817 818
                pagination={false}
              />,
wuhao's avatar
wuhao committed
819
            },
左玲玲's avatar
左玲玲 committed
820
            pagination: "false",
wuhao's avatar
wuhao committed
821 822 823 824 825 826
            rowKey: "id",
            rowSelection: {
              onChange: (selectedRowKeys, selectedRows) => {
                setselected(selectedRows)
              },
            }
wuhao's avatar
wuhao committed
827
          },
wuhao's avatar
wuhao committed
828 829
        ],
      },
wuhao's avatar
wuhao committed
830
      {
左玲玲's avatar
左玲玲 committed
831
        cardTitle: "强制关单信息",
wuhao's avatar
wuhao committed
832 833
        itemData: [
          {
左玲玲's avatar
左玲玲 committed
834
            title: "关单人",
wuhao's avatar
wuhao committed
835 836 837
            key: "closeUserName",
          },
          {
左玲玲's avatar
左玲玲 committed
838
            title: "关单时间",
wuhao's avatar
wuhao committed
839 840 841 842
            key: "closeTime",
          }
        ],
      },
wuhao's avatar
wuhao committed
843 844
      {
        cardTitle: "上架明细",
wuhao's avatar
wuhao committed
845
        noPrint: true,
wuhao's avatar
wuhao committed
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882
        itemData: [
          {
            key: "materialUploadList",
            type: "table",
            col: { span: 24 },
            columns: [
              {
                title: "物料编码 - 名称",
                dataIndex: "materieName",
                key: "materieName",
                search: false,
                render: (dom, row) => {
                  return (row.materieCode ?? '') + " - " + (row.materieName ?? '')
                }
              },
              {
                title: "供应商编号 - 名称",
                dataIndex: "supplierNo",
                key: "supplierNo",
                search: false,
                render: (dom, row) => {
                  return (row.supplierNo ?? '') + " - " + (row.supplierName ?? '')
                }
              },
              {
                title: "批次号/SN号",
                dataIndex: "materieControlNo",
                key: "materieControlNo",
                search: false,
              },
              {
                title: "入库数量",
                dataIndex: "instroeNum",
                key: "instroeNum",
                search: false,
              },
              {
wuhao's avatar
wuhao committed
883
                title: "库存单位",
wuhao's avatar
wuhao committed
884 885 886 887 888 889 890 891 892 893 894 895
                dataIndex: "productionUnitName",
                key: "productionUnitName",
                search: false,
              },
            ],
            expandable: {
              defaultExpandAllRows: true,
              expandedRowRender: record => <Table
                style={{ marginLeft: 48 }}
                columns={[
                  {
                    title: "库位名称",
wuhao's avatar
wuhao committed
896 897
                    dataIndex: "storePositionName",
                    key: "storePositionName",
wuhao's avatar
wuhao committed
898
                    search: false,
wuhao's avatar
wuhao committed
899 900 901 902 903
                    "formItemProps": () => {
                      return {
                        rules: [{ required: true, message: '此项为必填项' }],
                      };
                    },
wuhao's avatar
wuhao committed
904 905 906 907 908
                  },
                  {
                    title: "上架数量",
                    dataIndex: "instroeNum",
                    key: "instroeNum",
wuhao's avatar
wuhao committed
909 910 911 912 913 914
                    search: false,
                    "formItemProps": () => {
                      return {
                        rules: [{ required: true, message: '此项为必填项' }],
                      };
                    },
wuhao's avatar
wuhao committed
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937
                  }
                  ,
                  {
                    title: "备注",
                    dataIndex: "remark",
                    key: "remark",
                    search: false,
                  }
                  ,
                  {
                    title: "操作人",
                    dataIndex: "uploadUserName",
                    key: "uploadUserName",
                    search: false,
                  }
                  ,
                  {
                    title: "操作时间",
                    dataIndex: "uploadTime",
                    key: "uploadTime",
                    search: false,
                  }
                ]}
wuhao's avatar
wuhao committed
938
                dataSource={record.uploadList}
wuhao's avatar
wuhao committed
939 940 941 942 943 944 945
                pagination={false}
              />,
            },
            pagination: "false"
          },
        ],
      },
wuhao's avatar
wuhao committed
946
    ]
wuhao's avatar
wuhao committed
947
  }), doinsert = (fid, storeId) => ({
wuhao's avatar
wuhao committed
948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980
    totalCard: [
      //物料详情
      {
        cardTitle: "基本信息",
        itemData: [
          {
            title: "入库单号",
            key: "materieInstoreNo",
          },
          {
            title: "入库类型",
            key: "instoreTypeName",
          },
          {
            title: "入库仓库",
            key: "storeName",
          },
          {
            title: "相关单号",
            key: "businessNo",
          },
          {
            title: "备注",
            key: "remark",
          },
          {
            title: "创建人",
            key: "createUserName",
          },
          {
            title: "创建时间",
            key: "createTime",
          },
981 982 983 984
          {
            title: "状态",
            key: "statusName",
          }
wuhao's avatar
wuhao committed
985 986 987 988 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
        ],
      },
      {
        cardTitle: "物料信息列表",
        extra: true,
        extrapath: "/ngic-workmanship/wmsMaterieInstore/upload",
        extrakey: "submit",//redux key
        itemData: [
          {
            key: "materialList",
            type: "table",
            col: { span: 24 },
            columns: [
              {
                title: "物料编码 - 名称",
                dataIndex: "materieName",
                key: "materieName",
                search: false,
                render: (dom, row) => {
                  return (row.materieCode ?? '') + " - " + (row.materieName ?? '')
                }
              },
              {
                title: "供应商编号 - 名称",
                dataIndex: "supplierNo",
                key: "supplierNo",
                search: false,
                render: (dom, row) => {
                  return (row.supplierNo ?? '') + " - " + (row.supplierName ?? '')
                }
              },
              {
                title: "批次号/SN号",
                dataIndex: "materieControlNo",
                key: "materieControlNo",
                search: false,
              },
              {
                title: "入库数量",
                dataIndex: "instroeNum",
                key: "instroeNum",
左玲玲's avatar
左玲玲 committed
1026
                search: false
wuhao's avatar
wuhao committed
1027
              },
左玲玲's avatar
左玲玲 committed
1028 1029 1030 1031 1032 1033
              {
                title: "未上架数量",
                dataIndex: "remainderNums",
                key: "remainderNums",
                search: false,
              },
wuhao's avatar
wuhao committed
1034
              {
wuhao's avatar
wuhao committed
1035
                title: "库存单位",
wuhao's avatar
wuhao committed
1036 1037 1038 1039 1040 1041
                dataIndex: "productionUnitName",
                key: "productionUnitName",
                search: false,
              },
            ],
            expandable: {
左玲玲's avatar
左玲玲 committed
1042 1043 1044
              expandedRowRender: record => <EditUpload record={record} fid={fid} storeId={storeId} />,
            },
            rowKey: "id"
wuhao's avatar
wuhao committed
1045 1046 1047 1048
          },
        ],
      },
    ]
wuhao's avatar
wuhao committed
1049
  });
wuhao's avatar
wuhao committed
1050 1051 1052 1053 1054 1055 1056 1057




export default {
  one,
  two,
  three,
wuhao's avatar
wuhao committed
1058
  four,
wuhao's avatar
wuhao committed
1059 1060
  detail,
  doinsert
wuhao's avatar
wuhao committed
1061
};