index.jsx 19.7 KB
Newer Older
TZW's avatar
TZW committed
1
/* eslint-disable react-hooks/exhaustive-deps */
TZW's avatar
TZW committed
2 3 4 5
/* 追踪工单
 * @Author: Li Hanlin
 * @Date: 2022-12-02 11:41:03
 * @Last Modified by: Li Hanlin
TZW's avatar
TZW committed
6
 * @Last Modified time: 2023-01-30 11:12:49
TZW's avatar
TZW committed
7
 */
wuhao's avatar
wuhao committed
8

TZW's avatar
TZW committed
9
import * as React from 'react';
TZW's avatar
TZW committed
10
import { useState, useMemo, useRef, useEffect } from 'react';
TZW's avatar
TZW committed
11 12 13 14 15 16
import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton';
import getcolumns from './columns';
import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch';
TZW's avatar
TZW committed
17 18 19
import Addform from '@/components/Addform';
import { Menu, Dropdown, Button, message } from 'antd';
import InitForm from '@/components/InitForm';
TZW's avatar
TZW committed
20
import Detail from '@/components/RepaireDetail/Detail';
TZW's avatar
TZW committed
21 22
function Failure(props) {
  const actionRef = useRef(),
TZW's avatar
TZW committed
23
    containderef = useRef(),
TZW's avatar
TZW committed
24 25
    formRef = useRef();
  const [drawer, setdrawer] = useState({
wuhao's avatar
wuhao committed
26
      open: false,
TZW's avatar
TZW committed
27
      SpecName: null,
TZW's avatar
TZW committed
28 29
    }),
    [activeTabKey, setactiveTabKey] = useState('1');
wuhao's avatar
wuhao committed
30

TZW's avatar
TZW committed
31 32 33 34 35 36 37 38 39 40 41 42 43
  const { run, loading } = useRequest(doFetch, {
    manual: true,
    onSuccess: (res, params) => {
      if (res?.code == '0000') {
        actionRef?.current?.reload();
        setdrawer((s) => ({
          ...s,
          open: false,
        }));
      }
    },
  });

TZW's avatar
TZW committed
44 45 46 47 48 49 50 51 52 53 54 55 56
  useEffect(async () => {
    let res = await doFetch({
      url: '/base/pmBaseBusinessData/queryBySpecName',
      params: {
        businessSpecName: 'TRACKING_ORDER_DISTRIBUTE',
      },
    });
    setdrawer((s) => ({
      ...s,
      SpecName: res?.data?.data,
    }));
  }, []);

TZW's avatar
TZW committed
57 58
  // 重新指派
  const Reassig = () => {
TZW's avatar
TZW committed
59
    return (
TZW's avatar
TZW committed
60 61 62 63
      <>
        <InitForm
          fields={[
            {
TZW's avatar
TZW committed
64
              title: '最新追踪人员',
TZW's avatar
TZW committed
65
              dataIndex: 'newRepairUserName',
TZW's avatar
TZW committed
66
              formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
TZW's avatar
TZW committed
67 68
              fieldProps: { disabled: true },
              key: 'newRepairUserName',
TZW's avatar
TZW committed
69 70 71 72 73
            },
            {
              title: '追踪人员',
              dataIndex: 'trackAssistList',
              formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
TZW's avatar
TZW committed
74 75 76 77
              fieldProps: {
                placeholder: '请选择',
                mode: 'multiple',
              },
TZW's avatar
TZW committed
78 79 80 81 82 83 84 85 86 87
              key: 'trackAssistList',
              valueType: 'select',
              options: {
                path: '/repair/umTrackOrder/selectionAgain',
                params: { id: drawer?.item.id },
              },
            },
          ]}
          onFinish={async (vals) => {
            let params = {
TZW's avatar
TZW committed
88
              trackAssistList: vals?.trackAssistList.map((it) => ({ assistUserId: it })),
TZW's avatar
TZW committed
89 90 91
              id: drawer?.item?.id,
            };
            let res = await doFetch({
TZW's avatar
TZW committed
92
              url: '/repair/umTrackOrder/againTrack',
TZW's avatar
TZW committed
93 94 95
              params,
            });
            if (res.code === '0000') {
TZW's avatar
TZW committed
96
              message.success('重新指派成功!');
TZW's avatar
TZW committed
97 98 99 100 101 102 103
              setdrawer((s) => ({
                ...s,
                open: false,
              }));
              actionRef.current.reload();
            }
          }}
TZW's avatar
TZW committed
104
          defaultFormValue={drawer?.item}
TZW's avatar
TZW committed
105
          {...drawer}
TZW's avatar
TZW committed
106 107 108 109 110 111 112 113 114 115 116 117 118
        />
      </>
    );
  };

  // 追踪
  const TrackForm = () => {
    return (
      <>
        <InitForm
          fields={[
            {
              title: '计划追踪日期',
TZW's avatar
TZW committed
119 120
              dataIndex: 'planTrackTime',
              formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
TZW's avatar
TZW committed
121
              key: 'nextTrackDate',
TZW's avatar
TZW committed
122 123
              fieldProps: {
                disabled: true,
TZW's avatar
TZW committed
124 125 126
              },
            },
            {
TZW's avatar
TZW committed
127 128 129
              title: '追踪结果',
              dataIndex: 'trackResult',
              valueType: 'radio',
TZW's avatar
TZW committed
130
              formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
TZW's avatar
TZW committed
131 132 133 134 135 136 137 138 139 140 141 142
              options: [
                {
                  value: '1',
                  label: '正常',
                },
                {
                  value: '2',
                  label: '异常',
                },
              ],
              colProps: { span: 24 },
              key: 'trackResult',
TZW's avatar
TZW committed
143 144
            },
            {
TZW's avatar
TZW committed
145 146 147
              title: '是否完成追踪',
              dataIndex: 'isFinishTrack',
              valueType: 'radio',
TZW's avatar
TZW committed
148
              formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
TZW's avatar
TZW committed
149 150 151 152 153 154 155 156 157 158 159 160
              colProps: { span: 24 },
              key: 'isFinishTrack',
              options: [
                {
                  value: '1',
                  label: '是',
                },
                {
                  value: '2',
                  label: '否',
                },
              ],
TZW's avatar
TZW committed
161 162
            },
            {
TZW's avatar
TZW committed
163 164 165
              title: '追踪周期',
              dataIndex: 'trackCycle',
              key: 'trackCycle',
TZW's avatar
TZW committed
166 167 168
              fieldProps: {
                disabled: true,
              },
TZW's avatar
TZW committed
169 170
            },
            {
TZW's avatar
TZW committed
171 172 173
              title: '追踪内容',
              dataIndex: 'trackContents',
              key: 'trackContents',
TZW's avatar
TZW committed
174
              formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
TZW's avatar
TZW committed
175 176 177 178 179
              valueType: 'textarea',
            },
          ]}
          onFinish={async (vals) => {
            let params = {
TZW's avatar
TZW committed
180
              trackTraceinfo: { ...vals, planTrackTime: vals.nextTrackDate },
TZW's avatar
TZW committed
181 182
              id: drawer?.item?.id,
            };
TZW's avatar
TZW committed
183 184 185
            delete params.trackTraceinfo.nextTrackDate;
            //console.log(params);

TZW's avatar
TZW committed
186
            let res = await doFetch({
TZW's avatar
TZW committed
187
              url: '/repair/umTrackOrder/trackById',
TZW's avatar
TZW committed
188 189 190
              params,
            });
            if (res.code === '0000') {
TZW's avatar
TZW committed
191
              message.success('成功完成追踪!');
TZW's avatar
TZW committed
192 193 194 195 196 197 198
              setdrawer((s) => ({
                ...s,
                open: false,
              }));
              actionRef.current.reload();
            }
          }}
TZW's avatar
TZW committed
199
          {...drawer}
TZW's avatar
TZW committed
200
          defaultFormValue={drawer?.item}
TZW's avatar
TZW committed
201 202 203 204 205
        />
      </>
    );
  };

TZW's avatar
TZW committed
206 207
  // 验证
  const CheckForm = () => {
TZW's avatar
TZW committed
208 209 210 211 212
    return (
      <>
        <InitForm
          fields={[
            {
TZW's avatar
TZW committed
213 214
              title: '追踪人员',
              dataIndex: 'trackerName',
TZW's avatar
TZW committed
215
              formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
TZW's avatar
TZW committed
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
              key: 'trackerName',
              fieldProps: {
                placeholder: '请选择',
                disabled: true,
              },
            },
            {
              title: '计划追踪日期',
              dataIndex: 'planTrackTime',
              key: 'planTrackTime',
              fieldProps: {
                placeholder: '请选择',
                disabled: true,
              },
            },
            {
              title: '实际追踪日期',
              dataIndex: 'actualTrackTime',
              fieldProps: {
                placeholder: '请选择',
                disabled: true,
              },
              key: 'actualTrackTime',
            },
            {
              title: '追踪结果',
              dataIndex: 'trackResults',
              fieldProps: {
                placeholder: '请选择',
                disabled: true,
              },
              key: 'trackResults',
            },
            {
              title: '追踪内容',
              dataIndex: 'trackContents',
              key: 'trackContents',
              fieldProps: {
                placeholder: '请选择',
                disabled: true,
              },
            },
            {
              title: '验证结果',
              dataIndex: 'reviewerResult',
              valueType: 'radio',
TZW's avatar
TZW committed
262
              formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
TZW's avatar
TZW committed
263 264 265 266 267 268 269 270 271 272 273
              options: [
                {
                  value: 1,
                  label: '通过',
                },
                {
                  value: 2,
                  label: '不通过',
                },
              ],
              key: 'reviewerResult',
TZW's avatar
TZW committed
274 275
            },
            {
TZW's avatar
TZW committed
276
              title: '备注',
TZW's avatar
TZW committed
277
              dataIndex: 'remark',
TZW's avatar
TZW committed
278
              valueType: 'textarea',
TZW's avatar
TZW committed
279
              formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
TZW's avatar
TZW committed
280
              key: 'remark',
TZW's avatar
TZW committed
281 282 283 284
            },
          ]}
          onFinish={async (vals) => {
            let params = {
TZW's avatar
TZW committed
285 286 287 288
              trackProcess: {
                reviewerResult: vals.reviewerResult,
                remark: vals.remark,
              },
TZW's avatar
TZW committed
289 290 291
              id: drawer?.item?.id,
            };
            let res = await doFetch({
TZW's avatar
TZW committed
292
              url: '/repair/umTrackOrder/verification',
TZW's avatar
TZW committed
293 294 295
              params,
            });
            if (res.code === '0000') {
TZW's avatar
TZW committed
296
              message.success('验证成功!');
TZW's avatar
TZW committed
297 298 299 300 301 302 303
              setdrawer((s) => ({
                ...s,
                open: false,
              }));
              actionRef.current.reload();
            }
          }}
TZW's avatar
TZW committed
304
          defaultFormValue={drawer?.item}
TZW's avatar
TZW committed
305
          {...drawer}
TZW's avatar
TZW committed
306 307
        />
      </>
TZW's avatar
TZW committed
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
    );
  };

  const remove = (text, row, _, action) => {
    return (
      <PremButton
        pop={{
          title: '是否删除?',
          okText: '确认',
          cancelText: '取消',
          onConfirm: () => {
            run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
          },
        }}
        btn={{
          size: 'small',
          type: 'danger',
        }}
      >
        删除
      </PremButton>
    );
  };

TZW's avatar
TZW committed
332 333
  // 更多
  const more = (text, row, _, action) => {
TZW's avatar
TZW committed
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
    let menulist = [];
    if (row?.status == '1') {
      menulist = [
        {
          label: (
            <PremButton
              btn={{
                onClick: async () => {
                  let params = {
                    id: row?.id,
                  };
                  let res = await doFetch({
                    url: '/repair/umTrackOrder/orderReceiving',
                    params,
                  });
                  if (res.code === '0000') {
                    message.success('接单成功!');
TZW's avatar
TZW committed
351 352
                    setdrawer((s) => ({
                      ...s,
TZW's avatar
TZW committed
353
                      open: false,
TZW's avatar
TZW committed
354
                    }));
TZW's avatar
TZW committed
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
                    actionRef.current.reload();
                  }
                },
              }}
            >
              接单
            </PremButton>
          ),
          key: '0',
          // disabled: true,
        },
      ];
    } else if (row?.status == '2') {
      menulist = [
        {
          label: (
            <PremButton
              btn={{
                onClick: async () => {
                  let params = {
                    id: row?.id,
                  };
                  let res = await doFetch({
                    url: '/repair/umTrackOrder/dispatchById',
                    params,
                  });
                  if (res.code === '0000') {
                    message.success('派单成功!');
TZW's avatar
TZW committed
383 384
                    setdrawer((s) => ({
                      ...s,
TZW's avatar
TZW committed
385
                      open: false,
TZW's avatar
TZW committed
386
                    }));
TZW's avatar
TZW committed
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452
                    actionRef.current.reload();
                  }
                },
              }}
            >
              派单
            </PremButton>
          ),
          key: '0',
          // disabled: true,
        },
      ];
    } else if (row?.status == '3') {
      menulist = [
        {
          label: (
            <PremButton
              btn={{
                onClick: () => {
                  setdrawer((s) => ({
                    ...s,
                    open: true,
                    type: 'track',
                    item: { ...row, trackCycle: String(row?.trackCycle) },
                    // detailpath: '/repair/umTrackTraceinfo/queryByTrackOrderId',
                    // params: { trackOrderId: row?.id },
                    val: 'only',
                    title: '追踪信息',
                  }));
                },
              }}
            >
              追踪
            </PremButton>
          ),
          key: '1',
        },
      ];
    } else if (row?.status == '4') {
      menulist = [
        {
          label: (
            <PremButton
              btn={{
                onClick: () => {
                  setdrawer((s) => ({
                    ...s,
                    open: true,
                    val: 'only',
                    title: '验证',
                    item: row,
                    detailpath: '/repair/umTrackTraceinfo/queryByTrackOrderId',
                    params: { trackOrderId: row?.id },
                    type: 'check',
                  }));
                },
              }}
            >
              验证
            </PremButton>
          ),
          key: '2',
        },
      ];
    }
    const menu = <Menu items={menulist} />;
TZW's avatar
TZW committed
453 454 455 456 457 458 459 460 461 462 463 464 465
    return (
      <Dropdown
        overlay={menu}
        trigger={['click']}
        arrow={true}
        getPopupContainer={() => containderef.current}
      >
        <Button size="small">更多</Button>
      </Dropdown>
    );
  };
  // 未完成按钮
  const unfinishBtn = (text, row, _, action) => {
TZW's avatar
TZW committed
466
    if (row?.status == 1 || row?.status == 2) {
TZW's avatar
TZW committed
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484
      return (
        <PremButton
          pop={{
            title: '是否删除?',
            okText: '确认',
            cancelText: '取消',
            onConfirm: () => {
              run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
            },
          }}
          btn={{
            size: 'small',
            type: 'danger',
          }}
        >
          删除
        </PremButton>
      );
TZW's avatar
TZW committed
485
    } else if (row?.status == 3) {
TZW's avatar
TZW committed
486 487 488 489
      return (
        <PremButton
          btn={{
            size: 'small',
TZW's avatar
TZW committed
490 491 492
            onClick: () => {
              setdrawer((s) => ({
                ...s,
TZW's avatar
TZW committed
493 494 495 496
                item: {
                  ...row,
                  trackAssistList: row?.trackAssistList ? row?.trackAssistList : [],
                },
TZW's avatar
TZW committed
497 498 499 500
                type: 'Reassig',
                open: true,
                val: 'only',
              }));
TZW's avatar
TZW committed
501
              //console.log(drawer);
TZW's avatar
TZW committed
502
            },
TZW's avatar
TZW committed
503 504 505 506 507 508 509 510
          }}
        >
          重新指派
        </PremButton>
      );
    }
  };

TZW's avatar
TZW committed
511
  const columns = useMemo(() => {
TZW's avatar
TZW committed
512 513 514
    let defcolumn = getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
      (it) => it.key == activeTabKey,
    )[0]?.columns;
TZW's avatar
TZW committed
515
    //console.log(defcolumn);
TZW's avatar
TZW committed
516 517 518 519
    let defpath =
      getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
        (it) => it.key == activeTabKey,
      )[0]?.pathconfig ?? {};
TZW's avatar
TZW committed
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541

    if (activeTabKey == '1') {
      return defcolumn.concat({
        title: '操作',
        valueType: 'option',
        width: 150,
        render: (text, row, _, action) => {
          return [more(text, row, _, action)];
        },
      });
    } else if (activeTabKey == '2') {
      return defcolumn.concat({
        title: '操作',
        valueType: 'option',
        width: 150,
        render: (text, row, _, action) => {
          return [unfinishBtn(text, row, _, action)];
        },
      });
    } else if (activeTabKey == '3') {
      return defcolumn;
    }
TZW's avatar
TZW committed
542
  }, [activeTabKey]);
