Elements-SY

modify

...@@ -74,17 +74,13 @@ export function delFlightId(id) { ...@@ -74,17 +74,13 @@ export function delFlightId(id) {
74 } 74 }
75 75
76 //启用/停止规则 76 //启用/停止规则
77 -export function enableOrDisable(id, status) { 77 +export function enableOrDisable(data) {
78 //statsu 1-有效 3-停用 78 //statsu 1-有效 3-停用
79 - const data = {
80 - id,
81 - status
82 - }
83 return request({ 79 return request({
84 - url: '/destinationFlight/enableOrDisable', 80 + url: "/destinationFlight/enableOrDisable",
85 - method: 'post', 81 + method: "post",
86 - data: data 82 + data: data,
87 - }) 83 + });
88 } 84 }
89 85
90 //获取全部字典 86 //获取全部字典
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
28 size="mini" 28 size="mini"
29 :disabled="pageName || item.status == '3' || status" 29 :disabled="pageName || item.status == '3' || status"
30 :loading="item.loading" 30 :loading="item.loading"
31 - @click="saveSubmit(item)" 31 + @click="saveSubmit(item, index)"
32 >保 存</el-button 32 >保 存</el-button
33 > 33 >
34 <el-button 34 <el-button
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
38 icon="el-icon-video-pause" 38 icon="el-icon-video-pause"
39 :loading="item.loading" 39 :loading="item.loading"
40 :disabled="pageName || status" 40 :disabled="pageName || status"
41 - @click="onOffSubmit(item)" 41 + @click="onOffSubmit(item, index)"
42 >{{ item.status | statusBtn }}</el-button 42 >{{ item.status | statusBtn }}</el-button
43 > 43 >
44 <el-button 44 <el-button
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
48 icon="el-icon-delete" 48 icon="el-icon-delete"
49 :disabled="pageName || item.status !== '3' || status" 49 :disabled="pageName || item.status !== '3' || status"
50 :loading="item.loading" 50 :loading="item.loading"
51 - @click="deleteSubmit(item)" 51 + @click="deleteSubmit(item, index)"
52 >删 除</el-button 52 >删 除</el-button
53 > 53 >
54 <span class="flight-route-title"> 54 <span class="flight-route-title">
...@@ -593,16 +593,16 @@ export default { ...@@ -593,16 +593,16 @@ export default {
593 this.$emit("addRlue", index); 593 this.$emit("addRlue", index);
594 }, 594 },
595 // 保存 595 // 保存
596 - saveSubmit(item) { 596 + saveSubmit(item, index) {
597 - this.$emit("save", item); 597 + this.$emit("save", item, index);
598 }, 598 },
599 // 开启/暂停 599 // 开启/暂停
600 - onOffSubmit(item) { 600 + onOffSubmit(item, index) {
601 - this.$emit("onOff", item); 601 + this.$emit("onOff", item, index);
602 }, 602 },
603 // 删除 603 // 删除
604 - deleteSubmit(item) { 604 + deleteSubmit(item, index) {
605 - this.$emit("delete", item); 605 + this.$emit("delete", item, index);
606 }, 606 },
607 }, 607 },
608 }; 608 };
...@@ -626,7 +626,6 @@ export default { ...@@ -626,7 +626,6 @@ export default {
626 border-bottom: 1px solid #ccc; 626 border-bottom: 1px solid #ccc;
627 } 627 }
628 .el-collapse-item:last-child { 628 .el-collapse-item:last-child {
629 -
630 } 629 }
631 .route-container { 630 .route-container {
632 strong { 631 strong {
......
...@@ -337,7 +337,7 @@ export default { ...@@ -337,7 +337,7 @@ export default {
337 this.loading = true; 337 this.loading = true;
338 updateOrAddFlight(parmas) 338 updateOrAddFlight(parmas)
339 .then((res) => { 339 .then((res) => {
340 - const { code, msg } = res; 340 + const { code, msg, data } = res;
341 if (code == 200) { 341 if (code == 200) {
342 this.$forceUpdate(); 342 this.$forceUpdate();
343 this.msgSuccess("保存成功!"); 343 this.msgSuccess("保存成功!");
...@@ -349,22 +349,29 @@ export default { ...@@ -349,22 +349,29 @@ export default {
349 .catch(() => { 349 .catch(() => {
350 this.loading = false; 350 this.loading = false;
351 }); 351 });
352 - }else{ 352 + } else {
353 - this.msgWarning('未添加规则信息,请添加后再保存!') 353 + this.msgWarning("未添加规则信息,请添加后再保存!");
354 } 354 }
355 }, 355 },
356 // 开启/暂停 356 // 开启/暂停
357 - onOffSubmit(item) { 357 + onOffSubmit(item, index) {
358 this.loading = true; 358 this.loading = true;
359 let tip = item.status == "1" ? "停用" : "启用"; 359 let tip = item.status == "1" ? "停用" : "启用";
360 + let parmas = {
361 + id: item.id,
362 + status: item.status == "1" ? "3" : "1",
363 + };
360 this.$confirm("是否确认" + tip + "此航班规则?", "警告", { 364 this.$confirm("是否确认" + tip + "此航班规则?", "警告", {
361 confirmButtonText: "确定", 365 confirmButtonText: "确定",
362 cancelButtonText: "取消", 366 cancelButtonText: "取消",
363 type: "warning", 367 type: "warning",
364 }).then(() => { 368 }).then(() => {
365 - enableOrDisable({ id: item.id, status: item.status == "1" ? "3" : "1" }) 369 + enableOrDisable(parmas)
366 .then((res) => { 370 .then((res) => {
367 - const { code, msg } = res; 371 + const { code, msg, data } = res;
372 + console.log(this.routesInfo);
373 + console.log(index);
374 + console.log(data);
368 if (code == 200) { 375 if (code == 200) {
369 this.$forceUpdate(); 376 this.$forceUpdate();
370 this.msgSuccess(tip + "成功"); 377 this.msgSuccess(tip + "成功");
...@@ -389,8 +396,11 @@ export default { ...@@ -389,8 +396,11 @@ export default {
389 }).then(() => { 396 }).then(() => {
390 delFlightId({ id: item.id }) 397 delFlightId({ id: item.id })
391 .then((res) => { 398 .then((res) => {
392 - const { code, msg } = res; 399 + const { code, msg, data } = res;
393 if (code == 200) { 400 if (code == 200) {
401 + console.log(this.routesInfo);
402 + console.log(index);
403 + console.log(data);
394 this.$forceUpdate(); 404 this.$forceUpdate();
395 this.msgSuccess(msg); 405 this.msgSuccess(msg);
396 } else { 406 } else {
......