This commit is contained in:
ylj20011123 2025-06-19 19:29:53 +08:00
parent d94b67182e
commit 09d7a93e89
10 changed files with 1440 additions and 22 deletions

View File

@ -687,6 +687,11 @@ export default [
path: 'GrowthValueRecordSearch', path: 'GrowthValueRecordSearch',
name: 'GrowthValueRecordSearch', name: 'GrowthValueRecordSearch',
component: './travelMember/GrowthValueRecordSearch/index' component: './travelMember/GrowthValueRecordSearch/index'
},
{
path: 'MemberAddress',
name: 'MemberAddress',
component: './travelMember/MemberAddress/index'
} }
] ]
}, },
@ -727,6 +732,18 @@ export default [
} }
] ]
}, },
{
path: '/operatingMerchants',
name: 'operatingMerchants',
icon: 'AccountBookOutlined',
routes: [
{
path: 'MerchantInformation',
name: 'MerchantInformation',
component: './operatingMerchants/MerchantInformation/index'
},
]
},
{ {

View File

@ -16,6 +16,7 @@ import RevenueList from './RevenueList';
import moment from 'moment'; import moment from 'moment';
import { fmoney } from "@/services/options"; import { fmoney } from "@/services/options";
import { getDetail } from "@/pages/contract/service"; import { getDetail } from "@/pages/contract/service";
import Item from 'antd/lib/list/Item';
// 更新回款信息 // 更新回款信息
const handleAddUpdate = async (dataType: 1000 | 2000, fields: number) => { const handleAddUpdate = async (dataType: 1000 | 2000, fields: number) => {
@ -104,7 +105,6 @@ const ShareBenefit: React.FC<{ props: BusinessProjectModel, showEdit?: boolean,
return `${record.GUARANTEERATIO || '-'}%` return `${record.GUARANTEERATIO || '-'}%`
}, },
}, },
{ {
title: '保底租金', title: '保底租金',
dataIndex: 'MINTURNOVER', dataIndex: 'MINTURNOVER',
@ -171,8 +171,8 @@ const ShareBenefit: React.FC<{ props: BusinessProjectModel, showEdit?: boolean,
valueType: 'option', valueType: 'option',
width: 80, width: 80,
hideInTable: showType === 'Nooperate' ? true : !(showEdit === undefined || showEdit), hideInTable: showType === 'Nooperate' ? true : !(showEdit === undefined || showEdit),
render: (_, record,) => ( render: (_, record) => (
new Date(record?.STARTDATE).getTime() < new Date().getTime() ? new Date(record?.STARTDATE).getTime() < new Date().getTime() && record.showAgainBtn ?
<Space> <Space>
<a <a
key="revenue" key="revenue"
@ -223,7 +223,7 @@ const ShareBenefit: React.FC<{ props: BusinessProjectModel, showEdit?: boolean,
] ]
// 拿到关联合同项目数据 // 拿到关联合同项目数据
const handleGetRelatedData = (list: any) => { const handleGetRelatedData = async (list: any) => {
console.log('list', list); console.log('list', list);
let result: any = [] let result: any = []
@ -231,21 +231,31 @@ const ShareBenefit: React.FC<{ props: BusinessProjectModel, showEdit?: boolean,
// 可能存在多个关联项目 // 可能存在多个关联项目
for (let i = 0; i <= list.length - 1; i++) { for (let i = 0; i <= list.length - 1; i++) {
handleGetSplitRes({ const res = await handleGetSplitRes({
DataType: 2, DataType: 2,
CompactId: list[0].REGISTERCOMPACT_ID CompactId: list[i].REGISTERCOMPACT_ID
}).then(res => {
console.log('res', res);
result.push({
title: list[0].COMPACT_NAME,
time: `${moment(list[0].COMPACT_STARTDATE).format('YYYY-MM-DD')}-${moment(list[0].COMPACT_ENDDATE).format('YYYY-MM-DD')}`,
data: res.data
})
// for循环不一定会等接口调完 才赋值 所以放在循环里面 最后一次也会拿到最新的
setRelateTableData(result)
}) })
} result.push({
title: list[i].COMPACT_NAME,
time: `${moment(list[i].COMPACT_STARTDATE).format('YYYY-MM-DD')}-${moment(list[i].COMPACT_ENDDATE).format('YYYY-MM-DD')}`,
STARTDATE: moment(list[i].COMPACT_STARTDATE).format('YYYY-MM-DD'),
ENDDATE: moment(list[i].COMPACT_ENDDATE).format('YYYY-MM-DD'),
data: res.data
})
// .then(res => {
// console.log('312321312312', JSON.parse(JSON.stringify(res)));
// result.push({
// title: list[i].COMPACT_NAME,
// time: `${moment(list[i].COMPACT_STARTDATE).format('YYYY-MM-DD')}-${moment(list[0].COMPACT_ENDDATE).format('YYYY-MM-DD')}`,
// data: res.data
// })
// console.log('resultresultresultresult', result);
// // for循环不一定会等接口调完 才赋值 所以放在循环里面 最后一次也会拿到最新的
// })
}
setRelateTableData(result)
return result
} }
return ( return (
@ -281,9 +291,29 @@ const ShareBenefit: React.FC<{ props: BusinessProjectModel, showEdit?: boolean,
} }
} }
const data = await handleGetSplitRes(req) const data = await handleGetSplitRes(req)
console.log('fjajasdaslkd', data);
let res: any = []
if (relatedContractsList && relatedContractsList.length > 0) { if (relatedContractsList && relatedContractsList.length > 0) {
handleGetRelatedData(relatedContractsList) res = await handleGetRelatedData(relatedContractsList)
} }
console.log('resresresresres', res);
if (res && res.length > 0) {
res.forEach((item: any) => {
if (data.data && data.data.length > 0) {
data.data.forEach((subItem: any) => {
if (new Date(item.STARTDATE).getTime() < new Date(subItem.ENDDATE).getTime() && new Date(item.ENDDATE).getTime() >= new Date(subItem.ENDDATE).getTime()) {
// 如果该行数据(上面的) 已经包括了下面的数据的时间 那么这段就不出现重新生成
} else {
subItem.showAgainBtn = true
}
})
}
})
}
setTableLoading(false) setTableLoading(false)
return data return data
}} }}

View File

@ -368,13 +368,16 @@ const Detail = ({ id, showTabs, tabActive, smallTabActive, isPayment, price, dat
PageSize: 999999 PageSize: 999999
} }
} }
console.log('req', req);
const data = await handleGetRelatedList(req) const data = await handleGetRelatedList(req)
console.log('handleGetRelatedContracts', data); console.log('handleGetRelatedContracts', data);
if (data && data.data && data.data.length > 0) { if (data && data.data && data.data.length > 0) {
const list: any = [] const list: any = []
data.data.forEach((item: any) => { data.data.forEach((item: any) => {
if (type !== 1000 || (type === 1000 && item.COMPACT_DETAILS !== 1000)) { // if (type !== 1000 || (type === 1000 && item.COMPACT_DETAILS !== 1000)) {
if (item.COMPACT_DETAILS === 2000) {
list.push(item) list.push(item)
} }
}) })
@ -682,7 +685,7 @@ const Detail = ({ id, showTabs, tabActive, smallTabActive, isPayment, price, dat
// { key: 4, tab: '商家往来款' }, { key: 9, tab: '在售商品信息' }, // { key: 4, tab: '商家往来款' }, { key: 9, tab: '在售商品信息' },
const list = [{ key: 2, tab: '欠款组成' }, { key: 3, tab: '履约拆分' }, { key: 5, tab: '合作分润' }, const list = [{ key: 2, tab: '欠款组成' }, { key: 3, tab: '履约拆分' }, { key: 5, tab: '合作分润' },
{ key: 7, tab: '营收分润' }, { key: 8, tab: '单品销售' }, { key: 10, tab: '门店营收' }, { key: 11, tab: '现场稽核' }, { key: 7, tab: '营收分润' }, { key: 8, tab: '单品销售' }, { key: 10, tab: '门店营收' }, { key: 11, tab: '现场稽核' },
{ key: 1, tab: '合同详情' },{ key: 4, tab: '商家往来款' }] // 可显示的所有tab标签 { key: 1, tab: '合同详情' }, { key: 4, tab: '商家往来款' }] // 可显示的所有tab标签
// 筛选需要显示的tab list // 筛选需要显示的tab list
const tabs = showTabs || [1, 3, 4, 5, 7, 8, 9, 10, 11] const tabs = showTabs || [1, 3, 4, 5, 7, 8, 9, 10, 11]
// if (!showTabs && projectDetail?.BUSINESS_TYPE === 1000) { // if (!showTabs && projectDetail?.BUSINESS_TYPE === 1000) {

View File

@ -0,0 +1,723 @@
// 商家信息管理
import React, { useRef, useState, Suspense } from 'react';
import moment from 'moment'; // 时间相关引用,没有使用可以删除
import numeral from "numeral"; // 数字相关引用,没有使用可以删除
import { connect } from 'umi';
import useRequest from '@ahooksjs/use-request'; // 请求数据的引用
import Draggable from 'react-draggable';
import SubMenu from "antd/lib/menu/SubMenu";
import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';
import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from '@ant-design/pro-form';
import { 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';
import type { CurrentUser } from "umi";
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 { handleGetMEMBERADDRESSList, handleGetSERVERPARTSHOPList } from '../service';
import LeftSelectTree from '@/pages/reports/settlementAccount/component/leftSelectTree';
import session from '@/utils/session';
const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
const { currentUser } = props
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const associationActionRef = useRef<ActionType>();
const [currentRow, setCurrentRow] = useState<any>();
const [showDetail, setShowDetail] = useState<boolean>();
const [modalVisible, handleModalVisible] = useState<boolean>();
const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交
const [searchParams, setSearchParams] = useState<any>();
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
const [collapsible, setCollapsible] = useState<boolean>(false)
// 新增关联选择的方法
const [selectedRowKeys, setSelectRowKeys] = useState<any>();
const [selectedRowDetail, setSelectRowDetail] = useState<any>();
let SHOPTRADEObj = session.get('SHOPTRADEObj')
let shopregionObj = session.get('shopregionObj')
let businessStateObj = session.get('businessStateObj')
// 弹出框拖动效果
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
const draggleRef = React.createRef<any>()
// 显示新增门店功能悬浮框
const [showAddModal, setShowAddModal] = useState<boolean>(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 = [
{
dataIndex: 'SELLER_NAME',
title: '商家名称',
align: 'center',
hideInSearch: true,
render: (_, record) => {
return record?.SELLER_NAME ? `${record?.SERVERPART_NAME || ""}${record?.SELLER_NAME}` : "-"
}
},
{
dataIndex: 'SHOPTRADE',
title: '经营业态',
align: 'center',
width: 150,
valueType: 'select',
valueEnum: SHOPTRADEObj,
fieldProps: {
showSearch: true,
filterOption: (input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
},
},
{
dataIndex: '',
title: '预约点餐',
align: 'center',
width: 150,
hideInSearch: true,
},
{
dataIndex: 'MONTHLYSALES',
title: '月销售量',
align: 'center',
width: 150,
hideInSearch: true,
},
{
dataIndex: 'PERCAPITA',
title: '人均消费',
align: 'center',
width: 150,
hideInSearch: true,
},
{
dataIndex: 'SELLER_SCORE',
title: '评价分数',
align: 'center',
width: 150,
hideInSearch: true,
},
{
dataIndex: 'COMMENT_COUNT',
title: '评价数量',
align: 'center',
width: 150,
hideInSearch: true,
},
{
dataIndex: 'SERVERPARTSELLER_DESC',
title: '备注说明',
width: 150,
ellipsis: true,
align: 'center',
hideInSearch: true,
},
{
dataIndex: 'option',
title: '操作',
valueType: 'option',
width: 150,
align: 'center',
hideInSearch: true,
render: (_, record) => {
return (
<Space>
<a
onClick={() => {
setCurrentRow({ ...record });
handleModalVisible(true);
}}
>
</a>
<Popconfirm
title="确认删除该服务区商家信息列表信息吗?"
onConfirm={async () => {
await handelDelete(record.SERVERPARTSELLER_ID);
}}
>
<a></a>
</Popconfirm>
</Space>
);
},
},
];
// 关联商家的表格
const merchantColumns: any = [
{
dataIndex: 'SERVERPART_NAME',
title: '服务区名称',
align: 'center',
width: 150,
ellipsis: true,
hideInSearch: true,
},
{
dataIndex: 'SHOPNAME',
title: '门店名称',
align: 'center',
width: 150,
ellipsis: true,
hideInSearch: true,
},
{
dataIndex: 'SHOPREGION',
title: '所属方位',
align: 'center',
width: 120,
hideInSearch: true,
valueType: "select",
valueEnum: shopregionObj
},
{
dataIndex: 'SCANCODE_ORDER',
title: '扫码点餐',
align: 'center',
width: 120,
hideInSearch: true,
valueType: "select",
valueEnum: {
"0": "禁用",
"1": "启用"
}
},
{
dataIndex: 'BUSINESS_STATE',
title: '经营状态',
align: 'center',
width: 120,
hideInSearch: true,
valueType: "select",
valueEnum: businessStateObj
},
{
dataIndex: 'SHOPDIRECTION',
title: '门店方向',
align: 'center',
width: 120,
ellipsis: true,
hideInSearch: true,
},
{
dataIndex: 'ISVALID',
title: '门店状态',
align: 'center',
width: 120,
valueEnum: {
"0": "无效",
"1": "有效"
},
initialValue: "1"
},
{
dataIndex: 'SERVERPARTSHOP_DESC',
title: '介绍说明',
align: 'center',
width: 150,
ellipsis: true,
hideInSearch: true,
},
{
dataIndex: 'option',
title: '操作',
valueType: 'option',
width: 150,
align: 'center',
hideInSearch: true,
render: (_, record) => {
return (
<Space>
<a
onClick={() => {
setCurrentRow({ ...record });
handleModalVisible(true);
}}
>
</a>
</Space>
);
},
},
]
const handelDelete = async (serverpartsellerid: number) => {
};
const handleAddUpdate = async (res: any) => {
};
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
style={{ height: 'calc(100vh - 135px)', background: '#fff' }}
scroll={{ y: 'calc(100vh - 410px)' }}
rowKey={(record) => {
return `${record?.SERVERPARTSELLER_ID}`
}}
bordered
formRef={formRef}
headerTitle="服务区商家信息列表" // 列表表头
actionRef={actionRef}
search={{ span: 6, labelWidth: 'auto' }}
// 请求数据
request={async (params, sorter) => {
if (!selectedId) {
return
}
const req = {
searchParameter: {
SERVERPART_IDS: selectedId,
SHOPTRADES: params?.SHOPTRADES,
ISVALID: 1
},
PageIndex: params.current,
PageSize: params.pageSize,
}
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 }
}}
columns={columns}
toolbar={{
actions: selectedId ? [
// 新增按钮
<Button
key="new"
icon={<PlusOutlined />}
type="primary"
onClick={() => {
setShowAddModal(true)
}}
>
</Button>,
] : "",
}}
pagination={{ defaultPageSize: 10 }}
/>
</div>
</div>
{/* 添加服务区商家信息表 */}
<Modal
title={'新建服务区商家信息'}
destroyOnClose
width={'75%'}
visible={showAddModal}
afterClose={() => {
}}
onCancel={() => {
setShowAddModal(false)
setSelectRowKeys(null)
setSelectRowDetail(null)
}}
okText={"关联"}
onOk={async () => { // 提交框内的数据
console.log('selectedRowKeysselectedRowKeys', selectedRowKeys);
console.log('selectedRowDetailselectedRowDetail', selectedRowDetail);
}}
>
<ProTable
actionRef={associationActionRef}
columns={merchantColumns}
scroll={{ x: '100%', y: '400px' }}
bordered
rowKey={"SERVERPARTSHOP_ID"}
request={async (params) => {
const req: any = {
searchParameter: {
SERVERPART_IDS: selectedId,
ISVALID: params?.ISVALID
},
PageIndex: 1,
PageSize: 999999,
SortStr: "SHOPTRADE,SHOPREGION,SHOPSHORTNAME,SHOPCODE"
}
const data = await handleGetSERVERPARTSHOPList(req)
if (data.List && data.List.length > 0) {
let list: any = []
data.List.forEach((item: any) => {
if (!item.SELLER_ID) {
list.push(item)
}
})
console.log('datadatadatadatadata2', list);
return { data: list, success: true }
}
return { data: [], success: true }
}}
pagination={false}
rowSelection={{
type: 'checkbox',
onChange: (rowKeys, rowDetail) => {
setSelectRowKeys(rowKeys)
setSelectRowDetail(rowDetail)
},
}}
/>
</Modal>
{/* 同步商户门店信息的悬浮框 */}
<Modal
title={
<div
style={{
width: '100%',
cursor: 'move',
}}
onMouseOver={() => {
if (disabled) {
setDraggleDisabled(false)
}
}}
onMouseOut={() => {
setDraggleDisabled(true)
}}
onFocus={() => { }}
onBlur={() => { }}
>
{currentRow ? '更新服务区商家信息' : '新建服务区商家信息'}
</div>
}
destroyOnClose={true}
width={900}
visible={modalVisible}
confirmLoading={confirmLoading}
afterClose={() => {
formRef.current?.resetFields();
setCurrentRow(undefined);
}}
onCancel={() => {
handleConfirmLoading(false)
handleModalVisible(false)
}}
onOk={async () => { // 提交框内的数据
formRef?.current?.validateFields().then(() => {
handleConfirmLoading(true)
formRef?.current?.submit()
})
}}
modalRender={(modal) => {
return <Draggable
disabled={disabled}
bounds={bounds}
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
>
<div ref={draggleRef}>{modal}</div>
</Draggable>
}}
>
<ProForm
layout={'horizontal'}
wrapperCol={{ span: 16 }} // 表单项 填写部分所占的栅格数
labelCol={{ span: 6 }} // 表单项 标题所占的栅格数
formRef={formRef}
autoFocusFirstInput
submitter={false}
preserve={false}
initialValues={currentRow}
onFinish={async (values) => {
let newValue: any = { ...values };
if (currentRow) {
// 编辑数据
newValue = { ...values, SERVERPARTSELLER_ID: currentRow.SERVERPARTSELLER_ID };
}
// 如果有开关,要把开关的代码写进去
const success = await handleAddUpdate(newValue as SERVERPARTSELLERModel);
handleConfirmLoading(false)
if (success) {
if (actionRef.current) {
actionRef.current.reload();
}
handleModalVisible(false);
}
}}
>
<Row>
<Col span={12}>
<ProFormText
name="SELLER_NAME"
label="商家名称"
/>
</Col>
<Col span={12}>
<ProFormText
name="PROVINCE_CODE"
label="省份编码"
/>
</Col>
<Col span={12}>
<ProFormText
name="SERVERPARTSHOP_IDS"
label="东西区门店内码"
/>
</Col>
<Col span={12}>
<ProFormText
name="SHOPTRADE"
label="行业名称"
/>
</Col>
<Col span={12}>
<ProFormText
name="SHOPDIRECTION"
label="门店方向"
/>
</Col>
<Col span={12}>
<ProFormText
name="SHOPREGION"
label="所属方位"
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="SELLER_INDEX"
label="排序索引"
/>
</Col>
<Col span={12}>
<ProFormText
name="SELLER_LINKMAN"
label="联系人员"
/>
</Col>
<Col span={12}>
<ProFormText
name="SELLER_TELEPHONE"
label="商家电话"
/>
</Col>
<Col span={12}>
<ProFormText
name="SELLER_ADDRESS"
label="商家地址"
/>
</Col>
<Col span={12}>
<ProFormDatePicker
name="BUS_STARTDATE"
label="营业时间"
width="lg"
/>
</Col>
<Col span={24}>
<ProFormTextArea
name="SELLER_DESC"
label="商家介绍"
labelCol={{ span: 3 }}
wrapperCol={{ span: 20 }}
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="SELLER_SCORE"
label="平均评分"
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="COMMENT_COUNT"
label="评价数量"
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="MONTHLYSALES"
label="销量"
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="CASHPAY"
label="销售额"
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="PERCAPITA"
label="人均"
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="SHOW_HOME"
label="是否显示在首页"
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="SHOW_HOME_INDEX"
label="精选商户排序"
/>
</Col>
<Col span={12}>
<ProFormMoney
width="lg"
fieldProps={{
moneySymbol: false,
}}
name="ISSHOW"
label="是否显示在发现页"
/>
</Col>
<Col span={12}>
<ProFormText
name="SELF_COMMENT"
label="掌柜自评"
/>
</Col>
<Col span={12}>
<ProFormSelect
name="ISVALID"
label="是否有效数据"
/>
</Col>
<Col span={12}>
<ProFormText
name="CREATE_STAFF_NAME"
label="创建人员"
/>
</Col>
<Col span={12}>
<ProFormDatePicker
name="CREATE_DATE"
label="创建时间"
width="lg"
/>
</Col>
<Col span={12}>
<ProFormText
name="UPDATE_STAFF_NAME"
label="修改人员"
/>
</Col>
<Col span={12}>
<ProFormDatePicker
name="UPDATE_DATE"
label="修改时间"
width="lg"
/>
</Col>
<Col span={24}>
<ProFormTextArea
name="SERVERPARTSELLER_DESC"
label="备注说明"
labelCol={{ span: 3 }}
wrapperCol={{ span: 20 }}
/>
</Col>
<Col style={{ display: 'none' }}>
<ProFormText
name="SELLER_ID"
label="内码"
/>
</Col>
<Col style={{ display: 'none' }}>
<ProFormText
name="SERVERPART_ID"
label="服务区内码"
/>
</Col>
<Col style={{ display: 'none' }}>
<ProFormText
name="CREATE_STAFF_ID"
label="创建人内码"
/>
</Col>
<Col style={{ display: 'none' }}>
<ProFormText
name="UPDATE_STAFF_ID"
label="修改人内码"
/>
</Col>
</Row>
</ProForm>
</Modal>
</div>
);
};
export default connect(({ user }: ConnectState) => ({
currentUser: user.currentUser
}))(MerchantInformation);

View File

@ -0,0 +1,51 @@
import requestEncryption from '@/utils/requestEncryption';
// 拿到服务区商家信息表
export async function handleGetMEMBERADDRESSList(params: any) {
const data = await requestEncryption(`/BaseInfo/GetSERVERPARTSELLERList`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return []
}
return data.Result_Data
}
// 同步服务区商家信息
export async function handleSynchroSERVERPARTSELLER(params: any) {
const data = await requestEncryption(`/BaseInfo/SynchroSERVERPARTSELLER`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return []
}
return data
}
// 删除服务区商家
export async function handleDeleteSERVERPARTSELLER(params: any) {
const data = await requestEncryption(`/BaseInfo/DeleteSERVERPARTSELLER`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return []
}
return data
}
// 获取门店信息列表
export async function handleGetSERVERPARTSHOPList(params: any) {
const data = await requestEncryption(`/BaseInfo/GetSERVERPARTSHOPList`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return []
}
return data.Result_Data
}

View File

@ -19,6 +19,7 @@ import { wrapTreeNode } from "@/utils/format";
import YearExamineDetailTable from "../settlementAccount/component/YearExamineDetailTable"; import YearExamineDetailTable from "../settlementAccount/component/YearExamineDetailTable";
import './index.less' import './index.less'
import * as XLSX from 'xlsx'; import * as XLSX from 'xlsx';
import session from "@/utils/session";
const settlementSummaryTable: React.FC<{ currentUser: CurrentUser }> = (props) => { const settlementSummaryTable: React.FC<{ currentUser: CurrentUser }> = (props) => {
const { currentUser } = props const { currentUser } = props
@ -30,7 +31,7 @@ const settlementSummaryTable: React.FC<{ currentUser: CurrentUser }> = (props) =
const [collapsible, setCollapsible] = useState<boolean>(false) const [collapsible, setCollapsible] = useState<boolean>(false)
const [treeView, setTreeView] = useState<any>() const [treeView, setTreeView] = useState<any>()
const [printIndex, setPrintIndex] = useState<number>(new Date().getTime()) const [printIndex, setPrintIndex] = useState<number>(new Date().getTime())
let SETTLEMENT_MODESObj = session.get('SETTLEMENT_MODESObj')
// 树相关的属性和方法 // 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>() const [selectedId, setSelectedId] = useState<string>()
@ -85,6 +86,17 @@ const settlementSummaryTable: React.FC<{ currentUser: CurrentUser }> = (props) =
"-1": "提前退场", "-1": "提前退场",
} }
}, },
{
title: "结算模式",
dataIndex: 'SettlementModes',
valueType: 'select',
hideInTable: true,
valueEnum: SETTLEMENT_MODESObj,
fieldProps: {
mode: 'multiple', // 开启多选模式
},
initialValue: ["3000", "4000"]
},
{ {
title: <div style={{ textAlign: 'center' }}></div>, title: <div style={{ textAlign: 'center' }}></div>,
titleStr: '管理中心', titleStr: '管理中心',
@ -665,7 +677,8 @@ const settlementSummaryTable: React.FC<{ currentUser: CurrentUser }> = (props) =
const req: any = { const req: any = {
StatisticsYear: params?.StatisticsYear, StatisticsYear: params?.StatisticsYear,
ServerpartId: selectedId, ServerpartId: selectedId,
SettlementState: params?.SettlementState SettlementState: params?.SettlementState,
SettlementModes: params?.SettlementModes
// ServerpartIds: selectedId, // ServerpartIds: selectedId,
// // ShopRoyaltyId: compareCurrent?.ShopRoyaltyId, // // ShopRoyaltyId: compareCurrent?.ShopRoyaltyId,
// // BusinessProjectId: compareCurrent?.BUSINESSPROJECT_ID, // // BusinessProjectId: compareCurrent?.BUSINESSPROJECT_ID,

View File

@ -0,0 +1,541 @@
// 地址管理
import React, { useRef, useState, Suspense, useEffect } from 'react';
import moment from 'moment'; // 时间相关引用,没有使用可以删除
import numeral from "numeral"; // 数字相关引用,没有使用可以删除
import { connect } from 'umi';
import useRequest from '@ahooksjs/use-request'; // 请求数据的引用
import Draggable from 'react-draggable';
import SubMenu from "antd/lib/menu/SubMenu";
import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';
import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from '@ant-design/pro-form';
import { 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';
import type { CurrentUser } from "umi";
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';
const MemberAddress: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
const { currentUser } = props
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const [currentRow, setCurrentRow] = useState<MEMBERADDRESSModel>();
const [showDetail, setShowDetail] = useState<boolean>();
const [modalVisible, handleModalVisible] = useState<boolean>();
const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交
const [searchParams, setSearchParams] = useState<any>();
// 弹出框拖动效果
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
const draggleRef = React.createRef<any>()
const [province, setProvince] = useState<string>('');
const [city, setCity] = useState<string>('');
const [county, setCounty] = useState<string>('');
const [address, setAddress] = useState<string>('');
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),
});
};
// 拖动结束
useEffect(() => {
formRef.current?.setFieldsValue({ ADDRESS: `${province || ''}${city || ''}${county || ''}` })
// 监听省、市、区/县的变化,拼接收货地址
// setAddress(`${province || ''}${city || ''}${county || ''}`);
}, [province, city, county]);
// 定义列表字段内容
const columns: 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: '收货地址',
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>
);
},
},
];
const handelDelete = async (id: number) => {
const result = await handleDeleteMEMBERADDRESS({
MEMBERADDRESSId: id
});
console.log('resultresultresult', result);
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?.MEMBERADDRESS_ID) {
req = {
...currentRow,
...res
}
} else {
req = {
...res,
ADDTIME: moment().format('YYYY-MM-DD HH:mm:ss'),
STAFF_ID: currentUser?.ID,
STAFF_NAME: currentUser?.Name,
OWNERUNIT_ID: currentUser?.OwnerUnitId,
OWNERUNIT_NAME: currentUser?.OwnerUnitName,
PROVINCE_CODE: currentUser?.ProvinceCode
}
}
const data = await handleSynchroMEMBERADDRESS(req);
if (data.Result_Code === 100) {
message.success(data.Result_Desc)
formRef?.current?.resetFields()
setCurrentRow(undefined)
handleModalVisible(false)
actionRef.current?.reload()
} else {
message.error(data.Result_Desc)
}
};
return (
<PageContainer header={{
title: '',
breadcrumb: {}
}}>
<ProTable
style={{ height: 'calc(100vh - 135px)', background: '#fff' }}
scroll={{ y: 'calc(100vh - 410px)' }}
rowKey={(record) => {
return `${record?.MEMBERADDRESS_ID}`
}}
formRef={formRef}
headerTitle="会员收货地址列表" // 列表表头
actionRef={actionRef}
search={{ span: 6, labelWidth: 'auto' }}
bordered
// 请求数据
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);
console.log('datadatadatadatadata', data);
if (data.List && data.List.length > 0) {
return { data: data.List, success: true, total: data.TotalCount }
}
return { data: [], success: true }
}}
columns={columns}
toolbar={{
actions: []
}}
/>
<Drawer
width={600}
visible={showDetail}
onClose={() => {
setCurrentRow(undefined);
setShowDetail(false);
}}
closable={false}
>
{currentRow?.MEMBERADDRESS_ID && (
<ProDescriptions
column={2}
request={async () => ({
data: currentRow || {},
})}
params={{
id: currentRow?.MEMBERADDRESS_ID,
}}
columns={columns}
/>
)}
</Drawer>
<Modal
title={
<div
style={{
width: '100%',
cursor: 'move',
}}
onMouseOver={() => {
if (disabled) {
setDraggleDisabled(false)
}
}}
onMouseOut={() => {
setDraggleDisabled(true)
}}
onFocus={() => { }}
onBlur={() => { }}
>
{currentRow ? '更新会员收货地址' : '新建会员收货地址'}
</div>
}
destroyOnClose={true}
width={900}
visible={modalVisible}
confirmLoading={confirmLoading}
afterClose={() => {
formRef.current?.resetFields();
setCurrentRow(undefined);
}}
onCancel={() => {
handleConfirmLoading(false)
handleModalVisible(false)
setProvince("")
setCity("")
setCounty("")
}}
onOk={async () => { // 提交框内的数据
formRef?.current?.validateFields().then(() => {
handleConfirmLoading(true)
formRef?.current?.submit()
})
}}
modalRender={(modal) => {
return <Draggable
disabled={disabled}
bounds={bounds}
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
>
<div ref={draggleRef}>{modal}</div>
</Draggable>
}}
>
<ProForm
layout={'horizontal'}
labelCol={{ style: { width: '80px' } }}
formRef={formRef}
autoFocusFirstInput
submitter={false}
preserve={false}
initialValues={currentRow}
onFinish={async (values) => {
let newValue: any = { ...values };
if (currentRow) {
// 编辑数据
newValue = { ...values, MEMBERADDRESS_ID: currentRow.MEMBERADDRESS_ID };
}
await handleAddUpdate(newValue);
handleConfirmLoading(false)
}}
>
<Row gutter={8}>
<Col span={12}>
<ProFormText
name="USER_NAME"
label="收货人名称"
/>
</Col>
<Col span={12}>
<ProFormSelect
name="USER_SEX"
label="收货人性别"
options={[
{ label: "男", value: 1 },
{ label: "女", value: 2 },
]}
/>
</Col>
<Col span={12}>
<ProFormText
name="MOBILEPHONE"
label="手机号码"
/>
</Col>
<Col span={12}>
<ProFormText
name="RECEIVE_PROVINCE"
label="省"
fieldProps={{
onChange: (e: any) => {
console.log('eee', e);
setProvince(e.target.value)
}
}}
/>
</Col>
<Col span={12}>
<ProFormText
name="RECEIVE_CITY"
label="市"
fieldProps={{
onChange: (e: any) => {
setCity(e.target.value)
}
}}
/>
</Col>
<Col span={12}>
<ProFormText
name="RECEIVE_COUNTY"
label="区/县"
fieldProps={{
onChange: (e: any) => {
setCounty(e.target.value)
}
}}
/>
</Col>
<Col span={12}>
<ProFormText
name="ADDRESS"
label="收货地址"
disabled
/>
</Col>
<Col span={12}>
<ProFormText
name="DOORPLATE"
label="门牌号码"
/>
</Col>
<Col span={12}>
<ProFormSelect
name="ISDEFAULT"
label="默认地址"
options={[
{ label: "是", value: 1 },
{ label: "否", value: 0 },
]}
/>
</Col>
<Col span={12}>
<ProFormSelect
name="TAGTYPE"
label="地址类型"
options={[
{ label: "家", value: 1000 },
{ label: "公司", value: 2000 },
{ label: "其他", value: 3000 },
]}
/>
</Col>
<Col span={12}>
<ProFormSelect
name="ISVALID"
label="是否有效"
options={[
{ label: "是", value: 1 },
{ label: "否", value: 0 },
]}
/>
</Col>
<Col span={24}>
<ProFormTextArea
name="MEMBERADDRESS_DESC"
label="备注说明"
/>
</Col>
</Row>
</ProForm>
</Modal>
</PageContainer>
);
};
export default connect(({ user }: ConnectState) => ({
currentUser: user.currentUser
}))(MemberAddress);

