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
ab61c233
Commit
ab61c233
authored
Sep 02, 2020
by
前端-许佳敏
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
2582e6fe
847ea846
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
132 additions
and
115 deletions
+132
-115
global.d.ts~668eafb4417a6b5f478f8f12a3735f4ec118a5f6
...nfig/global.d.ts~668eafb4417a6b5f478f8f12a3735f4ec118a5f6
+1
-7
addAttribute.tsx
src/pages/classAndProperty/attribute/addAttribute.tsx
+1
-5
index.tsx
src/pages/classAndProperty/categoryAttributes/index.tsx
+11
-21
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+49
-17
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+29
-12
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+23
-47
productModal.tsx
...ges/transaction/enquirySubmit/components/productModal.tsx
+16
-4
detail.tsx
src/pages/transaction/enquirySubmit/toSubmit/detail.tsx
+0
-0
detailFormColumnType.ts
...ransaction/enquirySubmit/toSubmit/detailFormColumnType.ts
+2
-2
No files found.
src/global/config/global.d.ts
→
src/global/config/global.d.ts
~668eafb4417a6b5f478f8f12a3735f4ec118a5f6
View file @
ab61c233
...
...
@@ -28,15 +28,9 @@ export interface ShopInfo {
url: string;
}
export
interface
OrderMode
{
value
:
number
;
label
:
string
;
platformType
:
number
;
}
export interface Web {
shopInfo: ShopInfo[];
orderMode
:
OrderMode
[];
orderMode:
any
[];
}
export interface CountryList {
...
...
src/pages/classAndProperty/attribute/addAttribute.tsx
View file @
ab61c233
...
...
@@ -91,24 +91,20 @@ const AddAtttribute: React.FC<{}> = () => {
{
title
:
'ID'
,
dataIndex
:
'id'
,
align
:
'center'
,
key
:
'id'
,
},
{
title
:
'属性名称'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
,
},
{
title
:
'属性组名'
,
dataIndex
:
'groupName'
,
align
:
'center'
,
key
:
'groupName'
,
},
{
title
:
'展示方式'
,
align
:
'center'
,
dataIndex
:
'type'
,
key
:
'type'
,
render
:
(
text
:
number
)
=>
{
...
...
@@ -118,7 +114,6 @@ const AddAtttribute: React.FC<{}> = () => {
},
{
title
:
'是否必填'
,
align
:
'center'
,
dataIndex
:
'isEmpty'
,
key
:
'isEmpty'
,
render
:
(
text
:
boolean
)
=>
text
?
'是'
:
'否'
...
...
@@ -343,6 +338,7 @@ const AddAtttribute: React.FC<{}> = () => {
onCancel=
{
()
=>
setRoleVisible
(
false
)
}
okText=
"确认"
cancelText=
"取消"
width=
{
704
}
>
<
StandardTable
columns=
{
columns
}
...
...
src/pages/classAndProperty/categoryAttributes/index.tsx
View file @
ab61c233
...
...
@@ -57,13 +57,13 @@ const CategoryAttributes: React.FC<{}> = () => {
// 获取选中项的关联属性列表
useEffect
(()
=>
{
if
(
selectKey
)
ref
.
current
.
reload
({
current
:
1
,
pageSize
:
10
,
name
:
''
,
categoryId
:
selectKey
})
ref
.
current
.
reload
({
current
:
1
,
pageSize
:
10
,
name
:
''
,
categoryId
:
selectKey
,
isByCategory
:
true
})
},
[
selectKey
])
const
fetchLinkAttributeData
=
(
params
:
any
)
=>
{
console
.
log
(
params
,
'params'
)
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getProductCustomerGetCustomerCategoryAttributeList
({...
params
,
categoryId
:
selectKey
,
name
:
params
.
name
||
''
}).
then
(
res
=>
{
PublicApi
.
getProductCustomerGetCustomerCategoryAttributeList
({...
params
,
categoryId
:
selectKey
,
name
:
params
.
name
||
''
,
isByCategory
:
true
}).
then
(
res
=>
{
resolve
(
res
.
data
)
setLinkTableRowData
(
res
.
data
.
data
)
})
...
...
@@ -74,7 +74,10 @@ const CategoryAttributes: React.FC<{}> = () => {
const
fetchAttributeData
=
(
params
:
any
)
=>
{
console
.
log
(
params
,
'params'
)
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getProductCustomerGetCustomerAttributeList
({
...
params
,
name
:
params
.
name
||
''
}).
then
(
res
=>
{
// PublicApi.getProductCustomerGetCustomerAttributeList({ ...params, name: params.name || '' }).then(res=>{
// resolve(res.data)
// })
PublicApi
.
getProductCustomerGetCustomerCategoryAttributeList
({...
params
,
categoryId
:
selectKey
,
name
:
params
.
name
||
''
,
isByCategory
:
false
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
...
...
@@ -86,12 +89,10 @@ const CategoryAttributes: React.FC<{}> = () => {
const
handleSelectOk
=
()
=>
{
setRoleVisible
(
false
)
// if (goodsRowCtl.selectRow.length) {
PublicApi
.
postProductCustomerSaveCustomerCategoryAttribute
({
customerCategoryId
:
selectKey
,
customerAttributeIds
:
goodsRowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setTimeout
(()
=>
ref
.
current
.
reload
(),
500
)
})
// }
PublicApi
.
postProductCustomerSaveCustomerCategoryAttribute
({
customerCategoryId
:
selectKey
,
customerAttributeIds
:
goodsRowCtl
.
selectedRowKeys
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setTimeout
(()
=>
ref
.
current
.
reload
(),
500
)
})
}
const
handleSelectCancel
=
()
=>
{
setRoleVisible
(
false
)
...
...
@@ -102,26 +103,22 @@ const CategoryAttributes: React.FC<{}> = () => {
{
title
:
'ID'
,
dataIndex
:
'id'
,
align
:
'center'
,
key
:
'id'
,
},
{
title
:
'属性名称'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
span
className=
"commonPickColor"
onClick=
{
()
=>
handleSee
(
record
)
}
>
{
text
}
<
EyeOutlined
/></
span
>
},
{
title
:
'属性组名称'
,
dataIndex
:
'groupName'
,
align
:
'center'
,
key
:
'groupName'
,
},
{
title
:
'展示方式'
,
dataIndex
:
'type'
,
align
:
'center'
,
key
:
'type'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
_txt
:
string
=
''
...
...
@@ -138,13 +135,11 @@ const CategoryAttributes: React.FC<{}> = () => {
{
title
:
'是否必填'
,
dataIndex
:
'isEmpty'
,
align
:
'center'
,
key
:
'isEmpty'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(<>
{
text
?
'是'
:
'否'
}
</>)
},
{
title
:
'状态'
,
align
:
'center'
,
dataIndex
:
'isEnable'
,
key
:
'isEnable'
,
render
:
(
text
:
any
,
record
:
any
)
=>
text
?
'有效'
:
'无效'
...
...
@@ -152,7 +147,6 @@ const CategoryAttributes: React.FC<{}> = () => {
{
title
:
'操作'
,
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<>
...
...
@@ -167,25 +161,21 @@ const CategoryAttributes: React.FC<{}> = () => {
{
title
:
'ID'
,
dataIndex
:
'id'
,
align
:
'center'
,
key
:
'id'
,
},
{
title
:
'属性名称'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
,
},
{
title
:
'属性组名称'
,
dataIndex
:
'groupName'
,
align
:
'center'
,
key
:
'groupName'
,
},
{
title
:
'展示方式'
,
dataIndex
:
'type'
,
align
:
'center'
,
key
:
'type'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
_txt
:
string
=
''
...
...
@@ -202,7 +192,6 @@ const CategoryAttributes: React.FC<{}> = () => {
{
title
:
'是否必填'
,
dataIndex
:
'isEmpty'
,
align
:
'center'
,
key
:
'isEmpty'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(<>
{
text
?
'是'
:
'否'
}
</>)
}
...
...
@@ -325,6 +314,7 @@ const CategoryAttributes: React.FC<{}> = () => {
okText=
"确认"
cancelText=
"取消"
destroyOnClose=
{
true
}
width=
{
704
}
>
<
StandardTable
columns=
{
columnsLink
}
...
...
src/pages/commodity/products/addProducts.tsx
View file @
ab61c233
...
...
@@ -27,6 +27,7 @@ const AddProducts: React.FC<{}> = (props) => {
const
[
responseId
,
setReponseId
]
=
useState
<
number
>
(
null
)
const
[
attributeList
,
setAttributeList
]
=
useState
<
any
[]
>
([])
const
[
clickTabIndex
,
setClickTabIndex
]
=
useState
<
string
[]
>
([
'1'
])
const
[
isDisableSaveBtn
,
setIsDisableSaveBtn
]
=
useState
<
boolean
>
(
false
)
let
[
formRefs
,
setFormRefs
]
=
useState
([])
//子form的ref数组
const
{
ProductStore
}
=
store
const
{
...
...
@@ -64,6 +65,7 @@ const AddProducts: React.FC<{}> = (props) => {
},
[])
const
onSave
=
()
=>
{
setIsDisableSaveBtn
(
true
)
const
{
id
}
=
history
.
location
.
query
if
(
formRefs
.
length
>
0
){
try
{
...
...
@@ -128,29 +130,36 @@ const AddProducts: React.FC<{}> = (props) => {
/** 没有点击tab项做修改处理时 */
// 如果没有点击商品图片第"5"项 不做校验
if
(
clickTabIndex
.
indexOf
(
"5"
)
!==
-
1
){
let
_productAttributeAndImageParams
=
[...
productAttributeAndImageParams
]
try
{
if
(
productAttributeAndImageParams
.
length
>
0
){
productAttributeAndImageParams
.
map
(
_item
=>
{
if
(
_
productAttributeAndImageParams
.
length
>
0
){
_
productAttributeAndImageParams
.
map
(
_item
=>
{
console
.
log
(
_item
,
'_item'
)
_item
.
goods
=
{
id
:
_item
.
goodsId
}
// id为0表示无货品
delete
_item
.
goodsId
if
(
_item
.
attributeAndValueList
.
length
>
0
){
_item
.
attributeAndValueList
.
map
(
__item
=>
{
delete
__item
.
customerAttributeName
// **** 新字段结构变更
__item
.
customerAttribute
=
{
id
:
__item
.
customerAttributeId
}
__item
.
customerAttributeValue
=
{
id
:
__item
.
id
,
value
:
__item
.
value
}
delete
__item
.
id
delete
__item
.
value
delete
__item
.
customerAttributeId
})
}
//
if(_item.attributeAndValueList.length>0){
//
_item.attributeAndValueList.map(__item => {
//
delete __item.customerAttributeName
//
// **** 新字段结构变更
//
__item.customerAttribute = { id: __item.customerAttributeId }
//
__item.customerAttributeValue = { id: __item.id, value: __item.value }
//
delete __item.id
//
delete __item.value
//
delete __item.customerAttributeId
//
})
//
}
if
(
_item
.
commodityPic
.
length
>
0
){
// 编辑情况下兼顾手动添加图片列表属性
console
.
log
(
'不一定'
)
_item
.
commodityPic
=
_item
.
commodityPic
.
map
(
__item
=>
__item
?.
response
?.
data
||
__item
?.
url
)
// 多种属性组合 所有属性共用的情况下 每一行都是用第一项
if
(
isAllAttributePic
)
_item
.
commodityPic
=
_productAttributeAndImageParams
[
0
].
commodityPic
}
else
{
if
(
isAllAttributePic
&&
productAttributeAndImageParams
[
0
].
commodityPic
.
length
>
0
)
//处理所有属性共用
_item
.
commodityPic
=
productAttributeAndImageParams
[
0
].
commodityPic
if
(
isAllAttributePic
&&
_productAttributeAndImageParams
[
0
].
commodityPic
.
length
>
0
){
//处理所有属性共用
console
.
log
(
'所有属性共用'
)
_item
.
commodityPic
=
_productAttributeAndImageParams
[
0
].
commodityPic
}
else
throw
new
Error
(
'每项请至少上传一张商品图片!'
)
}
...
...
@@ -161,9 +170,26 @@ const AddProducts: React.FC<{}> = (props) => {
}
catch
(
e
){
return
e
}
_params
.
unitPriceAndPicList
=
productAttributeAndImageParams
_params
.
unitPriceAndPicList
=
_
productAttributeAndImageParams
}
else
{
// 编辑 没有点击商品图片
_params
.
unitPriceAndPicList
=
productInfoByEdit
.
unitPriceAndPicList
if
(
clickTabIndex
.
indexOf
(
"4"
)
!==
-
1
){
// 没有点击图片单单修改了商品价格 取原有的图片和新的价格合成
console
.
log
(
'仅修改商品价格'
)
_params
.
unitPriceAndPicList
=
priceAttributeParams
.
map
((
item
,
index
)
=>
{
return
{
goods
:
{
id
:
item
.
goodsId
},
attributeAndValueList
:
item
.
attributeAndValueList
,
// .map(_item => {
// return {
// customerAttribute: { id: _item.customerAttributeId },
// customerAttributeValue: { id: _item.id, value: _item.value }
// }
// }),
unitPrice
:
item
.
unitPrice
,
commodityPic
:
productInfoByEdit
.
unitPriceAndPicList
[
index
].
commodityPic
}
})
}
}
if
(
clickTabIndex
.
indexOf
(
"3"
)
===-
1
)
// 商品属性
_params
.
commodityAttributeList
=
productInfoByEdit
.
commodityAttributeList
...
...
@@ -194,10 +220,16 @@ const AddProducts: React.FC<{}> = (props) => {
}
catch
(
e
){
return
e
}
// 移除混入的id数字类的键值项
let
numberKeys
=
Object
.
keys
(
_params
).
map
(
_
=>
Number
(
_
)).
filter
(
Boolean
)
if
(
numberKeys
.
length
>
0
)
numberKeys
.
map
(
item
=>
delete
_params
[
item
])
console
.
log
(
_params
,
'params'
)
PublicApi
.
postProductCommoditySaveOrUpdateCommodity
(
_params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
setIsEnableCheck
(
false
)
setIsDisableSaveBtn
(
false
)
setReponseId
(
res
.
data
)
history
.
goBack
()
}
...
...
@@ -234,7 +266,7 @@ const AddProducts: React.FC<{}> = (props) => {
title=
{
history
.
location
.
query
.
id
?
'编辑商品'
:
'新建商品'
}
extra=
{
[
<
Button
key=
"2"
disabled=
{
isEnableCheck
}
onClick=
{
handleApplyCheck
}
>
直接提交审核
</
Button
>,
<
Button
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
onClick=
{
onSave
}
>
<
Button
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
onClick=
{
onSave
}
disabled=
{
isDisableSaveBtn
}
>
保存
</
Button
>,
]
}
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
ab61c233
...
...
@@ -199,11 +199,11 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
else
if
(
history
.
location
.
query
?.
id
){
// 此时没有货品并且处于编辑状态 取接口返回的数据
let
_goods
:
any
[]
=
Object
.
values
(
productInfoByEdit
.
unitPriceAndPicList
.
map
(
_
=>
_
.
goods
))
if
(
_goods
.
indexOf
(
null
)
===-
1
){
let
goodsInApi
:
any
=
Object
.
values
(
_goods
)
.
reduce
((
item
,
next
)
=>
{
let
goodsInApi
:
any
=
Object
.
values
(
_goods
.
reduce
((
item
,
next
)
=>
{
item
[
next
.
id
]
=
next
return
item
},{})
},{})
)
_col
.
push
({
title
:
'对应货品'
,
dataIndex
:
'对应货品'
,
...
...
@@ -312,17 +312,34 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
let
_tempArr
:
any
=
[]
Array
.
isArray
(
item
)
?
item
.
map
((
_item
,
_index
)
=>
{
let
_tempObject
:
any
=
{};
_tempObject
.
customerAttributeId
=
attributeObjArr
[
_index
].
customerAttributeId
_tempObject
.
customerAttributeName
=
attributeObjArr
[
_index
].
attributeName
// _tempObject.id = attributeValObjArr[_index].find(__item=>__item.value===item[_index]).id /** 解决原有 若属性或者属性值顺序错乱无法找到正确值的问题 */
_tempObject
.
id
=
attributeValObjArr
.
map
(
item
=>
item
.
find
(
_
=>
_
.
value
===
_item
)).
filter
(
__
=>
__
)[
0
].
id
_tempObject
.
value
=
item
[
_index
]
// _tempObject.customerAttributeId = attributeObjArr[_index].customerAttributeId
// _tempObject.customerAttributeName = attributeObjArr[_index].attributeName
// _tempObject.id = attributeValObjArr.map(item =>item.find(_ => _.value===_item)).filter(__ => __)[0].id
// _tempObject.value = item[_index]
/* 新格式 */
_tempObject
.
customerAttribute
=
{
id
:
attributeObjArr
[
_index
].
customerAttributeId
,
name
:
attributeObjArr
[
_index
].
attributeName
}
_tempObject
.
customerAttributeValue
=
{
id
:
attributeValObjArr
.
map
(
item
=>
item
.
find
(
_
=>
_
.
value
===
_item
)).
filter
(
__
=>
__
)[
0
].
id
,
value
:
item
[
_index
]
}
_tempArr
.
push
(
_tempObject
)
})
:
_tempArr
.
push
({
customerAttributeId
:
attributeObjArr
[
0
].
customerAttributeId
,
customerAttributeName
:
attributeObjArr
[
0
].
attributeName
,
id
:
attributeValObjArr
[
0
][
0
].
id
,
value
:
item
.
toString
()
// customerAttributeId: attributeObjArr[0].customerAttributeId,
// customerAttributeName: attributeObjArr[0].attributeName,
// id: attributeValObjArr[0][0].id,
// value: item.toString()
/* 新格式 */
customerAttribute
:
{
id
:
attributeObjArr
[
0
].
customerAttributeId
,
name
:
attributeObjArr
[
0
].
attributeName
},
customerAttributeValue
:
{
id
:
attributeValObjArr
[
0
][
0
].
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 带上单价*/
...
...
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
ab61c233
...
...
@@ -26,20 +26,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
const
[
defaultChecked
,
setDefaultChecked
]
=
useState
(
-
1
)
const
[
priceAttributeParamsByRender
,
setPriceAttributeParamsByRender
]
=
useState
<
any
[]
>
([])
const
[
commonImageList
,
setCommonImageList
]
=
useState
<
any
>
([
// {
// uid: '-1',
// name: 'image.png',
// status: 'done',
// url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
// },
// {
// uid: '-2',
// name: 'image.png',
// status: 'done',
// url: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
// },
])
const
[
commonImageList
,
setCommonImageList
]
=
useState
<
any
>
([])
const
[
previewVisible
,
setPreviewVisible
]
=
useState
(
false
)
const
[
previewImage
,
setPreviewImage
]
=
useState
(
''
)
const
[
previewTitle
,
setPreviewTitle
]
=
useState
(
''
)
...
...
@@ -48,8 +35,19 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
const
{
ProductStore
}
=
store
const
{
priceAttributeParams
,
productInfoByEdit
,
setProductAttributeAndImageParams
,
setIsAllAttributePic
}
=
ProductStore
/* 给数据添加图片字段 */
useEffect
(()
=>
{
if
(
priceAttributeParams
.
length
>
0
){
console
.
log
(
priceAttributeParams
,
'对比'
)
constructImageListByRender
(
priceAttributeParams
)
}
else
if
(
history
.
location
.
query
?.
id
){
console
.
log
(
productInfoByEdit
.
unitPriceAndPicList
,
'对比'
)
constructImageListByRender
(
productInfoByEdit
.
unitPriceAndPicList
)
}
},[
priceAttributeParams
])
/* 给数据添加图片字段 */
/* 直接进入商品图片编辑的时候 参数为空数组 但是没有价格属性的时候 也可能为空数组 区别在于是否有url id */
const
constructImageListByRender
=
(
priceAttributeParams
?:
any
)
=>
{
let
_priceAttributeParams
:
any
=
[]
if
(
productInfoByEdit
?.
id
){
// id判断是否新增还是编辑
setSetImageType
(
productInfoByEdit
.
isAllAttributePic
)
...
...
@@ -75,14 +73,8 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
return
_obj
})
}
// console.log('???', _priceAttributeParams)
// if(_priceAttributeParams?.length>0 && _priceAttributeParams[0]?.goodsCustomerAttributeList?.length!=0){
setDefaultChecked
(
0
)
clickItemTab
(
0
)
// }else{
// setDefaultChecked(-1)
// clickItemTab(-1)
// }
setDefaultChecked
(
0
)
clickItemTab
(
0
)
setPriceAttributeParamsByRender
(
_priceAttributeParams
)
setProductAttributeAndImageParams
(
_priceAttributeParams
)
console
.
log
(
_priceAttributeParams
,
priceAttributeParams
,
'_p'
)
// 这里可能为空数组 ** 如果不到此页面 前一个是旧数据 后面的为新数据
...
...
@@ -90,13 +82,11 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
if
(
setImageType
&&
_priceAttributeParams
.
length
>
0
){
setCommonImageList
(
_priceAttributeParams
[
0
].
commodityPic
)
}
},[
priceAttributeParams
])
}
const
clickItemTab
=
(
_index
:
number
)
=>
{
console
.
log
(
_index
,
'点击项'
)
setDefaultChecked
(
_index
)
// console.log(priceAttributeParams, 'params')
}
const
uploadButton
=
(
...
...
@@ -161,23 +151,12 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
const
handleChange
=
({
file
,
fileList
},
index
)
=>
{
let
_priceAttributeParams
=
[...
priceAttributeParamsByRender
]
console
.
log
(
_priceAttributeParams
,
index
,
'图片更改初始数据'
)
// if(index===-1){ // -1表示所有属性共用 也表示表格只有默认的一行 // 无需判断 不管是共用还是不共用都需要逐条写入fileList
setCommonImageList
(
fileList
)
// _priceAttributeParams[0].commodityPic = fileList
// }else{
_priceAttributeParams
[
index
].
commodityPic
=
fileList
// }
setCommonImageList
(
fileList
)
_priceAttributeParams
[
index
].
commodityPic
=
fileList
if
(
!
file
?.
status
&&
file
?.
status
!==
'done'
){
// 不符合要求的 移除没有'done'状态的图片
// if(index === -1){
// let ttt = _priceAttributeParams[0].commodityPic.filter(_ => _.status === 'done')
// setCommonImageList(ttt)
// _priceAttributeParams[0].commodityPic = ttt
// }else{
let
ttt
=
_priceAttributeParams
[
index
].
commodityPic
.
filter
(
_
=>
_
.
status
===
'done'
)
_priceAttributeParams
[
index
].
commodityPic
=
ttt
setCommonImageList
(
ttt
)
// }
let
ttt
=
_priceAttributeParams
[
index
].
commodityPic
.
filter
(
_
=>
_
.
status
===
'done'
)
_priceAttributeParams
[
index
].
commodityPic
=
ttt
setCommonImageList
(
ttt
)
}
console
.
log
(
_priceAttributeParams
,
'图片更改之后数据'
)
setPriceAttributeParamsByRender
(
_priceAttributeParams
)
...
...
@@ -187,10 +166,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
const
onChangeSetImageType
=
(
e
)
=>
{
setSetImageType
(
e
.
target
.
value
)
setIsAllAttributePic
(
e
.
target
.
value
)
// if(e.target.value)
// clickItemTab(-1)
// else
clickItemTab
(
0
)
clickItemTab
(
0
)
// 切换 清空图片数组
let
_priceAttributeParams
=
[...
priceAttributeParamsByRender
]
_priceAttributeParams
.
map
(
item
=>
{
...
...
@@ -225,7 +201,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
<
li
key=
{
index
}
className=
{
defaultChecked
==
index
?
styles
.
activedLi
:
""
}
onClick=
{
()
=>
clickItemTab
(
index
)
}
>
<
span
>
{
item
.
attributeAndValueList
.
map
((
_item
,
_index
)
=>
_item
.
value
).
join
(
'/'
)
item
.
attributeAndValueList
.
map
((
_item
,
_index
)
=>
_item
.
customerAttributeValue
.
value
).
join
(
'/'
)
}
</
span
>
</
li
>
...
...
src/pages/transaction/enquirySubmit/components/productModal.tsx
View file @
ab61c233
...
...
@@ -3,10 +3,10 @@
* @Date: 2020-08-28 10:07:45
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-0
8-29 10:16:45
* @LastEditTime: 2020-0
9-01 15:45:57
*/
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
{
Modal
,
Button
,
Form
,
Radio
,
Tabs
,
Input
,
Select
,
Checkbox
}
from
'antd'
import
{
Modal
,
Button
,
Form
,
Radio
,
AutoComplete
,
Tabs
,
Input
,
Select
,
Checkbox
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
const
{
TabPane
}
=
Tabs
const
{
Option
}
=
Select
...
...
@@ -68,10 +68,14 @@ const comfirmDialog: React.FC<Params> = (props) => {
const
renderTabPanchildren
=
(
item
:
any
)
=>
{
console
.
log
(
'子项'
,
item
)
return
(
<>
{
item
.
attributeList
.
map
((
attrItem
:
any
)
=>
{
const
options
=
attrItem
.
attributeValueList
.
map
((
item
:
any
)
=>
({
value
:
item
.
value
}))
return
(
<>
{
...
...
@@ -84,7 +88,15 @@ const comfirmDialog: React.FC<Params> = (props) => {
message
:
'此项为必填项'
}]
}
>
<
Select
<
AutoComplete
style=
{
{
width
:
200
}
}
options=
{
options
}
placeholder=
"选择或输入"
filterOption=
{
(
inputValue
,
option
)
=>
option
.
value
.
toUpperCase
().
indexOf
(
inputValue
.
toUpperCase
())
!==
-
1
}
/>
{
/* <Select
placeholder="请选择"
allowClear
onChange={(v)=>onChange(v, attrItem)}
...
...
@@ -94,7 +106,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
<Option key={item.id} value={item.id}>{item.value}</Option>
))
}
</
Select
>
</Select>
*/
}
</
Form
.
Item
>
}
{
...
...
src/pages/transaction/enquirySubmit/toSubmit/detail.tsx
View file @
ab61c233
This diff is collapsed.
Click to expand it.
src/pages/transaction/enquirySubmit/toSubmit/detailFormColumnType.ts
View file @
ab61c233
...
...
@@ -3,7 +3,7 @@
* @Date: 2020-08-27 16:27:53
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-0
8-29 14:29:40
* @LastEditTime: 2020-0
9-01 10:08:44
*/
import
{
ColumnType
}
from
'antd/lib/table/interface'
export
const
equiryColumns
:
ColumnType
<
any
>
[]
=
[
...
...
@@ -66,7 +66,7 @@ export const equiryColumns: ColumnType<any>[] = [
]
export
const
docking
List
:
ColumnType
<
any
>
[]
=
[
export
const
docking
Column
:
ColumnType
<
any
>
[]
=
[
{
title
:
'序号'
,
dataIndex
:
'id'
,
...
...
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