Commit 46587bfc authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'v2-220418' of…

Merge branch 'v2-220418' of ssh://gitlab.shushangyun.com:8122/linkseeks-design/pro-platform into chore-v2-220418
parents 3d081f5f f053d2e0
......@@ -39,13 +39,13 @@ export function HarvestMaterialInput(props: {
}
// 存在小数点 且 字符串必须大于 . +1 才执行
if (targetVal.includes('.') && targetVal.length != targetVal.indexOf('.')) {
const reg = new RegExp("((^[1-9][0-9]{0,8})+(.?[0-9]{1,3})?$)")
const reg = new RegExp("((^[0-9][0-9]{0,8})+(.?[0-9]{1,3})?$)")
const test = reg.test(targetVal)
if (!test) {
return;
}
} else {
const reg = new RegExp("((^[1-9][0-9]{0,8})+(.?[0-9]{1,3})?$)")
const reg = new RegExp("((^[0-9][0-9]{0,8})+(.?[0-9]{1,3})?$)")
const test = reg.test(targetVal)
if (!test) {
return;
......
import { useMemo, useState } from "react";
function usePageTitle() {
const [info, setInfo] = useState<any>()
const title = useMemo(() => {
return `${info?.digest ?? ''} | ${info?.No ?? ''}`
}, [info])
const setDeliveryTitle = (info) => {
info.No = info?.deliveryNo
setInfo(info)
}
const setReceiveTitle = (info) => {
info.No = info?.deliveryNo
setInfo(info)
}
return {
title,
setDeliveryTitle,
setReceiveTitle
}
}
export default usePageTitle;
\ No newline at end of file
......@@ -87,7 +87,7 @@ const DeliveryGood: AnchorsItem = {
const ExternalRoamRecord: AnchorsItem = {
key: 'ExternalDocumentFlowRecord',
name: '外部单据流转记录'
name: '流转记录'
}
const Remarks: AnchorsItem = {
......
......@@ -21,7 +21,7 @@ export const DeliveryNoteAddFromTableColumn: any = [
width: 140,
render: (_, rcode, index) => {
return (
<HarvestMaterialInput value={rcode.DeliveryNum} index={index} keyUp="ConsigneeNum" />
<HarvestMaterialInput value={rcode.DeliveryNum} index={index} keyup="ConsigneeNum" />
)
},
editable: true,
......
......@@ -119,7 +119,7 @@ export const PlannedDeliveryNumColumn: any = {
}
export const FlowOnColumn: any = {
title: '流转顺序号',
title: '序号',
// align: 'center',
}
......@@ -144,7 +144,7 @@ export const FlowOptionsTimeColumn: any = {
}
export const FlowNoteColumn: any = {
title: '备注',
title: '审核意见',
// align: 'center',
}
......
......@@ -261,16 +261,25 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</Radio.Group>
</FormItem>
<FormItem hidden={isLogistics} label={LogisticsCarNoLabel} name="executorVO.carNumbers">
<Input maxLength={20} />
<FormItem
rules={[
{ max: 20, message: "最长20个字符" }
]}
hidden={isLogistics} label={LogisticsCarNoLabel} name="executorVO.carNumbers">
<Input />
</FormItem>
<FormItem hidden={isLogistics} label={LogisticsCompanyLabel} name="logisticsCompanyInt">
<LogisticsCompanyMerchantsSelect />
</FormItem>
<FormItem
rules={[
{ max: 20, message: "最长20个字符" }
]}
hidden={isLogistics}
label={LogisticsNoLabel} name="logisticsNo">
<Input maxLength={20} />
<Input />
</FormItem>
</ContentBox>
......
......@@ -12,6 +12,7 @@ import { DeliveryNoticeTableColumn, ExternalRoamRecordTableColumn } from '../../
import { useLocation } from 'umi';
import NoteFactoryService from '../../assets/handles/DeliveryNoteService';
import { DeliveryNumColumn } from '../../constants/table-column';
import usePageTitle from '../../assets/hooks/usePageTitle';
const ContentBoxItem = ContentBox.BaseInfoItem;
......@@ -36,15 +37,17 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
const [totalCount, setTotalCount] = useState(1);
const [outerHistoryList, setOuterHistoryList] = useState([]);
const { title, setDeliveryTitle } = usePageTitle()
useEffect(() => {
service.getDetailInfoById(query.id as string).then(res => {
setInfo(res)
setDeliveryTitle(res)
})
service.getDetailInfoProductById(query.id as string).then(res => {
setTableDataSource(res.data)
setTotalCount(res.totalCount)
})
......@@ -59,7 +62,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
return (
<AnchorPage title="送货单管理详情(B2B)"
<AnchorPage title={title}
anchors={anchors}
>
......@@ -106,11 +109,11 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<ContentBoxItem label={DeliveryAddrLabel}>
<div>
{info?.deliverVO?.provinceName??''}
{info?.deliverVO?.cityName??''}
{info?.deliverVO?.districtName??''}
{info?.deliverVO?.streetName??''}
{info?.deliverVO?.address??''}
{info?.deliverVO?.provinceName ?? ''}
{info?.deliverVO?.cityName ?? ''}
{info?.deliverVO?.districtName ?? ''}
{info?.deliverVO?.streetName ?? ''}
{info?.deliverVO?.address ?? ''}
</div>
<div>
{info?.deliverVO.phone}
......@@ -120,11 +123,11 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<ContentBoxItem label={DeliverySlefAddrLabel}>
<div>
{info?.receiverBO?.provinceName??''}
{info?.receiverBO?.cityName??''}
{info?.receiverBO?.districtName??''}
{info?.receiverBO?.streetName??''}
{info?.receiverBO?.address??''}
{info?.receiverBO?.provinceName ?? ''}
{info?.receiverBO?.cityName ?? ''}
{info?.receiverBO?.districtName ?? ''}
{info?.receiverBO?.streetName ?? ''}
{info?.receiverBO?.address ?? ''}
</div>
<div>
{info?.receiverBO?.phone}
......
......@@ -26,6 +26,7 @@ import { addrFormatValue } from '../../assets/format/addrValue';
import { PATTERN_MAPS } from '@/constants/regExp';
import usePrompt from '@/hooks/usePrompt';
import useLogistics from '../../assets/hooks/useLogistics';
import usePageTitle from '../../assets/hooks/usePageTitle';
const ContentBoxItem = ContentBox.BaseInfoItem;
......@@ -43,6 +44,8 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
const { handleLogisticsShow, isLogistics } = useLogistics()
const { title, setDeliveryTitle } = usePageTitle()
const [anchors, setAnchors] = useState<AnchorsItem[]>([
BillsInfo,
Distribution,
......@@ -55,6 +58,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
form.setFieldsValue({ sourceType: 0, id: id })
service.getDetailById(id).then(res => {
form.setFieldsValue(res)
setDeliveryTitle(res)
})
service.getOrderDeliveryOrderDetailProductPage({ id }).then(res => {
......@@ -93,7 +97,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
return (
<AnchorPage title="送货单管理编辑(B2B)"
<AnchorPage title={title}
anchors={anchors}
extra={
<Button.Group>
......
......@@ -12,6 +12,7 @@ import { DeliveryNoteAddFromTableColumn, DeliveryNoticeTableColumn, DeliveryNoti
import NoteFactoryService from '../../assets/handles/DeliveryNoteService';
import { useLocation } from 'umi';
import qs from 'query-string';
import usePageTitle from '../../assets/hooks/usePageTitle';
const ContentBoxItem = ContentBox.BaseInfoItem;
......@@ -19,6 +20,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
const location = useLocation();
const query = qs.parse(location.search);
const { title, setDeliveryTitle } = usePageTitle()
const service = NoteFactoryService.getInstance();
......@@ -40,6 +42,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
service.getDetailInfoById(query.id as string).then(info => {
setInfo(info)
setDeliveryTitle(info)
service.getDetailInfoProductById(query.id as string).then(res => {
setTableDataSource(res.data)
setAnchors([
......@@ -69,7 +72,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
return (
<AnchorPage title="送货单管理详情(SRM)"
<AnchorPage title={title}
anchors={anchors}
>
......
......@@ -27,6 +27,7 @@ import { addrFormatValue } from '../../assets/format/addrValue';
import { PATTERN_MAPS } from '@/constants/regExp';
import usePrompt from '@/hooks/usePrompt';
import useLogistics from '../../assets/hooks/useLogistics';
import usePageTitle from '../../assets/hooks/usePageTitle';
const ContentBoxItem = ContentBox.BaseInfoItem;
......@@ -45,6 +46,8 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
const service = new DeliveryNoteUploadService(form);
const { title, setDeliveryTitle } = usePageTitle()
const [anchors, setAnchors] = useState<AnchorsItem[]>([
BillsInfo,
Distribution,
......@@ -56,6 +59,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
form.setFieldsValue({ sourceType: 0, id: id })
service.getDetailById(id).then(res => {
form.setFieldsValue(res)
setDeliveryTitle(res)
setOuterHistoryList(res.outerHistoryList)
})
......@@ -95,7 +99,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
return (
<AnchorPage title="送货单管理详情(SRM)"
<AnchorPage title={title}
anchors={anchors}
extra={
<Button.Group>
......
......@@ -17,6 +17,7 @@ import { Table } from 'antd';
import { DeliveryNoticeTableColumn, DeliveryNoticeTableColumnSRM, ExternalRoamRecordTableColumn } from '../../constants/page-table-column';
import { useLocation } from 'umi';
import NoteFactoryService from '../../assets/handles/DeliveryNoteService';
import usePageTitle from '../../assets/hooks/usePageTitle';
const ContentBoxItem = ContentBox.BaseInfoItem;
......@@ -42,6 +43,8 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
const [totalCount, setTotalCount] = useState(1);
const [outerHistoryList, setOuterHistoryList] = useState([]);
const { title, setReceiveTitle } = usePageTitle()
useEffect(() => {
service.getDetailInfoById(query.id as string).then(res => {
......@@ -77,11 +80,12 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
*/
useEffect(() => {
setOuterHistoryList(info?.outerHistoryList)
setReceiveTitle(info)
}, [info])
return (
<AnchorPage title="收货单详情"
<AnchorPage title={title}
anchors={anchors}
>
......@@ -209,13 +213,13 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</ContentBox>
{/* <ContentBox title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<ContentBox title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
columns={ExternalRoamRecordTableColumn}
rowKey="id"
dataSource={outerHistoryList}
/>
</ContentBox> */}
</ContentBox>
</AnchorPage>
)
......
......@@ -12,6 +12,7 @@ import ReceiveNoteFacotry from '../../assets/handles/ReceiveNotePage';
import { useLocation } from 'umi';
import { DeliveryNoticeTableColumn, DeliveryNoticeTableColumnSRM, ExternalRoamRecordTableColumn } from '../../constants/page-table-column';
import { DeliveryNumColumn } from '../../constants/table-column';
import usePageTitle from '../../assets/hooks/usePageTitle';
const ListInfoItem = ListInfo.BaseInfoItem;
const service = ReceiveNoteFacotry.getInstance()
......@@ -27,6 +28,7 @@ const DeliveryNoteManageDetails: React.FC = () => {
const [loading, setLoading] = useState(true)
const [outerHistoryList, setOuterHistoryList] = useState([])
const { title, setReceiveTitle } = usePageTitle()
useEffect(() => {
......@@ -35,6 +37,8 @@ const DeliveryNoteManageDetails: React.FC = () => {
service.getDetailProduct({ id, current: 1 })
]).then((values) => {
setInfo(values[0])
setReceiveTitle(values[0])
setOuterHistoryList(values[0].outerHistoryList)
setTableDataSource(values[1].data)
setLoading(false)
......@@ -60,7 +64,7 @@ const DeliveryNoteManageDetails: React.FC = () => {
return (
<Spin spinning={loading}>
<AnchorPage
title={`${info?.deliveryNo}收货单详情`}
title={title}
anchors={anchors}
>
......@@ -73,7 +77,7 @@ const DeliveryNoteManageDetails: React.FC = () => {
{info?.buyerMemberName}
</ListInfoItem>
<ListInfoItem label='货单摘要'>
<ListInfoItem label='货单摘要'>
{info?.digest}
</ListInfoItem>
......
......@@ -22,6 +22,7 @@ import LogisticsCompanyMerchantsSelect from "@/components/LogisticsCompanySelect
import { DeliveryNumColumn, OrderNumColumn } from "../../constants/table-column"
import { useLocation } from "umi"
import usePrompt from "@/hooks/usePrompt"
import usePageTitle from "../../assets/hooks/usePageTitle"
const { useForm } = Form;
const noteService = NoteFactoryService.getInstance('receive');
......@@ -39,6 +40,7 @@ function DeliveryNoteAddForm() {
const service = new ReceiveOrderUpdate(form);
service.setTableData(tableDataSource)
const { renderPrompt, handleLeave } = usePrompt()
const { title, setReceiveTitle } = usePageTitle()
const [anchors, setAnchors] = useState<AnchorsItem[]>(() => {
return [
......@@ -57,6 +59,7 @@ function DeliveryNoteAddForm() {
});
noteService.getDetailInfoById(id).then(res => {
setReceiveTitle(res)
const target = {
...service.formatField(res),
"executorVO.phone": res?.executorVO?.phone,
......@@ -71,6 +74,7 @@ function DeliveryNoteAddForm() {
id: id,
...target
})
setOuterHistoryList(res?.outerHistoryList)
})
......@@ -98,7 +102,7 @@ function DeliveryNoteAddForm() {
}
return (
<AnchorPage title={ReceiptAddLabel}
<AnchorPage title={title}
anchors={anchors}
extra={
<Button onClick={() => handleSubmit()} type="primary">
......
......@@ -12,6 +12,7 @@ import ReceiveNoteFacotry from '../../assets/handles/ReceiveNotePage'
import { useLocation } from 'umi'
import { DeliveryNoticeTableColumn, DeliveryNoticeTableColumnSRM, ExternalRoamRecordTableColumn } from '../../constants/page-table-column'
import { DeliveryNumColumn } from '../../constants/table-column'
import usePageTitle from '../../assets/hooks/usePageTitle'
const service = ReceiveNoteFacotry.getInstance('Query')
......@@ -26,14 +27,16 @@ const DeliveryNoteDetails: React.FC = () => {
const { id } = (location as any).query
const [outerHistoryList, setOuterHistoryList] = useState([])
const { title, setDeliveryTitle } = usePageTitle()
useEffect(() => {
Promise.all([
service.getDetailById(id),
service.getDetailProduct({ id, current: "1" })
]).then(values => {
console.log(values[0])
setDeliveryTitle(values[0])
setInfo(values[0])
setTableDataSource(values[1].data)
setOuterHistoryList(values[0]?.outerHistoryList)
......@@ -60,7 +63,7 @@ const DeliveryNoteDetails: React.FC = () => {
return (
<AnchorPage
title="送货单详情"
title={title}
anchors={anchors}
>
......
......@@ -23,6 +23,7 @@ import { DeliveryNumColumn, OrderNumColumn } from "../../constants/table-column"
import { useLocation } from "umi"
import ReceiveNoteFacotry from "../../assets/handles/ReceiveNotePage"
import usePrompt from "@/hooks/usePrompt"
import usePageTitle from "../../assets/hooks/usePageTitle"
const { useForm } = Form;
const noteService = ReceiveNoteFacotry.getInstance('Manage')
......@@ -42,6 +43,7 @@ function DeliveryNoteAddForm() {
service.setTableData(tableDataSource)
const { renderPrompt, handleLeave } = usePrompt()
const { title, setDeliveryTitle } = usePageTitle()
const [anchors, setAnchors] = useState<AnchorsItem[]>(() => {
return [
......@@ -62,6 +64,7 @@ function DeliveryNoteAddForm() {
...res
})
setType(res?.type)
setDeliveryTitle(res)
})
service.getOrderDeliveryOrderDetailProductPage(id).then(res => {
......@@ -87,7 +90,7 @@ function DeliveryNoteAddForm() {
}
return (
<AnchorPage title={ReceiptAddLabel}
<AnchorPage title={title}
anchors={anchors}
extra={
<Button onClick={() => handleSubmit()} type="primary">
......
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