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
ef33cef8
Commit
ef33cef8
authored
Sep 16, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 确认转单
parent
aa4772f6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
18 deletions
+58
-18
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+1
-1
schema.ts
...seOrder/orderCollectB2b/components/addressModal/schema.ts
+3
-3
schema.ts
...seOrder/orderCollectSrm/components/addressModal/schema.ts
+2
-1
index.tsx
src/pages/transaction/saleOrder/constant/index.tsx
+3
-2
index.tsx
src/pages/transaction/saleOrder/index.tsx
+49
-11
No files found.
src/pages/commodity/products/addProducts.tsx
View file @
ef33cef8
...
...
@@ -174,7 +174,7 @@ const AddProducts: React.FC<{}> = (props) => {
if
(
productInfoByEdit
?.
type
===
CommodityType
.
UPPER_SUPPORTER_COMMODITY
)
{
// @ 上游商品 直接取原信息中的品类品牌id
_bacsicForm
.
customerCategoryId
=
productInfoByEdit
?.
customerCategory
.
fullId
.
split
(
'.'
).
map
(
item
=>
Number
(
item
)
+
''
)
_bacsicForm
.
brandId
=
productInfoByEdit
?.
brand
.
id
_bacsicForm
.
brandId
=
productInfoByEdit
?.
brand
?.
id
||
null
}
_bacsicForm
.
customerCategoryId
=
_bacsicForm
.
customerCategoryId
[
_bacsicForm
.
customerCategoryId
.
length
-
1
]
// 移除描述中的空数组[]
...
...
src/pages/transaction/purchaseOrder/orderCollectB2b/components/addressModal/schema.ts
View file @
ef33cef8
...
...
@@ -162,7 +162,8 @@ const addressSchema: ISchema = {
}
],
"x-component-props"
:
{
placeholder
:
'输入你的手机号码'
placeholder
:
'输入你的手机号码'
,
style
:
{
width
:
'100%'
}
}
}
}
...
...
@@ -183,4 +184,4 @@ const addressSchema: ISchema = {
}
}
export
default
addressSchema
\ No newline at end of file
export
default
addressSchema
src/pages/transaction/purchaseOrder/orderCollectSrm/components/addressModal/schema.ts
View file @
ef33cef8
...
...
@@ -161,7 +161,8 @@ const addressSchema: ISchema = {
}
],
"x-component-props"
:
{
placeholder
:
'输入你的手机号码'
placeholder
:
'输入你的手机号码'
,
style
:
{
width
:
'100%'
}
}
}
}
...
...
src/pages/transaction/saleOrder/constant/index.tsx
View file @
ef33cef8
...
...
@@ -153,11 +153,12 @@ export const useTransformOrderTable = (ctx: ISchemaFormActions | ISchemaFormAsyn
const
{
visible
,
setVisible
}
=
useModalTable
()
const
handleDelete
=
(
record
)
=>
{
console
.
log
(
record
,
'删除转单'
)
const
orders
=
ctx
.
getFieldValue
(
'orders'
)
const
data
=
orders
.
filter
(
item
=>
item
.
orderId
!==
record
.
orderId
)
ctx
.
setFieldValue
(
'orders'
,
[...
data
])
}
const
[
orderColumns
,
setOrderColumns
]
=
useState
(()
=>
{
const
orderInfoColumns
=
[
{
title
:
'订单号'
,
...
...
src/pages/transaction/saleOrder/index.tsx
View file @
ef33cef8
...
...
@@ -15,6 +15,7 @@ import { createFormActions, registerVirtualBox } from '@formily/antd'
import
ModalForm
from
'@/components/ModalForm'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
TableOperation
from
'@/components/TableOperation'
import
{
getAuth
}
from
'@/utils/auth'
// 销售订单查询
...
...
@@ -38,6 +39,8 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
const
{
run
:
runPause
,
loading
:
loadingEnd
}
=
useHttpRequest
(
PublicApi
.
postOrderVendorTerminate
)
const
{
transformRef
,
orderColumns
}
=
useTransformOrderTable
(
transformActions
)
// const [transformLoading, setTransformLoading] = useState<boolean>(false)
const
{
roles
}
=
getAuth
()
||
{}
const
serversRoles
=
roles
.
filter
(
item
=>
item
[
'roleType'
]
===
2
)
// 提交取消
const
handleSubmit
=
()
=>
{
...
...
@@ -97,19 +100,40 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
// 单个或批量转单
const
handelTransformOrder
=
async
(
orderId
?)
=>
{
if
(
!
serversRoles
.
length
)
{
return
message
.
error
(
'当前登录会员,无服务消费者角色,无法进行转单'
)
}
if
(
orderId
)
{
const
{
code
,
data
}
=
await
PublicApi
.
postOrderVendorTransferPreview
([{
orderId
}])
const
{
code
,
data
}
=
await
PublicApi
.
postOrderVendorTransferPreview
([{
orderId
}]
,
{
ctlType
:
'none'
}
)
if
(
code
===
1000
)
{
transformRef
.
current
.
setVisible
(
true
)
console
.
log
(
data
,
'fdd'
)
transformActions
.
setFieldValue
(
'orders'
,
data
)
transformActions
.
setFieldState
(
'roleId'
,
prevState
=>
{
prevState
.
props
.
enum
=
serversRoles
.
map
(
item
=>
({
label
:
item
.
memberRoleName
,
value
:
item
.
memberRoleId
,
}))
})
transformActions
.
setFieldValue
(
'roleId'
,
serversRoles
[
0
][
'memberRoleId'
])
transformActions
.
setFieldState
(
'NOT_SUBMIT_TITLE'
,
prevState
=>
{
prevState
.
props
[
'x-component-props'
].
number
=
1
})
}
}
else
if
(
selectRef
.
current
.
length
)
{
const
{
code
,
data
}
=
await
PublicApi
.
postOrderVendorTransferPreview
(
selectRef
.
current
.
map
(
item
=>
({
orderId
:
item
})))
const
{
code
,
data
}
=
await
PublicApi
.
postOrderVendorTransferPreview
(
selectRef
.
current
.
map
(
item
=>
({
orderId
:
item
}))
,
{
ctlType
:
'none'
}
)
if
(
code
===
1000
)
{
transformRef
.
current
.
setVisible
(
true
)
console
.
log
(
data
,
'fdd'
)
transformActions
.
setFieldValue
(
'orders'
,
data
)
transformActions
.
setFieldState
(
'roleId'
,
prevState
=>
{
prevState
.
props
.
enum
=
serversRoles
.
map
(
item
=>
({
label
:
item
.
memberRoleName
,
value
:
item
.
memberRoleId
,
}))
})
transformActions
.
setFieldValue
(
'roleId'
,
serversRoles
[
0
][
'memberRoleId'
])
transformActions
.
setFieldState
(
'NOT_SUBMIT_TITLE'
,
prevState
=>
{
prevState
.
props
[
'x-component-props'
].
number
=
selectRef
.
current
.
length
})
}
}
else
{
return
message
.
error
(
'请选择需要转单的订单'
)
...
...
@@ -118,11 +142,14 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
const
handleSubmitTransform
=
()
=>
{
transformActions
.
submit
(
values
=>
{
console
.
log
(
values
)
transformRef
.
current
.
setVisible
(
false
)
const
{
roleId
,
orders
}
=
values
PublicApi
.
postOrderVendorTransfer
({
roleId
,
orderIds
:
orders
.
map
(
item
=>
item
.
orderId
)}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
()
setSelectedRowKeys
([])
setTimeout
(()
=>
{
ref
.
current
.
reload
()
},
800
)
}
})
})
...
...
@@ -167,8 +194,8 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
<
Button
type=
"primary"
onClick=
{
()
=>
handelTransformOrder
()
}
>
转单
</
Button
>
</
Space
>
registerVirtualBox
(
"CustomTitle"
,
({
children
,
schema
})
=>
{
return
<
p
>
当前勾运了
<
b
>
3
</
b
>
张订单进行转单,转单后生成的采购订单可通过会员角色
<
b
>
采购商角色
</
b
>
进行查看
</
p
>
registerVirtualBox
(
"CustomTitle"
,
({
props
})
=>
{
return
<
p
>
当前勾运了
<
b
>
{
props
[
'x-component-props'
].
number
}
</
b
>
张订单进行转单,转单后生成的采购订单可通过会员角色
<
b
>
{
props
[
'x-component-props'
].
roleName
||
serversRoles
[
0
][
'memberRoleName'
]
}
</
b
>
进行查看
</
p
>
})
return
<
PageHeaderWrapper
>
...
...
@@ -311,6 +338,7 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
roleId
:
{
type
:
'number'
,
title
:
'会员角色(转单采购)'
,
required
:
true
,
enum
:
[
{
label
:
'采购商(默认)'
,
...
...
@@ -321,17 +349,19 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
value
:
2
}
],
"x-component-props"
:
{
require
:
true
,
}
},
NOT_SUBMIT_TITLE
:
{
type
:
'object'
,
"x-component"
:
"CustomTitle"
,
"x-component-props"
:
{
number
:
0
,
roleName
:
null
,
}
},
orders
:
{
type
:
'array'
,
"x-component"
:
'MultTable'
,
required
:
true
,
"x-component-props"
:
{
rowKey
:
'id'
,
columns
:
"{{orderColumns}}"
,
...
...
@@ -340,6 +370,14 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
},
}
}
}
effects=
{
(
$
,
actions
)
=>
{
$
(
'onFieldInputChange'
,
'roleId'
).
subscribe
(
state
=>
{
actions
.
setFieldState
actions
.
setFieldState
(
'NOT_SUBMIT_TITLE'
,
prevState
=>
{
prevState
.
props
[
'x-component-props'
].
roleName
=
state
.
values
[
1
].
title
})
})
}
}
expressionScope=
{
{
orderColumns
,
}
}
...
...
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