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

fix:销售订单添加不接受物流单的状态,交易规则添加加工流程交易规则类型,处理采购下单删除已选商品提交数据报错,处理多次支付下单禁用到付

parent 9b49aaa2
...@@ -34,6 +34,7 @@ const config: any = { ...@@ -34,6 +34,7 @@ const config: any = {
['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'], ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'],
['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god'], ['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god'],
['import', { libraryName: '@umijs/hooks', libraryDirectory: 'lib', camel2DashComponentName: false }, '@umijs/hooks'],// 将下划线转化关闭 ['import', { libraryName: '@umijs/hooks', libraryDirectory: 'lib', camel2DashComponentName: false }, '@umijs/hooks'],// 将下划线转化关闭
['transform-remove-console', { "exclude": [ "error", "warn"] }], // 移除 console
], ],
history: { history: {
type: 'browser', // 'brower' | 'hash' type: 'browser', // 'brower' | 'hash'
......
...@@ -927,6 +927,11 @@ export enum SaleOrderInsideWorkState { ...@@ -927,6 +927,11 @@ export enum SaleOrderInsideWorkState {
* 手工发货 * 手工发货
*/ */
HAND_DELEVED_ORDER, HAND_DELEVED_ORDER,
/**
* 不接受物流单
*/
NOT_ACCEPTED_DELIVERY,
} }
// 支付外部状态 // 支付外部状态
...@@ -1039,7 +1044,8 @@ export const SaleOrderInsideWorkStateTexts = { ...@@ -1039,7 +1044,8 @@ export const SaleOrderInsideWorkStateTexts = {
24: '订单归档', 24: '订单归档',
25: '待审核发货单', 25: '待审核发货单',
26: '待确认物流单', 26: '待确认物流单',
27: '待手工发货' 27: '待手工发货',
28: '不接受物流单',
} }
// 订单流转记录外部状态 // 订单流转记录外部状态
......
...@@ -205,14 +205,15 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -205,14 +205,15 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
} }
} else { } else {
actions.setFieldState('usingElectronicContracts', state => { actions.setFieldState('usingElectronicContracts', state => {
state.value = 0 // state.value = 0
state.props["x-component-props"] = { state.props["x-component-props"] = {
disabled: true disabled: true
} }
}) })
actions.setFieldValue('usingElectronicContracts', data.usingElectronicContracts || 0)
} }
$('onFieldValueChange', 'contractTemplateId').subscribe(state => { $('onFieldValueChange', 'contractTemplateId').subscribe(state => {
console.log(state.props) // console.log(state.props)
}) })
// }) // })
}} }}
......
...@@ -153,7 +153,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -153,7 +153,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if(qrCodeInfo.qrUrl) { if(qrCodeInfo.qrUrl) {
// @ts-ignore // @ts-ignore
PublicApi.getOrderPayResultsl({id, paymentInformationId: currentPayInfoId}).then(res => { PublicApi.getOrderPayResultsl({id, paymentInformationId: currentPayInfoId}).then(res => {
console.log(res)
if(res.code === 1000) { if(res.code === 1000) {
if(res.data) { if(res.data) {
setOpenTimer(0) setOpenTimer(0)
...@@ -170,14 +169,13 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -170,14 +169,13 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} }
const handleConfirm = () => { const handleConfirm = () => {
console.log(data,'data')
if (current === 0) { if (current === 0) {
if (checked.id) { if (checked.id) {
if (checked.id === 5) { // 线下支付 if (checked.id === 5) { // 线下支付
setCurrent(1) setCurrent(1)
setPayStep(1) setPayStep(1)
// 获取账户信息 // 获取对公账户信息
PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.supplyMembersId}).then(res => { PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.supplyMembersId, memberRoleId: data.supplyMembersRoleId}).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
setBlankAccountInfo(res.data) setBlankAccountInfo(res.data)
} }
...@@ -261,7 +259,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -261,7 +259,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
handleSubmitPay() handleSubmitPay()
} else if (current === 2) { } else if (current === 2) {
// 开始提交授信支付数据 (需要输入支付密码) // 开始提交授信支付数据 (需要输入支付密码)
console.log('开始提交授信支付数据', payPrice)
if(payPrice <= creditInfo.canUseQuota){ if(payPrice <= creditInfo.canUseQuota){
setPayStep(2) setPayStep(2)
setCurrent(1000) setCurrent(1000)
...@@ -270,7 +267,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -270,7 +267,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} }
} else if(current === 3) { } else if(current === 3) {
// 开始提交余额支付数据 (需要输入支付密码) // 开始提交余额支付数据 (需要输入支付密码)
console.log('开始提交余额支付数据', payPrice)
if(payPrice <= balanceInfo){ if(payPrice <= balanceInfo){
setPayStep(2) setPayStep(2)
setCurrent(1000) setCurrent(1000)
...@@ -279,7 +275,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -279,7 +275,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} }
} else if(current === 5) { } else if(current === 5) {
// 开始提交货到付款数据 // 开始提交货到付款数据
console.log('开始提交货到付款数据', payPrice)
handleSubmitPay() handleSubmitPay()
} }
......
...@@ -251,8 +251,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -251,8 +251,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
history.goBack() history.goBack()
}, 1000) }, 1000)
// history.replace('/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder') // history.replace('/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder')
} else {
setBtnLoading(false)
} }
setBtnLoading(false)
} catch (error) { } catch (error) {
setBtnLoading(false) setBtnLoading(false)
error?.message && message.error(error.message) error?.message && message.error(error.message)
......
...@@ -87,6 +87,14 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions ...@@ -87,6 +87,14 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
if(options.filter(_item => _item.payType === 4).length) if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false options.filter(_item => _item.payType === 4)[0].disabled = false
} }
// 多次支付也要禁用到付
if(ctx.getFieldValue('paymentInformationResponses').length > 1) {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = true
} else {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false
}
} }
}, [orderProducts, columns]) }, [orderProducts, columns])
......
...@@ -66,6 +66,11 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -66,6 +66,11 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
rowSelectionCtl.setSelectRow(newData) rowSelectionCtl.setSelectRow(newData)
rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id)) rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id))
ctx.setFieldValue('orderProductRequests', newData) ctx.setFieldValue('orderProductRequests', newData)
// 商品行数变动 清空之前的支付信息
if (pageStatus === PageStatus.ADD) {
ctx.setFieldValue('paymentInformationResponses', [])
}
} }
const [productColumns, setProductColumns] = useState(() => { const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) { if (pageStatus === PageStatus.ADD) {
......
import React, { useState, useRef, useEffect } from 'react' import React, { useState, useRef, useEffect } from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import { ISchemaFormProps, ISchemaFieldProps, ISchemaFieldComponentProps, createFormActions, useFieldState } from '@formily/antd' import { ISchemaFormProps, ISchemaFieldProps, ISchemaFieldComponentProps, createFormActions, useFieldState } from '@formily/antd'
import { Button, Space, Row, Col, Tag } from 'antd' import { Button, Space, Row, Col, Tag } from 'antd'
import { PlusOutlined, DeleteColumnOutlined, EditOutlined, DeleteOutlined, CaretUpOutlined, CaretDownOutlined, EyeOutlined } from '@ant-design/icons' import { PlusOutlined, DeleteColumnOutlined, EditOutlined, DeleteOutlined, CaretUpOutlined, CaretDownOutlined, EyeOutlined } from '@ant-design/icons'
import cx from 'classnames' import cx from 'classnames'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)` const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border { .select_style_border {
border: 1px solid #EEF0F3; border: 1px solid #EEF0F3;
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 8px 14px; padding: 8px 14px;
cursor: pointer; cursor: pointer;
line-height: 28px; line-height: 28px;
position:relative; position:relative;
} }
.select_style_border.active { .select_style_border.active {
border: 1px solid #00B382; border: 1px solid #00B382;
} }
.select_style_border.active::after { .select_style_border.active::after {
content: ''; content: '';
position: absolute; position: absolute;
width: 0; width: 0;
height: 0; height: 0;
border-bottom: 12px solid #00B37A; border-bottom: 12px solid #00B37A;
border-left: 12px solid transparent; border-left: 12px solid transparent;
bottom: 0; bottom: 0;
right: 0; right: 0;
z-index: 5; z-index: 5;
} }
` `
enum ProcessTagColor { enum ProcessTagColor {
'red', 'red',
'orange', 'orange',
'purple', 'purple',
'blue' 'blue',
} 'green'
}
enum ProcessTagType {
'订单交易流程', enum ProcessTagType {
'售后换货流程', '订单交易流程',
'售后退货流程', '售后换货流程',
'售后维修流程' '售后退货流程',
} '售后维修流程',
'加工生产流程'
const SelectProcesss = (props: ISchemaFieldComponentProps) => { }
const [formInitValue, setFormInitValue] = useState<any>(null)
const [state, setFieldState] = useFieldState({ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
dataSource: [], const [formInitValue, setFormInitValue] = useState<any>(null)
showMore: false const [state, setFieldState] = useFieldState({
}) dataSource: [],
const { dataSource, showMore } = state showMore: false
const { value, mutators, editable } = props })
const { dataSource, showMore } = state
useEffect(() => { const { value, mutators, editable } = props
PublicApi.getOrderTradingRulesTransactionProcessList().then(res => {
setFieldState({ useEffect(() => {
dataSource: res.data, PublicApi.getOrderTradingRulesTransactionProcessList().then(res => {
showMore setFieldState({
}) dataSource: res.data,
}) showMore
}, []) })
})
const showDataSource = showMore ? dataSource : [...dataSource].splice(0, 3) }, [])
const handleCheck = (id) => { const showDataSource = showMore ? dataSource : [...dataSource].splice(0, 3)
if (editable) {
mutators.change(id) const handleCheck = (id) => {
} if (editable) {
} mutators.change(id)
}
const toogleMore = () => { }
setFieldState({
dataSource, const toogleMore = () => {
showMore: !showMore setFieldState({
}) dataSource,
} showMore: !showMore
})
const renderProcessType = (v: any) => { }
return <Tag color={ProcessTagColor[v.type - 1]}>
{ProcessTagType[v.type - 1]} const renderProcessType = (v: any) => {
</Tag> return <Tag color={ProcessTagColor[v.type - 1]}>
} {ProcessTagType[v.type - 1]}
</Tag>
return ( }
<div style={{ width: '100%' }}>
<SelectStyles> return (
{ <div style={{ width: '100%' }}>
showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v.id)} className={cx('select_style_border', value === v.id ? 'active' : '')}> <SelectStyles>
<div> {
<Row style={{ color: '#303133' }}> showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v.id)} className={cx('select_style_border', value === v.id ? 'active' : '')}>
<Col>{v.name}</Col> <div>
<Col style={{ marginLeft: 6 }}> <Row style={{ color: '#303133' }}>
{ <Col>{v.name}</Col>
renderProcessType(v) <Col style={{ marginLeft: 6 }}>
} {
</Col> renderProcessType(v)
</Row> }
<div style={{ color: '#909399' }}>{v.explain}</div> </Col>
</div> </Row>
</div>) <div style={{ color: '#909399' }}>{v.explain}</div>
} </div>
</SelectStyles> </div>)
{dataSource.length > 3 && }
<div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer' }}> </SelectStyles>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />} {dataSource.length > 3 &&
</div> <div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer' }}>
} 显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</div> </div>
) }
} </div>
)
SelectProcesss.defaultProps = {} }
SelectProcesss.isFieldComponent = true; SelectProcesss.defaultProps = {}
export default SelectProcesss SelectProcesss.isFieldComponent = true;
\ No newline at end of file
export default SelectProcesss
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