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
d1372010
Commit
d1372010
authored
Sep 24, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加编辑商品套餐
parent
1b66eb80
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
10 deletions
+28
-10
service.js
src/pages/GoodsManage/service.js
+2
-1
staticdata.js
src/pages/GoodsManage/staticdata.js
+16
-5
FormPackage.jsx
src/pages/ServiceGoods/components/FormPackage.jsx
+9
-2
FormPriceOrStock.jsx
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
+1
-2
No files found.
src/pages/GoodsManage/service.js
View file @
d1372010
...
...
@@ -234,8 +234,9 @@ export const apiQueryLastChangeLog = skuId =>
// 商品上下架
export
const
apiChangeStateGoods
=
async
params
=>
{
const
data
=
await
request
.
post
(
'
/product/api/merchant/pushedOrOffline/batch
'
,
{
data
:
params
,
data
:
stringify
(
params
)
,
prefix
:
goodsApi
,
headers
,
});
return
data
;
};
src/pages/GoodsManage/staticdata.js
View file @
d1372010
import
React
from
'
react
'
;
import
{
Button
,
Badge
,
Switch
}
from
'
antd
'
;
import
{
Button
,
Badge
,
Switch
,
Modal
}
from
'
antd
'
;
import
{
ExclamationCircleOutlined
}
from
'
@ant-design/icons
'
;
import
styles
from
'
./style.less
'
;
import
{
resetTime
}
from
'
../../utils/utils
'
;
import
{
apiChangeStateGoods
}
from
'
./service
'
;
const
{
confirm
}
=
Modal
;
export
const
productType
=
[
{
value
:
1
,
...
...
@@ -33,11 +36,19 @@ export const productType = [
export
function
column
()
{
const
onChangeState
=
async
({
skuId
,
state
})
=>
{
const
res
=
await
apiChangeStateGoods
({
ids
:
skuId
,
productState
:
+
state
===
6
?
7
:
6
,
// 6:上架,7:下架
confirm
({
icon
:
<
ExclamationCircleOutlined
/>
,
content
:
`确认
${
+
state
===
6
?
'
下架
'
:
'
上架
'
}
商品?`
,
onOk
:
async
()
=>
{
const
res
=
await
apiChangeStateGoods
({
ids
:
skuId
,
productState
:
+
state
===
6
?
7
:
6
,
// 6:上架,7:下架
});
if
(
res
.
businessCode
===
'
0000
'
&&
res
.
code
===
'
0000
'
)
{
this
.
handleSearch
();
}
},
});
this
.
handleSearch
();
};
return
[
...
...
src/pages/ServiceGoods/components/FormPackage.jsx
View file @
d1372010
...
...
@@ -228,15 +228,22 @@ const FormPackage = forwardRef((props, ref) => {
};
useEffect
(()
=>
{
console
.
log
(
'
props.initData :>>
'
,
props
.
initData
);
if
(
props
.
initData
&&
props
.
initData
.
length
)
{
if
(
props
.
initData
.
length
!==
list
.
length
)
{
const
arr
=
[];
props
.
initData
.
forEach
((
item
,
i
)
=>
{
let
children
=
[];
if
(
item
.
serviceItem
&&
item
.
serviceItem
.
setMealContent
&&
item
.
serviceItem
.
setMealContent
.
length
)
{
children
=
[...
item
.
serviceItem
.
setMealContent
];
}
arr
.
push
({
uuid
:
i
,
specName
:
`套餐
${
i
+
1
}
`
,
children
:
[]
,
children
,
});
});
setList
(
arr
);
...
...
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
View file @
d1372010
...
...
@@ -214,6 +214,7 @@ const CreateBatchFormItems = ({ specInitValue, batchChange, editRef, defaultColu
const
FormPriceOrStock
=
forwardRef
((
props
,
ref
)
=>
{
const
{
specList
,
editData
,
skuList
=
[],
onSpecChange
}
=
props
;
const
editRef
=
useRef
(
null
);
const
packageRef
=
useRef
(
null
);
const
customer
=
useContext
(
ServiceContext
);
...
...
@@ -226,9 +227,7 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const
onCheck
=
async
()
=>
{
try
{
console
.
log
(
'
11111 :>>
'
,
11111
);
const
setMealContent
=
await
packageRef
.
current
.
onCheck
();
console
.
log
(
'
222 :>>
'
,
222
);
const
values
=
await
form
.
validateFields
();
const
items
=
await
editRef
.
current
.
onCheck
();
if
(
items
)
{
...
...
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