Commit 3c7b10bf authored by 卢均锐's avatar 卢均锐

chore: 修改pages/transaction/effect里接口引入方式

parent 9d1513ed
import React, { useEffect, useState } from 'react'
import { PublicApi } from '@/services/api';
import { GetOrderBuyerPageItemsResponse } from '@/services/OrderV2Api';
import { getProductSelectGetSelectCategory } from '@/services/ProductV2Api';
import { getPurchaseRequisitionFindInnerStatusEnum } from '@/services/PurchaseV2Api';
import { GetOrderBuyerPageItemsResponse, getOrderBuyerPageItems, getOrderVendorPageItems, getOrderBuyerValidatePageItems, getOrderVendorValidatePageItems, getOrderBuyerCreatePageItems } from '@/services/OrderNewV2Api';
// 高级筛选schema中用于输入搜索需求发布品类的Effect
export const searchSelectGetSelectCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
getProductSelectGetSelectCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
......@@ -27,9 +28,9 @@ export const getPurchaseOrderSelectOption = () => {
const [state, setstate] = useState<GetOrderBuyerPageItemsResponse>()
useEffect(() => {
PublicApi.getOrderBuyerPageItems({}).then(res => {
getOrderBuyerPageItems({}).then(res => {
const { code, data } = res
if(code === 1000) {
if (code === 1000) {
setstate(data)
}
})
......@@ -43,9 +44,9 @@ export const getSaleOrderSelectOption = () => {
const [state, setstate] = useState<any>()
useEffect(() => {
PublicApi.getOrderVendorPageItems({}).then(res => {
getOrderVendorPageItems({}).then(res => {
const { code, data } = res
if(code === 1000) {
if (code === 1000) {
setstate(data)
}
})
......@@ -59,9 +60,9 @@ export const getPurchaseOrderAuditPageSelectOption = () => {
const [state, setstate] = useState<any>()
useEffect(() => {
PublicApi.getOrderBuyerValidatePageItems({}).then(res => {
getOrderBuyerValidatePageItems({}).then(res => {
const { code, data } = res
if(code === 1000) {
if (code === 1000) {
setstate(data)
}
})
......@@ -76,9 +77,9 @@ export const getSaleOrderAuditPageSelectOption = () => {
const [state, setstate] = useState<any>()
useEffect(() => {
PublicApi.getOrderVendorValidatePageItems({}).then(res => {
getOrderVendorValidatePageItems({}).then(res => {
const { code, data } = res
if(code === 1000) {
if (code === 1000) {
setstate(data)
}
})
......@@ -92,9 +93,9 @@ export const getPurchaseOrderReadyAddPageSelectOption = () => {
const [state, setstate] = useState<any>()
useEffect(() => {
PublicApi.getOrderBuyerCreatePageItems({}).then(res => {
getOrderBuyerCreatePageItems({}).then(res => {
const { code, data } = res
if(code === 1000) {
if (code === 1000) {
setstate(data)
}
})
......@@ -108,9 +109,9 @@ export const getPurchaseRequisitionOrderPageSelectOption = () => {
const [state, setstate] = useState<any>()
useEffect(() => {
PublicApi.getPurchaseRequisitionFindInnerStatusEnum({}).then(res => {
getPurchaseRequisitionFindInnerStatusEnum({}).then(res => {
const { code, data } = res
if(code === 1000) {
if (code === 1000) {
setstate(data)
}
})
......
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