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
3eb34615
Commit
3eb34615
authored
Apr 14, 2022
by
前端-彭佳文
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2-0418-xxx' into 'v2-220418'
代码优化 See merge request linkseeks-design/pro-platform!282
parents
cea42e18
da7f2c08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
59 deletions
+82
-59
useBillDetail.tsx
src/pages/transaction/_public/bill/effects/useBillDetail.tsx
+5
-3
index.tsx
...saction/purchaseRequisition/increaseRequisition/index.tsx
+77
-56
No files found.
src/pages/transaction/_public/bill/effects/useBillDetail.tsx
View file @
3eb34615
...
...
@@ -33,9 +33,9 @@ export const useBillDetail = (options: BillDetailHookProps) => {
switch
(
type
)
{
case
'requestBill'
:
api
=
getPurchaseRequisitionDetail
;
break
;
break
;
case
'transformBill'
:
api
=
getPurchaseRequisitionTransferPurchaseDetail
break
;
break
;
default
:
api
=
getPurchaseRequisitionDetail
;
}
...
...
@@ -46,7 +46,7 @@ export const useBillDetail = (options: BillDetailHookProps) => {
if
(
id
||
requisitionNo
)
{
const
fn
=
getDetailsApi
(
type
)
// @ts-ignore
fn
(
id
?
{
id
}
:
{
requisitionNo
},
{
ctlType
:
"none"
}).
then
(
res
=>
{
fn
(
id
?
{
id
}
:
{
requisitionNo
},
{
ctlType
:
"none"
}).
then
(
res
=>
{
const
{
code
,
data
,
message
:
msg
}
=
res
if
(
code
===
1000
)
{
setFormData
(
data
)
...
...
@@ -61,7 +61,9 @@ export const useBillDetail = (options: BillDetailHookProps) => {
const
anchorTitleList
=
[
{
title
:
'流转进度'
,
id
:
'transferProcess'
,
componentName
:
"TransferProcess"
},
{
title
:
'基本信息'
,
id
:
'baseicInfo'
,
type
:
"basicInfo"
},
{
title
:
'送货/交期信息'
,
id
:
'BillDelivery'
,
type
:
"BillDelivery"
,
componentName
:
"BillDelivery"
},
{
title
:
'请购物料'
,
id
:
'billMaterial'
,
componentName
:
"BillMaterial"
},
{
title
:
"附件"
,
id
:
'BilEnclosure'
,
componentName
:
"BilEnclosure"
},
{
title
:
'流转记录'
,
id
:
'transferRecord'
,
componentName
:
"TransformRecord"
},
]
...
...
src/pages/transaction/purchaseRequisition/increaseRequisition/index.tsx
View file @
3eb34615
...
...
@@ -90,27 +90,26 @@ const IncreaseRequisition: React.FC<{}> = () => {
const
_orderProductRequests
=
procurementRenderField
(
data
)
addSchemaAction
.
setFieldState
(
'deliveryAddressId'
,
state
=>
{
state
.
props
.
isDefaultAddress
=
false
;
state
.
visible
=
data
.
deliveryMethod
==
1
?
true
:
false
;
state
.
visible
=
data
.
deliveryMethod
==
1
&&
data
.
deliveryType
!=
1
?
true
:
false
;
});
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
state
.
visible
=
data
.
deliveryMethod
!=
1
?
true
:
false
;
state
.
visible
=
data
.
deliveryMethod
!=
1
||
data
.
deliveryType
==
1
?
true
:
false
;
});
if
(
data
.
delivery
Type
)
{
if
(
data
.
deliveryMethod
==
1
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
false
}
}
)
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
if
(
data
.
delivery
Method
===
1
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
false
:
true
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
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
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
}
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
state
.
visible
=
true
;
});
setdeliveryType
(
data
.
deliveryType
)
}
if
(
data
.
deliveryMethod
==
2
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
true
:
false
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
}
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
state
.
visible
=
true
;
});
setdeliveryType
(
data
.
deliveryType
)
rowvendorMemberInfoRef
.
current
=
{
memberId
:
data
.
vendorMemberId
,
roleId
:
data
.
vendorRoleId
,
...
...
@@ -214,18 +213,34 @@ const IncreaseRequisition: React.FC<{}> = () => {
const
handleOrderMember
=
()
=>
{
memberRef
.
current
.
setVisible
(
true
)
}
// 配送方式
const
changeDeliveryType
=
(
e
)
=>
{
addSchemaAction
.
setFieldValue
(
'deliveryType'
,
e
.
target
.
value
)
setdeliveryType
(
e
.
target
.
value
)
const
Address
=
addSchemaAction
.
getFieldState
(
'deliveryAddressId'
)
console
.
log
(
Address
)
const
name
=
Address
.
value
.
name
?
Address
.
value
.
name
:
Address
.
value
.
receiverName
;
const
addres
=
Address
.
value
.
fullAddress
?
Address
.
value
.
fullAddress
:
Address
.
value
.
streetName
+
Address
.
value
.
address
+
Address
.
value
.
phone
;
console
.
log
(
addres
,
name
)
if
(
Address
.
value
)
{
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
state
.
visible
=
true
;
state
.
value
=
name
+
Address
.
value
.
provinceName
+
Address
.
value
.
cityName
+
Address
.
value
.
districtName
+
addres
});
addSchemaAction
.
setFieldState
(
'deliveryAddressId'
,
state
=>
{
state
.
visible
=
false
;
});
}
}
// 自定义组建
const
RadioNode
=
()
=>
{
const
value
=
deliveryTypeList
.
filter
((
item
)
=>
!
item
.
disabled
);
return
(
// defaultValue={id ? deliveryType : value ? value.deliveryType : ''}
<
Radio
.
Group
onChange=
{
changeDeliveryType
}
defaultValue=
{
id
?
deliveryType
:
value
.
length
?
value
[
0
].
deliveryType
:
''
}
>
<
Radio
.
Group
onChange=
{
changeDeliveryType
}
value=
{
deliveryType
}
defaultValue=
{
id
?
deliveryType
:
''
}
>
<
div
className=
{
styles
.
RadioMian
}
>
{
deliveryTypeList
.
map
((
item
)
=>
(
...
...
@@ -357,9 +372,8 @@ const IncreaseRequisition: React.FC<{}> = () => {
dataIndex
:
'goodsName'
,
render
:
(
text
,
record
,
index
)
=>
{
let
goodsName
=
id
||
text
?
enclosureRef
.
current
.
list
.
find
(
item
=>
item
.
label
===
text
)
:
''
console
.
log
(
goodsName
)
return
(
<
Select
style=
{
{
width
:
230
}
}
defaultValue=
{
id
||
goodsName
?
goodsName
.
label
:
''
}
onChange=
{
(
value
)
=>
handleFirstChange
(
value
,
index
)
}
>
<
Select
style=
{
{
width
:
230
}
}
defaultValue=
{
id
||
goodsName
?
goodsName
?
.
label
:
''
}
onChange=
{
(
value
)
=>
handleFirstChange
(
value
,
index
)
}
>
{
Object
.
keys
(
enclosureRef
.
current
).
length
&&
enclosureRef
.
current
.
list
.
map
((
item
:
any
)
=>
{
return
(
...
...
@@ -388,6 +402,48 @@ const IncreaseRequisition: React.FC<{}> = () => {
},
500
)
}
const
onChangeAddress
=
(
res
)
=>
{
if
(
res
.
values
[
1
]?.
title
===
"物流"
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
false
:
true
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
state
.
visible
=
false
;
});
setdeliveryType
(
''
)
addSchemaAction
.
setFieldValue
(
'deliveryType'
,
""
)
addSchemaAction
.
setFieldState
(
'deliveryAddressId'
,
state
=>
{
state
.
visible
=
true
;
});
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
state
.
visible
=
true
;
});
return
;
}
if
(
res
.
values
[
1
]?.
title
===
"自提"
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
true
:
false
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
state
.
visible
=
true
;
});
addSchemaAction
.
setFieldValue
(
'deliveryType'
,
""
)
addSchemaAction
.
setFieldValue
(
'deliveryAddressId'
,
""
)
addSchemaAction
.
setFieldState
(
'deliveryAddressId'
,
state
=>
{
state
.
visible
=
false
;
});
setdeliveryType
(
''
)
return
;
}
if
(
res
.
values
[
1
]?.
title
===
"无需配送"
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
&&
deliveryTypeListRef
.
current
?.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
true
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
state
.
visible
=
false
;
});
addSchemaAction
.
setFieldState
(
'deliveryAddressId'
,
state
=>
{
state
.
visible
=
false
;
});
setdeliveryType
(
''
)
addSchemaAction
.
setFieldValue
(
'deliveryType'
,
""
)
}
}
return
(<
div
className=
{
styles
[
'mian'
]
}
>
<
FormDetailContext
.
Provider
value=
{
providerValue
}
>
<
FormDetailHeader
...
...
@@ -428,42 +484,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
formContext
.
useAttachmentChangeForContext
(
ctx
)
$
(
'onFieldChange'
,
'deliveryMethod'
).
subscribe
(
res
=>
{
if
(
res
.
values
[
1
]?.
title
===
"物流"
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
false
:
true
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
state
.
visible
=
false
;
});
addSchemaAction
.
setFieldValue
(
'deliveryType'
,
""
)
addSchemaAction
.
setFieldState
(
'deliveryAddressId'
,
state
=>
{
state
.
visible
=
true
;
});
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
state
.
visible
=
true
;
});
}
if
(
res
.
values
[
1
]?.
title
===
"自提"
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
item
.
disabled
=
item
.
deliveryTypeName
==
'直送客户'
?
true
:
false
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
addSchemaAction
.
setFieldState
(
'deliveryType'
,
state
=>
{
state
.
visible
=
true
;
});
addSchemaAction
.
setFieldValue
(
'deliveryType'
,
""
)
addSchemaAction
.
setFieldValue
(
'deliveryAddressId'
,
""
)
addSchemaAction
.
setFieldState
(
'deliveryAddressId'
,
state
=>
{
state
.
visible
=
false
;
});
}
if
(
res
.
values
[
1
]?.
title
===
"无需配送"
)
{
deliveryTypeListRef
.
current
.
deliveryTypeList
=
deliveryTypeListRef
.
current
.
deliveryTypeList
&&
deliveryTypeListRef
.
current
?.
deliveryTypeList
.
map
(
item
=>
{
return
{
...
item
,
disabled
:
true
}
})
setdeliveryTypeList
(
deliveryTypeListRef
.
current
.
deliveryTypeList
)
addSchemaAction
.
setFieldState
(
'deliveryAddress'
,
state
=>
{
state
.
visible
=
true
;
});
addSchemaAction
.
setFieldState
(
'deliveryAddressId'
,
state
=>
{
state
.
visible
=
false
;
});
addSchemaAction
.
setFieldValue
(
'deliveryType'
,
""
)
}
onChangeAddress
(
res
)
})
}
}
...
...
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