View File

@ -127,4 +127,40 @@ export async function handleDeleteGROWTHSETTING(params: any) {
return [] return []
} }
return data return data
}
// 拿到收货地址列表数据
export async function handleGetMEMBERADDRESSList(params: any) {
const data = await requestEncryption(`/MemberOrder/GetMEMBERADDRESSList`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return []
}
return data.Result_Data
}
// 同步收获地址
export async function handleSynchroMEMBERADDRESS(params: any) {
const data = await requestEncryption(`/MemberOrder/SynchroMEMBERADDRESS`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return []
}
return data
}
// 删除收获地址
export async function handleDeleteMEMBERADDRESS(params: any) {
const data = await requestEncryption(`/MemberOrder/DeleteMEMBERADDRESS`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return []
}
return data
} }

View File

@ -158,6 +158,9 @@ export async function getServerpartTree(ProvinceCode?: number | string, Serverpa
ShowRoyalty=${false}&ShowCompactCount=${ShowCompactCount || false}&StatisticsType=${StatisticsType || ''}`, { ShowRoyalty=${false}&ShowCompactCount=${ShowCompactCount || false}&StatisticsType=${StatisticsType || ''}`, {
method: 'GET', method: 'GET',
}); });
console.log('djsiadjsakdjsalkjfoidhifsa', data);
if (data.Result_Code !== 100) { if (data.Result_Code !== 100) {
return []; return [];
} }

View File

@ -126,7 +126,8 @@ requestEncryption.interceptors.request.use((url, opt: any) => {
} }
} }
if (options.data.requestEncryption) {
if (options && options.data && options.data.requestEncryption) {
options.data = { options.data = {
name: "", name: "",
value: encryptAES(JSON.stringify(options.data)) value: encryptAES(JSON.stringify(options.data))