Commit f87949ab authored by LeeJiancong's avatar LeeJiancong

对接待提交

parent cb29bec1
This diff is collapsed.
/*
* @Author: LeeJiancong
* @Date: 2020-07-22 09:54:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 19:28:23
*/
/**
* 正则表达式集合
*/
......@@ -8,5 +14,6 @@ export const PATTERN_MAPS = {
email: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,
phone: /^1[3|4|5|6|7|8|9][0-9]{9}$/,
smsCode: /^\d{6}$/,
money:/^\d*(?:\.\d{0,2})?$/
money:/^\d*(?:\.\d{0,2})?$/,
weight:/^\d*(?:\.\d{0,3})?$/,
}
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-07-30 17:23:48
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 17:24:49
*/
export default {
default: {
padding: '2px 5px',
background: 'rgba(244,245,247,1)',
borderRadius: '4px'
},
confirm: {
color: '#3F7ED2',
padding: '2px 5px',
background: 'rgba(240, 248, 255, 1)',
borderRadius: '4px'
},
success: {
color: '#00B37A',
padding: '2px 5px',
background: 'rgba(235,247,242,1)',
borderRadius: '4px'
},
warn: {
color: '#E63F3B',
padding: '2px 5px',
background: 'rgba(255,235,230,1)',
borderRadius: '4px'
}
}
\ No newline at end of file
......@@ -74,7 +74,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
x-component="Radio"
/>
{props.dontReceive &&
<FormMegaLayout name='remarkOption' label='不接受原因' full required wrapperWidth={570} labelCol={2} labelAlign="top">
<FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top">
<Field
name="remark"
x-component="TextArea"
......
/*
* @Author: LeeJiancong
* @Date: 2020-07-18 15:55:51
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 19:14:40
*/
import React, { useState, useEffect, useRef, ReactNode } from 'react';
import { Card, Button, Row, Col, Tooltip, Input, Select, Tag, Space } from 'antd'
import { UpOutlined, DownOutlined, EyeOutlined } from '@ant-design/icons'
......@@ -9,6 +15,7 @@ import { history } from 'umi'
import { hidden } from 'chalk';
import { PublicApi } from '@/services/api';
import {timeRange} from '@/utils/index'
import statuStyle from '../colorTag'
let { Option } = Select
export interface listProps {
title?: ReactNode,
......@@ -23,32 +30,6 @@ const data = [
status: 0
}
]
const statuStyle = {
default: {
padding: '2px 5px',
background: 'rgba(244,245,247,1)',
borderRadius: '4px'
},
confirm: {
color: '#3F7ED2',
padding: '2px 5px',
background: 'rgba(240, 248, 255, 1)',
borderRadius: '4px'
},
success: {
color: '#00B37A',
padding: '2px 5px',
background: 'rgba(235,247,242,1)',
borderRadius: '4px'
},
warn: {
color: '#E63F3B',
padding: '2px 5px',
background: 'rgba(255,235,230,1)',
borderRadius: '4px'
}
}
// 定义列的格式
interface Item {
oredrNo: string
......@@ -313,9 +294,15 @@ const orderSearchList: React.FC<listProps> = (props) => {
* @param {type}
* @return:
*/
const handleChange = (key:any,val) => {
const handleChange = (key:any,val:any) => {
let obj = {}
switch(key){
case 'logisticsOrderNo':
obj = { ...searchForm, logisticsOrderNo: val }
break;
case 'invoicesNo':
obj = { ...searchForm, invoicesNo: val }
break;
case 'companyId':
obj = { ...searchForm, companyId: val }
break;
......@@ -355,6 +342,7 @@ const orderSearchList: React.FC<listProps> = (props) => {
<PageHeaderWrapper title='快递单查询'>
<Card>
<StandardTable
tableProps={{rowKey:'id'}}
columns={columns}
currentRef={ref}
formAlign='left'
......@@ -372,7 +360,7 @@ const orderSearchList: React.FC<listProps> = (props) => {
value={searchForm.logisticsOrderNo}
placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, logisticsOrderNo: e.target.value })}
onSearch={(val) => handleSearch(val)}
onSearch={(val) => handleChange('logisticsOrderNo',val)}
/>
</Tooltip>
<Button className={style['filter-btn']} onClick={() => setIsSearch(isSearch = !isSearch)}>
......@@ -386,8 +374,17 @@ const orderSearchList: React.FC<listProps> = (props) => {
isSearch &&
<Col>
<Space size={16}>
{
props.type === '1' ?
<>
<Input.Search
style={{ width: '232px' }}
value={searchForm.invoicesNo}
placeholder='输入对应单号进行搜索'
onChange={(e) => setSearchForm({ ...searchForm, invoicesNo: e.target.value })}
onSearch={(val) => handleChange('invoicesNo',val)}
/>
<Select
className={style.select}
showSearch
......@@ -406,6 +403,7 @@ const orderSearchList: React.FC<listProps> = (props) => {
})
}
</Select>
</>
:
<Select
className={style.select}
......@@ -419,8 +417,8 @@ const orderSearchList: React.FC<listProps> = (props) => {
>
<Option value=''>发货方(全部)</Option>
{
shipperAddressList.map((item) => {
return <Option value={item.value}>{item.label}</Option>
shipperAddressList.map((item,index) => {
return <Option key={index} value={item.value}>{item.label}</Option>
})
}
</Select>
......@@ -432,8 +430,8 @@ const orderSearchList: React.FC<listProps> = (props) => {
onChange={(val) => handleChangeTime(val)}
>
{
TimeList.map((item) => {
return <Option value={item.value}>{item.label}</Option>
TimeList.map((item,index) => {
return <Option key={index} value={item.value}>{item.label}</Option>
})
}
</Select>
......@@ -443,8 +441,8 @@ const orderSearchList: React.FC<listProps> = (props) => {
onChange={(val) => handleChange('status',val)}
>
{
outSideStatusList.map((item) => {
return <Option value={item.value}>{item.label}</Option>
outSideStatusList.map((item,index) => {
return <Option key={index} value={item.value}>{item.label}</Option>
})
}
</Select>
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-28 14:01:19
* @LastEditTime: 2020-07-30 19:37:57
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -31,6 +31,7 @@ import {
import {PublicApi} from '@/services/api'
import styles from './templateForm.less';
import ReutrnEle from '@/components/ReturnEle'
import {PATTERN_MAPS} from '@/constants/regExp'
import ChinaImg from '../../../../../mockStatic/china.png'
import gou from '../../../../../mockStatic/gou.png'
import japenImg from '../../../../../mockStatic/japen.png'
......@@ -232,7 +233,6 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}}
x-component="Input"
x-component-props={{
placeholder: '',
addonAfter: "KG"
}}
......@@ -240,6 +240,10 @@ const diaLogForm: React.FC<ListProps> = (props) => {
addonBefore: ' ',
addonAfter: '内,'
}}
x-rules={{
pattern: PATTERN_MAPS.weight,
message:'数字类型,可保留3位小数'
}}
/>
<Field
name="price"
......@@ -255,6 +259,10 @@ const diaLogForm: React.FC<ListProps> = (props) => {
placeholder: '',
addonAfter: "元"
}}
x-rules={{
pattern: PATTERN_MAPS.money,
message:'数字类型,可保留2位小数'
}}
/>
</FormMegaLayout>
<FormMegaLayout inline>
......@@ -276,6 +284,10 @@ const diaLogForm: React.FC<ListProps> = (props) => {
addonBefore: '每增加',
addonAfter: '增加运费'
}}
x-rules={{
pattern: PATTERN_MAPS.weight,
message:'数字类型,可保留3位小数'
}}
/>
<Field
name="incrementPrice"
......@@ -291,6 +303,10 @@ const diaLogForm: React.FC<ListProps> = (props) => {
addonAfter: "元"
}}
x-rules={{
pattern: PATTERN_MAPS.money,
message:'数字类型,可保留2位小数'
}}
/>
</FormMegaLayout>
</FormMegaLayout>
......@@ -354,21 +370,42 @@ const diaLogForm: React.FC<ListProps> = (props) => {
console.log(e.target.value)
// actions.validate()
},
// validate: (value:any) => {
// return new Promise(resolve => {
// setTimeout(() => {
// resolve(value !== '57350' ? '验证码验证失败' : '123')
// }, 1000)
// })
// }
}}
x-rules={{
pattern: PATTERN_MAPS.weight,
message:'数字类型,可保留3位小数'
}}
/>
<Field
name="price"
x-component="Input"
type="number"
title="首费(元)"
x-rules={{
pattern: PATTERN_MAPS.money,
message:'数字类型,可保留2位小数'
}}
/>
<Field
name="incrementWeight"
x-component="Input"
type="number"
title="续件(件/KG)"
x-rules={{
pattern: PATTERN_MAPS.weight,
message:'数字类型,可保留3位小数'
}}
/>
<Field
name="incrementPrice"
x-component="Input"
type="number"
title="续费(元)"
x-rules={{
pattern: PATTERN_MAPS.money,
message:'数字类型,可保留2位小数'
}}
/>
<Field name="price" x-component="Input" type="number" title="首费(元)" />
<Field name="incrementWeight" x-component="Input" type="number" title="续件(件/KG)" />
<Field name="incrementPrice" x-component="Input" type="number" title="续费(元)" />
</Field>
</Field>
</Col>
......
......@@ -2,11 +2,14 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-29 15:55:43
* @LastEditTime: 2020-07-30 20:17:59
*/
import React, { Component, ReactNode, useRef, useState } from 'react'
import React, { Component, ReactNode, useRef, useState, useEffect } from 'react'
import { history } from 'umi'
import { Modal, Card, Button, Form, InputNumber, Radio, Popconfirm,Tooltip, Switch,Select, Input,Tag,Row,Col } from 'antd';
import {
Modal, Card, Button, Form, InputNumber, Radio,
Popconfirm, Tooltip, Switch, Select, Input, Tag, Row, Col, Space
} from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
......@@ -21,9 +24,10 @@ import ConfirmModal from '../components/confirmModal'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import {PublicApi} from '@/services/api'
import { PublicApi } from '@/services/api'
import statuStyle from '../colorTag'
import style from '../components/index.less'
const {Option} = Select
const { Option } = Select
const data = [
{
key: '1',
......@@ -56,7 +60,7 @@ export interface ListProps {
title?: React.ReactNode,
type: string
}
interface DiaLogParams{
interface DiaLogParams {
onCancel: Function
}
export interface ListType {
......@@ -121,52 +125,52 @@ const OrderList: React.FC<ListProps> = (props) => {
let [isSearch, setIsSearch] = useState<boolean>(false)
const [searchForm, setSearchForm] = useState({
searName: '',
buyer:'',//收货商
buyer: '',//收货商
dateSelect: '',
outSideStatus: '',
TimeRange: ''
})
const TimeList = [
{
label:'单据时间(全部)',value: ''
label: '单据时间(全部)', value: ''
},
{
label:'今天',value:1
label: '今天', value: 1
},
{
label:'一周内',value:2
label: '一周内', value: 2
},
{
label:'一个月内',value:3
label: '一个月内', value: 3
},
{
label:'三个月内',value:4
label: '三个月内', value: 4
},
{
label:'六个月内',value:5
label: '六个月内', value: 5
},
{
label:'一年内',value: 6
label: '一年内', value: 6
},
{
label:'一年前',value: 7
label: '一年前', value: 7
}
]
const outSideStatusList = [
{
label:'外部状态(全部)',value: ''
label: '外部状态(全部)', value: ''
},
{
label:'待提交',value: 1
label: '待提交', value: 1
},
{
label:'待确认',value: 2
label: '待确认', value: 2
},
{
label:'接受物流单',value: 3
label: '接受物流单', value: 3
},
{
label:'不接受物流单',value: 4
label: '不接受物流单', value: 4
}
]
const columns: ColumnType<any>[] = [
......@@ -175,6 +179,8 @@ const OrderList: React.FC<ListProps> = (props) => {
dataIndex: 'logisticsOrderNo',
align: 'center',
key: 'logisticsOrderNo',
render: (text: any, reconds: any) =>
<span className="commonPickColor" onClick={() => handleSee(reconds.id)}>{text}&nbsp;<EyeOutlined /></span>
},
{
title: '对应订单号',
......@@ -223,15 +229,18 @@ const OrderList: React.FC<ListProps> = (props) => {
align: 'center',
dataIndex: 'status',
key: 'status',
render: () => {
return (
<>
<Tag color="default">待提交</Tag>
<Tag color="processing">待确认</Tag>
<Tag color="green">接受物流单</Tag>
<Tag color="red">不接受物流单</Tag>
</>
)
render: (text: any, record: any) => {
let component: ReactNode = null
if (text == 3) {
component = <><span style={statuStyle.success}>接受物流单</span></>
} else if (text == 4) {
component = <><span style={statuStyle.warn}>不接受物流单</span></>
} else if (text == 2) {
component = <><span style={statuStyle.confirm}>待确认</span></>
} else if (text == 1) {
component = <><span style={statuStyle.default}>待提交</span></>
}
return component
}
},
{
......@@ -242,7 +251,6 @@ const OrderList: React.FC<ListProps> = (props) => {
return (
<>
<Button type='link' onClick={() => handleDialog(record.id)}>确认</Button>
<Button type='link' onClick={() => handleSee(record.id)}>查看</Button>
</>
)
}
......@@ -250,32 +258,26 @@ const OrderList: React.FC<ListProps> = (props) => {
];
// 模拟请求
const fetchData = (params: any) => {
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
// PublicApi.getLogisticsShipperAddressPage({ current: params.page, pageSize: params.rows }).then(res => {
const queryResult = data.find(v => v.key === params.keywords)
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data
PublicApi.getLogisticsOrderWaitConfirmPage({
...searchForm,
...params
}).then(res => {
resolve(res.data)
})
}, 1000)
// })
})
}
}
//生命周期
// useEffect(() => {
// effect
// return () => {
// cleanup
// }
// }, [input])
useEffect(() => {
return () => {
}
}, [])
const handleDialog = (id:any) => {
const handleDialog = (id: any) => {
setvisible(true)
}
......@@ -322,7 +324,7 @@ const fetchData = (params: any) => {
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{rowKey:'id'}}
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
......@@ -339,7 +341,7 @@ const fetchData = (params: any) => {
<Row>
<Col span={12}>
<Tooltip trigger={['focus']} placement='top'
title={props.type === '1'? '输入物流单号、订单号进行搜索':'输入物流单号、发货方进行搜索' }>
title={props.type === '1' ? '输入物流单号、订单号进行搜索' : '输入物流单号、发货方进行搜索'}>
<Input.Search
style={{ width: '232px' }}
value={searchForm.searName}
......@@ -348,24 +350,25 @@ const fetchData = (params: any) => {
onSearch={() => handleSearch}
/>
</Tooltip>
<Button className={style['filter-btn']} onClick={() => setIsSearch(isSearch = !isSearch) }>
<Button className={style['filter-btn']} onClick={() => setIsSearch(isSearch = !isSearch)}>
高级筛选{isSearch ? <UpOutlined /> : <DownOutlined />}
</Button>
<Button className={style.selectBtn} onClick={() => handleReset()}>重置</Button>
</Col>
</Row>
<Row style={{margin: '16px 0'}}>
<Row style={{ margin: '16px 0' }}>
{
isSearch &&
<Col>
<Space size={16}>
<Select
className={style.select}
value={searchForm.TimeRange}
onChange={(val) => setSearchForm({ ...searchForm, TimeRange: val })}
>
{
TimeList.map((item) => {
return <Option value={item.value}>{item.label}</Option>
TimeList.map((item,index) => {
return <Option key={index} value={item.value}>{item.label}</Option>
})
}
</Select>
......@@ -375,11 +378,12 @@ const fetchData = (params: any) => {
onChange={(val) => setSearchForm({ ...searchForm, outSideStatus: val })}
>
{
outSideStatusList.map((item) => {
return <Option value={item.value}>{item.label}</Option>
outSideStatusList.map((item,index) => {
return <Option key={index} value={item.value}>{item.label}</Option>
})
}
</Select>
</Space>
</Col>
}
</Row>
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-29 17:08:32
* @LastEditTime: 2020-07-30 17:37:44
*/
import React, { Component, useEffect, useRef, useState } from 'react'
import { Card, Row, Col, Tabs, Button, Input as SelectInput, Badge } from 'antd'
......@@ -233,7 +233,7 @@ const Deatail: React.FC<{}> = () => {
*/
useEffect(() => {
PublicApi.postLogisticsCompanyList().then(res => {
PublicApi.getLogisticsSelectListCompany().then(res => {
let list = []
res.data.forEach(item => {
list.push({value:item.id,label:item.name})
......@@ -241,7 +241,7 @@ const Deatail: React.FC<{}> = () => {
setCompanyList(list)
})
PublicApi.postLogisticsShipperAddressList().then(res => {
PublicApi.getLogisticsSelectListShipperAddress().then(res => {
let list = []
res.data.forEach(item => {
list.push({value:item.id,label:item.fullAddress})
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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