Showing
3 changed files
with
51 additions
and
7 deletions
| ... | @@ -49,6 +49,21 @@ export function delFlightId(id){ | ... | @@ -49,6 +49,21 @@ export function delFlightId(id){ |
| 49 | }) | 49 | }) |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | +//启用/停止规则 | ||
| 53 | +export function enableOrDisable(id, status){ | ||
| 54 | + //statsu 1-有效 3-停用 | ||
| 55 | + const data = { | ||
| 56 | + id, | ||
| 57 | + status | ||
| 58 | + } | ||
| 59 | + return request({ | ||
| 60 | + url: '/destinationFlight/enableOrDisable', | ||
| 61 | + method: 'post', | ||
| 62 | + data: data | ||
| 63 | + }) | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | + | ||
| 52 | //申报类别 | 67 | //申报类别 |
| 53 | export function cargoTypeData(){ | 68 | export function cargoTypeData(){ |
| 54 | return request({ | 69 | return request({ | ... | ... |
| ... | @@ -74,10 +74,18 @@ | ... | @@ -74,10 +74,18 @@ |
| 74 | @click="del(scope.row.id)" | 74 | @click="del(scope.row.id)" |
| 75 | >删除</el-button | 75 | >删除</el-button |
| 76 | > | 76 | > |
| 77 | - <el-button type="text" size="mini" icon="el-icon-video-play" | 77 | + <el-button |
| 78 | + type="text" | ||
| 79 | + size="mini" | ||
| 80 | + icon="el-icon-video-play" | ||
| 81 | + @click="changeStatus(scope.row.id, 1)" | ||
| 78 | >启用</el-button | 82 | >启用</el-button |
| 79 | > | 83 | > |
| 80 | - <el-button type="text" size="mini" icon="el-icon-video-pause" | 84 | + <el-button |
| 85 | + type="text" | ||
| 86 | + size="mini" | ||
| 87 | + icon="el-icon-video-pause" | ||
| 88 | + @click="changeStatus(scope.row.id, 3)" | ||
| 81 | >停用</el-button | 89 | >停用</el-button |
| 82 | > | 90 | > |
| 83 | </template> | 91 | </template> |
| ... | @@ -100,7 +108,11 @@ | ... | @@ -100,7 +108,11 @@ |
| 100 | </template> | 108 | </template> |
| 101 | 109 | ||
| 102 | <script> | 110 | <script> |
| 103 | -import { findFlightNo, delFlightId } from "@/api/destinationFlight"; | 111 | +import { |
| 112 | + findFlightNo, | ||
| 113 | + delFlightId, | ||
| 114 | + enableOrDisable, | ||
| 115 | +} from "@/api/destinationFlight"; | ||
| 104 | 116 | ||
| 105 | export default { | 117 | export default { |
| 106 | data() { | 118 | data() { |
| ... | @@ -145,7 +157,8 @@ export default { | ... | @@ -145,7 +157,8 @@ export default { |
| 145 | confirmButtonText: "确定", | 157 | confirmButtonText: "确定", |
| 146 | cancelButtonText: "取消", | 158 | cancelButtonText: "取消", |
| 147 | type: "warning", | 159 | type: "warning", |
| 148 | - }).then(function () { | 160 | + }) |
| 161 | + .then(function () { | ||
| 149 | return delFlightId(id); | 162 | return delFlightId(id); |
| 150 | }) | 163 | }) |
| 151 | .then(() => { | 164 | .then(() => { |
| ... | @@ -154,8 +167,23 @@ export default { | ... | @@ -154,8 +167,23 @@ export default { |
| 154 | }) | 167 | }) |
| 155 | .catch(function () {}); | 168 | .catch(function () {}); |
| 156 | }, | 169 | }, |
| 157 | - //删除,启用,停用 | 170 | + //启用,停用 |
| 158 | - changeStatus(id, handle) {}, | 171 | + changeStatus(id, status) { |
| 172 | + let tip = status === 1 ? "启用" : "停用"; | ||
| 173 | + this.$confirm("是否确认" + tip + "此航班规则?", "警告", { | ||
| 174 | + confirmButtonText: "确定", | ||
| 175 | + cancelButtonText: "取消", | ||
| 176 | + type: "warning", | ||
| 177 | + }) | ||
| 178 | + .then(function () { | ||
| 179 | + return enableOrDisable(id, status); | ||
| 180 | + }) | ||
| 181 | + .then(() => { | ||
| 182 | + this.getList(); | ||
| 183 | + this.msgSuccess(tip + "成功"); | ||
| 184 | + }) | ||
| 185 | + .catch(function () {}); | ||
| 186 | + }, | ||
| 159 | }, | 187 | }, |
| 160 | created() { | 188 | created() { |
| 161 | this.getList(); | 189 | this.getList(); | ... | ... |
| ... | @@ -189,12 +189,13 @@ export default { | ... | @@ -189,12 +189,13 @@ export default { |
| 189 | type: 'success' | 189 | type: 'success' |
| 190 | }); | 190 | }); |
| 191 | } | 191 | } |
| 192 | - this.btnLoading = false; | 192 | + this.close(); |
| 193 | }); | 193 | }); |
| 194 | this.form.typeOfGoods = this.typeOfGoods; | 194 | this.form.typeOfGoods = this.typeOfGoods; |
| 195 | this.form.declarationCategory = this.declarationCategory; | 195 | this.form.declarationCategory = this.declarationCategory; |
| 196 | this.form.serviceCode = this.formServiceCode; | 196 | this.form.serviceCode = this.formServiceCode; |
| 197 | this.form.subCategory = this.formSubCategory; | 197 | this.form.subCategory = this.formSubCategory; |
| 198 | + this.btnLoading = false; | ||
| 198 | 199 | ||
| 199 | }, | 200 | }, |
| 200 | close() { | 201 | close() { | ... | ... |
-
Please register or login to post a comment