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
701fc12b
Commit
701fc12b
authored
Nov 25, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理手工下单商品价格没有算入折扣,处理销售订单待审核订单审核时候无法默认选择已有的电子合同模板
parent
1e1e4c9d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
6 deletions
+28
-6
index.ts
src/constants/index.ts
+4
-2
index.tsx
...ages/transaction/components/createElectronModal/index.tsx
+3
-2
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+2
-1
useProductTable.tsx
...tion/purchaseOrder/orderCollect/model/useProductTable.tsx
+4
-1
type.ts
src/utils/type.ts
+15
-0
No files found.
src/constants/index.ts
View file @
701fc12b
...
...
@@ -798,10 +798,12 @@ export const PurchaseOrderInsideWorkStateTexts = {
2
:
'一级待审核订单'
,
3
:
'二级待审核订单'
,
4
:
'待提交订单'
,
5
:
'待确认电子合同'
,
// 5: '待确认电子合同',
5
:
'提交订单完成'
,
6
:
'提交一级审核订单不通过'
,
7
:
'提交二级审核订单不通过'
,
8
:
'待支付订单'
,
// 8: '待支付订单',
8
:
'确认电子合同'
,
10
:
'支付成功'
,
11
:
'支付失败'
,
12
:
'待确认收货'
,
...
...
src/pages/transaction/components/createElectronModal/index.tsx
View file @
701fc12b
...
...
@@ -189,8 +189,9 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
effects=
{
(
$
,
actions
)
=>
{
// $('onFormInit').subscribe(() =>
{
if
(
data
.
isElectronicContract
===
1
)
{
useAsyncSelect
(
'contractTemplateId'
,
async
()
=>
(
await
PublicApi
.
getOrderSelectListContractTemplate
()).
data
,
[
'name'
,
'id'
])
actions
.
setFieldValue
(
"contractTemplateId"
,
data
.
contractTemplateId
)
useAsyncSelect
(
'contractTemplateId'
,
async
()
=>
(
await
PublicApi
.
getOrderSelectListContractTemplate
()).
data
,
[
'name'
,
'id'
]).
then
(()
=>
{
actions
.
setFieldValue
(
"contractTemplateId"
,
data
.
contractTemplateId
)
})
}
else
{
actions
.
setFieldState
(
'usingElectronicContracts'
,
state
=>
{
state
.
value
=
0
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
701fc12b
...
...
@@ -30,6 +30,7 @@ import { changeRouterTitleByStatus } from '../../_public/order/utils'
import
{
ReadyAddOrderDetailContext
}
from
'../context'
import
AuditProcess
from
'@/components/AuditProcess'
import
styles
from
'./index.less'
import
{
toPoint
}
from
'@/utils/type'
export
interface
PurchaseOrderDetailProps
{}
...
...
@@ -180,7 +181,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
orderProductRequests
:
_orderProductRequests
.
map
(
v
=>
{
v
.
price
=
1
v
.
isMemberPrice
=
Number
(
v
.
isMemberPrice
)
v
.
memberPrice
=
parseI
nt
(
v
.
memberPrice
)
v
.
memberPrice
=
toPoi
nt
(
v
.
memberPrice
)
v
.
imgUrl
=
v
.
mainPic
v
.
minOrder
=
v
.
minOrder
// v.productId = v.id
...
...
src/pages/transaction/purchaseOrder/orderCollect/model/useProductTable.tsx
View file @
701fc12b
...
...
@@ -5,6 +5,7 @@ import { productInfoColumns } from '../constant';
import
ProductTableCell
,
{
ProductEditableRow
}
from
'../components/productTableCell'
;
import
{
useModalTable
}
from
'./useModalTable'
;
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
toPoint
}
from
'@/utils/type'
;
export
const
getUnitPriceTotal
=
(
record
)
=>
{
const
purchaseCount
=
Number
(
record
[
'purchaseCount'
])
||
0
...
...
@@ -27,7 +28,9 @@ export const getUnitPriceTotal = (record) => {
return
false
}
})
return
unitPrice
*
purchaseCount
// 考虑会员折扣
let
memberPrice
=
record
?.
memberPrice
?
toPoint
(
record
.
memberPrice
)
:
1
return
unitPrice
*
purchaseCount
*
memberPrice
}
export
const
useProductTable
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
)
=>
{
const
productRef
=
useRef
<
any
>
({})
...
...
src/utils/type.ts
View file @
701fc12b
export
function
isString
(
str
:
any
):
str
is
string
{
return
typeof
str
===
'string'
}
// 分数转小数
export
const
toPoint
=
(
percent
:
string
)
=>
{
let
str
:
any
=
percent
.
replace
(
"%"
,
""
);
str
=
str
/
100
;
return
str
;
}
// 小数转分数
export
const
toPercent
=
(
point
:
number
)
=>
{
let
str
=
Number
(
point
*
100
).
toFixed
(
1
);
str
+=
"%"
;
return
str
;
}
\ No newline at end of file
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