Commit 6b3a0258 authored by 前端-许佳敏's avatar 前端-许佳敏
parents f8d8c2ff ed7914cf
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
# mockStatic # mockStatic
/.idea /.idea
src/services/index.ts
config/base.config.json config/base.config.json
/src/services/index.ts /src/services/index.ts
......
.btn-wrap .ant-input-group .ant-input-group-addon { .selectBtn {
padding: 0 !important;
}
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .ant-input-group-wrapper .ant-input-wrapper .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .selectBtn .ant-input-wrapper .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .ant-input-group-wrapper .ant-input-group .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .selectBtn .ant-input-group .ant-input-group-addon {
padding: 0 !important; padding: 0 !important;
} }
.btn-wrap{ .selectBtn{
.ant-input-group{
.ant-input-group-addon{
padding: 0 !important; padding: 0 !important;
}
.ant-form-item-control{
.ant-form-item-control-input{
.ant-form-item-control-input-content{
.ant-input-group-wrapper, .selectBtn{
.ant-input-wrapper ,.ant-input-group{
.ant-input-group-addon{
padding: 0 !important;
}
}
}
} }
} }
} }
\ No newline at end of file
...@@ -69,7 +69,7 @@ const { Option } = Select; ...@@ -69,7 +69,7 @@ const { Option } = Select;
const defaultValue = 'lucy' const defaultValue = 'lucy'
const company: React.FC<{}> = () => { const company: React.FC<{}> = () => {
//hook只能写在函数组件的顶级作用域 //hook只能写在函数组件的顶级作用域
const ref = useRef({}) const ref = useRef<any>({})
const [menuForm] = Form.useForm(); const [menuForm] = Form.useForm();
const [headerTitle, setHeaderTitle] = useState('新建物流公司') const [headerTitle, setHeaderTitle] = useState('新建物流公司')
const [Code, setCode] = useState('') const [Code, setCode] = useState('')
...@@ -224,7 +224,7 @@ const company: React.FC<{}> = () => { ...@@ -224,7 +224,7 @@ const company: React.FC<{}> = () => {
} }
]} ]}
> >
<Input className={style['btn-wrap']} disabled maxLength={20} addonAfter={selectBtn}/> <Input className={style['selectBtn']} disabled maxLength={20} addonAfter={selectBtn}/>
</Form.Item> </Form.Item>
: :
<Form.Item <Form.Item
......
/* /*
* @Date: 2020-07-13 15:01:40 * @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 10:06:44 * @LastEditTime: 2020-08-03 16:52:53
*/ */
import React, { ReactNode, useRef } from 'react' import React, { ReactNode, useRef } from 'react'
...@@ -50,7 +50,7 @@ const fetchData = (params?: any) => { ...@@ -50,7 +50,7 @@ const fetchData = (params?: any) => {
} }
const Company: React.FC<{}> = () => { const Company: React.FC<{}> = () => {
const ref = useRef({}) const ref = useRef<any>({})
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55 * @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-28 10:56:07 * @LastEditTime: 2020-08-03 17:59:56
*/ */
import React, { Component, useState, useEffect } from 'react'; import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom'
...@@ -175,7 +175,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -175,7 +175,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
setOptions(TelCodeList) setOptions(TelCodeList)
}) })
const getAllCode = setTimeout(()=> { const getAllCode = setTimeout(()=> {
PublicApi.getWarehouseAreaByPcodeAll({ pcode: '100000' }).then(res => { PublicApi.getManageAreaByPcodeAll({ pcode: '100000' }).then(res => {
let list = [] let list = []
res.data.forEach((item: any, index: number) => { res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: `${item.code}-${item.name}` }) list.push({ label: item.name, value: `${item.code}-${item.name}` })
...@@ -259,7 +259,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -259,7 +259,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
state.value = '' state.value = ''
let list = [] let list = []
let pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value let pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value
PublicApi.getWarehouseAreaByPcodeAll({ pcode: pcode }).then(res => { PublicApi.getManageAreaByPcodeAll({ pcode: pcode }).then(res => {
res.data.forEach((item: any, index: number) => { 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}` }) list.push({ label: item.name, value: `${item.code}-${item.name}` })
...@@ -277,7 +277,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -277,7 +277,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
state.value = '' state.value = ''
let list = [] let list = []
let pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value let pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value
PublicApi.getWarehouseAreaByPcodeAll({ pcode: pcode }).then(res => { PublicApi.getManageAreaByPcodeAll({ pcode: pcode }).then(res => {
res.data.forEach((item: any, index: number) => { 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}` }) list.push({ label: item.name, value: `${item.code}-${item.name}` })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55 * @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 19:37:57 * @LastEditTime: 2020-08-03 18:02:39
*/ */
import React, { Component, useState, useEffect } from 'react'; import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom'
...@@ -105,7 +105,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -105,7 +105,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
} }
// console.log(id,typeof id,history.location.query.isSee,typeof history.location.query.isSee) // console.log(id,typeof id,history.location.query.isSee,typeof history.location.query.isSee)
setHeaderTitle(`${_title}运费模板`) setHeaderTitle(`${_title}运费模板`)
PublicApi.getWarehouseAreaByPcodeAll({ pcode: '100000' }).then(res => { PublicApi.getManageAreaByPcodeAll({ pcode: '100000' }).then(res => {
let list = [] let list = []
res.data.forEach((item: any, index: number) => { res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: Number(item.code) }) list.push({ label: item.name, value: Number(item.code) })
...@@ -152,10 +152,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -152,10 +152,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
history.goBack() history.goBack()
},1000) },1000)
} }
const addStyle = {
padding: '2px 0',
textAlign: 'center'
}
const onSearch = () => { const onSearch = () => {
} }
...@@ -335,7 +332,8 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -335,7 +332,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
operations: { operations: {
title: '操作' title: '操作'
}, },
renderAddition: () => <div style={addStyle}>+添加指定地区</div>, renderAddition: () =>
<div style={{padding: '2px 0',textAlign: 'center'}}>+添加指定地区</div>,
renderMoveDown: () => null, renderMoveDown: () => null,
renderMoveUp: () => null, renderMoveUp: () => null,
renderRemove: (idx: any) => { renderRemove: (idx: any) => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34 * @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24 20:08:29 * @LastEditTime: 2020-08-03 11:19:53
*/ */
import React, { Component, ReactNode, useRef, useState } from 'react' import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi' import { history } from 'umi'
...@@ -111,7 +111,7 @@ const EditableCell: React.FC<EditableCellProps> = ({ ...@@ -111,7 +111,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
*/ */
const Template: React.FC<ListProps> = (props) => { const Template: React.FC<ListProps> = (props) => {
console.log(props) console.log(props)
const ref = useRef({}) const ref = useRef<any>({})
const [form] = Form.useForm(); const [form] = Form.useForm();
const [table, setTable] = useState([]) const [table, setTable] = useState([])
const [editingKey, setEditingKey] = useState(''); const [editingKey, setEditingKey] = useState('');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34 * @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-31 19:27:46 * @LastEditTime: 2020-08-03 15:48:15
*/ */
import React, { Component, ReactNode, useRef, useState, useEffect } from 'react' import React, { Component, ReactNode, useRef, useState, useEffect } from 'react'
import { history } from 'umi' import { history } from 'umi'
...@@ -28,6 +28,7 @@ import { PublicApi } from '@/services/api' ...@@ -28,6 +28,7 @@ import { PublicApi } from '@/services/api'
import { timeRange} from '@/utils/index' import { timeRange} from '@/utils/index'
import moment from 'moment' import moment from 'moment'
import statuStyle from '../colorTag' import statuStyle from '../colorTag'
import {TimeList,outSideStatusList,statusList} from '../statusList'
import style from '../components/index.less' import style from '../components/index.less'
const { Option } = Select const { Option } = Select
const data = [ const data = [
...@@ -143,49 +144,7 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -143,49 +144,7 @@ const OrderList: React.FC<ListProps> = (props) => {
invoicesTimeStart: '', invoicesTimeStart: '',
invoicesTimeEnd: '' invoicesTimeEnd: ''
}) })
const TimeList = [
{
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
},
{
label: '一周内', value: 2
},
{
label: '一个月内', value: 3
},
{
label: '三个月内', value: 4
},
{
label: '六个月内', value: 5
},
{
label: '一年内', value: 6
},
{
label: '一年前', value: 7
}
]
const outSideStatusList = [
{
label: '外部状态(全部)', value: ''
},
{
label: '待提交', value: 1
},
{
label: '待确认', value: 2
},
{
label: '接受物流单', value: 3
},
{
label: '不接受物流单', value: 4
}
]
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
title: '物流单号', title: '物流单号',
...@@ -240,9 +199,12 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -240,9 +199,12 @@ const OrderList: React.FC<ListProps> = (props) => {
}, },
{ {
title: '外部状态', title: '外部状态',
align: 'center', align: 'left',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
filters: statusList,
filterMultiple: false,
onFilter:(value,record) => record.status === value,
render: (text: any, record: any) => { render: (text: any, record: any) => {
let component: ReactNode = null let component: ReactNode = null
if (text == 3) { if (text == 3) {
...@@ -398,17 +360,6 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -398,17 +360,6 @@ const OrderList: React.FC<ListProps> = (props) => {
}) })
} }
</Select> </Select>
<Select
className={style.select}
value={searchForm.status}
onChange={(val) => setSearchForm({ ...searchForm, status: val })}
>
{
outSideStatusList.map((item,index) => {
return <Option key={index} value={item.value}>{item.label}</Option>
})
}
</Select>
</Space> </Space>
</Col> </Col>
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-28 11:25:30 * @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 17:37:44 * @LastEditTime: 2020-08-03 16:48:12
*/ */
import React, { Component, useEffect, useRef, useState } from 'react' import React, { Component, useEffect, useRef, useState,ReactNode } from 'react'
import { Card, Row, Col, Tabs, Button, Input as SelectInput, Badge } from 'antd' import { Card, Row, Col, Tabs, Button, Input as SelectInput, Badge } from 'antd'
import { LinkOutlined } from '@ant-design/icons' import { LinkOutlined } from '@ant-design/icons'
import { StandardTable } from 'god' import { StandardTable } from 'god'
...@@ -82,17 +82,17 @@ const Deatail: React.FC<{}> = () => { ...@@ -82,17 +82,17 @@ const Deatail: React.FC<{}> = () => {
}, },
{ {
title: '状态', title: '状态',
align: 'center', align: 'left',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
render: (_: any, record) => { render: (text: number, record: any) => {
return ( let component: ReactNode = null;
<> text === 1 ? component = <Badge status='default' text="待提交" />:
<Badge color="#6C9CEB" text='待确认' /> text === 2 ? component = <Badge status='processing' text="待确认" />:
<Badge status='error' text='不接受物流单' /> text === 3 ? component = <Badge status='success' text="接受物流单" />:
</> component = <Badge status='error' text="不接受物流单" />
) return component;
} },
}, },
{ {
title: '操作', title: '操作',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34 * @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-31 19:35:54 * @LastEditTime: 2020-08-03 15:49:51
*/ */
import React, { Component, ReactNode, useRef, useState, useEffect } from 'react' import React, { Component, ReactNode, useRef, useState, useEffect } from 'react'
import { history } from 'umi' import { history } from 'umi'
...@@ -26,6 +26,7 @@ import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableCon ...@@ -26,6 +26,7 @@ import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableCon
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import style from '../components/index.less' import style from '../components/index.less'
import statuStyle from '../colorTag' import statuStyle from '../colorTag'
import {TimeList,outSideStatusList,statusList} from '../statusList'
import moment from 'moment' import moment from 'moment'
import { timeRange } from '@/utils/index' import { timeRange } from '@/utils/index'
import Index from '@/pages'; import Index from '@/pages';
...@@ -57,49 +58,7 @@ const data = [ ...@@ -57,49 +58,7 @@ const data = [
interface Item { interface Item {
key: string key: string
} }
const TimeList = [
{
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
},
{
label: '一周内', value: 2
},
{
label: '一个月内', value: 3
},
{
label: '三个月内', value: 4
},
{
label: '六个月内', value: 5
},
{
label: '一年内', value: 6
},
{
label: '一年前', value: 7
}
]
const outSideStatusList = [
{
label: '外部状态(全部)', value: ''
},
{
label: '待提交', value: 1
},
{
label: '待确认', value: 2
},
{
label: '接受物流单', value: 3
},
{
label: '不接受物流单', value: 4
}
]
//父页面传递来的参数 //父页面传递来的参数
export interface ListProps { export interface ListProps {
} }
...@@ -200,9 +159,12 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -200,9 +159,12 @@ const OrderList: React.FC<ListProps> = (props) => {
}, },
{ {
title: '外部状态', title: '外部状态',
align: 'center', align: 'left',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
filters: statusList,
filterMultiple: false,
onFilter:(value,record) => record.status === value,
render: (text: any, reconds: any) => { render: (text: any, reconds: any) => {
let component: ReactNode = null let component: ReactNode = null
if (text == 3) { if (text == 3) {
...@@ -239,7 +201,9 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -239,7 +201,9 @@ const OrderList: React.FC<ListProps> = (props) => {
删除 删除
</Button> </Button>
</Popconfirm> </Popconfirm>
<Button type='link'>提交</Button> <Popconfirm title="确定要提交吗?" okText="是" cancelText="否" onConfirm={() => handleSubmit(record.id)}>
<Button type='link'>提交</Button>
</Popconfirm>
</> </>
} }
...@@ -286,11 +250,17 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -286,11 +250,17 @@ const OrderList: React.FC<ListProps> = (props) => {
}) })
} }
const handleDelete = (id: number | string) => { const handleDelete = (id: number) => {
PublicApi.postLogisticsOrderWaitSubmitDelete({ id: id }).then(res => { PublicApi.postLogisticsOrderWaitSubmitDelete({ id: id }).then(res => {
ref.current.reload() ref.current.reload()
}) })
} }
const handleSubmit = (id:number) => {
PublicApi.postLogisticsOrderWaitSubmitSubmit({id:id}).then(res => {
ref.current.reload()
})
}
const handleSee = (id: number) => { const handleSee = (id: number) => {
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil?id=${id}`) history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil?id=${id}`)
} }
......
/*
* @Author: LeeJiancong
* @Date: 2020-08-01 11:06:09
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-01 11:07:49
*/
export const TimeList = [
{
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
},
{
label: '一周内', value: 2
},
{
label: '一个月内', value: 3
},
{
label: '三个月内', value: 4
},
{
label: '六个月内', value: 5
},
{
label: '一年内', value: 6
},
{
label: '一年前', value: 7
}
]
export const outSideStatusList = [
{
label: '外部状态(全部)', value: ''
},
{
label: '待提交', value: 1
},
{
label: '待确认', value: 2
},
{
label: '接受物流单', value: 3
},
{
label: '不接受物流单', value: 4
}
]
export const statusList = [
{
text: '待提交', value: 1
},
{
text: '待确认', value: 2
},
{
text: '接受物流单', value: 3
},
{
text: '不接受物流单', value: 4
}
]
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi'; import { history } from 'umi';
import { import { PageHeaderWrapper } from '@ant-design/pro-layout';
Tooltip, import { Tooltip, Input, Button, Card, Row, Col, Popconfirm } from 'antd';
Input,
Select,
Button,
Card,
Dropdown,
Menu,
Row,
Col,
Popconfirm,
} from 'antd';
import { import {
PlusOutlined, PlusOutlined,
EyeOutlined, EyeOutlined,
UpOutlined, PlayCircleOutlined,
DeleteOutlined, PauseCircleOutlined,
DownOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less'; import style from './index.less';
const BillsType: React.FC<{}> = () => { const data = [
return <div>BillsType</div>; {
key: '1',
id: '1',
no: 'DJ001',
name: '进货入库单',
direction: 1,
status: 1,
},
{
key: '2',
id: '2',
no: 'DJ002',
name: '退货入库单',
direction: 2,
status: 2,
},
];
const billsType: React.FC<{}> = () => {
const ref = useRef({});
const [searchName, setSearchName] = useState('');
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '单据类型编号',
dataIndex: 'no',
align: 'center',
key: 'no',
},
{
title: '单据名称',
dataIndex: 'name',
align: 'center',
key: 'name',
render: (text: any, record: any) => {
return (
<span className="commonPickColor" onClick={() => history.push('')}>
{text}&nbsp;
<EyeOutlined />
</span>
);
},
},
{
title: '方向',
dataIndex: 'direction',
align: 'center',
key: 'direction',
render: (text: any, record: any) => {
return (
<span>
{text}
{record.direction === 1 ? ' +' : ' -'}
</span>
);
},
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
key: 'status',
sorter: true,
render: (text: any, record: any) => {
return (
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => console.log('...')}
onCancel={() => console.log('...')}
okText="是"
cancelText="否"
>
<Button
type="link"
onClick={() => console.log('???')}
style={
record.status === 1 ? { color: '#00B37A' } : { color: 'red' }
}
>
{record.status === 1 ? (
<>
有效 <PlayCircleOutlined />
</>
) : (
<>
无效 <PauseCircleOutlined />
</>
)}
</Button>
</Popconfirm>
);
},
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (record: any) => (
<>
<Button type="link" onClick={record => history.push('')}>
编辑
</Button>
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => console.log('...')}
onCancel={() => console.log('...')}
okText="是"
cancelText="否"
>
<Button type="link">删除</Button>
</Popconfirm>
</>
),
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
});
};
const handleReset = () => {};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row>
<Col span={12}>
<Button
type="primary"
onClick={() =>
history.push(
'/memberCenter/memberAbility/manage/addMember?type=add',
)
}
>
<PlusOutlined />
新建
</Button>
</Col>
<Col span={12} style={{ textAlign: 'right' }}>
<Tooltip
trigger={['focus']}
placement="top"
title={<span>输入单据名称进行搜索</span>}
>
<Input.Search
style={{ width: '232px' }}
value={searchName}
placeholder="搜索"
onChange={e => setSearchName(e.target.value)}
/>
</Tooltip>
<Button
style={{ marginLeft: '16px' }}
onClick={() => handleReset()}
>
重置
</Button>
</Col>
</Row>
}
/>
</Card>
</PageHeaderWrapper>
);
}; };
export default BillsType; export default billsType;
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi'; import { history } from 'umi';
import { import { PageHeaderWrapper } from '@ant-design/pro-layout';
Tooltip, import { Tooltip, Input, Button, Card, Row, Col, Popconfirm } from 'antd';
Input,
Select,
Button,
Card,
Dropdown,
Menu,
Row,
Col,
Popconfirm,
} from 'antd';
import { import {
PlusOutlined, PlusOutlined,
EyeOutlined, EyeOutlined,
UpOutlined, PlayCircleOutlined,
DeleteOutlined, PauseCircleOutlined,
DownOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less'; import style from './index.less';
const data = [
{
key: '1',
id: '1',
name: '广州成品仓',
address: '广东省广州市海珠区新港东路1068号中洲中心北塔6楼',
person: '蒯美政',
phoneMobile: '185 2929 5432',
status: 1,
},
{
key: '2',
id: '2',
name: '广州成品仓',
address: '广东省广州市海珠区新港东路1068号中洲中心北塔6楼',
person: '蒯美政',
phoneMobile: '185 2929 5432',
status: 2,
},
];
const WareHouse: React.FC<{}> = () => { const WareHouse: React.FC<{}> = () => {
return <div>warehouse</div>; const ref = useRef({});
const [searchName, setSearchName] = useState('');
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '仓库名称',
dataIndex: 'name',
align: 'center',
key: 'name',
render: (text: any, record: any) => {
return (
<span className="commonPickColor" onClick={() => history.push('')}>
{text}&nbsp;
<EyeOutlined />
</span>
);
},
},
{
title: '仓库地址',
dataIndex: 'address',
align: 'center',
key: 'address',
},
{
title: '仓库负责人',
dataIndex: 'person',
align: 'center',
key: 'person',
},
{
title: '联系电话',
dataIndex: 'phoneMobile',
align: 'center',
key: 'phoneMobile',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
key: 'status',
sorter: true,
render: (text: any, record: any) => {
return (
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => console.log('...')}
onCancel={() => console.log('...')}
okText="是"
cancelText="否"
>
<Button
type="link"
onClick={() => console.log('???')}
style={
record.status === 1 ? { color: '#00B37A' } : { color: 'red' }
}
>
{record.status === 1 ? (
<>
有效 <PlayCircleOutlined />
</>
) : (
<>
无效 <PauseCircleOutlined />
</>
)}
</Button>
</Popconfirm>
);
},
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (record: any) => (
<>
<Button type="link" onClick={record => history.push('')}>
编辑
</Button>
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => console.log('...')}
onCancel={() => console.log('...')}
okText="是"
cancelText="否"
>
<Button type="link">删除</Button>
</Popconfirm>
</>
),
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
});
};
const handleReset = () => {};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row>
<Col span={12}>
<Button
type="primary"
onClick={() =>
history.push(
'/memberCenter/memberAbility/manage/addMember?type=add',
)
}
>
<PlusOutlined />
新建
</Button>
</Col>
<Col span={12} style={{ textAlign: 'right' }}>
<Tooltip
trigger={['focus']}
placement="top"
title={<span>输入仓库名称进行搜索</span>}
>
<Input.Search
style={{ width: '232px' }}
value={searchName}
placeholder="搜索"
onChange={e => setSearchName(e.target.value)}
/>
</Tooltip>
<Button
style={{ marginLeft: '16px' }}
onClick={() => handleReset()}
>
重置
</Button>
</Col>
</Row>
}
/>
</Card>
</PageHeaderWrapper>
);
}; };
export default WareHouse; export default WareHouse;
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