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
1a4aa07b
Commit
1a4aa07b
authored
Mar 26, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 更新商品规格
parent
00a538e2
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
153 additions
and
90 deletions
+153
-90
env.config.js
config/env.config.js
+1
-1
AddRepertoryModal.jsx
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
+12
-13
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+140
-76
No files found.
config/env.config.js
View file @
1a4aa07b
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
environment
=
'
xyqb
'
;
const
environment
=
'
sc1
'
;
const
envAPi
=
{
api
:
`https://security-
${
environment
}
.liangkebang.net`
,
//'https://security-xyqb.liangkebang.net',
kdspOpApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
...
...
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
View file @
1a4aa07b
...
...
@@ -16,6 +16,8 @@ const AddRepertoryModal = (props, ref) => {
});
const
{
modifiedInventory
,
intactData
,
repertoryModel
}
=
props
;
console
.
log
(
'
repertoryModel
'
,
repertoryModel
);
const
{
type
,
idx
,
item
}
=
repertoryModel
;
useImperativeHandle
(
ref
,
()
=>
({
// changeVal 就是暴露给父组件的方法
setOpenRepertory
:
newVal
=>
{
...
...
@@ -59,10 +61,9 @@ const AddRepertoryModal = (props, ref) => {
},
400
);
const
handleOk
=
async
()
=>
{
const
values
=
await
form
.
validateFields
();
console
.
log
(
'
values
'
,
values
);
values
.
autoStock
=
values
.
autoStock
?
1
:
0
;
// 回调库存
modifiedInventory
(
values
);
modifiedInventory
(
type
,
idx
,
values
);
// setConfirmLoading(true);
// setTimeout(() => {
// setOpenRepertory(false);
...
...
@@ -74,10 +75,9 @@ const AddRepertoryModal = (props, ref) => {
setOpenRepertory
(
false
);
};
useEffect
(()
=>
{
console
.
log
(
'
open
'
,
openRepertory
,
intactData
?.
items
,
repertoryModel
);
if
(
intactData
?.
items
?.
length
)
{
const
{
productStock
,
serviceItem
}
=
intactData
?.
items
[
0
];
const
{
autoStock
,
maxStock
}
=
serviceItem
;
console
.
log
(
'
333
'
,
repertoryModel
);
if
(
item
?.
serviceItem
)
{
const
{
productStock
=
1
,
autoStock
=
0
,
maxStock
=
2
}
=
item
?.
serviceItem
;
const
params
=
{
productStock
,
autoStock
:
+
autoStock
===
1
,
...
...
@@ -85,24 +85,23 @@ const AddRepertoryModal = (props, ref) => {
};
console
.
log
(
'
params=====
'
,
params
);
switch
(
repertoryModel
)
{
switch
(
type
)
{
case
'
all
'
:
// 统一设置
console
.
log
(
'
params
'
,
params
);
form
.
setFieldsValue
(
params
);
form
.
setFieldsValue
({
autoStock
:
true
});
break
;
case
'
mlti
'
:
// 多规格设置
setInitialValues
(
params
);
case
'
m
u
lti
'
:
// 多规格设置
form
.
setFieldsValue
(
params
);
break
;
case
'
singular
'
:
// 单规格设置
setInitialValues
(
params
);
// setInitialValues(params);
form
.
setFieldsValue
(
params
);
break
;
default
:
break
;
}
}
},
[
openRepertory
,
i
ntactData
]);
},
[
openRepertory
,
i
tem
]);
return
(
<>
{
openRepertory
&&
(
...
...
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
1a4aa07b
This diff is collapsed.
Click to expand it.
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