// 新增商品审批
import { connect } from "umi";
import type { CurrentUser } from "umi";
import type { ConnectState } from "@/models/connect";
import React, { useEffect, useRef, useState } from "react";
import type { FormInstance } from "antd";
import { Button, Card, Col, message, Modal, Popconfirm, Row, Space, Spin, Steps, Tooltip, Tree } from "antd";
import type { ActionType } from "@ant-design/pro-table";
import ProTable from "@ant-design/pro-table";
import PageTitleBox from "@/components/PageTitleBox";
import { handleGetExamineList } from "@/pages/examine/examineList/service";
import ProForm, { ProFormDateTimePicker, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect } from "@ant-design/pro-form";
import { getServerpartTree } from "@/services/options";
import { handleGetAPPROVALROUTEList } from "@/pages/Setting/serviceConfig/service";
import { handleGetNestingCOMMODITYTYPETree, handleGetServerpartShopTrade } from "../commodityInfo/service";
import { handleGetUSERDEFINEDTYPEList } from "../userDefinedType/service";
import useRequest from "@ahooksjs/use-request";
import moment from 'moment'
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleDeleteCOMMODITY_RUNNING, handleDeleteCommodityProInst, handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleReapplyCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
import './style.less'


const { Step } = Steps
const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props) => {
    const { currentUser } = props
    const downloadBtnRef = useRef<any>()
    const actionRef = useRef<ActionType>();
    const formRef = useRef<FormInstance>();
    const modalFormRef = useRef<FormInstance>();
    const modalShopFormRef = useRef<FormInstance>();
    const modalApproveFormRef = useRef<FormInstance>();

    // 新增商品申请
    const [showApplyFor, setShowApplyFor] = useState<boolean>(false);
    // 显示新增商品的悬浮框
    const [showAddShopModal, setShowAddShopModal] = useState<boolean>(false);
    // 选择记录行的数据
    const [currentRow, setCurrentRow] = useState<any>()
    // 选择商品行的数据
    const [currentShopRow, setCurrentShopRow] = useState<any>()
    // 商品列表数据
    const [shopData, setShopData] = useState<any>()
    const [selectSERVERPARTID, setSelectSERVERPARTID] = useState<any>()
    // 商品业态的搜索框内容
    const [commodityList, setCommodityList] = useState<any>([])
    const [selectBUSINESSTYPE, setSelectBUSINESSTYPE] = useState<any>()
    const [customClassList, setCustomClassList] = useState<any>()
    const [treeView, setTreeView] = useState<any>()
    // 审批的悬浮框
    const [approveModal, setApproveModal] = useState<boolean>(false);
    // 点击审批的行数据
    const [approveCurrentRow, setApproveCurrentRow] = useState<any>()
    // 下一个审批流程
    const [nextApproval, setNextApproval] = useState<any>()
    // 下一审批流程的审批人
    const [nextApprovalPerson, setNextApprovalPerson] = useState<any>()
    // 新增申请的加载效果
    const [addApprovalLoading, setAddApprovalLoading] = useState<boolean>(false);
    // 审批还是驳回 1 审批  2 驳回
    const [ApprovalType, setApprovaType] = useState<number>(0)
    // 审批记录详情
    const [BUSINESSAPPROVALDETAIL, setBUSINESSAPPROVALDETAIL] = useState<any>()
    // 还有几个环节 拼在流程进度后面
    const [nextStepsList, setNextStepsList] = useState<any>()
    // 判断有无发起申请的权限
    const [InitiateApplication, setInitiateApplication] = useState<boolean>(false)
    // 显示类型
    const [showDetailType, setShowDetailType] = useState<any>()
    // 加载服务区树
    const { loading: treeLoading, data: treeViews } = useRequest(async () => {
        const req = {
            PROVINCE_CODE: currentUser?.ProvinceCode,
            COMMODITYTYPE_VALID: 1,
            ShowCode: true
        }
        const data = await handleGetNestingCOMMODITYTYPETree(req)
        setTreeView(data)
        return data
    })

    let statusList: string[] = ["0", "1000", "2000", "2010,2020,2030,2040,2050,2060,2070,2080,2090", "9000"]
    const columns: any = [
        {
            dataIndex: 'BusinessProcess_StateSearch',
            title: '流程状态',
            width: 200,
            ellipsis: true,
            align: 'center',
            hideInTable: true,
            // valueEnum: {
            //     "0": "全部",
            //     "2000": "待审核",
            //     "2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
            //     "9000": "已审结"
            // },
            valueEnum: {
                0: "全部",
                1: "待申请",
                2: "待审核",
                3: "审核中",
                4: "已审结"
            },
            initialValue: "0"
        },
        {
            dataIndex: 'BusinessProcess_Name',
            title: '业务名称',
            width: 300,
            ellipsis: true,
            align: 'center',
            hideInSearch: true,
        },
        {
            dataIndex: 'Serverpart_Name',
            title: '服务区名称',
            width: 200,
            ellipsis: true,
            align: 'center',
            hideInSearch: true,
        },
        {
            dataIndex: 'ServerpartShop_Name',
            title: '门店名称',
            width: 200,
            ellipsis: true,
            align: 'center',
            hideInSearch: true,
        },
        {
            dataIndex: 'ApproveStaff_Name',
            title: '待审核人',
            width: 200,
            ellipsis: true,
            align: 'center',
            hideInSearch: true,
        },
        {
            dataIndex: 'BusinessProcess_StateText',
            title: '待审核环节',
            width: 200,
            ellipsis: true,
            align: 'center',
            hideInSearch: true,
            render: (_, record) => {
                return <a style={{
                    color: record?.BusinessProcess_StateText === '待审核' ? '#1890ff' :
                        record?.BusinessProcess_StateText === '审核中' ? 'rgb(250, 173, 20)' :
                            record?.BusinessProcess_StateText === '已审结' ? 'red' : ""
                }} onClick={() => {
                    console.log('recordrecordrecord', record);
                    setShowDetailType('detail')
                    setCurrentRow(record)
                    setShowApplyFor(true)
                }}>{record?.BusinessProcess_StateText || "-"}</a>
            }
        },
        // {
        //     dataIndex: 'Accept_Code',
        //     title: '业务类别',
        //     width: 200,
        //     ellipsis: true,
        //     align: 'center',
        //     hideInSearch: true,
        // },
        {
            dataIndex: 'BusinessProcess_EndDate',
            title: '办结时间',
            width: 200,
            ellipsis: true,
            align: 'center',
            hideInSearch: true,
        },
        {
            dataIndex: 'BusinessProcess_StartDate',
            title: '流程开始',
            width: 200,
            ellipsis: true,
            align: 'center',
            hideInSearch: true,
        },
        {
            dataIndex: 'option',
            title: '操作',
            valueType: 'option',
            align: 'center',
            hideInSearch: true,
            width: 180,
            fixed: "right",
            ellipsis: true,
            render: (_, record) => {
                return (
                    record?.ApproveStaff_ID === currentUser?.ID && record?.BusinessProcess_State !== 9000
                        ?
                        <Space>
                            {
                                record?.BusinessProcess_State === 1000
                                    ?
                                    <>
                                        <a onClick={() => {
                                            console.log('recordrecordrecord', record);

                                            setCurrentRow(record)
                                            setShowApplyFor(true)
                                        }}
                                        >
                                            编辑
                                        </a>
                                        <Popconfirm
                                            title="确认删除该商品审批流程吗?"
                                            onConfirm={async () => {
                                                const req: any = {
                                                    businessApprovalId: record?.BusinessApproval_ID,
                                                    UserId: currentUser?.ID
                                                }
                                                const data = await handleDeleteCommodityProInst(req)
                                                if (data.Result_Code === 100) {
                                                    message.success(data.Result_Desc)
                                                    actionRef.current?.reload()
                                                } else {
                                                    message.error(data.Result_Desc)
                                                }
                                            }}
                                        >
                                            <a>删除</a>
                                        </Popconfirm>
                                    </>
                                    : ""
                            }
                            {
                                record?.BusinessProcess_State > 1000 ?
                                    <>
                                        <a onClick={() => {
                                            setApprovaType(1)
                                            setCurrentRow(record)
                                            // setApproveCurrentRow(record)
                                            // setApproveModal(true)
                                            setShowApplyFor(true)
                                        }}
                                        >
                                            审批
                                        </a>
                                        <a onClick={() => {
                                            setApprovaType(2)
                                            setCurrentRow(record)
                                            // setApproveCurrentRow(record)
                                            // setApproveModal(true)
                                            setShowApplyFor(true)
                                        }}>
                                            驳回
                                        </a>
                                    </> : ""
                            }
                        </Space> : ""

                );
            },
        },
    ]

    const modalColumns: any = [
        {
            title: "序号",
            width: 70,
            dataIndex: "index",
            valueType: "index",
            align: 'center',
            ellipsis: true,
        },
        {
            title: "名称",
            width: 300,
            dataIndex: "COMMODITY_NAME",
            ellipsis: true,
            align: 'center',
        },
        {
            title: "条码",
            width: 150,
            dataIndex: "COMMODITY_BARCODE",
            ellipsis: true,
            align: 'center',
        },
        {
            title: "零售价",
            width: 150,
            dataIndex: "COMMODITY_RETAILPRICE",
            ellipsis: true,
            align: 'center',
        },
        {
            title: "规格",
            width: 150,
            dataIndex: "COMMODITY_RULE",
            ellipsis: true,
            align: 'center',
        },
        {
            title: "单位",
            width: 150,
            dataIndex: "COMMODITY_UNIT",
            ellipsis: true,
            align: 'center',
        },
        {
            dataIndex: 'option',
            title: '操作',
            valueType: 'option',
            align: 'center',
            hideInSearch: true,
            width: 120,
            fixed: "right",
            ellipsis: true,
            render: (_, record) => {
                return (
                    <Space>
                        {
                            currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' :
                                <>
                                    <a
                                        onClick={() => {
                                            setCurrentShopRow(record)
                                            setShowAddShopModal(true)
                                        }}
                                    >
                                        编辑
                                    </a>
                                    <Popconfirm
                                        title="确认删除该商品管理列表信息吗?"
                                        onConfirm={async () => {
                                            if (currentRow?.BusinessApproval_ID) {
                                                // 申请回到发起时候的真删
                                                const req: any = {
                                                    COMMODITY_RUNNINGId: record?.COMMODITY_ID
                                                }
                                                const data = await handleDeleteCOMMODITY_RUNNING(req)
                                                console.log('datadatadatadata', data);
                                                actionRef.current?.reload()
                                                // 实现直接删除的效果
                                                let oldData: any = JSON.parse(JSON.stringify(shopData))
                                                let list: any = []
                                                oldData.forEach((item: any) => {
                                                    if (item.COMMODITY_ID !== record?.COMMODITY_ID) {
                                                        list.push(item)
                                                    }
                                                })
                                                setShopData(list)
                                            } else {
                                                // 还未发起申请的假删
                                                console.log('record', record);
                                                let oldData: any = JSON.parse(JSON.stringify(shopData))
                                                let list: any = []
                                                oldData.forEach((item: any) => {
                                                    if (item.ADDTIME !== record?.ADDTIME) {
                                                        list.push(item)
                                                    }
                                                })
                                                setShopData(list)
                                            }
                                        }}
                                    >
                                        <a>删除</a>
                                    </Popconfirm>
                                </>
                        }

                        {
                            currentRow?.BusinessProcess_State === 9000 ?
                                <a onClick={() => {
                                    setCurrentShopRow(record)
                                    setShowAddShopModal(true)
                                }}>详情</a>
                                : ''
                        }

                    </Space>
                );
            },
        },
    ]

    // 拿到对应的商品业态
    const handleGetCommodity = async (id: any) => {
        const req: any = {
            ProvinceCode: currentUser?.ProvinceCode,
            ServerpartId: id
        }
        const data = await handleGetServerpartShopTrade(req)
        console.log('data', data)
        setCommodityList(data)
    }

    // 请求自定义类的选择列表
    const handleGetCustomClassList = async (id: any) => {
        const req: any = {
            SearchParameter: {
                USERDEFINEDTYPE_STATE: 1,
                SERVERPART_ID: id,
                BUSINESSTYPE: selectBUSINESSTYPE
            },
            PageIndex: 1,
            PageSize: 999999,
            pageSize: 999999,
        }
        const data = await handleGetUSERDEFINEDTYPEList(req)
        if (data && data.length > 0) {
            const list: any = []
            data.forEach((item: any) => {
                list.push({ label: item.USERDEFINEDTYPE_NAME, value: item.USERDEFINEDTYPE_ID })
            })
            setCustomClassList(list)
        }
        console.log('data', data)
    }


    useEffect(async () => {
        const req: any = {
            SearchParameter: {
                APPROVALROUTE_STATES: "",
                APPROVALROUTE_VALID: 1,
                OPERATION_TYPES: "100100",
            }
        }
        const data = await handleGetAPPROVALROUTEList(req)
        console.log('datadatadatadata', data);
        // 拿到发起申请的人
        let firstSetp: any = {}
        if (data && data.length > 0) {
            data.forEach((item: any) => {
                if (item.APPROVALROUTE_STATE === 1000) {
                    firstSetp = item
                }
            })
        }
        // 判断当前用户 是否有新增权限
        let have: boolean = false
        let idList: any = firstSetp.APPROVALSTAFF_ID.split(',')
        console.log('idList', idList);

        if (idList.indexOf(currentUser?.ID.toString()) !== -1) {
            have = true
        }
        setInitiateApplication(have)

    }, [])

    return (
        <div>
            <div style={{ backgroundColor: '#fff', display: 'flex' }}>
                <div style={{
                    width: '100%',
                    paddingTop: 0,
                    paddingBottom: 0,
                    paddingRight: 0
                }}>
                    <ProTable
                        actionRef={actionRef}
                        formRef={formRef}
                        columns={columns}
                        bordered
                        expandable={{
                            expandRowByClick: true
                        }}
                        scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
                        headerTitle={<PageTitleBox props={props} />} // 列表表头
                        search={{ span: 6 }}
                        request={async (params) => {
                            const req: any = {
                                QueryType: 0,
                                SearchParameter: {
                                    Operation_Type: 6,
                                    Accept_Code: "6-100100",
                                    BusinessProcess_StateSearch: statusList[params?.BusinessProcess_StateSearch] === "0" ? '' : statusList[params?.BusinessProcess_StateSearch]
                                },
                                PageIndex: 1,
                                PageSize: 999999
                            }
                            const data = await handleGetExamineList(req)
                            console.log('data', data)
                            if (data.data && data.data.length > 0) {
                                data.data.forEach((item: any) => {
                                    if (item.BusinessProcess_State === 1000) {
                                        item.BusinessProcess_StateText = "待发起"
                                    } else if (item.BusinessProcess_State === 2000) {
                                        item.BusinessProcess_StateText = "待审核"
                                    } else if (item.BusinessProcess_State > 2000 && item.BusinessProcess_State < 9000) {
                                        item.BusinessProcess_StateText = "审核中"
                                    } else if (item.BusinessProcess_State = 9000) {
                                        item.BusinessProcess_StateText = "已审结"
                                    }
                                })


                                return { data: data.data, success: true, total: data.data.length }
                            }
                            return { data: [], success: true }
                        }}
                        toolbar={{
                            actions: [
                                InitiateApplication ?
                                    <Button type={"primary"} onClick={() => {
                                        setShowApplyFor(true)
                                    }}>
                                        新增商品申请
                                    </Button> : ""
                            ]
                        }}
                    />
                </div>
            </div>

            {/* 审批的悬浮框 */}
            {/* <Modal
                width={"70%"}
                title={"审批"}
                open={approveModal}
                confirmLoading={addApprovalLoading}
                destroyOnClose
                onCancel={() => {
                    setApproveCurrentRow(undefined)
                    setApproveModal(false)
                    setApprovaType(0)
                }}
                onOk={() => {
                    modalApproveFormRef?.current?.validateFields().then(() => {
                        modalApproveFormRef?.current?.submit()
                    })
                }}
            >
                <ProForm
                    // layout={'horizontal'}
                    formRef={modalApproveFormRef}
                    submitter={false}
                    preserve={false}
                    request={async () => {
                        console.log('approveCurrentRowapproveCurrentRowapproveCurrentRow', approveCurrentRow);
                        const reqState: any = {
                            SearchParameter: {
                                APPROVALROUTE_STATES: "",
                                APPROVALROUTE_VALID: 1,
                                OPERATION_TYPES: "100100",
                            },
                            PageIndex: 1,
                            PageSize: 999999
                        }
                        const dataState = await handleGetAPPROVALROUTEList(reqState)
                        console.log('dataStatedataStatedataState', dataState);
                        let obj: any = {}
                        let currentIndex: number = 0
                        if (dataState && dataState.length > 0) {
                            dataState.forEach((item: any, index: number) => {
                                if (item.APPROVALROUTE_STATE === approveCurrentRow.BusinessProcess_State) {
                                    obj = item
                                    currentIndex = index
                                }
                            })
                        }
                        if (obj) {
                            // 审批的时候 拿到当前状态 去找下一个状态  
                            if (ApprovalType === 1) {
                                // 拿到当前状态的信息 判断下一状态 是不是结束了 结束了 就不显示 下一结算审批人   不是结束 就拿到下一流程的审批人
                                setNextApproval(obj.NEXT_STATE)
                                let nextObj: any = currentIndex + 1 <= dataState.length ? dataState[currentIndex + 1] : {}
                                if (nextObj) {
                                    let personTotal: number = nextObj.APPROVALSTAFF_ID.split(',').length || 0
                                    if (personTotal > 0) {
                                        let STAFFIDList: number[] = nextObj.APPROVALSTAFF_ID.split(',')
                                        let STAFFNAMEList: string[] = nextObj.APPROVALSTAFF_NAME.split(',')
                                        let list: any = []
                                        for (let i = 0; i < personTotal; i++) {
                                            list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] })
                                        }
                                        setNextApprovalPerson(list)
                                    }
                                }
                            } else {
                                // 驳回的话 去找历史状态
                                if (dataState && dataState.length > 0) {
                                    let list: any = []
                                    dataState.forEach((item: any, index: number) => {
                                        if (obj.APPROVALROUTE_STATE > item.APPROVALROUTE_STATE) {
                                            list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE })
                                        }
                                    })
                                    setNextApprovalPerson(list)
                                }

                            }

                        }
                        return {}
                    }}
                    onFinish={async (res) => {
                        setAddApprovalLoading(true)
                        let data: any = {}

                        if (ApprovalType === 1) {
                            // 审批
                            const req: any = {
                                businessApprovalId: approveCurrentRow?.BusinessApproval_ID,
                                UserId: currentUser?.ID,
                                ApproveInfo: res.ApproveInfo,
                                nextApproveStaffId: res.nextApproveStaffId || "",
                                nextApproveState: nextApproval || ""
                            }

                            data = await handleApproveCommodityProInst(req)
                        } else {
                            // 驳回
                            const req: any = {
                                businessApprovalId: approveCurrentRow?.BusinessApproval_ID,
                                UserId: currentUser?.ID,
                                RejectInfo: res.ApproveInfo,
                                nextApproveState: res.nextApproveState || ""
                            }
                            console.log('reqreqreqreq', req);

                            data = await handleRejectCommodityProInst(req)
                        }
                        setAddApprovalLoading(false)
                        console.log('datadatadata', data);
                        if (data.Result_Code === 100) {
                            message.success(data.Result_Desc)
                            setApproveCurrentRow(undefined)
                            setApproveModal(false)
                            setNextApproval(null)
                            setNextApprovalPerson(null)
                            setApprovaType(0)
                            actionRef.current?.reload()
                        } else {
                            message.error(data.Result_Desc)
                        }

                    }}
                >
                    {
                        ApprovalType === 1 ?
                            <Row>
                                {
                                    nextApproval === 9000 ? '' :
                                        <Col span={6}>
                                            <ProFormSelect
                                                label={"下一阶段审批人"}
                                                name={"nextApproveStaffId"}
                                                options={nextApprovalPerson}
                                                rules={[
                                                    {
                                                        required: true,
                                                        message: "请选择下一阶段审批人！"
                                                    }
                                                ]}
                                            />
                                        </Col>

                                }
                                <Col span={24}>
                                    <ProFormTextArea
                                        label={"审批意见"}
                                        name={"ApproveInfo"}
                                        rules={[
                                            {
                                                required: true,
                                                message: "请输入审批意见！"
                                            }
                                        ]}
                                    />
                                </Col>
                            </Row> : ApprovalType === 2 ?
                                <Row>
                                    <Col span={6}>
                                        <ProFormSelect
                                            label={"驳回状态"}
                                            name={"nextApproveState"}
                                            options={nextApprovalPerson}
                                            rules={[
                                                {
                                                    required: true,
                                                    message: "请选择下一阶段审批人！"
                                                }
                                            ]}
                                        />
                                    </Col>

                                    <Col span={24}>
                                        <ProFormTextArea
                                            label={"驳回意见"}
                                            name={"ApproveInfo"}
                                            rules={[
                                                {
                                                    required: true,
                                                    message: "请输入驳回意见！"
                                                }
                                            ]}
                                        />
                                    </Col>
                                </Row> : ""
                    }
                </ProForm>
            </Modal> */}

            {/* 新增申请的悬浮框 */}
            <Modal
                className="addProductModal"
                width={"70%"}
                title={currentRow?.BusinessApproval_ID ? "商品申请详情" : "新增商品申请"}
                open={showApplyFor}
                destroyOnClose
                onCancel={() => {
                    setShowApplyFor(false)
                    setCurrentRow(undefined)
                    setShopData([])
                    setBUSINESSAPPROVALDETAIL(undefined)
                    setShowDetailType(null)


                    setApprovaType(0)
                }}
                footer={showDetailType === 'detail' || !InitiateApplication || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? false :
                    <div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'flex-end', boxSizing: 'border-box', padding: "0 16px" }}>
                        <Button style={{ marginRight: '8px' }} onClick={() => {
                            setShowApplyFor(false)
                            setCurrentRow(undefined)
                            setShopData([])
                            setBUSINESSAPPROVALDETAIL(undefined)
                            setShowDetailType(null)


                            setApprovaType(0)
                        }}>取消</Button>

                        <Button type={"primary"} onClick={() => {
                            if (currentRow?.BusinessProcess_State > 1000) {
                                modalApproveFormRef?.current?.validateFields().then(() => {
                                    modalApproveFormRef?.current?.submit()
                                })
                            } else {
                                modalFormRef?.current?.validateFields().then(() => {
                                    modalFormRef?.current?.submit()
                                })
                            }
                        }}>确认</Button>
                    </div>}
                onOk={() => {
                    if (currentRow?.BusinessProcess_State > 1000) {
                        modalApproveFormRef?.current?.validateFields().then(() => {
                            modalApproveFormRef?.current?.submit()
                        })
                    } else {
                        modalFormRef?.current?.validateFields().then(() => {
                            modalFormRef?.current?.submit()
                        })
                    }
                }}
            >
                <ProForm
                    // layout={'horizontal'}
                    formRef={modalFormRef}
                    submitter={false}
                    preserve={false}
                    request={async () => {
                        if (currentRow?.BusinessApproval_ID) {
                            const req: any = {
                                BUSINESSAPPROVALId: currentRow?.BusinessApproval_ID,
                            }
                            const data = await handleGetBUSINESSAPPROVALDetail(req)
                            console.log('datadatadata', data);
                            setBUSINESSAPPROVALDETAIL(data.Result_Data)

                            let shopData: any = []

                            if (currentRow?.BusinessProcess_State === 9000) {
                                shopData = await handleGetApprovalCommodityList({
                                    ProvinceCode: currentUser?.ProvinceCode,
                                    // CommodityId: currentUser?.ProvinceCode,
                                    BusinessApprovalId: currentRow?.BusinessApproval_ID,
                                    PageIndex: 1,
                                    PageSize: 999999,
                                })
                            } else {
                                shopData = await handleGetCOMMODITYRUNNINGList({
                                    SearchParameter: {
                                        BUSINESSAPPROVAL_ID: currentRow?.BusinessApproval_ID,
                                    },
                                    PageIndex: 1,
                                    pageSize: 999999,
                                })
                            }


                            console.log('shopDatashopDatashopDatashopData', shopData);
                            setShopData(shopData.Result_Data.List)
                            return {
                                reasonForApplication: data.Result_Data.BUSINESSAPPROVAL_DESC,
                                ServerpartId: data.Result_Data.SERVERPART_ID,
                                NextApproveStaffId: data.Result_Data.APPOVED_IDS
                            }
                        } else {
                            return {}
                        }
                    }}
                    onFinish={async (res) => {
                        let data: any = {}
                        if (currentRow?.BusinessApproval_ID) {
                            const req: any = {
                                ProinstId: currentRow?.BusinessApproval_ID,
                                ProinstName: res.reasonForApplication,
                                UserId: currentUser?.ID,
                                OperateType: "100100",
                                ServerpartId: res.ServerpartId,
                                NextApproveStaffId: res.NextApproveStaffId,
                                NextApproveState: 2000,
                                CommodityRunningList: shopData
                            }
                            data = await handleReapplyCommodityProInst(req)
                        } else {
                            const req: any = {
                                ProinstName: res.reasonForApplication,
                                UserId: currentUser?.ID,
                                OperateType: "100100",
                                ServerpartId: res.ServerpartId,
                                NextApproveStaffId: res.NextApproveStaffId,
                                NextApproveState: 2000,
                                CommodityRunningList: shopData
                            }
                            data = await handleCreateCommodityProInst(req)
                            console.log('dsaidjaskda', data);
                        }
                        if (data.Result_Code === 100) {
                            message.success(data.Result_Desc)
                            // setShowApplyFor(false)
                            // setCurrentRow(undefined)
                            setShowApplyFor(false)
                            setCurrentRow(undefined)
                            setShopData([])
                            setBUSINESSAPPROVALDETAIL(undefined)
                            setShowDetailType(null)
                            setApprovaType(0)
                            actionRef.current?.reload()

                        } else {
                            message.error(data.Result_Desc)
                        }



                    }}
                >
                    <Row gutter={8}>
                        <Col span={24}>
                            <ProFormTextArea
                                label="申请原因"
                                name="reasonForApplication"
                                rules={[{
                                    required: true,
                                    message: "请输入申请原因！"
                                }]}
                                disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
                            />
                        </Col>
                        <Col span={12}>
                            <ProFormSelect
                                label="服务区"
                                name="ServerpartId"
                                rules={[{
                                    required: true,
                                    message: "请选择服务区！"
                                }]}
                                request={async () => {
                                    const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
                                    const list: any = []
                                    if (data && data.length > 0) {
                                        data.forEach((item: any) => {
                                            if (item.children && item.children.length > 0) {
                                                item.children.forEach((subItem: any) => {
                                                    list.push({ label: subItem.label, value: subItem.value })
                                                })
                                            }
                                        })
                                        data.forEach((item: any) => {
                                            list.push({ label: item.label, value: item.value })
                                        })
                                    }
                                    return list
                                }}
                                disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
                            />
                        </Col>
                        <Col span={12} style={{ display: currentRow?.BusinessProcess_State > 1000 && ApprovalType !== 0 ? "none" : "" }}>
                            <ProFormSelect
                                label="下一环节审批人"
                                name="NextApproveStaffId"
                                rules={[{
                                    required: true,
                                    message: "请选择下一环节审批人！"
                                }]}
                                request={async () => {
                                    const reqState: any = {
                                        SearchParameter: {
                                            APPROVALROUTE_STATES: "",
                                            APPROVALROUTE_VALID: 1,
                                            OPERATION_TYPES: "100100",
                                        },
                                        PageIndex: 1,
                                        PageSize: 999999
                                    }
                                    const dataState = await handleGetAPPROVALROUTEList(reqState)
                                    if (dataState && dataState.length > 0) {
                                        let obj: any = {}
                                        // 下面的环节
                                        let nextList: any = []
                                        console.log('dataState', dataState);

                                        dataState.forEach((item: any) => {
                                            if (item.APPROVALROUTE_STATE === 2000) {
                                                obj = item
                                            }
                                            if (item.APPROVALROUTE_STATE >= currentRow?.BusinessProcess_State) {
                                                if (item.APPROVALROUTE_STATE === currentRow?.BusinessProcess_State) {
                                                    item.status = "process"
                                                }
                                                nextList.push(item)
                                            }
                                        })
                                        setNextStepsList(nextList)
                                        console.log('next', nextList);

                                        let personTotal: number = obj.APPROVALSTAFF_ID.split(',').length || 0
                                        if (personTotal > 0) {
                                            let STAFFIDList: number[] = obj.APPROVALSTAFF_ID.split(',')
                                            let STAFFNAMEList: string[] = obj.APPROVALSTAFF_NAME.split(',')
                                            let list: any = []
                                            for (let i = 0; i < personTotal; i++) {
                                                list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] })
                                            }
                                            return list
                                        }
                                    }
                                }}
                                disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
                            />
                        </Col>
                    </Row>

                </ProForm>
                {
                    currentRow?.BusinessProcess_State > 1000 ?
                        <ProForm
                            // layout={'horizontal'}
                            formRef={modalApproveFormRef}
                            submitter={false}
                            preserve={false}
                            request={async () => {
                                console.log('approveCurrentRowapproveCurrentRowapproveCurrentRow', approveCurrentRow);
                                const reqState: any = {
                                    SearchParameter: {
                                        APPROVALROUTE_STATES: "",
                                        APPROVALROUTE_VALID: 1,
                                        OPERATION_TYPES: "100100",
                                    },
                                    PageIndex: 1,
                                    PageSize: 999999
                                }
                                const dataState = await handleGetAPPROVALROUTEList(reqState)
                                console.log('dataStatedataStatedataState', dataState);
                                let obj: any = {}
                                let currentIndex: number = 0
                                if (dataState && dataState.length > 0) {
                                    dataState.forEach((item: any, index: number) => {
                                        if (item.APPROVALROUTE_STATE === currentRow.BusinessProcess_State) {
                                            obj = item
                                            currentIndex = index
                                        }
                                    })
                                }
                                if (obj) {
                                    // 审批的时候 拿到当前状态 去找下一个状态  
                                    if (ApprovalType === 1) {
                                        // 拿到当前状态的信息 判断下一状态 是不是结束了 结束了 就不显示 下一结算审批人   不是结束 就拿到下一流程的审批人
                                        setNextApproval(obj.NEXT_STATE)
                                        let nextObj: any = currentIndex + 1 <= dataState.length ? dataState[currentIndex + 1] : {}
                                        if (nextObj) {
                                            let personTotal: number = nextObj.APPROVALSTAFF_ID.split(',').length || 0
                                            if (personTotal > 0) {
                                                let STAFFIDList: number[] = nextObj.APPROVALSTAFF_ID.split(',')
                                                let STAFFNAMEList: string[] = nextObj.APPROVALSTAFF_NAME.split(',')
                                                let list: any = []
                                                for (let i = 0; i < personTotal; i++) {
                                                    list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] })
                                                }
                                                setNextApprovalPerson(list)
                                            }
                                        }
                                    } else {
                                        // 驳回的话 去找历史状态
                                        if (dataState && dataState.length > 0) {
                                            let list: any = []
                                            dataState.forEach((item: any, index: number) => {
                                                if (obj.APPROVALROUTE_STATE > item.APPROVALROUTE_STATE) {
                                                    list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE })
                                                }
                                            })
                                            setNextApprovalPerson(list)
                                        }

                                    }

                                }
                                return {}
                            }}
                            onFinish={async (res) => {
                                setAddApprovalLoading(true)
                                let data: any = {}

                                if (ApprovalType === 1) {
                                    // 审批
                                    const req: any = {
                                        businessApprovalId: currentRow?.BusinessApproval_ID,
                                        UserId: currentUser?.ID,
                                        ApproveInfo: res.ApproveInfo,
                                        nextApproveStaffId: res.nextApproveStaffId || "",
                                        nextApproveState: nextApproval || ""
                                    }

                                    data = await handleApproveCommodityProInst(req)
                                } else {
                                    // 驳回
                                    const req: any = {
                                        businessApprovalId: currentRow?.BusinessApproval_ID,
                                        UserId: currentUser?.ID,
                                        RejectInfo: res.ApproveInfo,
                                        nextApproveState: res.nextApproveState || ""
                                    }
                                    console.log('reqreqreqreq', req);

                                    data = await handleRejectCommodityProInst(req)
                                }
                                setAddApprovalLoading(false)
                                console.log('datadatadata', data);
                                if (data.Result_Code === 100) {
                                    message.success(data.Result_Desc)

                                    setShowApplyFor(false)
                                    setCurrentRow(undefined)
                                    setShopData([])
                                    setBUSINESSAPPROVALDETAIL(undefined)
                                    setShowDetailType(null)


                                    // setApproveCurrentRow(undefined)
                                    // setApproveModal(false)
                                    setNextApproval(null)
                                    setNextApprovalPerson(null)
                                    setApprovaType(0)
                                    actionRef.current?.reload()
                                } else {
                                    message.error(data.Result_Desc)
                                }

                            }}
                        >
                            {
                                ApprovalType === 1 ?
                                    <Row>
                                        {
                                            nextApproval === 9000 ? '' :
                                                <Col span={6}>
                                                    <ProFormSelect
                                                        label={"下一阶段审批人"}
                                                        name={"nextApproveStaffId"}
                                                        options={nextApprovalPerson}
                                                        rules={[
                                                            {
                                                                required: true,
                                                                message: "请选择下一阶段审批人！"
                                                            }
                                                        ]}
                                                    />
                                                </Col>

                                        }
                                        <Col span={24}>
                                            <ProFormTextArea
                                                label={"审批意见"}
                                                name={"ApproveInfo"}
                                                rules={[
                                                    {
                                                        required: true,
                                                        message: "请输入审批意见！"
                                                    }
                                                ]}
                                            />
                                        </Col>
                                    </Row> : ApprovalType === 2 ?
                                        <Row>
                                            <Col span={6}>
                                                <ProFormSelect
                                                    label={"驳回状态"}
                                                    name={"nextApproveState"}
                                                    options={nextApprovalPerson}
                                                    rules={[
                                                        {
                                                            required: true,
                                                            message: "请选择下一阶段审批人！"
                                                        }
                                                    ]}
                                                />
                                            </Col>

                                            <Col span={24}>
                                                <ProFormTextArea
                                                    label={"驳回意见"}
                                                    name={"ApproveInfo"}
                                                    rules={[
                                                        {
                                                            required: true,
                                                            message: "请输入驳回意见！"
                                                        }
                                                    ]}
                                                />
                                            </Col>
                                        </Row> : ""
                            }
                        </ProForm> : ""
                }

                <ProTable
                    search={false}
                    options={false}
                    pagination={false}
                    columns={modalColumns}
                    dataSource={shopData}
                    bordered
                    toolbar={{
                        actions: [
                            currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : <Button type={"primary"} onClick={() => {
                                setShowAddShopModal(true)
                            }}>
                                新增商品
                            </Button>
                        ]
                    }}
                />

                {
                    currentRow?.BusinessProcess_State > 1000 ?
                        <Card title="流程进度" bordered className="ProcessProgress">
                            <div style={{ width: '100%' }} className="ProcessProgressBox">
                                <Steps
                                    size="small"
                                    className="multi-line-steps"
                                    direction="horizontal"
                                    progressDot={false}
                                    current={BUSINESSAPPROVALDETAIL?.approveList && BUSINESSAPPROVALDETAIL?.approveList.length ? BUSINESSAPPROVALDETAIL?.approveList.length : 0}
                                >
                                    {/* <Step
                                        style={{ minWidth: 180, maxWidth: 220 }}
                                        status={currentRow?.BusinessProcess_State > 1000 ? 'finish' : 'wait'}
                                        title="发起申请"
                                        description={
                                            <div>
                                                <Tooltip title={`${currentRow?.Staff_Name || ''}${currentRow?.BusinessProcess_Desc ? `：${currentRow?.BusinessProcess_Desc}` : ''}`}>
                                                    <p>{`${currentRow?.BusinessProcess_StartDate || ''}`}</p>
                                                </Tooltip>
                                            </div>
                                        }
                                    /> */}
                                    {
                                        BUSINESSAPPROVALDETAIL?.approveList && BUSINESSAPPROVALDETAIL?.approveList.length > 0 ?
                                            BUSINESSAPPROVALDETAIL?.approveList.map((item: any, index: number) => (
                                                <Step
                                                    key={index}
                                                    style={{ minWidth: 180, maxWidth: 220 }}
                                                    status={"finish"}
                                                    title={item.APPROVED_NAME}
                                                    description={
                                                        <div>
                                                            <Tooltip title={`${item.STAFF_NAME || ''}${item.APPLYAPPROVE_INFO ? `：${item.APPLYAPPROVE_INFO}` : ''}`}>
                                                                <p>{`${item.APPLYAPPROVE_DATE || ''}`}</p>
                                                            </Tooltip>
                                                        </div>}
                                                />
                                            )) : ''
                                    }

                                    {
                                        nextStepsList && nextStepsList.length > 0 ?
                                            nextStepsList.map((item: any, index: number) => (
                                                <Step
                                                    key={index}
                                                    style={{ minWidth: 180, maxWidth: 220 }}
                                                    status={item.status === 'process' ? 'process' : 'wait'}
                                                    title={item.APPROVALROUTE_NAME}
                                                />
                                            )) : ''
                                    }
                                </Steps>
                            </div>
                        </Card>
                        : ''
                }
            </Modal>

            {/* 新增商品的悬浮框 */}
            <Modal
                open={showAddShopModal}
                width={1200}
                wrapClassName={'shopModal'}
                destroyOnClose
                title={currentShopRow?.COMMODITY_ID ? '编辑商品' : '添加商品'}
                onOk={() => {
                    modalShopFormRef.current?.validateFields().then(async (res: any) => {
                        let oldData: any = shopData && shopData.length > 0 ? JSON.parse(JSON.stringify(shopData)) : []

                        console.log('oldDataoldDataoldData', oldData);
                        console.log('resresresresresres', res);

                        let newList: any = []
                        // 判断当前的里面有没有一样的
                        if (oldData && oldData.length > 0) {
                            let same: boolean = false
                            oldData.forEach((item: any, index: number) => {
                                if (item.ADDTIME === res.ADDTIME) {
                                    same = true
                                    newList.push({
                                        ...item,
                                        ...res
                                    })
                                } else {
                                    newList.push(item)
                                }
                            })
                            if (!same) {
                                newList.push(res)
                            }

                        } else {
                            newList.push(res)
                        }
                        console.log('newList', newList);


                        setShopData(newList)
                        setShowAddShopModal(false)
                        setCommodityList([])
                        setCustomClassList([])
                        setCurrentShopRow(undefined)
                    })
                }}
                onCancel={() => {
                    setShowAddShopModal(false)
                    setCommodityList([])
                    setCustomClassList([])
                    setCurrentShopRow(undefined)
                }}
            >

                <ProForm
                    formRef={modalShopFormRef}
                    submitter={false}
                    initialValues={currentShopRow}
                    request={async () => {
                        // !currentShopRow?.COMMODITY_ID && 
                        if (currentShopRow?.SERVERPART_ID) {
                            await handleGetCommodity(currentShopRow?.SERVERPART_ID)
                        }
                        return { ...currentShopRow, BUSINESSTYPE: currentShopRow?.BUSINESSTYPE.toString() }
                    }}
                    disabled={currentRow?.BusinessProcess_State === 9000}
                >
                    <div className={'modalTitle'}>商品基本信息</div>
                    <Row gutter={16}>
                        <Col span={16}>
                            <ProFormText
                                name="COMMODITY_NAME"
                                label="商品名称"
                                placeholder="请输入商品名称"
                                rules={[
                                    {
                                        required: true,
                                        message: '请输入商品名称',
                                    },
                                ]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormText
                                name="COMMODITY_EN"
                                label="拼音简码"
                            />
                        </Col>

                        <Col span={8}>
                            <ProFormSelect
                                name="SERVERPART_ID"
                                label="服务区名"
                                request={async () => {
                                    const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
                                    const list: any = []
                                    if (data && data.length > 0) {
                                        data.forEach((item: any) => {
                                            if (item.children && item.children.length > 0) {
                                                item.children.forEach((subItem: any) => {
                                                    list.push({ label: subItem.label, value: subItem.value })
                                                })
                                            }
                                        })
                                        data.forEach((item: any) => {
                                            list.push({ label: item.label, value: item.value })
                                        })
                                    }
                                    return list
                                }}
                                rules={[
                                    {
                                        required: true,
                                        message: '请选择服务区',
                                    },
                                ]}
                                fieldProps={{
                                    onChange: async (e: any) => {
                                        console.log('e', e)
                                        if (e) {
                                            setSelectSERVERPARTID(e)
                                            await handleGetCommodity(e)
                                            if (selectBUSINESSTYPE) {
                                                await handleGetCustomClassList(e)
                                            }
                                        } else {
                                            setSelectSERVERPARTID(undefined)
                                            setCommodityList([])
                                            setCustomClassList([])
                                        }
                                    }
                                }}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormSelect
                                name="BUSINESSTYPE"
                                label="商品业态"
                                rules={[
                                    {
                                        required: true,
                                        message: '请选择商品业态',
                                    },
                                ]}
                                options={commodityList}
                                fieldProps={{
                                    onChange: async (e: any) => {
                                        if (e) {
                                            setSelectBUSINESSTYPE(e)
                                            if (selectSERVERPARTID) {
                                                await handleGetCustomClassList(e)
                                            }
                                        } else {
                                            setSelectBUSINESSTYPE(undefined)
                                        }
                                    }
                                }}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormTreeSelect
                                name="COMMODITY_TYPE"
                                label="商品类别"
                                rules={[
                                    {
                                        required: true,
                                        message: '请选择商品类别',
                                    },
                                ]}
                                request={() => {
                                    return treeView
                                }}
                                fieldProps={{
                                    treeDefaultExpandAll: true
                                }}
                            />
                        </Col>

                        <Col span={8}>
                            <ProFormText
                                name="COMMODITY_BARCODE"
                                label="商品条码"
                                disabled={currentRow}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormText
                                name="COMMODITY_UNIT"
                                label="商品单位"
                                rules={[
                                    {
                                        required: true,
                                        message: '请输入商品单位',
                                    },
                                ]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormText
                                name="COMMODITY_RULE"
                                label="商品规格"
                                rules={[
                                    {
                                        required: true,
                                        message: '请输入商品规格',
                                    },
                                ]}
                            />
                        </Col>

                        <Col span={8}>
                            <ProFormText
                                name="COMMODITY_HOTKEY"
                                label="快捷键值"
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormSelect
                                name="COMMODITY_GRADE"
                                label="质量等级"
                                rules={[
                                    {
                                        required: true,
                                        message: '请选择质量等级',
                                    },
                                ]}
                                initialValue={1000}
                                options={[{ label: '一等品', value: 1000 }, { label: '二等品', value: 2000 }, { label: '三等品', value: 5000 }, { label: '优等品', value: 3000 }, { label: '合格品', value: 4000 },]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormText
                                name="COMMODITY_ORI"
                                label="商品产地"
                                rules={[
                                    {
                                        required: true,
                                        message: '请输入商品产地',
                                    },
                                ]}
                            />
                        </Col>

                        <Col span={8}>
                            <ProFormSelect
                                name="USERDEFINEDTYPE_ID"
                                label="自定义类"
                                options={customClassList}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormText
                                name="PROVINCE_CODE"
                                label="省份编码"
                                disabled
                            // initialValue={currentUser?.ProvinceCode}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormText
                                name="COMMODITY_CODE"
                                label="商品编码"
                                disabled
                            />
                        </Col>

                        <Col span={24}>
                            <ProFormTextArea
                                name="COMMODITY_DESC"
                                label="商品说明"
                            />
                        </Col>
                    </Row>
                    <div className={'modalTitle'}>商品状态信息</div>
                    <Row gutter={16}>
                        <Col span={8}>
                            <ProFormSelect
                                name="CANSALE"
                                label="是否销售"
                                rules={[
                                    {
                                        required: true,
                                        message: '请选择是否销售',
                                    },
                                ]}
                                initialValue={1}
                                options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormSelect
                                name="ISBULK"
                                label="是否散装"
                                rules={[
                                    {
                                        required: true,
                                        message: '请选择是否散装',
                                    },
                                ]}
                                initialValue={0}
                                options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormSelect
                                name="METERINGMETHOD"
                                label="称重方式"
                                rules={[
                                    {
                                        required: true,
                                        message: '请选择称重方式',
                                    },
                                ]}
                                initialValue={1}
                                options={[{ label: '计价', value: 1 }, { label: '散装称重', value: 0 }]}
                            />
                        </Col>


                        <Col span={8}>
                            <ProFormSelect
                                name="COMMODITY_STATE"
                                label="审核状态"
                                rules={[
                                    {
                                        required: true,
                                        message: '请选择审核状态',
                                    },
                                ]}
                                initialValue={1}
                                options={[{ label: '有效', value: 1 }, { label: '审核中', value: 2 }, { label: '无效', value: 0 }]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormText
                                name="ADDTIME"
                                label="添加时间"
                                disabled
                                initialValue={moment().format('YYYY-MM-DD HH:mm:ss')}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormDateTimePicker
                                name="OPERATE_DATE"
                                label="生效时间"
                                initialValue={moment().format('YYYY-MM-DD HH:mm:ss')}
                            />
                        </Col>
                    </Row>
                    <div className={'modalTitle'}>商品价格信息</div>
                    <Row gutter={16}>
                        <Col span={8}>
                            <ProFormDigit
                                name="COMMODITY_RETAILPRICE"
                                label="零售价"
                                rules={[
                                    {
                                        required: true,
                                        message: '请输入零售价',
                                    },
                                ]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormDigit
                                name="COMMODITY_CURRPRICE"
                                label="当前价格"
                                rules={[
                                    {
                                        required: true,
                                        message: '请输入当前价格',
                                    },
                                ]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormDigit
                                name="COMMODITY_MEMBERPRICE"
                                label="会员价"
                            />
                        </Col>

                        <Col span={8}>
                            <ProFormDigit
                                name="COMMODITY_PURCHASEPRICE"
                                label="进货价"
                                rules={[
                                    {
                                        required: true,
                                        message: '请输入进货价',
                                    },
                                ]}
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormDigit
                                name="COMMODITY_MINPRICE"
                                label="最低价"
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormDigit
                                name="COMMODITY_MAXPRICE"
                                label="最高价"
                            />
                        </Col>
                    </Row>
                    <div className={'modalTitle'}>商品进销信息</div>
                    <Row gutter={16}>
                        <Col span={8}>
                            <ProFormDigit
                                name="DUTY_PARAGRAPH"
                                label="进价税率"
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormDigit
                                name="RETAIL_DUTY"
                                label="零售税率"
                            />
                        </Col>
                        <Col span={8}>
                            <ProFormSelect
                                name="COMMODITY_FROZENCOUNT"
                                label="采购状态"
                                options={[{ label: '允许', value: 1000 }, { label: '禁止', value: 2000 }]}
                            />
                        </Col>
                    </Row>
                </ProForm>
            </Modal>
        </div >
    )
}

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