Commit effcdff5 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 销售订单查询添加取消订单操作

parent d2db36f5
......@@ -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.postPurchaseInviteTenderDiscardInviteTender)
const { run, loading } = useHttpRequest(PublicApi.postOrderPurchaseOrderCancel)
// 售后唤起弹窗
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,
......
import React, { useRef, useState } from 'react'
import React, { useCallback, 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>
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment