Update add.js
This commit is contained in:
parent
5f69e61f1e
commit
107b2059e3
|
@ -171,8 +171,6 @@ export default class acclist extends React.Component{
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let codeInfo= { //数据模型不可少
|
let codeInfo= { //数据模型不可少
|
||||||
code_name:"",
|
code_name:"",
|
||||||
issued:'',//发放总量
|
issued:'',//发放总量
|
||||||
|
@ -320,17 +318,11 @@ export default class acclist extends React.Component{
|
||||||
this.setState({drawerVisible2:true})
|
this.setState({drawerVisible2:true})
|
||||||
}
|
}
|
||||||
async productSubmit(){
|
async productSubmit(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let visible = await this.refs.product.submit()
|
let visible = await this.refs.product.submit()
|
||||||
if(visible)
|
if(visible)
|
||||||
{
|
{
|
||||||
Notify.success("保存成功")
|
Notify.success("保存成功")
|
||||||
this.setState({drawerVisible2:false})
|
this.setState({drawerVisible2:false})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
|
|
||||||
let data = JSON.parse(sessionStorage.getItem("productData"));
|
let data = JSON.parse(sessionStorage.getItem("productData"));
|
||||||
|
@ -373,13 +365,11 @@ export default class acclist extends React.Component{
|
||||||
let model2 = this.state.codeInfo;
|
let model2 = this.state.codeInfo;
|
||||||
model2.date_time = e;
|
model2.date_time = e;
|
||||||
this.setState({codeInfo:model2})
|
this.setState({codeInfo:model2})
|
||||||
console.log(this.state.codeInfo)
|
|
||||||
}
|
}
|
||||||
submit2(){
|
submit2(){
|
||||||
this.refs.form2.validator()
|
this.refs.form2.validator()
|
||||||
}
|
}
|
||||||
onRankChange(e){
|
onRankChange(e){
|
||||||
console.log(e)
|
|
||||||
_.forEach(this.state.tempdata, (item) => {
|
_.forEach(this.state.tempdata, (item) => {
|
||||||
item.checked = e.findIndex((checks)=>{return checks.key == item.product_id}) > -1;
|
item.checked = e.findIndex((checks)=>{return checks.key == item.product_id}) > -1;
|
||||||
})
|
})
|
||||||
|
@ -392,7 +382,6 @@ export default class acclist extends React.Component{
|
||||||
|
|
||||||
if(this.state.uploading )
|
if(this.state.uploading )
|
||||||
{
|
{
|
||||||
|
|
||||||
Notify.error("还有图片上传中,不可提交")
|
Notify.error("还有图片上传中,不可提交")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -403,7 +392,6 @@ export default class acclist extends React.Component{
|
||||||
_.forEach(productlist,(o)=>{
|
_.forEach(productlist,(o)=>{
|
||||||
sum += parseInt(o.quantity);
|
sum += parseInt(o.quantity);
|
||||||
})
|
})
|
||||||
console.log("总数"+sum)
|
|
||||||
if(sum < this.state.codeInfo.issued)
|
if(sum < this.state.codeInfo.issued)
|
||||||
{
|
{
|
||||||
Notify.error("所选商品库存总数小于发放量")
|
Notify.error("所选商品库存总数小于发放量")
|
||||||
|
@ -415,9 +403,6 @@ export default class acclist extends React.Component{
|
||||||
let rank = _.map(this.state.rank,(item)=>{
|
let rank = _.map(this.state.rank,(item)=>{
|
||||||
return item.text
|
return item.text
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(rank)
|
|
||||||
|
|
||||||
let tableData = this.state.distdata;
|
let tableData = this.state.distdata;
|
||||||
let temp = {
|
let temp = {
|
||||||
title:this.state.codeInfo.code_name,
|
title:this.state.codeInfo.code_name,
|
||||||
|
@ -450,20 +435,14 @@ export default class acclist extends React.Component{
|
||||||
|
|
||||||
if(this.state.rowIndex > -1)
|
if(this.state.rowIndex > -1)
|
||||||
{
|
{
|
||||||
console.log("编辑")
|
|
||||||
this.state.distdata[this.state.rowIndex] = temp;
|
this.state.distdata[this.state.rowIndex] = temp;
|
||||||
this.setState({distdata:this.state.distdata})
|
this.setState({distdata:this.state.distdata})
|
||||||
console.log(this.state.distdata)
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log("新增")
|
|
||||||
let tempdata = this.state.distdata;
|
let tempdata = this.state.distdata;
|
||||||
tempdata.push(temp)
|
tempdata.push(temp)
|
||||||
this.setState({distdata:tempdata})
|
this.setState({distdata:tempdata})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let id = sessionStorage.getItem("key_plan_id")
|
let id = sessionStorage.getItem("key_plan_id")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -873,14 +852,15 @@ export default class acclist extends React.Component{
|
||||||
})
|
})
|
||||||
console.log("重复的手机号",mobile_repeat)
|
console.log("重复的手机号",mobile_repeat)
|
||||||
this.setState({mobile_repeat:mobile_repeat})
|
this.setState({mobile_repeat:mobile_repeat})
|
||||||
|
console.log(this.state.excel_count )
|
||||||
|
console.log(this.state.error_count )
|
||||||
|
|
||||||
let model = this.state.model;
|
let model = this.state.model;
|
||||||
model.quantity = this.state.excel_count - this.state.error_count + this.state.mobile_repeat.length;
|
model.quantity = this.state.excel_count - this.state.error_count + mobile_repeat.length;
|
||||||
this.setState({model:model})
|
this.setState({model:model})
|
||||||
this.setState({accessVerify:false})
|
this.setState({accessVerify:false})
|
||||||
this.setState({excel_visible:false})
|
this.setState({excel_visible:false})
|
||||||
this.setState({import_visible:false})
|
this.setState({import_visible:false})
|
||||||
|
|
||||||
this.setState({import_success:true})
|
this.setState({import_success:true})
|
||||||
}
|
}
|
||||||
resetUpload(){
|
resetUpload(){
|
||||||
|
|
Loading…
Reference in New Issue