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

import { dicFindUtils, DictBizType } from '@/utils/utils'
import { dispatchHandle } from "@/utils/publicHandle";
import useFormTable from '@/useHooks/useFormTable';
import ShowApproval from '@/components/ShowApproval/ShowApproval'

import EditableTable from "../components/EditableTable"
import AddSparePartModal from "./components/AddSparePartModal"
import SubmitRemindModal from './components/SubmitRemindModal'
import AddFeeModal from "./components/AddFeeModal"
import InfluenceAdv from "./components/InfluenceAdv"
import MainDeviceCard from "./components/MainDeviceCard"
import CustormRangePicker from '@/components/CustormRangePicker';
import style from "./index.less"
import TreeSelector from "@/components/TreeSelector"

const { TabPane } = Tabs;
const { TextArea } = Input
const { Option } = Select

const AddSpecialPlan = (props) => {
    const {
        dispatch,
        spLoading,
        FeeLoading,
        location: {
            query
        },
        dict: {
            dicTotalsList
        },
        maintaining: {
            deviceSystemList,
            sparePartList,
            planOutFeeList,
            firmList
        },
        universal: {
            approvalDetail
        }
    } = props;
    const [form] = Form.useForm()// 新增表单
    const [spForm] = Form.useForm() // 备件表单
    const [defaultValue, setDefaultValue] = useState(false) // 是否委外养护
    const [tableData, setTableData] = useState([]); // 单元格可编辑的数据备件
    const [selectDevice, setSelectDevice] = useState([])// 设备选择
    const [specialPlanSureVisible, setSpecialPlanSureVisible] = useState(false) //专项计划保存确认对话框显示隐藏
    const [relativeAdvRule, setRelativeAdvRule] = useState([])
    const [planNumber, setPlanNumber] = useState('')
    const [activeKey, setActiveKey] = useState('2')
    // 是否委外养护的值发生变化
    const getValue = (value) => {
        setDefaultValue(value)
        if (value) {
            setActiveKey('1')
        } else {
            setActiveKey('2')
        }
    }

    /**
   * @计划备件分页列表
   */
    // 备件分页列表
    const [spSelectKeys, setSpSelectKeys] = useState([])
    const getListItem = (payload = {}) => {
        // payload.planNumber = query?.id
        dispatchHandle(
            dispatch,
            'maintaining/operation_service_m_curing_plan_materiePageList_post',
            payload,
            res => setTableData(res)
        )
    }
    const { tableProps, search } = useFormTable(getListItem, {
        form: spForm, manual: true
    })
    // 备件
    // 移除备件
    const deleteSparePart = (payload = []) => {
        dispatchHandle(
            dispatch,
            'maintaining/operation_service_m_curing_plan_deleteMaterie_patch',
            payload,
            () => {
                search.reset()
            }
        )
    }
    const deleteSparePartAction = (record) => {
        deleteSparePart([record.id])
    }
    const spRowSelection = {
        selectedRowKeys: spSelectKeys,
        onChange: (selectedRowKeys, selectedRows) => {
            setSpSelectKeys(selectedRowKeys)
        }
    };
    // table编辑
    const editSPAction = (item) => {
        const payload = {
            id: item.id,
            numberOfMaterials: item.numberOfMaterials
        }
        dispatchHandle(
            dispatch,
            'maintaining/operation_service_m_curing_plan_editMaterie_patch',
            payload
        )
    }
    // 备件
    const sparePartColumns = [
        {
            title: '物料编号',
            dataIndex: 'materielId',
            key: 'id',
        },
        {
            title: '品名',
            dataIndex: ['abo', 'materialInfo', 'materialName'],
            key: 'name',
        },
        {
            title: '类型',
            dataIndex: ['abo', 'materialInfo', 'materialType'],
            key: 'type',
        },
        {
            title: '品牌',
            dataIndex: ['abo', 'materialSupplier', 'brand'],
            key: 'brand',
        },
        {
            title: '规格',
            dataIndex: ['abo', 'materialInfo', 'mmodel'],
            key: 'specs',
        },
        {
            title: '单位',
            dataIndex: ['abo', 'materialInfo', 'munit'],
            key: 'unit',
        },
        {
            title: '需求数量',
            dataIndex: 'numberOfMaterials',
            key: 'numberOfMaterials',
            editable: true,
            render: text => text || 0
        },
        {
            title: '单价(元)',
            dataIndex: ['abo', 'materialSupplier', 'materialPrice'],
            key: 'unitPrice',
            render: text => <a style={{ color: '#138900' }}>{text}</a>
        },
        {
            title: '库存数量',
            dataIndex: ['abo', 'stockNum'],
            key: 'inventoryNum',
            render: text => <a style={{ color: '#138900' }}>{text}</a>
        },
        {
            title: '剩余有效期 (天)',
            dataIndex: ['abo', 'validityTerm'],
            key: 'restValidityTerm',
            render: text => <a>{text}</a>
        },
        {
            title: '供应商',
            dataIndex: ['abo', 'materialSupplier', 'supplierName'],
            key: 'supplier',
        },
        {
            title: '设备状态',
            dataIndex: ['abo', 'materialStatus'],
            key: 'state',
            align: "center",
            render: text => (
                <span
                    className={
                        (text === 105 && 'btn_common') ||
                        (text === 110 && 'btn_warning') ||
                        (text === 100 && 'btn_disabled')
                    }
                >
                    {
                        (text === 105 && '正常') ||
                        (text === 110 && '呆滞') ||
                        (text === 100 && '报废')
                    }
                </span>
            )
        },
        {
            title: '操作',
            key: 'action',
            dataIndex: 'action',
            fixed: 'right',
            render: (text, record) => <div className={style.action}>
                {/* <a>编辑</a>
                <Divider type="vertical" /> */}
                <Popconfirm title='确定删除此备件?' onConfirm={() => deleteSparePartAction(record)}>
                    <a>移除</a>
                </Popconfirm>
            </div>

        },

    ];
    const [sparePartvisible, setSparePartVisible] = useState(false); // 对话框显示隐藏

    // 备件对话框事件方法
    const sparePartShowModal = () => {
        setSparePartVisible(true)
        search.submit();
    };
    // 多项删除(删除备件)
    const deleteManySPAction = () => {
        if (spSelectKeys.length !== 0) {
            deleteSparePart(spSelectKeys)
        } else {
            message.warn(`请选择需要删除的${defaultValue ? '费用' : '备件'}`)
        }
    }

    /**
   * @计划委外费用
   */
    // 养护费用分页列表
    const [feevisible, setFeeVisible] = useState(false); // 对话框显示隐藏
    const [feeType, setFeeType] = useState();// 新增或编辑
    const [selectFeeKeys, setSelectFeeKeys] = useState([])
    const [feeTableData, setFeeTableData] = useState([])
    const getFeeList = (payload = {}) => {
        // payload.planNumber = query?.id
        dispatchHandle(
            dispatch,
            'maintaining/operation_service_m_curing_plan_ExpensesPageList_post',
            payload,
            res => {
                setFeeTableData(res)
            }
        )
    }
    const { tableProps: feeTableProps, search: feeSearch } = useFormTable(getFeeList, {
        form: spForm, manual: true
    })
    const editFeeAction = (record) => {// 编辑费用
        dispatchHandle(
            dispatch,
            'maintaining/setModelsState',
            {
                planFeeDetail: record
            }
        )
        setFeeVisible(true)
        setFeeType('edit')
    }
    const deleteFeeRequest = (payload = []) => {
        dispatchHandle(
            dispatch,
            'maintaining/operation_service_m_curing_plan_deleteExpenses_patch',
            payload,
            () => {
                feeSearch.refresh()
            }
        )
    }
    // 移除费用
    const deleteFeeAction = (record) => {
        deleteFeeRequest([record.id])
    }
    // 养护费用
    const outSourcingColumns = [
        {
            title: '费用名称',
            dataIndex: 'usageTypeName',
            key: 'name',
        },
        {
            title: '单位',
            dataIndex: 'companyName',
            key: 'unit',
        },
        {
            title: '需求数量',
            dataIndex: 'demandQuantity',
            key: 'demandCount',
            editable: true,
            render: text => text || 0
        },
        {
            title: '单价(元)',
            dataIndex: 'unitPrice',
            key: 'unitPrice',
            editable: true
        },
        {
            title: '小计',
            dataIndex: 'subtotal',
            key: 'subtotal',
            render: (text, record) => <a>{record.demandQuantity * record.unitPrice || 0}</a>
        },
        // {
        //     title: '使用人',
        //     dataIndex: 'userName',
        // },
        {
            title: '费用说明',
            dataIndex: 'costDescription',
            key: 'costDescription',
        },
        {
            title: '操作',
            key: 'action',
            dataIndex: 'action',
            align: "center",
            fixed: 'right',
            render: (text, record) => <div>
                <a onClick={() => editFeeAction(record)}>编辑</a>
                <Divider type="vertical" />
                <Popconfirm title='确认删除此费用?' onConfirm={() => deleteFeeAction(record)}>
                    <a>移除</a>
                </Popconfirm>
            </div>

        },

    ];
    // 费用对话框事件方法
    const feeShowModal = () => {// 新增
        setFeeVisible(true)
        setFeeType('add')
    };
    // table行所选项发生变化
    const feeRowSelection = {
        selectedRowKeys: selectFeeKeys,
        onChange: (selectedRowKeys, selectedRows) => {
            setSelectFeeKeys(selectedRowKeys)
        }
    };
    // 删除多个费用
    const deleteManyFeeAction = () => {
        if (selectFeeKeys.length > 0) {
            deleteFeeRequest(selectFeeKeys)
        }
    }

    // 新增计划保存确认
    const spPlanSureAction = (type) => {
        console.log(selectDevice, `selectDevice---------`)
        form.validateFields().then(values => {
            const infoContent = values?.announcementContent?.toHTML()
            const noticeVo = {
                announcementContent: infoContent,
                announcementTypeId: values.announcementTypeId,
                nameOfAnnouncement: values.nameOfAnnouncement,
                notificationRulesIds: values.notificationRulesIds,
                urgency: values?.urgency
            }
            const obj = {
                ...values,
                auditRuleId: ((approvalDetail && approvalDetail.length > 0) && approvalDetail[0].id),
                startTime: ((values.startTime_endTime && values.startTime_endTime.length > 0) && moment(values.startTime_endTime[0]).format('HH:mm:ss')),
                endTime: ((values.startTime_endTime && values.startTime_endTime.length > 0) && moment(values.startTime_endTime[1]).format('HH:mm:ss')),
                specialStartTime: ((values.startTime_endTime && values.startTime_endTime.length > 0) && moment(values.startTime_endTime[0])),
                specialEndTime: ((values.startTime_endTime && values.startTime_endTime.length > 0) && moment(values.startTime_endTime[1])),
                planState: 1,
                cycleType: 0,
                missionValidity: 0
            }
            const deviceVo = selectDevice.map(item => {
                const arr = [];
                const array = item?.standardIds || item?.relationBOS || []
                if (array && array?.length > 0) {
                    array.forEach(i => {
                        const id = i?.curingStandardId || i?.id
                        arr.push(id)
                    })
                }
                item.standardIds = arr
                return {
                    deviceId: item.id,
                    standardIds: item.standardIds
                };
            })
            if (!deviceVo || deviceVo.length === 0) {
                message.warn('请选择养护设备!')
                return;
            }
            const payload = {
                noticeVo,
                ...obj,
                deviceVo,
                planState: type
            }
            delete payload.startTime_endTime;
            delete payload.announcementContent;
            delete payload.announcementTypeId;
            delete payload.nameOfAnnouncement;
            delete payload.notificationRulesIds;
            delete payload.urgency;
            console.log(payload, '=========')
            if (query.planId) {
                payload.id = query.planId

            }
            dispatchHandle(
                dispatch,
                'maintaining/operation_service_m_curing_plan_planAddEdit_patch',
                payload,
                () => {
                    closeCurrentPage('/ops/mainmanage/mainplan')
                }
            )
        })
            .catch(() => { })
    };
    // 专项计划保存确认弹出框
    const spPlanSureShowModal = (type) => {
        if (defaultValue) {
            spPlanSureAction(type)
        } else {
            setSpecialPlanSureVisible(true)
        }
    };

    useEffect(() => {
        if (!query.planId) {
            dispatchHandle(
                dispatch,
                'maintaining/operation_service_m_curing_plan_getPlanNumber_get',
                {},
                res => {
                    if (res) {
                        form.setFieldsValue({
                            planNumber: res
                        })
                        setPlanNumber(res)
                        search.submit({ planNumber: res })
                        feeSearch.submit({ planNumber: res })
                    }
                }
            )
        }
        dispatchHandle(
            dispatch,
            'maintaining/device_service_device_post_noPage',
            {}
        )
        dispatchHandle(
            dispatch,
            'maintaining/common_service_m_maintenance_manufacturer_pageList_post',
            {}
        )
        if (query.planId) {
            dispatchHandle(
                dispatch,
                'maintaining/operation_service_m_curing_plan_detail_id_get',
                { id: query.planId },
                res => {
                    if (res) {
                        setPlanNumber(res?.planNumber)
                        search.submit({ planNumber: res?.planNumber })
                        feeSearch.submit({ planNumber: res?.planNumber })
                        form.setFieldsValue({
                            ...res,
                            appointedUnit: res.principalId,
                            startTime_endTime: [moment(res?.specialStartTime), moment(res?.specialEndTime)],
                        })
                        setDefaultValue(res.outsourcingOrNot)
                        if (res.notice) {
                            if (res.notice.announcementContent) {
                                res.notice.announcementContent = BraftEditor.createEditorState(res.notice.announcementContent || '')
                            }
                            if (res?.notice?.notificationRulesId) {
                                res.notice.notificationRulesIds = res.notice.notificationRulesId
                            }
                            const obj = {...res.notice}
                            form.setFieldsValue({...obj})
                        }
                        if (res.deviceBOS && res.deviceBOS.length > 0) {
                            const array = res?.deviceBOS?.map(item => ({
                                ...item,
                                ...item?.deBo
                            }))
                            setSelectDevice(array)
                        }
                        // form.setFieldsValue({...res})
                        if (res.outsourcingOrNot) {
                            setActiveKey('1')
                        } else {
                            setActiveKey('2')
                        }
                    }
                }
            )
        }
        form.setFieldsValue({
            outsourcingOrNot: false
        })
    }, [])

    // 设备系统
    const systemData = deviceSystemList?.length > 0 ? deviceSystemList.map((item, index) => {
        item.id = `${index}-0`;
        item.selectable = false;
        const itemJson = JSON.stringify(item);
        const jsonData = itemJson
            .replace(/\bname\b/g, "title")
            .replace(/\bid\b/g, "value")
            .replace(/\bsystemNodeList\b/g, "children")
            .replace(/\bsubList\b/g, "children");
        return JSON.parse(jsonData)
    }) : []
    const disabledDate = (current) => {
        return current && current <= moment().startOf('day');
    }
    const maintainTypeList = dicFindUtils(dicTotalsList, DictBizType.maintainType); // 养护类型
    const schedulingType = dicFindUtils(dicTotalsList, DictBizType.postType); // 排班类型
    return <div>
        <Form form={form}>
            <Card className={style.basic_info}>
                <div className={classnames(style.add_plan, style.add_special_plan)}>
                    <h3 className={style.h3_title}>基本信息</h3>
                    <Row>
                        <Col span={6} className={style.odd_row}>
                            <Tooltip title='计划编号'>
                                <span className={classnames(style.title, style.title_required)}>计划编号</span>
                            </Tooltip>
                            <Form.Item name="planNumber" rules={[{ required: true }]}>
                                <Input placeholder="自动生成" readOnly />
                            </Form.Item>
                            {/* <span className={style.required}>*</span> */}
                        </Col>
                        <Col span={6} className={style.odd_row}>
                            <Tooltip title='计划名称'>
                                <span className={classnames(style.title, style.title_required)}>计划名称</span>
                            </Tooltip>
                            <Form.Item name="planName" rules={[{ required: true }]}>
                                <Input placeholder="请输入" allowClear />
                            </Form.Item>
                            {/* <span className={style.required}>*</span> */}
                        </Col>
                        <Col span={6} className={style.odd_row}>
                            <Tooltip title='养护类型'>
                                <span className={classnames(style.title, style.title_required)}>养护类型</span>
                            </Tooltip>
                            <Form.Item name="planType" rules={[{ required: true }]}>
                                <Select placeholder="请选择" allowClear>
                                    {
                                        maintainTypeList.length !== 0 && maintainTypeList.map(i => <Option key={i.id} value={i.id}>{i.dicValue}</Option>)
                                    }
                                </Select>
                            </Form.Item>
                        </Col>
                        <Col span={6} className={style.odd_row}>
                            <Tooltip title="起止执行时间">
                                <span className={classnames(style.title, style.title_required)}>起止执行时间</span>
                            </Tooltip>
                            <Form.Item name="startTime_endTime" rules={[{ required: true }]}>
                                <CustormRangePicker
                                    allowClear
                                    showTime
                                    disabledDate={disabledDate}
                                />
                            </Form.Item>
                        </Col>
                        <Col span={6} className={style.even_row}>
                            <Tooltip title='提前提醒时间'>
                                <span className={style.title}>提前提醒时间</span>
                            </Tooltip>
                            <div style={{ display: 'flex', flex: 1 }}>
                                <Form.Item name="advanceRemind" style={{ flex: 1 }}>
                                    <InputNumber style={{ width: '100%' }} min={1} allowClear placeholder="请输入" />
                                </Form.Item>
                                <span className={style.required} style={{ color: '#000', width: '7%', textAlign: 'center', fontSize: '0.63vw' }}></span>
                            </div>
                        </Col>
                        <Col span={6} className={style.even_row}>
                            <Tooltip title="任务执行部门">
                                <span className={classnames(style.title, style.title_required)}>任务执行部门</span>
                            </Tooltip>
                            <Form.Item name="executiveDepartment" rules={[{ required: true }]}>
                                <TreeSelector isDepart={true}/>
                            </Form.Item>
                            {/* <span className={style.required} style={{ color: 'red' }}>*</span> */}
                        </Col>
                        <Col span={6} className={style.even_row}>
                            <Tooltip title="任务执行岗位">
                                <span className={classnames(style.title, style.title_required)}>任务执行岗位</span>
                            </Tooltip>
                            <Form.Item name="executivePost" rules={[{ required: true }]}>
                                <Select allowClear placeholder="请选择">
                                    {
                                        schedulingType && schedulingType.length !== 0 && schedulingType.map(i => <Option key={i.id} value={i.id}>{i.dicValue}</Option>)
                                    }
                                </Select>
                            </Form.Item>
                            {/* <span className={style.required} style={{ color: 'red' }}>*</span> */}
                        </Col>
                        <Col span={6} className={style.even_row}>
                            <Tooltip title='负责人'>
                                <span className={classnames(style.title, style.title_required)}>负责人</span>
                            </Tooltip>
                            <Form.Item name="principalId" rules={[{ required: true }]}>
                                <TreeSelector />
                            </Form.Item>
                            {/* <span className={style.required} style={{ color: 'red' }}>*</span> */}
                        </Col>
                        <Col span={6} className={style.odd_row}>
                            <Tooltip title='是否委外养护'>
                                <span className={style.title}>是否委外养护</span>
                            </Tooltip>
                            <Form.Item name="outsourcingOrNot">
                                <Select onChange={getValue} allowClear placeholder="请选择">
                                    <Option value></Option>
                                    <Option value={false}></Option>
                                </Select>
                            </Form.Item>
                        </Col>
                        {
                            defaultValue ? <Col span={6} className={style.odd_row}>
                                <Tooltip title='委派单位'>
                                    <span className={classnames(style.title, style.title_required)}>委派单位</span>
                                </Tooltip>
                                <Form.Item name="appointedUnit" rules={[{ required: true }]}>
                                    <Select
                                        placeholder="请选择"
                                        allowClear
                                        showSearch
                                        optionFilterProp="children"
                                    >
                                        {firmList?.length > 0 && firmList?.map(item => <Option value={item?.id}>{item?.name}</Option>)}
                                    </Select>
                                </Form.Item>
                            </Col> : null
                        }
                        {
                            defaultValue ? <Col span={6} className={style.odd_row}>
                                <Tooltip title='预计费用'>
                                    <span className={style.title}>预计费用</span>
                                </Tooltip>
                                <Form.Item name="estimatedCost">
                                    <Input placeholder="请输入" allowClear />
                                </Form.Item>
                                <span className={style.required} style={{ color: '#000' }}></span>
                            </Col> : null
                        }
                        <Col span={6} className={style.odd_row}>
                            <Tooltip title='验收人'>
                                <span className={classnames(style.title, style.title_required)}>验收人</span>
                            </Tooltip>
                            <Form.Item name="acceptancePerson" rules={[{ required: true }]}>
                                {/* <Input placeholder="请输入" /> */}
                                <TreeSelector />
                            </Form.Item>
                            {/* <span className={style.required} style={{ color: 'red' }}>*</span> */}
                        </Col>
                    </Row>
                    <Row justify="space-between" className={style.add_cycle_plan_desc}>
                        <Col span={defaultValue ? 11 : 24}>
                            <h3 style={{ fontSize: '14px' }}>养护说明:</h3>
                            <Form.Item name='planDescribe' style={{ paddingLeft: 0, width: '100%' }}>
                                <TextArea rows={5} placeholder="请输入" />
                            </Form.Item>
                        </Col>
                        {
                            defaultValue ? <Col span={11}>
                                <h3 style={{ fontSize: '14px' }}>委外说明:</h3>
                                <Form.Item name='delegationInstructions' style={{ paddingLeft: 0, width: '100%' }}>
                                    <TextArea rows={5} placeholder="请输入" />
                                </Form.Item>
                            </Col> : null
                        }
                    </Row>
                </div>
            </Card>
            <Card className={style.approval_process}>
                <h3 className={style.h3_title}>审批流程</h3>
                <ShowApproval businessType='curing' />
            </Card>
            <MainDeviceCard
                setSelectDevice={setSelectDevice}
                selectDevice={selectDevice}
                id={planNumber}
            />
            <Card className={style.demand_influence}>
                <div className={style.influence_title}>
                    <h3 className={style.h3_title}>需求及影响</h3>
                </div>
                <Divider />
                <Tabs activeKey={activeKey} onChange={(activeKey) => setActiveKey(activeKey)}>
                    {
                        defaultValue && (
                            <TabPane tab='委外费用' key='1' forceRender={true}>
                                <div className={style.fee_buttons}>
                                    <Button type="primary" icon={<PlusOutlined />} onClick={feeShowModal}>添加费用</Button>
                                    <Button type={selectFeeKeys.length === 0 ? 'default' : 'primary'} danger onClick={deleteManyFeeAction}>删除</Button>
                                </div>
                                <div className={style.table}>
                                    <EditableTable
                                        loading={FeeLoading}
                                        optColumns={outSourcingColumns}
                                        tableData={feeTableData}
                                        setTableData={setFeeTableData}
                                        pagination={planOutFeeList.pagination}
                                        tableProps={feeTableProps}
                                        rowSelection={feeRowSelection}
                                        editAction={editFeeAction}
                                    />
                                </div>
                            </TabPane>
                        )
                    }
                    <TabPane tab='备件/耗材' key='2' forceRender={true}>
                        <div className={style.fee_buttons}>
                            <Button type="primary" icon={<PlusOutlined />} onClick={sparePartShowModal}>添加备件</Button>
                            <Button type={spSelectKeys.length === 0 ? 'default' : 'primary'} danger onClick={deleteManySPAction}>删除</Button>
                        </div>
                        <div className={style.table}>
                            <EditableTable
                                loading={spLoading}
                                optColumns={sparePartColumns}
                                tableData={tableData}
                                setTableData={setTableData}
                                pagination={sparePartList.pagination}
                                tableProps={tableProps}
                                rowSelection={spRowSelection}
                                editAction={editSPAction}
                            />
                        </div>
                    </TabPane>
                    <TabPane tab="影响公告" key="3" forceRender={true}>
                        <InfluenceAdv form={form} setRule={setRelativeAdvRule} />
                    </TabPane>
                </Tabs>
                <div style={{ position: 'fixed', right: 20, bottom: 20, display: 'flex', justifyContent: 'flex-end', zIndex: 10 }}>
                    <ul style={{ display: 'flex' }}>
                        <li>
                            <Button onClick={() => history.goBack()}>取消</Button>
                        </li>
                        <li style={{ margin: '0 16px 0' }}>
                            <Button type="primary" onClick={() => spPlanSureShowModal(0)}>暂存</Button>
                        </li>
                        <li>
                            <Button type="primary" onClick={() => spPlanSureShowModal(1)}>提交</Button>
                        </li>
                    </ul>
                </div>
            </Card>
        </Form>
        <AddSparePartModal
            visible={sparePartvisible}
            setVisible={setSparePartVisible}
            systemData={systemData}
            id={planNumber}
            searches={search}
        />
        <AddFeeModal
            visible={feevisible}
            setVisible={setFeeVisible}
            type={feeType}
            planNumber={planNumber}
            search={feeSearch}
        />
        <SubmitRemindModal
            visible={specialPlanSureVisible}
            setVisible={setSpecialPlanSureVisible}
            handleOk={spPlanSureAction}
            systemData={systemData}
            planNumber={planNumber}
        />
    </div>
}

export default connect(({ maintaining, dict, universal, loading }) => ({
    universal,
    dict,
    maintaining,
    spLoading: loading.effects['maintaining/operation_service_m_curing_plan_materiePageList_post'],
    FeeLoading: loading.effects['maintaining/operation_service_m_curing_plan_ExpensesPageList_post'],
    standardLoading: loading.effects['maintaining/operation_service_m_curing_plan_standardPageList_post']
}))(AddSpecialPlan)