Commit 0e988912 authored by rainbowmorel@163.com's avatar rainbowmorel@163.com

修改一些bug

parent bb8611e8
......@@ -53,6 +53,16 @@ const ReceivingNote = [
hideInMenu: true,
noMargin: true
},
{
/** 收货单编辑*/
path: '/memberCenter/order/receivingNote/deliveryNoteManage/edit',
name: '收货单编辑',
component: '@/pages/order/receivingNote/deliveryNoteManage/edit',
hideInMenu: true,
noMargin: true
},
]
}
......
......@@ -58,6 +58,7 @@
"start:v2-220418": "cross-env PRO_ENV=v2-220418 yarn start",
"start-fast": "cross-env NODE_OPTIONS=--max_old_space_size=4096 UMI_ENV=local umi dev",
"start-fast:v2-220418": "cross-env PRO_ENV=v2-220418 yarn start-fast"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
......
......@@ -8,6 +8,7 @@ import {
GetOrderReceiveOrderDetailResponse,
getOrderReceiveOrderDetailProductPage
} from '@/services/OrderNewV2Api';
import moment from 'moment';
/**
* 送货单服务基类
......@@ -26,10 +27,60 @@ class NoteSrmService {
return getOrderDeliveryOrderDetail({
id
}).then(res => {
return res.data
})
}
formatField(data) {
let formField = {
digest: data?.digest,
remark: data?.remark,
member: {
buyerMemberId: data?.buyerMemberId,
buyerMemberName: data?.buyerMemberName,
buyerRoleId: data?.buyerRoleId,
roleType: 2,
name: data?.buyerMemberName
},
deliveryTime: data?.deliveryTime ? moment(data?.deliveryTime) : moment().startOf('day'),
deliveryRangeTime: [
moment().startOf('day'),
moment().endOf('day')
],
deliveryVO: {
...data?.deliverVO,
shipperName: data?.deliverVO?.consignee,
fullAddress: data?.deliverVO?.provinceName ?? '' + data?.deliverVO?.cityName ?? '' + data?.deliverVO?.districtName ?? '' + data?.deliverVO?.streetName ?? ''
},
receiveVO: {
...data?.receiverBO,
receiverName: data?.receiverBO?.consignee,
fullAddress: `${data?.receiverBO?.provinceName ?? ''}${data?.receiverBO?.cityName ?? ''}${data?.receiverBO?.districtName ?? ''}${data?.receiverBO?.streetName ?? ''}`
},
executorVO: {
...data?.executorVO,
fullAddress: data?.executorVO?.provinceName ?? '' + data?.executorVO?.cityName ?? '' + data?.executorVO?.districtName ?? '' + data?.executorVO?.streetName ?? ''
},
"executorVO.consignee": data?.executorVO?.consignee,
"executorVO.phone": data?.executorVO?.phone,
sendTime: data?.sendTime ? moment(data?.sendTime) : moment().startOf('day'),
"executorVO.carNumbers": data?.executorVO?.carNumbers,
"receiverBO.phone": data?.receiverBO?.phone,
logisticsNo: data?.logisticsNo,
logisticsCompanyInt: {
label: data?.logisticsCompany,
value: data?.logisticsCompanyId
},
deliveryType: data?.deliveryType,
outerHistoryList: data?.outerHistoryList,
deliveryNo: data?.deliveryNo
}
console.log(formField);
return formField
}
getDetailInfoProductById(id: string, current: string = "1", pageSize: string = "10") {
return getOrderDeliveryOrderDetailProductPage({
id,
......@@ -68,7 +119,7 @@ class NoteReceiveService extends NoteSrmService {
return getOrderReceiveOrderDetail({
id
}).then(res => {
return res.data
return this.formatField(res.data)
})
}
......
......@@ -185,8 +185,8 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
required()
]}
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
formatValue={addrFormatValue}
/>
</FormItem>
......
......@@ -50,11 +50,11 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
form.setFieldsValue({ sourceType: 0, id: id })
service.getDetailById(id).then(res => {
form.setFieldsValue(res)
setOuterHistoryList(res.outerHistoryList)
setOuterHistoryList(res?.outerHistoryList)
})
service.getOrderDeliveryOrderDetailProductPage({ id }).then(res => {
setTableDataSource(res.data)
setTableDataSource(res?.data)
})
}, [id])
......@@ -190,7 +190,6 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
<ReceiverAddress
disabled={true}
formatValue={addrFormatValue}
/>
</FormItem>
......
......@@ -15,7 +15,7 @@ import { HarvestMaterialContextProvider, HarvestMaterialInput } from '../../asse
import { DeliveryNoteB2bUploadService, ReceiveOrderCreate, ReceivingNoteAddService } from "../../assets/handles/HandleFormSubmit"
import NoteFactoryService from "../../assets/handles/DeliveryNoteService"
import { RoleSelect } from "@/components/RoleSelect"
import { AddressDrawer, ShipperAddress } from "@/components/AddressDrawer"
import { AddressDrawer, ReceiverAddress, ShipperAddress } from "@/components/AddressDrawer"
import { getLogisticsSelectListReceiverAddress, getLogisticsSelectListShipperAddress, postLogisticsReceiverAddressAdd, postLogisticsReceiverAddressUpdate, postLogisticsShipperAddressAdd, postLogisticsShipperAddressUpdate } from "@/services/LogisticsV2Api"
import { DatePickerSelect } from "@/components/DatePickerSelect"
import LogisticsCompanyMerchantsSelect from "@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect"
......@@ -141,18 +141,7 @@ function DeliveryNoteAddForm() {
required()
]}
label={ReceivingAddress} name="receiveVO">
<AddressDrawer
addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsReceiverAddressUpdate(val)
},
add: (val) => {
return postLogisticsReceiverAddressAdd(val)
}
}}
<ReceiverAddress
/>
</FormItem>
......@@ -203,12 +192,13 @@ function DeliveryNoteAddForm() {
<ContentBox title={LogisticsInfo.name} id={LogisticsInfo.key}>
<FormItem hidden name="deliveryType">
<Input />
</FormItem>
<FormItem
label={DeliveryTypeLabel} name="deliveryType">
<>
<Input hidden />
<RenaderDeliveryType />
</>
label={DeliveryTypeLabel} >
<RenaderDeliveryType />
</FormItem>
<FormItem label={LogisticsCarNoLabel} name="executorVO.carNumbers">
......
import AnchorPage, { AnchorsItem } from "@/components/AnchorPage"
import { BaseInfo } from "@/components/BaseInfo"
import { useContext, useEffect, useState } from "react"
import {
BillsInfo, DeliveryInfo, LogisticsInfo, Harvest, HarvestMaterial,
ReceiptAddLabel, NoteLabel, DeliveryTimeLabel,
ConsigneeTimeLabel, LogisticsCompanyLabel, LogisticsCarNoLabel, LogisticsNoLabel,
DeliveryAbstractLabel, BuyerLabel, DeliveryDateLabel, DeliveryNameLabel,
DeliveryPhoneLabel, ReceivingAddress, DeliveryTypeLabel, DeliveryNoLabel, ExternalRoamRecord
} from '../../constants'
import { Button, Form, Input, Radio, Table } from 'antd'
import { FormItem, required } from '@/components/FormItem'
import { DeliveryNoticeTableColumn, ExternalRoamRecordTableColumn } from "../../constants/page-table-column"
import { HarvestMaterialContextProvider, HarvestMaterialInput } from '../../assets/context'
import { DeliveryNoteB2bUploadService, ReceiveOrderCreate, ReceivingNoteAddService } from "../../assets/handles/HandleFormSubmit"
import NoteFactoryService from "../../assets/handles/DeliveryNoteService"
import { RoleSelect } from "@/components/RoleSelect"
import { AddressDrawer, ReceiverAddress, ShipperAddress } from "@/components/AddressDrawer"
import { getLogisticsSelectListReceiverAddress, getLogisticsSelectListShipperAddress, postLogisticsReceiverAddressAdd, postLogisticsReceiverAddressUpdate, postLogisticsShipperAddressAdd, postLogisticsShipperAddressUpdate } from "@/services/LogisticsV2Api"
import { DatePickerSelect } from "@/components/DatePickerSelect"
import LogisticsCompanyMerchantsSelect from "@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect"
import { DeliveryNumColumn, OrderNumColumn } from "../../constants/table-column"
import { useLocation } from "umi"
const { useForm } = Form;
const noteService = NoteFactoryService.getInstance('receive');
const ContentBox = BaseInfo;
function DeliveryNoteAddForm() {
const [tableDataSource, setTableDataSource] = useState<any>([])
const [outerHistoryList, setOuterHistoryList] = useState([])
const location = useLocation()
const { id } = (location as any).query
const [form] = useForm()
const service = new ReceiveOrderCreate(form);
service.setTableData(tableDataSource)
const [anchors, setAnchors] = useState<AnchorsItem[]>(() => {
return [
BillsInfo,
Harvest,
DeliveryInfo,
LogisticsInfo,
HarvestMaterial
]
})
useEffect(() => {
noteService.getDetailInfoProductById(id).then(res => {
setTableDataSource(res.data)
});
noteService.getDetailInfoById(id).then(res => {
form.setFieldsValue({
deliveryOrderId: id,
...res
})
setOuterHistoryList(res?.outerHistoryList)
})
}, [])
function handleSubmit() {
service.submit().then(res => {
console.log(res)
})
}
function RenaderDeliveryType({ value }: { value?: any }) {
return (
<>
<Input />
{value === 0 ? '自提' : '物流'}
</>
)
}
return (
<AnchorPage title={ReceiptAddLabel}
anchors={anchors}
extra={
<Button onClick={() => handleSubmit()} type="primary">
提交
</Button>
}
>
<Form form={form}>
<FormItem hidden name="deliveryOrderId">
<Input />
</FormItem>
<ContentBox title={BillsInfo.name} id={BillsInfo.key}>
<FormItem
rules={[
required()
]}
label={DeliveryAbstractLabel} name="digest">
<Input />
</FormItem>
<FormItem
rules={[
required()
]}
label={BuyerLabel} name="member">
<RoleSelect
disabled={true}
formatFeils={(e) => {
return {
buyerMemberId: e.memberId,
buyerRoleId: e.roleId,
roleType: 2,
name: e.name
}
}} />
</FormItem>
<FormItem label={NoteLabel} name="remark">
<Input />
</FormItem>
</ContentBox>
<ContentBox title={Harvest.name} id={Harvest.key}>
<FormItem
rules={[
required()
]}
label={ConsigneeTimeLabel} name="sendTime">
<DatePickerSelect className="w-full" />
</FormItem>
<FormItem
rules={[
required()
]}
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
/>
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliveryPhoneLabel} name="receiverBO.phone">
<Input />
</FormItem>
</ContentBox>
<ContentBox title={DeliveryInfo.name} id={DeliveryInfo.key}>
<FormItem
rules={[
required()
]}
label={DeliveryNoLabel} name="deliveryNo">
<Input disabled={true} />
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliveryDateLabel} name="deliveryTime">
<DatePickerSelect disabled={true} className='w-full' />
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliveryNameLabel} name="deliveryVO">
<ShipperAddress disabled={true} />
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliveryTimeLabel} name="deliveryRangeTime">
<DatePickerSelect.RangePicker disabled={true} className="w-full" />
</FormItem>
</ContentBox>
<ContentBox title={LogisticsInfo.name} id={LogisticsInfo.key}>
<FormItem hidden name="deliveryType">
<Input />
</FormItem>
<FormItem
label={DeliveryTypeLabel} >
<RenaderDeliveryType />
</FormItem>
<FormItem label={LogisticsCarNoLabel} name="executorVO.carNumbers">
<Input disabled={true} />
</FormItem>
<FormItem label={LogisticsCompanyLabel} name="logisticsCompanyInt">
<LogisticsCompanyMerchantsSelect disabled={true} />
</FormItem>
<FormItem label={LogisticsNoLabel}
rules={[
{
max: 20
}
]}
name="logisticsNo">
<Input maxLength={20} disabled={true} />
</FormItem>
</ContentBox>
<ContentBox title={HarvestMaterial.name} id={HarvestMaterial.key} cols={1}>
<HarvestMaterialContextProvider value={{
dataSource: tableDataSource
}}>
<Table
rowKey={row => row.orderNo}
columns={
[
...DeliveryNoticeTableColumn
, {
...DeliveryNumColumn,
render: (t, rcode, index) => {
return (
<HarvestMaterialInput
value={rcode[OrderNumColumn.key]}
index={index}
keyUp="deliveryCount"
/>
)
}
}
]}
dataSource={tableDataSource}
/>
</HarvestMaterialContextProvider>
</ContentBox>
<ContentBox className='mt-15' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
columns={[
...ExternalRoamRecordTableColumn,
]}
rowKey="id"
dataSource={outerHistoryList}
/>
</ContentBox>
</Form>
</AnchorPage>
)
}
export default DeliveryNoteAddForm
\ No newline at end of file
......@@ -70,11 +70,11 @@ const DeliveryNoteDetails: React.FC = () => {
</ListInfoItem>
<ListInfoItem label='送货人'>
{info?.deliverVO?.consignee}
{info?.executorVO?.consignee}
</ListInfoItem>
<ListInfoItem label='送货电话'>
{info?.deliverVO?.phone}
{info?.executorVO?.phone}
</ListInfoItem>
</ListInfo>
......
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