update
This commit is contained in:
parent
3fbb6dc0b0
commit
0771f7dd3f
@ -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<BasicLayoutProps> = (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) {
|
||||
|
||||
@ -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<any>([])
|
||||
// 内景图片列表
|
||||
const [InteriorImage, setInteriorImageList] = useState<any>([])
|
||||
// 营收的加载效果
|
||||
const [revenueLoading, setRevenueLoading] = useState<boolean>(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 (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
@ -723,7 +783,7 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> =
|
||||
return `${record?.SERVERPARTSELLER_ID}`
|
||||
}}
|
||||
bordered
|
||||
formRef={formRef}
|
||||
// formRef={formRef}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
actionRef={actionRef}
|
||||
search={{ span: 6, labelWidth: 'auto' }}
|
||||
@ -960,7 +1020,9 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> =
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowAddModal(true)
|
||||
}}>关联门店</Button>
|
||||
<Button type={"primary"}>获取营收</Button>
|
||||
<Button type={"primary"} loading={revenueLoading} onClick={() => {
|
||||
handleGetRevenueData()
|
||||
}}>获取营收</Button>
|
||||
</div>
|
||||
: <div></div>
|
||||
}
|
||||
@ -994,18 +1056,8 @@ 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) => {
|
||||
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
|
||||
@ -1014,20 +1066,10 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> =
|
||||
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) => {
|
||||
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
|
||||
@ -1036,19 +1078,10 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> =
|
||||
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) => {
|
||||
|
||||
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
|
||||
@ -1057,16 +1090,83 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> =
|
||||
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 }> =
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
<ProFormTreeSelect
|
||||
name="SHOPTRADE"
|
||||
label="门店业态"
|
||||
options={SHOPTRADEList}
|
||||
request={() => {
|
||||
return processTreeData(BUSINESSTRADEYNTree)
|
||||
}}
|
||||
fieldProps={{
|
||||
treeDefaultExpandAll: true, // 默认展开所有节点
|
||||
showSearch: true, // 可选:添加搜索功能
|
||||
treeNodeFilterProp: 'label', // 可选:按标签搜索
|
||||
}}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
@ -1393,9 +1500,6 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> =
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -3,21 +3,48 @@ 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<any>()
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const modalRef = useRef<FormInstance>();
|
||||
|
||||
// 查询的条件
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
const [currentRow, setCurrentRow] = useState<any>();
|
||||
const [modalVisible, handleModalVisible] = useState<boolean>();
|
||||
const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交
|
||||
// 弹出框拖动效果
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||
|
||||
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 ? <a onClick={() => {
|
||||
console.log('recordrecordrecordrecord', record);
|
||||
setCurrentRow(record);
|
||||
handleModalVisible(true)
|
||||
}}>{record?.SALEBILL_CODE}</a> : "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<div>
|
||||
@ -276,6 +376,276 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<Modal
|
||||
className="MallOrderManageModal"
|
||||
// title={
|
||||
// <div
|
||||
// style={{
|
||||
// width: '100%',
|
||||
// cursor: 'move',
|
||||
// }}
|
||||
// onMouseOver={() => {
|
||||
// if (disabled) {
|
||||
// setDraggleDisabled(false)
|
||||
// }
|
||||
// }}
|
||||
// onMouseOut={() => {
|
||||
// setDraggleDisabled(true)
|
||||
// }}
|
||||
|
||||
// onFocus={() => { }}
|
||||
// onBlur={() => { }}
|
||||
// >
|
||||
// {'订单详情'}
|
||||
// </div>
|
||||
// }
|
||||
title={false}
|
||||
closeIcon={<div></div>}
|
||||
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 <Draggable
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
handle=".bookingOrderModalTop"
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
formRef={modalRef}
|
||||
submitter={false}
|
||||
initialValues={currentRow ? {
|
||||
...currentRow,
|
||||
ORDER_DATE: currentRow?.ORDER_DATE ? moment(currentRow?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : ''
|
||||
} : {}}
|
||||
>
|
||||
<div className="bookingOrderModalTop">
|
||||
<div className="modalTopLeft">
|
||||
<img className="memberIcon" src={orderIcon} />
|
||||
<span className="modalTitle">订单详情</span>
|
||||
</div>
|
||||
<div className="modalTopRight">
|
||||
<img className="memberIcon" src={closeIcon} onClick={() => {
|
||||
handleCloseModal()
|
||||
}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bookingOrderModalCenter">
|
||||
<div className="smallTitle">订单信息</div>
|
||||
|
||||
<Row gutter={8}>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"SALEBILL_CODE"}
|
||||
label={"订单编码"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"CHANNEL_TYPE"}
|
||||
label={"支付渠道"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"ORDER_DATE"}
|
||||
label={"下单时间"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"RECORD_COUNT"}
|
||||
label={"商品种类"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"TOTAL_COUNT"}
|
||||
label={"商品件数"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"ORDER_AMOUNT"}
|
||||
label={"订单金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"COUPON_AMOUNT"}
|
||||
label={"优惠金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"PACK_AMOUNT"}
|
||||
label={"打包金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"CONSUME_SCORE"}
|
||||
label={"使用积分"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"PAY_AMOUNT"}
|
||||
label={"实付金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"COST_AMOUNT"}
|
||||
label={"成本金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"SALEBILL_STATE"}
|
||||
label={"订单状态"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[
|
||||
{ label: "订单待支付", value: 1005 },
|
||||
{ label: "订单待制作", value: 1010 },
|
||||
{ label: "订单待取餐", value: 2000 },
|
||||
{ label: "订单已完成", value: 3000 },
|
||||
{ label: "退款申请中", value: 8000 },
|
||||
{ label: "订单已退款", value: 8900 },
|
||||
{ label: "订单已关闭", value: 9000 },
|
||||
{ label: "订单已撤销", value: 9999 },
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"COMMENT_STATE"}
|
||||
label={"订单评价状态"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[
|
||||
{ label: "未评价", value: 0 },
|
||||
{ label: "已评价", value: 1 },
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"TAKE_TYPE"}
|
||||
label={"取餐方式"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[
|
||||
{ label: "堂食", value: 1000 },
|
||||
{ label: "预约", value: 2000 },
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"PACK_TYPE"}
|
||||
label={"就餐方式"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[
|
||||
{ label: "堂食", value: 1000 },
|
||||
{ label: "打包", value: 2000 },
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"TAKE_NUMBER"}
|
||||
label={"取餐码"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</ProForm>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ProTable
|
||||
columns={orderDetailColumns}
|
||||
bordered
|
||||
search={false}
|
||||
options={false}
|
||||
request={async () => {
|
||||
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 (
|
||||
<tr>
|
||||
<td colSpan={2} style={{ textAlign: 'center', fontWeight: 'bold' }}>合计</td>
|
||||
<td />
|
||||
<td style={{ textAlign: 'center', fontWeight: 'bold' }}>{currentRow?.TOTAL_COUNT || 0}</td>
|
||||
<td />
|
||||
<td style={{ textAlign: 'center', fontWeight: 'bold' }}>{currentRow?.ORDER_AMOUNT?.toFixed(2) || '0.00'}</td>
|
||||
</tr>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
106
src/pages/travelMember/MallOrderManage/style.less
Normal file
106
src/pages/travelMember/MallOrderManage/style.less
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,564 @@
|
||||
// 订单售后管理
|
||||
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<any>()
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const modalRef = useRef<FormInstance>();
|
||||
// 查询的条件
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
const [currentRow, setCurrentRow] = useState<any>();
|
||||
const [modalVisible, handleModalVisible] = useState<boolean>();
|
||||
const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交
|
||||
// 弹出框拖动效果
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||
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 ? <a onClick={() => {
|
||||
setCurrentRow(record);
|
||||
handleModalVisible(true)
|
||||
}}>
|
||||
{record?.SALEBILL_CODE}
|
||||
</a> : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<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 = {
|
||||
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={{
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<Modal
|
||||
className="OrderAfterSalesManageModal"
|
||||
// title={
|
||||
// <div
|
||||
// style={{
|
||||
// width: '100%',
|
||||
// cursor: 'move',
|
||||
// }}
|
||||
// onMouseOver={() => {
|
||||
// if (disabled) {
|
||||
// setDraggleDisabled(false)
|
||||
// }
|
||||
// }}
|
||||
// onMouseOut={() => {
|
||||
// setDraggleDisabled(true)
|
||||
// }}
|
||||
|
||||
// onFocus={() => { }}
|
||||
// onBlur={() => { }}
|
||||
// >
|
||||
// {'订单详情'}
|
||||
// </div>
|
||||
// }
|
||||
title={false}
|
||||
closeIcon={<div></div>}
|
||||
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 <Draggable
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
handle=".bookingOrderModalTop"
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
formRef={modalRef}
|
||||
submitter={false}
|
||||
initialValues={currentRow ? {
|
||||
...currentRow,
|
||||
ORDER_DATE: currentRow?.ORDER_DATE ? moment(currentRow?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : ''
|
||||
} : {}}
|
||||
>
|
||||
<div className="bookingOrderModalTop">
|
||||
<div className="modalTopLeft">
|
||||
<img className="memberIcon" src={orderIcon} />
|
||||
<span className="modalTitle">订单详情</span>
|
||||
</div>
|
||||
<div className="modalTopRight">
|
||||
<img className="memberIcon" src={closeIcon} onClick={() => {
|
||||
handleCloseModal()
|
||||
}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bookingOrderModalCenter">
|
||||
<div className="smallTitle">订单信息</div>
|
||||
|
||||
<Row gutter={8}>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"SALEBILL_CODE"}
|
||||
label={"订单编码"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"CHANNEL_TYPE"}
|
||||
label={"支付渠道"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"ORDER_DATE"}
|
||||
label={"下单时间"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"RECORD_COUNT"}
|
||||
label={"商品种类"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"TOTAL_COUNT"}
|
||||
label={"商品件数"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"ORDER_AMOUNT"}
|
||||
label={"订单金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"COUPON_AMOUNT"}
|
||||
label={"优惠金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"PACK_AMOUNT"}
|
||||
label={"打包金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"CONSUME_SCORE"}
|
||||
label={"使用积分"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"PAY_AMOUNT"}
|
||||
label={"实付金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"COST_AMOUNT"}
|
||||
label={"成本金额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"SALEBILL_STATE"}
|
||||
label={"订单状态"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[
|
||||
{ label: "订单待支付", value: 1005 },
|
||||
{ label: "订单待制作", value: 1010 },
|
||||
{ label: "订单待取餐", value: 2000 },
|
||||
{ label: "订单已完成", value: 3000 },
|
||||
{ label: "退款申请中", value: 8000 },
|
||||
{ label: "订单已退款", value: 8900 },
|
||||
{ label: "订单已关闭", value: 9000 },
|
||||
{ label: "订单已撤销", value: 9999 },
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"COMMENT_STATE"}
|
||||
label={"订单评价状态"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[
|
||||
{ label: "未评价", value: 0 },
|
||||
{ label: "已评价", value: 1 },
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"TAKE_TYPE"}
|
||||
label={"取餐方式"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[
|
||||
{ label: "堂食", value: 1000 },
|
||||
{ label: "预约", value: 2000 },
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"PACK_TYPE"}
|
||||
label={"就餐方式"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[
|
||||
{ label: "堂食", value: 1000 },
|
||||
{ label: "打包", value: 2000 },
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"TAKE_NUMBER"}
|
||||
label={"取餐码"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</ProForm>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ProTable
|
||||
columns={orderDetailColumns}
|
||||
bordered
|
||||
search={false}
|
||||
options={false}
|
||||
request={async () => {
|
||||
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 (
|
||||
<tr>
|
||||
<td colSpan={2} style={{ textAlign: 'center', fontWeight: 'bold' }}>合计</td>
|
||||
<td />
|
||||
<td style={{ textAlign: 'center', fontWeight: 'bold' }}>{currentRow?.TOTAL_COUNT || 0}</td>
|
||||
<td />
|
||||
<td style={{ textAlign: 'center', fontWeight: 'bold' }}>{currentRow?.ORDER_AMOUNT?.toFixed(2) || '0.00'}</td>
|
||||
</tr>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
106
src/pages/travelMember/OrderAfterSalesManage/style.less
Normal file
106
src/pages/travelMember/OrderAfterSalesManage/style.less
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<string>()
|
||||
// 显示新增点餐分类的悬浮框
|
||||
const [showFoodTypeModal, setShowFoodTypeModal] = useState<boolean>(false)
|
||||
|
||||
// 获取商品的悬浮框
|
||||
const [getProducts, setGetProducts] = useState<boolean>(false)
|
||||
// 判断是否是第一次进入到页面
|
||||
const [isFirst, setIsFirst] = useState<boolean>(true)
|
||||
// 选择要上架的商品
|
||||
const [selectListShop, setSelectListShop] = useState<any>()
|
||||
// 点击选择了的商品上架的加载效果
|
||||
const [selectListShopLoading, setSelectListShopLoading] = useState<boolean>(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 ? <a onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
|
||||
setCurrentRow(record)
|
||||
setShowDetail(true)
|
||||
}}>{record?.COMMODITY_NAME}</a> : ""
|
||||
@ -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 (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
@ -282,8 +416,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
paddingRight: 0
|
||||
}}>
|
||||
<ProTable
|
||||
style={{ height: 'calc(100vh - 135px)', background: '#fff' }}
|
||||
scroll={{ y: 'calc(100vh - 410px)' }}
|
||||
scroll={{ x: "100%", y: 'calc(100vh - 410px)' }}
|
||||
rowKey={(record) => {
|
||||
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,16 +463,25 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
columns={columns}
|
||||
toolbar={{
|
||||
actions: [
|
||||
selectedId ?
|
||||
<>
|
||||
<Button onClick={() => {
|
||||
setGetProducts(true)
|
||||
}}>获取商品</Button>
|
||||
< Button type={"primary"} onClick={() => {
|
||||
setShowDetail(true)
|
||||
}}>新增商品</Button>
|
||||
</>
|
||||
: "",
|
||||
|
||||
],
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{/* 图片预览组件 */}
|
||||
{fileList && fileList.length > 0 && <div style={{ display: 'none' }}>
|
||||
{
|
||||
fileList && fileList.length > 0 && <div style={{ display: 'none' }}>
|
||||
<Image.PreviewGroup
|
||||
preview={{
|
||||
visible: imagePreviewVisible,
|
||||
@ -345,7 +493,8 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
fileList.map((n) => <Image src={n.url} key={n.url} />)
|
||||
}
|
||||
</Image.PreviewGroup>
|
||||
</div>}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<Modal
|
||||
@ -383,6 +532,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
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 ? {
|
||||
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
|
||||
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 }> = (
|
||||
<Row gutter={8}>
|
||||
<Col span={18}>
|
||||
<ProFormTreeSelect
|
||||
name="COMMODITY_TYPE"
|
||||
name="USERDEFINEDTYPE_ID"
|
||||
label="商品类别"
|
||||
request={async () => {
|
||||
// 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 }> = (
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col style={{ display: 'none' }}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_NAME"
|
||||
label=""
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_NAME"
|
||||
@ -509,14 +696,28 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="LIMIT_DAILYCOUNT"
|
||||
name="COMMODITY_STOCK"
|
||||
label="每日可售"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<ProFormDateRangePicker
|
||||
name=""
|
||||
<Col span={8}>
|
||||
<ProFormDatePicker
|
||||
width={'lg'}
|
||||
name="UPPER_DATE"
|
||||
label="生效时间"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择生效时间'
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDatePicker
|
||||
width={'lg'}
|
||||
name="OFF_DATE"
|
||||
label="下架时间"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
@ -531,12 +732,6 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
label="商品规格"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_HOTKEY"
|
||||
label="快捷键码"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_RETAILPRICE"
|
||||
@ -565,7 +760,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
<ProFormSelect
|
||||
name="UPPER_STATE"
|
||||
label="上架状态"
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
options={[{ label: "已上架", value: 1 }, { label: "未上架", value: 0 }]}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
@ -576,33 +771,33 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="OPERATE_PERSON"
|
||||
name="STAFF_NAME"
|
||||
label="操作人员"
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="OPERATE_TIME"
|
||||
name="OPERATE_DATE"
|
||||
label="操作时间"
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormText
|
||||
name="COMMODITY_INTRO"
|
||||
name="COMMODITY_EN"
|
||||
label="商品简介"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormUploadButton
|
||||
name=""
|
||||
name="ImageInfo"
|
||||
label="商品图片"
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
max={1}
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
maxCount: 1,
|
||||
onPreview: handlePreview,
|
||||
fileList: fileList, // 绑定 fileList
|
||||
onChange: async (info: any) => {
|
||||
@ -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 }> = (
|
||||
</ProForm>
|
||||
</Modal>
|
||||
|
||||
|
||||
|
||||
|
||||
<Modal
|
||||
title={"新增点餐分类"}
|
||||
destroyOnClose={true}
|
||||
@ -666,6 +864,98 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
>
|
||||
<OrderCategoryManage />
|
||||
</Modal>
|
||||
|
||||
|
||||
{/* 获取商品的悬浮框 */}
|
||||
<Modal
|
||||
title={"获取商品"}
|
||||
destroyOnClose={true}
|
||||
width={1400}
|
||||
visible={getProducts}
|
||||
footer={<div style={{ width: "100%", display: 'flex', justifyContent: 'flex-end', boxSizing: 'border-box', padding: '0 16px' }}>
|
||||
<Button type={"primary"} loading={selectListShopLoading} onClick={async () => {
|
||||
if (selectListShop && selectListShop.length > 0) {
|
||||
setSelectListShopLoading(true)
|
||||
console.log('selectListShopselectListShopselectListShop', selectListShop);
|
||||
|
||||
|
||||
let list: any = []
|
||||
selectListShop.forEach((item: any) => {
|
||||
let obj: any = JSON.parse(JSON.stringify(item))
|
||||
obj.MERCHANTS_ID = selectedId
|
||||
obj.UPPER_STATE = 1
|
||||
obj.STAFF_ID = currentUser?.ID
|
||||
obj.STAFF_NAME = currentUser?.Name
|
||||
obj.OPERATE_DATE = moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
obj.PROVINCE_CODE = currentUser?.ProvinceCode
|
||||
list.push(obj)
|
||||
})
|
||||
|
||||
const req: any = {
|
||||
list: list
|
||||
}
|
||||
console.log('req', req);
|
||||
|
||||
const data = await handeSyncSellerCommodityInfo(req)
|
||||
console.log('data', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success("同步成功!")
|
||||
setGetProducts(false)
|
||||
setSelectListShop([])
|
||||
setSelectListShopLoading(false)
|
||||
actionRef.current?.reload()
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
} else {
|
||||
message.error('请勾选需要上架的商品!')
|
||||
}
|
||||
}}>确认上架</Button>
|
||||
</div>}
|
||||
onCancel={() => {
|
||||
setGetProducts(false)
|
||||
setSelectListShop([])
|
||||
setSelectListShopLoading(false)
|
||||
}}
|
||||
bodyStyle={{
|
||||
maxHeight: '700px', // 你可以根据需要调整高度
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
>
|
||||
|
||||
<ProTable
|
||||
columns={getProductsColumns}
|
||||
bordered
|
||||
search={false}
|
||||
rowKey={"COMMODITY_ID"}
|
||||
options={false}
|
||||
request={async () => {
|
||||
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)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
</div >
|
||||
);
|
||||
};
|
||||
|
||||
@ -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,6 +38,13 @@ const LeftSelectMallType = ({ setSelectedId, reload, actionRef, currentUser, wid
|
||||
const [isShowAllInTree, setIsShowAllInTree] = useState<boolean>(false)
|
||||
// 加载服务区树
|
||||
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
||||
|
||||
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: "",
|
||||
@ -46,7 +54,12 @@ const LeftSelectMallType = ({ setSelectedId, reload, actionRef, currentUser, wid
|
||||
const data = await handlGetUSERDEFINEDTYPEList(req);
|
||||
setTreeView(data)
|
||||
setData(data)
|
||||
|
||||
session.set("USERDEFINEDTYPEList", data)
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
})
|
||||
// 显示服务区树搜索框
|
||||
const [showServiceSearchBox, setShowServiceSearchBox] = useState<boolean>(false)
|
||||
|
||||
@ -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<ActionType>();
|
||||
const ruleActionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [currentRow, setCurrentRow] = useState<any>();
|
||||
const [showDetail, setShowDetail] = useState<boolean>();
|
||||
@ -70,7 +85,24 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
const [selectedRows, setSelectedRows] = useState<any>()
|
||||
// 当前商品关联的规格数据
|
||||
const [specsData, setSpecsData] = useState<any>()
|
||||
// 主图图片
|
||||
const [mainImgList, setMainImgList] = useState<any>()
|
||||
// 头部轮播框
|
||||
const [headerImgList, setHeaderImgList] = useState<any>()
|
||||
// 详情图
|
||||
const [detailImgList, setDetailImgList] = useState<any>()
|
||||
// 文件列表
|
||||
const [fileList, setFileList] = useState<any>([])
|
||||
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(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
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
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 <Input value={record.COMMODITY_STOCK} onChange={(e: any) => {
|
||||
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 <Input value={record.COMMODITY_RETAILPRICE} onChange={(e: any) => {
|
||||
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 <Input value={record.COMMODITY_MEMBERPRICE} onChange={(e: any) => {
|
||||
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 <Input value={record.COMMODITY_PURCHASEPRICE} onChange={(e: any) => {
|
||||
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 (
|
||||
<Space>
|
||||
<Popconfirm
|
||||
title="确认删除该商品规格嘛?"
|
||||
onConfirm={async () => {
|
||||
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()
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
// 新增多规格的表格
|
||||
@ -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 (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
@ -501,28 +681,29 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
</div>
|
||||
{/* 添加商品的悬浮框 */}
|
||||
<Modal
|
||||
title={currentRow ? '更新商品管理' : '新建商品管理'}
|
||||
// title={
|
||||
// <div
|
||||
// style={{
|
||||
// width: '100%',
|
||||
// cursor: 'move',
|
||||
// }}
|
||||
// onMouseOver={() => {
|
||||
// if (disabled) {
|
||||
// setDraggleDisabled(false)
|
||||
// }
|
||||
// }}
|
||||
// onMouseOut={() => {
|
||||
// setDraggleDisabled(true)
|
||||
// }}
|
||||
// title={currentRow ? '更新商品管理' : '新建商品管理'}
|
||||
title={
|
||||
<div
|
||||
className='productListing'
|
||||
style={{
|
||||
width: '100%',
|
||||
cursor: 'move',
|
||||
}}
|
||||
onMouseOver={() => {
|
||||
if (disabled) {
|
||||
setDraggleDisabled(false)
|
||||
}
|
||||
}}
|
||||
onMouseOut={() => {
|
||||
setDraggleDisabled(true)
|
||||
}}
|
||||
|
||||
// onFocus={() => { }}
|
||||
// onBlur={() => { }}
|
||||
// >
|
||||
// {currentRow ? '更新商品管理' : '新建商品管理'}
|
||||
// </div>
|
||||
// }
|
||||
onFocus={() => { }}
|
||||
onBlur={() => { }}
|
||||
>
|
||||
{currentRow ? '更新商品管理' : '新建商品管理'}
|
||||
</div>
|
||||
}
|
||||
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={<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
<div>
|
||||
{
|
||||
@ -556,6 +743,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
// 清空一下 商品关联表的选择行
|
||||
setSelectedRowKeys([])
|
||||
setSelectedRows([])
|
||||
setMainImgList([])
|
||||
setHeaderImgList([])
|
||||
setDetailImgList([])
|
||||
}}>取 消</Button>
|
||||
<Button type={"primary"} loading={confirmLoading} onClick={() => {
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
@ -571,15 +761,16 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
formRef?.current?.submit()
|
||||
})
|
||||
}}
|
||||
// modalRender={(modal) => {
|
||||
// return <Draggable
|
||||
// disabled={disabled}
|
||||
// bounds={bounds}
|
||||
// onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
// >
|
||||
// <div ref={draggleRef}>{modal}</div>
|
||||
// </Draggable>
|
||||
// }}
|
||||
modalRender={(modal) => {
|
||||
return <Draggable
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
handle='.productListing'
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
@ -587,10 +778,80 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
autoFocusFirstInput
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
initialValues={currentRow ? currentRow : {
|
||||
request={async () => {
|
||||
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) {
|
||||
@ -635,8 +896,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
name="BRAND_ID"
|
||||
label="商品品牌"
|
||||
request={async () => {
|
||||
console.log('BRAND_NAMEListBRAND_NAMEListBRAND_NAMEList', BRAND_NAMEList);
|
||||
|
||||
if (BRAND_NAMEList && BRAND_NAMEList.length > 0) {
|
||||
return BRAND_NAMEList
|
||||
} else {
|
||||
@ -686,6 +945,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
name="USERDEFINEDTYPE_ID"
|
||||
label="商品分类"
|
||||
request={async () => {
|
||||
console.log('leftTreeDataleftTreeDataleftTreeData', leftTreeData);
|
||||
|
||||
return leftTreeData
|
||||
}}
|
||||
fieldProps={{
|
||||
@ -695,6 +956,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
},
|
||||
showSearch: true,
|
||||
multiple: true, // 支持多选
|
||||
allowClear: true, // 允许清除和删除
|
||||
filterTreeNode: (input, node) =>
|
||||
(node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase())
|
||||
}}
|
||||
@ -1001,6 +1263,153 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Divider orientation="left">主图</Divider>
|
||||
<Col span={24}>
|
||||
<ProFormUploadButton
|
||||
name="mainImgList"
|
||||
label="主图图片"
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
onPreview: handlePreview,
|
||||
fileList: mainImgList, // 绑定 fileList
|
||||
onChange: async (info: any) => {
|
||||
if (info.file.status === 'removed') {
|
||||
const index = mainImgList.findIndex(n => n.uid === info.file.uid);
|
||||
confirm({
|
||||
title: '确认删除该文件吗?',
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
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)
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Divider orientation="left">头部轮播图</Divider>
|
||||
<Col span={24}>
|
||||
<ProFormUploadButton
|
||||
name="headerImgList"
|
||||
label="轮播框图"
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
onPreview: handlePreview,
|
||||
fileList: headerImgList, // 绑定 fileList
|
||||
onChange: async (info: any) => {
|
||||
if (info.file.status === 'removed') {
|
||||
const index = headerImgList.findIndex(n => n.uid === info.file.uid);
|
||||
confirm({
|
||||
title: '确认删除该文件吗?',
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
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)
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Divider orientation="left">详情图</Divider>
|
||||
<Col span={24}>
|
||||
<ProFormUploadButton
|
||||
name="detailImgList"
|
||||
label="详情图"
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
onPreview: handlePreview,
|
||||
fileList: detailImgList, // 绑定 fileList
|
||||
onChange: async (info: any) => {
|
||||
if (info.file.status === 'removed') {
|
||||
const index = detailImgList.findIndex(n => n.uid === info.file.uid);
|
||||
confirm({
|
||||
title: '确认删除该文件吗?',
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
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)
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</ProForm>
|
||||
</Modal>
|
||||
@ -1009,21 +1418,75 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
<Modal
|
||||
title={"多规格管理"}
|
||||
destroyOnClose={true}
|
||||
width={1000}
|
||||
width={1200}
|
||||
visible={showMoreSpecs}
|
||||
onCancel={() => {
|
||||
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([])
|
||||
}
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
<ProTable
|
||||
actionRef={ruleActionRef}
|
||||
search={false}
|
||||
pagination={false}
|
||||
options={false}
|
||||
columns={specsColumns}
|
||||
scroll={{ x: "100%" }}
|
||||
bordered
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type={"primary"} onClick={() => {
|
||||
@ -1043,6 +1506,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
SortStr: "COMMODITY_MULTI_ID"
|
||||
}
|
||||
const data = await handeGetRTCOMMODITY_MULTIList(req)
|
||||
console.log('多规格管理', data);
|
||||
@ -1064,7 +1528,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
<Modal
|
||||
title={"新增规格管理"}
|
||||
destroyOnClose={true}
|
||||
width={800}
|
||||
width={1200}
|
||||
visible={showAddSpecsModal}
|
||||
onCancel={() => {
|
||||
setShowAddSpecsModal(false)
|
||||
@ -1073,7 +1537,19 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
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)
|
||||
}}
|
||||
>
|
||||
<ProTable
|
||||
@ -1093,13 +1569,15 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
request={async () => {
|
||||
const req = {
|
||||
searchParameter: {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: "",
|
||||
GOODSTYPE: 6000,
|
||||
USERDEFINEDTYPE_STATE: 1
|
||||
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);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -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<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [modalVisible, handleModalVisible] = useState<boolean>();
|
||||
@ -38,6 +39,10 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => {
|
||||
const [serverPartDetail, setServerPartDetail] = useState<any>()
|
||||
// 表单请求服务区的详情
|
||||
const [formDetailAll, setFormDetailAll] = useState<any>()
|
||||
// 片区的tab
|
||||
const [areaTabList, setAreaTabList] = useState<any>()
|
||||
// 选择的tab
|
||||
const [selectTab, setSelectTab] = useState<any>()
|
||||
|
||||
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 (
|
||||
<div>
|
||||
@ -304,6 +351,14 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => {
|
||||
</Radio.Group>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
{
|
||||
pageType === 2 ?
|
||||
<div style={{ width: '100%', boxSizing: 'border-box', padding: "0 48px" }}>
|
||||
<Tabs activeKey={selectTab} onChange={(e: any) => {
|
||||
setSelectTab(e)
|
||||
}} items={areaTabList} />
|
||||
</div> :
|
||||
<Row>
|
||||
<Col span={1}>
|
||||
</Col>
|
||||
@ -342,10 +397,10 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => {
|
||||
<Col span={17}>
|
||||
</Col>
|
||||
</Row>
|
||||
}
|
||||
|
||||
|
||||
{/* 下面开始是一个方位区一块的内容 */}
|
||||
|
||||
<div style={{ display: areaTabList && areaTabList.length > 0 && selectTab === areaTabList[0].key ? 'block' : 'none' }}>
|
||||
<Divider orientation="left">面积相关</Divider>
|
||||
<Row>
|
||||
<Col span={8}>
|
||||
@ -599,10 +654,10 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => {
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
{
|
||||
serverPartType === 2 ?
|
||||
<>
|
||||
<Divider orientation="left">对向信息</Divider>
|
||||
</div>
|
||||
|
||||
<div style={{ display: areaTabList && areaTabList.length > 1 && selectTab === areaTabList[1].key ? 'block' : 'none' }}>
|
||||
{/* <Divider orientation="left">对向信息</Divider>
|
||||
<Row>
|
||||
<Col span={1}></Col>
|
||||
<Col span={5}>
|
||||
@ -643,7 +698,7 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => {
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Row> */}
|
||||
<Divider orientation="left">面积相关</Divider>
|
||||
<Row>
|
||||
<Col span={8}>
|
||||
@ -897,9 +952,8 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => {
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
</> : ''
|
||||
}
|
||||
|
||||
</ProForm>
|
||||
</div >
|
||||
|
||||
@ -459,7 +459,7 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
<div style={{ height: 'calc(100% - 60px)', overflowY: 'auto', boxSizing: "border-box", paddingTop: '12px' }}>
|
||||
{
|
||||
showRightForm ?
|
||||
<ServerpartInfo onRef={serverPartRef} currentRow={{ SERVERPART_ID: currenMenu ? currenMenu : '' }} onShow={showRightForm} /> :
|
||||
<ServerpartInfo pageType={2} onRef={serverPartRef} currentRow={{ SERVERPART_ID: currenMenu ? currenMenu : '' }} onShow={showRightForm} /> :
|
||||
<LoadingBox />
|
||||
}
|
||||
</div>
|
||||
|
||||
@ -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 }
|
||||
})
|
||||
@ -586,3 +586,80 @@ export async function handeGetSPRegionShopTree(params: any) {
|
||||
}
|
||||
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
|
||||
}
|
||||
@ -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) {
|
||||
|
||||
|
||||
2
src/services/options/typings.d.ts
vendored
2
src/services/options/typings.d.ts
vendored
@ -9,7 +9,7 @@
|
||||
// 字段枚举 model( 下拉框数据字典)
|
||||
type FieldParamsModel = {
|
||||
FieldExplainField: string;
|
||||
FieldEnumStatus?: string;
|
||||
FieldEnumStatus?: string | Boolean;
|
||||
FieldEnumValue?: string;
|
||||
notformate?: boolean;
|
||||
sessionName?: string;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user