|
@@ -894,6 +894,12 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ 'loading': {
|
|
|
+ handler (newVal) {
|
|
|
+ this.$emit('changeLoading', newVal)
|
|
|
+ this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -1055,11 +1061,12 @@
|
|
|
this.doSubmit('save', callback)
|
|
|
},
|
|
|
startForm (callback) {
|
|
|
+ this.loading = true
|
|
|
// 如果uscCode是空的或者uscCode的数据不存在,再执行保存方法
|
|
|
if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
|
|
|
this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
|
|
|
this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
|
|
|
- if (data.use === 'false' || uscCode.data === this.inputForm.uscCode) {
|
|
|
+ if (data.use === 'false' || uscCode.data.uscCode === this.inputForm.uscCode) {
|
|
|
this.uscCodeMessage = ''
|
|
|
this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
|
|
|
this.workClientService.queryNameById(this.inputForm.id).then((name) => {
|
|
@@ -1068,12 +1075,14 @@
|
|
|
this.nameMessage = ''
|
|
|
} else {
|
|
|
this.nameMessage = '该客户已存在'
|
|
|
+ this.loading = false
|
|
|
throw new Error()
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
|
this.uscCodeMessage = '该客户已存在'
|
|
|
+ this.loading = false
|
|
|
throw new Error()
|
|
|
}
|
|
|
})
|
|
@@ -1085,6 +1094,7 @@
|
|
|
this.startFormTrue(callback)
|
|
|
this.nameMessage = ''
|
|
|
} else {
|
|
|
+ this.loading = false
|
|
|
this.nameMessage = '该客户已存在'
|
|
|
throw new Error()
|
|
|
}
|
|
@@ -1093,28 +1103,39 @@
|
|
|
}
|
|
|
},
|
|
|
startFormTrue (callback) {
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.cwWorkClientBillingDTOList)) {
|
|
|
- this.$message.error('“开票信息”中至少有一条数据')
|
|
|
- throw new Error('“开票信息”中至少有一条数据')
|
|
|
- } else {
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.updateRequestId)) {
|
|
|
- this.workClientService.pushUpdate(this.inputForm.id).then(({data}) => {
|
|
|
- this.inputForm.updateRequestId = data.id
|
|
|
- this.doSubmit('start', callback)
|
|
|
- })
|
|
|
+ this.loading = true
|
|
|
+ this.workClientService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '0' && data.status !== '1' && data.status !== '3' && data.status !== '5') { // 审核状态不是“未发起”或“暂存”或“撤回”或“已完成”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
} else {
|
|
|
- this.workClientService.rebackPushUpdate(this.inputForm.id).then(() => {
|
|
|
- this.doSubmit('start', callback)
|
|
|
- })
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwWorkClientBillingDTOList)) {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('“开票信息”中至少有一条数据')
|
|
|
+ throw new Error('“开票信息”中至少有一条数据')
|
|
|
+ } else {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.updateRequestId)) {
|
|
|
+ this.workClientService.pushUpdate(this.inputForm.id).then(({data}) => {
|
|
|
+ this.inputForm.updateRequestId = data.id
|
|
|
+ this.doSubmit('start', callback)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.workClientService.rebackPushUpdate(this.inputForm.id).then(() => {
|
|
|
+ this.doSubmit('start', callback)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
},
|
|
|
reapplyForm (callback) {
|
|
|
+ this.loading = true
|
|
|
// 如果uscCode是空的或者uscCode的数据不存在,再执行保存方法
|
|
|
if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
|
|
|
this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
|
|
|
this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
|
|
|
- if (data.use === 'false' || uscCode.data === this.inputForm.uscCode) {
|
|
|
+ if (data.use === 'false' || uscCode.data.uscCode === this.inputForm.uscCode) {
|
|
|
this.uscCodeMessage = ''
|
|
|
this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
|
|
|
this.workClientService.queryNameById(this.inputForm.id).then((name) => {
|
|
@@ -1122,12 +1143,14 @@
|
|
|
this.reapplyFormTrue(callback)
|
|
|
this.nameMessage = ''
|
|
|
} else {
|
|
|
+ this.loading = false
|
|
|
this.nameMessage = '该客户已存在'
|
|
|
throw new Error()
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
|
+ this.loading = false
|
|
|
this.uscCodeMessage = '该客户已存在'
|
|
|
throw new Error()
|
|
|
}
|
|
@@ -1140,6 +1163,7 @@
|
|
|
this.reapplyFormTrue(callback)
|
|
|
this.nameMessage = ''
|
|
|
} else {
|
|
|
+ this.loading = false
|
|
|
this.nameMessage = '该客户已存在'
|
|
|
throw new Error()
|
|
|
}
|
|
@@ -1148,12 +1172,15 @@
|
|
|
}
|
|
|
},
|
|
|
reapplyFormTrue (callback) {
|
|
|
+ this.loading = true
|
|
|
this.workClientService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
} else {
|
|
|
if (this.commonJS.isEmpty(this.inputForm.cwWorkClientBillingDTOList)) {
|
|
|
+ this.loading = false
|
|
|
this.$message.error('“开票信息”中至少有一条数据')
|
|
|
throw new Error('“开票信息”中至少有一条数据')
|
|
|
} else {
|
|
@@ -1163,8 +1190,10 @@
|
|
|
})
|
|
|
},
|
|
|
async agreeForm (callback) {
|
|
|
+ this.loading = true
|
|
|
await this.workClientService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '2') { // 审核状态不是“待审核”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
} else {
|
|
@@ -1227,6 +1256,7 @@
|
|
|
if (status === 'reapply') {
|
|
|
this.workClientService.reapplyUpdate(data.businessId)
|
|
|
}
|
|
|
+ this.inputForm.id = data.businessId
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.loading = false
|
|
|
}).catch(() => {
|
|
@@ -1236,6 +1266,7 @@
|
|
|
})
|
|
|
},
|
|
|
updateStatusById (type, callback) {
|
|
|
+ this.loading = true
|
|
|
if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
@@ -1243,6 +1274,7 @@
|
|
|
if (type === 'reject' || type === 'reback') {
|
|
|
this.workClientService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -1252,6 +1284,7 @@
|
|
|
let param = {status: '4', id: this.inputForm.id}
|
|
|
this.workClientService.updateStatusById(param).then(() => {
|
|
|
this.workClientService.rejectUpdate(this.inputForm.id)
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
}
|
|
@@ -1260,6 +1293,7 @@
|
|
|
let param = {status: '3', id: this.inputForm.id}
|
|
|
this.workClientService.updateStatusById(param).then(() => {
|
|
|
this.workClientService.rebackUpdate(this.inputForm.id)
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
}
|
|
@@ -1268,12 +1302,14 @@
|
|
|
} else if (type === 'hold') {
|
|
|
this.workClientService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
|
// 终止
|
|
|
this.workClientService.stopUpdate(this.inputForm.id).then(() => {
|
|
|
callback()
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -1359,6 +1395,7 @@
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.uscCodeMessage = ''
|
|
|
this.nameMessage = ''
|
|
|
+ this.loading = false
|
|
|
},
|
|
|
tabHandleClick (event) {
|
|
|
this.tableKeyBilling = Math.random()
|
|
@@ -1682,7 +1719,7 @@
|
|
|
if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
|
|
|
this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
|
|
|
this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
|
|
|
- if (data.use !== 'false' && this.commonJS.isNotEmpty(data.use) && this.commonJS.isNotEmpty(data.id) && this.inputForm.uscCode !== uscCode.data) {
|
|
|
+ if (data.use !== 'false' && this.commonJS.isNotEmpty(data.use) && this.commonJS.isNotEmpty(data.id) && this.inputForm.uscCode !== uscCode.data.uscCode) {
|
|
|
this.uscCodeMessage = '该客户已存在'
|
|
|
if (data.isUpdate === 'false') {
|
|
|
this.$message.error('该客户信息已存在并且数据正在修改中')
|