wuhao's avatar
wuhao committed
543

TZW's avatar
TZW committed
544 545 546 547
  const pathconfig = useMemo(() => {
    let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
    return defpath;
  }, [activeTabKey]);
wuhao's avatar
wuhao committed
548

TZW's avatar
TZW committed
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633
  const basecolumns = useMemo(() => {
    if (activeTabKey == 3) {
      return [
        {
          title: '创建人',
          dataIndex: 'createUserName',
          key: 'createUserName',
        },
        {
          title: '创建时间',
          dataIndex: 'createTime',
          key: 'createTime',
        },
        {
          title: '工单状态',
          dataIndex: 'statusName',
          key: 'statusName',
        },
        {
          title: '来源工单',
          dataIndex: 'dataSourcesNo',
          key: 'dataSourcesNo',
        },
        {
          title: '来源类型',
          dataIndex: 'dataSourcesName',
          key: 'dataSourcesName',
        },
        {
          title: '最新追踪人员',
          dataIndex: 'newRepairUserName',
          key: 'newRepairUserName',
        },
        {
          title: '下次追踪日期',
          dataIndex: 'nextTrackDate',
          key: 'nextTrackDate',
        },
        {
          title: '关单时间',
          dataIndex: 'repairCloseTime',
          key: 'repairCloseTime',
        },
      ];
    } else {
      return [
        {
          title: '创建人',
          dataIndex: 'createUserName',
          key: 'createUserName',
        },
        {
          title: '创建时间',
          dataIndex: 'createTime',
          key: 'createTime',
        },
        {
          title: '工单状态',
          dataIndex: 'statusName',
          key: 'statusName',
        },
        {
          title: '来源工单',
          dataIndex: 'dataSourcesNo',
          key: 'dataSourcesNo',
        },
        {
          title: '来源类型',
          dataIndex: 'dataSourcesName',
          key: 'dataSourcesName',
        },
        {
          title: '最新追踪人员',
          dataIndex: 'newRepairUserName',
          key: 'newRepairUserName',
        },
        {
          title: '下次追踪日期',
          dataIndex: 'nextTrackDate',
          key: 'nextTrackDate',
        },
      ];
    }
  }, [activeTabKey]);

