Commit 5acef646 authored by Bill's avatar Bill

添加手工发货、手工收货

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