| | |
| | | cancelButtonText: "不生成", |
| | | type: "success", |
| | | distinguishCancelAndClose: true, |
| | | }).then(() => { |
| | | this.$axios.post(this.$api.insReport.isReport, { |
| | | id:row.id, |
| | | state:1 |
| | | }).then(res => { |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.$message.success("已生成") |
| | | this.refreshTable() |
| | | }).catch(err => { |
| | | |
| | | console.log(err) |
| | | }) |
| | | }).catch((e) => { |
| | | console.log(e) |
| | | if(e=='cancel'){ |
| | | beforeClose: (action, instance, done) => { |
| | | if (action === 'confirm') { |
| | | instance.confirmButtonLoading = true; |
| | | this.$axios.post(this.$api.insReport.isReport, { |
| | | id:row.id, |
| | | state:1 |
| | | }).then(res => { |
| | | instance.confirmButtonLoading = false; |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.$message.success("已生成") |
| | | this.refreshTable() |
| | | done(); |
| | | }).catch(err => { |
| | | console.log(err) |
| | | instance.confirmButtonLoading = false; |
| | | }) |
| | | } else if(action === 'cancel'){ |
| | | instance.cancelButtonLoading = true; |
| | | this.$axios.post(this.$api.insReport.isReport, { |
| | | id:row.id, |
| | | state:0 |
| | | }).then(res => { |
| | | instance.cancelButtonLoading = false; |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.refreshTable() |
| | | done(); |
| | | this.$message.success("已取消生成") |
| | | }).catch(err => { |
| | | instance.cancelButtonLoading = false; |
| | | console.log(err) |
| | | }) |
| | | }else{ |
| | | done(); |
| | | } |
| | | } |
| | | }).then(() => { |
| | | |
| | | }).catch((e) => { |
| | | console.log(e) |
| | | }) |
| | | } |
| | | } |