TZW's avatar
TZW committed
634 635 636
  const selectType = (type) => {
    switch (type) {
      case 'add':
TZW's avatar
TZW committed
637
        return (
TZW's avatar
TZW committed
638 639 640 641 642 643
          <Addform
            url={'/repair/umTrackOrder/save'}
            setdrawer={setdrawer}
            actionRef={actionRef}
            drawer={drawer}
          />
TZW's avatar
TZW committed
644
        );
TZW's avatar
TZW committed
645 646 647 648
      case 'track':
        return <TrackForm />;
      case 'check':
        return <CheckForm />;
TZW's avatar
TZW committed
649 650
      case 'Reassig':
        return <Reassig />;
TZW's avatar
TZW committed
651 652 653 654 655 656 657 658 659 660 661 662
      case 'detail':
        return (
          <Detail
            title="追踪单号"
            titleno={drawer?.item?.taskOrderNo}
            detailpath="/repair/umTrackOperation/queryOperationList"
            params={{ trackOrderId: drawer?.item?.id }}
            baseRow={drawer?.item}
            basecolumns={basecolumns}
            type="zzgd"
          />
        );
TZW's avatar
TZW committed
663 664 665 666 667
      default:
        break;
    }
  };
  return (
TZW's avatar
TZW committed
668
    <div style={{ position: 'relative' }} ref={containderef}>
TZW's avatar
TZW committed
669
      <AutoTable
TZW's avatar
TZW committed
670
        pagetitle={<h3 className="page-title">追踪工单</h3>}
TZW's avatar
TZW committed
671 672 673 674
        columns={columns}
        path={pathconfig?.list || '/ngic-auth/sysUser/query/page'}
        actionRef={actionRef}
        pageextra={pathconfig?.enableadd ? 'add' : null}
TZW's avatar
TZW committed
675
        resizeable={false}
TZW's avatar
TZW committed
676 677
        addconfig={{
          // access: 'sysDepartment_save',
TZW's avatar
TZW committed
678
          name: '新建追踪工单',
TZW's avatar
TZW committed
679 680 681
          btn: {
            disabled: false,
            type: 'primary',
wuhao's avatar
wuhao committed
682 683 684 685
            onClick: () => {
              setdrawer((s) => ({
                ...s,
                open: true,
TZW's avatar
TZW committed
686 687 688
                item: {
                  isShutdown: 1,
                },
TZW's avatar
TZW committed
689
                title: '新建追踪工单',
TZW's avatar
TZW committed
690 691
                val: 'only',
                type: 'add',
wuhao's avatar
wuhao committed
692 693
              }));
            },
TZW's avatar
TZW committed
694 695 696 697 698 699 700 701
          },
        }}
        tabList={getcolumns()}
        activeTabKey={activeTabKey}
        onTabChange={(key) => {
          setactiveTabKey(key);
        }}
      />
wuhao's avatar
wuhao committed
702

TZW's avatar
TZW committed
703 704 705 706 707 708 709 710 711 712 713
      <DrawerPro
        fields={columns}
        detailpath={pathconfig?.detail || null}
        detailData={drawer?.item}
        defaultFormValue={drawer?.item}
        params={{ id: drawer?.item?.id }}
        formRef={formRef}
        placement="right"
        onClose={() => {
          setdrawer((s) => ({
            ...s,
TZW's avatar
TZW committed
714

TZW's avatar
TZW committed
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731
            open: false,
          }));
        }}
        {...drawer}
        onFinish={(vals) => {
          if (drawer?.val == 'add') {
            run({ url: pathconfig?.add || '/add', params: { ...vals } });
          } else if (drawer?.val == 'edit') {
            run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
          }
        }}
      >
        {selectType(drawer?.type)}
      </DrawerPro>
    </div>
  );
}
wuhao's avatar
wuhao committed
732

TZW's avatar
TZW committed
733
export default Failure;