Commit 578e3fe8 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞fix: 修复待确认物流单bug

parent 8df1e773
import React, { useEffect, useState, ReactNode, useRef } from 'react';
import { Row, Col, Table, Input, Button, Tag, Badge, Steps, message } from 'antd'
import { Row, Col, Table, Input, Button, Tag, Badge, Steps, message, Form, Typography } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { CheckSquareOutlined } from '@ant-design/icons'
import { ColumnType } from 'antd/lib/table/interface'
......@@ -8,11 +8,19 @@ import { history } from 'umi'
import { PublicApi } from '@/services/api'
import moment from 'moment'
import style from './index.less'
import statuStyle from '../colorTag'
import statuStyle from '../colorTag';
const { Step } = Steps
const layout: any = {
colon: false,
labelCol: { style: { width: '150px' } },
wrapperCol: { style: { width: '500px' } },
labelAlign: "left"
}
const detailInfo: React.FC<{}> = () => {
const ref = useRef<any>({})
const [form] = Form.useForm();
const [freightPrice, setfreightPrice] = useState<any>(null);
let [isextraOption, setIsextraOption] = useState(false)
let [dataInfo, setdataInfo] = useState<any>({
......@@ -75,7 +83,7 @@ const detailInfo: React.FC<{}> = () => {
title: '运费',
leftElem: [
{ title: '运费:', key: 'freight', value: dataInfo.freightPrice || '' },
{ title: '结算方式:', key: '', value: dataInfo.settlementWay || '' }
{ title: '结算方式:', key: 'settlement', value: dataInfo.settlementWay || '' }
]
}
}
......@@ -246,11 +254,13 @@ const detailInfo: React.FC<{}> = () => {
setfreightPrice(value);
}
const handleAudit = () => {
if (freightPrice) {
setvisible(true)
} else {
message.error('请输入运费')
const handleAudit = async () => {
try {
const value = await form.validateFields();
setfreightPrice(value.freight);
setvisible(true);
} catch {
message.error('请下拉到运费模块输入运费!')
}
}
......@@ -420,35 +430,43 @@ const detailInfo: React.FC<{}> = () => {
{infoTem['freight'].leftElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={`freight${index + 1}`}>
<div className={style['cols-main-options']}>
{item.title}
</div>
{
item.key === 'freight' ?
<>
{type === 'option' ?
<div className={style['cols-main-options']}>
<Input
value={freightPrice}
addonBefore="¥"
onChange={inputOnchange}
type='number'
maxLength={25}
style={{ width: '300px' }}
/>
</div>
:
<div className={style['cols-main-options']}>
{dataInfo.status < 3 ? '未报价' : item.value}
</div>
}
</>
: <div className={style['cols-main-options']}>
{item.value}
</div>
<Form {...layout} form={form}>
{item.key === 'freight' &&
<>
{type === 'option' ? (
<Form.Item
label={item.title}
name={item.key}
rules={[
{
required: true,
message: '请正确输入运费',
},
{
pattern: /^\d+(\.\d{1,2})?$/,
message: '运费数值小数点后仅限两位',
}
]}
>
<Input
type='number'
addonBefore="¥"
maxLength={25}
style={{ width: '300px' }}
/>
</Form.Item>
) : (
<Form.Item label={item.title} name={item.key} rules={[{ required: true, message: '请输入运费' }]}>
{dataInfo.status < 3 ? <Typography.Text>未报价</Typography.Text> : <Typography.Text>{item.value && `¥${(item.value).toFixed(2)}`}</Typography.Text>}
</Form.Item>
)}
</>
}
</div>
{item.key === 'settlement' &&
<Form.Item label={item.title} name={item.key}>
<span>{item.value}</span>
</Form.Item>}
</Form>
);
},
)}
......
......@@ -196,7 +196,7 @@ const company: React.FC<parmas> = (props) => {
backIcon={<ReutrnEle description="返回" />}
title={headerTitle}
>
<Row gutter={[36, 36]}>
<Row>
<Col span={24}>
<Card>
{
......
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