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
linweijiong
jinfa-platform
Commits
9127cbda
Commit
9127cbda
authored
Sep 15, 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
dd7c9740
54043d96
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
61 additions
and
29 deletions
+61
-29
index.tsx
src/pages/commodity/goods/index.tsx
+1
-0
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+1
-1
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+30
-17
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+3
-3
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+1
-1
directChannel.tsx
src/pages/commodity/products/directChannel.tsx
+20
-2
fastModifyPrice.tsx
src/pages/commodity/products/fastModifyPrice.tsx
+2
-2
index.tsx
src/pages/commodity/products/index.tsx
+2
-2
index.tsx
src/pages/trademark/index.tsx
+1
-1
No files found.
src/pages/commodity/goods/index.tsx
View file @
9127cbda
...
@@ -110,6 +110,7 @@ const Goods: React.FC<{}> = () => {
...
@@ -110,6 +110,7 @@ const Goods: React.FC<{}> = () => {
title
:
'成单价'
,
title
:
'成单价'
,
dataIndex
:
'costPrice'
,
dataIndex
:
'costPrice'
,
key
:
'costPrice'
,
key
:
'costPrice'
,
render
:
text
=>
`¥
${
text
}
`
},
},
{
{
title
:
'导入批次'
,
title
:
'导入批次'
,
...
...
src/pages/commodity/products/addProducts.tsx
View file @
9127cbda
...
@@ -108,7 +108,7 @@ const AddProducts: React.FC<{}> = (props) => {
...
@@ -108,7 +108,7 @@ const AddProducts: React.FC<{}> = (props) => {
_itme
.
customerAttribute
=
{
id
:
_itme
.
customerAttributeId
}
_itme
.
customerAttribute
=
{
id
:
_itme
.
customerAttributeId
}
delete
_itme
.
attributeName
delete
_itme
.
attributeName
delete
_itme
.
isPrice
delete
_itme
.
isPrice
delete
_itme
.
customerAttributeId
// delete _itme.customerAttributeId
})
})
let
_bacsicForm
=
{...
values
[
0
]}
let
_bacsicForm
=
{...
values
[
0
]}
if
(
values
.
length
>
0
){
if
(
values
.
length
>
0
){
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
9127cbda
...
@@ -317,33 +317,46 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
...
@@ -317,33 +317,46 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const
constructedPrarams
=
()
=>
{
const
constructedPrarams
=
()
=>
{
let
_paramsArray
:
any
[]
=
[];
let
_paramsArray
:
any
[]
=
[];
// console.log('生成传输数据', combineAttributeArray, attributeObjArr, attributeValObjArr, tableDataSource)
// console.log('生成传输数据', combineAttributeArray, attributeObjArr, attributeValObjArr, tableDataSource)
Array
.
isArray
(
combineAttributeArray
)
?
combineAttributeArray
.
map
((
item
,
index
)
=>
{
// 非数组情况下默认无组合 从table数据中获取 // 当属性减少的时候 这个combine数组还是之前的
Array
.
isArray
(
combineAttributeArray
)
?
combineAttributeArray
.
map
((
item
,
index
)
=>
{
// 非数组情况下默认无组合 从table数据中获取 // 当属性减少的时候 这个combine数组还是之前的
/* code1 */
let
_tempArr
:
any
=
[]
let
_tempArr
:
any
=
[]
Array
.
isArray
(
item
)
?
item
.
map
((
_item
,
_index
)
=>
{
console
.
log
(
item
,
'0'
)
Array
.
isArray
(
item
)
?
item
.
map
((
_item
,
_index
)
=>
{
/* code2 */
console
.
log
(
item
,
_item
,
'1'
)
let
_tempObject
:
any
=
{};
let
_tempObject
:
any
=
{};
/* 新格式 */
_tempObject
.
customerAttribute
=
{
_tempObject
.
customerAttribute
=
{
id
:
attributeObjArr
[
_index
].
customerAttributeId
,
id
:
attributeObjArr
[
_index
].
customerAttributeId
,
name
:
attributeObjArr
[
_index
].
attributeName
name
:
attributeObjArr
[
_index
].
attributeName
}
}
_tempObject
.
customerAttributeValue
=
{
_tempObject
.
customerAttributeValue
=
{
id
:
attributeValObjArr
.
map
(
item
=>
item
.
find
(
_
=>
_
.
value
===
_item
)).
filter
(
__
=>
__
)[
0
].
id
,
id
:
attributeValObjArr
.
map
(
__item
=>
__
item
.
find
(
_
=>
_
.
value
===
_item
)).
filter
(
__
=>
__
)[
0
].
id
,
value
:
item
[
_index
]
value
:
item
[
_index
]
}
}
_tempArr
.
push
(
_tempObject
)
_tempArr
.
push
(
_tempObject
)
})
:
_tempArr
.
push
({
})
:
(
/* code3 */
/* 新格式 */
// ** 可能是单一多选 attributeValObjArr可能为多个
customerAttribute
:
{
_tempArr
.
push
({
id
:
attributeObjArr
[
0
].
customerAttributeId
,
customerAttribute
:
{
name
:
attributeObjArr
[
0
].
attributeName
id
:
attributeObjArr
[
0
].
customerAttributeId
,
},
name
:
attributeObjArr
[
0
].
attributeName
customerAttributeValue
:
{
},
id
:
attributeValObjArr
[
0
][
0
].
id
,
customerAttributeValue
:
{
value
:
item
.
toString
()
id
:
attributeValObjArr
[
0
][
index
].
id
,
// 只有一行属性,多选情况下
}
value
:
item
.
toString
()
})
}
_paramsArray
.
push
({
goodsId
:
_tableDataSource
[
index
]
?
_tableDataSource
[
index
][
'对应货品'
]
:
0
,
attributeAndValueList
:
_tempArr
,
unitPrice
:
_tableDataSource
[
index
]
&&
_tableDataSource
[
index
][
'单价'
]})
/*带上货品id 带上单价*/
})
})
:
_paramsArray
.
push
({
goodsId
:
_tableDataSource
[
0
]
?
_tableDataSource
[
0
][
'对应货品'
]
:
0
,
attributeAndValueList
:
[],
unitPrice
:
_tableDataSource
[
0
]
&&
_tableDataSource
[
0
][
'单价'
]})
/*带上货品id 带上单价*/
)
/* code3 end */
/* code2 end */
_paramsArray
.
push
({
goodsId
:
_tableDataSource
[
index
]
?
_tableDataSource
[
index
][
'对应货品'
]
:
0
,
attributeAndValueList
:
_tempArr
,
unitPrice
:
_tableDataSource
[
index
]
&&
_tableDataSource
[
index
][
'单价'
]
})
/*带上货品id 带上单价*/
})
:
_paramsArray
.
push
({
goodsId
:
_tableDataSource
[
0
]
?
_tableDataSource
[
0
][
'对应货品'
]
:
0
,
attributeAndValueList
:
[],
unitPrice
:
_tableDataSource
[
0
]
&&
_tableDataSource
[
0
][
'单价'
]
})
/*带上货品id 带上单价*/
/* code1 end */
setPriceAttributeParams
(
_paramsArray
)
setPriceAttributeParams
(
_paramsArray
)
// console.log(_paramsArray,'params')
// console.log(_paramsArray,'params')
}
}
...
...
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
9127cbda
...
@@ -129,8 +129,8 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
...
@@ -129,8 +129,8 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
// 遍历 排空
// 遍历 排空
let
resultParams
=
_resultParams
.
filter
((
_item
:
any
)
=>
_item
.
customerAttributeValueList
.
length
!=
0
)
let
resultParams
=
_resultParams
.
filter
((
_item
:
any
)
=>
_item
.
customerAttributeValueList
.
length
!=
0
)
//
console.log(resultParams,'resultParams') // 最终传输数据
console
.
log
(
resultParams
,
'resultParams'
)
// 最终传输数据
setProductSelectAttribute
(
resultParams
)
//......存在数据冗余 导致价格列表属性出错
setProductSelectAttribute
(
resultParams
)
}
}
/* 编辑情况下,利用商品信息中的属性值转换为结果参数,用于后续表格生成 */
/* 编辑情况下,利用商品信息中的属性值转换为结果参数,用于后续表格生成 */
...
@@ -144,7 +144,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
...
@@ -144,7 +144,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
isPrice
:
attributeLists
.
filter
(
_item
=>
_item
.
name
===
item
.
customerAttribute
.
name
)[
0
]?.
isPrice
isPrice
:
attributeLists
.
filter
(
_item
=>
_item
.
name
===
item
.
customerAttribute
.
name
)[
0
]?.
isPrice
}
}
})
})
//
console.log(_selectAttributeByEdit, '__selectAttributeByEdit__', attributeLists)
console
.
log
(
_selectAttributeByEdit
,
'__selectAttributeByEdit__'
,
attributeLists
)
paramsArray
=
_selectAttributeByEdit
paramsArray
=
_selectAttributeByEdit
setProductSelectAttribute
(
_selectAttributeByEdit
)
setProductSelectAttribute
(
_selectAttributeByEdit
)
}
}
...
...
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
9127cbda
...
@@ -124,7 +124,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
...
@@ -124,7 +124,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
let
_URL
=
window
.
URL
||
window
.
webkitURL
;
let
_URL
=
window
.
URL
||
window
.
webkitURL
;
let
img
=
new
Image
();
let
img
=
new
Image
();
img
.
onload
=
function
()
{
img
.
onload
=
function
()
{
let
valid
=
img
.
width
<
width
&&
img
.
height
<
height
;
let
valid
=
img
.
width
<
=
width
&&
img
.
height
<=
height
;
valid
?
resolve
()
:
reject
();
valid
?
resolve
()
:
reject
();
};
};
img
.
src
=
_URL
.
createObjectURL
(
file
);
img
.
src
=
_URL
.
createObjectURL
(
file
);
...
...
src/pages/commodity/products/directChannel.tsx
View file @
9127cbda
...
@@ -93,7 +93,25 @@ const DirectChannel: React.FC<{}> = () => {
...
@@ -93,7 +93,25 @@ const DirectChannel: React.FC<{}> = () => {
title
:
'价格'
,
title
:
'价格'
,
dataIndex
:
[
'channelCommodity'
,
'commodity'
,
'min'
],
dataIndex
:
[
'channelCommodity'
,
'commodity'
,
'min'
],
key
:
'id'
,
key
:
'id'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<>
¥
{
text
}
~ ¥
{
record
.
channelCommodity
.
commodity
.
max
}
</>
render
:
(
text
:
any
,
reocrd
:
any
)
=>
{
let
min
=
reocrd
.
channelCommodity
.
commodity
.
min
let
type
=
reocrd
.
channelCommodity
.
commodity
.
priceType
let
max
=
reocrd
.
channelCommodity
.
commodity
.
max
if
(
type
===
1
){
if
(
max
===
min
)
return
<>
¥
{
min
}
</>
else
return
<>
¥
{
min
}
~ ¥
{
max
}
</>
}
if
(
type
===
3
){
if
(
max
===
min
)
return
<>
{
min
}
</>
else
return
<>
{
min
}
~
{
max
}
</>
}
if
(
type
===
2
)
return
null
}
},
},
{
{
title
:
'渠道会员角色'
,
title
:
'渠道会员角色'
,
...
@@ -101,7 +119,7 @@ const DirectChannel: React.FC<{}> = () => {
...
@@ -101,7 +119,7 @@ const DirectChannel: React.FC<{}> = () => {
key
:
'memberRoleName'
,
key
:
'memberRoleName'
,
},
},
{
{
title
:
'适用
会员
'
,
title
:
'适用
渠道
'
,
dataIndex
:
'memberName'
,
dataIndex
:
'memberName'
,
key
:
'memberName'
,
key
:
'memberName'
,
},
},
...
...
src/pages/commodity/products/fastModifyPrice.tsx
View file @
9127cbda
...
@@ -100,13 +100,13 @@ const FastModifyPrice: React.FC<{}> = () => {
...
@@ -100,13 +100,13 @@ const FastModifyPrice: React.FC<{}> = () => {
key
:
'min'
,
key
:
'min'
,
render
:
(
text
:
any
,
reocrd
:
any
)
=>
{
render
:
(
text
:
any
,
reocrd
:
any
)
=>
{
if
(
reocrd
.
priceType
===
1
){
if
(
reocrd
.
priceType
===
1
){
if
(
reocrd
.
m
in
===
reocrd
.
min
)
if
(
reocrd
.
m
ax
===
reocrd
.
min
)
return
<>
¥
{
reocrd
.
min
}
</>
return
<>
¥
{
reocrd
.
min
}
</>
else
else
return
<>
¥
{
reocrd
.
min
}
~ ¥
{
reocrd
.
max
}
</>
return
<>
¥
{
reocrd
.
min
}
~ ¥
{
reocrd
.
max
}
</>
}
}
if
(
reocrd
.
priceType
===
3
){
if
(
reocrd
.
priceType
===
3
){
if
(
reocrd
.
m
in
===
reocrd
.
min
)
if
(
reocrd
.
m
ax
===
reocrd
.
min
)
return
<>
{
reocrd
.
min
}
</>
return
<>
{
reocrd
.
min
}
</>
else
else
return
<>
{
reocrd
.
min
}
~
{
reocrd
.
max
}
</>
return
<>
{
reocrd
.
min
}
~
{
reocrd
.
max
}
</>
...
...
src/pages/commodity/products/index.tsx
View file @
9127cbda
...
@@ -143,13 +143,13 @@ const Products: React.FC<{}> = () => {
...
@@ -143,13 +143,13 @@ const Products: React.FC<{}> = () => {
key
:
'min'
,
key
:
'min'
,
render
:
(
text
:
any
,
reocrd
:
any
)
=>
{
render
:
(
text
:
any
,
reocrd
:
any
)
=>
{
if
(
reocrd
.
priceType
===
1
){
if
(
reocrd
.
priceType
===
1
){
if
(
reocrd
.
m
in
===
reocrd
.
min
)
if
(
reocrd
.
m
ax
===
reocrd
.
min
)
return
<>
¥
{
reocrd
.
min
}
</>
return
<>
¥
{
reocrd
.
min
}
</>
else
else
return
<>
¥
{
reocrd
.
min
}
~ ¥
{
reocrd
.
max
}
</>
return
<>
¥
{
reocrd
.
min
}
~ ¥
{
reocrd
.
max
}
</>
}
}
if
(
reocrd
.
priceType
===
3
){
if
(
reocrd
.
priceType
===
3
){
if
(
reocrd
.
m
in
===
reocrd
.
min
)
if
(
reocrd
.
m
ax
===
reocrd
.
min
)
return
<>
{
reocrd
.
min
}
</>
return
<>
{
reocrd
.
min
}
</>
else
else
return
<>
{
reocrd
.
min
}
~
{
reocrd
.
max
}
</>
return
<>
{
reocrd
.
min
}
~
{
reocrd
.
max
}
</>
...
...
src/pages/trademark/index.tsx
View file @
9127cbda
...
@@ -40,7 +40,7 @@ const Trademark: React.FC<{}> = () => {
...
@@ -40,7 +40,7 @@ const Trademark: React.FC<{}> = () => {
render
:
(
text
:
any
,
record
:
any
)
=>
<
span
className=
"commonPickColor"
onClick=
{
()
=>
handleSee
(
record
)
}
>
{
text
}
<
EyeOutlined
/></
span
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
span
className=
"commonPickColor"
onClick=
{
()
=>
handleSee
(
record
)
}
>
{
text
}
<
EyeOutlined
/></
span
>
},
},
{
{
title
:
'申请时间'
,
title
:
'申请
审核
时间'
,
dataIndex
:
'applyTime'
,
dataIndex
:
'applyTime'
,
key
:
'applyTime'
,
key
:
'applyTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
text
&&
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
render
:
(
text
:
any
,
record
:
any
)
=>
text
&&
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
...
...
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