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

feat: 确认运费新增税率输入

parent 8ab10058
......@@ -13,6 +13,7 @@ export interface Params {
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
taxRate?: any,
freightPrice?: any;
dontReceive?: boolean; //默认展示
}
......@@ -25,9 +26,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
if(props.freightPrice) {
value.freightPrice = props.freightPrice
}
value.freightPrice = props.freightPrice
value.taxRate = props.taxRate
value.taxInclusive = 1
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) {
props.onOK()
......
import React, { useEffect, useState, ReactNode, useRef } from 'react';
import { Row, Col, Table, Input, Button, Tag, Badge, Steps, message } 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'
......@@ -11,9 +11,18 @@ import style from './index.less'
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);
const [ taxRate ,setTaxRate] = useState<any>(null);
let [isextraOption, setIsextraOption] = useState(false)
let [dataInfo, setdataInfo] = useState<any>({
status: '',
......@@ -74,8 +83,9 @@ const detailInfo: React.FC<{}> = () => {
freight: {
title: '运费',
leftElem: [
{ title: '是否含税:', key: 'taxRate', value: '' },
{ title: '运费:', key: 'freight', value: dataInfo.freightPrice || '' },
{ title: '结算方式:', key: '', value: dataInfo.settlementWay || '' }
{ title: '结算方式:', key: 'settlement', value: dataInfo.settlementWay || '' }
]
}
}
......@@ -245,11 +255,14 @@ 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);
setTaxRate(value.taxRate);
setvisible(true);
} catch {
message.error('请下拉到运费模块输入税率和运费!')
}
}
......@@ -419,35 +432,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}
<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>
}
</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' &&
<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>
</Form.Item>}
</Form>
);
},
)}
......@@ -470,6 +491,7 @@ const detailInfo: React.FC<{}> = () => {
<ConfirmModal
id={id}
dialogVisible={visible}
taxRate={taxRate}
freightPrice={freightPrice}
onCancel={() => setvisible(false)}
onOK={() => handleModalOK()}
......
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