diff --git a/src/views/Outsourcing/OutsourcingTaskExecution/index.vue b/src/views/Outsourcing/OutsourcingTaskExecution/index.vue index 4dcebb5c..0f945655 100644 --- a/src/views/Outsourcing/OutsourcingTaskExecution/index.vue +++ b/src/views/Outsourcing/OutsourcingTaskExecution/index.vue @@ -768,10 +768,8 @@ export default { if (valid) { if (this.title === '增加') { this.submitAdd() - this.title = '' } else if (this.title === '编辑') { this.submitEdit() - this.title = '' } } }) @@ -781,7 +779,6 @@ export default { this.$refs['form'].resetFields() } this.title = '增加' - this.dialogFormVisible = true var time = new Date() var month = time.getMonth() + 1 var day = time.getDate() @@ -797,21 +794,29 @@ export default { }) this.form.运费 = null this.form.外协厂家 = '' + this.dialogFormVisible = true }, submitAdd() { - addTable(this.form.表单号, this.id, this.ManufactorNumber1, this.form.下达任务日期, this.form.运费).then(response => { - if (response.data[0].result === '1') { - this.$notify({ - title: '成功', - message: '信息添加成功', - type: 'success' - }) - this.dialogFormVisible = false - this.fetchData() - } else { - this.$message.error('信息添加失败') - } - }) + this.form.运费 = parseInt(this.form.运费) + if (isNaN(this.form.运费)) { + this.form.运费 = '' + this.$message.error('请输入数字') + } else { + addTable(this.form.表单号, this.id, this.ManufactorNumber1, this.form.下达任务日期, this.form.运费).then(response => { + if (response.data[0].result === '1') { + this.$notify({ + title: '成功', + message: '信息添加成功', + type: 'success' + }) + this.dialogFormVisible = false + this.title = '' + this.fetchData() + } else { + this.$message.error('信息添加失败') + } + }) + } }, getList() { if (this.partNumber !== '') { @@ -1247,6 +1252,7 @@ export default { if (response.data[0].result === '1') { this.$message.success('编辑成功') this.dialogFormVisible = false + this.title = '' this.fetchData() } else { this.$message.error('编辑失败') } })