import LeftSelectTree from "@/components/leftSelectTree/leftSelectTree";
import { ActionType, FormInstance, ProForm, ProFormDatePicker, ProFormDigit, ProFormSelect, ProFormText, ProTable } from "@ant-design/pro-components";
import { Button, Col, Divider, message, Modal, Row, Tooltip } from "antd";
import { useEffect, useRef, useState } from "react";
import { connect } from "umi";
import './style.less'
import { handleGetServerpartTree, handleGetSERVERPARTTYPEList, handlGetDeleteRENTCALCULATION, handlGetRENTCALCULATIONList, handlGetSPCONTRIBUTIONList, handlSynchroRENTCALCULATION } from "../operationReport/service";
import { handleGetServerpartInfo } from "../serverpartAssets/service";
import { encryptAES } from "@/utils/handleAes";
import moment from "moment";
import { handleGetPassportInfoById } from "../DigitalElectronics/service";
import operation from '../../assets/operation.png'

const RentCalculation: React.FC<{ currentUser: any }> = (props) => {
    const actionRef = useRef<ActionType>();
    const formRef = useRef<FormInstance>();
    const selectFormRef = useRef<FormInstance>();
    const modalRef = useRef<FormInstance>();
    // 树相关的属性和方法
    const [selectedId, setSelectedId] = useState<string>()
    const [collapsible, setCollapsible] = useState<boolean>(false)
    // 选择运营模式的悬浮框
    const [showSelectOperatingModel, setShowSelectOperatingModel] = useState<boolean>(false);
    // 当前选择的运营模式
    const [selectedOperatingModel, setSelectedOperatingModel] = useState<string | null>(null);
    // 实际计算租金的modal
    const [rentCalculateModal, setRentCalculateModal] = useState<boolean>(false)
    // 当前片区下的服务区列表
    const [serverPartList, setServerPartList] = useState<any>()
    // 当前服务区下的方位
    const [SERVERPARTREGION, setSERVERPARTREGION] = useState<any>()
    // 选择模式里面的 表单数据
    const [selectFormData, setSelectFormData] = useState<any>()
    // 当前选择的行数据
    const [currentRow, setCurrentRow] = useState<any>()
    // 当前的用户信息
    const [userInfoDetail, setUserInfoDetail] = useState<any>()
    const [rentCalculateModalLoading, setRentCalculateModalLoading] = useState<boolean>(false)
    // 租金实际分析的悬浮框
    const [analysisModal, setAnalysisModal] = useState<boolean>(false)
    // 租金分析的对象
    const [currentObj, setCurrentObj] = useState<any>()
    // 模拟数据 计数的
    const [proposalObj, setProposalObj] = useState<any>({
    })

    const operatingModels = [
        '委托运营',
        '加盟项目',
        '保底收益一',
        '保底收益二'
    ];
    const SERVERPART_TYPEObj: any = {
        1000: "立标杆",
        2000: "提能级",
        3000: "稳营收",
        4000: "保功能",
    }

    const top5Data: any = [
        {
            SERVERPART_NAME: "大仓服务区",
            preferredRating: 88,
            tolerance: 12,
            revenueTolerance: 8,
            canReplace: true,
            monthlyAverageRent: 560000,
            monthlyAverageRentIncreaseData: 20000,
            monthlyAverageRentIncreaseRate: 0.05,
            REVENUE_AMOUNT: 800000,
            REVENUE_AMOUNTIncreaseData: 15000,
            REVENUE_AMOUNTIncreaseRate: 0.03,
            SERVERPART_REVENUE: 3800000,
            SERVERPART_REVENUEIncreaseData: 80000,
            SERVERPART_REVENUEIncreaseRate: 0.022,
            MINIMART_REVENUE: 420000,
            MINIMART_REVENUEIncreaseData: 6000,
            MINIMART_REVENUEIncreaseRate: 0.015,
            SERVERPART_AVGFLOW: 13500,
            AVGFLOWDiffIncreaseData: 500,
            AVGFLOWDiffIncreaseRate: 0.037,
            PROFIT_AMOUNT: 300000,
            PROFIT_AMOUNTIncreaseData: 12000,
            PROFIT_AMOUNTIncreaseRate: 0.04,
        },
        {
            SERVERPART_NAME: "地索坪服务区",
            preferredRating: 92,
            tolerance: 6,
            revenueTolerance: 11,
            canReplace: false,
            monthlyAverageRent: 460000,
            monthlyAverageRentIncreaseData: -15000,
            monthlyAverageRentIncreaseRate: -0.03,
            REVENUE_AMOUNT: 720000,
            REVENUE_AMOUNTIncreaseData: -8000,
            REVENUE_AMOUNTIncreaseRate: -0.011,
            SERVERPART_REVENUE: 3100000,
            SERVERPART_REVENUEIncreaseData: -60000,
            SERVERPART_REVENUEIncreaseRate: -0.019,
            MINIMART_REVENUE: 380000,
            MINIMART_REVENUEIncreaseData: -4000,
            MINIMART_REVENUEIncreaseRate: -0.01,
            SERVERPART_AVGFLOW: 9800,
            AVGFLOWDiffIncreaseData: -1200,
            AVGFLOWDiffIncreaseRate: -0.109,
            PROFIT_AMOUNT: 250000,
            PROFIT_AMOUNTIncreaseData: -9000,
            PROFIT_AMOUNTIncreaseRate: -0.035,
        },

        {
            SERVERPART_NAME: "楚雄服务区",
            preferredRating: 81,
            tolerance: 9,
            revenueTolerance: 7,
            canReplace: true,
            monthlyAverageRent: 380000,
            monthlyAverageRentIncreaseData: 10000,
            monthlyAverageRentIncreaseRate: 0.028,
            REVENUE_AMOUNT: 600000,
            REVENUE_AMOUNTIncreaseData: 5000,
            REVENUE_AMOUNTIncreaseRate: 0.008,
            SERVERPART_REVENUE: 2500000,
            SERVERPART_REVENUEIncreaseData: 45000,
            SERVERPART_REVENUEIncreaseRate: 0.018,
            MINIMART_REVENUE: 300000,
            MINIMART_REVENUEIncreaseData: 2000,
            MINIMART_REVENUEIncreaseRate: 0.006,
            SERVERPART_AVGFLOW: 11200,
            AVGFLOWDiffIncreaseData: 200,
            AVGFLOWDiffIncreaseRate: 0.018,
            PROFIT_AMOUNT: 200000,
            PROFIT_AMOUNTIncreaseData: 6000,
            PROFIT_AMOUNTIncreaseRate: 0.03,
        },

        {
            SERVERPART_NAME: "恐龙山服务区",
            preferredRating: 76,
            tolerance: 14,
            revenueTolerance: 5,
            canReplace: false,
            monthlyAverageRent: 320000,
            monthlyAverageRentIncreaseData: -8000,
            monthlyAverageRentIncreaseRate: -0.025,
            REVENUE_AMOUNT: 450000,
            REVENUE_AMOUNTIncreaseData: -12000,
            REVENUE_AMOUNTIncreaseRate: -0.026,
            SERVERPART_REVENUE: 2100000,
            SERVERPART_REVENUEIncreaseData: -30000,
            SERVERPART_REVENUEIncreaseRate: -0.014,
            MINIMART_REVENUE: 250000,
            MINIMART_REVENUEIncreaseData: -3000,
            MINIMART_REVENUEIncreaseRate: -0.012,
            SERVERPART_AVGFLOW: 7300,
            AVGFLOWDiffIncreaseData: -900,
            AVGFLOWDiffIncreaseRate: -0.11,
            PROFIT_AMOUNT: 160000,
            PROFIT_AMOUNTIncreaseData: -5000,
            PROFIT_AMOUNTIncreaseRate: -0.03,
        },
        {
            SERVERPART_NAME: "保山服务区",
            preferredRating: 95,
            tolerance: 4,
            revenueTolerance: 3,
            canReplace: true,
            monthlyAverageRent: 680000,
            monthlyAverageRentIncreaseData: 26000,
            monthlyAverageRentIncreaseRate: 0.041,
            REVENUE_AMOUNT: 960000,
            REVENUE_AMOUNTIncreaseData: 30000,
            REVENUE_AMOUNTIncreaseRate: 0.032,
            SERVERPART_REVENUE: 4200000,
            SERVERPART_REVENUEIncreaseData: 130000,
            SERVERPART_REVENUEIncreaseRate: 0.032,
            MINIMART_REVENUE: 520000,
            MINIMART_REVENUEIncreaseData: 9000,
            MINIMART_REVENUEIncreaseRate: 0.017,
            SERVERPART_AVGFLOW: 15800,
            AVGFLOWDiffIncreaseData: 850,
            AVGFLOWDiffIncreaseRate: 0.056,
            PROFIT_AMOUNT: 350000,
            PROFIT_AMOUNTIncreaseData: 20000,
            PROFIT_AMOUNTIncreaseRate: 0.061,
        }
    ]


    const columns: any = [
        {
            title: "片区",
            dataIndex: "SPREGIONTYPE_NAME",
            hideInSearch: true,
            align: 'center',
            width: 180,
            ellipsis: true,
        },
        {
            title: "服务区",
            dataIndex: "SERVERPART_NAME",
            hideInSearch: true,
            align: 'center',
            width: 180,
            ellipsis: true,
            // render: (_, record) => {
            //     return <a onClick={() => {
            //         setCurrentObj({
            //             ...record,
            //             profitavg: 30,
            //             sumTotal: 12,
            //             min: 5,
            //             max: 13,
            //             MINTURNOVERMin: 600,
            //             MINTURNOVERMax: 600,
            //             avg: 8.6,
            //             MINTURNOVERAvg: 30,
            //             MINTURNOVER: 30,
            //             GUARANTEERATIO: 26,
            //             oldRate: 5,
            //             reduce: 13,
            //             nowRate: 9,
            //             BUSINESS_TYPEMINTURNOVER: 30,
            //             nowGUARANTEERATIO: 5,
            //             differenceGUARANTEERATIO: 4,
            //             addMINTURNOVER: 5,
            //             addMINTURNOVERRate: 5,
            //             currentThanRecently: true,
            //             recentREVENUE_AMOUNT: 1660000,
            //             nowProfit: 15,
            //             monthlyAverageRent: 150000, // 15 万元/月（≈180 万/年，符合高收益委托运营特征）
            //             REVENUE_AMOUNT: 138000, // ≈13.8 万元/月
            //             SERVERPART_REVENUE: 1800000, // 180 万元/月
            //             MINIMART_REVENUE: 260000, // 26 万元/月
            //             SERVERPART_AVGFLOW: 10500, // 1.05 万辆/日
            //             PROFIT_AMOUNT: 100000, // 10 万元/月
            //             preferredRating: 60
            //         })
            //         setAnalysisModal(true)
            //     }}>
            //         {record?.SERVERPART_NAME || ""}
            //     </a>
            // }
        },
        {
            title: "所属高速",
            dataIndex: "EXPRESSWAY_NAME",
            hideInSearch: true,
            align: 'center',
            width: 150,
            ellipsis: true,
        },
        {
            title: "产权所属",
            dataIndex: "OWNER_COMPANY",
            hideInSearch: true,
            align: 'center',
            width: 150,
            ellipsis: true,
        },
        {
            title: "运营模式",
            dataIndex: "OPERATING_MODE",
            hideInSearch: true,
            align: 'center',
            width: 120,
            ellipsis: true,
        },
        {
            title: "站点类型",
            dataIndex: "STATION_TYPE",
            hideInSearch: true,
            align: 'center',
            width: 120,
            ellipsis: true,
            valueType: 'select',
            fieldProps: {
                options: [
                    { label: "服务区", value: "1000" },
                    { label: "停车区", value: "2000" },
                    { label: "加油站", value: "3000" },
                    { label: "加水站", value: "4000" },
                    { label: "观景台", value: "5000" },
                    { label: "休息区", value: "6000" },
                ]
            }
        },
        {
            title: "分类定级",
            dataIndex: "SERVERPART_TYPE",
            hideInSearch: true,
            align: 'center',
            width: 120,
            ellipsis: true,
            valueType: 'select',
            fieldProps: {
                options: [
                    { label: "立标杆", value: 1000 },
                    { label: "提能级", value: 2000 },
                    { label: "稳营收", value: 3000 },
                    { label: "保功能", value: 4000 },
                ]
            }
        },
        {
            title: <div style={{ textAlign: 'center' }}>断面车流统计(辆/日)</div>,
            dataIndex: "SECTIONFLOW_NUM",
            hideInSearch: true,
            align: 'right',
            width: 180,
            ellipsis: true,
        },
        {
            title: "业态",
            dataIndex: "BUSINESS_TYPE",
            hideInSearch: true,
            align: 'center',
            width: 120,
            ellipsis: true,
        },
        {
            title: "招商模式",
            dataIndex: "LEASING_MODE",
            hideInSearch: true,
            align: 'center',
            width: 120,
            ellipsis: true,
        },
        {
            title: <div style={{ textAlign: 'center' }}>首次保底营业额(元)</div>,
            dataIndex: "FIRST_GUARANTEE_TURNOVER",
            hideInSearch: true,
            align: 'right',
            width: 150,
            ellipsis: true,
        },
        {
            title: <div style={{ textAlign: 'center' }}>首次采购人收益提点比例(%)</div>,
            dataIndex: "FIRST_PURCHASER_RATE",
            hideInSearch: true,
            align: 'right',
            width: 200,
            ellipsis: true,
        },
        {
            title: <div style={{ textAlign: 'center' }}>二次保底营业额(元)</div>,
            dataIndex: "SECOND_GUARANTEE_TURNOVER",
            hideInSearch: true,
            align: 'right',
            width: 150,
            ellipsis: true,
        },
        {
            title: <div style={{ textAlign: 'center' }}>二次采购人收益提点比例(%)</div>,
            dataIndex: "SECOND_PURCHASER_RATE",
            hideInSearch: true,
            align: 'right',
            width: 200,
            ellipsis: true,
        },
        {
            title: <div style={{ textAlign: 'center' }}>三次保底营业额(元)</div>,
            dataIndex: "THIRD_GUARANTEE_TURNOVER",
            hideInSearch: true,
            align: 'right',
            width: 150,
            ellipsis: true,
        },
        {
            title: <div style={{ textAlign: 'center' }}>三次采购人收益提点比例(%)</div>,
            dataIndex: "THIRD_PURCHASER_RATE",
            hideInSearch: true,
            align: 'right',
            width: 200,
            ellipsis: true,
        },

        {
            title: '操作',
            dataIndex: 'action',
            width: 150,
            fixed: 'left',
            align: 'center',
            hideInSearch: true,
            render: (_: any, record: any) => (
                <>
                    <a style={{ marginRight: '8px' }} onClick={() => {
                        setCurrentRow(record)
                        setRentCalculateModal(true)
                    }}>详情</a>
                    <a onClick={async () => {
                        await handleDeleteRecord(record?.RENTCALCULATION_ID)
                    }
                    }>删除</a>
                </>
            )
        }
    ]
    // 根据区域获取到服务区列表
    const handleGetServerPartList = async (id: string) => {
        const req: any = {
            ProvinceCode: "530000",
            SPRegionType_ID: id
        }
        const data = await handleGetServerpartTree(req)
        if (data && data.length > 0) {
            let list = data[0].children
            setServerPartList(list)
        } else {
            setServerPartList([])
        }
    }
    // 获取到服务区方位的方法
    const handleGetSERVERPARTREGION = async (id: string) => {
        setSERVERPARTREGION([])
        const req: any = {
            SERVERPARTId: id
        }
        const data = await handleGetServerpartInfo(req)
        let list: any = []
        if (data.RegionInfo && data.RegionInfo.length > 0) {
            data.RegionInfo.forEach((item: any) => {
                list.push({ label: item.SERVERPART_REGIONNAME, value: item.SERVERPART_REGION })
            })
        }
        setSERVERPARTREGION(list)


        const newReq: any = {
            SearchParameter: {
                SERVERPART_IDS: id
            },
            PageIndex: 1,
            PageSize: 999999,
        }

        let newreq: any = {
            name: "",
            value: encryptAES(JSON.stringify(newReq))
        }
        const newData = await handlGetSPCONTRIBUTIONList(newreq)
        if (newData && newData.length > 0) {
            let res: any = newData[0].SERVERPART_TYPE
            if (selectFormRef) {
                selectFormRef.current?.setFieldsValue({ SERVERPART_TYPE: res })
            }
        }

    }
    // 同步和新增方法
    const handleAddUpdate = async (formData: any) => {
        let req: any = {}
        if (currentRow?.RENTCALCULATION_ID) {
            req = {
                ...currentRow,
                ...formData,
                CONTRACT_END_DATE: formData?.CONTRACT_END_DATE ? moment(formData?.CONTRACT_END_DATE).format('YYYY-MM-DD') : "",
                COOPERATION_TERM: formData?.COOPERATION_TERM ? moment(formData?.COOPERATION_TERM).format('YYYY-MM-DD') : "",
                FIRSTSTART_DATE: formData?.FIRSTSTART_DATE ? moment(formData?.FIRSTSTART_DATE).format('YYYY-MM-DD') : "",
                SERVERPART_TYPE: selectFormData?.SERVERPART_TYPE ? Number(selectFormData?.SERVERPART_TYPE) : "",
                STAFF_ID: userInfoDetail.ID,
                STAFF_NAME: userInfoDetail.Name,
                RENTCALCULATION_STATE: 1,
                OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
            }
        } else {
            req = {
                ...formData,
                CONTRACT_END_DATE: formData?.CONTRACT_END_DATE ? moment(formData?.CONTRACT_END_DATE).format('YYYY-MM-DD') : "",
                COOPERATION_TERM: formData?.COOPERATION_TERM ? moment(formData?.COOPERATION_TERM).format('YYYY-MM-DD') : "",
                FIRSTSTART_DATE: formData?.FIRSTSTART_DATE ? moment(formData?.FIRSTSTART_DATE).format('YYYY-MM-DD') : "",
                SERVERPART_TYPE: selectFormData?.SERVERPART_TYPE ? Number(selectFormData?.SERVERPART_TYPE) : "",
                STAFF_ID: userInfoDetail.ID,
                STAFF_NAME: userInfoDetail.Name,
                RENTCALCULATION_STATE: 1,
                OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
            }
        }

        let newReq: any = {
            name: "",
            value: encryptAES(JSON.stringify(req))
        }

        const data = await handlSynchroRENTCALCULATION(newReq)
        setRentCalculateModalLoading(false)
        if (data.Result_Code === 100) {
            message.success('同步成功')
            setShowSelectOperatingModel(false)
            setRentCalculateModal(false)
            setSelectedOperatingModel(null)
            actionRef.current?.reload()
        } else {
            message.error('同步失败')
        }
    }
    // 加盟项目  第二次底价 和 第三次底价的处理方法
    const handleCalcSecondThirdLowPrice = (rent: number, cost: number, increase: number, first90: number) => {
        // rent  原合同年末租金   cost  集团成本合计   increase 保底收益递增   first90  首次招商底价 * 90%
        // 解析数字，容错去逗号/货币符号
        function toNum(v) {
            if (v === null || v === undefined || v === '') return NaN;
            if (typeof v === 'number') return Number.isFinite(v) ? v : NaN;
            const s = String(v).trim().replace(/[,￥\s]/g, '');
            return s === '' ? NaN : Number(s);
        }

        const a = toNum(rent);
        const b = toNum(cost);
        const c = toNum(increase);
        const d = toNum(first90);

        const candidates = [a, b, c, d].filter(x => !Number.isNaN(x));
        if (candidates.length === 0) {
            return { firstOffer: null, secondResult: null, thirdResult: null, candidatesSorted: [] };
        }

        // 去重并从大到小排序（保留重复也可，若需要保留请去掉 Set）
        const unique = Array.from(new Set(candidates)).sort((x, y) => y - x);

        // 通过 first90 反推 firstOffer（如果 first90 不合法则 firstOffer = null）
        const firstOffer = Number.isNaN(d) ? null : (d / 0.9);

        // helper: 从候选中找出 < bound 的最大值（或 null）
        function maxUnder(bound) {
            if (bound == null || Number.isNaN(bound)) return null;
            const list = unique.filter(v => v < bound);
            return list.length ? list[0] /* 因为已降序，第一项即最大 */ : null;
        }

        const secondResult = maxUnder(firstOffer);
        const thirdResult = secondResult == null ? null : maxUnder(secondResult);

        return { firstOffer, secondResult, thirdResult, candidatesSorted: unique };
    }
    // 删除
    const handleDeleteRecord = async (id: any) => {
        const req: any = {
            RENTCALCULATIONId: id
        }
        let newReq: any = {
            name: "",
            value: encryptAES(JSON.stringify(req))
        }

        const data = await handlGetDeleteRENTCALCULATION(newReq)
        if (data.Result_Code === 100) {
            message.success('删除成功！')
            actionRef.current?.reload()
        } else {
            message.error('删除失败！')
        }
    }

    const truncateDecimal = (num: number) => {
        if (!num && num !== 0) {
            return 0
        }
        // 先用 toFixed 保留两位小数以消除精度问题
        const fixedNum = parseFloat(num.toFixed(10));
        // 将数字转换为字符串
        let strNum = fixedNum.toString();

        // 找到小数点的位置
        const dotIndex = strNum.indexOf('.');

        // 如果有小数点且小数点后有至少两位，则截取
        if (dotIndex !== -1) {
            strNum = strNum.substring(0, dotIndex + 3);
        }

        // 转换回数字类型
        return parseFloat(strNum);
    }

    return (
        <div style={{ height: 'calc(100vh - 100px)', backgroundColor: '#fff', display: 'flex' }}>
            <LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
            <div style={{
                width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
                paddingTop: 0,
                paddingBottom: 0,
                paddingRight: 0
            }}>

                <ProTable
                    actionRef={actionRef}
                    formRef={formRef}
                    columns={columns}
                    bordered
                    scroll={{ x: '100%', y: 'calc(100vh - 450px)' }}
                    headerTitle={'租金测算列表'}
                    search={{ span: 6, }}
                    request={async (params) => {
                        // 地址栏传参    UserIdEncrypted 为当前登录用户的加密id
                        const search = window.location.search;
                        const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
                        const reqtoken: any = {
                            UserIdEncrypted: addressParams.UserIdEncrypted
                        }
                        const userInfo = await handleGetPassportInfoById(reqtoken)
                        setUserInfoDetail(userInfo)
                        if (!selectedId) {
                            return { data: [], success: true }
                        }

                        const req: any = {
                            searchParameter: {
                                SERVERPART_IDS: selectedId,
                                RENTCALCULATION_STATE: 1
                            },
                            PageIndex: 1,
                            PageSize: 999999,
                            SortStr: "OPERATE_DATE desc"
                        }
                        let newReq: any = {
                            name: "",
                            value: encryptAES(JSON.stringify(req))
                        }
                        const data = await handlGetRENTCALCULATIONList(newReq)
                        if (data && data.length > 0) {
                            return { data, success: true }
                        }
                        return { data: [], success: true }
                    }}
                    toolbar={{
                        actions: [
                            <Button type={'primary'} onClick={() => {
                                setShowSelectOperatingModel(true)
                                setSelectedOperatingModel(null); // Reset selection when opening modal
                            }}>添加租金测算</Button>
                        ]
                    }}
                />
            </div>

            {/* 实际分析租金的悬浮框 */}
            <Modal
                title={'租金分析'}
                destroyOnClose
                width={1200}
                open={analysisModal}
                className="analysisModalBox"
                onCancel={() => {
                    setAnalysisModal(false)
                    setCurrentObj(undefined)

                }}
                footer={false}
            >
                <div className="analysisModalContentBox">
                    <div className={'serverPart'}>
                        <div className={'serverPartDetail'}>
                            <div className={'serverPartDetailTop'}>
                                <span className={'serverPartName'}>{currentObj?.SERVERPART_NAME}</span>
                                <div className={'serverPartType'}>{SERVERPART_TYPEObj[currentObj?.SERVERPART_TYPE]}</div>
                            </div>
                            <div className="bigTitlte">{`${currentObj?.SERVERPART_NAME || ''}${currentObj?.EXPRESSWAY_NAME || ''}${currentObj?.OPERATING_MODE ? currentObj?.OPERATING_MODE + '项目' : ''}`}</div>
                        </div>
                    </div>

                    <div className={'operateLeft'}>
                        <img className={'operateIcon'} src={operation} />
                        <span className={'titleName'}>招商分析</span>
                    </div>
                    <div style={{ fontWeight: 600, color: '#FE7628' }}>通过查询云南彩云驿所有经营项目数据：</div>

                    <div className="paragraph" style={{ textIndent: '2rem' }}>
                        {/*  */}
                        共找到类似项目（<span className="keynote">{currentObj?.SERVERPART_TYPE ? SERVERPART_TYPEObj[currentObj?.SERVERPART_TYPE] : ''}</span>
                        服务区，
                        <span className="keynote">{currentObj?.OPERATING_MODE || ''}</span>
                        共计
                        <span className="keynote">{currentObj?.sumTotal}</span>
                        {/* <span className="keynote">{allListData && allListData.length > 0 ? allListData.length : 0}</span> */}
                        个）
                        。大模型调用租金收益、门店营收、服务区整体营收、商超表现、车流量适应性等5项核心数据指标，对各候选项目的潜在收益及服务区适应性进行综合衡量，优化即将到期得
                        <span className="keynote">{currentObj?.SERVERPART_NAME}</span>
                        的
                        <span className="keynote">{currentObj?.SHOPSHORTNAME}</span>
                        具体分析如下：
                    </div>

                    <div className="proposal" style={{ marginTop: '12px' }}>
                        <div>根据行业(<span className="keynote">{currentObj?.SERVERPART_TYPE ? SERVERPART_TYPEObj[currentObj?.SERVERPART_TYPE] : ''}</span>)
                            常规提成比例<span className="keynote">11%</span>，在营项目<span className="keynote">20</span>个，商家平均净利润率约为：<span className="keynote">3.6%</span>，</div>
                        <div ><span className="keynote">{currentObj?.SERVERPART_TYPE ? SERVERPART_TYPEObj[currentObj?.SERVERPART_TYPE] : ''}</span>{currentObj?.profitavg < 10 ? '商家经营存在困难，建议降低保底租金以减轻商家负担，提成比例适当降低或维持现状。' :
                            currentObj?.profitavg >= 10 && currentObj?.profitavg <= 20 ? '商家有一定盈利能力，建议维持行业平均提成比例，同时保底租金设置参考营收和行业水平。' :
                                currentObj?.profitavg > 20 ? '商家盈利能力强，可以适当提高提成比例，同时设定更高的保底租金。' :
                                    ''}
                        </div>
                        <div style={{ marginTop: '12px' }}>
                            彩云驿目前在营项目（
                            <span className="keynote">{currentObj?.SERVERPART_TYPE ? SERVERPART_TYPEObj[currentObj?.SERVERPART_TYPE] : ''}</span>
                            共计
                            <span className="keynote">{currentObj?.sumTotal}</span>
                            {/* <span className="keynote">{allListData && allListData.length > 0 ? allListData.length : 0}</span> */}
                            个）的提成比例为：{
                                currentObj?.noRate ? '固定租金' :
                                    <span>{currentObj?.min === currentObj?.max ?
                                        <span>
                                            <span className="keynote">{currentObj?.max}%</span>
                                        </span> :
                                        <span>
                                            <span className="keynote">{currentObj?.min}%</span>—
                                            <span className="keynote">{currentObj?.max}%</span>
                                        </span>}</span>
                            }，保底租金为：{
                                currentObj?.MINTURNOVERMin === currentObj?.MINTURNOVERMax ?
                                    <span className="keynote">{currentObj?.MINTURNOVERMin}</span> :
                                    <span>
                                        <span className="keynote">{currentObj?.MINTURNOVERMin}</span>万元—
                                        <span className="keynote">{currentObj?.MINTURNOVERMax}</span>
                                    </span>
                            }万元，平均提成比例：{currentObj?.noRate ? '固定租金' : <span className="keynote">{currentObj?.avg}%</span>}，平均保底租金为：<span className="keynote">{currentObj?.MINTURNOVERAvg}万元</span>，
                        </div>
                        <div>
                            <span className="keynote">{`${currentObj?.SERVERPART_NAME || ''}${currentObj?.EXPRESSWAY_NAME || ''}${currentObj?.OPERATING_MODE ? currentObj?.OPERATING_MODE + '项目' : ''}`}</span>目前保底租金为<span className="keynote">{currentObj?.MINTURNOVER || ''}</span>万/年，
                            {
                                currentObj?.BUSINESS_TYPE === 2000 ?
                                    '' :
                                    <span>提成比例<span className="keynote">{currentObj?.GUARANTEERATIO || '-'}%，</span></span>
                            }
                            <Tooltip title={currentObj?.indexRevenue || ''}>
                                累计盈利：<span className="keynote">120</span>万元
                            </Tooltip>
                        </div>


                        <div style={{ marginTop: '12px' }}><span className="proposalTitle">租金提成建议</span>：</div>
                        <div style={{ fontWeight: 600 }}>提成比例{
                            currentObj?.avgThanNowRate ?
                                <span>
                                    <Tooltip title={`${currentObj?.oldRate}%${currentObj?.reduce ? `-${currentObj.reduce}%` : ''}`}>
                                        <span className="keynote" style={{ color: 'red' }}>{currentObj?.nowRate || ''}%</span>
                                    </Tooltip>
                                    —
                                    <span className="keynote" style={{ color: 'red' }}>{currentObj?.avg || ''}%</span>
                                    {
                                        currentObj?.BUSINESS_TYPE === 2000 ?
                                            <span>(原合同固定租金：<span className="keynote">{currentObj?.BUSINESS_TYPEMINTURNOVER || ''}</span>万/年)</span> :
                                            <span>(原合同提成比例<span className="keynote">{currentObj?.nowGUARANTEERATIO || ''}%</span>
                                                {
                                                    currentObj?.differenceGUARANTEERATIO ?
                                                        <span>，{currentObj?.differenceGUARANTEERATIO > 0 ? '优于' : currentObj?.differenceGUARANTEERATIO < 0 ? '下浮' : ''}<span className="keynote">{currentObj?.differenceGUARANTEERATIO || ''}%</span></span> : ''
                                                }
                                                )
                                            </span>
                                    }
                                </span> :
                                <span>
                                    <Tooltip title={`${currentObj?.oldRate}%${currentObj?.reduce ? `-${currentObj.reduce}%` : ''}`}>
                                        <span className="keynote" style={{ color: 'red' }}>{currentObj?.nowRate || ''}%</span>
                                    </Tooltip>
                                    {
                                        currentObj?.BUSINESS_TYPE === 2000 ?
                                            <span>(原合同固定租金：<span className="keynote">{currentObj?.BUSINESS_TYPEMINTURNOVER || ''}</span>万/年)</span> :
                                            <span>(原合同提成比例<span className="keynote">{currentObj?.nowGUARANTEERATIO || ''}%</span>
                                                {
                                                    currentObj?.differenceGUARANTEERATIO ?
                                                        <span>，{currentObj?.differenceGUARANTEERATIO > 0 ? '优于' : currentObj?.differenceGUARANTEERATIO < 0 ? '下浮' : ''}
                                                            <span className="keynote">{currentObj?.differenceGUARANTEERATIO || ''}%</span>
                                                        </span> : ''
                                                }
                                                )</span>
                                    }
                                </span>
                        }
                        </div>
                        <div style={{ fontWeight: 600 }}>保底租金
                            {
                                currentObj?.MINTURNOVERAvgThanAvg ?
                                    <span>
                                        {/* title={`${currentObj?.currentThanRecently ? '当前' : '上个'}合同年的对客销售总额${truncateDecimal(currentObj?.recentREVENUE_AMOUNT / 10000)}万元×${currentObj?.nowRate || ''}% = ${currentObj?.nowProfit}万元，保底租金${currentObj?.addMINTURNOVER>0?'优于':currentObj?.addMINTURNOVER<0?'下浮':''}${currentObj?.addMINTURNOVER}万/年。`} */}
                                        <Tooltip title={currentObj?.BUSINESS_TYPE === 2000 ? `` : `比原来${currentObj?.addMINTURNOVER > 0 ? '优于' : currentObj?.addMINTURNOVER < 0 ? '下浮' : ''}${currentObj?.addMINTURNOVER}万元，${currentObj?.addMINTURNOVERRate > 0 ? '提升' : currentObj?.addMINTURNOVERRate < 0 ? '降低' : ''}${Math.abs(currentObj?.addMINTURNOVERRate)}%`}>
                                            <span className="keynote" style={{ color: 'red' }}>{currentObj?.nowProfit}</span>万元
                                        </Tooltip>
                                        —
                                        <span className="keynote" style={{ color: 'red' }}>{currentObj?.MINTURNOVERAvg}万元</span>
                                        ({currentObj?.currentThanRecently ? '当前' : '上个'}合同年的对客销售总额<span className="keynote">{(currentObj?.recentREVENUE_AMOUNT / 10000)}</span>万元×<span className="keynote">{currentObj?.nowRate || ''}%</span> = <span className="keynote">{currentObj?.nowProfit}</span>万元，原合同保底租金<span className="keynote">{currentObj?.BUSINESS_TYPE === 2000 ? currentObj?.BUSINESS_TYPEMINTURNOVER : currentObj?.nowMINTURNOVER}</span>万元，{currentObj?.addMINTURNOVER > 0 ? '优于' : currentObj?.addMINTURNOVER < 0 ? '下浮' : ''}<span className="keynote">{currentObj?.addMINTURNOVER}</span>万/年)
                                    </span>
                                    :
                                    <span>
                                        <Tooltip title={currentObj?.BUSINESS_TYPE === 2000 ? `` : `比原来${currentObj?.addMINTURNOVER > 0 ? '优于' : currentObj?.addMINTURNOVER < 0 ? '下浮' : ''}${currentObj?.addMINTURNOVER}万元，${currentObj?.addMINTURNOVERRate > 0 ? '提升' : currentObj?.addMINTURNOVERRate < 0 ? '降低' : ''}${Math.abs(currentObj?.addMINTURNOVERRate)}%`}>
                                            <span className="keynote" style={{ color: 'red' }}>{currentObj?.nowProfit}</span>万元
                                        </Tooltip>
                                        ({currentObj?.currentThanRecently ? '当前' : '上个'}合同年的对客销售总额<span className="keynote">{(currentObj?.recentREVENUE_AMOUNT / 10000)}</span>万元×<span className="keynote">{currentObj?.nowRate || ''}%</span> = <span className="keynote">{currentObj?.nowProfit}</span>万元，原合同保底租金<span className="keynote">{currentObj?.BUSINESS_TYPE === 2000 ? currentObj?.BUSINESS_TYPEMINTURNOVER : currentObj?.nowMINTURNOVER}</span>万元，{currentObj?.addMINTURNOVER > 0 ? '优于' : currentObj?.addMINTURNOVER < 0 ? '下浮' : ''}<span className="keynote">{currentObj?.addMINTURNOVER}</span>万/年)
                                    </span>

                            }
                        </div>
                    </div>

                    <div className="paragraph">
                        <span style={{ fontWeight: 600 }}>数据来源与核心指标</span>
                        <div>
                            核心数据：
                            <div style={{ textIndent: '2rem' }}>
                                <div style={{ fontWeight: 600 }}>租金月均（万元）：体现甲方的直接租金收益。（权重比例20%）</div>
                                <div style={{ fontWeight: 600 }}>门店月均营收（万元）：衡量门店的市场吸引力和实际营收表现。（权重比例35%）</div>
                                <div style={{ fontWeight: 600 }}>服务区整体营收（万元）：反映服务区的整体商业氛围和消费潜力。（权重比例10%）</div>
                                <div style={{ fontWeight: 600 }}>商超月均收入（万元）：作为基础消费需求的参考，体现服务区内的消费稳定性。（权重比例10%）</div>
                                <div style={{ fontWeight: 600 }}>日均入区车流量（辆）：指示潜在客流量，评估车流对门店经营的带动效果。（权重比例5%）</div>
                                <div style={{ fontWeight: 600 }}>商家盈利稳定性（万元）：综合考虑商家在一年周期内的盈利状况，体现项目的可持续经营能力。（权重比例20%）</div>
                            </div>
                            <div>
                                分析逻辑：通过加权计算得出门店的综合评分，以量化门店在各维度上的综合表现。最终评分结合关键指标差值，确保候选门店在整体及单项核心指标上均具备明显优势，以作为优选或续签判断依据。
                            </div>
                        </div>
                    </div>

                    <div className="paragraph">


                        <div className="beforeBluePoint" style={{ textIndent: '2rem' }}>现有门店：<span className="keynote">{currentObj?.SERVERPART_NAME}</span>(<span className="numberValue" style={{ color: '#FE7628' }}>{currentObj?.preferredRating || ''}</span>分)</div>
                        <div style={{ textIndent: '4rem' }}>
                            现状数据：
                            <div style={{ textIndent: '6rem' }}>
                                <div>租金月均：<span className="numberValue">{truncateDecimal(currentObj?.monthlyAverageRent / 10000)}</span><span className="unit">万元</span></div>
                                <div>门店月均营收：<span className="numberValue">{truncateDecimal(currentObj?.REVENUE_AMOUNT / 10000)}</span><span className="unit">万元</span></div>
                                <div>服务区整体营收：<span className="numberValue">{truncateDecimal(currentObj?.SERVERPART_REVENUE / 10000)}</span><span className="unit">万元</span></div>
                                <div>商超月均：<span className="numberValue">{truncateDecimal(currentObj?.MINIMART_REVENUE / 10000)}</span><span className="unit">万元</span></div>
                                <div>日均入区车流量：<span className="numberValue">{currentObj?.SERVERPART_AVGFLOW}</span><span className="unit">辆</span></div>
                                <div>商家盈利稳定性：<span className="numberValue">{truncateDecimal(currentObj?.PROFIT_AMOUNT / 10000)}</span><span className="unit">万元</span></div>
                            </div>
                        </div>
                        <div className="beforeBluePoint" style={{ textIndent: '2rem' }}>候选替换选项：</div>
                        <div style={{ marginTop: '12px' }}>
                            {
                                top5Data && top5Data?.length > 0 ?
                                    top5Data.map((item: any, index: number) => {
                                        return <div style={{ marginTop: '8px' }}>
                                            <div style={{ textIndent: '4rem' }}><span style={{ fontWeight: 600 }}>{index + 1}、</span> <span className="keynote">{item.SERVERPART_NAME}</span> (<span className="numberValue" style={{ color: '#FE7628' }}>{item.preferredRating || ''}</span>分)</div>
                                            <div style={{ textIndent: '4rem' }}>
                                                容差比对：车流容差率<span className="numberValue">{item.tolerance ? item.tolerance + '%' : ''}</span>，营收容差<span className="numberValue">{item.revenueTolerance ? item.revenueTolerance + '%' : ''}</span>，<span className="compare">{item.canReplace ? '推荐替换' : '不建议替换'}</span>
                                                <div style={{ textIndent: '6rem' }}>租金月均：
                                                    <span className="numberValue">{truncateDecimal(item.monthlyAverageRent / 10000)}</span>
                                                    万元（
                                                    {`${item.monthlyAverageRentIncreaseData < 0 ? '低于' : item.monthlyAverageRentIncreaseData > 0 ? '高于' : ''}`}
                                                    现有<span className="numberValue">{truncateDecimal(Math.abs(item.monthlyAverageRentIncreaseData / 10000))}</span><span className="unit">万元</span>
                                                    ，{item.monthlyAverageRentIncreaseRate > 0 ? '优于' : item.monthlyAverageRentIncreaseRate < 0 ? '下浮' : ''}
                                                    <span className="numberValue">{truncateDecimal(Math.abs(item.monthlyAverageRentIncreaseRate * 100))}%</span>
                                                    ）
                                                </div>
                                                <div style={{ textIndent: '6rem' }}>门店月均营收：
                                                    <span className="numberValue">{truncateDecimal(item.REVENUE_AMOUNT / 10000)}</span>
                                                    万元（
                                                    {`${item.REVENUE_AMOUNTIncreaseData < 0 ? '低于' : item.REVENUE_AMOUNTIncreaseData > 0 ? '高于' : ''}`}
                                                    现有<span className="numberValue">{truncateDecimal(Math.abs(item.REVENUE_AMOUNTIncreaseData / 10000))}</span><span className="unit">万元</span>
                                                    ，{item.REVENUE_AMOUNTIncreaseRate > 0 ? '优于' : item.REVENUE_AMOUNTIncreaseRate < 0 ? '下浮' : ''}
                                                    <span className="numberValue">{truncateDecimal(Math.abs(item.REVENUE_AMOUNTIncreaseRate * 100))}%</span>
                                                    ）
                                                </div>
                                                <div style={{ textIndent: '6rem' }}>服务区整体营收：
                                                    <span className="numberValue">{truncateDecimal(item.SERVERPART_REVENUE / 10000)}</span>
                                                    万元（
                                                    {`${item.SERVERPART_REVENUEIncreaseData < 0 ? '低于' : item.SERVERPART_REVENUEIncreaseData > 0 ? '高于' : ''}`}
                                                    现有<span className="numberValue">{truncateDecimal(Math.abs(item.SERVERPART_REVENUEIncreaseData / 10000))}</span><span className="unit">万元</span>
                                                    ，{item.SERVERPART_REVENUEIncreaseRate > 0 ? '优于' : item.SERVERPART_REVENUEIncreaseRate < 0 ? '下浮' : ''}
                                                    <span className="numberValue">{truncateDecimal(Math.abs(item.SERVERPART_REVENUEIncreaseRate * 100))}%</span>
                                                    ）
                                                </div>
                                                <div style={{ textIndent: '6rem' }}>商超月均：
                                                    <span className="numberValue">{truncateDecimal(item.MINIMART_REVENUE / 10000)}</span>
                                                    万元（
                                                    {`${item.MINIMART_REVENUEIncreaseData < 0 ? '低于' : item.MINIMART_REVENUEIncreaseData > 0 ? '高于' : ''}`}
                                                    现有<span className="numberValue">{truncateDecimal(Math.abs(item.MINIMART_REVENUEIncreaseData / 10000))}</span><span className="unit">万元</span>
                                                    ，{item.MINIMART_REVENUEIncreaseRate > 0 ? '优于' : item.MINIMART_REVENUEIncreaseRate < 0 ? '下浮' : ''}
                                                    <span className="numberValue">{truncateDecimal(Math.abs(item.MINIMART_REVENUEIncreaseRate * 100))}%</span>
                                                    ）
                                                </div>
                                                <div style={{ textIndent: '6rem' }}>日均入区车流量：
                                                    <span className="numberValue">{item.SERVERPART_AVGFLOW}</span>
                                                    辆（
                                                    {`${item.AVGFLOWDiffIncreaseData < 0 ? '低于' : item.AVGFLOWDiffIncreaseData > 0 ? '高于' : ''}`}
                                                    <span className="numberValue">{truncateDecimal(Math.abs(item?.AVGFLOWDiffIncreaseData))}</span><span className="unit">辆</span>
                                                    ，{item.AVGFLOWDiffIncreaseRate > 0 ? '优于' : item.AVGFLOWDiffIncreaseRate < 0 ? '下浮' : ''}
                                                    <span className="numberValue">{Math.abs(truncateDecimal(item.AVGFLOWDiffIncreaseRate * 100))}%</span>
                                                    ，<span className="compare">{item.tolerance > 10 ? '超出10%容差范围' : '未达到容差范围'}</span>）
                                                </div>
                                                <div style={{ textIndent: '6rem' }}>商家盈利稳定性：
                                                    <span className="numberValue">{truncateDecimal(item.PROFIT_AMOUNT / 10000)}</span>
                                                    万元（
                                                    {`${item.PROFIT_AMOUNTIncreaseData < 0 ? '低于' : item.PROFIT_AMOUNTIncreaseData > 0 ? '高于' : ''}`}
                                                    现有<span className="numberValue">{truncateDecimal(Math.abs(item.PROFIT_AMOUNTIncreaseData / 10000))}</span><span className="unit">万元</span>
                                                    ，{item.PROFIT_AMOUNTIncreaseRate > 0 ? '优于' : item.PROFIT_AMOUNTIncreaseRate < 0 ? '下浮' : ''}
                                                    <span className="numberValue">{truncateDecimal(Math.abs(item.PROFIT_AMOUNTIncreaseRate * 100))}%</span>
                                                    ）
                                                </div>
                                            </div>
                                        </div>
                                    }) : ''
                            }
                        </div>
                    </div>


                    <div className="paragraph">
                        <span style={{ fontWeight: 600 }}>分析逻辑与流程</span>
                        <div style={{ textIndent: '2rem', marginBottom: '8px' }}>
                            步骤1：初步筛选
                            <div style={{ textIndent: '2rem' }}>
                                通过B类服务区所有门店的综合评分，按租金、门店营收、车流量适应性等维度筛选出前五名候选门店作为潜在替换选项。
                                使用“低车流高营收”优先原则，筛选在车流量不显著高于目标门店的情况下，仍能保持高营收的候选门店。
                            </div>
                        </div>
                        <div style={{ textIndent: '2rem', marginBottom: '8px' }}>
                            步骤2：多维对比分析
                            <div style={{ textIndent: '2rem' }}>
                                将前五名候选门店的租金、门店营收、商超、车流量等数据与目标门店（如{currentObj?.SERVERPART_NAME || ''}）现状对比，分析替换后可能产生的影响。
                                重点考量：是否符合“车流量不显著提升但营收提升显著”的替换条件；若入区车流量下降，营收至少提升5%；车流量提升不超过10%，营收需至少提升20%。
                            </div>
                        </div>
                        <div style={{ textIndent: '2rem' }}>
                            步骤3：最终推荐
                            <div style={{ textIndent: '2rem' }}>
                                根据候选门店的适应性得出结论，判断哪些替换选项可能带来增值效果，是否比现有的“{currentObj?.SERVERPART_NAME || ''}”表现更优。若候选选项不符合期望，则建议续签现有合同。
                            </div>
                        </div>
                    </div>
                    <div className="paragraph">
                        <span style={{ fontWeight: 600 }}>保底租金和提成比例逻辑框架</span>
                        <div style={{ textIndent: '2rem', marginBottom: '8px' }}>
                            1. 利润率
                            <div style={{ textIndent: '2rem' }}>
                                {`高利润率（>20%）：
                                    商家盈利能力强，可以适当提高提成比例，同时设定更高的保底租金。
                                    中等利润率（10%-20%）：
                                    商家有一定盈利能力，建议维持行业平均提成比例，同时保底租金设置参考营收和行业水平。
                                    低利润率（<10%）或负值：
                                    商家经营存在困难，建议降低保底租金以减轻商家负担，提成比例适当降低或维持现状。`}
                            </div>
                        </div>
                        <div style={{ textIndent: '2rem', marginBottom: '8px' }}>
                            2. 当前提成比例
                            <div style={{ textIndent: '2rem' }}>
                                {`高提成（>30%）：
                                    若商家利润率仍然较高，可以维持或小幅提高提成比例。
                                    若利润率较低，则建议适当下调提成比例以减轻商家压力。
                                    中等提成（20%-30%）：
                                    若商家盈利稳定，可以适当上调至行业高区间。
                                    若盈利困难，则建议维持现状或根据行业标准调整。
                                    低提成（<20%）：
                                    若商家盈利良好，可考虑提高至行业平均水平。`}
                            </div>
                        </div>
                        <div style={{ textIndent: '2rem', marginBottom: '8px' }}>
                            3. 业态特殊性
                            <div style={{ textIndent: '2rem' }}>
                                {`高盈利业态（如西式快餐、中餐馆）：
                                    这些业态商业价值高，消费频次较高，建议设定较高的保底租金和提成比例。
                                    低盈利业态（如其他面食、粽子等）：
                                    这些业态盈利能力有限，建议降低保底租金，提成比例维持在低区间。
                                    亏损业态：
                                    若业态存在战略意义（如提升服务区形象、吸引客流），建议通过降低保底租金、调整提成比例来吸引商家继续经营。
                                    新兴或小众业态：
                                    可采用低保底租金和高提成比例的策略，以降低商家初期经营风险，同时鼓励其提高营收。`}
                            </div>
                        </div>
                        <div style={{ textIndent: '2rem', marginBottom: '8px' }}>
                            4. 综合考量甲方收益
                            <div style={{ textIndent: '2rem' }}>
                                在保底租金和提成比例调整的同时，需要确保甲方的整体收益水平不下降。
                            </div>
                        </div>
                    </div>
                    <div className="paragraph">
                        <span style={{ fontWeight: 600 }}>保底租金计算逻辑：</span>
                        <div style={{ textIndent: '2rem', marginBottom: '8px' }}>
                            首先，选择项目近两个合同年中的最大对客销售额作为参考。如果本期项目销售额较高（因本期可能尚未结束），则基于本期预计全年营收进行预判，并按照行业标准提成比例进行保底租金的测算，确保商家经营的可持续性。为避免商家经营不善导致保底金额偏离实际，计算出的保底金额将与行业平均保底租金进行对比。如果行业标准较高，则显示保底租金建议的合理范围。
                        </div>
                        <span style={{ fontWeight: 600 }}>保底提成比例计算逻辑：</span>
                        <div style={{ textIndent: '2rem', marginBottom: '8px' }}>
                            根据行业业态的标准规则，结合服务区的车流量、商家的经营情况及行业的平均利润率，首先确定一个推荐的提成比例区间。车流量较大的服务区通常对应较高的提成比例，因此会根据车流量的大小推荐一个相应的标准提成比例。同时，通过对行业商家平均利润率的判断，如果实际利润率较高且超过了推荐的提成比例，系统将提供一个更高的提成比例范围供选择。此策略旨在通过合理的提成比例平衡甲方与商家的利益，确保项目的可持续盈利，同时促进商家的积极运营。
                        </div>
                    </div>
                </div>
            </Modal>


            <Modal
                title={'请选择运营模式'}
                destroyOnClose
                width={1200}
                open={showSelectOperatingModel}
                className={'operatingModelModal'}
                onCancel={() => {
                    setShowSelectOperatingModel(false)
                }}
                okText={'下一步'}
                onOk={async () => {
                    // setShowSelectOperatingModel(false);
                    selectFormRef.current?.validateFields().then((res: any) => {
                        if (selectedOperatingModel) {
                            setSelectFormData(res)
                            setRentCalculateModal(true)
                        } else {
                            message.success('请选择运营模式')
                        }
                    })
                }}
            >
                <div className="operatingModelModalBox">
                    {operatingModels.map((model) => (
                        <div
                            key={model}
                            className={`operatingModelModalItemBox ${selectedOperatingModel === model ? 'selected' : ''}`}
                            onClick={() => {
                                setSelectedOperatingModel(model)
                                // setShowSelectOperatingModel(false);
                                // setRentCalculateModal(true)
                            }}
                        >
                            {model}
                        </div>
                    ))}

                    <ProForm
                        formRef={selectFormRef}
                        submitter={false}
                        layout={'horizontal'}
                        labelCol={{ style: { width: 80 } }}
                        style={{ width: '100%', marginTop: '30px' }}
                    >
                        <Row gutter={8}>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'片区'}
                                    name={'SPREGIONTYPE_ID'}
                                    rules={[{ required: true, message: '请选择片区!' }]}
                                    request={async () => {
                                        const req: any = {
                                            SearchParameter: {
                                                SERVERPARTSTATICTYPE_ID: 1000,
                                                TYPE_STATE: 1,
                                                PROVINCE_CODE: 530000
                                            },
                                            PageIndex: 1,
                                            PageSize: 100,
                                            SortStr: "TYPE_INDEX,SERVERPARTTYPE_ID"
                                        }
                                        const data = await handleGetSERVERPARTTYPEList(req)
                                        let list: any = []
                                        if (data && data.length > 0) {
                                            data.forEach((item: any) => {
                                                list.push({ label: item.TYPE_NAME, value: item.SERVERPARTTYPE_ID })
                                            })
                                        }
                                        return list
                                    }}
                                    fieldProps={{
                                        showSearch: true,
                                        filterOption: (input, option) =>
                                            (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
                                        optionFilterProp: 'label',
                                        onChange: (value: any, option: any) => {
                                            handleGetServerPartList(value)
                                            if (value) {
                                                selectFormRef.current?.setFieldsValue({ SPREGIONTYPE_NAME: option.label })
                                            } else {
                                                selectFormRef.current?.setFieldsValue({ SPREGIONTYPE_NAME: "" })
                                            }
                                        }
                                    }}
                                />
                            </Col>
                            <Col span={8} style={{ display: 'none' }}>
                                <ProFormText
                                    label={'片区名称'}
                                    name={'SPREGIONTYPE_NAME'}
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'服务区'}
                                    name={'SERVERPART_ID'}
                                    options={serverPartList}
                                    fieldProps={{
                                        onChange: (e: any, option: any) => {
                                            handleGetSERVERPARTREGION(e)
                                            if (e) {
                                                selectFormRef.current?.setFieldsValue({ SERVERPART_NAME: option.label })
                                            } else {
                                                selectFormRef.current?.setFieldsValue({ SERVERPART_NAME: "" })
                                            }
                                        }
                                    }}
                                    rules={[{ required: true, message: '请选择服务区!' }]}
                                />
                            </Col>
                            <Col span={8} style={{ display: 'none' }}>
                                <ProFormText
                                    label={'服务区名称'}
                                    name={'SERVERPART_NAME'}
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'方位'}
                                    name={'SERVERPART_REGION'}
                                    options={SERVERPARTREGION}
                                />
                            </Col>
                            {


                                selectedOperatingModel === '委托运营' ?
                                    <Col span={8}>
                                        <ProFormSelect
                                            label={'是否首次'}
                                            name={'isFirst'}
                                            rules={[
                                                {
                                                    required: true,
                                                    message: '请选择是否为首次'
                                                }
                                            ]}
                                            options={[
                                                { label: "首次", value: 1 },
                                                { label: "非首次", value: 2 }
                                            ]}
                                        />
                                    </Col> : ""
                            }

                            <Col span={8} style={{ display: 'none' }}>
                                <ProFormSelect
                                    label={'分类定级'}
                                    name={'SERVERPART_TYPE'}
                                    options={[
                                        { label: "立标杆", value: 1000 },
                                        { label: "提能级", value: 2000 },
                                        { label: "稳营收", value: 3000 },
                                        { label: "保功能", value: 4000 },
                                    ]}
                                />
                            </Col>
                        </Row>

                    </ProForm>
                </div>
            </Modal>


            {/* 打开实际填写测算的 悬浮框 */}
            <Modal
                title={'租金测算'}
                destroyOnClose
                width={1200}
                open={rentCalculateModal}
                onCancel={() => {
                    setRentCalculateModal(false)
                    setCurrentRow(undefined)
                }}
                onOk={async () => {
                    modalRef.current?.validateFields().then((res: any) => {
                        // 保存同步租金测算的方法
                        handleAddUpdate(res)
                    })
                }}
                footer={currentRow ? false : <div>
                    <Button style={{ marginRight: '12px' }} onClick={() => {
                        setRentCalculateModal(false)
                        setCurrentRow(undefined)
                    }}>取消</Button>
                    <Button loading={rentCalculateModalLoading} type={'primary'} onClick={() => {
                        modalRef.current?.validateFields().then((res: any) => {
                            setRentCalculateModalLoading(true)
                            // 保存同步租金测算的方法
                            handleAddUpdate(res)
                        })
                    }}>确定</Button>
                </div>}
            >
                <div className="rentCalculateModalContent" style={{ height: '700px', overflowY: 'auto', overflowX: 'hidden', boxSizing: 'border-box', width: '100%' }}>
                    <ProForm
                        formRef={modalRef}
                        submitter={false}
                        layout={'horizontal'}
                        labelCol={{ style: { width: 120 } }}
                        request={async () => {
                            if (currentRow) {
                                handleGetServerPartList(currentRow?.SPREGIONTYPE_ID)
                                handleGetSERVERPARTREGION(currentRow?.SERVERPART_ID)
                                return {
                                    ...currentRow,
                                    SERVERPART_REGION: Number(currentRow?.SERVERPART_REGION)
                                }
                            } else {
                                let formData: any = selectFormRef.current?.getFieldsValue({})
                                if (formData) {
                                    return {
                                        ...formData
                                    }
                                } else {
                                    return {}
                                }
                            }
                        }}
                    >

                        <Row gutter={16}>
                            <Divider orientation="left">基础信息</Divider>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'片区'}
                                    name={'SPREGIONTYPE_ID'}
                                    readonly
                                    request={async () => {
                                        const req: any = {
                                            SearchParameter: {
                                                SERVERPARTSTATICTYPE_ID: 1000,
                                                TYPE_STATE: 1,
                                                PROVINCE_CODE: 530000
                                            },
                                            PageIndex: 1,
                                            PageSize: 100,
                                            SortStr: "TYPE_INDEX,SERVERPARTTYPE_ID"
                                        }
                                        const data = await handleGetSERVERPARTTYPEList(req)
                                        let list: any = []
                                        if (data && data.length > 0) {
                                            data.forEach((item: any) => {
                                                list.push({ label: item.TYPE_NAME, value: item.SERVERPARTTYPE_ID })
                                            })
                                        }
                                        return list
                                    }}
                                />
                            </Col>
                            <Col span={8} style={{ display: 'none' }}>
                                <ProFormText
                                    label={'片区名称'}
                                    name={'SPREGIONTYPE_NAME'}
                                    readonly
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'服务区'}
                                    name={'SERVERPART_ID'}
                                    options={serverPartList}
                                    readonly
                                />
                            </Col>
                            <Col span={8} style={{ display: 'none' }}>
                                <ProFormText
                                    label={'服务区名称'}
                                    name={'SERVERPART_NAME'}
                                    readonly
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'服务区方位'}
                                    name={'SERVERPART_REGION'}
                                    options={SERVERPARTREGION}
                                    readonly
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormDigit
                                    label={'经营面积'}
                                    name={'BUSINESS_TOTALAREA'}
                                    readonly={currentRow}
                                    fieldProps={{
                                        onChange: (e: any) => {
                                            if (e && selectedOperatingModel === '委托运营') {
                                                let sum: number = e * 16.89
                                                modalRef.current?.setFieldsValue({ GROUP_COST_WATER: sum.toFixed(2), GROUP_COST_WATER_INC: (Number(sum.toFixed(2)) * 1.15).toFixed(2) })
                                            }
                                        }
                                    }}
                                />
                            </Col>
                            {/* <Col span={8}>
                                <ProFormSelect
                                    label={'是否首次'}
                                    name={'isFirst'}
                                    options={[
                                        { label: "首次", value: 1 },
                                        { label: "非首次", value: 2 }
                                    ]}
                                    fieldProps={{
                                        onChange: (e: any) => {
                                            if (e) {
                                                // 因为是非首次 所以要拿到第三方保底递增收益的值 去判断 要不要重新计算首次保底营业额的值
                                                let GUARANTEE_INCREASE: number = modalRef.current?.getFieldValue('GUARANTEE_INCREASE')
                                                if (e === 2) {
                                                    modalRef.current?.setFieldsValue({ FIRST_PURCHASER_RATE: 32 })
                                                    if (GUARANTEE_INCREASE) {
                                                        modalRef.current?.setFieldsValue({ FIRST_GUARANTEE_TURNOVER: Number(GUARANTEE_INCREASE / 0.35).toFixed(2) })
                                                    }
                                                } else if (e === 1) {
                                                    modalRef.current?.setFieldsValue({ FIRST_PURCHASER_RATE: 38 })
                                                    modalRef.current?.setFieldsValue({ FIRST_GUARANTEE_TURNOVER: Number(GUARANTEE_INCREASE).toFixed(2) })
                                                }
                                            }
                                        }
                                    }}
                                />
                            </Col> */}
                            <Col span={8}>
                                <ProFormText
                                    label={'所属高速'}
                                    name={'EXPRESSWAY_NAME'}
                                    readonly={currentRow}
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'站点类型'}
                                    name={'STATION_TYPE'}
                                    options={[
                                        { label: "服务区", value: "1000" },
                                        { label: "停车区", value: "2000" },
                                        { label: "加油站", value: "3000" },
                                        { label: "加水站", value: "4000" },
                                        { label: "观景台", value: "5000" },
                                        { label: "休息区", value: "6000" },
                                    ]}
                                    readonly={currentRow}
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'评审方式'}
                                    name={'REVIEW_METHOD'}
                                    options={[
                                        { label: "综合评分法", value: "综合评分法" },
                                    ]}
                                    initialValue={"综合评分法"}
                                    readonly={currentRow}
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'业态'}
                                    name={'BUSINESS_TYPE'}
                                    options={[
                                        { label: "综合楼", value: "综合楼" },
                                        { label: "便利店", value: "便利店" },
                                        { label: "餐饮", value: "餐饮" },
                                        { label: "小吃", value: "小吃" },
                                        { label: "加水", value: "加水" },
                                        { label: "汽修", value: "汽修" },
                                    ]}
                                    readonly={currentRow}
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'招商模式'}
                                    name={'LEASING_MODE'}
                                    options={[
                                        { label: "招标", value: "招标" },
                                        { label: "非招标", value: "非招标" },
                                        { label: "加盟", value: "加盟" },
                                        { label: "保底收益", value: "保底收益" },
                                    ]}
                                    readonly={currentRow}
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormSelect
                                    label={'运营模式'}
                                    name={'OPERATING_MODE'}
                                    options={[
                                        { label: "委托运营", value: "委托运营" },
                                        { label: "加盟项目", value: "加盟项目" },
                                        { label: "保底收益", value: "保底收益" },
                                    ]}
                                    initialValue={selectedOperatingModel || "委托运营"}
                                    readonly={currentRow}
                                />
                            </Col>
                            <Col span={8}>
                                <ProFormDatePicker
                                    label={'合同到期时间'}
                                    name={'CONTRACT_END_DATE'}
                                    width={'100%'}
                                    readonly={currentRow}
                                />
                            </Col>
                            {/* 每个类型 实际需要填写计算的内容 都不一样  所以要区分了 */}
                            {
                                selectedOperatingModel === '委托运营' || currentRow?.OPERATING_MODE === '委托运营' ?
                                    <>
                                        <Divider orientation="left">委托运营</Divider>
                                        <Col span={8}>
                                            <ProFormDigit
                                                label={'原合同末年租金'}
                                                name={'ORIG_CONTRACT_RENT'}
                                                readonly={currentRow}
                                            />
                                        </Col>
                                        <Col span={8}>
                                            <ProFormText
                                                label={'捆绑方式'}
                                                name={'BUNDLE_METHOD'}
                                                readonly={currentRow}
                                            />
                                        </Col>
                                        <Divider orientation="left">集团公司成本价格</Divider>
                                        <Col span={8}>
                                            <ProFormDigit
                                                label={'加水'}
                                                name={'GROUP_COST_WATER'}
                                                fieldProps={{
                                                    onChange: (e: any) => {
                                                        if (e) {
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_WATER_INC: (Number(e) * 1.15).toFixed(2) })
                                                        }
                                                    }
                                                }}
                                                readonly={currentRow}
                                            />
                                        </Col>
                                        <Col span={8}>
                                            <ProFormDigit
                                                label={'加水成本递增15%'}
                                                name={'GROUP_COST_WATER_INC'}
                                                readonly={currentRow}
                                            />
                                        </Col>
                                        <Divider orientation="left">第三方评估测算年保底收益</Divider>
                                        <Col span={8}>
                                            <ProFormDigit
                                                label={'保底价格'}
                                                name={'THIRD_GUARANTEE'}
                                                fieldProps={{
                                                    onChange: (e: any) => {
                                                        if (e) {
                                                            let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                            if (fromRes) {
                                                                let rate: number = 1.05
                                                                if (fromRes === 1000 || fromRes === 2000) {
                                                                    rate = 1.15
                                                                } else if (fromRes === 3000) {
                                                                    rate = 1.1
                                                                } else if (fromRes === 4000) {
                                                                    rate = 1.05
                                                                }
                                                                let sum: number = e * 1.15 * rate
                                                                modalRef.current?.setFieldsValue({ GUARANTEE_INCREASE: sum.toFixed(2) })

                                                                // 是首次 那么就要把 1 2 3 次都算出来  不是首次的话  就算 2 3 即可
                                                                if (selectFormData?.isFirst === 1) {
                                                                    // 是首次的话 
                                                                    modalRef.current?.setFieldsValue({ FIRST_GUARANTEE_TURNOVER: (Number(sum.toFixed(2)) / 0.35).toFixed(2) })
                                                                    // 首次的钱 赋值一下
                                                                    let firstMinimumRevenueNumber: number = Number((Number(sum.toFixed(2)) / 0.35).toFixed(2))
                                                                    // 第二次就是第一次的值 
                                                                    modalRef.current?.setFieldsValue({ SECOND_GUARANTEE_TURNOVER: (Number(firstMinimumRevenueNumber)).toFixed(2) })
                                                                    // 给第二次的钱 赋值一下 
                                                                    let secondMinimumRevenueNumber: number = Number((Number(firstMinimumRevenueNumber)).toFixed(2))
                                                                    // 第三次的钱是第二次的90%
                                                                    modalRef.current?.setFieldsValue({ THIRD_GUARANTEE_TURNOVER: (Number(secondMinimumRevenueNumber) * 0.9).toFixed(2) })
                                                                } else if (selectFormData?.isFirst === 2) {
                                                                    // 非首次 这边怎么样都没关系了 等用户自己输入第一次的值之后 再给他补齐 2 3 次
                                                                }
                                                            }
                                                        }
                                                    }
                                                }}
                                                readonly={currentRow}
                                            />
                                        </Col>
                                        <Col span={8}>
                                            <ProFormDigit
                                                label={'保底收益递增'}
                                                name={'GUARANTEE_INCREASE'}
                                                fieldProps={{
                                                    onChange: (e: any) => {
                                                        if (e) {
                                                            // 先拿到判断是不是首次项目
                                                            let formDataIsFirst: number = modalRef.current?.getFieldValue('isFirst')
                                                            // 是首次 就不去改变  保底营业额的值 不是才计算
                                                            if (formDataIsFirst === 1) {
                                                            } else if (formDataIsFirst === 2) {
                                                                modalRef.current?.setFieldsValue({ FIRST_GUARANTEE_TURNOVER: Number(e / 0.35).toFixed(2) })
                                                            }
                                                        }
                                                    }
                                                }}
                                                readonly={currentRow}
                                            />
                                        </Col>

                                        <>
                                            <Divider orientation="left">测算结果</Divider>
                                            <Col span={8}>
                                                <ProFormDatePicker
                                                    width="100%"
                                                    label={'合作期限'}
                                                    name={'COOPERATION_TERM'}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDatePicker
                                                    width="100%"
                                                    label={'非招标启动时间'}
                                                    name={'FIRSTSTART_DATE'}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Divider orientation="left">首次招标</Divider>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'保底营业额（元）'}
                                                    name={'FIRST_GUARANTEE_TURNOVER'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            if (e) {
                                                                let sum: number = e * 0.9
                                                                modalRef.current?.setFieldsValue({
                                                                    SECOND_GUARANTEE_TURNOVER: e,
                                                                    THIRD_GUARANTEE_TURNOVER: sum.toFixed(2)
                                                                })
                                                            }
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'收益提点比例（%）'}
                                                    name={'FIRST_PURCHASER_RATE'}
                                                    initialValue={selectFormData?.isFirst === 1 ? 38 : 32}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Divider orientation="left">二次招标</Divider>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'保底营业额（元）'}
                                                    name={'SECOND_GUARANTEE_TURNOVER'}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'收益提点比例（%）'}
                                                    name={'SECOND_PURCHASER_RATE'}
                                                    initialValue={32}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Divider orientation="left">三次招标</Divider>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'保底营业额（元）'}
                                                    name={'THIRD_GUARANTEE_TURNOVER'}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'收益提点比例（%）'}
                                                    name={'THIRD_PURCHASER_RATE'}
                                                    initialValue={32}
                                                    readonly={currentRow}
                                                />
                                            </Col>

                                        </>
                                    </> :
                                    selectedOperatingModel === '加盟项目' || currentRow?.OPERATING_MODE === '加盟项目' ?
                                        <>
                                            {/* <Divider orientation="left">业态定位</Divider>
                                            <Col span={8}>
                                                <ProFormText
                                                    label={'餐饮'}
                                                    name={''}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormText
                                                    label={'小吃'}
                                                    name={''}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormText
                                                    label={'便利店'}
                                                    name={''}
                                                />
                                            </Col> */}
                                            <Divider orientation="left">原合同末年租金</Divider>
                                            <Col>

                                                <ProFormDigit
                                                    label={'原合同末年租金'}
                                                    name={'ORIG_RENT_COMPREHENSIVE'}
                                                    tooltip={"综合楼、加水、汽修站合计"}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到当前表单数据
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_TOTAL_INC_V2", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(e || 0), Number(sumObj.GROUP_COST_TOTAL_INC_V2 || 0), Number(sumObj.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(e || 0), Number(sumObj.GROUP_COST_TOTAL_INC_V2 || 0), Number(sumObj.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Divider orientation="left">业态面积</Divider>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'综合楼面积'}
                                                    name={'AREA_BUILDING_COMPREHENSIVE'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 先改自己有关联的 
                                                            let sum: number = Number(((e || 0) * 303.91).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_COMPREHENSIVE: sum, GROUP_COST_COMPREHENSIVE_INC: (sum * 1.15).toFixed(2) })
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_COMPREHENSIVE_INC", "GROUP_COST_WATER_INC", "GROUP_COST_AUTOSHOP_INC"])

                                                            let totalIncrementalSum: number = Number((Number(sumObj.GROUP_COST_COMPREHENSIVE_INC || 0) + Number(sumObj.GROUP_COST_WATER_INC || 0) + Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })

                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'加水经营面积'}
                                                    name={'AREA_WATER'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            let sum: number = Number(((e || 0) * 16.89).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_WATER: sum, GROUP_COST_WATER_INC: (sum * 1.15).toFixed(2) })
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_COMPREHENSIVE_INC", "GROUP_COST_WATER_INC", "GROUP_COST_AUTOSHOP_INC"])
                                                            let totalIncrementalSum: number = Number((Number(sumObj.GROUP_COST_COMPREHENSIVE_INC || 0) + Number(sumObj.GROUP_COST_WATER_INC || 0) + Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })

                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'汽修站面积'}
                                                    name={'AREA_AUTOSHOP'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            let sum: number = Number(((e || 0) * 16.89).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_AUTOSHOP: sum, GROUP_COST_AUTOSHOP_INC: (sum * 1.15).toFixed(2) })
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_COMPREHENSIVE_INC", "GROUP_COST_WATER_INC", "GROUP_COST_AUTOSHOP_INC"])
                                                            let totalIncrementalSum: number = Number((Number(sumObj.GROUP_COST_COMPREHENSIVE_INC || 0) + Number(sumObj.GROUP_COST_WATER_INC || 0) + Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Divider orientation="left">集团公司成本价格</Divider>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'综合楼'}
                                                    name={'GROUP_COST_COMPREHENSIVE'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            let sum: number = Number(((e || 0) * 1.15).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_COMPREHENSIVE_INC: sum })
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_COMPREHENSIVE_INC", "GROUP_COST_WATER_INC", "GROUP_COST_AUTOSHOP_INC"])
                                                            let totalIncrementalSum: number = Number((Number(sumObj.GROUP_COST_COMPREHENSIVE_INC || 0) + Number(sumObj.GROUP_COST_WATER_INC || 0) + Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'加水'}
                                                    name={'GROUP_COST_WATER'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            let sum: number = Number(((e || 0) * 1.15).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_WATER_INC: sum })
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_COMPREHENSIVE_INC", "GROUP_COST_WATER_INC", "GROUP_COST_AUTOSHOP_INC"])
                                                            let totalIncrementalSum: number = Number((Number(sumObj.GROUP_COST_COMPREHENSIVE_INC || 0) + Number(sumObj.GROUP_COST_WATER_INC || 0) + Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })


                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'汽修站'}
                                                    name={'GROUP_COST_AUTOSHOP'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            let sum: number = Number(((e || 0) * 1.15).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_AUTOSHOP_INC: sum })
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_COMPREHENSIVE_INC", "GROUP_COST_WATER_INC", "GROUP_COST_AUTOSHOP_INC"])
                                                            let totalIncrementalSum: number = Number((Number(sumObj.GROUP_COST_COMPREHENSIVE_INC || 0) + Number(sumObj.GROUP_COST_WATER_INC || 0) + Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'综合楼递增15%'}
                                                    name={'GROUP_COST_COMPREHENSIVE_INC'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_WATER_INC", "GROUP_COST_AUTOSHOP_INC"])
                                                            let totalIncrementalSum: number = Number((Number(e || 0) + Number(sumObj.GROUP_COST_WATER_INC || 0) + Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'加水递增15%'}
                                                    name={'GROUP_COST_WATER_INC'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_COMPREHENSIVE_INC", "GROUP_COST_AUTOSHOP_INC"])
                                                            let totalIncrementalSum: number = Number((Number(sumObj.GROUP_COST_COMPREHENSIVE_INC || 0) + Number(e || 0) + Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })

                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'汽修站递增15%'}
                                                    name={'GROUP_COST_AUTOSHOP_INC'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_COMPREHENSIVE_INC", "GROUP_COST_WATER_INC"])
                                                            let totalIncrementalSum: number = Number((Number(sumObj.GROUP_COST_COMPREHENSIVE_INC || 0) + Number(sumObj.GROUP_COST_WATER_INC || 0) + Number(e || 0)).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ GROUP_COST_TOTAL_INC_V2: totalIncrementalSum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(totalIncrementalSum || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'集团合计递增15%'}
                                                    name={'GROUP_COST_TOTAL_INC_V2'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "totalGuaranteedIncomeAdd"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(e || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(e || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Divider orientation="left">第三方评估测算年保底收益（元）</Divider>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'综合楼'}
                                                    name={'THIRD_GUARANTEE_COMPREHENSIVE'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["THIRD_GUARANTEE_WATER", "THIRD_GUARANTEE_AUTOSHOP"])
                                                            let sum: number = Number((Number(e || 0) + Number(sumObj.THIRD_GUARANTEE_WATER || 0) + Number(sumObj.THIRD_GUARANTEE_AUTOSHOP || 0)).toFixed(2))

                                                            let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                            let rate: number = 1.05
                                                            if (fromRes === 1000 || fromRes === 2000) {
                                                                rate = 1.15
                                                            } else if (fromRes === 3000) {
                                                                rate = 1.1
                                                            } else if (fromRes === 4000) {
                                                                rate = 1.05
                                                            }


                                                            modalRef.current?.setFieldsValue({ GUARANTEE_TOTAL: sum, totalGuaranteedIncomeAdd: (sum * 1.15 * rate).toFixed(2) })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'加水区域'}
                                                    name={'THIRD_GUARANTEE_WATER'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["THIRD_GUARANTEE_COMPREHENSIVE", "THIRD_GUARANTEE_AUTOSHOP"])
                                                            let sum: number = Number((Number(sumObj.THIRD_GUARANTEE_COMPREHENSIVE || 0) + Number(e || 0) + Number(sumObj.THIRD_GUARANTEE_AUTOSHOP || 0)).toFixed(2))

                                                            let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                            let rate: number = 1.05
                                                            if (fromRes === 1000 || fromRes === 2000) {
                                                                rate = 1.15
                                                            } else if (fromRes === 3000) {
                                                                rate = 1.1
                                                            } else if (fromRes === 4000) {
                                                                rate = 1.05
                                                            }

                                                            modalRef.current?.setFieldsValue({ GUARANTEE_TOTAL: sum, totalGuaranteedIncomeAdd: (sum * 1.15 * rate).toFixed(2) })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'汽修站'}
                                                    name={'THIRD_GUARANTEE_AUTOSHOP'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到合计
                                                            let sumObj: any = modalRef.current?.getFieldsValue(["THIRD_GUARANTEE_COMPREHENSIVE", "THIRD_GUARANTEE_WATER"])
                                                            let sum: number = Number((Number(sumObj.THIRD_GUARANTEE_COMPREHENSIVE || 0) + Number(sumObj.THIRD_GUARANTEE_WATER || 0) + Number(e || 0)).toFixed(2))

                                                            let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                            let rate: number = 1.05
                                                            if (fromRes === 1000 || fromRes === 2000) {
                                                                rate = 1.15
                                                            } else if (fromRes === 3000) {
                                                                rate = 1.1
                                                            } else if (fromRes === 4000) {
                                                                rate = 1.05
                                                            }

                                                            modalRef.current?.setFieldsValue({ GUARANTEE_TOTAL: sum, totalGuaranteedIncomeAdd: (sum * 1.15 * rate).toFixed(2) })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Divider orientation="left">保底收益</Divider>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'保底收益合计'}
                                                    name={'GUARANTEE_TOTAL'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                            let rate: number = 1.05
                                                            if (fromRes === 1000 || fromRes === 2000) {
                                                                rate = 1.15
                                                            } else if (fromRes === 3000) {
                                                                rate = 1.1
                                                            } else if (fromRes === 4000) {
                                                                rate = 1.05
                                                            }
                                                            let sum: number = Number(((e || 0) * 1.15 * rate).toFixed(2))
                                                            modalRef.current?.setFieldsValue({ totalGuaranteedIncomeAdd: sum })

                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "GROUP_COST_TOTAL_INC_V2"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj2.GROUP_COST_TOTAL_INC_V2 || 0), Number(sum || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj2.GROUP_COST_TOTAL_INC_V2 || 0), Number(sum || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormDigit
                                                    label={'保底收益递增'}
                                                    name={'GUARANTEE_INCREASE'}
                                                    fieldProps={{
                                                        onChange: (e: any) => {
                                                            // 拿到当前表单数据
                                                            let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "GROUP_COST_TOTAL_INC_V2"])
                                                            // 先拿第一次的招商底价 这是第一次招商的底价
                                                            let FIRST_OFFER: number = Math.max(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj2.GROUP_COST_TOTAL_INC_V2 || 0), Number(e || 0))
                                                            // 拿到第二次和第三次的招商底价方法
                                                            let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj2.GROUP_COST_TOTAL_INC_V2 || 0), Number(e || 0), Number((FIRST_OFFER * 0.9).toFixed(2)))
                                                            modalRef.current?.setFieldsValue({
                                                                FIRST_OFFER: FIRST_OFFER, SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                            })
                                                        }
                                                    }}
                                                    readonly={currentRow}
                                                />
                                            </Col>
                                            <Col span={8}>
                                                <ProFormText
                                                    label={'捆绑方式'}
                                                    name={'BUNDLE_METHOD'}
                                                    readonly={currentRow}
                                                />
                                            </Col>

                                            <Divider orientation="left">加盟项目</Divider>
                                            <>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'首次招商底价（元）'}
                                                        name={'FIRST_OFFER'}
                                                        fieldProps={{
                                                            onChange: (e: any) => {
                                                                // 拿到当前表单数据
                                                                let sumObj2: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "GROUP_COST_TOTAL_INC_V2", "totalGuaranteedIncomeAdd"])
                                                                // 拿到第二次和第三次的招商底价方法
                                                                let res: any = handleCalcSecondThirdLowPrice(Number(sumObj2.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj2.GROUP_COST_TOTAL_INC_V2 || 0), Number(sumObj2.totalGuaranteedIncomeAdd || 0), Number(((e || 0) * 0.9).toFixed(2)))
                                                                modalRef.current?.setFieldsValue({
                                                                    SECOND_OFFER: res.secondResult, THIRD_OFFER: res.thirdResult
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'二次招商底价（元）'}
                                                        name={'SECOND_OFFER'}
                                                        readonly={currentRow}

                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'三次招商底价（元）'}
                                                        name={'THIRD_OFFER'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'物业费用（元）'}
                                                        name={'PROPERTY_FEE'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'装修免租期（月）'}
                                                        name={'RENT_FREE_MONTHS'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'加盟费（元）'}
                                                        name={'FRANCHISE_FEE'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'首次品牌营销费（元）'}
                                                        name={'FIRSTBRANDMARKETING_FEE'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'合作期限'}
                                                        name={'COOPERATION_YEARS'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDatePicker
                                                        label={'非招标启动时间'}
                                                        name={'FIRSTSTART_DATE'}
                                                        width={'100%'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'评估费'}
                                                        name={'EVALUATION_FEE'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                            </>
                                        </> :
                                        selectedOperatingModel === '保底收益一' || currentRow?.OPERATING_MODE === '保底收益一' ?
                                            <>
                                                <Divider orientation="left">业态面积</Divider>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'综合楼面积'}
                                                        name={'AREA_BUILDING_COMPREHENSIVE'}
                                                        fieldProps={{
                                                            onChange: (e: any) => {
                                                                // 改变综合楼单平方价格
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["FIRST_OFFER_LY"])
                                                                let COMPREHENSIVE_PRICE_PER: number = Number((Number(sumObj?.FIRST_OFFER_LY || 0) / Number(e || 0)).toFixed(2))
                                                                modalRef.current?.setFieldsValue({
                                                                    COMPREHENSIVE_PRICE_PER: COMPREHENSIVE_PRICE_PER,
                                                                })

                                                                let sumObj2: any = modalRef.current?.getFieldsValue(["TOTAL_PROPERTY_FEE", "AREA_DINING", "AREA_SNACK", "AREA_CONVENIENCE", "AREA_AUTOSHOP"])
                                                                modalRef.current?.setFieldsValue({
                                                                    PROPERTY_FEE_DINING: Number((Number(sumObj2.TOTAL_PROPERTY_FEE || 0) / Number(e || 0) * Number(sumObj2.AREA_DINING || 0)).toFixed(2)),//餐饮
                                                                    PROPERTY_FEE_SNACK: Number((Number(sumObj2.TOTAL_PROPERTY_FEE || 0) / Number(e || 0) * Number(sumObj2.AREA_SNACK || 0)).toFixed(2)),//小吃
                                                                    PROPERTY_FEE_CONVENIENCE: Number((Number(sumObj2.TOTAL_PROPERTY_FEE || 0) / Number(e || 0) * Number(sumObj2.AREA_CONVENIENCE || 0)).toFixed(2)),//便利店
                                                                    PROPERTY_FEE_AUTOSHOP: Number((Number(sumObj2.TOTAL_PROPERTY_FEE || 0) / Number(e || 0) * 0.1 * Number(sumObj2.AREA_AUTOSHOP || 0)).toFixed(2)),//汽修站
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'餐饮'}
                                                        name={'AREA_DINING'}
                                                        fieldProps={{
                                                            min: 80,
                                                            onChange: (e: any) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["COMPREHENSIVE_PRICE_PER"])
                                                                modalRef.current?.setFieldsValue({
                                                                    AREA_OFFER_DINING: Number((Number(sumObj.COMPREHENSIVE_PRICE_PER || 0) * Number(e || 0)).toFixed(2)),
                                                                })

                                                                let sumObj2: any = modalRef.current?.getFieldsValue(["TOTAL_PROPERTY_FEE", "AREA_BUILDING_COMPREHENSIVE"])
                                                                modalRef.current?.setFieldsValue({
                                                                    PROPERTY_FEE_DINING: Number((Number(sumObj2.TOTAL_PROPERTY_FEE || 0) / Number(sumObj2.AREA_BUILDING_COMPREHENSIVE || 0) * Number(e || 0)).toFixed(2)),//餐饮
                                                                })
                                                            }
                                                        }}
                                                        tooltip={"最小值为80"}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'小吃'}
                                                        name={'AREA_SNACK'}
                                                        fieldProps={{
                                                            min: 30,
                                                            onChange: (e: any) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["COMPREHENSIVE_PRICE_PER"])
                                                                modalRef.current?.setFieldsValue({
                                                                    AREA_OFFER_SNACK: Number((Number(sumObj.COMPREHENSIVE_PRICE_PER || 0) * Number(e || 0)).toFixed(2)),
                                                                })

                                                                let sumObj2: any = modalRef.current?.getFieldsValue(["AREA_BUILDING_COMPREHENSIVE", "TOTAL_PROPERTY_FEE"])
                                                                modalRef.current?.setFieldsValue({
                                                                    PROPERTY_FEE_SNACK: Number((Number(sumObj2.TOTAL_PROPERTY_FEE || 0) / Number(sumObj2.AREA_BUILDING_COMPREHENSIVE || 0) * Number(e || 0)).toFixed(2)),//小吃
                                                                })
                                                            }
                                                        }}
                                                        tooltip={"最小值为30"}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'便利店'}
                                                        name={'AREA_CONVENIENCE'}
                                                        fieldProps={{
                                                            min: 50,
                                                            onChange: (e: any) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["COMPREHENSIVE_PRICE_PER"])
                                                                modalRef.current?.setFieldsValue({
                                                                    AREA_OFFER_CONVENIENCE: Number((Number(sumObj.COMPREHENSIVE_PRICE_PER || 0) * Number(e || 0)).toFixed(2)),
                                                                })

                                                                let sumObj2: any = modalRef.current?.getFieldsValue(["TOTAL_PROPERTY_FEE", "AREA_BUILDING_COMPREHENSIVE"])
                                                                modalRef.current?.setFieldsValue({
                                                                    PROPERTY_FEE_CONVENIENCE: Number((Number(sumObj2.TOTAL_PROPERTY_FEE || 0) / Number(sumObj2.AREA_BUILDING_COMPREHENSIVE || 0) * Number(e || 0)).toFixed(2)),//便利店
                                                                })
                                                            }
                                                        }}
                                                        tooltip={"最小值为50"}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'加水'}
                                                        name={'AREA_WATER'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'汽修站'}
                                                        name={'AREA_AUTOSHOP'}
                                                        fieldProps={{
                                                            onChange: (e: any) => {
                                                                let sumObj2: any = modalRef.current?.getFieldsValue(["TOTAL_PROPERTY_FEE", "AREA_BUILDING_COMPREHENSIVE"])
                                                                modalRef.current?.setFieldsValue({
                                                                    PROPERTY_FEE_AUTOSHOP: Number((Number(sumObj2.TOTAL_PROPERTY_FEE || 0) / Number(sumObj2.AREA_BUILDING_COMPREHENSIVE || 0) * 0.1 * Number(e || 0)).toFixed(2)),//汽修站
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Divider orientation="left">第三方评估测算年保底收益（元）</Divider>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'综合楼'}
                                                        name={'THIRD_GUARANTEE_COMPREHENSIVE'}
                                                        fieldProps={{
                                                            onChange: (e) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["THIRD_GUARANTEE_WATER", "THIRD_GUARANTEE_AUTOSHOP"])
                                                                let sum: number = Number((Number(e || 0) + Number(sumObj.THIRD_GUARANTEE_WATER || 0) + Number(sumObj.THIRD_GUARANTEE_AUTOSHOP || 0)).toFixed(2))
                                                                let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                                let rate: number = 1.05
                                                                if (fromRes === 1000 || fromRes === 2000) {
                                                                    rate = 1.15
                                                                } else if (fromRes === 3000) {
                                                                    rate = 1.1
                                                                } else if (fromRes === 4000) {
                                                                    rate = 1.05
                                                                }
                                                                let sumAdd: number = Number((sum * rate * 1.15).toFixed(2))
                                                                modalRef.current?.setFieldsValue({
                                                                    GUARANTEE_TOTAL: sum,
                                                                    GUARANTEE_INCREASE: sumAdd
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'加水'}
                                                        name={'THIRD_GUARANTEE_WATER'}
                                                        fieldProps={{
                                                            onChange: (e) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["THIRD_GUARANTEE_COMPREHENSIVE", "THIRD_GUARANTEE_AUTOSHOP"])
                                                                let sum: number = Number((Number(e || 0) + Number(sumObj.THIRD_GUARANTEE_COMPREHENSIVE || 0) + Number(sumObj.THIRD_GUARANTEE_AUTOSHOP || 0)).toFixed(2))
                                                                let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                                let rate: number = 1.05
                                                                if (fromRes === 1000 || fromRes === 2000) {
                                                                    rate = 1.15
                                                                } else if (fromRes === 3000) {
                                                                    rate = 1.1
                                                                } else if (fromRes === 4000) {
                                                                    rate = 1.05
                                                                }
                                                                let sumAdd: number = Number((sum * rate * 1.15).toFixed(2))
                                                                modalRef.current?.setFieldsValue({
                                                                    GUARANTEE_TOTAL: sum,
                                                                    GUARANTEE_INCREASE: sumAdd
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'汽修站'}
                                                        name={'THIRD_GUARANTEE_AUTOSHOP'}
                                                        fieldProps={{
                                                            onChange: (e) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["THIRD_GUARANTEE_COMPREHENSIVE", "THIRD_GUARANTEE_WATER"])
                                                                let sum: number = Number((Number(e || 0) + Number(sumObj.THIRD_GUARANTEE_WATER || 0) + Number(sumObj.THIRD_GUARANTEE_COMPREHENSIVE || 0)).toFixed(2))
                                                                let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                                let rate: number = 1.05
                                                                if (fromRes === 1000 || fromRes === 2000) {
                                                                    rate = 1.15
                                                                } else if (fromRes === 3000) {
                                                                    rate = 1.1
                                                                } else if (fromRes === 4000) {
                                                                    rate = 1.05
                                                                }
                                                                let sumAdd: number = Number((sum * rate * 1.15).toFixed(2))
                                                                modalRef.current?.setFieldsValue({
                                                                    GUARANTEE_TOTAL: sum,
                                                                    GUARANTEE_INCREASE: sumAdd
                                                                })

                                                                let repairSum: number = Number((Number(e || 0) * 1.15 * rate).toFixed(2))
                                                                modalRef.current?.setFieldsValue({ AREA_OFFER_AUTOSHOP: repairSum })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Divider orientation="left">保底收益一</Divider>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'保底收益'}
                                                        name={'GUARANTEE_TOTAL'}
                                                        fieldProps={{
                                                            onChange: (e) => {
                                                                let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                                let rate: number = 1.05
                                                                if (fromRes === 1000 || fromRes === 2000) {
                                                                    rate = 1.15
                                                                } else if (fromRes === 3000) {
                                                                    rate = 1.1
                                                                } else if (fromRes === 4000) {
                                                                    rate = 1.05
                                                                }
                                                                let sumAdd: number = Number(((e || 0) * rate * 1.15).toFixed(2))
                                                                modalRef.current?.setFieldsValue({
                                                                    GUARANTEE_INCREASE: sumAdd
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'保底收益递增'}
                                                        name={'GUARANTEE_INCREASE'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormText
                                                        label={'捆绑方式'}
                                                        name={'BUNDLE_METHOD'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'单平方价格'}
                                                        name={'COMPREHENSIVE_PRICE_PER'}
                                                        tooltip={"（m²/元/年）"}
                                                        fieldProps={{
                                                            placeholder: "请输入单平方价格（m²/元/年）",
                                                            onChange: (e: any) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["AREA_DINING", "AREA_SNACK", "AREA_CONVENIENCE"])
                                                                modalRef.current?.setFieldsValue({
                                                                    AREA_OFFER_DINING: Number((Number(sumObj.AREA_DINING || 0) * Number(e || 0)).toFixed(2)),
                                                                    AREA_OFFER_SNACK: Number((Number(sumObj.AREA_SNACK || 0) * Number(e || 0)).toFixed(2)),
                                                                    AREA_OFFER_CONVENIENCE: Number((Number(sumObj.AREA_CONVENIENCE || 0) * Number(e || 0)).toFixed(2)),
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'去年首次招商底价（元）'}
                                                        name={'FIRST_OFFER_LY'}
                                                        fieldProps={{
                                                            onChange: (e: any) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["AREA_BUILDING_COMPREHENSIVE"])
                                                                let COMPREHENSIVE_PRICE_PER: number = Number((Number(e || 0) / Number(sumObj.AREA_BUILDING_COMPREHENSIVE || 0)).toFixed(2))
                                                                modalRef.current?.setFieldsValue({
                                                                    COMPREHENSIVE_PRICE_PER: COMPREHENSIVE_PRICE_PER
                                                                })

                                                                let sumObj2: any = modalRef.current?.getFieldsValue(["AREA_DINING", "AREA_SNACK", "AREA_CONVENIENCE"])
                                                                modalRef.current?.setFieldsValue({
                                                                    AREA_OFFER_DINING: Number((Number(sumObj2.AREA_DINING || 0) * Number(COMPREHENSIVE_PRICE_PER || 0)).toFixed(2)),
                                                                    AREA_OFFER_SNACK: Number((Number(sumObj2.AREA_SNACK || 0) * Number(COMPREHENSIVE_PRICE_PER || 0)).toFixed(2)),
                                                                    AREA_OFFER_CONVENIENCE: Number((Number(sumObj2.AREA_CONVENIENCE || 0) * Number(COMPREHENSIVE_PRICE_PER || 0)).toFixed(2)),
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'总物业费用（元）'}
                                                        name={'TOTAL_PROPERTY_FEE'}
                                                        fieldProps={{
                                                            onChange: (e: any) => {
                                                                let sumObj: any = modalRef.current?.getFieldsValue(["AREA_BUILDING_COMPREHENSIVE", "AREA_DINING", "AREA_SNACK", "AREA_CONVENIENCE", "AREA_AUTOSHOP"])
                                                                modalRef.current?.setFieldsValue({
                                                                    PROPERTY_FEE_DINING: Number((Number(e || 0) / Number(sumObj.AREA_BUILDING_COMPREHENSIVE || 0) * Number(sumObj.AREA_DINING || 0)).toFixed(2)),//餐饮
                                                                    PROPERTY_FEE_SNACK: Number((Number(e || 0) / Number(sumObj.AREA_BUILDING_COMPREHENSIVE || 0) * Number(sumObj.AREA_SNACK || 0)).toFixed(2)),//小吃
                                                                    PROPERTY_FEE_CONVENIENCE: Number((Number(e || 0) / Number(sumObj.AREA_BUILDING_COMPREHENSIVE || 0) * Number(sumObj.AREA_CONVENIENCE || 0)).toFixed(2)),//便利店
                                                                    PROPERTY_FEE_AUTOSHOP: Number((Number(e || 0) / Number(sumObj.AREA_BUILDING_COMPREHENSIVE || 0) * 0.1 * Number(sumObj.AREA_AUTOSHOP || 0)).toFixed(2)),//汽修站
                                                                })
                                                            }
                                                        }}
                                                        readonly={currentRow}
                                                    />
                                                </Col>

                                                <Divider orientation="left">面积拆分招商底价（元）</Divider>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'餐饮'}
                                                        name={'AREA_OFFER_DINING'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'小吃'}
                                                        name={'AREA_OFFER_SNACK'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'便利店'}
                                                        name={'AREA_OFFER_CONVENIENCE'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'汽修'}
                                                        name={'AREA_OFFER_AUTOSHOP'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'加水'}
                                                        name={'AREA_OFFER_WATER'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Divider orientation="left">面积拆分物业费（元）</Divider>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'餐饮'}
                                                        name={'PROPERTY_FEE_DINING'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'小吃'}
                                                        name={'PROPERTY_FEE_SNACK'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'便利店'}
                                                        name={'PROPERTY_FEE_CONVENIENCE'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'汽修站'}
                                                        name={'PROPERTY_FEE_AUTOSHOP'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Divider orientation="left">测算结果</Divider>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'装修免租期（月）'}
                                                        name={'RENT_FREE_MONTHS'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'合作期限'}
                                                        name={'COOPERATION_YEARS'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDatePicker
                                                        label={'首次非招标启动时间'}
                                                        width={'100%'}
                                                        name={'FIRSTSTART_DATE'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                                <Col span={8}>
                                                    <ProFormDigit
                                                        label={'去年评估费'}
                                                        name={'EVALUATION_FEE_LY'}
                                                        readonly={currentRow}
                                                    />
                                                </Col>
                                            </> :
                                            selectedOperatingModel === '保底收益二' || currentRow?.OPERATING_MODE === '保底收益二' ?
                                                <>
                                                    <Divider orientation="left">业态面积</Divider>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'汽修站面积'}
                                                            name={'AREA_AUTOSHOP'}
                                                            fieldProps={{
                                                                onChange: (e: any) => {
                                                                    let sum: number = Number((Number(e || 0) * 16.89).toFixed(2))
                                                                    let sumAdd: number = Number((sum * 1.15).toFixed(2))

                                                                    modalRef.current?.setFieldsValue({
                                                                        GROUP_COST_AUTOSHOP: sum,
                                                                        GROUP_COST_AUTOSHOP_INC: sumAdd
                                                                    })


                                                                    let sumObj: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "GUARANTEE_INCREASE"])
                                                                    // 第一次招商底价
                                                                    let firstPrice: number = Math.max(Number(sumObj?.ORIG_RENT_COMPREHENSIVE || 0), Number(sumAdd || 0), Number(sumObj?.GUARANTEE_INCREASE || 0))
                                                                    // 拿到第二次和第三次的招商底价方法
                                                                    let res: any = handleCalcSecondThirdLowPrice(Number(sumObj.ORIG_RENT_COMPREHENSIVE || 0), Number(sumAdd || 0), Number(sumObj.GUARANTEE_INCREASE || 0), Number((firstPrice * 0.9).toFixed(2)))
                                                                    modalRef.current?.setFieldsValue({
                                                                        FIRST_OFFER: firstPrice,
                                                                        SECOND_OFFER: res.secondResult,
                                                                        THIRD_OFFER: res.thirdResult
                                                                    })

                                                                    let sumObj2: any = modalRef.current?.getFieldsValue(["AREA_BUILDING_COMPREHENSIVE", "TOTAL_PROPERTY_FEE"])

                                                                    let repairPropertySum: number = sumObj2?.AREA_BUILDING_COMPREHENSIVE ? Number((Number(sumObj2?.TOTAL_PROPERTY_FEE || 0) / Number(sumObj2?.AREA_BUILDING_COMPREHENSIVE || 0) * 0.1 * Number(e || 0)).toFixed(2)) : 0
                                                                    modalRef.current?.setFieldsValue({
                                                                        AUTOSHOP_PROPERTY_FEE: repairPropertySum,
                                                                    })
                                                                }
                                                            }}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Divider orientation="left">原合同末年租金</Divider>

                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'合同末年租金'}
                                                            name={'ORIG_RENT_COMPREHENSIVE'}
                                                            tooltip={"综合楼、加水、汽修站合计"}
                                                            fieldProps={{
                                                                onChange: (e: any) => {
                                                                    let sumObj: any = modalRef.current?.getFieldsValue(["GROUP_COST_AUTOSHOP_INC", "GUARANTEE_INCREASE"])
                                                                    // 第一次招商底价
                                                                    let firstPrice: number = Math.max(Number(e || 0), Number(sumObj?.GROUP_COST_AUTOSHOP_INC || 0), Number(sumObj?.GUARANTEE_INCREASE || 0))
                                                                    // 拿到第二次和第三次的招商底价方法
                                                                    let res: any = handleCalcSecondThirdLowPrice(Number(e || 0), Number(sumObj.GROUP_COST_AUTOSHOP_INC || 0), Number(sumObj.GUARANTEE_INCREASE || 0), Number((firstPrice * 0.9).toFixed(2)))
                                                                    modalRef.current?.setFieldsValue({
                                                                        FIRST_OFFER: firstPrice,
                                                                        SECOND_OFFER: res.secondResult,
                                                                        THIRD_OFFER: res.thirdResult
                                                                    })
                                                                }
                                                            }}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    {/* <Col span={8}>
                                                        <ProFormDigit
                                                            label={'综合楼'}
                                                            name={''}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'加水'}
                                                            name={''}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'汽修站'}
                                                            name={''}
                                                        />
                                                    </Col> */}
                                                    <Divider orientation="left">集团公司成本价格</Divider>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'汽修站'}
                                                            name={'GROUP_COST_AUTOSHOP'}
                                                            fieldProps={{
                                                                onChange: (e: any) => {
                                                                    let sum: number = Number((e * 1.15).toFixed(2))
                                                                    modalRef.current?.setFieldsValue({
                                                                        GROUP_COST_AUTOSHOP_INC: sum
                                                                    })

                                                                    let sumObj: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "GUARANTEE_INCREASE"])
                                                                    // 第一次招商底价
                                                                    let firstPrice: number = Math.max(Number(sumObj?.ORIG_RENT_COMPREHENSIVE || 0), Number(sum || 0), Number(sumObj?.GUARANTEE_INCREASE || 0))
                                                                    // 拿到第二次和第三次的招商底价方法
                                                                    let res: any = handleCalcSecondThirdLowPrice(Number(sumObj.ORIG_RENT_COMPREHENSIVE || 0), Number(sum || 0), Number(sumObj.GUARANTEE_INCREASE || 0), Number((firstPrice * 0.9).toFixed(2)))
                                                                    modalRef.current?.setFieldsValue({
                                                                        FIRST_OFFER: firstPrice,
                                                                        SECOND_OFFER: res.secondResult,
                                                                        THIRD_OFFER: res.thirdResult
                                                                    })
                                                                }
                                                            }}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'汽修站递增'}
                                                            name={'GROUP_COST_AUTOSHOP_INC'}
                                                            fieldProps={{
                                                                onChange: (e: any) => {
                                                                    let sumObj: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "GUARANTEE_INCREASE"])
                                                                    // 第一次招商底价
                                                                    let firstPrice: number = Math.max(Number(sumObj?.ORIG_RENT_COMPREHENSIVE || 0), Number(e || 0), Number(sumObj?.GUARANTEE_INCREASE || 0))
                                                                    // 拿到第二次和第三次的招商底价方法
                                                                    let res: any = handleCalcSecondThirdLowPrice(Number(sumObj.ORIG_RENT_COMPREHENSIVE || 0), Number(e || 0), Number(sumObj.GUARANTEE_INCREASE || 0), Number((firstPrice * 0.9).toFixed(2)))
                                                                    modalRef.current?.setFieldsValue({
                                                                        FIRST_OFFER: firstPrice,
                                                                        SECOND_OFFER: res.secondResult,
                                                                        THIRD_OFFER: res.thirdResult
                                                                    })
                                                                }
                                                            }}
                                                            readonly={currentRow}

                                                        />
                                                    </Col>
                                                    <Divider orientation="left">第三方评估测算年保底收益（元）</Divider>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'保底收益'}
                                                            name={'GUARANTEE_TOTAL'}
                                                            fieldProps={{
                                                                onChange: (e) => {
                                                                    let fromRes: any = Number(selectFormData?.SERVERPART_TYPE)
                                                                    let rate: number = 1.05
                                                                    if (fromRes === 1000 || fromRes === 2000) {
                                                                        rate = 1.15
                                                                    } else if (fromRes === 3000) {
                                                                        rate = 1.1
                                                                    } else if (fromRes === 4000) {
                                                                        rate = 1.05
                                                                    }
                                                                    let sumAdd: number = Number(((e || 0) * rate * 1.15).toFixed(2))
                                                                    modalRef.current?.setFieldsValue({
                                                                        GUARANTEE_INCREASE: sumAdd
                                                                    })

                                                                    let sumObj: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "GROUP_COST_AUTOSHOP_INC"])
                                                                    // 第一次招商底价
                                                                    let firstPrice: number = Math.max(Number(sumObj?.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj?.GROUP_COST_AUTOSHOP_INC || 0), Number(sumAdd || 0))
                                                                    // 拿到第二次和第三次的招商底价方法
                                                                    let res: any = handleCalcSecondThirdLowPrice(Number(sumObj.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj?.GROUP_COST_AUTOSHOP_INC || 0), Number(sumAdd || 0), Number((firstPrice * 0.9).toFixed(2)))
                                                                    modalRef.current?.setFieldsValue({
                                                                        FIRST_OFFER: firstPrice,
                                                                        SECOND_OFFER: res.secondResult,
                                                                        THIRD_OFFER: res.thirdResult
                                                                    })
                                                                }
                                                            }}

                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'保底收益递增'}
                                                            name={'GUARANTEE_INCREASE'}
                                                            fieldProps={{
                                                                onChange: (e: any) => {
                                                                    let sumObj: any = modalRef.current?.getFieldsValue(["ORIG_RENT_COMPREHENSIVE", "GROUP_COST_AUTOSHOP_INC"])
                                                                    // 第一次招商底价
                                                                    let firstPrice: number = Math.max(Number(sumObj?.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj?.GROUP_COST_AUTOSHOP_INC || 0), Number(e || 0))
                                                                    // 拿到第二次和第三次的招商底价方法
                                                                    let res: any = handleCalcSecondThirdLowPrice(Number(sumObj.ORIG_RENT_COMPREHENSIVE || 0), Number(sumObj?.GROUP_COST_AUTOSHOP_INC || 0), Number(e || 0), Number((firstPrice * 0.9).toFixed(2)))
                                                                    modalRef.current?.setFieldsValue({
                                                                        FIRST_OFFER: firstPrice,
                                                                        SECOND_OFFER: res.secondResult,
                                                                        THIRD_OFFER: res.thirdResult
                                                                    })
                                                                }
                                                            }}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormText
                                                            label={'捆绑方式'}
                                                            name={'BUNDLE_METHOD'}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>

                                                    <Divider orientation="left">招商底价（元）</Divider>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'今年首次'}
                                                            name={'FIRST_OFFER'}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'今年二次'}
                                                            name={'SECOND_OFFER'}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'今年三次'}
                                                            name={'THIRD_OFFER'}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Divider orientation="left">测算结果</Divider>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'总物业费用（元）'}
                                                            name={'TOTAL_PROPERTY_FEE'}
                                                            fieldProps={{
                                                                onChange: (e: any) => {
                                                                    let sumObj: any = modalRef.current?.getFieldsValue(["AREA_AUTOSHOP", "AREA_BUILDING_COMPREHENSIVE"])

                                                                    let repairPropertySum: number = sumObj?.AREA_BUILDING_COMPREHENSIVE ? Number((Number(e || 0) / Number(sumObj?.AREA_BUILDING_COMPREHENSIVE || 0) * 0.1 * Number(sumObj?.AREA_AUTOSHOP || 0)).toFixed(2)) : 0
                                                                    modalRef.current?.setFieldsValue({
                                                                        AUTOSHOP_PROPERTY_FEE: repairPropertySum,
                                                                    })

                                                                }
                                                            }}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'综合楼面积（m²）'}
                                                            name={'AREA_BUILDING_COMPREHENSIVE'}
                                                            fieldProps={{
                                                                onChange: (e: any) => {
                                                                    let sumObj: any = modalRef.current?.getFieldsValue(["AREA_AUTOSHOP", "TOTAL_PROPERTY_FEE"])

                                                                    let repairPropertySum: number = e ? Number((Number(sumObj?.TOTAL_PROPERTY_FEE || 0) / Number(e || 0) * 0.1 * Number(sumObj?.AREA_AUTOSHOP || 0)).toFixed(2)) : 0
                                                                    modalRef.current?.setFieldsValue({
                                                                        AUTOSHOP_PROPERTY_FEE: repairPropertySum,
                                                                    })

                                                                }
                                                            }}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'汽修物业费（元）'}
                                                            name={'AUTOSHOP_PROPERTY_FEE'}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'合作期限'}
                                                            name={'COOPERATION_YEARS'}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDatePicker
                                                            label={'首次招商启动时间'}
                                                            width={'100%'}
                                                            name={'FIRSTSTART_DATE'}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                    <Col span={8}>
                                                        <ProFormDigit
                                                            label={'评估费'}
                                                            name={'EVALUATION_FEE'}
                                                            readonly={currentRow}
                                                        />
                                                    </Col>
                                                </> :
                                                <></>
                            }
                        </Row>
                    </ProForm>
                </div>
            </Modal>

        </div >)
}

export default connect(({ user }: ConnectState) => ({
    currentUser: user.data
}))(RentCalculation);