From 2b07a6caa27320056fcaa23adb5f88d80ea13d27 Mon Sep 17 00:00:00 2001 From: zhangdingyu <974548713@qq.com> Date: Tue, 1 Jan 2019 17:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E5=8D=8F=E4=BB=BB=E5=8A=A1=E6=89=A7?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OutsourcingTaskExecution/index.vue | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) 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('编辑失败') } })