Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈智峰
jinfa-platform
Commits
effcdff5
Commit
effcdff5
authored
Jun 10, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 销售订单查询添加取消订单操作
parent
d2db36f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
4 deletions
+68
-4
index.tsx
src/pages/transaction/purchaseOrder/index.tsx
+3
-2
index.tsx
src/pages/transaction/saleOrder/index.tsx
+65
-2
No files found.
src/pages/transaction/purchaseOrder/index.tsx
View file @
effcdff5
...
...
@@ -73,7 +73,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
[
recordId
,
setRecordId
]
=
useState
<
any
>
()
const
ref
=
useRef
<
any
>
({})
const
destoryRef
=
useRef
<
any
>
({})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
post
PurchaseInviteTenderDiscardInviteTender
)
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
post
OrderPurchaseOrderCancel
)
// 售后唤起弹窗
const
handleSaleAfter
=
(
id
)
=>
{
...
...
@@ -118,6 +118,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const
handleCancel
=
async
(
id
)
=>
{
destoryRef
.
current
.
setVisible
(
true
)
destroyActions
.
setFieldValue
(
'id'
,
id
)
// await PublicApi.postOrderPurchaseOrderCancel({id})
// ref.current.reload()
}
...
...
@@ -241,7 +242,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
title
:
'当前id'
,
visible
:
false
,
},
disabledRemark
:
{
reason
:
{
type
:
'textarea'
,
"x-component-props"
:
{
rows
:
4
,
...
...
src/pages/transaction/saleOrder/index.tsx
View file @
effcdff5
import
React
,
{
use
Ref
,
useState
}
from
'react'
import
React
,
{
use
Callback
,
useRef
}
from
'react'
import
{
Card
,
Button
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
...
...
@@ -14,6 +14,8 @@ import Submit from '@/components/NiceForm/components/Submit'
import
NiceForm
from
'@/components/NiceForm'
import
{
createFormActions
}
from
'@formily/antd'
import
TableOperation
from
'@/components/TableOperation'
import
ModalForm
from
'@/components/ModalForm'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
// 销售订单查询
...
...
@@ -25,16 +27,33 @@ const fetchTableData = async (params) => {
}
const
formActions
=
createFormActions
();
const
destroyActions
=
createFormActions
()
const
SaleOrder
:
React
.
FC
<
SaleOrderProps
>
=
(
props
)
=>
{
const
ref
=
useRef
<
any
>
({})
const
destoryRef
=
useRef
<
any
>
({})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderPurchaseOrderCancel
)
// 提交取消
const
handleSubmit
=
useCallback
(()
=>
{
destroyActions
.
submit
().
then
(
async
({
values
}:
any
)
=>
{
const
result
=
await
run
(
values
)
if
(
result
.
code
===
1000
)
{
destoryRef
.
current
.
setVisible
(
false
)
setTimeout
(()
=>
{
ref
.
current
.
reload
()
},
800
)
}
})
},
[])
const
handleEvaluate
=
(
id
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated`
)
}
const
handleCancel
=
(
r
)
=>
{
console
.
log
(
'TODO'
)
destoryRef
.
current
.
setVisible
(
true
)
destroyActions
.
setFieldValue
(
'id'
,
r
.
id
)
}
const
handleSuspend
=
(
r
)
=>
{
...
...
@@ -114,6 +133,50 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
}
}
/>
</
Card
>
<
ModalForm
modalTitle=
'取消原因'
currentRef=
{
destoryRef
}
confirm=
{
handleSubmit
}
actions=
{
destroyActions
}
schema=
{
{
type
:
'object'
,
properties
:
{
NO_SUBMIT
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
labelAlign
:
'top'
,
},
properties
:
{
id
:
{
type
:
'number'
,
title
:
'当前id'
,
visible
:
false
,
},
reason
:
{
type
:
'textarea'
,
"x-component-props"
:
{
rows
:
4
,
placeholder
:
'在此输入你的原因, 最多50个汉字'
},
title
:
'取消原因'
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请输入取消原因'
},
{
limitByte
:
true
,
maxByte
:
100
}
]
}
}
}
}
}
}
modalProps=
{
{
confirmLoading
:
loading
}
}
/>
</
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