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
84bb3c45
Commit
84bb3c45
authored
Aug 13, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 去掉多余的变量声明
parent
e3fff14b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
14 deletions
+93
-14
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+93
-14
No files found.
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
84bb3c45
...
@@ -9,7 +9,6 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
...
@@ -9,7 +9,6 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetAsReturnGoodsGetDetailByConsumerResponse
}
from
'@/services/AfterServiceV2Api'
;
import
{
normalizeFiledata
,
FileData
}
from
'@/utils'
;
import
{
normalizeFiledata
,
FileData
}
from
'@/utils'
;
import
{
import
{
ORDER_TYPE_INQUIRY_CONTRACT
,
ORDER_TYPE_INQUIRY_CONTRACT
,
...
@@ -51,7 +50,86 @@ interface BillsFormProps {
...
@@ -51,7 +50,86 @@ interface BillsFormProps {
* 订单类型
* 订单类型
*/
*/
orderType
?:
number
,
orderType
?:
number
,
};
}
type
ReturnGoodsListItemType
=
{
/**
* 订单号
*/
orderNo
:
string
,
/**
* 商品id
*/
productId
:
string
,
/**
* 商品名称
*/
productName
:
string
,
/**
* 品类
*/
category
:
string
,
/**
* 品牌
*/
brand
:
string
,
/**
* 单位
*/
unit
:
string
,
/**
* 采购数量
*/
purchaseCount
:
number
,
/**
* 物料编号
*/
associatedProductId
:
string
,
/**
* 物料名称、规格
*/
associatedProductName
:
string
,
/**
* 物料品类
*/
associatedCategory
:
string
,
/**
* 物料品牌
*/
associatedBrand
:
string
,
/**
* 物料单位
*/
associatedUnit
:
string
,
/**
* 关联报价商品ID、名称、规格、品类、品牌
*/
associated
:
string
,
/**
* 采购单价
*/
purchasePrice
:
number
,
/**
* 采购金额
*/
purchaseAmount
:
number
,
/**
* 已支付金额
*/
payAmount
:
number
,
/**
* 退货数量
*/
returnCount
:
number
,
/**
* 退款金额
*/
refundAmount
:
number
,
/**
* 额外的数据
*/
extraData
:
{
[
key
:
string
]:
any
},
}
interface
DetailInfo
{
interface
DetailInfo
{
applyTime
:
string
;
applyTime
:
string
;
...
@@ -73,6 +151,10 @@ interface DetailInfo {
...
@@ -73,6 +151,10 @@ interface DetailInfo {
* 订单类型
* 订单类型
*/
*/
orderType
?:
number
,
orderType
?:
number
,
/**
* 商品数据
*/
returnGoodsList
?:
ReturnGoodsListItemType
[],
}
}
interface
OrderNoProps
{
interface
OrderNoProps
{
...
@@ -105,7 +187,6 @@ const ReturnForm: React.FC<BillsFormProps> = ({
...
@@ -105,7 +187,6 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
({
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
});
});
const
[
returnGoodsList
,
setReturnGoodsList
]
=
useState
<
GetAsReturnGoodsGetDetailByConsumerResponse
[
'goodsDetailList'
]
>
([]);
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
...
@@ -341,11 +422,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
...
@@ -341,11 +422,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
]
:
]
:
[]
[]
,
,
...
rest
,
returnGoodsList
:
goodsDetailList
.
map
(
item
=>
({
});
setOrderTypeValue
(
rest
.
orderType
);
setReturnGoodsList
(
goodsDetailList
.
map
(
item
=>
({
...
item
,
...
item
,
remaining
:
item
.
purchaseCount
||
0
,
// 可退货数量,这里取 采购数量判断即可
remaining
:
item
.
purchaseCount
||
0
,
// 可退货数量,这里取 采购数量判断即可
extraData
:
{
extraData
:
{
...
@@ -357,7 +434,11 @@ const ReturnForm: React.FC<BillsFormProps> = ({
...
@@ -357,7 +434,11 @@ const ReturnForm: React.FC<BillsFormProps> = ({
},
},
associated
:
!
item
.
associatedProductId
?
''
:
`
${
item
.
productId
}
/
${
item
.
productName
}
/
${
item
.
associatedCategory
}
/
${
item
.
associatedBrand
}
`
,
associated
:
!
item
.
associatedProductId
?
''
:
`
${
item
.
productId
}
/
${
item
.
productName
}
/
${
item
.
associatedCategory
}
/
${
item
.
associatedBrand
}
`
,
materielNameAndType
:
`
${
item
.
associatedProductName
||
''
}${
item
.
associatedType
?
'/'
+
item
.
associatedType
:
''
}
`
,
materielNameAndType
:
`
${
item
.
associatedProductName
||
''
}${
item
.
associatedType
?
'/'
+
item
.
associatedType
:
''
}
`
,
})));
})),
...
rest
,
});
setOrderTypeValue
(
rest
.
orderType
);
setGoodsValue
(
goodsDetailList
.
map
(
item
=>
item
.
orderRecordId
));
setGoodsValue
(
goodsDetailList
.
map
(
item
=>
item
.
orderRecordId
));
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
@@ -638,9 +719,10 @@ const ReturnForm: React.FC<BillsFormProps> = ({
...
@@ -638,9 +719,10 @@ const ReturnForm: React.FC<BillsFormProps> = ({
taxRate
:
item
.
taxRate
,
taxRate
:
item
.
taxRate
,
contractId
:
item
.
contractId
,
contractId
:
item
.
contractId
,
contractNo
:
item
.
contractNo
,
contractNo
:
item
.
contractNo
,
associated
:
!
isMateriel
?
''
:
`
${
item
.
associatedProductId
}
/
${
item
.
quotedName
}
/
${
item
.
category
}
/
${
item
.
b
rand
}
`
,
associated
:
!
isMateriel
?
''
:
`
${
item
.
quotedProductNo
}
/
${
item
.
quotedName
}
/
${
item
.
quotedSpec
}
/
${
item
.
quotedCategory
}
/
${
item
.
quotedB
rand
}
`
,
associatedProductId
:
item
.
quotedProductNo
||
''
,
associatedProductId
:
item
.
quotedProductNo
||
''
,
associatedProductName
:
`
${
item
.
quotedName
||
''
}
`
,
associatedProductName
:
`
${
item
.
quotedName
||
''
}
`
,
associatedType
:
`
${
item
.
quotedSpec
||
''
}
`
,
associatedCategory
:
item
.
quotedCategory
||
''
,
associatedCategory
:
item
.
quotedCategory
||
''
,
associatedBrand
:
item
.
quotedBrand
||
''
,
associatedBrand
:
item
.
quotedBrand
||
''
,
associatedUnit
:
item
.
unit
||
''
,
associatedUnit
:
item
.
unit
||
''
,
...
@@ -739,10 +821,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
...
@@ -739,10 +821,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
>
>
<
Card
>
<
Card
>
<
NiceForm
<
NiceForm
value=
{
{
value=
{
detailInfo
}
...
detailInfo
,
returnGoodsList
:
returnGoodsList
,
}
}
previewPlaceholder=
" "
previewPlaceholder=
" "
expressionScope=
{
{
expressionScope=
{
{
TableAddButton
,
TableAddButton
,
...
...
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