diff --git a/anrui-scm/anrui-scm-ui/src/views/ruzhang/ruzhangguanli/ruzhangAdd.vue b/anrui-scm/anrui-scm-ui/src/views/ruzhang/ruzhangguanli/ruzhangAdd.vue index 458d8c20d2..955fbc7aa0 100644 --- a/anrui-scm/anrui-scm-ui/src/views/ruzhang/ruzhangguanli/ruzhangAdd.vue +++ b/anrui-scm/anrui-scm-ui/src/views/ruzhang/ruzhangguanli/ruzhangAdd.vue @@ -5,7 +5,7 @@
{{ viewTitle }}
保存 - 提交 + 提交 关闭
@@ -743,7 +743,6 @@ export default { if (valid) { this.submitdisabled = true req.saveOrUpdate(this.formobj).then((resp) => { - this.submitdisabled = false if (resp.success) { this.$message({ showClose: true, type: 'success', message: '保存成功' }) this.handleReturn('true') @@ -812,28 +811,42 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { - req.submitVehicleApply(this.formobj).then((res) => { - if (res.success) { - this.$message({ - showClose: true, - type: 'success', - message: '提交成功' + this.$refs['form_obj'].validate(valid => { + if (valid) { + this.submitdisabled = true + req.submitVehicleApply(this.formobj).then((res) => { + if (res.success) { + this.$message({ + showClose: true, + type: 'success', + message: '提交成功' + }) + this.handleReturn('true') + } + }).catch(() => { + this.submitdisabled = false }) - this.handleReturn('true') } }) }).catch(() => { hint = 0 }) } else { - req.submitVehicleApply(this.formobj).then((res) => { - if (res.success) { - this.$message({ - showClose: true, - type: 'success', - message: '提交成功' + this.$refs['form_obj'].validate(valid => { + if (valid) { + this.submitdisabled = true + req.submitVehicleApply(this.formobj).then((res) => { + if (res.success) { + this.$message({ + showClose: true, + type: 'success', + message: '提交成功' + }) + this.handleReturn('true') + } + }).catch(() => { + this.submitdisabled = false }) - this.handleReturn('true') } }) } @@ -843,6 +856,7 @@ export default { if (isreload === 'true') this.$emit('reloadlist') this.$refs['form_obj'].resetFields() this.imgList = [] + this.submitdisabled = false this.$emit('doback') } } diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/ruzhangguanliFlow/ruzhangguanli/ruzhangEdit.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/ruzhangguanliFlow/ruzhangguanli/ruzhangEdit.vue index f3810a9c41..e388e3c89c 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/ruzhangguanliFlow/ruzhangguanli/ruzhangEdit.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/ruzhangguanliFlow/ruzhangguanli/ruzhangEdit.vue @@ -5,7 +5,7 @@
{{ viewTitle }}
保存 - 提交 + 提交
@@ -757,7 +757,6 @@ export default { if (valid) { this.submitdisabled = true req.saveOrUpdate(this.formobj).then((resp) => { - this.submitdisabled = false /* this.$message({ showClose: true, type: 'success', @@ -838,42 +837,56 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { - req.submitVehicleApply(this.formobj).then((res) => { - if (res.success) { - this.$message({ - showClose: true, - type: 'success', - message: '提交成功' - }) - // 子页面向父级页面传递值(关闭弹框) - window.parent.postMessage({ - cmd: 'returnHeight', - params: { - // 操作成功,告诉父级页面关闭弹框 - code: 1 + this.$refs['form_obj'].validate(valid => { + if (valid) { + this.submitdisabled = true + req.submitVehicleApply(this.formobj).then((res) => { + if (res.success) { + this.$message({ + showClose: true, + type: 'success', + message: '提交成功' + }) + // 子页面向父级页面传递值(关闭弹框) + window.parent.postMessage({ + cmd: 'returnHeight', + params: { + // 操作成功,告诉父级页面关闭弹框 + code: 1 + } + }, '*') } - }, '*') + }).catch(() => { + this.submitdisabled = false + }) } }) }).catch(() => { hint = 0 }) } else { - req.submitVehicleApply(this.formobj).then((res) => { - if (res.success) { - this.$message({ - showClose: true, - type: 'success', - message: '提交成功' - }) - // 子页面向父级页面传递值(关闭弹框) - window.parent.postMessage({ - cmd: 'returnHeight', - params: { - // 操作成功,告诉父级页面关闭弹框 - code: 1 + this.$refs['form_obj'].validate(valid => { + if (valid) { + this.submitdisabled = true + req.submitVehicleApply(this.formobj).then((res) => { + if (res.success) { + this.$message({ + showClose: true, + type: 'success', + message: '提交成功' + }) + // 子页面向父级页面传递值(关闭弹框) + window.parent.postMessage({ + cmd: 'returnHeight', + params: { + // 操作成功,告诉父级页面关闭弹框 + code: 1 + } + }, '*') } - }, '*') + }).catch(() => { + this.submitdisabled = false + }) } }) }