Commit 8f4ce6b0 authored by rainbowmorel@163.com's avatar rainbowmorel@163.com

ui 和 ux上的一些修改

parent ad97a337
......@@ -7,7 +7,7 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useCallback, useEffect, useState, useContext } from 'react'
import {
BaseInfo, BuyerLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryDate,
DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryPanleNoLabel, DeliveryPhoneLabel, DeliveryTime,
DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryPanleNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTime,
DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel,
LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, ReceivingAddress as ReceivingAddressLabel
} from '../../constants'
......@@ -31,11 +31,13 @@ import { SourceTypeEnum } from '../../constants/SourceTypeEnum';
import { ShipperAddress, ReceiverAddress } from '@/components/AddressDrawer'
import { checkRegExp } from '@/utils/regExp';
import { PATTERN_MAPS } from '@/constants/regExp';
import usePrompt from '@/hooks/usePrompt';
const DeliveryNoticeManageSRMDetails: React.FC = () => {
const [tableDataSource, setTableDataSource] = useState();
const { renderPrompt, handleLeave } = usePrompt();
const [form] = Form.useForm()
const location = useLocation()
......@@ -98,8 +100,10 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</Button.Group>
}
>
{renderPrompt()}
<Form
form={form}
onValuesChange={() => handleLeave()}
>
<FormItem hidden name="sourceType">
<Input type="hidden" />
......@@ -149,28 +153,26 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<DatePickerSelect disabled={true} defualtToday={true} className='w-full' />
</FormItem>
<FormItem
rules={[
required(`${DeliveryTime}不能为空`)
required(`${DeliveryNameLabel}不能为空`)
]}
label={DeliveryTime} name="deliveryRangeTime">
<DatePickerSelect.RangePicker className="w-full" picker='time' />
label={DeliveryNameLabel} name="executorVO.consignee">
<Input />
</FormItem>
<FormItem
rules={[
required(`${DeliveryNameLabel}不能为空`)
required(`${DeliveryTime}不能为空`)
]}
label={DeliveryNameLabel} name="executorVO.consignee">
<Input />
label={DeliveryTime} name="deliveryRangeTime">
<DatePickerSelect.RangePicker className="w-full" picker='time' />
</FormItem>
<FormItem
rules={[
required(`${DeliveryPhoneLabel}不能为空`),
{pattern:PATTERN_MAPS.phone,message:"手机号是否正确"}
{ pattern: PATTERN_MAPS.phone, message: "手机号是否正确" }
]}
label={DeliveryPhoneLabel} name="executorVO.phone">
<Input />
......@@ -182,21 +184,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<FormItem
rules={[
required(`${DeliveryNameLabel}不能为空`)
]}
label={DeliveryNameLabel} name="deliveryVO">
<ShipperAddress
showDefault={true}
onChange={(val) => {
form.setFieldsValue({
"executorVO.phone": val?.phone
})
}}
/>
</FormItem>
<FormItem
rules={[
required(`${ConsigneeTimeLabel}不能为空`)
]}
label={ConsigneeTimeLabel} name="sendTime">
......@@ -213,6 +200,21 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</FormItem>
<FormItem
rules={[
required(`${DeliverySlefAddrLabel}不能为空`)
]}
label={DeliverySlefAddrLabel} name="deliveryVO">
<ShipperAddress
showDefault={true}
onChange={(val) => {
form.setFieldsValue({
"executorVO.phone": val?.phone
})
}}
/>
</FormItem>
</ContentBox>
<ContentBox title={LogisticsInfo.name} id={LogisticsInfo.key}>
......@@ -223,8 +225,8 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
]}
label={DeliveryTypeLabel} name="deliveryType">
<Radio.Group>
<Radio.Button value={1}>物流</Radio.Button>
<Radio.Button value={2}>自提</Radio.Button>
<Radio value={1}>物流</Radio>
<Radio value={2}>自提</Radio>
{/* <Radio.Button value={3}>无效配送</Radio.Button> */}
</Radio.Group>
</FormItem>
......@@ -250,7 +252,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
rowKey={row => row.orderNo}
columns={
[
...(ot === 1 ? DeliveryNoticeTableColumn : DeliveryNoticeTableColumnSRM)
...(ot === 1 ? DeliveryNoticeTableColumn : DeliveryNoticeTableColumnSRM)
, {
...DeliveryNumColumn,
render: (t, rcode, index) => {
......
......@@ -175,30 +175,30 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
rules={[
required()
]}
label={DeliverySlefAddrLabel} name="deliveryVO">
<ShipperAddress
showDefault={true}
/>
label={ConsigneeTimeLabel} name="sendTime">
<DatePickerSelect className="w-full" />
</FormItem>
<FormItem
rules={[
required()
]}
label={ConsigneeTimeLabel} name="sendTime">
<DatePickerSelect className="w-full" />
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
disabled={true}
/>
</FormItem>
<FormItem
rules={[
required()
]}
label={ReceivingAddress} name="receiveVO">
label={DeliverySlefAddrLabel} name="deliveryVO">
<ReceiverAddress
disabled={true}
<ShipperAddress
showDefault={true}
/>
</FormItem>
......
......@@ -89,7 +89,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
>
<Form
form={form}
onValuesChange={()=>{handleLeave()}}
onValuesChange={() => { handleLeave() }}
>
<FormItem name="sourceType">
<Input type="hidden" />
......@@ -153,7 +153,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<FormItem
rules={[
required('请出入正确的手机号'),
{pattern:PATTERN_MAPS.phone,message:"手机号是否正确"}
{ pattern: PATTERN_MAPS.phone, message: "手机号是否正确" }
]}
label={DeliveryPhoneLabel} name="executorVO.phone">
<Input />
......@@ -167,29 +167,29 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
rules={[
required()
]}
label={DeliverySlefAddrLabel} name="deliveryVO">
<ShipperAddress
showDefault={true}
/>
label={ConsigneeTimeLabel} name="sendTime">
<DatePickerSelect className="w-full" />
</FormItem>
<FormItem
rules={[
required()
]}
label={ConsigneeTimeLabel} name="sendTime">
<DatePickerSelect className="w-full" />
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
/>
</FormItem>
<FormItem
rules={[
required()
]}
label={ReceivingAddress} name="receiveVO">
label={DeliverySlefAddrLabel} name="deliveryVO">
<ReceiverAddress
<ShipperAddress
showDefault={true}
/>
</FormItem>
......@@ -206,8 +206,8 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
]}
label={DeliveryTypeLabel} name="deliveryType">
<Radio.Group>
<Radio.Button value={1}>物流</Radio.Button>
<Radio.Button value={2}>自提</Radio.Button>
<Radio value={1}>物流</Radio>
<Radio value={2}>自提</Radio>
{/* <Radio.Button value={3}>无效配送</Radio.Button> */}
</Radio.Group>
</FormItem>
......
......@@ -176,29 +176,29 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
rules={[
required()
]}
label={DeliverySlefAddrLabel} name="deliveryVO">
<ShipperAddress
/>
label={ConsigneeTimeLabel} name="sendTime">
<DatePickerSelect className="w-full" />
</FormItem>
<FormItem
rules={[
required()
]}
label={ConsigneeTimeLabel} name="sendTime">
<DatePickerSelect className="w-full" />
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
/>
</FormItem>
<FormItem
rules={[
required()
]}
label={ReceivingAddress} name="receiveVO">
label={DeliverySlefAddrLabel} name="deliveryVO">
<ReceiverAddress
<ShipperAddress
/>
</FormItem>
</ContentBox>
......
......@@ -2,7 +2,7 @@ import AnchorPage, { AnchorsItem } from "@/components/AnchorPage";
import { Button, Form, Input, message, Radio, Table } from "antd";
import { useCallback, useEffect, useState } from "react";
import { DeliveryNoticeOrderAddService } from "../../assets/handles/HandleFormSubmit";
import { BillsInfo, BuyerLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAbstractNoLabel, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryPhoneLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, ReceivingAddress } from "../../constants";
import { BillsInfo, BuyerLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAbstractNoLabel, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, ReceivingAddress } from "../../constants";
import { BaseInfo } from '@/components/BaseInfo';
import { required, FormItem } from "@/components/FormItem";
import { RoleSelect } from "@/components/RoleSelect";
......@@ -17,6 +17,7 @@ import { SourceTypeEnum } from "../../constants/SourceTypeEnum";
import { useLocation } from "umi";
import AuthButton from "@/components/AuthButton";
import { RoleTypeEnum } from "../../constants/RoleTypeEnum";
import usePrompt from "@/hooks/usePrompt";
const ContentBox = BaseInfo
const service = new DeliveryNoticeOrderAddService();
......@@ -24,6 +25,7 @@ const service = new DeliveryNoticeOrderAddService();
function DeliveryNoticeFromCreate() {
const [tableDataSource, setTableDataSource] = useState<any[]>();
const [type, setType] = useState(0);
const { renderPrompt, handleLeave } = usePrompt();
const [form] = Form.useForm()
service.setForm(form);
......@@ -87,8 +89,10 @@ function DeliveryNoticeFromCreate() {
</AuthButton>
}
>
{renderPrompt()}
<Form
form={form}
onValuesChange={() => handleLeave()}
>
<FormItem hidden name="sourceType">
<Input type="hidden" />
......@@ -144,24 +148,20 @@ function DeliveryNoticeFromCreate() {
<DatePickerSelect disabled={true} className='w-full' />
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliveryTimeLabel} name="deliveryRangeTime">
<DatePickerSelect.RangePicker disabled={true} className="w-full" picker='time' />
label={DeliveryNameLabel} name="executorVO.consignee">
<Input />
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliveryNameLabel} name="executorVO.consignee">
<Input />
label={DeliveryTimeLabel} name="deliveryRangeTime">
<DatePickerSelect.RangePicker disabled={true} className="w-full" picker='time' />
</FormItem>
<FormItem
......@@ -171,24 +171,12 @@ function DeliveryNoticeFromCreate() {
label={DeliveryPhoneLabel} name="executorVO.phone">
<Input />
</FormItem>
</ContentBox>
<ContentBox
title={DeliveryInfo.name} id={DeliveryInfo.key}>
<FormItem
rules={[
required()
]}
label={DeliveryNameLabel} name="deliveryVO">
<ShipperAddress
onChange={(v) => {
form.setFieldsValue({
"executorVO.phone": v.phone
})
}}
/>
</FormItem>
<FormItem
rules={[
required()
......@@ -209,6 +197,21 @@ function DeliveryNoticeFromCreate() {
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliverySlefAddrLabel} name="deliveryVO">
<ShipperAddress
onChange={(v) => {
form.setFieldsValue({
"executorVO.phone": v.phone
})
}}
/>
</FormItem>
</ContentBox>
<ContentBox title={LogisticsInfo.name} id={LogisticsInfo.key}>
......@@ -218,9 +221,9 @@ function DeliveryNoticeFromCreate() {
required()
]}
label={DeliveryTypeLabel} name="deliveryType">
<Radio.Group onChange={(e) => {
form.setFieldsValue({ 'deliveryType': e.target?.value })
}}>
<Radio.Group onChange={(e) => {
form.setFieldsValue({ 'deliveryType': e.target?.value })
}}>
<Radio.Button value={1}>物流</Radio.Button>
<Radio.Button value={2}>自提</Radio.Button>
{/* <Radio.Button value={3}>无效配送</Radio.Button> */}
......
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