Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
c7b3d5e8
Commit
c7b3d5e8
authored
Dec 09, 2020
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
待新增物流单修改
parent
e25588a3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
586 additions
and
77 deletions
+586
-77
index.tsx
src/components/ModalTable/index.tsx
+6
-2
index.ts
src/components/ModalTable/schema/index.ts
+80
-4
ModalTableOrder.tsx
...ics/logisticsSubmit/detail/components/ModalTableOrder.tsx
+215
-0
basicInfo.tsx
...logistics/logisticsSubmit/detail/components/basicInfo.tsx
+53
-24
goods.tsx
...ges/logistics/logisticsSubmit/detail/components/goods.tsx
+138
-17
index.tsx
src/pages/logistics/logisticsSubmit/detail/index.tsx
+78
-13
index.tsx
src/pages/transaction/inquiryQuote/schema/index.tsx
+12
-13
pendingReview.tsx
src/pages/transaction/inquiryQuote/schema/pendingReview.tsx
+4
-4
No files found.
src/components/ModalTable/index.tsx
View file @
c7b3d5e8
...
...
@@ -3,7 +3,7 @@ import {StandardTable} from 'god';
import
NestTable
from
'@/components/NestTable'
;
import
{
IStandardTableProps
}
from
'god/dist/src/standard-table'
;
import
{
Row
,
Col
,
Modal
}
from
'antd'
;
import
{
productModalSchema
,
productModalByMemberSchema
,
memberModalSchema
,
inquirySchema
,
demandSchema
,
enquirySchema
,
mergeOrderSchema
,
goodsModalSchema
,
demandNumberSchema
}
from
'./schema'
;
import
{
productModalSchema
,
productModalByMemberSchema
,
memberModalSchema
,
inquirySchema
,
demandSchema
,
enquirySchema
,
mergeOrderSchema
,
goodsModalSchema
,
demandNumberSchema
,
logisticsDeliverySearchSchema
}
from
'./schema'
;
import
Search
from
'../NiceForm/components/Search'
;
import
SearchSelect
from
'../NiceForm/components/SearchSelect'
;
import
Submit
from
'../NiceForm/components/Submit'
;
...
...
@@ -18,7 +18,7 @@ export interface ModalTableProps extends IStandardTableProps<any> {
cancel
?(),
visible
?:
boolean
,
resetModal
?:
object
,
modalType
?:
'productByDefault'
|
'productByMember'
|
'memberByDefault'
|
'inquiryByDefault'
|
'demandByDefault'
|
'enquiryModel'
|
'MergeOrderByDefault'
|
'goodsModalSchema'
|
'demandNumberSchema'
|
'none'
,
modalType
?:
'productByDefault'
|
'productByMember'
|
'memberByDefault'
|
'inquiryByDefault'
|
'demandByDefault'
|
'enquiryModel'
|
'MergeOrderByDefault'
|
'goodsModalSchema'
|
'demandNumberSchema'
|
'
logisticsDelivery'
|
'
none'
,
useNestTable
?:
boolean
,
// 是否使用嵌套表格
nestColumns
?:
any
[],
nestTableProps
?:
any
,
...
...
@@ -76,6 +76,10 @@ const ModalTable:React.FC<ModalTableProps> = (props) => {
case
'demandNumberSchema'
:
{
return
demandNumberSchema
}
case
'logisticsDelivery'
:
{
return
logisticsDeliverySearchSchema
}
case
'none'
:
{
return
{}
}
...
...
src/components/ModalTable/schema/index.ts
View file @
c7b3d5e8
...
...
@@ -285,8 +285,8 @@ export const inquirySchema: ISchema = {
/**
* @description: 新增报价单 需求单查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export
const
enquirySchema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -526,4 +526,81 @@ export const demandNumberSchema: ISchema = {
}
}
}
}
\ No newline at end of file
}
/** 物流选择发货单 */
export
const
logisticsDeliverySearchSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
invoicesNo
:
{
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'发货单号'
,
align
:
'flex-left'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
style
:
{
marginRight
:
0
}
},
colStyle
:
{
marginTop
:
20
,
},
},
properties
:
{
orderNo
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'对应订单号'
,
style
:
{
width
:
160
}
}
},
invoicesAbstract
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'单据摘要'
,
style
:
{
width
:
160
}
}
},
inventoryId
:
{
type
:
'string'
,
"x-component"
:
'SearchSelect'
,
'x-component-props'
:
{
placeholder
:
'单据类型'
,
fetchSearch
:
PublicApi
.
getWarehouseInvoicesTypeAll
,
style
:
{
width
:
160
}
},
},
"[startTransactionTime,endTransactionTime]"
:
{
type
:
'string'
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
'单据时间(全部)'
,
}
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
}
}
}
}
}
src/pages/logistics/logisticsSubmit/detail/components/ModalTableOrder.tsx
0 → 100644
View file @
c7b3d5e8
import
React
,
{
ReactText
,
useRef
,
useEffect
,
useLayoutEffect
,
useState
}
from
'react'
;
import
{
StandardTable
}
from
'god'
;
import
{
ISchema
}
from
'@formily/antd'
;
import
NestTable
from
'@/components/NestTable'
;
import
{
IStandardTableProps
}
from
'god/dist/src/standard-table'
;
import
{
Row
,
Col
,
Modal
,
Form
,
Radio
}
from
'antd'
;
import
Search
from
'@/components//NiceForm/components/Search'
;
import
SearchSelect
from
'@/components//NiceForm/components/SearchSelect'
;
import
Submit
from
'@/components//NiceForm/components/Submit'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
DateSelect
from
'@/components//NiceForm/components/DateSelect'
;
import
{
PublicApi
}
from
'@/services/api'
;
export
interface
ModalTableProps
extends
IStandardTableProps
<
any
>
{
width
?:
number
,
confirm
?:
Function
,
cancel
?(),
visible
?:
boolean
,
resetModal
?:
object
,
modalType
?:
'none'
,
useNestTable
?:
boolean
,
// 是否使用嵌套表格
nestColumns
?:
any
[],
nestTableProps
?:
any
,
// fix: 新增参数, 为true时每次开启弹窗都会重新reload接口
forceRender
?:
boolean
,
searchName
?:
string
}
export
const
logisticsDeliverySearchSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
invoicesNo
:
{
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'单据号'
,
align
:
'flex-left'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
style
:
{
marginRight
:
0
}
},
colStyle
:
{
marginTop
:
20
,
},
},
properties
:
{
orderNo
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'会员名称'
,
style
:
{
width
:
160
}
}
},
invoicesAbstract
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'单据摘要'
,
style
:
{
width
:
160
}
}
},
"[startTransactionTime,endTransactionTime]"
:
{
type
:
'string'
,
"x-component"
:
"dateSelect"
,
"x-component-props"
:
{
placeholder
:
'单据时间(全部)'
,
}
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
}
}
}
}
}
const
ModalTableOrder
:
React
.
FC
<
ModalTableProps
>
=
(
props
)
=>
{
const
{
width
=
704
,
confirm
,
cancel
,
visible
,
currentRef
,
resetModal
,
modalType
=
'none'
,
forceRender
,
useNestTable
=
false
,
nestColumns
,
nestTableProps
,
searchName
,
...
resetTable
}
=
props
const
selfRef
=
currentRef
||
useRef
<
any
>
({})
useEffect
(()
=>
{
if
(
visible
&&
forceRender
)
{
// 重新开启时需reload接口
// fix: 去掉自动reload接口, 防止重复请求
// fix: 新增forceRender接口, 用于控制弹窗是否需要reload
selfRef
.
current
.
reload
&&
selfRef
.
current
.
reload
()
}
else
{
selfRef
.
current
.
resetField
&&
selfRef
.
current
.
resetField
({
validate
:
false
})
}
},
[
visible
])
const
[
form
]
=
Form
.
useForm
();
const
[
type
,
setType
]
=
useState
<
number
>
(
1
);
const
[
modalTitle
,
setmodalTitle
]
=
useState
<
string
>
(
'订单'
);
const
modelSchemaRender
=
()
=>
{
switch
(
modalType
)
{
case
'none'
:
{
return
logisticsDeliverySearchSchema
}
}
}
useEffect
(()
=>
{
form
.
setFieldsValue
({
radio
:
type
})
fetchData
()
},
[
type
])
const
fetchData
=
(
parmas
?:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
switch
(
type
)
{
case
1
:
PublicApi
.
getOrderLogisticsOrderList
({...
parmas
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
break
;
case
2
:
break
;
case
3
:
break
;
case
4
:
break
;
}
})
}
return
(
<
Modal
width=
{
width
}
title=
{
modalTitle
}
onOk=
{
()
=>
confirm
(
type
)
}
onCancel=
{
cancel
}
visible=
{
visible
}
{
...
resetModal
}
>
{
useNestTable
?
(
<
NestTable
NestColumns=
{
nestColumns
}
className=
"common_tb"
rowClassName=
{
(
_
,
index
)
=>
(
index
%
2
)
===
0
&&
"tb_bg"
}
{
...
nestTableProps
}
/>
)
:
(
<
StandardTable
tableType=
'small'
currentRef=
{
selfRef
}
fetchTableData=
{
(
params
)
=>
fetchData
(
params
)
}
formRender=
{
(
child
,
ps
)
=>
<
Row
justify=
'space-between'
style=
{
{
marginBottom
:
16
}
}
>
<
Col
span=
{
18
}
style=
{
{
zIndex
:
99
}
}
>
<
Form
form=
{
form
}
>
<
Form
.
Item
name=
'radio'
label=
'单据选择'
>
<
Radio
.
Group
onChange=
{
(
e
)
=>
setType
(
e
.
target
.
value
)
}
>
<
Radio
value=
{
1
}
>
订单
</
Radio
>
<
Radio
value=
{
2
}
>
换货申请单(退货发货)
</
Radio
>
<
Radio
value=
{
3
}
>
换货申请单(换货发货)
</
Radio
>
<
Radio
value=
{
4
}
>
退货申请单
</
Radio
>
</
Radio
.
Group
>
</
Form
.
Item
>
</
Form
>
</
Col
>
<
Col
style=
{
{
marginTop
:
4
}
}
>
{
ps
}
</
Col
>
<
Col
span=
{
18
}
style=
{
{
zIndex
:
99
}
}
>
{
child
}
</
Col
>
</
Row
>
}
formilyProps=
{
{
ctx
:
{
schema
:
modelSchemaRender
(),
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
,
DateSelect
},
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
searchName
?
searchName
:
'name'
,
FORM_FILTER_PATH
,
);
}
}
}
}
{
...
resetTable
}
/>
)
}
</
Modal
>
)
}
ModalTableOrder
.
defaultProps
=
{}
export
default
ModalTableOrder
src/pages/logistics/logisticsSubmit/detail/components/basicInfo.tsx
View file @
c7b3d5e8
...
...
@@ -4,13 +4,14 @@
* @Author: HJX
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Input
,
Button
,
Select
}
from
'antd'
;
import
{
Form
,
Input
,
Select
}
from
'antd'
;
import
moment
from
'moment'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
LinkOutlined
}
from
'@ant-design/icons'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
ShippingModal
from
'../../../components/sumbitOrderModal'
;
import
InvoicesModal
from
'../../../components/sumbitOrderModal'
;
import
ModalTable
from
'@/components/ModalTable'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
ModalTableOrder
from
'./ModalTableOrder'
;
const
{
Search
}
=
Input
;
const
{
Option
}
=
Select
;
const
layout
:
any
=
{
...
...
@@ -22,15 +23,18 @@ const layout: any = {
export
interface
interfaceinfo
{
set
?:
any
,
currentRef
?:
any
,
onGet
?:
Function
onGet
?:
Function
,
onBadge
?:
Function
,
}
const
BasicInfo
:
React
.
FC
<
interfaceinfo
>
=
(
props
)
=>
{
const
{
set
,
currentRef
,
onGet
}
=
props
;
const
{
set
,
currentRef
,
onGet
,
onBadge
}
=
props
;
const
[
listcompany
,
setlistcompany
]
=
useState
<
any
>
([]);
//物流服务商
const
[
shipperaddress
,
setshipperaddress
]
=
useState
<
any
>
([]);
//发货地址
const
[
shippingvisible
,
setshippingvisible
]
=
useState
<
boolean
>
(
false
);
const
[
invoicesvisible
,
setinvoicesvisible
]
=
useState
<
boolean
>
(
false
);
const
[
shippingRowSelection
,
shippingRowCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
,
type
:
'radio'
});
const
[
invoicesRowSelection
,
invoicesRowCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
,
type
:
'radio'
});
const
[
form
]
=
Form
.
useForm
();
//获取物流服务商
const
getListCompany
=
()
=>
{
...
...
@@ -109,18 +113,20 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
}
]
// 确定
const
handleShipping
=
(
type
:
any
,
values
:
any
,
param
:
any
)
=>
{
const
handleShipping
=
()
=>
{
const
selectRow
=
shippingRowCtl
.
selectRow
[
0
]
form
.
setFieldsValue
({
shipmentOrderCode
:
values
[
0
]
.
invoicesNo
shipmentOrderCode
:
selectRow
.
invoicesNo
})
onGet
(
values
[
0
]
,
2
);
onGet
(
selectRow
,
2
);
setshippingvisible
(
false
);
}
const
handleInvoices
=
(
type
:
any
,
values
:
any
,
param
:
any
)
=>
{
const
handleInvoices
=
(
type
:
number
)
=>
{
const
selectRow
=
invoicesRowCtl
.
selectRow
[
0
]
form
.
setFieldsValue
({
invoicesNo
:
values
[
0
]
.
orderNo
invoicesNo
:
selectRow
.
orderNo
})
onGet
(
values
[
0
],
3
);
onGet
(
selectRow
,
3
,
type
);
setinvoicesvisible
(
false
);
}
...
...
@@ -154,6 +160,17 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
}
})
/** 选择发货单 列表数据 */
const
fetchShippingData
=
(
params
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
PublicApi
.
getWarehouseInvoicesList
({
...
params
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
}
return
(
<>
<
Form
...
...
@@ -167,7 +184,7 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
<
Select
allowClear
onChange=
{
(
value
,
option
)
=>
onGet
(
option
,
1
)
}
>
{
listcompany
.
map
((
item
:
any
,
index
:
number
)
=>
(
<
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Option
>
<
Option
roleid=
{
item
.
roleId
}
memberid=
{
item
.
memberId
}
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>
...
...
@@ -198,21 +215,33 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
<
Form
.
Item
label=
"单据时间"
name=
'voucherTime'
><
span
></
span
></
Form
.
Item
>
<
Form
.
Item
label=
"外部状态"
name=
'externalState'
><
span
></
span
></
Form
.
Item
>
</
Form
>
<
ShippingModal
title=
'选择发货单'
{
/* 选择发货单弹框 */
}
<
ModalTable
width=
{
900
}
modalTitle=
'选择发货单'
columns=
{
shippingColumns
}
type=
{
2
}
onOk=
{
(
type
,
values
,
param
)
=>
handleShipping
(
type
,
values
,
param
)
}
dialogVisible=
{
shippingvisible
}
onCancel=
{
()
=>
setshippingvisible
(
false
)
}
visible=
{
shippingvisible
}
rowSelection=
{
shippingRowSelection
}
cancel=
{
()
=>
setshippingvisible
(
false
)
}
confirm=
{
handleShipping
}
fetchTableData=
{
params
=>
fetchShippingData
(
params
)
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'id'
}
}
modalType=
'logisticsDelivery'
searchName=
'invoicesNo'
/>
<
InvoicesModal
title=
'选择订单'
{
/* 选择订单/换货申请单(退货发货)/换货申请单(换货发货)/退货申请单 */
}
<
ModalTableOrder
width=
{
900
}
visible=
{
invoicesvisible
}
columns=
{
invoicesColumns
}
type=
{
1
}
onOk=
{
(
type
,
values
,
param
)
=>
handleInvoices
(
type
,
values
,
param
)
}
dialogVisible=
{
invoicesvisible
}
onCancel=
{
()
=>
setinvoicesvisible
(
false
)
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'id'
}
}
modalType=
'none'
searchName=
'invoicesNo'
rowSelection=
{
invoicesRowSelection
}
cancel=
{
()
=>
setinvoicesvisible
(
false
)
}
confirm=
{
handleInvoices
}
/>
</>
)
...
...
src/pages/logistics/logisticsSubmit/detail/components/goods.tsx
View file @
c7b3d5e8
import
React
from
'react'
;
import
{
Button
,
Input
,
Table
,
Row
,
Col
,
Statistic
}
from
'antd'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Button
,
Input
,
Table
,
Row
,
Col
,
Statistic
,
message
,
Form
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
ModalTable
from
'@/components/ModalTable'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
interface
goodsParamsProps
{
currentRef
?:
any
,
set
?:
any
set
?:
any
,
onGet
?:
Function
,
onBadge
?:
Function
,
}
const
AddGoods
:
React
.
FC
<
goodsParamsProps
>
=
(
props
)
=>
{
const
{
currentRef
,
set
,
onGet
,
onBadge
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
visible
,
setvisible
]
=
useState
<
boolean
>
(
false
);
const
[
rowSelection
,
SelectionRowCtl
]
=
useRowSelectionTable
({
customKey
:
'productId'
});
const
[
data
,
setdata
]
=
useState
<
Array
<
any
>>
([]);
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'ID'
,
...
...
@@ -39,40 +48,61 @@ const AddGoods: React.FC<goodsParamsProps> = (props) => {
{
title
:
'数量'
,
key
:
'amount'
,
width
:
120
,
dataIndex
:
'amount'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Input
/>
<
Form
.
Item
noStyle
initialValue=
{
record
.
amount
}
rules=
{
[{
required
:
true
,
message
:
'请输入数量'
}]
}
>
<
Input
type=
'number'
min=
{
1
}
onBlur=
{
(
e
)
=>
inputOnchange
(
record
.
productId
,
e
,
'amount'
)
}
/>
</
Form
.
Item
>
},
{
title
:
'箱数'
,
key
:
'carton'
,
width
:
120
,
dataIndex
:
'carton'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Input
/>
<
Form
.
Item
noStyle
initialValue=
{
record
.
carton
}
rules=
{
[{
required
:
true
,
message
:
'请输入箱数'
}]
}
>
<
Input
type=
'number'
min=
{
1
}
onBlur=
{
(
e
)
=>
inputOnchange
(
record
.
productId
,
e
,
'carton'
)
}
/>
</
Form
.
Item
>
},
{
title
:
'重量 (KG)'
,
key
:
'weight'
,
width
:
120
,
dataIndex
:
'weight'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Input
/>
<
Form
.
Item
noStyle
initialValue=
{
record
.
weight
}
rules=
{
[{
required
:
true
,
message
:
'请输入重量 (KG)'
}]
}
>
<
Input
type=
'number'
min=
{
1
}
onBlur=
{
(
e
)
=>
inputOnchange
(
record
.
productId
,
e
,
'weight'
)
}
/>
</
Form
.
Item
>
},
{
title
:
'体积 (M3)'
,
key
:
'volume'
,
width
:
120
,
dataIndex
:
'volume'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Input
/>
<
Form
.
Item
noStyle
initialValue=
{
record
.
volume
}
rules=
{
[{
required
:
true
,
message
:
'请输入体积 (M3)'
}]
}
>
<
Input
type=
'number'
min=
{
1
}
onBlur=
{
(
e
)
=>
inputOnchange
(
record
.
productId
,
e
,
'volume'
)
}
/>
</
Form
.
Item
>
},
{
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Input
/>
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
<
Button
type=
'link'
onClick=
{
()
=>
onHandleDelect
(
index
)
}
>
删除
</
Button
>
}
]
/** 删除 */
const
onHandleDelect
=
(
idx
:
number
)
=>
{
const
list
=
[...
data
];
list
.
splice
(
idx
,
1
);
SelectionRowCtl
.
setSelectRow
(
list
)
SelectionRowCtl
.
setSelectedRowKeys
(
list
.
map
(
v
=>
v
.
productId
));
setdata
(
list
)
console
.
log
(
idx
)
}
/**选择商品弹框表头 */
const
columnsTable
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -98,27 +128,118 @@ const AddGoods: React.FC<goodsParamsProps> = (props) => {
]
/**获取商品列表 */
const
fetchProductList
=
(
params
:
any
)
=>
{
const
fetchProductList
=
(
params
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
PublicApi
.
getOrderProcurementOrderProductPageList
({
id
:
set
.
shipmentOrderId
,
...
params
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
arr
:
any
=
[];
res
.
data
.
data
.
forEach
((
item
:
any
)
=>
{
arr
.
push
({
productId
:
item
.
productId
,
productName
:
item
.
productName
,
categoryName
:
item
.
category
,
brandName
:
item
.
brand
,
unitName
:
item
.
unit
,
amount
:
item
.
amount
,
carton
:
item
.
carton
,
weight
:
item
.
weight
,
volume
:
item
.
volume
})
})
res
.
data
.
data
=
arr
resolve
(
res
.
data
)
}
})
})
}
/** 打开添加商品 */
const
openModal
=
()
=>
{
const
dataInfo
=
{
...
set
};
if
(
Object
.
keys
(
dataInfo
).
length
>
0
&&
dataInfo
.
shipmentOrderId
)
{
if
(
data
.
length
>
0
)
{
SelectionRowCtl
.
setSelectRow
([...
data
])
}
console
.
log
(
SelectionRowCtl
.
selectRow
)
setvisible
(
true
)
}
else
{
message
.
error
(
'请先选择要操作的对应发货单号或对应订单号/售后单'
)
}
}
/** 确定添加商品 */
const
onconfirm
=
()
=>
{
const
list
=
SelectionRowCtl
.
selectRow
;
const
arr
:
any
[]
=
[]
list
.
forEach
((
item
:
any
)
=>
{
arr
.
push
({
productId
:
item
.
productId
,
productName
:
item
.
productName
,
categoryName
:
item
.
categoryName
,
brandName
:
item
.
brandName
,
unitName
:
item
.
unitName
,
amount
:
item
.
amount
,
carton
:
item
.
carton
,
weight
:
item
.
weight
,
volume
:
item
.
volume
})
})
setdata
([...
arr
])
setvisible
(
false
)
}
/**输入框输入 */
const
inputOnchange
=
(
id
,
e
,
name
)
=>
{
const
{
value
}
=
e
.
target
data
.
forEach
(
v
=>
{
if
(
v
.
productId
===
id
)
{
v
[
name
]
=
value
}
})
onGet
([...
data
])
// 返回给父级
setdata
([...
data
])
countTotal
(
name
)
}
/** 计算总数 */
const
countTotal
=
(
name
?:
string
)
=>
{
let
num
:
any
=
0
data
.
forEach
((
item
:
any
,
idx
:
number
)
=>
{
if
(
name
===
'carton'
)
{
num
+=
item
.
carton
?
Number
(
item
.
carton
)
:
0
}
else
if
(
name
===
'weight'
)
{
num
+=
item
.
weight
?
Number
(
item
.
weight
)
:
0
}
else
if
(
name
===
'volume'
)
{
num
+=
item
.
volume
?
Number
(
item
.
volume
)
:
0
}
})
return
num
}
return
(
<>
<
Button
block
type=
'dashed'
style=
{
{
marginBottom
:
'24px'
}
}
><
PlusOutlined
/>
添加商品
</
Button
>
<
Table
columns=
{
columns
}
/>
<
Button
block
type=
'dashed'
style=
{
{
marginBottom
:
'24px'
}
}
onClick=
{
openModal
}
><
PlusOutlined
/>
添加商品
</
Button
>
<
Form
form=
{
form
}
>
<
Table
columns=
{
columns
}
dataSource=
{
data
}
rowKey=
{
'productId'
}
pagination=
{
false
}
/>
</
Form
>
<
Row
gutter=
{
[
24
,
24
]
}
style=
{
{
margin
:
'0 0 0 65%'
,
width
:
'35%'
}
}
>
<
Col
span=
{
8
}
><
Statistic
title=
"总箱数(箱)"
value=
{
112893
}
/></
Col
>
<
Col
span=
{
8
}
><
Statistic
title=
"总重量(KG)"
value=
{
112893
}
/></
Col
>
<
Col
span=
{
8
}
><
Statistic
title=
"总体积(M3)"
value=
{
112893
}
/></
Col
>
<
Col
span=
{
8
}
><
Statistic
title=
"总箱数(箱)"
value=
{
countTotal
(
'carton'
)
}
/></
Col
>
<
Col
span=
{
8
}
><
Statistic
title=
"总重量(KG)"
value=
{
countTotal
(
'weight'
)
}
/></
Col
>
<
Col
span=
{
8
}
><
Statistic
title=
"总体积(M3)"
value=
{
countTotal
(
'volume'
)
}
/></
Col
>
</
Row
>
{
/* 选择商品弹框 */
}
{
/* <ModalTable
<
ModalTable
width=
{
900
}
modalTitle=
'选择商品'
columns=
{
columnsTable
}
visible=
{
visible
}
rowSelection=
{
rowSelection
}
fetchTableData=
{
params
=>
fetchProductList
(
params
)
}
/> */
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'productId'
}
}
cancel=
{
()
=>
setvisible
(
false
)
}
confirm=
{
()
=>
onconfirm
()
}
/>
</>
)
}
...
...
src/pages/logistics/logisticsSubmit/detail/index.tsx
View file @
c7b3d5e8
...
...
@@ -3,16 +3,24 @@
* @Date: 2020-11-06
* @Author: HJX
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
import
{
Button
,
Card
,
Tabs
}
from
'antd'
;
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
;
import
{
Button
,
Card
,
Tabs
,
Form
,
message
,
Badge
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
ReturnEle
from
'@/components/ReturnEle'
;
import
{
history
}
from
'umi'
;
import
Table
from
'./components/table'
;
//流转记录
import
BasicInfo
from
'./components/basicInfo'
;
//基本信息
import
Goods
from
'./components/goods'
;
//物流单明细
import
{
PublicApi
}
from
'@/services/api'
;
const
{
TabPane
}
=
Tabs
const
layout
:
any
=
{
colon
:
false
,
labelCol
:
{
style
:
{
width
:
'174px'
}
},
wrapperCol
:
{
span
:
9
},
labelAlign
:
"left"
};
const
AddEditLogistics
:
React
.
FC
<
{}
>
=
()
=>
{
const
basic
=
useRef
<
any
>
();
// 用于提交的
...
...
@@ -23,47 +31,92 @@ const AddEditLogistics: React.FC<{}> = () => {
shipmentOrderCode
:
''
,
//发货单号 1
relevanceOrderId
:
''
,
//对应订单id
invoicesNo
:
''
,
//对应单据编号 1
relevanceType
:
''
,
//对应单据类型 1-订单 2-换货申请单(退货发货) 3-换货申请单(换货发货) 4-退货申请单
relevanceType
:
1
,
//对应单据类型 1-订单 2-换货申请单(退货发货) 3-换货申请单(换货发货) 4-退货申请单
receiverName
:
''
,
//收货方名称1
receiverAddressId
:
''
,
//收货方id 1
shipperAddressId
:
''
,
//发货方id
phone
:
''
,
receiverFullAddress
:
''
,
detailList
:
[],
//物流单明细列表 ,LogisticsOrderDetailRequest
})
const
[
data
,
setData
]
=
useState
<
any
>
({})
const
[
settlementMethod
,
setSettlementMethod
]
=
useState
<
any
>
();
const
[
memberInfo
,
setmemberInfo
]
=
useState
<
any
>
({});
const
[
badge
,
setbadge
]
=
useState
<
any
>
([
0
,
0
,
0
])
// 提交数据
const
handleSubmit
=
async
()
=>
{
const
basicRef
=
await
basic
.
current
.
get
();
if
(
basicRef
.
state
)
{
console
.
log
(
basicRef
.
data
);
if
(
parmas
.
detailList
.
length
>
0
)
{
const
data
=
{
...
basicRef
.
data
};
data
.
invoicesNo
=
parmas
.
invoicesNo
;
data
.
receiverMemberId
=
parmas
.
receiverMemberId
;
data
.
receiverMemberName
=
parmas
.
receiverMemberName
;
data
.
relevanceType
=
parmas
.
relevanceType
;
data
.
detailList
=
parmas
.
detailList
;
console
.
log
(
data
,
'提交的数据源'
);
}
}
}
const
getBasicInfo
=
(
value
:
any
,
index
:
number
)
=>
{
const
getBasicInfo
=
(
value
:
any
,
index
:
number
,
type
?:
number
)
=>
{
const
data
=
{
...
parmas
};
if
(
index
===
1
)
{
data
.
companyName
=
value
.
children
setmemberInfo
({
memberId
:
value
.
memberid
,
roleId
:
value
.
roleid
})
}
else
if
(
index
===
2
)
{
data
.
shipmentOrderCode
=
value
.
invoicesNo
;
//发货单号
data
.
receiverPhone
=
value
.
phone
;
data
.
receiverName
=
value
.
receiverName
;
//收货方名称
data
.
receiverFullAddress
=
value
.
fullAddress
;
data
.
receiverMemberName
=
value
.
memberName
;
data
.
invoices
Id
=
value
.
id
}
else
if
(
index
===
3
&&
!
data
.
invoicesNo
)
{
data
.
shipmentOrder
Id
=
value
.
id
}
else
if
(
index
===
3
&&
!
data
.
shipmentOrderId
)
{
data
.
receiverPhone
=
value
.
phone
;
data
.
receiverName
=
value
.
receiverName
;
//收货方名称
data
.
receiverFullAddress
=
value
.
fullAddress
;
data
.
receiverMemberName
=
value
.
memberName
;
data
.
invoicesId
=
value
.
id
data
.
shipmentOrderId
=
value
.
id
data
.
relevanceType
=
type
;
}
else
{
data
.
shipperFullAddress
=
value
.
children
}
setParmas
(
data
)
}
/**必填没填写出现角标 */
const
getError
=
(
num
:
number
,
idx
:
number
)
=>
{
const
data
=
[...
badge
];
data
[
idx
]
=
num
;
setbadge
(
data
);
console
.
log
(
num
,
idx
)
}
const
getGoodsList
=
(
list
:
any
)
=>
{
const
data
=
{...
parmas
}
data
.
detailList
=
list
;
setParmas
(
data
);
}
useEffect
(()
=>
{
if
(
Object
.
keys
(
memberInfo
).
length
>
0
)
{
PublicApi
.
getSettleAccountsPlatformConfigGetSettlementWay
({...
memberInfo
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
console
.
log
(
res
.
data
)
}
}).
catch
(
error
=>
{
message
.
error
(
error
.
message
)
})
}
},
[
memberInfo
])
const
TabFormErrors
=
(
props
)
=>
{
return
(
<
Badge
count=
{
props
.
dot
}
offset=
{
[
5
,
-
5
]
}
>
{
props
.
children
}
</
Badge
>
)
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
...
...
@@ -72,19 +125,31 @@ const AddEditLogistics: React.FC<{}> = () => {
>
<
Card
>
<
Tabs
type=
"card"
>
<
TabPane
key=
'tab-1'
tab=
'基本信息'
>
<
TabPane
key=
'tab-1'
tab=
{
<
TabFormErrors
dot=
{
badge
[
0
]
}
>
基本信息
</
TabFormErrors
>
}
>
<
BasicInfo
currentRef=
{
basic
}
set=
{
parmas
}
onBadge=
{
getError
}
onGet=
{
getBasicInfo
}
/>
</
TabPane
>
<
TabPane
key=
'tab-2'
tab=
'物流单明细'
>
<
TabPane
key=
'tab-2'
tab=
{
<
TabFormErrors
dot=
{
badge
[
1
]
}
>
物流单明细
</
TabFormErrors
>
}
>
<
Goods
set=
{
parmas
}
onBadge=
{
getError
}
onGet=
{
getGoodsList
}
/>
</
TabPane
>
<
TabPane
key=
'tab-3'
tab=
'运费'
></
TabPane
>
<
TabPane
key=
'tab-3'
tab=
'运费'
>
<
Form
{
...
layout
}
>
<
Form
.
Item
label=
'运费'
>
<
span
></
span
>
</
Form
.
Item
>
<
Form
.
Item
label=
'结算方式'
>
<
span
></
span
>
</
Form
.
Item
>
</
Form
>
</
TabPane
>
<
TabPane
key=
'tab-4'
tab=
'流转记录'
>
<
Table
/>
</
TabPane
>
...
...
src/pages/transaction/inquiryQuote/schema/index.tsx
View file @
c7b3d5e8
...
...
@@ -6,8 +6,8 @@ import { PublicApi } from '@/services/api'
/**
* @description: 公用
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export
const
commonEnquieryOfferSchema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -63,7 +63,7 @@ export const commonEnquieryOfferSchema: ISchema = {
inquiryListNo
:{
//需求单号
type
:
'string'
,
"x-mega-props"
:{
},
"x-component-props"
:{
placeholder
:
'询价单号'
...
...
@@ -114,7 +114,7 @@ export const commonEnquieryOfferSchema: ISchema = {
sumbit
:{
"x-component"
:
'Submit'
,
"x-mega-props"
:{
span
:
1
span
:
1
},
"x-component-props"
:{
children
:
'查询'
...
...
@@ -127,8 +127,8 @@ export const commonEnquieryOfferSchema: ISchema = {
/**
* @description: 需求报价-需求单查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export
const
enquierySearchSchema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -226,8 +226,8 @@ export const enquierySearchSchema: ISchema = {
/**
* @description: 需求报价-报价查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export
const
enquieryOfferSearchSchema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -323,8 +323,8 @@ export const enquieryOfferSearchSchema: ISchema = {
/**
* @description: 报价单新增编辑-需求单查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export
const
dialogEqformSearch
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -406,7 +406,7 @@ export const dialogEqformSearch: ISchema = {
}
/**
* @description: 报价单查询-搜索
* @param {type}
* @param {type}
* @return {type}
*/
export
const
quoteFormSearch
:
ISchema
=
{
...
...
@@ -515,4 +515,4 @@ export const quoteFormSearch: ISchema = {
}
}
}
}
\ No newline at end of file
}
src/pages/transaction/inquiryQuote/schema/pendingReview.tsx
View file @
c7b3d5e8
...
...
@@ -6,8 +6,8 @@ import { PublicApi } from '@/services/api'
/**
* @description: 待审核询价单
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export
const
pendingReviewSchema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -98,8 +98,8 @@ export const pendingReviewSchema: ISchema = {
/**
* @description: 询价报价
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export
const
inquiryQuoteSchema
:
ISchema
=
{
type
:
'object'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment