diff --git a/src/assets/detail/closeIcon.png b/src/assets/detail/closeIcon.png new file mode 100644 index 0000000..e7784e8 Binary files /dev/null and b/src/assets/detail/closeIcon.png differ diff --git a/src/assets/detail/memberDetailIcon.png b/src/assets/detail/memberDetailIcon.png new file mode 100644 index 0000000..f9e86b3 Binary files /dev/null and b/src/assets/detail/memberDetailIcon.png differ diff --git a/src/assets/detail/memberInfoIcon.png b/src/assets/detail/memberInfoIcon.png new file mode 100644 index 0000000..c6f0997 Binary files /dev/null and b/src/assets/detail/memberInfoIcon.png differ diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 88d2c47..b8790d1 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -29,7 +29,7 @@ import IconFont from '@/components/IconFont'; import type { CurrentUser } from '@/models/user' import session from '@/utils/session'; import upMenu from '@/assets/tab/upMenu.svg' -import { getFieldEnum, getFieldEnumTree, getFieldGetFieEnumList } from "@/services/options"; +import { getFieldEnum, getFieldEnumTree, getFieldGetFieEnumList, getTravelFieldEnumTree } from "@/services/options"; import { handleGetServerpartTree } from '@/pages/basicManage/serverpartAssets/service'; @@ -219,7 +219,7 @@ const BasicLayout: React.FC = (props) => { session.set('BUSINESSSTATETree', BUSINESSSTATE); } }) - + // 景区类型 getFieldEnumTree({ FieldExplainField: 'SCENICAREA_TYPE' }).then((SCENICAREATYPE: any) => { if (SCENICAREATYPE && SCENICAREATYPE.length > 0) { diff --git a/src/pages/Setting/OperationLog/index.tsx b/src/pages/Setting/OperationLog/index.tsx index 6c3bfce..b58b4e5 100644 --- a/src/pages/Setting/OperationLog/index.tsx +++ b/src/pages/Setting/OperationLog/index.tsx @@ -185,6 +185,7 @@ const saleRankReport: React.FC<{ currentUser: CurrentUser }> = (props) => { "驿付商家版": "驿付商家版", "微信公众号": "微信公众号", "驿商云客户端": "驿商云客户端", + "彩云驿出行": "彩云驿出行", }, initialValue: '驿商云平台' }, diff --git a/src/pages/travelMember/BookingMealOrder/index.tsx b/src/pages/travelMember/BookingMealOrder/index.tsx index 7efb1df..151245f 100644 --- a/src/pages/travelMember/BookingMealOrder/index.tsx +++ b/src/pages/travelMember/BookingMealOrder/index.tsx @@ -1,4 +1,4 @@ -// 预约点餐订单 +// 预约点餐订单 预约订单管理 import { ConnectState } from "@/models/connect"; import { connect, CurrentUser } from "umi"; import { useRef, useState } from "react"; @@ -6,11 +6,13 @@ import ProTable, { ActionType } from "@ant-design/pro-table"; import PageTitleBox from "@/components/PageTitleBox"; import { Button, Col, FormInstance, message, Modal, Popconfirm, Row, Space } from "antd"; import { PlusOutlined } from "@ant-design/icons"; -import { handeDeleteMERCHANTS, handeGetMERCHANTSList, handeGetSALEBILLList, handeSynchroMERCHANTS } from "../service"; +import { handeDeleteMERCHANTS, handeGetMERCHANTSList, handeGetSALEBILLDetail, handeGetSALEBILLList, handeGetSaleBillWholeList, handeGetSALEDETAILList, handeSynchroMERCHANTS } from "../service"; import Draggable from "react-draggable"; import React from "react"; import ProForm, { ProFormSelect, ProFormText, ProFormTextArea } from "@ant-design/pro-form"; import moment from 'moment' +import session from "@/utils/session"; +import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree"; const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { const { currentUser } = props @@ -29,6 +31,8 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (pr const [currentRow, setCurrentRow] = useState(); const [confirmLoading, handleConfirmLoading] = useState(false) // 弹出框的内容表单是否在提交 + let SALEBILLSTATEObj = session.get('SALEBILLSTATEObj') + const onDraggaleStart = (event, uiData) => { const { clientWidth, clientHeight } = window.document.documentElement; const targetRect = draggleRef.current?.getBoundingClientRect(); @@ -44,6 +48,22 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (pr }; 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')], + }, { dataIndex: "index", title: "序号", @@ -54,143 +74,159 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (pr ellipsis: true, }, { - dataIndex: 'MERCHANTS_TYPE', - title: '商户类型', + dataIndex: 'SALEBILL_CODE', + title: '订单编号', align: 'center', hideInSearch: true, - width: 150, - ellipsis: true, - }, - { - dataIndex: 'MERCHANTS_NAME', - title: '商户名称', - align: 'center', - hideInSearch: true, - width: 300, - ellipsis: true, - }, - { - dataIndex: 'MERCHANTS_EN', - title: '商户简称', - align: 'center', - hideInSearch: true, - width: 150, - ellipsis: true, - }, - { - dataIndex: 'MERCHANTS_AUTOTYPE', - title: '商户性质', - align: 'center', - hideInSearch: true, - width: 120, - ellipsis: true, - valueEnum: { - "1000": "企业公司", - "2000": "个体", - "3000": "自然人" - } - }, - { - dataIndex: 'TAXPAYER_IDENTIFYCODE', - title: '统一信用代码', - align: 'center', - hideInSearch: true, - width: 150, - ellipsis: true, - }, - { - dataIndex: 'MERCHANTS_TELEPHONE', - title: '联系电话', - align: 'center', - hideInSearch: true, - width: 120, - ellipsis: true, - }, - { - dataIndex: 'option', - title: '操作', - valueType: 'option', - align: 'center', - hideInSearch: true, - width: 120, - fixed: "right", + width: 200, ellipsis: true, render: (_, record) => { - return ( - - { - setCurrentRow({ ...record }); - handleModalVisible(true); - }} - > - 编辑 - - { - await handelDelete(record.MERCHANTS_ID); - }} - > - 删除 - - - ); - }, + return record?.SALEBILL_CODE ? { + setCurrentRow(record); + handleModalVisible(true) + }}>{record?.SALEBILL_CODE} : "-" + } }, + { + dataIndex: 'SHOPNAME', + title: '门店名称', + align: 'center', + hideInSearch: true, + width: 150, + ellipsis: true, + }, + { + dataIndex: 'ORDER_PERSON', + title: '下单人员', + align: 'center', + hideInSearch: true, + width: 250, + ellipsis: true, + }, + { + dataIndex: 'ORDER_AMOUNT', + title: '订单金额', + align: 'center', + hideInSearch: true, + width: 120, + ellipsis: true, + }, + { + dataIndex: 'COUPON_AMOUNT', + title: '优惠金额', + align: 'center', + hideInSearch: true, + width: 120, + ellipsis: true, + }, + { + dataIndex: 'PAY_AMOUNT', + title: '实付金额', + align: 'center', + hideInSearch: true, + width: 120, + ellipsis: true, + }, + // { + // dataIndex: 'COUPON_SEND_ID', + // title: '优惠券名', + // align: 'center', + // hideInSearch: true, + // width: 120, + // ellipsis: true, + // }, + { + dataIndex: 'ORDER_DATE', + title: '订单时间', + align: 'center', + hideInSearch: true, + width: 170, + ellipsis: true, + render: (_, record) => { + return record?.ORDER_DATE ? moment(record?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : '' + } + }, + { + dataIndex: 'SALEBILL_STATE', + title: '订单状态', + align: 'center', + width: 120, + ellipsis: true, + valueType: 'select', + valueEnum: { + "0": "全部", + "1005": "订单待支付", + "1010": "订单待制作", + "2000": "订单待取餐", + "3000": "订单已完成", + "8000": "退款申请中", + "8900": "订单已退款", + "9000": "订单已关闭", + "9999": "订单已撤销", + }, + initialValue: "0" + } ] - const handelDelete = async (MERCHANTS_ID: number) => { - const result = await handeDeleteMERCHANTS({ MERCHANTSId: MERCHANTS_ID }); - - if (result.Result_Code !== 100) { - message.error(`${result.Result_Desc}` || `${result.Result_Code}:删除失败`); - } else { - message.success('删除成功!'); - actionRef.current?.reload() - } - }; - - const handleAddUpdate = async (res: any) => { - let req: any = {} - if (currentRow?.USERDEFINEDTYPE_ID) { - req = { - ...currentRow, - ...res, - OWNERUNIT_ID: currentUser?.OwnerUnitId, - OWNERUNIT_NAME: currentUser?.OwnerUnitName, - PROVINCE_CODE: currentUser?.ProvinceCode, - OPERATE_PERSON: currentUser?.ID, - OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), - } - } else { - req = { - ...res, - OWNERUNIT_ID: currentUser?.OwnerUnitId, - OWNERUNIT_NAME: currentUser?.OwnerUnitName, - PROVINCE_CODE: currentUser?.ProvinceCode, - OPERATE_PERSON: currentUser?.ID, - OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), - } - } - const data = await handeSynchroMERCHANTS(req) - handleConfirmLoading(false) - if (data.Result_Code === 100) { - message.success("新增成功!") - setCurrentRow(undefined) - formRef?.current?.resetFields() - handleModalVisible(false) - actionRef.current?.reload() - } else { - message.error(data.Result_Desc) - } - }; + // 订单详情的表格 + 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, + }, + ] return (
+
= (pr search={{ span: 6, labelWidth: 'auto' }} // 请求数据 request={async (params, sorter) => { + if (!selectedId) { + return + } const req = { searchParameter: { - RESERVATION_DATE: "2025-06-01", - RESERVATION_ENDDATE: "2025-07-01", - OWNERUNIT_ID: currentUser?.OwnerUnitId, - PROVINCE_CODE: currentUser?.ProvinceCode, + SERVERPART_IDS: selectedId, + SALEBILL_TYPES: 6000, + ORDER_DATE_Start: params?.ORDER_DATE_Start || "", + ORDER_DATE_End: params?.ORDER_DATE_End || "", + SALEBILL_STATES: params?.SALEBILL_STATE === "0" ? "1010,2000,3000" : params?.SALEBILL_STATE }, PageIndex: 1, PageSize: 999999, + SortStr: "ORDER_DATE desc", } - const data = await handeGetSALEBILLList(req); + const data = await handeGetSaleBillWholeList(req) + // const req = { + // searchParameter: { + // ORDER_DATE_Start: params?.ORDER_DATE_Start || "", + // ORDER_DATE_End: params?.ORDER_DATE_End || "", + // SALEBILL_TYPE: 6000, + // OWNERUNIT_ID: currentUser?.OwnerUnitId, + // PROVINCE_CODE: currentUser?.ProvinceCode, + // SALEBILL_STATE: params?.SALEBILL_STATE === "0" ? "" : params?.SALEBILL_STATE + // }, + // PageIndex: 1, + // PageSize: 999999, + // } + // const data = await handeGetSALEBILLList(req); console.log('datadatadatadatadata', data); if (data.List && data.List.length > 0) { return { data: data.List, success: true, total: data.TotalCount } @@ -227,17 +281,6 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (pr columns={columns} toolbar={{ actions: [ - // 新增按钮 - ], }} /> @@ -264,7 +307,7 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (pr onFocus={() => { }} onBlur={() => { }} > - {currentRow ? '更新商品管理' : '新建商品管理'} + {'订单详情'}
} destroyOnClose={true} @@ -278,14 +321,9 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (pr onCancel={() => { handleConfirmLoading(false) handleModalVisible(false) + setCurrentRow(undefined); }} - - onOk={async () => { // 提交框内的数据 - formRef?.current?.validateFields().then(() => { - handleConfirmLoading(true) - formRef?.current?.submit() - }) - }} + footer={false} modalRender={(modal) => { return = (pr }} > - { - let newValue: any = { ...values }; - if (currentRow) { - // 编辑数据 - newValue = { ...values, COMMODITY_ID: currentRow.COMMODITY_ID }; + + { + const req: any = { + searchParameter: { + SALEBILL_ID: currentRow?.SALEBILL_ID + }, + PageIndex: 1, + PageSize: 999999, } - // 如果有开关,要把开关的代码写进去 - await handleAddUpdate(newValue); - - handleConfirmLoading(false) - handleModalVisible(false); + const data = await handeGetSALEDETAILList(req) + console.log('datadatadata', data); + if (data.List && data.List.length > 0) { + return { data: data.List, success: true, total: data.TotalCount } + } + return { data: [], success: true } }} - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - + summary={() => { + // extra 是 request 返回的 extra 字段 + return ( + + 合计 + + {currentRow?.TOTAL_COUNT || 0} + + {currentRow?.ORDER_AMOUNT?.toFixed(2) || '0.00'} + + ) + }} + /> - - - - - - - - - -
) diff --git a/src/pages/travelMember/MallOrderManage/index.tsx b/src/pages/travelMember/MallOrderManage/index.tsx index 18e74dd..fdc8487 100644 --- a/src/pages/travelMember/MallOrderManage/index.tsx +++ b/src/pages/travelMember/MallOrderManage/index.tsx @@ -8,7 +8,7 @@ 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, handeGetSALEDETAILList } from "../service"; +import { handeGetSALEBILLList, handeGetSaleBillWholeList, handeGetSALEDETAILList } from "../service"; const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { @@ -16,51 +16,73 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { const actionRef = useRef(); const formRef = useRef(); - // 查询的条件 const [searchParams, setSearchParams] = useState() const columns: any = [ { - title: "查询时间", - dataIndex: "searchTime", - valueType: "dateRange", + title: '查询时间', + dataIndex: 'search_date', + valueType: 'dateRange', hideInTable: true, - initialValue: [moment().subtract(1, 'day'), moment().subtract(1, 'day').startOf('M')], + hideInDescriptions: true, search: { transform: (value) => { return { - ORDERDATE_START: moment(value[0]).format('YYYY-MM-DD'), - ORDERDATE_END: moment(value[1]).format('YYYY-MM-DD'), + ORDER_DATE_Start: value[0], + ORDER_DATE_End: value[1], }; }, }, - fieldProps: { - picker: "month", - format: 'YYYY-MM', - } + initialValue: [moment().format('YYYY-MM-DD'), moment().add(-1, 'M').format('YYYY-MM-DD')], }, { title: "订单状态", dataIndex: "orderStatus", valueType: "select", - valueEnum: {}, + valueEnum: { + "0": "全部", + "1005": "订单待支付", + "1010": "订单待发货", + "2010": "订单已发货", + "3000": "订单已完成", + "8000": "退款申请中", + "8900": "订单已退款", + "9000": "订单已关闭", + "9999": "订单已撤销" + }, + initialValue: '0', hideInTable: true, }, { title: "订单类型", dataIndex: "orderType", valueType: "select", - valueEnum: {}, + valueEnum: { + "0": "全部", + "3000": "零售商城", + "3001": "工会商城", + "3002": "品诺商城", + "3010": "积分商城" + }, + initialValue: '0', hideInTable: true, }, { title: "支付方式", - dataIndex: "paymentMethod", + dataIndex: "PAYMETHOD", valueType: "select", - valueEnum: {}, + valueEnum: { + "0": "全部", + "支付宝": "支付宝", + "微信": "微信", + "积分兑换": "积分兑换", + "余额支付": "余额支付", + }, + initialValue: '0', hideInTable: true, }, + { title: "序号", dataIndex: "index", @@ -126,13 +148,27 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { align: "center", valueType: 'select', valueEnum: { - "2000": "充值驿付会员", - "6000": "预约点餐" - } + "3000": "零售商城", + "3001": "工会商城", + "3002": "品诺商城", + "3010": "积分商城" + }, + // valueEnum: { + // "2000": "充值驿付会员", + // "6000": "预约点餐" + // } }, { title: "支付方式", dataIndex: "PAY_METHOD", + valueType: "select", + valueEnum: { + "0": "全部", + "支付宝": "支付宝", + "微信": "微信", + "积分兑换": "积分兑换", + "余额支付": "余额支付", + }, width: 120, hideInSearch: true, ellipsis: true, @@ -163,6 +199,18 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { width: 120, hideInSearch: true, ellipsis: true, + valueType: "select", + valueEnum: { + "0": "全部", + "1005": "订单待支付", + "1010": "订单待发货", + "2010": "订单已发货", + "3000": "订单已完成", + "8000": "退款申请中", + "8900": "订单已退款", + "9000": "订单已关闭", + "9999": "订单已撤销" + }, align: "center", }, { @@ -203,16 +251,20 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser }> = (props) => { SearchParameter: { OWNERUNIT_ID: currentUser?.OwnerUnitId, PROVINCE_CODE: currentUser?.ProvinceCode, - SALEBILL_TYPE: "3000", - ORDERDATE_START: params?.ORDERDATE_START || "", - ORDERDATE_END: params?.ORDERDATE_END || "", - SALEBILL_STATE: "" + SALEBILL_TYPES: params?.orderType === '0' ? '3000,3001,3002,3010' : params?.orderType, + ORDER_DATE_Start: params?.ORDER_DATE_Start || "", + ORDER_DATE_End: params?.ORDER_DATE_End || "", + SALEBILL_STATES: params?.SALEBILL_STATE === "0" ? "1010,2010,3000" : params?.SALEBILL_STATE, + CHANNEL_TYPE: params?.PAY_METHOD === "0" ? "" : params?.PAY_METHOD }, PageIndex: 1, PageSize: 999999, SortStr: "ORDER_DATE desc", } - const data = await handeGetSALEBILLList(req); + 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 } diff --git a/src/pages/travelMember/MemberAddress/index.tsx b/src/pages/travelMember/MemberAddress/index.tsx index ca989a3..3133ed1 100644 --- a/src/pages/travelMember/MemberAddress/index.tsx +++ b/src/pages/travelMember/MemberAddress/index.tsx @@ -19,7 +19,7 @@ import type { ConnectState } from '@/models/connect'; import type { ActionType, ProColumns } from '@ant-design/pro-table'; import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; import type { FormInstance } from 'antd'; -import { handleDeleteMEMBERADDRESS, handleGetMEMBERADDRESSList, handleSynchroMEMBERADDRESS } from '../service'; +import { handeGetMemberAddressCombineList, handleDeleteMEMBERADDRESS, handleGetMEMBERADDRESSList, handleSynchroMEMBERADDRESS } from '../service'; import PageTitleBox from '@/components/PageTitleBox'; @@ -27,6 +27,7 @@ import PageTitleBox from '@/components/PageTitleBox'; const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { const { currentUser } = props const actionRef = useRef(); + const modalActionRef = useRef(); const formRef = useRef(); const [currentRow, setCurrentRow] = useState(); const [showDetail, setShowDetail] = useState(); @@ -43,6 +44,11 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props const [city, setCity] = useState(''); const [county, setCounty] = useState(''); const [address, setAddress] = useState(''); + // 显示详情抽屉 + const [showDetailDrawer, setShowDetailDrawer] = useState(false) + // 显示当前选中的外层表格数据 + const [currentBigRow, setCurrentBigRow] = useState(false) + const onDraggaleStart = (event, uiData) => { const { clientWidth, clientHeight } = window.document.documentElement; @@ -86,6 +92,12 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props width: 150, align: 'center', hideInSearch: true, + render: (_, record) => { + return record?.USER_NAME ? { + setCurrentBigRow(record) + setShowDetailDrawer(true) + }}>{record?.USER_NAME} : "-" + } }, { dataIndex: 'USER_SEX', @@ -128,6 +140,175 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props // align: 'center', // hideInSearch: true, // }, + // { + // dataIndex: 'ADDRESS', + // title: '收货地址', + // width: 300, + // align: 'center', + // hideInSearch: true, + // }, + // { + // dataIndex: 'DOORPLATE', + // title: '门牌号码', + // width: 300, + // align: 'center', + // hideInSearch: true, + // }, + // { + // dataIndex: 'ISDEFAULT', + // title: '默认地址', + // width: 120, + // align: 'center', + // hideInSearch: true, + // valueType: 'select', + // valueEnum: { + // "1": "是", + // "0": "否", + // } + // }, + // { + // dataIndex: 'TAGTYPE', + // title: '地址类型', + // width: 120, + // align: 'center', + // hideInSearch: true, + // valueType: 'select', + // valueEnum: { + // "1000": "家", + // "2000": "公司", + // "3000": "其他", + // } + // }, + + // { + // dataIndex: 'CREATE_STAFF_NAME', + // title: '创建人名称', + // align: 'center', + // hideInSearch: true, + // }, + // { + // dataIndex: 'CREATE_DATE', + // title: '创建时间', + // valueType: 'date', + // align: 'center', + // hideInSearch: true, + // }, + // { + // dataIndex: 'UPDATE_STAFF_NAME', + // title: '更新人名称', + // align: 'center', + // hideInSearch: true, + // }, + // { + // dataIndex: 'UPDATE_DATE', + // title: '更新时间', + // valueType: 'date', + // align: 'center', + // hideInSearch: true, + // }, + // { + // dataIndex: 'MEMBERADDRESS_DESC', + // title: '备注说明', + // align: 'center', + // hideInSearch: true, + // }, + // { + // dataIndex: 'option', + // title: '操作', + // width: 120, + // align: 'center', + // valueType: 'option', + // hideInSearch: true, + // render: (_, record) => { + // return ( + // + // { + // console.log('record', record); + + // setProvince(record?.RECEIVE_PROVINCE) + // setCity(record?.RECEIVE_CITY) + // setCounty(record?.RECEIVE_COUNTY) + // setCurrentRow({ ...record }); + // handleModalVisible(true); + // }} + // > + // 编辑 + // + // { + // await handelDelete(record.MEMBERADDRESS_ID); + // }} + // > + // 删除 + // + // + // ); + // }, + // }, + ]; + + // 抽屉里面的table的columns + const drawerColumns: any = [ + { + dataIndex: 'searchText', + title: '', + width: 150, + align: 'center', + hideInTable: true, + fieldProps: { + placeholder: "输入收货人名称" + } + }, + { + dataIndex: 'USER_NAME', + title: '收货人名称', + width: 150, + align: 'center', + hideInSearch: true + }, + { + dataIndex: 'USER_SEX', + title: '收货人性别', + width: 120, + align: 'center', + hideInSearch: true, + valueType: 'select', + valueEnum: { + "1": "男", + "2": "女", + "0": "-", + } + }, + { + dataIndex: 'MOBILEPHONE', + title: '手机号码', + width: 150, + align: 'center', + hideInSearch: true, + }, + { + dataIndex: 'RECEIVE_PROVINCE', + title: '省/直辖市', + width: 120, + align: 'center', + hideInSearch: true, + }, + { + dataIndex: 'RECEIVE_CITY', + title: '城市/直辖市', + width: 120, + align: 'center', + hideInSearch: true, + }, + { + dataIndex: 'RECEIVE_COUNTY', + title: '区/县', + width: 150, + align: 'center', + hideInSearch: true, + }, { dataIndex: 'ADDRESS', title: '收货地址', @@ -207,6 +388,7 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props align: 'center', valueType: 'option', hideInSearch: true, + fixed: 'right', render: (_, record) => { return ( @@ -247,7 +429,7 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props message.error(`${result.Result_Desc}` || `${result.Result_Code}:删除失败`); } else { message.success('删除成功!'); - actionRef.current?.reload() + modalActionRef.current?.reload() } }; @@ -276,7 +458,7 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props formRef?.current?.resetFields() setCurrentRow(undefined) handleModalVisible(false) - actionRef.current?.reload() + modalActionRef.current?.reload() } else { message.error(data.Result_Desc) } @@ -303,21 +485,35 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props request={async (params, sorter) => { console.log('params', params); + // const req = { + // SearchParameter: { + // PROVINCE_CODE: currentUser?.ProvinceCode || "", + // OWNERUNIT_ID: 911, + // ISVALID: 1 + // }, + // PageIndex: params.current, + // PageSize: params.pageSize, + // SortStr: "CREATE_DATE desc", + // keyWord: { + // Key: "USER_NAME", + // Value: params?.searchText + // } + // } + // const data = await handleGetMEMBERADDRESSList(req); + const req = { - SearchParameter: { - PROVINCE_CODE: currentUser?.ProvinceCode || "", - OWNERUNIT_ID: 911, - ISVALID: 1 - }, + // PROVINCE_CODE: currentUser?.ProvinceCode || "", + OwnerUnitId: currentUser?.OwnerUnitId || "", + Isvalid: 1, PageIndex: params.current, PageSize: params.pageSize, SortStr: "CREATE_DATE desc", - keyWord: { - Key: "USER_NAME", - Value: params?.searchText - } + SearchKeyName: "USER_NAME", + SearchKeyValue: params?.searchText || "" } - const data = await handleGetMEMBERADDRESSList(req); + + console.log('reqreqreqreqreqreqreq', req); + const data = await handeGetMemberAddressCombineList(req) console.log('datadatadatadatadata', data); if (data.List && data.List.length > 0) { return { data: data.List, success: true, total: data.TotalCount } @@ -329,31 +525,55 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props actions: [] }} /> + { - setCurrentRow(undefined); - setShowDetail(false); + setCurrentBigRow(undefined); + setShowDetailDrawer(false); }} closable={false} + destroyOnClose > - {currentRow?.MEMBERADDRESS_ID && ( - ({ - data: currentRow || {}, - })} - params={{ - id: currentRow?.MEMBERADDRESS_ID, - }} - columns={columns} - /> - )} + { + const req = { + SearchParameter: { + MEMBERSHIP_ID: currentBigRow?.MEMBERSHIP_ID, + PROVINCE_CODE: currentUser?.ProvinceCode || "", + OWNERUNIT_ID: 911, + ISVALID: 1 + }, + PageIndex: params.current, + PageSize: params.pageSize, + SortStr: "CREATE_DATE desc", + keyWord: { + Key: "USER_NAME", + Value: params?.searchText + } + } + const data = await handleGetMEMBERADDRESSList(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 } + }} + /> + = (props disabled={disabled} bounds={bounds} onStart={(event, uiData) => onDraggaleStart(event, uiData)} + handle=".modal-drag-title" >
{modal}
diff --git a/src/pages/travelMember/MerchantEvaluationManage/index.tsx b/src/pages/travelMember/MerchantEvaluationManage/index.tsx index 9bcbf10..7d59e5d 100644 --- a/src/pages/travelMember/MerchantEvaluationManage/index.tsx +++ b/src/pages/travelMember/MerchantEvaluationManage/index.tsx @@ -1,11 +1,156 @@ // 商家评价管理 -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 type { FormInstance } from "antd"; +import { Button, message, Space, Spin, Tree } from "antd"; +import useRequest from "@ahooksjs/use-request"; +import type { ActionType } from "@ant-design/pro-table"; +import ProTable from "@ant-design/pro-table"; +import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree"; +import PageTitleBox from "@/components/PageTitleBox"; +import { handeGetCOMMENTList } from "../service"; +import moment from 'moment' + + +const MerchantEvaluationManage: React.FC<{ currentUser: CurrentUser }> = (props) => { + const { currentUser } = props + const actionRef = useRef(); + const formRef = useRef(); + const [collapsible, setCollapsible] = useState(false) + + + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + + + const columns: any = [ + { + title: "序号", + dataIndex: "index", + valueType: "index", + hideInSearch: true, + align: "center", + width: 60, + }, + { + title: "商家名称", + dataIndex: "MERCHANTS_ID", + width: 300, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "评价时间", + dataIndex: "CREATE_DATE", + width: 180, + hideInSearch: true, + ellipsis: true, + align: "center", + render: (_, record) => { + return record?.CREATE_DATE ? moment(record?.CREATE_DATE).format('YYYY-MM-DD HH:mm:ss') : "-" + } + }, + { + title: "评价人员", + dataIndex: "UPDATE_STAFF_NAME", + width: 150, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "会员类型", + dataIndex: "会员类型", + width: 150, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "消费评价", + dataIndex: "消费评价", + width: 120, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "评分", + dataIndex: "COMMENT_SCORE", + width: 120, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "评价内容", + dataIndex: "COMMENT_CONTENT", + width: 250, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + { + title: "回复内容", + dataIndex: "回复内容", + width: 250, + hideInSearch: true, + ellipsis: true, + align: "center", + }, + ] -const MerchantEvaluationManage: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { return (
- +
+ +
+ } // 列表表头 + search={{ span: 6 }} + request={async (params) => { + if (!selectedId) { + return + } + const req: any = { + SearchParameter: { + OWNERUNIT_ID: currentUser?.OwnerUnitId, + PROVINCE_CODE: currentUser?.ProvinceCode, + COMMENT_ISVALID: 1 + }, + PageIndex: 1, + PageSize: 999999, + } + const data = await handeGetCOMMENTList(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={{ + actions: [ + ] + }} + /> +
+
) } diff --git a/src/pages/travelMember/OrderProductManage/index.tsx b/src/pages/travelMember/OrderProductManage/index.tsx index e07cfb3..cb36837 100644 --- a/src/pages/travelMember/OrderProductManage/index.tsx +++ b/src/pages/travelMember/OrderProductManage/index.tsx @@ -9,7 +9,7 @@ import Draggable from 'react-draggable'; import SubMenu from "antd/lib/menu/SubMenu"; import ProTable from '@ant-design/pro-table'; import ProDescriptions from '@ant-design/pro-descriptions'; -import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormDateTimeRangePicker, ProFormDigit, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton } from '@ant-design/pro-form'; +import ProForm, { ProFormDatePicker, ProFormDateRangePicker, ProFormDateTimePicker, ProFormDateTimeRangePicker, 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 } from 'antd'; @@ -23,7 +23,7 @@ import type { FormInstance } from 'antd'; import { getFieldEnumTree, getFieldEnumName } from "@/services/options"; // 枚举的引用,没有使用可以删除 import { handeDeleteCOMMODITY, handeGetCOMMODITYList, handeSynchroCOMMODITY, handlDeleteUSERDEFINEDTYPE, handlGetUSERDEFINEDTYPEList, handlSynchroUSERDEFINEDTYPE } from '../service'; import PageTitleBox from '@/components/PageTitleBox'; -import { uploadPicture } from '@/services/picture'; +import { deletePicture, uploadPicture } from '@/services/picture'; import defaultIcon from '../../../assets/brand/defaultIcon.png' import OrderCategoryTree from './components/OrderCategoryTree'; @@ -96,42 +96,53 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( // }, { dataIndex: 'USERDEFINEDTYPE_NAME', - title: '类别名称', + title: '商品类别', + align: 'center', + width: 120, + ellipsis: true, + hideInSearch: true, + hideInDescriptions: true, + }, + { + dataIndex: 'COMMODITY_NAME', + title: '商品名称', align: 'center', width: 300, ellipsis: true, hideInSearch: true, - hideInDescriptions: true, render: (_, record) => { - return
- - {record?.USERDEFINEDTYPE_NAME} -
+ return record?.COMMODITY_NAME ? { + setCurrentRow(record) + setShowDetail(true) + }}>{record?.COMMODITY_NAME} : "" } }, { - dataIndex: 'USERDEFINEDTYPE_INDEX', - title: '类别索引', + dataIndex: 'COMMODITY_RETAILPRICE', + title: '零售价', align: 'center', width: 120, ellipsis: true, hideInSearch: true, }, { - dataIndex: 'USERDEFINEDTYPE_STATE', - title: '有效状态', + dataIndex: 'COMMODITY_UNIT', + title: '商品单位', align: 'center', width: 120, ellipsis: true, - valueType: "select", - valueEnum: { - "1": "有效", - "0": "无效" - }, - initialValue: "1" + hideInSearch: true, }, { - dataIndex: 'SCANCODE_ORDER', + dataIndex: 'COMMODITY_RULE', + title: '商品规格', + align: 'center', + width: 120, + ellipsis: true, + hideInSearch: true, + }, + { + dataIndex: 'UPPER_STATE', title: '上架状态', align: 'center', width: 120, @@ -144,70 +155,29 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( } }, { - dataIndex: "PRESALE_TYPE", - title: "是否预售", - align: 'center', - hideInSearch: true, - width: 120, - ellipsis: true, - valueType: "select", - valueEnum: { - "0": "否", - "1": "是" - } - }, - { - dataIndex: 'OWNERUNIT_NAME', - title: '业主单位', + dataIndex: 'OPERATE_DATE', + title: '修改时间', align: 'center', width: 180, ellipsis: true, hideInSearch: true, }, { - dataIndex: 'option', - title: '操作', - width: 100, - ellipsis: true, - valueType: 'option', + dataIndex: 'SERVERPART_NAME', + title: '服务区名称', align: 'center', + width: 180, + ellipsis: true, hideInSearch: true, - render: (_, record) => { - return ( - - { - console.log('recordrecordrecord', record); - if (record?.USERDEFINEDTYPE_ICO) { - setFileList([{ - name: "", - url: record?.USERDEFINEDTYPE_ICO - }]) - } - - if (record?.PRESALE_TYPE) { - setFormPRESALE_TYPE(true) - } - - - setCurrentRow({ ...record }); - handleModalVisible(true); - }} - > - 编辑 - - { - handelDelete(record.USERDEFINEDTYPE_ID); - }} - > - 删除 - - - ); - }, }, + { + dataIndex: 'SHOPNAME', + title: '门店名称', + align: 'center', + width: 180, + ellipsis: true, + hideInSearch: true, + } ]; // 预览上传后的图片 @@ -293,7 +263,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( request={async (params, sorter) => { const req = { searchParameter: { - OWNERUNIT_ID: currentUser?.OwnerUnitId, + // OWNERUNIT_ID: currentUser?.OwnerUnitId, PROVINCE_CODE: currentUser?.ProvinceCode, USERDEFINEDTYPE_IDS: selectedId, UPPER_STATE: params?.UPPER_STATE, @@ -303,6 +273,8 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( PageIndex: 1, PageSize: 999999, } + console.log('reqreqreqreq', req); + const data = await handeGetCOMMODITYList(req); console.log('datadatadatadatadata', data); if (data.List && data.List.length > 0) { @@ -313,17 +285,9 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( columns={columns} toolbar={{ actions: [ - // 新增按钮 - , + ], }} /> @@ -348,6 +312,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( = ( onFocus={() => { }} onBlur={() => { }} > - {currentRow ? '更新商品自定义类别' : '新建商品自定义类别'} + {currentRow?.COMMODITY_ID ? '编辑商品详情' : '新增商品'} } destroyOnClose={true} - width={900} - visible={modalVisible} + width={1200} + visible={showDetail} confirmLoading={confirmLoading} afterClose={() => { formRef.current?.resetFields(); @@ -377,9 +342,8 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( }} onCancel={() => { handleConfirmLoading(false) - handleModalVisible(false) - setFormPRESALE_TYPE(false) - setFileList([]) + setShowDetail(false) + setCurrentRow(undefined) }} onOk={async () => { // 提交框内的数据 @@ -393,6 +357,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( disabled={disabled} bounds={bounds} onStart={(event, uiData) => onDraggaleStart(event, uiData)} + handle=".modal-drag-title" >
{modal}
@@ -406,11 +371,10 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( preserve={false} initialValues={currentRow ? { ...currentRow, - PRESALE_TIME: currentRow?.PRESALE_TYPE ? [currentRow?.PRESALE_STARTTIME, currentRow?.PRESALE_ENDTIME] : "" + OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), } : { - USERDEFINEDTYPE_STATE: 1, - USERDEFINEDTYPE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), - OWNERUNIT_NAME: currentUser?.OwnerUnitName + OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'), + OPERATE_PERSON: currentUser?.Name }} onFinish={async (values) => { let newValue = { ...values }; @@ -419,7 +383,6 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( newValue = { ...values, USERDEFINEDTYPE_ID: currentRow.USERDEFINEDTYPE_ID }; } - console.log('fileListfileList', fileList); console.log('newValuenewValuenewValue', newValue); @@ -431,41 +394,41 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( }} > - + { - if (typeTreeData && typeTreeData.length > 0) { - let list: any = [{ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }, ...typeTreeData] - return list - } else { - const req = { - OWNERUNIT_ID: currentUser?.OwnerUnitId, - PROVINCE_CODE: "", - GOODSTYPE: 4000, - } - const data = await handlGetUSERDEFINEDTYPEList(req); - console.log('datadatadatadatadata', data); - if (data.List && data.List.length > 0) { - data.List.unshirft({ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }) - setTypeTreeData(data.List) - return data.List - } else { - return [{ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }] - } - } - }} - fieldProps={{ - fieldNames: { - label: 'USERDEFINEDTYPE_NAME', - value: 'USERDEFINEDTYPE_ID', - children: 'children' - }, - showSearch: true, - filterTreeNode: (input, node) => - (node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase()) + // 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 }] + // } + // } }} + // fieldProps={{ + // fieldNames: { + // label: 'USERDEFINEDTYPE_NAME', + // value: 'USERDEFINEDTYPE_ID', + // children: 'children' + // }, + // showSearch: true, + // filterTreeNode: (input, node) => + // (node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase()) + // }} rules={[ { required: true, @@ -474,163 +437,163 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = ( ]} /> - + - + + + + + + + + + + + + + + + + + + + - - + - + + + + - - { - setFormPRESALE_TYPE(e) - } - }} - /> - - { - formPRESALE_TYPE ? - - - - : "" - } - - { - const formData = new FormData(); - formData.append('files', info.file); - formData.append('TableType', '1215'); - formData.append('ImageName', typeof info.file !== 'string' ? info.file?.name : ''); - if (info.filename) { - const success = await uploadPicture(formData) - if (success) { - const list = [{ - // uid: `${success.ImageId}`, // 注意,这个uid一定不能少,否则上传失败 - name: success.Result_Data.ImageName, - // status: 'done', - url: success.Result_Data.ImageUrl, // url 是展示在页面上的绝对链接 - // imgUrl: success.ImagePath // + success.ImageUrl, - }] - setFileList(list) - } - } else { - message.error("您上传的图片不存在.") - } - }, - onChange: async (info: any) => { - if (info.file.status === 'removed') { - confirm({ - title: '确认删除该图片吗?', - icon: , - async onOk() { - setFileList([]) - - // const deleteLoading = message.loading('正在删除...') - // try { - - // const deleteIndex = fileList?.findIndex((n: any) => n.uid === info.file.uid) - // const success = await deletePicture(info.file?.ImagePath, info.file?.ImageId, '1208') - // if (deleteIndex !== -1) { - // const files = [...fileList] - // files.splice(deleteIndex, 1) - // setFileList(files) - // } - // deleteLoading() - // return true - // } catch (error) { - // deleteLoading() - // return false - // } - } - }); - } - } - }} - /> - - + - + - + + { + console.log('info', info); + console.log('fileList', fileList); + if (info.file.status === 'removed') { + const index = fileList.findIndex(n => n.uid === info.file.uid); + confirm({ + title: '确认删除该文件吗?', + icon: , + async onOk() { + if (info.file.ImageId) { + const deleteLoading = message.loading('正在删除...') + const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '', '5000') + deleteLoading() + if (success) { + const files = [...fileList] + files.splice(index, 1) + setFileList(files) + message.success("删除成功") + actionRef.current?.reload() + } + else { + message.error("删除失败") + } + } else { + const files = [...fileList]; + files.splice(index, 1); + setFileList(files); + } + }, + onCancel() { + }, + }); + } else { + setFileList(info.fileList) + } + } + }} + /> +
diff --git a/src/pages/travelMember/ProductListingManagement/index.tsx b/src/pages/travelMember/ProductListingManagement/index.tsx index 1dfb397..59e5829 100644 --- a/src/pages/travelMember/ProductListingManagement/index.tsx +++ b/src/pages/travelMember/ProductListingManagement/index.tsx @@ -68,6 +68,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop // 选择的规格内容 const [selectedRowKeys, setSelectedRowKeys] = useState() const [selectedRows, setSelectedRows] = useState() + // 当前商品关联的规格数据 + const [specsData, setSpecsData] = useState() @@ -246,12 +248,11 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop valueType: 'index', }, { - dataIndex: '', + dataIndex: 'COMMODITY_MULTI_ID', title: '规格分类', align: 'center', width: 120, ellipsis: true, - valueType: 'index', }, { dataIndex: 'USERDEFINEDTYPE_NAME ', @@ -259,39 +260,34 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop align: 'center', width: 150, ellipsis: true, - valueType: 'index', }, { - dataIndex: '', + dataIndex: 'COMMODITY_STOCK', title: '商品库存', align: 'center', width: 120, ellipsis: true, - valueType: 'index', }, { - dataIndex: '', + dataIndex: 'COMMODITY_RETAILPRICE', title: '商品原价', align: 'center', width: 120, ellipsis: true, - valueType: 'index', }, { - dataIndex: '', + dataIndex: 'COMMODITY_MEMBERPRICE', title: '零售价格', align: 'center', width: 120, ellipsis: true, - valueType: 'index', }, { - dataIndex: '', + dataIndex: 'COMMODITY_PURCHASEPRICE', title: '商品成本', align: 'center', width: 120, ellipsis: true, - valueType: 'index', } ] @@ -387,6 +383,11 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop formRef?.current?.resetFields() handleModalVisible(false) actionRef.current?.reload() + // 清空一下 商品关联表的数据 + setSpecsData([]) + // 清空一下 商品关联表的选择行 + setSelectedRowKeys([]) + setSelectedRows([]) } else { message.error(data.Result_Desc) } @@ -541,8 +542,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop { currentRow ? : "" } @@ -552,6 +551,11 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop handleConfirmLoading(false) handleModalVisible(false) setBRAND_NAMEList([]) + // 清空一下 商品关联表的数据 + setSpecsData([]) + // 清空一下 商品关联表的选择行 + setSelectedRowKeys([]) + setSelectedRows([]) }}>取 消 ] }} + dataSource={specsData} request={async () => { + console.log('currentRowcurrentRowcurrentRow', currentRow); + const req: any = { searchParameter: { - OWNERUNIT_ID: currentUser?.OwnerUnitId, - PROVINCE_CODE: "", + COMMODITY_IDS: currentRow?.COMMODITY_ID, + // OWNERUNIT_ID: currentUser?.OwnerUnitId, + // PROVINCE_CODE: "", }, PageIndex: 1, PageSize: 999999, } - const data = await handeGetCOMMODITY_MULTIList(req) + const data = await handeGetRTCOMMODITY_MULTIList(req) console.log('多规格管理', data); + if (data.List && data.List.length > 0) { + setSpecsData(data.List) + // return { data: data.List, success: true, total: data.TotalCount } + } else { + setSpecsData([]) + } + // return { data: [], success: true } - return selectedRows + // return selectedRows }} /> @@ -1056,6 +1071,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop }} onOk={async () => { // 提交框内的数据 setShowAddSpecsModal(false) + console.log('specsDataspecsDataspecsData', specsData); + console.log('selectedRowsselectedRowsselectedRows', selectedRows); + }} > = (props) => { const { currentUser } = props const downloadBtnRef = useRef() + const draggleRef = React.createRef() const actionRef = useRef(); const formRef = useRef(); + const modalRef = useRef(); const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 const [printOut, setPrintOut] = useState(); // 打印数据的内容 const [collapsible, setCollapsible] = useState(false) @@ -32,7 +41,9 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { let MEMBERSHIP_TYPEObj = session.get('MEMBERSHIP_TYPEObj'); let MEMBERSHIP_LEVELObj = session.get('MEMBERSHIP_LEVELObj'); + let MEMBERSHIP_LEVELList = session.get('MEMBERSHIP_LEVELList'); let COMPANY_STATEObj = session.get('COMPANY_STATEObj'); + let COMPANY_STATEList = session.get('COMPANY_STATEList'); let CONSUMPTIONRECORDTYPEObj = session.get('CONSUMPTIONRECORDTYPEObj') // 树相关的属性和方法 @@ -51,38 +62,80 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { const [showDetailDrawer, setShowDetailDrawer] = useState(false) // 当前行数据 const [currentRow, setCurrentRow] = useState() + // 弹出框拖动效果 + const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置 + const [disabled, setDraggleDisabled] = useState() // 是否拖动 + + const [columnsStateMap, setColumnsStateMap] = useState({ + MEMBERSHIP_CODE: { show: false }, + MEMBERSHIP_CARD: { show: false }, + MEMBERSHIP_ADDRESS: { show: false }, + PLUS_EXPIRYDATE: { show: false }, + RECOMMEND_NAME: { show: false }, + ADDTIME: { show: false }, + MEMBERSHIP_DESC: { show: false }, + }); + 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: "会员名称", + title: "查询内容", width: 200, dataIndex: "MEMBERSHIP_NAME", - hideInSearch: true, ellipsis: true, align: 'center', fixed: 'left', - render: (_, record) => { - return { - console.log('recordrecord', record); - setCurrentRow(record) - setShowDetailDrawer(true) - }}> - {record?.MEMBERSHIP_NAME || ""} - + // render: (_, record) => { + // return { + // console.log('recordrecord', record); + // setCurrentRow(record) + // setShowDetailDrawer(true) + // }}> + // {record?.MEMBERSHIP_NAME || ""} + // + // } + fieldProps: { + placeholder: "请输入要查询的内容" } }, { title: "会员类型", width: 120, dataIndex: "MEMBERSHIP_TYPE", - hideInSearch: true, ellipsis: true, + hideInTable: true, + align: 'center', + valueType: 'select', + valueEnum: { + ...MEMBERSHIP_TYPEObj, + 0: '全部' + }, + initialValue: "0" + }, + { + title: "会员类型", + width: 120, + dataIndex: "MEMBERSHIP_TYPE", + ellipsis: true, + hideInSearch: true, align: 'center', valueType: 'select', valueEnum: { ...MEMBERSHIP_TYPEObj, 0: '-' - } + }, }, { title: "会员编码", @@ -127,7 +180,7 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { }, { title: "证件号码", - width: 120, + width: 150, dataIndex: "CERTIFICATE_NUMBER", hideInSearch: true, ellipsis: true, @@ -141,22 +194,22 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { ellipsis: true, align: 'center', }, - { - title: "会员头像", - width: 120, - dataIndex: "MEMBERSHIP_HEADIMAGEURL", - hideInSearch: true, - ellipsis: true, - align: 'center', - render: (_, record) => { - return record?.MEMBERSHIP_HEADIMAGEURL ? { - window.open(record?.MEMBERSHIP_HEADIMAGEURL) - }}>点击查看 : "" - } - }, + // { + // title: "会员头像", + // width: 120, + // dataIndex: "MEMBERSHIP_HEADIMAGEURL", + // hideInSearch: true, + // ellipsis: true, + // align: 'center', + // render: (_, record) => { + // return record?.MEMBERSHIP_HEADIMAGEURL ? { + // window.open(record?.MEMBERSHIP_HEADIMAGEURL) + // }}>点击查看 : "" + // } + // }, { title: "联系地址", - width: 120, + width: 180, dataIndex: "MEMBERSHIP_ADDRESS", hideInSearch: true, ellipsis: true, @@ -164,7 +217,7 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { }, { title: "车牌号", - width: 120, + width: 150, dataIndex: "LICENSEPLATE_NUMBER", hideInSearch: true, ellipsis: true, @@ -174,11 +227,14 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { title: "会员等级", width: 120, dataIndex: "MEMBERSHIP_LEVEL", - hideInSearch: true, ellipsis: true, align: 'center', valueType: 'select', - valueEnum: MEMBERSHIP_LEVELObj + valueEnum: { + "0": "全部", + ...MEMBERSHIP_LEVELObj + }, + initialValue: "0" }, { title: "会员积分", @@ -229,16 +285,17 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { title: "会员状态", width: 120, dataIndex: "MEMBERSHIP_STATE", - hideInSearch: true, ellipsis: true, align: 'center', valueType: 'select', - valueEnum: COMPANY_STATEObj + valueEnum: COMPANY_STATEObj, + initialValue: "1000" }, { title: "添加时间", width: 150, dataIndex: "ADDTIME", + align: 'center', hideInSearch: true, ellipsis: true, align: 'center', @@ -252,6 +309,23 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { dataIndex: "MEMBERSHIP_DESC", hideInSearch: true, ellipsis: true, + }, + { + title: "操作", + width: 120, + dataIndex: "options", + hideInSearch: true, + align: 'center', + ellipsis: true, + fixed: "right", + render: (_, record) => { + return + { + setCurrentRow(record) + setShowDetailDrawer(true) + }}>详情 + + } } ] @@ -485,6 +559,11 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { }, ] + // 悬浮框的关闭方法 + const handleCloseModal = () => { + setShowDetailDrawer(false) + setCurrentRow(undefined); + } return (
{ @@ -560,10 +639,17 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { const req: any = { SearchParameter: { PROVINCE_CODE: currentUser?.ProvinceCode || "", - OWNERUNIT_ID: 911 + OWNERUNIT_ID: 911, + MEMBERSHIP_TYPE: params?.MEMBERSHIP_TYPE === "0" ? "" : params?.MEMBERSHIP_TYPE, + MEMBERSHIP_LEVEL: params?.MEMBERSHIP_LEVEL === "0" ? "" : params?.MEMBERSHIP_LEVEL, + MEMBERSHIP_STATE: params?.MEMBERSHIP_STATE }, - PageIndex: 1, - PageSize: 20 + keyWord: { + Key: "MEMBERSHIP_NAME,MEMBERSHIP_MOBILEPHONE,CERTIFICATE_NUMBER,MEMBERSHIP_CARD,MEMBERSHIP_ADDRESS,LICENSEPLATE_NUMBER", + value: params?.MEMBERSHIP_NAME || "" + }, + PageIndex: params.current || 1, + PageSize: 20, } setSearchParams(params) const data = await handleGetMEMBERSHIPList(req) @@ -590,12 +676,257 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { defaultPageSize: 20, showTotal: (total) => `共 ${total} 条记录` }} + columnsState={{ + value: columnsStateMap, + onChange: setColumnsStateMap, + }} />
+ { + // if (disabled) { + // setDraggleDisabled(false) + // } + // }} + // onMouseOut={() => { + // setDraggleDisabled(true) + // }} - { }} + // onBlur={() => { }} + // > + // {'会员详情'} + // + // } + closeIcon={
} + destroyOnClose={true} + width={1200} + visible={showDetailDrawer} + footer={false} + afterClose={() => { + modalRef.current?.resetFields(); + setCurrentRow(undefined); + }} + onCancel={() => { + setShowDetailDrawer(false) + setCurrentRow(undefined); + }} + modalRender={(modal) => { + return onDraggaleStart(event, uiData)} + handle=".modal-drag-title" + > +
{modal}
+
+ }} + > + + +
+
+ + 会员详情 +
+
+ { + handleCloseModal() + }} /> +
+
+
+
+ +
+ +
+
+ {currentRow?.MEMBERSHIP_NAME || "-"} + {currentRow?.MEMBERSHIP_SEX === 1 ? '男' : currentRow?.MEMBERSHIP_SEX === 2 ? '女' : ''} + { + currentRow?.MEMBERSHIP_TYPE && MEMBERSHIP_TYPEObj && MEMBERSHIP_TYPEObj[currentRow?.MEMBERSHIP_TYPE] ? + {MEMBERSHIP_TYPEObj[currentRow?.MEMBERSHIP_TYPE]} : "" + } + +
+ +
+ + + + + + + + + + + + + + + + + + +
+
+
+ +
+ + 详情信息 +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + {/* = (props) => { return { data: [], success: true } }} /> - + */} ) } diff --git a/src/pages/travelMember/memberInfor/style.less b/src/pages/travelMember/memberInfor/style.less new file mode 100644 index 0000000..4d746ba --- /dev/null +++ b/src/pages/travelMember/memberInfor/style.less @@ -0,0 +1,176 @@ +.memberInfoDetailModal { + .react-draggable { + .ant-modal-content { + border-radius: 16px; + + .ant-modal-body { + padding: 0; + height: 700px; + overflow-y: auto; + overflow: hidden; + + .ant-form { + .modalTop { + 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; + } + } + } + + .topDetail { + width: 100%; + display: flex; + box-sizing: border-box; + padding: 30px 28px; + + .topDetailLeft { + width: 120px; + height: 120px; + margin-right: 28px; + + .headerImage { + width: 120px; + height: 120px; + border-radius: 50%; + overflow: hidden; + } + } + + .topDetailRight { + width: calc(100% - 148px); + height: 120px; + box-sizing: border-box; + padding: 8px 0; + + .topDetailRightTop { + .detailName { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 20px; + color: #333333; + line-height: 14px; + text-align: left; + font-style: normal; + } + + .detailSex { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 20px; + color: #333333; + line-height: 14px; + text-align: left; + font-style: normal; + margin-left: 8px; + } + + .memberType { + font-family: PingFangSC, PingFang SC; + font-size: 14px; + color: #fff; + line-height: 14px; + text-align: left; + font-style: normal; + padding: 2px 8px; + background: linear-gradient(0deg, #A13B00 0%, #D7AB0E 100%); + border-radius: 4px; + } + } + + .topDetailItem { + width: 100%; + margin-top: 16px; + + .ant-row { + .memberInfoDetailItem { + .ant-form-item { + margin-bottom: 12px; + } + } + } + } + } + } + + .carNavBox { + width: calc(100% - 42px); + background-color: #F3F4F8; + border-radius: 8px; + display: flex; + align-items: center; + margin-left: 21px; + box-sizing: border-box; + padding: 12px 16px; + + .carNavIcon { + width: 26px; + height: 26px; + margin-right: 8px; + } + + .carNavTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 12px; + text-align: left; + font-style: normal; + } + } + + .bottomDetailBox { + width: calc(100% - 42px); + margin-left: 30px; + box-sizing: border-box; + margin-top: 26px; + } + + + } + } + + .ant-modal-body::-webkit-scrollbar { + width: 0; + display: none; + } + } + } +} \ No newline at end of file diff --git a/src/pages/travelMember/serverpartInfo/index.tsx b/src/pages/travelMember/serverpartInfo/index.tsx index 706f9c1..9d8325b 100644 --- a/src/pages/travelMember/serverpartInfo/index.tsx +++ b/src/pages/travelMember/serverpartInfo/index.tsx @@ -5,8 +5,8 @@ import React, { useRef, useState } from "react"; import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree"; import ServerpartInfo from "./components/serverpartInfo"; import ProCard from "@ant-design/pro-card"; -import { MenuFoldOutlined } from "@ant-design/icons"; -import { Button, message, Tree } from "antd"; +import { ExclamationCircleOutlined, MenuFoldOutlined } from "@ant-design/icons"; +import { Button, Col, FormInstance, message, Modal, Row, Tree, Image } from "antd"; import LoadingBox from "@/pages/reports/Finance/businessAnalysis/components/loading"; import session from "@/utils/session"; import moment from 'moment' @@ -14,10 +14,26 @@ import { handleSynchroSERVERPART } from "@/pages/newDataAnalysis/service"; import useRequest from "@ahooksjs/use-request"; import { getServerpartTree } from "@/services/options"; import { handleSynchroNOTICEINFO } from "@/pages/basicManage/highwayHeadlines/service"; +import ProForm, { ProFormUploadButton } from "@ant-design/pro-form"; +import { deletePicture, getPictureList, uploadPicture } from "@/services/picture"; +import { handeGetPictureList } from "../service"; +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 < 5; + if (!isLt2M) { + message.error('图片大小不超过 5MB!'); + } + return isJpgOrPng && isLt2M; +} const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => { + const { confirm } = Modal; const { currentUser } = props + const modalRef = useRef(); const [collapsible, setCollapsible] = useState(false) const [treeView, setTreeView] = useState() // 树相关的属性和方法 @@ -26,6 +42,15 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => { const [showRightForm, setShowRightForm] = useState(true) const serverPartRef = useRef() const shopregionObj = session.get('shopregionObj') + // 显示上传图片的悬浮框 + const [showUploadImgModal, setShowUploadImgModal] = useState(false) + // 点击的按钮类型 1 服务区图片上传 2 母婴室图片上传 3 司机之家图片上传 4 住宿客房图片上传 5 便利店图片上传 + const [showType, setShowType] = useState(0) + // 悬浮框的点击确认的效果 + const [confirmLoading, setConfirmLoading] = useState(false) + // 文件列表 + const [fileList, setFileList] = useState([]) + const [imagePreviewVisible, setImagePreviewVisible] = useState(false) // 预览图片 const { loading: treeLoading, data: treeViews } = useRequest(async () => { const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) @@ -41,6 +66,15 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => { }) + // 预览上传后的图片 + const handlePreview = async () => { + setFileList(fileList) + setImagePreviewVisible(true) + }; + const handleChangePreview = (val: any) => { + setImagePreviewVisible(val) + } + // 保存方法 const handleSubmitForm = async () => { let res: any = serverPartRef.current?.formRef.current?.getFieldsValue() @@ -272,14 +306,44 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => { paddingRight: 0, overflowY: "auto" }}> -
+
{ showRightForm ? : }
-
+
+ {/* 上传设施图片 */} + {/* 点击的按钮类型 1 服务区图片上传 2 母婴室图片上传 3 司机之家图片上传 4 住宿客房图片上传 5 便利店图片上传 */} + { + selectedId ?
+ + + + + + + + + +
: "" + } { selectedId ? : '' }
-
+ + + {/* 图片预览组件 */} + {fileList && fileList.length > 0 &&
+ { + handleChangePreview(vis) + } + }}> + { + fileList.map((n) => ) + } + +
} + + {/* */} + { + setConfirmLoading(false) + setShowType(0) + setShowUploadImgModal(false); + setFileList([]) + }} + onOk={async () => { + console.log('file', fileList); + let form: any = await modalRef.current?.getFieldsValue({}) + console.log('formDataformDataformData', form); + // 判断这次上传图片了没 + if (form.SCENICAREA_Image && form.SCENICAREA_Image.length > 0) { + const formData = new FormData(); + form.SCENICAREA_Image.forEach((file: any) => { + formData.append('files[]', file.originFileObj); + formData.append('ImageName', typeof file !== 'string' ? file?.name : ''); + }); + formData.append('TableId', selectedId!); + formData.append('imageType', showType === 1 ? '' : showType === 2 ? '1001' : showType === 3 ? '1002' : showType === 4 ? '2001' : showType === 5 ? '2002' : ''); + formData.append('TableType', showType === 1 ? '1123' : showType === 2 ? '1131' : showType === 3 ? '1131' : showType === 4 ? '1131' : showType === 5 ? '1131' : ''); + + console.log('formData', formData); + let res = await uploadPicture(formData) + console.log('resresresres', res); + if (res.Result_Code === 100) { + message.success("上传成功!") + setConfirmLoading(false) + setShowType(0) + setShowUploadImgModal(false); + setFileList([]) + setShowRightForm(false) + setTimeout(() => { + setShowRightForm(true) + }, 1000) + } else { + message.error(res.Result_Desc) + } + } else { + setConfirmLoading(false) + setShowType(0) + setShowUploadImgModal(false); + setFileList([]) + } + }} + > + { + let req: any = { + TableId: selectedId, + TableName: showType === 1 ? 'SERVERPART' : showType === 2 ? 'SERVERPARTINFO' : showType === 3 ? 'SERVERPARTINFO' : showType === 4 ? 'SERVERPARTINFO' : showType === 5 ? 'SERVERPARTINFO' : '', + TableType: showType === 1 ? '1123' : showType === 2 ? '1131' : showType === 3 ? '1131' : showType === 4 ? '1131' : showType === 5 ? '1131' : '', + ImageType: showType === 1 ? '' : showType === 2 ? '1001' : showType === 3 ? '1002' : showType === 4 ? '2001' : showType === 5 ? '2002' : '', + } + const data = await handeGetPictureList(req) + console.log('datadatadatadata', data); + if (data.List && data.List.length > 0) { + let list: any = [] + if (data.List && data.List.length > 0) { + data.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' + list.push(obj) + }) + } + setFileList(list); + return { + SCENICAREA_Image: list + } + } + return {} + }} + > + + + { + console.log('info', info); + console.log('fileList', fileList); + if (info.file.status === 'removed') { + const index = fileList.findIndex(n => n.uid === info.file.uid); + confirm({ + title: '确认删除该文件吗?', + icon: , + async onOk() { + if (info.file.ImageId) { + const deleteLoading = message.loading('正在删除...') + const success = await deletePicture(info.file?.ImagePath, info.file?.uid, showType === 1 ? 'SERVERPART' : showType === 2 ? 'SERVERPARTINFO' : showType === 3 ? 'SERVERPARTINFO' : showType === 4 ? 'SERVERPARTINFO' : showType === 5 ? 'SERVERPARTINFO' : '', showType === 1 ? '1123' : showType === 2 ? '1131' : showType === 3 ? '1131' : showType === 4 ? '1131' : showType === 5 ? '1131' : '') + deleteLoading() + + if (success) { + const files = [...fileList] + files.splice(index, 1) + setFileList(files) + message.success("删除成功") + } + else { + message.error("删除失败") + } + } else { + const files = [...fileList]; + files.splice(index, 1); + setFileList(files); + } + }, + onCancel() { + }, + }); + } else { + setFileList(info.fileList) + } + } + }} + /> + + + + + + + ) } diff --git a/src/pages/travelMember/service.ts b/src/pages/travelMember/service.ts index 05a8fe8..6693545 100644 --- a/src/pages/travelMember/service.ts +++ b/src/pages/travelMember/service.ts @@ -1,4 +1,4 @@ -// import request from '@/utils/request'; +import request from '@/utils/request'; import { wrapTreeNode } from '@/utils/format'; import requestEncryption from '@/utils/requestEncryption'; @@ -337,9 +337,6 @@ export async function handeGetCOMMODITY_MULTIList(params: any) { return data.Result_Data } - - - // 获取商户列表 export async function handeGetMERCHANTSList(params: any) { const data = await requestEncryption(`/MallBasic/GetMERCHANTSList`, { @@ -501,7 +498,7 @@ export async function handeDeleteCOMMODITY_MULTI(params: any) { return data } -// 获取商品多规格关联表列表 +// 获取商品规格关联的列表(就是拿到商品已经关联了的规格) export async function handeGetRTCOMMODITY_MULTIList(params: any) { const data = await requestEncryption(`/MemberConfig/GetRTCOMMODITY_MULTIList`, { method: 'POST', @@ -510,7 +507,71 @@ export async function handeGetRTCOMMODITY_MULTIList(params: any) { if (data.Result_Code !== 100) { return [] } - return data + return data.Result_Data } +// 查询线上订单详情 +export async function handeGetSALEBILLDetail(params: any) { + const data = await requestEncryption(`/OnlineOrder/GetSALEBILLDetail`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data +} + + +// 获取评价表列表 +export async function handeGetCOMMENTList(params: any) { + const data = await requestEncryption(`/Comment/GetCOMMENTList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data +} + + +// 服务区的图片 +export async function handeGetPictureList(params: any) { + const data = await request(`/Picture/GetPictureList`, { + method: 'GET', + params + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data +} + +// 查询线上订单列表信息(含子订单) +export async function handeGetSaleBillWholeList(params: any) { + const data = await requestEncryption(`/OnlineOrder/GetSaleBillWholeList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data +} + + + +// 用户为树形的 用户地址 +export async function handeGetMemberAddressCombineList(params: any) { + const data = await requestEncryption(`/Member/GetMemberAddressCombineList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data +} + diff --git a/src/services/options/index.ts b/src/services/options/index.ts index ce16b9d..14fd415 100644 --- a/src/services/options/index.ts +++ b/src/services/options/index.ts @@ -19,6 +19,7 @@ import { wrapTreeNode } from '@/utils/format'; import request from '@/utils/request'; +import requestEncryption from '@/utils/requestEncryption' import session from '@/utils/session'; import type { CommonTypeModel, FieldParamsModel } from './typings'; import useRequest from "@ahooksjs/use-request"; @@ -114,6 +115,21 @@ export async function getFieldEnumTree(params: FieldParamsModel) { return [...options]; } +/* 获取枚举列表 出行平台的枚举 */ +export async function getTravelFieldEnumTree(params: FieldParamsModel) { + + const data = await requestEncryption(`/FrameWork/GetFieldEnumByField`, { + method: 'GET', + params: { ...params }, + }); + if (data.Result_Code !== 100) { + return []; + } + + const options = wrapTreeNode(data.Result_Data.List); + return [...options]; +} + /* 获取枚举列表 */ export async function getFieldEnum(params: FieldParamsModel): Promise<{ label: string; value: string | number }[]> { // const FieldExplain = session.get(params.sessionName ? params.sessionName : params.FieldExplainField);