|
@@ -733,6 +733,12 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ 'loading': {
|
|
|
+ handler (newVal) {
|
|
|
+ this.$emit('changeLoading', newVal)
|
|
|
+ this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -991,10 +997,35 @@
|
|
|
// })
|
|
|
},
|
|
|
reapplyForm (callback) {
|
|
|
- this.startForm(callback)
|
|
|
+ this.loading = true
|
|
|
+ this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ startForm (callback) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
|
+ this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.type !== '0' && data.type !== '1' && data.type !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ }
|
|
|
},
|
|
|
// 送审
|
|
|
- async startForm (callback) {
|
|
|
+ async startFormTrue (callback) {
|
|
|
this.$refs['inputForm'].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
@@ -1015,6 +1046,7 @@
|
|
|
this.inputForm.type = '2'
|
|
|
this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
|
|
|
this.inputForm.title = `${this.$store.state.user.name} 发起了 [${data.no}] - [财务-报销审批]`
|
|
|
+ this.inputForm.id = data.businessId
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = false
|
|
@@ -1030,35 +1062,48 @@
|
|
|
// this.$refs.inputForm.resetFields()
|
|
|
// this.loading = false
|
|
|
// })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 通过
|
|
|
async agreeForm (callback) {
|
|
|
- this.$refs['inputForm'].validate(async (valid) => {
|
|
|
- if (valid) {
|
|
|
- this.loading = true
|
|
|
- this.submitCheck()
|
|
|
- if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
- this.loading = false
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.files)) {
|
|
|
- this.inputForm.files = []
|
|
|
- }
|
|
|
- this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
|
- this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(({data}) => {
|
|
|
- if (this.commonJS.isNotEmpty(data)) {
|
|
|
- if (data === '公司领导审批') {
|
|
|
- this.inputForm.type = '5'
|
|
|
+ this.loading = true
|
|
|
+ this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.$refs['inputForm'].validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ this.submitCheck()
|
|
|
+ if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
}
|
|
|
- }
|
|
|
- this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
|
|
|
- callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.loading = false
|
|
|
- }).catch(() => {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.files)) {
|
|
|
+ this.inputForm.files = []
|
|
|
+ }
|
|
|
+ this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
|
+ this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(({data}) => {
|
|
|
+ if (this.commonJS.isNotEmpty(data)) {
|
|
|
+ if (data === '公司领导审批') {
|
|
|
+ this.inputForm.type = '5'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
|
|
|
+ callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
this.loading = false
|
|
|
- })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -1066,15 +1111,34 @@
|
|
|
// 修改状态
|
|
|
updateStatusById (type, callback) {
|
|
|
if (type === 'reject') {
|
|
|
- this.inputForm.type = '4'
|
|
|
- this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
|
|
|
- callback()
|
|
|
+ this.loading = true
|
|
|
+ this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.inputForm.type = '4'
|
|
|
+ this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
|
|
|
+ this.loading = false
|
|
|
+ callback()
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- // this.reimbursementService.updateStatusById(this.inputForm)
|
|
|
} else if (type === 'hold') {
|
|
|
- this.inputForm.type = '1'
|
|
|
- this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
|
|
|
- callback()
|
|
|
+ this.loading = true
|
|
|
+ this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.inputForm.type = '1'
|
|
|
+ this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
|
|
|
+ this.loading = false
|
|
|
+ callback()
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|