Commit 4f36f26e authored by LeeJiancong's avatar LeeJiancong

修复物流管理页面不显示问题,优化物流模板

parent abdcfd3d
......@@ -21,40 +21,40 @@ const LogisticsRoute = {
key: 'logistics',
routes: [
{
path: '/memberCenter/logisticsAbility/logistics/list/company',
path: '/memberCenter/logisticsAbility/logistics/company',
name: 'company',
component: '@/pages/logistics/list/company'
},
{
path: '/memberCenter/logisticsAbility/logistics/list/addCompany',
path: '/memberCenter/logisticsAbility/logistics/addCompany',
name: 'addCompany',
component: '@/pages/logistics/list/addCompany',
hideInMenu: true
},
//送货地址
{
path: '/memberCenter/logisticsAbility/logistics/list/deliveryAddress',
path: '/memberCenter/logisticsAbility/logistics/deliveryAddress',
name: 'deliveryAddress',
component: '@/pages/logistics/list/deliveryAddress'
},
{
path: '/memberCenter/logisticsAbility/logistics/list/addressForm',
path: '/memberCenter/logisticsAbility/logistics/addressForm',
name: 'addressForm',
component: '@/pages/logistics/list/components/addressForm',
hideInMenu: true
},
{
path: '/memberCenter/logisticsAbility/logistics/list/receivingAddress',
path: '/memberCenter/logisticsAbility/logistics/receivingAddress',
name: 'receivingAddress',
component: '@/pages/logistics/list/receivingAddress'
},
{
path: '/memberCenter/logisticsAbility/logistics/list/template',
path: '/memberCenter/logisticsAbility/logistics/template',
name: 'template',
component: '@/pages/logistics/list/template'
},
{
path: '/memberCenter/logisticsAbility/logistics/list/templateForm',
path: '/memberCenter/logisticsAbility/logistics/templateForm',
name: 'templateForm',
component: '@/pages/logistics/list/components/templateForm',
hideInMenu: true
......
EyePreview/*
/*
* @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-03 16:52:53
* @LastEditTime: 2020-08-19 10:52:37
*/
import React, { ReactNode, useRef } from 'react'
......@@ -20,8 +20,6 @@ import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableCon
import {PublicApi,CustomApi} from '@/services/api'
import EyePreview from '@/components/EyePreview'
import StatusSwitch from '@/components/StatusSwitch'
import { getCompanyList, delCompany,updateCompanyStatus } from '@/services/logistics/index'
const data = [
{
key: '1',
......@@ -76,7 +74,7 @@ const Company: React.FC<{}> = () => {
align: 'center',
key: 'name',
render: (text: any, record: any) => (
<EyePreview url={`/memberCenter/logisticsAbility/logistics/list/addCompany?id=${record.id}&preview=1`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/logisticsAbility/logistics/addCompany?id=${record.id}&preview=1`}>{text}</EyePreview>
)
},
{
......@@ -109,7 +107,7 @@ const Company: React.FC<{}> = () => {
<>
{ record.status === 0 ?
<>
<Button type='link' onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/list/addCompany?id=${record.id}`)}>编辑</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/addCompany?id=${record.id}`)}>编辑</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => handleDelete(record.id)}>
<Button type='link'>
删除
......@@ -139,7 +137,7 @@ const Company: React.FC<{}> = () => {
text: '新建',
icon: <PlusOutlined />,
handler: () => {
history.push('/memberCenter/logisticsAbility/logistics/list/addCompany')
history.push('/memberCenter/logisticsAbility/logistics/addCompany')
}
}
]
......@@ -157,7 +155,7 @@ const Company: React.FC<{}> = () => {
}
const handleSee = (id: number) => {
history.push(`/memberCenter/logisticsAbility/logistics/list/addCompany?id=${id}&isSee=true`)
history.push(`/memberCenter/logisticsAbility/logistics/addCompany?id=${id}&isSee=true`)
}
const confirm = () => {
......@@ -184,7 +182,7 @@ const Company: React.FC<{}> = () => {
formilyChilds={{
children: (
<>
<Button type="primary" onClick={() => history.push('/memberCenter/logisticsAbility/logistics/list/addCompany')}>
<Button type="primary" onClick={() => history.push('/memberCenter/logisticsAbility/logistics/addCompany')}>
新建 <PlusOutlined />
</Button>
</>
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-29 20:37:05
* @LastEditTime: 2020-08-19 10:53:33
*/
import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi'
......@@ -117,12 +117,12 @@ const EditableCell: React.FC<EditableCellProps> = ({
*/
const AddressList: React.FC<ListProps> = (props) => {
console.log(props)
const ref = useRef({})
const ref = useRef<any>({})
const [form] = Form.useForm();
const [table, setTable] = useState([])
const [editingKey, setEditingKey] = useState('');
const toEdit = (id: number) => {
history.push(`/memberCenter/logisticsAbility/logistics/list/addressForm?type=${props.type}&id=${id}`)
history.push(`/memberCenter/logisticsAbility/logistics/addressForm?type=${props.type}&id=${id}`)
};
const columns: ColumnType<any>[] = [
{
......@@ -246,7 +246,7 @@ const AddressList: React.FC<ListProps> = (props) => {
text: '新建',
icon: <PlusOutlined />,
handler: () => {
history.push('/logisticsAbility/logistics/list/addCompany')
history.push('/logisticsAbility/logistics/addCompany')
}
}
]
......@@ -280,7 +280,7 @@ const AddressList: React.FC<ListProps> = (props) => {
formilyChilds={{
children: (
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/list/addressForm?type=${props.type}&id=0`)}>新建</Button>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/addressForm?type=${props.type}&id=0`)}>新建</Button>
</>
)
}}
......
/*
EyePreview/*
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-03 11:19:53
* @LastEditTime: 2020-08-19 11:03:37
*/
import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi'
......@@ -18,6 +18,8 @@ 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 StatusSwitch from '@/components/StatusSwitch'
import EyePreview from '@/components/EyePreview'
import { PublicApi} from '@/services/api'
const data = [
......@@ -124,8 +126,11 @@ const Template: React.FC<ListProps> = (props) => {
{
title: '模板名称',
dataIndex: 'name',
align: 'center',
align: 'left',
key: 'name',
render: (text:any,record:any) => (
<EyePreview url={`/memberCenter/logisticsAbility/logistics/templateForm?id=${record.id}&isSee=${true}`}>{text}</EyePreview>
)
},
{
title: '计价方式',
......@@ -160,32 +165,21 @@ const Template: React.FC<ListProps> = (props) => {
align: 'center',
dataIndex: 'status',
key: 'status',
render: (_:any,record: any) => {
return (
<Button type="link" style={record.status === 1 ? { color: '#00B37A' } : { color: 'red' }}>{record.status === 1 ? '有效' : '无效'}
{record.status === 1 ? <PlayCircleOutlined /> : <PauseCircleOutlined />}
</Button>
)
}
render: (text: any, record: any) => (
<StatusSwitch fieldNames="status" handleConfirm={() => handleChangeStatus(record.id,record.status)} record={record}/>
)
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (_: any, record: any) => {
const status = record.status === 0?'启用':'停用'
const title = `确定要${status}吗?`
return (
<>
<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/templateForm?id=${record.id}`)}>编辑</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/templateForm?id=${record.id}`)}>编辑</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() =>handleDelete(record.id)}>
<Button type='link'>
删除
......@@ -193,7 +187,6 @@ const Template: React.FC<ListProps> = (props) => {
</Popconfirm>
</> : ''
}
<Button type='link' onClick={() => handleSee(record.id)}>查看</Button>
</>
)
}
......@@ -238,7 +231,7 @@ const Template: React.FC<ListProps> = (props) => {
}
]
const handleSee = (id: number) => {
history.push(`/memberCenter/logisticsAbility/logistics/list/templateForm?id=${id}&isSee=${true}`)
history.push(`/memberCenter/logisticsAbility/logistics/templateForm?id=${id}&isSee=${true}`)
}
const confirm = () => {
......@@ -265,7 +258,7 @@ const Template: React.FC<ListProps> = (props) => {
formilyChilds={{
children: (
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/list/templateForm?id=0`)}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/logisticsAbility/logistics/templateForm?id=0`)}>
新建
</Button>
</>
......
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