Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
df6c07b0
Commit
df6c07b0
authored
Nov 15, 2022
by
李腾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完善多物流发货新增编辑逻辑
parent
ef633c31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
14 deletions
+46
-14
env.config.js
config/env.config.js
+2
-2
index.jsx
...ingDeliveryOrder/components/MultiLogisticsModal/index.jsx
+37
-8
index.jsx
src/pages/orderManage/pendingDeliveryOrder/index.jsx
+7
-4
No files found.
config/env.config.js
View file @
df6c07b0
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
environment
=
'
sc
'
;
const
environment
=
'
sc
1
'
;
const
envAPi
=
{
api
:
`https://security-
${
environment
}
.liangkebang.net`
,
//'https://security-xyqb.liangkebang.net',
kdspOpApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
kdspApi
:
`http
://192.168.68.87:7002
`
,
kdspApi
:
`http
s://sc-merchant-api-
${
environment
}
.liangkebang.net
`
,
goodsApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
querysApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
prologueDomain
:
`https://mall-
${
environment
}
.liangkebang.net`
,
...
...
src/pages/orderManage/pendingDeliveryOrder/components/MultiLogisticsModal/index.jsx
View file @
df6c07b0
...
...
@@ -72,7 +72,7 @@ const FormComponent = (props, ref) => {
skuInfoList
:
[{
validator
:
onCheckSkuInfoList
}],
expressCompanyCode
:
[{
required
:
true
,
message
:
'
请选择物流公司
'
}],
expressNo
:
[{
required
:
true
,
message
:
'
请填写物流单号
'
}],
serialNumber
:
[{
required
:
true
,
message
:
'
请填写序列号
'
}],
//
serialNumber: [{ required: true, message: '请填写序列号' }],
};
useImperativeHandle
(
ref
,
()
=>
({
...
...
@@ -180,6 +180,7 @@ const UpdateStatusModal = (props, ref) => {
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
record
,
setRecord
]
=
useState
();
const
[
oldPackageList
,
setOldPackageList
]
=
useState
();
const
[
actionRef
,
setActionRef
]
=
useState
();
// 提交前处理数据结构将skuNo的值从[skuNo]=>skuNo
const
onFilterParams
=
packageList
=>
{
...
...
@@ -206,27 +207,54 @@ const UpdateStatusModal = (props, ref) => {
});
};
const
open
=
item
=>
{
const
open
=
(
item
,
tableRef
)
=>
{
setActionRef
(
tableRef
);
setVisible
(
true
);
setOldPackageList
(
JSON
.
parse
(
JSON
.
stringify
(
item
.
packageList
)));
setRecord
(
item
);
};
const
onCancel
=
()
=>
{
setVisible
(
false
);
setConfirmLoading
(
false
);
formRef
.
current
.
form
.
resetFields
();
setRecord
(
null
);
setConfirmLoading
(
false
);
setVisible
(
false
);
};
const
onOk
=
async
()
=>
{
formRef
.
current
.
form
.
validateFields
().
then
(
async
values
=>
{
const
packageList
=
onFilterParams
(
values
.
packageList
);
// oldPackageList.forEach((item, index) => {
// if (JSON.stringify(item) !== JSON.stringify(packageList[index])) {
// packageList[index].preExpressCompanyCode = item.expressCompanyCode;
// packageList[index].preExpressCompanyName = item.expressCompanyName;
// packageList[index].preExpressNo = item.expressNo;
// }
// });
// 对比修改差异
oldPackageList
.
forEach
((
item
,
index
)
=>
{
if
(
JSON
.
stringify
(
item
)
!==
JSON
.
stringify
(
packageList
[
index
]))
{
const
updateAttr
=
()
=>
{
packageList
[
index
].
preExpressCompanyCode
=
item
.
expressCompanyCode
;
packageList
[
index
].
preExpressCompanyName
=
item
.
expressCompanyName
;
packageList
[
index
].
preExpressNo
=
item
.
expressNo
;
};
// eslint-disable-next-line no-restricted-syntax
for
(
const
key
in
item
)
{
if
(
typeof
item
[
key
]
!==
'
object
'
&&
item
[
key
]
!==
packageList
[
index
][
key
])
{
console
.
log
(
'
修改了物流信息
'
);
updateAttr
();
break
;
}
else
if
(
typeof
item
[
key
]
===
'
object
'
&&
JSON
.
stringify
(
item
[
key
])
!==
JSON
.
stringify
(
packageList
[
index
][
key
])
)
{
console
.
log
(
'
修改了选择的商品
'
);
updateAttr
();
break
;
}
}
});
...
...
@@ -236,13 +264,12 @@ const UpdateStatusModal = (props, ref) => {
};
console
.
log
(
'
params
'
,
params
);
const
res
=
await
apiDeliveriesAdd
(
params
);
console
.
log
(
'
res>>
'
,
res
);
if
(
res
.
code
===
'
0000
'
&&
res
.
businessCode
===
'
0000
'
)
{
notification
.
success
({
message
:
'
提交成功
'
,
});
onCancel
();
actionRef
.
current
.
reload
();
}
});
};
...
...
@@ -260,10 +287,12 @@ const UpdateStatusModal = (props, ref) => {
onOk
,
};
return
(
return
visible
?
(
<
Modal
{
...
modalProps
}
>
{
record
?
<
FormWarpper
ref=
{
formRef
}
record=
{
record
}
companys=
{
companys
}
/>
:
''
}
</
Modal
>
)
:
(
''
);
};
...
...
src/pages/orderManage/pendingDeliveryOrder/index.jsx
View file @
df6c07b0
...
...
@@ -421,10 +421,13 @@ const TableList = props => {
orderNo: record.orderNo,
});
multiLogisticsModalRef.current.open({
...record,
packageList: res.data.packageList || [],
});
multiLogisticsModalRef.current.open(
{
...record,
packageList: res.data.packageList || [],
},
actionRef,
);
}
}
>
{
props
.
type
===
2
?
'
更新物流信息
'
:
'
填写物流信息
'
}
...
...
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