Commit cb9e5a6a authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 4faa7273 b2869910
...@@ -15,5 +15,18 @@ ...@@ -15,5 +15,18 @@
margin-left: 2px; margin-left: 2px;
} }
} }
&_value {
:global {
.ant-form-item {
margin-bottom: 0;
}
.ant-form-item-explain {
position: absolute;
top: 32px;
}
}
}
} }
} }
\ No newline at end of file
import React from 'react' import React from 'react'
import { Form } from 'antd'
import { FormInstance } from 'antd/lib/form'
import cx from 'classnames' import cx from 'classnames'
import styles from './index.less' import styles from './index.less'
...@@ -10,11 +12,12 @@ interface dataListType { ...@@ -10,11 +12,12 @@ interface dataListType {
} }
interface InfoListProps { interface InfoListProps {
options: dataListType[] options: dataListType[],
form?: FormInstance,
} }
const InfoList: React.FC<InfoListProps> = (props) => { const InfoList: React.FC<InfoListProps> = (props) => {
const { options = [] } = props const { options = [], form } = props
return ( return (
<div className={styles.info_list}> <div className={styles.info_list}>
......
import React from 'react' import React from 'react'
import { Input } from 'antd' import { Input, Form } from 'antd'
import { FormInstance } from 'antd/lib/form' import { FormInstance } from 'antd/lib/form'
import InfoList from '../../../../components/InfoList' import InfoList from '../../../../components/InfoList'
interface BasicInfoProps { interface BasicInfoProps {
form: FormInstance
} }
const BasicInfo: React.FC<BasicInfoProps> = (props) => { const BasicInfo: React.FC<BasicInfoProps> = (props) => {
const { form } = props
let detailList = [ let detailList = [
{ {
label: '申请单摘要', label: '申请单摘要',
value: <Input style={{ width: 572 }} placeholder="请输入申请单摘要" />, value: <Form.Item
name="applyAbstract"
rules={[{ required: true, message: '请输入申请单摘要' },]}
>
<Input style={{ width: 572 }} placeholder="请输入申请单摘要" />
</Form.Item>,
required: true, required: true,
}, },
{ {
...@@ -39,7 +42,7 @@ const BasicInfo: React.FC<BasicInfoProps> = (props) => { ...@@ -39,7 +42,7 @@ const BasicInfo: React.FC<BasicInfoProps> = (props) => {
return ( return (
<div> <div>
<InfoList options={detailList} /> <InfoList options={detailList} {...props} />
</div> </div>
) )
} }
......
...@@ -51,7 +51,11 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => { ...@@ -51,7 +51,11 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => {
const handleSave = () => { const handleSave = () => {
form.validateFields().then(values => {
console.log(values, "values")
}).catch(errors => {
console.log(errors, "errors")
})
} }
return ( return (
...@@ -70,27 +74,28 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => { ...@@ -70,27 +74,28 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => {
] : []} ] : []}
> >
<div className={styles.detail_wrap}> <div className={styles.detail_wrap}>
<Tabs type="card" activeKey={tabActiveKey} onChange={(key) => setTabActiveKey(key)} className={styles.detail_tabs}> <Form form={form}>
<TabPane tab="基本信息" key="basicInfo"> <Tabs type="card" activeKey={tabActiveKey} onChange={(key) => setTabActiveKey(key)} className={styles.detail_tabs}>
<BasicInfo form={form} /> <TabPane tab="基本信息" key="basicInfo">
</TabPane> <BasicInfo />
<TabPane tab="换货商品" key="exchangeGoods"> </TabPane>
<ExchangeGoods /> <TabPane tab="换货商品" key="exchangeGoods">
</TabPane> <ExchangeGoods />
<TabPane tab="举证附件" key="proofFile"> </TabPane>
<ProofFile /> <TabPane tab="举证附件" key="proofFile">
</TabPane> <ProofFile />
<TabPane tab="退货收货地址" key="returnAddress"> </TabPane>
<ReturnAddress /> <TabPane tab="退货收货地址" key="returnAddress">
</TabPane> <ReturnAddress />
<TabPane tab="换货收货地址" key="replaceAddress"> </TabPane>
<ReplaceAddress /> <TabPane tab="换货收货地址" key="replaceAddress">
</TabPane> <ReplaceAddress />
<TabPane tab="流转记录" key="log"> </TabPane>
<Log /> <TabPane tab="流转记录" key="log">
</TabPane> <Log />
</Tabs> </TabPane>
</Tabs>
</Form>
</div> </div>
</PageHeaderWrapper> </PageHeaderWrapper>
</> </>
......
...@@ -5,6 +5,7 @@ import Recommand from '../components/Recommand' ...@@ -5,6 +5,7 @@ import Recommand from '../components/Recommand'
import cx from 'classnames' import cx from 'classnames'
import { Checkbox, Affix, message, Modal, Button } from 'antd' import { Checkbox, Affix, message, Modal, Button } from 'antd'
import styles from './index.less' import styles from './index.less'
import { history } from 'umi'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { priceFormat, numFormat } from "@/utils/numberFomat" import { priceFormat, numFormat } from "@/utils/numberFomat"
import { useLocalStore, observer } from 'mobx-react' import { useLocalStore, observer } from 'mobx-react'
...@@ -19,7 +20,8 @@ interface PurchaseOrderPropsType { ...@@ -19,7 +20,8 @@ interface PurchaseOrderPropsType {
layoutType: LAYOUT_TYPE, layoutType: LAYOUT_TYPE,
shopInfo: GetTemplateChannelFindChannelResponse, shopInfo: GetTemplateChannelFindChannelResponse,
shopUrlParam: string, shopUrlParam: string,
mallInfo: any mallInfo: any,
location: any
} }
const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
...@@ -543,9 +545,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -543,9 +545,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
updateOrderInfo(buyOrderInfo, sessionKey).then(() => { updateOrderInfo(buyOrderInfo, sessionKey).then(() => {
if (res.data) { if (res.data) {
window.location.href = `/order?spam_id=${sessionKey}&scence=purchase` history.push(`/order?spam_id=${sessionKey}&scence=purchase`)
} else { } else {
window.location.href = `/memberCenter/tranactionAbility/purchaseOrder/orderDetail?modelType=5&spam_id=${sessionKey}` history.push(`/memberCenter/tranactionAbility/purchaseOrder/orderDetail?modelType=5&spam_id=${sessionKey}`)
} }
}) })
} }
......
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