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
1c501f74
Commit
1c501f74
authored
May 15, 2022
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复请购单bug
parent
f1d24910
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
12 deletions
+38
-12
AuthUrl.ts
src/components/AuthButton/AuthUrl.ts
+1
-1
index.tsx
src/components/AuthButton/index.tsx
+1
-1
index.tsx
.../businessRequestFunds/components/contractDrawer/index.tsx
+4
-0
index.tsx
...ion/increaseRequisition/components/editSalesman/index.tsx
+30
-8
index.tsx
...saction/purchaseRequisition/increaseRequisition/index.tsx
+2
-2
No files found.
src/components/AuthButton/AuthUrl.ts
View file @
1c501f74
...
@@ -3,7 +3,7 @@ import { getAuth } from "@/utils/auth";
...
@@ -3,7 +3,7 @@ import { getAuth } from "@/utils/auth";
export
const
AuthUrl
=
(
btnCode
:
string
)
=>
{
export
const
AuthUrl
=
(
btnCode
:
string
)
=>
{
const
{
auth
}
=
getAuth
()
const
{
auth
}
=
getAuth
()
const
{
pathname
}
=
new
URL
(
window
.
location
.
href
);
const
{
pathname
}
=
new
URL
(
window
.
location
.
href
);
const
RoutesAuth
=
auth
.
filter
((
item
:
any
)
=>
item
?.
u
===
pathname
)
const
RoutesAuth
=
auth
?
.
filter
((
item
:
any
)
=>
item
?.
u
===
pathname
)
// 默认 让所以按钮权限 打开
// 默认 让所以按钮权限 打开
// return true;
// return true;
// 先把全部按钮打开
// 先把全部按钮打开
...
...
src/components/AuthButton/index.tsx
View file @
1c501f74
...
@@ -22,7 +22,7 @@ const AuthButton = (props: AuthButtonProps) => {
...
@@ -22,7 +22,7 @@ const AuthButton = (props: AuthButtonProps) => {
const
{
auth
}
=
getAuth
()
const
{
auth
}
=
getAuth
()
const
{
pathname
}
=
new
URL
(
window
.
location
.
href
);
const
{
pathname
}
=
new
URL
(
window
.
location
.
href
);
const
RoutesAuth
=
auth
.
filter
((
item
:
any
)
=>
item
?.
u
===
pathname
)
const
RoutesAuth
=
auth
?
.
filter
((
item
:
any
)
=>
item
?.
u
===
pathname
)
const
_authorityBtn
=
()
=>
{
const
_authorityBtn
=
()
=>
{
// 本地开发时直接开放权限
// 本地开发时直接开放权限
if
(
process
.
env
.
NODE_ENV
===
"development"
)
return
true
if
(
process
.
env
.
NODE_ENV
===
"development"
)
return
true
...
...
src/pages/balance/businessRequestFunds/components/contractDrawer/index.tsx
View file @
1c501f74
...
@@ -42,6 +42,10 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
...
@@ -42,6 +42,10 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
title
:
intl
.
formatMessage
({
id
:
'balance.businessRequestFunds.components.contractDrawer.columns.billAbstract'
}),
title
:
intl
.
formatMessage
({
id
:
'balance.businessRequestFunds.components.contractDrawer.columns.billAbstract'
}),
key
:
'billAbstract'
,
key
:
'billAbstract'
,
dataIndex
:
'billAbstract'
,
dataIndex
:
'billAbstract'
,
},{
title
:
"付款方式"
,
key
:
'paymentTypeName'
,
dataIndex
:
'paymentTypeName'
,
},
{
},
{
title
:
intl
.
formatMessage
({
id
:
'balance.businessRequestFunds.components.contractDrawer.columns.billTime'
}),
title
:
intl
.
formatMessage
({
id
:
'balance.businessRequestFunds.components.contractDrawer.columns.billTime'
}),
key
:
'billTime'
,
key
:
'billTime'
,
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/components/editSalesman/index.tsx
View file @
1c501f74
...
@@ -66,15 +66,21 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
...
@@ -66,15 +66,21 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
record
?.
requisitionSalesManReqs
)
{
console
.
log
(
record
)
if
(
record
?.
requisitionSalesManReqs
&&
visible
)
{
form
.
setFieldsValue
({
requisitionSalesManReqs
:
record
?.
requisitionSalesManReqs
})
form
.
setFieldsValue
({
requisitionSalesManReqs
:
record
?.
requisitionSalesManReqs
})
}
}
},
[
record
])
},
[
visible
])
const
handleCancel
=
()
=>
{
setVisible
(
false
)
form
.
resetFields
([
'requisitionSalesManReqs'
])
}
const
renderFooter
=
()
=>
{
const
renderFooter
=
()
=>
{
return
(
return
(
<
div
style=
{
{
textAlign
:
'right'
}
}
>
<
div
style=
{
{
textAlign
:
'right'
}
}
>
<
Button
style=
{
{
marginRight
:
8
}
}
onClick=
{
()
=>
setVisible
(
false
)
}
>
<
Button
style=
{
{
marginRight
:
8
}
}
onClick=
{
()
=>
handleCancel
(
)
}
>
{
intl
.
formatMessage
({
id
:
'transaction_components.quxiao'
})
}
{
intl
.
formatMessage
({
id
:
'transaction_components.quxiao'
})
}
</
Button
>
</
Button
>
<
Button
type=
"primary"
onClick=
{
handleSubmit
}
>
<
Button
type=
"primary"
onClick=
{
handleSubmit
}
>
...
@@ -87,16 +93,33 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
...
@@ -87,16 +93,33 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
const
otherProps
=
{
footer
:
!
preview
?
renderFooter
()
:
null
}
const
otherProps
=
{
footer
:
!
preview
?
renderFooter
()
:
null
}
const
handleFormList
=
()
=>
{
// const handleFormList = () => {
// const pattern = /^[1-9]\d*$/;
// let totalPrice = 0;
// let purchaseQuantity = 0;
// const requisitionSalesManReqs = form.getFieldValue(`requisitionSalesManReqs`);
// requisitionSalesManReqs.forEach((_item, _index) => {
// totalPrice += (pattern.test(_item?.purchaseQuantity) ? Number(_item?.purchaseQuantity) : 0);
// purchaseQuantity = (pattern.test((record?.quantity - totalPrice).toString()) ? (record?.quantity - totalPrice) : 0);
// })
// Object.assign(requisitionSalesManReqs[requisitionSalesManReqs.length - 1], { purchaseQuantity: pattern.test(purchaseQuantity.toString()) ? purchaseQuantity : 0 })
// form.setFieldsValue({ requisitionSalesManReqs })
// }
const
handleTotal
=
()
=>
{
const
pattern
=
/^
[
1-9
]\d
*$/
;
const
pattern
=
/^
[
1-9
]\d
*$/
;
let
totalPrice
=
0
;
let
totalPrice
=
0
;
let
purchaseQuantity
=
0
;
let
purchaseQuantity
=
0
;
const
requisitionSalesManReqs
=
form
.
getFieldValue
(
`requisitionSalesManReqs`
);
const
requisitionSalesManReqs
=
form
.
getFieldValue
(
`requisitionSalesManReqs`
);
requisitionSalesManReqs
.
forEach
((
_item
,
_index
)
=>
{
requisitionSalesManReqs
.
forEach
((
_item
,
_index
)
=>
{
if
(
requisitionSalesManReqs
.
length
===
1
||
_index
!==
(
requisitionSalesManReqs
.
length
-
1
))
{
totalPrice
+=
(
pattern
.
test
(
_item
?.
purchaseQuantity
)
?
Number
(
_item
?.
purchaseQuantity
)
:
0
);
totalPrice
+=
(
pattern
.
test
(
_item
?.
purchaseQuantity
)
?
Number
(
_item
?.
purchaseQuantity
)
:
0
);
purchaseQuantity
=
(
pattern
.
test
((
record
?.
quantity
-
totalPrice
).
toString
())
?
(
record
?.
quantity
-
totalPrice
)
:
0
);
purchaseQuantity
=
(
pattern
.
test
((
record
?.
quantity
-
totalPrice
).
toString
())
?
(
record
?.
quantity
-
totalPrice
)
:
0
);
}
})
})
if
(
requisitionSalesManReqs
.
length
>
1
)
{
Object
.
assign
(
requisitionSalesManReqs
[
requisitionSalesManReqs
.
length
-
1
],
{
purchaseQuantity
:
pattern
.
test
(
purchaseQuantity
.
toString
())
?
purchaseQuantity
:
0
})
Object
.
assign
(
requisitionSalesManReqs
[
requisitionSalesManReqs
.
length
-
1
],
{
purchaseQuantity
:
pattern
.
test
(
purchaseQuantity
.
toString
())
?
purchaseQuantity
:
0
})
}
form
.
setFieldsValue
({
requisitionSalesManReqs
})
form
.
setFieldsValue
({
requisitionSalesManReqs
})
}
}
...
@@ -106,7 +129,7 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
...
@@ -106,7 +129,7 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
title=
'编辑业务员'
title=
'编辑业务员'
visible=
{
visible
}
visible=
{
visible
}
width=
{
900
}
width=
{
900
}
onCancel=
{
()
=>
setVisible
(
false
)
}
onCancel=
{
()
=>
handleCancel
(
)
}
onOk=
{
handleSubmit
}
onOk=
{
handleSubmit
}
{
...
otherProps
}
{
...
otherProps
}
>
>
...
@@ -164,7 +187,6 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
...
@@ -164,7 +187,6 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
requisitionSalesManReqs
.
forEach
(
_item
=>
{
requisitionSalesManReqs
.
forEach
(
_item
=>
{
totalPrice
+=
(
pattern
.
test
(
_item
?.
purchaseQuantity
)
?
Number
(
_item
?.
purchaseQuantity
)
:
0
)
totalPrice
+=
(
pattern
.
test
(
_item
?.
purchaseQuantity
)
?
Number
(
_item
?.
purchaseQuantity
)
:
0
)
})
})
console
.
log
(
totalPrice
,
'totalPrice'
)
if
(
!
pattern
.
test
(
value
))
{
if
(
!
pattern
.
test
(
value
))
{
return
Promise
.
reject
(
new
Error
(
'采购数量必须大于0,仅限三位小数'
))
return
Promise
.
reject
(
new
Error
(
'采购数量必须大于0,仅限三位小数'
))
}
}
...
@@ -176,7 +198,7 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
...
@@ -176,7 +198,7 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
},
},
]
}
]
}
>
>
<
Input
placeholder=
'请输入'
disabled=
{
((
fields
.
length
>
1
&&
(
fields
.
length
-
1
===
_index
)
&&
!
preview
)
||
preview
)
?
true
:
false
}
/>
<
Input
onChange=
{
()
=>
handleTotal
()
}
placeholder=
'请输入'
disabled=
{
((
fields
.
length
>
1
&&
(
fields
.
length
-
1
===
_index
)
&&
!
preview
)
||
preview
)
?
true
:
false
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
{
(
fields
.
length
>
1
&&
!
preview
)
?
(
{
(
fields
.
length
>
1
&&
!
preview
)
?
(
...
@@ -194,7 +216,7 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
...
@@ -194,7 +216,7 @@ const EditSalesman: React.FC<MemberModalTableProps> = (props) => {
<
Form
.
Item
>
<
Form
.
Item
>
<
Button
type=
"dashed"
onClick=
{
()
=>
{
<
Button
type=
"dashed"
onClick=
{
()
=>
{
add
({
userId
:
null
,
name
:
null
,
purchaseQuantity
:
null
})
add
({
userId
:
null
,
name
:
null
,
purchaseQuantity
:
null
})
handle
FormList
()
handle
Total
()
}
}
block
icon=
{
<
PlusOutlined
/>
}
>
}
}
block
icon=
{
<
PlusOutlined
/>
}
>
添加
添加
</
Button
>
</
Button
>
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/index.tsx
View file @
1c501f74
...
@@ -394,8 +394,8 @@ const IncreaseRequisition: React.FC<{}> = () => {
...
@@ -394,8 +394,8 @@ const IncreaseRequisition: React.FC<{}> = () => {
const
onChangeAddress
=
(
res
)
=>
{
const
onChangeAddress
=
(
res
)
=>
{
console
.
log
(
res
,
'10086'
)
if
(
res
.
values
[
1
]?.
title
===
"物流"
)
{
if
(
res
.
values
[
1
]?.
value
===
1
)
{
const
list
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
false
:
true
}
})
const
list
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
false
:
true
}
})
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
state
.
visible
=
false
;
state
.
visible
=
false
;
...
...
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