Commit 43590d64 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

修改物流管理 收货地址新增的问题

parent c81f8b34
import * as React from 'react'; import * as React from 'react';
import { useState, useRef, useEffect } from 'react'; import { useState, useRef, useEffect } from 'react';
import { Row, Col, Tooltip, Form, Input, Select, Popconfirm, Button, Card, message, Modal } from 'antd'; import { Row, Col, Form, Input, Select, Popconfirm, Button, Card } from 'antd';
import { DeleteOutlined, FormOutlined, PlusCircleOutlined, LoadingOutlined, PlusOutlined, LinkOutlined } from '@ant-design/icons'; import { LinkOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import { StandardTable } from 'god'
import { history } from 'umi' import { history } from 'umi'
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import ModalTable from '@/components/ModalTable' import ModalTable from '@/components/ModalTable'
import { PublicApi, CustomApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus' import { PageStatus } from '@/hooks/usePageStatus'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable' import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { addCompany, updateCompany, getCompanyDetail } from '@/services/logistics/index'
import style from "./addCompany.less"
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
export interface companyProps { export interface companyProps {
...@@ -64,19 +61,6 @@ const columns: ColumnType<any>[] = [ ...@@ -64,19 +61,6 @@ const columns: ColumnType<any>[] = [
align: 'center' align: 'center'
} }
] ]
// 模拟请求
// const fetchData = (params: any) => {
// return new Promise((resolve, reject) => {
// const queryResult = data.find(v => v.key === params.keywords)
// setTimeout(() => {
// resolve({
// code: 200,
// message: '',
// data: queryResult ? [queryResult] : data
// })
// }, 1000)
// })
// }
const fetchData = async (params) => { const fetchData = async (params) => {
const res = await PublicApi.getMemberManageLowerPageBynamerole(params) const res = await PublicApi.getMemberManageLowerPageBynamerole(params)
...@@ -108,6 +92,7 @@ const company: React.FC<parmas> = (props) => { ...@@ -108,6 +92,7 @@ const company: React.FC<parmas> = (props) => {
const [selectRow, setSelectRow] = useState<Item[]>([]) // 模态框选择的行数据 const [selectRow, setSelectRow] = useState<Item[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]) const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
useEffect(() => { useEffect(() => {
console.log(id, pageStatus, '100000')
let _title = pageStatus === PageStatus.PREVIEW ? '查看' : id ? '编辑' : '新建' let _title = pageStatus === PageStatus.PREVIEW ? '查看' : id ? '编辑' : '新建'
setHeaderTitle(`${_title}物流公司`) setHeaderTitle(`${_title}物流公司`)
PublicApi.getMemberManageRoleList().then(res => { PublicApi.getMemberManageRoleList().then(res => {
...@@ -136,6 +121,7 @@ const company: React.FC<parmas> = (props) => { ...@@ -136,6 +121,7 @@ const company: React.FC<parmas> = (props) => {
const handleSubmitAllSetting = () => { const handleSubmitAllSetting = () => {
menuForm.validateFields().then((values: any) => { menuForm.validateFields().then((values: any) => {
console.log(values, '嘿嘿嘿')
if (id) { if (id) {
values.id = id values.id = id
setLoading(true) setLoading(true)
...@@ -250,13 +236,9 @@ const company: React.FC<parmas> = (props) => { ...@@ -250,13 +236,9 @@ const company: React.FC<parmas> = (props) => {
(<Form (<Form
form={menuForm} form={menuForm}
colon={false} colon={false}
name="edit_infomation" name="edit_infomation"
layout="horizontal"
labelAlign="left" labelAlign="left"
autoComplete="off"
{...layout} {...layout}
> >
<Row gutter={24}> <Row gutter={24}>
<Col span={18}> <Col span={18}>
...@@ -292,7 +274,7 @@ const company: React.FC<parmas> = (props) => { ...@@ -292,7 +274,7 @@ const company: React.FC<parmas> = (props) => {
} }
]} ]}
> >
<Input disabled={isSee} className="input_addonAfter" disabled maxLength={20} addonAfter={selectBtn} /> <Input disabled={isSee} className="input_addonAfter" maxLength={20} addonAfter={selectBtn} />
</Form.Item> </Form.Item>
: :
<Form.Item <Form.Item
......
...@@ -91,7 +91,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -91,7 +91,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
*/ */
const formSubmit = (values) => { const formSubmit = (values) => {
console.log(values) console.log(values)
let id = history.location.query.id //0新建 // let id = history.location.query.id //0新建
let value = { ...values } let value = { ...values }
value.isDefault = values.isDefault ? 1 : 0 value.isDefault = values.isDefault ? 1 : 0
value.provinceCode = value.provinceCode.split('-').length > 1 ? value.provinceCode.split('-')[0] : value.provinceCode value.provinceCode = value.provinceCode.split('-').length > 1 ? value.provinceCode.split('-')[0] : value.provinceCode
...@@ -101,7 +101,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -101,7 +101,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
value.cityName = cityName value.cityName = cityName
value.districtName = districtName value.districtName = districtName
if (type == 1) { if (type == 1) {
if (id == 0) { if (!id) {
setloading(true) setloading(true)
PublicApi.postLogisticsShipperAddressAdd(value).then(res => { PublicApi.postLogisticsShipperAddressAdd(value).then(res => {
if (res.code == 1000) { if (res.code == 1000) {
...@@ -118,7 +118,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -118,7 +118,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}) })
} }
} else { } else {
if (id == 0) { if (!id) {
setloading(true) setloading(true)
PublicApi.postLogisticsReceiverAddressAdd(value).then(res => { PublicApi.postLogisticsReceiverAddressAdd(value).then(res => {
if (res.code == 1000) { if (res.code == 1000) {
...@@ -176,8 +176,8 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -176,8 +176,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
useEffect(() => { useEffect(() => {
const id = Number(history.location.query.id) const id = Number(history.location.query.id)
console.log(typeof(id)) console.log(typeof(id))
let title = id === 0 ? '新建' : '编辑' // let title = id === 0 ? '新建' : '编辑'
type === 1 ? setHeaderTitle(`${title}发货地址`) : setHeaderTitle(`${title}收货地址`) // type === 1 ? setHeaderTitle(`${title}发货地址`) : setHeaderTitle(`${title}收货地址`)
PublicApi.getManageCountryAreaGetTelCode().then(res => { PublicApi.getManageCountryAreaGetTelCode().then(res => {
res.data.forEach((item,index) => { res.data.forEach((item,index) => {
TelCodeList.push({ label: item, value: (index).toString() }) TelCodeList.push({ label: item, value: (index).toString() })
...@@ -306,7 +306,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -306,7 +306,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />} backIcon={<ReutrnEle description="返回" />}
title={headerTitle} // title={headerTitle}
> >
<Card> <Card>
<Row> <Row>
...@@ -415,7 +415,7 @@ const diaLogForm: React.FC<ListProps> = (props) => { ...@@ -415,7 +415,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
x-component="TextArea" x-component="TextArea"
x-component-props={{ x-component-props={{
placeholder: '请输入详细地址', placeholder: '请输入详细地址',
autocomplete: 'off' autoComplete: 'off'
}} }}
x-rules= {[{ x-rules= {[{
max: 30, max: 30,
......
...@@ -6,7 +6,6 @@ const AddShipingAddress:React.FC<{}> = () => { ...@@ -6,7 +6,6 @@ const AddShipingAddress:React.FC<{}> = () => {
return( return(
<AddressTemplate <AddressTemplate
type={2} type={2}
id={0}
/> />
) )
} }
......
...@@ -145,7 +145,7 @@ const detailInfo: React.FC<parmas> = (props) => { ...@@ -145,7 +145,7 @@ const detailInfo: React.FC<parmas> = (props) => {
title: '交易条件', title: '交易条件',
leftElem: [ leftElem: [
{ title: '交付日期', key: 'shipmentOrderNo', value: moment(dataInfo.deliveryTime).format('YYYY-MM-DD HH:mm:ss') }, { title: '交付日期', key: 'shipmentOrderNo', value: moment(dataInfo.deliveryTime).format('YYYY-MM-DD HH:mm:ss') },
{ title: '交付地址', key: '', value: shipperAddress }, { title: '交付地址', key: '', value: dataInfo.addres },
{ title: '物流要求', key: '', value: dataInfo.logistics } { title: '物流要求', key: '', value: dataInfo.logistics }
], ],
centerElem: [ centerElem: [
......
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