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
d368b364
Commit
d368b364
authored
May 16, 2022
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复请购单bug
parent
9b63e2bc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
28 deletions
+40
-28
purchaseRequisitionRoute.ts
config/routes/procurementRoute/purchaseRequisitionRoute.ts
+1
-1
AuthUrl.ts
src/components/AuthButton/AuthUrl.ts
+1
-1
index.tsx
...ion/purchaseRequisition/components/billMaterial/index.tsx
+1
-1
index.tsx
...creaseRequisition/components/materialModalTable/index.tsx
+3
-1
index.tsx
...saction/purchaseRequisition/increaseRequisition/index.tsx
+32
-22
useMaterialTable.tsx
...equisition/increaseRequisition/model/useMaterialTable.tsx
+2
-2
No files found.
config/routes/procurementRoute/purchaseRequisitionRoute.ts
View file @
d368b364
...
...
@@ -47,7 +47,7 @@ export const purchaseRequisitionRoute = [
},
// 待新增请购单-编辑请购单
{
path
:
'/memberCenter/
tranaction
Ability/purchaseRequisition/readyAddBill/edit'
,
path
:
'/memberCenter/
procurement
Ability/purchaseRequisition/readyAddBill/edit'
,
name
:
'待新增请购单-编辑请购单'
,
component
:
'@/pages/transaction/purchaseRequisition/increaseRequisition'
,
hideInMenu
:
true
,
...
...
src/components/AuthButton/AuthUrl.ts
View file @
d368b364
...
...
@@ -3,7 +3,7 @@ import { getAuth } from "@/utils/auth";
export
const
AuthUrl
=
(
btnCode
:
string
)
=>
{
const
{
auth
}
=
getAuth
()
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;
// 先把全部按钮打开
...
...
src/pages/transaction/purchaseRequisition/components/billMaterial/index.tsx
View file @
d368b364
...
...
@@ -201,7 +201,7 @@ const BidMaterial: React.FC<BidMaterialProps> = ({ cardTitle }) => {
<
div
className=
{
style
.
childrenContent
}
>
<
p
><
span
>
{
intl
.
formatMessage
({
id
:
'purchaseRequisition.guigexinghao'
,
defaultMessage
:
'规格型号'
})
}
:
</
span
>
{
record
.
spec
}
</
p
>
<
p
><
span
>
{
intl
.
formatMessage
({
id
:
'purchaseRequisition.pinlei'
,
defaultMessage
:
'品类'
})
}
:
</
span
>
{
record
.
category
}
</
p
>
<
p
><
span
>
物料编号:
</
span
>
{
record
.
globalMQID
}
</
p
>
<
p
><
span
>
物料编号:
</
span
>
{
record
.
productNo
}
</
p
>
<
p
><
span
>
托规格(托):
</
span
>
{
record
.
palmSpec
}
KG/包
</
p
>
<
p
><
span
>
柜/车规格:
</
span
>
{
record
.
cabinetSpec
}
吨/柜
</
p
>
</
div
>
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/components/materialModalTable/index.tsx
View file @
d368b364
...
...
@@ -142,7 +142,7 @@ const MaterialModalTable: React.FC<MaterialModalTableProps> = (props) => {
temp
.
name
=
v
.
name
;
// 物料名称
temp
.
category
=
v
?.
customerCategory
?.
name
||
v
?.
category
||
null
;
// 物料品类
temp
.
brand
=
v
?.
brand
?.
name
||
v
?.
brand
||
null
;
// 物料品牌
temp
.
spec
=
v
.
type
;
// 物料规格
temp
.
type
=
v
.
type
;
// 物料规格
temp
.
unit
=
v
?.
unitName
||
v
?.
unit
||
null
;
//计价单位
// temp.price = v?.price; // 物料价格
// temp.stock = v?.stock; // 供方库存
...
...
@@ -174,6 +174,7 @@ const MaterialModalTable: React.FC<MaterialModalTableProps> = (props) => {
tempOriginData
.
push
(
item
)
}
})
console
.
log
(
tempOriginData
,
'tempOriginData'
)
return
tempOriginData
}
}
...
...
@@ -181,6 +182,7 @@ const MaterialModalTable: React.FC<MaterialModalTableProps> = (props) => {
const
handleConfirm
=
async
()
=>
{
const
materialData
=
schemaAction
.
getFieldValue
(
'products'
)
schemaAction
.
setFieldValue
(
'products'
,
addMaterialProcessField
(
rowSelectionCtl
.
selectRow
,
materialData
))
console
.
log
(
addMaterialProcessField
(
rowSelectionCtl
.
selectRow
,
materialData
))
confirmModal
&&
confirmModal
()
setVisible
(
false
)
clearModalParams
()
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/index.tsx
View file @
d368b364
...
...
@@ -33,6 +33,18 @@ import EditSalesman from './components/editSalesman'
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
import
{
getPurchaseRequisitionSrmGetEnumsData
}
from
'@/services/PurchaseV2Api'
/** 配送 */
const
SUPPLY
=
1
/** 自提 */
const
PICK_UP
=
2
/** 客户自提 */
const
ClIENT_PICK_UP
=
3
/** 供应商直发 */
const
SUPPLIER_DIRECT
=
4
const
{
onFormMount$
,
}
=
FormEffectHooks
;
...
...
@@ -54,7 +66,6 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', () => {
const
intl
=
useIntl
()
const
{
form
}
=
useFormSpy
({
selector
:
[[
'onFieldValueChange'
,
'products'
]],
reducer
:
v
=>
v
})
const
data
=
form
.
getFieldValue
(
'products'
)
console
.
log
(
data
,
'data'
)
const
sum
=
data
?
data
.
reduce
((
prev
,
next
)
=>
(
prev
*
1000
+
(
next
.
amount
||
0
)
*
1000
)
/
1000
,
0
)
:
0
const
total
=
data
?
data
.
reduce
((
prev
,
next
)
=>
(
prev
*
1000
+
(
next
.
quantity
||
0
)
*
1000
)
/
1000
,
0
)
:
0
...
...
@@ -108,16 +119,16 @@ const IncreaseRequisition: React.FC<{}> = () => {
// state.visible = data.deliveryMethod != 1 || data.deliveryType == 1 ? true : false;
});
if
(
data
.
deliveryMethod
===
1
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
false
:
true
}
})
console
.
log
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
//
if (data.deliveryMethod === 1) {
//
deliveryTypeListRef.current.deliveryTypeList = deliveryTypeListRef.current.deliveryTypeList.map(item => { return { ...item, disabled: item.disabled = item.deliveryTypeName == '直送客户' ? false : true } })
//
console.log(deliveryTypeListRef.current.deliveryTypeList)
}
if
(
data
.
deliveryMethod
==
2
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
true
:
false
}
})
//
}
//
if (data.deliveryMethod == 2) {
//
deliveryTypeListRef.current.deliveryTypeList = deliveryTypeListRef.current.deliveryTypeList.map(item => { return { ...item, disabled: item.disabled = item.deliveryTypeName == '直送客户' ? true : false } })
}
//
}
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
...
...
@@ -138,6 +149,9 @@ const IncreaseRequisition: React.FC<{}> = () => {
attachmentsRef
.
current
.
attachments
=
data
.
attachments
;
setInitFormValue
(()
=>
procurmentRenderInit
(
data
))
setTimeout
(()
=>
{
addSchemaAction
.
setFieldValue
(
'currency'
,
(
data
.
currency
).
toString
())
addSchemaAction
.
setFieldValue
(
'business'
,
(
data
.
businessType
).
toString
())
addSchemaAction
.
setFieldValue
(
'arrivalArea'
,
(
data
.
arrivalArea
).
toString
())
addSchemaAction
.
setFieldValue
(
'products'
,
_orderProductRequests
)
addSchemaAction
.
setFieldValue
(
'attachments'
,
data
.
attachments
)
addSchemaAction
.
setFieldValue
(
'deliveryAddressId'
,
data
.
receiverAddressResponse
)
...
...
@@ -156,9 +170,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
addSchemaAction
.
setFieldValue
(
'vendorMemberName'
,
userInfo
.
orgName
||
''
)
addSchemaAction
.
setFieldValue
(
'deliveryType'
,
userInfo
.
orgId
||
''
)
}
}
},
[])
const
setLik
=
(
row
)
=>
{
...
...
@@ -179,7 +191,6 @@ const IncreaseRequisition: React.FC<{}> = () => {
let
fnResult
=
null
// 新增订单/编辑订单
const
params
=
{
...
value
}
console
.
log
(
value
)
if
(
formContext
.
innerFormErrors
)
{
throw
new
Error
(
intl
.
formatMessage
({
id
:
'purchaseRequisition.qingwanshandingdan'
,
defaultMessage
:
'请完善订单物料数据'
}))
}
...
...
@@ -197,11 +208,9 @@ const IncreaseRequisition: React.FC<{}> = () => {
setBtnLoading
(
true
)
const
_params
=
procurementProcessField
(
params
)
console
.
log
(
_params
)
if
(
_params
.
deliveryAddressId
)
{
_params
.
deliveryAddressId
=
_params
.
deliveryAddressId
.
id
;
}
console
.
log
(
_params
,
'_params'
)
if
(
id
)
{
fnResult
=
await
postPurchaseRequisitionUpdate
({
...
_params
,
id
})
}
else
{
...
...
@@ -217,7 +226,6 @@ const IncreaseRequisition: React.FC<{}> = () => {
}
catch
(
error
)
{
setBtnLoading
(
false
)
error
?.
message
&&
message
.
error
(
error
.
message
)
console
.
log
(
error
)
}
}
...
...
@@ -337,14 +345,12 @@ const IncreaseRequisition: React.FC<{}> = () => {
list
.
map
((
item
:
any
)
=>
{
arr
.
push
({
label
:
item
.
name
,
value
:
item
.
id
})
})
console
.
log
(
arr
,
'arr'
);
enclosureRef
.
current
.
list
=
[...
arr
];
await
constructedCallback
()
}
useEffect
(()
=>
{
console
.
log
(
enclosureRef
.
current
)
constructedCallback
()
},
[
enclosureRef
.
current
])
...
...
@@ -394,8 +400,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
const
onChangeAddress
=
(
res
)
=>
{
console
.
log
(
res
,
'10086'
)
if
(
res
.
values
[
1
]?.
value
===
1
)
{
if
(
res
.
values
[
1
]?.
value
===
SUPPLY
||
res
.
values
[
1
]?.
value
===
SUPPLIER_DIRECT
)
{
const
list
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
false
:
true
}
})
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
state
.
visible
=
false
;
...
...
@@ -411,7 +416,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
state
.
visible
=
true
;
});
return
;
}
if
(
res
.
values
[
1
]?.
title
===
"自提"
)
{
}
if
(
res
.
values
[
1
]?.
value
===
PICK_UP
)
{
const
list
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
true
:
false
}
})
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
state
.
visible
=
true
;
...
...
@@ -423,7 +428,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
state
.
visible
=
false
;
});
return
;
}
if
(
res
.
values
[
1
]?.
title
===
"无需配送"
)
{
}
if
(
res
.
values
[
1
]?.
value
===
ClIENT_PICK_UP
)
{
const
list
=
deliveryTypeListRef
.
current
.
deliveryTypeList
&&
deliveryTypeListRef
.
current
?.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
true
}
})
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
state
.
props
[
"x-component-props"
].
list
=
list
...
...
@@ -507,11 +512,16 @@ const IncreaseRequisition: React.FC<{}> = () => {
formContext
.
useAttachmentChangeForContext
(
ctx
)
$
(
'onFieldChange'
,
'deliveryMethod'
).
subscribe
(
res
=>
{
console
.
log
(
res
);
onChangeAddress
(
res
)
})
$
(
'onFieldInputChange'
,
'deliveryAddressId'
).
subscribe
(
state
=>
{
let
deliveryAddress
=
state
?.
value
?.
fullAddress
?
`${state?.value?.name}${state?.value?.fullAddress}${state?.value?.phone}`
:
`${state?.value?.name}${state?.value?.provinceName}${state?.value?.cityName}${state?.value?.districtName}${state?.value?.streetName}${state?.value?.address}${state?.value?.phone}`
;
ctx
.
setFieldValue
(
'deliveryAddress'
,
deliveryAddress
)
})
}
}
expressionScope=
{
{
memberBtn
,
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/model/useMaterialTable.tsx
View file @
d368b364
...
...
@@ -130,9 +130,9 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
</
Col
>
<
Col
span=
{
6
}
>
<
div
className=
{
style
.
childrenContent
}
>
<
p
><
span
>
{
intl
.
formatMessage
({
id
:
'purchaseRequisition.guigexinghao'
,
defaultMessage
:
'规格型号'
})
}
:
</
span
>
{
record
.
spec
}
</
p
>
<
p
><
span
>
{
intl
.
formatMessage
({
id
:
'purchaseRequisition.guigexinghao'
,
defaultMessage
:
'规格型号'
})
}
:
</
span
>
{
record
.
type
}
</
p
>
<
p
><
span
>
{
intl
.
formatMessage
({
id
:
'purchaseRequisition.pinlei'
,
defaultMessage
:
'品类'
})
}
:
</
span
>
{
record
.
category
}
</
p
>
<
p
><
span
>
物料编号:
</
span
>
{
record
.
globalMQID
}
</
p
>
<
p
><
span
>
物料编号:
</
span
>
{
record
.
code
}
</
p
>
<
p
><
span
>
托规格(托):
</
span
>
{
record
.
palmSpec
}
KG/包
</
p
>
<
p
><
span
>
柜/车规格:
</
span
>
{
record
.
cabinetSpec
}
吨/柜
</
p
>
</
div
>
...
...
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