Commit 853c6225 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 31f34f90 c0c91dc4
......@@ -19,7 +19,7 @@ import { logisticsDetailSchema } from './schema'
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import StatusTag from '../../components/StatusTag';
import { logisticsColumn } from '../../common/columns';
const RangePicker = DatePicker.RangePicker
const formActions = createFormActions();
......@@ -36,18 +36,6 @@ interface infoType {
statusName: string // 结算状态名称
}
const columns = [
{title: '单据号', dataIndex: 'orderNo'},
{title: '单据摘要', dataIndex: 'orderAbstract'},
{title: '单据类型', dataIndex: 'orderTypeName'},
{title: '单据时间', dataIndex: 'orderTime'},
{title: '总箱数', dataIndex: 'totalCarton'},
{title: '总重量', dataIndex: 'totalWeight'},
{title: '总体积', dataIndex: 'totalVolume'},
{title: '接单金额', dataIndex: 'orderAmount'},
{title: '接单时间', dataIndex: 'acceptOrderTime'},
{title: '结算金额', dataIndex: 'settlementAmount'},
]
const logisticsDetail: React.FC = () => {
const ref = useRef<any>({});
......@@ -97,10 +85,10 @@ const logisticsDetail: React.FC = () => {
<AvatarWrap
info={{
aloneTxt: '单',
name: "结算单号:"
name: ""
}}
extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{infoDetail?.settlementNo}</span>
<span style={{ fontSize: 16, fontWeight: 'bold', color: "#303133" }}>结算单号:{infoDetail?.settlementNo}</span>
)}
/>
}
......@@ -127,7 +115,7 @@ const logisticsDetail: React.FC = () => {
tableProps={{
rowKey: 'id',
}}
columns={columns}
columns={logisticsColumn}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
......
......@@ -19,23 +19,11 @@ import { detailSchema } from './schema'
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import StatusTag from '../../components/StatusTag'
import { productNoticecolumns } from '../../common/columns';
const RangePicker = DatePicker.RangePicker;
const formActions = createFormActions();
const columns = [
{title: '单据号', dataIndex: 'orderNo'},
{title: '单据摘要', dataIndex: 'orderAbstract'},
{title: '单据类型', dataIndex: 'orderTypeName'},
{title: '单据时间', dataIndex: 'orderTime'},
{title: '单据总额', dataIndex: 'orderAmount'},
{title: '收货批次', dataIndex: 'batch'},
{title: '收货时间', dataIndex: 'receiveTime'},
{title: '收货数量', dataIndex: 'receiveCount'},
// {title: '加工单价', dataIndex: 'processPrice'},
{title: '结算金额', dataIndex: 'settlementAmount'},
]
interface infoType {
id: number, // 会员结算id
settlementNo: string, // 结算单号
......@@ -98,10 +86,10 @@ const ProductNoticeSettlementDetail: React.FC = () => {
<AvatarWrap
info={{
aloneTxt: '单',
name: "结算单号:"
name: ""
}}
extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{infoDetail?.settlementNo}</span>
<span style={{ fontSize: 16, fontWeight: 'bold', color: "#303133" }}>结算单号:{infoDetail?.settlementNo}</span>
)}
/>
}
......@@ -128,7 +116,7 @@ const ProductNoticeSettlementDetail: React.FC = () => {
tableProps={{
rowKey: 'id',
}}
columns={columns}
columns={productNoticecolumns}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
......
......@@ -4,9 +4,9 @@
* @Description: 应付账款结算
*/
import React, { useRef } from 'react';
import React, { useRef, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Card, Button, DatePicker, Tag, Badge } from 'antd';
import { Card, Button, DatePicker, Tag, Badge, Drawer } from 'antd';
import NiceForm from '@/components/NiceForm';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { createFormActions } from '@formily/antd';
......@@ -14,122 +14,18 @@ import { StandardTable } from 'god';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { schema } from './schema';
import ModalContainer from '../../components/ModalContainer'
import InvoiceCreate from '../../components/InvoiceCreate'
import { PublicApi } from '@/services/api'
import StatusTag from '../../components/StatusTag';
import styles from './index.less'
import { fetchOptions } from '../../common';
const RangePicker = DatePicker.RangePicker;
const formActions = createFormActions();
const columns = [
{
title: '订单号/类型',
dataIndex: 'orderNo',
render: (text, record: any) => {
return (
<div>
<p>{record.orderNo}</p>
<StatusTag text={record.settlementOrderTypeName} />
</div>
)
}
},
{
title: '单据摘要/时间',
dataIndex: 'orderAbstract',
render: (text, record: any) => {
return (
<div>
<p>{record.orderAbstract}</p>
<p>{record.orderTime}</p>
</div>
)
}
},
{title: '订单类型',dataIndex: 'orderTypeName'},
{title: '单据总额', dataIndex: 'orderAmount'},
{
title: '支付批次/环节',
dataIndex: 'batch',
render: (text, record) => {
return (
<div>
<p>{record.batch}</p>
<p>{record.payNode}</p>
</div>
)
}
},
{title: '支付金额', dataIndex: 'payAmount'},
{title: '支付时间', dataIndex: 'payTime'},
{
title: '开票状态',
dataIndex: 'invoiceStatus',
filters: [
{ text: '未开票', value: 0 },
{ text: '已开票', value: 1 },
],
onFilter: (value: number, record: any) => record.invoiceStatus == value,
render: (text, record) => {
return (
<div>
<StatusTag text={record.invoiceStatusName} />
</div>
)
}
},
{
title: '支付状态',
dataIndex: 'status',
filters: [
{ text: '未支付', value: '未支付' },
{ text: '已支付', value: '已支付' },
],
onFilter: (value: number, record: any) => record.payStatusName == value,
render: (text, record) => {
const color = record.payStatusName == '已支付' ? 'green': '#C0C4CC';
return (
<Badge color={color} text={record.payStatusName} />
)
}
},
{
title: '操作',
render: (text, record) => {
return (
<>
<ModalContainer>
{
({visible, show, cancel}) => {
return (
<>
<InvoiceCreate
id={record.id}
type={record.invoiceStatus}
payRoleId={record.payRoleId}
payMemberId={record.payMemberId}
title="开具发票"
width={800}
visible={visible}
onCancel={cancel}
refresh={() => formActions.submit()}
/>
<div className={styles.text} onClick={show}>{record.invoiceStatus == 1 ? '查看' : '开票'}</div>
</>
)
}
}
</ModalContainer>
</>
)
}
}
]
const SettlementList = () => {
const ref = useRef<any>({});
const [visible, setVisible] = useState(false);
const [activeData, setActiveData] = useState({});
/**
* 获取开票管理列表
......@@ -158,6 +54,105 @@ const SettlementList = () => {
ref.current.reload({...values, payStartTime, payEndTime, orderStartTime, orderEndTime});
}
const handleShow = (record) => {
document.body.parentNode.style.overflowY = "hidden";
setVisible(true)
setActiveData({
id: record.id,
type: record.invoiceStatus,
// payRoleId: record.payRoleId,
// payMemberId: record.payMemberId
})
}
const handleOnCancel = () => {
document.body.parentNode.style.overflowY = "auto";
setVisible(false)
setActiveData({})
}
const columns = [
{
title: '订单号/类型',
dataIndex: 'orderNo',
render: (text, record: any) => {
return (
<div>
<p>{record.orderNo}</p>
<StatusTag text={record.settlementOrderTypeName} />
</div>
)
}
},
{
title: '单据摘要/时间',
dataIndex: 'orderAbstract',
render: (text, record: any) => {
return (
<div>
<p>{record.orderAbstract}</p>
<p>{record.orderTime}</p>
</div>
)
}
},
{title: '订单类型',dataIndex: 'orderTypeName'},
{title: '单据总额', dataIndex: 'orderAmount'},
{
title: '支付批次/环节',
dataIndex: 'batch',
render: (text, record) => {
return (
<div>
<p>{record.batch}</p>
<p>{record.payNode}</p>
</div>
)
}
},
{title: '支付金额', dataIndex: 'payAmount'},
{title: '支付时间', dataIndex: 'payTime'},
{
title: '开票状态',
dataIndex: 'invoiceStatus',
filters: [
{ text: '未开票', value: 0 },
{ text: '已开票', value: 1 },
],
onFilter: (value: number, record: any) => record.invoiceStatus == value,
render: (text, record) => {
return (
<div>
<StatusTag text={record.invoiceStatusName} />
</div>
)
}
},
{
title: '支付状态',
dataIndex: 'status',
filters: [
{ text: '未支付', value: '未支付' },
{ text: '已支付', value: '已支付' },
],
onFilter: (value: number, record: any) => record.payStatusName == value,
render: (text, record) => {
const color = record.payStatusName == '已支付' ? 'green': '#C0C4CC';
return (
<Badge color={color} text={record.payStatusName} />
)
}
},
{
title: '操作',
render: (text, record) => {
return (
<a onClick={() => handleShow(record)}>{record.invoiceStatus == 1 ? '查看' : '开票'}</a>
)
}
}
]
return (
<PageHeaderWrapper>
<Card>
......@@ -203,6 +198,14 @@ const SettlementList = () => {
}
/>
</Card>
<InvoiceCreate
{...activeData}
title="开具发票"
width={800}
visible={visible}
onCancel={handleOnCancel}
refresh={() => formActions.submit()}
/>
</PageHeaderWrapper>
)
}
......
......@@ -19,23 +19,11 @@ import { logisticsDetailSchema } from './schema'
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import StatusTag from '../../components/StatusTag';
import { logisticsColumn } from '../../common/columns';
const RangePicker = DatePicker.RangePicker;
const formActions = createFormActions();
const columns = [
{title: '单据号', dataIndex: 'orderNo'},
{title: '单据摘要', dataIndex: 'orderAbstract'},
{title: '单据类型', dataIndex: 'orderTypeName'},
{title: '单据时间', dataIndex: 'orderTime'},
{title: '总箱数', dataIndex: 'totalCarton'},
{title: '总重量', dataIndex: 'totalWeight'},
{title: '总体积', dataIndex: 'totalVolume'},
{title: '接单金额', dataIndex: 'orderAmount'},
{title: '接单时间', dataIndex: 'acceptOrderTime'},
{title: '结算金额', dataIndex: 'settlementAmount'},
]
interface infoType {
id: number, // 会员结算id
settlementNo: string, // 结算单号
......@@ -95,10 +83,10 @@ const logisticsDetail: React.FC = () => {
<AvatarWrap
info={{
aloneTxt: '单',
name: "结算单号:"
name: ""
}}
extra={(
<span style={{ fontSize: 12 }}>{infoDetail?.settlementNo}</span>
<span style={{ fontSize: 16, fontWeight: 'bold', color: "#303133" }}>结算单号:{infoDetail?.settlementNo}</span>
)}
/>
}
......@@ -125,7 +113,7 @@ const logisticsDetail: React.FC = () => {
tableProps={{
rowKey: 'id',
}}
columns={columns}
columns={logisticsColumn}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
......
......@@ -19,23 +19,11 @@ import { detailSchema } from './schema'
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import StatusTag from '../../components/StatusTag';
import { productNoticecolumns } from '../../common/columns';
const RangePicker = DatePicker.RangePicker;
const formActions = createFormActions();
const columns = [
{title: '单据号', dataIndex: 'orderNo'},
{title: '单据摘要', dataIndex: 'orderAbstract'},
{title: '单据类型', dataIndex: 'orderTypeName'},
{title: '单据时间', dataIndex: 'orderTime'},
{title: '单据总额', dataIndex: 'orderAmount'},
{title: '收货批次', dataIndex: 'batch'},
{title: '收货时间', dataIndex: 'receiveTime'},
{title: '收货数量', dataIndex: 'receiveCount'},
// {title: '加工单价', dataIndex: 'processPrice'},
{title: '结算金额', dataIndex: 'settlementAmount'},
]
interface infoType {
id: number, // 会员结算id
settlementNo: string, // 结算单号
......@@ -99,10 +87,10 @@ const ProductNoticeSettlementDetail: React.FC = () => {
<AvatarWrap
info={{
aloneTxt: '单',
name: "结算单号:"
name: ""
}}
extra={(
<span style={{ fontSize: 12 }}>{infoDetail?.settlementNo}</span>
<span style={{ fontSize: 16, fontWeight: 'bold', color: "#303133" }}>结算单号:{infoDetail?.settlementNo}</span>
)}
/>
}
......@@ -129,7 +117,7 @@ const ProductNoticeSettlementDetail: React.FC = () => {
tableProps={{
rowKey: (record) => `${record.orderNo}-${record.batch}`,
}}
columns={columns}
columns={productNoticecolumns}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
......
import React from 'react';
import add from '@/assets/imgs/add.png';
import subtraction from '@/assets/imgs/subtraction.png';
export const productNoticecolumns = [
{title: '单据号', dataIndex: 'orderNo'},
{title: '单据摘要', dataIndex: 'orderAbstract'},
{title: '单据类型', dataIndex: 'orderTypeName'},
{title: '单据时间', dataIndex: 'orderTime'},
{
title: '单据总额',
dataIndex: 'orderAmount',
render: (text) => {
return ("¥" + text)
}
},
{title: '收货批次', dataIndex: 'batch'},
{title: '收货时间', dataIndex: 'receiveTime'},
{title: '收货数量', dataIndex: 'receiveCount'},
// {title: '加工单价', dataIndex: 'processPrice'},
{
title: '结算金额',
dataIndex: 'settlementAmount',
render: (text) => {
return (
<div style={{display: "flex", flexDirection: "row", alignItems: 'center'}}>
<img src={text > 0 ? add : subtraction} width={16} height={16} />
<span style={{marginLeft: '8px'}}>{text}</span>
</div>
)
}
},
]
export const logisticsColumn = [
{title: '单据号', dataIndex: 'orderNo'},
{title: '单据摘要', dataIndex: 'orderAbstract'},
{title: '单据类型', dataIndex: 'orderTypeName'},
{title: '单据时间', dataIndex: 'orderTime'},
{title: '总箱数', dataIndex: 'totalCarton'},
{title: '总重量', dataIndex: 'totalWeight'},
{title: '总体积', dataIndex: 'totalVolume'},
{
title: '接单金额',
dataIndex: 'orderAmount',
render: (text) => {
return (
<div style={{display: "flex", flexDirection: "row", alignItems: 'center'}}>
<img src={text > 0 ? add : subtraction} width={16} height={16} />
<span style={{marginLeft: '8px'}}>{text}</span>
</div>
)
}
},
{title: '接单时间', dataIndex: 'acceptOrderTime'},
{
title: '结算金额',
dataIndex: 'settlementAmount',
render: (text) => {
return (
<div style={{display: "flex", flexDirection: "row", alignItems: 'center'}}>
<img src={text > 0 ? add : subtraction} width={16} height={16} />
<span style={{marginLeft: '8px'}}>{text}</span>
</div>
)
}
},
]
......@@ -27,8 +27,8 @@ interface Iprops {
width: number,
type: number, // 0 -> 开票, 1-> 查看
id: string, // 开票管理id,
payRoleId: number,
payMemberId: number,
// payRoleId: number,
// payMemberId: number,
onCancel: () => void,
refresh: () => void
}
......@@ -41,6 +41,11 @@ interface SubmitProps {
}[]
}
enum TypeEnum {
edit = 0,
view = 1
}
const columns = [
{title: '发票号码', dataIndex:'number'},
{title: '发票时间', dataIndex:'invoiceDate'},
......@@ -48,12 +53,12 @@ const columns = [
]
const InvoiceDrawer: React.FC<Iprops> = (props) => {
const { visible, title, onCancel, width, type, id, payMemberId, payRoleId } = props;
const { visible, title, onCancel, width, type, id} = props;
const [invoiceInfo, setInvoiceInfo] = useState<InvoiceInfoProps>(null);
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
const handleSubmit = () => {
// // 如果当前type==0为开票, 1为查看,那么直接关闭
if(type == 0) {
if(type === TypeEnum.edit) {
formActions.submit()
} else {
// 查看类型的话,按确认直接关掉窗口
......@@ -63,7 +68,7 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
const handleForm = (value: SubmitProps) => {
if(typeof value.list === 'undefined' || value.list.length == 0) {
if(typeof value.list === 'undefined' || value.list.length === 0) {
message.error({
content: '请添加发票信息'
})
......@@ -71,7 +76,7 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
}
const { kindName, typeName, ...rest } = invoiceInfo
const proveList = value.list.map((item) => { return {number: item.number, remark: item.remark, invoiceDate: item.invoiceDate.format('YYYY-MM-DD')} })
const proveList = value.list.map((item, key) => { return {number: item.number, remark: item.remark, invoiceDate: item.invoiceDate.format('YYYY-MM-DD')} })
const postData = {
...rest,
proveList: proveList,
......@@ -104,31 +109,37 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
}
}, [id, visible])
const tableList = invoiceInfo?.proveList?.map((item, key) => ({...item, id: key}));
const renderFooter = () => {
if(type === TypeEnum.view) {
return null
}
return (
<div style={{textAlign: 'right'}}>
<Button onClick={onCancel} style={{ marginRight: 8 }}>
取消
</Button>
<Button onClick={handleSubmit} type="primary">
确认
</Button>
</div>
)
}
return (
<Drawer
getContainer={false}
destroyOnClose
visible={visible}
title={title}
width={width}
onClose={onCancel}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button onClick={onCancel} style={{ marginRight: 8 }}>
取消
</Button>
<Button onClick={handleSubmit} type="primary">
确认
</Button>
</div>
}
footer={renderFooter()}
>
<InvoiceInfo infos={invoiceInfo} />
{
type == 0
type === TypeEnum.edit
? (
<>
<div className={styles.formHeader}>
......@@ -154,8 +165,8 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
: (
<Table
columns={columns}
dataSource={invoiceInfo?.proveList}
rowKey={"number"}
dataSource={tableList}
rowKey={record => record.id}
/>
)
......
import InvoiceDrawer from './InvoiceDrawer';
import InvoiceDrawer1 from './InvoiceDrawer'
import InvoiceDrawer from './InvoiceDrawer'
export default InvoiceDrawer1
\ No newline at end of file
export default InvoiceDrawer
......@@ -30,4 +30,4 @@ class ModalContainer extends Component {
}
}
export default ModalContainer;
\ No newline at end of file
export default ModalContainer;
......@@ -180,7 +180,7 @@ const UploadVoucher: React.FC<UploadVocherProps> = (props) => {
}
const handleComfirm = (params) => {
props.handleUpload({onCancel: params.cancel, id: params.id, fileList: params.fileList})
props.handleUpload({onCancel: params.onCancel, id: params.id, fileList: params.fileList})
}
return (
......@@ -194,6 +194,7 @@ const UploadVoucher: React.FC<UploadVocherProps> = (props) => {
title="上传付款凭证"
onCancel={cancel}
visible={visible}
destroyOnClose
footer={(
<Space>
<Button onClick={cancel}>取消</Button>
......
......@@ -9,6 +9,7 @@
font-size: 12px;
height: 32px;
padding: 0 10px;
margin-bottom: 16px;
.image {
width: 20px;
......@@ -29,4 +30,4 @@
.text {
cursor: pointer;
}
}
\ No newline at end of file
}
......@@ -33,9 +33,14 @@ const Voucher: React.FC<Iprops> = (props) => {
<div className={styles.text}>
<a href={item.proveUrl} target={"_blank"}>{item.name}</a>
</div>
<div className={styles.view}>
<a onClick={() => handleRemove(item)}>删除</a>
</div>
{
props.onRemove &&
(
<div className={styles.view}>
<a onClick={() => handleRemove(item)}>删除</a>
</div>
)
}
</div>
)
})
......
......@@ -32,7 +32,7 @@ const columns = [
{title: '代收金额', dataIndex: 'collectAmount'},
{title: '支付时间', dataIndex: 'payTime'},
{
title: '佣金比例',
title: '佣金比例',
dataIndex: 'ratio',
render: (text, record) => {
return record.ratio + "%"
......@@ -83,9 +83,9 @@ const Info: React.FC = () => {
const orderTimeRange = orderTime ? timeRange(values.orderTime) : null;
const orderStartTime = orderTimeRange ? moment(orderTimeRange.st).format(format) : null;
const orderEndTime = orderTimeRange ? moment(orderTimeRange.et).format(format) : null;
ref.current.reload({...rest, payStartTime, payEndTime, orderStartTime, orderEndTime});
}
}
return (
<PageHeaderWrapper
......@@ -95,21 +95,21 @@ const Info: React.FC = () => {
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
<AvatarWrap
info={{
aloneTxt: '单',
name: "结算单号:"
}}
name: ""
}}
extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{infoDetail?.settlementNo}</span>
<span style={{ fontSize: 16, fontWeight: 'bold', color: "#303133" }}>结算单号:{infoDetail?.settlementNo}</span>
)}
/>
}
>
<Descriptions
column={3}
style={{
padding: '0 32px',
<Descriptions
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="结算日期:">{infoDetail?.settlementDate}</Descriptions.Item>
......@@ -133,7 +133,7 @@ const Info: React.FC = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
<NiceForm
actions={formActions}
expressionScope={{
exportBtn: (
......
......@@ -98,10 +98,10 @@ const Info: React.FC = () => {
<AvatarWrap
info={{
aloneTxt: '单',
name: "结算单号:"
name: ""
}}
extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{infoDetail?.settlementNo}</span>
<span style={{ fontSize: 16, fontWeight: 'bold', color: "#303133" }}>结算单号:{infoDetail?.settlementNo}</span>
)}
/>
}
......
......@@ -475,6 +475,7 @@ const Detail: React.FC<{}> = () => {
activeAddress={activeAddress}
deliverAddressOption={deliverAddressOption}
deliverAddressOnChange={deliverAddressOnChange}
manualDeliver={info.manualDeliver}
/>
</div>
......
......@@ -22,14 +22,17 @@ interface Iprops {
deliverAddressOnChange: (value: string) => void,
activeAddress: string,
deliverAddressOption: {label: string, value: string}[]
manualDeliver: any
}
const DeliveryInfomation: React.FC<Iprops> = (props) => {
console.log(props);
const manualDeliverInfo = props.manualDeliver && props.manualDeliver.deliveryAddress?.split("/");
console.log(manualDeliverInfo)
return (
<Card title="交付信息">
<Row>
<Col span={6}>
<Col span={4}>
{/* <OtherRequirement /> */}
<Row style={{marginBottom: '20px'}}>
<Col span={6}>配送方式</Col>
......@@ -40,7 +43,7 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
<Col>{props.deliveryDate && moment(props.deliveryDate).format('YYYY-MM-DD HH:mm:ss')}</Col>
</Row>
</Col>
<Col span={9} style={props.deliveryType == 1 ? {} : {display: 'none'}}>
<Col span={6} style={props.deliveryType == 1 ? {} : {display: 'none'}}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>收货地址</Col>
<Col>{props.receiveUserName} / {props.receiveUserTel}</Col>
......@@ -51,7 +54,7 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
</Col>
{
props.editDeliverAddress
? <Col span={9}>
? <Col span={7}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>{props.deliveryType == 2 ? '自提地址' : '发货地址' }</Col>
<Col span={19}>
......@@ -70,17 +73,37 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
</Col>
</Row>
</Col>
: <Col span={9} style={!props.deliveryUserName ? {display: 'none'} : {}}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>{props.deliveryType == 2 ? '自提地址' : '发货地址' }</Col>
<Col>{props.deliveryUserTel} / {props.deliveryUserName}</Col>
</Row>
<Row>
<Col offset={5}>{props.deliveryAddress}</Col>
</Row>
: <Col span={7} style={!props.deliveryUserName ? {display: 'none'} : {}}>
<div style={{display: "flex", flexDirection: "row"}}>
<div style={{marginRight: '20px'}}>{props.deliveryType == 2 ? '自提地址' : '发货地址' }</div>
<div>
{
props.manualDeliver
? <Col>
<p>{manualDeliverInfo[0]}</p>
<p>{manualDeliverInfo[1]} / {manualDeliverInfo[2]}</p>
</Col>
: <Col>
<p>{props.deliveryAddress}</p>
<p>{props.deliveryUserTel} / {props.deliveryUserName}</p>
</Col>
}
</div>
</div>
</Col>
}
{
props.manualDeliver
? <Col span={4}>
<div>
<p>
手工发货-发货单号:<a target={"_blank"} href={`https://www.kuaidi100.com/chaxun?nu=${props.manualDeliver?.deliveryNo}`} >{props.manualDeliver?.deliveryNo}</a>
</p>
<p> 手工发货-发货时间: {props.manualDeliver && props.manualDeliver.deliveryTime && moment(props.manualDeliver.deliveryTime).format('YYYY-MM-DD HH:mm:ss')}</p>
</div>
</Col>
: null
}
</Row>
</Card>
)
......
......@@ -33,6 +33,13 @@ export const querySchema: ISchema = {
columns: 6,
},
properties: {
summary: {
type: 'string',
'x-component-props': {
placeholder: '通知单摘要',
allowClear: true,
},
},
processName: {
type: 'string',
'x-component-props': {
......@@ -126,6 +133,13 @@ export const tobeAddQuerySchema: ISchema = {
},
},
properties: {
summary: {
type: 'string',
'x-component-props': {
placeholder: '通知单摘要',
allowClear: true,
},
},
processName: {
type: 'string',
'x-component-props': {
......@@ -220,6 +234,13 @@ export const pendingFirstQuerySchema: ISchema = {
},
},
properties: {
summary: {
type: 'string',
'x-component-props': {
placeholder: '通知单摘要',
allowClear: true,
},
},
processName: {
type: 'string',
'x-component-props': {
......
......@@ -77,13 +77,14 @@ const DetailTab: React.FC<Iprops> = (props) => {
const confirm = (params, type) => {
props.handleConfirm(type, params);
}
const sorted = dataSource && dataSource.sort((a, b) => a.deliveryBatch - b.deliveryBatch ) || []
return (
<div >
<div >
<Radio.Group value={activeBatch} onChange={handleOnChange}>
{
dataSource && dataSource.map((item, key) => {
sorted.map((item, key) => {
return (
<Radio.Button key={item.deliveryBatch} value={key}>{item.deliveryBatch} 批次</Radio.Button>
)
......
......@@ -33,6 +33,13 @@ export const querySchema: ISchema = {
columns: 6,
},
properties: {
summary: {
type: 'string',
'x-component-props': {
placeholder: '通知单摘要',
allowClear: true,
},
},
supplierName: {
type: 'string',
'x-component-props': {
......@@ -196,6 +203,13 @@ export const pendingFirstQuerySchema: ISchema = {
},
},
properties: {
summary: {
type: 'string',
'x-component-props': {
placeholder: '通知单摘要',
allowClear: true,
},
},
supplierName: {
type: 'string',
'x-component-props': {
......
......@@ -79,7 +79,7 @@ const Address: React.FC<AddressPropsType> = (props) => {
return new Promise((resolve, reject) => {
PublicApi.postLogisticsReceiverAddressDelete({ id }).then(res => {
if (res.code === 1000) {
resolve()
resolve(true)
fetchAddressList()
}
}).catch(() => {
......
......@@ -11,19 +11,9 @@ import { Input, Switch, Select, FormMegaLayout } from '@formily/antd-components'
import { PublicApi } from '@/services/api'
import { PATTERN_MAPS } from '@/constants/regExp'
import { GetLogisticsReceiverAddressPageResponseDetail, postLogisticsReceiverAddressUpdate } from '@/services/LogisticsApi'
import ChinaImg from '../../../../../../mockStatic/china.png'
import japenImg from '../../../../../../mockStatic/japen.png'
import korenImg from '../../../../../../mockStatic/koren.png'
import us from '../../../../../../mockStatic/us.png'
import styles from './index.less'
import { isEmpty } from 'lodash'
const _width: number = 24
const _height: number = 17
interface countryItem {
name: string,
key: string,
icon: string
}
//列表带来的参数
export interface ListProps {
title?: React.ReactNode
......@@ -50,24 +40,19 @@ const AddAddress: React.FC<AddAddressPropsType> = (props) => {
const { visible = false, title, onOk, onCancel, editItem, type } = props
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [Options, setOptions] = useState([])
const [state, setState] = useState({ editable: true })
const [telCodeList, setTelCodeList] = useState([])
const [state] = useState({ editable: true })
const [provinceName, setProvinceName] = useState('')
const [cityName, setCityName] = useState('')
const [districtName, setDistrictName] = useState('')
const [headerTitle, setHeaderTitle] = useState('')
const [provinceList, setProvinceList] = useState([])
const [cityList, setCityList] = useState([])
const [telCode, setTelCode] = useState<any>([])
// useEffect(() => {
// if (type === 'edit' && !!editItem) {
// initAddressItemInfo()
// }
// }, [editItem, type])
const [cityList] = useState([])
const initAddressItemInfo = async () => {
//@ts-ignore
const addressDetailRes = await PublicApi.getLogisticsReceiverAddressGet({ id: editItem.id })
const param: any = {
id: editItem.id
}
const addressDetailRes = await PublicApi.getLogisticsReceiverAddressGet(param)
const addressDetail = addressDetailRes.data
Object.keys(addressDetail).forEach(key => {
......@@ -87,49 +72,54 @@ const AddAddress: React.FC<AddAddressPropsType> = (props) => {
})
}
// const selectList: any = [
// { label: <><img src={ChinaImg} key='1' style={{ width: _width, height: _height }} /> +86</>, value: '1' },
// { label: <><img src={japenImg} key='3' style={{ width: _width, height: _height }} /> +86</>, value: '3' },
// { label: <><img src={korenImg} key='4' style={{ width: _width, height: _height }} /> +86</>, value: '4' },
// { label: <><img src={us} key='5' style={{ width: _width, height: _height }} /> +86</>, value: '5' }
// ]
// let _Options: any = []
let TelCodeList: any = []
useEffect(() => {
PublicApi.getManageCountryAreaGetTelCode().then(res => {
res.data.forEach((item, index) => {
TelCodeList.push({ label: item, value: (index).toString() })
})
setOptions(TelCodeList)
})
const getAllCode = setTimeout(() => {
PublicApi.getManageAreaByPcodeAll({ pcode: '100000' }).then(res => {
let list = []
res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: `${item.code}-${item.name}` })
// list.push({ label: item.name, value: item.code })
const fetchCountryAreaTelCode = () => {
if(isEmpty(telCodeList)) {
PublicApi.getManageCountryAreaGetTelCode().then(res => {
const result: any = []
res.data.forEach((item, index) => {
result.push({ label: item, value: (index).toString() })
})
setProvinceList(list)
setTelCodeList(result)
})
}, 1000)
if (type === 'edit' && !!editItem) {
initAddressItemInfo()
}
}
return () => {
clearTimeout(getAllCode)
useEffect(() => {
if(visible) {
fetchCountryAreaTelCode()
let getAllCode = null
if(isEmpty(provinceList)) {
getAllCode = setTimeout(() => {
PublicApi.getManageAreaByPcodeAll({ pcode: '100000' }).then(res => {
const list = []
res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: `${item.code}-${item.name}` })
})
setProvinceList(list)
})
}, 1000)
}
if (type === 'edit' && editItem) {
initAddressItemInfo()
}
return () => {
clearTimeout(getAllCode)
}
}
}, [editItem, type])
}, [editItem, type, visible])
/**
* @description: Form保存
* @param {type}
* @return:
* @param {type}
* @return:
*/
const formSubmit = (values) => {
let value = { ...values }
const value = { ...values }
value.isDefault = values.isDefault ? 1 : 0
value.provinceCode = value.provinceCode.split('-').length > 1 ? value.provinceCode.split('-')[0] : value.provinceCode
value.cityCode = value.cityCode.split('-').length > 1 ? value.cityCode.split('-')[0] : value.cityCode
......@@ -158,8 +148,8 @@ const AddAddress: React.FC<AddAddressPropsType> = (props) => {
/**
* @description: 自定义HOOK
* @param {type}
* @return:
* @param {type}
* @return:
*/
const useAreaEffects = () => {
const { setFieldState } = createFormActions()
......@@ -167,12 +157,12 @@ const AddAddress: React.FC<AddAddressPropsType> = (props) => {
setFieldState('districtCode', state => {
state.value = ''
})
let name = value && value.split('-').length > 1 ? value.split('-')[1] : ''
const name = value && value.split('-').length > 1 ? value.split('-')[1] : ''
setProvinceName(name)
setFieldState('*(cityCode)', state => {
state.value = ''
let list = []
let pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value
const list = []
const pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value
PublicApi.getManageAreaByPcodeAll({ pcode: pcode }).then(res => {
res.data.forEach((item: any, index: number) => {
// list.push({ label: item.name, value: item.code })
......@@ -184,12 +174,12 @@ const AddAddress: React.FC<AddAddressPropsType> = (props) => {
})
onFieldValueChange$('cityCode').subscribe(({ value }) => {
let name = value && value.split('-').length > 1 ? value.split('-')[1] : ''
const name = value && value.split('-').length > 1 ? value.split('-')[1] : ''
setCityName(name)
setFieldState('*(districtCode)', state => {
state.value = ''
let list = []
let pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value
const list = []
const pcode = value && value.split('-').length > 1 ? value.split('-')[0] : value
PublicApi.getManageAreaByPcodeAll({ pcode: pcode }).then(res => {
res.data.forEach((item: any, index: number) => {
// list.push({ label: item.name, value: item.code })
......@@ -200,7 +190,7 @@ const AddAddress: React.FC<AddAddressPropsType> = (props) => {
})
})
onFieldValueChange$('districtCode').subscribe(({ value }) => {
let name = value && value.split('-').length > 1 ? value.split('-')[1] : ''
const name = value && value.split('-').length > 1 ? value.split('-')[1] : ''
setDistrictName(name)
})
}
......@@ -316,7 +306,7 @@ const AddAddress: React.FC<AddAddressPropsType> = (props) => {
message: '请选择区号',
}}
x-component="Select"
enum={Options}
enum={telCodeList}
x-component-props={{
placeholder: '请选择'
}}
......
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