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
shenshaokai
jinfa-platform
Commits
2f711be3
Commit
2f711be3
authored
Dec 29, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理采购/销售发货单校验和翻译问题
parent
ad51cd9d
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
34 additions
and
125 deletions
+34
-125
useFormDetail.tsx
src/formSchema/effects/useFormDetail.tsx
+1
-1
order.ts
src/locales/en-US/order.ts
+3
-0
order.ts
src/locales/ko-KR/order.ts
+3
-0
order.ts
src/locales/zh-CN/order.ts
+4
-1
index.ts
...ction/purchaseOrder/addPurchaseReceiveOrder/apis/index.ts
+0
-24
index.tsx
...ansaction/purchaseOrder/addPurchaseReceiveOrder/index.tsx
+1
-12
index.ts
...ges/transaction/saleOrder/addLogisticsOrder/apis/index.ts
+1
-15
index.tsx
.../addLogisticsOrder/components/productModalTable/index.tsx
+2
-3
index.tsx
...r/addLogisticsOrder/components/productTableCell/index.tsx
+5
-0
index.tsx
...ransaction/saleOrder/addLogisticsOrder/constant/index.tsx
+3
-3
index.tsx
src/pages/transaction/saleOrder/addLogisticsOrder/index.tsx
+5
-18
index.ts
...s/transaction/saleOrder/addLogisticsOrder/schema/index.ts
+2
-1
index.ts
...s/transaction/saleOrder/addSaleDelevedOrder/apis/index.ts
+0
-24
index.tsx
...addSaleDelevedOrder/components/productTableCell/index.tsx
+2
-10
index.tsx
...pages/transaction/saleOrder/addSaleDelevedOrder/index.tsx
+2
-13
No files found.
src/formSchema/effects/useFormDetail.tsx
View file @
2f711be3
...
...
@@ -30,7 +30,7 @@ export const useFormDetail = () => {
/**
* 收集表单完成度逻辑
* 若需要统计表单有效字段完成度,需要把此函数注入到NiceForm的effects里面
* @param ctx
* @param ctx
FormActions
*/
const
useAttachmentChangeForContext
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
)
=>
{
FormEffectHooks
.
onFormMount$
().
subscribe
(()
=>
{
...
...
src/locales/en-US/order.ts
View file @
2f711be3
...
...
@@ -573,6 +573,9 @@ export default {
'saleOrder.productTableCell.validator1'
:
'x must be entered'
,
'saleOrder.productTableCell.validator2'
:
'Only one decimal digit is reserved for the value'
,
'saleOrder.productTableCell.validator3'
:
'The value is reserved for three decimal places only'
,
'saleOrder.qingwanshanwuliudan'
:
'Please improve the detailed data of logistics order'
,
'saleOrder.qingwanshanfahuodan'
:
'Please improve the detailed data of invoice'
,
'saleOrder.shouhuoshuliangjin'
:
'The quantity received is limited to three decimal places only'
,
// Requisitions
...
...
src/locales/ko-KR/order.ts
View file @
2f711be3
...
...
@@ -571,6 +571,9 @@ export default {
'saleOrder.productTableCell.validator1'
:
'x는 반드시'
,
'saleOrder.productTableCell.validator2'
:
'값은 소수점 한 자리만 남는다'
,
'saleOrder.productTableCell.validator3'
:
'값은 세 자리 소수만 남는다'
,
'saleOrder.qingwanshanwuliudan'
:
'물류 명세서 데이터를 완벽히 하세요'
,
'saleOrder.qingwanshanfahuodan'
:
'인보이스 명세 데이터를 보완해 주세요'
,
'saleOrder.shouhuoshuliangjin'
:
'상품을 받을 수 있는 수량은 세 자리 소수로만 제한한다'
,
// 请购单
...
...
src/locales/zh-CN/order.ts
View file @
2f711be3
...
...
@@ -370,7 +370,7 @@ export default {
'purchaseOrder.danjuzhaiyao'
:
'单据摘要'
,
'purchaseOrder.baocun'
:
'保存'
,
'purchaseOrder.shanchu'
:
'删除'
,
'purchaseOrder.qingwanshancaigou'
:
'请完善采购收货单
商品
数据'
,
'purchaseOrder.qingwanshancaigou'
:
'请完善采购收货单
明细
数据'
,
'saleOrder.daochuerweima'
:
'导出二维码'
,
'saleOrder.tijiaoshenhe'
:
'提交审核'
,
...
...
@@ -570,6 +570,9 @@ export default {
'saleOrder.productTableCell.validator1'
:
'x必须填写'
,
'saleOrder.productTableCell.validator2'
:
'数值仅保留一位小数'
,
'saleOrder.productTableCell.validator3'
:
'数值仅保留三位小数'
,
'saleOrder.qingwanshanwuliudan'
:
'请完善物流单明细数据'
,
'saleOrder.qingwanshanfahuodan'
:
'请完善发货单明细数据'
,
'saleOrder.shouhuoshuliangjin'
:
'收货数量仅限三位小数'
,
// 请购单
...
...
src/pages/transaction/purchaseOrder/addPurchaseReceiveOrder/apis/index.ts
deleted
100644 → 0
View file @
ad51cd9d
import
{
postMemberManageLowerProviderPage
}
from
"@/services/MemberV2Api"
import
{
getProductCommodityCommonGetCommodityListByBuyer
,
getProductGoodsGetGoodsList
}
from
"@/services/ProductV2Api"
export
const
fetchOrderApi
=
{
/** 弹窗获取商品列表 */
async
getProductList
(
params
)
{
const
{
data
}
=
await
getProductCommodityCommonGetCommodityListByBuyer
(
params
,
{
useCache
:
true
,
ttl
:
10
*
1000
})
return
data
},
/** 获取下架服务提供者会员列表 */
async
getMemberListByMemberName
(
params
)
{
const
{
data
}
=
await
postMemberManageLowerProviderPage
({...
params
},
{
ctlType
:
'none'
})
return
data
},
/** 请购单物料 获取商品货品列表 */
async
getPurchaseRequesitionMaterielList
(
params
)
{
const
{
data
}
=
await
getProductGoodsGetGoodsList
(
params
)
return
data
},
}
src/pages/transaction/purchaseOrder/addPurchaseReceiveOrder/index.tsx
View file @
2f711be3
...
...
@@ -56,18 +56,7 @@ const AddPurchaseReceiveOrder: React.FC<{}> = () => {
const
params
=
{
...
value
}
console
.
log
(
value
)
if
(
formContext
.
innerFormErrors
)
{
throw
new
Error
(
intl
.
formatMessage
({
id
:
'purchaseOrder.qingwanshancaigou'
,
defaultMessage
:
'请完善采购收货单商品数据'
}))
}
// 校验采购数量
const
judgementByCount
=
params
.
products
?.
length
&&
params
.
products
.
map
(
item
=>
{
if
(
item
.
quantity
){
return
true
}
else
{
return
false
}
})
if
(
!
judgementByCount
||
judgementByCount
.
includes
(
false
)){
throw
new
Error
(
'请填写商品收货数量'
)
throw
new
Error
(
intl
.
formatMessage
({
id
:
'purchaseOrder.qingwanshancaigou'
,
defaultMessage
:
'请完善采购收货单明细数据'
}))
}
setBtnLoading
(
true
)
...
...
src/pages/transaction/saleOrder/addLogisticsOrder/apis/index.ts
View file @
2f711be3
import
{
postMemberManageLowerProviderPage
}
from
"@/services/MemberV2Api"
import
{
getProductCommodityCommonGetCommodityListByBuyer
,
getProductGoodsGetGoodsList
}
from
"@/services/ProductV2Api"
import
{
getProductCommodityCommonGetCommodityListByBuyer
}
from
"@/services/ProductV2Api"
export
const
fetchOrderApi
=
{
/** 弹窗获取商品列表 */
...
...
@@ -8,17 +7,4 @@ export const fetchOrderApi = {
return
data
},
/** 获取下架服务提供者会员列表 */
async
getMemberListByMemberName
(
params
)
{
const
{
data
}
=
await
postMemberManageLowerProviderPage
({...
params
},
{
ctlType
:
'none'
})
return
data
},
/** 请购单物料 获取商品货品列表 */
async
getPurchaseRequesitionMaterielList
(
params
)
{
const
{
data
}
=
await
getProductGoodsGetGoodsList
(
params
)
return
data
},
}
src/pages/transaction/saleOrder/addLogisticsOrder/components/productModalTable/index.tsx
View file @
2f711be3
...
...
@@ -107,7 +107,6 @@ export const filterProductDataById = (data, targetData) => {
prev
.
push
(
next
)
}
return
prev
},
[])
}
...
...
@@ -187,10 +186,10 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
'name'
,
FORM_FILTER_PATH
,
);
FormEffectHooks
.
onFieldChange$
(
'customerCategoryId'
).
subscribe
(
state
=>
{
FormEffectHooks
.
onFieldChange$
(
'customerCategoryId'
).
subscribe
(()
=>
{
searchCustomerCategoryOptionEffect
(
schemaAction
,
actions
,
'customerCategoryId'
)
})
FormEffectHooks
.
onFieldChange$
(
'brandId'
).
subscribe
(
state
=>
{
FormEffectHooks
.
onFieldChange$
(
'brandId'
).
subscribe
(()
=>
{
searchBrandOptionEffect
(
schemaAction
,
actions
,
'brandId'
)
})
}
...
...
src/pages/transaction/saleOrder/addLogisticsOrder/components/productTableCell/index.tsx
View file @
2f711be3
import
React
,
{
useRef
,
useContext
}
from
'react'
import
{
Form
,
Input
}
from
'antd'
;
import
{
useIntl
}
from
'umi'
;
import
{
FormDetailContext
}
from
'@/formSchema/context'
;
export
interface
ProductTableCellProps
{
title
:
React
.
ReactNode
;
...
...
@@ -48,12 +49,16 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
const
formItemRef
=
useRef
<
any
>
();
const
{
form
}
=
useContext
(
EditableContext
);
const
intl
=
useIntl
()
const
{
formContext
}
=
useContext
(
FormDetailContext
);
const
save
=
async
()
=>
{
try
{
const
values
=
await
form
.
validateFields
();
values
.
purchaseCount
=
Number
(
values
.
purchaseCount
)
||
0
handleSave
({
...
record
,
...
values
});
formContext
.
ctl
.
setInnerFormErrors
(
0
)
}
catch
(
errInfo
)
{
formContext
.
ctl
.
setInnerFormErrors
(
errInfo
.
errorFields
.
length
)
console
.
log
(
'Save failed:'
,
errInfo
);
}
};
...
...
src/pages/transaction/saleOrder/addLogisticsOrder/constant/index.tsx
View file @
2f711be3
...
...
@@ -19,7 +19,7 @@ export const PriceComp = (props) => {
</
div
>
}
/**
代客下
单 初始值转换 */
/**
新增物流
单 初始值转换 */
export
const
procurmentRenderInit
=
(
initValue
:
any
)
=>
{
return
{
...
...
@@ -38,7 +38,7 @@ export const procurmentRenderInit = (initValue: any) => {
}
}
/**
代客下
单 回显商品字段转换 */
/**
新增物流
单 回显商品字段转换 */
export
const
procurementRenderField
=
(
data
)
=>
{
const
_orderProductRequests
=
data
.
product
.
products
return
_orderProductRequests
.
map
(
item
=>
{
...
...
@@ -71,7 +71,7 @@ export const procurementRenderField = (data) => {
})
}
/**
代客下单提交
字段转换 */
/**
新增物流单
字段转换 */
export
const
procurementProcessField
=
(
value
)
=>
{
value
.
products
=
value
.
products
.
map
(
item
=>
{
return
{
...
...
src/pages/transaction/saleOrder/addLogisticsOrder/index.tsx
View file @
2f711be3
...
...
@@ -87,22 +87,11 @@ const AddLogisticsOrder:React.FC<{}> = () => {
const
handleSubmit
=
async
(
value
)
=>
{
try
{
let
fnResult
=
null
// 新增
订单/编辑订
单
// 新增
物流单/编辑物流
单
const
params
=
{
...
value
}
console
.
log
(
value
)
if
(
formContext
.
innerFormErrors
)
{
throw
new
Error
(
intl
.
formatMessage
({
id
:
'purchaseRequisition.qingwanshandingdan'
,
defaultMessage
:
'请完善订单物料数据'
}))
}
// 校验采购数量
const
judgementByCount
=
params
.
products
?.
length
&&
params
.
products
.
map
(
item
=>
{
if
(
item
.
quantity
){
return
true
}
else
{
return
false
}
})
if
(
!
judgementByCount
||
judgementByCount
.
includes
(
false
)){
throw
new
Error
(
intl
.
formatMessage
({
id
:
'purchaseRequisition.qingtianxieshangpin'
,
defaultMessage
:
'请填写商品采购数量'
}))
throw
new
Error
(
intl
.
formatMessage
({
id
:
'saleOrder.qingwanshanwuliudan'
,
defaultMessage
:
'请完善物流单明细数据'
}))
}
setBtnLoading
(
true
)
...
...
@@ -123,7 +112,6 @@ const AddLogisticsOrder:React.FC<{}> = () => {
}
catch
(
error
)
{
setBtnLoading
(
false
)
error
?.
message
&&
message
.
error
(
error
.
message
)
console
.
log
(
error
)
}
}
...
...
@@ -170,6 +158,9 @@ const AddLogisticsOrder:React.FC<{}> = () => {
// 物料信息的改动 渲染总额
useMaterialTableChangeForAmount
(
ctx
,
update
)
// 注入表单完成进度
formContext
.
useAttachmentChangeForContext
(
ctx
)
useAsyncSelect
(
'deliverAddress'
,
fetchDeliverAddressSelectOptions
,
...
...
@@ -179,10 +170,6 @@ const AddLogisticsOrder:React.FC<{}> = () => {
'logisticProvider'
,
fetchLogisticProviderSelectOptions
,
)
// 注入表单完成进度
formContext
.
useAttachmentChangeForContext
(
ctx
)
}
}
expressionScope=
{
{
productColumns
,
...
...
src/pages/transaction/saleOrder/addLogisticsOrder/schema/index.ts
View file @
2f711be3
...
...
@@ -46,7 +46,8 @@ const basicInfo: ISchema = {
logisticProvider
:
{
type
:
'string'
,
title
:
intl
.
formatMessage
({
id
:
'saleOrder.wuliufuwushang'
,
defaultMessage
:
'物流服务商'
}),
enum
:
[]
enum
:
[],
required
:
true
,
},
deliverAddress
:
{
type
:
'string'
,
...
...
src/pages/transaction/saleOrder/addSaleDelevedOrder/apis/index.ts
deleted
100644 → 0
View file @
ad51cd9d
import
{
postMemberManageLowerProviderPage
}
from
"@/services/MemberV2Api"
import
{
getProductCommodityCommonGetCommodityListByBuyer
,
getProductGoodsGetGoodsList
}
from
"@/services/ProductV2Api"
export
const
fetchOrderApi
=
{
/** 弹窗获取商品列表 */
async
getProductList
(
params
)
{
const
{
data
}
=
await
getProductCommodityCommonGetCommodityListByBuyer
(
params
,
{
useCache
:
true
,
ttl
:
10
*
1000
})
return
data
},
/** 获取下架服务提供者会员列表 */
async
getMemberListByMemberName
(
params
)
{
const
{
data
}
=
await
postMemberManageLowerProviderPage
({...
params
},
{
ctlType
:
'none'
})
return
data
},
/** 请购单物料 获取商品货品列表 */
async
getPurchaseRequesitionMaterielList
(
params
)
{
const
{
data
}
=
await
getProductGoodsGetGoodsList
(
params
)
return
data
},
}
src/pages/transaction/saleOrder/addSaleDelevedOrder/components/productTableCell/index.tsx
View file @
2f711be3
...
...
@@ -145,26 +145,18 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
style=
{
{
margin
:
0
}
}
name=
{
dataIndex
}
initialValue=
{
record
[
dataIndex
]
||
''
}
rules=
{
dataIndex
===
'quantity'
?
[
rules=
{
[
{
required
:
true
,
message
:
`${title}${intl.formatMessage({ id: 'saleOrder.bixutianxie', defaultMessage: '必须填写' })}`
,
},
{
pattern
:
/^
\d
+
(\.\d
{1,3}
)?
$/
,
message
:
intl
.
formatMessage
({
id
:
'saleOrder.
caigoushuliangjin'
,
defaultMessage
:
'采购
数量仅限三位小数'
}),
message
:
intl
.
formatMessage
({
id
:
'saleOrder.
shouhuoshuliangjin'
,
defaultMessage
:
'收货
数量仅限三位小数'
}),
},
{
validator
:
validatorNumber
},
]
:
[
{
pattern
:
/^
\d
+
(\.\d
{1,4}
)?
$/
,
message
:
intl
.
formatMessage
({
id
:
'saleOrder.danjiajinxiansi'
,
defaultMessage
:
'单价仅限四位小数'
}),
},
{
validator
:
validatorNumber
}
]
}
>
{
chooseFormItem
(
formItem
,
record
[
dataIndex
]
||
''
)
}
...
...
src/pages/transaction/saleOrder/addSaleDelevedOrder/index.tsx
View file @
2f711be3
...
...
@@ -52,21 +52,10 @@ const AddSaleDelevedOrder:React.FC<{}> = () => {
const
handleSubmit
=
async
(
value
)
=>
{
try
{
let
fnResult
=
null
// 新增
订单/编辑订
单
// 新增
发货单/编辑发货
单
const
params
=
{
...
value
}
if
(
formContext
.
innerFormErrors
)
{
throw
new
Error
(
intl
.
formatMessage
({
id
:
'purchaseRequisition.qingwanshandingdan'
,
defaultMessage
:
'请完善订单物料数据'
}))
}
// 校验采购数量
const
judgementByCount
=
params
.
products
?.
length
&&
params
.
products
.
map
(
item
=>
{
if
(
item
.
quantity
){
return
true
}
else
{
return
false
}
})
if
(
!
judgementByCount
||
judgementByCount
.
includes
(
false
)){
throw
new
Error
(
intl
.
formatMessage
({
id
:
'purchaseRequisition.qingtianxieshangpin'
,
defaultMessage
:
'请填写商品采购数量'
}))
throw
new
Error
(
intl
.
formatMessage
({
id
:
'saleOrder.qingwanshanfahuodan'
,
defaultMessage
:
'请完善发货单明细数据'
}))
}
setBtnLoading
(
true
)
...
...
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