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

fix: 对接新订单采购订单查询筛选下拉和订单列表

parent 30ad2185
......@@ -80,8 +80,8 @@ const AddBrand: React.FC<{}> = () => {
setFormValues(data)
form.setFieldsValue(data)
setlogoUrl(data.logoUrl)
// if(data.status === 4)
// setBanSomeField(true)
if(data.status === 4)
setBanSomeField(true)
// 多图回显
let proveImgs = Object.values(data.proveUrl)
let files = [];
......
import { getSaleOrderInsideWorkState } from './../../effect/index';
import { getPurchaseOrderSelectOption, getSaleOrderSelectOption } from './../../effect/index';
import { ISchema } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
// import { OrderTypeMap, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants/order'
import { getOrderType, getPurchaseOrderInsideWorkState, getPurchaseOrderOutWorkState, } from '../../effect'
export const orderTypeLabel = ['',
......@@ -42,9 +40,13 @@ export enum SALE_ORDER_STATUS {
export const tableListSchema: any = () => {
const OrderType = getOrderType()
const PurchaseOrderOutWorkStateTexts = getPurchaseOrderOutWorkState()
const PurchaseOrderInsideWorkStateTexts = getPurchaseOrderInsideWorkState()
const res = getPurchaseOrderSelectOption()
if(res) {
const {
orderTypes: OrderType,
innerStatus: PurchaseOrderInsideWorkStateTexts,
outerStatus: PurchaseOrderOutWorkStateTexts
} = res
return {
type: 'object',
......@@ -90,52 +92,53 @@ export const tableListSchema: any = () => {
},
properties: {
orderThe: {
digest: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
},
"supplyMembersName": {
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
}
},
"type": {
"orderType": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
},
enum: OrderType.map(item => ({
label: item['name'],
value: item['status'],
label: item['text'],
value: item['id'],
}))
},
"externalState": {
"outerStatus": {
type: 'string',
"x-component-props": {
placeholder: '请选择外部状态'
},
enum: PurchaseOrderOutWorkStateTexts.map(item => ({
label: item['name'],
value: item['status'],
label: item['text'],
value: item['id'],
}))
},
"interiorState": {
"innerStatus": {
type: 'string',
"x-component-props": {
placeholder: '请选择内部状态'
},
enum: PurchaseOrderInsideWorkStateTexts.map(item => ({
label: item['name'],
value: item['status'],
label: item['text'],
value: item['id'],
}))
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
"[startDate, endDate]": {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
// showTime: true,
placeholder: ['开始时间','结束时间'],
},
},
......@@ -149,6 +152,7 @@ export const tableListSchema: any = () => {
},
}
}
}
}
......@@ -160,9 +164,11 @@ export const tableListSchema: any = () => {
export const saleTableListSchema: any = () => {
const OrderType = getOrderType()
const PurchaseOrderOutWorkStateTexts = getPurchaseOrderOutWorkState()
const SaleOrderInsideWorkStateTexts = getSaleOrderInsideWorkState()
const {
orderTypes: OrderType,
innerStatus: SaleOrderInsideWorkStateTexts,
outerStatus: PurchaseOrderOutWorkStateTexts
} = getSaleOrderSelectOption()
return {
type: 'object',
......
import React, { useEffect, useState } from 'react'
import { PublicApi } from '@/services/api';
import { GetOrderBuyerPageItemsResponse } from '@/services/OrderV2Api';
......@@ -17,10 +18,45 @@ export const searchSelectGetSelectCategoryOptionEffect = (context: any, fieldNam
/** 订单状态逻辑复用 */
interface IState {
satatus: number;
status: number;
name: string;
}
/** 获取采购订单下拉项:订单类型、内部状态、外部状态 */
export const getPurchaseOrderSelectOption = () => {
const [state, setstate] = useState<GetOrderBuyerPageItemsResponse>()
useEffect(() => {
PublicApi.getOrderBuyerPageItems({}).then(res => {
const { code, data } = res
if(code === 1000) {
setstate(data)
}
})
}, [])
return state
}
/** @todo 获取销售订单下拉项:订单类型、内部状态、外部状态 */
export const getSaleOrderSelectOption = () => {
const [state, setstate] = useState<any>()
// useEffect(() => {
// PublicApi.getOrderBuyerPageItems({}).then(res => {
// const { code, data } = res
// if(code === 1000) {
// setstate(data)
// }
// })
// }, [])
return state
}
// **以下*即将弃用*** //
/** 获取订单类型映射 */
export const getOrderType = () => {
const [state, setstate] = useState<IState[]>([])
......
......@@ -31,15 +31,15 @@ export const baseOrderListColumns: any = () => {
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
dataIndex: 'digest',
key: 'digest',
ellipsis: true,
},
{
title: '供应会员',
align: 'center',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
dataIndex: 'memberName',
key: 'memberName',
ellipsis: true,
},
{
......@@ -59,28 +59,28 @@ export const baseOrderListColumns: any = () => {
{
title: '订单类型',
align: 'center',
dataIndex: 'typeName',
key: 'typeName',
filters: OrderType.map((e, i) => ({ text: e['name'], value: Number(e['status']) })),
onFilter: (value, record) => value === record.type,
dataIndex: 'orderTypeName',
key: 'orderTypeName',
filters: OrderType.map((e, i) => ({ text: e['text'], value: Number(e['id']) })),
onFilter: (value, record) => value === record.orderType,
},
{
title: '外部状态',
align: 'center',
dataIndex: 'externalState',
key: 'externalState',
render: (text, record) => <StatusColors status={text} type='out' text={record['externalStateName']} />,
filters: PurchaseOrderOutWorkStateTexts.map((e, i) => ({ text: e['name'], value: Number(e['status']) })),
onFilter: (value, record) => value === record.externalState,
dataIndex: 'outerStatusName',
key: 'outerStatusName',
render: (text, record) => <StatusColors status={text} type='out' text={record['outerStatusName']} />,
filters: PurchaseOrderOutWorkStateTexts.map((e, i) => ({ text: e['text'], value: Number(e['id']) })),
onFilter: (value, record) => value === record.outerStatus,
},
{
title: '内部状态',
align: 'center',
dataIndex: 'interiorState',
key: 'interiorState',
render: (text, record) => <StatusColors status={text} type='inside' text={record['interiorStateName']} />,
filters: PurchaseOrderInsideWorkStateTexts.map((e, i) => ({ text: e['name'], value: Number(e['status']) })),
onFilter: (value, record) => value === record.interiorState,
dataIndex: 'innerStatusName',
key: 'innerStatusName',
render: (text, record) => <StatusColors status={text} type='inside' text={record['innerStatusName']} />,
filters: PurchaseOrderInsideWorkStateTexts.map((e, i) => ({ text: e['text'], value: Number(e['id']) })),
onFilter: (value, record) => value === record.innerStatus,
}
]
}
......@@ -54,7 +54,7 @@ const SelectStyles = styled((props) => <div className='select-list' {...props}><
export interface PurchaseOrderProps { }
const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementOrderList(params)
const { data } = await PublicApi.getOrderBuyerPage(params)
return data
}
......@@ -119,8 +119,6 @@ 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()
}
/** 参照后台数据生成 */
......@@ -134,7 +132,6 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
'4': ['售后', '评价'],
}
const operationHandler = {
// @todo 取消订单
'取消订单': () => handleCancel(record.id),
'售后': () => handleSaleAfter(record.id),
'评价': () => handleEvaluate(record.id),
......@@ -156,12 +153,6 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
dataIndex: 'ctl',
key: 'ctl',
render: (text: any, record: any) => renderOptionButton(record)
// render: (text, record) => <>
// { record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER && !record.procurementEevaluateState && <Button type='link' onClick={() => handleEvaluate(record.id)}>评价</Button> }
// {
// (record.receivingTimes >= 1 || record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER) && <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button>
// }
// </>
}
])
......
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