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
8bc729ca
Commit
8bc729ca
authored
Dec 11, 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
c6f99fc6
1b3ad9a0
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
227 additions
and
183 deletions
+227
-183
useStoreId.ts
src/hooks/useStoreId.ts
+10
-3
index.tsx
src/pages/afterService/components/GoodsDrawer/index.tsx
+3
-7
index.ts
...pages/afterService/components/GoodsDrawer/schema/index.ts
+2
-2
useBusinessEffects.ts
...mit/components/ExchangeForm/effects/useBusinessEffects.ts
+4
-20
index.tsx
...cation/exchangePrSubmit/components/ExchangeForm/index.tsx
+38
-8
index.ts
.../exchangePrSubmit/components/ExchangeForm/schema/index.ts
+5
-7
index.tsx
...terService/exchangeApplication/exchangePrSubmit/index.tsx
+11
-11
useBusinessEffects.ts
...ubmit/components/RepairForm/effects/useBusinessEffects.ts
+2
-2
index.tsx
...pplication/repairPrSubmit/components/RepairForm/index.tsx
+20
-5
index.ts
...tion/repairPrSubmit/components/RepairForm/schema/index.ts
+5
-12
index.tsx
...s/afterService/repairApplication/repairPrSubmit/index.tsx
+12
-12
useBusinessEffects.ts
...ubmit/components/ReturnForm/effects/useBusinessEffects.ts
+0
-26
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+15
-5
index.ts
...tion/returnPrSubmit/components/ReturnForm/schema/index.ts
+3
-0
index.tsx
...s/afterService/returnApplication/returnPrSubmit/index.tsx
+12
-12
index.tsx
src/pages/lxMall/commodity/index.tsx
+28
-6
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+8
-5
index.tsx
src/pages/lxMall/components/Recommand/index.tsx
+8
-9
index.tsx
src/pages/lxMall/order/index.tsx
+7
-1
index.tsx
src/pages/lxMall/pay/components/balance/index.tsx
+3
-3
index.tsx
src/pages/lxMall/pay/components/bank/index.tsx
+3
-3
index.tsx
src/pages/lxMall/pay/components/credit/index.tsx
+3
-3
index.tsx
src/pages/lxMall/pay/components/point/index.tsx
+3
-3
index.tsx
src/pages/lxMall/pay/components/transfer/index.tsx
+4
-3
index.tsx
src/pages/lxMall/pay/components/wechat/index.tsx
+5
-5
index.tsx
src/pages/lxMall/pay/index.tsx
+1
-3
commodity.tsx
src/pages/systemSetting/collection/commodity.tsx
+7
-5
index.tsx
src/utils/index.tsx
+5
-2
No files found.
src/hooks/useStoreId.ts
View file @
8bc729ca
...
...
@@ -5,8 +5,10 @@ import { GlobalConfig } from "@/global/config"
const
useStoreId
=
(
layoutType
:
LAYOUT_TYPE
)
=>
{
const
[
storeId
,
setStoreId
]
=
useState
<
number
>
()
const
getStoreIdByLayoutType
=
()
=>
{
switch
(
layoutType
)
{
const
getStoreIdByLayoutType
=
(
newLayoutType
?:
LAYOUT_TYPE
)
=>
{
const
type
=
newLayoutType
?
newLayoutType
:
layoutType
switch
(
type
)
{
case
LAYOUT_TYPE
.
mall
:
setStoreId
(
getStoreId
(
SHOP_TYPE
.
mall
))
break
...
...
@@ -29,6 +31,10 @@ const useStoreId = (layoutType: LAYOUT_TYPE) => {
getStoreIdByLayoutType
()
},
[
layoutType
])
const
uploadStoreId
=
(
newLayoutType
:
LAYOUT_TYPE
)
=>
{
getStoreIdByLayoutType
(
newLayoutType
)
}
const
getStoreId
=
(
mallType
:
number
)
=>
{
const
shopList
=
GlobalConfig
.
web
.
shopInfo
const
shopInfo
:
any
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
mallType
)[
0
]
||
{}
...
...
@@ -36,7 +42,8 @@ const useStoreId = (layoutType: LAYOUT_TYPE) => {
}
return
{
storeId
storeId
,
uploadStoreId
}
}
...
...
src/pages/afterService/components/GoodsDrawer/index.tsx
View file @
8bc729ca
...
...
@@ -2,20 +2,16 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-1
0 17:56:20
* @LastEditTime: 2020-12-1
1 11:04:53
* @Description: 维修商品抽屉组件
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Drawer
,
Button
,
Pagination
}
from
'antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
useAsyncInitSelect
}
from
'@/formSchema/effects/useAsyncInitSelect'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetOrderOneBatchOrderListResponse
}
from
'@/services/OrderApi'
;
import
{
PurchaseOrderInsideWorkStateTexts
,
ORDER_TYPE2
}
from
'@/constants'
;
import
{
PurchaseOrderOutWorkStateTexts
,
ORDER_TYPE2
}
from
'@/constants'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
NestTable
from
'@/components/NestTable'
;
import
{
goodItem
,
OrderListParams
,
OrderListRes
}
from
'./interface'
;
...
...
@@ -155,7 +151,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
title
:
'订单状态'
,
dataIndex
:
'externalState'
,
align
:
'center'
,
render
:
text
=>
PurchaseOrder
Inside
WorkStateTexts
[
text
],
render
:
text
=>
PurchaseOrder
Out
WorkStateTexts
[
text
],
},
{
title
:
'订单类型'
,
...
...
src/pages/afterService/components/GoodsDrawer/schema/index.ts
View file @
8bc729ca
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-29 10:03:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-1
1-02 13:47:58
* @LastEditTime: 2020-1
2-11 10:58:36
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
...
...
@@ -75,7 +75,7 @@ export const listSearchSchema: ISchema = {
{
label
:
ORDER_TYPE2
[
ORDER_TYPE2_CHANNEL_POINTS
],
value
:
ORDER_TYPE2_CHANNEL_POINTS
},
],
'x-component-props'
:
{
placeholder
:
'
外部状态
(全部)'
,
placeholder
:
'
订单类型
(全部)'
,
allowClear
:
true
,
},
},
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/effects/useBusinessEffects.ts
View file @
8bc729ca
...
...
@@ -2,34 +2,18 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-
08 13:51:2
1
* @LastEditTime: 2020-12-
11 10:29:5
1
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
import
{
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
}
from
'@/constants'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
{
onFieldInputChange$
,
onFieldValueChange$
,
}
=
FormEffectHooks
;
// 获取采购入库单相关数据
const
fetchOrderPurchaseReceiptAddList
=
async
(
params
:
any
)
=>
{
const
res
=
await
PublicApi
.
getOrderPurchaseReceiptAddList
({
...
params
,
})
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
return
[];
};
export
const
useBusinessEffects
=
(
context
,
actions
)
=>
{
const
{
getFieldValue
,
...
...
@@ -72,14 +56,14 @@ export const useBusinessEffects = (context, actions) => {
// 已换货数量
const
replacedCountValue
=
getFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`rep
airGoodsList.
${
$1
}
.replacedCount
`
return
`rep
laceGoodsList.
${
$1
}
.extraData
`
}),
state
=>
state
.
value
,
state
=>
state
.
value
.
replacedCount
,
);
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`rep
air
GoodsList.
${
$1
}
.replaceCount`
return
`rep
lace
GoodsList.
${
$1
}
.replaceCount`
}),
state
=>
{
if
(
+
value
>
replacedCountValue
)
{
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/index.tsx
View file @
8bc729ca
...
...
@@ -47,6 +47,7 @@ interface DetailInfo {
outerStatusName
?:
string
,
innerStatus
?:
number
,
innerStatusName
?:
string
,
deliveryType
?:
number
,
}
const
ExchangeForm
:
React
.
FC
<
BillsFormProps
>
=
({
...
...
@@ -184,6 +185,18 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
supplierName
,
parentMemberId
,
parentMemberRoleId
,
evaluate
,
goodsDetailList
,
innerTaskList
,
manualReturnGoodsAddress
,
replaceDeliveryGoodsList
,
replaceStatisticsList
,
taskType
,
consumerName
,
outerTaskList
,
replaceBatch
,
replaceId
,
...
rest
}
=
res
.
data
;
...
...
@@ -248,7 +261,16 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
pageSize
:
`
${
99999
}
`
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setReplaceGoodsList
(
res
.
data
);
setReplaceGoodsList
({
data
:
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
extraData
:
{
replacedCount
:
item
.
purchaseCount
||
0
,
// 已换货数量,这里取 采购数量判断即可
id
:
item
.
orderRecordId
,
},
})),
totalCount
:
res
.
data
.
totalCount
,
});
setGoodsValue
(
res
.
data
&&
res
.
data
.
data
?
res
.
data
.
data
.
map
(
item
=>
item
.
orderRecordId
)
:
[]);
}
}).
finally
(()
=>
{
...
...
@@ -292,6 +314,13 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
deliveryAddress
=
{},
proofFileList
=
[],
replaceGoodsList
=
[],
outerStatus
,
outerStatusName
,
innerStatus
,
innerStatusName
,
applyNo
,
applyTime
,
...
rest
}
=
value
;
...
...
@@ -334,9 +363,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
,
sendId
:
deliveryType
===
1
?
shippingAddress
.
sendI
d
:
shippingAddress
.
i
d
:
deliveryType
===
2
?
pickupAddress
.
sendI
d
:
pickupAddress
.
i
d
:
''
,
},
...
...
@@ -345,13 +374,13 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
filePath
:
item
.
data
.
url
,
})),
replaceGoodsList
:
replaceGoodsList
.
map
(({
id
,
replaceCount
,
brand
,
unit
,
extraData
,
...
rest
})
=>
({
orderRecordId
:
id
,
orderRecordId
:
extraData
.
id
,
replaceCount
:
+
replaceCount
,
brand
:
brand
||
''
,
unit
:
unit
||
''
,
...
...
@@ -415,8 +444,6 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
existing
?
existing
:
{
id
:
item
.
id
,
orderRecordId
:
item
.
orderId
,
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
...
...
@@ -426,8 +453,11 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
purchaseCount
:
item
.
purchaseCount
,
purchasePrice
:
item
.
price
,
purchaseAmount
:
+
(
item
.
price
*
item
.
purchaseCount
).
toFixed
(
2
),
replacedCount
:
item
.
replaceCount
||
item
.
purchaseCount
||
0
,
// 已换货数量
replaceReason
:
''
,
extraData
:
{
replacedCount
:
item
.
replaceCount
||
item
.
purchaseCount
||
0
,
// 已换货数量
id
:
item
.
id
,
},
};
value
.
push
(
atom
);
});
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/schema/index.ts
View file @
8bc729ca
...
...
@@ -60,6 +60,7 @@ const supplierSchema: ISchema = {
placeholder
:
'搜索'
,
align
:
'flex-start'
,
advanced
:
false
,
tip
:
'输入 供应会员名称 进行搜索'
,
},
},
},
...
...
@@ -211,6 +212,8 @@ export const addBillSchema: ISchema = {
'x-component-props'
:
{
renderAddition
:
()
=>
null
,
renderRemove
:
'{{renderListTableRemove}}'
,
renderMoveDown
:
()
=>
null
,
renderMoveUp
:
()
=>
null
,
operationsWidth
:
100
,
operations
:
{
align
:
'center'
,
...
...
@@ -315,16 +318,11 @@ export const addBillSchema: ISchema = {
type
:
'string'
,
display
:
false
,
},
// 不用于展示,只用于收集值
orderId
:
{
//
其他数据,
不用于展示,只用于收集值
extraData
:
{
type
:
'string'
,
display
:
false
,
},
// 已换货数量
replacedCount
:
{
type
:
'string'
,
visible
:
false
,
},
},
}
},
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/index.tsx
View file @
8bc729ca
...
...
@@ -137,6 +137,17 @@ const ExchangePrSubmit: React.FC = () => {
提交
</
Button
>
)
}
{
(
record
.
innerStatus
===
EXCHANGE_INNER_STATUS_UNCOMMITTED
||
record
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FAILED
)
&&
(
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/afterService/exchangeApplication/exchangePrSubmit/edit?id=${record.replaceId}`
)
}
>
编辑
</
Button
>
)
}
{
record
.
innerStatus
===
EXCHANGE_INNER_STATUS_UNCOMMITTED
&&
(
<
Popconfirm
title=
"确定要删除吗?"
...
...
@@ -152,17 +163,6 @@ const ExchangePrSubmit: React.FC = () => {
</
Button
>
</
Popconfirm
>
)
}
{
(
record
.
innerStatus
===
EXCHANGE_INNER_STATUS_UNCOMMITTED
||
record
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FAILED
)
&&
(
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/afterService/exchangeApplication/exchangePrSubmit/edit?id=${record.replaceId}`
)
}
>
编辑
</
Button
>
)
}
</>
),
},
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/effects/useBusinessEffects.ts
View file @
8bc729ca
...
...
@@ -33,9 +33,9 @@ export const useBusinessEffects = (context, actions) => {
// 已维修数量
const
repairedCountValue
=
getFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`repairGoodsList.
${
$1
}
.
repairedCount
`
return
`repairGoodsList.
${
$1
}
.
extraData
`
}),
state
=>
state
.
value
,
state
=>
state
.
value
.
repairedCount
,
);
setFieldState
(
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/index.tsx
View file @
8bc729ca
...
...
@@ -122,6 +122,17 @@ const RepairForm: React.FC<BillsFormProps> = ({
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setRepairGoodsList
(
res
.
data
);
setRepairGoodsList
({
data
:
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
extraData
:
{
id
:
item
.
orderRecordId
,
orderId
:
item
.
orderId
,
repairedCount
:
item
.
purchaseCount
||
0
,
// 已维修数量,这里取 采购数量判断即可
},
})),
totalCount
:
res
.
data
.
totalCount
,
});
setGoodsValue
(
res
.
data
&&
res
.
data
.
data
?
res
.
data
.
data
.
map
(
item
=>
item
.
orderRecordId
)
:
[]);
}
}).
finally
(()
=>
{
...
...
@@ -197,13 +208,14 @@ const RepairForm: React.FC<BillsFormProps> = ({
filePath
:
item
.
data
.
url
,
})),
repairGoodsList
:
repairGoodsList
.
map
(({
id
,
repairCount
,
brand
,
unit
,
extraData
,
...
rest
})
=>
({
orderRecordId
:
id
,
orderId
:
extraData
.
orderId
,
orderRecordId
:
extraData
.
id
,
repairCount
:
+
repairCount
,
brand
:
brand
||
''
,
unit
:
unit
||
''
,
...
...
@@ -211,6 +223,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
})),
...
rest
,
};
PublicApi
.
postAsRepairGoodsSave
(
payload
)
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -262,8 +275,6 @@ const RepairForm: React.FC<BillsFormProps> = ({
existing
?
existing
:
{
id
:
item
.
id
,
orderId
:
item
.
orderId
,
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
...
...
@@ -271,8 +282,12 @@ const RepairForm: React.FC<BillsFormProps> = ({
brand
:
item
.
unitName
,
unit
:
item
.
costPrice
,
purchaseCount
:
item
.
purchaseCount
,
repairedCount
:
item
.
repairCount
||
item
.
purchaseCount
||
0
,
// 已维修数量
repairReason
:
''
,
extraData
:
{
id
:
item
.
id
,
orderId
:
item
.
orderId
,
repairedCount
:
item
.
repairCount
||
item
.
purchaseCount
||
0
,
// 已维修数量
},
};
value
.
push
(
atom
);
});
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/schema/index.ts
View file @
8bc729ca
...
...
@@ -60,6 +60,7 @@ const supplierSchema: ISchema = {
placeholder
:
'搜索'
,
align
:
'flex-start'
,
advanced
:
false
,
tip
:
'输入 供应会员名称 进行搜索'
,
},
},
},
...
...
@@ -211,6 +212,8 @@ export const addBillSchema: ISchema = {
'x-component-props'
:
{
renderAddition
:
()
=>
null
,
renderRemove
:
'{{renderListTableRemove}}'
,
renderMoveDown
:
()
=>
null
,
renderMoveUp
:
()
=>
null
,
operationsWidth
:
100
,
operations
:
{
align
:
'center'
,
...
...
@@ -301,21 +304,11 @@ export const addBillSchema: ISchema = {
}
],
},
// 不用于展示,只用于收集值
id
:
{
//
其他数据,
不用于展示,只用于收集值
extraData
:
{
type
:
'string'
,
display
:
false
,
},
// 不用于展示,只用于收集值
orderId
:
{
type
:
'string'
,
display
:
false
,
},
// 已维修数量
repairedCount
:
{
type
:
'string'
,
visible
:
false
,
},
},
}
},
...
...
src/pages/afterService/repairApplication/repairPrSubmit/index.tsx
View file @
8bc729ca
...
...
@@ -130,6 +130,18 @@ const RepairPrSubmit: React.FC = () => {
提交
</
Button
>
)
}
{
/* 外部状态为不接受申请 或者 内部状态为 待提交申请 都可以进行编辑 */
}
{
(
record
.
outerStatus
===
REPAIR_OUTER_STATUS_FAILED
||
record
.
innerStatus
===
REPAIR_INNER_STATUS_UNCOMMITTED
)
&&
(
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/afterService/repairApplication/repairPrSubmit/edit?id=${record.applyId}`
)
}
>
编辑
</
Button
>
)
}
{
record
.
innerStatus
===
REPAIR_INNER_STATUS_UNCOMMITTED
&&
(
<
Popconfirm
title=
"确定要删除吗?"
...
...
@@ -145,18 +157,6 @@ const RepairPrSubmit: React.FC = () => {
</
Button
>
</
Popconfirm
>
)
}
{
/* 外部状态为不接受申请 或者 内部状态为 待提交申请 都可以进行编辑 */
}
{
(
record
.
outerStatus
===
REPAIR_OUTER_STATUS_FAILED
||
record
.
innerStatus
===
REPAIR_INNER_STATUS_UNCOMMITTED
)
&&
(
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/afterService/repairApplication/repairPrSubmit/edit?id=${record.applyId}`
)
}
>
编辑
</
Button
>
)
}
</>
),
},
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/effects/useBusinessEffects.ts
View file @
8bc729ca
...
...
@@ -48,29 +48,4 @@ export const useBusinessEffects = (context, actions) => {
break
};
});
// 校验退货数量
onFieldInputChange$
(
'returnGoodsList.*.returnCount'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
// 已退货数量
const
replacedCountValue
=
getFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`returnGoodsList.
${
$1
}
.returnedCount`
}),
state
=>
state
.
value
,
);
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`returnGoodsList.
${
$1
}
.returnCount`
}),
state
=>
{
if
(
+
value
>
replacedCountValue
)
{
state
.
errors
=
'填写值已超过最大可退货数量,请重新填写'
;
}
else
{
state
.
errors
=
''
;
}
}
);
});
}
\ No newline at end of file
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
8bc729ca
...
...
@@ -267,6 +267,18 @@ const ReturnForm: React.FC<BillsFormProps> = ({
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setReturnGoodsList
(
res
.
data
);
setReturnGoodsList
({
data
:
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
returnedCount
:
item
.
purchaseCount
||
0
,
// 已退货数量,这里取 采购数量判断即可
extraData
:
{
id
:
item
.
orderRecordId
,
returnReason
:
item
.
returnReason
,
payList
:
item
.
payList
,
},
})),
totalCount
:
res
.
data
.
totalCount
,
});
setGoodsValue
(
res
.
data
&&
res
.
data
.
data
?
res
.
data
.
data
.
map
(
item
=>
item
.
orderRecordId
)
:
[]);
}
}).
finally
(()
=>
{
...
...
@@ -321,8 +333,6 @@ const ReturnForm: React.FC<BillsFormProps> = ({
...
rest
}
=
values
;
console
.
log
(
'value'
,
values
)
setSubmitLoading
(
true
);
const
payload
=
{
...
...
@@ -357,9 +367,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
,
sendId
:
deliveryType
===
1
?
shippingAddress
.
sendI
d
:
shippingAddress
.
i
d
:
deliveryType
===
2
?
pickupAddress
.
sendI
d
:
pickupAddress
.
i
d
:
''
,
},
...
...
@@ -531,7 +541,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
);
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
Spin
spinning=
{
infoLoading
||
returnGoodsLoading
}
>
<
PageHeaderWrapper
style=
{
{
padding
:
24
,
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/schema/index.ts
View file @
8bc729ca
...
...
@@ -60,6 +60,7 @@ const supplierSchema: ISchema = {
placeholder
:
'搜索'
,
align
:
'flex-start'
,
advanced
:
false
,
tip
:
'输入 供应会员名称 进行搜索'
,
},
},
},
...
...
@@ -211,6 +212,8 @@ export const addBillSchema: ISchema = {
'x-component-props'
:
{
renderAddition
:
()
=>
null
,
renderRemove
:
'{{renderListTableRemove}}'
,
renderMoveDown
:
()
=>
null
,
renderMoveUp
:
()
=>
null
,
operationsWidth
:
100
,
operations
:
{
align
:
'center'
,
...
...
src/pages/afterService/returnApplication/returnPrSubmit/index.tsx
View file @
8bc729ca
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 10:13:18
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-
09 14:31:30
* @LastEditTime: 2020-12-
11 11:12:44
* @Description: 待提交退货申请单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -142,6 +142,17 @@ const ReturnPrSubmit: React.FC = () => {
提交
</
Button
>
)
}
{
(
record
.
innerStatus
===
RETURN_INNER_STATUS_UNCOMMITTED
||
record
.
outerStatus
===
RETURN_OUTER_STATUS_FAILED
)
&&
(
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/afterService/returnApplication/returnPrSubmit/edit?id=${record.returnId}`
)
}
>
编辑
</
Button
>
)
}
{
record
.
innerStatus
===
RETURN_INNER_STATUS_UNCOMMITTED
&&
(
<
Popconfirm
title=
"确定要删除吗?"
...
...
@@ -157,17 +168,6 @@ const ReturnPrSubmit: React.FC = () => {
</
Button
>
</
Popconfirm
>
)
}
{
(
record
.
innerStatus
===
RETURN_INNER_STATUS_UNCOMMITTED
||
record
.
outerStatus
===
RETURN_OUTER_STATUS_FAILED
)
&&
(
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/afterService/returnApplication/returnPrSubmit/edit?id=${record.returnId}`
)
}
>
编辑
</
Button
>
)
}
</>
),
},
...
...
src/pages/lxMall/commodity/index.tsx
View file @
8bc729ca
...
...
@@ -47,6 +47,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
const
UserStore
=
useLocalStore
(()
=>
store
.
UserStore
)
const
FilterStore
=
useLocalStore
(()
=>
store
.
FilterStore
)
const
{
userInfo
}
=
UserStore
const
[
initLoad
,
setInitLoad
]
=
useState
<
boolean
>
(
true
)
const
[
modalVisible
,
setModalVisible
]
=
useState
<
boolean
>
(
false
)
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
const
[
commonlyUsedName
,
setCommonlyUsedName
]
=
useState
<
string
>
(
""
)
...
...
@@ -63,11 +64,19 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
useEffect
(()
=>
{
if
(
categoryId
&&
categoryName
)
{
onFilter
({
key
:
[
categoryId
],
title
:
decodeURIComponent
(
atob
(
categoryName
)),
type
:
FILTER_TYPE
.
category
,
})
if
(
layoutType
===
LAYOUT_TYPE
.
mall
)
{
onFilter
({
key
:
[
categoryId
],
title
:
decodeURIComponent
(
atob
(
categoryName
)),
type
:
FILTER_TYPE
.
category
,
})
}
else
{
onFilter
({
key
:
[
categoryId
],
title
:
decodeURIComponent
(
atob
(
categoryName
)),
type
:
FILTER_TYPE
.
customerCategory
,
})
}
}
if
(
brandId
&&
brandName
)
{
onFilter
({
...
...
@@ -85,9 +94,22 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
}
},
[
props
.
location
.
query
])
const
checkInitLoad
=
()
=>
{
let
load
=
true
if
(
categoryId
||
categoryName
||
brandId
||
brandName
||
priceType
)
{
if
(
initLoad
)
{
setInitLoad
(
false
)
load
=
false
}
}
if
(
load
)
{
fetchCommodityList
(
1
)
}
}
useEffect
(()
=>
{
setCurrent
(
1
)
fetchCommodityList
(
1
)
checkInitLoad
(
)
},
[
filterParam
])
useEffect
(()
=>
{
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
8bc729ca
...
...
@@ -98,7 +98,7 @@ const CommodityDetail = (props) => {
const
[
commonCategoryCommodityList
,
setCommonCategoryCommodityList
]
=
useState
([])
const
[
spinLoading
,
setSpinLoading
]
=
useState
<
boolean
>
(
true
)
const
[
errorInfo
,
setErrorInfo
]
=
useState
<
any
>
()
const
{
storeId
}
=
useStoreId
(
getLayoutType
(
layoutType
,
Number
(
type
)))
const
{
storeId
,
uploadStoreId
}
=
useStoreId
(
getLayoutType
(
layoutType
,
Number
(
type
)))
let
clickFlag
=
true
...
...
@@ -213,8 +213,10 @@ const CommodityDetail = (props) => {
setErrorInfo
(
null
)
setCommodityDetail
(
res
.
data
)
initAttributeAndValueList
(
res
.
data
)
getPayWayListByMemberId
(
res
.
data
?.
memberId
)
getPayWayListByMemberId
(
res
.
data
?.
memberId
,
res
.
data
?.
memberRoleId
)
if
(
!
type
)
{
uploadStoreId
(
getLayoutType
(
layoutType
,
Number
(
res
.
data
.
priceType
)))
}
if
(
res
.
data
.
customerCategory
)
{
fetchCommonCategoryCommodityList
(
res
.
data
.
customerCategory
.
id
,
res
.
data
.
priceType
)
}
...
...
@@ -234,12 +236,13 @@ const CommodityDetail = (props) => {
* 获取供货商的支付方式
* @param memberId
*/
const
getPayWayListByMemberId
=
(
memberId
:
number
)
=>
{
const
getPayWayListByMemberId
=
(
memberId
:
number
,
memberRoleId
)
=>
{
if
(
!
memberId
)
{
return
}
const
param
:
any
=
{
memberId
memberId
,
memberRoleId
,
}
PublicApi
.
getPayPayWayList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
src/pages/lxMall/components/Recommand/index.tsx
View file @
8bc729ca
...
...
@@ -34,8 +34,8 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
const
getCommodityListByCategoryIds
=
async
()
=>
{
let
result
=
[]
for
(
le
t
id
of
categoryIds
)
{
le
t
resList
:
any
=
await
getListById
(
id
)
for
(
cons
t
id
of
categoryIds
)
{
cons
t
resList
:
any
=
await
getListById
(
id
)
result
=
[...
result
,
...
resList
]
if
(
result
&&
result
.
length
>=
5
)
{
setList
(
result
)
...
...
@@ -61,7 +61,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
const
getListById
=
(
categoryId
:
number
)
=>
{
return
new
Promise
((
resolve
)
=>
{
le
t
param
:
any
=
{
cons
t
param
:
any
=
{
current
:
1
,
pageSize
:
5
,
categoryId
...
...
@@ -102,7 +102,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
const
fetchFirstCategory
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
let
getFn
le
t
param
:
any
=
{}
cons
t
param
:
any
=
{}
switch
(
layoutType
)
{
case
LAYOUT_TYPE
.
channel
:
case
LAYOUT_TYPE
.
ichannel
:
...
...
@@ -127,7 +127,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
*/
const
fetchCategoryById
=
(
categoryId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
le
t
param
:
any
=
{
cons
t
param
:
any
=
{
categoryId
}
...
...
@@ -151,7 +151,6 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
}
param
.
templateId
=
templateId
// @ts-ignore
getFn
&&
getFn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
...
...
@@ -161,9 +160,9 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
}
const
getCategoryComponents
=
async
()
=>
{
le
t
firstCategory
:
any
=
await
fetchFirstCategory
()
cons
t
firstCategory
:
any
=
await
fetchFirstCategory
()
if
(
firstCategory
[
0
])
{
le
t
categoryDetail
:
any
=
await
fetchCategoryById
(
firstCategory
[
0
].
id
)
cons
t
categoryDetail
:
any
=
await
fetchCategoryById
(
firstCategory
[
0
].
id
)
setList
(
changeDataKey
(
categoryDetail
.
goodsBOList
))
}
}
...
...
@@ -190,7 +189,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
<
div
className=
{
styles
.
recommand_list
}
>
{
list
&&
list
.
map
((
item
,
index
)
=>
index
<
5
&&
(
<
a
href=
{
getCommodityDetailLink
(
item
)
}
key=
{
`recommand_list_item_${index}`
}
target=
"_blank"
>
<
a
href=
{
getCommodityDetailLink
(
item
)
}
key=
{
`recommand_list_item_${index}`
}
target=
"_blank"
rel=
"noreferrer"
>
<
div
className=
{
styles
.
recommand_list_item
}
>
<
div
className=
{
styles
.
recommand_list_item_img
}
>
<
ImageBox
width=
{
224
}
height=
{
224
}
imgUrl=
{
item
.
mainPic
}
direction=
"column"
/>
...
...
src/pages/lxMall/order/index.tsx
View file @
8bc729ca
...
...
@@ -118,7 +118,13 @@ const Order: React.FC<OrderPropsType> = (props) => {
// 根据商品ID获取工作流信息,判断是否需要签署合同
if
(
productId
)
{
try
{
const
rulesRes
=
await
PublicApi
.
getOrderTradingRulesByProductId
({
productId
})
const
param
:
any
=
{
productId
,
shopId
,
storeId
,
memberId
:
orderInfo
.
supplyMembersId
,
memberRoleId
:
orderInfo
.
supplyMembersRoleId
,
}
const
rulesRes
=
await
PublicApi
.
getOrderTradingRulesByProductId
(
param
)
const
{
data
}
=
rulesRes
if
(
data
)
{
// 是否选用电子合同
...
...
src/pages/lxMall/pay/components/balance/index.tsx
View file @
8bc729ca
...
...
@@ -82,7 +82,8 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
id
:
Number
(
orderId
),
paymentInformationId
:
Number
(
payInfo
.
paymentInformationId
),
payTypeId
:
payInfo
.
paymentChannelsId
,
payPassword
:
encryptedByAES
(
payPassword
)
payPassword
:
encryptedByAES
(
payPassword
),
payType
:
1
,
}
setConfirmLoading
(
true
)
PublicApi
.
postOrderPendingOrderPay
(
param
).
then
(
res
=>
{
...
...
@@ -148,4 +149,4 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
)
}
export
default
BablancePayWay
\ No newline at end of file
export
default
BablancePayWay
src/pages/lxMall/pay/components/bank/index.tsx
View file @
8bc729ca
...
...
@@ -22,11 +22,11 @@ const BankPayWay: React.FC<BankPayWayPropsType> = (props) => {
if
(
status
!==
'uploading'
)
{
console
.
log
(
info
.
file
,
info
.
fileList
);
}
if
(
status
===
'done'
)
{
//
if (status === 'done') {
}
else
if
(
status
===
'error'
)
{
//
} else if (status === 'error') {
}
//
}
},
};
...
...
src/pages/lxMall/pay/components/credit/index.tsx
View file @
8bc729ca
...
...
@@ -81,7 +81,8 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
id
:
Number
(
orderId
),
paymentInformationId
:
Number
(
payInfo
.
paymentInformationId
),
payTypeId
:
payInfo
.
paymentChannelsId
,
payPassword
:
encryptedByAES
(
payPassword
)
payPassword
:
encryptedByAES
(
payPassword
),
payType
:
3
,
}
setConfirmLoading
(
true
)
PublicApi
.
postOrderPendingOrderPay
(
param
).
then
(
res
=>
{
...
...
@@ -146,4 +147,4 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
)
}
export
default
CreditPayWay
\ No newline at end of file
export
default
CreditPayWay
src/pages/lxMall/pay/components/point/index.tsx
View file @
8bc729ca
...
...
@@ -86,7 +86,8 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
relType
,
paymentInformationId
:
Number
(
payInfo
.
paymentInformationId
),
payTypeId
:
payInfo
.
paymentChannelsId
,
payPassword
:
encryptedByAES
(
payPassword
)
payPassword
:
encryptedByAES
(
payPassword
),
payType
:
0
,
}
setConfirmLoading
(
true
)
...
...
@@ -174,4 +175,4 @@ const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
)
}
export
default
PointPayWay
\ No newline at end of file
export
default
PointPayWay
src/pages/lxMall/pay/components/transfer/index.tsx
View file @
8bc729ca
...
...
@@ -69,14 +69,15 @@ const TransferPayWay: React.FC<TransferPayWayPropsType> = (props) => {
message
.
info
(
"请上传支付凭证"
)
return
}
let
param
=
{
const
param
:
any
=
{
id
:
Number
(
orderId
),
paymentInformationId
:
payInfo
.
paymentInformationId
,
payTypeId
:
payInfo
.
paymentChannelsId
,
payOrderUrls
:
JSON
.
stringify
([
payOrderUrl
])
payOrderUrls
:
JSON
.
stringify
([
payOrderUrl
]),
payType
:
2
,
}
setConfirmLoading
(
true
)
//@ts-ignore
PublicApi
.
postOrderPendingOrderPay
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
...
...
src/pages/lxMall/pay/components/wechat/index.tsx
View file @
8bc729ca
...
...
@@ -39,13 +39,13 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
}
const
pay
=
()
=>
{
let
param
=
{
const
param
:
any
=
{
id
:
Number
(
orderId
),
paymentInformationId
:
payInfo
.
paymentInformationId
,
payTypeId
:
payInfo
.
paymentChannelsId
,
payType
:
1
,
}
//@ts-ignore
PublicApi
.
postOrderPendingOrderPay
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
...
...
@@ -64,12 +64,12 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
const
checkPayState
=
()
=>
{
if
(
checkCount
<
24
)
{
let
param
=
{
const
param
:
any
=
{
id
:
Number
(
orderId
),
paymentInformationId
:
payInfo
.
paymentInformationId
,
payTypeId
:
payInfo
.
paymentChannelsId
,
}
//@ts-ignore
PublicApi
.
getOrderPayResultsl
(
param
).
then
(
res
=>
{
const
{
data
,
code
}
=
res
if
(
code
===
1000
)
{
...
...
src/pages/lxMall/pay/index.tsx
View file @
8bc729ca
...
...
@@ -8,8 +8,6 @@ import BankPayWay from './components/bank'
import
TransferPayWay
from
'./components/transfer'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetOrderOrderPayDetailsResponse
}
from
'@/services/OrderApi'
import
{
useLocalStore
,
observer
}
from
'mobx-react'
import
{
store
}
from
'@/store'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
styles
from
'./index.less'
import
{
message
,
Button
}
from
'antd'
...
...
@@ -117,7 +115,7 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
return
null
}
}
const
backHome
=
()
=>
{
window
.
location
.
href
=
'/'
}
...
...
src/pages/systemSetting/collection/commodity.tsx
View file @
8bc729ca
...
...
@@ -42,7 +42,9 @@ const Commodity: React.FC = () => {
const
param
:
any
=
{
commodityId
:
detail
.
commodity
.
id
,
type
:
detail
.
type
,
channelMemberId
:
detail
.
channelMemberId
}
if
(
detail
.
channelMemberId
)
{
param
.
channelMemberId
=
detail
.
channelMemberId
}
setBuyLoading
(
true
)
PublicApi
.
getSearchShopCommonGetCommodityIsPublish
(
param
).
then
(
res
=>
{
...
...
@@ -53,16 +55,16 @@ const Commodity: React.FC = () => {
switch
(
detail
.
type
)
{
case
1
:
case
2
:
el
.
href
=
`/shop/commodity/detail?id=
${
detail
.
commodity
.
id
}
&shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
detail
.
commodity
.
storeId
,
memberId
:
detail
.
commodity
.
memberId
,
roleId
:
detail
.
commodity
.
memberRoleId
}))}
`
;
el
.
href
=
`/shop/commodity/detail?id=
${
detail
.
commodity
.
id
}
&
type=
${
detail
.
commodity
.
priceType
}
&
shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
detail
.
commodity
.
storeId
,
memberId
:
detail
.
commodity
.
memberId
,
roleId
:
detail
.
commodity
.
memberRoleId
}))}
`
;
break
case
3
:
el
.
href
=
`
${
GlobalConfig
.
channelRootRoute
}
/commodity/detail?id=
${
detail
.
commodity
.
id
}
&channelId=
${
btoa
(
JSON
.
stringify
({
memberId
:
detail
.
channelMemberId
}))}
`
;
el
.
href
=
`
${
GlobalConfig
.
channelRootRoute
}
/commodity/detail?id=
${
detail
.
commodity
.
id
}
&
type=
${
detail
.
commodity
.
priceType
}
&
channelId=
${
btoa
(
JSON
.
stringify
({
memberId
:
detail
.
channelMemberId
}))}
`
;
break
case
4
:
el
.
href
=
`
${
GlobalConfig
.
ichannelRootRoute
}
/commodity/detail?id=
${
detail
.
commodity
.
id
}
&channelId=
${
btoa
(
JSON
.
stringify
({
memberId
:
detail
.
channelMemberId
}))}
`
;
el
.
href
=
`
${
GlobalConfig
.
ichannelRootRoute
}
/commodity/detail?id=
${
detail
.
commodity
.
id
}
&
type=
${
detail
.
commodity
.
priceType
}
&
channelId=
${
btoa
(
JSON
.
stringify
({
memberId
:
detail
.
channelMemberId
}))}
`
;
break
case
5
:
el
.
href
=
`
${
GlobalConfig
.
channelRootRoute
}
/commodity/detail?id=
${
detail
.
commodity
.
id
}
&channelId=
${
btoa
(
JSON
.
stringify
({
memberId
:
detail
.
channelMemberId
}))}
`
;
el
.
href
=
`
${
GlobalConfig
.
channelRootRoute
}
/commodity/detail?id=
${
detail
.
commodity
.
id
}
&
type=
${
detail
.
commodity
.
priceType
}
&
channelId=
${
btoa
(
JSON
.
stringify
({
memberId
:
detail
.
channelMemberId
}))}
`
;
break
}
el
.
target
=
'_blank'
;
...
...
src/utils/index.tsx
View file @
8bc729ca
...
...
@@ -449,7 +449,9 @@ export function normalizeFiledata(url: any): any {
name
:
fileName
,
status
:
'done'
,
url
,
data
:
url
,
// formily Upload value 需要这个字段
data
:
{
url
,
},
// formily Upload value 需要这个字段
};
};
...
...
@@ -519,7 +521,8 @@ export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): nu
// 循环数据,找到状态值,一直覆盖
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
!
data
[
i
][
customKey
])
{
index
=
i
-
1
;
index
=
i
;
break
;
}
// 循环到最后如果 index 还是为 0 的话,说明工作流全部跑完了,此时 index 为 data.length - 1
if
(
i
===
data
.
length
-
1
&&
index
===
0
)
{
...
...
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