fix: 修复流程中当发起流程时,如果没有草稿时,后端接口报错的BUG,此处在前端页面增加判断逻辑防止如果没有草稿数据时接口报错的BUG

This commit is contained in:
zyd
2022-07-13 22:22:25 +08:00
parent b9ca214c0f
commit 32370c07e7
4 changed files with 74 additions and 57 deletions
@@ -373,20 +373,23 @@
this.foldFormFlag = !this.foldFormFlag
},
getData () {
const queryId = this.$route.query.bpnId
if(queryId !== null && queryId !== undefined && queryId !==''){
queryTaskFirst({
bpnId: this.$route.query.bpnId
bpnId: this.$route.query.bpnId
}).then(res => {
this.bpnId = this.$route.query.bpnId
let mes = JSON.parse(res.mes)
if (mes.form.date) {
mes.form.date = new Date(this.$moment(mes.form.date).format('YYYY-MM-DD'))
} else {
mes.form.date = ''
}
this.form = mes.form
this.roleForm = mes.roleForm
this.commentText1 = mes.commentText1 || ''
this.bpnId = this.$route.query.bpnId
let mes = JSON.parse(res.mes)
if (mes.form.date) {
mes.form.date = new Date(this.$moment(mes.form.date).format('YYYY-MM-DD'))
} else {
mes.form.date = ''
}
this.form = mes.form
this.roleForm = mes.roleForm
this.commentText1 = mes.commentText1 || ''
})
}
},
checkedRole2 (data) {
var idList = ''
@@ -597,9 +600,11 @@
let taskId = {
id: this.$route.query.bpnId
}
taskDel(taskId).then(res=>{
if(taskId !=='' && taskId !== undefined && taskId !== null){
taskDel(taskId).then(res=>{
return res
})
})
}
this.$router.push('/processCenter')
}
this.isSubmit = false
@@ -589,9 +589,11 @@ export default {
let taskId = {
id: this.$route.query.bpnId
}
taskDel(taskId).then(res=>{
return res
})
if(taskId !== '' && taskId !== undefined && taskId !== null){
taskDel(taskId).then(res=>{
return res
})
}
this.$router.push('/processCenter')
}
this.isSubmit = false
@@ -862,22 +862,25 @@
this.itermsConditionsTitle = row.replace(/''/g, '\'')
},
getData () {
const queryId =this.$route.query.bpnId
if(queryId !== null && queryId !== undefined && queryId !==''){
queryTaskFirst({
bpnId: this.$route.query.bpnId
bpnId: this.$route.query.bpnId
}).then(res => {
let mes = JSON.parse(res.mes)
this.bpnId = this.$route.query.bpnId
if (mes.form.date) {
mes.form.date = new Date(this.$moment(mes.form.date).format('YYYY-MM-DD'))
} else {
mes.form.date = ''
}
this.form = mes.form
this.roleForm = mes.roleForm
this.commentText1 = mes.commentText1 || ''
this.itemList = mes.itemList
this.sarType = mes.sarType
let mes = JSON.parse(res.mes)
this.bpnId = this.$route.query.bpnId
if (mes.form.date) {
mes.form.date = new Date(this.$moment(mes.form.date).format('YYYY-MM-DD'))
} else {
mes.form.date = ''
}
this.form = mes.form
this.roleForm = mes.roleForm
this.commentText1 = mes.commentText1 || ''
this.itemList = mes.itemList
this.sarType = mes.sarType
})
}
},
setMap(data){
data.forEach(item => {
@@ -1136,9 +1139,11 @@
let taskId = {
id: this.$route.query.bpnId
}
if(taskId !== '' && taskId !== undefined && taskId !== null){
taskDel(taskId).then(res=>{
return res
return res
})
}
this.$router.push('/processCenter')
}
})
@@ -661,30 +661,33 @@ export default {
window.open(routeUrl.href, '_blank')
},
getData() {
queryTaskFirst({
bpnId: this.$route.query.bpnId
}).then(res => {
let mes = JSON.parse(res.mes)
console.log(mes);
this.bpnId = this.$route.query.bpnId
if (mes.form.endTime) {
mes.form.endTime = new Date(this.$moment(mes.form.endTime).format('YYYY-MM-DD'))
} else {
mes.form.endTime = ''
}
this.addFjList = mes.filesId || mes.form.filesId || ''
this.form.fjListName = mes.filesName
this.form = mes.form
this.roleForm = mes.roleForm
this.commentText1 = mes.commentText1 || ''
if (this.form.standId) {
this.$http.get('SarStandItems/sar-stand-items/getFileTypeHG', {
standId: this.form.standId
}, {}, res => {
this.textTypeList = res.data
})
}
})
const queryId = this.$route.query.bpnId
if(queryId !== null && queryId !== undefined && queryId !==''){
queryTaskFirst({
bpnId: this.$route.query.bpnId
}).then(res => {
let mes = JSON.parse(res.mes)
console.log(mes);
this.bpnId = this.$route.query.bpnId
if (mes.form.endTime) {
mes.form.endTime = new Date(this.$moment(mes.form.endTime).format('YYYY-MM-DD'))
} else {
mes.form.endTime = ''
}
this.addFjList = mes.filesId || mes.form.filesId || ''
this.form.fjListName = mes.filesName
this.form = mes.form
this.roleForm = mes.roleForm
this.commentText1 = mes.commentText1 || ''
if (this.form.standId) {
this.$http.get('SarStandItems/sar-stand-items/getFileTypeHG', {
standId: this.form.standId
}, {}, res => {
this.textTypeList = res.data
})
}
})
}
},
addZqyjList() {
this.title = '国内外标准库'
@@ -860,9 +863,11 @@ export default {
let taskId = {
id: this.$route.query.bpnId
}
taskDel(taskId).then(res=>{
return res
})
if(taskId !== '' && taskId !== undefined && taskId !== null){
taskDel(taskId).then(res=>{
return res
})
}
this.$router.push('/processCenter')
}
})