Commit c7b05b7c authored by 前端-许佳敏's avatar 前端-许佳敏

Merge branch 'dev-srm' into v2

parents e327a7b1 4b35028c
......@@ -520,7 +520,7 @@ const viewProducts: React.FC<{}> = () => {
<p>税率:</p>
</Col>
<Col span={20}>
<p>{productDetail?.taxRate}</p>
<p>{productDetail?.taxRate ? `${productDetail?.taxRate}%` : null}</p>
</Col>
</Row>
{
......
......@@ -17,7 +17,7 @@ export interface Iprops extends IAntdSchemaFormProps {
contractId: any,
children?: React.ReactNode,
title?: string,
payItem?: React.ReactNode
}
......@@ -27,7 +27,8 @@ const PaymentCard: React.FC<Iprops> = ({
basics,
contractId,
children,
title
title,
payItem
}) => {
/* 非手工单进入请款 */
const like = (sourceType, item) => {
......@@ -71,6 +72,7 @@ const PaymentCard: React.FC<Iprops> = ({
<div className={style.label}>付款方式:</div>
<div className={style.text}>{item.payWayName}</div>
</div>
{payItem ? payItem : null}
</div>
</div>
)
......@@ -87,6 +89,8 @@ PaymentCard.defaultProps = {
payPlanList: [],
basics: {},
contractId: 0,
children: null,
payItem: null
}
export default PaymentCard;
......@@ -72,13 +72,12 @@ const Details = (props: any) => {
{ label: '合同编号', extra: basics.contractNo ? basics.contractNo : '', },
{ label: '合同摘要', extra: basics.contractAbstract ? basics.contractAbstract : '' },
{ label: '外部状态', extra: basics.outerStatusName ? basics.outerStatusName : '', type: 'StatusTag' },
{ label: '内部状态', extra: basics.innerStatusName ? basics.innerStatusName : '' },
],
col2: [
{ label: '寻源类型', extra: basics.sourceTypeName ? basics.sourceTypeName : '' },
{ label: '对应单据', extra: basics.sourceNo ? basics.sourceNo : '' },
{ label: '授标会员', extra: basics.partyAName ? basics.partyAName : '' },
{ label: '授标金额', extra: basics.totalAmount ? `¥${basics.totalAmount}` : '' },
],
col3: [
{ label: '合同有效期:', extra: `${basics.startTime}${basics.endTime}` },
......@@ -87,6 +86,20 @@ const Details = (props: any) => {
if (type) {
basicInfo.col1[0].url = `/memberCenter/contract/coordination/coordinationList/details?contractId=${contractId}`
}
if (type != 'implement') {
basicInfo.col1.push({ label: '内部状态', extra: basics.innerStatusName ? basics.innerStatusName : '' })
basicInfo.col2.push(
{ label: '授标会员', extra: basics.partyAName ? basics.partyAName : '' },
{ label: '授标金额', extra: basics.totalAmount ? `¥${basics.totalAmount}` : '' },
)
} else {
basicInfo.col2.push(
{ label: '合同甲方:', extra: basics.partyAName ? basics.partyAName : '' },
)
basicInfo.col3.unshift(
{ label: '合同金额:', extra: basics.totalAmount ? `¥${basics.totalAmount}` : '' },
)
}
if (basics.sourceId) {
switch (basics.sourceType) {
case 1: {
......@@ -360,6 +373,24 @@ const Details = (props: any) => {
payPlanList={payPlanList}
basics={basicInfo}
contractId={contractId}
payItem={
<div style={{
display: 'flex',
}}>
<div style={{
fontSize: '12px',
fontWeight: 400,
color: '#909399',
flex: 0.5,
}}>支付方式:</div>
<div style={{
fontSize: '12px',
fontWeight: 400,
color: '#303133',
flex: 1,
}}>线下支付方式:线下支付线上确认</div>
</div>
}
/>
}
{/* 交易条件 */}
......
......@@ -56,14 +56,32 @@ const purchaseList: React.FC<Iprops> = ({
{ title: '单位', dataIndex: 'unit', align: 'center', },
{ title: '采购数量', dataIndex: 'purchaseCount', align: 'center', },
{ title: '含税', dataIndex: 'isHasTaxName', align: 'center', },
{ title: '税率', dataIndex: 'taxRate', align: 'center', },
{ title: '单价(含税)', dataIndex: 'price', align: 'center', },
{
title: '税率', dataIndex: 'taxRate', align: 'center',
render: (text) => {
return (
<div>
{text}%
</div>
)
}
},
{
title: '单价(含税)', dataIndex: 'price', align: 'center',
render: (text) => {
return (
<div>
{text}
</div>
)
}
},
{
dataIndex: 'bidCount', align: 'center',
title: (
<Space direction='vertical'>
<Text>授标数量</Text>
<Text>合计:{Numberamount}</Text>
<Text>合计:{Totalamount}</Text>
</Space>
),
},
......@@ -72,9 +90,16 @@ const purchaseList: React.FC<Iprops> = ({
title: (
<Space direction='vertical'>
<Text>金额(不含税)</Text>
<Text>合计: ¥{Totalamount}</Text>
<Text>合计: ¥{Numberamount}</Text>
</Space>
),
render: (text) => {
return (
<div>
{text}
</div>
)
}
},
];
setcolumns(columns)
......@@ -207,7 +232,7 @@ const purchaseList: React.FC<Iprops> = ({
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
采购材料
合同采购材料
</div>
</div>
</div>
......
......@@ -21,6 +21,7 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
const [page, setPage] = useState(1);
const [size, setSize] = useState(10);
const [total, setTotal] = useState(0);
const [listLoading, setListLoading] = useState(false);
/* 单据总金额 */
const [orderAmount, setorderAmount] = useState<number>(0);
......@@ -64,7 +65,7 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
keyId: index + 1,
}
})
console.log(list)
setdata(list)
}
setTotal(res.data.totalCount)
......@@ -198,9 +199,20 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
pageSize: pageSize,
}
setSize(pageSize)
console.log(data, pageSize, current)
getContracInfoList(data)
};
useEffect(() => {
if (contractId) {
let data = {
contractId,
current: 1,
pageSize: 8
}
getContracInfoList(data)
}
console.log(data, '13132131')
}, [contractId])
return (
<div id='docking' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
......
......@@ -17,7 +17,6 @@ import { history } from 'umi';
import moment from 'moment';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
const QueryList = () => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
......
......@@ -12,7 +12,7 @@ const { Option } = Select;
const { Text } = Typography;
const FormList = (props: any) => {
const { currentRef, Row, sourceType, onBadge } = props;
const { currentRef, Row, sourceType } = props;
console.log(sourceType)
const refs = useRef({});
/* 显示模态框 */
......
/** 合同管理 二级审核页面 */
import React, { useRef, useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd';
......@@ -15,7 +16,7 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke
import { PublicApi } from '@/services/api';
import ExamineFrom from '../../components/examine'
import moment from 'moment';
import { history, Redirect } from 'umi';
import { history } from 'umi';
const Secondaryexamine = () => {
const ref = useRef<any>({});
......
/* 合同管理签订合同页面 */
import React, { useRef, useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd';
......@@ -16,7 +16,6 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke
import { PublicApi } from '@/services/api';
import moment from 'moment';
import '../../constants/index.less'
const Signacontract = () => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
......
......@@ -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 = [];
......
......@@ -28,42 +28,39 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
const { orderNo } = history.location.query
const { type } = options
const dataRef = useRef<any>([
{ label: '对应报价单号', name: 'quotationNo', span: 8, render: text => <Link to={'/'}>{text}</Link> },
{ label: '订单摘要', name: 'orderThe', span: 8 },
{ label: type === 'saleOrder' ? '采购会员' : '供应会员', name: type === 'saleOrder' ? 'createMemberName' : 'supplyMembersName', span: 8 },
{ label: '下单模式', name: 'orderModel', span: 8, render: text => GlobalConfig.web.orderMode.find(v => v.value === text)?.label || '' },
{ label: '订单类型', name: 'typeName', span: 8 },
{ label: '对应报价单号', name: 'quoteNo', span: 8, render: text => <Link to={'/'}>{text}</Link> },
{ label: '订单摘要', name: 'digest', span: 8 },
{ label: type === 'saleOrder' ? '采购会员' : '供应会员', name: type === 'saleOrder' ? 'buyerMemberName' : 'vendorMemberName', span: 8 },
{ label: '下单模式', name: 'orderModeName', span: 8 },
{ label: '订单类型', name: 'orderTypeName', span: 8 },
{ label: '下单时间', name: 'createTime', span: 8, render: text => formatTimeString(text) },
{
label: '外部状态',
name: 'externalState',
name: 'outerStatusName',
span: 8,
render: (text, record) => <StatusColors type='out' status={text} text={record.externalStateName} />
render: (text, record) => <StatusColors type='out' status={text} text={record.outerStatusName} />
},
{
label: '内部状态',
name: type === 'saleOrder' ? 'purchaseOrderInteriorState' : 'interiorState',
name: 'innerStatusName',
span: 8,
render: (text, record) => <StatusColors type={type === 'saleOrder' ? 'saleInside' : 'inside'} status={text} text={record.interiorStateName} />
render: (text, record) => <StatusColors type={type === 'saleOrder' ? 'saleInside' : 'inside'} status={text} text={record.innerStatusName} />
},
])
useEffect(() => {
reloadFormData()
// reloadPayList()
}, [])
const reloadFormData = useCallback(() => {
if (id || orderNo) {
const fn = type === 'purchaseOrder' ? PublicApi.getOrderProcurementOrderDetails : PublicApi.getOrderPurchaseOrderDetails
fn( id ? { id } : { orderNo }, { ctlType: "none" }).then(res => {
const fn = type === 'purchaseOrder' ? PublicApi.getOrderBuyerDetail : PublicApi.getOrderVendorDetail
// @ts-ignore
fn( id ? { orderId: id } : { orderNo }, { ctlType: "none" }).then(res => {
const { code, data, message: msg } = res
if (code === 1000) {
setFormData(data)
// if(data.paymentInformationResponses.length > 0){
// setCurrentPayInfoId(data.paymentInformationResponses[0].id)
// }
reloadPayList(data.supplyMembersId, data.supplyMembersRoleId)
reloadPayList(data.vendorMemberId, data.vendorRoleId)
} else {
message.error(msg)
}
......@@ -80,16 +77,6 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
})
}
// const reloadPayList = useCallback(() => {
// PublicApi.getPayPayWayList().then(res => {
// const { code, data } = res
// if (code === 1000) {
// setPaylist(data)
// }
// })
// }, [id])
// 需共享的状态
const formContext = {
......
......@@ -19,23 +19,23 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type
return (
formContext.data && <div className='gray-wrap'>
<AuditProcess
customTitleKey='operationalProcess'
customKey='state'
outerVerifyCurrent={findLastIndexFlowState(formContext.data.externalWorkflowFlowRecordLogResponses)}
innerVerifyCurrent={findLastIndexFlowState(formContext.data.interiorWorkflowFlowRecordLogResponses)}
customTitleKey='stepName'
customKey='step'
outerVerifyCurrent={formContext.data.currentOuterStep}
innerVerifyCurrent={formContext.data.currentInnerStep}
outerVerifySteps={
formContext.data.externalWorkflowFlowRecordLogResponses ?
formContext.data.externalWorkflowFlowRecordLogResponses.map(item => ({
formContext.data.outerSteps ?
formContext.data.outerSteps.map(item => ({
...item,
status: item.isExecute ? 'finish' : 'wait',
status: (item.step <= formContext.data.currentOuterStep) ? 'finish' : 'wait',
})) :
null
}
innerVerifySteps={
formContext.data.interiorWorkflowFlowRecordLogResponses ?
formContext.data.interiorWorkflowFlowRecordLogResponses.map(item => ({
formContext.data.innerSteps ?
formContext.data.innerSteps.map(item => ({
...item,
status: item.isExecute ? 'finish' : 'wait',
status: (item.step <= formContext.data.currentInnerStep) ? 'finish' : 'wait',
})) :
null
}
......
......@@ -10,39 +10,25 @@ import cx from 'classnames'
export interface OrderMergeInfoProps { }
const payInfo = [
{ title: '交付日期:', name: 'deliveryTime', render: (text) => formatTimeString(text) },
{ title: '交付日期:', name: 'deliverDate', render: (text) => formatTimeString(text) },
{
title: '交付地址:', name: 'deliveryAddressInfo', render: (_, record) =>
title: '交付地址:', name: 'areaName', render: (_, record) =>
<div>
<Row>
<Col>{record.receiverName}</Col>
<Col>{record.consignee}</Col>
<Col> / </Col>
<Col>{record.phone}</Col>
{record.isDefault && <Col style={{ marginLeft: 6 }}><Tag color='default'>默认</Tag></Col>}
<Col>{record.countryCode + '' + record.phone}</Col>
{record.defaultConsignee && <Col style={{ marginLeft: 6 }}><Tag color='default'>默认</Tag></Col>}
</Row>
<div style={{ color: '#909399' }}>{record.fullAddress}</div>
<div style={{ color: '#909399' }}>{record.areaName + '' + record.address}</div>
</div>
},
{ title: '提货方式:', name: 'deliveryType', render: (text) => DELIVERY_TYPE[text] },
{ title: '自提地址:', name: 'pickUpAddress' },
{ title: '运费:', name: 'freight' }
]
const electronInfo = [
{ title: '电子合同', name: 'none' },
]
// let invoiceDetalis: any = {};
// const clickLook = (id) => {
// console.log('fpId', id)
// PublicApi.getSettleAccountsMobileInvoiceMessageDetails({id}).then(res => {
// if(res.code === 1000){
// invoiceDetalis = res.data
// }
// })
// }
const RenderCard = ({ infoList, dataSource }) => infoList.map(v => dataSource[v.name] ? <Row key={v.name} className={style['card-list']}>
<Col span={6} className={style['card-list_title']}>{v.title}</Col>
<Col flex={1} {...v.resetCol}>{v.render ? v.render(dataSource[v.name], dataSource) : dataSource[v.name]}</Col>
......@@ -52,7 +38,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
const orderDetailCtx = useContext(OrderDetailContext)
const [isModalVisible, setIsModalVisible] = useState(false)
const { data, ctl } = orderDetailCtx
const {theInvoiceInfo} = data
const { theInvoiceInfo, consignee } = data
const otherInfo = [
{ title: '发票:', name: 'theInvoiceInfo', render: item => <div className={style.invoice_list_item}>
......@@ -83,7 +69,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
<Row style={{ marginTop: 24 }} gutter={24}>
<Col span={(data.externalStateName !== '不接受订单') || (data.orderModel > 30) ? 15 : 12}>
<MellowCard title='交易信息' fullHeight>
<RenderCard infoList={payInfo} dataSource={data} />
<RenderCard infoList={payInfo} dataSource={consignee} />
</MellowCard>
</Col>
<Col span={(data.externalStateName !== '不接受订单') || (data.orderModel > 30) ? 9: 6}>
......
......@@ -39,17 +39,17 @@ const payChannel = [
const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
const [visible, setVisible] = useState(false)
const { data, payList, ctl } = useContext(OrderDetailContext)
const { data, ctl } = useContext(OrderDetailContext)
// 简单流程为24
const processEnum = data.processEnum
useEffect(() => {
// 过滤支付信息 取第一个待支付或者未到账的id
if(data?.paymentInformationResponses?.length) {
let payments = data.paymentInformationResponses.filter(item => item.externalState === 1 || item.externalState === 4)
if(data?.payments?.length) {
let payments = data.payments.filter(item => item.externalState === 1 || item.externalState === 4)
if(payments.length) {
ctl.setPayId(payments[0].id)
ctl.setPayId(payments[0].paymentId)
}
}
}, [])
......@@ -63,7 +63,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
return <Row justify='space-between' style={{minWidth: 216}}>
<Col>
<div className={style.fontGray}>支付比例</div>
<div className={style.bignumber}>{dataSource.payRatio}%</div>
<div className={style.bignumber}>{dataSource.payRate}%</div>
<div className={style.smallnumber}>
{dataSource.channel !== 0 && '¥'}
{dataSource.payPrice || 0}
......@@ -85,7 +85,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
</Row>
}
const urlsDatas = data.paymentInformationResponses.filter(item => item['channel'] === 5 && item['payWay'] === 2).map(_item => _item['payOrderUrls']).filter(__item => __item.length)
const urlsDatas = data.payments.filter(item => item['channel'] === 5 && item['payWay'] === 2).map(_item => _item['payOrderUrls']).filter(__item => __item.length)
return (
<>
......@@ -94,7 +94,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
<MellowCard bordered={false} fullHeight>
{/* <Row gutter={24}> */}
<Tabs defaultActiveKey='1' onChange={onChange}>
{ data.paymentInformationResponses && data.paymentInformationResponses.map(v => <TabPane key={v.id} tab={<TabHeader dataSource={v}/>}>
{ data.payments && data.payments.map(v => <TabPane key={v.paymentId} tab={<TabHeader dataSource={v}/>}>
<Row>
<Col className={style.fontGray} span={4}>支付环节: </Col>
<Col>{v.payNode}</Col>
......
......@@ -41,52 +41,23 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
const modalPriceActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, preview }) => {
const { orderProductRequests = [], deliveryAddressInfo, freight = 0, sumPrice, amount, orderModel } = dataSource || {}
const { product, orderModel } = dataSource || {}
const { couponAmount, freight, productAmount, promotionAmount, totalAmount, products } = product
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
// 合计金额, 如果后端有传则用后端数据
const sum = amount || orderProductRequests.reduce((prev, next) => prev + parseInt((next.money || 0)), 0)
const sum = productAmount || products.reduce((prev, next) => prev + parseInt((next.amount || 0)), 0)
// 总计金额
const amountMoney = sumPrice || sum + freight
// const modelRef = useRef<any>({})
// const [freePrice, setFreePrice] = useState<number>(0)
// const handleSetting = () => {
// modelRef.current.setVisible(true)
// }
const amountMoney = totalAmount || sum + freight
// const handleConfirm = () => {
// setFreePrice(parseInt(modalPriceActions.getFieldValue('freePrice') || 0))
// modelRef.current.setVisible(false)
// }
// useEffect(() => {
// // 存在商品 并且有选择收货地址,则开始计算运费
// if (orderProductRequests && orderProductRequests.length > 0 && deliveryAddressInfo) {
// // 筛选配送方式为物流的商品并且使用了运费模板
// const logsiticsDataMaps = orderProductRequests.filter(v => v.logistics && v.logistics.useTemplate && v.logistics.deliveryType === 1)
// if (logsiticsDataMaps.length > 0) {
// PublicApi.postLogisticsFreightTemplateCalFreightPrice({
// orderProductList: logsiticsDataMaps.map(v => ({
// templateId: v.templateId,
// weight: v.weight
// })),
// receiverAddressId: deliveryAddressInfo.id
// }, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => {
// if (res.code === 1000) {
// setFreePrice(res.data)
// }
// })
// }
// }
// }, [orderProductRequests])
return <RowStyle>
<Col span={2}>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{sum}</div>
</Col>
<Col span={2}>
{/* <div>运费 { !preview && <SettingOutlined style={{marginLeft: 8}} onClick={handleSetting}/> }</div> */}
<div>运费</div>
<div>{freight}</div>
</Col>
......@@ -94,34 +65,6 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{amountMoney}</div>
</Col>
{/* <ModalForm
modalTitle='设置运费'
currentRef={modelRef}
initialValues={freePrice}
schema={{
type: 'object',
properties: {
NO_SUBMIT_LAYOUT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'top'
},
properties: {
freePrice: {
type: 'string',
title: '设置运费',
"x-props": {
addonBefore: '¥'
}
}
}
}
}
}}
actions={modalPriceActions}
confirm={handleConfirm}
/> */}
</RowStyle>
}
......@@ -213,7 +156,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
const { ctl, data, preview } = useContext(OrderDetailContext)
const { orderProductRequests = [], orderModel } = data || {}
const { product = [], orderModel } = data || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
// 合同下单模式
const contractOrder = (orderModel === OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER || orderModel === OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER || orderModel === OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER)
......@@ -225,40 +168,40 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
}
}
const asyncGetMemberPrice = async (asyncData: any[]) => {
return await Promise.all(asyncData.filter(v => v.memberPrice === undefined).map(async v => {
console.log(v, 'v')
const {code, data} = await PublicApi.getMemberManageUpperCreditParamGet({
parentMemberId: v.memberId,
parentMemberRoleId: v.memberRoleId
}, {ttl: 60 * 1000, useCache: true})
return code === 1000 ? { value: (data.parameter * 100) + '%', id: v.id } : { value: '', id: 0 }
}
))
}
// const asyncGetMemberPrice = async (asyncData: any[]) => {
// return await Promise.all(asyncData.filter(v => v.memberPrice === undefined).map(async v => {
// console.log(v, 'v')
// const {code, data} = await PublicApi.getMemberManageUpperCreditParamGet({
// parentMemberId: v.vendorMemberId,
// parentMemberRoleId: v.vendorRoleId
// }, {ttl: 60 * 1000, useCache: true})
// return code === 1000 ? { value: (data.parameter * 100) + '%', id: v.id } : { value: '', id: 0 }
// }
// ))
// }
useEffect(() => {
// 过滤 会员折扣不存在的列表
const hasPriceList = orderProductRequests.filter(v => !v.memberPrice)
if (hasPriceList.length > 0) {
asyncGetMemberPrice(hasPriceList).then((asyncData) => {
const newData = orderProductRequests.map((v, i) => {
if (!v.memberPrice) {
v.memberPrice = asyncData.find(j => j.id === v.id)?.value || ''
}
return v
})
ctl.setData({
...data,
orderProductRequests: newData
})
})
}
}, [])
// useEffect(() => {
// // 过滤 会员折扣不存在的列表
// const hasPriceList = product.products.filter(v => !v.memberPrice)
// if (hasPriceList.length > 0) {
// asyncGetMemberPrice(hasPriceList).then((asyncData) => {
// const newData = product.products.map((v, i) => {
// if (!v.memberPrice) {
// v.memberPrice = asyncData.find(j => j.id === v.id)?.value || ''
// }
// return v
// })
// ctl.setData({
// ...data,
// orderProductRequests: newData
// })
// })
// }
// }, [])
const handleSave = row => {
const newData = [...orderProductRequests];
const newData = [...product.products];
const index = newData.findIndex(item => row.key === item.key);
const item = newData[index];
newData.splice(index, 1, {
......@@ -275,15 +218,15 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
const productInfoColumns: any[] = [
{
title: 'ID',
dataIndex: 'id',
dataIndex: 'productId',
align: 'center',
key: 'id',
key: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
dataIndex: 'name',
align: 'center',
key: 'productName',
key: 'name',
},
{
title: '品类',
......@@ -311,23 +254,24 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
},
{
title: '会员折扣',
dataIndex: 'memberPrice',
dataIndex: 'discount',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? (text * 10000 / 100 + '%') : null
key: 'discount',
// render: (text, record) => record.isMemberPrice ? (text * 10000 / 100 + '%') : null
render: (text, record) => text + '%'
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
dataIndex: 'quantity',
align: 'center',
key: 'purchaseCount',
key: 'quantity',
editable: true
},
{
title: '含税',
dataIndex: 'taxInclusive',
dataIndex: 'tax',
align: 'center',
key: 'taxInclusive',
key: 'tax',
render: (t, r) => t ? '是' : '否'
},
{
......@@ -339,18 +283,18 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
dataIndex: 'money',
dataIndex: 'amount',
align: 'center',
key: 'money',
key: 'amount',
},
// 接口调用
{
title: '配送方式',
dataIndex: 'logistics',
dataIndex: 'deliverType',
align: 'center',
key: 'logistics',
render: (text) => (text && text.deliveryType && text.deliveryType === 2) ?
<AddressPop pickInfo={text}>{DELIVERY_TYPE[text.deliveryType]}</AddressPop> : DELIVERY_TYPE[text?.deliveryType]
key: 'deliverType',
render: (text, record) => (text && text === 2) ?
<AddressPop pickInfo={record}>{record.deliverTypeName}</AddressPop> : record.deliverTypeName
}
]
......@@ -471,7 +415,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
<MellowCard title={contractOrder ? '订单物料' : '订单商品'} style={{marginTop: 24}} bordered={false}>
<Table
columns={ contractOrder ? materialInfo : productInfoColumns }
dataSource={orderProductRequests}
dataSource={product.products}
components={productComponents}
rowKey='id'
pagination={false}
......
......@@ -19,17 +19,15 @@ const outOrderCols: any[] = [
},
{
title: '操作角色',
dataIndex: 'roleName',
dataIndex: 'operatorRoleName',
align: 'center',
key: 'roleName',
key: 'operatorRoleName',
},
{
title: '状态',
dataIndex: 'state',
dataIndex: 'statusName',
align: 'center',
key: 'state',
render: (text, record) => <StatusColors status={text} type='transformOut' text={record.stateName} />
// @todo 需传递工作流状态重新render
key: 'statusName',
},
{
title: '操作',
......@@ -39,16 +37,16 @@ const outOrderCols: any[] = [
},
{
title: '操作时间',
dataIndex: 'operationTime',
dataIndex: 'createTime',
align: 'center',
key: 'operationTime',
key: 'createTime',
render: time => formatTimeString(time)
},
{
title: '审核意见',
dataIndex: 'auditOpinion',
dataIndex: 'remark',
align: 'center',
key: 'auditOpinion',
key: 'remark',
},
]
const PurchaseSideOrderCols: any[] = [
......@@ -61,9 +59,9 @@ const PurchaseSideOrderCols: any[] = [
},
{
title: '操作人',
dataIndex: 'roleName',
dataIndex: 'operator',
align: 'center',
key: 'roleName',
key: 'operator',
},
{
title: '部门',
......@@ -73,16 +71,15 @@ const PurchaseSideOrderCols: any[] = [
},
{
title: '职位',
dataIndex: 'position',
dataIndex: 'jobTitle',
align: 'center',
key: 'position',
key: 'jobTitle',
},
{
title: '状态',
dataIndex: 'state',
dataIndex: 'statusName',
align: 'center',
key: 'state',
render: (text, record) => <StatusColors status={text} type='transformInside' text={record.stateName} />
key: 'statusName',
},
{
title: '操作',
......@@ -92,18 +89,19 @@ const PurchaseSideOrderCols: any[] = [
},
{
title: '操作时间',
dataIndex: 'operationTime',
dataIndex: 'createTime',
align: 'center',
key: 'operationTime',
key: 'createTime',
render: text => formatTimeString(text)
},
{
title: '审核意见',
dataIndex: 'auditOpinion',
dataIndex: 'remark',
align: 'center',
key: 'auditOpinion',
key: 'remark',
},
]
const SaleSideOrderCols: any[] = [
{
title: '流转记录',
......@@ -160,30 +158,27 @@ const SaleSideOrderCols: any[] = [
// 订单流转记录
const OrderTransformRecord:React.FC<OrderTransformRecordProps> = ({type}) => {
const { data } = useContext(OrderDetailContext)
const { externalProcurementOrderLogResponses, interiorProcurementOrderLogResponses } = data
// 复杂流程或者多次支付显示标题
// const isShowOuterTitle = data?.processEnum !== 24 || data?.paymentInformationResponses?.length > 1
const { outerHistories, innerHistories } = data
return (
<>
{
(externalProcurementOrderLogResponses?.length > 0 || interiorProcurementOrderLogResponses?.length > 0) &&
(outerHistories?.length > 0 || innerHistories?.length > 0) &&
<MellowCard style={{marginTop: 24}} bordered={false}>
<Tabs defaultActiveKey="1">
<Tabs.TabPane tab='外部订单流转记录' key="1">
<Table
columns={outOrderCols}
dataSource={externalProcurementOrderLogResponses}
dataSource={outerHistories}
pagination={false}
rowKey="id"
/>
</Tabs.TabPane>
{
interiorProcurementOrderLogResponses?.length > 0 && <Tabs.TabPane tab='内部订单流转记录' key="2">
innerHistories?.length > 0 && <Tabs.TabPane tab='内部订单流转记录' key="2">
<Table
columns={type === 'saleOrder' ? SaleSideOrderCols : PurchaseSideOrderCols}
dataSource={interiorProcurementOrderLogResponses}
dataSource={innerHistories}
pagination={false}
rowKey="id"
/>
......
import React, { useEffect, useState } from 'react'
import { PublicApi } from '@/services/api';
import { GetOrderBuyerPageItemsResponse } from '@/services/OrderV2Api';
......@@ -17,10 +18,66 @@ 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
}
/** 获取 销售订单查询 下拉项:订单类型、内部状态、外部状态 */
export const getSaleOrderSelectOption = () => {
const [state, setstate] = useState<any>()
useEffect(() => {
PublicApi.getOrderVendorPageItems({}).then(res => {
const { code, data } = res
if(code === 1000) {
setstate(data)
}
})
}, [])
return state
}
/** (销售订单审核各个页面)获取前端页面下拉框列表 */
export const getSaleOrderAuditPageSelectOption = () => {
const [state, setstate] = useState<any>()
useEffect(() => {
PublicApi.getOrderVendorValidatePageItems({}).then(res => {
const { code, data } = res
if(code === 1000) {
setstate(data)
}
})
}, [])
return state
}
// **以下*即将弃用*** //
// **以下*即将弃用*** //
// **以下*即将弃用*** //
// **以下*即将弃用*** //
// **以下*即将弃用*** //
/** 获取订单类型映射 */
export const getOrderType = () => {
const [state, setstate] = useState<IState[]>([])
......
......@@ -3,84 +3,88 @@ import { history } from 'umi'
import { formatTimeString } from '@/utils'
import StatusColors from '../components/StatusColors'
import EyePreview from '@/components/EyePreview'
import { getOrderType, getPurchaseOrderInsideWorkState, getPurchaseOrderOutWorkState } from '../../effect'
// import { ORDER_TYPE, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants/order'
import { getPurchaseOrderSelectOption } from '../../effect'
export const baseOrderListColumns: any = () => {
const OrderType = getOrderType()
const PurchaseOrderOutWorkStateTexts = getPurchaseOrderOutWorkState()
const PurchaseOrderInsideWorkStateTexts = getPurchaseOrderInsideWorkState()
const res = getPurchaseOrderSelectOption()
if(res) {
const {
orderTypes: OrderType,
innerStatus: PurchaseOrderInsideWorkStateTexts,
outerStatus: PurchaseOrderOutWorkStateTexts
} = res
return [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`${history.location.pathname}/preview?id=${record.id}`}>
{text}
</EyePreview>
)
return [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`${history.location.pathname}/preview?id=${record.orderId}`}>
{text}
</EyePreview>
)
},
ellipsis: true,
},
ellipsis: true,
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
ellipsis: true,
},
{
title: '供应会员',
align: 'center',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
ellipsis: true,
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
key: 'createTime',
render: (text) => formatTimeString(text)
},
{
title: '订单总额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
ellipsis: true,
},
{
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,
},
{
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,
},
{
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,
}
]
{
title: '订单摘要',
align: 'center',
dataIndex: 'digest',
key: 'digest',
ellipsis: true,
},
{
title: '供应会员',
align: 'center',
dataIndex: 'vendorMemberName',
key: 'vendorMemberName',
ellipsis: true,
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
key: 'createTime',
render: (text) => formatTimeString(text)
},
{
title: '订单总额',
align: 'center',
dataIndex: 'amount',
key: 'amount',
ellipsis: true,
},
{
title: '订单类型',
align: 'center',
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: '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: '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),
......@@ -149,21 +146,20 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
)
}
const secondColumns: any[] = baseOrderListColumns().concat([
{
title: '操作',
align: 'center',
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>
// }
// </>
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text: any, record: any) => renderOptionButton(record)
}
])
}
])
}
const controllerBtns = <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
......@@ -171,7 +167,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
<Card>
<StandardTable
fetchTableData={params => fetchTableData(params)}
columns={secondColumns}
columns={secondColumns()}
currentRef={ref}
controlRender={
<NiceForm
......
......@@ -74,21 +74,14 @@ const orderProductShopTypeMaps = {
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
let receiveInfo = pickInfo?.render && typeof pickInfo.render === 'object' ? pickInfo.render : JSON.parse(pickInfo.render)
return pickInfo && pickInfo.deliveryType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
{/* <p>{pickInfo.receiverName} / {pickInfo.phone}</p>
<p>{pickInfo.fullAddress}</p> */}
{
receiveInfo && <>
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
<p>{receiveInfo.provinceName + receiveInfo.cityName + receiveInfo.districtName + receiveInfo.address || receiveInfo.fullAddress}</p>
</>
}
<p>{pickInfo.receiver} / {pickInfo.phone}</p>
<p>{pickInfo.address}</p>
</div>
</Row>
}>
......
import React from 'react'
import { formatTimeString } from '@/utils'
// import { ORDER_TYPE, SaleOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants/order'
import StatusColors from '@/pages/transaction/components/StatusColors'
import EyePreview from '@/components/EyePreview'
import { history } from 'umi'
import { getOrderType, getPurchaseOrderOutWorkState, getSaleOrderInsideWorkState } from '../../effect'
import { getSaleOrderSelectOption } from '../../effect'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getSaleOrderAuditPageSelectOption } from '@/pages/transaction/effect';
export const baseOrderListColumns: any = () => {
interface LayoutState {
/** flex布局的对齐方式 */
align?: string,
/** 列的样式 */
colStyle?: Object
}
const OrderType = getOrderType()
const SaleOrderInsideWorkStateTexts = getSaleOrderInsideWorkState()
const PurchaseOrderOutWorkStateTexts = getPurchaseOrderOutWorkState()
/** 订单审核各个页面 只有订单类型查询的Schema */
export const tableListSchema: any = (align?: String, colStyle?: Object) => {
console.log(align, colStyle)
const res = getSaleOrderAuditPageSelectOption()
if(res) {
const {
orderTypes: OrderType,
} = res
return [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`${history.location.pathname}/preview?id=${record.id}`}>
{text}
</EyePreview>
)
return {
type: 'object',
properties: {
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: align || 'flex-start',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: colStyle || {marginRight: 20}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
}
},
"orderType": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
},
enum: OrderType.map(item => ({
label: item['text'],
value: item['id'],
}))
},
"[startDate,endDate]": {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
}
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
},
{
title: '采购会员',
align: 'center',
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
key: 'createTime',
render: (text) => formatTimeString(text)
},
{
title: '订单总额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
},
{
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,
},
{
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,
},
{
title: '内部状态',
align: 'center',
dataIndex: 'purchaseOrderInteriorState',
key: 'purchaseOrderInteriorState',
render: (text, record) => <StatusColors status={text} type='saleInside' text={record['interiorStateName']} />,
filters: SaleOrderInsideWorkStateTexts.map((e, i) => ({ text: e['name'], value: Number(e['status']) })),
onFilter: (value, record) => value === record.purchaseOrderInteriorState,
},
]
}
}
}
export const baseOrderListColumns: any = () => {
const res = getSaleOrderSelectOption()
if(res) {
const {
orderTypes: OrderType,
innerStatus: SaleOrderInsideWorkStateTexts,
outerStatus: SaleOrderOutWorkStateTexts
} = res
return [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`${history.location.pathname}/preview?id=${record.orderId}`}>
{text}
</EyePreview>
)
}
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
},
{
title: '采购会员',
align: 'center',
dataIndex: 'buyerMemberName',
key: 'buyerMemberName',
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
key: 'createTime',
render: (text) => formatTimeString(text)
},
{
title: '订单总额',
align: 'center',
dataIndex: 'amount',
key: 'amount',
},
{
title: '订单类型',
align: 'center',
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: 'outerStatusName',
key: 'outerStatusName',
render: (text, record) => <StatusColors status={text} type='out' text={record['outerStatusName']} />,
filters: SaleOrderOutWorkStateTexts.map((e, i) => ({ text: e['text'], value: Number(e['id']) })),
onFilter: (value, record) => value === record.outerStatus,
},
{
title: '内部状态',
align: 'center',
dataIndex: 'innerStatusName',
key: 'innerStatusName',
render: (text, record) => <StatusColors status={text} type='saleInside' text={record['innerStatusName']} />,
filters: SaleOrderInsideWorkStateTexts.map((e, i) => ({ text: e['text'], value: Number(e['id']) })),
onFilter: (value, record) => value === record.innerStatus,
},
]
}
}
......@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable'
import { tableListSchema } from './schema'
import { tableListSchema } from '../constant'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
......@@ -21,7 +21,6 @@ const fetchTableData = async (params) => {
return data
}
// TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const {
columns,
......@@ -58,7 +57,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
formilyProps={{
ctx: {
inline: false,
schema: tableListSchema(),
schema: tableListSchema('flex-end', { marginLeft: 20 }),
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
......
......@@ -3,7 +3,6 @@ import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant'
import { history } from 'umi'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { SaleOrderInsideWorkState } from '@/constants/order'
// 业务hooks, 待新增订单
export const useSelfTable = () => {
......@@ -11,28 +10,30 @@ export const useSelfTable = () => {
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const handleSubmit = async (record) => {
if (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER) {
history.push(`/memberCenter/tranactionAbility/saleOrder/firstApprovedOrder/detail?id=${record.id}`)
}
history.push(`/memberCenter/tranactionAbility/saleOrder/firstApprovedOrder/detail?id=${record.id}`)
}
const secondColumns: any[] = baseOrderListColumns().concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) =>
// <>
// {
// record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER &&
<Button type='link' onClick={() => handleSubmit(record)}>提交审核</Button>
// }
// </>
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => {
return <>
<Button type='link' onClick={() => handleSubmit(record)}>提交审核</Button>
</>
}
}
])
}
])
}
return {
columns: secondColumns,
columns: secondColumns(),
ref,
rowSelection,
rowSelectionCtl
......
......@@ -2,9 +2,6 @@ import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getOrderType } from '@/pages/transaction/effect';
/**
* 除了订单必填字段, 默认
*/
export const tableListSchema: any = () => {
const OrderType = getOrderType()
......
......@@ -22,7 +22,7 @@ import { useHttpRequest } from '@/hooks/useHttpRequest'
export interface SaleOrderProps { }
const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderPurchaseOrderList(params)
const { data } = await PublicApi.getOrderVendorPage(params)
return data
}
......@@ -103,18 +103,20 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
)
}
const secondColumns: any[] = baseOrderListColumns().concat([
{
title: '操作',
align: 'center',
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> }
// </>
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text: any, record: any) => renderOptionButton(record)
}
])
}
])
}
const controllerBtns = <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
......@@ -122,7 +124,7 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
<Card>
<StandardTable
fetchTableData={params => fetchTableData(params)}
columns={secondColumns}
columns={secondColumns()}
currentRef={ref}
controlRender={
<NiceForm
......
import React from 'react'
import { Card, message } from 'antd'
import { Card } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { useSelfTable } from './model/useSelfTable'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import '../index.less'
import { tableListSchema } from '../constant'
// 待提交审核订单
......@@ -22,31 +20,14 @@ const fetchTableData = async (params) => {
return data
}
// TODO
const ReadyApprovedOrder:React.FC<ReadyApprovedOrderProps> = (props) => {
const { columns, ref } = useSelfTable()
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderOneAll)
const handleBitchPush = async () => {
if (rowSelectionCtl.selectedRowKeys.length > 0) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) {
rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([])
ref.current.reload()
}
} else {
message.error('请勾选要审核的订单')
}
}
return <PageHeaderWrapper>
<Card>
<StandardTable
fetchTableData={params => fetchTableData(params)}
rowSelection={rowSelection}
columns={columns}
currentRef={ref}
formilyLayouts={{
......@@ -69,19 +50,7 @@ const ReadyApprovedOrder:React.FC<ReadyApprovedOrderProps> = (props) => {
Submit
}
},
// layouts: {
// order: 2,
// span: 16
// }
}}
// formilyChilds={{
// children: <Space>
// <Button onClick={handleBitchPush} loading={loading}>批量提交审核</Button>
// </Space>,
// layouts: {
// span: 8
// }
// }}
/>
</Card>
</PageHeaderWrapper>
......
import React, { useRef } from 'react'
import { Button } from 'antd'
import { baseOrderListColumns } from '../../constant'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
// 业务hooks, 待审核订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const handleSubmit = async (id) => {
history.push(`/memberCenter/tranactionAbility/saleOrder/readyApprovedOrder/detail?id=${id}`)
}
const secondColumns: any[] = baseOrderListColumns().concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => {
return <>
<Button type='link' onClick={() => handleSubmit(record.id)}>提交审核</Button>
</>
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => {
return <>
<Button type='link' onClick={() => handleSubmit(record.id)}>提交审核</Button>
</>
}
}
])
}
])
}
return {
columns: secondColumns,
columns: secondColumns(),
ref,
rowSelection,
rowSelectionCtl
}
}
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getOrderType } from '@/pages/transaction/effect';
import { getSaleOrderAuditPageSelectOption } from '@/pages/transaction/effect';
/**
* 除了订单必填字段, 默认
*/
export const tableListSchema: any = () => {
const OrderType = getOrderType()
const res = getSaleOrderAuditPageSelectOption()
if(res) {
const {
orderTypes: OrderType,
} = res
return {
type: 'object',
properties: {
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-start',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginRight: 20
}
},
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
return {
type: 'object',
properties: {
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-start',
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginRight: 20
}
},
"type": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
properties: {
orderThe: {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
}
},
enum: OrderType.map(item => ({
label: item['name'],
value: item['status'],
}))
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
}
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
"type": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
},
enum: OrderType.map(item => ({
label: item['text'],
value: item['id'],
}))
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
},
}
}
}
}
......@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable'
import { tableListSchema } from './schema'
import { tableListSchema } from '../constant'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
......@@ -16,11 +16,10 @@ import '../index.less'
export interface FirstApprovedOrderProps {}
const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderConfirmShipmentOrderList(params)
const { data } = await PublicApi.getOrderVendorValidateDeliveryPage(params)
return data
}
// TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const {
columns
......
......@@ -3,7 +3,6 @@ import { history, Link } from 'umi'
import { Button } from 'antd'
import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE, SaleOrderInsideWorkState } from '@/constants/order'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
......@@ -20,7 +19,7 @@ export const useSelfTable = () => {
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/preview?id=${record.id}`}>
<EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/preview?id=${record.orderId}`}>
{text}
</EyePreview>
)
......@@ -29,8 +28,8 @@ export const useSelfTable = () => {
{
title: '订单摘要/下单时间',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
dataIndex: 'digest',
key: 'digest',
render: (text, record) => <>
<div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
......@@ -40,56 +39,51 @@ export const useSelfTable = () => {
{
title: '采购会员',
align: 'left',
dataIndex: 'memberName',
key: 'memberName',
dataIndex: 'buyerMemberName',
key: 'buyerMemberName',
},
{
title: '总金额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
render: (t, r) => (r.type === 7 || r.type === 8) ? t : '¥' + t
dataIndex: 'amount',
key: 'amount',
render: (t, r) => (r.orderType === 7 || r.orderType === 8) ? t : '¥' + t
},
{ title: '已发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `${text}次` : '' },
{ title: '已发货批次', align: 'center', dataIndex: 'batchNo', key: 'batchNo', render: text => text ? `${text}次` : '' },
// @todo 发货单号跳转
{
title: '发货单号',
align: 'center',
dataIndex: 'deliverNo',
key: 'deliverNo',
dataIndex: 'deliveryNo',
key: 'deliveryNo',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link>
},
{
title: '订单类型',
align: 'center',
dataIndex: 'typeName',
key: 'typeName',
dataIndex: 'orderTypeName',
key: 'orderTypeName',
},
{
title: '外部状态',
align: 'center',
dataIndex: 'externalState',
key: 'externalState',
render: (text, record) => <StatusColors status={text} type='out' text={record['externalStateName']} />,
dataIndex: 'outerStatus',
key: 'outerStatus',
render: (text, record) => <StatusColors status={text} type='out' text={record['outerStatusName']} />,
},
{
title: '内部状态',
align: 'center',
dataIndex: 'purchaseOrderInteriorState',
key: 'purchaseOrderInteriorState',
render: (text, record) => <StatusColors status={text} type='saleInside' text={record['interiorStateName']} />,
dataIndex: 'innerStatus',
key: 'innerStatus',
render: (text, record) => <StatusColors status={text} type='saleInside' text={record['innerStatusName']} />,
},
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) =>
// <>
// { (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER || record.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER) &&
<Button type='link' onClick={() => handleConfirm(record)}>确认发货</Button>
// }
// </>
render: (text, record) => <Button type='link' onClick={() => handleConfirm(record)}>确认发货</Button>
}
]
......
......@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable'
import { tableListSchema } from './schema'
import { tableListSchema } from '../constant'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
......@@ -20,7 +20,6 @@ const fetchTableData = async (params) => {
return data
}
// TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const {
columns
......
......@@ -8,19 +8,27 @@ export const useSelfTable = () => {
const handleConfirm = async (record) => {
history.push(`/memberCenter/tranactionAbility/saleOrder/readyConfirmOrder/detail?id=${record.id}`)
}
const secondColumns: any[] = baseOrderListColumns().concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
<Button type='link' onClick={() => handleConfirm(record)}>确认订单</Button>
</>
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => {
return <>
<Button type='link' onClick={() => handleConfirm(record)}>确认订单</Button>
</>
}
}
])
}
])
}
return {
columns: secondColumns
columns: secondColumns()
}
}
......@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable'
import { tableListSchema } from './schema'
import { tableListSchema } from '../constant'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
......@@ -20,7 +20,6 @@ const fetchTableData = async (params) => {
return data
}
// TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const {
columns
......
......@@ -4,7 +4,6 @@ import { Button, Row, Col } from 'antd'
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE } from '@/constants/order'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
import {
......@@ -50,13 +49,13 @@ const CircleChart = props => {
</Chart>
}
// 业务hooks, 待支付订单
// 待支付订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const PurchaseOrderOutWorkStateTexts = getPurchaseOrderOutWorkState()
const SaleOrderInsideWorkStateTexts = getSaleOrderInsideWorkState()
const payOrderColumns: any[] = [
{
title: '订单号',
......
......@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
import { useSelfTable } from './model/useSelfTable'
import { tableListSchema } from './schema'
import { tableListSchema } from '../constant'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
......@@ -22,7 +22,6 @@ const fetchTableData = async (params) => {
return data
}
// TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const {
columns,
......@@ -56,7 +55,8 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
formilyProps={{
ctx: {
inline: false,
schema: tableListSchema(),
schema: tableListSchema('flex-end', { marginLeft: 20 }),
// schema: tableListSchema(),
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
......
......@@ -8,24 +8,30 @@ import { SaleOrderInsideWorkState } from '@/constants/order'
export const useSelfTable = () => {
const ref = useRef<any>({})
const handleSubmit = async (record) => {
if (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.TWO_LEVEL_AUDIT_ORDER) {
history.push(`/memberCenter/tranactionAbility/saleOrder/secondApprovedOrder/detail?id=${record.id}`)
}
history.push(`/memberCenter/tranactionAbility/saleOrder/secondApprovedOrder/detail?id=${record.id}`)
}
const secondColumns: any[] = baseOrderListColumns().concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
<Button type='link' onClick={() => handleSubmit(record)}>提交审核</Button>
</>
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => {
return <>
<Button type='link' onClick={() => handleSubmit(record)}>提交审核</Button>
</>
}
}
])
}
])
}
return {
columns: secondColumns,
columns: secondColumns(),
ref
}
}
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