Commit 5acef646 authored by Bill's avatar Bill

添加手工发货、手工收货

parent 95bacda4
...@@ -14,7 +14,6 @@ import ProcessOrder from '../../components/ProcessOrder'; ...@@ -14,7 +14,6 @@ import ProcessOrder from '../../components/ProcessOrder';
import {WrapUploadFile} from '../../components/UploadFile'; import {WrapUploadFile} from '../../components/UploadFile';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import ProcessDetail from '../../components/ProcessDetail'; import ProcessDetail from '../../components/ProcessDetail';
// import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { useRowSelection } from '../../common/useRowSelection'; import { useRowSelection } from '../../common/useRowSelection';
import { getAuth } from '@/utils/auth'; import { getAuth } from '@/utils/auth';
import { ENTERPRISE_MALL } from '../../common'; import { ENTERPRISE_MALL } from '../../common';
...@@ -139,7 +138,6 @@ const Add: React.FC<{}> = () => { ...@@ -139,7 +138,6 @@ const Add: React.FC<{}> = () => {
} }
}, [id]) }, [id])
const noticesDetailColumn = () => { const noticesDetailColumn = () => {
const blackList = ["orderNo", "orderTotal", "restTotal"]; const blackList = ["orderNo", "orderTotal", "restTotal"];
const tempColumns = [ const tempColumns = [
......
...@@ -77,23 +77,20 @@ const basicTab = { ...@@ -77,23 +77,20 @@ const basicTab = {
display: false, display: false,
}, },
source: { source: {
type: 'object', type: 'radio',
title: '通知单来源', title: '通知单来源',
required: true, required: true,
"x-component": 'Radio', enum: [
"x-component-props": { {
options: [ label: '订单加工',
{ value: 1
label: '订单加工', },
value: 1 {
}, label: '商品加工',
{ value: 2
label: '商品加工', }
value: 2 ],
} default: 1
],
default: 1
}
}, },
deliveryDate: { deliveryDate: {
......
...@@ -297,6 +297,20 @@ const Detail: React.FC<{}> = () => { ...@@ -297,6 +297,20 @@ const Detail: React.FC<{}> = () => {
} }
}) })
} }
/**
* 手工收货
*/
const handleManualReceiver = () => {
const postData = {
id: id,
}
PublicApi.postEnhanceSupplierToBeReceiveManualReceive(postData)
.then(({data, code}) => {
if(code === 1000) {
getInfo()
}
})
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
...@@ -347,7 +361,7 @@ const Detail: React.FC<{}> = () => { ...@@ -347,7 +361,7 @@ const Detail: React.FC<{}> = () => {
} }
{ {
// 这里手工发货需要某个字段值去判断 // 这里手工发货需要某个字段值去判断
pathname === (PENDING_DELIVERD_PATH + "/detail") && info && info.outerStatus === 29 pathname === (PENDING_DELIVERD_PATH + "/detail") && info && info.outerTaskType === 29 && info.innerStatus < 21
? ( ? (
<DeliverGood mode="edit" handleManualDeliver={handleManualDeliver} deliveryType={info.deliveryType}> <DeliverGood mode="edit" handleManualDeliver={handleManualDeliver} deliveryType={info.deliveryType}>
<Button loading={loading} type="primary" >手工发货</Button> <Button loading={loading} type="primary" >手工发货</Button>
...@@ -355,6 +369,24 @@ const Detail: React.FC<{}> = () => { ...@@ -355,6 +369,24 @@ const Detail: React.FC<{}> = () => {
) )
: null : null
} }
{
// 手工收货
pathname === (ASSIGN_PENDING_RECEIVE_DETAIL) && info && info.outerTaskType === 29 && info.innerStatus == 21
? (
<DeliverGood
mode="view"
deliveryType={info.deliveryType}
deliveryAddress={info.manualDeliverBO?.deliveryAddress}
deliveryTime={info.manualDeliverBO?.deliveryTime}
deliveryNo={info.manualDeliverBO?.deliveryNo}
logisticsName={info.manualDeliverBO?.logisticsName}
handleManualReceiver={handleManualReceiver}
>
<Button type="primary" >确认手工收货</Button>
</DeliverGood>
)
: null
}
</Col> </Col>
</Row> </Row>
</PageHeader> </PageHeader>
...@@ -374,7 +406,7 @@ const Detail: React.FC<{}> = () => { ...@@ -374,7 +406,7 @@ const Detail: React.FC<{}> = () => {
{/* 这里全部是走 非手工发货,当有手工发货按钮是,此时下面收发货明细隐藏 */} {/* 这里全部是走 非手工发货,当有手工发货按钮是,此时下面收发货明细隐藏 */}
{ {
info && info.outerStatus === 26 info && info.outerTaskType !== 29
? <div style={{marginTop: '20px'}}> ? <div style={{marginTop: '20px'}}>
<ReceiptDeliveryDetailsCard> <ReceiptDeliveryDetailsCard>
<StatisticsTab tab="收发货统计" columns={receiveColumns(info.source === 2 ? 'product' : 'order')} dataSource={info.details}></StatisticsTab> <StatisticsTab tab="收发货统计" columns={receiveColumns(info.source === 2 ? 'product' : 'order')} dataSource={info.details}></StatisticsTab>
......
...@@ -5,15 +5,18 @@ import { createAsyncFormActions, FormEffectHooks } from '@formily/antd'; ...@@ -5,15 +5,18 @@ import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'; import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import styles from './index.less'; import styles from './index.less';
import { Link } from 'umi'
const formActions = createAsyncFormActions(); const formActions = createAsyncFormActions();
const { onFieldValueChange$, onFieldMount$ } = FormEffectHooks
interface Iprops { interface Iprops {
children: React.ReactNode, children: React.ReactNode,
mode: 'view' | 'edit', mode: 'view' | 'edit',
handleManualDeliver?: (value: any) => void handleManualDeliver?: (value: any) => void
deliveryType: 1 | 2 handleManualReceiver?: () => void
deliveryType: 1 | 2,
deliveryAddress?: string,
deliveryTime?: string
deliveryNo?: string
logisticsName?: string
} }
const getSchema = (type) => { const getSchema = (type) => {
...@@ -101,9 +104,11 @@ const DeliverGood: React.FC<Iprops> = (props) => { ...@@ -101,9 +104,11 @@ const DeliverGood: React.FC<Iprops> = (props) => {
const handleOk = () => { const handleOk = () => {
if(mode === 'edit') { if(mode === 'edit') {
formActions.submit() formActions.submit()
} else {
setVisible(false);
props.handleManualReceiver()
} }
} }
const handleCancel = () => { const handleCancel = () => {
setVisible(false); setVisible(false);
} }
...@@ -135,21 +140,13 @@ const DeliverGood: React.FC<Iprops> = (props) => { ...@@ -135,21 +140,13 @@ const DeliverGood: React.FC<Iprops> = (props) => {
return data.map((item) => { return data.map((item) => {
return { return {
label: item.name, label: item.name,
value: item.id value: item.name
} }
}) })
} }
return [] return []
}, []) }, [])
const effects = () => {
console.log(123);
onFieldValueChange$('logisticsName').subscribe((fieldState) => {
// console.log(fieldState);
// formActions.setFieldValue()
})
}
return ( return (
<div> <div>
<div onClick={() => setVisible(true)}> <div onClick={() => setVisible(true)}>
...@@ -179,20 +176,26 @@ const DeliverGood: React.FC<Iprops> = (props) => { ...@@ -179,20 +176,26 @@ const DeliverGood: React.FC<Iprops> = (props) => {
: <div> : <div>
<Row className={styles.row}> <Row className={styles.row}>
<Col className={styles.label} span={4}>发货地址:</Col> <Col className={styles.label} span={4}>发货地址:</Col>
<Col>广东省广州市海珠区新港东路1068号中州中心北塔6楼</Col> <Col>{props.deliveryAddress}</Col>
</Row> </Row>
<Row className={styles.row}> <Row className={styles.row}>
<Col className={styles.label} span={4}>发货时间:</Col> <Col className={styles.label} span={4}>发货时间:</Col>
<Col>2020-05-20 08:00</Col> <Col>{props.deliveryTime}</Col>
</Row>
<Row className={styles.row}>
<Col className={styles.label} span={4}>物流单号:</Col>
<Col><Link to={'/'}>WL0954548</Link></Col>
</Row>
<Row className={styles.row}>
<Col className={styles.label} span={4}>物流公司:</Col>
<Col>顺丰</Col>
</Row> </Row>
{
props.deliveryType === 1
? <>
<Row className={styles.row}>
<Col className={styles.label} span={4}>物流单号:</Col>
<Col><a href="https://www.kuaidi100.com/">{props.deliveryNo}</a></Col>
</Row>
<Row className={styles.row}>
<Col className={styles.label} span={4}>物流公司:</Col>
<Col>{props.logisticsName}</Col>
</Row>
</>
: null
}
</div> </div>
} }
</Modal> </Modal>
......
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