Commit 451ebbcd authored by tjy's avatar tjy

merge

parents 1648706a 0b3876cf
import React,{useState,useEffect,useRef, ReactNode} from 'react';
import { Card, Button} from 'antd'
import {PageHeaderWrapper} from '@ant-design/pro-layout'
import {StandardTable} from 'god'
import React, { useState, useEffect, useRef, ReactNode } from 'react';
import { Card, Button, Row, Col, Tooltip, Input, Select } from 'antd'
import { UpOutlined, DownOutlined } from '@ant-design/icons'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
interface listProps{
title?:string,
fromPage?:string | number
let { Option } = Select
interface listProps {
title?: string,
fromPage?: string | number
}
const data = [
{
key:'12',
oredrNo:'WL 52653581',
key: '12',
oredrNo: 'WL 52653581',
status: 0
}
]
const statuStyle = {
default:{
padding:'2px 5px',
background:'rgba(244,245,247,1)',
borderRadius:'4px'
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'
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'
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'
warn: {
color: '#E63F3B',
padding: '2px 5px',
background: 'rgba(255,235,230,1)',
borderRadius: '4px'
}
}
......@@ -59,84 +61,91 @@ const fetchData = (params: any) => {
}
const orderSearchList: React.FC<listProps> = (props) => {
const ref = useRef({})
const [selectRow,setSelectRow] = useState<Item[]>([])
const [selectedRowKeys,setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<Item[]>([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
let [isSearch, setIsSearch] = useState<boolean>(false)
const [searchForm, setSearchForm] = useState({
searName: '',
dateSelect: '',
outSideStatus: '',
TimeRange: ''
})
const handleSee = () => {
}
const columns: ColumnType<any>[] = [
{
title:'物流单号',
align:'left',
dataIndex:'oredrNo',
key:'oredrNo'
title: '物流单号',
align: 'left',
dataIndex: 'oredrNo',
key: 'oredrNo'
},
{
title:'对应订单号',
align:'center',
dataIndex:'key13',
key:'key13'
title: '对应订单号',
align: 'center',
dataIndex: 'key13',
key: 'key13'
},
{
title:'收货方',
align:'left',
dataIndex:'key12',
key:'key12'
title: '收货方',
align: 'left',
dataIndex: 'key12',
key: 'key12'
},
{
title:'物流单号',
align:'center',
dataIndex:'key11',
key:'key11'
title: '物流单号',
align: 'center',
dataIndex: 'key11',
key: 'key11'
},
{
title:'总箱数',
align:'center',
dataIndex:'key222',
key:'key222'
title: '总箱数',
align: 'center',
dataIndex: 'key222',
key: 'key222'
},
{
title:'总重量',
align:'center',
dataIndex:'key222',
key:'key222'
},
title: '总重量',
align: 'center',
dataIndex: 'key222',
key: 'key222'
},
{
title:'总体积',
align:'center',
dataIndex:'key22',
key:'key22'
},
title: '总体积',
align: 'center',
dataIndex: 'key22',
key: 'key22'
},
{
title:'单据时间',
align:'left',
dataIndex:'key2',
key:'key2'
title: '单据时间',
align: 'left',
dataIndex: 'key2',
key: 'key2'
},
{
title:'外部状态',
align:'center',
dataIndex:'status',
key:'status',
render:(_:any,reconds) =>{
let component:ReactNode = null
if(reconds.status == 0){
title: '外部状态',
align: 'center',
dataIndex: 'status',
key: 'status',
render: (_: any, reconds) => {
let component: ReactNode = null
if (reconds.status == 0) {
component = <><span style={statuStyle.success}>接受物流</span></>
}else if(reconds.status == 2){
} else if (reconds.status == 2) {
component = <><span style={statuStyle.warn}>不接受物流单</span></>
}else if(reconds.status == 3) {
} else if (reconds.status == 3) {
component = <><span style={statuStyle.confirm}>待确认</span></>
}else if(reconds.status == 4) {
} else if (reconds.status == 4) {
component = <><span style={statuStyle.default}>请提交</span></>
}
return component
}
},
{
title:'操作',
align:'center',
dataIndex:'option',
render: (_:any,reconds) => {
title: '操作',
align: 'center',
dataIndex: 'option',
render: (_: any, reconds) => {
return (
<Button type="link" onClick={handleSee}>查看</Button>
)
......@@ -145,25 +154,95 @@ const orderSearchList: React.FC<listProps> = (props) => {
]
const rowSelection = {
const rowSelection = {
}
const handleSearch = () => {
}
const handleReset = () => {
for (let key in searchForm) {
searchForm[key] = ''
}
setSearchForm({ ...searchForm })
}
return (
<PageHeaderWrapper title='快递单查询'>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
formAlign='left'
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row"
columns={columns}
currentRef={ref}
formAlign='left'
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row"
controlRender={
<>
<Row>
<Col span={12}>
<Tooltip trigger={['focus']} placement='top' title='输入物流单号、发货方进行搜索'>
<Input.Search
style={{ width: '232px' }}
value={searchForm.searName}
placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
onSearch={() => handleSearch}
/>
</Tooltip>
<Button onClick={() => setIsSearch(isSearch = !isSearch) }>
高级筛选{isSearch ? <UpOutlined /> : <DownOutlined />}
</Button>
<Button onClick={() => handleReset()}>重置</Button>
</Col>
</Row>
<Row>
{
isSearch &&
<Col>
<Select
value={searchForm.outSideStatus}
onChange={(val) => setSearchForm({ ...searchForm, outSideStatus: val })}
>
<Option value=''>收货方(全部)</Option>
<Option value='1'>待审核</Option>
<Option value='2'>审核通过</Option>
<Option value='3'>审核不通过</Option>
</Select>
<Select
value={searchForm.TimeRange}
onChange={(val) => setSearchForm({ ...searchForm, TimeRange: val })}
>
<Option value=''>单据时间</Option>
<Option value='1'>今天</Option>
<Option value='2'>一周内</Option>
<Option value='3'>一个月内</Option>
<Option value='4'>三个月内</Option>
<Option value='5'>六个月内</Option>
<Option value='6'>一年内</Option>
<Option value='7'>一年前</Option>
</Select>
<Select
value={searchForm.outSideStatus}
onChange={(val) => setSearchForm({ ...searchForm, outSideStatus: val })}
>
<Option value=''>外部状态(全部)</Option>
<Option value='1'>待审核</Option>
<Option value='2'>审核通过</Option>
<Option value='3'>审核不通过</Option>
</Select>
</Col>
}
</Row>
</>
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
}
orderSearchList.defaultProps = {
}
......
.ant-input-group-addon {
padding: 0;
}
.ant-input-group-addon{
padding: 0;
}
\ No newline at end of file
This diff is collapsed.
/*
* @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-18 15:12:44
* @LastEditTime: 2020-07-22 11:07:17
*/
import React, { ReactNode, useRef } from 'react'
import { history } from 'umi'
import { Button, Popconfirm, Card } from 'antd'
import { Button, Popconfirm, Card, message } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {
PlusOutlined,
......@@ -17,6 +17,8 @@ import {
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import {PublicApi,CustomApi} from '@/services/api'
import { getCompanyList, delCompany,updateCompanyStatus } from '@/services/logistics/index'
const data = [
{
......@@ -38,16 +40,12 @@ const data = [
]
// 模拟请求
const fetchData = (params: any) => {
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords)
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data
})
}, 1000)
PublicApi.getLogisticsCompanyPage({ current: params.page, pageSize: params.rows }).then(res => {
resolve(res.data)
})
})
}
......@@ -57,21 +55,24 @@ const Company: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'key',
dataIndex: 'id',
align: 'center',
key: 'key',
key: 'id',
},
{
title: '物流公司编码/平台会员ID',
align: 'center',
dataIndex: 'required',
key: 'required',
dataIndex: 'memberId',
key: "memberId",
render: (value: any, recond: any) =>
<>{recond.memberId ? recond.memberId : recond.code}</>
},
{
title: '属性名称',
dataIndex: 'attrName',
dataIndex: 'name',
align: 'center',
key: 'attrName',
key: 'name',
render: (text: any, record: any) => <span className="commonPickColor" onClick={() => handleSee(record)}>{text}&nbsp;<EyeOutlined /></span>
},
{
......@@ -113,13 +114,28 @@ const Company: React.FC<{}> = () => {
dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => {
const status = record.status === 0?'启用':'停用'
const title = `确定要${status}吗?`
return (
<>
<Button type='link'>启用</Button>
{
record.status === 0 ? <><Button type='link'>编辑</Button><Button type='link'>删除</Button></> : ''
}
<Button type='link'>查看</Button>
<Popconfirm title={title} okText="是" cancelText="否" onConfirm={() => handleChangeStatus(record.id,record.status)}>
<Button type='link'>
{ record.status === 0?'启用':'停用'}
</Button>
</Popconfirm>
{ record.status === 0 ?
<>
<Button type='link' onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/list/addCompany?id=${record.id}`)}>编辑</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => handleDelete(record.id)}>
<Button type='link'>
删除
</Button>
</Popconfirm>
</>
:''}
<Button type='link' onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/list/addCompany?id=${record.id}&isSee=true`)}>查看</Button>
</>
)
}
......@@ -135,6 +151,7 @@ const Company: React.FC<{}> = () => {
}
]
const searchBarActions: IButtonFilter[] = [
{
type: 'primary',
......@@ -145,6 +162,24 @@ const Company: React.FC<{}> = () => {
}
}
]
const handleDelete = (id: any) => {
PublicApi.postLogisticsCompanyDelete({ id: id }).then(res => {
if (res.code === 1000) {
message.success(res.message)
ref.current.reload()
}
})
}
const handleChangeStatus = (id:any,status:any) => {
let _status = status == 0 ? 1: 0
PublicApi.postLogisticsCompanyEnable({id:id,status:_status}).then(res => {
if(res.code === 1000){
message.success(res.message)
console.log(ref)
ref.current.reload()
}
})
}
const handleSee = (record: any) => {
console.log('see')
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-18 17:48:11
* @LastEditTime: 2020-07-22 11:47:39
*/
import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi'
......@@ -18,7 +18,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
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'
const data = [
{
key: '1',
......@@ -45,20 +45,7 @@ const data = [
]
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
resolve(data)
// const queryResult = data.find(v => v.key === params.keywords)
// setTimeout(() => {
// resolve({
// code: 200,
// message: '',
// data: queryResult ? [queryResult] : data
// })
// }, 1000)
})
}
// const fetchData = (param: any) => {
// return new Promise((resolve) => {
// let reqParam = {
......@@ -153,7 +140,7 @@ const AddressList: React.FC<ListProps> = (props) => {
key: 'address',
render: (_: any, record: any) => (
<>
{record.address}
{record.fullAddress}
</>
)
},
......@@ -166,14 +153,14 @@ const AddressList: React.FC<ListProps> = (props) => {
{
title: '手机号码',
align: 'center',
dataIndex: 'phone',
key: 'phone',
dataIndex: 'phoneNO',
key: 'phoneNO',
},
{
title: '电话号码',
align: 'center',
dataIndex: 'tel',
key: 'tel',
dataIndex: 'telNO',
key: 'telNO',
},
{
title: '是否默认',
......@@ -210,6 +197,21 @@ const AddressList: React.FC<ListProps> = (props) => {
}
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
if(props.type === '1'){//发货
PublicApi.getLogisticsShipperAddressPage({ current: params.page, pageSize: params.rows }).then(res => {
resolve(res.data)
})
}else{
PublicApi.getLogisticsReceiverAddressPage({ current: params.page, pageSize: params.rows }).then(res => {
resolve(res.data)
})
}
})
}
//生命周期
// useEffect(() => {
// effect
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-18 15:58:56
* @LastEditTime: 2020-07-22 11:23:30
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -28,6 +28,7 @@ import {
MegaLayout, Input, Switch, Select, FormMegaLayout, FormTab,
Radio, ArrayTable, ArrayCards, Transfer
} from '@formily/antd-components'
import {PublicApi} from '@/services/api'
import styles from './templateForm.less';
import ReutrnEle from '@/components/ReturnEle'
import ChinaImg from '../../../../../mockStatic/china.png'
......
/*
* @Author: LeeJiancong
* @Date: 2020-07-22 09:54:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-22 10:23:38
*/
import * as Api from './index'
import request from '@/utils/request'
/**
* 可在这里写入自定义的接口
*/
export const CustomApi = {}
export const CustomApi = {
}
// 公共的接口,从yapi拉下
export const PublicApi = Api
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* @Author: LeeJiancong
* @Date: 2020-07-13 16:33:05
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-20 17:02:09
*/
declare namespace LogisticsAPI {
/**
* @description: 只有基础参数
* @param {type} current ;pageSize
* @return:
*/
export interface justBaseParams{
current: number,
pageSize: number
}
//删除id
export interface delID{
id: number| string
}
//查询id
export interface detailID{
id: number
}
//添加 || 编辑
export interface CompanyItem{
id?: number,
memberId ?: number,
name: string,
code?:string | number,
cooperateType: number,
remark: string
}
export interface CompanyStatus{
id: number,
status: number | string
}
}
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-07-13 16:33:16
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-20 17:14:20
*/
import request from '@/utils/request';
const prefix = ''
/**
* @description 物流公司列表
* @param
*/
export async function getCompanyList(params: LogisticsAPI.justBaseParams) {
return request('/logistics/company/page', {
method: 'get',
prefix,
params//get请求 不用写 data: params这样形式
})
}
/**
* @description: 新增公司
* @param {type}
* @return:
*/
export async function addCompany(params: LogisticsAPI.CompanyItem){
return request('/logistics/company/add',{
method: 'post',
prefix,
data: params
})
}
/**
* @description: 编辑公司
* @param {type}
* @return:
*/
export async function updateCompany(params: LogisticsAPI.CompanyItem){
return request('/logistics/company/update',{
method: 'post',
prefix,
data: params
})
}
/**
* @description: 删除公司
* @param {type}
* @return:
*/
export async function delCompany(params: LogisticsAPI.delID){
return request('/logistics/company/delete',{
method: 'post',
prefix,
data: params
})
}
export async function getCompanyDetail(params: LogisticsAPI.delID){
return request('/logistics/company/get',{
method: 'get',
prefix,
params
})
}
/**
* @description: 公司状态
* @param {type}
* @return:
*/
export async function updateCompanyStatus(params: LogisticsAPI.CompanyStatus){
return request('/logistics/company/enable',{
method: 'post',
prefix,
data: params
})
}
/**
* @description: 物流模板列表
* @param {type}
* @return:
*/
export async function freightTemplateList(params: LogisticsAPI.justBaseParams){
return request('/logistics/freightTemplate/page',{
method: 'post',
prefix,
data: params
})
}
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