Elements-SY

new branch

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 -}
1 -import request from "@/utils/request";
2 -
3 -// HScode黑名单查询
4 -export function findHsCodeList(data) {
5 - return request({
6 - url: "/etes/findHsCodeList",
7 - method: "post",
8 - data: data,
9 - });
10 -}
11 -
12 -// HScode黑名单删除
13 -export function delBlackList(data) {
14 - return request({
15 - url: "/etes/delBlackList",
16 - method: "post",
17 - data: data,
18 - });
19 -}
20 -
21 -// HScode黑名单下载模板
22 -export function downLoadTemplate(template) {
23 - return request({
24 - url: "/etes/downLoadTemplate?template=" + template,
25 - method: "get",
26 - responseType: "blob",
27 - });
28 -}
29 -
30 -// HScode黑名单导入
31 -export function uploadHsCode(data) {
32 - return request({
33 - url: "/etes/uploadHsCode",
34 - method: "post",
35 - data: data,
36 - });
37 -}
38 -
1 -import request from "@/utils/request";
2 -
3 -// HScode英文品名黑名单查询
4 -export function findShipmentDescList(data) {
5 - return request({
6 - url: "/etes/findShipmentDescList",
7 - method: "post",
8 - data: data,
9 - });
10 -}
11 -
12 -// HScode英文品名黑名单导入
13 -export function uploadShipmentDesc(data) {
14 - return request({
15 - url: "/etes/uploadShipmentDesc",
16 - method: "post",
17 - data: data,
18 - });
19 -}
20 -
21 -// HScode黑名单/英文品名删除
22 -export function delBlackList(data) {
23 - return request({
24 - url: "/etes/delBlackList ",
25 - method: "post",
26 - data: data,
27 - });
28 -}
29 -
30 -
...@@ -205,14 +205,3 @@ export function checkFlightRoute(data) { ...@@ -205,14 +205,3 @@ export function checkFlightRoute(data) {
205 }) 205 })
206 } 206 }
207 207
208 -//更新航线
209 -/**
210 - * @param id *
211 - */
212 -export function updateRoute(id) {
213 - return request({
214 - url: `/dictionary/updateRoute/${id}`,
215 - method: "post",
216 - data: {},
217 - });
218 -}
......
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>
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>
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>
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>
......
...@@ -45,9 +45,5 @@ export default { ...@@ -45,9 +45,5 @@ export default {
45 } 45 }
46 } 46 }
47 }, 47 },
48 - getBlockCurrentHeight() {
49 - let height = this.$refs.appMainBlock.$el.clientHeight;
50 - this.$store.dispatch("app/setAppMainBlockCH", height);
51 - },
52 }, 48 },
53 }; 49 };
......
...@@ -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 {
......
1 -<template>
2 - <div class="form-header container">
3 - <yl-table
4 - :attrs="tableAttr"
5 - :loadingTable="tableAttr.loadingTable"
6 - :columns="columns"
7 - :tableData="tableData"
8 - :pageConfig="pageConfig"
9 - @sizeChange="handleSizeChange"
10 - @currentChange="handleCurrentChange"
11 - >
12 - </yl-table>
13 - </div>
14 -</template>
15 -
16 -<script>
17 -import YlTable from "@/components/YlTable";
18 -import { tableAttr, columnHeader } from "./tableConfig";
19 -export default {
20 - name: "ErrorInfo",
21 - components: {
22 - YlTable,
23 - },
24 - data() {
25 - return {
26 - pageConfig: {
27 - // 分页配置项
28 - isPagination: false,
29 - total: 0,
30 - pageData: {
31 - page: 1,
32 - size: 10,
33 - },
34 - },
35 - tableAttr: tableAttr, // table配置项
36 - columns: columnHeader(), // 表头
37 - tableData: [], // 表格数据
38 - };
39 - },
40 - created() {
41 - const { data } = this.$route.query;
42 - this.tableData = JSON.parse(data);
43 - },
44 - methods: {
45 - //条数变化
46 - handleSizeChange(e) {
47 - this.pageConfig.pageData.size = e;
48 - this.pageConfig.pageData.page = 1;
49 - this.searchBtn();
50 - },
51 - //页码变化
52 - handleCurrentChange(e) {
53 - this.pageConfig.pageData.page = e;
54 - this.searchBtn();
55 - },
56 - // 搜索
57 - searchBtn() {},
58 - },
59 -};
60 -</script>
61 -<style lang="scss" scoped></style>
1 -export const tableAttr = {
2 - border: true,
3 - loadingTable: false,
4 - isDragSort: false, // 拖拽tableData数据一定要加id字段
5 - maxHeight: 300,
6 - btnCofig: {
7 - isBtn: false,
8 - btnGroup: [],
9 - },
10 -};
11 -export const columnHeader = () => [
12 - {
13 - type: "index",
14 - label: "序号",
15 - prop: "rowNum",
16 - align: "center",
17 - width: "70",
18 - },
19 - {
20 - label: "错误信息",
21 - prop: "msg",
22 - align: "center",
23 - minWidth: 150,
24 - },
25 -];
1 -<template>
2 - <div class="error-container">
3 - <el-dialog
4 - :width="width"
5 - :title="title"
6 - :center="center"
7 - :visible.sync="dialogVisible"
8 - :close-on-click-modal="onModalClickClose"
9 - @open="dialogOpenEvent"
10 - @close="dialogCloseEvent"
11 - >
12 - <slot></slot>
13 - <span slot="footer" class="dialog-footer">
14 - <el-button @click="cancel">取 消</el-button>
15 - <el-button type="primary" @click="confirm">{{
16 - confirmBtnName
17 - }}</el-button>
18 - </span>
19 - </el-dialog>
20 - </div>
21 -</template>
22 -
23 -<script>
24 -export default {
25 - props: {
26 - width: {
27 - type: String,
28 - default: "50%",
29 - },
30 - title: {
31 - type: String,
32 - default: "标题",
33 - },
34 - center: {
35 - type: String,
36 - default: "center",
37 - },
38 - confirmBtnName: {
39 - type: String,
40 - default: "确 定",
41 - },
42 - onModalClickClose: {
43 - type: Boolean,
44 - default: false,
45 - },
46 - },
47 - data() {
48 - return {
49 - dialogVisible: false,
50 - };
51 - },
52 - computed: {},
53 - created() {},
54 - mounted() {},
55 - methods: {
56 - dialogOpenEvent(data) {
57 - if (data && data.length) {
58 - console.log(data);
59 - }
60 - this.dialogVisible = true;
61 - this.$emit("open");
62 - },
63 - dialogCloseEvent() {
64 - this.dialogVisible = false;
65 - this.$emit("close");
66 - },
67 - // 确认事件
68 - confirm() {
69 - this.dialogVisible = false;
70 - this.$emit("confirm");
71 - },
72 - // 取消事件
73 - cancel() {
74 - this.dialogVisible = false;
75 - this.$emit("cancel");
76 - },
77 - },
78 -};
79 -</script>
80 -<style lang='scss' scoped>
81 -
82 -</style>
1 -export const formConfig = [
2 - {
3 - label: "HSCODE",
4 - type: "Input",
5 - name: "searchValue",
6 - prop: "searchValue",
7 - placeholder: "根据Hscode查询",
8 - span: 6,
9 - trigger: "blur", // 事件名
10 - },
11 -];
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 - />
12 - </el-col>
13 - </el-row>
14 - <yl-table
15 - ref="ylTable"
16 - :attrs="tableAttr"
17 - :loadingTable="tableAttr.loadingTable"
18 - :columns="columns"
19 - :tableData="tableData"
20 - :pageConfig="pageConfig"
21 - @search="searchBtn"
22 - @download="downloadTemplate"
23 - @upload="toUpload"
24 - @export="exportTemplate"
25 - @delete="deleteData"
26 - @sizeChange="handleSizeChange"
27 - @currentChange="handleCurrentChange"
28 - @selectionEvent="tableSelectionChange"
29 - >
30 - </yl-table>
31 - </div>
32 -</template>
33 -<script>
34 -import YlForm from "@/components/YlForm";
35 -import YlTable from "@/components/YlTable";
36 -import { formConfig } from "./formConfig";
37 -import { tableAttr, columnHeader } from "./tableConfig";
38 -import { restTableHeight } from "@/utils";
39 -import {
40 - findHsCodeList, // ShipmentDesc查询
41 - delBlackList, // ShipmentDesc删除
42 - downLoadTemplate, // ShipmentDesc下载模板
43 - uploadHsCode, // ShipmentDesc导入
44 -} from "@/api/et86HsCodeBlack";
45 -import { downLoadXlsx } from "@/utils/zipdownload";
46 -export default {
47 - name: "Et86HsCodeBlack",
48 - components: {
49 - YlForm,
50 - YlTable,
51 - },
52 - data() {
53 - return {
54 - formConfig: formConfig, // 表单配置项
55 - queryForm: {
56 - searchValue: "",
57 - }, // 表单参数
58 - pageConfig: {
59 - // 分页配置项
60 - isPagination: true,
61 - total: 0,
62 - pageData: {
63 - page: 1,
64 - size: 10,
65 - },
66 - },
67 - tableAttr: tableAttr, // table配置项
68 - columns: columnHeader(this.indexAdd, this.deleteRow), // 表头
69 - tableData: [], // 表格数据
70 - multipleSelection: [],
71 - };
72 - },
73 - created() {
74 - // 黑名单查询
75 - this.$nextTick(() => {
76 - this.searchBtn();
77 - });
78 - },
79 - mounted() {
80 - this.$nextTick(() => {
81 - this.tableAttr.maxHeight =
82 - window.innerHeight - restTableHeight(this.$refs);
83 - });
84 - },
85 - methods: {
86 - // HScode黑名单查询
87 - queryFindHsCodeList() {
88 - const { page, size } = this.pageConfig.pageData;
89 - let params = {
90 - limitStart: (page - 1) * size,
91 - limitSize: size,
92 - ...this.queryForm,
93 - };
94 - this.tableAttr.loadingTable = true;
95 - findHsCodeList(params)
96 - .then((res) => {
97 - this.tableAttr.loadingTable = false;
98 - const { code, data } = res;
99 - if (code == 200) {
100 - this.tableData = data.list;
101 - this.pageConfig.total = data.total;
102 - }
103 - })
104 - .catch(() => {});
105 - },
106 - // 删除黑名单
107 - toDelBlackList(params) {
108 - delBlackList(params)
109 - .then((res) => {
110 - const { code, msg } = res;
111 - if (code == 200) {
112 - this.searchBtn();
113 - this.msgSuccess(msg || "删除成功!");
114 - } else {
115 - this.$message.error(msg || "删除失败");
116 - }
117 - })
118 - .catch(() => {});
119 - },
120 - // 选择上传【HScode黑名单导入】
121 - toUpload({ file }) {
122 - const formData = new FormData();
123 - formData.append("file", file);
124 - uploadHsCode(formData)
125 - .then((res) => {
126 - const { code, data, msg } = res;
127 - if (code == 200) {
128 - this.searchBtn();
129 - this.msgSuccess(msg || "导入成功!");
130 - } else {
131 - this.$message.error(msg || "导入失败");
132 - this.$router.push({
133 - path: "/errorInfo",
134 - query: {
135 - name: "errorInfo",
136 - error: code,
137 - data: JSON.stringify(data),
138 - },
139 - });
140 - }
141 - })
142 - .catch(() => {});
143 - },
144 - // 下载【HScode黑名单下载模板】
145 - downloadTemplate() {
146 - downLoadTemplate("hsCode")
147 - .then((res) => {
148 - if (res) {
149 - const blob = new Blob([res]);
150 - const link = document.createElement("a"); //创建a标签
151 - link.download = "HSCODE黑名单表.xlsx"; //a标签添加属性
152 - link.style.display = "none";
153 - link.href = URL.createObjectURL(blob);
154 - document.body.appendChild(link);
155 - link.click(); //执行下载
156 - URL.revokeObjectURL(link.href); //释放url
157 - document.body.removeChild(link); //释放标签
158 - } else {
159 - this.$message.error("下载失败");
160 - }
161 - })
162 - .catch(() => {});
163 - },
164 - // 导出
165 - exportTemplate(row, i) {
166 - this.tableAttr.btnCofig.btnGroup[i].loading = true;
167 - downLoadXlsx("/etes/exportHsCodeList", this.queryForm, "HSCODE黑名单表")
168 - .then(() => {
169 - this.tableAttr.btnCofig.btnGroup[i].loading = false;
170 - })
171 - .catch(() => {
172 - this.$message.error("导出失败");
173 - });
174 - },
175 - // 删除
176 - deleteData(row) {
177 - if (this.multipleSelection.length) {
178 - let params = [];
179 - this.multipleSelection.map((item) => {
180 - params.push(item.id);
181 - });
182 - this.$confirm("是否确认删除?", "提示", {
183 - confirmButtonText: "确定",
184 - cancelButtonText: "取消",
185 - type: "warning",
186 - center: true,
187 - })
188 - .then(() => {
189 - this.toDelBlackList(params);
190 - })
191 - .catch(() => {});
192 - } else {
193 - this.$message.error("请勾选一条或者多条数据再操作!");
194 - }
195 - },
196 - // 搜索
197 - searchBtn() {
198 - this.pageConfig.pageData.page = 1;
199 - this.pageConfig.pageData.size = 10;
200 - this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
201 - this.queryFindHsCodeList();
202 - });
203 - },
204 - // 翻页序号递增
205 - indexAdd(index){
206 - const page = this.pageConfig.pageData.page // 当前页码
207 - const pagesize = this.pageConfig.pageData.size // 每页条数
208 - return index + 1 + (page - 1) * pagesize
209 - },
210 - //条数变化
211 - handleSizeChange(e) {
212 - this.pageConfig.pageData.size = e;
213 - this.pageConfig.pageData.page = 1;
214 - this.queryFindHsCodeList();
215 - },
216 - //页码变化
217 - handleCurrentChange(e) {
218 - this.pageConfig.pageData.page = e;
219 - this.queryFindHsCodeList();
220 - },
221 - // table勾选
222 - tableSelectionChange(val) {
223 - this.multipleSelection = val;
224 - },
225 - // 删除
226 - deleteRow({ row }) {
227 - this.$confirm("是否确认删除?", "提示", {
228 - confirmButtonText: "确定",
229 - cancelButtonText: "取消",
230 - type: "warning",
231 - center: true,
232 - })
233 - .then(() => {
234 - this.toDelBlackList([row.id]);
235 - })
236 - .catch(() => {});
237 - },
238 - },
239 -};
240 -</script>
241 -<style lang="scss" scoped></style>
1 -export const tableAttr = {
2 - border: true,
3 - loadingTable: false,
4 - isDragSort: false, // 拖拽tableData数据一定要加id字段
5 - maxHeight: 0,
6 - btnCofig: {
7 - isBtn: true,
8 - btnGroup: [
9 - {
10 - type: "primary", // text、primary、danger
11 - icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
12 - btnName: "搜索",
13 - size: "mini", // medium / small / mini
14 - round: false,
15 - loading: false,
16 - event: "search",
17 - },
18 - {
19 - type: "primary",
20 - icon: "el-icon-download",
21 - btnName: "下载模板",
22 - size: "mini",
23 - round: false,
24 - loading: false,
25 - event: "download",
26 - },
27 - {
28 - type: "primary",
29 - icon: "el-icon-upload",
30 - btnName: "导入",
31 - size: "mini",
32 - round: false,
33 - loading: false,
34 - event: "upLoad",
35 - action: "/goods/uploadGoodsExcel",
36 - fileName: "name",
37 - limit: 1,
38 - accept: ".xlsx",
39 - },
40 - {
41 - type: "primary",
42 - icon: "el-icon-download",
43 - btnName: "导出",
44 - size: "mini",
45 - round: false,
46 - loading: false,
47 - event: "export",
48 - },
49 - {
50 - type: "danger",
51 - icon: "el-icon-delete",
52 - btnName: "删除",
53 - size: "mini",
54 - round: false,
55 - loading: false,
56 - event: "delete",
57 - },
58 - ],
59 - },
60 -};
61 -export const columnHeader = (indexAdd, deleteRow) => [
62 - {
63 - type: "selection",
64 - align: "center",
65 - prop: "selection",
66 - width: "50",
67 - },
68 - {
69 - type: "index",
70 - label: "序号",
71 - prop: "id",
72 - align: "center",
73 - width: "50",
74 - index: indexAdd,
75 - },
76 - {
77 - label: "HSCODE",
78 - prop: "blackValue",
79 - align: "center",
80 - minWidth: 100,
81 - },
82 - {
83 - label: "创建时间",
84 - prop: "createTime",
85 - align: "center",
86 - minWidth: 100,
87 - },
88 - {
89 - label: "创建人",
90 - prop: "createUserName",
91 - align: "center",
92 - minWidth: 100,
93 - },
94 - {
95 - label: "文件名",
96 - prop: "uploadFileName",
97 - align: "center",
98 - minWidth: 100,
99 - },
100 -
101 - {
102 - label: "操作",
103 - prop: "operate",
104 - align: "center",
105 - minWidth: 120,
106 - fixed: "right",
107 - render: (h, params) => {
108 - return h("div", [
109 - h(
110 - "el-button",
111 - {
112 - style: {
113 - color: "#ff4949",
114 - },
115 - props: {
116 - type: "text",
117 - size: "mini",
118 - icon: "el-icon-delete",
119 - },
120 - on: {
121 - click() {
122 - deleteRow(params);
123 - },
124 - },
125 - },
126 - "删除"
127 - ),
128 - ]);
129 - },
130 - },
131 -];
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 -};
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.indexAdd, 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 - indexAdd(index){
128 - const page = this.pageConfig.pageData.page // 当前页码
129 - const pagesize = this.pageConfig.pageData.size // 每页条数
130 - return index + 1 + (page - 1) * pagesize
131 - },
132 - //条数变化
133 - handleSizeChange(e) {
134 - this.pageConfig.pageData.size = e;
135 - this.pageConfig.pageData.page = 1;
136 - this.queryFindAllEtesRules();
137 - },
138 - //页码变化
139 - handleCurrentChange(e) {
140 - this.pageConfig.pageData.page = e;
141 - this.queryFindAllEtesRules();
142 - },
143 - // 添加
144 - addBtn(item) {
145 - this.$router.push({
146 - path: "/edit",
147 - query: {
148 - name: "add",
149 - },
150 - });
151 - },
152 - // 重置表单
153 - restForm() {
154 - this.$refs.ruleForm.resetFields("ruleForm");
155 - },
156 - // 查看
157 - viewRow({ row }) {
158 - this.$router.push({
159 - path: "/edit",
160 - query: {
161 - name: "view",
162 - id: row.id,
163 - status: row.status,
164 - },
165 - });
166 - },
167 - // 编辑
168 - editRow({ row }) {
169 - this.$router.push({
170 - path: "/edit",
171 - query: {
172 - name: "edit",
173 - id: row.id,
174 - status: row.status,
175 - },
176 - });
177 - },
178 - // 删除
179 - deleteRow({ row }) {
180 - this.$confirm("是否确认删除? 删除后该规则设置为无效,不可恢复", "提示", {
181 - confirmButtonText: "确定",
182 - cancelButtonText: "取消",
183 - type: "warning",
184 - center: true,
185 - })
186 - .then(() => {
187 - deleteEtesRuleById({ id: row.id }).then((res) => {
188 - const { code, msg } = res;
189 - if (code == 200) {
190 - this.searchBtn();
191 - this.msgSuccess("删除成功!");
192 - } else {
193 - this.msgError(msg || "删除失败");
194 - }
195 - });
196 - })
197 - .catch(() => {});
198 - },
199 - },
200 -};
201 -</script>
202 -<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 = (indexAdd, viewRow, editRow, deleteRow) => [
36 - {
37 - type: "index",
38 - label: "序号",
39 - prop: "id",
40 - align: "center",
41 - width: "50",
42 - index: indexAdd,
43 - },
44 - {
45 - label: "原航班",
46 - prop: "originOfFlightNo",
47 - align: "center",
48 - minWidth: 80,
49 - },
50 - {
51 - label: "配载航班",
52 - prop: "rankFltNoStr",
53 - align: "center",
54 - minWidth: 120,
55 - },
56 - {
57 - label: "航线",
58 - prop: "rankFltRouteStr",
59 - align: "center",
60 - minWidth: 140,
61 - },
62 - {
63 - label: "状态",
64 - prop: "status",
65 - align: "center",
66 - minWidth: 50,
67 - render: (h, params) => {
68 - const { row } = params;
69 - return h("div", `${state[row.status]}`);
70 - },
71 - },
72 - {
73 - label: "修改时间",
74 - prop: "updateTime",
75 - align: "center",
76 - minWidth: 80,
77 - // sortable: true,
78 - // "sort-method": (a, b) => a.createTime - b.createTime,
79 - },
80 - {
81 - label: "修改人",
82 - prop: "updateUserName",
83 - align: "center",
84 - minWidth: 60,
85 - },
86 - {
87 - label: "操作",
88 - prop: "operate",
89 - align: "center",
90 - minWidth: 90,
91 - fixed: "right",
92 - render: (h, params) => {
93 - let operateData = [];
94 - if (params.row.status == "1") {
95 - operateData = [
96 - h(
97 - "el-button",
98 - {
99 - props: {
100 - type: "text",
101 - size: "mini",
102 - icon: "el-icon-view",
103 - },
104 - on: {
105 - click() {
106 - viewRow(params);
107 - },
108 - },
109 - },
110 - "查看"
111 - ),
112 - h(
113 - "el-button",
114 - {
115 - props: {
116 - type: "text",
117 - size: "mini",
118 - icon: "el-icon-edit",
119 - },
120 - on: {
121 - click() {
122 - editRow(params);
123 - },
124 - },
125 - },
126 - "修改"
127 - ),
128 - h(
129 - "el-button",
130 - {
131 - style: {
132 - color: "#ff4949",
133 - },
134 - props: {
135 - type: "text",
136 - size: "mini",
137 - icon: "el-icon-delete",
138 - },
139 - on: {
140 - click() {
141 - deleteRow(params);
142 - },
143 - },
144 - },
145 - "删除"
146 - ),
147 - ];
148 - } else {
149 - operateData = [
150 - h(
151 - "el-button",
152 - {
153 - props: {
154 - type: "text",
155 - size: "mini",
156 - icon: "el-icon-view",
157 - },
158 - on: {
159 - click() {
160 - viewRow(params);
161 - },
162 - },
163 - },
164 - "查看"
165 - ),
166 - ];
167 - }
168 - return h("div", operateData);
169 - },
170 - },
171 -];
1 -<template>
2 - <div class="error-container">
3 - <el-dialog
4 - :width="width"
5 - :title="title"
6 - :center="center"
7 - :visible.sync="dialogVisible"
8 - :close-on-click-modal="onModalClickClose"
9 - @open="dialogOpenEvent"
10 - @close="dialogCloseEvent"
11 - >
12 - <slot></slot>
13 - <span slot="footer" class="dialog-footer">
14 - <el-button @click="cancel">取 消</el-button>
15 - <el-button type="primary" @click="confirm">{{
16 - confirmBtnName
17 - }}</el-button>
18 - </span>
19 - </el-dialog>
20 - </div>
21 -</template>
22 -
23 -<script>
24 -export default {
25 - props: {
26 - width: {
27 - type: String,
28 - default: "50%",
29 - },
30 - title: {
31 - type: String,
32 - default: "标题",
33 - },
34 - center: {
35 - type: String,
36 - default: "center",
37 - },
38 - confirmBtnName: {
39 - type: String,
40 - default: "确 定",
41 - },
42 - onModalClickClose: {
43 - type: Boolean,
44 - default: false,
45 - },
46 - },
47 - data() {
48 - return {
49 - dialogVisible: false,
50 - };
51 - },
52 - computed: {},
53 - created() {},
54 - mounted() {},
55 - methods: {
56 - dialogOpenEvent(data) {
57 - if (data && data.length) {
58 - console.log(data);
59 - }
60 - this.dialogVisible = true;
61 - this.$emit("open");
62 - },
63 - dialogCloseEvent() {
64 - this.dialogVisible = false;
65 - this.$emit("close");
66 - },
67 - // 确认事件
68 - confirm() {
69 - this.dialogVisible = false;
70 - this.$emit("confirm");
71 - },
72 - // 取消事件
73 - cancel() {
74 - this.dialogVisible = false;
75 - this.$emit("cancel");
76 - },
77 - },
78 -};
79 -</script>
80 -<style lang='scss' scoped>
81 -
82 -</style>
1 -export const formConfig = [
2 - {
3 - label: "ShipmentDesc",
4 - type: "Input",
5 - name: "searchValue",
6 - prop: "searchValue",
7 - placeholder: "根据ShipmentDesc查询",
8 - span: 7,
9 - trigger: "blur", // 事件名
10 - },
11 -];
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 - />
12 - </el-col>
13 - </el-row>
14 - <yl-table
15 - ref="ylTable"
16 - :attrs="tableAttr"
17 - :loadingTable="tableAttr.loadingTable"
18 - :columns="columns"
19 - :tableData="tableData"
20 - :pageConfig="pageConfig"
21 - @search="searchBtn"
22 - @upload="toUpload"
23 - @export="exportTemplate"
24 - @delete="deleteData"
25 - @sizeChange="handleSizeChange"
26 - @currentChange="handleCurrentChange"
27 - @selectionEvent="tableSelectionChange"
28 - >
29 - </yl-table>
30 - </div>
31 -</template>
32 -<script>
33 -import YlForm from "@/components/YlForm";
34 -import YlTable from "@/components/YlTable";
35 -import { formConfig } from "./formConfig";
36 -import { tableAttr, columnHeader } from "./tableConfig";
37 -import { restTableHeight } from "@/utils";
38 -import {
39 - findShipmentDescList, // HScode英文品名黑名单查询
40 - uploadShipmentDesc, // HScode英文品名黑名单导入
41 - delBlackList, // HScode黑名单/英文品名删除
42 -} from "@/api/et86ShipmentDesc";
43 -import { downLoadXlsx } from "@/utils/zipdownload";
44 -export default {
45 - name: "et86ShipmentDesc",
46 - components: {
47 - YlForm,
48 - YlTable,
49 - },
50 - data() {
51 - return {
52 - formConfig: formConfig, // 表单配置项
53 - queryForm: {
54 - searchValue: "",
55 - }, // 表单参数
56 - pageConfig: {
57 - // 分页配置项
58 - isPagination: true,
59 - total: 0,
60 - pageData: {
61 - page: 1,
62 - size: 10,
63 - },
64 - },
65 - tableAttr: tableAttr, // table配置项
66 - columns: columnHeader(this.indexAdd, this.deleteRow), // 表头
67 - tableData: [], // 表格数据
68 - multipleSelection: [],
69 - };
70 - },
71 - created() {
72 - // 黑名单查询
73 - this.$nextTick(() => {
74 - this.searchBtn();
75 - });
76 - },
77 - mounted() {
78 - this.$nextTick(() => {
79 - this.tableAttr.maxHeight =
80 - window.innerHeight - restTableHeight(this.$refs);
81 - });
82 - },
83 - methods: {
84 - // HScode黑名单查询
85 - queryFindShipmentDescList() {
86 - const { page, size } = this.pageConfig.pageData;
87 - let params = {
88 - limitStart: (page - 1) * size,
89 - limitSize: size,
90 - ...this.queryForm,
91 - };
92 - this.tableAttr.loadingTable = true;
93 - findShipmentDescList(params)
94 - .then((res) => {
95 - this.tableAttr.loadingTable = false;
96 - const { code, data } = res;
97 - if (code == 200) {
98 - this.tableData = data.list;
99 - this.pageConfig.total = data.total;
100 - }
101 - })
102 - .catch(() => {});
103 - },
104 - // 删除黑名单
105 - toDelBlackList(params) {
106 - delBlackList(params)
107 - .then((res) => {
108 - const { code, msg } = res;
109 - if (code == 200) {
110 - this.searchBtn();
111 - this.msgSuccess(msg || "删除成功!");
112 - } else {
113 - this.$message.error(msg || "删除失败");
114 - }
115 - })
116 - .catch(() => {});
117 - },
118 - // 选择上传【HScode黑名单导入】
119 - toUpload({ file }) {
120 - const formData = new FormData();
121 - formData.append("file", file);
122 - uploadShipmentDesc(formData)
123 - .then((res) => {
124 - const { code, data, msg } = res;
125 - if (code == 200) {
126 - this.searchBtn();
127 - this.msgSuccess(msg || "导入成功!");
128 - } else {
129 - this.$message.error(msg || "导入失败");
130 - this.$router.push({
131 - path: "/errorInfo",
132 - query: {
133 - name: "errorInfo",
134 - error: code,
135 - data: JSON.stringify(data),
136 - },
137 - });
138 - }
139 - })
140 - .catch(() => {});
141 - },
142 - // 导出
143 - exportTemplate(row, i) {
144 - this.tableAttr.btnCofig.btnGroup[i].loading = true;
145 - downLoadXlsx(
146 - "/etes/exportShipmentDescList",
147 - this.queryForm,
148 - "HSCODE英文品名黑名单表"
149 - )
150 - .then(() => {
151 - this.tableAttr.btnCofig.btnGroup[i].loading = false;
152 - })
153 - .catch(() => {
154 - this.$message.error("导出失败");
155 - });
156 - },
157 - // 删除
158 - deleteData(row) {
159 - if (this.multipleSelection.length) {
160 - let params = [];
161 - this.multipleSelection.map((item) => {
162 - params.push(item.id);
163 - });
164 - this.$confirm("是否确认删除?", "提示", {
165 - confirmButtonText: "确定",
166 - cancelButtonText: "取消",
167 - type: "warning",
168 - center: true,
169 - })
170 - .then(() => {
171 - this.toDelBlackList(params);
172 - })
173 - .catch(() => {});
174 - } else {
175 - this.$message.error("请勾选一条或者多条数据再操作!");
176 - }
177 - },
178 - // 搜索
179 - searchBtn() {
180 - this.pageConfig.pageData.page = 1;
181 - this.pageConfig.pageData.size = 10;
182 - this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
183 - this.queryFindShipmentDescList();
184 - });
185 - },
186 - // 翻页序号递增
187 - indexAdd(index){
188 - const page = this.pageConfig.pageData.page // 当前页码
189 - const pagesize = this.pageConfig.pageData.size // 每页条数
190 - return index + 1 + (page - 1) * pagesize
191 - },
192 - //条数变化
193 - handleSizeChange(e) {
194 - this.pageConfig.pageData.size = e;
195 - this.pageConfig.pageData.page = 1;
196 - this.queryFindShipmentDescList();
197 - },
198 - //页码变化
199 - handleCurrentChange(e) {
200 - this.pageConfig.pageData.page = e;
201 - this.queryFindShipmentDescList();
202 - },
203 - // table勾选
204 - tableSelectionChange(val) {
205 - this.multipleSelection = val;
206 - },
207 - // 删除
208 - deleteRow({ row }) {
209 - this.$confirm("是否确认删除?", "提示", {
210 - confirmButtonText: "确定",
211 - cancelButtonText: "取消",
212 - type: "warning",
213 - center: true,
214 - })
215 - .then(() => {
216 - this.toDelBlackList([row.id]);
217 - })
218 - .catch(() => {});
219 - },
220 - },
221 -};
222 -</script>
223 -<style lang="scss" scoped></style>
1 -export const tableAttr = {
2 - border: true,
3 - loadingTable: false,
4 - isDragSort: false, // 拖拽tableData数据一定要加id字段
5 - maxHeight: 300,
6 - btnCofig: {
7 - isBtn: true,
8 - btnGroup: [
9 - {
10 - type: "primary", // text、primary、danger
11 - icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
12 - btnName: "搜索",
13 - size: "mini", // medium / small / mini
14 - round: false,
15 - loading: false,
16 - event: "search",
17 - },
18 - {
19 - type: "primary",
20 - icon: "el-icon-upload",
21 - btnName: "导入",
22 - size: "mini",
23 - round: false,
24 - loading: false,
25 - event: "upLoad",
26 - action: "/goods/uploadGoodsExcel",
27 - fileName: "name",
28 - limit: 1,
29 - accept: ".xlsx",
30 - },
31 - {
32 - type: "primary",
33 - icon: "el-icon-download",
34 - btnName: "导出",
35 - size: "mini",
36 - round: false,
37 - loading: false,
38 - event: "export",
39 - },
40 - {
41 - type: "danger",
42 - icon: "el-icon-delete",
43 - btnName: "删除",
44 - size: "mini",
45 - round: false,
46 - loading: false,
47 - event: "delete",
48 - },
49 - ],
50 - },
51 -};
52 -export const columnHeader = (indexAdd, deleteRow) => [
53 - {
54 - type: "selection",
55 - align: "center",
56 - prop: "selection",
57 - width: "50",
58 - },
59 - {
60 - type: "index",
61 - label: "序号",
62 - prop: "id",
63 - align: "center",
64 - width: "50",
65 - index: indexAdd,
66 - },
67 - {
68 - label: "ShipmentDesc",
69 - prop: "blackValue",
70 - align: "center",
71 - minWidth: 100,
72 - },
73 - {
74 - label: "创建时间",
75 - prop: "createTime",
76 - align: "center",
77 - minWidth: 100,
78 - },
79 - {
80 - label: "创建人",
81 - prop: "createUserName",
82 - align: "center",
83 - minWidth: 100,
84 - },
85 - {
86 - label: "文件名",
87 - prop: "uploadFileName",
88 - align: "center",
89 - minWidth: 100,
90 - },
91 -
92 - {
93 - label: "操作",
94 - prop: "operate",
95 - align: "center",
96 - minWidth: 120,
97 - fixed: "right",
98 - render: (h, params) => {
99 - return h("div", [
100 - h(
101 - "el-button",
102 - {
103 - style: {
104 - color: "#ff4949",
105 - },
106 - props: {
107 - type: "text",
108 - size: "mini",
109 - icon: "el-icon-delete",
110 - },
111 - on: {
112 - click() {
113 - deleteRow(params);
114 - },
115 - },
116 - },
117 - "删除"
118 - ),
119 - ]);
120 - },
121 - },
122 -];
...@@ -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"
...@@ -171,7 +166,7 @@ ...@@ -171,7 +166,7 @@
171 166
172 <script> 167 <script>
173 import Dialog from './dialog.vue' 168 import Dialog from './dialog.vue'
174 -import { getDictNameList, getDictionaryList, getServiceCodeList, delServiceCodeCihild, delDict, flightType, delFlight, queryRoute, delRoute, checkFlightRoute, updateRoute } from '@/api/system/dictionary.js' 169 +import { getDictNameList, getDictionaryList, getServiceCodeList, delServiceCodeCihild, delDict, flightType, delFlight, queryRoute, delRoute, checkFlightRoute } from '@/api/system/dictionary.js'
175 170
176 export default { 171 export default {
177 name: 'DictionaryConfig', 172 name: 'DictionaryConfig',
...@@ -251,25 +246,6 @@ export default { ...@@ -251,25 +246,6 @@ export default {
251 }, 246 },
252 }, 247 },
253 methods: { 248 methods: {
254 - /*
255 - 【更新航线】
256 - 更新路由成功后不用去调查询接口,
257 - 因为即便不去刷新页面调查询接口,
258 - 当前checkBox都是当前操作的状态;
259 - 所以调不调查询接口没有意义,反而消耗后台服务;
260 - */
261 - async updateRouteSubmit(params){
262 - await updateRoute(params).then(res=>{
263 - if(res.code == 200){
264 - this.msgSuccess(res.msg)
265 - }else{
266 - this.msgError(res.msg);
267 - }
268 - }).catch(err => {
269 - console.log(err)
270 - this.msgWarning(err)
271 - })
272 - },
273 //字典名称 249 //字典名称
274 dictNameSelect() { 250 dictNameSelect() {
275 getDictNameList().then(res => { 251 getDictNameList().then(res => {
...@@ -375,22 +351,7 @@ export default { ...@@ -375,22 +351,7 @@ export default {
375 } else if (this.tableName === '虚拟航班') { 351 } else if (this.tableName === '虚拟航班') {
376 this.flightDel([val.id]) 352 this.flightDel([val.id])
377 } else if (this.tableName === '航线') { 353 } else if (this.tableName === '航线') {
378 - /*
379 - 如果该航线是普通航线直接删,如果是ET86航线,那么要查询该航线有没有设置维度,
380 - 如果没有直接删,如果已经设置了维度是否考虑将该航线下的维度删掉再进行操作;
381 - */
382 - if(!val.isEtesRoute){ // 普通航线
383 this.routeDel({ data: [val], id: [val.id] }) 354 this.routeDel({ data: [val], id: [val.id] })
384 - }else{ // ET86航线
385 - this.$confirm("该航线是ET86航线。是否要删除", "注意!", {
386 - closeOnClickModal: false,
387 - confirmButtonText: "确定删除",
388 - cancelButtonText: "取消",
389 - type: "warning",
390 - }).then(() => {
391 - this.routeDel({ data: [val], id: [val.id] })
392 - }).catch(() => { })
393 - }
394 } else { 355 } else {
395 this.dicDel([val.id]) 356 this.dicDel([val.id])
396 } 357 }
...@@ -553,35 +514,6 @@ export default { ...@@ -553,35 +514,6 @@ export default {
553 serviceCodeTableSelectAll(val) { 514 serviceCodeTableSelectAll(val) {
554 this.nowSelect = val 515 this.nowSelect = val
555 }, 516 },
556 - // 确认消息提示
557 - confirmHandle($index, row){
558 - this.$confirm(row.msg, "提示", {
559 - confirmButtonText: "确定",
560 - cancelButtonText: "取消",
561 - type: "warning",
562 - center: true,
563 - })
564 - .then(() => {
565 - this.updateRouteSubmit(row.id);
566 - })
567 - .catch(() => {
568 - this.tableData[$index].isEtesRoute = !this.tableData[$index].isEtesRoute;
569 - });
570 - },
571 - // checkBox是否设置ET86航线
572 - checkboxIsEtesRoute({ $index, row }){
573 - if(!row.isEtesRoute){
574 - /*
575 - 将ET86设置成普通航线要查询校验该航线有没有设置维度,
576 - 如果该航线设置了ET86维度是否考虑将该航线下的维度删掉再进行操作;
577 - */
578 - row.msg = "是否将该航线设置为非ET86航线?";
579 - this.confirmHandle($index, row)
580 - }else{
581 - row.msg = "是否将该航线设置为ET86航线?";
582 - this.confirmHandle($index, row)
583 - }
584 - }
585 } 517 }
586 } 518 }
587 </script> 519 </script>
......