审批调整细节
This commit is contained in:
parent
364d2d6c30
commit
74c72edc35
|
@ -1012,7 +1012,6 @@ export default class exchangedit extends React.Component{
|
||||||
<div className="audit">
|
<div className="audit">
|
||||||
<div className="modal"> </div>
|
<div className="modal"> </div>
|
||||||
<div className="audit-box" >
|
<div className="audit-box" >
|
||||||
<Icon type="close" className="audit-close" onClick={(e)=>{this.setState({approvalLoading:false})}} />
|
|
||||||
<div className="audit-box-title">撤销审批中</div>
|
<div className="audit-box-title">撤销审批中</div>
|
||||||
<div className="audit-box-txt">
|
<div className="audit-box-txt">
|
||||||
正在发起撤销...,请等待 <span style={{color:"red"}}> {this.state.timer}</span> 秒
|
正在发起撤销...,请等待 <span style={{color:"red"}}> {this.state.timer}</span> 秒
|
||||||
|
|
|
@ -7,7 +7,7 @@ import Step1 from "./step1.js"
|
||||||
import Step2 from "./step2.js"
|
import Step2 from "./step2.js"
|
||||||
import Step3 from "./step3.js"
|
import Step3 from "./step3.js"
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import {addPlanStep,handelResponse,getReseller,planSend,getDraftInfo,putPlanStep,uploadImg,getApprovalsInfo,approvals,terminateApprovals,getApprovalsStatus} from "../../../assets/api.js"
|
import {getThemeChoice,addPlanStep,handelResponse,getReseller,planSend,getDraftInfo,putPlanStep,uploadImg,getApprovalsInfo,approvals,terminateApprovals,getApprovalsStatus} from "../../../assets/api.js"
|
||||||
|
|
||||||
export default class add extends React.Component{
|
export default class add extends React.Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
|
@ -42,6 +42,7 @@ export default class add extends React.Component{
|
||||||
payment_direction:["对私账户","对公账户","预付款扣除"],
|
payment_direction:["对私账户","对公账户","预付款扣除"],
|
||||||
approvalLoading:false,
|
approvalLoading:false,
|
||||||
timer:3,
|
timer:3,
|
||||||
|
theme_options:[]
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +80,7 @@ export default class add extends React.Component{
|
||||||
let approval_id = sessionStorage.getItem("approval_id")
|
let approval_id = sessionStorage.getItem("approval_id")
|
||||||
|
|
||||||
//获取审批接口的编辑信息
|
//获取审批接口的编辑信息
|
||||||
if(approval_id !=0)
|
if(approval_id > 0)
|
||||||
{
|
{
|
||||||
getApprovalsInfo(approval_id).then((res)=>{
|
getApprovalsInfo(approval_id).then((res)=>{
|
||||||
handelResponse(res,(req,msg)=>{
|
handelResponse(res,(req,msg)=>{
|
||||||
|
@ -110,10 +111,26 @@ export default class add extends React.Component{
|
||||||
},500)
|
},500)
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
if(req.theme)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
let theme_data ={
|
||||||
|
|
||||||
|
theme_id:req.theme.theme_id,
|
||||||
|
use:req.theme.theme_data.use,
|
||||||
|
link:req.theme.theme_data.link,
|
||||||
|
list:req.theme.theme_data.list
|
||||||
|
|
||||||
|
}
|
||||||
|
this.getThemeData();
|
||||||
|
console.log("样式数据",theme_data)
|
||||||
|
this.setState({step3_data:theme_data})
|
||||||
this.setState({card_visible : true})
|
this.setState({card_visible : true})
|
||||||
|
this.setState({curstep:3})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},(err)=>{
|
},(err)=>{
|
||||||
Notify.error(err)
|
Notify.error(err)
|
||||||
})
|
})
|
||||||
|
@ -296,6 +313,23 @@ export default class add extends React.Component{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getThemeData(){
|
||||||
|
|
||||||
|
getThemeChoice().then((res)=>{
|
||||||
|
handelResponse(res,(req,msg)=>{
|
||||||
|
let arr = _.map(req,(o)=>{
|
||||||
|
let obj = {};
|
||||||
|
obj.key = o.id;
|
||||||
|
obj.text = o.title
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
|
||||||
|
this.setState({theme_options:arr})
|
||||||
|
},(err)=>{
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
addNewkey(){
|
addNewkey(){
|
||||||
let step = "step2-" + this.state.keys.length
|
let step = "step2-" + this.state.keys.length
|
||||||
this.state.keys.push(step)
|
this.state.keys.push(step)
|
||||||
|
@ -535,7 +569,7 @@ export default class add extends React.Component{
|
||||||
this.state.card_visible ? (
|
this.state.card_visible ? (
|
||||||
<div id="step3" className="step3">
|
<div id="step3" className="step3">
|
||||||
<Card style={{ width:'100%',height:"auto" }} title={this.state.step3_pagetitle}>
|
<Card style={{ width:'100%',height:"auto" }} title={this.state.step3_pagetitle}>
|
||||||
<Step3 ref="step3" data={this.state.step3_data} disabled={this.state.disabled} />
|
<Step3 ref="step3" data={this.state.step3_data} options={this.state.theme_options} disabled={this.state.disabled} />
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
) : null
|
) : null
|
||||||
|
@ -565,7 +599,7 @@ export default class add extends React.Component{
|
||||||
<div className="audit">
|
<div className="audit">
|
||||||
<div className="modal"> </div>
|
<div className="modal"> </div>
|
||||||
<div className="audit-box" >
|
<div className="audit-box" >
|
||||||
<Icon type="close" className="audit-close" onClick={(e)=>{this.onReturn(e)}} />
|
<Icon type="close" className="audit-close" onClick={(e)=>{this.setState({audit_visible:false})}} />
|
||||||
<div className="audit-box-title">提交审核</div>
|
<div className="audit-box-title">提交审核</div>
|
||||||
<div className="payType">
|
<div className="payType">
|
||||||
|
|
||||||
|
@ -577,7 +611,7 @@ export default class add extends React.Component{
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div className="audit-btn-group">
|
<div className="audit-btn-group">
|
||||||
<Button onClick={(e)=>{this.onReturn(e)}}>取消</Button>
|
<Button onClick={(e)=>{this.setState({audit_visible:false})}}>取消</Button>
|
||||||
<Button type="primary" onClick={(e)=>{this.onConfirm(e)}} >确定</Button>
|
<Button type="primary" onClick={(e)=>{this.onConfirm(e)}} >确定</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -615,11 +649,11 @@ export default class add extends React.Component{
|
||||||
<div className="audit">
|
<div className="audit">
|
||||||
<div className="modal"> </div>
|
<div className="modal"> </div>
|
||||||
<div className="audit-box" >
|
<div className="audit-box" >
|
||||||
<Icon type="close" className="audit-close" onClick={(e)=>{this.onReturn(e)}} />
|
|
||||||
<div className="audit-box-title">撤销审批中</div>
|
<div className="audit-box-title">撤销审批中</div>
|
||||||
<div className="audit-box-txt">
|
<div className="audit-box-txt">
|
||||||
正在发起撤销...,请等待{this.state.timer}秒
|
正在发起撤销...,请等待<span style={{color:"red"}}> {this.state.timer}</span>秒
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
):null
|
):null
|
||||||
|
|
|
@ -15,20 +15,30 @@ const TabPanel = Tabs.TabPanel;
|
||||||
export default class acclist extends React.Component{
|
export default class acclist extends React.Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props)
|
super(props)
|
||||||
|
console.log(props)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.state={
|
this.state={
|
||||||
model:{ //数据模型不可少
|
model:{ //数据模型不可少
|
||||||
"theme_id": "",
|
"theme_id":"",
|
||||||
"list": 2,
|
"list": 2,
|
||||||
"use": 1,
|
"use": 1,
|
||||||
"link": 3,
|
"link": 3,
|
||||||
},
|
},
|
||||||
options:[]
|
select_theme:null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount(e){
|
componentDidMount(e){
|
||||||
|
|
||||||
this.getThemeData();
|
this.getThemeData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +54,19 @@ export default class acclist extends React.Component{
|
||||||
})
|
})
|
||||||
|
|
||||||
this.setState({options:arr})
|
this.setState({options:arr})
|
||||||
|
|
||||||
|
if(this.props.data && this.props.data.theme_id)
|
||||||
|
{
|
||||||
|
this.setState({theme_id:this.props.data.theme_id})
|
||||||
|
|
||||||
|
let selctobj = this.state.options.find(o=>o.key == this.props.data.theme_id)
|
||||||
|
|
||||||
|
let model = this.state.model;
|
||||||
|
model.theme_id = selctobj
|
||||||
|
this.setState({model:model})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},(err)=>{
|
},(err)=>{
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -101,7 +124,7 @@ export default class acclist extends React.Component{
|
||||||
edit(data)
|
edit(data)
|
||||||
{
|
{
|
||||||
let model={ //数据模型不可少
|
let model={ //数据模型不可少
|
||||||
"theme_id": data.theme_id,
|
"theme_id":192 ,
|
||||||
"list": data.list,
|
"list": data.list,
|
||||||
"use": data.use,
|
"use": data.use,
|
||||||
"link": data.link
|
"link": data.link
|
||||||
|
|
|
@ -121,26 +121,30 @@ export default class acclist extends React.Component{
|
||||||
temp.push(req.code_batch[i])
|
temp.push(req.code_batch[i])
|
||||||
}
|
}
|
||||||
//获取审批单信息
|
//获取审批单信息
|
||||||
getApprovalsInfo(approval_id).then((res)=>{
|
if(approval_id > 0)
|
||||||
handelResponse(res,(req,msg)=>{
|
{
|
||||||
|
getApprovalsInfo(approval_id).then((res)=>{
|
||||||
|
handelResponse(res,(req,msg)=>{
|
||||||
|
|
||||||
for(let i = 0;i < req.code_batch.length;i++)
|
for(let i = 0;i < req.code_batch.length;i++)
|
||||||
{
|
{
|
||||||
let code_batch = req.code_batch[i];
|
let code_batch = req.code_batch[i];
|
||||||
let range = []
|
let range = []
|
||||||
for(let j = 0;j < code_batch.product.length;j++)
|
for(let j = 0;j < code_batch.product.length;j++)
|
||||||
{
|
{
|
||||||
let product = code_batch.product[j];
|
let product = code_batch.product[j];
|
||||||
range.push(product.product_name)
|
range.push(product.product_name)
|
||||||
}
|
}
|
||||||
req.code_batch[i].disabled = false
|
req.code_batch[i].disabled = false
|
||||||
req.code_batch[i].checked = false
|
req.code_batch[i].checked = false
|
||||||
code_batch.range = range.toString();
|
code_batch.range = range.toString();
|
||||||
temp.push(req.code_batch[i])
|
temp.push(req.code_batch[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
let model = {
|
let model = {
|
||||||
style: req.style,
|
style: req.style,
|
||||||
|
@ -478,25 +482,31 @@ export default class acclist extends React.Component{
|
||||||
|
|
||||||
|
|
||||||
onReCall(){
|
onReCall(){
|
||||||
|
|
||||||
let approval_id = sessionStorage.getItem("approval_id")
|
let approval_id = sessionStorage.getItem("approval_id")
|
||||||
this.setState({recall_visible:false})
|
this.setState({recall_visible:false})
|
||||||
terminateApprovals(approval_id).then((res)=>{
|
if(approval_id > 0)
|
||||||
handelResponse(res,(req,msg)=>{
|
{
|
||||||
this.setState({approvalLoading:true})
|
terminateApprovals(approval_id).then((res)=>{
|
||||||
let timer_c = setInterval(()=>{
|
handelResponse(res,(req,msg)=>{
|
||||||
console.log(this.state.timer)
|
this.setState({approvalLoading:true})
|
||||||
if(this.state.timer <= 0)
|
let timer_c = setInterval(()=>{
|
||||||
{
|
console.log(this.state.timer)
|
||||||
clearInterval(timer_c)
|
if(this.state.timer <= 0)
|
||||||
this.setState({approvalLoading:false})
|
{
|
||||||
}
|
clearInterval(timer_c)
|
||||||
let time = this.state.timer - 1;
|
this.setState({approvalLoading:false})
|
||||||
this.setState({timer:time})
|
}
|
||||||
},1000)
|
let time = this.state.timer - 1;
|
||||||
},(err)=>{
|
this.setState({timer:time})
|
||||||
Notify.error(err)
|
},1000)
|
||||||
})
|
},(err)=>{
|
||||||
})
|
Notify.error(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(){
|
onSubmit(){
|
||||||
|
@ -508,60 +518,88 @@ export default class acclist extends React.Component{
|
||||||
onConfirm(){
|
onConfirm(){
|
||||||
if(this.state.isEdit)
|
if(this.state.isEdit)
|
||||||
{
|
{
|
||||||
this.setState({audit_visible:false})
|
this.setState({audit_visible:false})
|
||||||
let approval_id = sessionStorage.getItem("approval_id")
|
let approval_id = sessionStorage.getItem("approval_id")
|
||||||
getApprovalsStatus(approval_id).then((res)=>{
|
if(approval_id > 0)
|
||||||
handelResponse(res,(req,msg)=>{
|
{
|
||||||
if(req.status == 0)
|
getApprovalsStatus(approval_id).then((res)=>{
|
||||||
{
|
handelResponse(res,(req,msg)=>{
|
||||||
this.setState({recall_visible:true})
|
if(req.status == 0)
|
||||||
}
|
{
|
||||||
if(req.status == 1)
|
this.setState({recall_visible:true})
|
||||||
{
|
|
||||||
Notify.error("进行中的批次不能提交审核")
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.props.history.push('/home/key-list/');
|
|
||||||
},2000)
|
|
||||||
|
|
||||||
}
|
|
||||||
if(req.status == 2 || req.status == 3){
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let selection = this.refs.bindObj.getSelectData()
|
|
||||||
console.log("选中对象")
|
|
||||||
console.log(selection)
|
|
||||||
let formdata = selection.filter((item)=>{
|
|
||||||
return !item.hasOwnProperty("disabled") || item.disabled == false
|
|
||||||
})
|
|
||||||
|
|
||||||
let id = sessionStorage.getItem("keybatch_id")
|
|
||||||
let data = {
|
|
||||||
code_batch:formdata,
|
|
||||||
"reseller_id":this.state.reseller.id,
|
|
||||||
"reseller_name":this.state.reseller.name,
|
|
||||||
"company_name":this.state.reseller.company_name,
|
|
||||||
"receive_email":this.state.reseller.contact_email[0],
|
|
||||||
"payment_direction":this.state.payment_direction[this.state.paytype - 1],
|
|
||||||
}
|
}
|
||||||
putKeyBatchDetail(id,data).then((res)=>{
|
if(req.status == 1)
|
||||||
handelResponse(res,(req,msg)=>{
|
{
|
||||||
Notify.success("更新key成功");
|
Notify.error("进行中的批次不能提交审核")
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
window.history.back()
|
this.props.history.push('/home/key-list/');
|
||||||
},1000);
|
},2000)
|
||||||
},(err)=>{
|
|
||||||
Notify.error(err)
|
}
|
||||||
})
|
if(req.status == 2 || req.status == 3){
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
let selection = this.refs.bindObj.getSelectData()
|
||||||
|
console.log("选中对象")
|
||||||
|
console.log(selection)
|
||||||
|
let formdata = selection.filter((item)=>{
|
||||||
|
return !item.hasOwnProperty("disabled") || item.disabled == false
|
||||||
|
})
|
||||||
|
|
||||||
|
let id = sessionStorage.getItem("keybatch_id")
|
||||||
|
let data = {
|
||||||
|
code_batch:formdata,
|
||||||
|
"reseller_id":this.state.reseller.id,
|
||||||
|
"reseller_name":this.state.reseller.name,
|
||||||
|
"company_name":this.state.reseller.company_name,
|
||||||
|
"receive_email":this.state.reseller.contact_email[0],
|
||||||
|
"payment_direction":this.state.payment_direction[this.state.paytype - 1],
|
||||||
|
}
|
||||||
|
putKeyBatchDetail(id,data).then((res)=>{
|
||||||
|
handelResponse(res,(req,msg)=>{
|
||||||
|
Notify.success("更新key成功");
|
||||||
|
setTimeout(()=>{
|
||||||
|
window.history.back()
|
||||||
|
},1000);
|
||||||
|
},(err)=>{
|
||||||
|
Notify.error(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},(err)=>{
|
||||||
|
Notify.error(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let selection = this.refs.bindObj.getSelectData()
|
||||||
|
console.log("选中对象")
|
||||||
|
console.log(selection)
|
||||||
|
let formdata = selection.filter((item)=>{
|
||||||
|
return !item.hasOwnProperty("disabled") || item.disabled == false
|
||||||
|
})
|
||||||
|
|
||||||
|
let id = sessionStorage.getItem("keybatch_id")
|
||||||
|
let data = {
|
||||||
|
code_batch:formdata,
|
||||||
|
"reseller_id":this.state.reseller.id,
|
||||||
|
"reseller_name":this.state.reseller.name,
|
||||||
|
"company_name":this.state.reseller.company_name,
|
||||||
|
"receive_email":this.state.reseller.contact_email[0],
|
||||||
|
"payment_direction":this.state.payment_direction[this.state.paytype - 1],
|
||||||
|
}
|
||||||
|
putKeyBatchDetail(id,data).then((res)=>{
|
||||||
|
handelResponse(res,(req,msg)=>{
|
||||||
|
Notify.success("更新key成功");
|
||||||
|
setTimeout(()=>{
|
||||||
|
window.history.back()
|
||||||
|
},1000);
|
||||||
},(err)=>{
|
},(err)=>{
|
||||||
Notify.error(err)
|
Notify.error(err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(this.refs.form1.validator())
|
if(this.refs.form1.validator())
|
||||||
|
@ -1246,7 +1284,7 @@ export default class acclist extends React.Component{
|
||||||
<div className="audit">
|
<div className="audit">
|
||||||
<div className="modal"> </div>
|
<div className="modal"> </div>
|
||||||
<div className="audit-box" >
|
<div className="audit-box" >
|
||||||
<Icon type="close" className="audit-close" onClick={(e)=>{this.onReturn(e)}} />
|
<Icon type="close" className="audit-close" onClick={(e)=>{this.setState({audit_visible:false})}} />
|
||||||
<div className="audit-box-title">提交审核</div>
|
<div className="audit-box-title">提交审核</div>
|
||||||
<div className="payType">
|
<div className="payType">
|
||||||
|
|
||||||
|
@ -1258,7 +1296,7 @@ export default class acclist extends React.Component{
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div className="audit-btn-group">
|
<div className="audit-btn-group">
|
||||||
<Button onClick={(e)=>{this.onReturn(e)}}>取消</Button>
|
<Button onClick={(e)=>{this.setState({audit_visible:false})}}>取消</Button>
|
||||||
<Button type="primary" onClick={(e)=>{this.onConfirm(e)}} >确定</Button>
|
<Button type="primary" onClick={(e)=>{this.onConfirm(e)}} >确定</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1298,7 +1336,7 @@ export default class acclist extends React.Component{
|
||||||
<Icon type="close" className="audit-close" onClick={(e)=>{this.setState({approvalLoading:false})}} />
|
<Icon type="close" className="audit-close" onClick={(e)=>{this.setState({approvalLoading:false})}} />
|
||||||
<div className="audit-box-title">撤销审批中</div>
|
<div className="audit-box-title">撤销审批中</div>
|
||||||
<div className="audit-box-txt">
|
<div className="audit-box-txt">
|
||||||
正在发起撤销...,请等待{this.state.timer}秒
|
正在发起撤销...,请等待<span style={{color:"red"}}> {this.state.timer}</span>秒
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue