Commit f1bcc54c authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 8574dda6 aea5507a
......@@ -71,7 +71,19 @@ const settlementManageRoute = {
name: '详情',
hideInMenu: true,
component: '@/pages/settlementManage/capitalAccount/paymentWithdraw/paymentDetails'
}
},
// 商户e账户管理-通联
{
path: '/settlementManage/capitalAccount/eAccountLists',
name: '商户e账户管理-通联',
component: '@/pages/settlementManage/capitalAccount/eAccountLists'
},
{
path: '/settlementManage/capitalAccount/eAccountLists/detail',
name: '商户e账户管理-通联-详情',
hideInMenu: true,
component: '@/pages/settlementManage/capitalAccount/eAccountLists/eAccountDetails',
},
]
},
{
......
import { GlobalConfig } from '@/global/config'
import { getDefaultEnterprise, getChannelInfo, getIChannelInfo } from '@/utils'
import {
getInfoCenterUrl,
getlogisticsCenterUrl,
getManufactureCenterUrl,
getSrmCenterUrl,
getTopDomain,
} from '@/utils/getDomain'
export const NOT_CHANGE_VALUE = 'hello, world'
/**
* 请求头
*/
export const REQUEST_HEADER = 'http://'
/**
* 顶域
*/
const env = process.env.NODE_ENV
export const TOP_DOMAIN = getTopDomain(env, 'lingxidev.com')
export const TOP_DOMAIN_NO_PORT = getTopDomain(env, 'lingxidev.com', true)
/**
* 行情资讯域名
*/
export const INFO_CENTER_URL = getInfoCenterUrl(TOP_DOMAIN)
/**
* 企业采购域名
*/
export const SRM_CENTER_URL = getSrmCenterUrl(TOP_DOMAIN)
/**
* 物流服务域名
*/
export const LOGISTICS_CENTER_URL = getlogisticsCenterUrl(TOP_DOMAIN)
/**
* 加工服务域名
*/
export const MANUFACTURE_CENTER_URL = getManufactureCenterUrl(TOP_DOMAIN)
export const MALL_TYPE = {
1: '企业商城',
2: '积分商城',
3: '渠道商城',
4: '渠道自有商城',
5: '渠道积分商城'
}
export enum SHOP_TYPE {
/** 企业商城 */
mall = 1,
/** 积分商城 */
scoreMall = 2,
/** 渠道商城 */
channel = 3,
/** 渠道自有商城 */
ichannel = 4,
/** 渠道积分商城 */
channelScoreMall = 5,
}
export enum LAYOUT_TYPE {
/**
* 企业商城
*/
mall = 'mall',
/**
* 自营商城
*/
own = 'own',
/**
* 店铺(店铺商城)
*/
shop = 'shop',
/**
* 渠道商城
*/
channel = 'channel',
/**
* 渠道自有商城
*/
ichannel = 'ichannel',
/**
* 企业商城-积分商城
*/
scoreMall = 'scoreMall',
/**
* 店铺-积分兑换
*/
shopScoreMall = 'shopScoreMall',
/**
* 渠道商城-积分兑换
*/
channelScoreMall = 'channelScoreMall',
/**
* 店铺列表
*/
shopList = 'shopList',
/**
* 在线求购
*/
purchaseOnline = 'purchaseOnline'
}
// 本地环境跳过权限校验
export const isDev = process.env.NODE_ENV === "development"
// 暂时将权限访问关闭
// export const isDev = false
export const Environment_Status = {
0: "所有",
1: "web",
2: "H5",
3: "小程序",
4: "APP"
}
export enum FILTER_TYPE {
/**
* 常用筛选
*/
commonlyUsed = 'commonlyUsed',
/**
* 分类
*/
category = 'category',
/**
* 分类名称
*/
categoryName = 'categoryName',
/**
* 会员品类
*/
customerCategory = 'customerCategory',
/**
* 分类和属性
*/
categoryAndAttr = 'categoryAndAttr',
/**
* 风格
*/
style = 'style',
/**
* 品牌
*/
brand = 'brand',
/**
* 价格
*/
price = 'price',
/**
* 最低价格
*/
minPrice = 'minPrice',
/**
* 最高价格
*/
maxPrice = 'maxPrice',
/**
* 发货地
*/
useArea = 'useArea',
/**
* 发货地省份
*/
province = 'province',
/**
* 发货地市区
*/
city = 'city',
/**
* 商品类型
*/
commodityType = 'commodityType',
/**
* 活跃店铺
*/
activeStores = 'activeStores',
/**
* 最新加入
*/
newJoin = 'newJoin',
/**
* 所需积分
*/
points = 'points',
/**
* 最低积分
*/
minPoints = 'minPoints',
/**
* 最高积分
*/
maxPoints = 'maxPoints',
/**
* 商品名称
*/
name = 'name',
/**
* 排序
*/
sort = 'sort',
/**
* 价格排序
*/
priceSort = 'priceSort',
/**
* 价格从高到低
*/
priceSortHighToLow = 'priceSortHighToLow',
/**
* 价格从低到高
*/
priceSortLowToHigh = 'priceSortLowToHigh',
/**
* 销量从高到低
*/
soldSort = 'soldSort',
/**
* 信用排序
*/
creditSort = 'creditSort',
/**
* 信用从高到低
*/
creditSortHighToLow = 'creditSortHighToLow',
/**
* 信用从低到高
*/
creditSortLowToHigh = 'creditSortLowToHigh',
/**
* 店铺信用从高到低
*/
shopCreditSortHighToLow = 'shopCreditSortHighToLow',
/**
* 店铺信用从低到高
*/
shopCreditSortLowToHigh = 'shopCreditSortLowToHigh',
/**
* 时间排序
*/
dateSort = 'dateSort',
/**
* 时间从高到低
*/
dateSortHighToLow = 'dateSortHighToLow',
/**
* 时间从低到高
*/
dateSortLowToHigh = 'dateSortLowToHigh',
/**
* 属性筛选
*/
attribute = 'attribute',
/**
* 店铺地区筛选
*/
shopArea = 'shopArea'
}
// 商城类型
export const SHOP_TYPES = [
{
value: 1,
label: "企业商城"
},
{
value: 2,
label: "积分商城"
},
{
value: 3,
label: "渠道商城"
},
{
value: 4,
label: "渠道自有商城"
},
{
value: 5,
label: "渠道积分商城"
},
]
export const STATUS_ENUM = [
{
label: '全部',
value: null
},
{
label: '有效',
value: 1
},
{
label: '无效',
value: 0
}
]
// 1是阿里云oss服务器, 2是本地文件服务器
// 2020/10/21 本地文件服务器关闭, 现全部上传到oss - xjm
export const UPLOAD_TYPE = 1
export enum COMMODITY_TYPE {
/**
* 现货商品
*/
prompt = 1,
/**
*询价商品
*/
inquiry = 2,
/**
* 积分商品
*/
integral = 3
}
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:04:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-30 20:08:50
* @LastEditTime: 2021-12-03 15:08:15
* @Description:
*/
import { FormEffectHooks, FormPath, IFormActions } from '@formily/antd';
......@@ -262,15 +262,15 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
const { value } = state;
const releaseTimeEndValue = value?.[1];
const effectiveTime = getFieldValue('[effectiveTimeStart, effectiveTimeEnd]'); // 券有效期
const effectiveTimeStartValue = effectiveTime?.[0];
const effectiveTimeEndValue = effectiveTime?.[1];
if (
releaseTimeEndValue
&& effectiveTimeStartValue
&& moment(releaseTimeEndValue) > moment(effectiveTimeStartValue)
&& effectiveTimeEndValue
&& moment(releaseTimeEndValue) >= moment(effectiveTimeEndValue)
) {
setFieldState('[releaseTimeStart, releaseTimeEnd]', fieldState => {
FormPath.setIn(fieldState, 'errors', '领(发)券截止时间应该小于券有效期起始时间');
FormPath.setIn(fieldState, 'errors', '领(发)券截止时间应该小于券有效期截止时间');
});
} else {
actions.clearErrors('[releaseTimeStart, releaseTimeEnd]');
......@@ -280,17 +280,17 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
// 券有效期始时间
onFieldValueChange$('[effectiveTimeStart, effectiveTimeEnd]').subscribe(state => {
const { value } = state;
const effectiveTimeStartValue = value?.[0];
const effectiveTimeEndValue = value?.[1];
const releaseTime = getFieldValue('[releaseTimeStart, releaseTimeEnd]'); // 券有效期
const releaseTimeEndValue = releaseTime?.[1];
if (
effectiveTimeStartValue
effectiveTimeEndValue
&& releaseTimeEndValue
&& moment(effectiveTimeStartValue) < moment(releaseTimeEndValue)
&& moment(effectiveTimeEndValue) <= moment(releaseTimeEndValue)
) {
setFieldState('[effectiveTimeStart, effectiveTimeEnd]', fieldState => {
FormPath.setIn(fieldState, 'errors', '券有效期起始时间应该大于等于领(发)券截止时间');
FormPath.setIn(fieldState, 'errors', '券有效期截止时间应该大于领(发)券截止时间');
});
} else {
actions.clearErrors('[effectiveTimeStart, effectiveTimeEnd]');
......
......@@ -30,11 +30,12 @@ interface CouponsDrawerProps {
onConfirm?: (record) => void,
selectId?: number,
// 1平台,2商家
belongType?: 1 | 2
belongType?: 1 | 2,
disabledKeys?: number[],
}
const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps) => {
const { visible, onClose, onConfirm, selectId, belongType } = props;
const { visible, onClose, onConfirm, selectId, belongType, disabledKeys } = props;
const { query: { shopId } }: any = history.location;
const [type, setType] = useState(belongType || 1);
const [selectedRowKeys, setSelectedRowKeys] = useState<any>(selectId ? [selectId] : []);
......@@ -145,7 +146,10 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
setSelectedRows(selectedRows);
setSelectedRowKeys(selectedRowKeys)
},
type: 'radio'
type: 'radio',
getCheckboxProps: (record: any) => ({
disabled: disabledKeys?.includes(record.id), // Column configuration not to be checked
}),
};
const drawerStyle = { background: '#FAFBFC' };
......
import { GlobalConfig } from '@/global/config';
import { INFO_CENTER_URL } from '@/constants'
const siteUrl = GlobalConfig.site.siteInfo.siteUrl;
......@@ -59,7 +60,7 @@ export const getMenuData = (shopId: number) => {
},
{
"id": 5,
"link": `${REQUEST_HEADER}info.${TOP_DOMAIN}`,
"link": INFO_CENTER_URL,
"name": "行情资讯",
"status": true,
"key": "shopInfomation",
......
......@@ -10,6 +10,7 @@ import { priceFormat } from '@/utils/numberFomat';
import { postMarketingCouponPlatformActivityPageSelectDetail } from '@/services/MarketingV2Api';
import CouponsDrawer from '@/pages/pageCustomized/components/drawers/couponsDrawer';
import useSamLevelProps from '../../../common/hooks/useSameLevelProps';
interface MarketingCardCouponProps {
......@@ -23,6 +24,8 @@ const MarketingCardCoupon: React.FC<MarketingCardCouponProps> = (props: Marketin
const { id, belongType, selectedKey } = props;
const [drawerVisible, setDrawerVisible] = useState(false);
const [record, setRecord] = useState<any>();
const sameLevelPropsList = useSamLevelProps({ key: selectedKey })
const _onClose = () => {
setDrawerVisible(false);
};
......@@ -110,6 +113,7 @@ const MarketingCardCoupon: React.FC<MarketingCardCouponProps> = (props: Marketin
belongType={belongType}
onClose={_onClose}
onConfirm={_onChooseConfirm}
disabledKeys={sameLevelPropsList ? sameLevelPropsList.map((item) => item.id) : []}
selectId={id}
/>
</div>
......
import { GlobalConfig } from '@/global/config';
import { SRM_CENTER_URL, LOGISTICS_CENTER_URL, MANUFACTURE_CENTER_URL, INFO_CENTER_URL } from "@/constants"
const siteUrl = GlobalConfig.site.siteInfo.siteUrl;
......@@ -31,7 +32,7 @@ export const getMenuData = () => {
return [
{
"id": 0,
"link": `${REQUEST_HEADER}www.${TOP_DOMAIN}`,
"link": siteUrl,
"name": "首页",
"type": 1,
"status": true,
......@@ -47,7 +48,7 @@ export const getMenuData = () => {
},
{
"id": 2,
"link": `${REQUEST_HEADER}srm.${TOP_DOMAIN}`,
"link": SRM_CENTER_URL,
"name": "名企采购",
"type": 3,
"status": true,
......@@ -71,7 +72,7 @@ export const getMenuData = () => {
},
{
"id": 5,
"link": `${REQUEST_HEADER}logistics.${TOP_DOMAIN}`,
"link": LOGISTICS_CENTER_URL,
"name": "物流服务",
"type": 6,
"key": "logistics",
......@@ -79,7 +80,7 @@ export const getMenuData = () => {
},
{
"id": 6,
"link": `${REQUEST_HEADER}manufacture.${TOP_DOMAIN}`,
"link": MANUFACTURE_CENTER_URL,
"name": "加工服务",
"type": 7,
"status": true,
......@@ -95,7 +96,7 @@ export const getMenuData = () => {
},
{
"id": 8,
"link": `${REQUEST_HEADER}info.${TOP_DOMAIN}`,
"link": INFO_CENTER_URL,
"name": "行情资讯",
"type": 9,
"status": true,
......
......@@ -162,7 +162,7 @@ const AccountDetail: React.FC<{}> = () => {
>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="账户信息">
<Row gutter={100}>
<Row gutter={100} style={{marginRight: 0}}>
<Col span={8}>
<div className={cx(styles.repayment, styles.repayinfo)}>
<div className={styles['repayment-left']}>
......
......@@ -31,7 +31,7 @@ export const searchSchema: ISchema = {
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
justifyContent: 'end',
justifyContent: 'flex-start',
},
colStyle: {
marginRight: 20,
......
......@@ -152,7 +152,7 @@ const CheckDetail: React.FC<{}> = () => {
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="账户提现">
<Row gutter={100}>
<Row gutter={100} style={{marginRight: 0}}>
<Col span={8}>
<div className={styles.repayment}>
<div className={styles['repayment-left']}>
......@@ -211,7 +211,7 @@ const CheckDetail: React.FC<{}> = () => {
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="账户信息">
<Row gutter={100}>
<Row gutter={100} style={{marginRight: 0}}>
<Col span={8}>
<div className={cx(styles.repayment, styles.repayinfo)}>
<div className={styles['repayment-left']}>
......
import React, { useState, useEffect, useRef, ReactNode } from 'react'
import { history } from 'umi'
import { Card, Space, Row, Col, Button, Table, Modal, Form, Input } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
import styles from './index.less'
import StatusTag from '@/components/StatusTag'
import cx from 'classnames'
import moment from 'moment'
import { ColumnType } from 'antd/lib/table/interface'
import { memberStatusMap, moveStatusMap, operationMap, statusMap } from '../constant'
import { SettingOutlined, StopOutlined } from '@ant-design/icons'
import { validatorByte } from '@/utils/regExp'
import { StandardTable } from 'god'
import { getPayPlatFormAssetAccountGetAccountStatusRecord, getPayPlatFormAssetAccountGetAccountTradeRecord, getPayPlatFormAssetAccountGetPlatFormAssetAccount, postPayMemberAssetAccountUpdateMemberAssetAccountEnable } from '@/services/PayV2Api'
const { TextArea } = Input
const EAccountDetail: React.FC<{}> = () => {
const refTrade = useRef<any>({})
const [checkForm] = Form.useForm()
const [moveRecord, setMoveRecord] = useState<any>()
const [isDisabled, setIsDisabled] = useState<boolean>(false)
const [visibleModal, setVisibleModal] = useState<boolean>(false)
const [ details, setDetails ] = useState<any>({ accountBalance: 0, lockBalance: 0})
useEffect(() => {
getAccountInfo()
}, [])
const getAccountInfo = async () => {
const { id } = history.location.query
let res = await getPayPlatFormAssetAccountGetPlatFormAssetAccount({id})
const { code, data } = res
setDetails(data)
if(code === 1000){
let statusRecord = await getPayPlatFormAssetAccountGetAccountStatusRecord({memberAssetAccountId: data.id + ''})
setMoveRecord(statusRecord.data)
}
}
// 获取交易记录
const fetchTradeData = (params) => {
return new Promise((resolve, reject) => {
getPayPlatFormAssetAccountGetAccountTradeRecord({memberAssetAccountId: history.location.query.id + '', ...params}).then(res => {
const { data } = res
resolve(data)
})
})
}
const columns: ColumnType<any>[] = [
{
title: '交易流水号',
dataIndex: 'tradeCode',
key: 'tradeCode',
},
{
title: '交易时间',
dataIndex: 'tradeTime',
key: 'tradeTime',
render: (text: any) => moment(text).format("YYYY-MM-DD HH:mm:ss")
},
{
title: '交易金额(元)',
dataIndex: 'tradeMoney',
key: 'tradeMoney',
render: (t, r) => `${operationMap[r.operation]['operator']} ${t.toFixed(2)}`
},
{
title: '交易项目',
dataIndex: 'operation',
key: 'operation',
render: (t, r) => operationMap[t]['title']
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: (text:any, record:any) => (<StatusTag title={statusMap[text]['title']} type={statusMap[text]['type']} />)
},
{
title: '意见',
dataIndex: 'remark',
key: 'remark',
},
];
const moveColumns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'id',
key: 'id',
render: (t, c, i) => i + 1
},
{
title: '操作角色',
dataIndex: ['memberAssetAccount','parentMemberManageRoleName'],
key: 'id',
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: (text:any, record:any) => (<StatusTag title={moveStatusMap[text]['title']} type={moveStatusMap[text]['type']} />)
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
render: (t, r)=> {
return t === 1 ? '冻结资金账户' : '解冻资金账户'
}
},
{
title: '操作时间',
dataIndex: 'createTime',
key: 'createTime',
render: (text: any) => moment(text).format("YYYY-MM-DD HH:mm:ss")
},
{
title: '意见',
dataIndex: 'remark',
key: 'remark',
},
];
const handleRelieve = () => {
setVisibleModal(true)
}
const handleCancel = () => {
setVisibleModal(false)
}
const handleOK = () => {
checkForm.validateFields().then(values => {
setVisibleModal(false)
postPayMemberAssetAccountUpdateMemberAssetAccountEnable({ id: details.id, status: details.accountStatus === 1 ? 2 : 1, ...values }).then(res => {
if(res.code === 1000)
getAccountInfo()
})
})
}
return (
<PageHeaderWrapper
title="账户详情"
onBack={() => history.goBack()}
backIcon={<ReutrnEle />}
extra={[
<Button
key="1"
onClick={handleRelieve}
type="primary"
icon={details?.accountStatus === 1 ? <SettingOutlined /> : <StopOutlined />}
disabled={isDisabled}
>
{details?.accountStatus === 1 ? '冻结' : '解冻'}
</Button>,
]}
>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="账户信息">
<Row gutter={100} style={{marginRight: 0}}>
<Col span={8}>
<div className={cx(styles.repayment, styles.repayinfo)}>
<div className={styles['repayment-left']}>
<div className={styles.statistic}>
<div className={styles['statistic-title']}>可用余额(元):</div>
<div className={styles['statistic-amount']}>
{`${((details.accountBalance*100 - details.lockBalance*100)/100).toFixed(2)}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
</div>
</div>
<div className={styles['repayment-end']}>
<span className={styles['repayment-time']}>
{details?.memberName}
</span>
</div>
</div>
</div>
</Col>
<Col span={16}>
<div className={styles.infoRight}>
<Row>
<Col span={4}>
<p className={styles.rightTitle}>账户归属:</p>
</Col>
<Col span={20}>
<p className={styles.rightInfo}>{details?.parentMemberName}</p>
</Col>
</Row>
<Row>
<Col span={4}>
<p className={styles.rightTitle}>账户余额(元):</p>
</Col>
<Col span={20}>
<p className={styles.rightInfo}>{details?.accountBalance?.toFixed(2)}</p>
</Col>
</Row>
<Row>
<Col span={4}>
<p className={styles.rightTitle}>锁定金额(元):</p>
</Col>
<Col span={20}>
<p className={styles.rightInfo}>{details?.lockBalance?.toFixed(2)}</p>
</Col>
</Row>
<Row>
<Col span={4}>
<p className={styles.rightTitle}>账户状态:</p>
</Col>
<Col span={20}>
<p className={styles.rightInfo}>
{
details?.accountStatus &&
<StatusTag title={memberStatusMap[details.accountStatus]['title']} type={memberStatusMap[details.accountStatus]['type']} />
}
</p>
</Col>
</Row>
</div>
</Col>
</Row>
</Card>
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="交易记录">
<StandardTable
columns={columns}
currentRef={refTrade}
fetchTableData={(params: any) => fetchTradeData(params)}
/>
</Card>
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="流转记录">
<Table columns={moveColumns} dataSource={moveRecord} pagination={false} />
{/* <StandardTable
columns={moveColumns}
currentRef={refMove}
fetchTableData={(params: any) => fetchMoveData(params)}
tableProps={{
pagination: false
}}
/> */}
</Card>
</Space>
<Modal
title={details?.accountStatus === 1 ? '会员冻结' : '会员解冻'}
visible={visibleModal}
onOk={handleOK}
onCancel={handleCancel}
destroyOnClose={true}
>
<Form
layout="vertical"
form={checkForm}
>
<Form.Item
name="remark"
label={details?.accountStatus === 1 ? '会员冻结原因' : '会员解冻原因'}
rules={[
{
required: true,
message: '请填写原因'
},
{
validator: (r, v, c) => validatorByte(r, v, c, 120)
}
]}
>
<TextArea rows={6} placeholder="请填写原因" />
</Form.Item>
</Form>
</Modal>
</PageHeaderWrapper>
)
}
export default EAccountDetail
.repayment {
padding: 56px 24px 33px;
display: flex;
align-items: center;
background: #8777D9;
border-radius: 4px;
border: 1px solid #8777D9;
color: #fff;
&-left {
flex: 1;
}
&-right {
flex-shrink: 0;
}
&-end {
margin-top: 32px;
}
&-action {
margin-left: 24px;
}
&-time {
line-height: 22px;
margin-right: 8px;
font-weight: 400;
}
}
.statistic {
&-title {
margin-bottom: 28px;
line-height: 22px;
font-weight: 400;
}
&-amount {
line-height: 40px;
font-size: 32px;
font-weight: 500;
}
&-input {
display: block !important;
width: 180px !important;
line-height: 40px !important;
padding: 8px 0 !important;
font-size: 32px !important;
font-weight: 500 !important;
color: #fff !important;
background: none !important;
border-top: none !important;
border-right: none !important;
border-left: none !important;
border-image: initial !important;
outline: none !important;
border-bottom: 1px solid #fff !important;
}
}
.infoRight {
margin: 35px 0;
.rightTitle {
height: 36px;
font-weight: 400;
color: #6B778C;
line-height: 36px;
}
.rightInfo {
height: 36px;
font-weight: 500;
color: #303133;
line-height: 36px;
}
}
.repayinfo {
background-color: #4279DF;
}
// 账户详情右侧操作按钮
.rightActions {
display: flex;
margin-top: 70px;
.rightAction {
width: 88px;
height: 40px;
&:last-child{
background-color: #6B778C;
color: #fff;
margin-left: 24px;
}
}
}
\ No newline at end of file
import React, { useState, useRef } from 'react'
import { Card, Button, Input, Modal, Form } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
import { history } from 'umi'
import { ColumnType } from 'antd/lib/table/interface'
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { searchSchema } from './schema'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import EyePreview from '@/components/EyePreview'
import { DatePicker } from '@formily/antd-components'
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
import StatusTag from '@/components/StatusTag'
import { accountMemberType, accountStatusMap, memberStatusMap } from '../constant'
import { validatorByte } from '@/utils/regExp'
import { getPayPlatFormAssetAccountGetPlatFormAssetAccountList, postPayPlatFormAssetAccountUpdateMemberAssetAccountEnable } from '@/services/PayV2Api'
import { getMemberManagePageitems } from '@/services/MemberV2Api'
const formActions = createFormActions();
const { TextArea } = Input;
const EAccountLists: React.FC<{}> = () => {
const ref = useRef<any>({})
const [checkForm] = Form.useForm()
const [currentRecord, setCurrentRecord] = useState<any>()
const [visibleModal, setVisibleModal] = useState<boolean>(false)
const columns: ColumnType<any>[] = [
{
title: '会员名称',
dataIndex: 'memberName',
key: 'memberName',
className: 'commonPickColor',
render: (text, record) => <>
<EyePreview
url={`/settlementManage/capitalAccount/eAccountLists/detail?id=${record.id}`}
>
{text}
</EyePreview>
</>
},
{
title: '会员类型',
dataIndex: 'memberType',
key: 'memberType',
render: (t, r) => accountMemberType[t]
},
{
title: '会员角色',
dataIndex: 'memberRoleName',
key: 'memberRoleName',
},
// {
// title: '会员等级',
// dataIndex: 'memberLevel',
// key: 'memberLevel',
// render: (t, r) => <LevelBrand level={r.level} />
// },
{
title: '账户余额',
dataIndex: 'accountBalance',
key: 'accountBalance',
render: text => `¥${text.toFixed(2)}`
},
{
title: '锁定余额',
dataIndex: 'lockBalance',
key: 'lockBalance',
render: text => `¥${text.toFixed(2)}`
},
{
title: '可用余额',
dataIndex: 'usableBalance',
key: 'usableBalance',
render: (t, r) => `¥${((r.accountBalance*100 - r.lockBalance*100)/100).toFixed(2)}`
},
{
title: '会员状态',
dataIndex: 'memberStatus',
key: 'memberStatus',
render: (t, r) => (<StatusTag title={memberStatusMap[t]['title']} type={memberStatusMap[t]['type']} />)
},
{
title: '账户状态',
dataIndex: 'accountStatus',
key: 'accountStatus',
render: (t, r) => (<><span className={accountStatusMap[t]['className']}></span>{accountStatusMap[t]['title']}</>)
},
{
title: '操作',
dataIndex: 'option',
render: (t: any, r: any) => (
// `/settlementManage/capitalAccount/accountLists/detail?id=${record.id}`
// handleRow(r)}>{r.accountStatus===1?'冻结':'解除'
<Button type='link' onClick={() => history.push(`/settlementManage/capitalAccount/eAccountLists/detail?id=${r.id}&status=${r.accountStatus}`)}>{r.accountStatus===1?'冻结':'解除'}</Button>
)
}
]
const handleRow = (data: any) => {
setCurrentRecord(data)
setVisibleModal(true)
}
const fetchData = (params: any) => {
console.log(params)
return new Promise((resolve, reject) => {
let obj = { ...params }
getPayPlatFormAssetAccountGetPlatFormAssetAccountList(obj).then(res => {
resolve(res.data)
})
})
}
// 会员弹框筛选select值
const fetchSelectOptions = async () => {
const res = await getMemberManagePageitems()
if (res.code === 1000) {
const { data = {} }: any = res
const {
memberTypes = [],
roles = [],
levels = [],
} = data
return {
memberType: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
memberRoleId: roles.map(item => ({ label: item.roleName, value: item.roleId })),
memberLevel: levels.map(item => ({ label: item.levelTag, value: item.level })),
}
}
return {}
}
const handleCancel = () => {
setVisibleModal(false)
}
const handleOK = () => {
checkForm.validateFields().then(values => {
setVisibleModal(false)
postPayPlatFormAssetAccountUpdateMemberAssetAccountEnable({ id: currentRecord.id, status: currentRecord.accountStatus === 1 ? 2 : 1, ...values }).then(res => {
if(res.code === 1000)
ref.current.reload()
})
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: "id" }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
components={{
RangePicker: DatePicker.RangePicker
}}
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'memberName',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['memberType', 'memberRoleId', 'memberLevel'],
fetchSelectOptions,
);
}}
schema={searchSchema}
/>
}
/>
</Card>
<Modal
title={currentRecord?.accountStatus === 1 ? '会员冻结' : '会员解冻'}
visible={visibleModal}
onOk={handleOK}
onCancel={handleCancel}
destroyOnClose={true}
>
<Form
layout="vertical"
form={checkForm}
>
<Form.Item
name="remark"
label={currentRecord?.accountStatus === 1 ? '会员账户冻结原因' : '会员账户解冻原因'}
rules={[
{
required: true,
message: '请填写原因'
},
{
validator: (r, v, c) => validatorByte(r, v, c, 120)
}
]}
>
<TextArea rows={6} placeholder="请填写原因" />
</Form.Item>
</Form>
</Modal>
</PageHeaderWrapper>
)
}
export default EAccountLists
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const searchSchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '会员名称',
align: 'flex-left',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
justifyContent: 'flex-start',
},
colStyle: {
marginRight: 20,
},
},
properties: {
memberType: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择会员类型',
style: {
width: 174
}
}
},
memberRoleId: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择会员角色',
style: {
width: 174
}
}
},
// memberLevel: {
// type: 'string',
// enum: [],
// "x-component-props": {
// placeholder: '请选择会员等级',
// style: {
// width: 174
// }
// }
// },
memberStatus: {
type: 'string',
'x-component-props': {
placeholder: '会员状态',
style: { width: '174px' },
},
enum: [
{
label: '正常',
value: 1,
},
{
label: '已冻结',
value: 2,
}
],
},
accountStatus: {
type: 'string',
'x-component-props': {
placeholder: '账户状态',
style: { width: '174px' },
},
enum: [
{
label: '正常',
value: 1,
},
{
label: '已冻结',
value: 2,
}
],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export const rechargeSchema: ISchema = {
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": "mega-layout",
"x-component-props": {
labelAlign: 'left',
labelCol: 24,
wrapperCol: 24
},
properties: {
money: {
type: "string",
title: '充值金额',
'x-component-props': {
addonBefore: "¥"
},
"x-rules": [
{
required: true,
message: '请输入充值金额'
},
]
},
type: {
type: "array:number",
"x-component": 'CardCheckBox',
"x-component-props": {
dataSource: [],
type: 'radio' // CardCheckBox 单选模式
},
"title": "充值方式",
"x-rules": [
{
required: true,
message: '请选择充值方式'
}
],
}
}
}
}
}
......@@ -246,7 +246,7 @@ const PaymentDetail: React.FC<{}> = () => {
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="账户提现">
<Row gutter={100}>
<Row gutter={100} style={{marginRight: 0}}>
<Col span={8}>
<div className={styles.repayment}>
<div className={styles['repayment-left']}>
......@@ -305,7 +305,7 @@ const PaymentDetail: React.FC<{}> = () => {
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="账户信息">
<Row gutter={100}>
<Row gutter={100} style={{marginRight: 0}}>
<Col span={8}>
<div className={cx(styles.repayment, styles.repayinfo)}>
<div className={styles['repayment-left']}>
......
......@@ -31,7 +31,7 @@ export const searchSchema: ISchema = {
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
justifyContent: 'end',
justifyContent: 'flex-start',
},
colStyle: {
marginRight: 20,
......
import { GlobalConfig } from '../global/config'
/**
* 请求头
*/
export const REQUEST_HEADER = 'http://'
export const getTopDomainByHost = (url: string, isPort = false): string => {
if (!url) return ''
// 如果后缀带有端口号, 则把端口号也加上
const splitUrl = url.split(':')
if (splitUrl.length > 1 && isPort) {
return `${splitUrl[0].split('.').slice(-2).join('.')}`
}
return url.split('.').slice(-2).join('.')
}
/**
* 获取顶域
*/
export const getTopDomain = (env: string = 'production', defaultTopDomain: string = 'lingxidev.com', isPort: boolean = false) => {
return env !== 'development' ? getTopDomainByHost(GlobalConfig.site.siteInfo.siteUrl, isPort) : defaultTopDomain
}
/**
* 获取平台首页子域名
*/
const getPlatformSubDomain = (defaultSubDomian: string) => {
const siteUrl = GlobalConfig.site.siteInfo.siteUrl
return siteUrl.split('.')[0] || defaultSubDomian
}
/**
* 获取平台首页域名
*/
export const getPlatformDomain = (topDomain: string, defaultSubDomian: string = 'lx-www') => {
return `${REQUEST_HEADER}${getPlatformSubDomain(defaultSubDomian)}.${topDomain}`
}
/**
* 会员中心域名
*/
export const getMemberCenterUrl = (topDomain: string, defaultSubDomian: string = 'lx-member') => {
return `${REQUEST_HEADER}${defaultSubDomian}.${topDomain}`
}
export const getDefaultEnterprise = () => {
const shopInfo = GlobalConfig.web.shopInfo
const webMallList = shopInfo.filter((item: { environment: number; type: number, property?: any }) => item.environment === 1 && item.type === 1 && item.property === 1)
const defaultMall = webMallList.filter((item: any) => item.isDefault === 1)[0]
let result: any = undefined
if (defaultMall) {
result = defaultMall
} else {
if (webMallList && webMallList.length > 0) {
result = webMallList[0]
}
}
return result
}
const enterpriseInfo = getDefaultEnterprise()
/**
* 企业商城域名
*/
export const getEnterpriseCenterUrl = (topDomain: string) => {
return `${REQUEST_HEADER}${enterpriseInfo ? enterpriseInfo.url : 'lx-b2b'}.${topDomain}`
}
export const getChannelInfo = () => {
const shopInfo = GlobalConfig.web.shopInfo
const webMallList = shopInfo.filter((item: { environment: number; type: number }) => item.environment === 1 && item.type === 3)
return webMallList[0]
}
export const getIChannelInfo = () => {
const shopInfo = GlobalConfig.web.shopInfo
const webMallList = shopInfo.filter((item: { environment: number; type: number }) => item.environment === 1 && item.type === 4)
return webMallList[0]
}
const channelInfo = getChannelInfo()
const iChannelInfo = getIChannelInfo()
/**
* 渠道商城子域名
*/
export const getChannelCenterUrl = (topDomain: string) => {
return `${REQUEST_HEADER}${channelInfo ? channelInfo.url : 'lx-channel'}.${topDomain}`
}
/**
* 自有渠道商城子域名
*/
export const getIChannelCenterUrl = (topDomain: string) => {
return `${REQUEST_HEADER}${iChannelInfo ? iChannelInfo.url : 'lx-ichannel'}.${topDomain}`
}
const getShopInfoByType = (type: number) => {
const shopInfo = GlobalConfig.web.shopInfo
const webMallList = shopInfo.filter((item: any) => item.type === type)
return webMallList[0]
}
const infoDetail = getShopInfoByType(9)
const srmDetail = getShopInfoByType(6)
const logisticsDetail = getShopInfoByType(7)
const manufactureDetail = getShopInfoByType(8)
/**
* 行情资讯域名
*/
export const getInfoCenterUrl = (topDomain: string) => {
return `${REQUEST_HEADER}${infoDetail ? infoDetail.url : 'lx-info'}.${topDomain}`
}
/**
* 企业采购域名
*/
export const getSrmCenterUrl = (topDomain: string) => {
return `${REQUEST_HEADER}${srmDetail ? srmDetail.url : 'lx-srm'}.${topDomain}`
}
/**
* 物流服务域名
*/
export const getlogisticsCenterUrl = (topDomain: string) => {
return `${REQUEST_HEADER}${logisticsDetail ? logisticsDetail.url : 'lx-logistics'}.${topDomain}`
}
/**
* 加工服务域名
*/
export const getManufactureCenterUrl = (topDomain: string) => {
return `${REQUEST_HEADER}${manufactureDetail ? manufactureDetail.url : 'lx-manufacture'}.${topDomain}`
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment