From 0771f7dd3f95efbd9f48014ddd6ebe148277d9dd Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Wed, 9 Jul 2025 21:31:17 +0800 Subject: [PATCH] update --- src/layouts/BasicLayout.tsx | 17 +- .../MerchantInformation/index.tsx | 273 ++- .../travelMember/MallOrderManage/index.tsx | 390 +++- .../travelMember/MallOrderManage/style.less | 106 ++ .../OrderAfterSalesManage/index.tsx | 563 +++++- .../OrderAfterSalesManage/style.less | 106 ++ .../travelMember/OrderProductManage/index.tsx | 480 ++++- .../component/LeftSelectMallType.tsx | 31 +- .../ProductListingManagement/index.tsx | 580 +++++- .../ShoppingMallProductSearch/index.tsx | 1620 ++++++++++++++++- .../components/serverpartInfo.tsx | 1160 ++++++------ .../travelMember/serverpartInfo/index.tsx | 2 +- src/pages/travelMember/service.ts | 79 +- src/services/options/index.ts | 23 + src/services/options/typings.d.ts | 10 +- 15 files changed, 4618 insertions(+), 822 deletions(-) create mode 100644 src/pages/travelMember/MallOrderManage/style.less create mode 100644 src/pages/travelMember/OrderAfterSalesManage/style.less diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index b8790d1..211128b 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -29,7 +29,7 @@ import IconFont from '@/components/IconFont'; import type { CurrentUser } from '@/models/user' import session from '@/utils/session'; import upMenu from '@/assets/tab/upMenu.svg' -import { getFieldEnum, getFieldEnumTree, getFieldGetFieEnumList, getTravelFieldEnumTree } from "@/services/options"; +import { getFieldEnum, getFieldEnumTree, getFieldGetFieEnumList, getTravelFieldEnumTree, handleGetFieldEnumTreeTravel } from "@/services/options"; import { handleGetServerpartTree } from '@/pages/basicManage/serverpartAssets/service'; @@ -205,6 +205,21 @@ const BasicLayout: React.FC = (props) => { // 拿到所有枚举的方法 const handleGetAllFieldEnum = async () => { + // 云南门店业态 + handleGetFieldEnumTreeTravel({ FieldExplainField: 'BUSINESS_TRADE', FieldEnumStatus: false }).then((BUSINESSTRADEYN: any) => { + if (BUSINESSTRADEYN && BUSINESSTRADEYN.length > 0) { + const obj: any = {} + const list: any = [] + BUSINESSTRADEYN.forEach((item: any) => { + list.push({ label: item.label, value: item.value }) + obj[item.value] = item.label + }) + session.set('BUSINESSTRADEYNList', list); + session.set('BUSINESSTRADEYNObj', obj); + session.set('BUSINESSTRADEYNTree', BUSINESSTRADEYN); + } + }) + // 景区状态 getFieldEnumTree({ FieldExplainField: 'BUSINESSSTATE' }).then((BUSINESSSTATE: any) => { if (BUSINESSSTATE && BUSINESSSTATE.length > 0) { diff --git a/src/pages/operatingMerchants/MerchantInformation/index.tsx b/src/pages/operatingMerchants/MerchantInformation/index.tsx index 448337f..fce6658 100644 --- a/src/pages/operatingMerchants/MerchantInformation/index.tsx +++ b/src/pages/operatingMerchants/MerchantInformation/index.tsx @@ -9,7 +9,7 @@ import Draggable from 'react-draggable'; import SubMenu from "antd/lib/menu/SubMenu"; import ProTable from '@ant-design/pro-table'; import ProDescriptions from '@ant-design/pro-descriptions'; -import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from '@ant-design/pro-form'; +import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton } from '@ant-design/pro-form'; import { MenuFoldOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons'; import { PageContainer } from '@ant-design/pro-layout'; import { Button, Col, Drawer, message, Row, Popconfirm, Space, Image, Modal, Form, Switch, Upload, Tooltip, Descriptions, TreeSelect, Divider, Tabs, Select, Input, Tree } from 'antd'; @@ -23,7 +23,7 @@ import { handleDeleteSERVERPARTSELLER, handleGetMEMBERADDRESSList, handleGetRela import LeftSelectTree from '@/pages/reports/settlementAccount/component/leftSelectTree'; import session from '@/utils/session'; import PageTitleBox from '@/components/PageTitleBox'; -import { handeGetCOMMENTList, handeGetPictureList } from '@/pages/travelMember/service'; +import { handeGetCOMMENTList, handeGetPictureList, handeGetRevenueReport } from '@/pages/travelMember/service'; import { deletePicture, uploadPicture } from '@/services/picture'; const beforeUpload = (file: any) => { @@ -73,10 +73,16 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = const [DoorImageList, setDoorImageList] = useState([]) // 内景图片列表 const [InteriorImage, setInteriorImageList] = useState([]) + // 营收的加载效果 + const [revenueLoading, setRevenueLoading] = useState(false) let SHOPTRADEObj = session.get('SHOPTRADEObj') let SHOPTRADEList = session.get('SHOPTRADEList') + // 云南 门店业态 + let BUSINESSTRADEYNTree = session.get('BUSINESSTRADEYNTree') + console.log('BUSINESSTRADEYNTree', BUSINESSTRADEYNTree); + let shopregionObj = session.get('shopregionObj') let businessStateObj = session.get('businessStateObj') let SERVERPARTTree = session.get('SERVERPARTTree') @@ -108,6 +114,14 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = }); }; // 拖动结束 + const formatTreeData = (data: any) => { + return data.map((item: any) => ({ + ...item, + value: String(item.value), // 数字转字符串 + children: item.children ? formatTreeData(item.children) : undefined, + })); + }; + // 定义列表字段内容 const columns: any = [ @@ -127,13 +141,16 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = title: '经营业态', align: 'center', width: 120, - valueType: 'select', + valueType: 'treeSelect', ellipsis: true, - valueEnum: SHOPTRADEObj, fieldProps: { - showSearch: true, - filterOption: (input, option) => - (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + treeData: formatTreeData(BUSINESSTRADEYNTree), // 设置树形数据源 + showSearch: true, // 启用搜索 + treeNodeFilterProp: 'label', // 按 label 过滤 + treeDefaultExpandAll: true, + filterTreeNode: (input: any, treeNode: any) => { + return String(treeNode.label).toLowerCase().includes(input.toLowerCase()); + }, }, }, { @@ -706,6 +723,49 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = setImageCommentPreviewVisible(val) } + // 获取营收数据 + const handleGetRevenueData = async () => { + const req: any = { + DataType: 1, + DataSourceType: 1, + ServerpartIds: currentRow?.SERVERPART_ID || "", + ServerpartShopIds: currentRow?.SERVERPARTSHOP_IDS || "", + StartDate: moment().subtract(1, 'M').startOf('M').format('YYYY-MM-DD'), + EndDate: moment().subtract(1, 'M').endOf('M').format('YYYY-MM-DD'), + } + setRevenueLoading(true) + console.log('req', req); + + const data = await handeGetRevenueReport(req) + setRevenueLoading(false) + console.log('datadata', data); + if (data && data.length > 0) { + let obj: any = data[0] + + formRef.current?.setFieldsValue({ + MONTHLYSALES: obj.TotalRevenue.Ticket_Count || "0", + CASHPAY: obj.TotalRevenue.Revenue_Amount || "0", + PERCAPITA: obj.TotalRevenue.Ticket_Count ? (obj.TotalRevenue.Revenue_Amount / obj.TotalRevenue.Ticket_Count).toFixed(2) : "0", + }) + + } + } + + + const processTreeData = (data: any) => { + return data.map((item: any) => { + if (item.children && item.children.length > 0) { + return { + ...item, + disabled: true, // 有子节点的节点禁用 + children: processTreeData(item.children) + }; + } + return item; + }); + }; + + return (
@@ -723,7 +783,7 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = return `${record?.SERVERPARTSELLER_ID}` }} bordered - formRef={formRef} + // formRef={formRef} headerTitle={} // 列表表头 actionRef={actionRef} search={{ span: 6, labelWidth: 'auto' }} @@ -960,7 +1020,9 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = - +
:
} @@ -994,79 +1056,117 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = let list2: any = [] let list3: any = [] - if (currentRow?.SELLER_ID) { - let req: any = { - TableId: currentRow?.SELLER_ID, - // TableName: '', - TableType: "1204", - ImageType: "1000", - } - const MerchantLogoData = await handeGetPictureList(req) - - if (MerchantLogoData.List && MerchantLogoData.List.length > 0) { - if (MerchantLogoData.List && MerchantLogoData.List.length > 0) { - MerchantLogoData.List.forEach((item: any) => { - let obj = JSON.parse(JSON.stringify(item)) - obj.url = obj.ImageUrl - obj.name = obj.ImageName - obj.uid = item.ImageId - obj.status = 'done' - list1.push(obj) - }) - } - - setMerchantLogoList(list1); - } - - let req2: any = { - TableId: currentRow?.SELLER_ID, - // TableName: '', - TableType: "1204", - ImageType: "2000", - } - const DoorImageData = await handeGetPictureList(req2) - if (DoorImageData.List && DoorImageData.List.length > 0) { - if (DoorImageData.List && DoorImageData.List.length > 0) { - DoorImageData.List.forEach((item: any) => { - let obj = JSON.parse(JSON.stringify(item)) - obj.url = obj.ImageUrl - obj.name = obj.ImageName - obj.uid = item.ImageId - obj.status = 'done' - list2.push(obj) - }) - } - - setDoorImageList(list2); - } - let req3: any = { - TableId: currentRow?.SELLER_ID, - // TableName: '', - TableType: "1204", - ImageType: "3000", - } - const InteriorImageData = await handeGetPictureList(req3) - if (InteriorImageData.List && InteriorImageData.List.length > 0) { - if (InteriorImageData.List && InteriorImageData.List.length > 0) { - InteriorImageData.List.forEach((item: any) => { - let obj = JSON.parse(JSON.stringify(item)) - obj.url = obj.ImageUrl - obj.name = obj.ImageName - obj.uid = item.ImageId - obj.status = 'done' - list3.push(obj) - }) - } - - setInteriorImageList(list3); - } + if (currentRow?.IconList && currentRow?.IconList.length > 0) { + currentRow?.IconList.forEach((item: any) => { + let obj = JSON.parse(JSON.stringify(item)) + obj.url = obj.ImageUrl + obj.name = obj.ImageName + obj.uid = item.ImageId + obj.status = 'done' + list1.push(obj) + }) } + setMerchantLogoList(list1); + + if (currentRow?.DoorImgList && currentRow?.DoorImgList.length > 0) { + currentRow?.DoorImgList.forEach((item: any) => { + let obj = JSON.parse(JSON.stringify(item)) + obj.url = obj.ImageUrl + obj.name = obj.ImageName + obj.uid = item.ImageId + obj.status = 'done' + list2.push(obj) + }) + } + setDoorImageList(list2); + + if (currentRow?.InsideImgList && currentRow?.InsideImgList.length > 0) { + currentRow?.InsideImgList.forEach((item: any) => { + let obj = JSON.parse(JSON.stringify(item)) + obj.url = obj.ImageUrl + obj.name = obj.ImageName + obj.uid = item.ImageId + obj.status = 'done' + list3.push(obj) + }) + } + setInteriorImageList(list3); + + + // if (currentRow?.SELLER_ID) { + // let req: any = { + // TableId: currentRow?.SELLER_ID, + // // TableName: '', + // TableType: "1204", + // ImageType: "1000", + // } + // const MerchantLogoData = await handeGetPictureList(req) + + // if (MerchantLogoData.List && MerchantLogoData.List.length > 0) { + // if (MerchantLogoData.List && MerchantLogoData.List.length > 0) { + // MerchantLogoData.List.forEach((item: any) => { + // let obj = JSON.parse(JSON.stringify(item)) + // obj.url = obj.ImageUrl + // obj.name = obj.ImageName + // obj.uid = item.ImageId + // obj.status = 'done' + // list1.push(obj) + // }) + // } + + // setMerchantLogoList(list1); + // } + + // let req2: any = { + // TableId: currentRow?.SELLER_ID, + // // TableName: '', + // TableType: "1204", + // ImageType: "2000", + // } + // const DoorImageData = await handeGetPictureList(req2) + // if (DoorImageData.List && DoorImageData.List.length > 0) { + // if (DoorImageData.List && DoorImageData.List.length > 0) { + // DoorImageData.List.forEach((item: any) => { + // let obj = JSON.parse(JSON.stringify(item)) + // obj.url = obj.ImageUrl + // obj.name = obj.ImageName + // obj.uid = item.ImageId + // obj.status = 'done' + // list2.push(obj) + // }) + // } + + // setDoorImageList(list2); + // } + // let req3: any = { + // TableId: currentRow?.SELLER_ID, + // // TableName: '', + // TableType: "1204", + // ImageType: "3000", + // } + // const InteriorImageData = await handeGetPictureList(req3) + // if (InteriorImageData.List && InteriorImageData.List.length > 0) { + // if (InteriorImageData.List && InteriorImageData.List.length > 0) { + // InteriorImageData.List.forEach((item: any) => { + // let obj = JSON.parse(JSON.stringify(item)) + // obj.url = obj.ImageUrl + // obj.name = obj.ImageName + // obj.uid = item.ImageId + // obj.status = 'done' + // list3.push(obj) + // }) + // } + + // setInteriorImageList(list3); + // } + // } return { ...data, - MerchantLogo: list1, - DoorImage: list2, - InteriorImage: list3, + SHOPTRADE: currentRow?.SHOPTRADE ? Number(currentRow?.SHOPTRADE) : "", + // MerchantLogo: list1, + // DoorImage: list2, + // InteriorImage: list3, } // if (currentRow?.SELLER_ID) { // const data = await handleGetSERVERPARTSELLERDetail({ SERVERPARTSELLERId: currentRow?.SELLER_ID }) @@ -1114,10 +1214,17 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = /> - { + return processTreeData(BUSINESSTRADEYNTree) + }} + fieldProps={{ + treeDefaultExpandAll: true, // 默认展开所有节点 + showSearch: true, // 可选:添加搜索功能 + treeNodeFilterProp: 'label', // 可选:按标签搜索 + }} rules={[ { required: true, @@ -1393,9 +1500,6 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = /> - - -
@@ -1407,6 +1511,9 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = columns={commentColumns} style={{ display: selectTab === '2' ? 'block' : 'none' }} request={async () => { + if (!currentRow?.SELLER_ID) { + return { data: [], success: true } + } const req: any = { searchParameter: { MERCHANTS_ID: currentRow?.SELLER_ID diff --git a/src/pages/travelMember/MallOrderManage/index.tsx b/src/pages/travelMember/MallOrderManage/index.tsx index fdc8487..52600fd 100644 --- a/src/pages/travelMember/MallOrderManage/index.tsx +++ b/src/pages/travelMember/MallOrderManage/index.tsx @@ -1,23 +1,50 @@ -// 商城订单管理 +// 商城订单管理 import { connect } from "umi"; import type { CurrentUser } from "umi"; import type { ConnectState } from "@/models/connect"; import React, { useRef, useState } from "react"; -import type { FormInstance } from "antd"; +import { Col, Modal, Row, type FormInstance } from "antd"; import type { ActionType } from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table"; import PageTitleBox from "@/components/PageTitleBox"; import moment from 'moment' import { handeGetSALEBILLList, handeGetSaleBillWholeList, handeGetSALEDETAILList } from "../service"; +import './style.less' +import Draggable from "react-draggable"; +import ProForm, { ProFormSelect, ProFormText } from "@ant-design/pro-form"; +import orderIcon from '@/assets/detail/orderIcon.png' +import closeIcon from '@/assets/detail/closeIcon.png' const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props + const draggleRef = React.createRef() const actionRef = useRef(); const formRef = useRef(); + const modalRef = useRef(); // 查询的条件 const [searchParams, setSearchParams] = useState() + const [currentRow, setCurrentRow] = useState(); + const [modalVisible, handleModalVisible] = useState(); + const [confirmLoading, handleConfirmLoading] = useState(false) // 弹出框的内容表单是否在提交 + // 弹出框拖动效果 + const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置 + const [disabled, setDraggleDisabled] = useState() // 是否拖动 + + const onDraggaleStart = (event, uiData) => { + const { clientWidth, clientHeight } = window.document.documentElement; + const targetRect = draggleRef.current?.getBoundingClientRect(); + if (!targetRect) { + return; + } + setBounds({ + left: -targetRect.left + uiData.x, + right: clientWidth - (targetRect.right - uiData.x), + top: -targetRect.top + uiData.y, + bottom: clientHeight - (targetRect.bottom - uiData.y), + }); + }; const columns: any = [ { @@ -115,6 +142,21 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { ellipsis: true, align: "center", }, + { + dataIndex: 'SALEBILL_CODE', + title: '订单编号', + align: 'center', + hideInSearch: true, + width: 200, + ellipsis: true, + render: (_, record) => { + return record?.SALEBILL_CODE ? { + console.log('recordrecordrecordrecord', record); + setCurrentRow(record); + handleModalVisible(true) + }}>{record?.SALEBILL_CODE} : "-" + } + }, { title: "购买的商品", dataIndex: "COMMODITY_NAME", @@ -185,14 +227,14 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { return record?.ORDER_DATE ? moment(record?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : "-" } }, - { - title: "订单编号", - dataIndex: "SALEBILL_CODE", - width: 150, - hideInSearch: true, - ellipsis: true, - align: "center", - }, + // { + // title: "订单编号", + // dataIndex: "SALEBILL_CODE", + // width: 150, + // hideInSearch: true, + // ellipsis: true, + // align: "center", + // }, { title: "订单状态", dataIndex: "SALEBILL_STATE", @@ -222,7 +264,65 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { align: "center", } ] + // 订单详情的表格 + const orderDetailColumns: any = [ + { + dataIndex: "index", + title: "序号", + align: 'center', + hideInSearch: true, + valueType: "index", + width: 70, + ellipsis: true, + }, + { + dataIndex: 'COMMODITY_NAME', + title: '商品名称', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'COMMODITY_BARCODE', + title: '商品条码', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'ORDER_COUNT', + title: '数量', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'AVERAGE_PRICE', + title: '单价', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'ORDER_AMOUNT', + title: '金额', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + ] + // 关闭悬浮框 + const handleCloseModal = () => { + handleConfirmLoading(false) + handleModalVisible(false) + setCurrentRow(undefined); + } return (
@@ -276,6 +376,276 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { />
+ + + { + // if (disabled) { + // setDraggleDisabled(false) + // } + // }} + // onMouseOut={() => { + // setDraggleDisabled(true) + // }} + + // onFocus={() => { }} + // onBlur={() => { }} + // > + // {'订单详情'} + // + // } + title={false} + closeIcon={
} + destroyOnClose={true} + width={1200} + visible={modalVisible} + confirmLoading={confirmLoading} + afterClose={() => { + formRef.current?.resetFields(); + setCurrentRow(undefined); + }} + onCancel={() => { + handleConfirmLoading(false) + handleModalVisible(false) + setCurrentRow(undefined); + }} + footer={false} + modalRender={(modal) => { + return onDraggaleStart(event, uiData)} + handle=".bookingOrderModalTop" + > +
{modal}
+
+ }} + > + +
+
+ + 订单详情 +
+
+ { + handleCloseModal() + }} /> +
+
+ +
+
订单信息
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + { + const req: any = { + searchParameter: { + SALEBILL_ID: currentRow?.SALEBILL_ID + }, + PageIndex: 1, + PageSize: 999999, + } + const data = await handeGetSALEDETAILList(req) + console.log('datadatadata', data); + if (data.List && data.List.length > 0) { + return { data: data.List, success: true, total: data.TotalCount } + } + return { data: [], success: true } + }} + summary={() => { + // extra 是 request 返回的 extra 字段 + return ( + + 合计 + + {currentRow?.TOTAL_COUNT || 0} + + {currentRow?.ORDER_AMOUNT?.toFixed(2) || '0.00'} + + ) + }} + /> + +
) } diff --git a/src/pages/travelMember/MallOrderManage/style.less b/src/pages/travelMember/MallOrderManage/style.less new file mode 100644 index 0000000..6050e9f --- /dev/null +++ b/src/pages/travelMember/MallOrderManage/style.less @@ -0,0 +1,106 @@ +.MallOrderManageModal { + .react-draggable { + .ant-modal-content { + border-radius: 16px; + + .ant-modal-body { + padding: 0; + height: 800px; + overflow-y: auto; + overflow: hidden; + + .ant-form { + .bookingOrderModalTop { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + border-bottom: 1px solid #D5D8DE; + box-sizing: border-box; + padding-bottom: 10px; + box-sizing: border-box; + padding: 30px 20px; + + .modalTopLeft { + display: flex; + align-items: center; + + .memberIcon { + width: 18px; + height: 18px; + margin-right: 5px; + } + + .modalTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 18px; + color: rgba(0, 0, 0, 0.85); + line-height: 18px; + text-align: left; + font-style: normal; + } + } + + .modalTopRight { + width: 18px; + height: 18px; + + .memberIcon { + width: 18px; + height: 18px; + cursor: pointer; + } + } + } + + .bookingOrderModalCenter { + width: 100%; + height: 100%; + margin-top: 14px; + box-sizing: border-box; + padding: 0 34px; + + .smallTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 10px; + text-align: left; + font-style: normal; + margin-bottom: 10px; + } + + .smallTitle::after { + content: ""; + width: 2px; + height: 14px; + background-color: #155DFE; + position: relative; + left: -5px; + top: 2px; + } + + + .ant-row { + .memberInfoDetailItem { + .ant-form-item { + margin-bottom: 12px; + } + } + } + + } + + + } + } + + .ant-modal-body::-webkit-scrollbar { + width: 0; + display: none; + } + } + } +} \ No newline at end of file diff --git a/src/pages/travelMember/OrderAfterSalesManage/index.tsx b/src/pages/travelMember/OrderAfterSalesManage/index.tsx index 4fdb933..1a95647 100644 --- a/src/pages/travelMember/OrderAfterSalesManage/index.tsx +++ b/src/pages/travelMember/OrderAfterSalesManage/index.tsx @@ -1,15 +1,568 @@ -// 订单售后管理 -import { ConnectState } from "@/models/connect"; -import { connect, CurrentUser } from "umi"; +// 订单售后管理 售后订单管理 +import { connect } from "umi"; +import type { CurrentUser } from "umi"; +import type { ConnectState } from "@/models/connect"; +import React, { useRef, useState } from "react"; +import { Col, Modal, Row, type FormInstance } from "antd"; +import type { ActionType } from "@ant-design/pro-table"; +import ProTable from "@ant-design/pro-table"; +import PageTitleBox from "@/components/PageTitleBox"; +import moment from 'moment' +import { handeGetSALEBILLList, handeGetSaleBillWholeList, handeGetSALEDETAILList } from "../service"; +import Draggable from "react-draggable"; +import ProForm, { ProFormSelect, ProFormText } from "@ant-design/pro-form"; +import orderIcon from '@/assets/detail/orderIcon.png' +import closeIcon from '@/assets/detail/closeIcon.png' +import './style.less' + + +const OrderAfterSalesManage: React.FC<{ currentUser: CurrentUser }> = (props) => { + const { currentUser } = props + const draggleRef = React.createRef() + const actionRef = useRef(); + const formRef = useRef(); + const modalRef = useRef(); + // 查询的条件 + const [searchParams, setSearchParams] = useState() + const [currentRow, setCurrentRow] = useState(); + const [modalVisible, handleModalVisible] = useState(); + const [confirmLoading, handleConfirmLoading] = useState(false) // 弹出框的内容表单是否在提交 + // 弹出框拖动效果 + const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置 + const [disabled, setDraggleDisabled] = useState() // 是否拖动 + const onDraggaleStart = (event, uiData) => { + const { clientWidth, clientHeight } = window.document.documentElement; + const targetRect = draggleRef.current?.getBoundingClientRect(); + if (!targetRect) { + return; + } + setBounds({ + left: -targetRect.left + uiData.x, + right: clientWidth - (targetRect.right - uiData.x), + top: -targetRect.top + uiData.y, + bottom: clientHeight - (targetRect.bottom - uiData.y), + }); + }; + + + const columns: any = [ + { + title: '查询时间', + dataIndex: 'search_date', + valueType: 'dateRange', + hideInTable: true, + hideInDescriptions: true, + search: { + transform: (value) => { + return { + ORDER_DATE_Start: value[0], + ORDER_DATE_End: value[1], + }; + }, + }, + initialValue: [moment().format('YYYY-MM-DD'), moment().add(-1, 'M').format('YYYY-MM-DD')], + }, + { + title: "订单状态", + dataIndex: "orderStatus", + valueType: "select", + valueEnum: { + "0": "全部", + "8000": "退款申请中", + "8020": "退款申请中", + "8900": "订单已退款", + "9000": "订单已关闭", + }, + initialValue: '8000', + hideInTable: true, + }, + { + title: "序号", + dataIndex: "index", + valueType: "index", + hideInSearch: true, + align: "center", + width: 60, + }, + { + title: "会员名称", + dataIndex: "ORDER_PERSON", + width: 200, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "联系电话", + dataIndex: "ORDER_PERSONTEL", + width: 150, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "订单编号", + dataIndex: "SALEBILL_CODE", + width: 200, + hideInSearch: true, + ellipsis: true, + align: "center", + render: (_, record) => { + return record?.SALEBILL_CODE ? { + setCurrentRow(record); + handleModalVisible(true) + }}> + {record?.SALEBILL_CODE} + : "" + } + }, + { + title: "购买的商品", + dataIndex: "COMMODITY_NAME", + width: 300, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "退款金额", + dataIndex: "ORDER_AMOUNT", + width: 120, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "申请时间", + dataIndex: "ORDER_DATE", + width: 150, + hideInSearch: true, + ellipsis: true, + align: "center", + render: (_, record) => { + return record?.ORDER_DATE ? moment(record?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : "-" + } + }, + { + title: "退款时间", + dataIndex: "RESERVATION_ENDDATE", + width: 120, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "订单状态", + dataIndex: "SALEBILL_STATE", + width: 120, + hideInSearch: true, + ellipsis: true, + valueType: "select", + valueEnum: { + "8000": "退款申请中", + "8020": "退款申请中", + "8900": "订单已退款", + "9000": "订单已关闭", + }, + align: "center", + }, + { + title: "备注说明", + dataIndex: "SALEBILL_DESC", + width: 180, + hideInSearch: true, + ellipsis: true, + align: "center", + } + ] + + // 订单详情的表格 + const orderDetailColumns: any = [ + { + dataIndex: "index", + title: "序号", + align: 'center', + hideInSearch: true, + valueType: "index", + width: 70, + ellipsis: true, + }, + { + dataIndex: 'COMMODITY_NAME', + title: '商品名称', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'COMMODITY_BARCODE', + title: '商品条码', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'ORDER_COUNT', + title: '数量', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'AVERAGE_PRICE', + title: '单价', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'ORDER_AMOUNT', + title: '金额', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + ] + + // 关闭悬浮框 + const handleCloseModal = () => { + handleConfirmLoading(false) + handleModalVisible(false) + setCurrentRow(undefined); + } + -const OrderAfterSalesManage: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { return (
+
+
+ } // 列表表头 + search={{ span: 6 }} + request={async (params) => { + const req = { + SearchParameter: { + OWNERUNIT_ID: currentUser?.OwnerUnitId, + PROVINCE_CODE: currentUser?.ProvinceCode, + // SALEBILL_TYPES: params?.orderType === '0' ? '8000,8020,8900,9000' : params?.orderType, + ORDER_DATE_Start: params?.ORDER_DATE_Start || "", + ORDER_DATE_End: params?.ORDER_DATE_End || "", + SALEBILL_STATES: params?.orderStatus === "0" ? "8000,8020,8900,9000" : params?.orderStatus, + SALEBILL_TYPES: "3999" + // CHANNEL_TYPE: params?.PAY_METHOD === "0" ? "" : params?.PAY_METHOD + }, + PageIndex: 1, + PageSize: 999999, + SortStr: "ORDER_DATE desc", + } + console.log('reqreqreqreqreq', req); + // const data = await handeGetSALEBILLList(req); + const data = await handeGetSaleBillWholeList(req); + console.log('datadatadatadatadata', data); + if (data.List && data.List.length > 0) { + return { data: data.List, success: true, total: data.TotalCount } + } + return { data: [], success: true } + }} + toolbar={{ + }} + /> +
+
+ + + + { + // if (disabled) { + // setDraggleDisabled(false) + // } + // }} + // onMouseOut={() => { + // setDraggleDisabled(true) + // }} + + // onFocus={() => { }} + // onBlur={() => { }} + // > + // {'订单详情'} + //
+ // } + title={false} + closeIcon={
} + destroyOnClose={true} + width={1200} + visible={modalVisible} + confirmLoading={confirmLoading} + afterClose={() => { + formRef.current?.resetFields(); + setCurrentRow(undefined); + }} + onCancel={() => { + handleConfirmLoading(false) + handleModalVisible(false) + setCurrentRow(undefined); + }} + footer={false} + modalRender={(modal) => { + return onDraggaleStart(event, uiData)} + handle=".bookingOrderModalTop" + > +
{modal}
+
+ }} + > + +
+
+ + 订单详情 +
+
+ { + handleCloseModal() + }} /> +
+
+ +
+
订单信息
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + { + const req: any = { + searchParameter: { + SALEBILL_ID: currentRow?.SALEBILL_ID + }, + PageIndex: 1, + PageSize: 999999, + } + const data = await handeGetSALEDETAILList(req) + console.log('datadatadata', data); + if (data.List && data.List.length > 0) { + return { data: data.List, success: true, total: data.TotalCount } + } + return { data: [], success: true } + }} + summary={() => { + // extra 是 request 返回的 extra 字段 + return ( + + 合计 + + {currentRow?.TOTAL_COUNT || 0} + + {currentRow?.ORDER_AMOUNT?.toFixed(2) || '0.00'} + + ) + }} + /> + + ) } export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser -}))(OrderAfterSalesManage); \ No newline at end of file +}))(OrderAfterSalesManage); diff --git a/src/pages/travelMember/OrderAfterSalesManage/style.less b/src/pages/travelMember/OrderAfterSalesManage/style.less new file mode 100644 index 0000000..a936086 --- /dev/null +++ b/src/pages/travelMember/OrderAfterSalesManage/style.less @@ -0,0 +1,106 @@ +.OrderAfterSalesManageModal { + .react-draggable { + .ant-modal-content { + border-radius: 16px; + + .ant-modal-body { + padding: 0; + height: 800px; + overflow-y: auto; + overflow: hidden; + + .ant-form { + .bookingOrderModalTop { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + border-bottom: 1px solid #D5D8DE; + box-sizing: border-box; + padding-bottom: 10px; + box-sizing: border-box; + padding: 30px 20px; + + .modalTopLeft { + display: flex; + align-items: center; + + .memberIcon { + width: 18px; + height: 18px; + margin-right: 5px; + } + + .modalTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 18px; + color: rgba(0, 0, 0, 0.85); + line-height: 18px; + text-align: left; + font-style: normal; + } + } + + .modalTopRight { + width: 18px; + height: 18px; + + .memberIcon { + width: 18px; + height: 18px; + cursor: pointer; + } + } + } + + .bookingOrderModalCenter { + width: 100%; + height: 100%; + margin-top: 14px; + box-sizing: border-box; + padding: 0 34px; + + .smallTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 10px; + text-align: left; + font-style: normal; + margin-bottom: 10px; + } + + .smallTitle::after { + content: ""; + width: 2px; + height: 14px; + background-color: #155DFE; + position: relative; + left: -5px; + top: 2px; + } + + + .ant-row { + .memberInfoDetailItem { + .ant-form-item { + margin-bottom: 12px; + } + } + } + + } + + + } + } + + .ant-modal-body::-webkit-scrollbar { + width: 0; + display: none; + } + } + } +} \ No newline at end of file diff --git a/src/pages/travelMember/OrderProductManage/index.tsx b/src/pages/travelMember/OrderProductManage/index.tsx index eb27a6d..1f38abf 100644 --- a/src/pages/travelMember/OrderProductManage/index.tsx +++ b/src/pages/travelMember/OrderProductManage/index.tsx @@ -1,5 +1,5 @@ // 点餐商品管理 -import React, { useRef, useState, Suspense } from 'react'; +import React, { useRef, useState, Suspense, Children, useEffect } from 'react'; import moment from 'moment'; // 时间相关引用,没有使用可以删除 import numeral from "numeral"; // 数字相关引用,没有使用可以删除 import { connect } from 'umi'; @@ -21,9 +21,9 @@ import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; import type { FormInstance } from 'antd'; import { getFieldEnumTree, getFieldEnumName } from "@/services/options"; // 枚举的引用,没有使用可以删除 -import { handeDeleteCOMMODITY, handeGetCOMMODITYList, handeSynchroCOMMODITY, handlDeleteUSERDEFINEDTYPE, handlGetUSERDEFINEDTYPEList, handlSynchroUSERDEFINEDTYPE } from '../service'; +import { handeDeleteCOMMODITY, handeGetBusinessCommodityList, handeGetCOMMODITYList, handeGetSellerCommodityList, handeSynchroCOMMODITY, handeSyncSellerCommodityInfo, handlDeleteUSERDEFINEDTYPE, handlGetUSERDEFINEDTYPEList, handlSynchroUSERDEFINEDTYPE } from '../service'; import PageTitleBox from '@/components/PageTitleBox'; -import { deletePicture, uploadPicture } from '@/services/picture'; +import { deletePicture, SavePicture, uploadPicture } from '@/services/picture'; import defaultIcon from '../../../assets/brand/defaultIcon.png' import OrderCategoryTree from './components/OrderCategoryTree'; import OrderCategoryManage from '../OrderCategoryManage'; @@ -72,7 +72,14 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( const [selectedId, setSelectedId] = useState() // 显示新增点餐分类的悬浮框 const [showFoodTypeModal, setShowFoodTypeModal] = useState(false) - + // 获取商品的悬浮框 + const [getProducts, setGetProducts] = useState(false) + // 判断是否是第一次进入到页面 + const [isFirst, setIsFirst] = useState(true) + // 选择要上架的商品 + const [selectListShop, setSelectListShop] = useState() + // 点击选择了的商品上架的加载效果 + const [selectListShopLoading, setSelectListShopLoading] = useState(false) const onDraggaleStart = (event, uiData) => { const { clientWidth, clientHeight } = window.document.documentElement; @@ -103,7 +110,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( }; }, }, - initialValue: [moment().format('YYYY-MM-DD'), moment().subtract(1, 'M').format('YYYY-MM-DD')], + // initialValue: [moment().format('YYYY-MM-DD'), moment().subtract(1, 'M').format('YYYY-MM-DD')], }, // { // title: '上级类别', @@ -143,6 +150,8 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( hideInSearch: true, render: (_, record) => { return record?.COMMODITY_NAME ? { + console.log('recordrecordrecord', record); + setCurrentRow(record) setShowDetail(true) }}>{record?.COMMODITY_NAME} : "" @@ -211,7 +220,58 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( hideInSearch: true, } ]; - + // 新增商品的columns + const getProductsColumns: any = [ + { + title: "序号", + width: 70, + dataIndex: "index", + ellipsis: true, + hideInSearch: true, + align: 'center', + valueType: "index" + }, + { + title: "商品名称", + width: 300, + dataIndex: "COMMODITY_NAME", + ellipsis: true, + align: 'center', + hideInSearch: true, + }, + { + title: "商品条码", + width: 200, + dataIndex: "COMMODITY_BARCODE", + ellipsis: true, + align: 'center', + hideInSearch: true, + }, + { + title: "零售价", + width: 150, + dataIndex: "COMMODITY_RETAILPRICE", + ellipsis: true, + align: 'center', + hideInSearch: true, + }, + { + title: "商品单位", + width: 150, + dataIndex: "COMMODITY_UNIT", + ellipsis: true, + align: 'center', + hideInSearch: true, + }, + { + title: "商品规格", + width: 150, + dataIndex: "COMMODITY_RULE", + ellipsis: true, + align: 'center', + hideInSearch: true, + }, + ] // 预览上传后的图片 const handlePreview = async () => { @@ -235,41 +295,115 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( const handleAddUpdate = async (res: any) => { let req: any = {} - if (currentRow?.USERDEFINEDTYPE_ID) { + console.log('resresresresresres', res); + + if (currentRow?.COMMODITY_ID) { req = { ...currentRow, ...res, + MERCHANTS_ID: selectedId, OWNERUNIT_ID: currentUser?.OwnerUnitId, OWNERUNIT_NAME: currentUser?.OwnerUnitName, PROVINCE_CODE: currentUser?.ProvinceCode, - OPERATE_PERSON: currentUser?.ID, - COMMODITY_TYPE: 3000, - OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), + STAFF_ID: currentUser?.ID, + STAFF_NAME: currentUser?.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), } } else { req = { ...res, + MERCHANTS_ID: selectedId, OWNERUNIT_ID: currentUser?.OwnerUnitId, OWNERUNIT_NAME: currentUser?.OwnerUnitName, PROVINCE_CODE: currentUser?.ProvinceCode, - OPERATE_PERSON: currentUser?.ID, - COMMODITY_TYPE: 3000, + STAFF_ID: currentUser?.ID, + STAFF_NAME: currentUser?.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), } } - const data = await handeSynchroCOMMODITY(req) + // const data = await handeSynchroCOMMODITY(req) + if (res.ImageInfo && res.ImageInfo.length > 0) { + let imageData = await handleUploadShopImg(res) + console.log('imageData', imageData); + let imgList: any = imageData.Result_Data + req.ImageInfo = imgList + } + + console.log('reqreqreqreqreq', req); + + + const data = await handeSyncSellerCommodityInfo({ list: [req] }) handleConfirmLoading(false) if (data.Result_Code === 100) { - message.success("新增成功!") + + message.success("同步成功!") setCurrentRow(undefined) formRef?.current?.resetFields() - handleModalVisible(false) + handleConfirmLoading(false) + setShowDetail(false) + setFileList([]) actionRef.current?.reload() } else { message.error(data.Result_Desc) } }; + // 上传商品图片 + const handleUploadShopImg = async (formRes: any) => { + + if (formRes.ImageInfo && formRes.ImageInfo.length > 0) { + const formData = new FormData(); + formRes.ImageInfo.forEach((file: any) => { + formData.append('files[]', file.originFileObj); + formData.append('ImageName', typeof file !== 'string' ? file?.name : ''); + }); + formData.append('imageType', "1000"); + formData.append('TableType', "1207"); + + console.log('formData', formData); + let res = await SavePicture(formData) + return res + } + + } + + // 获取商品类别的树 + const handleGetCOMMODITYTYPE = async () => { + const req = { + OWNERUNIT_ID: currentUser?.OwnerUnitId, + PROVINCE_CODE: "", + GOODSTYPE: 3000, + USERDEFINEDTYPE_STATE: 1 + // SearchKey: "" + } + let data = await handlGetUSERDEFINEDTYPEList(req); + console.log('datadatadatadatadata2', data); + if (data && data.length > 0) { + // data.unshirft({ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }) + + setTypeTreeData(processTreeData(data)) + } else { + setTypeTreeData([]) + } + + } + const processTreeData = (data: any) => { + return data.map((item: any) => { + if (item.children && item.children.length > 0) { + return { + ...item, + disabled: true, // 有子节点的节点禁用 + children: processTreeData(item.children) + }; + } + return item; + }); + }; + useEffect(async () => { + await handleGetCOMMODITYTYPE() + }, []) + return (
@@ -282,8 +416,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( paddingRight: 0 }}> { return `${record?.USERDEFINEDTYPE_PID}-${record?.USERDEFINEDTYPE_ID}` }} @@ -294,6 +427,10 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( bordered // 请求数据 request={async (params, sorter) => { + if (isFirst) { + setIsFirst(false) + return [] + } console.log('selectedIdselectedIdselectedIdselectedIdselectedId', selectedId); @@ -301,12 +438,13 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( searchParameter: { // OWNERUNIT_ID: currentUser?.OwnerUnitId, PROVINCE_CODE: currentUser?.ProvinceCode, + SERVERPART_IDS: params?.SERVERPART_IDS || "", + SELLER_IDS: selectedId || "", + UPPER_STATE: params?.UPPER_STATE === "-1" ? "" : params?.UPPER_STATE, + // USERDEFINEDTYPE_IDS: selectedId, OPERATE_DATE_Start: params?.OPERATE_DATE_Start || "", OPERATE_DATE_End: params?.OPERATE_DATE_End || "", - UPPER_STATE: params?.UPPER_STATE === "-1" ? "" : params?.UPPER_STATE, - SELLER_IDS: selectedId || "", - COMMODITY_TYPE: 3000 }, PageIndex: 1, PageSize: 999999, @@ -314,7 +452,8 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( } console.log('reqreqreqreq', req); - const data = await handeGetCOMMODITYList(req); + const data = await handeGetSellerCommodityList(req); + // const data = await handeGetCOMMODITYList(req); console.log('datadatadatadatadata', data); if (data.List && data.List.length > 0) { return { data: data.List, success: true, total: data.TotalCount } @@ -324,28 +463,38 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( columns={columns} toolbar={{ actions: [ - + selectedId ? + <> + + < Button type={"primary"} onClick={() => { + setShowDetail(true) + }}>新增商品 + + : "", + ], }} />
{/* 图片预览组件 */} - {fileList && fileList.length > 0 &&
- { - handleChangePreview(vis) + { + fileList && fileList.length > 0 &&
+ { + handleChangePreview(vis) + } + }}> + { + fileList.map((n) => ) } - }}> - { - fileList.map((n) => ) - } - -
} +
+
+ } = ( handleConfirmLoading(false) setShowDetail(false) setCurrentRow(undefined) + setFileList([]) }} onOk={async () => { // 提交框内的数据 @@ -412,23 +562,48 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( autoFocusFirstInput submitter={false} preserve={false} - initialValues={currentRow ? { - ...currentRow, - OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), - } : { - OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), - OPERATE_PERSON: currentUser?.Name + request={async () => { + if (currentRow) { + if (currentRow?.ImageInfo && currentRow?.ImageInfo.length > 0) { + let list: any = [] + currentRow?.ImageInfo.forEach((item: any) => { + let obj = JSON.parse(JSON.stringify(item)) + obj.url = obj.ImageUrl + obj.name = obj.ImageName + obj.uid = item.ImageId + obj.status = 'done' + list.push(obj) + }) + setFileList(list) + } + + return { + ...currentRow, + OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), + } + } else { + return { + OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), + OPERATE_PERSON: currentUser?.Name, + UPPER_STATE: 1 + } + } }} + // initialValues={currentRow ? { + // ...currentRow, + // OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), + // } : { + // OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), + // OPERATE_PERSON: currentUser?.Name, + // UPPER_STATE: 1 + // }} onFinish={async (values) => { let newValue = { ...values }; if (currentRow) { // 编辑数据 - newValue = { ...values, USERDEFINEDTYPE_ID: currentRow.USERDEFINEDTYPE_ID }; + newValue = { ...values }; } - console.log('fileListfileList', fileList); - console.log('newValuenewValuenewValue', newValue); - // 如果有开关,要把开关的代码写进去 await handleAddUpdate(newValue); @@ -441,38 +616,44 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( { - // if (typeTreeData && typeTreeData.length > 0) { - // let list: any = [{ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }, ...typeTreeData] - // return list - // } else { - // const req = { - // OWNERUNIT_ID: currentUser?.OwnerUnitId, - // PROVINCE_CODE: "", - // GOODSTYPE: 4000, - // } - // const data = await handlGetUSERDEFINEDTYPEList(req); - // console.log('datadatadatadatadata', data); - // if (data.List && data.List.length > 0) { - // data.List.unshirft({ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }) - // setTypeTreeData(data.List) - // return data.List - // } else { - // return [{ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }] - // } - // } + const req = { + OWNERUNIT_ID: currentUser?.OwnerUnitId, + PROVINCE_CODE: "", + GOODSTYPE: 3000, + USERDEFINEDTYPE_STATE: 1 + // SearchKey: "" + } + let data = await handlGetUSERDEFINEDTYPEList(req); + console.log('datadatadatadatadata2', data); + if (data && data.length > 0) { + // data.unshirft({ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }) + return processTreeData(data) + } else { + return [] + } }} fieldProps={{ - // fieldNames: { - // label: 'USERDEFINEDTYPE_NAME', - // value: 'USERDEFINEDTYPE_ID', - // children: 'children' - // }, - // showSearch: true, - // filterTreeNode: (input, node) => - // (node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase()) + fieldNames: { + label: 'USERDEFINEDTYPE_NAME', + value: 'USERDEFINEDTYPE_ID', + children: 'children' + }, + showSearch: true, + treeDefaultExpandAll: true, + filterTreeNode: (input, node) => + (node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase()), + onChange: (value, label) => { + console.log('value', value); + console.log('label', label); + + formRef.current?.setFieldsValue({ + USERDEFINEDTYPE_NAME: label.toString(), + USERDEFINEDTYPE_ID: value + }); + } }} rules={[ { @@ -489,6 +670,12 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( + + + = ( - - + + + + @@ -531,12 +732,6 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( label="商品规格" /> - - - = ( = ( { @@ -614,7 +809,13 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( async onOk() { if (info.file.ImageId) { const deleteLoading = message.loading('正在删除...') - const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '', '5000') + const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '', '6000') + await handeSyncSellerCommodityInfo({ + list: [{ + ...currentRow, + ImageInfo: null + }] + }) deleteLoading() if (success) { @@ -647,9 +848,6 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( - - - = ( > - + + + {/* 获取商品的悬浮框 */} + + + } + onCancel={() => { + setGetProducts(false) + setSelectListShop([]) + setSelectListShopLoading(false) + }} + bodyStyle={{ + maxHeight: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + > + + { + const req: any = { + ProvinceCode: currentUser?.ProvinceCode, + ServerpartShopId: "", + SellerId: selectedId, + SearchKeyName: "", + SearchKeyValue: "", + PageIndex: 1, + PageSize: 999999, + SortStr: "" + } + console.log('reqreqreqreq', req); + const data = await handeGetBusinessCommodityList(req) + console.log('datadatadatadata', data); + if (data.List && data.List.length > 0) { + return { data: data.List, success: true, total: data.TotalCount } + } + return { data: [], success: true } + }} + rowSelection={{ + type: "checkbox", + onChange: (_, selectedRows) => { + setSelectListShop(selectedRows) + } + }} + /> + + ); }; export default connect(({ user }: ConnectState) => ({ diff --git a/src/pages/travelMember/ProductListingManagement/component/LeftSelectMallType.tsx b/src/pages/travelMember/ProductListingManagement/component/LeftSelectMallType.tsx index 4051edb..c7bf160 100644 --- a/src/pages/travelMember/ProductListingManagement/component/LeftSelectMallType.tsx +++ b/src/pages/travelMember/ProductListingManagement/component/LeftSelectMallType.tsx @@ -12,6 +12,7 @@ import useRequest from "@ahooksjs/use-request"; import './style.less' import { getMerchantShopTree } from "@/pages/Setting/Users/service"; import { handlGetUSERDEFINEDTYPEList } from "../../service"; +import session from "@/utils/session"; type DetailProps = { @@ -37,16 +38,28 @@ const LeftSelectMallType = ({ setSelectedId, reload, actionRef, currentUser, wid const [isShowAllInTree, setIsShowAllInTree] = useState(false) // 加载服务区树 const { loading: treeLoading, data: treeViews } = useRequest(async () => { - const req = { - OWNERUNIT_ID: currentUser?.OwnerUnitId, - PROVINCE_CODE: "", - GOODSTYPE: 4000, - USERDEFINEDTYPE_STATE: 1 + + let USERDEFINEDTYPEList: any = session.get('USERDEFINEDTYPEList') + if (USERDEFINEDTYPEList && USERDEFINEDTYPEList.length > 0) { + setTreeView(USERDEFINEDTYPEList) + setData(USERDEFINEDTYPEList) + return USERDEFINEDTYPEList + } else { + const req = { + OWNERUNIT_ID: currentUser?.OwnerUnitId, + PROVINCE_CODE: "", + GOODSTYPE: 4000, + USERDEFINEDTYPE_STATE: 1 + } + const data = await handlGetUSERDEFINEDTYPEList(req); + setTreeView(data) + setData(data) + + session.set("USERDEFINEDTYPEList", data) + + return data } - const data = await handlGetUSERDEFINEDTYPEList(req); - setTreeView(data) - setData(data) - return data + }) // 显示服务区树搜索框 const [showServiceSearchBox, setShowServiceSearchBox] = useState(false) diff --git a/src/pages/travelMember/ProductListingManagement/index.tsx b/src/pages/travelMember/ProductListingManagement/index.tsx index 59e5829..a36e90c 100644 --- a/src/pages/travelMember/ProductListingManagement/index.tsx +++ b/src/pages/travelMember/ProductListingManagement/index.tsx @@ -12,7 +12,7 @@ import ProDescriptions from '@ant-design/pro-descriptions'; import ProForm, { ProFormDatePicker, ProFormDateRangePicker, ProFormDateTimePicker, ProFormDigit, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton } from '@ant-design/pro-form'; import { MenuFoldOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons'; import { PageContainer } from '@ant-design/pro-layout'; -import { Button, Col, Drawer, message, Row, Popconfirm, Space, Image, Modal, Form, Switch, Upload, Tooltip, Descriptions, TreeSelect, Divider } from 'antd'; +import { Button, Col, Drawer, message, Row, Popconfirm, Space, Image, Modal, Form, Switch, Upload, Tooltip, Descriptions, TreeSelect, Divider, Input } from 'antd'; import type { CurrentUser } from "umi"; import type { ConnectState } from '@/models/connect'; @@ -24,13 +24,28 @@ import { getFieldEnumTree, getFieldEnumName } from "@/services/options"; // 枚 import { getList, delcommodity, updatecommodity } from './service'; // 接口相关对象的引用 import PageTitleBox from "@/components/PageTitleBox"; import LeftSelectMallType from './component/LeftSelectMallType'; -import { handeDeleteCOMMODITY, handeGetCOMMODITY_MULTIList, handeGetCOMMODITYDetail, handeGetCOMMODITYList, handeGetMERCHANTSList, handeGetRTCOMMODITY_MULTIList, handeSynchroCOMMODITY, handleGetBRANDList, handlGetUSERDEFINEDTYPEList } from '../service'; +import { handeDeleteCOMMODITY, handeDeleteRTCOMMODITY_MULTI, handeGetCOMMODITY_MULTIList, handeGetCOMMODITYDetail, handeGetCOMMODITYList, handeGetMERCHANTSList, handeGetRTCOMMODITY_MULTIList, handeSynchroCOMMODITY, handeSynchroRTCOMMODITYMULTIList, handleGetBRANDList, handlGetUSERDEFINEDTYPEList } from '../service'; import session from '@/utils/session'; +import { deletePicture, uploadPicture } from '@/services/picture'; +const beforeUpload = (file: any) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; + if (!isJpgOrPng) { + message.error('请上传JPEG、jpg、png格式的图片文件!'); + } + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + message.error('图片大小不超过 2MB!'); + } + return isJpgOrPng && isLt2M; +} + const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { const { currentUser } = props + const { confirm } = Modal; const actionRef = useRef(); + const ruleActionRef = useRef(); const formRef = useRef(); const [currentRow, setCurrentRow] = useState(); const [showDetail, setShowDetail] = useState(); @@ -70,7 +85,24 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop const [selectedRows, setSelectedRows] = useState() // 当前商品关联的规格数据 const [specsData, setSpecsData] = useState() + // 主图图片 + const [mainImgList, setMainImgList] = useState() + // 头部轮播框 + const [headerImgList, setHeaderImgList] = useState() + // 详情图 + const [detailImgList, setDetailImgList] = useState() + // 文件列表 + const [fileList, setFileList] = useState([]) + const [imagePreviewVisible, setImagePreviewVisible] = useState(false) // 预览图片 + // 预览上传后的图片 + const handlePreview = async () => { + setFileList(fileList) + setImagePreviewVisible(true) + }; + const handleChangePreview = (val: any) => { + setImagePreviewVisible(val) + } const onDraggaleStart = (event, uiData) => { @@ -217,6 +249,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop { + console.log('recordrecordrecord', record); + setCurrentRow({ ...record }); handleModalVisible(true); }} @@ -248,14 +282,14 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop valueType: 'index', }, { - dataIndex: 'COMMODITY_MULTI_ID', + dataIndex: 'USERDEFINEDTYPE_NAME', title: '规格分类', align: 'center', width: 120, ellipsis: true, }, { - dataIndex: 'USERDEFINEDTYPE_NAME ', + dataIndex: 'COMMODITY_NAME', title: '规格名称', align: 'center', width: 150, @@ -267,6 +301,19 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop align: 'center', width: 120, ellipsis: true, + render: (_, record) => { + return { + let oldData: any = JSON.parse(JSON.stringify(specsData)) + let list: any = [] + oldData.forEach((item: any) => { + if (item.COMMODITY_MULTI_ID === record?.COMMODITY_MULTI_ID) { + item.COMMODITY_STOCK = e.target.value + } + list.push(item) + }) + setSpecsData(list) + }} /> + } }, { dataIndex: 'COMMODITY_RETAILPRICE', @@ -274,6 +321,19 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop align: 'center', width: 120, ellipsis: true, + render: (_, record) => { + return { + let oldData: any = JSON.parse(JSON.stringify(specsData)) + let list: any = [] + oldData.forEach((item: any) => { + if (item.COMMODITY_MULTI_ID === record?.COMMODITY_MULTI_ID) { + item.COMMODITY_RETAILPRICE = e.target.value + } + list.push(item) + }) + setSpecsData(list) + }} /> + } }, { dataIndex: 'COMMODITY_MEMBERPRICE', @@ -281,6 +341,19 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop align: 'center', width: 120, ellipsis: true, + render: (_, record) => { + return { + let oldData: any = JSON.parse(JSON.stringify(specsData)) + let list: any = [] + oldData.forEach((item: any) => { + if (item.COMMODITY_MULTI_ID === record?.COMMODITY_MULTI_ID) { + item.COMMODITY_MEMBERPRICE = e.target.value + } + list.push(item) + }) + setSpecsData(list) + }} /> + } }, { dataIndex: 'COMMODITY_PURCHASEPRICE', @@ -288,7 +361,50 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop align: 'center', width: 120, ellipsis: true, - } + render: (_, record) => { + return { + let oldData: any = JSON.parse(JSON.stringify(specsData)) + let list: any = [] + oldData.forEach((item: any) => { + if (item.COMMODITY_MULTI_ID === record?.COMMODITY_MULTI_ID) { + item.COMMODITY_PURCHASEPRICE = e.target.value + } + list.push(item) + }) + setSpecsData(list) + }} /> + } + }, + { + dataIndex: 'option', + title: '操作', + valueType: 'option', + align: 'center', + hideInSearch: true, + width: 120, + ellipsis: true, + render: (_, record) => { + return ( + + { + console.log('recordrecordrecord', record); + const data = await handeDeleteRTCOMMODITY_MULTI({ RTCOMMODITY_MULTIId: record?.RTCOMMODITY_MULTI_ID }) + if (data.Result_Code !== 100) { + message.error(`${data.Result_Desc}` || `${data.Result_Code}:删除失败`); + } else { + message.success('删除成功!'); + ruleActionRef.current?.reload() + } + }} + > + 删除 + + + ); + }, + }, ] // 新增多规格的表格 @@ -341,6 +457,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop req = { ...currentRow, ...res, + UserDefinedTypeIds: res.USERDEFINEDTYPE_ID ? res.USERDEFINEDTYPE_ID.toString() : "", BRAND_ID: res.BRAND_ID.split('-')[1], BRAND_NAME: res.BRAND_ID.split('-')[0], MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1], @@ -348,9 +465,11 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop OWNERUNIT_ID: currentUser?.OwnerUnitId, OWNERUNIT_NAME: currentUser?.OwnerUnitName, PROVINCE_CODE: currentUser?.ProvinceCode, - OPERATE_PERSON: currentUser?.ID, + OPERATE_PERSON: currentUser?.Name, + SELLER_ID: currentUser?.ID, COMMODITY_TYPE: 4000, COMMODITY_STATE: 1, + USERDEFINEDTYPE_ID: "", OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), UPPER_DATE: res.UPPER_DATE && res.UPPER_DATE.length > 0 ? moment(res.UPPER_DATE[0]).format('YYYY-MM-DD HH:mm:ss') : "", OFF_DATE: res.UPPER_DATE && res.UPPER_DATE.length > 0 ? moment(res.UPPER_DATE[1]).format('YYYY-MM-DD HH:mm:ss') : "", @@ -358,6 +477,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop } else { req = { ...res, + UserDefinedTypeIds: res.USERDEFINEDTYPE_ID ? res.USERDEFINEDTYPE_ID.toString() : "", BRAND_ID: res.BRAND_ID.split('-')[1], BRAND_NAME: res.BRAND_ID.split('-')[0], MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1], @@ -365,9 +485,11 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop OWNERUNIT_ID: currentUser?.OwnerUnitId, OWNERUNIT_NAME: currentUser?.OwnerUnitName, PROVINCE_CODE: currentUser?.ProvinceCode, - OPERATE_PERSON: currentUser?.ID, + OPERATE_PERSON: currentUser?.Name, + SELLER_ID: currentUser?.ID, COMMODITY_TYPE: 4000, COMMODITY_STATE: 1, + USERDEFINEDTYPE_ID: "", OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), UPPER_DATE: res.UPPER_DATE && res.UPPER_DATE.length > 0 ? moment(res.UPPER_DATE[0]).format('YYYY-MM-DD HH:mm:ss') : "", OFF_DATE: res.UPPER_DATE && res.UPPER_DATE.length > 0 ? moment(res.UPPER_DATE[1]).format('YYYY-MM-DD HH:mm:ss') : "", @@ -378,6 +500,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop const data = await handeSynchroCOMMODITY(req) handleConfirmLoading(false) if (data.Result_Code === 100) { + + await handleUploadShopImg(res, data.Result_Data) + message.success("新增成功!") setCurrentRow(undefined) formRef?.current?.resetFields() @@ -388,11 +513,63 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop // 清空一下 商品关联表的选择行 setSelectedRowKeys([]) setSelectedRows([]) + setMainImgList([]) + setHeaderImgList([]) + setDetailImgList([]) } else { message.error(data.Result_Desc) } }; + // 上传商品图片 + const handleUploadShopImg = async (formRes: any, shopData: any) => { + // formRes 当前表单的全部数据 shopData 商品数据 + // 主图 + if (formRes.mainImgList && formRes.mainImgList.length > 0) { + const formData = new FormData(); + formRes.mainImgList.forEach((file: any) => { + formData.append('files[]', file.originFileObj); + formData.append('ImageName', typeof file !== 'string' ? file?.name : ''); + }); + formData.append('TableId', shopData.COMMODITY_ID); + formData.append('imageType', "1000"); + formData.append('TableType', "1207"); + + console.log('formData', formData); + let res = await uploadPicture(formData) + } + + // 头部轮播图 + if (formRes.headerImgList && formRes.headerImgList.length > 0) { + const formData = new FormData(); + formRes.headerImgList.forEach((file: any) => { + formData.append('files[]', file.originFileObj); + formData.append('ImageName', typeof file !== 'string' ? file?.name : ''); + }); + formData.append('TableId', shopData.COMMODITY_ID); + formData.append('imageType', "2000"); + formData.append('TableType', "1207"); + + console.log('formData', formData); + let res = await uploadPicture(formData) + } + + // 头部轮播图 + if (formRes.detailImgList && formRes.detailImgList.length > 0) { + const formData = new FormData(); + formRes.detailImgList.forEach((file: any) => { + formData.append('files[]', file.originFileObj); + formData.append('ImageName', typeof file !== 'string' ? file?.name : ''); + }); + formData.append('TableId', shopData.COMMODITY_ID); + formData.append('imageType', "5000"); + formData.append('TableType', "1207"); + + console.log('formData', formData); + let res = await uploadPicture(formData) + } + } + // 拿到类别列表里面得规格 const collectItemsWithCommodityMultiId = (data: any, result = []) => { // 检查输入是否为数组 @@ -418,6 +595,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop return result; } + // 同步商品多规格 + + return (
@@ -501,28 +681,29 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
{/* 添加商品的悬浮框 */} { - // if (disabled) { - // setDraggleDisabled(false) - // } - // }} - // onMouseOut={() => { - // setDraggleDisabled(true) - // }} + // title={currentRow ? '更新商品管理' : '新建商品管理'} + title={ +
{ + if (disabled) { + setDraggleDisabled(false) + } + }} + onMouseOut={() => { + setDraggleDisabled(true) + }} - // onFocus={() => { }} - // onBlur={() => { }} - // > - // {currentRow ? '更新商品管理' : '新建商品管理'} - //
- // } + onFocus={() => { }} + onBlur={() => { }} + > + {currentRow ? '更新商品管理' : '新建商品管理'} +
+ } destroyOnClose={true} width={'70%'} visible={modalVisible} @@ -534,9 +715,15 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop onCancel={() => { handleConfirmLoading(false) handleModalVisible(false) + setMainImgList([]) + setHeaderImgList([]) + setDetailImgList([]) // setBRAND_NAMEList([]) }} - + bodyStyle={{ + maxHeight: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} footer={
{ @@ -556,6 +743,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop // 清空一下 商品关联表的选择行 setSelectedRowKeys([]) setSelectedRows([]) + setMainImgList([]) + setHeaderImgList([]) + setDetailImgList([]) }}>取 消 : "" + } +
+
+ {/* + */} +
+
} + onOk={async () => { // 提交框内的数据 + formRef?.current?.validateFields().then(() => { + handleConfirmLoading(true) + formRef?.current?.submit() + }) + }} + modalRender={(modal) => { + return onDraggaleStart(event, uiData)} + handle='.productListing' + > +
{modal}
+
+ }} + > + { + if (currentRow?.COMMODITY_ID) { + const data = await handeGetCOMMODITYDetail({ COMMODITYId: currentRow?.COMMODITY_ID }) + + let mainImgList: any = [] + let headerImgList: any = [] + let detailImgList: any = [] + // 主图 + if (data.IconList && data.IconList.length > 0) { + data.IconList.forEach((item: any) => { + let obj = JSON.parse(JSON.stringify(item)) + obj.url = obj.ImageUrl + obj.name = obj.ImageName + obj.uid = item.ImageId + obj.status = 'done' + mainImgList.push(obj) + }) + } + // 轮播框图 + if (data.GalleryImgList && data.GalleryImgList.length > 0) { + data.GalleryImgList.forEach((item: any) => { + let obj = JSON.parse(JSON.stringify(item)) + obj.url = obj.ImageUrl + obj.name = obj.ImageName + obj.uid = item.ImageId + obj.status = 'done' + headerImgList.push(obj) + }) + } + // 详情图 + if (data.DetailImgList && data.DetailImgList.length > 0) { + data.DetailImgList.forEach((item: any) => { + let obj = JSON.parse(JSON.stringify(item)) + obj.url = obj.ImageUrl + obj.name = obj.ImageName + obj.uid = item.ImageId + obj.status = 'done' + detailImgList.push(obj) + }) + } + + + setMainImgList(mainImgList) + setHeaderImgList(headerImgList) + setDetailImgList(detailImgList) + + return { + ...data, + USERDEFINEDTYPE_ID: data.UserDefinedTypeIds ? data.UserDefinedTypeIds.split(',').map(Number) : [], + BRAND_ID: `${data?.BRAND_NAME}-${data?.BRAND_ID}`, + MERCHANTS_ID: `${data?.MERCHANTS_NAME}-${data?.MERCHANTS_ID}`, + UPPER_DATE: data.UPPER_DATE && data.OFF_DATE ? [data.UPPER_DATE, data.OFF_DATE] : [], + // mainImgList: mainImgList, + // headerImgList: headerImgList, + // detailImgList: detailImgList, + } + } else { + return { + OPERATE_PERSON: currentUser?.Name, + UPPER_STATE: currentUser?.SupplierID ? 0 : "" + } + } + } + } + + + // initialValues={currentRow ? { + // ...currentRow, + // BRAND_ID: `${currentRow?.BRAND_NAME}-${currentRow?.BRAND_ID}`, + // MERCHANTS_ID: `${currentRow?.MERCHANTS_NAME}-${currentRow?.MERCHANTS_ID}`, + // } : { + // OPERATE_PERSON: currentUser?.Name, + // UPPER_STATE: currentUser?.SupplierID ? 0 : "" + // }} + onFinish={async (values) => { + let newValue: any = { ...values }; + if (currentRow) { + // 编辑数据 + newValue = { ...values, COMMODITY_ID: currentRow.COMMODITY_ID }; + } + // 如果有开关,要把开关的代码写进去 + await handleAddUpdate(newValue); + + handleModalVisible(false); + }} + > + + 基本信息 + + + + + + + + { + if (BRAND_NAMEList && BRAND_NAMEList.length > 0) { + return BRAND_NAMEList + } else { + const req: any = { + searchParameter: { + OWNERUNIT_ID: currentUser?.OwnerUnitId, + PROVINCE_CODE: currentUser?.ProvinceCode, + BRAND_STATE: 1, + BRAND_CATEGORY: 2000 + }, + PageIndex: 1, + PageSize: 999999, + SortStr: "BRAND_INDEX,OPERATE_DATE" + } + const data = await handleGetBRANDList(req) + if (data.List && data.List.length > 0) { + let list: any = [] + data.List.forEach((item: any) => { + list.push({ label: item.BRAND_NAME, value: `${item.BRAND_NAME}-${item.BRAND_ID}` }) + }) + + setBRAND_NAMEList(list) + return list + } + return [] + } + }} + fieldProps={{ + // fieldNames: { + // label: 'BRAND_NAME', + // value: 'BRAND_ID' + // }, + showSearch: true, + filterOption: (input, node) => + (node.BRAND_NAME || '').toLowerCase().includes(input.toLowerCase()) + }} + rules={[ + { + required: true, + message: "请选择商品品牌!" + } + ]} + readonly + /> + + + { + console.log('leftTreeDataleftTreeDataleftTreeData', leftTreeData); + + return leftTreeData + }} + fieldProps={{ + fieldNames: { + label: "USERDEFINEDTYPE_NAME", + value: "USERDEFINEDTYPE_ID" + }, + showSearch: true, + multiple: true, // 支持多选 + allowClear: true, // 允许清除和删除 + filterTreeNode: (input, node) => + (node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase()) + }} + readonly + /> + + + { + if (COMMODITYSUPPLIERLIST && COMMODITYSUPPLIERLIST.length > 0) { + return COMMODITYSUPPLIERLIST + } else { + const req = { + searchParameter: { + OWNERUNIT_ID: currentUser?.OwnerUnitId, + PROVINCE_CODE: currentUser?.ProvinceCode, + MERCHANTS_TYPE: "" + }, + PageIndex: 1, + PageSize: 999999, + } + const data = await handeGetMERCHANTSList(req); + console.log('datadatadatadatadata', data); + if (data.List && data.List.length > 0) { + let list: any = [] + data.List.forEach((item: any) => { + list.push({ label: item.MERCHANTS_NAME, value: `${item.MERCHANTS_NAME}-${item.MERCHANTS_ID}` }) + }) + setCOMMODITYSUPPLIERLIST(list) + return list + } + setCOMMODITYSUPPLIERLIST([]) + return [] + } + }} + fieldProps={{ + // fieldNames: { + // label: 'MERCHANTS_NAME', + // value: 'MERCHANTS_ID' + // }, + showSearch: true, + filterTreeNode: (input, node) => + (node.MERCHANTS_NAME || '').toLowerCase().includes(input.toLowerCase()) + }} + rules={[ + { + required: true, + message: "请选择供货商户" + } + ]} + readonly + /> + + 商品信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 商品价值 + + + + + + + + + + + + + + + + + + + + 配送信息 + + + + + + + + + + + + + 上架信息 + + + + + + + + + + + + + + + + + + + + + + 主图 + + { + if (info.file.status === 'removed') { + const index = mainImgList.findIndex(n => n.uid === info.file.uid); + confirm({ + title: '确认删除该文件吗?', + icon: , + async onOk() { + if (info.file.ImageId) { + const deleteLoading = message.loading('正在删除...') + const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '', '6000') + deleteLoading() + + if (success) { + const files = [...mainImgList] + files.splice(index, 1) + setMainImgList(files) + message.success("删除成功") + actionRef.current?.reload() + } + else { + message.error("删除失败") + } + } else { + const files = [...mainImgList]; + files.splice(index, 1); + setMainImgList(files); + } + }, + onCancel() { + }, + }); + } else { + setMainImgList(info.fileList) + } + } + }} + /> + + 头部轮播图 + + { + if (info.file.status === 'removed') { + const index = headerImgList.findIndex(n => n.uid === info.file.uid); + confirm({ + title: '确认删除该文件吗?', + icon: , + async onOk() { + if (info.file.ImageId) { + const deleteLoading = message.loading('正在删除...') + const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '', '6000') + deleteLoading() + + if (success) { + const files = [...headerImgList] + files.splice(index, 1) + setHeaderImgList(files) + message.success("删除成功") + actionRef.current?.reload() + } + else { + message.error("删除失败") + } + } else { + const files = [...headerImgList]; + files.splice(index, 1); + setHeaderImgList(files); + } + }, + onCancel() { + }, + }); + } else { + setHeaderImgList(info.fileList) + } + } + }} + readonly + disabled + /> + + 详情图 + + { + if (info.file.status === 'removed') { + const index = detailImgList.findIndex(n => n.uid === info.file.uid); + confirm({ + title: '确认删除该文件吗?', + icon: , + async onOk() { + if (info.file.ImageId) { + const deleteLoading = message.loading('正在删除...') + const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '', '6000') + deleteLoading() + + if (success) { + const files = [...detailImgList] + files.splice(index, 1) + setDetailImgList(files) + message.success("删除成功") + actionRef.current?.reload() + } + else { + message.error("删除失败") + } + } else { + const files = [...detailImgList]; + files.splice(index, 1); + setDetailImgList(files); + } + }, + onCancel() { + }, + }); + } else { + setDetailImgList(info.fileList) + } + } + }} + readonly + disabled + /> + + + + + + {/* 多规格配置的悬浮框 */} + { + setShowMoreSpecs(false) + setSpecsData([]) + }} + onOk={async () => { // 提交框内的数据 + console.log('specsDataspecsData', specsData); + // 判断表格数据是不是都填了 + let isAllOk: boolean = true + if (specsData && specsData.length > 0) { + specsData.forEach((item: any) => { + if (!item.COMMODITY_STOCK || !item.COMMODITY_RETAILPRICE || !item.COMMODITY_MEMBERPRICE || !item.COMMODITY_PURCHASEPRICE) { + isAllOk = false + } + }) + } + if (!isAllOk) { + message.error('请先完善表格数据!') + } + + + if (specsData && specsData.length > 0) { + let list: any = [] + specsData.forEach((item: any) => { + list.push({ + RTCOMMODITY_MULTI_ID: item.RTCOMMODITY_MULTI_ID ? item.RTCOMMODITY_MULTI_ID : "", + COMMODITY_ID: currentRow?.COMMODITY_ID, + COMMODITY_MULTI_ID: item.COMMODITY_MULTI_ID, + COMMODITY_STOCK: item.COMMODITY_STOCK, + COMMODITY_RETAILPRICE: item.COMMODITY_RETAILPRICE, + COMMODITY_PURCHASEPRICE: item.COMMODITY_PURCHASEPRICE, + COMMODITY_MEMBERPRICE: item.COMMODITY_MEMBERPRICE, + STAFF_ID: currentUser?.ID, + STAFF_NAME: currentUser?.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss') + }) + }) + // return + const req: any = { + list: list + } + console.log('reqreqreq', req); + + const data = await handeSynchroRTCOMMODITYMULTIList(req) + console.log('datadatadatadata', data); + if (data.Result_Code === 100) { + message.success("同步成功!") + setShowMoreSpecs(false) + setSpecsData([]) + } else { + message.error(data.Result_Desc) + } + } else { + setShowMoreSpecs(false) + setSpecsData([]) + } + + + }} + > + { + // setShowAddSpecsModal(true) + // }}>新增规格 + // ] + }} + dataSource={specsData} + request={async () => { + console.log('currentRowcurrentRowcurrentRow', currentRow); + + const req: any = { + searchParameter: { + COMMODITY_IDS: currentRow?.COMMODITY_ID, + // OWNERUNIT_ID: currentUser?.OwnerUnitId, + // PROVINCE_CODE: "", + }, + PageIndex: 1, + PageSize: 999999, + SortStr: "COMMODITY_MULTI_ID" + } + const data = await handeGetRTCOMMODITY_MULTIList(req) + console.log('多规格管理', data); + if (data.List && data.List.length > 0) { + setSpecsData(data.List) + // return { data: data.List, success: true, total: data.TotalCount } + } else { + setSpecsData([]) + } + // return { data: [], success: true } + + // return selectedRows + }} + /> + + + + {/* 添加多规格的悬浮框 */} + { + setShowAddSpecsModal(false) + }} + onOk={async () => { // 提交框内的数据 + setShowAddSpecsModal(false) + console.log('specsDataspecsDataspecsData', specsData); + console.log('selectedRowsselectedRowsselectedRows', selectedRows); + let list: any = JSON.parse(JSON.stringify(specsData)) + // list = list.concat(selectedRows) + if (selectedRows && selectedRows.length > 0) { + selectedRows.forEach((item: any) => { + let filterList: any = list.filter((filterItem: any) => filterItem.COMMODITY_MULTI_ID === item.COMMODITY_MULTI_ID) + if (filterList && filterList.length > 0) { + } else { + list.push(item) + } + // let obj: any = JSON.parse(JSON.stringify(item)) + }) + } + setSpecsData(list) + }} + > + { + setSelectedRowKeys(selectedRowKeys) + setSelectedRows(selectedRows) + }, + }} + request={async () => { + const req = { + searchParameter: { + OwnerUnitId: currentUser?.OwnerUnitId, + ExcludeCommodityId: currentRow?.COMMODITY_ID, + // PROVINCE_CODE: currentUser?.ProvinceCode, + // GOODSTYPE: 6000, + COMMODITY_STATE: 1 + }, + PageIndex: 1, + PageSize: 999999, + SortStr: "USERDEFINEDTYPE_ID,COMMODITY_MULTI_ID" + } + const data = await handeGetCOMMODITY_MULTIList(req); + console.log('datadatadatadata', data); + let list = data.List + if (list && list.length > 0) { + return { data: list, success: true } + } + return { data: [], success: true } + }} + /> + + + + + + ); +}; export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser -}))(ShoppingMallProductSearch); \ No newline at end of file +}))(ShoppingMallProductSearch); diff --git a/src/pages/travelMember/serverpartInfo/components/serverpartInfo.tsx b/src/pages/travelMember/serverpartInfo/components/serverpartInfo.tsx index 66fbf68..7ddd6a4 100644 --- a/src/pages/travelMember/serverpartInfo/components/serverpartInfo.tsx +++ b/src/pages/travelMember/serverpartInfo/components/serverpartInfo.tsx @@ -10,7 +10,7 @@ import ProDescriptions from '@ant-design/pro-descriptions'; import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormDigit, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from '@ant-design/pro-form'; import { MenuFoldOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons'; import { PageContainer } from '@ant-design/pro-layout'; -import { Button, Col, Drawer, message, Row, Popconfirm, Space, Image, Modal, Form, Switch, Upload, Tooltip, Descriptions, TreeSelect, Divider, Radio } from 'antd'; +import { Button, Col, Drawer, message, Row, Popconfirm, Space, Image, Modal, Form, Switch, Upload, Tooltip, Descriptions, TreeSelect, Divider, Radio, Tabs } from 'antd'; import type { CurrentUser } from "umi"; import type { ConnectState } from '@/models/connect'; import type { ActionType, ProColumns } from '@ant-design/pro-table'; @@ -26,8 +26,9 @@ type DetailProps = { currentRow?: any; onShow?: boolean; onRef?: any + pageType?: number } -const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => { +const SERVERPARTTable = ({ currentRow, onShow, onRef, pageType }: DetailProps) => { const actionRef = useRef(); const formRef = useRef(); const [modalVisible, handleModalVisible] = useState(); @@ -38,6 +39,10 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => { const [serverPartDetail, setServerPartDetail] = useState() // 表单请求服务区的详情 const [formDetailAll, setFormDetailAll] = useState() + // 片区的tab + const [areaTabList, setAreaTabList] = useState() + // 选择的tab + const [selectTab, setSelectTab] = useState() const LOADBEARINGList = session.get('LOADBEARINGList') @@ -67,7 +72,49 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => { } }, [onShow]) + useEffect(async () => { + if (pageType === 2) { + if (currentRow?.SERVERPART_ID) { + const req: any = { + ServerpartId: currentRow?.SERVERPART_ID + } + const regData = await handleNewGetSERVERPARTDetail(req) + const list: any = regData.ServerPartInfo + console.log('regData', regData); + console.log('formDetailAll', formDetailAll); + + if (list && list.length > 0) { + const obj: any = session.get('shopregionObj') + const res: any = [] + list.forEach((item: any, index: number) => { + if (item.SERVERPART_REGION) { + res.push({ label: obj[item.SERVERPART_REGION], value: item.SERVERPART_REGION.toString(), key: item.SERVERPART_REGION.toString() }) + if (index === 0) { + setSelectTab(item.SERVERPART_REGION.toString()) + } + } + }) + console.log('resresresres', res); + + setAreaTabList(res) + } else { + setAreaTabList([]) + setSelectTab(null) + } + } + } + + + + }, []) + + useEffect(() => { + // 确保 areaTabList 更新后,selectTab 也正确设置 + if (areaTabList && areaTabList.length > 0 && !selectTab) { + setSelectTab(areaTabList[0].key); + } + }, [areaTabList, selectTab]); return (
@@ -304,305 +351,313 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => { - - - - - { - if (currentRow?.SERVERPART_ID) { - const req: any = { - ServerpartId: currentRow?.SERVERPART_ID - } - const regData = await handleNewGetSERVERPARTDetail(req) - const list: any = regData.ServerPartInfo - console.log('regData', regData); - console.log('formDetailAll', formDetailAll); - - if (list && list.length > 0) { - const obj: any = session.get('shopregionObj') - const res: any = [] - list.forEach((item: any) => { - if (item.SERVERPART_REGION) { - res.push({ label: obj[item.SERVERPART_REGION], value: item.SERVERPART_REGION }) - } - }) - console.log('res', res); - formRef.current?.setFieldsValue({ currentArea: res[0].value }) - return res - } - } - }} - /> - - - - - - - {/* 下面开始是一个方位区一块的内容 */} - - 面积相关 - - - - - - - - - - - - 加油信息 - - - - - - - - - - - - - 充电信息 - - - - - - - - - - - - - - - - - - - 服务信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 车位信息 - - - - - - - - - - - - - - - - - - 经营信息 - - - - - - - - - - - - - - - - - - - - { - serverPartType === 2 ? - <> - 对向信息 + pageType === 2 ? +
+ { + setSelectTab(e) + }} items={areaTabList} /> +
: + + + + + { + if (currentRow?.SERVERPART_ID) { + const req: any = { + ServerpartId: currentRow?.SERVERPART_ID + } + const regData = await handleNewGetSERVERPARTDetail(req) + const list: any = regData.ServerPartInfo + + console.log('regData', regData); + console.log('formDetailAll', formDetailAll); + + if (list && list.length > 0) { + const obj: any = session.get('shopregionObj') + const res: any = [] + list.forEach((item: any) => { + if (item.SERVERPART_REGION) { + res.push({ label: obj[item.SERVERPART_REGION], value: item.SERVERPART_REGION }) + } + }) + console.log('res', res); + formRef.current?.setFieldsValue({ currentArea: res[0].value }) + return res + } + } + }} + /> + + + + + } + + +
0 && selectTab === areaTabList[0].key ? 'block' : 'none' }}> + 面积相关 + + + + + + + + + + + + 加油信息 + + + + + + + + + + + + + 充电信息 + + + + + + + + + + + + + + + + + + + 服务信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 车位信息 + + + + + + + + + + + + + + + + + + 经营信息 + + + + + + + + + + + + + + + + + + + + +
+ +
1 && selectTab === areaTabList[1].key ? 'block' : 'none' }}> + {/* 对向信息 @@ -643,263 +698,262 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => { }} /> - - 面积相关 - - - - - - - - - - - - 加油信息 - - - - - - - - - - + */} + 面积相关 + + + + + + + + + + + + 加油信息 + + + + + + + + + + - - 充电信息 - - - - - - - - - - - - - - - - + + 充电信息 + + + + + + + + + + + + + + + + - - 服务信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 车位信息 - - - - - - - - - - - - - - - - - - 经营信息 - - - - - - - - - - - - - - - - - - - - + + 服务信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 车位信息 + + + + + + + + + + + + + + + + + + 经营信息 + + + + + + + + + + + + + + + + + + + + +
- : '' - }
diff --git a/src/pages/travelMember/serverpartInfo/index.tsx b/src/pages/travelMember/serverpartInfo/index.tsx index 065ce27..ed96367 100644 --- a/src/pages/travelMember/serverpartInfo/index.tsx +++ b/src/pages/travelMember/serverpartInfo/index.tsx @@ -459,7 +459,7 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
{ showRightForm ? - : + : }
diff --git a/src/pages/travelMember/service.ts b/src/pages/travelMember/service.ts index 8b42e98..f44442a 100644 --- a/src/pages/travelMember/service.ts +++ b/src/pages/travelMember/service.ts @@ -500,7 +500,7 @@ export async function handeDeleteCOMMODITY_MULTI(params: any) { // 获取商品规格关联的列表(就是拿到商品已经关联了的规格) export async function handeGetRTCOMMODITY_MULTIList(params: any) { - const data = await requestEncryption(`/MemberConfig/GetRTCOMMODITY_MULTIList`, { + const data = await requestEncryption(`/MallBasic/GetRTCOMMODITY_MULTIList`, { method: 'POST', data: { ...params, requestEncryption: true } }) @@ -585,4 +585,81 @@ export async function handeGetSPRegionShopTree(params: any) { return [] } return wrapTreeNode(data.Result_Data.List) +} + +// 获取点餐商品 +export async function handeGetBusinessCommodityList(params: any) { + const data = await requestEncryption(`/BaseInfo/GetBusinessCommodityList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data +} + + +// 删除商品多规格 +export async function handeDeleteRTCOMMODITY_MULTI(params: any) { + const data = await requestEncryption(`/MallBasic/DeleteRTCOMMODITY_MULTI`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data +} + + +// 批量同步规格 +export async function handeSynchroRTCOMMODITYMULTIList(params: any) { + const data = await requestEncryption(`/MallBasic/SynchroRTCOMMODITYMULTIList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data +} + + + +// 获取业主营收统计报表数据 +export async function handeGetRevenueReport(params: any) { + const data = await requestEncryption(`/Revenue/GetRevenueReport`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return wrapTreeNode(data.Result_Data.List) +} + +// 获取点餐商品 +export async function handeGetSellerCommodityList(params: any) { + const data = await requestEncryption(`/MallBasic/GetSellerCommodityList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data +} + + +// 同步经营商家商品数据 +export async function handeSyncSellerCommodityInfo(params: any) { + const data = await requestEncryption(`/MallBasic/SyncSellerCommodityInfo`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data } \ No newline at end of file diff --git a/src/services/options/index.ts b/src/services/options/index.ts index 14fd415..110b5d0 100644 --- a/src/services/options/index.ts +++ b/src/services/options/index.ts @@ -115,6 +115,29 @@ export async function getFieldEnumTree(params: FieldParamsModel) { return [...options]; } +// 出行平台请求树的 +export async function handleGetFieldEnumTreeTravel(params: FieldParamsModel) { + const sessionName = `${params.sessionName ? params.sessionName : params.FieldExplainField}Tree`; + const FieldExplain = session.get(sessionName); + // if (FieldExplain && !params?.noStorge) { + // return FieldExplain; + // } + + const data = await requestEncryption(`/FrameWork/GetFieldEnumTree`, { + method: 'GET', + params, + }); + if (data.Result_Code !== 100) { + return []; + } + + const options = params.notformate ? formateTreeField(data.Result_Data.List) : wrapTreeNode(data.Result_Data.List); + session.set(sessionName, options); + // const oneList = getName(options) + // session.set(`${sessionName}One`,oneList); + return [...options]; +} + /* 获取枚举列表 出行平台的枚举 */ export async function getTravelFieldEnumTree(params: FieldParamsModel) { diff --git a/src/services/options/typings.d.ts b/src/services/options/typings.d.ts index f8640dc..0bff003 100644 --- a/src/services/options/typings.d.ts +++ b/src/services/options/typings.d.ts @@ -9,7 +9,7 @@ // 字段枚举 model( 下拉框数据字典) type FieldParamsModel = { FieldExplainField: string; - FieldEnumStatus?: string; + FieldEnumStatus?: string | Boolean; FieldEnumValue?: string; notformate?: boolean; sessionName?: string; @@ -19,7 +19,7 @@ type FieldParamsModel = { noStorge?: any;// 不管那个缓存的判断 }; // 通用选择/树数据源model -type CommonTypeModel ={ +type CommonTypeModel = { label: string;// 名称 , value: number;// 数值(对应数据表id) , key: string;// 数值代码(字符串) , @@ -31,7 +31,7 @@ type CommonTypeModel ={ type RequestResult = { Result_Code: number; // 状态码 , Result_Desc: string; // 消息 , - Result_Data: Record | ListJson | string | any;// 返回对象 + Result_Data: Record | ListJson | string | any;// 返回对象 } // 列表model type ListJson = { @@ -42,9 +42,9 @@ type ListJson = { List: any[];// 返回数据集 } // 文件model -export type PictureModel = { +export type PictureModel = { ImageId: number; // 图片内码 , - ImageType?: 1000 | 2000 | 3000 | 4000 ;// 文件类型 1000【营业执照】、2000【合同图片】, 3000 身份证人像面 4000 身份证国徽面; , + ImageType?: 1000 | 2000 | 3000 | 4000;// 文件类型 1000【营业执照】、2000【合同图片】, 3000 身份证人像面 4000 身份证国徽面; , ImageName: string; // 图片名称 , ImageUrl: string; // 图片地址 , ImagePath: string; // 图片相对路径(删除图片时提供的参数)