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

fix: 处理待核销订单和核销自提码的问题

parent 33cc23dc
...@@ -7,7 +7,7 @@ import NestTable from '@/components/NestTable' ...@@ -7,7 +7,7 @@ import NestTable from '@/components/NestTable'
import { OrderKindType } from '@/constants/order' import { OrderKindType } from '@/constants/order'
import { getIntl, history } from 'umi' import { getIntl, history } from 'umi'
import OverflowText from '@/components/OverflowText' import OverflowText from '@/components/OverflowText'
import { postOrderVendorValidateReceiptConfirm } from '@/services/OrderNewV2Api' import { postOrderVendorTransfer, postOrderVendorValidateDeliveryConfirm, postOrderVendorValidateReceiptConfirm, postOrderVendorValidateVerify } from '@/services/OrderNewV2Api'
import ModalForm from '@/components/ModalForm' import ModalForm from '@/components/ModalForm'
import { createFormActions } from '@formily/antd' import { createFormActions } from '@formily/antd'
...@@ -29,11 +29,13 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -29,11 +29,13 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
const [disabled, setDisabled] = useState<boolean>(false) const [disabled, setDisabled] = useState<boolean>(false)
const [visible, setVisible] = useState<boolean>(false) const [visible, setVisible] = useState<boolean>(false)
const [transData, setTransData] = useState<string[]>([]) const [transData, setTransData] = useState<string[]>([])
const [currentRecord, setCurrentRecord] = useState<any>()
const [loading, setLoading] = useState<boolean>(false)
// 用于储存已经修改过的订单id // 用于储存已经修改过的订单id
const dataRef = useRef<any>([]) const dataRef = useRef<any>([])
const checkoutRef = useRef<any>({}) const checkoutRef = useRef<any>({})
const { data, reloadFormData } = useContext(OrderDetailContext) const { data, reloadFormData } = useContext(OrderDetailContext)
const { deliveries, deliveryDetails, orderMode, externalState, orderKind } = data const { deliveries, deliveryDetails, orderMode, externalState, orderKind, orderId } = data
const contractOrder = (orderKind === OrderKindType.SRM_ORDER || orderKind === OrderKindType.REQUISITION_ORDER) const contractOrder = (orderKind === OrderKindType.SRM_ORDER || orderKind === OrderKindType.REQUISITION_ORDER)
const creditsCommodity = (orderMode === 10 || orderMode === 25) // @todo 积分或渠道积分下单模式 const creditsCommodity = (orderMode === 10 || orderMode === 25) // @todo 积分或渠道积分下单模式
...@@ -419,7 +421,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -419,7 +421,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
} }
const handleCheckout = (record) => { const handleCheckout = (record) => {
console.log(record, 'rrr') setCurrentRecord(record)
checkoutRef.current.setVisible(true) checkoutRef.current.setVisible(true)
} }
...@@ -459,8 +461,18 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -459,8 +461,18 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 核销自提码 // 核销自提码
const handleSubmitCheckout = () => { const handleSubmitCheckout = () => {
setLoading(true)
checkoutActions.submit().then(async ({ values }: any) => { checkoutActions.submit().then(async ({ values }: any) => {
console.log(values) console.log(values, currentRecord)
postOrderVendorValidateVerify({
orderId: orderId,
batchNo: currentRecord.batchNo,
selfCode: values.code,
}).then(({code}) => {
if(code === 1000) {
reloadFormData && reloadFormData()
}
}).finally(() => { setLoading(false) })
}) })
} }
...@@ -602,7 +614,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -602,7 +614,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
} }
} }
}} }}
// modalProps={{ confirmLoading: loading }} modalProps={{ confirmLoading: loading }}
/> />
</> </>
) )
......
...@@ -35,8 +35,8 @@ export const useSelfTable = () => { ...@@ -35,8 +35,8 @@ export const useSelfTable = () => {
{ {
title: intl.formatMessage({ id: 'saleOrder.caigouhuiyuan', defaultMessage: '采购会员' }), title: intl.formatMessage({ id: 'saleOrder.caigouhuiyuan', defaultMessage: '采购会员' }),
align: 'left', align: 'left',
dataIndex: 'memberName', dataIndex: 'buyerMemberName',
key: 'memberName', key: 'buyerMemberName',
}, },
{ {
title: intl.formatMessage({ id: 'saleOrder.xiadanshijian', defaultMessage: '下单时间' }), title: intl.formatMessage({ id: 'saleOrder.xiadanshijian', defaultMessage: '下单时间' }),
......
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getSaleOrderAuditPageSelectOption } from '@/pages/transaction/effect';
import { useIntl } from 'umi'; import { useIntl } from 'umi';
export const tableListSchema: any = () => { export const tableListSchema: any = () => {
const intl = useIntl() const intl = useIntl()
// const OrderType = getOrderType() const res = getSaleOrderAuditPageSelectOption()
if(res) {
const {
orderTypes: OrderType,
} = res
return { return {
type: 'object', type: 'object',
...@@ -43,15 +48,14 @@ export const tableListSchema: any = () => { ...@@ -43,15 +48,14 @@ export const tableListSchema: any = () => {
"x-component-props": { "x-component-props": {
placeholder: intl.formatMessage({ id: 'saleOrder.qingxuanzedingdanOrderType', defaultMessage: '请选择订单类型' }) placeholder: intl.formatMessage({ id: 'saleOrder.qingxuanzedingdanOrderType', defaultMessage: '请选择订单类型' })
}, },
// enum: OrderType.map(item => ({ enum: OrderType.map(item => ({
// label: item['name'], label: item['text'],
// value: item['status'], value: item['id'],
// })) }))
enum: []
}, },
"[startCreateTime,endCreateTime]": { "[startCreateTime,endCreateTime]": {
type: 'array', type: 'daterange',
"x-component": 'DateRangePickerUnix', // "x-component": 'DateRangePickerUnix',
'x-component-props': { 'x-component-props': {
placeholder: [intl.formatMessage({ id: 'saleOrder.kaishishijian', defaultMessage: '开始时间' }),intl.formatMessage({ id: 'saleOrder.jieshushijian', defaultMessage: '结束时间' })], placeholder: [intl.formatMessage({ id: 'saleOrder.kaishishijian', defaultMessage: '开始时间' }),intl.formatMessage({ id: 'saleOrder.jieshushijian', defaultMessage: '结束时间' })],
}, },
...@@ -66,4 +70,5 @@ export const tableListSchema: any = () => { ...@@ -66,4 +70,5 @@ export const tableListSchema: any = () => {
}, },
} }
} }
}
} }
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