Showing
1 changed file
with
30 additions
and
28 deletions
| ... | @@ -31,11 +31,7 @@ | ... | @@ -31,11 +31,7 @@ |
| 31 | @click="$router.push({ name: 'Add', params: { handle: 'add' } })" | 31 | @click="$router.push({ name: 'Add', params: { handle: 'add' } })" |
| 32 | >添加</el-button | 32 | >添加</el-button |
| 33 | > | 33 | > |
| 34 | - <el-table | 34 | + <el-table :data="flyList" v-loading="loading" size="small"> |
| 35 | - :data="flyList" | ||
| 36 | - v-loading="loading" | ||
| 37 | - size="small" | ||
| 38 | - > | ||
| 39 | <el-table-column | 35 | <el-table-column |
| 40 | prop="purposeOfFlightNo" | 36 | prop="purposeOfFlightNo" |
| 41 | label="航班号" | 37 | label="航班号" |
| ... | @@ -56,7 +52,7 @@ | ... | @@ -56,7 +52,7 @@ |
| 56 | 52 | ||
| 57 | <el-table-column prop="createTime" label="更新时间" align="center"> | 53 | <el-table-column prop="createTime" label="更新时间" align="center"> |
| 58 | <template slot-scope="scope"> | 54 | <template slot-scope="scope"> |
| 59 | - {{scope.row.createTime | formatTimer}} | 55 | + {{ scope.row.createTime | formatTimer }} |
| 60 | </template> | 56 | </template> |
| 61 | </el-table-column> | 57 | </el-table-column> |
| 62 | 58 | ||
| ... | @@ -80,7 +76,7 @@ | ... | @@ -80,7 +76,7 @@ |
| 80 | type="text" | 76 | type="text" |
| 81 | size="mini" | 77 | size="mini" |
| 82 | icon="el-icon-delete" | 78 | icon="el-icon-delete" |
| 83 | - @click="del(scope.row.id)" | 79 | + @click="del(scope.row.id, scope.row.status)" |
| 84 | >删除</el-button | 80 | >删除</el-button |
| 85 | > | 81 | > |
| 86 | <el-button | 82 | <el-button |
| ... | @@ -99,7 +95,6 @@ | ... | @@ -99,7 +95,6 @@ |
| 99 | v-else | 95 | v-else |
| 100 | >启用</el-button | 96 | >启用</el-button |
| 101 | > | 97 | > |
| 102 | - | ||
| 103 | </template> | 98 | </template> |
| 104 | </el-table-column> | 99 | </el-table-column> |
| 105 | </el-table> | 100 | </el-table> |
| ... | @@ -126,9 +121,7 @@ import { | ... | @@ -126,9 +121,7 @@ import { |
| 126 | enableOrDisable, | 121 | enableOrDisable, |
| 127 | } from "@/api/destinationFlight"; | 122 | } from "@/api/destinationFlight"; |
| 128 | 123 | ||
| 129 | -import { | 124 | +import { parseTime } from "@/utils/FedEx"; |
| 130 | - parseTime | ||
| 131 | -} from "@/utils/FedEx"; | ||
| 132 | 125 | ||
| 133 | export default { | 126 | export default { |
| 134 | data() { | 127 | data() { |
| ... | @@ -176,20 +169,29 @@ export default { | ... | @@ -176,20 +169,29 @@ export default { |
| 176 | }); | 169 | }); |
| 177 | }, | 170 | }, |
| 178 | //删除规则 | 171 | //删除规则 |
| 179 | - del(id) { | 172 | + del(id, status) { |
| 180 | - this.$confirm("是否确认删除此航班规则?", "警告", { | 173 | + if (status == "1") { |
| 181 | - confirmButtonText: "确定", | 174 | + this.$confirm("航班规则生效中,无法删除,请停用后再操作", "警告", { |
| 182 | - cancelButtonText: "取消", | 175 | + confirmButtonText: '确定', |
| 183 | - type: "warning", | 176 | + showCancelButton:false, |
| 184 | - }) | 177 | + type: "warning", |
| 185 | - .then(function () { | 178 | + }); |
| 186 | - return delFlightId(id); | 179 | + } else { |
| 187 | - }) | 180 | + this.$confirm("是否确认删除此航班规则?", "警告", { |
| 188 | - .then(() => { | 181 | + confirmButtonText: "确定", |
| 189 | - this.getList(); | 182 | + cancelButtonText: "取消", |
| 190 | - this.msgSuccess("删除成功"); | 183 | + showCancelButton:true, |
| 184 | + type: "warning", | ||
| 191 | }) | 185 | }) |
| 192 | - .catch(function () {}); | 186 | + .then(function () { |
| 187 | + return delFlightId(id); | ||
| 188 | + }) | ||
| 189 | + .then(() => { | ||
| 190 | + this.getList(); | ||
| 191 | + this.msgSuccess("删除成功"); | ||
| 192 | + }) | ||
| 193 | + .catch(function () {}); | ||
| 194 | + } | ||
| 193 | }, | 195 | }, |
| 194 | //启用,停用 | 196 | //启用,停用 |
| 195 | changeStatus(id, status) { | 197 | changeStatus(id, status) { |
| ... | @@ -208,18 +210,18 @@ export default { | ... | @@ -208,18 +210,18 @@ export default { |
| 208 | }) | 210 | }) |
| 209 | .catch(function () {}); | 211 | .catch(function () {}); |
| 210 | }, | 212 | }, |
| 211 | - parseDate(time){ | 213 | + parseDate(time) { |
| 212 | // debugger | 214 | // debugger |
| 213 | let str = new Date(time).format("yyyy-MM-dd"); | 215 | let str = new Date(time).format("yyyy-MM-dd"); |
| 214 | // let str = parseTime(date, 'yyyy-dd-mm'); | 216 | // let str = parseTime(date, 'yyyy-dd-mm'); |
| 215 | return str; | 217 | return str; |
| 216 | - } | 218 | + }, |
| 217 | }, | 219 | }, |
| 218 | created() { | 220 | created() { |
| 219 | this.getList(); | 221 | this.getList(); |
| 220 | }, | 222 | }, |
| 221 | filters: { | 223 | filters: { |
| 222 | - formatTimer: function(value) { | 224 | + formatTimer: function (value) { |
| 223 | let date = new Date(value); | 225 | let date = new Date(value); |
| 224 | let y = date.getFullYear(); | 226 | let y = date.getFullYear(); |
| 225 | let MM = date.getMonth() + 1; | 227 | let MM = date.getMonth() + 1; |
| ... | @@ -233,7 +235,7 @@ export default { | ... | @@ -233,7 +235,7 @@ export default { |
| 233 | let s = date.getSeconds(); | 235 | let s = date.getSeconds(); |
| 234 | s = s < 10 ? "0" + s : s; | 236 | s = s < 10 ? "0" + s : s; |
| 235 | return y + "-" + MM + "-" + d + " " + h + ":" + m + ":" + s; | 237 | return y + "-" + MM + "-" + d + " " + h + ":" + m + ":" + s; |
| 236 | - } | 238 | + }, |
| 237 | }, | 239 | }, |
| 238 | }; | 240 | }; |
| 239 | </script> | 241 | </script> | ... | ... |
-
Please register or login to post a comment