Commit bbef15b6 authored by leimo's avatar leimo

Merge branch '20418order' into 'v2-220418'

最后一点文案问题 See merge request linkseeks-design/pro-platform!508
parents 26cfc201 01fbaa9e
......@@ -97,7 +97,7 @@ const Remarks: AnchorsItem = {
const DeliveryNoteQuery: AnchorsItem[] = [
BillsInfo,
Distribution,
Harvest,
DeliveryInfo,
LogisticsInfo,
]
......
......@@ -29,7 +29,7 @@ import { useLocation } from 'umi';
import { SourceTypeEnum } from '../../constants/SourceTypeEnum';
import { ShipperAddress, ReceiverAddress } from '@/components/AddressDrawer'
import { checkRegExp } from '@/utils/regExp';
import { checkRegExp, validatorByteObject } from '@/utils/regExp';
import { PATTERN_MAPS } from '@/constants/regExp';
import usePrompt from '@/hooks/usePrompt';
import { useAnchor } from '@/utils/hooks';
......@@ -152,7 +152,11 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<Input />
</FormItem>
<FormItem label={NoteLabel} name="remark">
<FormItem
rules={[
validatorByteObject(150)
]}
label={NoteLabel} name="remark">
<Input maxLength={150} placeholder="150个汉字" />
</FormItem>
......@@ -162,7 +166,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
]}
label={BuyerLabel} name="member">
<RoleSelect
isDefault={true}
formatFeils={(e) => {
return {
buyerMemberId: e.memberId,
......@@ -185,6 +188,9 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</FormItem>
<FormItem
rules={[
validatorByteObject(16)
]}
label={DeliveryNameLabel} name="executorVO.consignee">
<Input maxLength={16} />
</FormItem>
......@@ -199,7 +205,8 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<FormItem
rules={[
{ pattern: PATTERN_MAPS.phone, message: "手机号是否正确" }
{ pattern: PATTERN_MAPS.phone, message: "手机号是否正确" },
validatorByteObject(20)
]}
label={DeliveryPhoneLabel} name="executorVO.phone">
<Input maxLength={20} />
......@@ -265,7 +272,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<FormItem
rules={[
{ max: 20, message: "最长20个字符" }
validatorByteObject(20)
]}
hidden={isLogistics} label={LogisticsCarNoLabel} name="executorVO.carNumbers">
<Input maxLength={20} />
......@@ -277,7 +284,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<FormItem
rules={[
{ max: 20, message: "最长20个字符" }
validatorByteObject(20)
]}
hidden={isLogistics}
label={LogisticsNoLabel} name="logisticsNo">
......
......@@ -106,6 +106,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
handleLeave(false)
// history.goBack()
// 兼容从送货计划协同跳转生成送货通知单
handleLeave(false)
history.push('/memberCenter/order/deliveryNoticeManagement/query')
}
}).finally(() => {
......
......@@ -107,7 +107,6 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
requestApi(params).then(({ code, data }) => {
if (code === 1000) {
handleLeave(false)
// history.goBack()
// 兼容从送货计划协同跳转生成送货通知单
history.push('/memberCenter/order/deliveryNoticeManagement/query')
}
......
......@@ -279,7 +279,7 @@ function DeliveryNoticeFromCreate() {
render: (t, rcode, index) => {
return (
<HarvestMaterialInput
value={rcode[OrderNumColumn.key]}
value={rcode?.deliveryCount}
index={index}
keyup="deliveryCount"
disabled={true}
......
......@@ -16,6 +16,7 @@ import { RoleSelect } from '@/components/RoleSelect'
import { getOrderDeliveryPlanOrderProductPage, postOrderDeliveryPlanSrmCreate } from '@/services/OrderNewV2Api'
import { getMemberManageLowerMerchantProviderPage } from '@/services/MemberV2Api'
import { columnSRM, initExpandIconColumn } from '../../constants/page-table-column'
import { validatorByteObject } from '@/utils/regExp'
const formItemLayout = {
labelCol: { span: 3 },
......@@ -281,7 +282,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
<Form.Item
name='remark'
rules={[
{ required: false, message: '请输入' }
{ required: false, message: '请输入' },
]}
>
<Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} />
......
......@@ -23,6 +23,7 @@ import { DeliveryNumColumn, OrderNumColumn } from "../../constants/table-column"
import { useLocation } from "umi"
import moment from "moment"
import usePrompt from "@/hooks/usePrompt"
import { validatorByteObject } from "@/utils/regExp"
const { useForm } = Form;
const noteService = NoteFactoryService.getInstance('receive');
......@@ -173,9 +174,6 @@ function DeliveryNoteAddForm() {
<div>
<FormItem
rules={[
required()
]}
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
disabled={true}
......@@ -225,7 +223,11 @@ function DeliveryNoteAddForm() {
<FormItem label={LogisticsCompanyLabel} >
{info?.LogisticsCompanyInt?.label}
</FormItem>
<FormItem label={LogisticsNoLabel} >
<FormItem
rules={[
validatorByteObject(20)
]}
label={LogisticsNoLabel} >
<Input hidden maxLength={20} disabled={true} />
{info?.logisticsNo}
</FormItem>
......
......@@ -6,7 +6,7 @@
import React, { useEffect, useState } from 'react'
import AnchorPage from '@/components/AnchorPage'
import { BaseInfo as ListInfo } from '@/components/BaseInfo'
import { BillsInfo, DeliveryInfo, DeliveryNoteQuery, Distribution, ExternalRoamRecord, Harvest, LogisticsInfo, Material } from '../../constants'
import { BillsInfo, DeliveryInfo, DeliveryNoteQuery, Distribution, ExternalRoamRecord, Harvest, HarvestMaterial, LogisticsInfo, Material } from '../../constants'
import { Space, Spin, Table, Tag } from 'antd';
import ReceiveNoteFacotry from '../../assets/handles/ReceiveNotePage';
import { useLocation } from 'umi';
......@@ -45,9 +45,9 @@ const DeliveryNoteManageDetails: React.FC = () => {
setAnchors([
...anchors,
{
...Material,
...HarvestMaterial,
...{
name: `${Material.name}(${values[1].totalCount})`
name: `${HarvestMaterial.name}(${values[1].totalCount})`
}
},
{
......@@ -69,11 +69,11 @@ const DeliveryNoteManageDetails: React.FC = () => {
>
<ListInfo className='mt-15' title={BillsInfo.name} id={BillsInfo.key}>
<ListInfoItem className="mt-16" label='收货单号'>
<ListInfoItem className="mt-16" label='收货单号'>
{info?.receiveNo}
</ListInfoItem>
<ListInfoItem label='采购会员'>
<ListInfoItem label='供应会员'>
{info?.buyerMemberName}
</ListInfoItem>
......@@ -95,7 +95,7 @@ const DeliveryNoteManageDetails: React.FC = () => {
<ListInfo className='mt-15' title={Harvest.name} id={Harvest.key}>
<div>
<ListInfoItem className="mt-16" label='收货日期'>
<ListInfoItem className="mt-16" label='收货时间'>
{info?.receiveTime}
</ListInfoItem>
......@@ -152,7 +152,7 @@ const DeliveryNoteManageDetails: React.FC = () => {
</ListInfo>
<ListInfo className='mt-15' title={Material.name} id={Material.key} cols={1}>
<ListInfo className='mt-15' title={HarvestMaterial.name} id={HarvestMaterial.key} cols={1}>
<Table
rowKey={row => row.orderNo}
columns={
......@@ -164,6 +164,11 @@ const DeliveryNoteManageDetails: React.FC = () => {
return rcode.deliveryCount
}
}
, {
title: '收货数量',
dataIndex: 'receiveCount',
key: 'receiveCount'
}
]}
dataSource={tableDataSource}
/>
......
......@@ -71,7 +71,7 @@ const DeliveryNoteManage: React.FC = () => {
{ title: '收货日期', dataIndex: 'receiveTime', key: 'receiveTime' },
{ title: '送货单号', dataIndex: 'deliveryNo', key: 'deliveryNo' },
{ title: '送货日期', dataIndex: 'deliveryTime', key: 'deliveryTime' },
{ title: '供应会员', dataIndex: 'buyerMemberName', key: 'buyerMemberName' },
{ title: '供应会员', dataIndex: 'vendorMemberName', key: 'vendorMemberName' },
{ title: '单据时间', dataIndex: 'createTime', key: 'createTime' },
{
title: '外部状态',
......
......@@ -91,7 +91,7 @@ const DeliveryNoteQuery: React.FC = () => {
},
{ title: '送货单摘要', dataIndex: 'digest', key: 'digest' },
{ title: '送货日期', dataIndex: 'deliveryTime', key: 'deliveryTime' },
{ title: '供应会员', dataIndex: 'buyerMemberName', key: 'buyerMemberName' },
{ title: '供应会员', dataIndex: 'vendorMemberName', key: 'vendorMemberName' },
{ title: '单据时间', dataIndex: 'createTime', key: 'createTime' },
{
title: '外部状态',
......
......@@ -3,7 +3,7 @@ import { values } from 'mobx';
* @param str:string 需要校验的字符串
* @param type:string 需要校验的类型
*/
export const checkRegExp = (str:string, type:string) => {
export const checkRegExp = (str: string, type: string) => {
switch (type) {
case 'phone': //手机号码
return /^1[3|4|5|6|7|8|9][0-9]{9}$/.test(str);
......@@ -54,10 +54,10 @@ export const checkRegExp = (str:string, type:string) => {
*/
export const validatorByte = (rule, value, callback, maxByte: number) => {
try {
if(value){
if (value) {
let str = value
str = str.replace(/[\u4e00-\u9fa5]/g, 'OO')
if(str.length > maxByte)
if (str.length > maxByte)
throw new Error(`最多输入${maxByte}个字符,${Math.floor(maxByte / 2)}个汉字`);
else
callback()
......@@ -69,6 +69,13 @@ export const validatorByte = (rule, value, callback, maxByte: number) => {
}
}
export const validatorByteObject = (num: number) => {
return {
validator: (rule, value, callback) => validatorByte(rule, value, callback, num)
}
}
/**
* 校验内容是否为纯空格
* @param value 表单输入的值
......@@ -77,8 +84,8 @@ export const validatorByte = (rule, value, callback, maxByte: number) => {
*/
export const validatorAllTrim = (value, callback, name = '') => {
try {
if(value){
if(value.trim().length === 0)
if (value) {
if (value.trim().length === 0)
throw new Error(`${name}不可为空`);
else
callback()
......
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