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
444b8b50
Commit
444b8b50
authored
May 06, 2022
by
rainbowmorel@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选择物料 逻辑修改
parent
13deed51
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
100 additions
and
63 deletions
+100
-63
add.tsx
src/pages/order/deliveryNotice/manageB2B/add.tsx
+29
-21
add.tsx
src/pages/order/deliveryNotice/manageSRM/add.tsx
+9
-10
index.tsx
...eliveryNoticeAwaitB2B/components/AddEditContent/index.tsx
+26
-15
index.tsx
...eliveryNoticeAwaitSRM/components/AddEditContent/index.tsx
+34
-17
index.tsx
...liveryNoticeManagement/deliveryNoticeFromCreate/index.tsx
+1
-0
add.tsx
src/pages/order/receivingNote/deliveryNoteManage/add.tsx
+1
-0
No files found.
src/pages/order/deliveryNotice/manageB2B/add.tsx
View file @
444b8b50
...
...
@@ -84,9 +84,9 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
},
[
form
,
tableDataSourceContext
])
const
handleRemoveMaterialTableRow
=
(
i
:
number
)
=>
{
const
source
:
any
[]
=
JSON
.
parse
(
JSON
.
stringify
(
tableDataSource
));
const
source
:
any
[]
=
JSON
.
parse
(
JSON
.
stringify
(
tableDataSource
Context
));
source
.
splice
(
i
,
1
);
let
atpm
=
JSON
.
parse
(
JSON
.
stringify
(
anchors
));
atpm
.
pop
()
...
...
@@ -203,6 +203,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
label=
{
ReceivingAddress
}
name=
"receiveVO"
>
<
ReceiverAddress
disabled=
{
true
}
hiddenBtn=
{
true
}
/>
</
FormItem
>
...
...
@@ -255,38 +256,45 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<
ContentBox
title=
{
DeliveryGood
.
name
}
id=
{
DeliveryGood
.
key
}
cols=
{
1
}
>
{
/* 在编辑的时候不需要进行此操作 */
}
<
DeliveryGoodTableSelectB2B
value=
{
tableDataSource
}
form=
{
form
}
onChange=
{
(
value
)
=>
{
if
(
value
.
length
>
0
)
{
let
addr
=
{
provinceName
:
value
[
0
].
provinceName
,
cityName
:
value
[
0
].
cityName
,
districtName
:
value
[
0
].
districtName
,
streetName
:
value
[
0
].
streetName
,
address
:
value
[
0
].
address
,
phone
:
value
[
0
].
phone
,
consignee
:
value
[
0
].
consignee
,
receiverName
:
value
[
0
].
consignee
,
fullAddress
:
`${value[0].provinceName}${value[0].cityName}${value[0].districtName}${value[0].streetName}${value[0].address}`
}
form
.
setFieldsValue
({
'receiveVO'
:
addr
})
}
let
atpm
=
JSON
.
parse
(
JSON
.
stringify
(
anchors
));
atpm
.
pop
()
const
ft
=
formatTable
(
value
);
setAnchors
([
...
atpm
,
{
...
DeliveryGood
,
name
:
`${DeliveryGood.name}(${
value
.length})`
name
:
`${DeliveryGood.name}(${
ft
.length})`
}
])
if
(
ft
.
length
>
0
)
{
let
addr
=
{
provinceName
:
ft
[
0
].
provinceName
,
cityName
:
ft
[
0
].
cityName
,
districtName
:
ft
[
0
].
districtName
,
streetName
:
ft
[
0
].
streetName
,
address
:
ft
[
0
].
address
,
phone
:
ft
[
0
].
phone
,
consignee
:
ft
[
0
].
consignee
,
receiverName
:
ft
[
0
].
consignee
,
fullAddress
:
`${ft[0].provinceName}${ft[0].cityName}${ft[0].districtName}${ft[0].streetName}${ft[0].address}`
}
form
.
setFieldsValue
({
'receiveVO'
:
addr
})
}
setTableDataSource
(
value
)
setTableDataSourceContext
(
f
ormatTable
(
value
)
)
setTableDataSourceContext
(
f
t
)
}
}
/>
...
...
src/pages/order/deliveryNotice/manageSRM/add.tsx
View file @
444b8b50
...
...
@@ -180,7 +180,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<
FormItem
label=
{
ReceivingAddress
}
name=
"receiveVO"
>
<
ReceiverAddress
disabled=
{
true
}
hiddenBtn=
{
true
}
/>
...
...
@@ -244,18 +243,10 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
form=
{
form
}
onChange=
{
(
value
)
=>
{
let
atpm
=
JSON
.
parse
(
JSON
.
stringify
(
anchors
));
atpm
.
pop
()
setAnchors
([
...
atpm
,
{
...
Material
,
name
:
`${Material.name}(${value.length})`
}
])
const
ft
=
formatTable
(
value
)
if
(
ft
.
length
>
0
)
{
...
...
@@ -275,6 +266,14 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
})
}
setAnchors
([
...
atpm
,
{
...
Material
,
name
:
`${Material.name}(${ft.length})`
}
])
setTableDataSource
(
value
)
setTableDataSourceContext
(
ft
)
}
}
...
...
src/pages/order/deliveryNoticeManagement/deliveryNoticeAwaitB2B/components/AddEditContent/index.tsx
View file @
444b8b50
...
...
@@ -21,6 +21,7 @@ import usePrompt from '@/hooks/usePrompt'
import
FormProgress
,
{
HandleType
}
from
'@/components/FormProgress'
import
{
getMemberManageBuyerMember
}
from
'@/services/MemberV2Api'
import
{
validatorByte
}
from
'@/utils/regExp'
import
{
formatTable
,
formMapData
}
from
'@/pages/order/components/DeliveryGoodTableSelect/useformatTable'
type
PropsType
=
{
type
:
'add'
|
'edit'
;
...
...
@@ -56,13 +57,19 @@ const getConst = (len = 0) => {
const
DeliveryNoticeManagementAwaitB2BDetails
:
React
.
FC
<
PropsType
>
=
({
type
,
id
,
planData
,
btnCode
})
=>
{
const
[
form
]
=
Form
.
useForm
()
const
{
renderPrompt
,
handleLeave
}
=
usePrompt
()
const
[
tableDataSource
,
setTableDataSource
]
=
useState
<
any
[]
>
([])
const
[
tableDataSource
,
setTableDataSource
]
=
useState
<
any
>
([])
const
[
tableDataSourceContext
,
setTableDataSourceContext
]
=
useState
([])
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
)
const
progressRef
=
useRef
<
HandleType
>
()
const
changeTableSource
=
(
data
=
[])
=>
{
setTableDataSource
(
data
)
const
r
=
formMapData
(
tableDataSource
,
data
)
setTableDataSource
(
r
);
setTableDataSourceContext
(
data
);
renderProgress
(
data
)
}
...
...
@@ -324,36 +331,40 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
</BaseInfo>
<BaseInfo className='mt-16' title={DeliveryGood.name} id={DeliveryGood.key} cols={1}>
<DeliveryGoodTableSelect
value={tableDataSource}
title={`
选择
$
{
DeliveryGood
.
name
}
`}
disabled={!!planData}
form={form}
onChange={(value) => {
if (value.length > 0) {
const ft = formatTable(value)
if (ft.length > 0) {
let addr = {
provinceName:
value
[0].provinceName,
cityName:
value
[0].cityName,
districtName:
value
[0].districtName,
streetName:
value
[0].streetName,
address:
value
[0].address,
phone:
value
[0].phone,
consignee:
value
[0].consignee,
consigneeId:
value
[0].consigneeId,
fullAddress: `
$
{
value
[
0
].
provinceName
}
$
{
value
[
0
].
cityName
}
$
{
value
[
0
].
districtName
}
$
{
value
[
0
].
streetName
}
$
{
value
[
0
].
address
}
`
provinceName:
ft
[0].provinceName,
cityName:
ft
[0].cityName,
districtName:
ft
[0].districtName,
streetName:
ft
[0].streetName,
address:
ft
[0].address,
phone:
ft
[0].phone,
consignee:
ft
[0].consignee,
consigneeId:
ft
[0].consigneeId,
fullAddress: `
$
{
ft
[
0
].
provinceName
}
$
{
ft
[
0
].
cityName
}
$
{
ft
[
0
].
districtName
}
$
{
ft
[
0
].
streetName
}
$
{
ft
[
0
].
address
}
`
}
form.setFieldsValue({
'receivingAddress': addr
})
}
changeTableSource(value)
setTableDataSource(value)
changeTableSource(ft)
}}
/>
<HarvestMaterialContextProvider value={{
dataSource: tableDataSource
dataSource: tableDataSource
Context
}}>
<Table
rowKey={row => row.orderNo}
columns={columns}
dataSource={tableDataSource}
dataSource={tableDataSource
Context
}
/>
</HarvestMaterialContextProvider>
</BaseInfo>
...
...
src/pages/order/deliveryNoticeManagement/deliveryNoticeAwaitSRM/components/AddEditContent/index.tsx
View file @
444b8b50
...
...
@@ -24,6 +24,7 @@ import usePrompt from '@/hooks/usePrompt'
import
FormProgress
,
{
HandleType
}
from
'@/components/FormProgress'
import
{
getMemberManageUpperConsumerMerchantPage
}
from
'@/services/MemberV2Api'
import
{
validatorByte
}
from
'@/utils/regExp'
import
{
formatTable
,
formMapData
}
from
'@/pages/order/components/DeliveryGoodTableSelect/useformatTable'
type
PropsType
=
{
type
:
'add'
|
'edit'
;
...
...
@@ -59,13 +60,21 @@ const getConst = (len = 0) => {
const
DeliveryNoticeManagementAwaitSRMDetails
:
React
.
FC
<
PropsType
>
=
({
type
,
id
,
planData
,
btnCode
})
=>
{
const
[
form
]
=
Form
.
useForm
()
const
{
renderPrompt
,
handleLeave
}
=
usePrompt
()
const
[
tableDataSource
,
setTableDataSource
]
=
useState
<
any
[]
>
([])
const
[
tableDataSource
,
setTableDataSource
]
=
useState
<
any
>
([])
const
[
tableDataSourceContext
,
setTableDataSourceContext
]
=
useState
([])
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
)
const
progressRef
=
useRef
<
HandleType
>
()
const
changeTableSource
=
(
data
=
[])
=>
{
setTableDataSource
(
data
)
const
r
=
formMapData
(
tableDataSource
,
data
)
setTableDataSource
(
r
);
setTableDataSourceContext
(
data
);
renderProgress
(
data
)
}
...
...
@@ -118,9 +127,10 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
}
const
handleRemoveMaterialTableRow
=
(
i
:
number
)
=>
{
const
source
:
any
[]
=
tableDataSource
;
const
source
:
any
[]
=
tableDataSource
Context
;
const
newSource
=
source
.
splice
(
i
,
0
)
changeTableSource
(
newSource
)
}
const
getDetail
=
async
()
=>
{
...
...
@@ -311,7 +321,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
{ required: true, message: `
请选择
$
{
ReceivingAddress
}
` }
]}
>
<ReceiverAddress disabled />
<ReceiverAddress disabled
hiddenBtn={true}
/>
</Form.Item>
<Form.Item
...
...
@@ -328,36 +338,43 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
</BaseInfo>
<BaseInfo className='mt-16' title={Material.name} id={Material.key} cols={1}>
<DeliveryGoodTableSelect
value={tableDataSource}
disabled={!!planData}
form={form}
orderType={2}
onChange={(value) => {
if (value.length > 0) {
const ft = formatTable(value)
if (ft.length > 0) {
let addr = {
provinceName:
value
[0].provinceName,
cityName:
value
[0].cityName,
districtName:
value
[0].districtName,
streetName:
value
[0].streetName,
address:
value
[0].address,
phone:
value
[0].phone,
consignee:
value
[0].consignee,
consigneeId:
value
[0].consigneeId,
fullAddress: `
$
{
value
[
0
].
provinceName
}
$
{
value
[
0
].
cityName
}
$
{
value
[
0
].
districtName
}
$
{
value
[
0
].
streetName
}
$
{
value
[
0
].
address
}
`
provinceName:
ft
[0].provinceName,
cityName:
ft
[0].cityName,
districtName:
ft
[0].districtName,
streetName:
ft
[0].streetName,
address:
ft
[0].address,
phone:
ft
[0].phone,
consignee:
ft
[0].consignee,
consigneeId:
ft
[0].consigneeId,
fullAddress: `
$
{
ft
[
0
].
provinceName
}
$
{
ft
[
0
].
cityName
}
$
{
ft
[
0
].
districtName
}
$
{
ft
[
0
].
streetName
}
$
{
ft
[
0
].
address
}
`
}
form.setFieldsValue({
'receivingAddress': addr
})
}
changeTableSource(value)
setTableDataSource(value)
changeTableSource(ft)
}}
/>
<HarvestMaterialContextProvider value={{
dataSource: tableDataSource
dataSource: tableDataSource
Context
}}>
<Table
rowKey={row => row.orderNo}
columns={columns}
dataSource={tableDataSource}
dataSource={tableDataSource
Context
}
/>
</HarvestMaterialContextProvider>
</BaseInfo>
...
...
src/pages/order/deliveryNoticeManagement/deliveryNoticeFromCreate/index.tsx
View file @
444b8b50
...
...
@@ -216,6 +216,7 @@ function DeliveryNoticeFromCreate() {
label=
{
ReceivingAddress
}
name=
"receiveVO"
>
<
ReceiverAddress
hiddenBtn=
{
true
}
disabled=
{
false
}
/>
...
...
src/pages/order/receivingNote/deliveryNoteManage/add.tsx
View file @
444b8b50
...
...
@@ -181,6 +181,7 @@ function DeliveryNoteAddForm() {
<FormItem
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
hiddenBtn={true}
disabled={true}
/>
</FormItem>
...
...
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