Commit 3de74a52 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 11b8868a 7035053e
......@@ -28,8 +28,6 @@ import {
EXCHANGE_INNER_STATUS_UNCONFIRMED_REPLACE_RECEIPT,
} from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import {
......@@ -37,6 +35,7 @@ import {
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
} from '../../constants';
import { isMaterialOrder } from '../../utils';
import ReturnDeliverDrawer, { AfterType } from '../DeliverDrawer';
import styles from './index.less';
......@@ -125,11 +124,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
const [submitLoading, setSubmitLoading] = useState(false);
const [currentDetailed, setCurrentDetailed] = useState<Detailed | null>(null);
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderType);
const commonColumns: EditableColumns[] = [
...(
......
......@@ -30,8 +30,6 @@ import {
EXCHANGE_INNER_STATUS_UNCONFIRMED_RETURN_RECEIPT,
} from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import {
......@@ -39,6 +37,7 @@ import {
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
} from '../../constants';
import { isMaterialOrder } from '../../utils';
import ReturnDeliverDrawer, { AfterType } from '../DeliverDrawer';
import styles from './index.less';
......@@ -127,11 +126,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
const [submitLoading, setSubmitLoading] = useState(false);
const [currentDetailed, setCurrentDetailed] = useState<Detailed | null>(null);
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderType);
const commonColumns: EditableColumns[] = [
...(
......
......@@ -30,8 +30,6 @@ import {
RETURN_INNER_STATUS_UNCONFIRMED_RETURN_RECEIPT,
} from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import {
......@@ -39,6 +37,7 @@ import {
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
} from '../../constants';
import { isMaterialOrder } from '../../utils';
import ReturnDeliverDrawer, { AfterType } from '../DeliverDrawer';
import styles from './index.less';
......@@ -127,11 +126,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
const [submitLoading, setSubmitLoading] = useState(false);
const [currentDetailed, setCurrentDetailed] = useState<Detailed | null>(null);
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderType);
const commonColumns: EditableColumns[] = [
...(
......
......@@ -7,11 +7,7 @@
*/
import BigNumber from 'bignumber.js';
import { FormEffectHooks } from '@formily/antd';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import { isMaterialOrder } from '../../../utils';
const {
onFieldInputChange$,
......@@ -39,11 +35,7 @@ export const useBusinessEffects = (context, actions) => {
const orderTypeValue = await getFieldValue('orderType');
const payListValue = await getFieldValue('payList') || [];
const isMateriel = (
orderTypeValue === ORDER_TYPE_INQUIRY_CONTRACT
|| orderTypeValue === ORDER_TYPE_BIDDING_CONTRACT
|| orderTypeValue === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderTypeValue);
if (!isMateriel) {
const newData = [...payListValue].map(item => {
......
......@@ -11,14 +11,10 @@ import NiceForm from '@/components/NiceForm';
import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
import BigNumber from 'bignumber.js';
import { PublicApi } from '@/services/api';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import schema from './schema';
import { createEffects } from './effects';
import Stamp from '../Stamp';
import { isMaterialOrder } from '../../utils';
import SteamerTicket from './components/SteamerTicket';
const schemaAction = createAsyncFormActions();
......@@ -186,11 +182,7 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
if (!applyInfo || !applyInfo.orderId) {
return;
}
const isMateriel = (
applyInfo.orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| applyInfo.orderType === ORDER_TYPE_BIDDING_CONTRACT
|| applyInfo.orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(applyInfo.orderType);
if (isMateriel) {
schemaAction.setFieldState('productName', state => {
state.title = '物料名称';
......
......@@ -21,8 +21,6 @@ import {
ORDER_TYPE2_CHANNEL_POINTS,
} from '@/constants/order';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE,
} from '@/constants/order';
......@@ -36,6 +34,7 @@ import {
EXCHANGE_OUTER_STATUS_TAG_MAP,
EXCHANGE_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import { isMaterialOrder } from '../../../utils';
const ProductList = React.lazy(() => import('../../../components/ProductList'));
const ExchangeReceivedInfo = React.lazy(() => import('../../../components/ExchangeReceivedInfo'));
......@@ -90,11 +89,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const [infoLoading, setInfoloading] = useState(false);
const isPointsOrder = detailInfo?.orderType === ORDER_TYPE2_POINTS || detailInfo?.orderType === ORDER_TYPE2_CHANNEL_POINTS;
const isMateriel = (
detailInfo?.orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_BIDDING_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(detailInfo?.orderType);
const productColumns: EditableColumns[] = [
{
......
......@@ -12,10 +12,6 @@ import { PublicApi } from '@/services/api';
import { GetAsReplaceGoodsPageReturnedGoodsResponseDetail } from '@/services/AfterServiceV2Api';
import { normalizeFiledata, FileData } from '@/utils';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE2,
ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_POINTS,
} from '@/constants/order';
......@@ -31,6 +27,7 @@ import {
EXCHANGE_OUTER_STATUS_TAG_MAP,
EXCHANGE_INNER_STATUS_BADGE_MAP,
} from '../../../../constants';
import { isMaterialOrder } from '../../../../utils';
const addSchemaAction = createFormActions();
const {
......@@ -194,11 +191,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const [orderTypeValue, setOrderTypeValue] = useState(0);
const isPointsOrder = orderTypeValue === ORDER_TYPE2_POINTS || orderTypeValue === ORDER_TYPE2_CHANNEL_POINTS;
const isMateriel = (
orderTypeValue === ORDER_TYPE_INQUIRY_CONTRACT
|| orderTypeValue === ORDER_TYPE_BIDDING_CONTRACT
|| orderTypeValue === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderTypeValue);
const tableColumn: ColumnType<any>[] = [
{
......
......@@ -11,12 +11,11 @@ import {
DELIVERY_TYPE_ENUM,
} from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_POINTS,
} from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils';
// 供应会员列表列
const supplierColumns = [
......@@ -88,11 +87,7 @@ const orderTypeArr = GlobalConfig.web.orderType.map((item) => ({
export const addSchema = (orderType: number): ISchema => {
const isPoints = orderType === ORDER_TYPE2_POINTS || orderType === ORDER_TYPE2_CHANNEL_POINTS;
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderType);
return {
type: 'object',
properties: {
......
......@@ -19,8 +19,6 @@ import {
EXCHANGE_INNER_STATUS_UNCOMMITTED,
} from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_POINTS,
......@@ -38,6 +36,7 @@ import {
EXCHANGE_OUTER_STATUS_TAG_MAP,
EXCHANGE_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import { isMaterialOrder } from '../../../utils';
const ProductList = React.lazy(() => import('../../../components/ProductList'));
const ExchangeReceivedInfo = React.lazy(() => import('../../../components/ExchangeReceivedInfo'));
......@@ -99,11 +98,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const [returnAddress, setReturnAddress] = useState<ReturnAddressValues>(null);
const isPointsOrder = detailInfo?.orderType === ORDER_TYPE2_POINTS || detailInfo?.orderType === ORDER_TYPE2_CHANNEL_POINTS;
const isMateriel = (
detailInfo?.orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_BIDDING_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(detailInfo?.orderType);
// 获取换货申请详情
const getDetailInfo = () => {
......
......@@ -13,8 +13,6 @@ import StatusTag from '@/components/StatusTag';
import { EditableColumns } from '@/components/PolymericTable/interface';
import { REPAIR_OUTER_STATUS_FINISHED } from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE,
} from '@/constants/order';
......@@ -22,6 +20,7 @@ import {
REPAIR_OUTER_STATUS_TAG_MAP,
REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import { isMaterialOrder } from '../../../utils';
const OuterCirculation = React.lazy(() => import('../../../components/OuterCirculation'));
const ProductList = React.lazy(() => import('../../../components/ProductList'));
......@@ -64,11 +63,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const [infoLoading, setInfoLoading] = useState(false);
const [repairGoodsLoading, setRepairGoodsLoading] = useState(false);
const isMateriel = (
detailInfo?.orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_BIDDING_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(detailInfo?.orderType);
const productColumns: EditableColumns[] = [
{
......
......@@ -30,6 +30,7 @@ import {
REPAIR_OUTER_STATUS_TAG_MAP,
REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../../../constants';
import { isMaterialOrder } from '../../../../utils';
const addSchemaAction = createFormActions();
const {
......@@ -123,11 +124,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
const [visibleDrawer, setVisibleDrawer] = useState(false);
const [orderTypeValue, setOrderTypeValue] = useState(0);
const isMateriel = (
orderTypeValue === ORDER_TYPE_INQUIRY_CONTRACT
|| orderTypeValue === ORDER_TYPE_BIDDING_CONTRACT
|| orderTypeValue === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderTypeValue);
const tableColumn: ColumnType<any>[] = [
{
......
......@@ -6,12 +6,11 @@ import { UPLOAD_TYPE } from '@/constants';
import { PublicApi } from '@/services/api';
import { GlobalConfig } from '@/global/config';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE_POINTS,
ORDER_TYPE_CHANNEL_POINTS,
} from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils';
// 供应会员列表列
const supplierColumns = [
......@@ -82,11 +81,7 @@ const orderTypeArr = GlobalConfig.web.orderType.map((item) => ({
})).filter((item) => (item.value !== ORDER_TYPE_POINTS && item.value !== ORDER_TYPE_CHANNEL_POINTS));
export const addSchema = (orderType: number): ISchema => {
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderType);
return {
type: 'object',
properties: {
......
......@@ -14,8 +14,6 @@ import AuditProcess from '@/components/AuditProcess';
import { EditableColumns } from '@/components/PolymericTable/interface';
import { REPAIR_OUTER_STATUS_FINISHED } from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE,
} from '@/constants/order';
......@@ -23,6 +21,7 @@ import {
REPAIR_OUTER_STATUS_TAG_MAP,
REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import { isMaterialOrder } from '../../../utils';
const ProductList = React.lazy(() => import('../../../components/ProductList'));
const FileList = React.lazy(() => import('../../../components/FileList'));
......@@ -65,11 +64,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const [infoLoading, setInfoLoading] = useState(false);
const [repairGoodsLoading, setRepairGoodsLoading] = useState(false);
const isMateriel = (
detailInfo?.orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_BIDDING_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(detailInfo?.orderType);
const productColumns: EditableColumns[] = [
{
......
......@@ -23,8 +23,6 @@ import {
RETURN_INNER_STATUS_UNCOMMITTED,
} from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE,
} from '@/constants/order';
......@@ -40,6 +38,7 @@ import {
RETURN_OUTER_STATUS_TAG_MAP,
RETURN_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import { isMaterialOrder } from '../../../utils';
const ProductList = React.lazy(() => import('../../../components/ProductList'));
const ReturnAnalysis = React.lazy(() => import('../../../components/ReturnAnalysis'));
......@@ -124,11 +123,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
setVisibleReturnInfo(true);
};
const isMateriel = (
detailInfo?.orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_BIDDING_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(detailInfo?.orderType);
const productColumns: EditableColumns[] = [
{
......
......@@ -29,6 +29,7 @@ import {
RETURN_OUTER_STATUS_TAG_MAP,
RETURN_INNER_STATUS_BADGE_MAP,
} from '../../../../constants';
import { isMaterialOrder } from '../../../../utils';
const addSchemaAction = createFormActions();
const {
......@@ -197,11 +198,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const [goodsValue, setGoodsValue] = useState([]);
const [orderTypeValue, setOrderTypeValue] = useState(0);
const isMateriel = (
orderTypeValue === ORDER_TYPE_INQUIRY_CONTRACT
|| orderTypeValue === ORDER_TYPE_BIDDING_CONTRACT
|| orderTypeValue === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderTypeValue);
const tableColumn: ColumnType<any>[] = [
{
......
......@@ -7,12 +7,11 @@ import { DELIVERY_TYPE_ENUM } from '@/constants/afterService';
import { PublicApi } from '@/services/api';
import { GlobalConfig } from '@/global/config';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE_POINTS,
ORDER_TYPE_CHANNEL_POINTS,
} from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils';
// 供应会员列表列
const supplierColumns = [
......@@ -87,11 +86,7 @@ const orderTypeArr = GlobalConfig.web.orderType.map((item) => ({
})).filter((item) => (item.value !== ORDER_TYPE_POINTS && item.value !== ORDER_TYPE_CHANNEL_POINTS));
export const addSchema = (orderType: number): ISchema => {
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(orderType);
return {
type: 'object',
properties: {
......
......@@ -25,8 +25,6 @@ import {
RETURN_INNER_STATUS_UNCOMMITTED,
} from '@/constants/afterService';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE,
} from '@/constants/order';
......@@ -43,6 +41,7 @@ import {
RETURN_OUTER_STATUS_TAG_MAP,
RETURN_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import { isMaterialOrder } from '../../../utils';
const ProductList = React.lazy(() => import('../../../components/ProductList'));
const ReturnAnalysis = React.lazy(() => import('../../../components/ReturnAnalysis'));
......@@ -150,11 +149,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
});
};
const isMateriel = (
detailInfo?.orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_BIDDING_CONTRACT
|| detailInfo?.orderType === ORDER_TYPE_TENDER_CONTRACT
);
const isMateriel = isMaterialOrder(detailInfo?.orderType);
const productColumns: EditableColumns[] = [
{
......
/*
* @Author: XieZhiXiong
* @Date: 2021-11-15 10:20:22
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-15 10:25:34
* @Description: 售后服务相关工具函数
*/
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE_REQUISITION,
} from '@/constants/order';
// 是否是采购订单
export const isMaterialOrder = (orderType: number) => {
return (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
|| orderType === ORDER_TYPE_REQUISITION
)
};
\ No newline at end of file
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