diff --git a/src/pages/exchangecode/commodity/goodedit.js b/src/pages/exchangecode/commodity/goodedit.js index cb7c7fef..6a649db8 100644 --- a/src/pages/exchangecode/commodity/goodedit.js +++ b/src/pages/exchangecode/commodity/goodedit.js @@ -40,40 +40,7 @@ export default class adduserinfo extends React.Component{ componentDidMount(e){ //获取商品信息 - - let product_id = sessionStorage.getItem("dataInfo"); - let code_batch_id = sessionStorage.getItem("code_id") - - getCodeProduct(code_batch_id,product_id).then(res=>{ - handelResponse(res,(req,msg)=>{ - let temp ={ //数据模型不可少 - id:req.product_id, - type:req.product_type, - contract_price:req.contract_price, - official_price:req.official_price, - cost_price:req.cost_price, - stock:req.quantity, - name:req.product_name, - show_url:[{src:req.show_url[0]}], - describe_url: [{src:req.describe_url[0]}] , - } - - let sel_item = this.state.productOption.find((o)=>{ - return o.key == temp.id - }) - - this.setState({cur_product:sel_item}) - this.setState({model:temp}) - - },(err)=>{ - - }) - }).catch(err=>{ - }); - - this.getProductInfo() - } //获取直连天下商品映射信息 getProductInfo(){ @@ -104,6 +71,39 @@ export default class adduserinfo extends React.Component{ }) console.log(arr) this.setState({"productOption":arr}) + + + let product_id = sessionStorage.getItem("dataInfo"); + let code_batch_id = sessionStorage.getItem("code_id") + + getCodeProduct(code_batch_id,product_id).then(res=>{ + handelResponse(res,(req,msg)=>{ + let temp ={ //数据模型不可少 + id:req.product_id, + type:req.product_type, + contract_price:req.contract_price, + official_price:req.official_price, + cost_price:req.cost_price, + stock:req.quantity, + name:req.product_name, + show_url:[{src:req.show_url[0]}], + describe_url: [{src:req.describe_url[0]}] , + } + + let sel_item = this.state.productOption.find((o)=>{ + return o.key == temp.id + }) + + this.setState({cur_product:sel_item}) + this.setState({model:temp}) + + },(err)=>{ + + }) + }).catch(err=>{ + }); + + },(err)=>{ }) @@ -359,7 +359,7 @@ export default class adduserinfo extends React.Component{ maxAmount={1} onChange={(e)=>{this.onUploadChange(e)}} onUpload={this.onUpload} - defaultFileList={this.state.model.show_url} + defaultFileList={this.state.model.show_url} value={this.state.model.show_url} /> @@ -372,7 +372,7 @@ export default class adduserinfo extends React.Component{ onChange={(e)=>{this.onUploadChange1(e)}} onUpload={this.onUpload} defaultFileList={this.state.model.describe_url} - value={this.state.model.describe_url} + value={this.state.model.describe_url} /> diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index bd83852c..f5e9314a 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -274,9 +274,9 @@ export default class exchangedit extends React.Component{ let visible = await this.refs.product.submit() if(visible) { - Notify.success("保存成功") - setTimeout(()=>{ this.setState({drawerVisible2:false}) + setTimeout(()=>{ + let data = JSON.parse(sessionStorage.getItem("productData")); this.setState({tempdata:data }) let arr = []; diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index eb102c05..d735d84c 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -171,9 +171,8 @@ export default class acclist extends React.Component{ let visible = await this.refs.product.submit() if(visible) { - Notify.success("保存成功") + this.setState({drawerVisible2:false}) setTimeout(()=>{ - this.setState({drawerVisible2:false}) console.log(sessionStorage.getItem("productData")); let data = JSON.parse(sessionStorage.getItem("productData")); this.setState({tempdata:data }) diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index 1f645d74..cfe65422 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -1,7 +1,7 @@ import ReactDOM from 'react-dom'; import React, { Component } from 'react'; import { Link } from "react-router-dom"; -import {Input,openDialog,Notify,Menu, MenuItem,Button,Tag,Sweetalert,CombinedDateRangePicker,Dropdown,DropdownPosition,DropdownClickTrigger,Icon,DropdownContent} from 'zent'; +import {Input,openDialog,closeDialog,Notify,Menu, MenuItem,Button,Tag,Sweetalert,CombinedDateRangePicker,Dropdown,DropdownPosition,DropdownClickTrigger,Icon,DropdownContent} from 'zent'; import "./list.less" import { Switch } from 'zent'; import "../../../assets/comm.css" @@ -10,7 +10,7 @@ import Grid from "../../../components/gird/main.js" import TabPage from "../../../components/tabPage/main.js" import Filterbar from "../../../components/filterbar/main.js" import menu from "../../../assets/enum.js" -import {getKeyList,handelResponse,startOrStopKeybatch,resKeyEmail,planSend,putKeyEmail,cancelKey} from "../../../assets/api.js" +import {getKeyList,handelResponse,startOrStopKeybatch,resKeyEmail,planResend,putKeyEmail,cancelKey} from "../../../assets/api.js" import _ from "lodash"; const Column = [ { @@ -116,6 +116,8 @@ export default class acclist extends React.Component{ distdata3:[], distdata11:[], tableHeight:600, + email:"", + phone:"", } } @@ -284,17 +286,29 @@ componentWillMount(){ this.setState({tableHeight:window.innerHeight-390}); } - +phoneChange=(e)=> + { + + this.setState({"phone":e.target.value}) + + } + emailChange=(e)=> + { + + this.setState({"email":e.target.value}) + + } menuItemClick(e,key,row){ console.log(key) + let self =this if(key == 1) { let data ={ "type":"sms" } - planSend(row.id,data).then((res)=>{ + planResend(row.id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ Notify.success("更改状态成功") @@ -310,7 +324,7 @@ componentWillMount(){ "type":"email" } - planSend(row.id,data).then((res)=>{ + planResend(row.id,data).then((res)=>{ handelResponse(res,(req,msg)=>{ Notify.success("更改状态成功") @@ -328,14 +342,11 @@ componentWillMount(){ closeBtn:true, dialogId: 1, // id is used to close the dialog title: '请输入接收邮箱', - children: { - email = e.target.value - - }}>, + children: , footer: , diff --git a/src/pages/plan/product/add.js b/src/pages/plan/product/add.js index 100e6ef3..f9ee0cb0 100644 --- a/src/pages/plan/product/add.js +++ b/src/pages/plan/product/add.js @@ -135,7 +135,7 @@ export default class adduserinfo extends React.Component{ onUploadChange(files){ - if(files[0].file) + if(files&&files[0].file) { let formdata= new FormData(); formdata.append("file",files[0].file)