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

fix: 处理副单位选择异常

parent d3577472
...@@ -733,9 +733,9 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -733,9 +733,9 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
value={assistUnitValue} value={assistUnitValue}
defaultActiveFirstOption={false} defaultActiveFirstOption={false}
filterOption={false} filterOption={false}
onSearch={handleUnitSearch} onSearch={handleAssistUnitSearch}
onChange={(value,option)=>handleAssistUnitChange(value, option)} onChange={(value,option)=>handleAssistUnitChange(value, option)}
onFocus={()=>handleUnitSearch(null)} onFocus={()=>handleAssistUnitSearch(null)}
notFoundContent={null} notFoundContent={null}
style={{width:'100%'}} style={{width:'100%'}}
> >
......
...@@ -44,44 +44,45 @@ const ParameterSetting: React.FC<{}> = () => { ...@@ -44,44 +44,45 @@ const ParameterSetting: React.FC<{}> = () => {
}, []) }, [])
useEffect(() => { useEffect(() => {
// if(autoReceiveVisible) { let fn = null;
// // 重组 配置配送时段数据 if(autoReceiveVisible) {
// PublicApi.getOrderParamGetDeliveryTime().then(res => { // 自动确认收货
// const { data } = res fn = PublicApi.getOrderParamGetReceiverDay
} else if(forcastTimeVisible) {
// setShopLists(() => [...shopLists].map(item => { // 预约时长
// const filterData = data.filter(_item => _item.shopId === item.shopId) fn = PublicApi.getOrderParamGetAppointmentDay
// if(filterData.length) { } else if(expressTimeVisible) {
// return { fn = PublicApi.getOrderParamGetDeliveryTime
// ...item, }
// ...filterData[0] fn && fn().then(res => {
// } const { data } = res
// } else { setShopLists(() => [...shopLists].map(item => {
// return {...item} const filterData = data.filter(_item => _item.shopId === item.shopId)
// } if(filterData.length) {
return {
// })) ...item,
// }) ...filterData[0],
// } else { paramList: expressTimeVisible ? filterData[0]['paramList'].map(param => {
// 重组 自动确认数据和商城列表数据 return {
PublicApi.getOrderParamGetReceiverDay().then(res => { timeRange: [moment(param.startTime, 'HH:mm:ss'), moment(param.endTime, 'HH:mm:ss')]
const { data } = res }
}) : []
setShopLists(() => [...shopLists].map(item => { }
const filterData = data.filter(_item => _item.shopId === item.shopId) } else {
if(filterData.length) { return {
return { ...item,
...item, days: null,
...filterData[0] status: 0
}
} else {
return {...item}
} }
}
}))
})
}, [autoReceiveVisible, forcastTimeVisible, expressTimeVisible])
})) useEffect(() => {
}) console.log(shopLists)
// } }, [shopLists])
}, [autoReceiveVisible, forcastTimeVisible])
const handleVisibleModalType = (id) => { const handleVisibleModalType = (id) => {
if(id === 1) { if(id === 1) {
...@@ -137,6 +138,7 @@ const ParameterSetting: React.FC<{}> = () => { ...@@ -137,6 +138,7 @@ const ParameterSetting: React.FC<{}> = () => {
} }
const onValuesChange = (changeValue, values, index) => { const onValuesChange = (changeValue, values, index) => {
console.log(changeValue, values, index)
setShopLists(() => [...shopLists].map(item => { setShopLists(() => [...shopLists].map(item => {
if(item.id === index) { if(item.id === index) {
return { return {
...@@ -160,29 +162,25 @@ const ParameterSetting: React.FC<{}> = () => { ...@@ -160,29 +162,25 @@ const ParameterSetting: React.FC<{}> = () => {
const handleSubmit = async (type?) => { const handleSubmit = async (type?) => {
console.log(shopLists, 'shopLists') console.log(shopLists, 'shopLists')
let codeNumber = null
setConfirmLoading(true)
if(type === 'autoReceive') { if(type === 'autoReceive') {
const { code } = await PublicApi.postOrderParamUpdateReceiverDay([...shopLists]) const { code } = await PublicApi.postOrderParamUpdateReceiverDay([...shopLists])
if(code === 1000) { codeNumber = code
setAutoReceiveVisible(false)
setForcastTimeVisible(false)
setExpressTimeVisible(false)
}
} else if(type === 'forcastTime') { } else if(type === 'forcastTime') {
const { code } = await PublicApi.postOrderParamUpdateAppointmentDay([...shopLists]) const { code } = await PublicApi.postOrderParamUpdateAppointmentDay([...shopLists])
if(code === 1000) { codeNumber = code
setAutoReceiveVisible(false)
setForcastTimeVisible(false)
setExpressTimeVisible(false)
}
} else if(type === 'timeLine') { } else if(type === 'timeLine') {
// const { code } = await PublicApi.postOrderParamUpdateDeliveryTime({ shopLists : [...shopLists] }) const { code } = await PublicApi.postOrderParamUpdateDeliveryTime([...shopLists])
// if(code === 1000) { codeNumber = code
// setAutoReceiveVisible(false) }
// setForcastTimeVisible(false) setConfirmLoading(false)
// setExpressTimeVisible(false) if(codeNumber === 1000) {
// } setAutoReceiveVisible(false)
console.log(shopLists, 'shop') setForcastTimeVisible(false)
setExpressTimeVisible(false)
} }
setConfirmLoading(false)
} }
const onChange = () => {} const onChange = () => {}
...@@ -272,7 +270,7 @@ const ParameterSetting: React.FC<{}> = () => { ...@@ -272,7 +270,7 @@ const ParameterSetting: React.FC<{}> = () => {
shopLists.map(item => (<Card style={{marginBottom: 16}} key={item.id}> shopLists.map(item => (<Card style={{marginBottom: 16}} key={item.id}>
<div className={cx(styles.cardMain, styles.cardBodyMain)}> <div className={cx(styles.cardMain, styles.cardBodyMain)}>
<p><img src={item.logoUrl} alt={item.name} /><span>{item.name}</span></p> <p><img src={item.logoUrl} alt={item.name} /><span>{item.name}</span></p>
<Switch defaultChecked={!!item.status} onChange={(v) => onChangeReceiveStatus(v, item.id)} /> <Switch defaultChecked={!!item.status} checked={!!item.status} onChange={(v) => onChangeReceiveStatus(v, item.id)} />
</div> </div>
{ !!item.status ? <p className={styles.receiveDay}><span>收货天数:</span><InputNumber onChange={(v) => onChangeReceiveDays(v, item.id)} value={item.days} /></p> : null } { !!item.status ? <p className={styles.receiveDay}><span>收货天数:</span><InputNumber onChange={(v) => onChangeReceiveDays(v, item.id)} value={item.days} /></p> : null }
</Card>)) </Card>))
...@@ -303,7 +301,7 @@ const ParameterSetting: React.FC<{}> = () => { ...@@ -303,7 +301,7 @@ const ParameterSetting: React.FC<{}> = () => {
shopLists.map(item => (<Card style={{marginBottom: 16}} key={item.id}> shopLists.map(item => (<Card style={{marginBottom: 16}} key={item.id}>
<div className={cx(styles.cardMain, styles.cardBodyMain)}> <div className={cx(styles.cardMain, styles.cardBodyMain)}>
<p><img src={item.logoUrl} alt={item.name} /><span>{item.name}</span></p> <p><img src={item.logoUrl} alt={item.name} /><span>{item.name}</span></p>
<Switch defaultChecked={!!item.status} onChange={(v) => onChangeReceiveStatus(v, item.id)} /> <Switch defaultChecked={!!item.status} checked={!!item.status} onChange={(v) => onChangeReceiveStatus(v, item.id)} />
</div> </div>
{ !!item.status ? <p className={styles.receiveDay}><span>预约时长(天):</span><InputNumber onChange={(v) => onChangeReceiveDays(v, item.id)} value={item.days} /></p> : null } { !!item.status ? <p className={styles.receiveDay}><span>预约时长(天):</span><InputNumber onChange={(v) => onChangeReceiveDays(v, item.id)} value={item.days} /></p> : null }
</Card>)) </Card>))
...@@ -334,12 +332,12 @@ const ParameterSetting: React.FC<{}> = () => { ...@@ -334,12 +332,12 @@ const ParameterSetting: React.FC<{}> = () => {
shopLists.map(item => (<Card style={{marginBottom: 16}} key={item.id}> shopLists.map(item => (<Card style={{marginBottom: 16}} key={item.id}>
<div className={cx(styles.cardMain, styles.cardBodyMain)}> <div className={cx(styles.cardMain, styles.cardBodyMain)}>
<p><img src={item.logoUrl} alt={item.name} /><span>{item.name}</span></p> <p><img src={item.logoUrl} alt={item.name} /><span>{item.name}</span></p>
<Switch defaultChecked={!!item.status} onChange={(v) => onChangeReceiveStatus(v, item.id)} /> <Switch defaultChecked={!!item.status} checked={!!item.status} onChange={(v) => onChangeReceiveStatus(v, item.id)} />
</div> </div>
{ {
!!item.status ? !!item.status ?
<div className={styles.deadLine}> <div className={styles.deadLine}>
<Form name="express_time_line_form" autoComplete="off" onValuesChange={(c, v) => onValuesChange(c, v, item.id)}> <Form name="express_time_line_form" autoComplete="off" onValuesChange={(c, v) => onValuesChange(c, v, item.id)} initialValues={{deadLine: item.paramList}}>
<Form.List name="deadLine"> <Form.List name="deadLine">
{(fields, { add, remove }) => ( {(fields, { add, remove }) => (
<> <>
......
import React, { useState, useRef, useCallback } from 'react' import React, { useState, useRef, useCallback } from 'react'
import { Card, Button, Modal, Row, Col, message, Dropdown, Menu } from 'antd' import { Card, Button, Modal, Row, Col, message } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
...@@ -18,6 +18,7 @@ import ModalForm from '@/components/ModalForm' ...@@ -18,6 +18,7 @@ import ModalForm from '@/components/ModalForm'
import { useHttpRequest } from '@/hooks/useHttpRequest' import { useHttpRequest } from '@/hooks/useHttpRequest'
import TableOperation from '@/components/TableOperation' import TableOperation from '@/components/TableOperation'
import { ORDER_TYPE_POINTS } from '@/constants/order' import { ORDER_TYPE_POINTS } from '@/constants/order'
import axios from 'axios'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)` const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border { .select_style_border {
...@@ -80,6 +81,12 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => { ...@@ -80,6 +81,12 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
{ id: 2, name: "退货"}, { id: 2, name: "退货"},
{ id: 3, name: "维修"}, { id: 3, name: "维修"},
]) ])
const [fetchParams, setFetchParams] = useState<any>()
const loadingTableData = (params) => {
setFetchParams(params)
return fetchTableData(params)
}
// 售后唤起弹窗 // 售后唤起弹窗
const handleSaleAfter = ({ orderId, orderType }) => { const handleSaleAfter = ({ orderId, orderType }) => {
...@@ -178,12 +185,32 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => { ...@@ -178,12 +185,32 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
} }
} }
const controllerBtns = <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button> const handleExport = async () => {
const downloadLink = document.createElement('a')
// const data = await PublicApi.getOrderBuyerExport({...fetchParams}, {extendsOptions: { responseType: "blob" }})
const data = await axios.get('/order/buyer/export', {
params: {...fetchParams},
headers: {
"Content-Type": "application/vnd.ms-excel;charset=UTF-8"
},
responseType: 'blob'
})
// @ts-ignore
let blob = new Blob([data], {type: 'application/vnd.ms-excel'})
downloadLink.style.display = 'none';
downloadLink.href = URL.createObjectURL(blob);
downloadLink.download = '采购订单列表.xls'
document.body.appendChild(downloadLink)
downloadLink.click()
document.body.removeChild(downloadLink)
}
const controllerBtns = <Button style={{width: 140}} onClick={handleExport} type='default'>导出</Button>
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
fetchTableData={params => fetchTableData(params)} fetchTableData={params => loadingTableData(params)}
columns={secondColumns()} columns={secondColumns()}
currentRef={ref} currentRef={ref}
controlRender={ controlRender={
......
...@@ -49,7 +49,7 @@ export const fetchOrderApi = { ...@@ -49,7 +49,7 @@ export const fetchOrderApi = {
/** 查看状态正常的会员服务消费者列表 */ /** 查看状态正常的会员服务消费者列表 */
async getMemberConsumeLists(params) { async getMemberConsumeLists(params) {
const { data } = await PublicApi.getMemberManageLowerConsumerMemberPage(params) const { data } = await PublicApi.getMemberManageOrderAgentMembers(params)
return data return data
}, },
......
...@@ -358,8 +358,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => { ...@@ -358,8 +358,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
const handleMemberSearch = (value) => { const handleMemberSearch = (value) => {
if(value) { if(value) {
fetchOrderApi.getMemberConsumeLists({ name: value }).then(res => { fetchOrderApi.getMemberConsumeLists({ name: value }).then(data => {
const { data } = res
addSchemaAction.setFieldState('buyerMemberId', state => { addSchemaAction.setFieldState('buyerMemberId', state => {
state.props.enum = data.map(item => ({ state.props.enum = data.map(item => ({
...item, ...item,
......
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