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
63a12f9b
Commit
63a12f9b
authored
Jul 31, 2022
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 调整
parent
d9af01f6
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
115 additions
and
67 deletions
+115
-67
index.jsx
src/pages/GoodsManage/SearchForm/index.jsx
+3
-0
index.jsx
src/pages/GoodsManage/index.jsx
+6
-1
EditFormTable.jsx
src/pages/ServiceGoods/components/EditFormTable.jsx
+27
-27
FormInformationBasic.jsx
src/pages/ServiceGoods/components/FormInformationBasic.jsx
+45
-31
FormRuleSetting.jsx
src/pages/ServiceGoods/components/FormRuleSetting.jsx
+2
-2
TaskTypeSelect.jsx
src/pages/ServiceGoods/components/TaskTypeSelect.jsx
+1
-0
config.js
src/pages/ServiceGoods/config.js
+3
-1
index.jsx
src/pages/ServiceGoods/index.jsx
+16
-3
service.js
src/pages/ServiceGoods/service.js
+6
-0
utils.js
src/pages/ServiceGoods/utils.js
+4
-0
utils.js
src/utils/utils.js
+2
-2
No files found.
src/pages/GoodsManage/SearchForm/index.jsx
View file @
63a12f9b
...
...
@@ -176,6 +176,9 @@ class goodsManage extends Component {
<
Button
type=
"primary"
className=
{
styles
.
button
}
onClick=
{
this
.
addSpu
}
>
新增商品
</
Button
>
<
Button
type=
"primary"
className=
{
styles
.
button
}
onClick=
{
this
.
props
.
serviceVisbleOpen
}
>
新增电子卡卷
</
Button
>
{
/* <Button
className={styles.button}
type="primary"
...
...
src/pages/GoodsManage/index.jsx
View file @
63a12f9b
...
...
@@ -322,6 +322,10 @@ class goodsManage extends Component {
}
};
serviceVisbleOpen
=
()
=>
{
this
.
serviceVisbleClose
(
true
);
};
serviceVisbleClose
=
flag
=>
{
this
.
setState
({
serviceVisble
:
flag
,
...
...
@@ -342,7 +346,6 @@ class goodsManage extends Component {
<
PageHeaderWrapper
>
<
Spin
spinning=
{
this
.
state
.
createloading
}
>
<
Card
>
<
Button
onClick=
{
()
=>
this
.
serviceVisbleClose
(
true
)
}
>
新建
</
Button
>
<
SearchForm
handleSearch=
{
this
.
handleSearch
}
onReset=
{
this
.
onReset
}
...
...
@@ -354,6 +357,7 @@ class goodsManage extends Component {
shopList=
{
this
.
shopList
}
addSpu=
{
()
=>
this
.
setState
({
createVisible
:
true
,
initData
:
{}
})
}
setArea=
{
(
isALL
,
type
)
=>
this
.
setArea
(
isALL
,
type
)
}
serviceVisbleOpen=
{
this
.
serviceVisbleOpen
}
/>
</
Card
>
<
Spin
spinning=
{
this
.
state
.
loading
}
>
...
...
@@ -444,6 +448,7 @@ class goodsManage extends Component {
id=
{
894048258062
}
onChange=
{
this
.
serviceVisbleClose
}
SourceData=
{
this
.
state
.
serviceData
}
shopList=
{
this
.
shopList
}
categoryList=
{
this
.
state
.
serviceData
.
productType
===
2
?
this
.
state
.
virtualTreeData
...
...
src/pages/ServiceGoods/components/EditFormTable.jsx
View file @
63a12f9b
...
...
@@ -45,7 +45,10 @@ const UpdateSkuName = ({ skuVisble, value, confirmEvent, cancelEvent }) => {
};
const
EditableContext
=
createContext
(
null
);
const
EditableRow
=
({
index
,
...
props
})
=>
<
tr
{
...
props
}
/>;
const
EditableRow
=
({
index
,
...
props
})
=>
(
// console.log('=============>EditableRow', props);
<
tr
{
...
props
}
/>
);
const
EditableCell
=
props
=>
{
const
{
rowIndex
,
...
...
@@ -84,34 +87,29 @@ const EditableCell = props => {
if
(
type
===
'
updateName
'
)
{
rowOnClickEvent
(
row
);
}
// console.log(type, row);
};
const
childNode
=
(
const
childNode
=
editable
?
(
<
Form
.
Item
style=
{
{
margin
:
0
}
}
hidden=
{
roleHidden
}
name=
{
[
'
tableList
'
,
rowIndex
,
dataIndex
]
}
rules=
{
[{
required
:
roleRules
.
required
,
message
:
`请输入${title}.`
}]
}
>
{
editable
?
(
<
CreateFormInput
{
...
roleProps
}
title=
{
title
}
rowIndex=
{
rowIndex
}
dataIndex=
{
dataIndex
}
record=
{
record
}
type=
{
props
.
type
}
onBlur=
{
save
}
onClick=
{
onClickEvent
}
disabled=
{
props
.
disabled
}
/>
)
:
(
<
Button
type=
"text"
>
{
children
[
1
]
}
</
Button
>
)
}
<
CreateFormInput
{
...
roleProps
}
title=
{
title
}
rowIndex=
{
rowIndex
}
dataIndex=
{
dataIndex
}
record=
{
record
}
type=
{
props
.
type
}
onBlur=
{
save
}
onClick=
{
onClickEvent
}
disabled=
{
props
.
disabled
}
/>
</
Form
.
Item
>
);
)
:
(
children
);
// <Button type="text">{children[1]}</Button>
return
<
td
{
...
restProps
}
>
{
childNode
}
</
td
>;
};
...
...
@@ -143,7 +141,10 @@ const EditFormTable = forwardRef((props, ref) => {
};
const
handleSave
=
row
=>
{
setTableData
([...
row
]);
form
.
setFieldsValue
({
tableList
:
[...
row
],
});
// setTableData([...row]);
};
const
onCheck
=
async
()
=>
{
...
...
@@ -210,10 +211,12 @@ const EditFormTable = forwardRef((props, ref) => {
}));
return
(
<
div
>
<>
<
Form
form=
{
form
}
scrollToFirstError
component=
{
false
}
>
<
EditableContext
.
Provider
value=
{
form
}
>
{
/* scroll={{ y: 300, x: 1200 }} */
}
<
Table
height=
{
300
}
pagination=
{
false
}
size=
"small"
components=
{
{
...
...
@@ -228,9 +231,6 @@ const EditFormTable = forwardRef((props, ref) => {
columns=
{
columns
}
/>
</
EditableContext
.
Provider
>
<
Button
onClick=
{
handleAdd
}
type=
"primary"
style=
{
{
marginBottom
:
16
}
}
>
Add a row
</
Button
>
</
Form
>
<
Button
onClick=
{
()
=>
{}
}
></
Button
>
<
UpdateSkuName
...
...
@@ -240,7 +240,7 @@ const EditFormTable = forwardRef((props, ref) => {
confirmEvent=
{
confirmEvent
}
cancelEvent=
{
cancelEvent
}
/>
</
div
>
</>
);
});
...
...
src/pages/ServiceGoods/components/FormInformationBasic.jsx
View file @
63a12f9b
...
...
@@ -16,7 +16,7 @@ const filterCategoryOptions = (inputValue, path) =>
path
.
some
(
option
=>
option
.
name
.
toLowerCase
().
indexOf
(
inputValue
.
toLowerCase
())
>
-
1
);
const
FormInformationBasic
=
forwardRef
((
props
,
ref
)
=>
{
const
{
editData
,
categoryList
,
brandList
,
afterAddressList
,
specListData
}
=
props
;
const
{
editData
,
categoryList
,
brandList
,
shopList
,
afterAddressList
,
specListData
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
noreBrandList
,
setNoreBrandList
]
=
useState
([]);
const
customer
=
useContext
(
ServiceContext
);
...
...
@@ -79,6 +79,15 @@ const FormInformationBasic = forwardRef((props, ref) => {
}
}
scrollToFirstError
>
<
Form
.
Item
label=
"供应商名称"
name=
"supplierId"
rules=
{
[{
required
:
true
,
message
:
'
请选择供应商名称
'
}]
}
>
<
Select
showSearch
placeholder=
"请选择供应商名称"
filterOption=
{
fileterBrandOptions
}
>
{
CreateSelectOption
(
shopList
)
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
name=
"categoryId"
label=
"商品类目"
...
...
@@ -126,40 +135,45 @@ const FormInformationBasic = forwardRef((props, ref) => {
*本列表的商品名称仅供搜索使用,不在前端作展示。若要修改APP端展示的商品名称,请在商品信息中修改。
</
Button
>
)
}
<
Form
.
Item
name=
"character"
label=
"商品卖点"
maxLength=
{
50
}
placeholder=
"卖点最优可填写3个词,12个字。前后用空格加竖杠分隔,例: 莹莹剔透 | 粒粒优选 | 易煮易熟"
rules=
{
[{
required
:
true
,
message
:
'
请输入商品卖点!
'
,
whitespace
:
true
}]
}
>
<
Input
placeholder=
"请输入商品名称"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"afterAddressId"
label=
"售后地址"
rules=
{
[{
required
:
true
,
message
:
'
请选择售后地址!
'
}]
}
>
<
Select
showSearch
placeholder=
"请选择商品品牌"
filterOption=
{
fileterBrandOptions
}
>
{
([{
id
:
9527
,
addressName
:
'
测试地址
'
}]
||
afterAddressList
).
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
addressName
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
{
!
customer
.
isCard
&&
(
<
Form
.
Item
name=
"character"
label=
"商品卖点"
maxLength=
{
50
}
placeholder=
"卖点最优可填写3个词,12个字。前后用空格加竖杠分隔,例: 莹莹剔透 | 粒粒优选 | 易煮易熟"
rules=
{
[{
required
:
true
,
message
:
'
请输入商品卖点!
'
,
whitespace
:
true
}]
}
>
<
Input
placeholder=
"请输入商品名称"
/>
</
Form
.
Item
>
)
}
{
specListData
.
map
((
item
,
index
)
=>
(
{
!
customer
.
isCard
&&
(
<
Form
.
Item
key=
{
item
.
specId
}
label=
{
item
.
specName
}
name=
{
item
.
specId
}
labelCol=
{
{
span
:
2
}
}
name=
"afterAddressId"
label=
"售后地址"
rules=
{
[{
required
:
true
,
message
:
'
请选择售后地址!
'
}]
}
>
<
Checkbox
.
Group
options=
{
item
.
specValues
}
/>
<
Select
showSearch
placeholder=
"请选择商品品牌"
filterOption=
{
fileterBrandOptions
}
>
{
([{
id
:
9527
,
addressName
:
'
测试地址
'
}]
||
afterAddressList
).
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
addressName
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
))
}
)
}
{
!
customer
.
isCard
&&
specListData
.
map
((
item
,
index
)
=>
(
<
Form
.
Item
key=
{
item
.
specId
}
label=
{
item
.
specName
}
name=
{
item
.
specId
}
labelCol=
{
{
span
:
2
}
}
>
<
Checkbox
.
Group
options=
{
item
.
specValues
}
/>
</
Form
.
Item
>
))
}
{
/* <Form.Item
name="brandId"
...
...
src/pages/ServiceGoods/components/FormRuleSetting.jsx
View file @
63a12f9b
...
...
@@ -96,10 +96,10 @@ const FormRuleSetting = forwardRef((props, ref) => {
scrollToFirstError
>
<
Form
.
Item
name=
"useTime"
label=
"购买时间"
{
...
rangeConfig
}
>
<
RangePicker
showTime
format=
"YYYY-MM-DD HH"
/>
<
RangePicker
showTime
format=
"YYYY-MM-DD HH
:mm:ss
"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"purchaseTime"
label=
"有效期"
{
...
rangeConfig
}
>
<
RangePicker
showTime
format=
"YYYY-MM-DD HH"
/>
<
RangePicker
showTime
format=
"YYYY-MM-DD HH
:mm:ss
"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"shopIds"
...
...
src/pages/ServiceGoods/components/TaskTypeSelect.jsx
View file @
63a12f9b
...
...
@@ -15,6 +15,7 @@ export const TaskTypeSelect = props => {
<
div
className=
{
commonStyle
.
prodcutContent
}
>
{
TaskList
.
map
(
task
=>
{
const
activeClassName
=
props
.
productType
===
task
.
type
?
commonStyle
.
activeCard
:
''
;
if
(
task
.
hide
)
return
null
;
return
(
<
dl
key=
{
task
.
type
}
...
...
src/pages/ServiceGoods/config.js
View file @
63a12f9b
...
...
@@ -12,6 +12,7 @@ export const TaskList = [
name
:
'
实体商品
'
,
type
:
1
,
desc
:
'
物流发货
'
,
hide
:
true
,
imgConfig
:
{
imageList
:
{
tip
:
'
(图片最大上传2M)
'
,
...
...
@@ -34,6 +35,7 @@ export const TaskList = [
name
:
'
虚拟商品
'
,
type
:
2
,
desc
:
'
无需物流
'
,
hide
:
true
,
imgConfig
:
{
imageList
:
{
rule
:
false
,
...
...
@@ -158,7 +160,7 @@ export const StaticColumns = customer => [
},
{
title
:
'
库存
'
,
dataIndex
:
'
s
tock
'
,
dataIndex
:
'
productS
tock
'
,
editable
:
true
,
role
:
[
3
],
roleRules
:
{
required
:
true
},
...
...
src/pages/ServiceGoods/index.jsx
View file @
63a12f9b
...
...
@@ -16,6 +16,8 @@ import {
afterSalesAddrsPage
,
merchantgetJdPicList
,
merchantProductAdd
,
// getSupplierList,
supplierListQuery
,
}
from
'
./service
'
;
import
{
isUrl
,
filterSendData
}
from
'
./utils
'
;
import
{
ServiceContext
}
from
'
./context
'
;
...
...
@@ -36,15 +38,16 @@ const ServiceGoods = options => {
const
[
pageId
,
setPageId
]
=
useState
(
null
);
const
[
isEdit
,
setIsEdit
]
=
useState
(
false
);
// 是否是编辑状态
const
[
productType
,
setProductType
]
=
useState
(
1
);
// 商品状态
const
[
productType
,
setProductType
]
=
useState
(
3
);
// 商品状态
const
[
pageLoading
,
setPageLoading
]
=
useState
(
false
);
// 页面加载状态
// const [categoryList, setCategoryList] = useState([]); // 获取三级类目
const
[
afterAddressList
,
setAfterAddressList
]
=
useState
([]);
const
[
shopList
,
setShopList
]
=
useState
([]);
const
[
brandList
,
setBrandList
]
=
useState
([]);
// 获取商品牌
const
[
specList
,
setSpecList
]
=
useState
([]);
// 规格列表
const
[
editData
,
setEditData
]
=
useState
({});
// 编辑保存数据
const
baseCheckList
=
[
basicRef
,
stockRef
,
picturesRef
];
const
baseCheckList
=
[
basicRef
,
stockRef
,
settingRef
,
settleOtrRef
,
picturesRef
];
// 卡卷默认5个,到时改版为实体对应3个
const
[
checkFormList
,
setCheckFormList
]
=
useState
(
baseCheckList
);
const
[
specKeyList
,
setSpecKeyList
]
=
useState
([]);
// 记录一级规格key字段
...
...
@@ -112,6 +115,14 @@ const ServiceGoods = options => {
}
};
const
getSupplierListResponse
=
async
()
=>
{
if
(
!
shopList
.
length
)
{
const
result
=
await
supplierListQuery
();
console
.
log
(
'
=================>result
'
,
result
);
setShopList
(
result
.
data
);
}
};
const
sendMerchantProductAdd
=
async
sendData
=>
{
const
addResponse
=
await
merchantProductAdd
(
sendData
);
console
.
log
(
addResponse
);
...
...
@@ -161,6 +172,7 @@ const ServiceGoods = options => {
return
;
}
setPageLoading
(
true
);
await
getSupplierListResponse
();
await
getMerchantBrandList
();
await
getAfterSalesAddrsPage
();
await
getMerchantSpecList
();
...
...
@@ -192,7 +204,7 @@ const ServiceGoods = options => {
const
handleCancel
=
()
=>
{
setPageId
(
null
);
setIsEdit
(
false
);
setProductType
(
1
);
setProductType
(
3
);
setEditData
({});
setSpecKeyList
([]);
resetForm
();
...
...
@@ -250,6 +262,7 @@ const ServiceGoods = options => {
<
FormInformationBasic
ref=
{
basicRef
}
editData=
{
editData
.
infoMation
}
shopList=
{
shopList
}
categoryList=
{
categoryList
}
brandList=
{
brandList
}
afterAddressList=
{
afterAddressList
}
...
...
src/pages/ServiceGoods/service.js
View file @
63a12f9b
...
...
@@ -72,3 +72,9 @@ export const merchantProductAdd = data =>
prefix
:
goodsApi
,
data
,
});
export
const
supplierListQuery
=
()
=>
request
.
get
(
'
/api/kdsp/supplier/supplier-list-query
'
,
{
prefix
:
config
.
kdspApi
,
headers
,
});
src/pages/ServiceGoods/utils.js
View file @
63a12f9b
...
...
@@ -131,6 +131,10 @@ export const batchTableSourceData = ({ batchItem, tableData, bacthSecon, bacthFi
const
filterItems
=
(
type
,
props
)
=>
{
const
{
infoSpecData
,
serviceItem
,
infoImageData
,
infoMation
,
settlementItem
}
=
props
;
console
.
log
(
'
===========>serviceItem
'
,
serviceItem
);
console
.
log
(
'
===========>settlementItem
'
,
settlementItem
);
const
{
imageList
=
{},
commonImageList
}
=
infoImageData
;
return
infoSpecData
.
items
.
map
(
item
=>
{
const
imgList
=
imageList
[
item
.
firstSpecValue
]
||
[];
...
...
src/utils/utils.js
View file @
63a12f9b
...
...
@@ -54,5 +54,5 @@ export function toThousands(data, num) {
return
result
;
}
export
const
formatTime
=
(
time
,
crm
=
'
YYYY-MM-DD HH
'
)
=>
time
.
format
(
crm
);
export
const
resetTime
=
(
time
,
crm
=
'
YYYY-MM-DD HH
'
)
=>
moment
(
time
,
crm
);
export
const
formatTime
=
(
time
,
crm
=
'
YYYY-MM-DD HH
:mm:ss
'
)
=>
time
.
format
(
crm
);
export
const
resetTime
=
(
time
,
crm
=
'
YYYY-MM-DD HH
:mm:ss
'
)
=>
moment
(
time
,
crm
);
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