Commit 4fc3e47d authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 51b0cb72 c95315eb
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-22 15:24:13
* @LastEditTime: 2021-09-24 10:39:53
* @Description: 换货发货统计、换货发货明细
*/
import React, { useState } from 'react';
......@@ -28,6 +28,11 @@ 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 {
MAIL_INNER_STATUS_UNCONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
......@@ -93,6 +98,11 @@ interface ExchangeDeliverInfoProps extends MellowCardProps {
* 退货配送方式
*/
deliveryType: number,
/**
* 订单类型
*/
orderType: number,
};
const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
......@@ -107,6 +117,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
isEdit = false,
afterType,
deliveryType,
orderType,
...rest
}) => {
const [radioValue, setRadioValue] = useState<('1' | '2')>('2');
......@@ -114,32 +125,75 @@ 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 commonColumns: EditableColumns[] = [
...(
!isMateriel
? [
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
}
]
: [
{
title: '物料编号',
dataIndex: 'productId',
},
{
title: '物料名称、规格',
dataIndex: 'productName',
render: (text, record) => `${text}${record.type ? '/' + record.type : ''}`,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
{
title: orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
];
const summaryColumns: EditableColumns[] = [
{
title: '订单号',
dataIndex: 'orderNo',
},
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
...commonColumns,
{
title: '换货数量',
dataIndex: 'replaceCount',
......@@ -178,27 +232,7 @@ const ExchangeDeliverInfo: React.FC<ExchangeDeliverInfoProps> = ({
title: '订单号',
dataIndex: 'orderNo',
},
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
...commonColumns,
{
title: '换货数量',
dataIndex: 'count',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-22 15:23:49
* @LastEditTime: 2021-09-24 11:13:56
* @Description: 换货退货收货统计、换货退货发货明细
*/
import React, { useState } from 'react';
......@@ -30,6 +30,11 @@ 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 {
MAIL_INNER_STATUS_UNCONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
......@@ -95,6 +100,11 @@ interface ExchangeReceivedInfoProps extends MellowCardProps {
* 退货配送方式
*/
deliveryType: number,
/**
* 订单类型
*/
orderType: number,
};
const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
......@@ -109,6 +119,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
isEdit = false,
afterType,
deliveryType,
orderType,
...rest
}) => {
const [radioValue, setRadioValue] = useState<('1' | '2')>('2');
......@@ -116,32 +127,75 @@ 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 commonColumns: EditableColumns[] = [
...(
!isMateriel
? [
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
}
]
: [
{
title: '物料编号',
dataIndex: 'productId',
},
{
title: '物料名称、规格',
dataIndex: 'productName',
render: (text, record) => `${text}${record.type ? '/' + record.type : ''}`,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
{
title: orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
];
const summaryColumns: EditableColumns[] = [
{
title: '订单号',
dataIndex: 'orderNo',
},
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
...commonColumns,
{
title: '换货数量',
dataIndex: 'replaceCount',
......@@ -180,27 +234,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
title: '订单号',
dataIndex: 'orderNo',
},
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
...commonColumns,
{
title: '换货数量',
dataIndex: 'count',
......@@ -351,7 +385,7 @@ const ExchangeReceivedInfo: React.FC<ExchangeReceivedInfoProps> = ({
<Descriptions.Item label="退货入库单号">
{!isPurchaser ? (
<Link
to={`/memberCenter/afterService/exchangeManage/exchangePrAddWarehousing/warehousingDetail?id=${item.storageId}`}
to={`/memberCenter/afterService/exchangeManage/exchangePrAddWarehousing/warehousingDetail?id=${item.deliveryNoId}`}
>
{item.storageNo}
</Link>
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 15:18:15
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-27 09:44:08
* @LastEditTime: 2021-09-24 10:27:17
* @Description: 退货收货统计、退货发货明细
*/
import React, { useState } from 'react';
......@@ -30,6 +30,11 @@ 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 {
MAIL_INNER_STATUS_UNCONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_DELIVER,
MAIL_INNER_STATUS_CONFIRMED_RECEIVING,
......@@ -95,6 +100,11 @@ interface ReturnInfoProps extends MellowCardProps {
* 退货配送方式
*/
deliveryType: number,
/**
* 订单类型
*/
orderType: number,
};
const ReturnInfo: React.FC<ReturnInfoProps> = ({
......@@ -109,6 +119,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
isEdit = false,
afterType,
deliveryType,
orderType,
...rest
}) => {
const [radioValue, setRadioValue] = useState<('1' | '2')>('2');
......@@ -116,32 +127,75 @@ 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 commonColumns: EditableColumns[] = [
...(
!isMateriel
? [
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
}
]
: [
{
title: '物料编号',
dataIndex: 'productId',
},
{
title: '物料名称、规格',
dataIndex: 'productName',
render: (text, record) => `${text}${record.type ? '/' + record.type : ''}`,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
{
title: orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
];
const summaryColumns: EditableColumns[] = [
{
title: '订单号',
dataIndex: 'orderNo',
},
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
...commonColumns,
{
title: '退货数量',
dataIndex: 'returnCount',
......@@ -180,27 +234,7 @@ const ReturnInfo: React.FC<ReturnInfoProps> = ({
title: '订单号',
dataIndex: 'orderNo',
},
{
title: '商品ID',
dataIndex: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
ellipsis: true,
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
...commonColumns,
{
title: '退货数量',
dataIndex: 'count',
......
......@@ -159,7 +159,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
{
title: detailInfo?.orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text}/${record.associatedProductName}/${record.associatedType || '无'}/${record.associatedCategory}/${record.associatedBrand}`,
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
......@@ -533,6 +533,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isEdit={isEditRefundDeliver}
afterType={2}
deliveryType={detailInfo?.returnGoodsAddress?.deliveryType}
orderType={detailInfo?.orderType}
id="returnDeliveryGoodsList"
/>
</Suspense>
......@@ -557,6 +558,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isEdit={isEditExchangeDeliver}
afterType={2}
deliveryType={detailInfo?.replaceGoodsAddress?.deliveryType}
orderType={detailInfo?.orderType}
id="replaceDeliveryGoodsList"
/>
</Suspense>
......
......@@ -312,7 +312,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
return new Promise((resolve, reject) => {
PublicApi.getOrderCommonAfterSalePage({
...params,
...payload,
vendorMemberId: supplierMemberValue[0].memberId,
vendorRoleId: supplierMemberValue[0].roleId,
orderType: orderTypeValue,
......
......@@ -217,7 +217,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
{
title: detailInfo?.orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text}/${record.associatedProductName}/${record.associatedType || '无'}/${record.associatedCategory}/${record.associatedBrand}`,
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
......@@ -578,6 +578,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isEdit={isEditRefundDeliver}
afterType={2}
deliveryType={detailInfo?.returnGoodsAddress?.deliveryType}
orderType={detailInfo?.orderType}
id="returnDeliveryGoodsList"
/>
</Suspense>
......@@ -602,6 +603,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isEdit={isEditExchangeDeliver}
afterType={2}
deliveryType={detailInfo?.replaceGoodsAddress?.deliveryType}
orderType={detailInfo?.orderType}
id="replaceDeliveryGoodsList"
/>
</Suspense>
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-20 14:30:20
* @LastEditTime: 2021-09-24 11:06:32
* @Description: 待新增退货发货单
*/
import React, { useState, useRef } from 'react';
......
......@@ -94,7 +94,7 @@ const ExchangePrDeliverVerify: React.FC = () => {
noDeliveryCount: current?.unDeliveryCount || 0,
receiveCount: current?.receiveCount || 0,
subCount: current?.differenceCount || 0,
count: item.deliveryCount,
count: current?.unDeliveryCount || 0,
};
})
),
......
......@@ -79,7 +79,7 @@ const ExchangePrReceived: React.FC = () => {
align: 'center',
render: (text, record) => (
<Link
to={`/memberCenter/afterService/exchangeManage/exchangePrAddWarehousing/warehousingDetail?id=${record.returnDeliveryId}`}
to={`/memberCenter/afterService/exchangeManage/exchangePrAddWarehousing/warehousingDetail?id=${record.deliveryId}`}
>
{text}
</Link>
......
......@@ -133,7 +133,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
{
title: detailInfo?.orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text}/${record.associatedProductName}/${record.associatedType || '无'}/${record.associatedCategory}/${record.associatedBrand}`,
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
......
......@@ -134,7 +134,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
{
title: detailInfo?.orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text}/${record.associatedProductName}/${record.associatedType || '无'}/${record.associatedCategory}/${record.associatedBrand}`,
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
......
......@@ -193,7 +193,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
{
title: detailInfo?.orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text}/${record.associatedProductName}/${record.associatedType || '无'}/${record.associatedCategory}/${record.associatedBrand}`,
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
......@@ -613,6 +613,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isEdit={isEditRefundDeliver}
afterType={3}
deliveryType={detailInfo?.returnGoodsAddress?.deliveryType}
orderType={detailInfo?.orderType}
id="returnDeliveryGoodsList"
/>
</Suspense>
......
......@@ -219,7 +219,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
{
title: detailInfo?.orderType !== ORDER_TYPE_TENDER_CONTRACT ? '关联报价商品ID、名称、规格、品类、品牌' : '关联投标商品ID、名称、规格、品类、品牌',
dataIndex: 'associatedProductId',
render: (text, record) => `${text}/${record.associatedProductName}/${record.associatedType || '无'}/${record.associatedCategory}/${record.associatedBrand}`,
render: (text, record) => `${text || ''}/${record.associatedProductName || ''}/${record.associatedType || ''}/${record.associatedCategory || ''}/${record.associatedBrand || ''}`,
},
]
),
......@@ -650,6 +650,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isEdit={isEditRefundDeliver}
afterType={3}
deliveryType={detailInfo?.returnGoodsAddress?.deliveryType}
orderType={detailInfo?.orderType}
id="returnDeliveryGoodsList"
/>
</Suspense>
......
......@@ -13,9 +13,7 @@ import { PublicApi } from '@/services/api';
import { store } from '@/store'
import { inject, observer } from 'mobx-react'
import { validatorNumberRange } from '../constant';
const {Item}:any = Form
import { orderlyLadderPrice, validatorNumberRange } from '../constant';
// 定义选择的行数据的类型
interface Item {
......@@ -164,11 +162,11 @@ const SetPrice:React.FC<IProps> = (props) => {
item.attributeAndValueList.map(_item => {
temp[_item.customerAttribute.name] = {value: _item.customerAttributeValue.value, vId: _item.customerAttributeValue.id, id: _item.customerAttribute.id }
})
// 预先排序
let tempUnit = {}
Object.keys(item.unitPrice).sort((a: any, b: any)=>a.split('-')[0] - b.split('-')[0]).forEach( key => {
tempUnit[key] = item.unitPrice[key];
})
// // 预先排序
// let tempUnit = {}
// Object.keys(item.unitPrice).sort((a: any, b: any)=>a.split('-')[0] - b.split('-')[0]).forEach( key => {
// tempUnit[key] = item.unitPrice[key];
// })
_tableData.push({
"id": item.id, // 行数据id
"goodsId": item.goods?.id || '', // 货品ID 可能为null
......@@ -177,7 +175,7 @@ const SetPrice:React.FC<IProps> = (props) => {
"商品名称": name || productName,
"对应货品": item.goods?.name || '',
...temp,
"单价": tempUnit
"单价": orderlyLadderPrice(item.unitPrice)
})
})
setSpecTableData(_tableData)
......
import React, { useState, useEffect, useRef, useMemo } from 'react'
import {history} from 'umi'
import { history } from 'umi'
import { Button, Form, Select, Checkbox, Tooltip, Radio, Input, Table, Modal, Row, Col, InputNumber, Space } from 'antd'
import styles from './index.less'
import { PublicApi } from '@/services/api'
......@@ -9,7 +9,7 @@ import { QuestionCircleOutlined, SettingOutlined, PlusOutlined, MinusOutlined, }
import { inject, observer } from 'mobx-react'
import { store } from '@/store'
import { IProductSelectAttribute } from '@/module/productModule'
import { validatorNumberRange } from '../constant'
import { orderlyLadderPrice, validatorNumberRange } from '../constant'
const _ = require("lodash");
......@@ -341,26 +341,20 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
_tempObj['规格ID'] = productInfoByEdit.unitPriceAndPicList[i]?.id
}
if(updateFlag.current){ // 初次渲染tab 再次进入tab采用缓存数据
// _tempObj['单价'] = productInfoByEdit.unitPriceAndPicList[i]?.unitPrice || {}
if(productInfoByEdit.unitPriceAndPicList[i]?.unitPrice) {
let tempUnit = {}
// let tempUnit = {}
let unitPric = productInfoByEdit.unitPriceAndPicList[i]?.unitPrice
Object.keys(unitPric).sort().forEach(key => {
tempUnit[key] = unitPric[key];
})
_tempObj['单价'] = tempUnit
// Object.keys(unitPric).sort().forEach(key => {
// tempUnit[key] = unitPric[key];
// })
_tempObj['单价'] = orderlyLadderPrice(unitPric)
} else {
_tempObj['单价'] = {}
}
}else{
// _tempObj['单价'] = _tableDataSource[i] && tableDataSource[i] && tableDataSource[i]['单价'] || {}
if(_tableDataSource[i] && tableDataSource[i] && tableDataSource[i]['单价']) {
let tempUnit = {}
let unitPric = _tableDataSource[i] && tableDataSource[i] && tableDataSource[i]['单价']
Object.keys(unitPric).sort().forEach(key => {
tempUnit[key] = unitPric[key]
})
_tempObj['单价'] = tempUnit
_tempObj['单价'] = orderlyLadderPrice(unitPric)
} else {
_tempObj['单价'] = {}
}
......
......@@ -121,6 +121,20 @@ export const columns: ColumnType<any>[] = [
},
];
/** 阶梯价格排序函数 */
export const orderlyLadderPrice = (data) => {
try {
if(JSON.stringify(data) !== '{}') {
let tempObject = {};
Object.keys(data).sort((x, y) => Number(x.split('-')[0]) - Number(y.split('-')[0])).forEach(key => {
tempObject[key] = data[key];
})
return tempObject;
}
} catch (error) {
console.log(error)
}
}
/** 校验阶梯价格函数 min参数判断是否校验最小起订 */
export const validatorNumberRange = (rule: any, value: any, callback: any, min?: any) => {
......
......@@ -12,7 +12,7 @@ import ReutrnEle from '@/components/ReturnEle';
import styles from './index.less'
import { PublicApi } from '@/services/api';
import { GetLogisticsSelectListCompanyResponse, GetLogisticsSelectListFreightTemplateResponse, GetLogisticsSelectListShipperAddressResponse } from '@/services/LogisticsApi';
import { validatorNumberRange } from './constant';
import { orderlyLadderPrice, validatorNumberRange } from './constant';
const layout = {
labelCol: {
......@@ -207,7 +207,7 @@ const ModifyDirectChannel:React.FC<{}> = () => {
"商品名称": commodity?.name || channelDetails?.channelCommodity?.commodity?.name,
"对应货品": item.goods?.name || '',
...temp,
"单价": item.unitPrice
"单价": orderlyLadderPrice(item.unitPrice)
})
})
if(noModal){
......@@ -701,71 +701,52 @@ const ModifyDirectChannel:React.FC<{}> = () => {
{fields.map(field => (
<Row key={field.key} gutter={[0, 10]}>
<Col span={20} style={{ display: 'flex' }}>
<Item
{...field}
name={[field.name, 'numberRange']}
fieldKey={[field.fieldKey, 'numberRange']}
key={'_' + field.fieldKey}
noStyle
<Form.Item
name={[field.name, 'numberRange', 'numberMin']}
rules={[
{
required: true,
message: '阶梯最小数量为必填项'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值小数点后仅限三位',
}
]}
>
<Input.Group compact>
<Form.Item
name={[field.name, 'numberRange', 'numberMin']}
noStyle
rules={[
{
required: true,
message: '阶梯最小数量为必填项'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值小数点后仅限三位',
}
]}
>
<InputNumber style={{ width: 100, textAlign: 'center' }} placeholder="最小数量" />
</Form.Item>
<Input
style={{
width: 30,
borderLeft: 0,
borderRight: 0,
pointerEvents: 'none',
}}
placeholder="~"
disabled
/>
<Form.Item
name={[field.name, 'numberRange', 'numberMax']}
noStyle
rules={[
{
required: true,
message: '阶梯最大数量为必填项'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值小数点后仅限三位',
}
]}
>
<InputNumber
className={styles.siteInputRight}
style={{
width: 100,
textAlign: 'center',
}}
placeholder="最大数量"
/>
</Form.Item>
</Input.Group>
</Item>
<Input placeholder="最小数量" />
</Form.Item>
<Input
style={{
width: 30,
height: 32,
borderLeft: 0,
borderRight: 0,
pointerEvents: 'none',
}}
placeholder="~"
disabled
/>
<Form.Item
name={[field.name, 'numberRange', 'numberMax']}
rules={[
{
required: true,
message: '阶梯最大数量为必填项'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值小数点后仅限三位',
}
]}
>
<Input placeholder="最大数量" />
</Form.Item>
<Item
{...field}
name={[field.name, 'numberPrice']}
fieldKey={[field.fieldKey, 'numberPrice']}
key={'__' + field.fieldKey}
noStyle
rules={[
{
required: true,
......@@ -776,8 +757,9 @@ const ModifyDirectChannel:React.FC<{}> = () => {
message: '阶梯单价小数点后仅限四位',
}
]}
style={{ marginLeft: 20 }}
>
<InputNumber style={{ width: '50%', marginLeft: 24 }} placeholder="请输入单价" />
<Input placeholder="请输入单价" />
</Item>
</Col>
<Col span={4}>
......
......@@ -5,7 +5,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
import { CHANNEL_CENTER_URL, } from '@/constants'
import { PublicApi } from '@/services/api'
import { carriageTypeLabel, deliveryTypeLabel, productStatusLabel } from './constant'
import { carriageTypeLabel, deliveryTypeLabel, orderlyLadderPrice, productStatusLabel } from './constant'
const ViewDriectChannel: React.FC<{}> = () => {
const [channelDetails, setChannelDetails] = useState<any>()
......@@ -104,7 +104,7 @@ const ViewDriectChannel: React.FC<{}> = () => {
"商品名称": commodity.name,
"对应货品": item.goods?.name,
...temp,
"单价": item.unitPrice
"单价": orderlyLadderPrice(item.unitPrice)
})
})
setPriceTableData(_tableData)
......
......@@ -15,7 +15,7 @@ import {
GetProductCommodityGetCommodityResponse,
GetProductCommodityGetCommodityCheckRecordResponse,
} from '@/services/ProductApi'
import { carriageTypeLabel, columns, customerCategoryTypeLabel, deliveryTypeLabel, priceTypeLabel, productStatusColor, productStatusLabel } from './constant'
import { carriageTypeLabel, columns, customerCategoryTypeLabel, deliveryTypeLabel, orderlyLadderPrice, priceTypeLabel, productStatusColor, productStatusLabel } from './constant'
interface IAttributeByValue {
groupName: string;
......@@ -201,7 +201,7 @@ const viewProducts: React.FC<{}> = () => {
"商品名称": product.name,
"对应货品": item.goods?.code+'/'+item.goods?.name+'/'+item.goods?.type,
...attrWithObj,
"单价": item.unitPrice,
"单价": orderlyLadderPrice(item.unitPrice),
}
return temp
})
......
......@@ -335,7 +335,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
const onChange = (e) => {
let v = e.target.value
let v = e.target.value.replace(/\D/g, '')
setCode(v)
}
......
......@@ -52,17 +52,25 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
const amountMoney = totalAmount || sum + freight
return <RowStyle>
<Col span={2}>
<Col span={1}>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{creditsCommodity ? sum : `¥${sum}`}</div>
</Col>
<Col span={1}>
<div>促销立减</div>
<div>{`-¥${promotionAmount}`}</div>
</Col>
<Col span={1}>
<div>优惠抵扣</div>
<div>{`-¥${couponAmount}`}</div>
</Col>
{
contractOrder ? null : <>
<Col span={2}>
<Col span={1}>
<div>运费</div>
<div>{`¥${freight}`}</div>
</Col>
<Col span={2}>
<Col span={1}>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{creditsCommodity ? amountMoney : `¥${amountMoney}`}</div>
</Col>
......
......@@ -42,7 +42,7 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
margin-bottom: 12px;
}
`
// 仓位库存扣减记录
const warehouseColumns: any[] = [
{
dataIndex: 'freightSpaceId',
......@@ -83,6 +83,85 @@ const warehouseColumns: any[] = [
render: text => formatTimeString(text)
}
]
// 营销活动使用记录
const activityColumns: any[] = [
{
dataIndex: 'promotionId',
key: 'promotionId',
title: '活动ID',
align: 'center'
},
{
dataIndex: 'name',
key: 'name',
title: '活动名称',
align: 'center'
},
{
dataIndex: 'promotionTypeName',
key: 'promotionTypeName',
title: '活动类型',
align: 'center'
},
{
dataIndex: 'belongTypeName',
key: 'belongTypeName',
title: '活动归属',
align: 'center'
},
{
dataIndex: 'startTime',
key: 'startTime',
title: '活动有效期',
align: 'center',
render: (t, r) => `${t}${r.expireTime}`
}
]
// 优惠劵使用记录
const couponColumns: any[] = [
{
dataIndex: 'couponId',
key: 'couponId',
title: '劵码',
align: 'center'
},
{
dataIndex: 'name',
key: 'name',
title: '优惠劵名称',
align: 'center'
},
{
dataIndex: 'couponTypeName',
key: 'couponTypeName',
title: '优惠劵类型',
align: 'center'
},
{
dataIndex: 'belongTypeName',
key: 'belongTypeName',
title: '优惠劵归属',
align: 'center'
},
{
dataIndex: 'amount',
key: 'amount',
title: '面额',
align: 'center',
render: (t) => `¥${t}`
},
{
dataIndex: 'startTime',
key: 'startTime',
title: '有效期',
align: 'center',
render: (t, r) => `${t}${r.expireTime}`
}
]
const modalPriceActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, isEditData }) => {
......@@ -143,17 +222,25 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
}, [products])
return <RowStyle>
<Col span={2}>
<Col span={1}>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{creditsCommodity ? sum : `¥${sum}`}</div>
</Col>
<Col span={1}>
<div>促销立减</div>
<div>{`-¥${promotionAmount}`}</div>
</Col>
<Col span={1}>
<div>优惠抵扣</div>
<div><Button type="link" style={{padding: 0, height: '18px', lineHeight: '18px'}}>{`-¥${couponAmount}`}</Button></div>
</Col>
{
contractOrder ? null : <>
<Col span={2}>
<Col span={1}>
<div>运费 { isEditData && !creditsCommodity && !contractOrder && <SettingOutlined style={{marginLeft: 8}} onClick={handleSetting}/>}</div>
<div>{`¥${freight}`}</div>
</Col>
<Col span={2}>
<Col span={1}>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{creditsCommodity ? amountMoney : `¥${amountMoney}`}</div>
</Col>
......@@ -298,8 +385,12 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
// 合同下单模式
const contractOrder = (orderKind === OrderKindType.SRM_ORDER)
const [warehouseVisible, setWarehouseVisible] = useState(false)
const [activityVisible, setActivityVisible] = useState(false)
const [couponVisible, setCouponVisible] = useState(false)
const [checkProduct, setCheckProduct] = useState<any>({}) // 选中的商品id
const warehouseRef = useRef<any>({})
const activityRef = useRef<any>({})
const couponRef = useRef<any>({})
// 判断是否可操作当前表格
const isEditData = data.innerStatusName === '待提交审核'
......@@ -372,6 +463,10 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
setWarehouseVisible(true)
}
const handlePreviewActivity = (record) => {
}
// 订单商品列
const productInfoColumns: any[] = [
{
......@@ -448,11 +543,14 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
<AddressPop pickInfo={record}>{record.deliverTypeName}</AddressPop> : record.deliverTypeName
},
{
title: '仓位库存扣减记录',
dataIndex: 'record',
title: '操作',
dataIndex: 'opeartion',
align: 'center',
key: 'record',
render: (_, record) => <Button type='link' onClick={() => handlePreviewWarehouse(record)}>查看</Button>
key: 'opeartion',
render: (_, record) => <>
<Button type='link' onClick={() => handlePreviewWarehouse(record)}>查看库存记录</Button>
<Button type='link' onClick={() => handlePreviewActivity(record)}>查看活动记录</Button>
</>
},
]
......@@ -601,6 +699,34 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
destroyOnClose: true
}}
/>
<ModalTable
columns={activityColumns}
modalTitle='营销活动使用记录'
visible={activityVisible}
cancel={() => setActivityVisible(false)}
currentRef={activityRef}
confirm={() => setActivityVisible(false)}
fetchTableData={params => fetchWarehouseData(params)}
resetModal={{
destroyOnClose: true
}}
/>
<ModalTable
columns={couponColumns}
modalTitle='优惠劵使用记录'
visible={couponVisible}
cancel={() => setCouponVisible(false)}
currentRef={couponRef}
confirm={() => setCouponVisible(false)}
fetchTableData={params => fetchWarehouseData(params)}
resetModal={{
destroyOnClose: true
}}
/>
</MellowCard>
)
}
......
......@@ -97,7 +97,7 @@ const ApplicableGoods: React.FC<IProps> = (props) => {
render: (text) => {
const unitPrice = normalizeUnitPrice(text);
const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price;
const end = unitPrice[unitPrice.length - 1]?.price;
return start !== end ? ${start}~${end}` : ${start}`;
},
},
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-29 09:36:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-28 17:49:07
* @LastEditTime: 2021-09-24 13:37:27
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -127,7 +127,6 @@ export const drawerSchema: ISchema = {
properties: {
memberId: {
type: 'string',
'x-component': 'NumberPicker',
'x-component-props': {
placeholder: '会员ID',
},
......
......@@ -2,12 +2,21 @@
* @Author: XieZhiXiong
* @Date: 2021-07-02 17:53:48
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-02 17:53:48
* @LastEditTime: 2021-09-24 11:52:11
* @Description:
*/
import { ISchema } from '@formily/antd';
import moment from 'moment';
import { PATTERN_MAPS } from '@/constants/regExp';
function range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
}
const schema: ISchema = {
type: 'object',
properties: {
......@@ -29,6 +38,17 @@ const schema: ISchema = {
style: {
width: '100%',
},
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (_, type) => {
if (type === 'start') {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
disabledSeconds: () => range(0, 60).splice(0, moment().get('second')),
};
}
return {};
},
},
},
quantity: {
......
......@@ -71,7 +71,7 @@ const ApplicableGoodsFormItem = (props) => {
render: (text) => {
const unitPrice = normalizeUnitPrice(text);
const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price;
const end = unitPrice[unitPrice.length - 1]?.price;
return start !== end ? ${start}~${end}` : ${start}`;
},
},
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 16:11:55
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-08 19:29:00
* @LastEditTime: 2021-09-24 14:05:33
* @Description: 商品选择抽屉
*/
import React, { useEffect } from 'react';
......@@ -181,7 +181,7 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
render: (text) => {
const unitPrice = normalizeUnitPrice(text);
const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price;
const end = unitPrice[unitPrice.length - 1]?.price;
return start !== end ? ${start}~${end}` : ${start}`;
},
},
......
......@@ -332,9 +332,9 @@ export const productInfoColumns: any[] = [
},
{
title: '库存',
dataIndex: 'stock',
dataIndex: 'stockCount',
align: 'center',
key: 'stock',
key: 'stockCount',
},
{
title: '采购数量',
......
......@@ -25,14 +25,12 @@ const ReadyConfirmContract: React.FC = () => {
// }
}
}
console.log(currentPayInfoId)
}, [data, currentPayInfoId])
const renderPayPrice = () => {
if(data){
if(data.payments.length > 0){
let obj = data.payments.filter(item => item.paymentId === Number(currentPayInfoId))[0]
console.log(obj, 'obj')
if(obj)
return obj.payAmount
}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-04 13:59:33
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-22 14:55:11
* @LastEditTime: 2021-09-24 11:15:07
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -348,6 +348,9 @@ const createSchema = (relatedType: RelatedType, billType: number, orderType: num
'x-component': 'Text',
'x-component-props': {
ellipsis: true,
style: {
width: 400,
},
},
},
// 商品品类
......
......@@ -12,11 +12,11 @@ import styles from './index.less';
const EllipsisText = (props) => {
const { value } = props;
const { ellipsis } = (props.props['x-component-props'] || {});
const { ellipsis, ...rest } = (props.props['x-component-props'] || {});
return (
<Tooltip title={ellipsis ? value : null}>
<div className={classNames({ [styles.ellipsis]: ellipsis })}>{value}</div>
<div className={classNames({ [styles.ellipsis]: ellipsis })} {...rest}>{value}</div>
</Tooltip>
)
}
......
......@@ -33,7 +33,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const [productRowSelection, productRowCtl] = useRowSelectionTable({customKey: 'id'})
const [productsLength, setProductsLength] = useState(0)
const [initValue, setInitialValue] = useState({})
const [idNotInList, setIdNotInList] = useState([])
// const [idNotInList, setIdNotInList] = useState([])
const {
id,
......@@ -51,7 +51,8 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
...params,
shopType: shopInfo[0].type,
environment: shopInfo[0].environment,
idNotInList: idNotInList,
statusList: [4, 5, 6, 7],
// idNotInList: idNotInList,
})
return res.data
}else{
......@@ -310,17 +311,17 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
}
}
// 查询已设置交易规则的列表
const fatchSetedProducts = (id) => {
let baseProcessId = addSchemaAction.getFieldValue("baseProcessId")
addSchemaAction.getFieldState("baseProcessId", state => {
let type = state.dataSource.filter(item => item.baseProcessid === baseProcessId)[0]["processType"]
PublicApi.getOrderTradingRulesProductIdList({shopId: id, type}).then(res => {
const { data, code } = res
setIdNotInList(() => data?.productIds || [])
})
})
}
// // 查询已设置交易规则的列表
// const fatchSetedProducts = (id) => {
// let baseProcessId = addSchemaAction.getFieldValue("baseProcessId")
// addSchemaAction.getFieldState("baseProcessId", state => {
// let type = state.dataSource.filter(item => item.baseProcessid === baseProcessId)[0]["processType"]
// PublicApi.getOrderTradingRulesProductIdList({shopId: id, type}).then(res => {
// const { data, code } = res
// setIdNotInList(() => data?.productIds || [])
// })
// })
// }
// 自定义支付批次配置组件
const CustomPayments = props => {
......@@ -377,7 +378,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
setFieldState('allProducts', state => {
state.value = true
})
fatchSetedProducts(parentState.value[0])
// fatchSetedProducts(parentState.value[0])
})
// 此项隐藏操作在编辑下能无效
$('onFieldValueChange', 'baseProcessId').subscribe(parentState => {
......
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