Commit b60cfb09 authored by LeeJiancong's avatar LeeJiancong

修改部分状态-查看,收货编辑

parent 121eb5d0
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-24 19:48:44
* @LastEditTime: 2020-07-24 20:42:21
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -31,7 +31,6 @@ import korenImg from '../../../../../mockStatic/koren.png'
import us from '../../../../../mockStatic/us.png'
const _width: number = 24
const _height: number = 17
const { location } = history
interface countryItem {
name: string,
key: string,
......@@ -102,8 +101,8 @@ const diaLogForm: React.FC<ListProps> = (props) => {
*/
const formSubmit = (values) => {
console.log(values)
let id = location.query.id //0新建
let type = location.query.type //'1' 发货 '2'收货
let id = history.location.query.id //0新建
let type = history.location.query.type //'1' 发货 '2'收货
let value = { ...values }
value.isDefault = values.isDefault ? 1 : 0
if (type == 1) {
......@@ -185,7 +184,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
})
setProvinceList(list)
})
if (id !== 0 && location.query.type == '1') {
if (id != 0 && history.location.query.type == '1') {
PublicApi.getLogisticsShipperAddressGet({ id: id.toString() }).then(res => {
if (res.code == 1000) {
let data = res.data
......@@ -205,7 +204,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}
//收货
if (id === 0 && location.query.type == '2') {
if (id != 0 && history.location.query.type == '2') {
PublicApi.getLogisticsReceiverAddressGet({ id: id.toString() }).then(res => {
if (res.code == 1000) {
let data = res.data
......@@ -295,7 +294,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
>
<FormMegaLayout labelCol={4} labelAlign="left">
{
location.query.type == '1' ?
history.location.query.type == '1' ?
<Field
required
title="发货人"
......@@ -319,7 +318,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
/>
}
<FormMegaLayout label={location.query.type == '1' ? '发货地区' : '收货地区'} grid full autoRow required>
<FormMegaLayout label={history.location.query.type == '1' ? '发货地区' : '收货地区'} grid full autoRow required>
<Field
x-mega-props={{ span: 1 }}
x-component="Select"
......
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