Commit e8e5b1cc authored by tjy's avatar tjy
parents 19ac5d51 1086753e
......@@ -20,7 +20,8 @@ const config:any = {
routes,
extraBabelPlugins: [
// ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'],
['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god']
['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god'],
['import', { libraryName: '@umijs/hooks', libraryDirectory: 'lib', camel2DashComponentName: false }, '@umijs/hooks'],// 将下划线转化关闭
],
history: {
type: 'browser', // 'brower' | 'hash'
......
......@@ -28,6 +28,7 @@
"@ant-design/pro-layout": "^5.0.16",
"@formily/antd": "^1.2.10",
"@formily/antd-components": "^1.2.10",
"@umijs/hooks": "^1.9.3",
"@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.0",
"bizcharts": "^4.0.7",
......
@import '../../constants/styles/_var.less';
.god-tabtree-header {
display: flex;
justify-content: space-between;
align-items: center;
height: 54px;
background: #fff;
font-size: 18px;
font-weight: 700;
color: @main-font-bold-color;
}
#root .ant-tree.god-tabtree {
.ant-tree-treenode {
cursor: pointer;
&:hover {
.god-tabtree-icons {
opacity: 1;
}
}
}
.god-tabtree-icons {
opacity: 0;
transition: .3s;
&.show {
opacity: 1;
}
}
.god-tabtree-select {
background: none;
border-color: @tree-node-border;
&.show {
border-color: @main-color;
background: @tree-node_hover;
.tree-node-circle {
background: @main-color;
}
}
&.hide {
.tree-node-circle {
background: @status-stop;
}
}
}
}
import React, { useState, ReactText, useImperativeHandle } from 'react'
import { Tree, Space, Tooltip, Button } from 'antd'
import { findItemAndDelete, findTreeKeys } from '@/utils'
import './index.less'
import deepClone from 'clone'
import { TreeProps } from 'antd/lib/tree'
import { PlusOutlined, DeleteOutlined, PlusCircleOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { EventDataNode } from 'rc-tree/lib/interface'
import { useSelections } from '@umijs/hooks'
export interface TabTreeActions {
getExpandedKeys: () => ReactText[],
getSelectKey: () => ReactText,
getSelectKeys: () => ReactText[],
setExpandedKeys: (keys: ReactText[]) => void,
setSelectKey: (key: ReactText) => void
setSelectKeys: (keys: ReactText[]) => void
}
export interface toolsRenderProps {
addNode?(node),
addChildNode?(node),
deleteNode?(node)
}
export interface TabTreeProps extends TreeProps {
treeData: any[],
fetchData(params?): Promise<any>,
actions?: TabTreeActions,
title?: React.ReactNode,
// 若传入该字段, 则会作为tree识别的节点, 默认是`key`, 传入后原有的key值将无效
customKey?: string | number,
customTitle?: string | number,
handleSelect?: (key: ReactText, node: EventDataNode) => void | Promise<any>,
toolsRender?: toolsRenderProps
}
export interface InnermostTreeNodeProps {
}
export interface RenderIconsProps {
node: any,
nowKey: any,
toolsRender?: toolsRenderProps
}
export const useTreeActions = (): TabTreeActions => {
const actions: TabTreeActions = {
getExpandedKeys(){ return [] },
getSelectKey(){ return '' },
getSelectKeys(){ return [] },
setSelectKey(){},
setSelectKeys(){},
setExpandedKeys(){},
}
return actions
}
const InnermostTreeNode: React.FC<InnermostTreeNodeProps> = (props) => {
return <span style={{display: 'flex', alignItems: 'center'}}>
<span className='tree-node-circle'></span>
<span>{props.children}</span>
</span>
}
const RenderIcons: React.FC<RenderIconsProps> = (props) => {
const {
toolsRender
} = props
// @todo 去掉点击active时, 保持icon显示
// return <Space className={cx('god-tabtree-icons', props.nowKey === props.node.key ? 'show' : 'hide')}>
return <Space className={cx('god-tabtree-icons')}>
<Tooltip title='新增节点'>
<PlusCircleOutlined onClick={(e) => {
e.stopPropagation()
toolsRender && toolsRender.addNode && toolsRender.addNode(props.node)
}}/>
</Tooltip>
<Tooltip title='新增子节点'>
<PlusCircleOutlined onClick={(e) => {
e.stopPropagation()
toolsRender && toolsRender.addChildNode && toolsRender.addChildNode(props.node)
}}/>
</Tooltip>
<Tooltip title='删除当前节点'>
<DeleteOutlined onClick={(e) => {
e.stopPropagation()
toolsRender && toolsRender.deleteNode && toolsRender.deleteNode(props.node)
}}/>
</Tooltip>
</Space>
}
// 将无children的叶子节点中的title 转化为带有样式的title, 由于每次render 都需要重新deepClone深拷贝,可以优化
// 在多选模式下无需转化
function transformSingleTitle(data, nowKey, checkable, disabled, toolsRender, customKey?, customTitle?) {
if (Array.isArray(data) && data.length > 0) {
for (let item = 0; item < data.length; item++) {
if (data[item].children) {
transformSingleTitle(data[item].children, nowKey, checkable, disabled, toolsRender, customKey, customTitle)
}
data[item].title = <span className='god-tabtree-title' style={{display: 'flex', alignItems: 'center', justifyContent: 'space-between'}}>
{ (checkable || data[item].children) ? data[item].title : <InnermostTreeNode>{data[item].title}</InnermostTreeNode> }
<div>
{ toolsRender && <RenderIcons node={data[item]} nowKey={nowKey} toolsRender={toolsRender}/> }
</div>
</span>
// 使选中样式受控
data[item].className= cx('god-tabtree-select', nowKey === data[item].key ? 'show' : 'hide')
if (disabled) {
data[item].disableCheckbox = disabled
}
// 指定默认key
if (customKey) {
data[item]._key = data[item].key
data[item].key = data[item][customKey]
}
if (customTitle) {
data[item]._title = data[item].title
data[item].title = data[item][customTitle]
}
}
}
return data;
}
const TabTree:React.FC<TabTreeProps> = (props) => {
const {
title,
treeData,
actions,
checkable,
customKey,
customTitle,
toolsRender,
disabled
} = props
// 需展开的key
const [expandkeys, setExpandkeys] = useState<ReactText[]>([])
// 当前选中的node
const [selectKey, setSelectKey] = useState<string | number>('')
const data = transformSingleTitle(deepClone(treeData), selectKey, checkable, disabled, toolsRender, customKey, customTitle)
// 重写选择方法, 只有在开启多选的时候才会启用
const checkedKeys = findTreeKeys(treeData)
const { selected, select,setSelected, unSelect, allSelected, unSelectAll, selectAll } = useSelections(
checkedKeys,
[]
);
const toggleSelectAll = () => {
if (allSelected) {
unSelectAll()
} else {
selectAll()
}
}
if (actions) {
actions.getExpandedKeys = () => expandkeys
actions.getSelectKey = () => selectKey
actions.getSelectKeys = () => selected
actions.setSelectKeys = (keys: ReactText[]) => {
setSelected(keys)
}
actions.setExpandedKeys = (keys: ReactText[]) => {
setExpandkeys(keys)
}
actions.setSelectKey = (key: ReactText) => {
setSelectKey(key)
}
}
const batchSelect = (items: any[]) => {
items.forEach(v => select(v))
}
return (
<div>
{title &&
<div className='god-tabtree-header'>
<div>{title}</div>
{checkable && <Button onClick={toggleSelectAll} disabled={disabled} type='link'>{ allSelected ? '取消全选' : '全选'}</Button>}
</div>
}
<Tree
className="god-tabtree"
treeData={data}
blockNode
checkable={checkable}
checkedKeys={selected}
expandedKeys={expandkeys}
onCheck={(keys, nodes) => {
const { node, checked, checkedNodes } = nodes
checked ? batchSelect(keys as any) : setSelected(checkedNodes)
}}
onSelect={(keys, e) => {
// 控制点击node时可以展开
const { node, selected } = e
// 用户自定义的选择后触发事件
if (props.handleSelect) {
const result = props.handleSelect(node.key, node)
// 存在返回值则不执行选中事件, 一般用于切换node时,不希望离开当前页面
if (result !== undefined) {
result.then(() => {
// 若promise 是resolve状态, 说明确认离开了当前页面
setSelectKey(selectKey === node.key ? '' : node.key)
setExpandkeys(expandkeys.includes(node.key) ? findItemAndDelete(expandkeys, node.key) : [...expandkeys, node.key])
}).catch(() => {
})
return false
}
}
// 如果重复点击 需要取消选中
setSelectKey(selectKey === node.key ? '' : node.key)
setExpandkeys(expandkeys.includes(node.key) ? findItemAndDelete(expandkeys, node.key) : [...expandkeys, node.key])
}}
>
</Tree>
</div>
)
}
TabTree.defaultProps = {}
export default TabTree
\ No newline at end of file
......@@ -142,4 +142,11 @@ h6 {
border: none;
background: none;
}
}
\ No newline at end of file
}
//addonAfter 有选择弹窗时
.input_addonAfter{
.ant-input-group-addon{
padding: 0 !important;
}
}
......@@ -6,9 +6,9 @@ import {
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { values } from 'mobx';
import {PublicApi} from '@/services/api'
export interface Params {
import { PublicApi } from '@/services/api'
import {PATTERN_MAPS} from '@/constants/regExp'
export interface Params {
id: number | string;
dialogVisible: boolean;
onCancel: Function;
......@@ -16,33 +16,40 @@ export interface Params {
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
const {onFieldChange$} = FormEffectHooks
const { onFieldChange$ } = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props) => {
console.log(props.dialogVisible)
const handleCancel = () => {
}
const handletOk = (values:any) => {
let value = {...values}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
console.log(values)
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if(res.code === 1000){
if (res.code === 1000) {
props.onOK()
}
})
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({value}) => {
setFieldState('remarkOption',state => {
if(value == 3){
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 3) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value == 3) {
state.visible = false
}else{
} else {
state.visible = true
}
})
......@@ -62,21 +69,23 @@ const comfirmDialog: React.FC<Params> = (props) => {
okText='确定'
cancelText='取消'
>
<SchemaForm components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values) }
initialValues={{
status: 3
}}
<SchemaForm
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 3
}}
>
<Field
enum={
[
{ label: '接受物流单', value:3},
{ label: '不接受物流单', value:4 }
{ label: '接受物流单', value: 3 },
{ label: '不接受物流单', value: 4 }
]}
name='status'
required
......@@ -84,27 +93,41 @@ const comfirmDialog: React.FC<Params> = (props) => {
/>
{props.dontReceive &&
<FormMegaLayout name='remarkOption' label='不接受原因' full required 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个汉字'
}
}
}
}
/>
<>
<Field
title='运费'
name="freightPrice"
x-component="Input"
required
x-component-props={{
placeholder:'运费',
// addonBefore: ' '
}}
x-rules ={{
pattern: PATTERN_MAPS.money,
message:'数字类型,币制为当前站点对应的币制,保留2位小数'
}}
/>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules ={{
max:60,
// maximum:10,//最大数值
message:'原因最多60个汉字'
}}
/>
</FormMegaLayout>
</>
}
</SchemaForm>
</Modal>
......
......@@ -38,9 +38,9 @@ interface dataInfoType{
}
const detailInfo: React.FC<{}> = () => {
const ref = useRef({})
const ref = useRef<any>({})
let [isextraOption, setIsextraOption] = useState(false)
let [dataInfo, setdataInfo] = useState<dataInfoType>({
let [dataInfo, setdataInfo] = useState<any>({
status: '',
digest: '',
logisticsOrderNo:'',
......@@ -54,7 +54,7 @@ const detailInfo: React.FC<{}> = () => {
freightPrice: 0,
settlementWay: ''
})
const [id, setid] = useState('')
const [id, setid] = useState(history.location.query.id)
let [visible, setvisible] = useState(false)
const [pagination, setPagination] = useState({
current: 1,
......@@ -179,19 +179,24 @@ const detailInfo: React.FC<{}> = () => {
{
title: '状态',
dataIndex: 'status',
align: 'center',
align: 'left',
key: 'status',
render: (text: any, record: any) => {
render: (text: number, record: any) => {
let component: ReactNode = null;
component = <Badge color="#FFC400" text="待审核" />;
text === 1 ? component = <Badge status='default' text="待提交" />:
text === 2 ? component = <Badge status='processing' text="待确认" />:
text === 3 ? component = <Badge status='success' text="接受物流单" />:
component = <Badge status='error' text="不接受物流单" />
return component;
},
},
{
title: '操作',
dataIndex: 'operation',
dataIndex: 'type',
align: 'center',
key: 'operation',
key: 'type',
render: (text: number ,record:any) =>
<>{text === 1 ?'提交物流单':'确认物流单'}</>
},
{
title: '操作时间',
......@@ -208,6 +213,7 @@ const detailInfo: React.FC<{}> = () => {
width: 300
},
];
//在这做逻辑判断 判断路由 是由哪个页面进来的
useEffect(() => {
let pathname = history.location.pathname
......@@ -243,12 +249,15 @@ const detailInfo: React.FC<{}> = () => {
//待确认物流单
if (pathname === '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmDeatil') {
setIsextraOption(true)
PublicApi.getLogisticsOrderWaitConfirmGet({ id: id }).then(res => {
setdataInfo(res.data)
let current = 0
if(res.data.status <= 2){
if(res.data.status == 1){
current = 0
}else if(res.data.status == 2){
current = 0
setIsextraOption(true)
}else if(res.data.status == 3 || res.data.status == 4){
current = 1
}
......@@ -261,17 +270,19 @@ const detailInfo: React.FC<{}> = () => {
}, [])
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: dataInfo.detailList//dataInfo.logList
});
}, 1000);
PublicApi.getLogisticsOrderWaitSubmitPageOrderLog({...params,orderId:id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
};
const handleModalOK = () => {
setvisible(false)
ref.current.reload()
}
return (
<PageHeaderWrapper
......@@ -364,7 +375,7 @@ const detailInfo: React.FC<{}> = () => {
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
<div className={style['cols-main-options']}>
<div className={style['cols-main-options']} style={{flex:'1.5 1'}}>
{item.title}
</div>
<div className={style['cols-main-options']}>
......@@ -464,9 +475,8 @@ const detailInfo: React.FC<{}> = () => {
{
item.key === 'freight' ?
<div className={style['cols-main-options']}>
{item.value}
{/* <Input addonBefore=" ¥ " defaultValue={100} /> */}
{dataInfo.status < 3 ?'未报价':item.value}
</div>
: <div className={style['cols-main-options']}>
{item.value}
......@@ -485,7 +495,14 @@ const detailInfo: React.FC<{}> = () => {
<div className={style['mainCol-title']}>
外部流转记录
</div>
<Table dataSource={dataInfo.logList} columns={columns} pagination={pagination} />
<StandardTable
tableProps={{rowKey:'id'}}
currentRef={ref}
columns={columns}
fetchTableData={(params: any) => fetchData(params)}
/>
{/* <Table dataSource={dataInfo.logList} columns={columns} pagination={pagination} /> */}
</Col>
......@@ -494,6 +511,7 @@ const detailInfo: React.FC<{}> = () => {
id={id}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK = {() =>handleModalOK}
/>
</PageHeaderWrapper>
......
.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;
}
.btn-wrap{
.ant-input-group{
.ant-input-group-addon{
padding: 0 !important;
.selectBtn{
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;
const defaultValue = 'lucy'
const company: React.FC<{}> = () => {
//hook只能写在函数组件的顶级作用域
const ref = useRef({})
const ref = useRef<any>({})
const [menuForm] = Form.useForm();
const [headerTitle, setHeaderTitle] = useState('新建物流公司')
const [Code, setCode] = useState('')
......@@ -224,7 +224,7 @@ const company: React.FC<{}> = () => {
}
]}
>
<Input className={style['btn-wrap']} disabled maxLength={20} addonAfter={selectBtn}/>
<Input className="input_addonAfter" disabled maxLength={20} addonAfter={selectBtn}/>
</Form.Item>
:
<Form.Item
......@@ -299,7 +299,10 @@ const company: React.FC<{}> = () => {
<StandardTable
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
rowSelection={{
type:'radio',
...rowSelection
}}
fetchTableData={(params: any) => fetchData(params)}
/>
......
/*
* @Date: 2020-07-13 15:01:40
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 10:06:44
* @LastEditTime: 2020-08-03 16:52:53
*/
import React, { ReactNode, useRef } from 'react'
......@@ -50,7 +50,7 @@ const fetchData = (params?: any) => {
}
const Company: React.FC<{}> = () => {
const ref = useRef({})
const ref = useRef<any>({})
const columns: ColumnType<any>[] = [
{
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-28 10:56:07
* @LastEditTime: 2020-08-03 17:59:56
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -175,7 +175,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
setOptions(TelCodeList)
})
const getAllCode = setTimeout(()=> {
PublicApi.getWarehouseAreaByPcodeAll({ pcode: '100000' }).then(res => {
PublicApi.getManageAreaByPcodeAll({ pcode: '100000' }).then(res => {
let list = []
res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: `${item.code}-${item.name}` })
......@@ -259,7 +259,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
state.value = ''
let list = []
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) => {
// list.push({ label: item.name, value: item.code })
list.push({ label: item.name, value: `${item.code}-${item.name}` })
......@@ -277,7 +277,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
state.value = ''
let list = []
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) => {
// list.push({ label: item.name, value: item.code })
list.push({ label: item.name, value: `${item.code}-${item.name}` })
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 19:37:57
* @LastEditTime: 2020-08-03 18:02:39
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -105,7 +105,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}
// console.log(id,typeof id,history.location.query.isSee,typeof history.location.query.isSee)
setHeaderTitle(`${_title}运费模板`)
PublicApi.getWarehouseAreaByPcodeAll({ pcode: '100000' }).then(res => {
PublicApi.getManageAreaByPcodeAll({ pcode: '100000' }).then(res => {
let list = []
res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: Number(item.code) })
......@@ -152,10 +152,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
history.goBack()
},1000)
}
const addStyle = {
padding: '2px 0',
textAlign: 'center'
}
const onSearch = () => {
}
......@@ -335,7 +332,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
operations: {
title: '操作'
},
renderAddition: () => <div style={addStyle}>+添加指定地区</div>,
renderAddition: () =>
<div style={{padding: '2px 0',textAlign: 'center'}}>+添加指定地区</div>,
renderMoveDown: () => null,
renderMoveUp: () => null,
renderRemove: (idx: any) => {
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @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 { history } from 'umi'
......@@ -111,7 +111,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
*/
const Template: 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('');
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-01 11:10:57
* @LastEditTime: 2020-08-03 15:48:15
*/
import React, { Component, ReactNode, useRef, useState, useEffect } from 'react'
import { history } from 'umi'
......@@ -199,7 +199,7 @@ const OrderList: React.FC<ListProps> = (props) => {
},
{
title: '外部状态',
align: 'center',
align: 'left',
dataIndex: 'status',
key: 'status',
filters: statusList,
......@@ -360,17 +360,6 @@ const OrderList: React.FC<ListProps> = (props) => {
})
}
</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>
</Col>
}
......
......@@ -2,9 +2,9 @@
* @Author: LeeJiancong
* @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 17:37:44
* @LastEditTime: 2020-08-03 18:28:38
*/
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 { LinkOutlined } from '@ant-design/icons'
import { StandardTable } from 'god'
......@@ -82,17 +82,17 @@ const Deatail: React.FC<{}> = () => {
},
{
title: '状态',
align: 'center',
align: 'left',
dataIndex: 'name',
key: 'name',
render: (_: any, record) => {
return (
<>
<Badge color="#6C9CEB" text='待确认' />
<Badge status='error' text='不接受物流单' />
</>
)
}
render: (text: number, record: any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交" />:
text === 2 ? component = <Badge status='processing' text="待确认" />:
text === 3 ? component = <Badge status='success' text="接受物流单" />:
component = <Badge status='error' text="不接受物流单" />
return component;
},
},
{
title: '操作',
......@@ -357,12 +357,12 @@ const Deatail: React.FC<{}> = () => {
<FormItem name="digest" label="单据摘要" required component={Input} />
<FormItem name="shipmentOrderCode" label='对应发货单号'>
<>
<SelectInput className={style['btn-wrap']} addonAfter={selectBtn2} />
<SelectInput className='input_addonAfter' addonAfter={selectBtn2} />
</>
</FormItem>
<FormItem name="invoicesNo" label='对应订单号/售后单'>
<>
<SelectInput className={style['btn-wrap']} addonAfter={selectBtn1} />
<SelectInput className='input_addonAfter' addonAfter={selectBtn1} />
</>
</FormItem>
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-01 11:12:49
* @LastEditTime: 2020-08-03 15:49:51
*/
import React, { Component, ReactNode, useRef, useState, useEffect } from 'react'
import { history } from 'umi'
......@@ -159,7 +159,7 @@ const OrderList: React.FC<ListProps> = (props) => {
},
{
title: '外部状态',
align: 'center',
align: 'left',
dataIndex: 'status',
key: 'status',
filters: statusList,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
import moment from 'moment';
import deepClone from 'clone'
function isArray(arr: any) {
return Array.isArray(arr)
......@@ -126,6 +127,20 @@ export const findItemAndDelete = (arr: any[], target) => {
}
}
// 遍历树拿到所有key的集合
export const findTreeKeys = (arr: any[], keyword?: string) => {
const copyArr: any[] = deepClone(arr)
const results: any[] = []
while(copyArr.length > 0) {
const item = copyArr.shift()
results.push(keyword ? item[keyword] : item.key)
if (item.children) {
copyArr.push(...item.children)
}
}
return results
}
export default {
isArray,
isObject,
......
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