Commit 8cfc1bbb authored by LeeJiancong's avatar LeeJiancong

'封装外部流转记录组件,每个详情调用接口不同'

parent 6d5f3452
......@@ -40,14 +40,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 3) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value == 3) {
if (value == 4) {
state.visible = false
} else {
state.visible = true
......@@ -78,14 +71,14 @@ const comfirmDialog: React.FC<Params> = (props) => {
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 3
status: 4
}}
>
<Field
enum={
[
{ label: '接受物流单', value: 3 },
{ label: '不接受物流单', value: 4 }
{ label: '接受物流单', value: 4 },
{ label: '不接受物流单', value: 3 }
]}
name='status'
required
......@@ -94,22 +87,6 @@ const comfirmDialog: React.FC<Params> = (props) => {
{props.dontReceive &&
<>
<Field
title='运费'
name="freightPrice"
x-component="Input"
required
x-component-props={{
placeholder:'运费',
// addonBefore: ' '
}}
x-rules ={{
pattern: PATTERN_MAPS.money,
message:'数字类型,币制为当前站点对应的币制,保留2位小数'
}}
/>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
......
......@@ -5,6 +5,7 @@ import { EyeOutlined, ClockCircleOutlined, UpOutlined, DownOutlined, StopOutline
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import ConfirmModal from './confirmModal'
import OrderLog from './pageOrderLog'
import { history } from 'umi'
import { PublicApi } from '@/services/api'
import moment from 'moment'
......@@ -282,6 +283,9 @@ const detailInfo: React.FC<{}> = () => {
const handleModalOK = () => {
setvisible(false)
ref.current.reload()
setTimeout(()=> {
history.goBack()
},1000)
}
......@@ -496,14 +500,13 @@ const detailInfo: React.FC<{}> = () => {
<div className={style['mainCol-title']}>
外部流转记录
</div>
<StandardTable
<OrderLog id={id} pathName={history.location.pathname}/>
{/* <StandardTable
tableProps={{rowKey:'id'}}
currentRef={ref}
columns={columns}
fetchTableData={(params: any) => fetchData(params)}
/>
{/* <Table dataSource={dataInfo.logList} columns={columns} pagination={pagination} /> */}
/> */}
</Col>
......@@ -512,7 +515,7 @@ const detailInfo: React.FC<{}> = () => {
id={id}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK = {() =>handleModalOK}
onOK = {() =>handleModalOK()}
/>
</PageHeaderWrapper>
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-18 15:55:51
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-18 14:13:08
* @LastEditTime: 2020-09-23 17:25:53
*/
import React, { useState, useEffect, useRef, ReactNode } from 'react';
import { Card, Button, Row, Col, Tooltip, Input, Select, Tag, Space } from 'antd'
......@@ -224,9 +224,9 @@ const orderSearchList: React.FC<listProps> = (props) => {
if (reconds.status == 3) {
component =
// <Tag color='success'>接受物流单</Tag>
<><span style={statuStyle.success}>不接受物流单</span></>
<><span style={statuStyle.warn}>不接受物流单</span></>
} else if (reconds.status == 4) {
component = <><span style={statuStyle.warn}>接受物流单</span></>
component = <><span style={statuStyle.success}>接受物流单</span></>
} else if (reconds.status == 2) {
component = <><span style={statuStyle.confirm}>待确认</span></>
} else if (reconds.status == 1) {
......
......@@ -3,7 +3,7 @@
* @Date: 2020-09-23 10:24:42
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-23 11:29:20
* @LastEditTime: 2020-09-23 18:07:31
* 外部流转记录
*/
import React, { Component,useRef,ReactNode } from 'react';
......@@ -65,7 +65,7 @@ const columns: ColumnType<any>[] = [
export interface Params{
id: string | number,
pathName?: string,
type: string //Submit 能力中心待提交
type?: string //Submit 能力中心待提交新增编辑
}
const Log: React.FC<Params> = (props) => {
const ref = useRef<any>({})
......@@ -73,7 +73,9 @@ const Log: React.FC<Params> = (props) => {
if(!props.id){
return
}
if(props.type === 'Submit'){
//待提交新增物流单
if(props.type === 'Submit' ){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderWaitSubmitPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
......@@ -82,6 +84,37 @@ const Log: React.FC<Params> = (props) => {
})
});
}
//物流单提交-物流单查询
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderSubmitPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
//物流单处理-物流单查询
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderConfirmPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
//物流单处理-待确认物流单
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmDeatil'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderWaitConfirmPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
};
return <StandardTable
tableProps={{rowKey:'id'}}
......
......@@ -3,7 +3,7 @@
* @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-23 15:39:49
* @LastEditTime: 2020-09-23 16:17:29
*/
import React, { Component, useEffect, useRef, useState, ReactNode } from 'react'
......@@ -408,7 +408,6 @@ const Deatail: React.FC<{}> = () => {
setFieldValue('detailList', value)
let detailData = value
computedALL(detailData)
})
}
......@@ -454,10 +453,11 @@ const Deatail: React.FC<{}> = () => {
break;
case 2://发货单
// memberName 收货方
let {deliveryAddresId, fullAddress,memberName } = values[0]
let {deliveryAddresId, fullAddress,memberName, } = values[0]
setShipmentOrderID(id)
actions.setFieldValue('shipmentOrderCode', orderNo)
actions.setFieldValue("receiverName",memberName)
actions.setFieldValue("invoicesTypeId",1)//发货单
actions.setFieldValue("receiverAddressId",deliveryAddresId)
actions.setFieldValue("receiverFullAddress",fullAddress)
setvisibleObj({ ...visibleObj, ModalSeletOrder2: false })
......@@ -564,6 +564,8 @@ const Deatail: React.FC<{}> = () => {
</Row>
<FormItem editable={false} name="receiverName" label='收货方' component={Input}/>
<FormItem display={false} editable={false} name="receiverAddressId" label='收货地址id' component={Input}/>
{/* <FormItem display={false} editable={false} name="invoicesTypeId" label='订单类型' component={Input}/> */}
<FormItem editable={false} name="receiverFullAddress" label='收货地址' component={Input}/>
<FormItem name="shipperAddressId" label="发货地址" dataSource={shipperAddress} required component={Select} />
</Col>
......
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