Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
黄庭坚
jinfa-platform
Commits
37a541c4
Commit
37a541c4
authored
Sep 08, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
cccabf4f
0fdb080f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
98 additions
and
59 deletions
+98
-59
addAttribute.tsx
src/pages/classAndProperty/attribute/addAttribute.tsx
+32
-5
addPropertyValue.tsx
...pages/classAndProperty/propertyValue/addPropertyValue.tsx
+1
-1
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+8
-2
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+1
-1
productDescFormDefault.tsx
...odity/products/addProductsItem/productDescFormDefault.tsx
+8
-0
directChannel.tsx
src/pages/commodity/products/directChannel.tsx
+13
-13
fastModifyPrice.tsx
src/pages/commodity/products/fastModifyPrice.tsx
+28
-28
index.ts
src/store/channelProduct/index.ts
+5
-6
index.ts
src/store/product/index.ts
+2
-3
No files found.
src/pages/classAndProperty/attribute/addAttribute.tsx
View file @
37a541c4
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
import
{
history
}
from
'umi'
import
{
Row
,
Col
,
Form
,
Input
,
Select
,
Popconfirm
,
Button
,
Card
,
Modal
,
Checkbox
,
Tooltip
,
message
,
Table
}
from
'antd'
;
import
{
Row
,
Col
,
Form
,
Input
,
Select
,
Popconfirm
,
Button
,
Card
,
Modal
,
Checkbox
,
Tooltip
,
message
,
Table
,
Radio
}
from
'antd'
;
import
{
LinkOutlined
,
QuestionCircleOutlined
,
InfoCircleOutlined
}
from
'@ant-design/icons'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
StandardTable
}
from
'god'
...
...
@@ -34,6 +34,7 @@ const AddAtttribute: React.FC<{}> = () => {
const
[
formValue
,
setFormValue
]
=
useState
<
any
>
({})
const
[
queryId
,
setQueryId
]
=
useState
(
''
)
// 判断编辑依据
const
[
isSee
,
setIsSee
]
=
useState
(
false
)
// 判断查看依据
const
[
isSpecial
,
setIsSpecial
]
=
useState
(
false
)
//特殊属性禁用展示方式
useEffect
(()
=>
{
const
{
location
}
=
history
...
...
@@ -134,11 +135,18 @@ const AddAtttribute: React.FC<{}> = () => {
setRoleVisible
(
true
)
let
menuFormData
=
menuForm
.
getFieldValue
(
'attribute'
)
console
.
log
(
formValue
,
'formValue'
,
menuFormData
)
//@ts-ignore
let
chooseKey
=
menuFormData
&&
menuFormData
.
id
||
null
setSelectedRowKeys
([
chooseKey
])
}
// 特殊属性切换
const
onChangeSpecial
=
(
e
,
type
)
=>
{
if
(
type
===
'isDate'
)
menuForm
.
setFieldsValue
({
isArea
:
false
})
if
(
type
===
'isArea'
)
menuForm
.
setFieldsValue
({
isDate
:
false
})
}
return
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
...
...
@@ -205,7 +213,7 @@ const AddAtttribute: React.FC<{}> = () => {
},
]
}
>
<
Select
placeholder=
"选择展示方式"
disabled=
{
isSee
}
>
<
Select
placeholder=
"选择展示方式"
disabled=
{
isSee
||
isSpecial
}
>
<
Option
value=
{
1
}
>
单选
</
Option
>
<
Option
value=
{
2
}
>
多选
</
Option
>
<
Option
value=
{
3
}
>
输入
</
Option
>
...
...
@@ -233,7 +241,8 @@ const AddAtttribute: React.FC<{}> = () => {
</Tooltip>
</Col> */
}
<
Col
span=
{
24
}
>
<
Form
.
Item
name=
"isPrice"
valuePropName=
"checked"
initialValue=
{
false
}
noStyle
><
Checkbox
disabled=
{
isSee
}
>
价格属性
</
Checkbox
></
Form
.
Item
>
{
/* 规格属性 -> 原价格属性 */
}
<
Form
.
Item
name=
"isPrice"
valuePropName=
"checked"
initialValue=
{
false
}
noStyle
><
Checkbox
disabled=
{
isSee
}
>
规格属性
</
Checkbox
></
Form
.
Item
>
<
Tooltip
title=
"勾选后对于此属性的每个属性值会在商品发布时按属性设置不同的价格!"
>
<
InfoCircleOutlined
/>
</
Tooltip
>
...
...
@@ -244,6 +253,23 @@ const AddAtttribute: React.FC<{}> = () => {
<
InfoCircleOutlined
/>
</
Tooltip
>
</
Col
>
{
/* 日期 地区属性 */
}
<
Col
span=
{
24
}
>
<
Form
.
Item
name=
"isDate"
valuePropName=
"checked"
initialValue=
{
false
}
noStyle
>
<
Checkbox
onChange=
{
(
e
)
=>
onChangeSpecial
(
e
,
'isDate'
)
}
disabled=
{
isSee
}
>
日期属性
</
Checkbox
>
</
Form
.
Item
>
<
Tooltip
title=
"勾选后此属性作为日期属性,日期属性的属性值无需在属性值管理中设置,系统自动取自然日作为属性值"
>
<
InfoCircleOutlined
/>
</
Tooltip
>
</
Col
>
<
Col
span=
{
24
}
>
<
Form
.
Item
name=
"isArea"
valuePropName=
"checked"
initialValue=
{
false
}
noStyle
>
<
Checkbox
onChange=
{
(
e
)
=>
onChangeSpecial
(
e
,
'isArea'
)
}
disabled=
{
isSee
}
>
地区属性
</
Checkbox
>
</
Form
.
Item
>
<
Tooltip
title=
"勾选后此属性作为地区属性,地区属性的属性值无需手工在属性值管理中设置,系统自动取地区数据作为属性值"
>
<
InfoCircleOutlined
/>
</
Tooltip
>
</
Col
>
</
Row
>
</
Form
.
Item
>
</
Col
>
...
...
@@ -333,12 +359,13 @@ const AddAtttribute: React.FC<{}> = () => {
</
Row
>
<
Modal
title=
"关联平台属性"
visible=
{
roleVisible
}
visible=
{
roleVisible
}
onOk=
{
handleSelectOk
}
onCancel=
{
()
=>
setRoleVisible
(
false
)
}
okText=
"确认"
cancelText=
"取消"
width=
{
704
}
destroyOnClose=
{
true
}
>
<
StandardTable
columns=
{
columns
}
...
...
src/pages/classAndProperty/propertyValue/addPropertyValue.tsx
View file @
37a541c4
...
...
@@ -181,7 +181,7 @@ const AddPropertyValue: React.FC<{}> = () => {
<
Col
span=
{
20
}
style=
{
{
display
:
'none'
}
}
><
Form
.
Item
name=
{
[
'attributeValue'
,
'id'
]
}
><
Input
disabled
/></
Form
.
Item
></
Col
>
<
Col
span=
{
20
}
><
Form
.
Item
name=
{
[
'attributeValue'
,
'value'
]
}
><
Input
disabled
/></
Form
.
Item
></
Col
>
<
Col
span=
{
4
}
>
<
Button
type=
"primary"
icon=
{
<
LinkOutlined
/>
}
style=
{
{
backgroundColor
:
'#6B778C'
,
borderColor
:
'#6B778C'
}
}
onClick=
{
handleLink
}
>
<
Button
type=
"primary"
icon=
{
<
LinkOutlined
/>
}
style=
{
{
backgroundColor
:
'#6B778C'
,
borderColor
:
'#6B778C'
}
}
onClick=
{
handleLink
}
disabled=
{
isSee
}
>
关联
</
Button
>
</
Col
>
...
...
src/pages/commodity/products/addProducts.tsx
View file @
37a541c4
...
...
@@ -262,18 +262,24 @@ const AddProducts: React.FC<{}> = (props) => {
}
})
}).
then
(
e
=>
{
console
.
log
(
e
,
'e'
)
setIsEnableCheck
(
false
)
if
(
e
)
message
.
error
(
e
.
message
)
console
.
log
(
e
,
'e'
)
}).
catch
(
error
=>
{
console
.
log
(
error
,
'_error'
)
setIsEnableCheck
(
false
)
if
(
error
.
messge
)
message
.
error
(
error
.
message
)
else
message
.
error
(
error
.
errorFields
[
0
].
errors
.
toString
())
console
.
log
(
error
,
'_error'
)
})
}
catch
(
e
){
setIsEnableCheck
(
false
)
message
.
error
(
e
.
message
)
console
.
log
(
e
,
'error'
)
}
}
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
37a541c4
...
...
@@ -342,7 +342,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
/**
* @description S
UK
组合
* @description S
KU
组合
* @param {[[],[]..]} chunks 传入不同的属性值数组进行组合
*/
const
SKUCombine
=
(
arr
:
any
[])
=>
{
...
...
src/pages/commodity/products/addProductsItem/productDescFormDefault.tsx
View file @
37a541c4
...
...
@@ -74,6 +74,14 @@ const ProductDescFormDefualt: React.FC<Iprops> = (props) => {
action
:
'/api/file/file/upload'
,
showUploadList
:
false
,
data
:
{
fileType
:
UPLOAD_TYPE
},
// beforeUpload(file) {
// console.log(file, 'video file')
// const isVideo = file.type === 'video/mp4' || file.type === 'image/png';
// if (!isVideo) {
// message.error('请上传视频文件!');
// }
// return isVideo
// },
onChange
(
info
)
{
if
(
info
.
file
.
status
!==
'uploading'
)
{
console
.
log
(
info
.
file
,
info
.
fileList
,
'video files'
);
...
...
src/pages/commodity/products/directChannel.tsx
View file @
37a541c4
...
...
@@ -140,19 +140,19 @@ const DirectChannel: React.FC<{}> = () => {
</>
:
''
}
{
(
record
.
status
===
4
)
&&
<>
<
Button
type=
'link'
onClick=
{
()
=>
clickUp
(
1
,
record
.
id
)
}
>
上架
</
Button
>
<
Dropdown
overlay=
{
<
Menu
>
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
clickModify
(
record
.
id
)
}
>
修改
</
Button
></
Menu
.
Item
>
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
clickDelete
(
record
.
id
)
}
>
删除
</
Button
></
Menu
.
Item
>
</
Menu
>
}
>
<
a
className=
"ant-dropdown-link"
onClick=
{
e
=>
e
.
preventDefault
()
}
>
更多
<
CaretDownOutlined
/>
</
a
>
</
Dropdown
>
</>
<>
<
Button
type=
'link'
onClick=
{
()
=>
clickUp
(
1
,
record
.
id
)
}
>
上架
</
Button
>
<
Dropdown
overlay=
{
<
Menu
>
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
clickModify
(
record
.
id
)
}
>
修改
</
Button
></
Menu
.
Item
>
<
Menu
.
Item
><
Button
type=
'link'
onClick=
{
()
=>
clickDelete
(
record
.
id
)
}
>
删除
</
Button
></
Menu
.
Item
>
</
Menu
>
}
>
<
a
className=
"ant-dropdown-link"
onClick=
{
e
=>
e
.
preventDefault
()
}
>
更多
<
CaretDownOutlined
/>
</
a
>
</
Dropdown
>
</>
}
</>
...
...
src/pages/commodity/products/fastModifyPrice.tsx
View file @
37a541c4
...
...
@@ -126,33 +126,33 @@ const FastModifyPrice: React.FC<{}> = () => {
component
=
(<
span
style=
{
{
padding
:
'2px 5px'
,
background
:
'rgba(244,245,247,1)'
,
borderRadius
:
'4px'
}
}
>
已下架
</
span
>)
return
component
},
filters
:
[
{
text
:
'待提交审核'
,
value
:
1
,
},
{
text
:
'待审核'
,
value
:
2
,
},
{
text
:
'审核通过'
,
value
:
3
,
},
{
text
:
'审核不通过'
,
value
:
4
,
},
{
text
:
'已上架'
,
value
:
5
,
},
{
text
:
'已下架'
,
value
:
6
,
}
],
onFilter
:
(
value
,
record
)
=>
record
.
status
===
value
,
//
filters: [
//
{
//
text: '待提交审核',
//
value: 1,
//
},
//
{
//
text: '待审核',
//
value: 2,
//
},
//
{
//
text: '审核通过',
//
value: 3,
//
},
//
{
//
text: '审核不通过',
//
value: 4,
//
},
//
{
//
text: '已上架',
//
value: 5,
//
},
//
{
//
text: '已下架',
//
value: 6,
//
}
//
],
//
onFilter: (value, record) => record.status === value,
},
{
title
:
'操作'
,
...
...
@@ -262,7 +262,7 @@ const FastModifyPrice: React.FC<{}> = () => {
console
.
log
(
_priceRange
)
// @ts-ignore
PublicApi
.
postProductCommodityUpdateCommodityPrice
({
commodityId
:
currentRow
.
id
,
unitPriceAndPicId
:
currentRow
.
commodityId
,
unitPrice
:
_priceRange
}).
then
(
res
=>
{
if
(
res
.
code
===
100
){
if
(
res
.
code
===
100
0
){
ref
.
current
.
reload
()
setModifyModal
(
false
)
}
...
...
src/store/channelProduct/index.ts
View file @
37a541c4
import
{
action
,
computed
,
observable
,
runInAction
}
from
'mobx'
import
{
IChannelProductModule
,
IRole
,
IChannel
}
from
'@/module/channelProductModule'
;
// mobx要用到的数据类型
import
{
GetProductChannelCommodityGetCommodityListResponseDetail
,
GetProductChannelCommodityGetCommodityUnitPriceResponse
}
from
'@/services'
;
import
{
IChannelProductModule
,
IRole
,
IChannel
}
from
'@/module/channelProductModule'
;
/**
* 渠道直采商品
...
...
@@ -8,12 +7,12 @@ import { GetProductChannelCommodityGetCommodityListResponseDetail, GetProductCha
class
ChannelProductStore
implements
IChannelProductModule
{
// 选择商品区块
@
observable
public
productSelectRowInStore
:
GetProductChannelCommodityGetCommodityListResponseDetail
=
null
;
@
observable
public
productSelectRowInStore
:
any
=
null
;
@
observable
public
priceType
:
number
=
null
@
observable
public
productName
:
string
=
null
@
observable
public
currentActiveKey
:
string
=
'1'
@
observable
public
currentOperateChannel
:
IChannel
=
null
@
observable
public
tableDataInSetPrice
:
GetProductChannelCommodityGetCommodityUnitPriceResponse
[]
=
null
@
observable
public
tableDataInSetPrice
:
any
[]
=
null
@
observable
public
selectedRole
:
IRole
=
null
...
...
@@ -26,7 +25,7 @@ class ChannelProductStore implements IChannelProductModule {
// }
@
action
.
bound
public
setProductSelectRowInStore
(
data
:
GetProductChannelCommodityGetCommodityListResponseDetail
)
{
public
setProductSelectRowInStore
(
data
:
any
)
{
this
.
productSelectRowInStore
=
data
;
}
...
...
@@ -51,7 +50,7 @@ class ChannelProductStore implements IChannelProductModule {
}
@
action
.
bound
public
setTableDataInSetPrice
(
data
:
GetProductChannelCommodityGetCommodityUnitPriceResponse
[]){
public
setTableDataInSetPrice
(
data
:
any
[]){
this
.
tableDataInSetPrice
=
data
;
}
...
...
src/store/product/index.ts
View file @
37a541c4
import
{
action
,
computed
,
observable
,
runInAction
}
from
'mobx'
import
{
IProductModule
,
IProductSelectAttribute
,
IBasicFormParam
,
IPriceAttributeParam
,
IOtherParam
,
IDecsParams
}
from
'@/module/productModule'
;
// mobx要用到的数据类型
import
{
GetProductGoodsGetGoodsListResponseDetail
}
from
'@/services'
;
class
ProductStore
implements
IProductModule
{
@
observable
public
attributeLists
:
any
[]
=
[];
@
observable
public
productName
:
string
=
""
;
@
observable
public
productSelectAttribute
:
IProductSelectAttribute
[]
=
[];
@
observable
public
selectedGoods
:
GetProductGoodsGetGoodsListResponseDetail
[]
=
[];
@
observable
public
selectedGoods
:
any
[]
=
[];
@
observable
public
tableDataSource
:
any
[]
=
[];
@
observable
public
priceAttributeParams
:
any
[]
=
[];
@
observable
public
productAttributeAndImageParams
:
any
[]
=
[];
...
...
@@ -94,7 +93,7 @@ class ProductStore implements IProductModule {
}
@
action
.
bound
public
setSelectedGoods
(
list
:
GetProductGoodsGetGoodsListResponseDetail
[])
{
public
setSelectedGoods
(
list
:
any
[])
{
this
.
selectedGoods
=
list
;
}
...
...
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