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
黄庭坚
jinfa-platform
Commits
2c1db914
Commit
2c1db914
authored
Jul 21, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改加工bug
parent
e14aecbc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
13 deletions
+93
-13
schema.tsx
...andling/assign/create/components/ProductDrawer/schema.tsx
+53
-3
index.tsx
src/pages/handling/assign/create/index.tsx
+18
-2
index.tsx
src/pages/handling/assign/tobeAddQuery/index.tsx
+16
-6
useSingleAction.tsx
src/pages/handling/common/hooks/useSingleAction.tsx
+6
-2
No files found.
src/pages/handling/assign/create/components/ProductDrawer/schema.tsx
View file @
2c1db914
...
@@ -88,12 +88,30 @@ const schema: ISchema = {
...
@@ -88,12 +88,30 @@ const schema: ISchema = {
processNum
:
{
processNum
:
{
type
:
'string'
,
type
:
'string'
,
title
:
'加工数量'
,
title
:
'加工数量'
,
required
:
true
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写加工数量'
},
{
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,3})?
$/
,
message
:
'请填写整数或保留三位小数'
}
]
},
},
processUnitPrice
:
{
processUnitPrice
:
{
title
:
"单价"
,
title
:
"单价"
,
type
:
'string'
,
type
:
'string'
,
required
:
true
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写加工单价'
},
{
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,3})?
$/
,
message
:
'请填写整数或保留三位小数'
}
]
},
},
isHasTax
:
{
isHasTax
:
{
title
:
"是否含税"
,
title
:
"是否含税"
,
...
@@ -107,11 +125,43 @@ const schema: ISchema = {
...
@@ -107,11 +125,43 @@ const schema: ISchema = {
label
:
'否'
,
label
:
'否'
,
value
:
0
,
value
:
0
,
}
}
],
required
:
true
,
"x-linkages"
:
[
{
type
:
'value:schema'
,
target
:
'taxRate'
,
condition
:
`{{ $value === 1 }}`
,
schema
:
{
"x-rules"
:
[
{
required
:
true
,
}
]
},
otherwise
:
{
"x-rules"
:
[
{
required
:
false
,
}
]
}
}
]
]
},
},
taxRate
:
{
taxRate
:
{
title
:
'税率'
,
title
:
'税率'
,
type
:
'string'
type
:
'string'
,
"x-component-props"
:
{
addonAfter
:
"%"
},
'x-rules'
:
[
{
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,2})?
$/
,
message
:
'请填写整数或保留两位小数'
}
],
},
},
},
},
},
},
...
...
src/pages/handling/assign/create/index.tsx
View file @
2c1db914
import
React
,
{
useCallback
,
useEffect
,
useMemo
,
useState
}
from
'react'
;
import
React
,
{
useCallback
,
useEffect
,
useMemo
,
useState
}
from
'react'
;
import
{
Button
,
Cascader
,
message
,
Space
,
Table
}
from
'antd'
;
import
{
Button
,
Cascader
,
message
,
Space
,
Table
,
Modal
}
from
'antd'
;
import
{
LinkOutlined
,
PlusOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
LinkOutlined
,
PlusOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
creataSchema
from
'./schema'
;
import
creataSchema
from
'./schema'
;
...
@@ -33,6 +33,8 @@ import { history } from 'umi';
...
@@ -33,6 +33,8 @@ import { history } from 'umi';
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
useFormatData
from
'./common/hooks/useFormatData'
;
import
useFormatData
from
'./common/hooks/useFormatData'
;
const
{
confirm
}
=
Modal
;
const
formActions
=
createFormActions
();
const
formActions
=
createFormActions
();
const
{
onFieldInit$
,
onFieldValueChange$
}
=
FormEffectHooks
const
{
onFieldInit$
,
onFieldValueChange$
}
=
FormEffectHooks
...
@@ -449,11 +451,13 @@ const Create = () => {
...
@@ -449,11 +451,13 @@ const Create = () => {
const
productList
=
isOrderSource
?
formActions
.
getFieldValue
(
'detail.layout1.orderList'
)
:
formActions
.
getFieldValue
(
'detail.layout1.productList'
);
const
productList
=
isOrderSource
?
formActions
.
getFieldValue
(
'detail.layout1.orderList'
)
:
formActions
.
getFieldValue
(
'detail.layout1.productList'
);
// const productList = formActions.getFieldValue('detail.layout1.productList');
// const productList = formActions.getFieldValue('detail.layout1.productList');
const
{
isHasTax
,
taxRate
,
processNum
,
processUnitPrice
,
enclosure
,
productProps
}
=
values
;
const
{
isHasTax
,
taxRate
,
processNum
,
processUnitPrice
,
enclosure
,
productProps
}
=
values
;
let
shouldShowConfirmMsg
=
false
;
const
newData
=
productList
.
map
((
_item
)
=>
{
const
newData
=
productList
.
map
((
_item
)
=>
{
/** 加工商品的时候用sku, 如果是加工订单商品的话用orderid */
/** 加工商品的时候用sku, 如果是加工订单商品的话用orderid */
if
((
!
isOrderSource
&&
_item
.
skuid
===
values
.
skuid
)
||
(
isOrderSource
&&
_item
.
id
===
values
.
id
))
{
if
((
!
isOrderSource
&&
_item
.
skuid
===
values
.
skuid
)
||
(
isOrderSource
&&
_item
.
id
===
values
.
id
))
{
const
other
=
isOrderSource
?
{
surplusAndProcessNum
:
`
${
_item
.
surplusProcessNum
}
/
${
processNum
}
`
}
:
{}
const
other
=
isOrderSource
?
{
surplusAndProcessNum
:
`
${
_item
.
surplusProcessNum
}
/
${
processNum
}
`
}
:
{};
shouldShowConfirmMsg
=
_item
.
surplusProcessNum
<
processNum
;
return
{
return
{
...
_item
,
...
_item
,
...
other
,
...
other
,
...
@@ -473,8 +477,20 @@ const Create = () => {
...
@@ -473,8 +477,20 @@ const Create = () => {
}
}
return
_item
;
return
_item
;
})
})
if
(
shouldShowConfirmMsg
)
{
confirm
({
title
:
'加工商品大于剩余加工商品'
,
content
:
'加工商品大于剩余加工商品, 是否确认提交?'
,
onOk
()
{
formActions
.
setFieldValue
(
source
===
ORDER_SOURCE
?
'detail.layout1.orderList'
:
'detail.layout1.productList'
,
newData
);
productDrawerToggle
(
false
);
},
});
return
;
}
formActions
.
setFieldValue
(
source
===
ORDER_SOURCE
?
'detail.layout1.orderList'
:
'detail.layout1.productList'
,
newData
);
formActions
.
setFieldValue
(
source
===
ORDER_SOURCE
?
'detail.layout1.orderList'
:
'detail.layout1.productList'
,
newData
);
productDrawerToggle
(
false
);
productDrawerToggle
(
false
);
}
}
/** -------------- 加工商品相关结束 --------------- */
/** -------------- 加工商品相关结束 --------------- */
...
...
src/pages/handling/assign/tobeAddQuery/index.tsx
View file @
2c1db914
...
@@ -44,15 +44,25 @@ const AllQuery = () => {
...
@@ -44,15 +44,25 @@ const AllQuery = () => {
title
:
'操作'
,
title
:
'操作'
,
render
:
(
text
,
record
)
=>
{
render
:
(
text
,
record
)
=>
{
const
loading
=
submitLoadingID
.
includes
(
record
.
id
);
const
loading
=
submitLoadingID
.
includes
(
record
.
id
);
const
IS_TO_BE_SUBMIT_EXAM
=
record
.
supplierInnerStatus
===
1
return
(
return
(
<
Space
>
<
Space
>
<
Spin
spinning=
{
loading
}
>
{
<
a
onClick=
{
()
=>
handleSingleReviewOrDelete
(
"exam"
,
{
id
:
record
.
id
})
}
>
提交
</
a
>
IS_TO_BE_SUBMIT_EXAM
&&
(
</
Spin
>
<
Spin
spinning=
{
loading
}
>
<
a
onClick=
{
()
=>
handleSingleReviewOrDelete
(
"exam"
,
{
id
:
record
.
id
})
}
>
提交
</
a
>
</
Spin
>
)
||
null
}
<
Link
to=
{
`/memberCenter/handling/assign/tobeAddQuery/edit?id=${record.id}`
}
>
编辑
</
Link
>
<
Link
to=
{
`/memberCenter/handling/assign/tobeAddQuery/edit?id=${record.id}`
}
>
编辑
</
Link
>
<
Popconfirm
title=
"确定删除吗?"
onConfirm=
{
()
=>
handleSingleReviewOrDelete
(
"delete"
,
{
id
:
record
.
id
})
}
>
{
<
Button
type=
"link"
loading=
{
loading
}
>
删除
</
Button
>
IS_TO_BE_SUBMIT_EXAM
&&
(
</
Popconfirm
>
<
Popconfirm
title=
"确定删除吗?"
onConfirm=
{
()
=>
handleSingleReviewOrDelete
(
"delete"
,
{
id
:
record
.
id
})
}
>
<
Button
type=
"link"
loading=
{
loading
}
>
删除
</
Button
>
</
Popconfirm
>
)
||
null
}
</
Space
>
</
Space
>
)
)
}
}
...
...
src/pages/handling/common/hooks/useSingleAction.tsx
View file @
2c1db914
...
@@ -12,8 +12,12 @@ import { useCallback, useState } from "react";
...
@@ -12,8 +12,12 @@ import { useCallback, useState } from "react";
prev
.
push
(
params
.
id
);
prev
.
push
(
params
.
id
);
return
prev
;
return
prev
;
})
})
const
res
=
await
api
(
params
)
let
res
;
setSubmitLoadingID
((
prev
:
number
[])
=>
prev
.
filter
((
_item
)
=>
_item
!==
params
.
id
))
try
{
res
=
await
api
(
params
)
}
finally
{
setSubmitLoadingID
((
prev
:
number
[])
=>
prev
.
filter
((
_item
)
=>
_item
!==
params
.
id
))
}
return
res
return
res
}
}
return
{
submitLoadingID
,
onSingleAction
}
return
{
submitLoadingID
,
onSingleAction
}
...
...
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