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
dda7b95b
Commit
dda7b95b
authored
Jul 30, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
6bf82f45
d0046413
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
151 additions
and
261 deletions
+151
-261
setPrice.tsx
src/pages/commodity/products/addChannelItem/setPrice.tsx
+1
-22
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+2
-50
index.tsx
src/pages/commodity/products/constant/index.tsx
+129
-0
fastModifyPrice.tsx
src/pages/commodity/products/fastModifyPrice.tsx
+2
-49
index.tsx
src/pages/commodity/products/index.tsx
+7
-73
modifyDirectChannel.tsx
src/pages/commodity/products/modifyDirectChannel.tsx
+4
-36
viewDirectChannel.tsx
src/pages/commodity/products/viewDirectChannel.tsx
+6
-30
viewProducts.tsx
src/pages/commodity/products/viewProducts.tsx
+0
-0
index.tsx
...Order/orderCollect/components/productModalTable/index.tsx
+0
-1
No files found.
src/pages/commodity/products/addChannelItem/setPrice.tsx
View file @
dda7b95b
...
@@ -13,6 +13,7 @@ import { PublicApi } from '@/services/api';
...
@@ -13,6 +13,7 @@ import { PublicApi } from '@/services/api';
import
{
store
}
from
'@/store'
import
{
store
}
from
'@/store'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
validatorNumberRange
}
from
'../constant'
;
const
{
Item
}:
any
=
Form
const
{
Item
}:
any
=
Form
...
@@ -307,28 +308,6 @@ const SetPrice:React.FC<IProps> = (props) => {
...
@@ -307,28 +308,6 @@ const SetPrice:React.FC<IProps> = (props) => {
setLadderPrice
(
false
)
setLadderPrice
(
false
)
}
}
// 校验阶梯范围
const
validatorNumberRange
=
(
rule
,
value
,
callback
)
=>
{
try
{
if
(
Array
.
isArray
(
value
)){
let
range
=
value
.
map
(
item
=>
{
if
(
item
)
return
Object
.
values
(
item
.
numberRange
)
}).
reduce
(
function
(
a
,
b
)
{
return
a
.
concat
(
b
);
},
[]
)
let
result
=
range
.
map
(
Number
).
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
callback
()
}
}
catch
(
err
)
{
callback
(
err
)
}
}
const
onChangeTax
=
(
e
)
=>
{
const
onChangeTax
=
(
e
)
=>
{
setIsTax
(
e
.
target
.
checked
)
setIsTax
(
e
.
target
.
checked
)
}
}
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
dda7b95b
...
@@ -9,6 +9,7 @@ import { QuestionCircleOutlined, SettingOutlined, PlusOutlined, MinusOutlined, }
...
@@ -9,6 +9,7 @@ import { QuestionCircleOutlined, SettingOutlined, PlusOutlined, MinusOutlined, }
import
{
inject
,
observer
}
from
'mobx-react'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
store
}
from
'@/store'
import
{
store
}
from
'@/store'
import
{
IProductSelectAttribute
}
from
'@/module/productModule'
import
{
IProductSelectAttribute
}
from
'@/module/productModule'
import
{
validatorNumberRange
}
from
'../constant'
const
_
=
require
(
"lodash"
);
const
_
=
require
(
"lodash"
);
...
@@ -588,56 +589,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
...
@@ -588,56 +589,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
priceForm
.
setFieldsValue
({
unitName
:
option
.
children
})
priceForm
.
setFieldsValue
({
unitName
:
option
.
children
})
}
}
// 校验阶梯范围
const
validatorNumberRange
=
(
rule
,
value
,
callback
)
=>
{
// let minOrder = Number(minOrderNumber)
// let precision;
// if(Number.isInteger(minOrder)) { // 整数取1
// precision = 1
// } else { // 小数取最小精度(最多三位)
// switch(minOrderNumber.toString().split(".")[1].length) {
// case 1:
// precision = 0.1
// break;
// case 2:
// precision = 0.01
// break;
// case 3:
// precision = 0.001
// break;
// default:
// precision = 1
// }
// }
try
{
if
(
Array
.
isArray
(
value
)){
let
range
=
value
.
map
(
item
=>
{
if
(
item
)
return
Object
.
values
(
item
.
numberRange
)
}).
reduce
(
function
(
a
,
b
)
{
// // 判断首位数是否满足精度
// if(a.length && b.length) {
// if((Number(b[0])*1000 - Number(a[a.length-1])*1000)/1000 !== precision) {
// throw new Error('请正确输入阶梯数量范围');
// }
// }
return
a
.
concat
(
b
);
},
[]
)
let
result
=
range
.
map
(
Number
).
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
if
(
Number
(
range
[
0
])
!==
Number
(
minOrderNumber
))
throw
new
Error
(
'阶段的起始值必须为最小起订数'
);
callback
()
}
}
catch
(
err
)
{
callback
(
err
)
}
}
const
clickBatchSetPrice
=
()
=>
{
const
clickBatchSetPrice
=
()
=>
{
// console.log('批量设置价格')
setPriceForm
.
resetFields
()
// 先清空
setPriceForm
.
resetFields
()
// 先清空
setIsBatchSetting
(
true
)
// 点击置为true
setIsBatchSetting
(
true
)
// 点击置为true
setSetPriceModal
(
true
)
setSetPriceModal
(
true
)
...
@@ -861,7 +813,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
...
@@ -861,7 +813,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
message
:
'阶梯范围为必填项'
message
:
'阶梯范围为必填项'
},
},
{
{
validator
:
validatorNumberRange
validator
:
(
r
,
v
,
c
)
=>
validatorNumberRange
(
r
,
v
,
c
,
minOrderNumber
)
}
}
]
}
]
}
>
>
...
...
src/pages/commodity/products/constant/index.tsx
0 → 100644
View file @
dda7b95b
import
{
ColumnType
}
from
'antd/lib/table'
;
import
moment
from
'moment'
;
import
React
,
{
ReactNode
}
from
'react'
/** 商品 渠道商品 快捷修改单价 共用常量 */
/** 商品(渠道商品)状态 */
export
const
productStatusLabel
=
[
''
,
'待提交审核'
,
'待审核'
,
'审核通过'
,
'审核不通过'
,
'已上架'
,
'已下架'
,
'未上架'
]
/** 品类类型&商品类型 */
export
const
customerCategoryTypeLabel
=
[
''
,
'实物商品'
,
'虚拟商品'
,
'服务商品'
,
]
/** 商品定价类型 */
export
const
priceTypeLabel
=
[
''
,
'现货价格'
,
'价格需要询价'
,
'积分兑换商品'
,
]
/** 商品物流类型 */
export
const
deliveryTypeLabel
=
[
''
,
'物流(默认)'
,
'自提'
,
'无需配送'
,
]
/** 商品运费类型 */
export
const
carriageTypeLabel
=
[
''
,
'卖家承担运费(默认)'
,
'买家承担运费'
,
]
/** 查看商品 审核历史列 */
export
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'序号'
,
dataIndex
:
'memberRoleId'
,
key
:
'memberRoleId'
,
render
:
(
t
,
c
,
i
)
=>
i
+
1
},
{
title
:
'角色'
,
dataIndex
:
'memberRoleName'
,
key
:
'memberRoleName'
,
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
if
(
record
.
status
===
4
)
component
=
(<><
span
className=
"commonStatusValid"
></
span
>
审核通过
</>)
else
if
(
record
.
status
===
1
)
component
=
(<><
span
className=
"commonStatusInvalid"
></
span
>
待提交审核
</>)
else
if
(
record
.
status
===
2
)
component
=
(<><
span
className=
"commonStatusModify"
></
span
>
待审核
</>)
else
if
(
record
.
status
===
3
)
component
=
(<><
span
className=
"commonStatusStop"
></
span
>
审核不通过
</>)
return
component
}
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
key
:
'operation'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
if
(
record
.
operation
===
1
)
return
'提交审核'
else
if
(
record
.
operation
===
2
)
return
'修改商品'
else
if
(
record
.
operation
===
3
)
return
'审核商品'
}
},
{
title
:
'操作时间'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
render
:
(
text
:
any
)
=>
moment
(
text
).
format
(
"YYYY-MM-DD HH:mm:ss"
)
},
{
title
:
'意见'
,
dataIndex
:
'checkRemark'
,
key
:
'checkRemark'
,
},
];
/** 校验阶梯价格函数 min参数判断是否校验最小起订 */
export
const
validatorNumberRange
=
(
rule
:
any
,
value
:
any
,
callback
:
any
,
min
?:
any
)
=>
{
try
{
if
(
Array
.
isArray
(
value
)){
let
range
=
value
.
map
(
item
=>
{
if
(
item
)
return
Object
.
values
(
item
.
numberRange
)
}).
reduce
(
function
(
a
,
b
)
{
return
a
.
concat
(
b
);
},
[]
)
let
result
=
range
.
map
(
Number
).
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
if
(
min
&&
(
Number
(
range
[
0
])
!==
Number
(
min
)))
throw
new
Error
(
'阶段的起始值必须为最小起订数'
);
callback
()
}
}
catch
(
err
)
{
callback
(
err
)
}
}
src/pages/commodity/products/fastModifyPrice.tsx
View file @
dda7b95b
...
@@ -16,6 +16,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
...
@@ -16,6 +16,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import
{
searchCustomerCategoryOptionEffect
,
searchBrandOptionEffect
}
from
'./effect'
import
{
searchCustomerCategoryOptionEffect
,
searchBrandOptionEffect
}
from
'./effect'
import
{
fastSchema
}
from
'./schema/productSchema'
import
{
fastSchema
}
from
'./schema/productSchema'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
validatorNumberRange
}
from
'./constant'
const
formActions
=
createFormActions
();
const
formActions
=
createFormActions
();
...
@@ -235,54 +236,6 @@ const FastModifyPrice: React.FC<{}> = () => {
...
@@ -235,54 +236,6 @@ const FastModifyPrice: React.FC<{}> = () => {
}
}
}
}
// 校验阶梯范围
const
validatorNumberRange
=
(
rule
,
value
,
callback
)
=>
{
// let minOrder = Number(currentRow.minOrder)
// let precision;
// if(Number.isInteger(minOrder)) { // 整数取1
// precision = 1
// } else { // 小数取最小精度(最多三位)
// switch(minOrder.toString().split(".")[1].length) {
// case 1:
// precision = 0.1
// break;
// case 2:
// precision = 0.01
// break;
// case 3:
// precision = 0.001
// break;
// default:
// precision = 1
// }
// }
try
{
if
(
Array
.
isArray
(
value
)){
let
range
=
value
.
map
(
item
=>
{
if
(
item
)
return
Object
.
values
(
item
.
numberRange
)
}).
reduce
(
function
(
a
,
b
)
{
// // 判断首位数是否满足精度
// if(a.length && b.length) {
// if((Number(b[0])*1000 - Number(a[1])*1000)/1000 !== precision) {
// throw new Error('请正确输入阶梯数量范围');
// }
// }
return
a
.
concat
(
b
);
},
[]
)
let
result
=
range
.
map
(
Number
).
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
if
(
Number
(
range
[
0
])
!==
Number
(
currentRow
.
minOrder
))
throw
new
Error
(
'阶段的起始值必须为最小起订数'
);
callback
()
}
}
catch
(
err
)
{
callback
(
err
)
}
}
return
(
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
<
Card
>
<
Card
>
...
@@ -347,7 +300,7 @@ const FastModifyPrice: React.FC<{}> = () => {
...
@@ -347,7 +300,7 @@ const FastModifyPrice: React.FC<{}> = () => {
message
:
'阶梯范围为必填项'
message
:
'阶梯范围为必填项'
},
},
{
{
validator
:
validatorNumberRange
validator
:
(
r
,
v
,
c
)
=>
validatorNumberRange
(
r
,
v
,
c
,
currentRow
.
minOrder
)
}
}
]
}
]
}
>
>
...
...
src/pages/commodity/products/index.tsx
View file @
dda7b95b
...
@@ -26,6 +26,8 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
...
@@ -26,6 +26,8 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import
{
searchBrandOptionEffect
,
searchCustomerCategoryOptionEffect
}
from
'./effect'
import
{
searchBrandOptionEffect
,
searchCustomerCategoryOptionEffect
}
from
'./effect'
import
{
getAuth
}
from
'@/utils/auth'
import
{
getAuth
}
from
'@/utils/auth'
import
useSetSearchValueInTable
from
'@/hooks/useSetSearchValueInTable'
import
useSetSearchValueInTable
from
'@/hooks/useSetSearchValueInTable'
import
{
priceTypeLabel
,
productStatusLabel
}
from
'./constant'
import
EyePreview
from
'@/components/EyePreview'
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
{
confirm
}
=
Modal
;
const
{
confirm
}
=
Modal
;
...
@@ -94,7 +96,9 @@ const Products: React.FC<{}> = () => {
...
@@ -94,7 +96,9 @@ const Products: React.FC<{}> = () => {
className
:
'commonPickColor'
,
className
:
'commonPickColor'
,
width
:
240
,
width
:
240
,
ellipsis
:
true
,
ellipsis
:
true
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
a
title=
{
text
}
onClick=
{
()
=>
handleSee
(
record
)
}
>
{
text
}
<
EyeOutlined
/></
a
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/commodityAbility/commodity/products/detail?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
},
},
{
{
title
:
'商品品类'
,
title
:
'商品品类'
,
...
@@ -115,29 +119,7 @@ const Products: React.FC<{}> = () => {
...
@@ -115,29 +119,7 @@ const Products: React.FC<{}> = () => {
title
:
'产品定价'
,
title
:
'产品定价'
,
dataIndex
:
'priceType'
,
dataIndex
:
'priceType'
,
key
:
'priceType'
,
key
:
'priceType'
,
render
:
(
text
:
any
,
reocrd
:
any
)
=>
{
render
:
(
text
:
any
,
reocrd
:
any
)
=>
priceTypeLabel
[
text
]
if
(
text
===
1
)
return
'现货价格'
else
if
(
text
===
2
)
return
'价格需要询价'
else
if
(
text
===
3
)
return
'积分兑换商品'
},
filters
:
[
{
text
:
'现货价格'
,
value
:
1
,
},
{
text
:
'价格需要询价'
,
value
:
2
,
},
{
text
:
'积分兑换商品'
,
value
:
3
,
},
],
onFilter
:
(
value
,
record
)
=>
record
.
priceType
===
value
,
},
},
{
{
title
:
'价格'
,
title
:
'价格'
,
...
@@ -170,49 +152,7 @@ const Products: React.FC<{}> = () => {
...
@@ -170,49 +152,7 @@ const Products: React.FC<{}> = () => {
title
:
'商品状态'
,
title
:
'商品状态'
,
dataIndex
:
'status'
,
dataIndex
:
'status'
,
key
:
'status'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
render
:
(
text
:
any
,
record
:
any
)
=>
<><
span
className=
"commonStatusModify"
></
span
>
{
productStatusLabel
[
text
]
}
</>
let
component
:
ReactNode
=
null
if
(
record
.
status
===
1
)
component
=
(<><
span
className=
"commonStatusStop"
></
span
>
待提交审核
</>)
else
if
(
record
.
status
===
2
)
component
=
(<><
span
className=
"commonStatusModify"
></
span
>
待审核
</>)
else
if
(
record
.
status
===
3
)
component
=
(<><
span
className=
"commonStatusInvalid"
></
span
>
审核不通过
</>)
else
if
(
record
.
status
===
4
)
component
=
(<><
span
className=
"commonStatusValid"
></
span
>
审核通过
</>)
else
if
(
record
.
status
===
5
)
component
=
(<
span
style=
{
{
color
:
'#00B37A'
,
padding
:
'2px 5px'
,
background
:
'rgba(235,247,242,1)'
,
borderRadius
:
'4px'
}
}
>
已上架
</
span
>)
else
if
(
record
.
status
===
6
)
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
,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
...
@@ -270,16 +210,11 @@ const Products: React.FC<{}> = () => {
...
@@ -270,16 +210,11 @@ const Products: React.FC<{}> = () => {
})
})
}
}
const
handleSee
=
(
record
:
any
)
=>
{
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/detail?id=
${
record
.
id
}
`
)
}
const
clickModify
=
(
id
:
number
)
=>
{
const
clickModify
=
(
id
:
number
)
=>
{
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/edit?id=
${
id
}
`
)
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/edit?id=
${
id
}
`
)
}
}
const
handleCancel
=
()
=>
{
const
handleCancel
=
()
=>
{
console
.
log
(
'cancel'
)
setImportModal
(
false
)
setImportModal
(
false
)
}
}
...
@@ -288,7 +223,6 @@ const Products: React.FC<{}> = () => {
...
@@ -288,7 +223,6 @@ const Products: React.FC<{}> = () => {
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
setSelectRow
(
selectedRows
);
setSelectRow
(
selectedRows
);
setSelectedRowKeys
(
selectedRowKeys
);
setSelectedRowKeys
(
selectedRowKeys
);
console
.
log
(
`selectedRowKeys:
${
selectedRowKeys
}
`
,
'selectedRows: '
,
selectedRows
);
}
}
}
}
...
...
src/pages/commodity/products/modifyDirectChannel.tsx
View file @
dda7b95b
...
@@ -10,9 +10,9 @@ import {
...
@@ -10,9 +10,9 @@ import {
}
from
'@ant-design/icons'
}
from
'@ant-design/icons'
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
styles
from
'./index.less'
import
styles
from
'./index.less'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetLogisticsSelectListCompanyResponse
,
GetLogisticsSelectListFreightTemplateResponse
,
GetLogisticsSelectListShipperAddressResponse
}
from
'@/services/LogisticsApi'
;
import
{
GetLogisticsSelectListCompanyResponse
,
GetLogisticsSelectListFreightTemplateResponse
,
GetLogisticsSelectListShipperAddressResponse
}
from
'@/services/LogisticsApi'
;
import
{
validatorNumberRange
}
from
'./constant'
;
const
layout
=
{
const
layout
=
{
labelCol
:
{
labelCol
:
{
...
@@ -96,11 +96,9 @@ const ModifyDirectChannel:React.FC<{}> = () => {
...
@@ -96,11 +96,9 @@ const ModifyDirectChannel:React.FC<{}> = () => {
PublicApi
.
getLogisticsSelectListShipperAddress
().
then
(
res
=>
{
PublicApi
.
getLogisticsSelectListShipperAddress
().
then
(
res
=>
{
setLogisticsAddressList
(
res
.
data
)
setLogisticsAddressList
(
res
.
data
)
})
})
PublicApi
.
getLogisticsSelectListCompany
({
cooperateType
:
'2'
}).
then
(
res
=>
{
PublicApi
.
getLogisticsSelectListCompany
({
cooperateType
:
'2'
}).
then
(
res
=>
{
setLogisticsCompanyLists
(
res
.
data
)
setLogisticsCompanyLists
(
res
.
data
)
})
})
PublicApi
.
getLogisticsSelectListFreightTemplate
().
then
(
res
=>
{
PublicApi
.
getLogisticsSelectListFreightTemplate
().
then
(
res
=>
{
setLogisticsTemplateList
(
res
.
data
)
setLogisticsTemplateList
(
res
.
data
)
})
})
...
@@ -128,9 +126,6 @@ const ModifyDirectChannel:React.FC<{}> = () => {
...
@@ -128,9 +126,6 @@ const ModifyDirectChannel:React.FC<{}> = () => {
idList
:
priceTableData
.
map
(
item
=>
item
.
id
)
idList
:
priceTableData
.
map
(
item
=>
item
.
id
)
},
{
ctlType
:
"none"
}).
then
(
res
=>
{
},
{
ctlType
:
"none"
}).
then
(
res
=>
{
const
{
data
}
=
res
const
{
data
}
=
res
// let hasIds = priceTableData.map(item => item.id)
// setOriginHasIds(hasIds)
// let _data = data.filter(item => !originHasIds.includes(item.id))
setOriginTableData
(
data
)
setOriginTableData
(
data
)
if
(
data
.
length
>
0
)
{
if
(
data
.
length
>
0
)
{
structureTable
(
data
)
structureTable
(
data
)
...
@@ -261,10 +256,9 @@ const ModifyDirectChannel:React.FC<{}> = () => {
...
@@ -261,10 +256,9 @@ const ModifyDirectChannel:React.FC<{}> = () => {
const
clickSetPrice
=
(
record
:
any
)
=>
{
const
clickSetPrice
=
(
record
:
any
)
=>
{
setIsBatchSetting
(
false
)
// 点击行操作批量置为false
setIsBatchSetting
(
false
)
// 点击行操作批量置为false
console
.
log
(
record
,
'record'
)
setCurrentSetPriceRow
(
record
)
setCurrentSetPriceRow
(
record
)
setModifyModal
(
true
)
setModifyModal
(
true
)
setPriceForm
.
resetFields
()
// 先清空
setPriceForm
.
resetFields
()
if
(
Object
.
keys
(
record
[
'单价'
])[
0
]
===
'0-0'
)
{
// 状态为非阶梯价格
if
(
Object
.
keys
(
record
[
'单价'
])[
0
]
===
'0-0'
)
{
// 状态为非阶梯价格
setLadderPrice
(
false
)
setLadderPrice
(
false
)
setPriceForm
.
setFieldsValue
({
ladderPrice
:
false
,
uniquePrice
:
Object
.
values
(
record
[
'单价'
])[
0
]})
setPriceForm
.
setFieldsValue
({
ladderPrice
:
false
,
uniquePrice
:
Object
.
values
(
record
[
'单价'
])[
0
]})
...
@@ -308,9 +302,7 @@ const ModifyDirectChannel:React.FC<{}> = () => {
...
@@ -308,9 +302,7 @@ const ModifyDirectChannel:React.FC<{}> = () => {
return
_row
return
_row
}
else
return
item
}
else
return
item
})
})
// newTabeData[curretSetPriceRow['索引']] = _row
}
}
console
.
log
(
curretSetPriceRow
,
_row
,
_newTabeData
,
newTabeData
,
'option'
)
setPriceTableData
(
_newTabeData
)
setPriceTableData
(
_newTabeData
)
constructedPrarams
()
constructedPrarams
()
})
})
...
@@ -350,12 +342,10 @@ const ModifyDirectChannel:React.FC<{}> = () => {
...
@@ -350,12 +342,10 @@ const ModifyDirectChannel:React.FC<{}> = () => {
})
})
setSubmitParams
(
_data
)
setSubmitParams
(
_data
)
// console.log(priceTableData, _priceTableData, _data, 'params')
}
}
const
clickDelete
=
(
record
:
any
)
=>
{
const
clickDelete
=
(
record
:
any
)
=>
{
setPriceTableData
(
priceTableData
=>
[...
priceTableData
].
filter
(
item
=>
item
.
id
!=
record
.
id
))
setPriceTableData
(
priceTableData
=>
[...
priceTableData
].
filter
(
item
=>
item
.
id
!=
record
.
id
))
// setSelectedSpecRowKeys(selectedSpecRowKeys => [...selectedSpecRowKeys].filter(item => item != record.id))
if
(
!
flagRef
.
current
){
if
(
!
flagRef
.
current
){
PublicApi
.
postProductChannelCommodityDeleteChannelCommodityPrice
({
id
:
record
.
id
},{
ctlType
:
'none'
})
PublicApi
.
postProductChannelCommodityDeleteChannelCommodityPrice
({
id
:
record
.
id
},{
ctlType
:
'none'
})
}
}
...
@@ -367,34 +357,12 @@ const ModifyDirectChannel:React.FC<{}> = () => {
...
@@ -367,34 +357,12 @@ const ModifyDirectChannel:React.FC<{}> = () => {
}
}
const
clickBatchSetPrice
=
()
=>
{
const
clickBatchSetPrice
=
()
=>
{
setPriceForm
.
resetFields
()
// 先清空
setPriceForm
.
resetFields
()
setIsBatchSetting
(
true
)
// 点击置为true
setIsBatchSetting
(
true
)
setModifyModal
(
true
)
setModifyModal
(
true
)
setLadderPrice
(
false
)
setLadderPrice
(
false
)
}
}
// 校验阶梯范围
const
validatorNumberRange
=
(
rule
,
value
,
callback
)
=>
{
try
{
if
(
Array
.
isArray
(
value
)){
let
range
=
value
.
map
(
item
=>
{
if
(
item
)
return
Object
.
values
(
item
.
numberRange
)
}).
reduce
(
function
(
a
,
b
)
{
return
a
.
concat
(
b
);
},
[]
)
let
result
=
range
.
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
callback
()
}
}
catch
(
err
)
{
callback
(
err
)
}
}
const
onSave
=
async
()
=>
{
const
onSave
=
async
()
=>
{
setIsDisabledSave
(
true
)
setIsDisabledSave
(
true
)
let
logistics
=
await
logisticsForm
.
validateFields
()
let
logistics
=
await
logisticsForm
.
validateFields
()
...
...
src/pages/commodity/products/viewDirectChannel.tsx
View file @
dda7b95b
...
@@ -3,9 +3,9 @@ import { history } from 'umi'
...
@@ -3,9 +3,9 @@ import { history } from 'umi'
import
{
Card
,
Space
,
Row
,
Col
,
Descriptions
,
Table
,
Avatar
}
from
'antd'
import
{
Card
,
Space
,
Row
,
Col
,
Descriptions
,
Table
,
Avatar
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
ReutrnEle
from
'@/components/ReturnEle'
import
ReutrnEle
from
'@/components/ReturnEle'
import
styles
from
"./index.less"
import
{
GlobalConfig
}
from
'@/global/config'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
{
carriageTypeLabel
,
deliveryTypeLabel
,
productStatusLabel
}
from
'./constant'
const
ViewDriectChannel
:
React
.
FC
<
{}
>
=
()
=>
{
const
ViewDriectChannel
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
channelDetails
,
setChannelDetails
]
=
useState
<
any
>
()
const
[
channelDetails
,
setChannelDetails
]
=
useState
<
any
>
()
...
@@ -111,26 +111,14 @@ const ViewDriectChannel: React.FC<{}> = () => {
...
@@ -111,26 +111,14 @@ const ViewDriectChannel: React.FC<{}> = () => {
"单价"
:
item
.
unitPrice
"单价"
:
item
.
unitPrice
})
})
})
})
console
.
log
(
col
,
'col'
,
_tableData
)
setPriceTableData
(
_tableData
)
setPriceTableData
(
_tableData
)
}
}
}
}
const
renderStatus
=
(
status
:
any
)
=>
{
if
(
status
===
5
)
return
<
span
className=
{
styles
.
pruductStatus
}
>
已上架
</
span
>
if
(
status
===
6
)
return
<
span
style=
{
{
padding
:
'2px 5px'
,
background
:
'rgba(244,245,247,1)'
,
borderRadius
:
'4px'
}
}
>
已下架
</
span
>
if
(
status
===
7
)
return
<
span
style=
{
{
color
:
'#E63F3B'
,
padding
:
'2px 5px'
,
background
:
'rgba(255,235,230,1)'
,
borderRadius
:
'4px'
}
}
>
未上架
</
span
>
else
return
null
}
const
content
=
<>
const
content
=
<>
<
Descriptions
colon=
{
true
}
style=
{
{
marginTop
:
50
}
}
>
<
Descriptions
colon=
{
true
}
style=
{
{
marginTop
:
50
}
}
>
{
{
renderStatus
(
channelDetails
?.
status
)
&&
<
Descriptions
.
Item
label=
"商品状态"
>
{
renderStatus
(
channelDetails
?.
status
)
}
</
Descriptions
.
Item
>
channelDetails
?.
status
&&
<
Descriptions
.
Item
label=
"商品状态"
>
{
productStatusLabel
[
channelDetails
?.
status
]
}
</
Descriptions
.
Item
>
}
}
{
{
channelDetails
?.
channelCommodity
?.
source
===
1
&&
<
Descriptions
.
Item
label=
"上级渠道"
>
{
channelDetails
?.
channelCommodity
?.
parentMemberName
}
</
Descriptions
.
Item
>
channelDetails
?.
channelCommodity
?.
source
===
1
&&
<
Descriptions
.
Item
label=
"上级渠道"
>
{
channelDetails
?.
channelCommodity
?.
parentMemberName
}
</
Descriptions
.
Item
>
...
@@ -156,18 +144,6 @@ const ViewDriectChannel: React.FC<{}> = () => {
...
@@ -156,18 +144,6 @@ const ViewDriectChannel: React.FC<{}> = () => {
</
Descriptions
>
</
Descriptions
>
</>
</>
const
renderDeliveryType
=
(
type
:
number
)
=>
{
if
(
type
===
1
)
return
'物流(默认)'
else
if
(
type
===
2
)
return
'自提'
else
if
(
type
===
3
)
return
'无需配送'
else
return
null
}
const
renderCarriageType
=
(
type
:
number
)
=>
{
if
(
type
===
1
)
return
'卖家承担运费(默认)'
if
(
type
===
2
)
return
'买家承担运费'
}
return
(
return
(
<
PageHeaderWrapper
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
onBack=
{
()
=>
history
.
goBack
()
}
...
@@ -229,24 +205,24 @@ const ViewDriectChannel: React.FC<{}> = () => {
...
@@ -229,24 +205,24 @@ const ViewDriectChannel: React.FC<{}> = () => {
<
Row
>
<
Row
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
{
{
renderDeliveryType
(
channelDetails
?.
logistics
?.
deliveryType
)
&&
channelDetails
?.
logistics
?.
deliveryType
&&
<
Row
>
<
Row
>
<
Col
span=
{
4
}
>
<
Col
span=
{
4
}
>
<
p
>
配送方式:
</
p
>
<
p
>
配送方式:
</
p
>
</
Col
>
</
Col
>
<
Col
span=
{
20
}
>
<
Col
span=
{
20
}
>
<
p
>
{
renderDeliveryType
(
channelDetails
?.
logistics
?.
deliveryType
)
}
</
p
>
<
p
>
{
deliveryTypeLabel
[
channelDetails
?.
logistics
?.
deliveryType
]
}
</
p
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
}
}
{
{
renderCarriageType
(
channelDetails
?.
logistics
?.
carriageType
)
&&
channelDetails
?.
logistics
?.
carriageType
&&
<
Row
>
<
Row
>
<
Col
span=
{
4
}
>
<
Col
span=
{
4
}
>
<
p
>
运送方式:
</
p
>
<
p
>
运送方式:
</
p
>
</
Col
>
</
Col
>
<
Col
span=
{
20
}
>
<
Col
span=
{
20
}
>
<
p
>
{
renderCarriageType
(
channelDetails
?.
logistics
?.
carriageType
)
}
</
p
>
<
p
>
{
carriageTypeLabel
[
channelDetails
?.
logistics
?.
carriageType
]
}
</
p
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
}
}
...
...
src/pages/commodity/products/viewProducts.tsx
View file @
dda7b95b
This diff is collapsed.
Click to expand it.
src/pages/transaction/purchaseOrder/orderCollect/components/productModalTable/index.tsx
View file @
dda7b95b
...
@@ -74,7 +74,6 @@ const orderProductShopTypeMaps = {
...
@@ -74,7 +74,6 @@ const orderProductShopTypeMaps = {
export
const
AddressPop
=
(
props
)
=>
{
export
const
AddressPop
=
(
props
)
=>
{
const
{
pickInfo
=
null
,
children
}
=
props
const
{
pickInfo
=
null
,
children
}
=
props
console
.
log
(
pickInfo
)
return
pickInfo
&&
pickInfo
.
deliverType
===
2
?
<
Space
>
return
pickInfo
&&
pickInfo
.
deliverType
===
2
?
<
Space
>
<
EnvironmentOutlined
style=
{
{
marginRight
:
8
}
}
/>
<
EnvironmentOutlined
style=
{
{
marginRight
:
8
}
}
/>
<
Popover
content=
{
<
Popover
content=
{
...
...
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