Merge branch 'master' of codeup.aliyun.com:5f9118049cffa29cfdd3be1c/marketing/frontend
This commit is contained in:
commit
1b26c39b4d
|
@ -40,40 +40,7 @@ export default class adduserinfo extends React.Component{
|
||||||
|
|
||||||
componentDidMount(e){
|
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()
|
this.getProductInfo()
|
||||||
|
|
||||||
}
|
}
|
||||||
//获取直连天下商品映射信息
|
//获取直连天下商品映射信息
|
||||||
getProductInfo(){
|
getProductInfo(){
|
||||||
|
@ -104,6 +71,39 @@ export default class adduserinfo extends React.Component{
|
||||||
})
|
})
|
||||||
console.log(arr)
|
console.log(arr)
|
||||||
this.setState({"productOption":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)=>{
|
},(err)=>{
|
||||||
})
|
})
|
||||||
|
@ -359,7 +359,7 @@ export default class adduserinfo extends React.Component{
|
||||||
maxAmount={1}
|
maxAmount={1}
|
||||||
onChange={(e)=>{this.onUploadChange(e)}}
|
onChange={(e)=>{this.onUploadChange(e)}}
|
||||||
onUpload={this.onUpload}
|
onUpload={this.onUpload}
|
||||||
defaultFileList={this.state.model.show_url}
|
defaultFileList={this.state.model.show_url}
|
||||||
value={this.state.model.show_url}
|
value={this.state.model.show_url}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
@ -372,7 +372,7 @@ export default class adduserinfo extends React.Component{
|
||||||
onChange={(e)=>{this.onUploadChange1(e)}}
|
onChange={(e)=>{this.onUploadChange1(e)}}
|
||||||
onUpload={this.onUpload}
|
onUpload={this.onUpload}
|
||||||
defaultFileList={this.state.model.describe_url}
|
defaultFileList={this.state.model.describe_url}
|
||||||
value={this.state.model.describe_url}
|
value={this.state.model.describe_url}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
|
@ -274,9 +274,9 @@ export default class exchangedit extends React.Component{
|
||||||
let visible = await this.refs.product.submit()
|
let visible = await this.refs.product.submit()
|
||||||
if(visible)
|
if(visible)
|
||||||
{
|
{
|
||||||
Notify.success("保存成功")
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.setState({drawerVisible2:false})
|
this.setState({drawerVisible2:false})
|
||||||
|
setTimeout(()=>{
|
||||||
|
|
||||||
let data = JSON.parse(sessionStorage.getItem("productData"));
|
let data = JSON.parse(sessionStorage.getItem("productData"));
|
||||||
this.setState({tempdata:data })
|
this.setState({tempdata:data })
|
||||||
let arr = [];
|
let arr = [];
|
||||||
|
|
|
@ -171,9 +171,8 @@ export default class acclist extends React.Component{
|
||||||
let visible = await this.refs.product.submit()
|
let visible = await this.refs.product.submit()
|
||||||
if(visible)
|
if(visible)
|
||||||
{
|
{
|
||||||
Notify.success("保存成功")
|
this.setState({drawerVisible2:false})
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.setState({drawerVisible2:false})
|
|
||||||
console.log(sessionStorage.getItem("productData"));
|
console.log(sessionStorage.getItem("productData"));
|
||||||
let data = JSON.parse(sessionStorage.getItem("productData"));
|
let data = JSON.parse(sessionStorage.getItem("productData"));
|
||||||
this.setState({tempdata:data })
|
this.setState({tempdata:data })
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Link } from "react-router-dom";
|
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 "./list.less"
|
||||||
import { Switch } from 'zent';
|
import { Switch } from 'zent';
|
||||||
import "../../../assets/comm.css"
|
import "../../../assets/comm.css"
|
||||||
|
@ -10,7 +10,7 @@ import Grid from "../../../components/gird/main.js"
|
||||||
import TabPage from "../../../components/tabPage/main.js"
|
import TabPage from "../../../components/tabPage/main.js"
|
||||||
import Filterbar from "../../../components/filterbar/main.js"
|
import Filterbar from "../../../components/filterbar/main.js"
|
||||||
import menu from "../../../assets/enum.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";
|
import _ from "lodash";
|
||||||
const Column = [
|
const Column = [
|
||||||
{
|
{
|
||||||
|
@ -116,6 +116,8 @@ export default class acclist extends React.Component{
|
||||||
distdata3:[],
|
distdata3:[],
|
||||||
distdata11:[],
|
distdata11:[],
|
||||||
tableHeight:600,
|
tableHeight:600,
|
||||||
|
email:"",
|
||||||
|
phone:"",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,17 +286,29 @@ componentWillMount(){
|
||||||
this.setState({tableHeight:window.innerHeight-390});
|
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){
|
menuItemClick(e,key,row){
|
||||||
console.log(key)
|
console.log(key)
|
||||||
|
let self =this
|
||||||
if(key == 1)
|
if(key == 1)
|
||||||
{
|
{
|
||||||
let data ={
|
let data ={
|
||||||
"type":"sms"
|
"type":"sms"
|
||||||
}
|
}
|
||||||
|
|
||||||
planSend(row.id,data).then((res)=>{
|
planResend(row.id,data).then((res)=>{
|
||||||
handelResponse(res,(req,msg)=>{
|
handelResponse(res,(req,msg)=>{
|
||||||
|
|
||||||
Notify.success("更改状态成功")
|
Notify.success("更改状态成功")
|
||||||
|
@ -310,7 +324,7 @@ componentWillMount(){
|
||||||
"type":"email"
|
"type":"email"
|
||||||
}
|
}
|
||||||
|
|
||||||
planSend(row.id,data).then((res)=>{
|
planResend(row.id,data).then((res)=>{
|
||||||
handelResponse(res,(req,msg)=>{
|
handelResponse(res,(req,msg)=>{
|
||||||
|
|
||||||
Notify.success("更改状态成功")
|
Notify.success("更改状态成功")
|
||||||
|
@ -328,14 +342,11 @@ componentWillMount(){
|
||||||
closeBtn:true,
|
closeBtn:true,
|
||||||
dialogId: 1, // id is used to close the dialog
|
dialogId: 1, // id is used to close the dialog
|
||||||
title: '请输入接收邮箱',
|
title: '请输入接收邮箱',
|
||||||
children: <Input placeholder="请输入接收邮箱" onChange={(e)=>{
|
children: <Input placeholder="请输入接收邮箱" onChange={self.emailChange}></Input>,
|
||||||
email = e.target.value
|
|
||||||
|
|
||||||
}}></Input>,
|
|
||||||
footer: <Button onClick={() => {
|
footer: <Button onClick={() => {
|
||||||
|
|
||||||
console.log(email)
|
|
||||||
if(email=="")
|
if(self.state.email=="")
|
||||||
{
|
{
|
||||||
Notify.error("接收邮箱不能为空")
|
Notify.error("接收邮箱不能为空")
|
||||||
return
|
return
|
||||||
|
@ -345,14 +356,14 @@ componentWillMount(){
|
||||||
let plan_id = row.id
|
let plan_id = row.id
|
||||||
let data ={
|
let data ={
|
||||||
type:"email",
|
type:"email",
|
||||||
to: email
|
to: self.state.email
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
putKeyEmail(plan_id,data).then((res)=>{
|
putKeyEmail(plan_id,data).then((res)=>{
|
||||||
handelResponse(res,(req,msg)=>{
|
handelResponse(res,(req,msg)=>{
|
||||||
Notify.success("发送成功")
|
Notify.success("发送成功")
|
||||||
this.closeDialog(1)
|
closeDialog(1)
|
||||||
},(err)=>{
|
},(err)=>{
|
||||||
Notify.error(err)
|
Notify.error(err)
|
||||||
})
|
})
|
||||||
|
@ -376,12 +387,10 @@ componentWillMount(){
|
||||||
closeBtn:true,
|
closeBtn:true,
|
||||||
dialogId: 2, // id is used to close the dialog
|
dialogId: 2, // id is used to close the dialog
|
||||||
title: '请输入接收手机',
|
title: '请输入接收手机',
|
||||||
children: <Input placeholder="请输入接收手机号" onChange={(e)=>{
|
children: <Input placeholder="请输入接收手机号" onChange={self.phoneChange}></Input>,
|
||||||
phone = e.target.phone
|
|
||||||
}}></Input>,
|
|
||||||
footer: <Button onClick={
|
footer: <Button onClick={
|
||||||
()=>{
|
()=>{
|
||||||
if(phone=="")
|
if(self.state.phone=="")
|
||||||
{
|
{
|
||||||
Notify.error("接收手机号不能为空")
|
Notify.error("接收手机号不能为空")
|
||||||
return
|
return
|
||||||
|
@ -389,20 +398,19 @@ componentWillMount(){
|
||||||
let plan_id = row.id
|
let plan_id = row.id
|
||||||
let data ={
|
let data ={
|
||||||
type:"sms",
|
type:"sms",
|
||||||
to: phone
|
to: self.state.phone
|
||||||
}
|
}
|
||||||
console.log(phone)
|
|
||||||
|
|
||||||
putKeyEmail(plan_id,data).then((res)=>{
|
putKeyEmail(plan_id,data).then((res)=>{
|
||||||
handelResponse(res,(req,msg)=>{
|
handelResponse(res,(req,msg)=>{
|
||||||
Notify.success("发送成功")
|
Notify.success("发送成功")
|
||||||
this.closeDialog(1)
|
closeDialog(2)
|
||||||
},(err)=>{
|
},(err)=>{
|
||||||
Notify.error(err)
|
Notify.error(err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
this.closeDialog(1)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}>发送</Button>,
|
}>发送</Button>,
|
||||||
|
|
|
@ -135,7 +135,7 @@ export default class adduserinfo extends React.Component{
|
||||||
|
|
||||||
|
|
||||||
onUploadChange(files){
|
onUploadChange(files){
|
||||||
if(files[0].file)
|
if(files&&files[0].file)
|
||||||
{
|
{
|
||||||
let formdata= new FormData();
|
let formdata= new FormData();
|
||||||
formdata.append("file",files[0].file)
|
formdata.append("file",files[0].file)
|
||||||
|
|
Loading…
Reference in New Issue