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
f107556f
Commit
f107556f
authored
Nov 16, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 去掉old创建实物商品
parent
f3b1113d
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
2114 deletions
+17
-2114
batchSetting.jsx
src/pages/GoodsManage/createModal/batchSetting.jsx
+0
-172
buttonGroup.jsx
src/pages/GoodsManage/createModal/buttonGroup.jsx
+0
-45
index.jsx
src/pages/GoodsManage/createModal/index.jsx
+0
-1294
mixin.jsx
src/pages/GoodsManage/createModal/mixin.jsx
+0
-445
skuNameChange.jsx
src/pages/GoodsManage/createModal/skuNameChange.jsx
+0
-53
index.jsx
src/pages/GoodsManage/index.jsx
+17
-105
index.jsx
src/pages/GoodsManage/infoAudit/index.jsx
+0
-0
No files found.
src/pages/GoodsManage/createModal/batchSetting.jsx
deleted
100644 → 0
View file @
f3b1113d
/* eslint-disable no-param-reassign */
import
{
Form
,
Select
,
Input
,
InputNumber
,
Button
}
from
'
antd
'
;
import
React
,
{
Component
}
from
'
react
'
;
// import styles from '../style.less';
const
{
Option
}
=
Select
;
const
FormItem
=
Form
.
Item
;
class
goodsManage
extends
Component
{
formRef
=
React
.
createRef
();
componentDidMount
()
{
this
.
props
.
onRef
(
this
);
}
setFiled
=
flag
=>
{
const
form
=
this
.
formRef
.
current
;
if
(
flag
===
'
firstKeys
'
)
{
form
.
setFieldsValue
({
firstSpecValue
:
''
});
return
;
}
form
.
setFieldsValue
({
secondSpecValue
:
''
});
};
batchSetting
=
()
=>
{
const
{
editData
,
isEdit
}
=
this
.
props
;
const
form
=
this
.
formRef
.
current
;
const
data
=
form
.
getFieldsValue
();
if
(
!
data
.
firstSpecValue
&&
!
data
.
secondSpecValue
)
{
editData
.
forEach
(
item
=>
{
item
.
marketPrice
=
data
.
marketPrice
;
// if (!isEdit) item.productStock = data.productStock; // 编辑状态不可修改库存
item
.
productStock
=
data
.
productStock
;
item
.
supplyPrice
=
data
.
supplyPrice
;
item
.
weight
=
data
.
weight
;
item
.
productStockWarning
=
data
.
productStockWarning
;
});
}
if
(
data
.
firstSpecValue
&&
!
data
.
secondSpecValue
)
{
editData
.
forEach
(
item
=>
{
if
(
item
.
firstSpecValue
===
data
.
firstSpecValue
)
{
item
.
marketPrice
=
data
.
marketPrice
;
item
.
productStock
=
data
.
productStock
;
item
.
supplyPrice
=
data
.
supplyPrice
;
item
.
weight
=
data
.
weight
;
item
.
productStockWarning
=
data
.
productStockWarning
;
}
});
}
if
(
!
data
.
firstSpecValue
&&
data
.
secondSpecValue
)
{
editData
.
forEach
(
item
=>
{
if
(
item
.
secondSpecValue
===
data
.
secondSpecValue
)
{
item
.
marketPrice
=
data
.
marketPrice
;
item
.
productStock
=
data
.
productStock
;
item
.
supplyPrice
=
data
.
supplyPrice
;
item
.
weight
=
data
.
weight
;
item
.
productStockWarning
=
data
.
productStockWarning
;
}
});
}
if
(
data
.
firstSpecValue
&&
data
.
secondSpecValue
)
{
editData
.
forEach
(
item
=>
{
if
(
item
.
firstSpecValue
===
data
.
firstSpecValue
&&
item
.
secondSpecValue
===
data
.
secondSpecValue
)
{
item
.
marketPrice
=
data
.
marketPrice
;
item
.
productStock
=
data
.
productStock
;
item
.
supplyPrice
=
data
.
supplyPrice
;
item
.
weight
=
data
.
weight
;
item
.
productStockWarning
=
data
.
productStockWarning
;
}
});
}
this
.
props
.
batchSetting
(
editData
);
};
render
()
{
const
{
firstSpes
=
[],
secondSpecs
=
[],
firstSpesName
=
''
,
secondSpesName
=
''
,
productType
,
isEdit
,
isService
,
}
=
this
.
props
;
return
(
<
Form
layout=
"inline"
ref=
{
this
.
formRef
}
>
<
FormItem
name=
"firstSpecValue"
>
<
Select
allowClear
style=
{
{
width
:
120
}
}
placeholder=
{
firstSpesName
}
>
{
firstSpes
.
length
>
0
&&
firstSpes
.
map
(
item
=>
item
&&
typeof
item
===
'
string
'
&&
(
<
Option
key=
{
item
}
value=
{
item
}
>
{
item
}
</
Option
>
),
)
}
</
Select
>
</
FormItem
>
<
FormItem
name=
"secondSpecValue"
>
<
Select
allowClear
style=
{
{
width
:
120
}
}
placeholder=
{
secondSpesName
}
>
{
secondSpecs
.
length
&&
secondSpecs
.
map
(
item
=>
item
&&
typeof
item
===
'
string
'
&&
(
<
Option
key=
{
item
}
value=
{
item
}
>
{
item
}
</
Option
>
),
)
}
</
Select
>
</
FormItem
>
<
FormItem
name=
"supplyPrice"
>
<
Input
placeholder=
"供货价"
style=
{
{
width
:
100
}
}
/>
</
FormItem
>
<
FormItem
name=
"marketPrice"
>
<
Input
placeholder=
"市场价"
style=
{
{
width
:
100
}
}
/>
</
FormItem
>
{
/* <FormItem>
{getFieldDecorator('salePrice', {})(
<Input placeholder="销售价" style={{ width: 100 }} />,
)}
</FormItem> */
}
{
productType
===
1
&&
(
<
FormItem
name=
"weight"
>
<
InputNumber
precision=
{
3
}
max=
{
999999.999
}
// eslint-disable-next-line radix
placeholder=
"重量"
style=
{
{
width
:
130
}
}
/>
</
FormItem
>
)
}
<
FormItem
name=
"productStock"
>
<
InputNumber
precision=
{
0
}
step=
{
1
}
// eslint-disable-next-line radix
formatter=
{
val
=>
parseInt
(
val
,
'
10
'
)
||
''
}
placeholder=
"库存"
style=
{
{
width
:
100
}
}
/>
</
FormItem
>
{
productType
===
1
&&
(
<
FormItem
name=
"productStockWarning"
>
<
InputNumber
placeholder=
"库存预警"
maxLength=
{
5
}
min=
{
0
}
precision=
{
0
}
style=
{
{
width
:
100
}
}
/>
</
FormItem
>
)
}
<
FormItem
>
<
Button
type=
"primary"
htmlType=
"submit"
onClick=
{
this
.
batchSetting
}
disabled=
{
isService
}
>
批量设置
</
Button
>
</
FormItem
>
</
Form
>
);
}
}
export
default
goodsManage
;
src/pages/GoodsManage/createModal/buttonGroup.jsx
deleted
100644 → 0
View file @
f3b1113d
import
{
Row
,
Col
,
Button
}
from
'
antd
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
styles
from
'
../style.less
'
;
// eslint-disable-next-line react/prefer-stateless-function
class
ButtonGroup
extends
Component
{
render
()
{
const
{
initData
,
confirmLoading
}
=
this
.
props
;
return
(
<
Row
type=
"flex"
justify=
"center"
align=
"middle"
gutter=
{
20
}
>
<
Col
>
<
Button
type=
"primary"
onClick=
{
()
=>
this
.
props
.
onCancel
()
}
className=
{
styles
.
logBtn
}
>
取消
</
Button
>
</
Col
>
<
Col
key=
"submit"
>
<
Button
type=
"primary"
onClick=
{
()
=>
this
.
props
.
confirm
()
}
className=
{
styles
.
logBtn
}
loading=
{
confirmLoading
}
disabled=
{
confirmLoading
}
>
提交
</
Button
>
</
Col
>
{
initData
&&
!
Object
.
keys
(
initData
).
length
&&
(
<
Col
key=
"submit-add"
>
<
Button
type=
"primary"
onClick=
{
()
=>
this
.
props
.
confirm
(
true
)
}
className=
{
styles
.
logBtn
}
loading=
{
confirmLoading
}
disabled=
{
confirmLoading
}
>
提交并继续添加
</
Button
>
</
Col
>
)
}
</
Row
>
);
}
}
export
default
ButtonGroup
;
src/pages/GoodsManage/createModal/index.jsx
deleted
100644 → 0
View file @
f3b1113d
This diff is collapsed.
Click to expand it.
src/pages/GoodsManage/createModal/mixin.jsx
deleted
100644 → 0
View file @
f3b1113d
This diff is collapsed.
Click to expand it.
src/pages/GoodsManage/createModal/skuNameChange.jsx
deleted
100644 → 0
View file @
f3b1113d
import
{
Form
}
from
'
@ant-design/compatible
'
;
import
'
@ant-design/compatible/assets/index.css
'
;
import
{
Input
,
Modal
}
from
'
antd
'
;
import
React
,
{
Component
}
from
'
react
'
;
const
{
TextArea
}
=
Input
;
const
FormItem
=
Form
.
Item
;
// import styles from '../style.less';
class
goodsManage
extends
Component
{
// componentDidMount() {
// this.props.onRef(this);
// }
handleOk
=
()
=>
{
const
{
form
}
=
this
.
props
;
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
this
.
props
.
changeSkuName
(
values
.
name
);
this
.
props
.
form
.
resetFields
();
}
});
};
handleCancel
=
()
=>
{
this
.
props
.
form
.
resetFields
();
this
.
props
.
onCancle
();
};
render
()
{
const
{
data
,
visible
,
form
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
form
;
return
(
<
Modal
title=
""
visible=
{
visible
}
onOk=
{
this
.
handleOk
}
onCancel=
{
this
.
handleCancel
}
>
<
Form
>
<
FormItem
label=
"sku名称"
>
{
getFieldDecorator
(
'
name
'
,
{
initialValue
:
data
,
rules
:
[
{
required
:
true
,
message
:
'
请输入
'
,
},
],
})(<
TextArea
autoSize=
{
{
minRows
:
2
,
maxRows
:
6
}
}
allowClear
/>)
}
</
FormItem
>
</
Form
>
</
Modal
>
);
}
}
export
default
Form
.
create
()(
goodsManage
);
src/pages/GoodsManage/index.jsx
View file @
f107556f
...
...
@@ -4,7 +4,6 @@ import { Card, Pagination, Table, notification, Drawer, Spin, Button, Modal } fr
import
React
,
{
Component
}
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
connect
}
from
'
dva
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
styles
from
'
./style.less
'
;
import
LocalStroage
from
'
@/utils/localStorage
'
;
import
configApi
from
'
../../../config/env.config
'
;
...
...
@@ -21,12 +20,11 @@ import {
apiQueryLastChangeLog
,
}
from
'
./service
'
;
import
LogModal
from
'
./LogModal
'
;
import
CreateModal
from
'
./createModal
'
;
import
{
column
,
JDSHOPID
,
ProcessEditData
}
from
'
./staticdata
'
;
import
SearchForm
from
'
./SearchForm
'
;
import
TempleatModal
from
'
./TempleatModal
'
;
import
ServiceGoods
from
'
../ServiceGoods
'
;
import
InfoAudit
from
'
./
createModal/
infoAudit
'
;
import
InfoAudit
from
'
./infoAudit
'
;
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
...
...
@@ -44,9 +42,7 @@ class goodsManage extends Component {
priceInfo
:
{},
logVisible
:
false
,
previewVisible
:
false
,
createVisible
:
false
,
// 新增or编辑普通商品modal
updateStockVisible
:
false
,
initData
:
{},
createloading
:
false
,
specListData
:
[],
templeatModalVisible
:
false
,
...
...
@@ -126,64 +122,6 @@ class goodsManage extends Component {
this
.
handleSearch
();
};
onUpdateInfo
=
async
({
state
,
spuId
,
productType
})
=>
{
this
.
setState
({
createloading
:
true
,
});
const
{
data
,
msg
}
=
await
spuDetail
({
id
:
spuId
});
// spuId
if
(
data
)
{
data
.
state
=
state
;
data
.
pageProductType
=
productType
;
data
.
categoryId
=
data
.
thirdCategoryId
;
data
.
firstSpecId
=
data
.
skuList
[
0
].
firstSpecId
;
data
.
secondSpecId
=
data
.
skuList
[
0
].
secondSpecId
;
data
.
firstSpecName
=
data
.
skuList
[
0
].
firstSpec
;
data
.
secondSpecName
=
data
.
skuList
[
0
].
secondSpec
;
data
.
firstSpecList
=
[];
data
.
secondSpecList
=
[];
data
.
colorKeys
=
[];
data
.
carouseList
.
forEach
(
i
=>
{
if
(
i
.
specValue
)
{
data
.
colorKeys
.
push
(
i
.
specValue
);
}
});
data
.
skuList
.
forEach
(
i
=>
{
if
(
data
.
firstSpecList
.
indexOf
(
i
.
firstSpecValue
)
===
-
1
)
{
data
.
firstSpecList
.
push
(
`
${
i
.
firstSpecValue
}
`
);
}
if
(
i
.
secondSpecValue
&&
data
.
secondSpecList
.
indexOf
(
i
.
secondSpecValue
)
===
-
1
)
{
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
.
carouseList
.
forEach
(
i
=>
{
data
.
imageList
[
`
${
i
.
specValue
}
`
]
=
i
.
skuSpecImageList
||
[];
});
data
.
editData
=
sortBy
(
data
.
skuList
,
item
=>
item
.
firstSpecValue
);
this
.
setState
({
initData
:
data
,
createVisible
:
true
,
createloading
:
false
,
});
}
else
{
this
.
setState
({
createloading
:
false
,
});
notification
.
warning
({
message
:
msg
,
});
}
};
onLoad
=
error
=>
{
if
(
!
error
)
{
notification
.
success
({
message
:
'
操作成功
'
});
...
...
@@ -389,6 +327,11 @@ class goodsManage extends Component {
}
};
onEdit
=
()
=>
{
this
.
setState
({
visibleAuditModal
:
false
,
auditRow
:
{}
});
this
.
serviceVisbleChange
(
this
.
state
.
auditRow
);
};
render
()
{
const
{
goodsManage
:
{
tableData
=
{}
},
...
...
@@ -416,17 +359,6 @@ class goodsManage extends Component {
)
:
(
''
)
}
{
/* {canAddService ? (
<Button
type="primary"
className={styles.button}
onClick={() => this.serviceVisbleClose(true)}
>
新增服务类商品
</Button>
) : (
''
)} */
}
<
Spin
spinning=
{
this
.
state
.
createloading
}
>
<
Card
>
<
SearchForm
...
...
@@ -439,7 +371,6 @@ class goodsManage extends Component {
treeData=
{
this
.
state
.
treeData
}
shopList=
{
this
.
shopList
}
checkStock=
{
this
.
checkEnableUpdateStock
}
// addSpu={() => this.setState({ createVisible: true, initData: {} })}
selectNum=
{
selectedRowKeys
.
length
}
setArea=
{
(
isALL
,
type
)
=>
this
.
setArea
(
isALL
,
type
)
}
/>
...
...
@@ -496,20 +427,6 @@ class goodsManage extends Component {
title=
"商品预览"
></
iframe
>
</
Drawer
>
{
this
.
state
.
createVisible
&&
(
<
CreateModal
initData=
{
this
.
state
.
initData
}
visible=
{
this
.
state
.
createVisible
}
onCancel=
{
()
=>
{
this
.
setState
({
createVisible
:
false
,
initData
:
{}
});
}
}
query=
{
()
=>
this
.
handleSearch
()
}
shopList=
{
this
.
filterShopList
(
this
.
shopList
,
Object
.
keys
(
this
.
state
.
initData
).
length
)
}
treeData=
{
this
.
state
.
treeData
}
virtualTreeData=
{
this
.
state
.
virtualTreeData
}
specListData=
{
this
.
state
.
specListData
}
></
CreateModal
>
)
}
<
UpdateStock
visible=
{
this
.
state
.
updateStockVisible
}
...
...
@@ -542,22 +459,17 @@ class goodsManage extends Component {
/>
)
}
</
Spin
>
<
InfoAudit
visible=
{
this
.
state
.
visibleAuditModal
}
skuInfo=
{
this
.
state
.
auditRow
}
canEditable=
{
this
.
canEditable
}
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
);
}
}
}
/>
{
this
.
state
.
visibleAuditModal
&&
(
<
InfoAudit
visible=
{
this
.
state
.
visibleAuditModal
}
skuInfo=
{
this
.
state
.
auditRow
}
canEditable=
{
this
.
canEditable
}
onCancel=
{
()
=>
{
this
.
setState
({
visibleAuditModal
:
false
,
auditRow
:
{}
});
}
}
onEdit=
{
this
.
onEdit
}
/>
)
}
</
PageHeaderWrapper
>
);
}
...
...
src/pages/GoodsManage/
createModal/infoAudit
.jsx
→
src/pages/GoodsManage/
infoAudit/index
.jsx
View file @
f107556f
File moved
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