Commit 8259463b authored by 前端-许佳敏's avatar 前端-许佳敏
parents 9e77a786 4bbe31a5
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
# mockStatic # mockStatic
/.idea /.idea
src/services/index.ts
config/base.config.json config/base.config.json
/src/services/index.ts /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 @@ ...@@ -7,9 +7,10 @@
import CommodityRoute from './commodityRoute' // 商品能力路由 import CommodityRoute from './commodityRoute' // 商品能力路由
import MemberRoute from './memberRoute' // 会员能力路由 import MemberRoute from './memberRoute' // 会员能力路由
import ShopRoute from './shopRoute' // 店铺能力路由 import ShopRoute from './shopRoute' // 店铺能力路由
import TranactionRoute from './tranactionRoute' // 交易能力路由
import LogisticsRoute from './logisticsRoutes' // 物流能力路由 import LogisticsRoute from './logisticsRoutes' // 物流能力路由
const routes = [CommodityRoute, MemberRoute, ShopRoute, LogisticsRoute] const routes = [CommodityRoute, MemberRoute, ShopRoute, TranactionRoute, LogisticsRoute]
const memberCenterRoute = { const memberCenterRoute = {
path: '/memberCenter', 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 { ...@@ -65,6 +65,14 @@ export default {
'menu.shopAbility.shopInfoManage': '店铺信息', 'menu.shopAbility.shopInfoManage': '店铺信息',
'menu.shopAbility.shopTemplate': '店铺装修模板', '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': '物流',
'menu.logisticsAbility.logistics': '物流管理', 'menu.logisticsAbility.logistics': '物流管理',
......
...@@ -7,10 +7,13 @@ import { ...@@ -7,10 +7,13 @@ import {
} from '@formily/antd' } from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components' import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { values } from 'mobx'; import { values } from 'mobx';
import {PublicApi} from '@/services/api'
export interface Params { export interface Params {
dialogVisible: boolean, id: number | string;
onCancel: Function, dialogVisible: boolean;
dontReceive?: boolean //默认展示 onCancel: Function;
onOK?: Function;
dontReceive?: boolean; //默认展示
} }
const actions = createFormActions() const actions = createFormActions()
const {onFieldChange$} = FormEffectHooks const {onFieldChange$} = FormEffectHooks
...@@ -19,9 +22,15 @@ const comfirmDialog: React.FC<Params> = (props) => { ...@@ -19,9 +22,15 @@ const comfirmDialog: React.FC<Params> = (props) => {
const handleCancel = () => { const handleCancel = () => {
} }
const handletOk = (values:any) => { const handletOk = (values:any) => {
let value = {...values}
value.id = props.id
console.log(values) console.log(values)
actions.submit() PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
props.onCancel() if(res.code === 1000){
props.onOK()
}
})
} }
useEffect(() => { useEffect(() => {
return () => { return () => {
...@@ -29,9 +38,9 @@ const comfirmDialog: React.FC<Params> = (props) => { ...@@ -29,9 +38,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
}, []) }, [])
const useFormEffects = () => { const useFormEffects = () => {
const { setFieldState } = createFormActions() const { setFieldState } = createFormActions()
onFieldChange$('radio').subscribe(({value}) => { onFieldChange$('status').subscribe(({value}) => {
setFieldState('remarkOption',state => { setFieldState('remarkOption',state => {
if(value == 1){ if(value == 3){
state.visible = false state.visible = false
}else{ }else{
state.visible = true state.visible = true
...@@ -46,7 +55,7 @@ const comfirmDialog: React.FC<Params> = (props) => { ...@@ -46,7 +55,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
title='单据确认' title='单据确认'
width={800} width={800}
visible={props.dialogVisible} visible={props.dialogVisible}
onOk={handletOk} onOk={() => actions.submit()}
onCancel={() => props.onCancel()} onCancel={() => props.onCancel()}
destroyOnClose destroyOnClose
afterClose={() => actions.reset()} afterClose={() => actions.reset()}
...@@ -58,21 +67,22 @@ const comfirmDialog: React.FC<Params> = (props) => { ...@@ -58,21 +67,22 @@ const comfirmDialog: React.FC<Params> = (props) => {
}} }}
actions={actions} actions={actions}
effects={() => useFormEffects()} effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values) onSubmit={(values) => handletOk(values) }
} initialValues={{
status: 3
}}
> >
<Field <Field
enum={ enum={
[ [
{ label: '接受物流单', value:1 }, { label: '接受物流单', value:3},
{ label: '不接受物流单', value:2 } { label: '不接受物流单', value:4 }
]} ]}
name='radio' name='status'
required required
x-component="Radio" x-component="Radio"
/> />
{props.dontReceive && {props.dontReceive &&
<FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top">
<Field <Field
...@@ -80,6 +90,7 @@ const comfirmDialog: React.FC<Params> = (props) => { ...@@ -80,6 +90,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
x-component="TextArea" x-component="TextArea"
required required
x-component-props={{ x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字' placeholder: '在此输入你的内容,最多60个汉字'
}} }}
x-rules={value => { x-rules={value => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-18 15:55:51 * @Date: 2020-07-18 15:55:51
* @LastEditors: LeeJiancong * @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 React, { useState, useEffect, useRef, ReactNode } from 'react';
import { Card, Button, Row, Col, Tooltip, Input, Select, Tag, Space } from 'antd' import { Card, Button, Row, Col, Tooltip, Input, Select, Tag, Space } from 'antd'
...@@ -16,6 +16,7 @@ import { hidden } from 'chalk'; ...@@ -16,6 +16,7 @@ import { hidden } from 'chalk';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import {timeRange} from '@/utils/index' import {timeRange} from '@/utils/index'
import statuStyle from '../colorTag' import statuStyle from '../colorTag'
import moment from 'moment'
let { Option } = Select let { Option } = Select
export interface listProps { export interface listProps {
title?: ReactNode, title?: ReactNode,
...@@ -47,7 +48,7 @@ interface paramsType { ...@@ -47,7 +48,7 @@ interface paramsType {
const orderSearchList: React.FC<listProps> = (props) => { const orderSearchList: React.FC<listProps> = (props) => {
console.log(props) console.log(props)
const ref = useRef({}) const ref = useRef<any>({})
const [selectRow, setSelectRow] = useState<Item[]>([]) const [selectRow, setSelectRow] = useState<Item[]>([])
const TimeList = [ const TimeList = [
{ {
...@@ -155,12 +156,6 @@ const orderSearchList: React.FC<listProps> = (props) => { ...@@ -155,12 +156,6 @@ const orderSearchList: React.FC<listProps> = (props) => {
* @return: * @return:
*/ */
useEffect(() => { useEffect(() => {
let timeRanges = timeRange(TimeRange);
setSearchForm({
...searchForm,
invoicesTimeStart: timeRanges.st,
invoicesTimeEnd: timeRanges.et
});
console.log(searchForm) console.log(searchForm)
if(props.type === '1'){ if(props.type === '1'){
PublicApi.getLogisticsSelectListCompany().then(res => { PublicApi.getLogisticsSelectListCompany().then(res => {
...@@ -186,7 +181,14 @@ const orderSearchList: React.FC<listProps> = (props) => { ...@@ -186,7 +181,14 @@ const orderSearchList: React.FC<listProps> = (props) => {
return () => { return () => {
} }
}, [])
useEffect(() => {
ref.current.reload()
return () => {
}
}, [TimeRange]) }, [TimeRange])
const handleSee = (id: number) => { const handleSee = (id: number) => {
if (props.type === '1') { if (props.type === '1') {
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil?id=${id}`) history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitDeatil?id=${id}`)
...@@ -248,7 +250,8 @@ const orderSearchList: React.FC<listProps> = (props) => { ...@@ -248,7 +250,8 @@ const orderSearchList: React.FC<listProps> = (props) => {
title: '单据时间', title: '单据时间',
align: 'left', align: 'left',
dataIndex: 'invoicesTime', dataIndex: 'invoicesTime',
key: 'invoicesTime' key: 'invoicesTime',
render: (text:any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
}, },
{ {
title: '外部状态', title: '外部状态',
...@@ -318,19 +321,36 @@ const orderSearchList: React.FC<listProps> = (props) => { ...@@ -318,19 +321,36 @@ const orderSearchList: React.FC<listProps> = (props) => {
ref.current.reload(obj) ref.current.reload(obj)
} }
const handleChangeTime = (val:number) =>{
console.log('选择箱时间',val)
setTimeRange(val)
let timeRanges = timeRange(TimeRange)
console.log('时间范围',timeRanges)
setSearchForm({ const changeTimeRange = (val:any) => {
...searchForm, console.log(val)
invoicesTimeStart: timeRanges.st, setTimeRange(val)
invoicesTimeEnd: timeRanges.et 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(); 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 = () => { const handleReset = () => {
for (let key in searchForm) { for (let key in searchForm) {
searchForm[key] = '' searchForm[key] = ''
...@@ -346,7 +366,7 @@ const orderSearchList: React.FC<listProps> = (props) => { ...@@ -346,7 +366,7 @@ const orderSearchList: React.FC<listProps> = (props) => {
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
formAlign='left' formAlign='left'
rowSelection={rowSelection} // rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
rowClassName="editable-row" rowClassName="editable-row"
controlRender={ controlRender={
...@@ -427,7 +447,17 @@ const orderSearchList: React.FC<listProps> = (props) => { ...@@ -427,7 +447,17 @@ const orderSearchList: React.FC<listProps> = (props) => {
<Select <Select
className={style.select} className={style.select}
value={TimeRange} value={TimeRange}
onChange={(val) => handleChangeTime(val)} onChange={(val) =>{
setTimeRange(val),
setSearchForm({
...searchForm,
invoicesTimeStart: timeRange(val).st,
invoicesTimeEnd: timeRange(val).et
})
}
}
> >
{ {
TimeList.map((item,index) => { TimeList.map((item,index) => {
......
...@@ -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-30 20:17:59 * @LastEditTime: 2020-07-31 19:27:46
*/ */
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'
...@@ -25,6 +25,8 @@ import { StandardTable } from 'god' ...@@ -25,6 +25,8 @@ import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController' import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { timeRange} from '@/utils/index'
import moment from 'moment'
import statuStyle from '../colorTag' import statuStyle from '../colorTag'
import style from '../components/index.less' import style from '../components/index.less'
const { Option } = Select const { Option } = Select
...@@ -67,6 +69,15 @@ export interface ListType { ...@@ -67,6 +69,15 @@ export interface ListType {
checked: boolean //可选 checked: boolean //可选
} }
interface paramsType {
logisticsOrderNo?: string;
invoicesTimeStart?: any;
invoicesTimeEnd?: any;
status?: number | string;
shipperId?: any;
}
interface EditableCellProps extends React.HTMLAttributes<HTMLElement> { interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
editing: boolean; editing: boolean;
dataIndex: string; dataIndex: string;
...@@ -117,22 +128,24 @@ const EditableCell: React.FC<EditableCellProps> = ({ ...@@ -117,22 +128,24 @@ const EditableCell: React.FC<EditableCellProps> = ({
const OrderList: React.FC<ListProps> = (props) => { const OrderList: 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('');
const [orderid, setOrderid] = useState(null)
let [visible, setvisible] = useState<boolean>(false) let [visible, setvisible] = useState<boolean>(false)
let [isSearch, setIsSearch] = useState<boolean>(false) let [isSearch, setIsSearch] = useState<boolean>(false)
const [searchForm, setSearchForm] = useState({ const [TimeRange, setTimeRange] = useState<number>(0)
searName: '', const [searchForm, setSearchForm] = useState<paramsType>({
buyer: '',//收货商 logisticsOrderNo: '',
dateSelect: '', shipperId: '',//收货商
outSideStatus: '', status: '',
TimeRange: '' invoicesTimeStart: '',
invoicesTimeEnd: ''
}) })
const TimeList = [ const TimeList = [
{ {
label: '单据时间(全部)', value: '' label: '单据时间(全部)', value: 0
}, },
{ {
label: '今天', value: 1 label: '今天', value: 1
...@@ -222,7 +235,8 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -222,7 +235,8 @@ const OrderList: React.FC<ListProps> = (props) => {
title: '单据时间', title: '单据时间',
align: 'center', align: 'center',
dataIndex: 'invoicesTime', dataIndex: 'invoicesTime',
key: 'invoicesTime' key: 'invoicesTime',
render: (text:any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
}, },
{ {
title: '外部状态', title: '外部状态',
...@@ -271,14 +285,13 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -271,14 +285,13 @@ const OrderList: React.FC<ListProps> = (props) => {
} }
//生命周期 //生命周期
useEffect(() => { useEffect(() => {
ref.current.reload()
return () => { return () => {
} }
}, []) }, [TimeRange])
const handleDialog = (id: any) => { const handleDialog = (id: any) => {
setOrderid(id)
setvisible(true) setvisible(true)
} }
const onDefaultChange = (id: any, checked: boolean) => { const onDefaultChange = (id: any, checked: boolean) => {
...@@ -316,6 +329,11 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -316,6 +329,11 @@ const OrderList: React.FC<ListProps> = (props) => {
setSearchForm({ ...searchForm }) setSearchForm({ ...searchForm })
} }
const handleModalOK = () => {
setvisible(false)
ref.current.reload()
}
const onCancel = () => { const onCancel = () => {
setvisible(false) setvisible(false)
...@@ -344,9 +362,9 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -344,9 +362,9 @@ const OrderList: React.FC<ListProps> = (props) => {
title={props.type === '1' ? '输入物流单号、订单号进行搜索' : '输入物流单号、发货方进行搜索'}> title={props.type === '1' ? '输入物流单号、订单号进行搜索' : '输入物流单号、发货方进行搜索'}>
<Input.Search <Input.Search
style={{ width: '232px' }} style={{ width: '232px' }}
value={searchForm.searName} value={searchForm.logisticsOrderNo}
placeholder='搜索' placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })} onChange={(e) => setSearchForm({ ...searchForm, logisticsOrderNo: e.target.value })}
onSearch={() => handleSearch} onSearch={() => handleSearch}
/> />
</Tooltip> </Tooltip>
...@@ -363,8 +381,16 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -363,8 +381,16 @@ const OrderList: React.FC<ListProps> = (props) => {
<Space size={16}> <Space size={16}>
<Select <Select
className={style.select} className={style.select}
value={searchForm.TimeRange} value={TimeRange}
onChange={(val) => setSearchForm({ ...searchForm, TimeRange: val })} onChange={(val) => {
setTimeRange(val),
setSearchForm({
...searchForm,
invoicesTimeStart: timeRange(val).st,
invoicesTimeEnd: timeRange(val).et
})
}
}
> >
{ {
TimeList.map((item,index) => { TimeList.map((item,index) => {
...@@ -374,8 +400,8 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -374,8 +400,8 @@ const OrderList: React.FC<ListProps> = (props) => {
</Select> </Select>
<Select <Select
className={style.select} className={style.select}
value={searchForm.outSideStatus} value={searchForm.status}
onChange={(val) => setSearchForm({ ...searchForm, outSideStatus: val })} onChange={(val) => setSearchForm({ ...searchForm, status: val })}
> >
{ {
outSideStatusList.map((item,index) => { outSideStatusList.map((item,index) => {
...@@ -392,8 +418,10 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -392,8 +418,10 @@ const OrderList: React.FC<ListProps> = (props) => {
} }
/> />
<ConfirmModal <ConfirmModal
id={orderid}
dialogVisible={visible} dialogVisible={visible}
onCancel={() => setvisible(false)} onCancel={() => setvisible(false)}
onOK={() => handleModalOK()}
/> />
......
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
* @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-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 { history } from 'umi'
import { Modal, Row, Col, Card, Button, Form, InputNumber, import {
Radio, Tooltip, Popconfirm, Switch, Input,Select, Tag,Space } from 'antd'; Modal, Row, Col, Card, Button, Form, InputNumber,
Radio, Tooltip, Popconfirm, Switch, Input, Select, Tag, Space
} from 'antd';
import { import {
PlayCircleOutlined, PlayCircleOutlined,
PauseCircleOutlined, PauseCircleOutlined,
...@@ -24,8 +26,10 @@ import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableCon ...@@ -24,8 +26,10 @@ 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 moment from 'moment'
import { timeRange } from '@/utils/index'
import Index from '@/pages'; import Index from '@/pages';
let {Option} = Select let { Option } = Select
const data = [ const data = [
{ {
key: '1', key: '1',
...@@ -55,45 +59,45 @@ interface Item { ...@@ -55,45 +59,45 @@ interface Item {
} }
const TimeList = [ 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 = [ 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 { ...@@ -119,7 +123,7 @@ interface paramsType {
*/ */
const OrderList: React.FC<ListProps> = (props) => { const OrderList: 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 [selectTableRow, setSelectTableRow] = useState<any>([]) const [selectTableRow, setSelectTableRow] = useState<any>([])
...@@ -130,8 +134,8 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -130,8 +134,8 @@ const OrderList: React.FC<ListProps> = (props) => {
const [TimeRange, setTimeRange] = useState<number>(0) const [TimeRange, setTimeRange] = useState<number>(0)
const [searchForm, setSearchForm] = useState<paramsType>({ const [searchForm, setSearchForm] = useState<paramsType>({
logisticsOrderNo: '', logisticsOrderNo: '',
invoicesNo:'', invoicesNo: '',
invoicesTimeStart:'', invoicesTimeStart: '',
invoicesTimeEnd: '', invoicesTimeEnd: '',
companyId: '', companyId: '',
status: '' status: ''
...@@ -148,7 +152,7 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -148,7 +152,7 @@ const OrderList: React.FC<ListProps> = (props) => {
align: 'center', align: 'center',
key: 'logisticsOrderNo', key: 'logisticsOrderNo',
render: (text: any, reconds: any) => 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) => { ...@@ -191,14 +195,15 @@ const OrderList: React.FC<ListProps> = (props) => {
title: '单据时间', title: '单据时间',
align: 'center', align: 'center',
dataIndex: 'invoicesTime', dataIndex: 'invoicesTime',
key: 'invoicesTime' key: 'invoicesTime',
render: (text: any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
}, },
{ {
title: '外部状态', title: '外部状态',
align: 'center', align: 'center',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
render: (text:any,reconds: any) => { render: (text: any, reconds: any) => {
let component: ReactNode = null let component: ReactNode = null
if (text == 3) { if (text == 3) {
component = <><span style={statuStyle.success}>接受物流单</span></> component = <><span style={statuStyle.success}>接受物流单</span></>
...@@ -222,8 +227,8 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -222,8 +227,8 @@ const OrderList: React.FC<ListProps> = (props) => {
{ {
(record.status === 1 || record.status === 4) && (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) => { ...@@ -237,10 +242,10 @@ const OrderList: React.FC<ListProps> = (props) => {
<Button type='link'>提交</Button> <Button type='link'>提交</Button>
</> </>
} }
</> </>
) )
} }
} }
]; ];
...@@ -264,9 +269,16 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -264,9 +269,16 @@ const OrderList: React.FC<ListProps> = (props) => {
} }
}) })
return () => { return () => {
} }
}, []) }, [])
//生命周期
useEffect(() => {
ref.current.reload()
return () => {
}
}, [TimeRange])
const onDefaultChange = (id: any, checked: boolean) => { const onDefaultChange = (id: any, checked: boolean) => {
console.log(id, checked) console.log(id, checked)
...@@ -274,8 +286,8 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -274,8 +286,8 @@ const OrderList: React.FC<ListProps> = (props) => {
}) })
} }
const handleDelete = (id:number | string) => { const handleDelete = (id: number | string) => {
PublicApi.postLogisticsOrderWaitSubmitDelete({id:id}).then(res => { PublicApi.postLogisticsOrderWaitSubmitDelete({ id: id }).then(res => {
ref.current.reload() ref.current.reload()
}) })
} }
...@@ -311,9 +323,9 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -311,9 +323,9 @@ const OrderList: React.FC<ListProps> = (props) => {
} }
setSearchForm({ ...searchForm }) setSearchForm({ ...searchForm })
} }
const handleChange = (key:any,val:any) => { const handleChange = (key: any, val: any) => {
let obj = {} let obj = {}
switch(key){ switch (key) {
case 'logisticsOrderNo': case 'logisticsOrderNo':
obj = { ...searchForm, logisticsOrderNo: val } obj = { ...searchForm, logisticsOrderNo: val }
break; break;
...@@ -338,7 +350,7 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -338,7 +350,7 @@ const OrderList: React.FC<ListProps> = (props) => {
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
tableProps={{rowKey:'id'}} tableProps={{ rowKey: 'id' }}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
...@@ -358,9 +370,9 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -358,9 +370,9 @@ const OrderList: React.FC<ListProps> = (props) => {
</Button> </Button>
</Col> </Col>
<Col span={10} <Col span={10}
offset={6} offset={6}
style={{textAlign:'right'}} style={{ textAlign: 'right' }}
> >
<Tooltip trigger={['focus']} placement='top' <Tooltip trigger={['focus']} placement='top'
title='输入物流单号、订单号进行搜索'> title='输入物流单号、订单号进行搜索'>
<Input.Search <Input.Search
...@@ -368,7 +380,7 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -368,7 +380,7 @@ const OrderList: React.FC<ListProps> = (props) => {
value={searchForm.logisticsOrderNo} value={searchForm.logisticsOrderNo}
placeholder='搜索' placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, logisticsOrderNo: e.target.value })} onChange={(e) => setSearchForm({ ...searchForm, logisticsOrderNo: e.target.value })}
onSearch={(val) => handleChange('logisticsOrderNo',val)} onSearch={(val) => handleChange('logisticsOrderNo', val)}
/> />
</Tooltip> </Tooltip>
<Button className={style['filter-btn']} onClick={() => setIsSearch(isSearch = !isSearch)}> <Button className={style['filter-btn']} onClick={() => setIsSearch(isSearch = !isSearch)}>
...@@ -378,23 +390,23 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -378,23 +390,23 @@ const OrderList: React.FC<ListProps> = (props) => {
<Row style={{ margin: '16px 0' }}> <Row style={{ margin: '16px 0' }}>
{ {
isSearch && isSearch &&
<Col <Col
offset={2} offset={2}
span={22} span={22}
> >
<Space size={16}> <Space size={16}>
<Input.Search <Input.Search
style={{ width: '232px' }} style={{ width: '232px' }}
value={searchForm.invoicesNo} value={searchForm.invoicesNo}
placeholder='输入对应单号进行搜索' placeholder='输入对应单号进行搜索'
onChange={(e) => setSearchForm({ ...searchForm, invoicesNo: e.target.value })} onChange={(e) => setSearchForm({ ...searchForm, invoicesNo: e.target.value })}
onSearch={(val) => handleChange('invoicesNo',val)} onSearch={(val) => handleChange('invoicesNo', val)}
/> />
<Select <Select
className={style.select} className={style.select}
value={searchForm.companyId} value={searchForm.companyId}
showSearch showSearch
onChange={(val) => handleChange('companyId',val)} onChange={(val) => handleChange('companyId', val)}
optionFilterProp='children' optionFilterProp='children'
filterOption={(input, option) => filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
...@@ -402,18 +414,26 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -402,18 +414,26 @@ const OrderList: React.FC<ListProps> = (props) => {
> >
<Option value=''>物流服务商(全部)</Option> <Option value=''>物流服务商(全部)</Option>
{ {
companyList.map((item, index) => { companyList.map((item, index) => {
return <Option key={index} value={item.id}>{item.name}</Option> return <Option key={index} value={item.id}>{item.name}</Option>
}) })
} }
</Select> </Select>
<Select <Select
className={style.select} className={style.select}
value={TimeRange} 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> 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