Showing
20 changed files
with
44 additions
and
1169 deletions
src/api/et86.js
deleted
100644 → 0
| 1 | -import request from "@/utils/request"; | ||
| 2 | - | ||
| 3 | -// ET86查询 | ||
| 4 | -/** | ||
| 5 | - * @param createTimeStart; 开始时间 | ||
| 6 | - * @param createTimeEnd; 结束时间 | ||
| 7 | - * @param status; 1-有效 0-无效 不传查全部 | ||
| 8 | - */ | ||
| 9 | -export function findAllEtesRules(data) { | ||
| 10 | - return request({ | ||
| 11 | - url: "/etes/findAllEtesRules", | ||
| 12 | - method: "post", | ||
| 13 | - data: data, | ||
| 14 | - }); | ||
| 15 | -} | ||
| 16 | - | ||
| 17 | -// ET86新增 | ||
| 18 | -export function add(data) { | ||
| 19 | - return request({ | ||
| 20 | - url: "/etes/add", | ||
| 21 | - method: "post", | ||
| 22 | - data: data, | ||
| 23 | - }); | ||
| 24 | -} | ||
| 25 | - | ||
| 26 | -// ET86详情 | ||
| 27 | -export function findEtesRuleById(data) { | ||
| 28 | - return request({ | ||
| 29 | - url: "/etes/findEtesRuleById", | ||
| 30 | - method: "post", | ||
| 31 | - data: data, | ||
| 32 | - }); | ||
| 33 | -} | ||
| 34 | - | ||
| 35 | -// ET86编辑 | ||
| 36 | -export function update(data) { | ||
| 37 | - return request({ | ||
| 38 | - url: "/etes/update", | ||
| 39 | - method: "post", | ||
| 40 | - data: data, | ||
| 41 | - }); | ||
| 42 | -} | ||
| 43 | - | ||
| 44 | -// ET86删除 | ||
| 45 | -export function deleteEtesRuleById(data) { | ||
| 46 | - return request({ | ||
| 47 | - url: "/etes/deleteEtesRuleById", | ||
| 48 | - method: "post", | ||
| 49 | - data: data, | ||
| 50 | - }); | ||
| 51 | -} |
| ... | @@ -211,14 +211,3 @@ export function checkFlightRoute(data) { | ... | @@ -211,14 +211,3 @@ export function checkFlightRoute(data) { |
| 211 | }) | 211 | }) |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | -//更新航线 | ||
| 215 | -/** | ||
| 216 | - * @param id * | ||
| 217 | - */ | ||
| 218 | -export function updateRoute(id) { | ||
| 219 | - return request({ | ||
| 220 | - url: `/dictionary/updateRoute/${id}`, | ||
| 221 | - method: "post", | ||
| 222 | - data: {}, | ||
| 223 | - }); | ||
| 224 | -} | ... | ... |
src/components/YlForm/index.vue
deleted
100644 → 0
This diff is collapsed. Click to expand it.
src/components/YlInput/index.vue
deleted
100644 → 0
| 1 | -<template> | ||
| 2 | - <el-input | ||
| 3 | - v-bind="$attrs" | ||
| 4 | - clearable | ||
| 5 | - @input="handleInput" | ||
| 6 | - @focus="handleFocus" | ||
| 7 | - @blur="handleBlur" | ||
| 8 | - @change="handleChange" | ||
| 9 | - class="yl-input" | ||
| 10 | - ></el-input> | ||
| 11 | -</template> | ||
| 12 | - | ||
| 13 | -<script> | ||
| 14 | -export default { | ||
| 15 | - props: { | ||
| 16 | - rules: { | ||
| 17 | - type: Array, | ||
| 18 | - default: () => [], | ||
| 19 | - }, | ||
| 20 | - }, | ||
| 21 | - data() { | ||
| 22 | - return {}; | ||
| 23 | - }, | ||
| 24 | - computed: {}, | ||
| 25 | - created() {}, | ||
| 26 | - mounted() {}, | ||
| 27 | - methods: { | ||
| 28 | - handleInput(event) { | ||
| 29 | - // v-bind="$attrs" v-on="$listeners" | ||
| 30 | - this.$emit("input", event); | ||
| 31 | - }, | ||
| 32 | - handleFocus(event) { | ||
| 33 | - this.$emit("focus", event); | ||
| 34 | - }, | ||
| 35 | - handleBlur(event) { | ||
| 36 | - this.$emit("blur", event); | ||
| 37 | - }, | ||
| 38 | - handleChange(event) { | ||
| 39 | - this.$emit("change", event); | ||
| 40 | - }, | ||
| 41 | - }, | ||
| 42 | -}; | ||
| 43 | -</script> | ||
| 44 | -<style lang='scss'> | ||
| 45 | - | ||
| 46 | -</style> |
src/components/YlTable/column.vue
deleted
100644 → 0
| 1 | -<script> | ||
| 2 | -/** | ||
| 3 | - * 动态渲染 el-table-column | ||
| 4 | - */ | ||
| 5 | -export default { | ||
| 6 | - name: 'column', | ||
| 7 | - props: { | ||
| 8 | - attrs: { | ||
| 9 | - type: Object, | ||
| 10 | - default: () => ({}), | ||
| 11 | - required: true | ||
| 12 | - } | ||
| 13 | - }, | ||
| 14 | - render: function(h) { | ||
| 15 | - let attrs = this.attrs; | ||
| 16 | - let scopedSlots = {}; | ||
| 17 | - if (attrs.render) { | ||
| 18 | - scopedSlots.default = scope => attrs.render(h, scope); | ||
| 19 | - } | ||
| 20 | - return h('el-table-column', { | ||
| 21 | - attrs, | ||
| 22 | - scopedSlots | ||
| 23 | - }); | ||
| 24 | - } | ||
| 25 | -}; | ||
| 26 | -</script> |
src/components/YlTable/index.vue
deleted
100644 → 0
| 1 | - <template> | ||
| 2 | - <div class="table-container"> | ||
| 3 | - <el-row | ||
| 4 | - v-if="attrs.btnCofig.isBtn" | ||
| 5 | - style="margin-bottom: 15px" | ||
| 6 | - id="group-btn" | ||
| 7 | - > | ||
| 8 | - <el-col> | ||
| 9 | - <span | ||
| 10 | - v-for="(item, i) in attrs.btnCofig.btnGroup" | ||
| 11 | - :key="item.btnName" | ||
| 12 | - :class="i == 0 ? 'first-span' : 'span'" | ||
| 13 | - > | ||
| 14 | - <el-button | ||
| 15 | - :type="item.type" | ||
| 16 | - :icon="item.icon" | ||
| 17 | - :round="item.round" | ||
| 18 | - :size="item.size" | ||
| 19 | - :loading="item.loading" | ||
| 20 | - @click="handleClick(item, i)" | ||
| 21 | - v-if="item.btnName !== '导入' && item.btnName !== '增加'" | ||
| 22 | - >{{ item.btnName }}</el-button | ||
| 23 | - > | ||
| 24 | - <el-upload | ||
| 25 | - v-else | ||
| 26 | - ref="upload" | ||
| 27 | - :action="item.action" | ||
| 28 | - :fileName="item.fileName" | ||
| 29 | - :http-request="toUpload" | ||
| 30 | - :on-remove="onRemoveUpload" | ||
| 31 | - :limit="item.limit" | ||
| 32 | - :accept="item.accept" | ||
| 33 | - :show-file-list="false" | ||
| 34 | - class="upload" | ||
| 35 | - > | ||
| 36 | - <el-button | ||
| 37 | - :type="item.type" | ||
| 38 | - :icon="item.icon" | ||
| 39 | - :round="item.round" | ||
| 40 | - :size="item.size" | ||
| 41 | - :loading="item.loading" | ||
| 42 | - >{{ item.btnName }}</el-button | ||
| 43 | - > | ||
| 44 | - </el-upload> | ||
| 45 | - </span> | ||
| 46 | - </el-col> | ||
| 47 | - </el-row> | ||
| 48 | - <el-table | ||
| 49 | - :max-height="attrs.maxHeight" | ||
| 50 | - :empty-text="emptyText" | ||
| 51 | - v-bind="attrs" | ||
| 52 | - v-loading="loadingTable" | ||
| 53 | - :data="tableData" | ||
| 54 | - @selection-change="selectionChange" | ||
| 55 | - ref="tableRef" | ||
| 56 | - row-key="id" | ||
| 57 | - :header-cell-class-name="headerCellClassName" | ||
| 58 | - > | ||
| 59 | - <template v-if="columns.length"> | ||
| 60 | - <template v-for="item in columns"> | ||
| 61 | - <column v-if="!item.hidden" :key="item.id" :attrs="item"></column> | ||
| 62 | - </template> | ||
| 63 | - </template> | ||
| 64 | - <slot name="column" v-else></slot> | ||
| 65 | - </el-table> | ||
| 66 | - <!-- 分页 --> | ||
| 67 | - <div | ||
| 68 | - v-if="pageConfig.isPagination" | ||
| 69 | - id="pagination" | ||
| 70 | - class="pagination-container" | ||
| 71 | - :style="{ textAlign: pageConfig.position || 'right' }" | ||
| 72 | - ref="paginationRef" | ||
| 73 | - > | ||
| 74 | - <el-pagination | ||
| 75 | - background | ||
| 76 | - :hide-on-single-page="false" | ||
| 77 | - :current-page="pageConfig.pageData.page" | ||
| 78 | - :page-sizes="[10, 15, 20, 25, 30, 35, 40]" | ||
| 79 | - :page-size="pageConfig.pageData.size" | ||
| 80 | - layout="total,prev, pager, next, jumper, ->, sizes" | ||
| 81 | - :total="pageConfig.total" | ||
| 82 | - @size-change="handleSizeChange" | ||
| 83 | - @current-change="handleCurrentChange" | ||
| 84 | - > | ||
| 85 | - </el-pagination> | ||
| 86 | - </div> | ||
| 87 | - </div> | ||
| 88 | -</template> | ||
| 89 | - | ||
| 90 | -<script> | ||
| 91 | -import Sortable from "sortablejs"; | ||
| 92 | -import { objectMerge, debounce } from "@/utils"; | ||
| 93 | -import column from "./column"; | ||
| 94 | -export default { | ||
| 95 | - props: { | ||
| 96 | - attrs: { | ||
| 97 | - type: Object, | ||
| 98 | - default: { | ||
| 99 | - border: true, | ||
| 100 | - isDragSort: false, | ||
| 101 | - btnCofig: { | ||
| 102 | - isBtn: true, | ||
| 103 | - btnGroup: [ | ||
| 104 | - { | ||
| 105 | - type: "primary", // text、primary、danger | ||
| 106 | - icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right | ||
| 107 | - btnName: "搜索", | ||
| 108 | - size: "mini", // medium / small / mini | ||
| 109 | - round: false, | ||
| 110 | - loading: false, | ||
| 111 | - event: "searchBtn", | ||
| 112 | - }, | ||
| 113 | - ], | ||
| 114 | - }, | ||
| 115 | - }, | ||
| 116 | - }, | ||
| 117 | - emptyText: { | ||
| 118 | - type: String, | ||
| 119 | - default: "暂无数据", | ||
| 120 | - }, | ||
| 121 | - loadingTable: { | ||
| 122 | - type: Boolean, | ||
| 123 | - default: false, | ||
| 124 | - }, | ||
| 125 | - columns: { | ||
| 126 | - type: Array, | ||
| 127 | - default: () => [], | ||
| 128 | - }, | ||
| 129 | - tableData: { | ||
| 130 | - type: Array, | ||
| 131 | - default: () => [], | ||
| 132 | - }, | ||
| 133 | - pageConfig: { | ||
| 134 | - type: Object, | ||
| 135 | - default: { | ||
| 136 | - isPagination: true, | ||
| 137 | - }, | ||
| 138 | - required: true, | ||
| 139 | - }, | ||
| 140 | - }, | ||
| 141 | - components: { | ||
| 142 | - column, | ||
| 143 | - }, | ||
| 144 | - data() { | ||
| 145 | - return { | ||
| 146 | - dropCol: objectMerge({}, this.columns), | ||
| 147 | - trHeight: 4, | ||
| 148 | - }; | ||
| 149 | - }, | ||
| 150 | - computed: { | ||
| 151 | - _attrs() { | ||
| 152 | - //默认table 参数 | ||
| 153 | - const defaultParams = {}; | ||
| 154 | - return Object.assign(defaultParams, this.attrs); | ||
| 155 | - }, | ||
| 156 | - isHasAttr() {}, | ||
| 157 | - }, | ||
| 158 | - created() { | ||
| 159 | - if (this.attrs.isDragSort) { | ||
| 160 | - // 有没有复选框、有没有render | ||
| 161 | - // this.columns | ||
| 162 | - } | ||
| 163 | - }, | ||
| 164 | - mounted() { | ||
| 165 | - //阻止火狐拖拽新建新页面 | ||
| 166 | - document.body.addEventListener( | ||
| 167 | - "drop", | ||
| 168 | - (event) => { | ||
| 169 | - event.preventDefault(); | ||
| 170 | - event.stopPropagation(); | ||
| 171 | - }, | ||
| 172 | - false | ||
| 173 | - ); | ||
| 174 | - if (this.tableData.length) { | ||
| 175 | - this.getTrCurrentHeight(); | ||
| 176 | - window.addEventListener("resize", this.getTrCurrentHeight); | ||
| 177 | - // 拖拽行更新排序 | ||
| 178 | - // this.rowDrop(); | ||
| 179 | - // 拖拽列更新排序 | ||
| 180 | - this.columnDrop(); | ||
| 181 | - } | ||
| 182 | - }, | ||
| 183 | - destroyed() { | ||
| 184 | - if (this.tableData.length) { | ||
| 185 | - window.removeEventListener("resize", this.getTrCurrentHeight); | ||
| 186 | - } | ||
| 187 | - }, | ||
| 188 | - | ||
| 189 | - methods: { | ||
| 190 | - getTrCurrentHeight: debounce(function () { | ||
| 191 | - this.$nextTick(() => { | ||
| 192 | - const trEl = | ||
| 193 | - this.$refs.tableRef.$refs.bodyWrapper.children[0].children[1] | ||
| 194 | - .children[0].clientHeight; | ||
| 195 | - this.trHeight = trEl; | ||
| 196 | - }); | ||
| 197 | - }, 800), | ||
| 198 | - | ||
| 199 | - // 给表头列添加className | ||
| 200 | - headerCellClassName({ row, column, rowIndex, columnIndex }) { | ||
| 201 | - if (columnIndex !== 0) { | ||
| 202 | - return "el-table_1_column"; | ||
| 203 | - } | ||
| 204 | - }, | ||
| 205 | - useTableFunc(FuncName, ...params) { | ||
| 206 | - if (!this.$refs["el-table"]) { | ||
| 207 | - return console.warn("访问不到el-table"); | ||
| 208 | - } | ||
| 209 | - if (!FuncName) { | ||
| 210 | - return console.error("请传入tabel方法名字"); | ||
| 211 | - } | ||
| 212 | - this.$refs["el-table"][FuncName](params[0]); | ||
| 213 | - }, | ||
| 214 | - // table复选框事件 | ||
| 215 | - selectionChange(e) { | ||
| 216 | - console.log(e); | ||
| 217 | - this.$emit("selectionEvent", e); | ||
| 218 | - }, | ||
| 219 | - // 条数变化 | ||
| 220 | - handleSizeChange(e) { | ||
| 221 | - this.$emit("sizeChange", e); | ||
| 222 | - }, | ||
| 223 | - // 页码变化 | ||
| 224 | - handleCurrentChange(e) { | ||
| 225 | - this.$emit("currentChange", e); | ||
| 226 | - }, | ||
| 227 | - // btn点击事件注册 | ||
| 228 | - handleClick(item, i) { | ||
| 229 | - this.$emit(item.event, item, i); | ||
| 230 | - }, | ||
| 231 | - // 拖拽行更新排序 | ||
| 232 | - rowDrop() { | ||
| 233 | - const wrapperTr = document.querySelector(".el-table__header-wrapper tr"); | ||
| 234 | - // console.log("wrapperTr:", wrapperTr); | ||
| 235 | - this.sortable = Sortable.create(wrapperTr, { | ||
| 236 | - sort: this.attrs.isDragSort, | ||
| 237 | - animation: 100, | ||
| 238 | - delay: 0, | ||
| 239 | - handle: ".move", // 只有带move类名的元素才能拖动,多选框禁止拖动 | ||
| 240 | - onEnd: (evt) => { | ||
| 241 | - // 因为手动加了一个多选框, 不在表头循环数组内, 所以这里减1 | ||
| 242 | - let oldIndx = evt.oldIndex - 1; | ||
| 243 | - let newIndx = evt.newIndex - 1; | ||
| 244 | - const oldItem = this.dropCol[oldIndx]; | ||
| 245 | - // 真正改变列数据--变化列头,就能实现列拖动 列数据按列头索引取值 {{ scope.row[dropCol[index].prop] }} | ||
| 246 | - this.dropCol.splice(oldIndx, 1); // 删除旧一行 删除为1 | ||
| 247 | - this.dropCol.splice(newIndx, 0, oldItem); // 插入新一行 插入为0 | ||
| 248 | - }, | ||
| 249 | - }); | ||
| 250 | - }, | ||
| 251 | - // 拖拽列更新排序 | ||
| 252 | - columnDrop() { | ||
| 253 | - const tbody = document.querySelector(".el-table__body-wrapper tbody"); | ||
| 254 | - const _this = this; | ||
| 255 | - Sortable.create(tbody, { | ||
| 256 | - sort: this.attrs.isDragSort, | ||
| 257 | - animation: 100, | ||
| 258 | - delay: 0, | ||
| 259 | - onEnd({ newIndex, oldIndex }) { | ||
| 260 | - // console.log("onEnd:", newIndex, oldIndex); | ||
| 261 | - const currRow = _this.tableData.splice(oldIndex, 1)[0]; | ||
| 262 | - _this.tableData.splice(newIndex, 0, currRow); | ||
| 263 | - }, | ||
| 264 | - }); | ||
| 265 | - }, | ||
| 266 | - // 选择上传 | ||
| 267 | - toUpload(options) { | ||
| 268 | - this.$refs.upload.map((item) => { | ||
| 269 | - item.clearFiles(); //上传成功之后清除历史记录 | ||
| 270 | - }); | ||
| 271 | - this.$emit("upload", options); | ||
| 272 | - }, | ||
| 273 | - //移除上传 | ||
| 274 | - onRemoveUpload(file, fileList) { | ||
| 275 | - this.$emit("rmfile", { file, fileList }); | ||
| 276 | - }, | ||
| 277 | - }, | ||
| 278 | - watch: { | ||
| 279 | - data() { | ||
| 280 | - this.$nextTick(() => { | ||
| 281 | - this.useTableFunc("doLayout"); | ||
| 282 | - }); | ||
| 283 | - }, | ||
| 284 | - }, | ||
| 285 | -}; | ||
| 286 | -</script> | ||
| 287 | -<style lang="scss"> | ||
| 288 | - .el-table { | ||
| 289 | - th { | ||
| 290 | - padding: 0; | ||
| 291 | - } | ||
| 292 | - td{ | ||
| 293 | - padding: 0; | ||
| 294 | - } | ||
| 295 | - } | ||
| 296 | - .first-span,.span{ | ||
| 297 | - display: inline-block; | ||
| 298 | - } | ||
| 299 | - .span{ | ||
| 300 | - margin-left: 6px; | ||
| 301 | - } | ||
| 302 | -</style> |
| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 8 | <navbar /> | 8 | <navbar /> |
| 9 | <tags-view v-if="needTagsView" /> | 9 | <tags-view v-if="needTagsView" /> |
| 10 | </div> | 10 | </div> |
| 11 | - <app-main ref="appMainBlock" /> | 11 | + <app-main /> |
| 12 | <right-panel v-if="false"> | 12 | <right-panel v-if="false"> |
| 13 | <settings /> | 13 | <settings /> |
| 14 | </right-panel> | 14 | </right-panel> | ... | ... |
| ... | @@ -73,20 +73,6 @@ export const constantRoutes = [ | ... | @@ -73,20 +73,6 @@ export const constantRoutes = [ |
| 73 | hidden: true, | 73 | hidden: true, |
| 74 | children: [ | 74 | children: [ |
| 75 | { | 75 | { |
| 76 | - path: "/edit", | ||
| 77 | - component: (resolve) => | ||
| 78 | - require(["@/views/et86Config/et86RuleConfig/edit"], resolve), | ||
| 79 | - name: "edit", | ||
| 80 | - meta: { title: "ET86规则", icon: "user", noCache: false }, | ||
| 81 | - }, | ||
| 82 | - { | ||
| 83 | - path: "/errorInfo", | ||
| 84 | - component: (resolve) => | ||
| 85 | - require(["@/views/et86Config/errorInfo"], resolve), | ||
| 86 | - name: "errorInfo", | ||
| 87 | - meta: { title: "错误信息提示", icon: "user" }, | ||
| 88 | - }, | ||
| 89 | - { | ||
| 90 | path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status", | 76 | path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status", |
| 91 | component: (resolve) => | 77 | component: (resolve) => |
| 92 | require(["@/views/allocationConfig/flightAllocConfig/info"], resolve), | 78 | require(["@/views/allocationConfig/flightAllocConfig/info"], resolve), | ... | ... |
| ... | @@ -2,7 +2,6 @@ const getters = { | ... | @@ -2,7 +2,6 @@ const getters = { |
| 2 | sidebar: (state) => state.app.sidebar, | 2 | sidebar: (state) => state.app.sidebar, |
| 3 | size: (state) => state.app.size, | 3 | size: (state) => state.app.size, |
| 4 | device: (state) => state.app.device, | 4 | device: (state) => state.app.device, |
| 5 | - appMainBlockClientHeight: (state) => state.app.appMainBlockClientHeight, | ||
| 6 | visitedViews: (state) => state.tagsView.visitedViews, | 5 | visitedViews: (state) => state.tagsView.visitedViews, |
| 7 | cachedViews: (state) => state.tagsView.cachedViews, | 6 | cachedViews: (state) => state.tagsView.cachedViews, |
| 8 | token: (state) => state.user.token, | 7 | token: (state) => state.user.token, | ... | ... |
| ... | @@ -10,7 +10,6 @@ const state = { | ... | @@ -10,7 +10,6 @@ const state = { |
| 10 | device: "desktop", | 10 | device: "desktop", |
| 11 | //size: Cookies.get('size') || 'medium' | 11 | //size: Cookies.get('size') || 'medium' |
| 12 | size: localStorage.getItem("size") || "medium", | 12 | size: localStorage.getItem("size") || "medium", |
| 13 | - appMainBlockClientHeight: null | ||
| 14 | }; | 13 | }; |
| 15 | 14 | ||
| 16 | const mutations = { | 15 | const mutations = { |
| ... | @@ -58,9 +57,6 @@ const actions = { | ... | @@ -58,9 +57,6 @@ const actions = { |
| 58 | setSize({ commit }, size) { | 57 | setSize({ commit }, size) { |
| 59 | commit("SET_SIZE", size); | 58 | commit("SET_SIZE", size); |
| 60 | }, | 59 | }, |
| 61 | - setAppMainBlockCH({ commit }, height) { | ||
| 62 | - commit("SET_APPMAINBLOCKCH", height); | ||
| 63 | - }, | ||
| 64 | }; | 60 | }; |
| 65 | 61 | ||
| 66 | export default { | 62 | export default { | ... | ... |
| ... | @@ -134,28 +134,18 @@ | ... | @@ -134,28 +134,18 @@ |
| 134 | </el-row> | 134 | </el-row> |
| 135 | <el-row style="margin-bottom:5px"> | 135 | <el-row style="margin-bottom:5px"> |
| 136 | <el-col :span="12"> | 136 | <el-col :span="12"> |
| 137 | - <el-form-item prop="route"> | 137 | + <el-form-item label="航班路线" prop="route"> |
| 138 | - <template slot="label"> | 138 | + <el-select class="wid80" v-model="form.route" placeholder="请选择航线"> |
| 139 | - <div style="display:inline-block">航班路线 | 139 | + <el-option v-for="item in routeList" :key="item.id" :label="item.route" |
| 140 | - <el-tooltip class="item" effect="dark" content="输入航班号后获取航线信息。航班种类为Purple Tail时可以进行多选,切换航班种类后需重新选择航线" | 140 | + :value="item.id"> |
| 141 | - placement="top-start"> | ||
| 142 | - <span class="el-icon-warning" style="color:#1890ff;font-size:16px"></span> | ||
| 143 | - </el-tooltip> | ||
| 144 | - </div> | ||
| 145 | - </template> | ||
| 146 | - <el-select ref="routeSelect" class="wid80" v-model="form.route" :disabled="formdisabled.route" | ||
| 147 | - placeholder="请选择航线" no-data-text="未查询到航线" @change="routeChange" :loading="routeLoading" | ||
| 148 | - :multiple='routeMultiple' :key="routeMultiple"> | ||
| 149 | - <el-option v-for="item in routeList" :key="item.id" :label="item.route" :value="item.route"> | ||
| 150 | </el-option> | 141 | </el-option> |
| 151 | </el-select> | 142 | </el-select> |
| 152 | </el-form-item> | 143 | </el-form-item> |
| 153 | - <div class="formTips" v-if="title == '修改航班信息'">注意!:移除航线,相对应日期级别航线维度会同时删除</div> | ||
| 154 | </el-col> | 144 | </el-col> |
| 155 | <el-col :span="12"> | 145 | <el-col :span="12"> |
| 156 | <el-form-item label="航班类型" prop="typeId"> | 146 | <el-form-item label="航班类型" prop="typeId"> |
| 157 | <el-select class="wid80" v-model="form.typeId" placeholder="请选择航班类型"> | 147 | <el-select class="wid80" v-model="form.typeId" placeholder="请选择航班类型"> |
| 158 | - <el-option v-for="item in selectOption.flightTypelist" :key="item.id" :label="item.chineseName" | 148 | + <el-option v-for="item in selectOption.flightTypelist" :key="item.id" :label="item.chineseName" |
| 159 | :value="item.id"> | 149 | :value="item.id"> |
| 160 | </el-option> | 150 | </el-option> |
| 161 | </el-select> | 151 | </el-select> |
| ... | @@ -166,7 +156,7 @@ | ... | @@ -166,7 +156,7 @@ |
| 166 | <el-col :span="12"> | 156 | <el-col :span="12"> |
| 167 | <el-form-item label="航班状态" prop="statusId"> | 157 | <el-form-item label="航班状态" prop="statusId"> |
| 168 | <el-select class="wid80" :disabled="true" v-model="form.statusId" placeholder="请选择航班状态"> | 158 | <el-select class="wid80" :disabled="true" v-model="form.statusId" placeholder="请选择航班状态"> |
| 169 | - <el-option v-for="item in selectOption.flightStatuslist" :key="item.id" :label="item.chineseName" | 159 | + <el-option v-for="item in selectOption.flightStatuslist" :key="item.id" :label="item.chineseName" |
| 170 | :value="item.id"> | 160 | :value="item.id"> |
| 171 | </el-option> | 161 | </el-option> |
| 172 | </el-select> | 162 | </el-select> |
| ... | @@ -319,6 +309,7 @@ export default { | ... | @@ -319,6 +309,7 @@ export default { |
| 319 | form: { | 309 | form: { |
| 320 | isNeedRequired: 2 | 310 | isNeedRequired: 2 |
| 321 | }, | 311 | }, |
| 312 | + routeList: [], | ||
| 322 | //表单校验 | 313 | //表单校验 |
| 323 | rules: { | 314 | rules: { |
| 324 | fltNo: [ | 315 | fltNo: [ |
| ... | @@ -353,7 +344,7 @@ export default { | ... | @@ -353,7 +344,7 @@ export default { |
| 353 | { | 344 | { |
| 354 | required: true, | 345 | required: true, |
| 355 | message: "航班路线不能为空", | 346 | message: "航班路线不能为空", |
| 356 | - trigger: "blur", | 347 | + trigger: "change", |
| 357 | }, | 348 | }, |
| 358 | // { | 349 | // { |
| 359 | // pattern: /^(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)(;{1,1}(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)){0,}$/, | 350 | // pattern: /^(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)(;{1,1}(([\~A-Z]{3,4})(\-[A-Z]{3,4})+)){0,}$/, |
| ... | @@ -515,7 +506,8 @@ export default { | ... | @@ -515,7 +506,8 @@ export default { |
| 515 | methods: { | 506 | methods: { |
| 516 | //输入航班号后 | 507 | //输入航班号后 |
| 517 | blurfltNo() { | 508 | blurfltNo() { |
| 518 | - this.routeList = [] | 509 | + |
| 510 | + // this.routeList = [] | ||
| 519 | this.form.accountTotalWeight = 0 | 511 | this.form.accountTotalWeight = 0 |
| 520 | this.form.accountAllocatedWeight = 0 | 512 | this.form.accountAllocatedWeight = 0 |
| 521 | if ( | 513 | if ( |
| ... | @@ -586,6 +578,10 @@ export default { | ... | @@ -586,6 +578,10 @@ export default { |
| 586 | this.routeLoading = false | 578 | this.routeLoading = false |
| 587 | if (res.code === 200) { | 579 | if (res.code === 200) { |
| 588 | this.routeList = res.data.list | 580 | this.routeList = res.data.list |
| 581 | + if(res.data.list.length == 0){ | ||
| 582 | + this.form.route = ""; | ||
| 583 | + this.msgError("该航班没有设置航线"); | ||
| 584 | + } | ||
| 589 | } else { | 585 | } else { |
| 590 | this.msgWarning(res.msg) | 586 | this.msgWarning(res.msg) |
| 591 | } | 587 | } |
| ... | @@ -593,6 +589,9 @@ export default { | ... | @@ -593,6 +589,9 @@ export default { |
| 593 | this.routeLoading = false | 589 | this.routeLoading = false |
| 594 | console.log(err) | 590 | console.log(err) |
| 595 | }) | 591 | }) |
| 592 | + }else{ | ||
| 593 | + this.form.route = ""; | ||
| 594 | + this.routeList = []; | ||
| 596 | } | 595 | } |
| 597 | }, | 596 | }, |
| 598 | //航班种类修改 | 597 | //航班种类修改 |
| ... | @@ -608,7 +607,7 @@ export default { | ... | @@ -608,7 +607,7 @@ export default { |
| 608 | } | 607 | } |
| 609 | } | 608 | } |
| 610 | }) | 609 | }) |
| 611 | - this.$refs.routeSelect.$forceUpdate() | 610 | + // this.$refs.routeSelect.$forceUpdate() |
| 612 | }, | 611 | }, |
| 613 | //查询条件数据源 | 612 | //查询条件数据源 |
| 614 | findFltConditionData() { | 613 | findFltConditionData() { |
| ... | @@ -853,12 +852,24 @@ export default { | ... | @@ -853,12 +852,24 @@ export default { |
| 853 | params: obj | 852 | params: obj |
| 854 | }) | 853 | }) |
| 855 | }, | 854 | }, |
| 855 | + // 航班状态 | ||
| 856 | + flightState(multipleSelection, statusName){ | ||
| 857 | + let flightState = multipleSelection.some(item=>item.statusName == statusName); | ||
| 858 | + if(flightState){ | ||
| 859 | + this.msgError(`勾选的航班,航班状态为${statusName},不可操作该按钮`); | ||
| 860 | + }else{ | ||
| 861 | + flightState = false | ||
| 862 | + } | ||
| 863 | + return flightState | ||
| 864 | + }, | ||
| 856 | /** 删除按钮操作 */ | 865 | /** 删除按钮操作 */ |
| 857 | handleDelete(row) { | 866 | handleDelete(row) { |
| 858 | let fIds = []; | 867 | let fIds = []; |
| 859 | this.ids.forEach(item => { | 868 | this.ids.forEach(item => { |
| 860 | fIds.push(item.id) | 869 | fIds.push(item.id) |
| 861 | - }) | 870 | + }); |
| 871 | + // 航班状态 | ||
| 872 | + if(this.flightState(this.ids, "已删除")) return | ||
| 862 | this.$confirm("是否确认删除所选数据?", "警告", { | 873 | this.$confirm("是否确认删除所选数据?", "警告", { |
| 863 | confirmButtonText: "确定", | 874 | confirmButtonText: "确定", |
| 864 | cancelButtonText: "取消", | 875 | cancelButtonText: "取消", |
| ... | @@ -965,6 +976,8 @@ export default { | ... | @@ -965,6 +976,8 @@ export default { |
| 965 | }, | 976 | }, |
| 966 | //批量开启/关闭航班 | 977 | //批量开启/关闭航班 |
| 967 | handleFlightStatus(status) { | 978 | handleFlightStatus(status) { |
| 979 | + // 航班状态 | ||
| 980 | + if(this.flightState(this.ids, "已删除")) return | ||
| 968 | let handle = status == "flightStatus80" ? "关闭" : "开启"; | 981 | let handle = status == "flightStatus80" ? "关闭" : "开启"; |
| 969 | let data = { | 982 | let data = { |
| 970 | updateIds: [], | 983 | updateIds: [], |
| ... | @@ -994,6 +1007,8 @@ export default { | ... | @@ -994,6 +1007,8 @@ export default { |
| 994 | }, | 1007 | }, |
| 995 | //自动推送开关 | 1008 | //自动推送开关 |
| 996 | autoPushBatch(status) { | 1009 | autoPushBatch(status) { |
| 1010 | + // 航班状态 | ||
| 1011 | + if(this.flightState(this.ids, "已删除")) return | ||
| 997 | let msg = status == "open" ? "开启" : "关闭"; | 1012 | let msg = status == "open" ? "开启" : "关闭"; |
| 998 | let data = { | 1013 | let data = { |
| 999 | updateIds: [], | 1014 | updateIds: [], |
| ... | @@ -1031,6 +1046,8 @@ export default { | ... | @@ -1031,6 +1046,8 @@ export default { |
| 1031 | }, | 1046 | }, |
| 1032 | //白名单配舱开关 | 1047 | //白名单配舱开关 |
| 1033 | whiteListSwitchStatus(val) { | 1048 | whiteListSwitchStatus(val) { |
| 1049 | + // 航班状态 | ||
| 1050 | + if(this.flightState(this.ids, "已删除")) return | ||
| 1034 | let obj = { | 1051 | let obj = { |
| 1035 | updateIds: [] | 1052 | updateIds: [] |
| 1036 | } | 1053 | } |
| ... | @@ -1051,6 +1068,8 @@ export default { | ... | @@ -1051,6 +1068,8 @@ export default { |
| 1051 | }, | 1068 | }, |
| 1052 | //黑名单配舱开关 | 1069 | //黑名单配舱开关 |
| 1053 | BlackListSwitchStatus(val) { | 1070 | BlackListSwitchStatus(val) { |
| 1071 | + // 航班状态 | ||
| 1072 | + if(this.flightState(this.ids, "已删除")) return | ||
| 1054 | let obj = { | 1073 | let obj = { |
| 1055 | updateIds: [] | 1074 | updateIds: [] |
| 1056 | } | 1075 | } |
| ... | @@ -1072,6 +1091,10 @@ export default { | ... | @@ -1072,6 +1091,10 @@ export default { |
| 1072 | //航线修改 | 1091 | //航线修改 |
| 1073 | routeChange(val) { | 1092 | routeChange(val) { |
| 1074 | this.$forceUpdate() | 1093 | this.$forceUpdate() |
| 1094 | + if(val.length){ | ||
| 1095 | + // this.rules.route.required = false | ||
| 1096 | + } | ||
| 1097 | + console.log(this.form.route) | ||
| 1075 | }, | 1098 | }, |
| 1076 | //多选框选中数据 | 1099 | //多选框选中数据 |
| 1077 | tableSelect(val) { | 1100 | tableSelect(val) { | ... | ... |
| 1 | -export const formConfig = [ | ||
| 2 | - { | ||
| 3 | - label: "重量(KG)", | ||
| 4 | - type: "Input", | ||
| 5 | - name: "minWeight", | ||
| 6 | - prop: "minWeight", | ||
| 7 | - placeholder: "0", | ||
| 8 | - rules: { | ||
| 9 | - required: true, | ||
| 10 | - message: "最大重量不得小于0KG", | ||
| 11 | - trigger: ["change", "blur"], | ||
| 12 | - }, | ||
| 13 | - trigger: "blur", // 事件名 | ||
| 14 | - }, | ||
| 15 | - { | ||
| 16 | - label: "", | ||
| 17 | - type: "Input", | ||
| 18 | - name: "maxWeight", | ||
| 19 | - prop: "maxWeight", | ||
| 20 | - placeholder: "34", | ||
| 21 | - rules: { | ||
| 22 | - required: true, | ||
| 23 | - message: "最大重量不得大于34KG", | ||
| 24 | - trigger: ["change", "blur"], | ||
| 25 | - }, | ||
| 26 | - trigger: "blur", // 事件名 | ||
| 27 | - }, | ||
| 28 | - { | ||
| 29 | - label: "件数", | ||
| 30 | - type: "Input", | ||
| 31 | - name: "minNumOfPieces", | ||
| 32 | - prop: "minNumOfPieces", | ||
| 33 | - placeholder: "0", | ||
| 34 | - rules: { | ||
| 35 | - required: true, | ||
| 36 | - message: "最大重量不得小于0KG", | ||
| 37 | - trigger: ["change", "blur"], | ||
| 38 | - }, | ||
| 39 | - trigger: "blur", // 事件名 | ||
| 40 | - }, | ||
| 41 | - { | ||
| 42 | - label: "", | ||
| 43 | - type: "Input", | ||
| 44 | - name: "maxNumOfPieces", | ||
| 45 | - prop: "maxNumOfPieces", | ||
| 46 | - placeholder: "34", | ||
| 47 | - rules: { | ||
| 48 | - required: true, | ||
| 49 | - message: "最大重量不得大于34KG", | ||
| 50 | - trigger: ["change", "blur"], | ||
| 51 | - }, | ||
| 52 | - trigger: "blur", // 事件名 | ||
| 53 | - }, | ||
| 54 | -]; |
This diff is collapsed. Click to expand it.
| 1 | -export default { | ||
| 2 | - methods: { | ||
| 3 | - // 获取字典 | ||
| 4 | - getObj({ serviceCode }) { | ||
| 5 | - let service_Code = []; | ||
| 6 | - serviceCode.map((item) => { | ||
| 7 | - service_Code.push(item.chineseName); | ||
| 8 | - }); | ||
| 9 | - this.serviceCodeData = service_Code; | ||
| 10 | - }, | ||
| 11 | - // 处理serviceCode包不包含 | ||
| 12 | - serviceCodeCofig() { | ||
| 13 | - let str = this.serviceCode.replace(/;|;/g, ","); | ||
| 14 | - let arr = str.split(","); | ||
| 15 | - if (arr[arr.length - 1] == "") { | ||
| 16 | - arr.splice(arr.length - 1, 1); | ||
| 17 | - } | ||
| 18 | - let noHasCode = this.serviceCodeData.filter( | ||
| 19 | - (v) => !arr.some((val) => val == v) | ||
| 20 | - ); | ||
| 21 | - let hasCode = this.serviceCodeData.filter((v) => | ||
| 22 | - arr.some((val) => val == v) | ||
| 23 | - ); | ||
| 24 | - let includeCode = arr.filter((v) => !hasCode.some((val) => val == v)); | ||
| 25 | - return { | ||
| 26 | - include: hasCode, | ||
| 27 | - noInclude: includeCode, | ||
| 28 | - }; | ||
| 29 | - }, | ||
| 30 | - // radio包含不包含serviceCode | ||
| 31 | - changeIsServiceCode(val) { | ||
| 32 | - // 勾选的时候去校验 || 输入的时候去校验 | ||
| 33 | - if (val == 1) { | ||
| 34 | - if (this.serviceCodeCofig().noInclude.length) { | ||
| 35 | - let tip = this.serviceCodeCofig().noInclude.toString(); | ||
| 36 | - this.msgError(`${tip} 不包含`); | ||
| 37 | - } | ||
| 38 | - } else { | ||
| 39 | - if (this.serviceCodeCofig().include.length) { | ||
| 40 | - let tip = this.serviceCodeCofig().include.toString(); | ||
| 41 | - this.msgError(`${tip} 已包含`); | ||
| 42 | - } | ||
| 43 | - } | ||
| 44 | - }, | ||
| 45 | - // serviceCode失焦事件 | ||
| 46 | - serviceCodeBlur() { | ||
| 47 | - if (this.isServiceCode == "1") { | ||
| 48 | - if (this.serviceCodeCofig().noInclude.length) { | ||
| 49 | - let tip = this.serviceCodeCofig().noInclude.toString(); | ||
| 50 | - // this.msgError(`${tip} 不包含`); | ||
| 51 | - } | ||
| 52 | - } else { | ||
| 53 | - if (this.serviceCodeCofig().include.length) { | ||
| 54 | - let tip = this.serviceCodeCofig().include.toString(); | ||
| 55 | - // this.msgError(`${tip} 已包含`); | ||
| 56 | - } | ||
| 57 | - } | ||
| 58 | - }, | ||
| 59 | - }, | ||
| 60 | -}; |
| 1 | -export const tableAttr = { | ||
| 2 | - border: true, | ||
| 3 | - loadingTable: false, | ||
| 4 | - isDragSort: true, // 拖拽tableData数据一定要加id字段 | ||
| 5 | - maxHeight: 300, | ||
| 6 | - btnCofig: { | ||
| 7 | - isBtn: false, | ||
| 8 | - btnGroup: [ | ||
| 9 | - { | ||
| 10 | - type: "primary", | ||
| 11 | - icon: "el-icon-plus", | ||
| 12 | - btnName: "添加", | ||
| 13 | - size: "mini", | ||
| 14 | - round: false, | ||
| 15 | - loading: false, | ||
| 16 | - event: "add", | ||
| 17 | - }, | ||
| 18 | - ], | ||
| 19 | - }, | ||
| 20 | -}; | ||
| 21 | - | ||
| 22 | -export const columnHeader = (deleteRow) => [ | ||
| 23 | - { | ||
| 24 | - label: "航班号", | ||
| 25 | - prop: "flightNo", | ||
| 26 | - align: "center", | ||
| 27 | - minWidth: 100, | ||
| 28 | - }, | ||
| 29 | - { | ||
| 30 | - label: "航班日期", | ||
| 31 | - prop: "calculateDay", | ||
| 32 | - align: "center", | ||
| 33 | - minWidth: 100, | ||
| 34 | - // sortable: true, | ||
| 35 | - // "sort-method": (a, b) => b.updateTime - a.updateTime, | ||
| 36 | - }, | ||
| 37 | - { | ||
| 38 | - label: "航线", | ||
| 39 | - prop: "flightRoute", | ||
| 40 | - align: "center", | ||
| 41 | - minWidth: 100, | ||
| 42 | - }, | ||
| 43 | - { | ||
| 44 | - label: "爆仓是否继续配舱", | ||
| 45 | - prop: "permitOverweight", | ||
| 46 | - align: "center", | ||
| 47 | - minWidth: 100, | ||
| 48 | - render: (h, params) => { | ||
| 49 | - const { row } = params; | ||
| 50 | - console.log(345678, row); | ||
| 51 | - // return h("div", `状态-${row.id}`); | ||
| 52 | - }, | ||
| 53 | - }, | ||
| 54 | - { | ||
| 55 | - label: "操作", | ||
| 56 | - align: "center", | ||
| 57 | - minWidth: 120, | ||
| 58 | - render: (h, params) => { | ||
| 59 | - return h("div", [ | ||
| 60 | - h( | ||
| 61 | - "el-button", | ||
| 62 | - { | ||
| 63 | - style: { | ||
| 64 | - color: "#ff4949", | ||
| 65 | - }, | ||
| 66 | - props: { | ||
| 67 | - type: "text", | ||
| 68 | - size: "mini", | ||
| 69 | - icon: "el-icon-delete", | ||
| 70 | - }, | ||
| 71 | - on: { | ||
| 72 | - click() { | ||
| 73 | - deleteRow(params); | ||
| 74 | - }, | ||
| 75 | - }, | ||
| 76 | - }, | ||
| 77 | - "删除" | ||
| 78 | - ), | ||
| 79 | - ]); | ||
| 80 | - }, | ||
| 81 | - }, | ||
| 82 | -]; |
| 1 | -export const formConfig = [ | ||
| 2 | - { | ||
| 3 | - label: "原航班", | ||
| 4 | - type: "Input", | ||
| 5 | - name: "originOfFlightNo", | ||
| 6 | - prop: "originOfFlightNo", | ||
| 7 | - placeholder: "请输入原航班号", | ||
| 8 | - span: 5, | ||
| 9 | - trigger: "blur", | ||
| 10 | - labelWidth: "55px", | ||
| 11 | - }, | ||
| 12 | - { | ||
| 13 | - label: "修改时间 从", | ||
| 14 | - type: "Date", | ||
| 15 | - name: "startTime", | ||
| 16 | - prop: "startTime", | ||
| 17 | - placeholder: "请选择开始时间", | ||
| 18 | - // rules: { required: true, message: "请选择开始时间", trigger: "blur" }, | ||
| 19 | - format: "yyyy-MM-dd", | ||
| 20 | - colWidth: "23%", | ||
| 21 | - inputWidth: "100%", | ||
| 22 | - }, | ||
| 23 | - { | ||
| 24 | - label: "到", | ||
| 25 | - type: "Date", | ||
| 26 | - name: "endTime", | ||
| 27 | - prop: "endTime", | ||
| 28 | - placeholder: "请选择结束时间", | ||
| 29 | - // rules: { required: true, message: "请选择结束时间", trigger: "blur" }, | ||
| 30 | - format: "yyyy-MM-dd", | ||
| 31 | - colWidth: "20%", | ||
| 32 | - labelWidth: "20px", | ||
| 33 | - inputWidth: "100%", | ||
| 34 | - }, | ||
| 35 | - { | ||
| 36 | - label: "规则状态", | ||
| 37 | - type: "Select", | ||
| 38 | - name: "status", | ||
| 39 | - prop: "status", | ||
| 40 | - placeholder: "请选择状态", | ||
| 41 | - options: { | ||
| 42 | - data: [ | ||
| 43 | - { | ||
| 44 | - value: "1", | ||
| 45 | - label: "有效", | ||
| 46 | - }, | ||
| 47 | - { | ||
| 48 | - value: "0", | ||
| 49 | - label: "无效", | ||
| 50 | - }, | ||
| 51 | - ], | ||
| 52 | - label: "有效", | ||
| 53 | - value: "1", | ||
| 54 | - }, | ||
| 55 | - colWidth: "18%", | ||
| 56 | - labelWidth: "70px", | ||
| 57 | - inputWidth: "100%", | ||
| 58 | - }, | ||
| 59 | -]; | ||
| 60 | - | ||
| 61 | -export const editFormConfig = [ | ||
| 62 | - { | ||
| 63 | - label: "航班号", | ||
| 64 | - type: "Search", | ||
| 65 | - name: "route", | ||
| 66 | - prop: "fltNo", | ||
| 67 | - placeholder: "请输入航班号", | ||
| 68 | - rules: { | ||
| 69 | - required: true, | ||
| 70 | - message: "请输入航班号", | ||
| 71 | - trigger: ["change", "blur"], | ||
| 72 | - }, | ||
| 73 | - http: { | ||
| 74 | - url: "/dictionary/queryRouteByFltNo", | ||
| 75 | - method: "post", | ||
| 76 | - data: { | ||
| 77 | - fltNo: "", | ||
| 78 | - }, | ||
| 79 | - }, | ||
| 80 | - }, | ||
| 81 | - { | ||
| 82 | - label: "", | ||
| 83 | - type: "inputNumber", | ||
| 84 | - name: "count", | ||
| 85 | - prop: "count", | ||
| 86 | - placeholder: "+", | ||
| 87 | - min: 0, | ||
| 88 | - max: 7, | ||
| 89 | - with: "50px", | ||
| 90 | - }, | ||
| 91 | - { | ||
| 92 | - label: "航线优先级", | ||
| 93 | - type: "Input", | ||
| 94 | - name: "route", | ||
| 95 | - prop: "fltNum", | ||
| 96 | - placeholder: "请选择航线优先级", | ||
| 97 | - trigger: "focus", | ||
| 98 | - }, | ||
| 99 | - { | ||
| 100 | - label: "爆仓是否继续配舱", | ||
| 101 | - type: "Checkbox", | ||
| 102 | - name: "checked", | ||
| 103 | - prop: "checked", | ||
| 104 | - disabled: false, | ||
| 105 | - }, | ||
| 106 | -]; |
| 1 | -<template> | ||
| 2 | - <div ref="formHeaderRef" class="form-header container"> | ||
| 3 | - <el-row> | ||
| 4 | - <el-col> | ||
| 5 | - <yl-form | ||
| 6 | - ref="ruleForm" | ||
| 7 | - :formConfig="formConfig" | ||
| 8 | - :queryForm="queryForm" | ||
| 9 | - :inline="false" | ||
| 10 | - formWidth="auto" | ||
| 11 | - @blur="blurEvent" | ||
| 12 | - /> | ||
| 13 | - </el-col> | ||
| 14 | - </el-row> | ||
| 15 | - <yl-table | ||
| 16 | - ref="ylTable" | ||
| 17 | - :attrs="tableAttr" | ||
| 18 | - :loadingTable="tableAttr.loadingTable" | ||
| 19 | - :columns="columns" | ||
| 20 | - :tableData="tableData" | ||
| 21 | - :pageConfig="pageConfig" | ||
| 22 | - @sizeChange="handleSizeChange" | ||
| 23 | - @currentChange="handleCurrentChange" | ||
| 24 | - @search="searchBtn" | ||
| 25 | - @add="addBtn" | ||
| 26 | - > | ||
| 27 | - </yl-table> | ||
| 28 | - </div> | ||
| 29 | -</template> | ||
| 30 | -<script> | ||
| 31 | -import YlForm from "@/components/YlForm"; | ||
| 32 | -import YlTable from "@/components/YlTable"; | ||
| 33 | -import { formConfig } from "./formConfig"; | ||
| 34 | -import { tableAttr, columnHeader } from "./tableConfig"; | ||
| 35 | -import { restTableHeight, sortList } from "@/utils"; | ||
| 36 | -import { | ||
| 37 | - findAllEtesRules, // ET86查询 | ||
| 38 | - deleteEtesRuleById, // 删除 | ||
| 39 | -} from "@/api/et86"; | ||
| 40 | -export default { | ||
| 41 | - components: { | ||
| 42 | - YlForm, | ||
| 43 | - YlTable, | ||
| 44 | - }, | ||
| 45 | - data() { | ||
| 46 | - return { | ||
| 47 | - formConfig: formConfig, // 表单配置项 | ||
| 48 | - queryForm: { | ||
| 49 | - // 表单参数 | ||
| 50 | - status: "有效", | ||
| 51 | - }, | ||
| 52 | - pageConfig: { | ||
| 53 | - // 分页配置项 | ||
| 54 | - isPagination: true, | ||
| 55 | - total: 0, | ||
| 56 | - pageData: { | ||
| 57 | - page: 1, | ||
| 58 | - size: 10, | ||
| 59 | - }, | ||
| 60 | - }, | ||
| 61 | - tableAttr: tableAttr, // table配置项 | ||
| 62 | - columns: columnHeader(this.viewRow, this.editRow, this.deleteRow), // 表头 | ||
| 63 | - tableData: [], // 表格数据 | ||
| 64 | - }; | ||
| 65 | - }, | ||
| 66 | - created() { | ||
| 67 | - // ET86查询 | ||
| 68 | - this.$nextTick(() => { | ||
| 69 | - this.searchBtn(); | ||
| 70 | - }); | ||
| 71 | - }, | ||
| 72 | - mounted() { | ||
| 73 | - this.$nextTick(() => { | ||
| 74 | - this.tableAttr.maxHeight = | ||
| 75 | - window.innerHeight - restTableHeight(this.$refs); | ||
| 76 | - }); | ||
| 77 | - }, | ||
| 78 | - methods: { | ||
| 79 | - // ET86查询 | ||
| 80 | - queryFindAllEtesRules() { | ||
| 81 | - const { page, size } = this.pageConfig.pageData; | ||
| 82 | - let params = { | ||
| 83 | - originOfFlightNo: this.queryForm.originOfFlightNo, | ||
| 84 | - updateTimeStart: this.queryForm.startTime | ||
| 85 | - ? this.queryForm.startTime | ||
| 86 | - : "", | ||
| 87 | - updateTimeEnd: this.queryForm.endTime ? this.queryForm.endTime : "", | ||
| 88 | - limitStart: (page - 1) * size, | ||
| 89 | - limitSize: size, | ||
| 90 | - status: this.queryForm.status, | ||
| 91 | - }; | ||
| 92 | - if (this.queryForm.status == "有效") { | ||
| 93 | - params.status = "1"; | ||
| 94 | - } | ||
| 95 | - this.tableAttr.loadingTable = true; | ||
| 96 | - findAllEtesRules(params) | ||
| 97 | - .then((res) => { | ||
| 98 | - this.tableAttr.loadingTable = false; | ||
| 99 | - const { code, data } = res; | ||
| 100 | - if (code == 200) { | ||
| 101 | - const valid = data.list.filter((item) => item.status == "1"); // 有效 | ||
| 102 | - const invalid = data.list.filter((item) => item.status == "0"); // 无效 | ||
| 103 | - // valid.reverse(); // 有效航班修改时间排序 | ||
| 104 | - // invalid.reverse(); // | ||
| 105 | - // const newValid = sortList(valid, "originOfFlightNo"); // 有效原航班按字母排序 | ||
| 106 | - // const newInvalid = sortList(invalid, "originOfFlightNo"); | ||
| 107 | - // this.tableData = newValid.concat(newInvalid); | ||
| 108 | - this.tableData = valid.concat(invalid); | ||
| 109 | - this.pageConfig.total = data.total; | ||
| 110 | - } | ||
| 111 | - }) | ||
| 112 | - .catch(() => {}); | ||
| 113 | - }, | ||
| 114 | - // 失焦事件 | ||
| 115 | - blurEvent({ originOfFlightNo }) { | ||
| 116 | - this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo); | ||
| 117 | - }, | ||
| 118 | - // 搜索 | ||
| 119 | - searchBtn() { | ||
| 120 | - this.pageConfig.pageData.page = 1; | ||
| 121 | - this.pageConfig.pageData.size = 10; | ||
| 122 | - this.$refs.ruleForm.handleSearch("ruleForm", (val) => { | ||
| 123 | - this.queryFindAllEtesRules(); | ||
| 124 | - }); | ||
| 125 | - }, | ||
| 126 | - //条数变化 | ||
| 127 | - handleSizeChange(e) { | ||
| 128 | - this.pageConfig.pageData.size = e; | ||
| 129 | - this.pageConfig.pageData.page = 1; | ||
| 130 | - this.queryFindAllEtesRules(); | ||
| 131 | - }, | ||
| 132 | - //页码变化 | ||
| 133 | - handleCurrentChange(e) { | ||
| 134 | - this.pageConfig.pageData.page = e; | ||
| 135 | - this.queryFindAllEtesRules(); | ||
| 136 | - }, | ||
| 137 | - // 添加 | ||
| 138 | - addBtn(item) { | ||
| 139 | - this.$router.push({ | ||
| 140 | - path: "/edit", | ||
| 141 | - query: { | ||
| 142 | - name: "add", | ||
| 143 | - }, | ||
| 144 | - }); | ||
| 145 | - }, | ||
| 146 | - // 重置表单 | ||
| 147 | - restForm() { | ||
| 148 | - this.$refs.ruleForm.resetFields("ruleForm"); | ||
| 149 | - }, | ||
| 150 | - // 查看 | ||
| 151 | - viewRow({ row }) { | ||
| 152 | - this.$router.push({ | ||
| 153 | - path: "/edit", | ||
| 154 | - query: { | ||
| 155 | - name: "view", | ||
| 156 | - id: row.id, | ||
| 157 | - status: row.status, | ||
| 158 | - }, | ||
| 159 | - }); | ||
| 160 | - }, | ||
| 161 | - // 编辑 | ||
| 162 | - editRow({ row }) { | ||
| 163 | - this.$router.push({ | ||
| 164 | - path: "/edit", | ||
| 165 | - query: { | ||
| 166 | - name: "edit", | ||
| 167 | - id: row.id, | ||
| 168 | - status: row.status, | ||
| 169 | - }, | ||
| 170 | - }); | ||
| 171 | - }, | ||
| 172 | - // 删除 | ||
| 173 | - deleteRow({ row }) { | ||
| 174 | - this.$confirm("是否确认删除? 删除后该规则设置为无效,不可恢复", "提示", { | ||
| 175 | - confirmButtonText: "确定", | ||
| 176 | - cancelButtonText: "取消", | ||
| 177 | - type: "warning", | ||
| 178 | - center: true, | ||
| 179 | - }) | ||
| 180 | - .then(() => { | ||
| 181 | - deleteEtesRuleById({ id: row.id }).then((res) => { | ||
| 182 | - const { code, msg } = res; | ||
| 183 | - if (code == 200) { | ||
| 184 | - this.searchBtn(); | ||
| 185 | - this.msgSuccess("删除成功!"); | ||
| 186 | - } else { | ||
| 187 | - this.msgError(msg || "删除失败"); | ||
| 188 | - } | ||
| 189 | - }); | ||
| 190 | - }) | ||
| 191 | - .catch(() => {}); | ||
| 192 | - }, | ||
| 193 | - }, | ||
| 194 | -}; | ||
| 195 | -</script> | ||
| 196 | -<style lang="scss" scoped></style> |
| 1 | -const state = { | ||
| 2 | - 1: "有效", | ||
| 3 | - 0: "无效", | ||
| 4 | -}; | ||
| 5 | -export const tableAttr = { | ||
| 6 | - border: true, | ||
| 7 | - loadingTable: false, | ||
| 8 | - isDragSort: false, // 拖拽tableData数据一定要加id字段 | ||
| 9 | - maxHeight: 0, | ||
| 10 | - // defaultSort: { prop: "updateTime", order: "descending" }, | ||
| 11 | - btnCofig: { | ||
| 12 | - isBtn: true, | ||
| 13 | - btnGroup: [ | ||
| 14 | - { | ||
| 15 | - type: "primary", // text、primary、danger | ||
| 16 | - icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right | ||
| 17 | - btnName: "搜索", | ||
| 18 | - size: "mini", // medium / small / mini | ||
| 19 | - round: false, | ||
| 20 | - loading: false, | ||
| 21 | - event: "search", | ||
| 22 | - }, | ||
| 23 | - { | ||
| 24 | - type: "primary", | ||
| 25 | - icon: "el-icon-plus", | ||
| 26 | - btnName: "添加", | ||
| 27 | - size: "mini", | ||
| 28 | - round: false, | ||
| 29 | - loading: false, | ||
| 30 | - event: "add", | ||
| 31 | - }, | ||
| 32 | - ], | ||
| 33 | - }, | ||
| 34 | -}; | ||
| 35 | -export const columnHeader = (viewRow, editRow, deleteRow) => [ | ||
| 36 | - { | ||
| 37 | - type: "index", | ||
| 38 | - label: "序号", | ||
| 39 | - prop: "id", | ||
| 40 | - align: "center", | ||
| 41 | - width: "50", | ||
| 42 | - }, | ||
| 43 | - { | ||
| 44 | - label: "原航班", | ||
| 45 | - prop: "originOfFlightNo", | ||
| 46 | - align: "center", | ||
| 47 | - minWidth: 80, | ||
| 48 | - }, | ||
| 49 | - { | ||
| 50 | - label: "配载航班", | ||
| 51 | - prop: "rankFltNoStr", | ||
| 52 | - align: "center", | ||
| 53 | - minWidth: 120, | ||
| 54 | - }, | ||
| 55 | - { | ||
| 56 | - label: "航线", | ||
| 57 | - prop: "rankFltRouteStr", | ||
| 58 | - align: "center", | ||
| 59 | - minWidth: 140, | ||
| 60 | - }, | ||
| 61 | - { | ||
| 62 | - label: "状态", | ||
| 63 | - prop: "status", | ||
| 64 | - align: "center", | ||
| 65 | - minWidth: 50, | ||
| 66 | - render: (h, params) => { | ||
| 67 | - const { row } = params; | ||
| 68 | - return h("div", `${state[row.status]}`); | ||
| 69 | - }, | ||
| 70 | - }, | ||
| 71 | - { | ||
| 72 | - label: "修改时间", | ||
| 73 | - prop: "updateTime", | ||
| 74 | - align: "center", | ||
| 75 | - minWidth: 80, | ||
| 76 | - // sortable: true, | ||
| 77 | - // "sort-method": (a, b) => a.createTime - b.createTime, | ||
| 78 | - }, | ||
| 79 | - { | ||
| 80 | - label: "修改人", | ||
| 81 | - prop: "updateUserName", | ||
| 82 | - align: "center", | ||
| 83 | - minWidth: 60, | ||
| 84 | - }, | ||
| 85 | - { | ||
| 86 | - label: "操作", | ||
| 87 | - prop: "operate", | ||
| 88 | - align: "center", | ||
| 89 | - minWidth: 90, | ||
| 90 | - fixed: "right", | ||
| 91 | - render: (h, params) => { | ||
| 92 | - let operateData = [] | ||
| 93 | - if (params.row.status == "1") { | ||
| 94 | - operateData = [ | ||
| 95 | - h( | ||
| 96 | - "el-button", | ||
| 97 | - { | ||
| 98 | - props: { | ||
| 99 | - type: "text", | ||
| 100 | - size: "mini", | ||
| 101 | - icon: "el-icon-view", | ||
| 102 | - }, | ||
| 103 | - on: { | ||
| 104 | - click() { | ||
| 105 | - viewRow(params); | ||
| 106 | - }, | ||
| 107 | - }, | ||
| 108 | - }, | ||
| 109 | - "查看" | ||
| 110 | - ), | ||
| 111 | - h( | ||
| 112 | - "el-button", | ||
| 113 | - { | ||
| 114 | - props: { | ||
| 115 | - type: "text", | ||
| 116 | - size: "mini", | ||
| 117 | - icon: "el-icon-edit", | ||
| 118 | - }, | ||
| 119 | - on: { | ||
| 120 | - click() { | ||
| 121 | - editRow(params); | ||
| 122 | - }, | ||
| 123 | - }, | ||
| 124 | - }, | ||
| 125 | - "修改" | ||
| 126 | - ), | ||
| 127 | - h( | ||
| 128 | - "el-button", | ||
| 129 | - { | ||
| 130 | - style: { | ||
| 131 | - color: "#ff4949", | ||
| 132 | - }, | ||
| 133 | - props: { | ||
| 134 | - type: "text", | ||
| 135 | - size: "mini", | ||
| 136 | - icon: "el-icon-delete", | ||
| 137 | - }, | ||
| 138 | - on: { | ||
| 139 | - click() { | ||
| 140 | - deleteRow(params); | ||
| 141 | - }, | ||
| 142 | - }, | ||
| 143 | - }, | ||
| 144 | - "删除" | ||
| 145 | - ), | ||
| 146 | - ]; | ||
| 147 | - }else{ | ||
| 148 | - operateData = [ | ||
| 149 | - h( | ||
| 150 | - "el-button", | ||
| 151 | - { | ||
| 152 | - props: { | ||
| 153 | - type: "text", | ||
| 154 | - size: "mini", | ||
| 155 | - icon: "el-icon-view", | ||
| 156 | - }, | ||
| 157 | - on: { | ||
| 158 | - click() { | ||
| 159 | - viewRow(params); | ||
| 160 | - }, | ||
| 161 | - }, | ||
| 162 | - }, | ||
| 163 | - "查看" | ||
| 164 | - ), | ||
| 165 | - ]; | ||
| 166 | - } | ||
| 167 | - return h("div", operateData); | ||
| 168 | - }, | ||
| 169 | - }, | ||
| 170 | -]; |
| ... | @@ -100,11 +100,6 @@ | ... | @@ -100,11 +100,6 @@ |
| 100 | }}<i class="el-icon-link"></i> </el-link> | 100 | }}<i class="el-icon-link"></i> </el-link> |
| 101 | </template> | 101 | </template> |
| 102 | <template slot="optionColumn"> | 102 | <template slot="optionColumn"> |
| 103 | - <!-- <el-table-column label="是否为ET86航线" align="center"> | ||
| 104 | - <template slot-scope="scope"> | ||
| 105 | - <el-checkbox v-model="scope.row.isEtesRoute" @change="checkboxIsEtesRoute(scope)"></el-checkbox> | ||
| 106 | - </template> | ||
| 107 | - </el-table-column> --> | ||
| 108 | <el-table-column label="操作" align="center"> | 103 | <el-table-column label="操作" align="center"> |
| 109 | <template slot-scope="scope"> | 104 | <template slot-scope="scope"> |
| 110 | <el-button size="mini" type="text" style="color:#ff4949" icon="el-icon-delete" | 105 | <el-button size="mini" type="text" style="color:#ff4949" icon="el-icon-delete" |
| ... | @@ -349,22 +344,6 @@ export default { | ... | @@ -349,22 +344,6 @@ export default { |
| 349 | this.flightDel([val.id]) | 344 | this.flightDel([val.id]) |
| 350 | } else if (this.tableName === '航线') { | 345 | } else if (this.tableName === '航线') { |
| 351 | this.routeDel({ data: [val], id: [val.id] }) | 346 | this.routeDel({ data: [val], id: [val.id] }) |
| 352 | - /* | ||
| 353 | - 如果该航线是普通航线直接删,如果是ET86航线,那么要查询该航线有没有设置维度, | ||
| 354 | - 如果没有直接删,如果已经设置了维度是否考虑将该航线下的维度删掉再进行操作; | ||
| 355 | - */ | ||
| 356 | - if(!val.isEtesRoute){ // 普通航线 | ||
| 357 | - this.routeDel({ data: [val], id: [val.id] }) | ||
| 358 | - }else{ // ET86航线 | ||
| 359 | - this.$confirm("该航线是ET86航线。是否要删除", "注意!", { | ||
| 360 | - closeOnClickModal: false, | ||
| 361 | - confirmButtonText: "确定删除", | ||
| 362 | - cancelButtonText: "取消", | ||
| 363 | - type: "warning", | ||
| 364 | - }).then(() => { | ||
| 365 | - this.routeDel({ data: [val], id: [val.id] }) | ||
| 366 | - }).catch(() => { }) | ||
| 367 | - } | ||
| 368 | } else { | 347 | } else { |
| 369 | this.dicDel([val.id]) | 348 | this.dicDel([val.id]) |
| 370 | } | 349 | } | ... | ... |
-
Please register or login to post a comment