Commit 5383ca73 authored by LeeJiancong's avatar LeeJiancong

运费模板对接完成

parent b60cfb09
This diff is collapsed.
......@@ -116,7 +116,18 @@ const LogisticsRoute = {
name: 'orderResultDeatil',
component: '@/pages/logistics/components/orderSearchDetail',
hideInMenu: true
}
},
{
path: '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList',
name: 'toOrderComfirmList',
component: '@/pages/logistics/logisticsResult/toOrderComfirmList',
},
{//待确认详情处理
path: '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmDeatil',
name: 'orderResultDeatil',
component: '@/pages/logistics/components/orderSearchDetail',
hideInMenu: true
},
]
}
......
......@@ -3,6 +3,7 @@
"scripts": {
"api": "god-ytt",
"scripts:build": "node scripts/run",
"start:dev":"umi dev",
"start:analyze": "ANALYZE=1 umi dev",
"clean": "rimraf node_modules",
"start": "yarn scripts:build && umi dev",
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-23 14:02:07
* @LastEditTime: 2020-07-27 11:29:16
*/
export default {
......@@ -83,5 +83,6 @@ export default {
'menu.logisticsAbility.logisticsResult': '物流单处理',
'menu.logisticsAbility.logisticsResult.orderResultSearchList': '物流单查询',
'menu.logisticsAbility.logisticsResult.orderResultDeatil': '物流单详情'
'menu.logisticsAbility.logisticsResult.orderResultDeatil': '物流单详情',
'menu.logisticsAbility.logisticsResult.toOrderComfirmList': '待确认物流单',
};
\ No newline at end of file
import React, { Component, useState, useEffect } from 'react';
import { Modal, Button, Form } from 'antd'
import {
SchemaForm, SchemaMarkupField as Field,
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { values } from 'mobx';
export interface Params {
dialogVisible: boolean,
onCancel: Function,
dontReceive?: boolean //默认展示
}
const actions = createFormActions()
const {onFieldChange$} = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props) => {
console.log(props.dialogVisible)
const handleCancel = () => {
}
const handletOk = (values:any) => {
console.log(values)
actions.submit()
props.onCancel()
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('radio').subscribe(({value}) => {
setFieldState('remarkOption',state => {
if(value == 1){
state.visible = false
}else{
state.visible = true
}
})
})
}
return (
<>
<Modal
title='单据确认'
width={800}
visible={props.dialogVisible}
onOk={handletOk}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => actions.reset()}
okText='确定'
cancelText='取消'
>
<SchemaForm components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)
}
>
<Field
enum={
[
{ label: '接受物流单', value:1 },
{ label: '不接受物流单', value:2 }
]}
name='radio'
required
x-component="Radio"
/>
{props.dontReceive &&
<FormMegaLayout name='remarkOption' label='不接受原因' full required wrapperWidth={570} labelCol={2} labelAlign="top">
<Field
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules={value => {
if (value.length > 60) {
return {
type: 'warning',
message: '原因最多60个汉字'
}
}
}
}
/>
</FormMegaLayout>
}
</SchemaForm>
</Modal>
</>
)
}
comfirmDialog.defaultProps = {
dontReceive: true
}
export default comfirmDialog
\ No newline at end of file
......@@ -4,6 +4,8 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { EyeOutlined, ClockCircleOutlined, UpOutlined, DownOutlined, StopOutlined, CheckSquareOutlined } from '@ant-design/icons'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import ConfirmModal from './confirmModal'
import {history} from 'umi'
import style from './index.less'
const { Step } = Steps
const data = [
......@@ -20,6 +22,8 @@ const data = [
const detailInfo: React.FC<{}> = () => {
const ref = useRef({})
let [isextraOption, setIsextraOption] = useState(false)
let [visible, setvisible] = useState(false)
const [detailData, setDetailData] = useState<any>({
step: {
current: 0,
......@@ -168,13 +172,15 @@ const detailInfo: React.FC<{}> = () => {
},
];
//在这做逻辑判断 判断路由 是由哪个页面进来的
// useEffect(() => {
// effect
// return () => {
// cleanup
// }
// }, [])
// 模拟请求
useEffect(() => {
let pathname = history.location.pathname
if(pathname === '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmDeatil'){
setIsextraOption(true)
}
return () => {
}
}, [])
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords);
......@@ -203,12 +209,13 @@ const detailInfo: React.FC<{}> = () => {
</>
}
extra={
isextraOption &&
<>
<Button>
<Button onClick={() => setvisible(true)}>
<StopOutlined />
不接受物流单
</Button>
<Button className={style['saveBtn']}>
<Button onClick={() => setvisible(true)} className={style['saveBtn']}>
<CheckSquareOutlined />
接受物流单
</Button>
......@@ -409,6 +416,10 @@ const detailInfo: React.FC<{}> = () => {
</Col>
</Row>
<ConfirmModal
dialogVisible={visible}
onCancel={() => setvisible(false)}
/>
</PageHeaderWrapper>
)
......
......@@ -122,8 +122,13 @@ const orderSearchList: React.FC<listProps> = (props) => {
TimeRange: ''
})
const handleSee = () => {
props.type === '1'? history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil`):
if(props.type === '1'){
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil`)
}else if(props.type === '2'){
history.push('/memberCenter/logisticsAbility/logisticsResult/orderResultDeatil')
}else {
history.push(' /memberCenter/logisticsAbility/logisticsResult/toOrderComfirmDeatil')
}
}
const columns: ColumnType<any>[] = [
{
......
/*
* @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24 17:54:55
* @LastEditTime: 2020-07-27 11:38:38
*/
import React, { ReactNode, useRef } from 'react'
......@@ -191,6 +191,7 @@ const Company: React.FC<{}> = () => {
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{rowKey:'id'}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24 20:42:21
* @LastEditTime: 2020-07-27 17:01:52
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -81,6 +81,9 @@ const diaLogForm: React.FC<ListProps> = (props) => {
const [areaCode, setAreaCode] = useState<number>(null)
const [Options, setOptions] = useState([])
const [state, setState] = useState({ editable: true })
const [provinceName,setProvinceName] = useState('')
const [cityName, setCityName] = useState('')
const [districtName, setDistrictName] = useState('')
const [headerTitle, setHeaderTitle] = useState('')
const [provinceList, setProvinceList] = useState([])
const [cityList, setCityList] = useState([])
......@@ -95,7 +98,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
)
}
/**
* @description:
* @description: Form保存
* @param {type}
* @return:
*/
......@@ -107,6 +110,12 @@ const diaLogForm: React.FC<ListProps> = (props) => {
value.isDefault = values.isDefault ? 1 : 0
if (type == 1) {
if (id == 0) {
value.provinceCode = value.provinceCode.split('-').length > 1 ? value.provinceCode.split('-')[0] : value.provinceCode
value.cityCode = value.cityCode.split('-').length > 1 ? value.cityCode.split('-')[0] : value.cityCode
value.districtCode = value.districtCode.split('-').length > 1 ? value.districtCode.split('-')[0] : value.districtCode
value.provinceName = provinceName
value.cityName = cityName
value.districtName = districtName
PublicApi.postLogisticsShipperAddressAdd(value).then(res => {
if (res.code == 1000) {
}
......@@ -180,7 +189,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
PublicApi.getWarehouseAreaByPcodeAll({ pcode: '100000' }).then(res => {
let list = []
res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: item.code })
list.push({ label: item.name, value: `${item.code}-${item.name}` })
// list.push({ label: item.name, value: item.code })
})
setProvinceList(list)
})
......@@ -236,37 +246,48 @@ const diaLogForm: React.FC<ListProps> = (props) => {
*/
const useAreaEffects = () => {
const { setFieldState } = createFormActions()
onFieldValueChange$('provinceId').subscribe(({ value }) => {
onFieldValueChange$('provinceCode').subscribe(({ value }) => {
console.log(value)
setFieldState('districtId', state => {
setFieldState('districtCode', state => {
state.value = ''
})
setFieldState('*(cityId)', state => {
let name = value&& value.split('-').length > 1 ? value.split('-')[1] : ''
setProvinceName(name)
setFieldState('*(cityCode)', state => {
state.value = ''
let list = []
PublicApi.getWarehouseAreaByPcodeAll({ pcode: value }).then(res => {
let pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value
PublicApi.getWarehouseAreaByPcodeAll({ pcode: pcode }).then(res => {
res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: item.code })
// list.push({ label: item.name, value: item.code })
list.push({ label: item.name, value: `${item.code}-${item.name}` })
})
// setCityList(list)
})
FormPath.setIn(state, 'props.enum', list)
})
})
onFieldValueChange$('cityId').subscribe(({ value }) => {
onFieldValueChange$('cityCode').subscribe(({ value }) => {
console.log(value)
setFieldState('*(districtId)', state => {
let name = value && value.split('-').length > 1 ? value.split('-')[1] : ''
setCityName(name)
setFieldState('*(districtCode)', state => {
state.value = ''
let list = []
PublicApi.getWarehouseAreaByPcodeAll({ pcode: value }).then(res => {
let pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value
PublicApi.getWarehouseAreaByPcodeAll({ pcode: pcode }).then(res => {
res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: item.code })
// list.push({ label: item.name, value: item.code })
list.push({ label: item.name, value: `${item.code}-${item.name}` })
})
})
FormPath.setIn(state, 'props.enum', list)
})
})
onFieldValueChange$('districtCode').subscribe(({ value }) => {
let name = value&& value.split('-').length > 1 ? value.split('-')[1] : ''
setDistrictName(name)
})
}
return (
......@@ -281,9 +302,9 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<SchemaForm editable={state.editable}
initialValues={{
// areaCode: areaCode
// provinceId: '',
// cityId:'111120',
// districtId:'121212'
// provinceCode: '',
// cityCode:'111120',
// districtCode:'121212'
}}
actions={actions}//要传递
components={{
......@@ -324,7 +345,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
x-component="Select"
enum={provinceList}
required
name="provinceId"
name="provinceCode"
x-component-props={{
placeholder: '-省份/直辖市-'
}}
......@@ -334,7 +355,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
x-component="Select"
enum={cityList}
required
name="cityId"
name="cityCode"
x-component-props={{
placeholder: '-市-'
}}
......@@ -344,7 +365,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
x-component="Select"
enum={selectList}
required
name="districtId"
name="districtCode"
x-component-props={{
placeholder: '-区-'
}}
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24 20:10:56
* @LastEditTime: 2020-07-27 19:11:21
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -84,7 +84,7 @@ const dropdownRender = () => {
const diaLogForm: React.FC<ListProps> = (props) => {
const [provinceList, setProvinceList] = useState([])
const [state, setState] = useState({ editable: true })
const [editable, setEditable] = useState<boolean>(true)
const [headerTitle, setHeaderTitle] = useState('')
const [select, setSelect] = useState<countryItem>({
key: 'cn',
......@@ -118,6 +118,9 @@ const diaLogForm: React.FC<ListProps> = (props) => {
let _title = history.location.query.isSee ? '查看':
Number(id) === 0? '新建':'编辑'
if( history.location.query.isSee){
setEditable(false)
}
// console.log(id,typeof id,history.location.query.isSee,typeof history.location.query.isSee)
setHeaderTitle(`${_title}运费模板`)
PublicApi.getWarehouseAreaByPcodeAll({ pcode: '100000' }).then(res => {
......@@ -181,6 +184,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
backIcon={<ReutrnEle description="返回" />}
title={headerTitle}
extra={
editable &&
<Button type="primary" onClick={() => actions.submit()}> 保存</Button>
//外层调用form API
}
......@@ -188,7 +192,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<Card>
<Row >
<Col span={24}>
<SchemaForm editable={state.editable}
<SchemaForm editable={editable}
actions={actions}//要传递
initialValues={{
// provic: '广东省',
......
This diff is collapsed.
......@@ -2,11 +2,11 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-23 13:54:05
* @LastEditTime: 2020-07-27 11:26:07
*/
import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi'
import { Modal, Card, Button, Form, InputNumber, Radio, Popconfirm, Switch, Input } from 'antd';
import { Modal, Card, Button, Form, InputNumber, Radio, Popconfirm, Switch, Input,Tag } from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
......@@ -43,19 +43,6 @@ const data = [
address: '地址32'
},
]
// const fetchData = (param: any) => {
// return new Promise((resolve) => {
// let reqParam = {
// ...param
// }
// getUserInfoList(reqParam).then(res => {
// resolve(res.data)
// })
// })
// }
interface Item {
key: string
}
......@@ -115,7 +102,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
* @param {type}
* @return:
*/
const AddressList: React.FC<ListProps> = (props) => {
const OrderList: React.FC<ListProps> = (props) => {
console.log(props)
const ref = useRef({})
const [form] = Form.useForm();
......@@ -128,49 +115,68 @@ const AddressList: React.FC<ListProps> = (props) => {
};
const columns: ColumnType<any>[] = [
{
title: '发货人姓名',
dataIndex: 'shipperName',
title: '物流单号',
dataIndex: 'logisticsOrderNo',
align: 'center',
key: 'shipperName',
key: 'logisticsOrderNo',
},
{
title: '发货地址',
title: '对应订单号',
align: 'left',
dataIndex: 'address',
key: 'address',
render: (_: any, record: any) => (
<>
{record.fullAddress}
</>
)
dataIndex: 'invoicesNo',
key: 'invoicesNo'
},
{
title: '邮编',
dataIndex: 'code',
title: '物流服务商',
dataIndex: 'companyName',
align: 'center',
key: 'code'
key: 'companyName'
},
{
title: '手机号码',
title: '收货方',
align: 'center',
dataIndex: 'phoneNO',
key: 'phoneNO',
dataIndex: 'receiverName',
key: 'receiverName',
},
{
title: '电话号码',
title: '总箱数',
align: 'center',
dataIndex: 'telNO',
key: 'telNO'
dataIndex: 'totalCarton',
key: 'totalCarton'
},
{
title: '是否默认',
title: '总重量',
align: 'center',
dataIndex: 'isDefault',
key: 'isDefault',
render: (_: any, record: any) =>
<Switch size='small' disabled defaultChecked={record.isDefault == 0 ? false : true}
/>,
dataIndex: 'totalWeight',
key: 'totalWeight'
},
{
title: '总体积',
align: 'center',
dataIndex: 'totalVolume',
key: 'totalVolume'
},
{
title: '单据时间',
align: 'center',
dataIndex: 'invoicesTime',
key: 'invoicesTime'
},
{
title: '外部状态',
align: 'center',
dataIndex: 'status',
key: 'status',
render: () => {
return (
<>
<Tag color="default">待提交</Tag>
<Tag color="processing">待确认</Tag>
<Tag color="green">接受物流单</Tag>
<Tag color="red">不接受物流单</Tag>
</>
)
}
},
{
title: '操作',
......@@ -179,7 +185,7 @@ const AddressList: React.FC<ListProps> = (props) => {
render: (_: any, record: any) => {
return (
<>
<Button type='link'>启用</Button>
{
record.status === 0 ?
<><Button type="link" onClick={() => edit(record)}>编辑</Button>
......@@ -190,6 +196,7 @@ const AddressList: React.FC<ListProps> = (props) => {
</Popconfirm>
</> : ''
}
<Button type='link'>提交</Button>
<Button type='link'>查看</Button>
</>
)
......@@ -229,26 +236,6 @@ const fetchData = (params: any) => {
const handleDelete = () => {
console.log('delete')
}
const search: IFormFilter[] = [
{
type: 'Input',
value: 'keywords',
col: 4,
placeHolder: '输入属性名称'
}
]
const searchBarActions: IButtonFilter[] = [
{
type: 'primary',
text: '新建',
icon: <PlusOutlined />,
handler: () => {
history.push('/logisticsAbility/logistics/list/addCompany')
}
}
]
const handleSee = (record: any) => {
console.log('see')
}
......@@ -286,7 +273,7 @@ const fetchData = (params: any) => {
</PageHeaderWrapper>
)
}
AddressList.defaultProps = {
OrderList.defaultProps = {
}
export default AddressList
\ No newline at end of file
export default OrderList
\ No newline at end of file
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