按钮loading-标准调研流程

This commit is contained in:
zyn
2023-11-06 11:20:32 +08:00
parent dda0b8c60c
commit ebda3b0bea
9 changed files with 74 additions and 8 deletions
@@ -542,6 +542,7 @@ export default {
}, },
handleSave() { handleSave() {
this.saveLoading = true this.saveLoading = true
this.isSubmit = true
let _formData = new FormData() let _formData = new FormData()
_formData.append('id', this.bpnId || '') _formData.append('id', this.bpnId || '')
_formData.append('createUser', this.$store.getters.userInfo.userId) _formData.append('createUser', this.$store.getters.userInfo.userId)
@@ -556,8 +557,9 @@ export default {
this.saveLoading = false this.saveLoading = false
this.$message.success('保存成功') this.$message.success('保存成功')
this.bpnId = res.result this.bpnId = res.result
}).catch(e => { }).finally(() => {
this.saveLoading = false this.saveLoading = false
this.isSubmit = false
}) })
}, },
handleSubmit() { handleSubmit() {
@@ -566,6 +568,7 @@ export default {
this.$refs['Form'].validate((valid) => { this.$refs['Form'].validate((valid) => {
if (valid) { if (valid) {
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
this.$http.post('lawss/activiti/startProcessRollBack', { this.$http.post('lawss/activiti/startProcessRollBack', {
createUser: this.$store.getters.userInfo.userId, createUser: this.$store.getters.userInfo.userId,
createUserName: this.$store.getters.userInfo.userName, createUserName: this.$store.getters.userInfo.userName,
@@ -597,9 +600,11 @@ export default {
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
}) })
} else { } else {
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
this.$message.warning('流程启动失败') this.$message.warning('流程启动失败')
} }
}) })
@@ -256,6 +256,8 @@
this.drawerModal = true this.drawerModal = true
}, },
checkedRole (data) { checkedRole (data) {
this.saveLoading = true
this.isSubmit = true
changeAssigneeNew({ changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人 userId:this.$store.getters.userInfo.userId, // 委托人
@@ -270,6 +272,9 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.saveLoading = false
this.isSubmit = false
}) })
}, },
// 请求转换流程图 // 请求转换流程图
@@ -324,6 +329,7 @@
}, },
handleSave() { handleSave() {
this.saveLoading = true this.saveLoading = true
this.isSubmit = true
let _formData = new FormData() let _formData = new FormData()
_formData.append('taskIds', this.taskIds) _formData.append('taskIds', this.taskIds)
_formData.append('json', JSON.stringify({ _formData.append('json', JSON.stringify({
@@ -331,16 +337,17 @@
commentText2: this.commentText2, commentText2: this.commentText2,
})) }))
saveTaskForPub(_formData).then(res => { saveTaskForPub(_formData).then(res => {
this.saveLoading = false
this.$message.success('保存成功') this.$message.success('保存成功')
}).catch(e => { }).finally(() => {
this.saveLoading = false this.saveLoading = false
this.isSubmit = false
}) })
}, },
handleSubmit() { handleSubmit() {
this.$refs['qbkwForm'].validate((valid) => { this.$refs['qbkwForm'].validate((valid) => {
if (valid) { if (valid) {
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
var json = this.json var json = this.json
json.commentText = this.commentText2 json.commentText = this.commentText2
json.responUserList = this.form.responUserList json.responUserList = this.form.responUserList
@@ -355,6 +362,7 @@
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
}) })
} else { } else {
return this.$message.warning('请完善基础信息') return this.$message.warning('请完善基础信息')
@@ -328,6 +328,8 @@
this.drawerModal = true this.drawerModal = true
}, },
checkedRole (data) { checkedRole (data) {
this.saveLoading = true
this.isSubmit = true
changeAssigneeNew({ changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人 userId:this.$store.getters.userInfo.userId, // 委托人
@@ -342,6 +344,9 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.saveLoading = false
this.isSubmit = false
}) })
}, },
// 请求转换流程图 // 请求转换流程图
@@ -429,6 +434,7 @@
}, },
handleSave() { handleSave() {
this.saveLoading = true this.saveLoading = true
this.isSubmit = true
let _formData = new FormData() let _formData = new FormData()
_formData.append('taskIds', this.taskIds) _formData.append('taskIds', this.taskIds)
_formData.append('json', JSON.stringify({ _formData.append('json', JSON.stringify({
@@ -437,15 +443,16 @@
commentText3: this.commentText3, commentText3: this.commentText3,
})) }))
saveTaskForPub(_formData).then(res => { saveTaskForPub(_formData).then(res => {
this.saveLoading = false
this.$message.success('保存成功') this.$message.success('保存成功')
}).catch(e => { }).finally(() => {
this.saveLoading = false this.saveLoading = false
this.isSubmit = false
}) })
}, },
// 接受按钮 // 接受按钮
handleAccept(){ handleAccept(){
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
execTask({ execTask({
todoId: this.todoId // 当前节点ID todoId: this.todoId // 当前节点ID
}).then(res => { }).then(res => {
@@ -453,6 +460,8 @@
this.$message.success('接收成功') this.$message.success('接收成功')
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
}).finally(() => {
this.saveLoading = false
this.isSubmit = false this.isSubmit = false
}) })
}, },
@@ -461,6 +470,7 @@
if (valid) { if (valid) {
this.json.dyhz = this.form.dyhz this.json.dyhz = this.form.dyhz
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
var json = this.json var json = this.json
json.commentText = this.commentText3 json.commentText = this.commentText3
json.fileId = this.form.fileId json.fileId = this.form.fileId
@@ -476,6 +486,7 @@
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
}) })
} else { } else {
return this.$message.warning('请完善基础信息') return this.$message.warning('请完善基础信息')
@@ -210,6 +210,7 @@
show-submit show-submit
:submitLoading="isSubmit" :submitLoading="isSubmit"
:saveLoading="saveLoading" :saveLoading="saveLoading"
:isSubmitBack="isSubmit"
@submit="handleSubmit" @submit="handleSubmit"
show-back show-back
@back="handleSubmitNo" @back="handleSubmitNo"
@@ -304,6 +305,8 @@
this.drawerModal = true this.drawerModal = true
}, },
checkedRole (data) { checkedRole (data) {
this.isSubmit = true
this.saveLoading = true
changeAssigneeNew({ changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人 userId:this.$store.getters.userInfo.userId, // 委托人
@@ -318,6 +321,9 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.isSubmit = false
this.saveLoading = false
}) })
}, },
// 请求转换流程图 // 请求转换流程图
@@ -355,6 +361,7 @@
}, },
handleSubmit() { // 同意 handleSubmit() { // 同意
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
var json = this.json var json = this.json
json.actionFlag = 0 json.actionFlag = 0
json.commentText = this.commentText4 json.commentText = this.commentText4
@@ -368,11 +375,13 @@
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
}) })
}, },
handleSubmitNo() { handleSubmitNo() {
if (this.commentText4) { if (this.commentText4) {
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
var json = this.json var json = this.json
json.actionFlag = 1 json.actionFlag = 1
json.commentText = this.commentText4 json.commentText = this.commentText4
@@ -386,6 +395,7 @@
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
}) })
} else { } else {
this.$message.warning('请输入审批意见') this.$message.warning('请输入审批意见')
@@ -299,6 +299,8 @@
this.drawerModal = true this.drawerModal = true
}, },
checkedRole (data) { checkedRole (data) {
this.saveLoading = true
this.isSubmit = true
changeAssigneeNew({ changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人 userId:this.$store.getters.userInfo.userId, // 委托人
@@ -313,6 +315,9 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.saveLoading = false
this.isSubmit = false
}) })
}, },
// 请求转换流程图 // 请求转换流程图
@@ -387,6 +392,7 @@
}, },
handleSave() { handleSave() {
this.saveLoading = true this.saveLoading = true
this.isSubmit = true
let json = this.form let json = this.form
json.responUserList = this.tableData json.responUserList = this.tableData
this.form.docUser = this.newDocUser this.form.docUser = this.newDocUser
@@ -399,14 +405,16 @@
saveTaskForPub(_formData).then(res => { saveTaskForPub(_formData).then(res => {
this.saveLoading = false this.saveLoading = false
this.$message.success('保存成功') this.$message.success('保存成功')
}).catch(e => { }).finally(() => {
this.saveLoading = false this.saveLoading = false
this.isSubmit = false
}) })
}, },
handleSubmit() { handleSubmit() {
this.$refs['qbkwForm'].validate((valid) => { this.$refs['qbkwForm'].validate((valid) => {
if (valid) { if (valid) {
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
let json = this.jsonData let json = this.jsonData
json.commentText = this.commentText5 json.commentText = this.commentText5
json.hzfileId = this.form.hzfileId json.hzfileId = this.form.hzfileId
@@ -423,6 +431,7 @@
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
}) })
} }
}) })
@@ -202,6 +202,7 @@
@back="handleSubmitNo" @back="handleSubmitNo"
:submitLoading="isSubmit" :submitLoading="isSubmit"
:saveLoading="saveLoading" :saveLoading="saveLoading"
:isSubmitBack="isSubmit"
show-transfer show-transfer
@transfer="handleTransfer" @transfer="handleTransfer"
@submit="handleSubmit" @submit="handleSubmit"
@@ -294,6 +295,8 @@
this.drawerModal = true this.drawerModal = true
}, },
checkedRole (data) { checkedRole (data) {
this.saveLoading = true
this.isSubmit = true
changeAssigneeNew({ changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人 userId:this.$store.getters.userInfo.userId, // 委托人
@@ -308,6 +311,9 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.saveLoading = false
this.isSubmit = false
}) })
}, },
// 请求转换流程图 // 请求转换流程图
@@ -382,6 +388,7 @@
}, },
handleSubmit() { handleSubmit() {
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
var json = this.json var json = this.json
json.actionFlag = 0 json.actionFlag = 0
json.commentText = this.commentText6 json.commentText = this.commentText6
@@ -395,11 +402,13 @@
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
}) })
}, },
handleSubmitNo() { handleSubmitNo() {
if (this.commentText6) { if (this.commentText6) {
this.isSubmit = true this.isSubmit = true
this.saveLoading = true
var json = this.json var json = this.json
json.actionFlag = 1 json.actionFlag = 1
json.commentText = this.commentText6 json.commentText = this.commentText6
@@ -413,6 +422,7 @@
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
this.saveLoading = false
}) })
} else { } else {
this.$message.warning('请输入审批意见') this.$message.warning('请输入审批意见')
@@ -201,6 +201,8 @@
approval approval
@back="handleSubmitNo" @back="handleSubmitNo"
:submitLoading="isSubmit" :submitLoading="isSubmit"
:isSubmitBack="isSubmit"
:saveLoading="isSubmit"
show-transfer show-transfer
@transfer="handleTransfer" @transfer="handleTransfer"
@submit="handleSubmit" @submit="handleSubmit"
@@ -293,6 +295,7 @@
this.drawerModal = true this.drawerModal = true
}, },
checkedRole (data) { checkedRole (data) {
this.isSubmit = true
changeAssigneeNew({ changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人 userId:this.$store.getters.userInfo.userId, // 委托人
@@ -307,6 +310,8 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.isSubmit = false
}) })
}, },
// 请求转换流程图 // 请求转换流程图
@@ -199,7 +199,8 @@
show-submit show-submit
approval approval
:submitLoading="isSubmit" :submitLoading="isSubmit"
:saveLoading="saveLoading" :saveLoading="isSubmit"
:isSubmitBack="isSubmit"
@submit="handleSubmit" @submit="handleSubmit"
show-back show-back
show-transfer show-transfer
@@ -294,6 +295,7 @@
this.drawerModal = true this.drawerModal = true
}, },
checkedRole (data) { checkedRole (data) {
this.isSubmit = true
changeAssigneeNew({ changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人 userId:this.$store.getters.userInfo.userId, // 委托人
@@ -308,6 +310,8 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.isSubmit = false
}) })
}, },
// 请求转换流程图 // 请求转换流程图
@@ -233,7 +233,8 @@
approval approval
@back="handleSubmitNo" @back="handleSubmitNo"
:submitLoading="isSubmit" :submitLoading="isSubmit"
:saveLoading="saveLoading" :saveLoading="isSubmit"
:isSubmitBack="isSubmit"
show-transfer show-transfer
@transfer="handleTransfer" @transfer="handleTransfer"
@submit="handleSubmit" @submit="handleSubmit"
@@ -337,6 +338,7 @@
this.drawerModal = true this.drawerModal = true
}, },
checkedRole (data) { checkedRole (data) {
this.isSubmit = true
changeAssigneeNew({ changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人 userId:this.$store.getters.userInfo.userId, // 委托人
@@ -351,6 +353,8 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.isSubmit = false
}) })
}, },
// 请求转换流程图 // 请求转换流程图