Commit 0d9d9434 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞fix: 修复采购询价bug

parent 5a5d1f3a
import React, { useEffect, useState, ReactNode, useRef } from 'react';
import { Row, Col, Table, Input, Button, Tag, Badge, Steps, message, Form, Typography } from 'antd'
import React, { useEffect, useState, ReactNode, useRef, Fragment } from 'react';
import { Row, Col, Table, Input, Button, Tag, Badge, Steps, message, Form, Checkbox } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { CheckSquareOutlined } from '@ant-design/icons'
import { ColumnType } from 'antd/lib/table/interface'
......@@ -8,7 +8,7 @@ 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 = {
......@@ -22,7 +22,7 @@ const detailInfo: React.FC<{}> = () => {
const ref = useRef<any>({})
const [form] = Form.useForm();
const [freightPrice, setfreightPrice] = useState<any>(null);
const [ taxRate ,setTaxRate] = useState<any>(null);
const [taxRate, setTaxRate] = useState<any>(null);
let [isextraOption, setIsextraOption] = useState(false)
let [dataInfo, setdataInfo] = useState<any>({
status: '',
......@@ -251,7 +251,6 @@ const detailInfo: React.FC<{}> = () => {
// 输入报价价格
const inputOnchange = (e: any) => {
console.log(e.target.value)
const value = e.target.value;
setfreightPrice(value);
}
......@@ -260,9 +259,10 @@ const detailInfo: React.FC<{}> = () => {
try {
const value = await form.validateFields();
setfreightPrice(value.freight);
setTaxRate(value.taxRate);
setvisible(true);
} catch {
message.error('请下拉到运费模块输入运费!')
message.error('请下拉到运费模块输入税率和运费!')
}
}
......@@ -433,37 +433,37 @@ const detailInfo: React.FC<{}> = () => {
(item: any, index: number) => {
return (
<Form {...layout} form={form}>
{item.key === 'taxRate' &&
<Form.Item label={item.title} style={{ marginBottom: 0, position: 'relative' }}>
<div style={{
position: 'absolute',
top: '7px',
}}>
<Checkbox checked></Checkbox>
</div>
<Form.Item
label='税率'
name='taxRate'
rules={[{ required: true, message: '请输入税率' }]}
style={{ paddingLeft: '60px' }}
>
<Input
type='number'
addonAfter='%'
maxLength={25}
style={{ width: '200px' }}
/>
</Form.Item>
</Form.Item>}
{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>
)}
</>
}
<Form.Item label={item.title} name={item.key} rules={[{ required: true, message: '请输入运费' }]}>
<Input
type='number'
addonBefore="¥"
maxLength={25}
style={{ width: '300px' }}
/>
</Form.Item>}
{item.key === 'settlement' &&
<Form.Item label={item.title} name={item.key}>
<span>{item.value}</span>
......
......@@ -142,6 +142,9 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
if (modalType === 'next') {
actions.setFieldValue('quotedPriceTime', moment().format())
}
if (modalType === 'abandon') {
actions.setFieldValue('reasonTime', moment().format())
}
}, [visible])
const handleSubmit = (val: any) => {
......
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