解决【追加key批次】提交审核时,后端提示“还有进行中的审批单”,创建/编辑成功后不需要请求审批接口

This commit is contained in:
Apple 2022-08-15 10:25:28 +08:00
parent 272b9dd921
commit bd5c9f5952
3 changed files with 33 additions and 91 deletions

View File

@ -749,21 +749,21 @@ export default class acclist extends React.Component {
handelResponse( handelResponse(
res, res,
(req, msg) => { (req, msg) => {
keyApproval(id, req.key_batch_id, data).then((res) => { // keyApproval(id, req.key_batch_id, data).then((res) => {
handelResponse( // handelResponse(
res, // res,
(req, msg) => { // (req, msg) => {
Notify.success('成功发起审批') Notify.success(res.message)
setTimeout(() => { setTimeout(() => {
// this.props.history.push('/home/key-list/') // this.props.history.push('/home/key-list/')
window.history.back() window.history.back()
}, 2000) }, 2000)
}, // },
(err) => { // (err) => {
Notify.error(err) // Notify.error(err)
} // }
) // )
}) // })
}, },
(err) => { (err) => {
Notify.error(err) Notify.error(err)

View File

@ -100,9 +100,7 @@ const getAccountList = () => {
setTimeout(() => { setTimeout(() => {
props.history.replace("/home/plan-list"); props.history.replace("/home/plan-list");
}, 1000); }, 1000);
console.log(104,market);
} else { } else {
console.log(104,market);
try { try {
menuList.forEach((item) => { menuList.forEach((item) => {

View File

@ -700,7 +700,6 @@ export default class acclist extends React.Component {
//除了创建中 编辑key //除了创建中 编辑key
if (this.state.isEdit) { if (this.state.isEdit) {
debugger
this.setState({ audit_visible: false }) this.setState({ audit_visible: false })
let approval_id = sessionStorage.getItem('approval_id') let approval_id = sessionStorage.getItem('approval_id')
if (approval_id > 0) { if (approval_id > 0) {
@ -806,20 +805,20 @@ export default class acclist extends React.Component {
handelResponse( handelResponse(
res, res,
(req, msg) => { (req, msg) => {
keyApproval(this.state.plan_id, id, data).then((res) => { // keyApproval(this.state.plan_id, id, data).then((res) => {
handelResponse( // handelResponse(
res, // res,
(req, msg) => { // (req, msg) => {
Notify.success('成功发起审批') Notify.success(res.message)
setTimeout(() => { setTimeout(() => {
this.props.history.push('/home/key-list/') this.props.history.push('/home/key-list/')
}, 2000) }, 2000)
}, // },
(err) => { // (err) => {
Notify.error(err) // Notify.error(err)
} // }
) // )
}) // })
}, },
(err) => { (err) => {
Notify.error(err) Notify.error(err)
@ -827,30 +826,6 @@ export default class acclist extends React.Component {
) )
}) })
} }
// putKeyBatchDetail(id,data).then((res)=>{
// handelResponse(res,(req,msg)=>{
// Notify.success("成功发起审批");
// setTimeout(()=>{
// window.history.back()
// },1000);
// },(err)=>{
// Notify.error(err)
// })
// })
// keyApproval(this.state.plan_id,id,data).then((res)=>{
// handelResponse(res,(req,msg)=>{
// Notify.success("成功发起审批");
// setTimeout(()=>{
// this.props.history.push('/home/key-list/');
// },2000)
// },(err)=>{
// Notify.error(err);
// })
// })
} }
} else { } else {
//创建中 编辑key //创建中 编辑key
@ -890,20 +865,20 @@ export default class acclist extends React.Component {
handelResponse( handelResponse(
res, res,
(req, msg) => { (req, msg) => {
keyApproval(this.state.plan_id, id, data).then((res) => { // keyApproval(this.state.plan_id, id, data).then((res) => {
handelResponse( // handelResponse(
res, // res,
(req, msg) => { // (req, msg) => {
Notify.success('成功发起审批') Notify.success(res.message)
setTimeout(() => { setTimeout(() => {
this.props.history.push('/home/key-list/') this.props.history.push('/home/key-list/')
}, 2000) }, 2000)
}, // },
(err) => { // (err) => {
Notify.error(err) // Notify.error(err)
} // }
) // )
}) // })
}, },
(err) => { (err) => {
Notify.error(err) Notify.error(err)
@ -934,37 +909,6 @@ export default class acclist extends React.Component {
}) })
} }
} }
// if(this.refs.form1.validator())
// {
// let data = {};
// data.batch_name = this.state.model.batch_name;
// data.style = this.state.model.style;
// data.quantity = this.state.model.quantity;
// data.bind_object = this.state.checkedList;
// data.allow_repetition = this.state.model.allow_repetition;
// data.allow_loss = this.state.model.allow_loss;
// data.merge_stock = this.state.model.merge_stock;
// data.code_batch = this.refs.bindObj.getSelectData();
// if(data.code_batch.length == 0)
// {
// Notify.error("请绑定对象")
// return
// }
// let id = sessionStorage.getItem("key_plan_id")
// addKeysBatchInfo(id,data).then((res)=>{
// handelResponse(res,(req,msg)=>{
// Notify.success("成功发起审批");
// setTimeout(()=>{
// window.history.back()
// },1000);
// },(err)=>{
// })
// })
// }
//}
} }
onBindNum(e, row) { onBindNum(e, row) {