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
555a3296
Commit
555a3296
authored
Apr 07, 2022
by
郭志伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/goodsChange' into 'master'
Feature/goods change See merge request
!29
parents
6ae2b521
1737b1fb
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
145 additions
and
33 deletions
+145
-33
env.config.js
config/env.config.js
+7
-7
batchSetting.jsx
src/pages/GoodsManage/createModal/batchSetting.jsx
+2
-1
index.jsx
src/pages/GoodsManage/createModal/index.jsx
+65
-11
mixin.jsx
src/pages/GoodsManage/createModal/mixin.jsx
+17
-2
index.jsx
src/pages/GoodsManage/index.jsx
+24
-3
service.js
src/pages/GoodsManage/service.js
+7
-0
staticdata.js
src/pages/GoodsManage/staticdata.js
+7
-2
style.less
src/pages/GoodsManage/style.less
+1
-0
index.jsx
src/pages/components/sortablUpload/index.jsx
+15
-7
No files found.
config/env.config.js
View file @
555a3296
...
@@ -2,14 +2,14 @@ const isProduction = process.env.NODE_ENV === 'production';
...
@@ -2,14 +2,14 @@ const isProduction = process.env.NODE_ENV === 'production';
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
envAPi
=
{
const
envAPi
=
{
api
:
'
//backstms-
test
2.liangkebang.net
'
,
api
:
'
//backstms-
gyl
2.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-
test
2.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-
gyl
2.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-
test
2.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-
gyl
2.liangkebang.net
'
,
goodsApi
:
'
https://sc-op-api-
test
2.liangkebang.net
'
,
goodsApi
:
'
https://sc-op-api-
gyl
2.liangkebang.net
'
,
// goodsApi: '//192.168.
188.111
:7000',
// goodsApi: '//192.168.
28.107
:7000',
prologueDomain
:
'
https://mall-
test
2.liangkebang.net
'
,
prologueDomain
:
'
https://mall-
gyl
2.liangkebang.net
'
,
qiniuHost
:
'
https://appsync.lkbang.net
'
,
qiniuHost
:
'
https://appsync.lkbang.net
'
,
opapiHost
:
'
https://opapi-
test
2.liangkebang.net
'
,
opapiHost
:
'
https://opapi-
gyl
2.liangkebang.net
'
,
};
};
const
prodApi
=
{
const
prodApi
=
{
...
...
src/pages/GoodsManage/createModal/batchSetting.jsx
View file @
555a3296
...
@@ -81,6 +81,7 @@ class goodsManage extends Component {
...
@@ -81,6 +81,7 @@ class goodsManage extends Component {
secondSpesName
=
''
,
secondSpesName
=
''
,
productType
,
productType
,
isEdit
,
isEdit
,
isService
,
}
=
this
.
props
;
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
return
(
return
(
...
@@ -171,7 +172,7 @@ class goodsManage extends Component {
...
@@ -171,7 +172,7 @@ class goodsManage extends Component {
</
FormItem
>
</
FormItem
>
)
}
)
}
<
FormItem
>
<
FormItem
>
<
Button
type=
"primary"
htmlType=
"submit"
onClick=
{
this
.
batchSetting
}
>
<
Button
type=
"primary"
htmlType=
"submit"
onClick=
{
this
.
batchSetting
}
disabled=
{
isService
}
>
批量设置
批量设置
</
Button
>
</
Button
>
</
FormItem
>
</
FormItem
>
...
...
src/pages/GoodsManage/createModal/index.jsx
View file @
555a3296
...
@@ -333,11 +333,11 @@ class goodsManage extends Component {
...
@@ -333,11 +333,11 @@ class goodsManage extends Component {
const
{
const
{
form
:
{
validateFields
},
form
:
{
validateFields
},
initData
,
initData
,
specListData
,
}
=
this
.
props
;
}
=
this
.
props
;
const
{
editData
,
productType
}
=
this
.
state
;
const
{
editData
,
productType
}
=
this
.
state
;
validateFields
(
async
(
errors
,
values
)
=>
{
validateFields
(
async
(
errors
,
values
)
=>
{
console
.
log
(
values
);
let
imgErr
=
false
;
let
imgErr
=
false
;
if
(
!
errors
)
{
if
(
!
errors
)
{
if
(
validateSpuInfo
(
values
,
initData
,
editData
,
productType
))
return
;
if
(
validateSpuInfo
(
values
,
initData
,
editData
,
productType
))
return
;
...
@@ -357,6 +357,15 @@ class goodsManage extends Component {
...
@@ -357,6 +357,15 @@ class goodsManage extends Component {
notification
.
error
({
message
:
'
滑动图不全,请检查!
'
});
notification
.
error
({
message
:
'
滑动图不全,请检查!
'
});
return
;
return
;
}
}
const
specs
=
[];
specListData
.
forEach
(
item
=>
{
if
(
values
.
hasOwnProperty
(
item
.
specId
))
{
specs
.
push
({
specId
:
item
.
specId
,
specValues
:
values
[
item
.
specId
]
||
[],
});
}
});
await
this
.
setState
(
prev
=>
({
await
this
.
setState
(
prev
=>
({
confirmLoading
:
true
,
confirmLoading
:
true
,
createData
:
{
createData
:
{
...
@@ -370,6 +379,8 @@ class goodsManage extends Component {
...
@@ -370,6 +379,8 @@ class goodsManage extends Component {
categoryId
:
prev
.
categoryId
?
prev
.
categoryId
:
initData
?.
thirdCategoryId
,
categoryId
:
prev
.
categoryId
?
prev
.
categoryId
:
initData
?.
thirdCategoryId
,
// productType: values.productType,
// productType: values.productType,
type
:
values
.
productType
,
type
:
values
.
productType
,
specs
,
character
:
values
.
character
,
},
},
}));
}));
const
data
=
initData
.
id
const
data
=
initData
.
id
...
@@ -448,8 +459,10 @@ class goodsManage extends Component {
...
@@ -448,8 +459,10 @@ class goodsManage extends Component {
};
};
render
()
{
render
()
{
const
{
visible
,
form
,
initData
=
{},
treeData
,
virtualTreeData
}
=
this
.
props
;
const
{
visible
,
form
,
initData
=
{},
treeData
,
virtualTreeData
,
specListData
}
=
this
.
props
;
const
isEdit
=
Object
.
keys
(
initData
).
length
!==
0
;
const
isEdit
=
Object
.
keys
(
initData
).
length
!==
0
;
// 是否仅编辑卖点和服务
const
isService
=
initData
.
state
&&
initData
.
state
!==
4
;
const
{
getFieldDecorator
,
getFieldsValue
}
=
form
;
const
{
getFieldDecorator
,
getFieldsValue
}
=
form
;
getFieldDecorator
(
'
firstKeys
'
,
{
initialValue
:
[]
});
getFieldDecorator
(
'
firstKeys
'
,
{
initialValue
:
[]
});
getFieldDecorator
(
'
secondKeys
'
,
{
initialValue
:
[]
});
getFieldDecorator
(
'
secondKeys
'
,
{
initialValue
:
[]
});
...
@@ -459,7 +472,7 @@ class goodsManage extends Component {
...
@@ -459,7 +472,7 @@ class goodsManage extends Component {
if
(
isFirstSame
)
first
.
pop
();
if
(
isFirstSame
)
first
.
pop
();
if
(
isSecondSame
)
second
.
pop
();
if
(
isSecondSame
)
second
.
pop
();
let
colorKeys
=
isEdit
let
colorKeys
=
isEdit
?
initData
.
firstSpecList
.
concat
(
first
||
this
.
state
.
initForm
.
first
||
[])
?
initData
?.
firstSpecList
?
.
concat
(
first
||
this
.
state
.
initForm
.
first
||
[])
:
first
||
this
.
state
.
initForm
.
first
||
[];
:
first
||
this
.
state
.
initForm
.
first
||
[];
if
(
isEdit
&&
!
Object
.
keys
(
this
.
state
.
initForm
).
length
&&
!
this
.
state
.
isCancel
)
{
if
(
isEdit
&&
!
Object
.
keys
(
this
.
state
.
initForm
).
length
&&
!
this
.
state
.
isCancel
)
{
...
@@ -490,6 +503,12 @@ class goodsManage extends Component {
...
@@ -490,6 +503,12 @@ class goodsManage extends Component {
if
(
isEdit
&&
!
initData
.
editData
[
0
]?.
firstSpec
&&
!
initData
.
editData
[
0
]?.
secondSpec
)
{
if
(
isEdit
&&
!
initData
.
editData
[
0
]?.
firstSpec
&&
!
initData
.
editData
[
0
]?.
secondSpec
)
{
colorKeys
=
colorKeys
.
length
>
1
?
colorKeys
.
filter
(
item
=>
item
!==
'
null
'
)
:
colorKeys
;
colorKeys
=
colorKeys
.
length
>
1
?
colorKeys
.
filter
(
item
=>
item
!==
'
null
'
)
:
colorKeys
;
}
}
const
optionsWithDisabled
=
[
{
label
:
'
Apple
'
,
value
:
'
Apple
'
},
{
label
:
'
Pear
'
,
value
:
'
Pear
'
},
{
label
:
'
Orange
'
,
value
:
'
Orange
'
,
disabled
:
false
},
];
return
(
return
(
<
Modal
<
Modal
title=
{
initData
.
id
?
'
修改商品
'
:
'
新增商品
'
}
title=
{
initData
.
id
?
'
修改商品
'
:
'
新增商品
'
}
...
@@ -509,7 +528,7 @@ class goodsManage extends Component {
...
@@ -509,7 +528,7 @@ class goodsManage extends Component {
initialValue
:
productType
,
initialValue
:
productType
,
rules
:
[{
required
:
true
,
message
:
'
请选择商品类型
'
}],
rules
:
[{
required
:
true
,
message
:
'
请选择商品类型
'
}],
})(
})(
<
Radio
.
Group
disabled=
{
isEdit
}
onChange=
{
this
.
bundleRadioChange
}
>
<
Radio
.
Group
disabled=
{
isEdit
||
isService
}
onChange=
{
this
.
bundleRadioChange
}
>
{
productTypeList
.
map
(
item
=>
(
{
productTypeList
.
map
(
item
=>
(
<
Radio
key=
{
item
.
value
}
value=
{
item
.
value
}
disabled=
{
item
.
disabled
}
>
<
Radio
key=
{
item
.
value
}
value=
{
item
.
value
}
disabled=
{
item
.
disabled
}
>
{
item
.
label
}
{
item
.
label
}
...
@@ -538,7 +557,7 @@ class goodsManage extends Component {
...
@@ -538,7 +557,7 @@ class goodsManage extends Component {
fieldNames=
{
{
label
:
'
name
'
,
value
:
'
id
'
,
children
:
'
children
'
}
}
fieldNames=
{
{
label
:
'
name
'
,
value
:
'
id
'
,
children
:
'
children
'
}
}
options=
{
treeDataArray
}
options=
{
treeDataArray
}
onChange=
{
(
val
,
label
,
ext
)
=>
this
.
treeChange
(
val
,
label
,
ext
)
}
onChange=
{
(
val
,
label
,
ext
)
=>
this
.
treeChange
(
val
,
label
,
ext
)
}
// disabled=
{
isEdit
}
disabled=
{
isService
}
/>,
/>,
)
}
)
}
</
FormItem
>
</
FormItem
>
...
@@ -567,6 +586,7 @@ class goodsManage extends Component {
...
@@ -567,6 +586,7 @@ class goodsManage extends Component {
style=
{
{
width
:
280
}
}
style=
{
{
width
:
280
}
}
filterOption=
{
filterOption
}
filterOption=
{
filterOption
}
placeholder=
"请选择商品品牌,支持模糊搜索"
placeholder=
"请选择商品品牌,支持模糊搜索"
disabled=
{
isService
}
>
>
{
brandListArray
?.
length
&&
{
brandListArray
?.
length
&&
brandListArray
.
map
(
item
=>
(
brandListArray
.
map
(
item
=>
(
...
@@ -604,6 +624,7 @@ class goodsManage extends Component {
...
@@ -604,6 +624,7 @@ class goodsManage extends Component {
maxLength=
{
100
}
maxLength=
{
100
}
placeholder=
"请输入商品名称"
placeholder=
"请输入商品名称"
allowClear
allowClear
disabled=
{
isService
}
/>,
/>,
)
}
)
}
</
FormItem
>
</
FormItem
>
...
@@ -614,6 +635,31 @@ class goodsManage extends Component {
...
@@ -614,6 +635,31 @@ class goodsManage extends Component {
</
div
>
</
div
>
)
}
)
}
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
FormItem
label=
"商品卖点"
labelCol=
{
{
span
:
2
}
}
>
{
getFieldDecorator
(
'
character
'
,
{
initialValue
:
initData
.
character
,
})(
<
Input
style=
{
{
width
:
690
}
}
maxLength=
{
50
}
placeholder=
"好的卖点信息有利于提高商品转化,限50字"
allowClear
/>,
)
}
</
FormItem
>
</
Col
>
{
specListData
.
length
?
specListData
.
map
((
item
,
index
)
=>
(
<
Col
span=
{
24
}
>
<
FormItem
label=
{
item
.
specName
}
labelCol=
{
{
span
:
2
}
}
>
{
getFieldDecorator
(
`${item.specId}`
,
{
initialValue
:
initData
[
item
.
specId
],
})(<
Checkbox
.
Group
options=
{
item
.
specValues
}
/>)
}
</
FormItem
>
</
Col
>
))
:
''
}
</
Row
>
</
Row
>
</
Card
>
</
Card
>
<
Card
className=
{
styles
.
card
}
bordered=
{
false
}
>
<
Card
className=
{
styles
.
card
}
bordered=
{
false
}
>
...
@@ -627,7 +673,7 @@ class goodsManage extends Component {
...
@@ -627,7 +673,7 @@ class goodsManage extends Component {
showSearch
showSearch
style=
{
{
width
:
200
}
}
style=
{
{
width
:
200
}
}
placeholder=
"请选择一级规格"
placeholder=
"请选择一级规格"
disabled=
{
isEdit
&&
initData
.
firstSpecId
}
disabled=
{
(
isEdit
&&
initData
.
firstSpecId
)
||
isService
}
onChange=
{
(
val
,
option
)
=>
onChange=
{
(
val
,
option
)
=>
this
.
specChange
(
'
first
'
,
option
?.
props
.
children
,
val
)
this
.
specChange
(
'
first
'
,
option
?.
props
.
children
,
val
)
}
}
...
@@ -705,7 +751,7 @@ class goodsManage extends Component {
...
@@ -705,7 +751,7 @@ class goodsManage extends Component {
<
Select
<
Select
allowClear
allowClear
showSearch
showSearch
disabled=
{
isEdit
&&
initData
.
secondSpecId
}
disabled=
{
(
isEdit
&&
initData
.
secondSpecId
)
||
isService
}
placeholder=
"请选择二级规格"
placeholder=
"请选择二级规格"
style=
{
{
width
:
200
}
}
style=
{
{
width
:
200
}
}
onChange=
{
(
val
,
option
)
=>
this
.
specChange
(
'
second
'
,
option
?.
props
.
children
)
}
onChange=
{
(
val
,
option
)
=>
this
.
specChange
(
'
second
'
,
option
?.
props
.
children
)
}
...
@@ -767,6 +813,7 @@ class goodsManage extends Component {
...
@@ -767,6 +813,7 @@ class goodsManage extends Component {
type=
"primary"
type=
"primary"
className=
{
styles
.
logBtn
}
className=
{
styles
.
logBtn
}
onClick=
{
()
=>
this
.
createShopInfo
(
isEdit
)
}
onClick=
{
()
=>
this
.
createShopInfo
(
isEdit
)
}
disabled=
{
isService
}
>
>
生成商品信息
生成商品信息
</
Button
>
</
Button
>
...
@@ -784,6 +831,7 @@ class goodsManage extends Component {
...
@@ -784,6 +831,7 @@ class goodsManage extends Component {
productType=
{
productType
}
productType=
{
productType
}
isEdit=
{
isEdit
}
isEdit=
{
isEdit
}
isJDGoods=
{
isJDGoods
}
isJDGoods=
{
isJDGoods
}
isService=
{
isService
}
/>
/>
<
Row
>
<
Row
>
<
Table
<
Table
...
@@ -804,6 +852,7 @@ class goodsManage extends Component {
...
@@ -804,6 +852,7 @@ class goodsManage extends Component {
this
.
state
.
initForm
.
secondSpecName
,
this
.
state
.
initForm
.
secondSpecName
,
isJDGoods
,
isJDGoods
,
isEdit
,
isEdit
,
isService
,
)
}
)
}
/>
/>
</
Row
>
</
Row
>
...
@@ -814,6 +863,7 @@ class goodsManage extends Component {
...
@@ -814,6 +863,7 @@ class goodsManage extends Component {
onClick=
{
this
.
deleteImg
}
onClick=
{
this
.
deleteImg
}
style=
{
{
marginTop
:
'
10px
'
}
}
style=
{
{
marginTop
:
'
10px
'
}
}
icon=
"rest"
icon=
"rest"
disabled=
{
isService
}
>
>
图片批量删除
图片批量删除
</
Button
>
</
Button
>
...
@@ -832,7 +882,7 @@ class goodsManage extends Component {
...
@@ -832,7 +882,7 @@ class goodsManage extends Component {
initialValue
:
this
.
state
.
initForm
.
commonImageList
,
initialValue
:
this
.
state
.
initForm
.
commonImageList
,
valuePropName
:
'
fileList
'
,
valuePropName
:
'
fileList
'
,
getValueFromEvent
:
normFile
,
getValueFromEvent
:
normFile
,
})(<
Upload
/>)
}
})(<
Upload
isDisabled=
{
isService
}
/>)
}
</
FormItem
>
</
FormItem
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
@@ -840,7 +890,6 @@ class goodsManage extends Component {
...
@@ -840,7 +890,6 @@ class goodsManage extends Component {
colorKeys
.
map
(
color
=>
{
colorKeys
.
map
(
color
=>
{
if
(
JSON
.
stringify
(
color
)
===
'
{}
'
)
return
[];
if
(
JSON
.
stringify
(
color
)
===
'
{}
'
)
return
[];
if
((
color
!==
null
&&
!
color
)
||
(
color
&&
!
color
.
trim
()))
return
[];
if
((
color
!==
null
&&
!
color
)
||
(
color
&&
!
color
.
trim
()))
return
[];
// if (initData.)
{}
return
[
return
[
<
Row
>
<
Row
>
<
Col
span=
{
1
}
>
<
Col
span=
{
1
}
>
...
@@ -861,7 +910,12 @@ class goodsManage extends Component {
...
@@ -861,7 +910,12 @@ class goodsManage extends Component {
this
.
state
.
initForm
.
imageList
&&
this
.
state
.
initForm
.
imageList
[
color
],
this
.
state
.
initForm
.
imageList
&&
this
.
state
.
initForm
.
imageList
[
color
],
valuePropName
:
'
fileList
'
,
valuePropName
:
'
fileList
'
,
getValueFromEvent
:
normFile
,
getValueFromEvent
:
normFile
,
})(<
Upload
onChange=
{
val
=>
this
.
imgChange
(
val
,
color
)
}
/>)
}
})(
<
Upload
isDisabled=
{
isService
}
onChange=
{
val
=>
this
.
imgChange
(
val
,
color
)
}
/>,
)
}
<
Button
<
Button
disabled=
{
colorImg
[
color
]?.
length
}
disabled=
{
colorImg
[
color
]?.
length
}
size=
"small"
size=
"small"
...
@@ -898,7 +952,7 @@ class goodsManage extends Component {
...
@@ -898,7 +952,7 @@ class goodsManage extends Component {
message
:
'
请上传详情图
'
,
message
:
'
请上传详情图
'
,
},
},
],
],
})(<
Upload
/>)
}
})(<
Upload
isDisabled=
{
isService
}
/>)
}
</
FormItem
>
</
FormItem
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
...
src/pages/GoodsManage/createModal/mixin.jsx
View file @
555a3296
...
@@ -213,7 +213,15 @@ export function verify(initData, categoryId) {
...
@@ -213,7 +213,15 @@ export function verify(initData, categoryId) {
return
false
;
return
false
;
}
}
export
function
editColumns
(
methods
,
firstData
,
firstSpec
,
secondSpec
,
isJDGoods
,
isEdit
)
{
export
function
editColumns
(
methods
,
firstData
,
firstSpec
,
secondSpec
,
isJDGoods
,
isEdit
,
isService
,
)
{
const
{
getJdPicList
,
inputChange
,
openModal
,
productType
}
=
methods
;
const
{
getJdPicList
,
inputChange
,
openModal
,
productType
}
=
methods
;
if
(
!
firstData
)
return
[];
if
(
!
firstData
)
return
[];
...
@@ -231,7 +239,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
...
@@ -231,7 +239,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
precision=
{
2
}
precision=
{
2
}
min=
{
0
}
min=
{
0
}
onChange=
{
value
=>
inputChange
(
value
,
'
supplyPrice
'
,
index
)
}
onChange=
{
value
=>
inputChange
(
value
,
'
supplyPrice
'
,
index
)
}
disabled=
{
isJDGoods
}
disabled=
{
isJDGoods
||
isService
}
/>
/>
),
),
},
},
...
@@ -248,6 +256,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
...
@@ -248,6 +256,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
precision=
{
2
}
precision=
{
2
}
min=
{
0
}
min=
{
0
}
onChange=
{
value
=>
inputChange
(
value
,
'
marketPrice
'
,
index
)
}
onChange=
{
value
=>
inputChange
(
value
,
'
marketPrice
'
,
index
)
}
disabled=
{
isService
}
/>
/>
),
),
},
},
...
@@ -263,6 +272,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
...
@@ -263,6 +272,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
precision=
{
0
}
precision=
{
0
}
min=
{
0
}
min=
{
0
}
onChange=
{
value
=>
inputChange
(
value
,
'
productStock
'
,
index
)
}
onChange=
{
value
=>
inputChange
(
value
,
'
productStock
'
,
index
)
}
disabled=
{
isService
}
/>
/>
),
),
},
},
...
@@ -278,6 +288,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
...
@@ -278,6 +288,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
className=
{
`thirdSkuNo ${index}`
}
className=
{
`thirdSkuNo ${index}`
}
defaultValue=
{
val
}
defaultValue=
{
val
}
onChange=
{
evt
=>
inputChange
(
evt
.
target
.
value
,
'
thirdSkuNo
'
,
index
)
}
onChange=
{
evt
=>
inputChange
(
evt
.
target
.
value
,
'
thirdSkuNo
'
,
index
)
}
disabled=
{
isService
}
/>
/>
),
),
},
},
...
@@ -295,6 +306,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
...
@@ -295,6 +306,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
className=
{
`skuLink ${index}`
}
className=
{
`skuLink ${index}`
}
defaultValue=
{
val
}
defaultValue=
{
val
}
onChange=
{
evt
=>
inputChange
(
evt
.
target
.
value
,
'
skuLink
'
,
index
)
}
onChange=
{
evt
=>
inputChange
(
evt
.
target
.
value
,
'
skuLink
'
,
index
)
}
disabled=
{
isService
}
/>
/>
}
}
</
Popover
>
</
Popover
>
...
@@ -319,6 +331,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
...
@@ -319,6 +331,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
size=
"small"
size=
"small"
style=
{
{
marginTop
:
'
5px
'
}
}
style=
{
{
marginTop
:
'
5px
'
}
}
onClick=
{
()
=>
openModal
(
row
,
index
)
}
onClick=
{
()
=>
openModal
(
row
,
index
)
}
disabled=
{
isService
}
>
>
修改sku名称
修改sku名称
</
Button
>
</
Button
>
...
@@ -343,6 +356,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
...
@@ -343,6 +356,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
max=
{
999999.999
}
max=
{
999999.999
}
precision=
{
3
}
precision=
{
3
}
onChange=
{
value
=>
inputChange
(
value
,
'
weight
'
,
index
)
}
onChange=
{
value
=>
inputChange
(
value
,
'
weight
'
,
index
)
}
disabled=
{
isService
}
/>
/>
),
),
});
});
...
@@ -360,6 +374,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
...
@@ -360,6 +374,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
min=
{
0
}
min=
{
0
}
precision=
{
0
}
precision=
{
0
}
onChange=
{
value
=>
inputChange
(
value
,
'
productStockWarning
'
,
index
)
}
onChange=
{
value
=>
inputChange
(
value
,
'
productStockWarning
'
,
index
)
}
disabled=
{
isService
}
/>
/>
),
),
});
});
...
...
src/pages/GoodsManage/index.jsx
View file @
555a3296
...
@@ -3,11 +3,13 @@ import React, { Component } from 'react';
...
@@ -3,11 +3,13 @@ import React, { Component } from 'react';
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
da
}
from
'
date-fns/locale
'
;
import
styles
from
'
./style.less
'
;
import
styles
from
'
./style.less
'
;
import
LocalStroage
from
'
@/utils/localStorage
'
;
import
LocalStroage
from
'
@/utils/localStorage
'
;
import
configApi
from
'
../../../config/env.config
'
;
import
configApi
from
'
../../../config/env.config
'
;
import
UpdateStock
from
'
./UpdateStock
'
;
import
UpdateStock
from
'
./UpdateStock
'
;
import
{
spuDetail
,
categoryList
,
getVirtualCategory
,
getTemplateList
}
from
'
./service
'
;
import
{
spuDetail
,
categoryList
,
getVirtualCategory
,
getTemplateList
,
specList
}
from
'
./service
'
;
import
LogModal
from
'
./LogModal
'
;
import
LogModal
from
'
./LogModal
'
;
import
CreateModal
from
'
./createModal
'
;
import
CreateModal
from
'
./createModal
'
;
import
{
column
,
JDSHOPID
}
from
'
./staticdata
'
;
import
{
column
,
JDSHOPID
}
from
'
./staticdata
'
;
...
@@ -31,6 +33,7 @@ class goodsManage extends Component {
...
@@ -31,6 +33,7 @@ class goodsManage extends Component {
updateStockVisible
:
false
,
updateStockVisible
:
false
,
initData
:
{},
initData
:
{},
createloading
:
false
,
createloading
:
false
,
specListData
:
[],
templeatModalVisible
:
false
,
templeatModalVisible
:
false
,
selectedRowKeys
:
[],
selectedRowKeys
:
[],
isAll
:
0
,
isAll
:
0
,
...
@@ -47,6 +50,7 @@ class goodsManage extends Component {
...
@@ -47,6 +50,7 @@ class goodsManage extends Component {
this
.
props
.
goodsManage
.
tableData
=
{};
this
.
props
.
goodsManage
.
tableData
=
{};
this
.
categoryList
();
this
.
categoryList
();
this
.
getVirtualCategory
();
this
.
getVirtualCategory
();
this
.
specList
();
}
}
handleSearch
=
page
=>
{
handleSearch
=
page
=>
{
...
@@ -97,12 +101,13 @@ class goodsManage extends Component {
...
@@ -97,12 +101,13 @@ class goodsManage extends Component {
this
.
handleSearch
();
this
.
handleSearch
();
};
};
onUpdateInfo
=
async
({
spuId
,
productType
})
=>
{
onUpdateInfo
=
async
({
s
tate
,
s
puId
,
productType
})
=>
{
this
.
setState
({
this
.
setState
({
createloading
:
true
,
createloading
:
true
,
});
});
const
{
data
,
msg
}
=
await
spuDetail
({
id
:
spuId
});
const
{
data
,
msg
}
=
await
spuDetail
({
id
:
spuId
});
if
(
data
)
{
if
(
data
)
{
data
.
state
=
state
;
data
.
pageProductType
=
productType
;
data
.
pageProductType
=
productType
;
data
.
categoryId
=
data
.
thirdCategoryId
;
data
.
categoryId
=
data
.
thirdCategoryId
;
data
.
firstSpecId
=
data
.
skuList
[
0
].
firstSpecId
;
data
.
firstSpecId
=
data
.
skuList
[
0
].
firstSpecId
;
...
@@ -125,7 +130,15 @@ class goodsManage extends Component {
...
@@ -125,7 +130,15 @@ class goodsManage extends Component {
data
.
secondSpecList
.
push
(
i
.
secondSpecValue
);
data
.
secondSpecList
.
push
(
i
.
secondSpecValue
);
}
}
});
});
data
.
specs
.
forEach
(
item
=>
{
const
arr
=
[];
if
(
item
.
specValues
.
length
)
{
item
.
specValues
.
forEach
(
childItem
=>
{
arr
.
push
(
childItem
.
value
);
});
}
data
[
item
.
specId
]
=
arr
;
});
data
.
imageList
=
[];
data
.
imageList
=
[];
data
.
carouseList
.
forEach
(
i
=>
{
data
.
carouseList
.
forEach
(
i
=>
{
data
.
imageList
[
`
${
i
.
specValue
}
`
]
=
i
.
skuSpecImageList
||
[];
data
.
imageList
[
`
${
i
.
specValue
}
`
]
=
i
.
skuSpecImageList
||
[];
...
@@ -251,6 +264,13 @@ class goodsManage extends Component {
...
@@ -251,6 +264,13 @@ class goodsManage extends Component {
}
}
};
};
specList
=
async
()
=>
{
const
data
=
await
specList
();
if
(
data
.
businessCode
===
'
0000
'
&&
data
.
data
.
length
)
{
this
.
setState
({
specListData
:
data
.
data
});
}
};
onSelectChange
=
selectedRowKeys
=>
{
onSelectChange
=
selectedRowKeys
=>
{
this
.
setState
({
this
.
setState
({
selectedRowKeys
,
selectedRowKeys
,
...
@@ -346,6 +366,7 @@ class goodsManage extends Component {
...
@@ -346,6 +366,7 @@ class goodsManage extends Component {
shopList=
{
this
.
filterShopList
(
this
.
shopList
,
Object
.
keys
(
this
.
state
.
initData
).
length
)
}
shopList=
{
this
.
filterShopList
(
this
.
shopList
,
Object
.
keys
(
this
.
state
.
initData
).
length
)
}
treeData=
{
this
.
state
.
treeData
}
treeData=
{
this
.
state
.
treeData
}
virtualTreeData=
{
this
.
state
.
virtualTreeData
}
virtualTreeData=
{
this
.
state
.
virtualTreeData
}
specListData=
{
this
.
state
.
specListData
}
></
CreateModal
>
></
CreateModal
>
<
UpdateStock
<
UpdateStock
...
...
src/pages/GoodsManage/service.js
View file @
555a3296
...
@@ -148,6 +148,13 @@ export async function getVirtualCategory() {
...
@@ -148,6 +148,13 @@ export async function getVirtualCategory() {
});
});
return
data
;
return
data
;
}
}
// 查询商品属性列表
export
async
function
specList
()
{
return
request
.
get
(
'
/product/api/merchant/spec
'
,
{
prefix
:
goodsApi
,
});
}
// sku绑定模板
// sku绑定模板
export
async
function
getTemplate
(
params
)
{
export
async
function
getTemplate
(
params
)
{
const
data
=
await
request
.
post
(
'
/api/kdsp/sku/template
'
,
{
const
data
=
await
request
.
post
(
'
/api/kdsp/sku/template
'
,
{
...
...
src/pages/GoodsManage/staticdata.js
View file @
555a3296
...
@@ -137,7 +137,12 @@ export function column() {
...
@@ -137,7 +137,12 @@ export function column() {
dataIndex
:
'
stateDesc
'
,
dataIndex
:
'
stateDesc
'
,
width
:
200
,
width
:
200
,
align
:
'
center
'
,
align
:
'
center
'
,
render
:
(
_
,
row
)
=>
<
span
>
{
row
.
state
>=
5
?
'
审核通过
'
:
_
}
<
/span>
,
render
:
(
_
,
row
)
=>
(
<
div
>
<
p
>
{
row
.
state
>=
5
?
'
审核通过
'
:
_
}
<
/p
>
<
p
>
{
row
.
updateStateDesc
||
'
_ _
'
}
<
/p
>
<
/div
>
),
},
},
{
{
title
:
'
操作
'
,
title
:
'
操作
'
,
...
@@ -146,7 +151,7 @@ export function column() {
...
@@ -146,7 +151,7 @@ export function column() {
align
:
'
center
'
,
align
:
'
center
'
,
render
:
(
_
,
row
)
=>
(
render
:
(
_
,
row
)
=>
(
<
div
className
=
{
styles
.
actionBtn
}
>
<
div
className
=
{
styles
.
actionBtn
}
>
{
row
.
state
===
4
&&
(
{
(
row
.
state
===
4
||
(
row
.
state
===
5
&&
row
.
updateState
!==
1
))
&&
(
<
Button
<
Button
key
=
"
edit
"
key
=
"
edit
"
type
=
"
primary
"
type
=
"
primary
"
...
...
src/pages/GoodsManage/style.less
View file @
555a3296
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
}
}
.warning {
.warning {
margin-top: -20px;
margin-top: -20px;
margin-bottom: 20px;
color: red;
color: red;
}
}
...
...
src/pages/components/sortablUpload/index.jsx
View file @
555a3296
...
@@ -156,7 +156,7 @@ class PicturesWall extends React.Component {
...
@@ -156,7 +156,7 @@ class PicturesWall extends React.Component {
<
div
className=
"ant-upload-text"
>
上传图片
</
div
>
<
div
className=
"ant-upload-text"
>
上传图片
</
div
>
</
div
>
</
div
>
);
);
const
{
max
}
=
this
.
props
;
const
{
max
,
isDisabled
}
=
this
.
props
;
const
that
=
this
;
const
that
=
this
;
const
uploadProps
=
{
const
uploadProps
=
{
beforeUpload
:
lodash
.
debounce
(
async
(
file
,
files
)
=>
{
beforeUpload
:
lodash
.
debounce
(
async
(
file
,
files
)
=>
{
...
@@ -218,11 +218,13 @@ class PicturesWall extends React.Component {
...
@@ -218,11 +218,13 @@ class PicturesWall extends React.Component {
className=
{
styles
.
maskIcon
}
className=
{
styles
.
maskIcon
}
onClick=
{
()
=>
this
.
handlePreview
(
item
)
}
onClick=
{
()
=>
this
.
handlePreview
(
item
)
}
/>
/>
<
Icon
{
!
isDisabled
&&
(
type=
"delete"
<
Icon
className=
{
styles
.
maskIcon
}
type=
"delete"
onClick=
{
()
=>
this
.
onRemoveImg
(
item
)
}
className=
{
styles
.
maskIcon
}
/>
onClick=
{
()
=>
this
.
onRemoveImg
(
item
)
}
/>
)
}
</
div
>
</
div
>
)
}
)
}
</
div
>
</
div
>
...
@@ -230,7 +232,13 @@ class PicturesWall extends React.Component {
...
@@ -230,7 +232,13 @@ class PicturesWall extends React.Component {
</
ReactSortable
>
</
ReactSortable
>
)
}
)
}
</
div
>
</
div
>
<
Upload
multiple
{
...
uploadProps
}
fileList=
{
fileList
}
showUploadList=
{
false
}
>
<
Upload
multiple
{
...
uploadProps
}
fileList=
{
fileList
}
showUploadList=
{
false
}
disabled=
{
isDisabled
}
>
{
max
&&
fileList
.
length
>=
max
?
null
:
uploadButton
}
{
max
&&
fileList
.
length
>=
max
?
null
:
uploadButton
}
</
Upload
>
</
Upload
>
<
Modal
visible=
{
previewVisible
}
footer=
{
null
}
onCancel=
{
this
.
handleCancel
}
>
<
Modal
visible=
{
previewVisible
}
footer=
{
null
}
onCancel=
{
this
.
handleCancel
}
>
...
...
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