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
shenshaokai
jinfa-platform
Commits
13efecec
Commit
13efecec
authored
Oct 19, 2021
by
Bill
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
f8b8d09e
d18f3db9
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
416 additions
and
242 deletions
+416
-242
contentRoute.ts
config/routes/contentRoute.ts
+8
-8
procurement.ts
src/constants/procurement.ts
+3
-1
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+1
-0
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+43
-13
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+4
-6
index.tsx
src/pages/commodity/products/index.tsx
+20
-16
schema.tsx
src/pages/content/category/schema.tsx
+2
-3
infomationInfo.tsx
src/pages/content/infomation/infomationInfo.tsx
+18
-3
infomationInfoSchema.tsx
src/pages/content/infomation/schema/infomationInfoSchema.tsx
+0
-4
index.tsx
src/pages/content/tagsManagement/schema/index.tsx
+5
-6
index.less
src/pages/ownMall/ownMallManager/ownMallAboutUs/index.less
+11
-2
index.tsx
src/pages/ownMall/ownMallManager/ownMallAboutUs/index.tsx
+26
-16
add.tsx
src/pages/ownMall/ownMallManager/ownMallSeo/add.tsx
+20
-10
index.tsx
src/pages/ownMall/ownMallManager/ownMallSeo/index.tsx
+5
-5
priceSetting.tsx
...ages/priceManage/priceStrategy/component/priceSetting.tsx
+10
-4
index.tsx
src/pages/transaction/purchaseOrder/constant/index.tsx
+2
-1
index.tsx
src/pages/transaction/purchaseOrder/index.tsx
+150
-17
index.tsx
...er/orderCollectB2b/components/inquiryModalTable/index.tsx
+8
-6
index.ts
...ransaction/purchaseOrder/orderCollectB2b/effects/index.ts
+1
-1
index.tsx
...pages/transaction/purchaseOrder/orderCollectB2b/index.tsx
+11
-11
index.ts
...transaction/purchaseOrder/orderCollectB2b/schema/index.ts
+25
-22
index.ts
src/pages/transaction/saleOrder/agentOrder/effects/index.ts
+7
-1
index.tsx
src/pages/transaction/saleOrder/agentOrder/index.tsx
+3
-1
index.ts
src/pages/transaction/saleOrder/agentOrder/schema/index.ts
+13
-0
index.tsx
src/pages/transaction/saleOrder/constant/index.tsx
+2
-0
index.tsx
src/pages/transaction/saleOrder/index.tsx
+18
-85
No files found.
config/routes/contentRoute.ts
View file @
13efecec
...
...
@@ -13,7 +13,7 @@
{
path
:
'/memberCenter/contentAbility/category'
,
name
:
'分类管理'
,
component
:
'@/pages/
memberCenter/contentAbility
/category'
component
:
'@/pages/
content
/category'
},
// 栏目管理
...
...
@@ -41,19 +41,19 @@
{
path
:
'/memberCenter/contentAbility/tagsManagement'
,
name
:
'tagsManagement'
,
component
:
'@/pages/
memberCenter/contentAbility
/tagsManagement'
component
:
'@/pages/
content
/tagsManagement'
},
{
path
:
'/memberCenter/contentAbility/tagsManagement/add'
,
name
:
'tagsAdd'
,
component
:
'@/pages/
memberCenter/contentAbility
/tagsManagement/tagsInfo'
,
component
:
'@/pages/
content
/tagsManagement/tagsInfo'
,
hideInMenu
:
true
,
hidePageHeader
:
true
,
},
{
path
:
'/memberCenter/contentAbility/tagsManagement/detail'
,
name
:
'tagsInfo'
,
component
:
'@/pages/
memberCenter/contentAbility
/tagsManagement/tagsInfo'
,
component
:
'@/pages/
content
/tagsManagement/tagsInfo'
,
hideInMenu
:
true
,
hidePageHeader
:
true
,
},
...
...
@@ -78,24 +78,24 @@
hideInMenu
:
true
,
hidePageHeader
:
true
,
},
// 公告管理
{
path
:
'/memberCenter/contentAbility/announcements'
,
name
:
'announcements'
,
component
:
'@/pages/
memberCenter/contentAbility
/announcements'
component
:
'@/pages/
content
/announcements'
},
{
path
:
'/memberCenter/contentAbility/announcements/add'
,
name
:
'announceAdd'
,
component
:
'@/pages/
memberCenter/contentAbility
/announcements/announceInfo'
,
component
:
'@/pages/
content
/announcements/announceInfo'
,
hideInMenu
:
true
,
hidePageHeader
:
true
,
},
{
path
:
'/memberCenter/contentAbility/announcements/detail'
,
name
:
'announceInfo'
,
component
:
'@/pages/
memberCenter/contentAbility
/announcements/announceInfo'
,
component
:
'@/pages/
content
/announcements/announceInfo'
,
hideInMenu
:
true
,
hidePageHeader
:
true
,
},
...
...
src/constants/procurement.ts
View file @
13efecec
...
...
@@ -321,7 +321,9 @@ export enum DOORTYPE {
/** 渠道门户 */
PLACE_DOORTYPE
,
/** 采购门户 */
PROCUREMENT_DOORTYPE
PROCUREMENT_DOORTYPE
,
/** 自营门户 */
OWN_DOORTYPE
}
/** 年加工额 */
...
...
src/pages/commodity/products/addProducts.tsx
View file @
13efecec
...
...
@@ -271,6 +271,7 @@ const AddProducts: React.FC<{}> = (props) => {
goods
:
{
id
:
item
.
goodsId
},
attributeAndValueList
:
item
.
attributeAndValueList
,
unitPrice
:
item
.
unitPrice
,
priceRate
:
item
.
priceRate
,
commodityPic
:
productInfoByEdit
.
unitPriceAndPicList
[
index
].
commodityPic
}
})
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
13efecec
...
...
@@ -57,6 +57,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const
[
isTax
,
setIsTax
]
=
useState
<
boolean
>
(
true
)
// 是否含税
const
[
assistantUniquePrice
,
setAssistantUniquePrice
]
=
useState
<
any
>
(
0
)
// 副单价
const
[
assistantUniqueLadderPrice
,
setAssistantUniqueLadderPrice
]
=
useState
<
any
[]
>
([])
// 副阶梯单价
const
[
assistantUniquePriceRate
,
setAssistantUniquePriceRate
]
=
useState
<
any
>
(
0
)
// 副单价换算比率
const
[
combineAttributeChangeFatories
,
setCombineAttributeChangeFatories
]
=
useState
<
number
>
(
0
)
...
...
@@ -309,7 +310,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
width
:
200
,
render
:
(
text
,
record
)
=>
{
const
assistPrice
=
_tableDataSource
[
record
[
'索引'
]][
"副单价"
]
console
.
log
(
assistPrice
,
'assis'
)
if
(
assistPrice
&&
Array
.
isArray
(
assistPrice
))
{
return
assistPrice
.
map
(
p
=>
<
p
>
{
planPrice
===
3
?
p
:
`¥${p}`
}
</
p
>)
}
else
if
(
assistPrice
)
{
...
...
@@ -358,21 +358,38 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
_tempObj
[
'规格ID'
]
=
productInfoByEdit
.
unitPriceAndPicList
[
i
]?.
id
}
if
(
updateFlag
.
current
){
// 初次渲染tab 再次进入tab采用缓存数据
console
.
log
(
1
,
productInfoByEdit
.
unitPriceAndPicList
[
i
])
if
(
productInfoByEdit
.
unitPriceAndPicList
[
i
]?.
unitPrice
)
{
let
unitPric
=
productInfoByEdit
.
unitPriceAndPicList
[
i
]?.
unitPrice
_tempObj
[
'单价'
]
=
orderlyLadderPrice
(
unitPric
)
// _tempObj['单价'] = orderlyLadderPrice(unitPric)
const
_price
=
orderlyLadderPrice
(
unitPric
)
const
_priceRate
=
productInfoByEdit
.
unitPriceAndPicList
[
i
]?.
priceRate
console
.
log
(
_price
,
_priceRate
)
_tempObj
[
'单价'
]
=
_price
_tempObj
[
'副单价率'
]
=
_priceRate
setAssistantUniquePriceRate
(
_priceRate
)
const
_priceNumber
=
Object
.
keys
(
_price
)[
0
]
===
'0-0'
?
Object
.
values
(
_price
)[
0
]
:
Object
.
values
(
_price
)
_tempObj
[
'副单价'
]
=
Array
.
isArray
(
_priceNumber
)
?
_priceNumber
.
map
(
_p
=>
(
Number
(
_p
)
*
Number
(
_priceRate
)
/
100
).
toFixed
(
2
))
:
(
Number
(
_priceNumber
)
*
Number
(
_priceRate
)
/
100
).
toFixed
(
2
)
}
else
{
_tempObj
[
'单价'
]
=
{}
}
}
else
{
console
.
log
(
2
,
_tableDataSource
[
i
]
&&
tableDataSource
[
i
]
&&
tableDataSource
[
i
])
if
(
_tableDataSource
[
i
]
&&
tableDataSource
[
i
]
&&
tableDataSource
[
i
][
'单价'
])
{
let
unitPric
=
_tableDataSource
[
i
]
&&
tableDataSource
[
i
]
&&
tableDataSource
[
i
][
'单价'
]
_tempObj
[
'单价'
]
=
orderlyLadderPrice
(
unitPric
)
// _tempObj['单价'] = orderlyLadderPrice(unitPric)
const
_price
=
orderlyLadderPrice
(
unitPric
)
const
_priceRate
=
_tableDataSource
[
i
]
&&
tableDataSource
[
i
]
&&
tableDataSource
[
i
][
'副单价率'
]
console
.
log
(
_price
,
_priceRate
)
_tempObj
[
'单价'
]
=
_price
_tempObj
[
'副单价率'
]
=
_priceRate
setAssistantUniquePriceRate
(
_priceRate
)
_tempObj
[
'副单价'
]
=
(
Number
(
_price
)
*
Number
(
_priceRate
)
/
100
).
toFixed
(
2
)
}
else
{
_tempObj
[
'单价'
]
=
{}
}
}
}
else
{
}
else
{
_tempObj
[
'对应货品'
]
=
selectedGoods
.
length
>
0
?
selectedGoods
[
0
].
id
:
0
_tempObj
[
'单价'
]
=
_tableDataSource
[
i
]
&&
tableDataSource
[
i
]
&&
tableDataSource
[
i
][
'单价'
]
||
{}
}
...
...
@@ -417,9 +434,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
useEffect
(()
=>
{
constructedPrarams
()
if
(
priceModalVisible
)
{
setAssistantUniquePrice
(
0
)
}
},[
combineAttributeArray
,
attributeObjArr
,
attributeValObjArr
,
priceModalVisible
,
tableDataSource
])
/* 生成传输数据 */
...
...
@@ -463,19 +477,22 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
})
)
/* code3 end */
/* code2 end */
console
.
log
(
_tableDataSource
[
index
]
&&
_tableDataSource
[
index
][
'副单价率'
])
_paramsArray
.
push
({
goodsId
:
_tableDataSource
[
index
]
?
_tableDataSource
[
index
][
'对应货品'
]
:
0
,
attributeAndValueList
:
_tempArr
,
unitPrice
:
_tableDataSource
[
index
]
&&
_tableDataSource
[
index
][
'单价'
],
priceRate
:
_tableDataSource
[
index
]
&&
_tableDataSource
[
index
][
'副单价率'
],
id
:
_tableDataSource
[
index
]
&&
_tableDataSource
[
index
][
'规格ID'
],
})
/*带上货品id 带上单价*/
})
:
_paramsArray
.
push
({
goodsId
:
_tableDataSource
[
0
]
?
_tableDataSource
[
0
][
'对应货品'
]
:
0
,
attributeAndValueList
:
[],
unitPrice
:
_tableDataSource
[
0
]
&&
_tableDataSource
[
0
][
'单价'
],
priceRate
:
_tableDataSource
[
0
]
&&
_tableDataSource
[
0
][
'副单价率'
],
id
:
_tableDataSource
[
0
]
&&
_tableDataSource
[
0
][
'规格ID'
],
})
/*带上货品id 带上单价*/
/* code1 end */
console
.
log
(
_tableDataSource
,
'params'
,
_paramsArray
)
setPriceAttributeParams
(
_paramsArray
)
}
...
...
@@ -531,6 +548,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const
confirmPrice
=
()
=>
{
setPriceForm
.
validateFields
().
then
(
v
=>
{
setPriceModalVisible
(
false
)
console
.
log
(
v
,
'v'
)
const
{
ladderPrice
,
ladderRange
}
=
v
let
_priceRange
=
{}
if
(
ladderPrice
){
// 判断阶梯价格
...
...
@@ -540,20 +558,26 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
else
{
_priceRange
[
'0-0'
]
=
v
.
uniquePrice
}
console
.
log
(
v
,
assistantUniquePrice
,
assistantUniqueLadderPrice
)
let
_row
=
{
...
curretSetPriceRow
,
单价
:
_priceRange
,
副单价
:
ladderPrice
?
[...
assistantUniqueLadderPrice
]
:
assistantUniquePrice
}
let
_row
=
{
...
curretSetPriceRow
,
单价
:
_priceRange
,
副单价
:
ladderPrice
?
[...
assistantUniqueLadderPrice
]
:
assistantUniquePrice
,
副单价率
:
assistantUniquePriceRate
}
let
newTabeData
=
[...
_tableDataSource
]
if
(
isBatchSetting
){
// 判断是否批量设置价格
// _tableDataSource.map(_item => _item['单价'] = _priceRange)
_tableDataSource
.
forEach
(
_item
=>
{
_item
[
'单价'
]
=
_priceRange
_item
[
'副单价'
]
=
ladderPrice
?
[...
assistantUniqueLadderPrice
]
:
assistantUniquePrice
_item
[
'副单价率'
]
=
assistantUniquePriceRate
})
}
else
{
newTabeData
[
curretSetPriceRow
[
'索引'
]]
=
_row
}
_tableDataSource
=
newTabeData
setTableDataSource
(
_tableDataSource
)
console
.
log
(
_tableDataSource
,
'confirmPrice'
)
})
}
...
...
@@ -561,17 +585,22 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
setIsBatchSetting
(
false
)
// 点击行操作批量置为false
setCurrentSetPriceRow
(
record
)
setPriceModalVisible
(
true
)
//
console.log(record, 'record') // 通过判断key字符串'0-0' 是否是阶梯价格 注:空对象时候{}为新建状态
console
.
log
(
record
,
'record'
)
// 通过判断key字符串'0-0' 是否是阶梯价格 注:空对象时候{}为新建状态
setPriceForm
.
resetFields
()
// 先清空 若需要价格回显 在此处处理
if
(
Object
.
keys
(
record
[
'单价'
])[
0
]
===
'0-0'
)
{
// 状态为非阶梯价格
setLadderPrice
(
false
)
setPriceForm
.
setFieldsValue
({
ladderPrice
:
false
,
uniquePrice
:
Object
.
values
(
record
[
'单价'
])[
0
]})
const
p
=
Object
.
values
(
record
[
'单价'
])[
0
]
setPriceForm
.
setFieldsValue
({
ladderPrice
:
false
,
uniquePrice
:
p
})
setPriceForm
.
setFieldsValue
({
assistantUniquePriceRate
:
record
[
'副单价率'
]})
setAssistantUniquePrice
((
Number
(
p
||
0
)
*
Number
(
record
[
'副单价率'
]
||
0
)
/
100
).
toFixed
(
2
))
}
else
if
(
JSON
.
stringify
(
record
[
'单价'
])
===
'{}'
){
// 新建情况下默认为{}
setLadderPrice
(
false
)
setAssistantUniquePrice
(
0
)
}
else
{
// 否则编辑情况下
setLadderPrice
(
true
)
let
numberArray
=
Object
.
keys
(
record
[
'单价'
]).
map
(
item
=>
item
.
split
(
'-'
).
map
(
_
=>
Number
(
_
)))
let
priceArray
=
Object
.
values
(
record
[
'单价'
])
setPriceForm
.
setFieldsValue
({
assistantUniquePriceRate
:
record
[
'副单价率'
]})
// 截取范围数组中第一个和最小起订 做对比,变动则重置阶梯数量
let
minOrder
=
priceForm
.
getFieldValue
(
'minOrder'
)
if
(
numberArray
[
0
][
0
]
===
minOrder
){
...
...
@@ -579,6 +608,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
numberArray
.
map
((
_item
,
_index
)
=>
{
tempArr
.
push
({
numberPrice
:
priceArray
[
_index
],
numberRange
:
{
numberMin
:
_item
[
0
],
numberMax
:
_item
[
1
]
}
})
})
setAssistantUniqueLadderPrice
(()
=>
tempArr
.
map
(
_item
=>
(
Number
(
_item
.
numberPrice
)
*
Number
(
record
[
'副单价率'
])
/
100
).
toFixed
(
2
)))
setPriceForm
.
setFieldsValue
({
ladderPrice
:
true
,
ladderRange
:
tempArr
})
}
else
{
let
tempArr
=
[];
...
...
@@ -645,7 +675,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
const
formValueChange
=
(
changeValue
,
values
)
=>
{
console
.
log
(
values
,
'vvv'
)
if
(
values
.
ladderPrice
)
{
setAssistantUniqueLadderPrice
(()
=>
{
return
values
?.
ladderRange
?
values
.
ladderRange
.
map
(
item
=>
{
...
...
@@ -659,6 +688,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
else
{
setAssistantUniquePrice
((
Number
(
values
[
'uniquePrice'
]
||
0
)
*
Number
(
values
[
'assistantUniquePriceRate'
]
||
0
)
/
100
).
toFixed
(
2
))
}
setAssistantUniquePriceRate
(
values
[
'assistantUniquePriceRate'
])
}
useEffect
(()
=>
{
...
...
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
13efecec
...
...
@@ -25,8 +25,6 @@ const { RangePicker } = DatePicker
let
paramsArray
=
[];
const
isEdit
=
history
.
location
.
query
?.
id
const
ProductAttributeForm
:
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
const
{
attributesData
,
onRef
}
=
props
const
[
isClearFormAndDataInEdit
,
setIsClearFormAndDataInEdit
]
=
useState
<
boolean
>
(
false
)
// 编辑情况下 是否要清空商品属性表单数据和页面全局数据
...
...
@@ -45,7 +43,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
useEffect
(()
=>
{
onRef
(
productAttributeFormRef
)
// 编辑情况下 构建选中属性数据 给paramsArray初始化数据用于编辑 设置表单数据
if
(
isEdit
){
if
(
history
.
location
.
query
?.
id
){
constructProductSelectAttribute
()
attributeForm
.
setFieldsValue
(
getProductAttributeFormParamsByEdit
)
}
...
...
@@ -53,7 +51,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
useEffect
(()
=>
{
// 属性变动 表明品类品牌变动 清空页面全局参数组合和store的选中属性 重置表单 (只对新增有效)
if
(
isEdit
){
if
(
history
.
location
.
query
?.
id
){
// 编辑第一次执行不清空,之后的变动需要清空
if
(
isClearFormAndDataInEdit
){
paramsArray
=
[]
...
...
@@ -150,7 +148,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
let
_isPrice
=
null
let
_isUpdateAttribute
=
null
let
_isDisabled
=
false
if
(
isEdit
){
if
(
history
.
location
.
query
?.
id
){
_isPrice
=
attrItem
.
isPrice
_isUpdateAttribute
=
productInfoByEdit
.
isUpdateAttribute
_isDisabled
=
_isPrice
&&
!
_isUpdateAttribute
...
...
@@ -268,7 +266,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
<
Tabs
defaultActiveKey=
"1"
tabPosition=
"left"
>
{
attributesData
?.
length
>
0
&&
attributesData
.
map
(
attributeItem
=>
isEdit
&&
!
productInfoByEdit
.
isUpdateAttribute
&&
(
attributeItem
.
createTime
>
productInfoByEdit
.
createTime
)
?
null
:
<
TabPane
tab=
{
attributeItem
.
name
}
key=
{
attributeItem
.
id
}
>
!
productInfoByEdit
?.
isUpdateAttribute
&&
(
attributeItem
?.
createTime
>
productInfoByEdit
?
.
createTime
)
?
null
:
<
TabPane
tab=
{
attributeItem
.
name
}
key=
{
attributeItem
.
id
}
>
{
renderTabPanchildren
(
attributeItem
)
}
...
...
src/pages/commodity/products/index.tsx
View file @
13efecec
...
...
@@ -363,23 +363,26 @@ const Products: React.FC<{}> = () => {
console
.
log
(
'取消删除'
)
}
const
onChangeUpShop
=
(
values
)
=>
{
const
onChangeUpShop
=
async
(
values
)
=>
{
console
.
log
(
values
,
'values'
)
// 全是自营商城 无需判断
// 商城属性: 1.B端商城 2.C端商城 3.B端自营商城 4.C端自营商城。为null的话就不是自营商城。
if
(
values
.
every
(
item
=>
item
.
property
===
3
||
item
.
property
===
4
))
{
setCheckedValues
(
values
)
return
;
}
// 判断上架之前是否有店铺 有即可以上下架
if
(
judgeShopRef
.
current
){
PublicApi
.
getTemplateWebMemberShopWebFindCurrMemberShop
({
memberId
:
getAuth
().
memberId
,
memberRoleId
:
getAuth
().
memberRoleId
}).
then
(
res
=>
{
if
(
res
.
data
?.
id
){
setShopId
(
res
.
data
)
setCheckedValues
(
values
)
}
else
{
message
.
error
(
'您还还未创建店铺,请先创建店铺!'
)
setTimeout
(()
=>
{
history
.
push
(
'/memberCenter/shopAbility/infoManage'
)
},
1000
)
}
})
const
{
data
}
=
await
PublicApi
.
getTemplateWebMemberShopWebFindCurrMemberShop
({
memberId
:
getAuth
().
memberId
,
memberRoleId
:
getAuth
().
memberRoleId
})
if
(
data
?.
id
)
{
setShopId
(
data
)
setCheckedValues
(
values
)
}
else
{
message
.
error
(
'您还还未创建店铺,请先创建店铺!'
)
setTimeout
(()
=>
{
history
.
push
(
'/memberCenter/shopAbility/infoManage'
)
},
1000
)
}
judgeShopRef
.
current
=
false
}
else
{
setCheckedValues
(
values
)
...
...
@@ -407,7 +410,8 @@ const Products: React.FC<{}> = () => {
if
(
isUp
)
{
if
(
checkedValues
.
length
>
0
){
const
fn
=
isBatch
?
PublicApi
.
postProductCommodityPublishCommodityBatch
:
PublicApi
.
postProductCommodityPublishCommodity
fn
(
isBatch
?
{
storeId
:
shopId
[
'id'
],
storeName
:
shopId
[
'name'
],
shopList
:
checkedValues
,
idList
:
currentRef
.
current
}
:
{
storeId
:
shopId
[
'id'
],
storeName
:
shopId
[
'name'
],
...
params
}).
then
(
res
=>
{
// @ts-ignore
fn
(
isBatch
?
{
storeId
:
shopId
[
'id'
],
storeName
:
shopId
[
'name'
],
shopList
:
checkedValues
,
idList
:
currentRef
.
current
}
:
{
storeId
:
shopId
?.
id
||
null
,
storeName
:
shopId
?.
name
||
null
,
...
params
}).
then
(()
=>
{
setUpDownModal
(
false
)
ref
.
current
.
reload
()
setIsDisabledOKbtn
(
false
)
...
...
src/pages/content/category/schema.tsx
View file @
13efecec
...
...
@@ -28,19 +28,18 @@ export const classSchema: ISchema = {
title
:
'分类名称'
,
required
:
true
,
"x-component-props"
:
{
placeholder
:
'请输入
品
类名称'
placeholder
:
'请输入
分
类名称'
},
"x-rules"
:
[
{
limitByte
:
true
,
maxByte
:
16
maxByte
:
20
}
]
},
describe
:
{
type
:
'textarea'
,
title
:
'类型'
,
required
:
true
,
"x-component-props"
:
{
placeholder
:
'最多100个字符,50个汉字'
},
...
...
src/pages/content/infomation/infomationInfo.tsx
View file @
13efecec
...
...
@@ -44,6 +44,8 @@ const InfomationInfo = () => {
const
initialValues
=
useInitialValues
({
id
:
id
},
PublicApi
.
getManageMemberInformationGet
);
const
[
category
,
setCategory
]
=
useState
<
any
>
([]);
const
[
column
,
setColumn
]
=
useState
<
ColumnListType
[]
>
([])
const
[
recommendLabelValue
,
setRecommendLabelValue
]
=
useState
<
number
>
();
const
isEdit
=
id
&&
!
preview
;
const
isAdd
=
!
id
&&
!
preview
;
const
isView
=
id
&&
preview
;
...
...
@@ -142,13 +144,17 @@ const InfomationInfo = () => {
: PublicApi.postManageMemberInformationUpdate
const postData = isAdd ? tempPostData : {...tempPostData, id: id};
console.log(`
postData
`, postData)
setSubmitLoading(true)
setUnsaved(false)
serviceActions(postData).then((data) => {
setSubmitLoading(false);
if(data.code === 1000) {
history.push('/memberCenter/contentAbility/infomations')
} else {
setSubmitLoading(false)
}
}).catch(() => {
setSubmitLoading(false)
})
}
...
...
@@ -199,7 +205,16 @@ const InfomationInfo = () => {
state.props['x-component-props']!["options"] = list;
})
})
onFieldValueChange$('recommendLabel').subscribe(({ value }) => {
console.log(`
recommendLabel
value
`, value)
setRecommendLabelValue(value)
actions.setFieldState('imageUrl', state => {
state.props["x-rules"] = [1, 2, 3, 4, 6].includes(value) ? {
"required": true,
"message": "请上传图片"
} : {}
})
})
}}
expressionScope={{
tagOnChange: (value) => {
...
...
@@ -208,7 +223,7 @@ const InfomationInfo = () => {
label: (
<div>
{
isAdd || isEdit
(isAdd || isEdit) && [1, 2, 3, 4, 6].includes(recommendLabelValue)
? <span style={{color: '#ff4d4f'}}>* </span>
: null
}
...
...
src/pages/content/infomation/schema/infomationInfoSchema.tsx
View file @
13efecec
...
...
@@ -219,10 +219,6 @@ const schema = {
// onChange: "{{uploadImage}}",
fileMaxSize
:
300
},
"x-rules"
:
{
"required"
:
true
,
"message"
:
"请上传图片"
},
},
digest
:
{
type
:
'string'
,
...
...
src/pages/content/tagsManagement/schema/index.tsx
View file @
13efecec
...
...
@@ -3,7 +3,7 @@ import EyePreview from '@/components/EyePreview';
const
columns
=
[
{
title
:
'ID'
,
dataIndex
:
'id'
},
{
title
:
'标签名称'
,
dataIndex
:
'name'
,
title
:
'标签名称'
,
dataIndex
:
'name'
,
render
:
(
text
:
string
,
record
:
any
)
=>
(
<
EyePreview
url=
{
`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}&preview=1`
}
...
...
@@ -51,9 +51,9 @@ const schema = {
name
:
'search'
,
'x-component'
:
'CustomSearch'
,
'x-component-props'
:
{
placeholder
:
"请填写
栏目
名称"
,
placeholder
:
"请填写
标签
名称"
,
"onSearch"
:
"{{search}}"
,
}
},
searchBtn
:
{
...
...
@@ -70,7 +70,7 @@ const schema = {
},
}
}
}
},
"table"
:
{
...
...
@@ -102,4 +102,4 @@ const schema = {
}
}
export
default
schema
;
\ No newline at end of file
export
default
schema
;
src/pages/ownMall/ownMallManager/ownMallAboutUs/index.less
View file @
13efecec
...
...
@@ -6,11 +6,21 @@
}
.mallLink {
display: flex;
align-items: center;
font-size: 12px;
color: #91959B;
& > span {
color: #252D37;
}
.link {
padding: 0 5px;
}
}
.copy_icon {
cursor: pointer;
}
}
\ No newline at end of file
}
src/pages/ownMall/ownMallManager/ownMallAboutUs/index.tsx
View file @
13efecec
import
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
Tabs
,
Form
,
Button
,
Card
,
Select
,
Input
,
Tooltip
,
Typography
,
Row
,
Col
,
Anchor
}
from
'antd'
;
import
{
Form
,
Button
,
Card
,
Select
,
Input
,
Tooltip
,
Typography
,
Row
,
Col
,
message
}
from
'antd'
;
import
RequireItem
from
'@/components/RequireItem'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
Prompt
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
QuestionCircleOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
PeripheralLayout
from
'@/pages/transaction/components/detailLayout'
;
import
{
CopyOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
validatorByte
}
from
'@/utils/regExp'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PAGE_TYPE
,
PAGE_TYPE_OPTIONS
}
from
'./constant
'
import
copy
from
'copy-to-clipboard
'
import
TabAnchor
from
'@/components/TabAnchor'
import
CitySelect
from
'@/components/CitySelect'
import
ImgUpload
,
{
imgUploadRefProps
}
from
'@/components/ImgUpload'
...
...
@@ -37,6 +35,12 @@ const tabLink = [
{
id
:
'4'
,
title
:
'宣传画册'
},
]
const
handleCopyLinke
=
(
link
:
string
)
=>
{
if
(
copy
(
link
))
{
message
.
success
(
'复制成功!'
)
}
}
const
defaultCityData
=
{
index
:
0
,
provinceCode
:
0
,
province
:
''
,
cityCode
:
0
,
city
:
''
}
const
OwnMallAboutUs
=
()
=>
{
...
...
@@ -77,7 +81,7 @@ const OwnMallAboutUs = () => {
temp
.
push
(
item
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
member
Channel
Areas
:
temp
member
Shop
Areas
:
temp
})
}
...
...
@@ -86,14 +90,14 @@ const OwnMallAboutUs = () => {
temp
=
temp
.
filter
((
item
:
any
)
=>
item
.
index
!==
index
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
member
Channel
Areas
:
temp
member
Shop
Areas
:
temp
})
}
const
handleCityChange
=
(
data
:
any
)
=>
{
setSelectCityData
(
data
)
form
.
setFieldsValue
({
member
Channel
Areas
:
data
member
Shop
Areas
:
data
})
}
...
...
@@ -117,7 +121,7 @@ const OwnMallAboutUs = () => {
}
console
.
log
(
`params`
,
params
)
setSaveLoading
(
true
)
PublicApi
.
post
ManageShopAboutSubmit
(
params
).
then
(
res
=>
{
PublicApi
.
post
TemplateWebMemberSelfWebSaveCurrMemberSelf
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setIsFormChange
(
false
)
}
...
...
@@ -129,7 +133,7 @@ const OwnMallAboutUs = () => {
// 根据站点获取自营商城
const
getAllMallList
=
()
=>
{
PublicApi
.
getManageWebShopWebFindWebEnterpriseSelfShop
({
siteId
}).
then
(
res
=>
{
PublicApi
.
getManageWebShopWebFindWebEnterpriseSelfShop
({
siteId
:
String
(
siteId
)
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
data
=
res
.
data
.
map
(
item
=>
{
return
{
...
...
@@ -144,9 +148,9 @@ const OwnMallAboutUs = () => {
})
}
// 获取关于我们详情
// 获取
自营商城
关于我们详情
const
getAboutUsInfo
=
()
=>
{
PublicApi
.
get
ManageShopAboutGet
().
then
(
res
=>
{
PublicApi
.
get
TemplateWebMemberSelfWebFindCurrMemberSelf
().
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
&&
data
)
{
const
{
albumName
,
albumUrl
,
honorPics
,
workshopPics
,
...
rest
}
=
data
...
...
@@ -161,7 +165,7 @@ const OwnMallAboutUs = () => {
setIsFormChange
(
false
)
setAlbumUrls
(
newAlbumUrls
)
setSelectCityData
(
rest
.
member
Channel
Areas
)
setSelectCityData
(
rest
.
member
Shop
Areas
)
setMallUrl
(
rest
.
url
)
}
})
...
...
@@ -196,7 +200,7 @@ const OwnMallAboutUs = () => {
</
Col
>
<
Col
span=
{
12
}
>
<
Form
.
Item
name=
'member
Channel
Areas'
name=
'member
Shop
Areas'
label=
{
<
RequireItem
label=
"业务覆盖地市"
isRequire=
{
true
}
/>
}
rules=
{
[
{
required
:
true
,
message
:
"请选择业务覆盖地市"
}
...
...
@@ -216,7 +220,13 @@ const OwnMallAboutUs = () => {
<
Form
.
Item
name=
'shopId'
>
<
Select
placeholder=
'请选择自营商城'
allowClear
options=
{
allMallList
}
onChange=
{
selectMall
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
'url'
><
div
className=
{
styles
.
mallLink
}
>
当前自营商城链接:
<
span
>
{
mallUrl
}
</
span
></
div
></
Form
.
Item
>
<
Form
.
Item
name=
'url'
>
<
div
className=
{
styles
.
mallLink
}
>
<
span
>
当前自营商城链接:
</
span
>
<
span
className=
{
styles
.
link
}
>
{
mallUrl
||
'-'
}
</
span
>
{
mallUrl
&&
<
Tooltip
title=
'复制'
><
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
mallUrl
)
}
/></
Tooltip
>
}
</
div
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Row
>
...
...
src/pages/ownMall/ownMallManager/ownMallSeo/add.tsx
View file @
13efecec
import
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
Tabs
,
Form
,
Button
,
Card
,
Select
,
Input
,
Tooltip
,
Typography
,
Row
,
Col
,
Anchor
}
from
'antd'
;
/*
* @Author: Crayon
* @Date: 2021-09-28 13:55:40
* @LastEditTime: 2021-10-19 14:30:13
* @LastEditors: Crayon
* @Description: 自营商城seo信息新增/修改
* @FilePath: \lingxi-business-paltform\src\pages\ownMall\ownMallManager\ownMallSeo\add.tsx
*/
import
{
useEffect
,
useState
}
from
'react'
;
import
{
Form
,
Button
,
Card
,
Select
,
Input
,
Tooltip
,
Typography
,
Row
,
Col
}
from
'antd'
;
import
RequireItem
from
'@/components/RequireItem'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
QuestionCircleOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
PeripheralLayout
from
'@/pages/transaction/components/detailLayout'
;
import
{
validatorByte
}
from
'@/utils/regExp'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PAGE_TYPE
,
PAGE_TYPE_OPTIONS
}
from
'./constant'
import
{
DOORTYPE
}
from
'@/constants/procurement'
import
TabAnchor
from
'@/components/TabAnchor'
import
styles
from
'./index.less'
...
...
@@ -43,18 +51,21 @@ const SeoAdd = () => {
const
params
=
{
id
,
name
:
PAGE_TYPE
[
values
.
type
],
doorType
:
DOORTYPE
.
OWN_DOORTYPE
,
// 门户类型:1-店铺门户 2-渠道门户 3-采购门户 4-自营门户
...
values
,
}
setSaveLoading
(
true
)
const
requestApi
=
id
?
PublicApi
.
post
ManageActivityShopSeoUpdate
:
PublicApi
.
postManageActivityShopSeo
Add
const
requestApi
=
id
?
PublicApi
.
post
TemplateWebSeoWebUpdate
:
PublicApi
.
postTemplateWebSeoWeb
Add
requestApi
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setIsFormChange
(
false
)
setTimeout
(()
=>
{
history
.
goBack
()
},
500
)
}
else
{
setSaveLoading
(
false
)
}
}).
finally
(()
=>
{
}).
catch
(()
=>
{
setSaveLoading
(
false
)
})
})
...
...
@@ -62,7 +73,7 @@ const SeoAdd = () => {
useEffect
(()
=>
{
if
(
id
)
{
PublicApi
.
get
ManageActivityShopSeo
Get
({
id
}).
then
(
res
=>
{
PublicApi
.
get
TemplateWebSeoWeb
Get
({
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
form
.
setFieldsValue
(
res
.
data
)
}
...
...
@@ -90,8 +101,8 @@ const SeoAdd = () => {
<
Col
span=
{
12
}
>
<
Form
.
Item
name=
'type'
label=
{
<
RequireItem
label=
"页面
名称
"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择页面
名称
"
}]
}
label=
{
<
RequireItem
label=
"页面
类型
"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择页面
类型
"
}]
}
>
<
Select
options=
{
PAGE_TYPE_OPTIONS
}
disabled=
{
isView
}
/>
</
Form
.
Item
>
...
...
@@ -152,4 +163,4 @@ const SeoAdd = () => {
)
}
export
default
SeoAdd
\ No newline at end of file
export
default
SeoAdd
src/pages/ownMall/ownMallManager/ownMallSeo/index.tsx
View file @
13efecec
...
...
@@ -13,6 +13,7 @@ import NiceForm from '@/components/NiceForm';
import
{
PlusOutlined
}
from
'@ant-design/icons'
import
{
PublicApi
}
from
'@/services/api'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
DOORTYPE
}
from
'@/constants/procurement'
const
formActions
=
createFormActions
();
...
...
@@ -118,18 +119,17 @@ const SeoList: React.FC<{}> = () => {
// 停用/启用
const
handleModify
=
async
(
record
:
any
)
=>
{
await
PublicApi
.
post
ManageActivityShopSeo
UpdateStatus
({
await
PublicApi
.
post
TemplateWebSeoWeb
UpdateStatus
({
id
:
record
.
id
,
enableS
tatus
:
record
.
status
===
1
?
0
:
1
s
tatus
:
record
.
status
===
1
?
0
:
1
})
ref
.
current
.
reload
()
}
// 删除
const
handleDelete
=
async
(
id
)
=>
{
const
res
=
await
PublicApi
.
getManageActivityShopSeo
Delete
({
id
})
const
res
=
await
PublicApi
.
postTemplateWebSeoWeb
Delete
({
id
})
if
(
res
.
code
===
1000
)
{
message
.
success
(
'删除成功'
)
ref
.
current
.
reload
()
}
}
...
...
@@ -137,7 +137,7 @@ const SeoList: React.FC<{}> = () => {
// 获取列表
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
)
=>
{
PublicApi
.
get
ManageActivityShopSeoPage
({
...
params
}).
then
(
res
=>
{
PublicApi
.
get
TemplateWebSeoWebPage
({
doorType
:
DOORTYPE
.
OWN_DOORTYPE
,
...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
...
...
src/pages/priceManage/priceStrategy/component/priceSetting.tsx
View file @
13efecec
...
...
@@ -17,6 +17,8 @@ import { constructTableData, transformDataForNiceForm } from '../../effect'
import
PriceModal
from
'./priceModal'
import
ProductModal
from
'./productModal'
import
MemberModal
from
'./memberModal'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
fectchShopListsSource
}
from
'@/utils/type'
const
{
Search
}
=
Input
...
...
@@ -27,8 +29,12 @@ export interface PriceSettingProps {
formSubmit
?(
values
),
}
const
PriceSetting
:
React
.
FC
<
PriceSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{
}
}
=
props
const
fetchShopLists
=
async
()
=>
{
return
await
fectchShopListsSource
({
type
:
1
})
}
const
PriceSetting
:
React
.
FC
<
PriceSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{}
}
=
props
const
priceRef
=
useRef
<
any
>
({})
const
productRef
=
useRef
<
any
>
({})
const
memberRef
=
useRef
<
any
>
({})
...
...
@@ -225,14 +231,14 @@ const PriceSetting: React.FC<PriceSettingProps> = (props) => {
FormEffectHooks
.
onFormInputChange$
().
subscribe
(()
=>
{
onFieldChange
()
})
useAsyncSelect
(
'shopId'
,
fetchShopLists
,
[
'name'
,
'id'
])
$
(
'onFieldValueChange'
,
'shopId'
).
subscribe
(
parentState
=>
{
if
(
parentState
.
value
)
{
ctx
.
setFieldState
(
'shopId'
,
state
=>
{
// state.dataSource = pageStatus === PageStatus.PREVIEW ?
// GlobalConfig.web.shopInfo.filter(v => v.id === parentState.value && state.value.includes(v.id))
// :
state
.
dataSource
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
id
===
parentState
.
value
)
//
state.dataSource = GlobalConfig.web.shopInfo.filter(v => v.id === parentState.value)
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
state
.
props
[
'x-component-props'
].
disabled
=
true
;
...
...
src/pages/transaction/purchaseOrder/constant/index.tsx
View file @
13efecec
...
...
@@ -3,6 +3,7 @@ import { history } from 'umi'
import
{
formatTimeString
}
from
'@/utils'
import
StatusColors
from
'../components/statusColors'
import
EyePreview
from
'@/components/EyePreview'
import
{
ORDER_TYPE_CHANNEL_POINTS
,
ORDER_TYPE_POINTS
}
from
'@/constants/order'
export
const
baseOrderListColumns
:
any
=
()
=>
{
...
...
@@ -49,7 +50,7 @@ export const baseOrderListColumns: any = () => {
dataIndex
:
'amount'
,
key
:
'amount'
,
ellipsis
:
true
,
render
:
(
t
)
=>
`¥
${
t
}
`
render
:
(
t
,
r
)
=>
(
r
.
orderType
===
ORDER_TYPE_POINTS
||
r
.
orderType
===
ORDER_TYPE_CHANNEL_POINTS
)
?
t
:
`¥
${
t
}
`
},
{
title
:
'订单类型'
,
...
...
src/pages/transaction/purchaseOrder/index.tsx
View file @
13efecec
...
...
@@ -19,6 +19,9 @@ import { useHttpRequest } from '@/hooks/useHttpRequest'
import
TableOperation
from
'@/components/TableOperation'
import
{
ORDER_TYPE_POINTS
}
from
'@/constants/order'
import
axios
from
'axios'
import
{
getAuth
}
from
'@/utils/auth'
import
moment
from
'moment'
const
SelectStyles
=
styled
((
props
)
=>
<
div
className=
'select-list'
{
...
props
}
></
div
>)
`
.select_style_border {
...
...
@@ -61,6 +64,7 @@ const fetchTableData = async (params) => {
const
formActions
=
createFormActions
();
const
destroyActions
=
createFormActions
()
const
adjustActions
=
createFormActions
();
// const showDataSource = [
// { id: 1, name: "换货"},
...
...
@@ -75,6 +79,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
[
orderType
,
setOrderType
]
=
useState
<
any
>
()
const
ref
=
useRef
<
any
>
({})
const
destoryRef
=
useRef
<
any
>
({})
const
adjustRef
=
useRef
<
any
>
({})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderBuyerCancel
)
const
[
showDataSource
,
setShowDataSource
]
=
useState
([
{
id
:
1
,
name
:
"换货"
},
...
...
@@ -82,6 +87,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
{
id
:
3
,
name
:
"维修"
},
])
const
[
fetchParams
,
setFetchParams
]
=
useState
<
any
>
()
const
{
token
,
memberId
,
memberRoleId
}
=
(
getAuth
()
||
{})
const
loadingTableData
=
(
params
)
=>
{
setFetchParams
(
params
)
...
...
@@ -153,13 +159,15 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
buttonGroup
=
{
'取消订单'
:
record
.
showCancel
,
'售后'
:
record
.
showAfterSales
,
'评价'
:
record
.
showComment
'评价'
:
record
.
showComment
,
'调整送货时间'
:
record
.
showModifyDeliverTime
}
const
operationHandler
=
{
'取消订单'
:
()
=>
handleCancel
(
record
.
orderId
),
'售后'
:
()
=>
handleSaleAfter
(
record
),
'评价'
:
()
=>
handleEvaluate
(
record
.
orderId
),
'调整送货时间'
:
()
=>
handleAdjust
(
record
)
}
return
(
...
...
@@ -185,24 +193,72 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
}
}
const
handleExport
=
async
()
=>
{
const
downloadLink
=
document
.
createElement
(
'a'
)
// const data = await PublicApi.getOrderBuyerExport({...fetchParams}, {extendsOptions: { responseType: "blob" }})
const
data
=
await
axios
.
get
(
'/order/buyer/export'
,
{
params
:
{...
fetchParams
},
headers
:
{
"Content-Type"
:
"application/vnd.ms-excel;charset=UTF-8"
},
responseType
:
'blob'
console
.
log
(
`
${
process
.
env
.
BACK_GATEWAY
}
/order/vendor/export?token=
${
token
}
`
)
window
.
open
(
`
${
process
.
env
.
BACK_GATEWAY
}
/order/buyer/export?token=
${
token
}
`
,
'_blank'
)
// const downloadLink = document.createElement('a')
// downloadLink.style.display = 'none';
// downloadLink.href = `${process.env.BACK_GATEWAY}order/buyer/export?token=${token}`;
// downloadLink.target = '_blank'
// document.body.appendChild(downloadLink)
// downloadLink.click()
// document.body.removeChild(downloadLink)
// axios({
// method: 'GET',
// url: '/order/buyer/export',
// params: {...fetchParams},
// responseType: 'blob',
// headers: {
// token,
// 'contentType': 'application/vnd.ms-excel;charset=UTF-8'
// },
// }).then(res => {
// console.log(res, res['headers'])
// // @ts-ignore
// let blob = new Blob([res.data], {type: "application/vnd.ms-excel;charset=utf-8"});
// downloadLink.style.display = 'none';
// downloadLink.href = URL.createObjectURL(blob);
// downloadLink.download = '采购订单列表.xls'
// document.body.appendChild(downloadLink)
// downloadLink.click()
// document.body.removeChild(downloadLink)
// }).catch(err => {
// console.log(err)
// })
}
const
handleAdjust
=
async
(
record
)
=>
{
adjustRef
.
current
.
setVisible
(
true
)
const
{
code
,
data
}
=
await
PublicApi
.
getOrderBuyerGetDeliveryTime
({
shopId
:
record
.
shopId
,
orderId
:
record
.
orderId
})
if
(
code
===
1000
)
{
adjustActions
.
setFieldValue
(
'orderId'
,
record
.
orderId
)
adjustActions
.
setFieldValue
(
'reason'
,
data
.
reason
)
adjustActions
.
setFieldValue
(
'deliverDate'
,
data
.
deliverDate
)
adjustActions
.
setFieldState
(
'timeLine'
,
prevState
=>
{
prevState
.
visible
=
data
.
isShow
})
}
}
const
handleSubmitAdjust
=
()
=>
{
adjustActions
.
submit
().
then
(
async
({
values
}:
any
)
=>
{
console
.
log
(
values
,
'adjust'
)
const
result
=
await
PublicApi
.
postOrderBuyerUpdateDeliveryTime
(
values
)
if
(
result
.
code
===
1000
)
{
adjustActions
.
reset
()
adjustRef
.
current
.
setVisible
(
false
)
setTimeout
(()
=>
{
ref
.
current
.
reload
()
},
800
)
}
})
// @ts-ignore
let
blob
=
new
Blob
([
data
],
{
type
:
'application/vnd.ms-excel'
})
downloadLink
.
style
.
display
=
'none'
;
downloadLink
.
href
=
URL
.
createObjectURL
(
blob
);
downloadLink
.
download
=
'采购订单列表.xls'
document
.
body
.
appendChild
(
downloadLink
)
downloadLink
.
click
()
document
.
body
.
removeChild
(
downloadLink
)
}
const
resetAdjustSelect
=
()
=>
{
adjustActions
.
reset
()
}
const
controllerBtns
=
<
Button
style=
{
{
width
:
140
}
}
onClick=
{
handleExport
}
type=
'default'
>
导出
</
Button
>
...
...
@@ -309,6 +365,83 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
}
}
modalProps=
{
{
confirmLoading
:
loading
}
}
/>
{
/* 调整送货时间 */
}
<
ModalForm
modalTitle=
'调整送货时间'
currentRef=
{
adjustRef
}
confirm=
{
handleSubmitAdjust
}
cancel=
{
resetAdjustSelect
}
actions=
{
adjustActions
}
// className={styles.adjustModal}
schema=
{
{
type
:
'object'
,
properties
:
{
NO_SUBMIT
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
labelAlign
:
'top'
,
},
properties
:
{
orderId
:
{
type
:
'number'
,
title
:
'当前id'
,
visible
:
false
,
},
deliverDate
:
{
type
:
'string'
,
"x-component"
:
'date'
,
title
:
'送货时间'
,
required
:
true
,
"x-component-props"
:
{
disabledDate
:
current
=>
{
return
current
&&
current
<
moment
().
startOf
(
'day'
)
},
showTime
:
true
,
style
:
{
width
:
'100%'
}
}
},
timeLine
:
{
title
:
'时间段'
,
type
:
'radio'
,
enum
:
[
{
label
:
'审核通过'
,
value
:
1
},
{
label
:
'审核不通过'
,
value
:
0
},
],
"x-component-props"
:
{
disabled
:
false
,
optionType
:
'button'
,
// className: styles.adjustFormItem
},
},
reason
:
{
type
:
'textarea'
,
"x-component-props"
:
{
rows
:
4
,
placeholder
:
'在此输入你的原因, 最多50个汉字'
},
title
:
'调整原因'
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请输入调整原因'
},
{
limitByte
:
true
,
maxByte
:
100
}
]
}
}
}
}
}
}
effects=
{
(
$
,
actions
)
=>
{
$
(
'onFormInit'
).
subscribe
(()
=>
{
})
}
}
/>
</
PageHeaderWrapper
>
}
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/components/inquiryModalTable/index.tsx
View file @
13efecec
...
...
@@ -42,9 +42,8 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
const
handleConfirm
=
async
()
=>
{
const
item
=
rowSelectionCtl
.
selectRow
[
0
]
console
.
log
(
item
,
'item'
)
if
(
item
)
{
schemaAction
.
setFieldValue
(
'quoteNo'
,
item
.
quotationNo
)
schemaAction
.
setFieldValue
(
'quoteId'
,
item
.
id
)
const
data
=
await
fetchOrderApi
.
getProductListByQuotationOrderId
({
id
:
item
.
inquiryListId
})
...
...
@@ -53,16 +52,19 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
v
.
memberId
=
item
.
offerMemberId
v
.
memberRoleId
=
item
.
offerMemberRoleId
v
.
orderMode
=
schemaAction
.
getFieldValue
(
'orderMode'
)
v
.
shopId
=
schemaAction
.
getFieldValue
(
'shopId'
)
v
.
shopId
=
item
[
'shopId'
]
// b2b询价下单 定价类型必定为2
v
.
priceType
=
2
return
v
})
schemaAction
.
setFieldValue
(
'quoteNo'
,
item
.
quotationNo
)
schemaAction
.
setFieldValue
(
'quoteId'
,
item
.
id
)
schemaAction
.
setFieldValue
(
'vendorRoleId'
,
item
.
offerMemberRoleId
)
schemaAction
.
setFieldValue
(
'products'
,
await
filterProductDataById
([],
newData
))
schemaAction
.
setFieldValue
(
'vendorMemberName'
,
item
.
offerMemberName
)
schemaAction
.
setFieldValue
(
'vendorMemberId'
,
item
.
offerMemberId
)
schemaAction
.
setFieldValue
(
'vendorRoleId'
,
item
.
offerMemberRoleId
)
schemaAction
.
setFieldValue
(
'shopId'
,
item
[
'shopId'
])
// 询价单回显订单明细
schemaAction
.
setFieldValue
(
'digest'
,
item
.
details
)
}
...
...
@@ -76,7 +78,7 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
visible=
{
visible
}
confirm=
{
handleConfirm
}
cancel=
{
()
=>
setVisible
(
false
)
}
fetchTableData=
{
async
(
params
)
=>
(
await
PublicApi
.
getTransactionNotarizeEnquiryProductQuotationList
({...
params
,
externalState
:
4
,
shopId
:
schemaAction
.
getFieldValue
(
'shopId'
)
})).
data
}
fetchTableData=
{
async
(
params
)
=>
(
await
PublicApi
.
getTransactionNotarizeEnquiryProductQuotationList
({...
params
,
externalState
:
4
})).
data
}
rowSelection=
{
rowSelection
}
modalType=
'inquiryByDefault'
searchName=
"quotationNo"
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/effects/index.ts
View file @
13efecec
...
...
@@ -65,7 +65,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
const
productItem
=
value
[
0
]
if
(
pageStatus
===
PageStatus
.
ADD
)
{
// 新增下 需要支付信息生成支付次数
ctx
.
setFieldValue
(
'payments'
,
[])
// 变动后先 清空支付信息
const
shopId
=
ctx
.
getFieldValue
(
'shopId'
)
const
shopId
=
productItem
[
'shopId'
]
const
products
=
value
.
map
(
item
=>
({
productId
:
item
.
commodityId
,
skuId
:
item
.
productId
}))
if
(
shopId
&&
products
?.
length
)
{
// 判断不存在物流 隐藏交付地址
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/index.tsx
View file @
13efecec
...
...
@@ -350,9 +350,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// 唤起报价单弹窗
const
handleOrderNo
=
async
()
=>
{
if
(
!
addSchemaAction
.
getFieldValue
(
'shopId'
))
{
return
message
.
error
(
'请先选择适应商城'
)
}
//
if(!addSchemaAction.getFieldValue('shopId')) {
//
return message.error('请先选择适应商城')
//
}
inquiryRef
.
current
.
setVisible
(
true
)
}
...
...
@@ -436,7 +436,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
effects=
{
(
$
,
ctx
)
=>
{
useAsyncSelect
(
'orderMode'
,
fetchOrderMode
,
[
'text'
,
'id'
])
$
(
'onFormMount'
).
subscribe
(
async
()
=>
{
const
data
=
await
fectchShopListsSource
(
{
type
:
1
,
environment
:
1
}
)
const
data
=
await
fectchShopListsSource
()
if
(
data
&&
data
.
length
)
{
ctx
.
setFieldState
(
'shopId'
,
state
=>
{
state
.
props
.
enum
=
data
.
map
(
item
=>
({
...
...
@@ -503,13 +503,13 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
})
// 新增下并且不是采购跳转 切换商城 清空受影响的字段
$
(
'onFieldValueChange'
,
'shopId'
).
subscribe
(
state
=>
{
pageStatus
===
PageStatus
.
ADD
&&
!
quotationId
&&
ctx
.
reset
({
validate
:
false
,
selector
:
'*(quoteNo,quoteId,vendorMemberName,vendorMemberId,vendorRoleId,products,payments)'
})
})
//
//
新增下并且不是采购跳转 切换商城 清空受影响的字段
//
$('onFieldValueChange', 'shopId').subscribe(state =>
{
//
pageStatus === PageStatus.ADD && !quotationId && ctx.reset(
{
//
validate: false,
//
selector: '*(quoteNo,quoteId,vendorMemberName,vendorMemberId,vendorRoleId,products,payments)'
//
})
//
})
}
}
expressionScope=
{
{
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/schema/index.ts
View file @
13efecec
...
...
@@ -65,28 +65,6 @@ const basicInfo: ISchema = {
},
],
},
shopId
:
{
type
:
'number'
,
// enum: getShopTypeMap,
enum
:
[],
title
:
'适应商城'
,
required
:
true
,
// visible: false,
},
digest
:
{
type
:
'string'
,
title
:
'订单摘要'
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请输入订单摘要'
},
{
limitByte
:
true
,
maxByte
:
60
}
]
},
quoteNo
:
{
type
:
'string'
,
title
:
'对应报价单号'
,
...
...
@@ -113,6 +91,31 @@ const basicInfo: ISchema = {
title
:
'报价单号ID'
,
visible
:
false
,
},
digest
:
{
type
:
'string'
,
title
:
'订单摘要'
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请输入订单摘要'
},
{
limitByte
:
true
,
maxByte
:
60
}
]
},
shopId
:
{
type
:
'number'
,
// enum: getShopTypeMap,
enum
:
[],
title
:
'适应商城'
,
required
:
true
,
"x-component-props"
:
{
disabled
:
true
,
},
// visible: false,
},
vendorMemberName
:
{
type
:
'string'
,
title
:
'供应会员'
,
...
...
src/pages/transaction/saleOrder/agentOrder/effects/index.ts
View file @
13efecec
...
...
@@ -4,7 +4,6 @@ import { useLinkageUtils } from '@/utils/formEffectUtils';
import
{
fetchOrderApi
}
from
'../apis'
;
import
{
PublicApi
}
from
'@/services/api'
;
// 异步填充表格字段
const
asyncPadDataForProduct
=
async
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
productValue
:
any
)
=>
{
const
productData
=
productValue
.
value
...
...
@@ -106,6 +105,13 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
})
}
// 异步处理发货 时间配置
export
const
useOrderDeliverTimeEffect
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
,
shopId
)
=>
{
PublicApi
.
getOrderParamFindDeliveryDate
({
shopId
}).
then
(
res
=>
{
console
.
log
(
res
.
data
,
'商城变动驱动送货时间段'
)
})
}
// 表单初始化时,对应操作
export
const
useOrderFormInitEffect
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
)
=>
{
FormEffectHooks
.
onFormMount$
().
subscribe
(
async
()
=>
{
...
...
src/pages/transaction/saleOrder/agentOrder/index.tsx
View file @
13efecec
...
...
@@ -8,7 +8,7 @@ import { createFormActions, registerVirtualBox, useFormSpy } from '@formily/antd
import
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
import
NiceForm
from
'@/components/NiceForm'
import
{
mergeAllSchemas
}
from
'./schema'
import
{
useEditHideField
,
useOrderFormInitEffect
,
useProductTableChangeForPay
}
from
'./effects'
import
{
useEditHideField
,
useOrder
DeliverTimeEffect
,
useOrder
FormInitEffect
,
useProductTableChangeForPay
}
from
'./effects'
import
{
orderCombination
,
procurementProcessField
,
procurementRenderField
,
procurmentRenderInit
}
from
'./constant'
import
ProductModalTable
from
'./components/productModalTable'
import
CirculationRecord
from
'../components/circulationRecord'
...
...
@@ -432,6 +432,8 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
// 新增下并且不是采购跳转 切换商城 清空受影响的字段
$
(
'onFieldValueChange'
,
'shopId'
).
subscribe
(
async
state
=>
{
console
.
log
(
state
,
'shop'
)
// 初始化 配送时间段处理
useOrderDeliverTimeEffect
(
ctx
,
state
.
value
)
const
data
=
await
fetchOrderApi
.
getOrderModeOrderType
({
shopType
:
state
.
values
[
1
][
'type'
]})
ctx
.
setFieldValue
(
'orderMode'
,
data
.
orderMode
)
ctx
.
setFieldValue
(
'orderModeName'
,
data
.
orderModeName
)
...
...
src/pages/transaction/saleOrder/agentOrder/schema/index.ts
View file @
13efecec
...
...
@@ -230,6 +230,19 @@ const submitInfo: ISchema = {
style
:
{
width
:
400
}
}
},
timeLine
:
{
// title: '配送时间段',
type
:
'radio'
,
enum
:
[
{
label
:
'审核通过'
,
value
:
1
},
{
label
:
'审核不通过'
,
value
:
0
},
],
"x-component-props"
:
{
disabled
:
false
,
optionType
:
'button'
,
// className: styles.adjustFormItem
},
},
}
},
deliveryAddresId
:
{
...
...
src/pages/transaction/saleOrder/constant/index.tsx
View file @
13efecec
...
...
@@ -9,6 +9,7 @@ import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import
{
useModalTable
}
from
'../../purchaseOrder/orderCollectB2b/model/useModalTable'
import
{
Button
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
{
ORDER_TYPE_CHANNEL_POINTS
,
ORDER_TYPE_POINTS
}
from
'@/constants/order'
/** 订单审核各个页面 只有订单类型查询的Schema */
export
const
tableListSchema
:
any
=
(
align
?:
String
,
colStyle
?:
Object
)
=>
{
...
...
@@ -123,6 +124,7 @@ export const baseOrderListColumns: any = () => {
align
:
'center'
,
dataIndex
:
'amount'
,
key
:
'amount'
,
render
:
(
t
,
r
)
=>
(
r
.
orderType
===
ORDER_TYPE_POINTS
||
r
.
orderType
===
ORDER_TYPE_CHANNEL_POINTS
)
?
t
:
`¥
${
t
}
`
},
{
title
:
'订单类型'
,
...
...
src/pages/transaction/saleOrder/index.tsx
View file @
13efecec
...
...
@@ -33,19 +33,19 @@ const formActions = createFormActions();
const
destroyActions
=
createFormActions
();
const
pauseActions
=
createFormActions
();
const
transformActions
=
createFormActions
();
const
adjustActions
=
createFormActions
();
const
SaleOrder
:
React
.
FC
<
SaleOrderProps
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
destoryRef
=
useRef
<
any
>
({})
const
pauseRef
=
useRef
<
any
>
({})
const
orderIds
=
useRef
<
number
[]
>
([])
const
adjustRef
=
useRef
<
any
>
({})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderVendorCancel
)
const
{
run
:
runPause
,
loading
:
loadingEnd
}
=
useHttpRequest
(
PublicApi
.
postOrderVendorTerminate
)
const
{
transformRef
,
orderColumns
}
=
useTransformOrderTable
(
transformActions
)
const
{
roles
}
=
getAuth
()
||
{}
const
serversRoles
=
roles
.
filter
(
item
=>
item
[
'roleType'
]
===
MEMBER_ROLE_TYPE_SERVICE_CONSUMER
)
const
{
token
,
memberId
,
memberRoleId
}
=
(
getAuth
()
||
{})
// 提交取消
const
handleSubmit
=
()
=>
{
...
...
@@ -173,24 +173,15 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
})
}
const
handleSubmitAdjust
=
()
=>
{
}
const
resetAdjustSelect
=
()
=>
{
}
/** 参照后台数据生成 */
const
renderOptionButton
=
(
record
)
=>
{
const
buttonGroup
=
{
'取消订单'
:
record
.
showCancel
,
'中止'
:
record
.
showTerminate
,
'评价'
:
record
.
showComment
,
'转单'
:
record
.
showTransfer
,
'调整送货时间'
:
true
}
const
buttonGroup
=
{
'取消订单'
:
record
.
showCancel
,
'中止'
:
record
.
showTerminate
,
'评价'
:
record
.
showComment
,
'转单'
:
record
.
showTransfer
}
const
operationHandler
=
{
'取消订单'
:
()
=>
handleCancel
(
record
),
'中止'
:
()
=>
handleSuspend
(
record
),
'评价'
:
()
=>
handleEvaluate
(
record
.
orderId
),
'转单'
:
()
=>
onlyTransform
(
record
.
orderId
),
'调整送货时间'
:
()
=>
adjustRef
.
current
.
setVisible
(
true
)
}
return
(
...
...
@@ -216,11 +207,25 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
}
}
const
handleExport
=
async
()
=>
{
console
.
log
(
`
${
process
.
env
.
BACK_GATEWAY
}
/order/vendor/export?token=
${
token
}
`
)
window
.
open
(
`
${
process
.
env
.
BACK_GATEWAY
}
/order/vendor/export?token=
${
token
}
`
,
'_blank'
)
// const downloadLink = document.createElement('a')
// downloadLink.style.display = 'none';
// downloadLink.href = `${process.env.BACK_GATEWAY}order/vendor/export?token=${token}`;
// downloadLink.target = '_blank'
// document.body.appendChild(downloadLink)
// downloadLink.click()
// document.body.removeChild(downloadLink)
}
const
controllerBtns
=
<
Space
>
<
Button
style=
{
{
width
:
140
}
}
onClick=
{
()
=>
{}
}
type=
'default'
>
导出
</
Button
>
<
Button
style=
{
{
width
:
140
}
}
onClick=
{
handleExport
}
type=
'default'
>
导出
</
Button
>
<
Button
type=
"primary"
onClick=
{
()
=>
batchTransform
()
}
>
转单
</
Button
>
</
Space
>
registerVirtualBox
(
"CustomTitle"
,
({
props
})
=>
{
return
<
p
>
当前勾运了
<
b
>
{
props
[
'x-component-props'
].
number
}
</
b
>
张订单进行转单,转单后生成的采购订单可通过会员角色
<
b
>
{
props
[
'x-component-props'
].
roleName
||
serversRoles
[
0
][
'memberRoleName'
]
}
</
b
>
进行查看
</
p
>
})
...
...
@@ -422,78 +427,6 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
orderColumns
,
}
}
/>
{
/* 调整送货时间 */
}
<
ModalForm
modalTitle=
'调整送货时间'
currentRef=
{
adjustRef
}
confirm=
{
handleSubmitAdjust
}
cancel=
{
resetAdjustSelect
}
actions=
{
adjustActions
}
// className={styles.adjustModal}
schema=
{
{
type
:
'object'
,
properties
:
{
NO_SUBMIT
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
labelAlign
:
'top'
,
},
properties
:
{
deliverDate
:
{
type
:
'string'
,
"x-component"
:
'date'
,
title
:
'送货时间'
,
required
:
true
,
"x-component-props"
:
{
disabledDate
:
current
=>
{
return
current
&&
current
<
moment
().
startOf
(
'day'
)
},
style
:
{
width
:
'100%'
}
}
},
timeLine
:
{
title
:
'时间段'
,
type
:
'radio'
,
enum
:
[
{
label
:
'审核通过'
,
value
:
1
},
{
label
:
'审核不通过'
,
value
:
0
},
],
default
:
1
,
"x-component-props"
:
{
disabled
:
false
,
optionType
:
'button'
,
// className: styles.adjustFormItem
},
},
adjustReason
:
{
type
:
'textarea'
,
"x-component-props"
:
{
rows
:
4
,
placeholder
:
'在此输入你的原因, 最多50个汉字'
},
title
:
'调整原因'
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请输入调整原因'
},
{
limitByte
:
true
,
maxByte
:
100
}
]
}
}
}
}
}
}
effects=
{
(
$
,
actions
)
=>
{
$
(
'onFormInit'
).
subscribe
(()
=>
{
})
}
}
/>
</
PageHeaderWrapper
>
}
...
...
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