Commit 8259463b authored by 前端-许佳敏's avatar 前端-许佳敏
parents 9e77a786 4bbe31a5
......@@ -22,6 +22,7 @@
# mockStatic
/.idea
src/services/index.ts
config/base.config.json
/src/services/index.ts
......
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":2,"typeName":"企业个人会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":2,"typeName":"商品销售"},{"id":3,"typeName":"加工服务"},{"id":4,"typeName":"物流服务"},{"id":5,"typeName":"金融服务"},{"id":6,"typeName":"保险服务"},{"id":7,"typeName":"1"},{"id":8,"typeName":"2"},{"id":9,"typeName":"3"},{"id":10,"typeName":"4"},{"id":11,"typeName":"23"},{"id":12,"typeName":"6"},{"id":13,"typeName":"5"},{"id":14,"typeName":"11111111111111111111111111"},{"id":16,"typeName":"44"},{"id":17,"typeName":"33"},{"id":18,"typeName":"32"},{"id":19,"typeName":"33333"},{"id":20,"typeName":"4432"}]},"useDetail":[{"groupName":"联系信息","elements":[{"id":26,"fieldName":"contact","fieldCNName":"联系人","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":27,"fieldName":"fixed_contact_number","fieldCNName":"固定联系电话","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":28,"fieldName":"phone_number","fieldCNName":"手机号码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":29,"fieldName":"fax_number","fieldCNName":"传真号码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":30,"fieldName":"address","fieldCNName":"地址","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":31,"fieldName":"zip_code","fieldCNName":"邮编","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":32,"fieldName":"url","fieldCNName":"网址","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":33,"fieldName":"email","fieldCNName":"邮箱","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"营业执照信息","elements":[{"id":10,"fieldName":"company_name","fieldCNName":"公司名称","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":11,"fieldName":"enterprise_type","fieldCNName":"企业类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":12,"fieldName":"residence","fieldCNName":"住所","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":13,"fieldName":"legal_representative","fieldCNName":"法定代表人","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":14,"fieldName":"register_capital","fieldCNName":"注册资本","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":15,"fieldName":"establish_date","fieldCNName":"成立日期","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":16,"fieldName":"business_term","fieldCNName":"营业期限","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":17,"fieldName":"business_scope","fieldCNName":"经营范围","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":18,"fieldName":"registration_authority","fieldCNName":"登记机关","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":19,"fieldName":"registration_time","fieldCNName":"登记时间","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":20,"fieldName":"unified_social_credit_code","fieldCNName":"统一社会信用代码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":21,"fieldName":"business_license","fieldCNName":"营业执照","fieldType":"file","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":35,"fieldName":" C_COMPANY_KIND","fieldCNName":"企业类型1","fieldType":"file","fieldLength":66,"fieldEmpty":1,"fieldOrder":2,"fieldRemark":"","checkRules":[]}]},{"groupName":"填写会员基本信息","elements":[{"id":1,"fieldName":"member_type","fieldCNName":"会员类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":2,"fieldName":"MEMBER_ROLE","fieldCNName":"会员角色","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":3,"fieldName":"member_level","fieldCNName":"会员等级","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":4,"fieldName":"REGISTER_PHONE","fieldCNName":"注册手机号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":5,"fieldName":"register_email","fieldCNName":"注册邮箱","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"法定代表人信息","elements":[{"id":22,"fieldName":"legal_name","fieldCNName":"法人姓名","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":23,"fieldName":"legal_phone","fieldCNName":"法人手机号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":24,"fieldName":"legal_id_card","fieldCNName":"法人身份证号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":25,"fieldName":"legal_id_card_information","fieldCNName":"法人身份证信息","fieldType":"file","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"填写渠道信息","elements":[{"id":6,"fieldName":"channel_level","fieldCNName":"渠道级别","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":7,"fieldName":"channel_type","fieldCNName":"渠道类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":8,"fieldName":"agent_city","fieldCNName":"代理地市","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":9,"fieldName":"channel_describe","fieldCNName":"渠道描述","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]}]},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"cn","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
......@@ -7,9 +7,10 @@
import CommodityRoute from './commodityRoute' // 商品能力路由
import MemberRoute from './memberRoute' // 会员能力路由
import ShopRoute from './shopRoute' // 店铺能力路由
import TranactionRoute from './tranactionRoute' // 交易能力路由
import LogisticsRoute from './logisticsRoutes' // 物流能力路由
const routes = [CommodityRoute, MemberRoute, ShopRoute, LogisticsRoute]
const routes = [CommodityRoute, MemberRoute, ShopRoute, TranactionRoute, LogisticsRoute]
const memberCenterRoute = {
path: '/memberCenter',
......
const TranactionRoute = {
path: '/memberCenter/tranactionAbility',
name: 'tranactionAbility',
key: 'tranactionAbility',
icon: 'smile',
routes: [
{
path: '/memberCenter/tranactionAbility/stockSellStorage',
name: 'stockSellStorage',
key: 'stockSellStorage',
routes: [
{
path: '/memberCenter/tranactionAbility/stockSellStorage/warehouse',
name: 'warehouse',
key: 'warehouse',
component: '@/pages/transaction/stockSellStorage/warehouse/index',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/billsType',
name: 'billsType',
key: 'billsType',
component: '@/pages/transaction/stockSellStorage/billsType/index',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/bills',
name: 'bills',
key: 'bills',
component: '@/pages/transaction/stockSellStorage/bills/index',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/inventory',
name: 'inventory',
key: 'inventory',
component: '@/pages/transaction/stockSellStorage/inventory/index',
},
]
}
]
}
export default TranactionRoute
......@@ -65,6 +65,14 @@ export default {
'menu.shopAbility.shopInfoManage': '店铺信息',
'menu.shopAbility.shopTemplate': '店铺装修模板',
// 交易能力
'menu.tranactionAbility': '交易',
'menu.tranactionAbility.stockSellStorage': '进销存',
'menu.tranactionAbility.stockSellStorage.warehouse': '仓库',
'menu.tranactionAbility.stockSellStorage.billsType': '单据类型',
'menu.tranactionAbility.stockSellStorage.bills': '单据',
'menu.tranactionAbility.stockSellStorage.inventory': '库存',
//物流能力
'menu.logisticsAbility': '物流',
'menu.logisticsAbility.logistics': '物流管理',
......
......@@ -7,10 +7,13 @@ import {
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { values } from 'mobx';
import {PublicApi} from '@/services/api'
export interface Params {
dialogVisible: boolean,
onCancel: Function,
dontReceive?: boolean //默认展示
id: number | string;
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
const {onFieldChange$} = FormEffectHooks
......@@ -19,9 +22,15 @@ const comfirmDialog: React.FC<Params> = (props) => {
const handleCancel = () => {
}
const handletOk = (values:any) => {
let value = {...values}
value.id = props.id
console.log(values)
actions.submit()
props.onCancel()
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if(res.code === 1000){
props.onOK()
}
})
}
useEffect(() => {
return () => {
......@@ -29,9 +38,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('radio').subscribe(({value}) => {
onFieldChange$('status').subscribe(({value}) => {
setFieldState('remarkOption',state => {
if(value == 1){
if(value == 3){
state.visible = false
}else{
state.visible = true
......@@ -46,7 +55,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
title='单据确认'
width={800}
visible={props.dialogVisible}
onOk={handletOk}
onOk={() => actions.submit()}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => actions.reset()}
......@@ -58,21 +67,22 @@ const comfirmDialog: React.FC<Params> = (props) => {
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)
}
onSubmit={(values) => handletOk(values) }
initialValues={{
status: 3
}}
>
<Field
enum={
[
{ label: '接受物流单', value:1 },
{ label: '不接受物流单', value:2 }
{ label: '接受物流单', value:3},
{ label: '不接受物流单', value:4 }
]}
name='radio'
name='status'
required
x-component="Radio"
/>
{props.dontReceive &&
<FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top">
<Field
......@@ -80,6 +90,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules={value => {
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-18 15:55:51
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 19:14:40
* @LastEditTime: 2020-07-31 19:23:51
*/
import React, { useState, useEffect, useRef, ReactNode } from 'react';
import { Card, Button, Row, Col, Tooltip, Input, Select, Tag, Space } from 'antd'
......@@ -16,6 +16,7 @@ import { hidden } from 'chalk';
import { PublicApi } from '@/services/api';
import {timeRange} from '@/utils/index'
import statuStyle from '../colorTag'
import moment from 'moment'
let { Option } = Select
export interface listProps {
title?: ReactNode,
......@@ -47,7 +48,7 @@ interface paramsType {
const orderSearchList: React.FC<listProps> = (props) => {
console.log(props)
const ref = useRef({})
const ref = useRef<any>({})
const [selectRow, setSelectRow] = useState<Item[]>([])
const TimeList = [
{
......@@ -155,12 +156,6 @@ const orderSearchList: React.FC<listProps> = (props) => {
* @return:
*/
useEffect(() => {
let timeRanges = timeRange(TimeRange);
setSearchForm({
...searchForm,
invoicesTimeStart: timeRanges.st,
invoicesTimeEnd: timeRanges.et
});
console.log(searchForm)
if(props.type === '1'){
PublicApi.getLogisticsSelectListCompany().then(res => {
......@@ -186,7 +181,14 @@ const orderSearchList: React.FC<listProps> = (props) => {
return () => {
}
}, [])
useEffect(() => {
ref.current.reload()
return () => {
}
}, [TimeRange])
const handleSee = (id: number) => {
if (props.type === '1') {
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil?id=${id}`)
......@@ -248,7 +250,8 @@ const orderSearchList: React.FC<listProps> = (props) => {
title: '单据时间',
align: 'left',
dataIndex: 'invoicesTime',
key: 'invoicesTime'
key: 'invoicesTime',
render: (text:any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
},
{
title: '外部状态',
......@@ -318,19 +321,36 @@ const orderSearchList: React.FC<listProps> = (props) => {
ref.current.reload(obj)
}
const handleChangeTime = (val:number) =>{
console.log('选择箱时间',val)
setTimeRange(val)
let timeRanges = timeRange(TimeRange)
console.log('时间范围',timeRanges)
setSearchForm({
...searchForm,
invoicesTimeStart: timeRanges.st,
invoicesTimeEnd: timeRanges.et
});
const changeTimeRange = (val:any) => {
console.log(val)
setTimeRange(val)
let timeRanges = timeRange(val)
console.log('更新',val)
console.log('选项:',val,'时间:',timeRanges)
// setSearchForm({
// ...searchForm,
// invoicesTimeStart: timeRanges.st,
// invoicesTimeEnd: timeRanges.et
// });
searchForm.invoicesTimeStart = timeRanges.st
searchForm.invoicesTimeEnd = timeRanges.et
ref.current.reload();
}
// const handleChangeTime = (val:number) =>{
// console.log('选择箱时间',val)
// setTimeRange(val)
// let timeRanges = timeRange(TimeRange)
// console.log('时间范围',timeRanges)
// setSearchForm({
// ...searchForm,
// invoicesTimeStart: timeRanges.st,
// invoicesTimeEnd: timeRanges.et
// });
// ref.current.reload();
// }
const handleReset = () => {
for (let key in searchForm) {
searchForm[key] = ''
......@@ -346,7 +366,7 @@ const orderSearchList: React.FC<listProps> = (props) => {
columns={columns}
currentRef={ref}
formAlign='left'
rowSelection={rowSelection}
// rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row"
controlRender={
......@@ -427,7 +447,17 @@ const orderSearchList: React.FC<listProps> = (props) => {
<Select
className={style.select}
value={TimeRange}
onChange={(val) => handleChangeTime(val)}
onChange={(val) =>{
setTimeRange(val),
setSearchForm({
...searchForm,
invoicesTimeStart: timeRange(val).st,
invoicesTimeEnd: timeRange(val).et
})
}
}
>
{
TimeList.map((item,index) => {
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 20:17:59
* @LastEditTime: 2020-07-31 19:27:46
*/
import React, { Component, ReactNode, useRef, useState, useEffect } from 'react'
import { history } from 'umi'
......@@ -25,6 +25,8 @@ 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'
import { timeRange} from '@/utils/index'
import moment from 'moment'
import statuStyle from '../colorTag'
import style from '../components/index.less'
const { Option } = Select
......@@ -67,6 +69,15 @@ export interface ListType {
checked: boolean //可选
}
interface paramsType {
logisticsOrderNo?: string;
invoicesTimeStart?: any;
invoicesTimeEnd?: any;
status?: number | string;
shipperId?: any;
}
interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
editing: boolean;
dataIndex: string;
......@@ -117,22 +128,24 @@ const EditableCell: React.FC<EditableCellProps> = ({
const OrderList: 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 [orderid, setOrderid] = useState(null)
let [visible, setvisible] = useState<boolean>(false)
let [isSearch, setIsSearch] = useState<boolean>(false)
const [searchForm, setSearchForm] = useState({
searName: '',
buyer: '',//收货商
dateSelect: '',
outSideStatus: '',
TimeRange: ''
const [TimeRange, setTimeRange] = useState<number>(0)
const [searchForm, setSearchForm] = useState<paramsType>({
logisticsOrderNo: '',
shipperId: '',//收货商
status: '',
invoicesTimeStart: '',
invoicesTimeEnd: ''
})
const TimeList = [
{
label: '单据时间(全部)', value: ''
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
......@@ -222,7 +235,8 @@ const OrderList: React.FC<ListProps> = (props) => {
title: '单据时间',
align: 'center',
dataIndex: 'invoicesTime',
key: 'invoicesTime'
key: 'invoicesTime',
render: (text:any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
},
{
title: '外部状态',
......@@ -271,14 +285,13 @@ const OrderList: React.FC<ListProps> = (props) => {
}
//生命周期
useEffect(() => {
ref.current.reload()
return () => {
}
}, [])
}, [TimeRange])
const handleDialog = (id: any) => {
setOrderid(id)
setvisible(true)
}
const onDefaultChange = (id: any, checked: boolean) => {
......@@ -316,6 +329,11 @@ const OrderList: React.FC<ListProps> = (props) => {
setSearchForm({ ...searchForm })
}
const handleModalOK = () => {
setvisible(false)
ref.current.reload()
}
const onCancel = () => {
setvisible(false)
......@@ -344,9 +362,9 @@ const OrderList: React.FC<ListProps> = (props) => {
title={props.type === '1' ? '输入物流单号、订单号进行搜索' : '输入物流单号、发货方进行搜索'}>
<Input.Search
style={{ width: '232px' }}
value={searchForm.searName}
value={searchForm.logisticsOrderNo}
placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
onChange={(e) => setSearchForm({ ...searchForm, logisticsOrderNo: e.target.value })}
onSearch={() => handleSearch}
/>
</Tooltip>
......@@ -363,8 +381,16 @@ const OrderList: React.FC<ListProps> = (props) => {
<Space size={16}>
<Select
className={style.select}
value={searchForm.TimeRange}
onChange={(val) => setSearchForm({ ...searchForm, TimeRange: val })}
value={TimeRange}
onChange={(val) => {
setTimeRange(val),
setSearchForm({
...searchForm,
invoicesTimeStart: timeRange(val).st,
invoicesTimeEnd: timeRange(val).et
})
}
}
>
{
TimeList.map((item,index) => {
......@@ -374,8 +400,8 @@ const OrderList: React.FC<ListProps> = (props) => {
</Select>
<Select
className={style.select}
value={searchForm.outSideStatus}
onChange={(val) => setSearchForm({ ...searchForm, outSideStatus: val })}
value={searchForm.status}
onChange={(val) => setSearchForm({ ...searchForm, status: val })}
>
{
outSideStatusList.map((item,index) => {
......@@ -392,8 +418,10 @@ const OrderList: React.FC<ListProps> = (props) => {
}
/>
<ConfirmModal
id={orderid}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={() => handleModalOK()}
/>
......
......@@ -2,12 +2,14 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 20:00:24
* @LastEditTime: 2020-07-31 19:35:54
*/
import React, { Component, ReactNode, useRef, useState,useEffect } from 'react'
import React, { Component, ReactNode, useRef, useState, useEffect } from 'react'
import { history } from 'umi'
import { Modal, Row, Col, Card, Button, Form, InputNumber,
Radio, Tooltip, Popconfirm, Switch, Input,Select, Tag,Space } from 'antd';
import {
Modal, Row, Col, Card, Button, Form, InputNumber,
Radio, Tooltip, Popconfirm, Switch, Input, Select, Tag, Space
} from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
......@@ -24,8 +26,10 @@ import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableCon
import { PublicApi } from '@/services/api'
import style from '../components/index.less'
import statuStyle from '../colorTag'
import moment from 'moment'
import { timeRange } from '@/utils/index'
import Index from '@/pages';
let {Option} = Select
let { Option } = Select
const data = [
{
key: '1',
......@@ -55,45 +59,45 @@ interface Item {
}
const TimeList = [
{
label:'单据时间(全部)',value:0
label: '单据时间(全部)', value: 0
},
{
label:'今天',value:1
label: '今天', value: 1
},
{
label:'一周内',value:2
label: '一周内', value: 2
},
{
label:'一个月内',value:3
label: '一个月内', value: 3
},
{
label:'三个月内',value:4
label: '三个月内', value: 4
},
{
label:'六个月内',value:5
label: '六个月内', value: 5
},
{
label:'一年内',value: 6
label: '一年内', value: 6
},
{
label:'一年前',value: 7
label: '一年前', value: 7
}
]
const outSideStatusList = [
{
label:'外部状态(全部)',value: ''
label: '外部状态(全部)', value: ''
},
{
label:'待提交',value: 1
label: '待提交', value: 1
},
{
label:'待确认',value: 2
label: '待确认', value: 2
},
{
label:'接受物流单',value: 3
label: '接受物流单', value: 3
},
{
label:'不接受物流单',value: 4
label: '不接受物流单', value: 4
}
]
//父页面传递来的参数
......@@ -119,7 +123,7 @@ interface paramsType {
*/
const OrderList: React.FC<ListProps> = (props) => {
console.log(props)
const ref = useRef({})
const ref = useRef<any>({})
const [form] = Form.useForm();
const [table, setTable] = useState([])
const [selectTableRow, setSelectTableRow] = useState<any>([])
......@@ -130,8 +134,8 @@ const OrderList: React.FC<ListProps> = (props) => {
const [TimeRange, setTimeRange] = useState<number>(0)
const [searchForm, setSearchForm] = useState<paramsType>({
logisticsOrderNo: '',
invoicesNo:'',
invoicesTimeStart:'',
invoicesNo: '',
invoicesTimeStart: '',
invoicesTimeEnd: '',
companyId: '',
status: ''
......@@ -148,7 +152,7 @@ const OrderList: React.FC<ListProps> = (props) => {
align: 'center',
key: 'logisticsOrderNo',
render: (text: any, reconds: any) =>
<span className="commonPickColor" onClick={() => handleSee(reconds.id)}>{text}&nbsp;<EyeOutlined /></span>
<span className="commonPickColor" onClick={() => handleSee(reconds.id)}>{text}&nbsp;<EyeOutlined /></span>
},
{
......@@ -191,14 +195,15 @@ const OrderList: React.FC<ListProps> = (props) => {
title: '单据时间',
align: 'center',
dataIndex: 'invoicesTime',
key: 'invoicesTime'
key: 'invoicesTime',
render: (text: any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
},
{
title: '外部状态',
align: 'center',
dataIndex: 'status',
key: 'status',
render: (text:any,reconds: any) => {
render: (text: any, reconds: any) => {
let component: ReactNode = null
if (text == 3) {
component = <><span style={statuStyle.success}>接受物流单</span></>
......@@ -222,8 +227,8 @@ const OrderList: React.FC<ListProps> = (props) => {
{
(record.status === 1 || record.status === 4) &&
<Button type="link" onClick={() => toEdit(record.id)}>编辑</Button>
<Button type="link" onClick={() => toEdit(record.id)}>编辑</Button>
}
{
......@@ -237,10 +242,10 @@ const OrderList: React.FC<ListProps> = (props) => {
<Button type='link'>提交</Button>
</>
}
</>
)
}
}
}
];
......@@ -264,9 +269,16 @@ const OrderList: React.FC<ListProps> = (props) => {
}
})
return () => {
}
}, [])
//生命周期
useEffect(() => {
ref.current.reload()
return () => {
}
}, [TimeRange])
const onDefaultChange = (id: any, checked: boolean) => {
console.log(id, checked)
......@@ -274,8 +286,8 @@ const OrderList: React.FC<ListProps> = (props) => {
})
}
const handleDelete = (id:number | string) => {
PublicApi.postLogisticsOrderWaitSubmitDelete({id:id}).then(res => {
const handleDelete = (id: number | string) => {
PublicApi.postLogisticsOrderWaitSubmitDelete({ id: id }).then(res => {
ref.current.reload()
})
}
......@@ -311,9 +323,9 @@ const OrderList: React.FC<ListProps> = (props) => {
}
setSearchForm({ ...searchForm })
}
const handleChange = (key:any,val:any) => {
const handleChange = (key: any, val: any) => {
let obj = {}
switch(key){
switch (key) {
case 'logisticsOrderNo':
obj = { ...searchForm, logisticsOrderNo: val }
break;
......@@ -338,7 +350,7 @@ const OrderList: React.FC<ListProps> = (props) => {
<PageHeaderWrapper>
<Card>
<StandardTable
tableProps={{rowKey:'id'}}
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
......@@ -358,9 +370,9 @@ const OrderList: React.FC<ListProps> = (props) => {
</Button>
</Col>
<Col span={10}
offset={6}
style={{textAlign:'right'}}
>
offset={6}
style={{ textAlign: 'right' }}
>
<Tooltip trigger={['focus']} placement='top'
title='输入物流单号、订单号进行搜索'>
<Input.Search
......@@ -368,7 +380,7 @@ const OrderList: React.FC<ListProps> = (props) => {
value={searchForm.logisticsOrderNo}
placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, logisticsOrderNo: e.target.value })}
onSearch={(val) => handleChange('logisticsOrderNo',val)}
onSearch={(val) => handleChange('logisticsOrderNo', val)}
/>
</Tooltip>
<Button className={style['filter-btn']} onClick={() => setIsSearch(isSearch = !isSearch)}>
......@@ -378,23 +390,23 @@ const OrderList: React.FC<ListProps> = (props) => {
<Row style={{ margin: '16px 0' }}>
{
isSearch &&
<Col
<Col
offset={2}
span={22}
>
<Space size={16}>
<Input.Search
<Input.Search
style={{ width: '232px' }}
value={searchForm.invoicesNo}
placeholder='输入对应单号进行搜索'
onChange={(e) => setSearchForm({ ...searchForm, invoicesNo: e.target.value })}
onSearch={(val) => handleChange('invoicesNo',val)}
onSearch={(val) => handleChange('invoicesNo', val)}
/>
<Select
className={style.select}
value={searchForm.companyId}
showSearch
onChange={(val) => handleChange('companyId',val)}
onChange={(val) => handleChange('companyId', val)}
optionFilterProp='children'
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
......@@ -402,18 +414,26 @@ const OrderList: React.FC<ListProps> = (props) => {
>
<Option value=''>物流服务商(全部)</Option>
{
companyList.map((item, index) => {
return <Option key={index} value={item.id}>{item.name}</Option>
})
}
companyList.map((item, index) => {
return <Option key={index} value={item.id}>{item.name}</Option>
})
}
</Select>
<Select
className={style.select}
value={TimeRange}
onChange={(val) => setTimeRange(val)}
onChange={(val) => {
setTimeRange(val),
setSearchForm({
...searchForm,
invoicesTimeStart: timeRange(val).st,
invoicesTimeEnd: timeRange(val).et
})
}}
>
{
TimeList.map((item,index) => {
TimeList.map((item, index) => {
return <Option key={index} value={item.value}>{item.label}</Option>
})
}
......
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import {
Tooltip,
Input,
Select,
Button,
Card,
Dropdown,
Menu,
Row,
Col,
Popconfirm,
} from 'antd';
import {
PlusOutlined,
EyeOutlined,
UpOutlined,
DeleteOutlined,
DownOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
const Bills: React.FC<{}> = () => {
return <div>Bills</div>;
};
export default Bills;
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import {
Tooltip,
Input,
Select,
Button,
Card,
Dropdown,
Menu,
Row,
Col,
Popconfirm,
} from 'antd';
import {
PlusOutlined,
EyeOutlined,
UpOutlined,
DeleteOutlined,
DownOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
const BillsType: React.FC<{}> = () => {
return <div>BillsType</div>;
};
export default BillsType;
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import {
Tooltip,
Input,
Select,
Button,
Card,
Dropdown,
Menu,
Row,
Col,
Popconfirm,
} from 'antd';
import {
PlusOutlined,
EyeOutlined,
UpOutlined,
DeleteOutlined,
DownOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
const Inventory: React.FC<{}> = () => {
return <div>Inventory</div>;
};
export default Inventory;
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import {
Tooltip,
Input,
Select,
Button,
Card,
Dropdown,
Menu,
Row,
Col,
Popconfirm,
} from 'antd';
import {
PlusOutlined,
EyeOutlined,
UpOutlined,
DeleteOutlined,
DownOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
const WareHouse: React.FC<{}> = () => {
return <div>warehouse</div>;
};
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