Commit 2cbcf6b0 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 对接e账户管理充值提现,对接待支付订单账期月结支付

parent ba89201e
...@@ -287,6 +287,7 @@ export default { ...@@ -287,6 +287,7 @@ export default {
'purchaseOrder.yizhifu': '已支付', 'purchaseOrder.yizhifu': '已支付',
'purchaseOrder.dingdanhao': '订单号', 'purchaseOrder.dingdanhao': '订单号',
'purchaseOrder.dingdanzhaiyao': '订单摘要/下单时间', 'purchaseOrder.dingdanzhaiyao': '订单摘要/下单时间',
'purchaseOrder.dingdandingdandigest': '订单摘要',
'purchaseOrder.gongyinghuiyuan': '供应会员', 'purchaseOrder.gongyinghuiyuan': '供应会员',
'purchaseOrder.zongjineyizhifu': '总金额/已支付(元)', 'purchaseOrder.zongjineyizhifu': '总金额/已支付(元)',
'purchaseOrder.dingdanleixing': '订单类型', 'purchaseOrder.dingdanleixing': '订单类型',
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -542,6 +542,8 @@ export default { ...@@ -542,6 +542,8 @@ export default {
'detail.purchase.label51': '操作角色', 'detail.purchase.label51': '操作角色',
'detail.purchase.label52': '操作时间', 'detail.purchase.label52': '操作时间',
'schma.purchase.purchaseType.help': '采购类型',
'schma.purchase.purchaseType.help.text': '有固定采购金额:采购金额固定,合同期内不可超过采购金额,无固定采购金额:采购金额不固定,可在合同期内按需采购',
'schma.purchase.orderNo': '请输入订单编号', 'schma.purchase.orderNo': '请输入订单编号',
'schma.purchase.orderThe': '请输入订单摘要', 'schma.purchase.orderThe': '请输入订单摘要',
'schma.purchase.supplyMembersName': '请输入供应会员名称', 'schma.purchase.supplyMembersName': '请输入供应会员名称',
...@@ -974,4 +976,5 @@ export default { ...@@ -974,4 +976,5 @@ export default {
'table.purchase.zhongbiaoshuliang': '中标数量', 'table.purchase.zhongbiaoshuliang': '中标数量',
'table.purchase.duiying': '对应', 'table.purchase.duiying': '对应',
'table.purchase.zhi': '至', 'table.purchase.zhi': '至',
} }
...@@ -47,8 +47,11 @@ const AccountDetail: React.FC<{}> = () => { ...@@ -47,8 +47,11 @@ const AccountDetail: React.FC<{}> = () => {
//timer //timer
const [openTimer, setOpenTimer] = useState(0); // timer const [openTimer, setOpenTimer] = useState(0); // timer
useEffect(() => { useEffect(() => {
console.log(openTimer) if(openTimer === 1) {
if(openTimer === 1) runTimerJump() runTimerJump()
} else {
clearInterval(timeChange)
}
}, [openTimer]) }, [openTimer])
const runTimerJump = () => { const runTimerJump = () => {
timeChange = setInterval(() => pollPayResult(), 3000) timeChange = setInterval(() => pollPayResult(), 3000)
...@@ -230,7 +233,7 @@ const AccountDetail: React.FC<{}> = () => { ...@@ -230,7 +233,7 @@ const AccountDetail: React.FC<{}> = () => {
setScanVisible(false) setScanVisible(false)
getAccountInfo() getAccountInfo()
refTrade.current.reload() refTrade.current.reload()
clearInterval(timeChange) setOpenTimer(0)
} }
return ( return (
......
...@@ -141,17 +141,16 @@ export const rechargeSchema: ISchema = { ...@@ -141,17 +141,16 @@ export const rechargeSchema: ISchema = {
type: "array:number", type: "array:number",
"x-component": 'CardCheckBox', "x-component": 'CardCheckBox',
"x-component-props": { "x-component-props": {
dataSource: [ dataSource: [],
// {id: 1, name: '支付宝', logoUrl: alipay}, // {id: 1, name: '支付宝', logoUrl: alipay},
{ id: 2, name: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.schema.rechargeSchema.type.dataSource.2' }), logoUrl: wxpay } // { id: 2, name: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.schema.rechargeSchema.type.dataSource.2' }), logoUrl: wxpay }
],
type: 'radio' // CardCheckBox 单选模式 type: 'radio' // CardCheckBox 单选模式
}, },
"title": intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.schema.rechargeSchema.type' }), "title": intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.schema.rechargeSchema.type' }),
"x-rules": [ "x-rules": [
{ {
required: true, required: true,
message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.schema.rechargeSchema.typemessage' }) message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.schema.rechargeSchema.type.message' })
} }
], ],
} }
......
...@@ -5,7 +5,7 @@ import MellowCard from '@/components/MellowCard'; ...@@ -5,7 +5,7 @@ import MellowCard from '@/components/MellowCard';
import { BIND_PHONE, EDetailContext, formItemLayout, formItemLayoutCompany, prefixSelector, prefixSelectorEle, tailFormItemLayout, tailFormItemLayoutCompany } from '../../constant'; import { BIND_PHONE, EDetailContext, formItemLayout, formItemLayoutCompany, prefixSelector, prefixSelectorEle, tailFormItemLayout, tailFormItemLayoutCompany } from '../../constant';
import { EditOutlined } from '@ant-design/icons'; import { EditOutlined } from '@ant-design/icons';
import UploadImage from '@/components/UploadImage'; import UploadImage from '@/components/UploadImage';
import { postPayAllInPayBindCompanyAccount, postPayAllInPayBindPhone, postPayAllInPayIdCardCollect, postPayAllInPaySendVerificationCode, postPayAllInPaySetCompanyInfo, postPayAllInPaySignContract } from '@/services/PayV2Api'; import { getPayAllInPayGetBankList, postPayAllInPayBindCompanyAccount, postPayAllInPayBindPhone, postPayAllInPayIdCardCollect, postPayAllInPaySendVerificationCode, postPayAllInPaySetCompanyInfo, postPayAllInPaySignContract } from '@/services/PayV2Api';
import useCountDown from '@/utils/hooks'; import useCountDown from '@/utils/hooks';
/** 图片key对应的picType值 */ /** 图片key对应的picType值 */
...@@ -35,6 +35,11 @@ const Company: React.FC<{}> = () => { ...@@ -35,6 +35,11 @@ const Company: React.FC<{}> = () => {
const [idCardBehindImg, setIdCardBehindImg] = useState<string>() const [idCardBehindImg, setIdCardBehindImg] = useState<string>()
const [certificateImg, setCertificateImg] = useState<string>() const [certificateImg, setCertificateImg] = useState<string>()
const [loading, setLoading] = useState<boolean>(false) const [loading, setLoading] = useState<boolean>(false)
const [bankLists, setBankLists] = useState([])
useEffect(() => {
getPayAllInPayGetBankList().then(({data = []}) => setBankLists(data))
}, [])
useEffect(() => { useEffect(() => {
if(data.step === 3) { if(data.step === 3) {
...@@ -79,13 +84,20 @@ const Company: React.FC<{}> = () => { ...@@ -79,13 +84,20 @@ const Company: React.FC<{}> = () => {
} }
const onFinishCard = (values) => { const onFinishCard = (values) => {
setLoading(true)
const pictures = Object.keys(values).map(item => ({ const pictures = Object.keys(values).map(item => ({
picType: PicType[item], picType: PicType[item],
picture: values[item] picture: values[item]
})) }))
const fns = pictures.map(item => postPayAllInPayIdCardCollect(item))
const fns = pictures.map((item, index) => new Promise(() => {
setTimeout(() => postPayAllInPayIdCardCollect(item), 500 * index)
}))
Promise.all(fns).then(res => { Promise.all(fns).then(res => {
console.log(res) console.log(res)
}).finally(() => {
setLoading(false)
reloadFormData() reloadFormData()
}) })
} }
...@@ -181,7 +193,22 @@ const Company: React.FC<{}> = () => { ...@@ -181,7 +193,22 @@ const Company: React.FC<{}> = () => {
}, },
]} ]}
> >
<Input placeholder={intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.company.mellowCard.1.bank.placeholder' })} /> {/* <Input placeholder={intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.company.mellowCard.1.bank.placeholder' })} /> */}
<Select
showSearch
optionFilterProp="label"
placeholder={intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.company.mellowCard.1.bank.placeholder' })}
filterOption={(input, option) =>
option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
filterSort={(optionA, optionB) =>
optionA.value.toLowerCase().localeCompare(optionB.value.toLowerCase())
}
>
{
bankLists.map(item => <Option key={item.id} value={item.name}>{item.name}</Option>)
}
</Select>
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
......
import React, { useContext, useState } from 'react' import React, { useContext, useState } from 'react'
import { Button, Col, Form, Input, message, Row, Select } from 'antd' import { Button, Col, Form, Input, message, Row, Select } from 'antd'
import MellowCard from '@/components/MellowCard'; import MellowCard from '@/components/MellowCard';
import { BIND_PHONE, EDetailContext, fetchTelCode, formItemLayout, prefixSelector, prefixSelectorEle, tailFormItemLayout } from '../../constant'; import { BIND_PHONE, EDetailContext, formItemLayout, prefixSelectorEle, tailFormItemLayout } from '../../constant';
import useCountDown from '@/utils/hooks'; import useCountDown from '@/utils/hooks';
import { PATTERN_MAPS } from '@/constants/regExp'; import { PATTERN_MAPS } from '@/constants/regExp';
import { postPayAllInPayBindPhone, postPayAllInPayPersonalCrate, postPayAllInPaySendVerificationCode, postPayAllInPaySetRealName } from '@/services/PayV2Api'; import { postPayAllInPayPersonalCrate, postPayAllInPaySendVerificationCode } from '@/services/PayV2Api';
import { useIntl } from 'umi'; import { useIntl } from 'umi';
/** 个人 初始认证 */ /** 个人 初始认证 */
...@@ -18,28 +18,13 @@ const Personal: React.FC<{}> = () => { ...@@ -18,28 +18,13 @@ const Personal: React.FC<{}> = () => {
const onFinish = async (values: any) => { const onFinish = async (values: any) => {
setLoading(true) setLoading(true)
// // 绑定手机 const { code } = await postPayAllInPayPersonalCrate({...values, verificationCodeType: BIND_PHONE}, { ctlType: "none" })
// const p1 = await postPayAllInPayBindPhone({phone: values.phone, verificationCode: values.captcha}, {ctlType: 'none'})
// // 实名认证
// const p2 = await postPayAllInPaySetRealName({name: values.name, cardType: values.cardType, cardNo: values.cardNo, phone: values.phone}, {ctlType:'none'})
// 提交
const { code } = await postPayAllInPayPersonalCrate({...values}, { ctlType: "none" })
if(code === 1000) { if(code === 1000) {
reloadFormData() reloadFormData()
message.success('操作成功') message.success(intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.caozuochenggong', defaultMessage: '操作成功' }))
} else { } else {
setLoading(false) setLoading(false)
} }
// Promise.all([p1, p2, p3]).then(res => {
// if(res.every(item => item['code'] === 1000)) {
// reloadFormData()
// message.success('操作成功')
// } else {
// message.error('接口请求异常')
// }
// setLoading(false)
// })
} }
const { text, isActive, start } = useCountDown({ const { text, isActive, start } = useCountDown({
...@@ -142,17 +127,17 @@ const Personal: React.FC<{}> = () => { ...@@ -142,17 +127,17 @@ const Personal: React.FC<{}> = () => {
<Row gutter={8}> <Row gutter={8}>
<Col span={20}> <Col span={20}>
<Form.Item <Form.Item
name="captcha" name="verificationCode"
noStyle noStyle
rules={[ rules={[
{ {
required: true, required: true,
message: intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.personal.captcha.message' }) message: intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.personal.captcha.message' })
}, },
{ // {
pattern: /^\d{5}$/, // pattern: /^\d{5}$/,
message: intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.personal.captcha.message' }) // message: intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.personal.captcha.message' })
} // }
]} ]}
> >
<Input placeholder={intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.personal.captcha.placeholder' })} /> <Input placeholder={intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.personal.captcha.placeholder' })} />
...@@ -166,7 +151,7 @@ const Personal: React.FC<{}> = () => { ...@@ -166,7 +151,7 @@ const Personal: React.FC<{}> = () => {
<Form.Item {...tailFormItemLayout}> <Form.Item {...tailFormItemLayout}>
<Button type="primary" htmlType="submit" loading={loading}> <Button type="primary" htmlType="submit" loading={loading}>
提交 {intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.tijiao', defaultMessage: '提交' })}
</Button> </Button>
</Form.Item> </Form.Item>
</Form> </Form>
......
import React, { useEffect, useRef, useState } from 'react' import { useState } from 'react'
import { Row, Input, Col, Button, Result, message, Modal } from 'antd'; import { useIntl } from 'umi'
import { Row, Input, Col, Button, } from 'antd';
import useCountDown from '@/utils/hooks'; import useCountDown from '@/utils/hooks';
import { postPayAllInPaySendVerificationCode } from '@/services/PayV2Api'; import { postPayAllInPaySendVerificationCode } from '@/services/PayV2Api';
import { UNBIND_PHONE } from '../../constant';
/** /**
* e账户认证 发送短信验证码 * e账户认证 发送短信验证码
...@@ -11,13 +11,14 @@ import { UNBIND_PHONE } from '../../constant'; ...@@ -11,13 +11,14 @@ import { UNBIND_PHONE } from '../../constant';
*/ */
const PhoneCode = (props) => { const PhoneCode = (props) => {
const intl = useIntl()
const { value, form, schema } = props const { value, form, schema } = props
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const {text, isActive, start} = useCountDown({ const {text, isActive, start} = useCountDown({
maxTime: 60, maxTime: 60,
minTime: 0, minTime: 0,
initText: '获取验证码', initText: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.huoquyanzhengma', defaultMessage: '获取验证码' }),
onEnd: () => { onEnd: () => {
setLoading(false) setLoading(false)
}, },
......
...@@ -8,21 +8,31 @@ import { useCallback, useState, useEffect } from 'react' ...@@ -8,21 +8,31 @@ import { useCallback, useState, useEffect } from 'react'
*/ */
export const MEMBER_TYPE_CORPORATE = 1; export const MEMBER_TYPE_CORPORATE = 1;
/** /**
* 个人会员 * 企业个人会员
*/ */
export const MEMBER_TYPE_INDIVIDUAL = 2; export const MEMBER_TYPE_CORPORATEPERSONAL = 2;
/**
* 渠道会员
*/
export const MEMBER_TYPE_CHANNEL = 3;
/**
* 渠道个人会员
*/
export const MEMBER_TYPE_CHANNELPERSONAL = 4;
export const MEMBER_TYPE = { export const MEMBER_TYPE = {
[MEMBER_TYPE_CORPORATE]: 'company', [MEMBER_TYPE_CORPORATE]: 'company',
[MEMBER_TYPE_INDIVIDUAL]: 'personal', [MEMBER_TYPE_CHANNEL]: 'company',
[MEMBER_TYPE_CORPORATEPERSONAL]: 'personal',
[MEMBER_TYPE_CHANNELPERSONAL]: 'personal',
}; };
export const useEDetail = () => { export const useEDetail = () => {
const { memberRoleType } = getAuth() || {} const { memberType } = getAuth() || {}
/** 详情数据 null从未认证 undefined接口数据还没加载 */ /** 详情数据 */
const [formData, setFormData] = useState<PostPayAllInPayGetMemberInfoResponse>(undefined) const [formData, setFormData] = useState<PostPayAllInPayGetMemberInfoResponse>(undefined)
/** 企业/个人 */ /** 企业/个人 */
const [type, setType] = useState<'company'|'personal'>(MEMBER_TYPE[memberRoleType]) const [type, setType] = useState<'company'|'personal'>(MEMBER_TYPE[memberType])
/** 是否需要完善 */ /** 是否需要完善 */
const [perfection, setPerfection] = useState<boolean>(false) const [perfection, setPerfection] = useState<boolean>(false)
/** 是否完善过 */ /** 是否完善过 */
...@@ -39,7 +49,8 @@ export const useEDetail = () => { ...@@ -39,7 +49,8 @@ export const useEDetail = () => {
const reloadFormData = useCallback(async () => { const reloadFormData = useCallback(async () => {
const { code, data, message: msg } = await postPayAllInPayGetMemberInfo({}, {ctlType: 'none'}) const { code, data, message: msg } = await postPayAllInPayGetMemberInfo({}, {ctlType: 'none'})
if (code === 1000) { if (code === 1000) {
!data && await postPayAllInPayCreateMember({}, {ctlType: 'none'}) // 企业未设置信息0 或者 个人未提交
((type === "company" && data.step === 0) || (type === "personal" && data.isSubmit === 2)) && await postPayAllInPayCreateMember({}, {ctlType: 'none'})
setFormData(data) setFormData(data)
} else { } else {
message.error(msg) message.error(msg)
......
...@@ -20,7 +20,7 @@ const EAccountApprove: React.FC<{}> = () => { ...@@ -20,7 +20,7 @@ const EAccountApprove: React.FC<{}> = () => {
backed, backed,
ctl, ctl,
data } = formContext data } = formContext
console.log(data, 'data')
const personalLinkList = [ const personalLinkList = [
{ title: intl.formatMessage({ id: 'payandSettle.eAccountApprove.personalLinkList.1' }), id: 'personalInfo' }, { title: intl.formatMessage({ id: 'payandSettle.eAccountApprove.personalLinkList.1' }), id: 'personalInfo' },
{ title: intl.formatMessage({ id: 'payandSettle.eAccountApprove.personalLinkList.2' }), id: 'accountInfo' }, { title: intl.formatMessage({ id: 'payandSettle.eAccountApprove.personalLinkList.2' }), id: 'accountInfo' },
...@@ -53,7 +53,7 @@ const EAccountApprove: React.FC<{}> = () => { ...@@ -53,7 +53,7 @@ const EAccountApprove: React.FC<{}> = () => {
<div> <div>
<EDetailContext.Provider value={formContext}> <EDetailContext.Provider value={formContext}>
<EDetailHeader <EDetailHeader
title="通联账户" title={intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.tonglianzhanghu', defaultMessage: '通联账户' })}
anchorList={renderAnchorList()} anchorList={renderAnchorList()}
backLink={backed ? handleBack : false} backLink={backed ? handleBack : false}
/> />
......
import { PATTERN_MAPS } from "@/constants/regExp"; import { PATTERN_MAPS } from "@/constants/regExp";
import { getIntl } from 'umi'
const intl = getIntl()
export const bindSchema = { export const bindSchema = {
type: 'object', type: 'object',
...@@ -15,7 +18,7 @@ export const bindSchema = { ...@@ -15,7 +18,7 @@ export const bindSchema = {
"x-component": 'mega-layout', "x-component": 'mega-layout',
"x-component-props": { "x-component-props": {
grid: true, grid: true,
label: '手机号', label: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.shoujihao', defaultMessage: '手机号' }),
columns: 6, columns: 6,
enableSafeWidth: false, enableSafeWidth: false,
className: 'noMarbottom', className: 'noMarbottom',
...@@ -34,7 +37,7 @@ export const bindSchema = { ...@@ -34,7 +37,7 @@ export const bindSchema = {
"x-rules": [ "x-rules": [
{ {
required: true, required: true,
message: '请选择区号' message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingxuanzequhao', defaultMessage: '请选择区号' })
} }
] ]
}, },
...@@ -46,15 +49,15 @@ export const bindSchema = { ...@@ -46,15 +49,15 @@ export const bindSchema = {
"x-rules": [ "x-rules": [
{ {
pattern: PATTERN_MAPS.phone, pattern: PATTERN_MAPS.phone,
message: '请输入正确的手机号' message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingshuruzhengque', defaultMessage: '请输入正确的手机号' })
}, },
{ {
required: true, required: true,
message: '请输入手机号' message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingshurushouji', defaultMessage: '请输入手机号' })
} }
], ],
"x-component-props": { "x-component-props": {
placeholder: '输入你的手机号码', placeholder: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.shurunideshou', defaultMessage: '输入你的手机号码' }),
style: { width: '100%' } style: { width: '100%' }
} }
} }
...@@ -66,7 +69,7 @@ export const bindSchema = { ...@@ -66,7 +69,7 @@ export const bindSchema = {
"x-rules": [ "x-rules": [
{ {
required: true, required: true,
message: '请填写验证码' message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingtianxieyanzheng', defaultMessage: '请填写验证码' })
}, },
// { // {
// pattern: /^\d{6}$/, // pattern: /^\d{6}$/,
...@@ -76,7 +79,7 @@ export const bindSchema = { ...@@ -76,7 +79,7 @@ export const bindSchema = {
"x-component-props": { "x-component-props": {
btnSize: 'middle', btnSize: 'middle',
inputSize: 'middle', inputSize: 'middle',
placeholder: '请输入短信验证码', placeholder: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingshuruduanxin', defaultMessage: '请输入短信验证码' }),
type: null type: null
} }
}, },
...@@ -116,15 +119,15 @@ export const unbindSchema = { ...@@ -116,15 +119,15 @@ export const unbindSchema = {
"x-rules": [ "x-rules": [
{ {
pattern: PATTERN_MAPS.phone, pattern: PATTERN_MAPS.phone,
message: '请输入正确的手机号' message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingshuruzhengque', defaultMessage: '请输入正确的手机号' })
}, },
{ {
required: true, required: true,
message: '请输入手机号' message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingshurushouji', defaultMessage: '请输入手机号' })
} }
], ],
"x-component-props": { "x-component-props": {
placeholder: '输入你的手机号码', placeholder: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.shurunideshou', defaultMessage: '输入你的手机号码' }),
style: { width: '100%' } style: { width: '100%' }
} }
} }
...@@ -136,7 +139,7 @@ export const unbindSchema = { ...@@ -136,7 +139,7 @@ export const unbindSchema = {
"x-rules": [ "x-rules": [
{ {
required: true, required: true,
message: '请填写验证码' message: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingtianxieyanzheng', defaultMessage: '请填写验证码' })
}, },
// { // {
// pattern: /^\d{6}$/, // pattern: /^\d{6}$/,
...@@ -146,7 +149,7 @@ export const unbindSchema = { ...@@ -146,7 +149,7 @@ export const unbindSchema = {
"x-component-props": { "x-component-props": {
btnSize: 'middle', btnSize: 'middle',
inputSize: 'middle', inputSize: 'middle',
placeholder: '请输入短信验证码', placeholder: intl.formatMessage({ id: 'payandSettle.capitalAccounts.eAccount.qingshuruduanxin', defaultMessage: '请输入短信验证码' }),
type: null type: null
} }
}, },
......
...@@ -79,7 +79,7 @@ const basicInfo: ISchema = { ...@@ -79,7 +79,7 @@ const basicInfo: ISchema = {
type: 'string', type: 'string',
required: true, required: true,
enum: Object.values(PURCHASE_TYPE).map((item, index) => ({ label: item, value: ++index })), enum: Object.values(PURCHASE_TYPE).map((item, index) => ({ label: item, value: ++index })),
title: '{{help(`"采购类型", "有固定采购金额:采购金额固定,合同期内不可超过采购金额,无固定采购金额:采购金额不固定,可在合同期内按需采购"`)}}', title: `{{help('${getIntl().formatMessage({ id: 'schma.purchase.purchaseType.help', defaultMessage: '采购类型' })}', '${getIntl().formatMessage({ id: 'schma.purchase.purchaseType.help.text', defaultMessage: "有固定采购金额:采购金额固定,合同期内不可超过采购金额,无固定采购金额:采购金额不固定,可在合同期内按需采购" })}')}}`,
"x-component-props": { "x-component-props": {
placeholder: intl.formatMessage({ id: 'schma.purchase.purchaseType' }), placeholder: intl.formatMessage({ id: 'schma.purchase.purchaseType' }),
} }
......
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getIntl } from 'umi';
const intl = getIntl();
export const tableListSchema: ISchema = { export const tableListSchema: ISchema = {
type: 'object', type: 'object',
......
...@@ -36,7 +36,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -36,7 +36,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const { data, payList, currentPayInfoId } = useContext(OrderDetailContext) const { data, payList, currentPayInfoId } = useContext(OrderDetailContext)
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [checked, setChecked] = useState<any>({}) const [checked, setChecked] = useState<any>({})
const [current, setCurrent] = useState(0) // 0选择方式 1线下支付方式 2授信支付 3余额支付 4微信支付 5货到付款 6支付宝 100账期 101月结 1000清除 const [current, setCurrent] = useState(0) // 0选择方式 1线下支付方式 2授信支付 3余额支付 4微信支付 5货到付款 6支付宝 9账期 8月结 99通联 1000清除
const [payStep, setPayStep] = useState(0) // 支付模态框的步骤 0选方式 1下一步的具体操作 2输入支付密码 const [payStep, setPayStep] = useState(0) // 支付模态框的步骤 0选方式 1下一步的具体操作 2输入支付密码
const mobilePayFlag = useRef(0) // 用于判断移动支付类型 4微信6支付宝 const mobilePayFlag = useRef(0) // 用于判断移动支付类型 4微信6支付宝
const [qrLoading, setQrLoading] = useState(false) const [qrLoading, setQrLoading] = useState(false)
...@@ -208,20 +208,25 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -208,20 +208,25 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
setPayStep(1) setPayStep(1)
setQrLoading(true) setQrLoading(true)
handleSubmitPay() handleSubmitPay()
} else if(checked.id === 100) { } else if(checked.id === 9) {
console.log('选择了账期结算模式') console.log('选择了账期结算模式')
mobilePayFlag.current = 0 mobilePayFlag.current = 0
setCurrent(100) setCurrent(9)
setPayStep(1) setPayStep(1)
} else if(checked.id === 101) { } else if(checked.id === 8) {
console.log('选择了月结结算模式') console.log('选择了月结结算模式')
mobilePayFlag.current = 0 mobilePayFlag.current = 0
setCurrent(101) setCurrent(8)
setPayStep(1)
} else if(checked.id === 11 || checked.id === 12 || checked.id === 13 || checked.id === 14) {
console.log('选择了通联模式')
mobilePayFlag.current = 0
setCurrent(99)
setPayStep(1) setPayStep(1)
} }
else { // else {
message.error('暂只支持线下支付、授信额度支付、余额支付、货到付款、微信、支付宝、账期月结支付方式') // message.error('暂只支持线下支付、授信额度支付、余额支付、货到付款、微信、支付宝、账期月结支付方式')
} // }
} else { } else {
message.error('请先选择支付方式') message.error('请先选择支付方式')
} }
...@@ -260,13 +265,17 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -260,13 +265,17 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} else if(current === 5) { } else if(current === 5) {
// 开始提交货到付款数据 // 开始提交货到付款数据
handleSubmitPay() handleSubmitPay()
} else if(current === 100) { } else if(current === 9) {
// 开始提交账期结算数据 // 开始提交账期结算数据
// @todo 与后端联调传参
handleSubmitPay() handleSubmitPay()
} else if(current === 101) { } else if(current === 8) {
// 开始提交月结结算数据 // 开始提交月结结算数据
// @todo 与后端联调传参 handleSubmitPay()
} else if(current === 4 || current === 6) {
// 微信 支付宝 提示扫码支付
return message.info('请扫码完成支付')
} else if(current === 99) {
// 提交通联支付
handleSubmitPay() handleSubmitPay()
} }
...@@ -484,7 +493,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -484,7 +493,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
本次需支付(元): 本次需支付(元):
</span> </span>
<span className={cx(style.amount, style.amount2)}> <span className={cx(style.amount, style.amount2)}>
{/* {data?.payments?.filter(item => item.paymentId === Number(currentPayInfoId))[0]?.payAmount?.toFixed(2)} */}
{Number(paymentAmount).toFixed(2)} {Number(paymentAmount).toFixed(2)}
</span> </span>
</p> </p>
...@@ -508,7 +516,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -508,7 +516,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
本次需支付(元): 本次需支付(元):
</span> </span>
<span className={cx(style.amount, style.amount2)}> <span className={cx(style.amount, style.amount2)}>
{/* {data?.payments?.filter(item => item.paymentId === Number(currentPayInfoId))[0]?.payAmount?.toFixed(2)} */}
{Number(paymentAmount).toFixed(2)} {Number(paymentAmount).toFixed(2)}
</span> </span>
</p> </p>
...@@ -532,7 +539,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -532,7 +539,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
支付金额(元): 支付金额(元):
</span> </span>
<span className={cx(style.amount, style.amount2)}> <span className={cx(style.amount, style.amount2)}>
{/* {data?.payments?.filter(item => item.paymentId === Number(currentPayInfoId))[0]?.payAmount?.toFixed(2)} */}
{Number(paymentAmount).toFixed(2)} {Number(paymentAmount).toFixed(2)}
</span> </span>
</p> </p>
...@@ -604,7 +610,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -604,7 +610,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} }
{/* 账期结算 */} {/* 账期结算 */}
{ {
current === 100 && current === 9 &&
<div> <div>
<p style={{fontWeight: "bold"}}>账期支付确认</p> <p style={{fontWeight: "bold"}}>账期支付确认</p>
<p> <p>
...@@ -620,7 +626,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -620,7 +626,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
支付渠道: 支付渠道:
</span> </span>
<span className={style.amount}> <span className={style.amount}>
{/* {transformPayList['5'][0]['label']} */} {checked?.channel}
</span> </span>
</p> </p>
<p> <p>
...@@ -628,7 +634,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -628,7 +634,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
支付金额(元): 支付金额(元):
</span> </span>
<span className={cx(style.amount, style.amount2)}> <span className={cx(style.amount, style.amount2)}>
{/* {data?.payments?.filter(item => item.paymentId === Number(currentPayInfoId))[0]?.payAmount?.toFixed(2)} */}
{Number(paymentAmount).toFixed(2)} {Number(paymentAmount).toFixed(2)}
</span> </span>
</p> </p>
...@@ -636,7 +641,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -636,7 +641,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} }
{/* 月结结算 */} {/* 月结结算 */}
{ {
current === 101 && current === 8 &&
<div> <div>
<p style={{fontWeight: "bold"}}>月结支付确认</p> <p style={{fontWeight: "bold"}}>月结支付确认</p>
<p> <p>
...@@ -652,7 +657,38 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -652,7 +657,38 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
支付渠道: 支付渠道:
</span> </span>
<span className={style.amount}> <span className={style.amount}>
{/* {transformPayList['6'][0]['label']} */} {checked?.channel}
</span>
</p>
<p>
<span className={style.title}>
支付金额(元):
</span>
<span className={cx(style.amount, style.amount2)}>
{Number(paymentAmount).toFixed(2)}
</span>
</p>
</div>
}
{/* 通联 */}
{
current === 99 &&
<div>
<p style={{fontWeight: "bold"}}>通联支付确认</p>
<p>
<span className={style.title}>
支付方式:
</span>
<span className={style.amount}>
通联支付
</span>
</p>
<p>
<span className={style.title}>
支付渠道:
</span>
<span className={style.amount}>
{checked?.channel}
</span> </span>
</p> </p>
<p> <p>
...@@ -660,7 +696,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -660,7 +696,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
支付金额(元): 支付金额(元):
</span> </span>
<span className={cx(style.amount, style.amount2)}> <span className={cx(style.amount, style.amount2)}>
{/* {data?.payments?.filter(item => item.paymentId === Number(currentPayInfoId))[0]?.payAmount?.toFixed(2)} */}
{Number(paymentAmount).toFixed(2)} {Number(paymentAmount).toFixed(2)}
</span> </span>
</p> </p>
......
...@@ -50,7 +50,7 @@ export const baseOrderListColumns: any = () => { ...@@ -50,7 +50,7 @@ export const baseOrderListColumns: any = () => {
fixed: 'left', fixed: 'left',
}, },
{ {
title: intl.formatMessage({ id: 'purchaseOrder.dingdanzhaiyao', defaultMessage: '订单摘要' }), title: intl.formatMessage({ id: 'purchaseOrder.dingdandigest', defaultMessage: '订单摘要' }),
align: 'center', align: 'center',
dataIndex: 'digest', dataIndex: 'digest',
key: 'digest', key: 'digest',
......
...@@ -116,7 +116,12 @@ const SaleOrder: React.FC<SaleOrderProps> = () => { ...@@ -116,7 +116,12 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
payForm.setFieldsValue({'payChart': `${window.location.origin}/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${currentPayRef.current.orderId}`}) payForm.setFieldsValue({'payChart': `${window.location.origin}/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${currentPayRef.current.orderId}`})
} else if(payModel === "app") { } else if(payModel === "app") {
// 生成二维码 // 生成二维码
QRCode.toDataURL(JSON.stringify({path: 'MycommodityDetails', orderId: currentPayRef.current.orderId})).then((url:any) => { QRCode.toDataURL(JSON.stringify({
path: 'MycommodityDetails',
orderId: currentPayRef.current.orderId,
buyerMemberId: currentPayRef.current.buyerMemberId,
buyerRoleId: currentPayRef.current.buyerRoleId
})).then((url:any) => {
setQrCode(url) setQrCode(url)
}).catch((err:any) => { }).catch((err:any) => {
console.error(err) console.error(err)
...@@ -193,9 +198,6 @@ const SaleOrder: React.FC<SaleOrderProps> = () => { ...@@ -193,9 +198,6 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
// 转单调接口逻辑 // 转单调接口逻辑
const handelTransformOrder = async (defaultRoleId, orderId?) => { const handelTransformOrder = async (defaultRoleId, orderId?) => {
if(!serversRoles.length) {
return message.error(intl.formatMessage({ id: 'saleOrder.dangqiandengluhui', defaultMessage: '当前登录会员,无服务消费者角色,无法进行转单' }))
}
orderIds.current = selectRef.current.length ? selectRef.current : (orderId ? [orderId] : []); orderIds.current = selectRef.current.length ? selectRef.current : (orderId ? [orderId] : []);
if(orderId) { if(orderId) {
const { code, data } = await postOrderVendorTransferPreview({ const { code, data } = await postOrderVendorTransferPreview({
...@@ -228,12 +230,18 @@ const SaleOrder: React.FC<SaleOrderProps> = () => { ...@@ -228,12 +230,18 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
// 单个转单 传入默认第一个角色 // 单个转单 传入默认第一个角色
const onlyTransform = (orderId) => { const onlyTransform = (orderId) => {
if(!serversRoles.length) {
return message.error(intl.formatMessage({ id: 'saleOrder.dangqiandengluhui', defaultMessage: '当前登录会员,无服务消费者角色,无法进行转单' }))
}
handelTransformOrder(serversRoles[0]['memberRoleId'], orderId) handelTransformOrder(serversRoles[0]['memberRoleId'], orderId)
transformActions.setFieldValue('orderId', orderId) transformActions.setFieldValue('orderId', orderId)
} }
// 批量转 // 批量转
const batchTransform = () => { const batchTransform = () => {
if(!serversRoles.length) {
return message.error(intl.formatMessage({ id: 'saleOrder.dangqiandengluhui', defaultMessage: '当前登录会员,无服务消费者角色,无法进行转单' }))
}
handelTransformOrder(serversRoles[0]['memberRoleId']) handelTransformOrder(serversRoles[0]['memberRoleId'])
transformActions.setFieldValue('orderId', null) transformActions.setFieldValue('orderId', null)
} }
......
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