Showing
20 changed files
with
42 additions
and
2490 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
| 1 | -<template> | ||
| 2 | - <div | ||
| 3 | - class="ylform" | ||
| 4 | - :class="inline == true ? 'the-form' : ''" | ||
| 5 | - :style="{ marginBottom: `${marginBottom}px` }" | ||
| 6 | - > | ||
| 7 | - <el-form | ||
| 8 | - :model="tempQueryForm" | ||
| 9 | - :inline="inline" | ||
| 10 | - :label-position="position" | ||
| 11 | - :label-width="formWidth" | ||
| 12 | - :loading="loading" | ||
| 13 | - ref="ruleForm" | ||
| 14 | - :size="size" | ||
| 15 | - > | ||
| 16 | - <el-row | ||
| 17 | - :gutter="rowGutter" | ||
| 18 | - :type="rowType" | ||
| 19 | - :justify="rowJustify" | ||
| 20 | - :align="rowAlign" | ||
| 21 | - :tag="rowTag" | ||
| 22 | - > | ||
| 23 | - <el-col | ||
| 24 | - v-for="item in tempFormConfig" | ||
| 25 | - :span="item.span" | ||
| 26 | - :offset="item.offset" | ||
| 27 | - :tag="item.tag" | ||
| 28 | - :push="item.push" | ||
| 29 | - :pull="item.pull" | ||
| 30 | - :xs="item.xs" | ||
| 31 | - :sm="item.sm" | ||
| 32 | - :md="item.md" | ||
| 33 | - :lg="item.lg" | ||
| 34 | - :xl="item.xl" | ||
| 35 | - :style="{ width: item.colWidth }" | ||
| 36 | - :key="item.prop" | ||
| 37 | - > | ||
| 38 | - <el-form-item | ||
| 39 | - :label="item.label" | ||
| 40 | - :prop="item.prop" | ||
| 41 | - :rules="item.rules" | ||
| 42 | - :label-width="item.labelWidth" | ||
| 43 | - > | ||
| 44 | - <!-- 输入框 --> | ||
| 45 | - <el-input | ||
| 46 | - v-if="item.type === 'Input'" | ||
| 47 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 48 | - :style="{ width: item.inputWidth }" | ||
| 49 | - :disabled="item.disable" | ||
| 50 | - :placeholder=" | ||
| 51 | - item.placeholder ? item.placeholder : '请输入' + item.label | ||
| 52 | - " | ||
| 53 | - v-on:[item.trigger]=" | ||
| 54 | - (e) => { | ||
| 55 | - inputEvent(e, item); | ||
| 56 | - } | ||
| 57 | - " | ||
| 58 | - @keyup.enter.native="toEnterSearch" | ||
| 59 | - clearable | ||
| 60 | - > | ||
| 61 | - </el-input> | ||
| 62 | - <template v-if="view"> | ||
| 63 | - <span v-text="tempQueryForm[item.prop]"></span> | ||
| 64 | - </template> | ||
| 65 | - <!-- 数字输入框 --> | ||
| 66 | - <el-input | ||
| 67 | - v-if="item.type === 'inputNumber'" | ||
| 68 | - type="number" | ||
| 69 | - :min="item.min" | ||
| 70 | - :max="item.max" | ||
| 71 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 72 | - :style="{ width: item.inputWidth }" | ||
| 73 | - :disabled="item.disable" | ||
| 74 | - :placeholder=" | ||
| 75 | - item.placeholder ? item.placeholder : '请输入' + item.label | ||
| 76 | - " | ||
| 77 | - v-on:keyup.enter="value = value.replace(/^-?[0-9]\d*$/, '')" | ||
| 78 | - clearable | ||
| 79 | - > | ||
| 80 | - </el-input> | ||
| 81 | - <!-- InputNumber 计数器 --> | ||
| 82 | - <el-input-number | ||
| 83 | - v-if="item.type === 'Number'" | ||
| 84 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 85 | - :min="0" | ||
| 86 | - :max="10" | ||
| 87 | - :size="item.size" | ||
| 88 | - :style="{ width: item.inputWidth }" | ||
| 89 | - label="描述文字" | ||
| 90 | - ></el-input-number> | ||
| 91 | - | ||
| 92 | - <template v-if="view"> | ||
| 93 | - <span v-text="tempQueryForm[item.prop]"></span> | ||
| 94 | - </template> | ||
| 95 | - | ||
| 96 | - <!-- 下拉选择 --> | ||
| 97 | - <el-select | ||
| 98 | - v-if="item.type === 'Select'" | ||
| 99 | - :multiple="item.multiple" | ||
| 100 | - :filterable="item.filterable" | ||
| 101 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 102 | - :style="{ width: item.inputWidth }" | ||
| 103 | - :disabled="item.disable" | ||
| 104 | - :loading="searchLoading" | ||
| 105 | - :placeholder=" | ||
| 106 | - item.placeholder ? item.placeholder : '请选择' + item.label | ||
| 107 | - " | ||
| 108 | - clearable | ||
| 109 | - > | ||
| 110 | - <el-option | ||
| 111 | - v-for="op in item.options.data" | ||
| 112 | - :label="op[item.options.label] || op.label" | ||
| 113 | - :value="op[item.options.value] || op.value" | ||
| 114 | - :key="op[item.options.value] || op.value" | ||
| 115 | - > | ||
| 116 | - </el-option> | ||
| 117 | - </el-select> | ||
| 118 | - | ||
| 119 | - <!-- 远程搜索 --> | ||
| 120 | - <template v-if="item.type === 'Search'"> | ||
| 121 | - <el-autocomplete | ||
| 122 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 123 | - :style="{ width: item.inputWidth }" | ||
| 124 | - :debounce="1500" | ||
| 125 | - :fetch-suggestions="querySearchAsync" | ||
| 126 | - :placeholder=" | ||
| 127 | - item.placeholder ? item.placeholder : '请选择' + item.label | ||
| 128 | - " | ||
| 129 | - @focus="focusKey(item)" | ||
| 130 | - @select="selectSearch" | ||
| 131 | - clearable | ||
| 132 | - ></el-autocomplete> | ||
| 133 | - </template> | ||
| 134 | - | ||
| 135 | - <!-- 日期 --> | ||
| 136 | - <el-date-picker | ||
| 137 | - v-if="item.type === 'Date'" | ||
| 138 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 139 | - :style="{ width: item.inputWidth }" | ||
| 140 | - :disabled="item.disable" | ||
| 141 | - :placeholder="item.placeholder ? item.placeholder : '请选择日期'" | ||
| 142 | - :value-format="item.format" | ||
| 143 | - clearable | ||
| 144 | - > | ||
| 145 | - </el-date-picker> | ||
| 146 | - | ||
| 147 | - <!-- 时间 --> | ||
| 148 | - <el-time-select | ||
| 149 | - v-if="item.type === 'Time'" | ||
| 150 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 151 | - :style="{ width: item.inputWidth }" | ||
| 152 | - :disabled="item.disable" | ||
| 153 | - :placeholder="item.placeholder ? item.placeholder : '请选择时间'" | ||
| 154 | - clearable | ||
| 155 | - > | ||
| 156 | - </el-time-select> | ||
| 157 | - | ||
| 158 | - <!-- 日期时间 --> | ||
| 159 | - <el-date-picker | ||
| 160 | - v-if="item.type === 'DateTime'" | ||
| 161 | - type="datetime" | ||
| 162 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 163 | - :disabled="item.disable" | ||
| 164 | - :placeholder="item.placeholder ? item.placeholder : '请选择日期'" | ||
| 165 | - clearable | ||
| 166 | - > | ||
| 167 | - </el-date-picker> | ||
| 168 | - | ||
| 169 | - <!-- 日期范围 --> | ||
| 170 | - <el-date-picker | ||
| 171 | - v-if="item.type === 'datetimerange'" | ||
| 172 | - type="datetimerange" | ||
| 173 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 174 | - :style="{ width: item.inputWidth }" | ||
| 175 | - :disabled="item.disable" | ||
| 176 | - range-separator="至" | ||
| 177 | - start-placeholder="开始日期" | ||
| 178 | - end-placeholder="结束日期" | ||
| 179 | - clearable | ||
| 180 | - > | ||
| 181 | - </el-date-picker> | ||
| 182 | - | ||
| 183 | - <!-- 单选框 普通的样式 Radio 的尺寸,仅在 border 为真时有效--> | ||
| 184 | - <template v-if="item.type === 'radio'"> | ||
| 185 | - <el-radio | ||
| 186 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 187 | - v-for="op in item.options.data" | ||
| 188 | - :disabled="item.disable" | ||
| 189 | - :border="tempQueryForm[item.border]" | ||
| 190 | - :size="tempQueryForm[item.size]" | ||
| 191 | - :label="op[item.options.label] || op.label" | ||
| 192 | - :value="op[item.options.value] || op.value" | ||
| 193 | - :key="op[item.options.value] || op.value" | ||
| 194 | - ></el-radio> | ||
| 195 | - </template> | ||
| 196 | - | ||
| 197 | - <!-- 单选框 按钮样式 --> | ||
| 198 | - <el-radio-group | ||
| 199 | - v-if="item.type === 'radioButtom'" | ||
| 200 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 201 | - :size="tempQueryForm[item.size]" | ||
| 202 | - :disabled="item.disable" | ||
| 203 | - > | ||
| 204 | - <el-radio-button | ||
| 205 | - v-for="op in item.options.data" | ||
| 206 | - :label="op[item.options.label] || op.label" | ||
| 207 | - :value="op[item.options.value] || op.value" | ||
| 208 | - :key="op[item.options.value] || op.value" | ||
| 209 | - ></el-radio-button> | ||
| 210 | - </el-radio-group> | ||
| 211 | - | ||
| 212 | - <!-- 文本框 --> | ||
| 213 | - <el-input | ||
| 214 | - v-if="item.type === 'textarea'" | ||
| 215 | - v-model.trim="tempQueryForm[item.prop]" | ||
| 216 | - type="textarea" | ||
| 217 | - :style="{ width: item.inputWidth }" | ||
| 218 | - :disabled="item.disable" | ||
| 219 | - :rows="item.row" | ||
| 220 | - :autosize="item.autosize" | ||
| 221 | - :placeholder=" | ||
| 222 | - item.placeholder ? item.placeholder : '请输入' + item.label | ||
| 223 | - " | ||
| 224 | - clearable | ||
| 225 | - > | ||
| 226 | - </el-input> | ||
| 227 | - | ||
| 228 | - <!-- 多选框 --> | ||
| 229 | - <template v-if="item.type === 'Checkbox'"> | ||
| 230 | - <el-checkbox | ||
| 231 | - v-model="tempQueryForm[item.prop]" | ||
| 232 | - :disabled="item.disabled" | ||
| 233 | - ></el-checkbox> | ||
| 234 | - </template> | ||
| 235 | - </el-form-item> | ||
| 236 | - </el-col> | ||
| 237 | - <!-- 查询按钮 de--> | ||
| 238 | - <span v-show="inline & hiddenFormBtn"> | ||
| 239 | - <el-form-item v-show="show"> | ||
| 240 | - <el-button | ||
| 241 | - type="primary" | ||
| 242 | - @click="handleSearch('ruleForm')" | ||
| 243 | - :btnLoading="btnLoading" | ||
| 244 | - > | ||
| 245 | - {{ formBtn }} | ||
| 246 | - </el-button> | ||
| 247 | - </el-form-item> | ||
| 248 | - </span> | ||
| 249 | - <span v-show="inline & hiddenFormBtn"> | ||
| 250 | - <el-form-item v-show="show"> | ||
| 251 | - <el-button @click="resetFields('ruleForm')">重置</el-button> | ||
| 252 | - </el-form-item> | ||
| 253 | - </span> | ||
| 254 | - </el-row> | ||
| 255 | - </el-form> | ||
| 256 | - </div> | ||
| 257 | -</template> | ||
| 258 | - | ||
| 259 | -<script> | ||
| 260 | -import request from "@/utils/request"; | ||
| 261 | -import { deepClone } from "@/utils"; | ||
| 262 | -export default { | ||
| 263 | - props: { | ||
| 264 | - rowGutter: { | ||
| 265 | - type: Number, | ||
| 266 | - default: 24, | ||
| 267 | - }, | ||
| 268 | - rowType: { | ||
| 269 | - type: String, | ||
| 270 | - default: "", | ||
| 271 | - }, | ||
| 272 | - rowJustify: { | ||
| 273 | - type: String, | ||
| 274 | - default: "", | ||
| 275 | - }, | ||
| 276 | - rowAlign: { | ||
| 277 | - type: String, | ||
| 278 | - default: "", | ||
| 279 | - }, | ||
| 280 | - rowTag: { | ||
| 281 | - type: String, | ||
| 282 | - default: "div", | ||
| 283 | - }, | ||
| 284 | - // 由inline属性决定form表单是普通表单,还是行内表单 | ||
| 285 | - inline: { | ||
| 286 | - //排列方式 | ||
| 287 | - type: Boolean, | ||
| 288 | - default: true, | ||
| 289 | - }, | ||
| 290 | - searchLoading: { | ||
| 291 | - type: Boolean, | ||
| 292 | - default: false, | ||
| 293 | - }, | ||
| 294 | - hiddenFormBtn: { | ||
| 295 | - //是否展示搜索按钮 | ||
| 296 | - type: Boolean, | ||
| 297 | - default: false, | ||
| 298 | - }, | ||
| 299 | - formWidth: { | ||
| 300 | - //form表单宽度 | ||
| 301 | - type: String, | ||
| 302 | - default: "auto", | ||
| 303 | - }, | ||
| 304 | - position: { | ||
| 305 | - type: String, | ||
| 306 | - default: "", | ||
| 307 | - }, | ||
| 308 | - formConfig: { | ||
| 309 | - type: Array, | ||
| 310 | - default: [], | ||
| 311 | - }, | ||
| 312 | - queryForm: { | ||
| 313 | - type: Object, | ||
| 314 | - default: () => {}, | ||
| 315 | - }, | ||
| 316 | - // 用于控制该表单内组件的尺寸 medium / small / mini | ||
| 317 | - size: { | ||
| 318 | - type: String, | ||
| 319 | - default: "small", | ||
| 320 | - }, | ||
| 321 | - marginBottom: { | ||
| 322 | - type: Number, | ||
| 323 | - default: 0, | ||
| 324 | - }, | ||
| 325 | - view: { | ||
| 326 | - type: Boolean, | ||
| 327 | - default: false, | ||
| 328 | - }, | ||
| 329 | - formBtn: { | ||
| 330 | - type: String, | ||
| 331 | - default: "查询", | ||
| 332 | - }, | ||
| 333 | - btnLoading: { | ||
| 334 | - type: Boolean, | ||
| 335 | - default: false, | ||
| 336 | - }, | ||
| 337 | - loading: { | ||
| 338 | - //加载 | ||
| 339 | - type: Boolean, | ||
| 340 | - default: false, | ||
| 341 | - }, | ||
| 342 | - isBtnSave: { | ||
| 343 | - type: Boolean, | ||
| 344 | - default: false, | ||
| 345 | - }, | ||
| 346 | - }, | ||
| 347 | - data() { | ||
| 348 | - return { | ||
| 349 | - show: true, | ||
| 350 | - tempQueryForm: {}, | ||
| 351 | - tempFormConfig: [], | ||
| 352 | - fetchResult: [], | ||
| 353 | - timeout: null, | ||
| 354 | - searchMark: {}, // 搜索 | ||
| 355 | - }; | ||
| 356 | - }, | ||
| 357 | - mounted() {}, | ||
| 358 | - computed: {}, | ||
| 359 | - methods: { | ||
| 360 | - // input事件绑定和注册 | ||
| 361 | - inputEvent(e, item) { | ||
| 362 | - this.$emit(item.trigger, this.tempQueryForm); | ||
| 363 | - }, | ||
| 364 | - // 回车事件 | ||
| 365 | - toEnterSearch() { | ||
| 366 | - this.$emit("keyup", this.tempQueryForm); | ||
| 367 | - }, | ||
| 368 | - // selectSearch 聚焦获取当前input绑定的数据 | ||
| 369 | - focusKey(item) { | ||
| 370 | - this.searchMark = item; | ||
| 371 | - }, | ||
| 372 | - // selectSearch 下拉选中获取当前input绑定的数据 | ||
| 373 | - selectSearch(item) { | ||
| 374 | - console.log(item); | ||
| 375 | - }, | ||
| 376 | - // 远程搜索查询 | ||
| 377 | - querySearchAsync(queryString, cb) { | ||
| 378 | - let result = this.formConfig.filter((item) => { | ||
| 379 | - if (item.hasOwnProperty("http")) { | ||
| 380 | - if (item.prop === this.searchMark.prop) { | ||
| 381 | - return item; | ||
| 382 | - } | ||
| 383 | - } | ||
| 384 | - }); | ||
| 385 | - // 在搜索关键词不为空时发送http请求 | ||
| 386 | - if (queryString) { | ||
| 387 | - if (queryString.split(" ").length > 0) { | ||
| 388 | - if (result[0].http.method == "post") { | ||
| 389 | - result[0].http.data[result[0].prop] = queryString.split(" ")[0]; | ||
| 390 | - } else { | ||
| 391 | - result[0].http.params[result[0].prop] = queryString.split(" ")[0]; | ||
| 392 | - } | ||
| 393 | - } | ||
| 394 | - request(result[0].http).then((res) => { | ||
| 395 | - if (res.code == 200) { | ||
| 396 | - if (res.data.list.length) { | ||
| 397 | - res.data.list.map((item) => { | ||
| 398 | - item.value = `${item[result[0].prop]} ${item[result[0].name]}`; | ||
| 399 | - }); | ||
| 400 | - this.fetchResult = res.data.list; | ||
| 401 | - var results = queryString.split(" ")[0] | ||
| 402 | - ? this.fetchResult.filter( | ||
| 403 | - this.createStateFilter(queryString.split(" ")[0]) | ||
| 404 | - ) | ||
| 405 | - : this.fetchResult; | ||
| 406 | - clearTimeout(this.timeout); | ||
| 407 | - this.timeout = setTimeout(() => { | ||
| 408 | - cb(results); | ||
| 409 | - }, 1500 * Math.random()); | ||
| 410 | - } | ||
| 411 | - } | ||
| 412 | - }); | ||
| 413 | - } | ||
| 414 | - }, | ||
| 415 | - // 远程搜索匹配查询 | ||
| 416 | - createStateFilter(queryString) { | ||
| 417 | - return (state) => { | ||
| 418 | - return ( | ||
| 419 | - state[this.searchMark.prop] | ||
| 420 | - .toLowerCase() | ||
| 421 | - .indexOf(queryString.toLowerCase()) === 0 | ||
| 422 | - ); | ||
| 423 | - }; | ||
| 424 | - }, | ||
| 425 | - // 行内表单搜索事件 | ||
| 426 | - handleSearch(formName, cb) { | ||
| 427 | - this.$refs[formName].validate((valid) => { | ||
| 428 | - if (valid) { | ||
| 429 | - cb(valid); | ||
| 430 | - } else { | ||
| 431 | - console.log("error submit!!"); | ||
| 432 | - return false; | ||
| 433 | - } | ||
| 434 | - }); | ||
| 435 | - this.$emit("handleSearch"); | ||
| 436 | - }, | ||
| 437 | - // 清空ruleForm表单事件 | ||
| 438 | - resetFields(formName = "ruleForm") { | ||
| 439 | - this.$refs[formName].resetFields(); | ||
| 440 | - }, | ||
| 441 | - }, | ||
| 442 | - watch: { | ||
| 443 | - queryForm: { | ||
| 444 | - handler(val) { | ||
| 445 | - this.tempQueryForm = val; | ||
| 446 | - }, | ||
| 447 | - deep: true, | ||
| 448 | - immediate: true, | ||
| 449 | - }, | ||
| 450 | - formConfig: { | ||
| 451 | - handler(val) { | ||
| 452 | - this.tempFormConfig = deepClone(val); | ||
| 453 | - }, | ||
| 454 | - deep: true, | ||
| 455 | - immediate: true, | ||
| 456 | - }, | ||
| 457 | - }, | ||
| 458 | -}; | ||
| 459 | -</script> | ||
| 460 | -<style lang="scss" scoped> | ||
| 461 | - | ||
| 462 | -</style> |
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,23 +134,13 @@ | ... | @@ -134,23 +134,13 @@ |
| 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"> |
| ... | @@ -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 | -]; |
| 1 | -<template> | ||
| 2 | - <div class="form-header"> | ||
| 3 | - <el-row style="padding-bottom: 20px"> | ||
| 4 | - <el-col> | ||
| 5 | - <el-divider content-position="left">ET86配舱航班顺位</el-divider> | ||
| 6 | - </el-col> | ||
| 7 | - </el-row> | ||
| 8 | - <!-- ET86配舱航班顺位 --> | ||
| 9 | - <el-row :gutter="24" justify="center"> | ||
| 10 | - <el-col :span="18"> | ||
| 11 | - <el-row style="margin-bottom: 15px" v-if="getRouter"> | ||
| 12 | - <el-col> | ||
| 13 | - <el-button | ||
| 14 | - type="primary" | ||
| 15 | - icon="el-icon-plus" | ||
| 16 | - size="mini" | ||
| 17 | - @click="addBtn" | ||
| 18 | - >添加</el-button | ||
| 19 | - > | ||
| 20 | - </el-col> | ||
| 21 | - </el-row> | ||
| 22 | - <yl-table | ||
| 23 | - emptyText="请添加配舱航班" | ||
| 24 | - :attrs="tableAttr" | ||
| 25 | - :loadingTable="tableAttr.loadingTable" | ||
| 26 | - :tableData="tableData" | ||
| 27 | - :pageConfig="{ | ||
| 28 | - isPagination: false, | ||
| 29 | - }" | ||
| 30 | - > | ||
| 31 | - <template #column> | ||
| 32 | - <el-table-column | ||
| 33 | - type="index" | ||
| 34 | - label="序号" | ||
| 35 | - width="50" | ||
| 36 | - align="center" | ||
| 37 | - ></el-table-column> | ||
| 38 | - <el-table-column | ||
| 39 | - label="航班号" | ||
| 40 | - prop="flightNo" | ||
| 41 | - min-width="100" | ||
| 42 | - align="center" | ||
| 43 | - > | ||
| 44 | - <template slot-scope="scope"> | ||
| 45 | - <el-input | ||
| 46 | - v-model="scope.row.flightNo" | ||
| 47 | - clearable | ||
| 48 | - :disabled="scope.row.edit" | ||
| 49 | - @focus="inputFocus(scope)" | ||
| 50 | - @blur="blurSearch" | ||
| 51 | - placeholder="请输入航班号" | ||
| 52 | - size="small" | ||
| 53 | - /> | ||
| 54 | - </template> | ||
| 55 | - </el-table-column> | ||
| 56 | - <el-table-column | ||
| 57 | - label="加减天数" | ||
| 58 | - prop="calculateDay" | ||
| 59 | - width="100" | ||
| 60 | - align="center" | ||
| 61 | - > | ||
| 62 | - <template slot-scope="scope"> | ||
| 63 | - <el-input | ||
| 64 | - type="text" | ||
| 65 | - v-model="scope.row.calculateDay" | ||
| 66 | - :disabled="scope.row.edit" | ||
| 67 | - min="-7" | ||
| 68 | - max="7" | ||
| 69 | - v-input-filter | ||
| 70 | - clearable | ||
| 71 | - placeholder="" | ||
| 72 | - size="small" | ||
| 73 | - /> | ||
| 74 | - <!-- <el-input | ||
| 75 | - type="number" | ||
| 76 | - v-model="scope.row.calculateDay" | ||
| 77 | - :disabled="scope.row.edit" | ||
| 78 | - min="-7" | ||
| 79 | - max="7" | ||
| 80 | - v-input-filter | ||
| 81 | - clearable | ||
| 82 | - placeholder="" | ||
| 83 | - size="small" | ||
| 84 | - /> --> | ||
| 85 | - </template> | ||
| 86 | - </el-table-column> | ||
| 87 | - <el-table-column | ||
| 88 | - label="航线" | ||
| 89 | - prop="flightRoute" | ||
| 90 | - min-width="100" | ||
| 91 | - align="center" | ||
| 92 | - > | ||
| 93 | - <template slot-scope="scope"> | ||
| 94 | - <el-select | ||
| 95 | - v-model="scope.row.flightRoute" | ||
| 96 | - placeholder="请选择" | ||
| 97 | - size="small" | ||
| 98 | - :disabled="scope.row.edit" | ||
| 99 | - > | ||
| 100 | - <el-option | ||
| 101 | - v-for="item in scope.row.routeList" | ||
| 102 | - :key="item.id" | ||
| 103 | - :label="item.route" | ||
| 104 | - :value="item.route" | ||
| 105 | - > | ||
| 106 | - </el-option> | ||
| 107 | - </el-select> | ||
| 108 | - </template> | ||
| 109 | - </el-table-column> | ||
| 110 | - <el-table-column | ||
| 111 | - label="爆仓是否继续配舱" | ||
| 112 | - prop="permitOverweight" | ||
| 113 | - min-width="100" | ||
| 114 | - align="center" | ||
| 115 | - > | ||
| 116 | - <template slot-scope="scope"> | ||
| 117 | - <el-checkbox | ||
| 118 | - v-model="scope.row.permitOverweight" | ||
| 119 | - :disabled="scope.row.edit" | ||
| 120 | - @change="changeCheck(scope)" | ||
| 121 | - ></el-checkbox> | ||
| 122 | - </template> | ||
| 123 | - </el-table-column> | ||
| 124 | - <el-table-column label="操作" min-width="100" align="center"> | ||
| 125 | - <template slot-scope="scope"> | ||
| 126 | - <el-button | ||
| 127 | - size="mini" | ||
| 128 | - type="danger" | ||
| 129 | - :disabled="scope.row.edit" | ||
| 130 | - @click="deleBtn(scope.row, scope.$index)" | ||
| 131 | - >删除</el-button | ||
| 132 | - > | ||
| 133 | - </template> | ||
| 134 | - </el-table-column> | ||
| 135 | - </template> | ||
| 136 | - </yl-table> | ||
| 137 | - </el-col> | ||
| 138 | - </el-row> | ||
| 139 | - <!-- ET86配舱航班顺位维度 --> | ||
| 140 | - <el-row style="padding: 20px 0"> | ||
| 141 | - <el-col> | ||
| 142 | - <el-divider content-position="left">航线维度设置</el-divider> | ||
| 143 | - </el-col> | ||
| 144 | - </el-row> | ||
| 145 | - <el-card shadow="always" class="box-card"> | ||
| 146 | - <el-form | ||
| 147 | - :model="queryForm" | ||
| 148 | - label-position="right" | ||
| 149 | - label-width="120px" | ||
| 150 | - ref="ruleForm" | ||
| 151 | - class="config-form" | ||
| 152 | - > | ||
| 153 | - <el-row class="rowPadding"> | ||
| 154 | - <el-col :span="24"> | ||
| 155 | - <el-col :span="10"> | ||
| 156 | - <el-form-item label="原航班号"> | ||
| 157 | - <el-input | ||
| 158 | - type="textarea" | ||
| 159 | - v-model="queryForm.originOfFlightNo" | ||
| 160 | - size="medium" | ||
| 161 | - maxlength="1000" | ||
| 162 | - show-word-limit | ||
| 163 | - :rows="4" | ||
| 164 | - placeholder="原航班号之间用分号分隔,例:LP001;LP002" | ||
| 165 | - @blur="blurEvent" | ||
| 166 | - :disabled="!getRouter" | ||
| 167 | - ></el-input> | ||
| 168 | - </el-form-item> | ||
| 169 | - </el-col> | ||
| 170 | - <el-col :span="14"> | ||
| 171 | - <el-form-item label=""> | ||
| 172 | - <el-col :span="4" style="text-align: end; width: 8%"> | ||
| 173 | - <span | ||
| 174 | - style=" | ||
| 175 | - width: 10%; | ||
| 176 | - margin-right: 10px; | ||
| 177 | - font-size: 14px; | ||
| 178 | - color: #606266; | ||
| 179 | - font-weight: 700; | ||
| 180 | - " | ||
| 181 | - >服务种类</span | ||
| 182 | - > | ||
| 183 | - </el-col> | ||
| 184 | - <el-col :span="4" style="text-align: end; width: 19%"> | ||
| 185 | - <el-radio-group | ||
| 186 | - v-model="isServiceCode" | ||
| 187 | - @change="changeIsServiceCode" | ||
| 188 | - :disabled="!getRouter" | ||
| 189 | - style="text-align: left" | ||
| 190 | - > | ||
| 191 | - <el-radio label="1">包含ServiceCode</el-radio> | ||
| 192 | - <el-radio label="2">不包含ServiceCode</el-radio> | ||
| 193 | - </el-radio-group> | ||
| 194 | - </el-col> | ||
| 195 | - <el-col :span="16"> | ||
| 196 | - <el-input | ||
| 197 | - type="textarea" | ||
| 198 | - v-model="queryForm.includeServiceType" | ||
| 199 | - size="medium" | ||
| 200 | - maxlength="1000" | ||
| 201 | - show-word-limit | ||
| 202 | - :rows="4" | ||
| 203 | - placeholder="请输入ServiceCode" | ||
| 204 | - @blur="serviceCodeBlur" | ||
| 205 | - :disabled="!getRouter" | ||
| 206 | - ></el-input> | ||
| 207 | - </el-col> | ||
| 208 | - </el-form-item> | ||
| 209 | - </el-col> | ||
| 210 | - </el-col> | ||
| 211 | - | ||
| 212 | - <el-col :span="24"> | ||
| 213 | - <el-col :span="10"> | ||
| 214 | - <el-form-item label="URSA包含"> | ||
| 215 | - <el-input | ||
| 216 | - type="textarea" | ||
| 217 | - v-model="queryForm.includeUrsa" | ||
| 218 | - size="medium" | ||
| 219 | - maxlength="1000" | ||
| 220 | - show-word-limit | ||
| 221 | - :rows="4" | ||
| 222 | - placeholder="URSA之间用分号分隔,例:F2;F3;P_" | ||
| 223 | - :disabled="!getRouter" | ||
| 224 | - ></el-input> | ||
| 225 | - </el-form-item> | ||
| 226 | - </el-col> | ||
| 227 | - <el-col :span="14"> | ||
| 228 | - <el-form-item label=""> | ||
| 229 | - <el-col :span="8" style="text-align: end; width: 27%" | ||
| 230 | - ><span | ||
| 231 | - class="ursa-label" | ||
| 232 | - style=" | ||
| 233 | - margin-right: 10px; | ||
| 234 | - font-size: 14px; | ||
| 235 | - color: #606266; | ||
| 236 | - font-weight: 700; | ||
| 237 | - " | ||
| 238 | - >URSA不包含</span | ||
| 239 | - ></el-col | ||
| 240 | - > | ||
| 241 | - <el-col :span="16"> | ||
| 242 | - <el-input | ||
| 243 | - type="textarea" | ||
| 244 | - v-model="queryForm.notIncludeUrsa" | ||
| 245 | - size="medium" | ||
| 246 | - maxlength="1000" | ||
| 247 | - show-word-limit | ||
| 248 | - :rows="4" | ||
| 249 | - placeholder="URSA之间用分号分隔,例:F2;F3;P_" | ||
| 250 | - :disabled="!getRouter" | ||
| 251 | - ></el-input> | ||
| 252 | - </el-col> | ||
| 253 | - </el-form-item> | ||
| 254 | - </el-col> | ||
| 255 | - </el-col> | ||
| 256 | - | ||
| 257 | - <el-col :span="10"> | ||
| 258 | - <el-form-item label="申报类别"> | ||
| 259 | - <el-card shadow="never"> | ||
| 260 | - <el-checkbox-group | ||
| 261 | - v-model="checkboxClassType" | ||
| 262 | - @change="changeCheckboxCargoType" | ||
| 263 | - style="display: flex" | ||
| 264 | - v-if="cargoType.length" | ||
| 265 | - :disabled="!getRouter" | ||
| 266 | - > | ||
| 267 | - <el-checkbox | ||
| 268 | - v-for="item in cargoType" | ||
| 269 | - :label="item.chineseName" | ||
| 270 | - :name="item.chineseName" | ||
| 271 | - :key="item.code" | ||
| 272 | - > | ||
| 273 | - <Tooltips :content="item.chineseName" :refName="item.code"> | ||
| 274 | - </Tooltips> | ||
| 275 | - </el-checkbox> | ||
| 276 | - </el-checkbox-group> | ||
| 277 | - </el-card> | ||
| 278 | - </el-form-item> | ||
| 279 | - </el-col> | ||
| 280 | - | ||
| 281 | - <el-col :span="24"> | ||
| 282 | - <el-col :span="2"> | ||
| 283 | - <el-form-item label="单品名"> | ||
| 284 | - <el-checkbox | ||
| 285 | - v-model="queryForm.multiHs" | ||
| 286 | - :disabled="!getRouter" | ||
| 287 | - ></el-checkbox> | ||
| 288 | - </el-form-item> | ||
| 289 | - </el-col> | ||
| 290 | - <el-col :span="8"> | ||
| 291 | - <el-form-item label="" class="custom-label"> | ||
| 292 | - <span class="custom-label-title">重量(KG)</span> | ||
| 293 | - <el-col :span="10"> | ||
| 294 | - <el-input | ||
| 295 | - v-model.trim="queryForm.minWeight" | ||
| 296 | - placeholder="最小重量" | ||
| 297 | - @blur="inputBlurMinWeight($event)" | ||
| 298 | - :disabled="!getRouter" | ||
| 299 | - ></el-input> | ||
| 300 | - <span ref="minWeight" class="el-form-item__error"></span> | ||
| 301 | - </el-col> | ||
| 302 | - <el-col style="text-align: center" :span="1">-</el-col> | ||
| 303 | - <el-col :span="10"> | ||
| 304 | - <el-input | ||
| 305 | - v-model.trim="queryForm.maxWeight" | ||
| 306 | - placeholder="最大重量" | ||
| 307 | - @blur="inputBlurMaxWeight($event)" | ||
| 308 | - :disabled="!getRouter" | ||
| 309 | - ></el-input> | ||
| 310 | - </el-col> | ||
| 311 | - </el-form-item> | ||
| 312 | - </el-col> | ||
| 313 | - | ||
| 314 | - <el-col :span="8"> | ||
| 315 | - <el-form-item label="件数" class="custom-label-pieces"> | ||
| 316 | - <el-col :span="10"> | ||
| 317 | - <el-input | ||
| 318 | - v-model.trim="queryForm.minNumOfPieces" | ||
| 319 | - placeholder="最少件数" | ||
| 320 | - @blur="inputBlurMinPieces($event)" | ||
| 321 | - :disabled="!getRouter" | ||
| 322 | - ></el-input> | ||
| 323 | - <span ref="minNumOfPieces" class="el-form-item__error"></span> | ||
| 324 | - </el-col> | ||
| 325 | - <el-col style="text-align: center" :span="1">-</el-col> | ||
| 326 | - <el-col :span="10"> | ||
| 327 | - <el-input | ||
| 328 | - v-model.trim="queryForm.maxNumOfPieces" | ||
| 329 | - placeholder="最多件数" | ||
| 330 | - @blur="inputBlurMaxPieces($event)" | ||
| 331 | - :disabled="!getRouter" | ||
| 332 | - ></el-input> | ||
| 333 | - </el-col> | ||
| 334 | - </el-form-item> | ||
| 335 | - </el-col> | ||
| 336 | - </el-col> | ||
| 337 | - | ||
| 338 | - <el-col :span="24"> | ||
| 339 | - <el-col :span="2"> | ||
| 340 | - <el-form-item label="申报价值"></el-form-item> | ||
| 341 | - </el-col> | ||
| 342 | - <el-col :span="8"> | ||
| 343 | - <el-form-item label="" class="custom-label"> | ||
| 344 | - <span class="custom-label-title">人民币</span> | ||
| 345 | - <el-col :span="10"> | ||
| 346 | - <el-input | ||
| 347 | - v-model.trim="minCNYCustomVal" | ||
| 348 | - placeholder="最小申报价值" | ||
| 349 | - @blur="inputBlurMin($event, 'minCNYCustomVal')" | ||
| 350 | - :disabled="!getRouter" | ||
| 351 | - ></el-input> | ||
| 352 | - <span | ||
| 353 | - ref="minCNYCustomVal" | ||
| 354 | - class="el-form-item__error" | ||
| 355 | - ></span> | ||
| 356 | - </el-col> | ||
| 357 | - <el-col style="text-align: center" :span="1">-</el-col> | ||
| 358 | - <el-col :span="10"> | ||
| 359 | - <el-input | ||
| 360 | - v-model.trim="maxCNYCustomVal" | ||
| 361 | - placeholder="最大申报价值" | ||
| 362 | - @blur="inputBlurMax($event, 'maxCNYCustomVal')" | ||
| 363 | - :disabled="!getRouter" | ||
| 364 | - ></el-input> | ||
| 365 | - </el-col> | ||
| 366 | - </el-form-item> | ||
| 367 | - </el-col> | ||
| 368 | - <el-col :span="8"> | ||
| 369 | - <el-form-item label="美元" class="custom-label-pieces"> | ||
| 370 | - <el-col :span="10"> | ||
| 371 | - <el-input | ||
| 372 | - v-model.trim="minSUDCustomVal" | ||
| 373 | - placeholder="最小申报价值" | ||
| 374 | - @blur="inputBlurMin($event, 'minSUDCustomVal')" | ||
| 375 | - :disabled="!getRouter" | ||
| 376 | - ></el-input> | ||
| 377 | - <span | ||
| 378 | - ref="minSUDCustomVal" | ||
| 379 | - class="el-form-item__error" | ||
| 380 | - ></span> | ||
| 381 | - </el-col> | ||
| 382 | - <el-col style="text-align: center" :span="1">-</el-col> | ||
| 383 | - <el-col :span="10"> | ||
| 384 | - <el-input | ||
| 385 | - v-model.trim="maxSUDCustomVal" | ||
| 386 | - placeholder="最大申报价值" | ||
| 387 | - @blur="inputBlurMax($event, 'maxSUDCustomVal')" | ||
| 388 | - :disabled="!getRouter" | ||
| 389 | - ></el-input> | ||
| 390 | - </el-col> | ||
| 391 | - </el-form-item> | ||
| 392 | - </el-col> | ||
| 393 | - </el-col> | ||
| 394 | - <el-col :span="24" v-if="getRouter"> | ||
| 395 | - <el-form-item label=""> | ||
| 396 | - <el-button type="primary" @click="submitForm('ruleForm')">{{ | ||
| 397 | - getRouter | ||
| 398 | - }}</el-button> | ||
| 399 | - </el-form-item> | ||
| 400 | - </el-col> | ||
| 401 | - </el-row> | ||
| 402 | - </el-form> | ||
| 403 | - </el-card> | ||
| 404 | - </div> | ||
| 405 | -</template> | ||
| 406 | - | ||
| 407 | -<script> | ||
| 408 | -import YlForm from "@/components/YlForm"; | ||
| 409 | -import YlTable from "@/components/YlTable"; | ||
| 410 | -import { formConfig } from "./formConfig"; | ||
| 411 | -import { inputBlurValidate } from "@/utils/mixins"; | ||
| 412 | -import { tableAttr } from "./tableConfig"; | ||
| 413 | -import { | ||
| 414 | - allDictData, // 获取全部字典 | ||
| 415 | - queryRouteByFltNo, // 航线查询 | ||
| 416 | -} from "@/api/destinationFlight"; | ||
| 417 | -import { | ||
| 418 | - add, // ET86新增 | ||
| 419 | - findEtesRuleById, // ET86详情 | ||
| 420 | - update, // ET86编辑 | ||
| 421 | -} from "@/api/et86"; | ||
| 422 | -import indexMixins from "./mixins"; | ||
| 423 | -export default { | ||
| 424 | - name: "edit", | ||
| 425 | - components: { | ||
| 426 | - YlForm, | ||
| 427 | - YlTable, | ||
| 428 | - }, | ||
| 429 | - mixins: [indexMixins, inputBlurValidate], | ||
| 430 | - data() { | ||
| 431 | - return { | ||
| 432 | - formConfig: formConfig, // 表单配置项 | ||
| 433 | - queryForm: { | ||
| 434 | - // ET86配舱航班顺位维度 | ||
| 435 | - // 表单参数 | ||
| 436 | - id: "", // 维度ID | ||
| 437 | - originOfFlightNo: "", // 原航班号 | ||
| 438 | - includeServiceType: "", // 服务种类包含 | ||
| 439 | - notIncludeServiceType: "", // 服务种类不包含 | ||
| 440 | - includeUrsa: "", // URSA包含 | ||
| 441 | - notIncludeUrsa: "", // URSA不包含 | ||
| 442 | - declarationCategory: "", // 已勾选申报类别的数据 | ||
| 443 | - multiHs: false, // 单品名 | ||
| 444 | - minWeight: "", // 最小重量 | ||
| 445 | - maxWeight: "", | ||
| 446 | - minNumOfPieces: "", // 最小件数 | ||
| 447 | - maxNumOfPieces: "", | ||
| 448 | - currencyCd: "", // 币种 | ||
| 449 | - minCustomVal: "", // 最小申报值 | ||
| 450 | - maxCustomVal: "", | ||
| 451 | - }, | ||
| 452 | - tableAttr: tableAttr, // table配置项 | ||
| 453 | - tableData: [], // ET86配舱航班顺位 | ||
| 454 | - currentIndex: 0, // 记录当前table 列的索引位置 | ||
| 455 | - id: 1, // ET86配舱航班顺位ID | ||
| 456 | - isServiceCode: "1", // 服务种类 | ||
| 457 | - serviceCode: "", // 服务种类内容 | ||
| 458 | - cargoType: [], // 申报类别调用接口获取所有的申报类别 | ||
| 459 | - checkboxCargoType: [], // 已勾选申报类别的数据 | ||
| 460 | - checkboxClassType: [], // 申报类别 | ||
| 461 | - serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode | ||
| 462 | - minCNYCustomVal: "", // 人民币最小申报值 | ||
| 463 | - maxCNYCustomVal: "", // | ||
| 464 | - minSUDCustomVal: "", // 美元最小申报值 | ||
| 465 | - maxSUDCustomVal: "", // | ||
| 466 | - }; | ||
| 467 | - }, | ||
| 468 | - computed: { | ||
| 469 | - // 获取路由参数 | ||
| 470 | - getRouter() { | ||
| 471 | - if (this.$route.query.name == "add") { | ||
| 472 | - return "保存"; | ||
| 473 | - } else if (this.$route.query.name == "edit") { | ||
| 474 | - return "修改"; | ||
| 475 | - } else { | ||
| 476 | - return false; | ||
| 477 | - } | ||
| 478 | - }, | ||
| 479 | - }, | ||
| 480 | - created() { | ||
| 481 | - this.getAllDictData(); // 获取全部字典 | ||
| 482 | - if (this.$route.query.name == "view" || this.$route.query.name == "edit") { | ||
| 483 | - this.queryFindEtesRuleById(this.$route.query); // ET86详情 | ||
| 484 | - } else { | ||
| 485 | - // 新增时默认一条数据 | ||
| 486 | - this.tableData = [ | ||
| 487 | - { | ||
| 488 | - id: this.id, | ||
| 489 | - flightNo: "", // 航班号 | ||
| 490 | - calculateDay: "", // 航班日期//+1 -1 | ||
| 491 | - flightRoute: "", // 航线 | ||
| 492 | - routeList: [], // 航线列表 | ||
| 493 | - permitOverweight: "N" ? false : true, // 爆仓是否继续配舱 Y-是,N-否 | ||
| 494 | - priority: this.id, // 优先等级 | ||
| 495 | - ruleId: "", // 维度ID | ||
| 496 | - }, | ||
| 497 | - ]; | ||
| 498 | - } | ||
| 499 | - }, | ||
| 500 | - mounted() {}, | ||
| 501 | - directives: { | ||
| 502 | - // 处理加减天数 | ||
| 503 | - "input-filter": { | ||
| 504 | - bind: function (el, binding) { | ||
| 505 | - el.handler = function (event) { | ||
| 506 | - if (event.data == "E" || event.data == "e") { | ||
| 507 | - // 无理数时 | ||
| 508 | - event.target.value = ""; | ||
| 509 | - } | ||
| 510 | - if (event.target.value) { | ||
| 511 | - if (Number(event.target.value) < -7) { | ||
| 512 | - event.target.value = ""; | ||
| 513 | - this.msgError("加减天数最小不能低于7天"); | ||
| 514 | - } else if (Number(event.target.value) > 7) { | ||
| 515 | - event.target.value = ""; | ||
| 516 | - this.msgError("加减天数最小不能大于7天"); | ||
| 517 | - } else if (/[\.]/.test(Number(event.target.value))) { | ||
| 518 | - // 浮点数时 | ||
| 519 | - event.target.value = ""; | ||
| 520 | - } else { | ||
| 521 | - | ||
| 522 | - } | ||
| 523 | - event.target.dispatchEvent(new Event("input")); | ||
| 524 | - } | ||
| 525 | - }; | ||
| 526 | - el.addEventListener("input", el.handler); | ||
| 527 | - }, | ||
| 528 | - unbind: function (el) { | ||
| 529 | - el.removeEventListener("input", el.handler); | ||
| 530 | - }, | ||
| 531 | - }, | ||
| 532 | - }, | ||
| 533 | - filters: {}, | ||
| 534 | - methods: { | ||
| 535 | - // ET86新增 | ||
| 536 | - postAdd(params) { | ||
| 537 | - add(params) | ||
| 538 | - .then((res) => { | ||
| 539 | - const { code, msg } = res; | ||
| 540 | - if (code == 200) { | ||
| 541 | - this.msgSuccess(msg || "创建成功!"); | ||
| 542 | - this.$router.push("/et86RuleConfig"); | ||
| 543 | - } else { | ||
| 544 | - this.msgError(msg || "创建失败!"); | ||
| 545 | - } | ||
| 546 | - }) | ||
| 547 | - .catch(() => {}); | ||
| 548 | - }, | ||
| 549 | - // ET86详情 | ||
| 550 | - queryFindEtesRuleById({ id, status, name }) { | ||
| 551 | - findEtesRuleById({ id: id, status: status }) | ||
| 552 | - .then((res) => { | ||
| 553 | - const { code, data, msg } = res; | ||
| 554 | - if (code == 200) { | ||
| 555 | - data.list.flightRankDtoList.map((item) => { | ||
| 556 | - if (name == "view") { | ||
| 557 | - item.edit = true; | ||
| 558 | - } else { | ||
| 559 | - item.edit = false; | ||
| 560 | - } | ||
| 561 | - // 爆仓是否继续配舱 | ||
| 562 | - if (item.permitOverweight == "N") { | ||
| 563 | - item.permitOverweight = false; | ||
| 564 | - } else { | ||
| 565 | - item.permitOverweight = true; | ||
| 566 | - } | ||
| 567 | - }); | ||
| 568 | - data.list.flightRankDtoList.map((item) => { | ||
| 569 | - item.calculateDay = item.calculateDay; | ||
| 570 | - }); | ||
| 571 | - // ET86配舱航班顺位 | ||
| 572 | - this.tableData = data.list.flightRankDtoList; | ||
| 573 | - Object.keys(data.list.fltRuleDto).map((key) => { | ||
| 574 | - if (key == "multiHs") { | ||
| 575 | - if (data.list.fltRuleDto[key] == "N") { | ||
| 576 | - data.list.fltRuleDto[key] = true; | ||
| 577 | - } else { | ||
| 578 | - data.list.fltRuleDto[key] = false; | ||
| 579 | - } | ||
| 580 | - } | ||
| 581 | - // 将详情获取为null的字段设置为空字符串,目的是为了判断的时候少些为null的判断,保持空数据同一的判断条件; | ||
| 582 | - if (data.list.fltRuleDto[key] == null) { | ||
| 583 | - data.list.fltRuleDto[key] = ""; | ||
| 584 | - } | ||
| 585 | - }); | ||
| 586 | - if (data.list.fltRuleDto.declarationCategory) { | ||
| 587 | - this.checkboxClassType = | ||
| 588 | - data.list.fltRuleDto.declarationCategory.split(";"); | ||
| 589 | - } else { | ||
| 590 | - this.checkboxClassType = []; | ||
| 591 | - } | ||
| 592 | - this.queryForm = data.list.fltRuleDto; // ET86配舱航班顺位维度 | ||
| 593 | - } else { | ||
| 594 | - this.msgError(msg || "获取查看失败"); | ||
| 595 | - } | ||
| 596 | - }) | ||
| 597 | - .catch(() => {}); | ||
| 598 | - }, | ||
| 599 | - // ET86编辑 | ||
| 600 | - postUpdate(parmas) { | ||
| 601 | - update(parmas) | ||
| 602 | - .then((res) => { | ||
| 603 | - const { code, msg } = res; | ||
| 604 | - if (code == 200) { | ||
| 605 | - this.msgSuccess(msg || "修改成功!"); | ||
| 606 | - this.$router.push("/et86RuleConfig"); | ||
| 607 | - } else { | ||
| 608 | - this.msgError(msg || "修改失败!"); | ||
| 609 | - } | ||
| 610 | - }) | ||
| 611 | - .catch(() => {}); | ||
| 612 | - }, | ||
| 613 | - // 获取所有数据字典 | ||
| 614 | - getAllDictData() { | ||
| 615 | - allDictData() | ||
| 616 | - .then((res) => { | ||
| 617 | - if (res.code != 200) { | ||
| 618 | - this.msgError(res.msg); | ||
| 619 | - return; | ||
| 620 | - } | ||
| 621 | - this.cargoType = res.data.cargoType; // 申报类别 | ||
| 622 | - if (res.data.serviceCode.length) { | ||
| 623 | - this.getObj(res.data); | ||
| 624 | - } | ||
| 625 | - }) | ||
| 626 | - .catch(() => {}); | ||
| 627 | - }, | ||
| 628 | - // 航线查询 | ||
| 629 | - getQueryRouteByFltNo(item) { | ||
| 630 | - this.tableAttr.loadingTable = true; | ||
| 631 | - this.tableData[this.currentIndex].flightRoute; | ||
| 632 | - queryRouteByFltNo(item) | ||
| 633 | - .then((res) => { | ||
| 634 | - this.tableAttr.loadingTable = false; | ||
| 635 | - if (res.code == 200) { | ||
| 636 | - const list = res.data.list; | ||
| 637 | - let routeList = []; | ||
| 638 | - if (list.length) { | ||
| 639 | - list.map((item) => { | ||
| 640 | - routeList.push(item); | ||
| 641 | - }); | ||
| 642 | - let isEtesRoute = list.filter((item) => item.isEtesRoute == "Y"); // 过滤普通航线 | ||
| 643 | - if (isEtesRoute.length == 0) { | ||
| 644 | - this.msgError("该航班下的航线均为普通航线"); | ||
| 645 | - } | ||
| 646 | - this.tableData[this.currentIndex].flightRoute = ""; | ||
| 647 | - this.tableData[this.currentIndex].routeList = isEtesRoute; | ||
| 648 | - } else { | ||
| 649 | - this.msgError("暂无航线"); | ||
| 650 | - this.tableData[this.currentIndex].routeList = []; | ||
| 651 | - this.tableData[this.currentIndex].flightRoute = ""; | ||
| 652 | - } | ||
| 653 | - } | ||
| 654 | - }) | ||
| 655 | - .catch(() => {}); | ||
| 656 | - }, | ||
| 657 | - // 航班号input 聚焦事件 | ||
| 658 | - inputFocus({ $index }) { | ||
| 659 | - this.currentIndex = $index; | ||
| 660 | - }, | ||
| 661 | - // 失焦查询 | ||
| 662 | - blurSearch() { | ||
| 663 | - this.tableData[this.currentIndex].flightNo = this.upCase( | ||
| 664 | - this.tableData[this.currentIndex].flightNo | ||
| 665 | - ); // 转大写字母 | ||
| 666 | - let params = { | ||
| 667 | - fltNo: this.tableData[this.currentIndex].flightNo, | ||
| 668 | - }; | ||
| 669 | - let repeat = this.tableData.filter( | ||
| 670 | - (item) => | ||
| 671 | - item.flightNo == this.tableData[this.currentIndex].flightNo && | ||
| 672 | - item.calculateDay == this.tableData[this.currentIndex].calculateDay && | ||
| 673 | - item.flightRoute == this.tableData[this.currentIndex].flightRoute | ||
| 674 | - ); // 筛选重复的航班 | ||
| 675 | - if (repeat.length > 1) { | ||
| 676 | - this.msgError("航班顺位已重复"); | ||
| 677 | - return; | ||
| 678 | - } | ||
| 679 | - if (params.fltNo) { | ||
| 680 | - this.getQueryRouteByFltNo(params); | ||
| 681 | - } else { | ||
| 682 | - this.tableData[this.currentIndex].flightRoute = ""; | ||
| 683 | - this.tableData[this.currentIndex].routeList = []; | ||
| 684 | - this.msgError("请输入航班号"); | ||
| 685 | - } | ||
| 686 | - }, | ||
| 687 | - // 添加ET86配舱航班顺位 | ||
| 688 | - addBtn(item) { | ||
| 689 | - this.id++; | ||
| 690 | - this.tableData.unshift({ | ||
| 691 | - id: this.id, | ||
| 692 | - flightNo: "", // 航班号 | ||
| 693 | - calculateDay: "", // 航班日期//+1 -1 | ||
| 694 | - flightRoute: "", // 航线 | ||
| 695 | - routeList: [], // 航线列表 | ||
| 696 | - permitOverweight: "N" ? false : true, // 爆仓是否继续配舱 Y-是,N-否 | ||
| 697 | - priority: this.id, // 优先等级 | ||
| 698 | - ruleId: "", // 维度ID | ||
| 699 | - }); | ||
| 700 | - }, | ||
| 701 | - // 是否爆仓 | ||
| 702 | - changeCheck({ $index, row }) { | ||
| 703 | - this.tableData.map((item, i) => { | ||
| 704 | - if ($index !== i) { | ||
| 705 | - item.permitOverweight = false; | ||
| 706 | - } | ||
| 707 | - }); | ||
| 708 | - }, | ||
| 709 | - // 删除 | ||
| 710 | - deleBtn(item, $index) { | ||
| 711 | - this.tableData.splice($index, 1); | ||
| 712 | - }, | ||
| 713 | - // 类别 | ||
| 714 | - changeCheckboxCargoType(arr) { | ||
| 715 | - let include = this.cargoType.filter((item) => | ||
| 716 | - arr.some((val) => val == item.chineseName) | ||
| 717 | - ); // 查询已被勾选的类别 | ||
| 718 | - this.checkboxCargoType = include; //已勾选申报类别的数据 | ||
| 719 | - this.queryForm.declarationCategory = arr.join(";"); | ||
| 720 | - }, | ||
| 721 | - // 失焦事件 | ||
| 722 | - blurEvent() { | ||
| 723 | - this.queryForm.originOfFlightNo = this.upCase( | ||
| 724 | - this.queryForm.originOfFlightNo | ||
| 725 | - ); | ||
| 726 | - }, | ||
| 727 | - // 表单提交 | ||
| 728 | - submitForm(formName) { | ||
| 729 | - this.$refs[formName].validate((valid) => { | ||
| 730 | - if (valid) { | ||
| 731 | - // 爆仓是否继续配舱 | ||
| 732 | - const newtTableData = JSON.parse(JSON.stringify(this.tableData)); | ||
| 733 | - const tableData = newtTableData; | ||
| 734 | - tableData.filter((item) => { | ||
| 735 | - if (item.permitOverweight == false) { | ||
| 736 | - item.permitOverweight = "N"; | ||
| 737 | - } else { | ||
| 738 | - item.permitOverweight = "Y"; | ||
| 739 | - } | ||
| 740 | - }); | ||
| 741 | - // 校验ET86配舱航班顺位维度 | ||
| 742 | - if ( | ||
| 743 | - this.minCNYCustomVal.length != "" || | ||
| 744 | - this.maxCNYCustomVal.length != "" | ||
| 745 | - ) { | ||
| 746 | - this.queryForm.currencyCd = "CNY"; | ||
| 747 | - this.queryForm.minCustomVal = this.minCNYCustomVal; | ||
| 748 | - this.queryForm.maxCustomVal = this.maxCNYCustomVal; | ||
| 749 | - } else if ( | ||
| 750 | - this.minSUDCustomVal.length != "" || | ||
| 751 | - this.maxSUDCustomVal.length != "" | ||
| 752 | - ) { | ||
| 753 | - this.queryForm.currencyCd = "USD"; | ||
| 754 | - this.queryForm.minCustomVal = this.minSUDCustomVal; | ||
| 755 | - this.queryForm.maxCustomVal = this.maxSUDCustomVal; | ||
| 756 | - } else { | ||
| 757 | - this.queryForm.currencyCd = "CNY"; | ||
| 758 | - } | ||
| 759 | - let fltNo = this.tableData.some((item) => item.flightNo == ""); // 通过遍历判断航班顺位列表有没有填写的航班号 | ||
| 760 | - let fltNoRoute = this.tableData.some( | ||
| 761 | - (item) => item.flightRoute == "" | ||
| 762 | - ); // 通过遍历判断航班顺位列表有没有填写的航线 | ||
| 763 | - if (fltNo) { | ||
| 764 | - this.msgError("航班号不可为空"); | ||
| 765 | - return; | ||
| 766 | - } | ||
| 767 | - if (fltNoRoute) { | ||
| 768 | - this.msgError("航线不可为空"); | ||
| 769 | - return; | ||
| 770 | - } | ||
| 771 | - if (this.queryForm.originOfFlightNo.length == 0) { | ||
| 772 | - this.msgError("原航班号不可为空"); | ||
| 773 | - return; | ||
| 774 | - } | ||
| 775 | - this.queryForm.includeServiceType = | ||
| 776 | - this.isServiceCode == "1" && this.serviceCode.length > 0 | ||
| 777 | - ? this.serviceCode | ||
| 778 | - : ""; // 包含服务种类 | ||
| 779 | - this.queryForm.notIncludeServiceType = | ||
| 780 | - this.isServiceCode == "2" && this.serviceCode.length > 0 | ||
| 781 | - ? this.serviceCode | ||
| 782 | - : ""; // 不包含服务种类 | ||
| 783 | - let parmas = { | ||
| 784 | - flightRankDtoList: tableData, // ET86配舱航班顺位 | ||
| 785 | - fltRuleDto: this.queryForm, | ||
| 786 | - }; | ||
| 787 | - // 筛选重复的航班 | ||
| 788 | - let repeat = tableData.filter( | ||
| 789 | - (item) => | ||
| 790 | - item.flightNo == tableData[this.currentIndex].flightNo && | ||
| 791 | - item.calculateDay == tableData[this.currentIndex].calculateDay && | ||
| 792 | - item.flightRoute == tableData[this.currentIndex].flightRoute | ||
| 793 | - ); | ||
| 794 | - if (tableData.length > 100) { | ||
| 795 | - this.msgError("最多添加100条,请删除后再添加"); | ||
| 796 | - return; | ||
| 797 | - } | ||
| 798 | - if (repeat.length > 1) { | ||
| 799 | - this.msgError("ET86配舱航班顺位中存在重复设置"); | ||
| 800 | - return; | ||
| 801 | - } | ||
| 802 | - parmas.fltRuleDto.multiHs = this.queryForm.multiHs ? "N" : "Y"; // N为单品名,Y为多品名 | ||
| 803 | - if (this.validateForm && this.$route.query.name == "add") { | ||
| 804 | - this.postAdd(parmas); // 新增 | ||
| 805 | - } else { | ||
| 806 | - if (this.validateForm) { | ||
| 807 | - this.postUpdate(parmas); // 修改 | ||
| 808 | - } | ||
| 809 | - } | ||
| 810 | - } else { | ||
| 811 | - console.log("error submit!!"); | ||
| 812 | - return false; | ||
| 813 | - } | ||
| 814 | - }); | ||
| 815 | - this.$emit("handleSearch"); | ||
| 816 | - }, | ||
| 817 | - }, | ||
| 818 | -}; | ||
| 819 | -</script> | ||
| 820 | -<style lang="scss" scoped> | ||
| 821 | -.rowPadding { | ||
| 822 | - padding: 10px 0; | ||
| 823 | - font-size: 12px; | ||
| 824 | -} | ||
| 825 | -::v-deep .custom-label { | ||
| 826 | - .el-form-item__content { | ||
| 827 | - display: flex; | ||
| 828 | - margin-left: 0 !important; | ||
| 829 | - span { | ||
| 830 | - font-size: 14px; | ||
| 831 | - color: #606266; | ||
| 832 | - font-weight: 700; | ||
| 833 | - float: right; | ||
| 834 | - margin-right: 10px; | ||
| 835 | - text-align: end; | ||
| 836 | - } | ||
| 837 | - .custom-label-title { | ||
| 838 | - width: 120px; | ||
| 839 | - } | ||
| 840 | - .el-input__suffix { | ||
| 841 | - right: -15px !important; | ||
| 842 | - } | ||
| 843 | - .el-form-item__error { | ||
| 844 | - color: #ff4949; | ||
| 845 | - font-size: 12px; | ||
| 846 | - line-height: 1; | ||
| 847 | - padding-top: 4px; | ||
| 848 | - position: absolute; | ||
| 849 | - top: 100%; | ||
| 850 | - left: 0; | ||
| 851 | - font-weight: 500; | ||
| 852 | - width: 100% !important; | ||
| 853 | - } | ||
| 854 | - } | ||
| 855 | -} | ||
| 856 | -::v-deep .custom-label-pieces { | ||
| 857 | - .el-form-item__content { | ||
| 858 | - width: 80%; | ||
| 859 | - } | ||
| 860 | -} | ||
| 861 | -</style> |
| 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