update
This commit is contained in:
parent
7fe7fe34e3
commit
4e48dc4a94
BIN
src/assets/detail/closeIcon.png
Normal file
BIN
src/assets/detail/closeIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
BIN
src/assets/detail/memberDetailIcon.png
Normal file
BIN
src/assets/detail/memberDetailIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 569 B |
BIN
src/assets/detail/memberInfoIcon.png
Normal file
BIN
src/assets/detail/memberInfoIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 818 B |
@ -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<BasicLayoutProps> = (props) => {
|
||||
session.set('BUSINESSSTATETree', BUSINESSSTATE);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 景区类型
|
||||
getFieldEnumTree({ FieldExplainField: 'SCENICAREA_TYPE' }).then((SCENICAREATYPE: any) => {
|
||||
if (SCENICAREATYPE && SCENICAREATYPE.length > 0) {
|
||||
|
||||
@ -185,6 +185,7 @@ const saleRankReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
"驿付商家版": "驿付商家版",
|
||||
"微信公众号": "微信公众号",
|
||||
"驿商云客户端": "驿商云客户端",
|
||||
"彩云驿出行": "彩云驿出行",
|
||||
},
|
||||
initialValue: '驿商云平台'
|
||||
},
|
||||
|
||||
@ -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<any>();
|
||||
const [confirmLoading, handleConfirmLoading] = useState<boolean>(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 (
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
setCurrentRow({ ...record });
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品管理列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
await handelDelete(record.MERCHANTS_ID);
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
return record?.SALEBILL_CODE ? <a onClick={() => {
|
||||
setCurrentRow(record);
|
||||
handleModalVisible(true)
|
||||
}}>{record?.SALEBILL_CODE}</a> : "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
|
||||
<div style={{
|
||||
width: '100%',
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
@ -207,17 +243,35 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (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: [
|
||||
// 新增按钮
|
||||
<Button
|
||||
key="new"
|
||||
icon={<PlusOutlined />}
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
>
|
||||
新增商户
|
||||
</Button>
|
||||
],
|
||||
}}
|
||||
/>
|
||||
@ -264,7 +307,7 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
onFocus={() => { }}
|
||||
onBlur={() => { }}
|
||||
>
|
||||
{currentRow ? '更新商品管理' : '新建商品管理'}
|
||||
{'订单详情'}
|
||||
</div>
|
||||
}
|
||||
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 <Draggable
|
||||
disabled={disabled}
|
||||
@ -296,136 +334,41 @@ const BookingMealOrder: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
</Draggable>
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
formRef={formRef}
|
||||
autoFocusFirstInput
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
initialValues={currentRow ? {
|
||||
...currentRow
|
||||
} : {
|
||||
OWNERUNIT_NAME: currentUser?.OwnerUnitName
|
||||
}}
|
||||
onFinish={async (values) => {
|
||||
let newValue: any = { ...values };
|
||||
if (currentRow) {
|
||||
// 编辑数据
|
||||
newValue = { ...values, COMMODITY_ID: currentRow.COMMODITY_ID };
|
||||
|
||||
<ProTable
|
||||
columns={orderDetailColumns}
|
||||
bordered
|
||||
search={false}
|
||||
request={async () => {
|
||||
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 }
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="OWNERUNIT_NAME"
|
||||
label="业主单位"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入业主单位!"
|
||||
}
|
||||
]}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="MERCHANTS_TYPE"
|
||||
label="商户类型"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择商户类型!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="MERCHANTS_AUTOTYPE"
|
||||
label="商户性质"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择商户性质!"
|
||||
}
|
||||
]}
|
||||
options={[{ label: "企业公司", value: 1000 }, { label: "个体", value: 2000 }, { label: "自然人", value: 3000 }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="MERCHANTS_NAME"
|
||||
label="商户名称"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入商户名称!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="MERCHANTS_EN"
|
||||
label="商户简称"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="TAXPAYER_IDENTIFYCODE"
|
||||
label="统一信用代码"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入统一信用代码!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="MERCHANTS_LINKMAN"
|
||||
label="联系人员"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="MERCHANTS_TELEPHONE"
|
||||
label="手机号码"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="MERCHANTS_STATE"
|
||||
label="商户状态"
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
/>
|
||||
</Col>
|
||||
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>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
<Col span={24}>
|
||||
<ProFormText
|
||||
name="MERCHANTS_ADDRESS "
|
||||
label="商户地址"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="MERCHANTS_DESC"
|
||||
label="商户简介"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</ProForm>
|
||||
</Modal>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -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<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
|
||||
|
||||
// 查询的条件
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
|
||||
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 }
|
||||
|
||||
@ -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<ActionType>();
|
||||
const modalActionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [currentRow, setCurrentRow] = useState<MEMBERADDRESSModel>();
|
||||
const [showDetail, setShowDetail] = useState<boolean>();
|
||||
@ -43,6 +44,11 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props
|
||||
const [city, setCity] = useState<string>('');
|
||||
const [county, setCounty] = useState<string>('');
|
||||
const [address, setAddress] = useState<string>('');
|
||||
// 显示详情抽屉
|
||||
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(false)
|
||||
// 显示当前选中的外层表格数据
|
||||
const [currentBigRow, setCurrentBigRow] = useState<any>(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 ? <a onClick={() => {
|
||||
setCurrentBigRow(record)
|
||||
setShowDetailDrawer(true)
|
||||
}}>{record?.USER_NAME}</a> : "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
// <Space>
|
||||
// <a
|
||||
// onClick={() => {
|
||||
// console.log('record', record);
|
||||
|
||||
// setProvince(record?.RECEIVE_PROVINCE)
|
||||
// setCity(record?.RECEIVE_CITY)
|
||||
// setCounty(record?.RECEIVE_COUNTY)
|
||||
// setCurrentRow({ ...record });
|
||||
// handleModalVisible(true);
|
||||
// }}
|
||||
// >
|
||||
// 编辑
|
||||
// </a>
|
||||
// <Popconfirm
|
||||
// title="确认删除该会员收货地址列表信息吗?"
|
||||
// onConfirm={async () => {
|
||||
// await handelDelete(record.MEMBERADDRESS_ID);
|
||||
// }}
|
||||
// >
|
||||
// <a>删除</a>
|
||||
// </Popconfirm>
|
||||
// </Space>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
];
|
||||
|
||||
// 抽屉里面的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 (
|
||||
<Space>
|
||||
@ -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: []
|
||||
}}
|
||||
/>
|
||||
|
||||
<Drawer
|
||||
width={600}
|
||||
visible={showDetail}
|
||||
width={'80%'}
|
||||
visible={showDetailDrawer}
|
||||
onClose={() => {
|
||||
setCurrentRow(undefined);
|
||||
setShowDetail(false);
|
||||
setCurrentBigRow(undefined);
|
||||
setShowDetailDrawer(false);
|
||||
}}
|
||||
closable={false}
|
||||
destroyOnClose
|
||||
>
|
||||
{currentRow?.MEMBERADDRESS_ID && (
|
||||
<ProDescriptions
|
||||
column={2}
|
||||
request={async () => ({
|
||||
data: currentRow || {},
|
||||
})}
|
||||
params={{
|
||||
id: currentRow?.MEMBERADDRESS_ID,
|
||||
}}
|
||||
columns={columns}
|
||||
/>
|
||||
)}
|
||||
<ProTable
|
||||
search={false}
|
||||
pagination={false}
|
||||
options={false}
|
||||
scroll={{ x: "100%", y: '500px' }}
|
||||
columns={drawerColumns}
|
||||
headerTitle={"用户地址"}
|
||||
actionRef={modalActionRef}
|
||||
request={async (params, sorter) => {
|
||||
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 }
|
||||
}}
|
||||
/>
|
||||
</Drawer>
|
||||
|
||||
<Modal
|
||||
title={
|
||||
<div
|
||||
className="modal-drag-title"
|
||||
style={{
|
||||
width: '100%',
|
||||
cursor: 'move',
|
||||
@ -400,6 +620,7 @@ const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
handle=".modal-drag-title"
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
|
||||
@ -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<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||
|
||||
|
||||
// 树相关的属性和方法
|
||||
const [selectedId, setSelectedId] = useState<string>()
|
||||
|
||||
|
||||
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 (
|
||||
<div>
|
||||
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
|
||||
<div style={{
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
}}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
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: [
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -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 <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }}>
|
||||
<img style={{ width: '30px', height: '30px', marginRight: '5px', borderRadius: '50%' }} src={record?.USERDEFINEDTYPE_ICO || defaultIcon} />
|
||||
<span style={{ width: '240px', display: "inline-block", whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', textAlign: 'left' }}>{record?.USERDEFINEDTYPE_NAME}</span>
|
||||
</div>
|
||||
return record?.COMMODITY_NAME ? <a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowDetail(true)
|
||||
}}>{record?.COMMODITY_NAME}</a> : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
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);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品自定义类别列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
handelDelete(record.USERDEFINEDTYPE_ID);
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
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: [
|
||||
// 新增按钮
|
||||
<Button
|
||||
key="new"
|
||||
icon={<PlusOutlined />}
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
>
|
||||
商品自定义类别
|
||||
</Button>,
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowDetail(true)
|
||||
}}>新增商品</Button>
|
||||
],
|
||||
}}
|
||||
/>
|
||||
@ -348,6 +312,7 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
<Modal
|
||||
title={
|
||||
<div
|
||||
className="modal-drag-title"
|
||||
style={{
|
||||
width: '100%',
|
||||
cursor: 'move',
|
||||
@ -364,12 +329,12 @@ const OrderProductManage: React.FC<{ currentUser: CurrentUser | undefined }> = (
|
||||
onFocus={() => { }}
|
||||
onBlur={() => { }}
|
||||
>
|
||||
{currentRow ? '更新商品自定义类别' : '新建商品自定义类别'}
|
||||
{currentRow?.COMMODITY_ID ? '编辑商品详情' : '新增商品'}
|
||||
</div>
|
||||
}
|
||||
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"
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
@ -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 }> = (
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<Col span={8}>
|
||||
<ProFormTreeSelect
|
||||
name="USERDEFINEDTYPE_PID"
|
||||
label="上级类别"
|
||||
name="COMMODITY_TYPE"
|
||||
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 }]
|
||||
}
|
||||
}
|
||||
}}
|
||||
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 }> = (
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_NAME"
|
||||
label="类别名称"
|
||||
name="COMMODITY_NAME"
|
||||
label="商品名称"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入类别名称"
|
||||
message: "请输入商品名称"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="USERDEFINEDTYPE_INDEX"
|
||||
label="类别索引"
|
||||
name="COMMODITY_BARCODE"
|
||||
label="商品条码"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="LIMIT_DAILYCOUNT"
|
||||
label="每日可售"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<ProFormDateRangePicker
|
||||
width={'lg'}
|
||||
name=""
|
||||
label="生效时间"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_UNIT"
|
||||
label="商品单位"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_RULE"
|
||||
label="商品规格"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_HOTKEY"
|
||||
label="快捷键码"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_RETAILPRICE"
|
||||
label="零售价格"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入类别索引"
|
||||
message: "请输入零售价格"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="SCANCODE_ORDER"
|
||||
label="上架状态"
|
||||
options={[{ label: "上架", value: 1 }, { label: "下架", value: 0 }]}
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_PURCHASEPRICE"
|
||||
label="进货价格"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_MEMBERPRICE"
|
||||
label="会员价格"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="USERDEFINEDTYPE_STATE"
|
||||
label="有效状态"
|
||||
name="UPPER_STATE"
|
||||
label="上架状态"
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择有效状态"
|
||||
message: "请选择上架状态"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="PRESALE_TYPE"
|
||||
label="是否预售"
|
||||
options={[{ label: "是", value: 1 }, { label: "否", value: 0 }]}
|
||||
fieldProps={{
|
||||
onChange: (e: any) => {
|
||||
setFormPRESALE_TYPE(e)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
{
|
||||
formPRESALE_TYPE ?
|
||||
<Col span={12}>
|
||||
<ProFormDateTimeRangePicker
|
||||
width={'lg'}
|
||||
name="PRESALE_TIME"
|
||||
label="预售时间"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择预售时间"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
: ""
|
||||
}
|
||||
<Col span={12}>
|
||||
<ProFormUploadButton
|
||||
name="USERDEFINEDTYPE_ICO"
|
||||
label="图标地址"
|
||||
fileList={fileList || []}
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
maxCount: 1,
|
||||
onPreview: handlePreview,
|
||||
customRequest: async (info) => {
|
||||
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: <ExclamationCircleOutlined rev={undefined} />,
|
||||
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
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_DATE"
|
||||
label="添加时间"
|
||||
name="OPERATE_PERSON"
|
||||
label="操作人员"
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="OWNERUNIT_NAME"
|
||||
label="业主单位"
|
||||
name="OPERATE_TIME"
|
||||
label="操作时间"
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="USERDEFINEDTYPE_DESC"
|
||||
label="备注"
|
||||
<ProFormText
|
||||
name="COMMODITY_INTRO"
|
||||
label="商品简介"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormUploadButton
|
||||
name=""
|
||||
label="商品图片"
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
max={1}
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
onPreview: handlePreview,
|
||||
fileList: fileList, // 绑定 fileList
|
||||
onChange: async (info: any) => {
|
||||
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: <ExclamationCircleOutlined />,
|
||||
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)
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</ProForm>
|
||||
</Modal>
|
||||
|
||||
@ -68,6 +68,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
// 选择的规格内容
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<any>()
|
||||
const [selectedRows, setSelectedRows] = useState<any>()
|
||||
// 当前商品关联的规格数据
|
||||
const [specsData, setSpecsData] = useState<any>()
|
||||
|
||||
|
||||
|
||||
@ -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 ?
|
||||
<Button type={"primary"} onClick={() => {
|
||||
console.log('currentRow', currentRow);
|
||||
|
||||
setShowMoreSpecs(true)
|
||||
}}>多规格管理</Button> : ""
|
||||
}
|
||||
@ -552,6 +551,11 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
handleConfirmLoading(false)
|
||||
handleModalVisible(false)
|
||||
setBRAND_NAMEList([])
|
||||
// 清空一下 商品关联表的数据
|
||||
setSpecsData([])
|
||||
// 清空一下 商品关联表的选择行
|
||||
setSelectedRowKeys([])
|
||||
setSelectedRows([])
|
||||
}}>取 消</Button>
|
||||
<Button type={"primary"} loading={confirmLoading} onClick={() => {
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
@ -1005,7 +1009,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
<Modal
|
||||
title={"多规格管理"}
|
||||
destroyOnClose={true}
|
||||
width={900}
|
||||
width={1000}
|
||||
visible={showMoreSpecs}
|
||||
onCancel={() => {
|
||||
setShowMoreSpecs(false)
|
||||
@ -1027,19 +1031,30 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
}}>新增规格</Button>
|
||||
]
|
||||
}}
|
||||
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);
|
||||
|
||||
}}
|
||||
>
|
||||
<ProTable
|
||||
|
||||
@ -5,7 +5,7 @@ import React, { useRef, useState } from "react";
|
||||
import ProCard from "@ant-design/pro-card";
|
||||
import { MenuFoldOutlined } from "@ant-design/icons";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Button, Drawer, message, Space, Spin, Tree } from "antd";
|
||||
import { Button, Col, Drawer, message, Modal, Row, Space, Spin, Tree } from "antd";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import { getServerpartTree } from "@/services/options";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
@ -16,13 +16,22 @@ import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { handleGetCONSUMPTIONRECORDList, handleGetMEMBERGROWTHList, handleGetMEMBERSHIPList, handleGetPOINTRECORDList } from "../service";
|
||||
import session from "@/utils/session";
|
||||
import moment from 'moment'
|
||||
import Draggable from "react-draggable";
|
||||
import ProForm, { ProFormSelect, ProFormText, ProFormTextArea } from "@ant-design/pro-form";
|
||||
import './style.less'
|
||||
import memberInfoIcon from '@/assets/detail/memberInfoIcon.png'
|
||||
import closeIcon from '@/assets/detail/closeIcon.png'
|
||||
import memberDetailIcon from '@/assets/detail/memberDetailIcon.png'
|
||||
|
||||
|
||||
|
||||
const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const downloadBtnRef = useRef<any>()
|
||||
const draggleRef = React.createRef<any>()
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const modalRef = useRef<FormInstance>();
|
||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||
const [collapsible, setCollapsible] = useState<boolean>(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<boolean>(false)
|
||||
// 当前行数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 弹出框拖动效果
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||
|
||||
const [columnsStateMap, setColumnsStateMap] = useState<any>({
|
||||
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 <a onClick={() => {
|
||||
console.log('recordrecord', record);
|
||||
setCurrentRow(record)
|
||||
setShowDetailDrawer(true)
|
||||
}}>
|
||||
{record?.MEMBERSHIP_NAME || ""}
|
||||
</a>
|
||||
// render: (_, record) => {
|
||||
// return <a onClick={() => {
|
||||
// console.log('recordrecord', record);
|
||||
// setCurrentRow(record)
|
||||
// setShowDetailDrawer(true)
|
||||
// }}>
|
||||
// {record?.MEMBERSHIP_NAME || ""}
|
||||
// </a>
|
||||
// }
|
||||
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 ? <a onClick={() => {
|
||||
window.open(record?.MEMBERSHIP_HEADIMAGEURL)
|
||||
}}>点击查看</a> : ""
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: "会员头像",
|
||||
// width: 120,
|
||||
// dataIndex: "MEMBERSHIP_HEADIMAGEURL",
|
||||
// hideInSearch: true,
|
||||
// ellipsis: true,
|
||||
// align: 'center',
|
||||
// render: (_, record) => {
|
||||
// return record?.MEMBERSHIP_HEADIMAGEURL ? <a onClick={() => {
|
||||
// window.open(record?.MEMBERSHIP_HEADIMAGEURL)
|
||||
// }}>点击查看</a> : ""
|
||||
// }
|
||||
// },
|
||||
{
|
||||
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 <Space>
|
||||
<a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowDetailDrawer(true)
|
||||
}}>详情</a>
|
||||
</Space>
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -485,6 +559,11 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
},
|
||||
]
|
||||
|
||||
// 悬浮框的关闭方法
|
||||
const handleCloseModal = () => {
|
||||
setShowDetailDrawer(false)
|
||||
setCurrentRow(undefined);
|
||||
}
|
||||
|
||||
return (
|
||||
<div ref={(el) => {
|
||||
@ -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,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Modal
|
||||
className="memberInfoDetailModal"
|
||||
title={false}
|
||||
// title={
|
||||
// <div
|
||||
// className="modal-drag-title"
|
||||
// style={{
|
||||
// width: '100%',
|
||||
// cursor: 'move',
|
||||
// }}
|
||||
// onMouseOver={() => {
|
||||
// if (disabled) {
|
||||
// setDraggleDisabled(false)
|
||||
// }
|
||||
// }}
|
||||
// onMouseOut={() => {
|
||||
// setDraggleDisabled(true)
|
||||
// }}
|
||||
|
||||
<Drawer
|
||||
// onFocus={() => { }}
|
||||
// onBlur={() => { }}
|
||||
// >
|
||||
// {'会员详情'}
|
||||
// </div>
|
||||
// }
|
||||
closeIcon={<div></div>}
|
||||
destroyOnClose={true}
|
||||
width={1200}
|
||||
visible={showDetailDrawer}
|
||||
footer={false}
|
||||
afterClose={() => {
|
||||
modalRef.current?.resetFields();
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
onCancel={() => {
|
||||
setShowDetailDrawer(false)
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
modalRender={(modal) => {
|
||||
return <Draggable
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
handle=".modal-drag-title"
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
}}
|
||||
>
|
||||
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
formRef={modalRef}
|
||||
submitter={false}
|
||||
initialValues={currentRow ? {
|
||||
...currentRow,
|
||||
MEMBERSHIP_BIRTHDAY: currentRow?.MEMBERSHIP_BIRTHDAY ? moment(currentRow?.MEMBERSHIP_BIRTHDAY).format('YYYY-MM-DD') : '',
|
||||
ADDTIME: currentRow?.ADDTIME ? moment(currentRow?.ADDTIME).format('YYYY-MM-DD HH:mm:ss') : ''
|
||||
} : {}}
|
||||
>
|
||||
<div className="modalTop">
|
||||
<div className="modalTopLeft">
|
||||
<img className="memberIcon" src={memberInfoIcon} />
|
||||
<span className="modalTitle">会员详情</span>
|
||||
</div>
|
||||
<div className="modalTopRight">
|
||||
<img className="memberIcon" src={closeIcon} onClick={() => {
|
||||
handleCloseModal()
|
||||
}} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="topDetail">
|
||||
<div className="topDetailLeft">
|
||||
<img className="headerImage" src={currentRow?.MEMBERSHIP_HEADIMAGEURL || "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132"} />
|
||||
</div>
|
||||
|
||||
<div className="topDetailRight">
|
||||
<div className="topDetailRightTop">
|
||||
<span className="detailName">{currentRow?.MEMBERSHIP_NAME || "-"}</span>
|
||||
<span className="detailSex">{currentRow?.MEMBERSHIP_SEX === 1 ? '男' : currentRow?.MEMBERSHIP_SEX === 2 ? '女' : ''}</span>
|
||||
{
|
||||
currentRow?.MEMBERSHIP_TYPE && MEMBERSHIP_TYPEObj && MEMBERSHIP_TYPEObj[currentRow?.MEMBERSHIP_TYPE] ?
|
||||
<span className="memberType">{MEMBERSHIP_TYPEObj[currentRow?.MEMBERSHIP_TYPE]}</span> : ""
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<div className="topDetailItem">
|
||||
<Row gutter={8}>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"CERTIFICATE_NUMBER"}
|
||||
label={"身份证号"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"MEMBERSHIP_MOBILEPHONE"}
|
||||
label={"联系电话"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"LICENSEPLATE_NUMBER"}
|
||||
label={"车牌号"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"MEMBERSHIP_BIRTHDAY"}
|
||||
label={"会员生日"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={16} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"MEMBERSHIP_ADDRESS"}
|
||||
label={"联系地址"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="carNavBox">
|
||||
<img className="carNavIcon" src={memberDetailIcon} />
|
||||
<span className="carNavTitle">详情信息</span>
|
||||
</div>
|
||||
|
||||
<div className="bottomDetailBox">
|
||||
<Row gutter={8}>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"MEMBERSHIP_CARD"}
|
||||
label={"会员卡号"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"MEMBERSHIP_CODE"}
|
||||
label={"会员编码"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"MEMBERSHIP_LEVEL"}
|
||||
label={"会员等级"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={MEMBERSHIP_LEVELList}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"ACCOUNT_BALANCE"}
|
||||
label={"账户余额"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"MEMBERSHIP_POINT"}
|
||||
label={"会员积分"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"MEMBERSHIP_STATE"}
|
||||
label={"会员状态"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={COMPANY_STATEList}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormSelect
|
||||
name={"ISPLUS"}
|
||||
label={"付费会员"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
options={[{ label: "是", value: 1 }, { label: "否", value: 0 }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"PLUS_EXPIRYDATE"}
|
||||
label={"付费有效期"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"RECOMMEND_NAME"}
|
||||
label={"推荐人"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={18} className="memberInfoDetailItem">
|
||||
<ProFormText
|
||||
name={"ADDTIME"}
|
||||
label={"添加时间"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24} className="memberInfoDetailItem">
|
||||
<ProFormTextArea
|
||||
name={"MEMBERSHIP_DESC"}
|
||||
label={"备注说明"}
|
||||
readonly
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
|
||||
</ProForm>
|
||||
|
||||
|
||||
</Modal>
|
||||
|
||||
{/* <Drawer
|
||||
width={'80%'}
|
||||
open={showDetailDrawer}
|
||||
closable={false}
|
||||
@ -688,7 +1019,7 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
/>
|
||||
</Drawer>
|
||||
</Drawer> */}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
176
src/pages/travelMember/memberInfor/style.less
Normal file
176
src/pages/travelMember/memberInfor/style.less
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<FormInstance>();
|
||||
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||
const [treeView, setTreeView] = useState<any>()
|
||||
// 树相关的属性和方法
|
||||
@ -26,6 +42,15 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const [showRightForm, setShowRightForm] = useState<boolean>(true)
|
||||
const serverPartRef = useRef<any>()
|
||||
const shopregionObj = session.get('shopregionObj')
|
||||
// 显示上传图片的悬浮框
|
||||
const [showUploadImgModal, setShowUploadImgModal] = useState<boolean>(false)
|
||||
// 点击的按钮类型 1 服务区图片上传 2 母婴室图片上传 3 司机之家图片上传 4 住宿客房图片上传 5 便利店图片上传
|
||||
const [showType, setShowType] = useState<number>(0)
|
||||
// 悬浮框的点击确认的效果
|
||||
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||
// 文件列表
|
||||
const [fileList, setFileList] = useState<any>([])
|
||||
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(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"
|
||||
}}>
|
||||
<div style={{ height: 'calc(100% - 60px)', overflowY: 'auto', }}>
|
||||
<div style={{ height: 'calc(100% - 60px)', overflowY: 'auto', boxSizing: "border-box", paddingTop: '12px' }}>
|
||||
{
|
||||
showRightForm ?
|
||||
<ServerpartInfo onRef={serverPartRef} currentRow={{ SERVERPART_ID: selectedId ? selectedId : '' }} onShow={showRightForm} /> :
|
||||
<LoadingBox />
|
||||
}
|
||||
</div>
|
||||
<div style={{ height: '60px', width: '100%', display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
|
||||
<div style={{ height: '60px', width: '100%', display: 'flex', justifyContent: 'space-between', alignItems: 'center', boxSizing: "border-box", padding: "0 16px" }}>
|
||||
{/* 上传设施图片 */}
|
||||
{/* 点击的按钮类型 1 服务区图片上传 2 母婴室图片上传 3 司机之家图片上传 4 住宿客房图片上传 5 便利店图片上传 */}
|
||||
{
|
||||
selectedId ? <div>
|
||||
<Button type={'primary'} style={{ marginRight: '8px' }} onClick={() => {
|
||||
setShowType(1)
|
||||
setShowUploadImgModal(true)
|
||||
}}>服务区图片上传</Button>
|
||||
|
||||
<Button type={'primary'} style={{ marginRight: '8px' }} onClick={() => {
|
||||
setShowType(2)
|
||||
setShowUploadImgModal(true)
|
||||
}}>母婴室图片上传</Button>
|
||||
|
||||
<Button type={'primary'} style={{ marginRight: '8px' }} onClick={() => {
|
||||
setShowType(3)
|
||||
setShowUploadImgModal(true)
|
||||
}}>司机之家图片上传</Button>
|
||||
|
||||
<Button type={'primary'} style={{ marginRight: '8px' }} onClick={() => {
|
||||
setShowType(4)
|
||||
setShowUploadImgModal(true)
|
||||
}}>住宿客房图片上传</Button>
|
||||
|
||||
<Button type={'primary'} style={{ marginRight: '8px' }} onClick={() => {
|
||||
setShowType(5)
|
||||
setShowUploadImgModal(true)
|
||||
}}>便利店图片上传</Button>
|
||||
</div> : ""
|
||||
}
|
||||
{
|
||||
selectedId ?
|
||||
<Button type="primary" onClick={() => {
|
||||
@ -287,9 +351,167 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
}}>保存</Button> : ''
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{/* 图片预览组件 */}
|
||||
{fileList && fileList.length > 0 && <div style={{ display: 'none' }}>
|
||||
<Image.PreviewGroup
|
||||
preview={{
|
||||
visible: imagePreviewVisible,
|
||||
onVisibleChange: vis => {
|
||||
handleChangePreview(vis)
|
||||
}
|
||||
}}>
|
||||
{
|
||||
fileList.map((n) => <Image src={n.url} key={n.url} />)
|
||||
}
|
||||
</Image.PreviewGroup>
|
||||
</div>}
|
||||
|
||||
{/* */}
|
||||
<Modal
|
||||
title={showType === 1 ? '服务区图片' : showType === 2 ? '母婴室图片' : showType === 3 ? '司机之家图片' : showType === 4 ? '住宿客房图片' : showType === 5 ? '便利店图片' : ''}
|
||||
destroyOnClose={true}
|
||||
width={1200}
|
||||
visible={showUploadImgModal}
|
||||
confirmLoading={confirmLoading}
|
||||
onCancel={() => {
|
||||
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([])
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
formRef={modalRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
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 {}
|
||||
}}
|
||||
>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<ProFormUploadButton
|
||||
name="SCENICAREA_Image"
|
||||
label={showType === 1 ? '服务区图片' : showType === 2 ? '母婴室图片' : showType === 3 ? '司机之家图片' : showType === 4 ? '住宿客房图片' : showType === 5 ? '便利店图片' : ''}
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
onPreview: handlePreview,
|
||||
fileList: fileList, // 绑定 fileList
|
||||
onChange: async (info: any) => {
|
||||
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: <ExclamationCircleOutlined />,
|
||||
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)
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
</ProForm>
|
||||
</Modal>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user