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
0a13076e
Commit
0a13076e
authored
Oct 12, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加商品属性
parent
08f4062b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
141 additions
and
4 deletions
+141
-4
index.jsx
src/pages/GoodsManage/createModal/index.jsx
+52
-1
infoAudit.jsx
src/pages/GoodsManage/createModal/infoAudit.jsx
+40
-0
index.jsx
src/pages/GoodsManage/index.jsx
+19
-2
service.js
src/pages/GoodsManage/service.js
+15
-0
staticdata.js
src/pages/GoodsManage/staticdata.js
+10
-1
style.less
src/pages/GoodsManage/style.less
+5
-0
No files found.
src/pages/GoodsManage/createModal/index.jsx
View file @
0a13076e
...
...
@@ -37,6 +37,7 @@ import {
addGoods
,
editGoods
,
queryAllAfterAddress
,
apiGetAttribute
,
}
from
'
../service
'
;
import
styles
from
'
../style.less
'
;
import
Upload
from
'
../../components/sortablUpload
'
;
...
...
@@ -74,6 +75,7 @@ class goodsManage extends Component {
this
.
getSpecData
();
this
.
getBrandData
();
this
.
getAfterAddressData
();
this
.
getAttribute
();
}
componentWillReceiveProps
()
{
...
...
@@ -204,8 +206,19 @@ class goodsManage extends Component {
this
.
setState
({
initForm
});
};
// 获取属性
getAttribute
=
async
categoryId
=>
{
console
.
log
(
'
categoryId :>>
'
,
categoryId
);
const
res
=
await
apiGetAttribute
({
categoryId
,
});
console
.
log
(
'
res :>>
'
,
res
);
};
treeChange
=
value
=>
{
this
.
setState
({
categoryId
:
value
[
value
.
length
-
1
],
initCascader
:
value
});
const
cid
=
value
[
value
.
length
-
1
];
this
.
setState
({
categoryId
:
cid
,
initCascader
:
value
});
this
.
getAttribute
(
cid
);
};
remove
=
(
flag
,
k
)
=>
{
...
...
@@ -525,6 +538,8 @@ class goodsManage extends Component {
}
=
this
.
state
;
const
skuSpeFirstKeys
=
initData
.
firstSpecList
||
[];
const
skuSpeSecondKeys
=
initData
.
secondSpecList
||
[];
const
skuAttr
=
initData
.
productAttributeApplyList
?.
productAttributeApplyList
||
[];
const
skuOldAttr
=
initData
.
productAttributeApplyList
?.
oldProductAttributeApplyList
||
[];
const
treeDataArray
=
productType
===
2
?
virtualTreeData
:
treeData
;
const
brandListArray
=
productType
===
2
?
brandList
:
normalBrandList
;
dataInit
(
this
.
state
.
editData
);
...
...
@@ -721,6 +736,42 @@ class goodsManage extends Component {
:
''
}
</
Row
>
</
Card
>
{
/* 商品属性 */
}
<
Card
className=
{
styles
.
card
}
bordered=
{
false
}
>
<
div
className=
{
styles
.
cardTitle
}
>
商品属性
</
div
>
<
Row
>
{
skuAttr
.
length
>
0
&&
skuAttr
.
map
(
k
=>
(
<
FormItem
label=
{
k
.
name
}
required=
{
false
}
key=
{
k
}
>
{
getFieldDecorator
(
`specs[${k}]`
,
{
initialValue
:
this
.
state
.
initForm
.
second
[
k
]
||
''
,
validateTrigger
:
[
'
onChange
'
,
'
onBlur
'
],
rules
:
+
k
.
required
===
1
?
{
required
:
true
,
message
:
'
请选择
'
}
:
[],
})(
<
Select
mode=
{
this
.
getMode
(
k
.
supportCustomValue
,
k
.
optionType
)
}
>
{
k
.
valueList
&&
k
.
valueList
.
length
&&
k
.
valueList
.
map
(
a
=>
(
<
Option
key=
{
a
.
id
}
value=
{
a
}
>
{
a
.
name
}
</
Option
>
))
}
</
Select
>,
)
}
</
FormItem
>
))
}
</
Row
>
<
Row
>
{
skuOldAttr
.
length
>
0
&&
skuOldAttr
.
map
(
s
=>
(
<
FormItem
label=
{
s
.
productAttributeName
}
required=
{
false
}
key=
{
s
.
id
}
>
{
s
.
value
}
</
FormItem
>
))
}
</
Row
>
</
Card
>
<
Card
className=
{
styles
.
card
}
bordered=
{
false
}
>
<
Row
>
<
FormItem
label=
"一级规格"
>
...
...
src/pages/GoodsManage/createModal/infoAudit.jsx
0 → 100644
View file @
0a13076e
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Modal
,
Button
}
from
'
antd
'
;
import
{
apiQueryLastAuditRecord
}
from
'
../service
'
;
const
InfoAudit
=
props
=>
{
const
getRecord
=
async
()
=>
{
console
.
log
(
'
333 :>>
'
,
props
.
skuInfo
.
skuId
);
// const res = await apiQueryLastAuditRecord(props.skuInfo.skuId);
// console.log('res :>> ', res);
};
useEffect
(()
=>
{
console
.
log
(
'
1111 :>>
'
,
1111
);
if
(
props
.
visible
)
{
console
.
log
(
'
222 :>>
'
,
222
);
getRecord
();
}
},
[
props
.
visible
]);
return
(
<
Modal
title=
"商品信息变更审核"
visible=
{
props
.
visible
}
footer=
{
[
<
Button
key=
"back"
type=
"primary"
onClick=
{
()
=>
props
.
onEdit
()
}
>
再次编辑
</
Button
>,
<
Button
key=
"close"
onClick=
{
()
=>
props
.
onCancel
()
}
>
关闭
</
Button
>,
]
}
>
<
p
>
审核状态:审核拒绝
</
p
>
<
p
>
申请时间:
</
p
>
<
p
>
审核结果:
</
p
>
</
Modal
>
);
};
export
default
InfoAudit
;
src/pages/GoodsManage/index.jsx
View file @
0a13076e
import
{
Form
}
from
'
@ant-design/compatible
'
;
import
'
@ant-design/compatible/assets/index.css
'
;
import
{
Card
,
Pagination
,
Table
,
notification
,
Drawer
,
Spin
,
Button
}
from
'
antd
'
;
import
{
Card
,
Pagination
,
Table
,
notification
,
Drawer
,
Spin
,
Button
,
Modal
}
from
'
antd
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
connect
}
from
'
dva
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
da
}
from
'
date-fns/locale
'
;
import
styles
from
'
./style.less
'
;
import
LocalStroage
from
'
@/utils/localStorage
'
;
import
configApi
from
'
../../../config/env.config
'
;
...
...
@@ -27,6 +26,7 @@ import { column, JDSHOPID, ProcessEditData } from './staticdata';
import
SearchForm
from
'
./SearchForm
'
;
import
TempleatModal
from
'
./TempleatModal
'
;
import
ServiceGoods
from
'
../ServiceGoods
'
;
import
InfoAudit
from
'
./createModal/infoAudit
'
;
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
...
...
@@ -58,6 +58,8 @@ class goodsManage extends Component {
serviceVisble
:
false
,
serviceData
:
{},
visibleAuditModal
:
false
,
auditRow
:
{},
// 查看审核信息使用
};
currentLog
=
null
;
...
...
@@ -537,6 +539,21 @@ class goodsManage extends Component {
specListData=
{
this
.
state
.
specListData
}
/>
</
Spin
>
<
InfoAudit
visible=
{
this
.
state
.
visibleAuditModal
}
skuInfo=
{
this
.
state
.
auditRow
}
onCancel=
{
()
=>
{
this
.
setState
({
visibleAuditModal
:
false
,
auditRow
:
{}
});
}
}
onEdit=
{
()
=>
{
this
.
setState
({
visibleAuditModal
:
false
,
auditRow
:
{}
});
if
(
this
.
state
.
auditRow
.
type
===
4
)
{
this
.
serviceVisbleChange
(
this
.
state
.
auditRow
);
}
else
{
this
.
onUpdateInfo
(
this
.
state
.
auditRow
);
}
}
}
/>
</
PageHeaderWrapper
>
);
}
...
...
src/pages/GoodsManage/service.js
View file @
0a13076e
...
...
@@ -42,6 +42,15 @@ export async function getBrandList() {
});
}
// 获取类目关联属性
export
async
function
apiGetAttribute
(
params
)
{
const
data
=
await
request
.
get
(
'
/api/kdsp/category/template/ref/attribute
'
,
{
prefix
:
goodsApi
,
params
,
});
return
data
;
}
// 编辑--获取详情
export
async
function
spuDetail
(
params
)
{
return
request
.
post
(
'
/product/api/merchant/detail
'
,
{
...
...
@@ -240,3 +249,9 @@ export const apiChangeStateGoods = async params => {
});
return
data
;
};
// 查询sku最后一条审核记录
export
const
apiQueryLastAuditRecord
=
skuId
=>
request
.
get
(
`/api/kdsp/sku/last/audit/record?skuId=
${
skuId
}
`
,
{
prefix
:
goodsApi
,
});
src/pages/GoodsManage/staticdata.js
View file @
0a13076e
...
...
@@ -50,6 +50,12 @@ export function column() {
},
});
};
const
onShowAudit
=
row
=>
{
this
.
setState
({
auditRow
:
row
,
visibleAuditModal
:
true
,
});
};
return
[
{
...
...
@@ -183,7 +189,10 @@ export function column() {
render
:
(
_
,
row
)
=>
(
<
div
>
<
p
>
{
row
.
state
>=
5
?
'
审核通过
'
:
_
}
<
/p
>
<
p
>
{
row
.
updateStateDesc
||
'
_ _
'
}
<
/p
>
<
div
onClick
=
{()
=>
onShowAudit
(
row
)}
>
{
'
'
}
{
row
.
updateStateDesc
?
<
span
>
{
row
.
updateStateDesc
}
<
/span> : '--'
}
<
/div
>
<
/div
>
),
},
...
...
src/pages/GoodsManage/style.less
View file @
0a13076e
...
...
@@ -110,3 +110,8 @@
color: #d9363e;
line-height: 1;
}
.cardTitle {
padding: 15px;
font-weight: bold;
font-size: 18px;
}
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