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

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

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