Showing
1 changed file
with
14 additions
and
13 deletions
| ... | @@ -192,14 +192,16 @@ export default { | ... | @@ -192,14 +192,16 @@ export default { |
| 192 | showCancelButton: true, | 192 | showCancelButton: true, |
| 193 | type: "warning", | 193 | type: "warning", |
| 194 | }) | 194 | }) |
| 195 | - .then(function () { | 195 | + .then(()=> { |
| 196 | - return delFlightId(id); | 196 | + delFlightId(id) |
| 197 | + .then((res) => { | ||
| 198 | + this.$message({ | ||
| 199 | + message: res.msg, | ||
| 200 | + type: res.code === 200 ? "success" : "warning", | ||
| 201 | + }); | ||
| 197 | }) | 202 | }) |
| 198 | - .then(() => { | 203 | + .catch(() => {}); |
| 199 | - this.getList(); | ||
| 200 | - this.msgSuccess("删除成功"); | ||
| 201 | }) | 204 | }) |
| 202 | - .catch(function () {}); | ||
| 203 | } | 205 | } |
| 204 | }, | 206 | }, |
| 205 | //启用,停用 | 207 | //启用,停用 |
| ... | @@ -210,18 +212,17 @@ export default { | ... | @@ -210,18 +212,17 @@ export default { |
| 210 | cancelButtonText: "取消", | 212 | cancelButtonText: "取消", |
| 211 | type: "warning", | 213 | type: "warning", |
| 212 | }) | 214 | }) |
| 213 | - .then(function () { | 215 | + .then(()=> { |
| 214 | - return enableOrDisable(id, status); | 216 | + enableOrDisable(id, status).then((res) => { |
| 215 | - }) | 217 | + if (res.code != 200) { |
| 216 | - .then((res) => { | ||
| 217 | - if (res.code != 200){ | ||
| 218 | this.msgError(res.msg); | 218 | this.msgError(res.msg); |
| 219 | - }else { | 219 | + } else { |
| 220 | this.getList(); | 220 | this.getList(); |
| 221 | this.msgSuccess(tip + "成功"); | 221 | this.msgSuccess(tip + "成功"); |
| 222 | } | 222 | } |
| 223 | }) | 223 | }) |
| 224 | - .catch(function () {}); | 224 | + .catch(()=> {}); |
| 225 | + }) | ||
| 225 | }, | 226 | }, |
| 226 | }, | 227 | }, |
| 227 | created() { | 228 | created() { | ... | ... |
-
Please register or login to post a comment