Elements-SY

Merge branch 'test' into uat

Showing 40 changed files with 3073 additions and 1496 deletions
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 +
...@@ -7,22 +7,45 @@ ...@@ -7,22 +7,45 @@
7 <el-form 7 <el-form
8 :model="tempQueryForm" 8 :model="tempQueryForm"
9 :inline="inline" 9 :inline="inline"
10 + :label-position="position"
11 + :label-width="formWidth"
10 :loading="loading" 12 :loading="loading"
11 ref="ruleForm" 13 ref="ruleForm"
12 :size="size" 14 :size="size"
13 > 15 >
14 - <el-form-item 16 + <el-row
17 + :gutter="rowGutter"
18 + :type="rowType"
19 + :justify="rowJustify"
20 + :align="rowAlign"
21 + :tag="rowTag"
22 + >
23 + <el-col
15 v-for="item in tempFormConfig" 24 v-for="item in tempFormConfig"
16 - :label="item.label" 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 }"
17 :key="item.prop" 36 :key="item.prop"
37 + >
38 + <el-form-item
39 + :label="item.label"
18 :prop="item.prop" 40 :prop="item.prop"
19 :rules="item.rules" 41 :rules="item.rules"
42 + :label-width="item.labelWidth"
20 > 43 >
21 <!-- 输入框 --> 44 <!-- 输入框 -->
22 <el-input 45 <el-input
23 v-if="item.type === 'Input'" 46 v-if="item.type === 'Input'"
24 v-model.trim="tempQueryForm[item.prop]" 47 v-model.trim="tempQueryForm[item.prop]"
25 - :style="{ width: item.width }" 48 + :style="{ width: item.inputWidth }"
26 :disabled="item.disable" 49 :disabled="item.disable"
27 :placeholder=" 50 :placeholder="
28 item.placeholder ? item.placeholder : '请输入' + item.label 51 item.placeholder ? item.placeholder : '请输入' + item.label
...@@ -46,7 +69,7 @@ ...@@ -46,7 +69,7 @@
46 :min="item.min" 69 :min="item.min"
47 :max="item.max" 70 :max="item.max"
48 v-model.trim="tempQueryForm[item.prop]" 71 v-model.trim="tempQueryForm[item.prop]"
49 - :style="{ width: item.width }" 72 + :style="{ width: item.inputWidth }"
50 :disabled="item.disable" 73 :disabled="item.disable"
51 :placeholder=" 74 :placeholder="
52 item.placeholder ? item.placeholder : '请输入' + item.label 75 item.placeholder ? item.placeholder : '请输入' + item.label
...@@ -62,20 +85,21 @@ ...@@ -62,20 +85,21 @@
62 :min="0" 85 :min="0"
63 :max="10" 86 :max="10"
64 :size="item.size" 87 :size="item.size"
65 - :style="{ width: item.width }" 88 + :style="{ width: item.inputWidth }"
66 label="描述文字" 89 label="描述文字"
67 ></el-input-number> 90 ></el-input-number>
68 91
69 <template v-if="view"> 92 <template v-if="view">
70 <span v-text="tempQueryForm[item.prop]"></span> 93 <span v-text="tempQueryForm[item.prop]"></span>
71 </template> 94 </template>
95 +
72 <!-- 下拉选择 --> 96 <!-- 下拉选择 -->
73 <el-select 97 <el-select
74 v-if="item.type === 'Select'" 98 v-if="item.type === 'Select'"
75 :multiple="item.multiple" 99 :multiple="item.multiple"
76 :filterable="item.filterable" 100 :filterable="item.filterable"
77 v-model.trim="tempQueryForm[item.prop]" 101 v-model.trim="tempQueryForm[item.prop]"
78 - :style="{ width: item.width }" 102 + :style="{ width: item.inputWidth }"
79 :disabled="item.disable" 103 :disabled="item.disable"
80 :loading="searchLoading" 104 :loading="searchLoading"
81 :placeholder=" 105 :placeholder="
...@@ -91,11 +115,12 @@ ...@@ -91,11 +115,12 @@
91 > 115 >
92 </el-option> 116 </el-option>
93 </el-select> 117 </el-select>
118 +
94 <!-- 远程搜索 --> 119 <!-- 远程搜索 -->
95 <template v-if="item.type === 'Search'"> 120 <template v-if="item.type === 'Search'">
96 <el-autocomplete 121 <el-autocomplete
97 v-model.trim="tempQueryForm[item.prop]" 122 v-model.trim="tempQueryForm[item.prop]"
98 - :style="{ width: item.width }" 123 + :style="{ width: item.inputWidth }"
99 :debounce="1500" 124 :debounce="1500"
100 :fetch-suggestions="querySearchAsync" 125 :fetch-suggestions="querySearchAsync"
101 :placeholder=" 126 :placeholder="
...@@ -111,9 +136,10 @@ ...@@ -111,9 +136,10 @@
111 <el-date-picker 136 <el-date-picker
112 v-if="item.type === 'Date'" 137 v-if="item.type === 'Date'"
113 v-model.trim="tempQueryForm[item.prop]" 138 v-model.trim="tempQueryForm[item.prop]"
114 - :style="{ width: item.width }" 139 + :style="{ width: item.inputWidth }"
115 :disabled="item.disable" 140 :disabled="item.disable"
116 :placeholder="item.placeholder ? item.placeholder : '请选择日期'" 141 :placeholder="item.placeholder ? item.placeholder : '请选择日期'"
142 + :value-format="item.format"
117 clearable 143 clearable
118 > 144 >
119 </el-date-picker> 145 </el-date-picker>
...@@ -122,7 +148,7 @@ ...@@ -122,7 +148,7 @@
122 <el-time-select 148 <el-time-select
123 v-if="item.type === 'Time'" 149 v-if="item.type === 'Time'"
124 v-model.trim="tempQueryForm[item.prop]" 150 v-model.trim="tempQueryForm[item.prop]"
125 - :style="{ width: item.width }" 151 + :style="{ width: item.inputWidth }"
126 :disabled="item.disable" 152 :disabled="item.disable"
127 :placeholder="item.placeholder ? item.placeholder : '请选择时间'" 153 :placeholder="item.placeholder ? item.placeholder : '请选择时间'"
128 clearable 154 clearable
...@@ -145,7 +171,7 @@ ...@@ -145,7 +171,7 @@
145 v-if="item.type === 'datetimerange'" 171 v-if="item.type === 'datetimerange'"
146 type="datetimerange" 172 type="datetimerange"
147 v-model.trim="tempQueryForm[item.prop]" 173 v-model.trim="tempQueryForm[item.prop]"
148 - :style="{ width: item.width }" 174 + :style="{ width: item.inputWidth }"
149 :disabled="item.disable" 175 :disabled="item.disable"
150 range-separator="至" 176 range-separator="至"
151 start-placeholder="开始日期" 177 start-placeholder="开始日期"
...@@ -188,7 +214,7 @@ ...@@ -188,7 +214,7 @@
188 v-if="item.type === 'textarea'" 214 v-if="item.type === 'textarea'"
189 v-model.trim="tempQueryForm[item.prop]" 215 v-model.trim="tempQueryForm[item.prop]"
190 type="textarea" 216 type="textarea"
191 - :style="{ width: item.width }" 217 + :style="{ width: item.inputWidth }"
192 :disabled="item.disable" 218 :disabled="item.disable"
193 :rows="item.row" 219 :rows="item.row"
194 :autosize="item.autosize" 220 :autosize="item.autosize"
...@@ -198,6 +224,7 @@ ...@@ -198,6 +224,7 @@
198 clearable 224 clearable
199 > 225 >
200 </el-input> 226 </el-input>
227 +
201 <!-- 多选框 --> 228 <!-- 多选框 -->
202 <template v-if="item.type === 'Checkbox'"> 229 <template v-if="item.type === 'Checkbox'">
203 <el-checkbox 230 <el-checkbox
...@@ -206,6 +233,7 @@ ...@@ -206,6 +233,7 @@
206 ></el-checkbox> 233 ></el-checkbox>
207 </template> 234 </template>
208 </el-form-item> 235 </el-form-item>
236 + </el-col>
209 <!-- 查询按钮 de--> 237 <!-- 查询按钮 de-->
210 <span v-show="inline & hiddenFormBtn"> 238 <span v-show="inline & hiddenFormBtn">
211 <el-form-item v-show="show"> 239 <el-form-item v-show="show">
...@@ -223,6 +251,7 @@ ...@@ -223,6 +251,7 @@
223 <el-button @click="resetFields('ruleForm')">重置</el-button> 251 <el-button @click="resetFields('ruleForm')">重置</el-button>
224 </el-form-item> 252 </el-form-item>
225 </span> 253 </span>
254 + </el-row>
226 </el-form> 255 </el-form>
227 </div> 256 </div>
228 </template> 257 </template>
...@@ -232,30 +261,25 @@ import request from "@/utils/request"; ...@@ -232,30 +261,25 @@ import request from "@/utils/request";
232 import { deepClone } from "@/utils"; 261 import { deepClone } from "@/utils";
233 export default { 262 export default {
234 props: { 263 props: {
235 - marginBottom: { 264 + rowGutter: {
236 type: Number, 265 type: Number,
237 - default: 30, 266 + default: 24,
238 }, 267 },
239 - view: { 268 + rowType: {
240 - type: Boolean,
241 - default: false,
242 - },
243 - formBtn: {
244 type: String, 269 type: String,
245 - default: "查询", 270 + default: "",
246 }, 271 },
247 - btnLoading: { 272 + rowJustify: {
248 - type: Boolean, 273 + type: String,
249 - default: false, 274 + default: "",
250 }, 275 },
251 - loading: { 276 + rowAlign: {
252 - //加载 277 + type: String,
253 - type: Boolean, 278 + default: "",
254 - default: false,
255 }, 279 },
256 - isBtnSave: { 280 + rowTag: {
257 - type: Boolean, 281 + type: String,
258 - default: false, 282 + default: "div",
259 }, 283 },
260 // 由inline属性决定form表单是普通表单,还是行内表单 284 // 由inline属性决定form表单是普通表单,还是行内表单
261 inline: { 285 inline: {
...@@ -272,14 +296,14 @@ export default { ...@@ -272,14 +296,14 @@ export default {
272 type: Boolean, 296 type: Boolean,
273 default: false, 297 default: false,
274 }, 298 },
275 - labelWidth: {
276 - type: String,
277 - default: "120px",
278 - },
279 formWidth: { 299 formWidth: {
280 //form表单宽度 300 //form表单宽度
281 type: String, 301 type: String,
282 - default: "200px", 302 + default: "auto",
303 + },
304 + position: {
305 + type: String,
306 + default: "",
283 }, 307 },
284 formConfig: { 308 formConfig: {
285 type: Array, 309 type: Array,
...@@ -294,6 +318,31 @@ export default { ...@@ -294,6 +318,31 @@ export default {
294 type: String, 318 type: String,
295 default: "small", 319 default: "small",
296 }, 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 + },
297 }, 346 },
298 data() { 347 data() {
299 return { 348 return {
...@@ -310,7 +359,7 @@ export default { ...@@ -310,7 +359,7 @@ export default {
310 methods: { 359 methods: {
311 // input事件绑定和注册 360 // input事件绑定和注册
312 inputEvent(e, item) { 361 inputEvent(e, item) {
313 - this.$emit("input", this.tempQueryForm); 362 + this.$emit(item.trigger, this.tempQueryForm);
314 }, 363 },
315 // 回车事件 364 // 回车事件
316 toEnterSearch() { 365 toEnterSearch() {
......
1 <template> 1 <template>
2 <div class="table-container"> 2 <div class="table-container">
3 - <el-row v-if="attrs.btnCofig.isBtn" style="margin-bottom: 15px"> 3 + <el-row
4 + v-if="attrs.btnCofig.isBtn"
5 + style="margin-bottom: 15px"
6 + id="group-btn"
7 + >
4 <el-col> 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 + >
5 <el-button 36 <el-button
6 - v-for="item in attrs.btnCofig.btnGroup"
7 - :key="item.icon"
8 :type="item.type" 37 :type="item.type"
9 :icon="item.icon" 38 :icon="item.icon"
10 :round="item.round" 39 :round="item.round"
11 :size="item.size" 40 :size="item.size"
12 :loading="item.loading" 41 :loading="item.loading"
13 - @click="handleClick(item)"
14 >{{ item.btnName }}</el-button 42 >{{ item.btnName }}</el-button
15 > 43 >
44 + </el-upload>
45 + </span>
16 </el-col> 46 </el-col>
17 </el-row> 47 </el-row>
18 <el-table 48 <el-table
...@@ -27,8 +57,8 @@ ...@@ -27,8 +57,8 @@
27 :header-cell-class-name="headerCellClassName" 57 :header-cell-class-name="headerCellClassName"
28 > 58 >
29 <template v-if="columns.length"> 59 <template v-if="columns.length">
30 - <template v-for="(item, index) in columns"> 60 + <template v-for="item in columns">
31 - <column v-if="!item.hidden" :key="index" :attrs="item"></column> 61 + <column v-if="!item.hidden" :key="item.id" :attrs="item"></column>
32 </template> 62 </template>
33 </template> 63 </template>
34 <slot name="column" v-else></slot> 64 <slot name="column" v-else></slot>
...@@ -36,8 +66,10 @@ ...@@ -36,8 +66,10 @@
36 <!-- 分页 --> 66 <!-- 分页 -->
37 <div 67 <div
38 v-if="pageConfig.isPagination" 68 v-if="pageConfig.isPagination"
69 + id="pagination"
39 class="pagination-container" 70 class="pagination-container"
40 :style="{ textAlign: pageConfig.position || 'right' }" 71 :style="{ textAlign: pageConfig.position || 'right' }"
72 + ref="paginationRef"
41 > 73 >
42 <el-pagination 74 <el-pagination
43 background 75 background
...@@ -193,8 +225,8 @@ export default { ...@@ -193,8 +225,8 @@ export default {
193 this.$emit("currentChange", e); 225 this.$emit("currentChange", e);
194 }, 226 },
195 // btn点击事件注册 227 // btn点击事件注册
196 - handleClick(item) { 228 + handleClick(item, i) {
197 - this.$emit(item.event, item); 229 + this.$emit(item.event, item, i);
198 }, 230 },
199 // 拖拽行更新排序 231 // 拖拽行更新排序
200 rowDrop() { 232 rowDrop() {
...@@ -231,6 +263,17 @@ export default { ...@@ -231,6 +263,17 @@ export default {
231 }, 263 },
232 }); 264 });
233 }, 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 + },
234 }, 277 },
235 watch: { 278 watch: {
236 data() { 279 data() {
...@@ -250,4 +293,10 @@ export default { ...@@ -250,4 +293,10 @@ export default {
250 padding: 0; 293 padding: 0;
251 } 294 }
252 } 295 }
296 + .first-span,.span{
297 + display: inline-block;
298 + }
299 + .span{
300 + margin-left: 6px;
301 + }
253 </style> 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 /> 11 + <app-main ref="appMainBlock" />
12 <right-panel v-if="false"> 12 <right-panel v-if="false">
13 <settings /> 13 <settings />
14 </right-panel> 14 </right-panel>
......
1 -import store from '@/store' 1 +import store from "@/store";
2 2
3 -const { body } = document 3 +const { body } = document;
4 -const WIDTH = 992 // refer to Bootstrap's responsive design 4 +const WIDTH = 992; // refer to Bootstrap's responsive design
5 5
6 export default { 6 export default {
7 watch: { 7 watch: {
8 $route(route) { 8 $route(route) {
9 - if (this.device === 'mobile' && this.sidebar.opened) { 9 + this.getBlockCurrentHeight();
10 - store.dispatch('app/closeSideBar', { withoutAnimation: false }) 10 + if (this.device === "mobile" && this.sidebar.opened) {
11 - } 11 + store.dispatch("app/closeSideBar", { withoutAnimation: false });
12 } 12 }
13 }, 13 },
14 + },
14 beforeMount() { 15 beforeMount() {
15 - window.addEventListener('resize', this.$_resizeHandler) 16 + window.addEventListener("resize", this.$_resizeHandler);
16 }, 17 },
17 beforeDestroy() { 18 beforeDestroy() {
18 - window.removeEventListener('resize', this.$_resizeHandler) 19 + window.removeEventListener("resize", this.$_resizeHandler);
19 }, 20 },
20 mounted() { 21 mounted() {
21 - const isMobile = this.$_isMobile() 22 + const isMobile = this.$_isMobile();
22 if (isMobile) { 23 if (isMobile) {
23 - store.dispatch('app/toggleDevice', 'mobile') 24 + store.dispatch("app/toggleDevice", "mobile");
24 - store.dispatch('app/closeSideBar', { withoutAnimation: true }) 25 + store.dispatch("app/closeSideBar", { withoutAnimation: true });
25 } 26 }
27 + this.$nextTick(()=>{
28 + this.getBlockCurrentHeight();
29 + })
26 }, 30 },
27 methods: { 31 methods: {
28 // use $_ for mixins properties 32 // use $_ for mixins properties
29 // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential 33 // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
30 $_isMobile() { 34 $_isMobile() {
31 - const rect = body.getBoundingClientRect() 35 + const rect = body.getBoundingClientRect();
32 - return rect.width - 1 < WIDTH 36 + return rect.width - 1 < WIDTH;
33 }, 37 },
34 $_resizeHandler() { 38 $_resizeHandler() {
35 if (!document.hidden) { 39 if (!document.hidden) {
36 - const isMobile = this.$_isMobile() 40 + const isMobile = this.$_isMobile();
37 - store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') 41 + store.dispatch("app/toggleDevice", isMobile ? "mobile" : "desktop");
38 42
39 if (isMobile) { 43 if (isMobile) {
40 - store.dispatch('app/closeSideBar', { withoutAnimation: true }) 44 + store.dispatch("app/closeSideBar", { withoutAnimation: true });
41 - }
42 - }
43 } 45 }
44 } 46 }
45 -} 47 + },
48 + getBlockCurrentHeight() {
49 + let height = this.$refs.appMainBlock.$el.clientHeight;
50 + this.$store.dispatch("app/setAppMainBlockCH", height);
51 + },
52 + },
53 +};
......
...@@ -73,19 +73,18 @@ export const constantRoutes = [ ...@@ -73,19 +73,18 @@ export const constantRoutes = [
73 hidden: true, 73 hidden: true,
74 children: [ 74 children: [
75 { 75 {
76 - path: "/et86", 76 + path: "/edit",
77 component: (resolve) => 77 component: (resolve) =>
78 - require(["@/views/allocationConfig/et86"], resolve), 78 + require(["@/views/et86Config/et86RuleConfig/edit"], resolve),
79 - name: "et86", 79 + name: "edit",
80 - meta: { title: "ET86", icon: "user" }, 80 + meta: { title: "ET86规则", icon: "user", noCache: false },
81 - children: [],
82 }, 81 },
83 { 82 {
84 - path: "/et86/:edit", 83 + path: "/errorInfo",
85 component: (resolve) => 84 component: (resolve) =>
86 - require(["@/views/allocationConfig/et86/edit"], resolve), 85 + require(["@/views/et86Config/errorInfo"], resolve),
87 - name: "edit", 86 + name: "errorInfo",
88 - meta: { title: "编辑", icon: "user" }, 87 + meta: { title: "错误信息提示", icon: "user" },
89 }, 88 },
90 { 89 {
91 path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status", 90 path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status",
......
1 const getters = { 1 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 - visitedViews: state => state.tagsView.visitedViews, 5 + appMainBlockClientHeight: (state) => state.app.appMainBlockClientHeight,
6 - cachedViews: state => state.tagsView.cachedViews, 6 + visitedViews: (state) => state.tagsView.visitedViews,
7 - token: state => state.user.token, 7 + cachedViews: (state) => state.tagsView.cachedViews,
8 - avatar: state => state.user.avatar, 8 + token: (state) => state.user.token,
9 - name: state => state.user.name, 9 + avatar: (state) => state.user.avatar,
10 - id: state => state.user.id, 10 + name: (state) => state.user.name,
11 - activePortName: state => state.user.activePortName, 11 + id: (state) => state.user.id,
12 - portName: state => state.user.portName, 12 + activePortName: (state) => state.user.activePortName,
13 - introduction: state => state.user.introduction, 13 + portName: (state) => state.user.portName,
14 - roles: state => state.user.roles, 14 + introduction: (state) => state.user.introduction,
15 - permissions: state => state.user.permissions, 15 + roles: (state) => state.user.roles,
16 - permission_routes: state => state.permission.routes, 16 + permissions: (state) => state.user.permissions,
17 - topbarRouters: state => state.permission.topbarRouters, 17 + permission_routes: (state) => state.permission.routes,
18 - defaultRoutes: state => state.permission.defaultRoutes, 18 + topbarRouters: (state) => state.permission.topbarRouters,
19 - sidebarRouters: state => state.permission.sidebarRouters, 19 + defaultRoutes: (state) => state.permission.defaultRoutes,
20 - filghtAllData: state => state.permission.filghtAllData, 20 + sidebarRouters: (state) => state.permission.sidebarRouters,
21 - tableHeader: state => state.user.tableHeader 21 + filghtAllData: (state) => state.permission.filghtAllData,
22 -} 22 + tableHeader: (state) => state.user.tableHeader,
23 +};
23 export default getters 24 export default getters
......
...@@ -2,13 +2,16 @@ ...@@ -2,13 +2,16 @@
2 2
3 const state = { 3 const state = {
4 sidebar: { 4 sidebar: {
5 - opened: localStorage.getItem('sidebarStatus') ? !!+localStorage.getItem('sidebarStatus') : true, 5 + opened: localStorage.getItem("sidebarStatus")
6 - withoutAnimation: false 6 + ? !!+localStorage.getItem("sidebarStatus")
7 + : true,
8 + withoutAnimation: false,
7 }, 9 },
8 - device: 'desktop', 10 + device: "desktop",
9 //size: Cookies.get('size') || 'medium' 11 //size: Cookies.get('size') || 'medium'
10 - size: localStorage.getItem('size') || 'medium' 12 + size: localStorage.getItem("size") || "medium",
11 -} 13 + appMainBlockClientHeight: null
14 +};
12 15
13 const mutations = { 16 const mutations = {
14 TOGGLE_SIDEBAR: state => { 17 TOGGLE_SIDEBAR: state => {
...@@ -35,23 +38,30 @@ const mutations = { ...@@ -35,23 +38,30 @@ const mutations = {
35 state.size = size 38 state.size = size
36 //Cookies.set('size', size) 39 //Cookies.set('size', size)
37 localStorage.setItem('size', size) 40 localStorage.setItem('size', size)
38 - } 41 + },
42 + SET_APPMAINBLOCKCH: (state, height) => {
43 + state.appMainBlockClientHeight = height;
44 + },
45 +
39 } 46 }
40 47
41 const actions = { 48 const actions = {
42 toggleSideBar({ commit }) { 49 toggleSideBar({ commit }) {
43 - commit('TOGGLE_SIDEBAR') 50 + commit("TOGGLE_SIDEBAR");
44 }, 51 },
45 closeSideBar({ commit }, { withoutAnimation }) { 52 closeSideBar({ commit }, { withoutAnimation }) {
46 - commit('CLOSE_SIDEBAR', withoutAnimation) 53 + commit("CLOSE_SIDEBAR", withoutAnimation);
47 }, 54 },
48 toggleDevice({ commit }, device) { 55 toggleDevice({ commit }, device) {
49 - commit('TOGGLE_DEVICE', device) 56 + commit("TOGGLE_DEVICE", device);
50 }, 57 },
51 setSize({ commit }, size) { 58 setSize({ commit }, size) {
52 - commit('SET_SIZE', size) 59 + commit("SET_SIZE", size);
53 - } 60 + },
54 -} 61 + setAppMainBlockCH({ commit }, height) {
62 + commit("SET_APPMAINBLOCKCH", height);
63 + },
64 +};
55 65
56 export default { 66 export default {
57 namespaced: true, 67 namespaced: true,
......
...@@ -54,26 +54,6 @@ const permission = { ...@@ -54,26 +54,6 @@ const permission = {
54 return new Promise((resolve) => { 54 return new Promise((resolve) => {
55 // 向后端请求路由数据 55 // 向后端请求路由数据
56 getRouters().then((res) => { 56 getRouters().then((res) => {
57 - // const newUrl = {
58 - // id: 24,
59 - // name: "et86",
60 - // path: "/et86",
61 - // hidden: false,
62 - // component: "allocationConfig/et86",
63 - // meta: {
64 - // title: "ET86",
65 - // icon: "edit",
66 - // permissions: "allocation:rand:list",
67 - // noCache: false,
68 - // },
69 - // alwaysShow: false,
70 - // children: null,
71 - // };
72 - // res.data.map((item) => {
73 - // if (item.name == "AllocationConfig") {
74 - // item.children.push(newUrl);
75 - // }
76 - // });
77 res.data = hasPermi.routerPer(res.data); 57 res.data = hasPermi.routerPer(res.data);
78 const sdata = JSON.parse(JSON.stringify(res.data)); 58 const sdata = JSON.parse(JSON.stringify(res.data));
79 const rdata = JSON.parse(JSON.stringify(res.data)); 59 const rdata = JSON.parse(JSON.stringify(res.data));
......
1 -import { parseTime } from './FedEx' 1 +import { parseTime } from "./FedEx";
2 2
3 /** 3 /**
4 * 表格时间格式化 4 * 表格时间格式化
5 */ 5 */
6 export function formatDate(cellValue) { 6 export function formatDate(cellValue) {
7 if (cellValue == null || cellValue == "") return ""; 7 if (cellValue == null || cellValue == "") return "";
8 - var date = new Date(cellValue) 8 + var date = new Date(cellValue);
9 - var year = date.getFullYear() 9 + var year = date.getFullYear();
10 - var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 10 + var month =
11 - var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() 11 + date.getMonth() + 1 < 10
12 - var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() 12 + ? "0" + (date.getMonth() + 1)
13 - var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() 13 + : date.getMonth() + 1;
14 - var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() 14 + var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
15 - return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds 15 + var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
16 + var minutes =
17 + date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
18 + var seconds =
19 + date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
20 + return (
21 + year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds
22 + );
16 } 23 }
17 24
18 /** 25 /**
...@@ -21,40 +28,40 @@ export function formatDate(cellValue) { ...@@ -21,40 +28,40 @@ export function formatDate(cellValue) {
21 * @returns {string} 28 * @returns {string}
22 */ 29 */
23 export function formatTime(time, option) { 30 export function formatTime(time, option) {
24 - if (('' + time).length === 10) { 31 + if (("" + time).length === 10) {
25 - time = parseInt(time) * 1000 32 + time = parseInt(time) * 1000;
26 } else { 33 } else {
27 - time = +time 34 + time = +time;
28 } 35 }
29 - const d = new Date(time) 36 + const d = new Date(time);
30 - const now = Date.now() 37 + const now = Date.now();
31 38
32 - const diff = (now - d) / 1000 39 + const diff = (now - d) / 1000;
33 40
34 if (diff < 30) { 41 if (diff < 30) {
35 - return '刚刚' 42 + return "刚刚";
36 } else if (diff < 3600) { 43 } else if (diff < 3600) {
37 // less 1 hour 44 // less 1 hour
38 - return Math.ceil(diff / 60) + '分钟前' 45 + return Math.ceil(diff / 60) + "分钟前";
39 } else if (diff < 3600 * 24) { 46 } else if (diff < 3600 * 24) {
40 - return Math.ceil(diff / 3600) + '小时前' 47 + return Math.ceil(diff / 3600) + "小时前";
41 } else if (diff < 3600 * 24 * 2) { 48 } else if (diff < 3600 * 24 * 2) {
42 - return '1天前' 49 + return "1天前";
43 } 50 }
44 if (option) { 51 if (option) {
45 - return parseTime(time, option) 52 + return parseTime(time, option);
46 } else { 53 } else {
47 return ( 54 return (
48 d.getMonth() + 55 d.getMonth() +
49 1 + 56 1 +
50 - '月' + 57 + "月" +
51 d.getDate() + 58 d.getDate() +
52 - '日' + 59 + "日" +
53 d.getHours() + 60 d.getHours() +
54 - '时' + 61 + "时" +
55 d.getMinutes() + 62 d.getMinutes() +
56 - '分' 63 + "分"
57 - ) 64 + );
58 } 65 }
59 } 66 }
60 67
...@@ -63,18 +70,18 @@ export function formatTime(time, option) { ...@@ -63,18 +70,18 @@ export function formatTime(time, option) {
63 * @returns {Object} 70 * @returns {Object}
64 */ 71 */
65 export function getQueryObject(url) { 72 export function getQueryObject(url) {
66 - url = url == null ? window.location.href : url 73 + url = url == null ? window.location.href : url;
67 - const search = url.substring(url.lastIndexOf('?') + 1) 74 + const search = url.substring(url.lastIndexOf("?") + 1);
68 - const obj = {} 75 + const obj = {};
69 - const reg = /([^?&=]+)=([^?&=]*)/g 76 + const reg = /([^?&=]+)=([^?&=]*)/g;
70 search.replace(reg, (rs, $1, $2) => { 77 search.replace(reg, (rs, $1, $2) => {
71 - const name = decodeURIComponent($1) 78 + const name = decodeURIComponent($1);
72 - let val = decodeURIComponent($2) 79 + let val = decodeURIComponent($2);
73 - val = String(val) 80 + val = String(val);
74 - obj[name] = val 81 + obj[name] = val;
75 - return rs 82 + return rs;
76 - }) 83 + });
77 - return obj 84 + return obj;
78 } 85 }
79 86
80 /** 87 /**
...@@ -83,14 +90,14 @@ export function getQueryObject(url) { ...@@ -83,14 +90,14 @@ export function getQueryObject(url) {
83 */ 90 */
84 export function byteLength(str) { 91 export function byteLength(str) {
85 // returns the byte length of an utf8 string 92 // returns the byte length of an utf8 string
86 - let s = str.length 93 + let s = str.length;
87 for (var i = str.length - 1; i >= 0; i--) { 94 for (var i = str.length - 1; i >= 0; i--) {
88 - const code = str.charCodeAt(i) 95 + const code = str.charCodeAt(i);
89 - if (code > 0x7f && code <= 0x7ff) s++ 96 + if (code > 0x7f && code <= 0x7ff) s++;
90 - else if (code > 0x7ff && code <= 0xffff) s += 2 97 + else if (code > 0x7ff && code <= 0xffff) s += 2;
91 - if (code >= 0xDC00 && code <= 0xDFFF) i-- 98 + if (code >= 0xdc00 && code <= 0xdfff) i--;
92 } 99 }
93 - return s 100 + return s;
94 } 101 }
95 102
96 /** 103 /**
...@@ -98,13 +105,13 @@ export function byteLength(str) { ...@@ -98,13 +105,13 @@ export function byteLength(str) {
98 * @returns {Array} 105 * @returns {Array}
99 */ 106 */
100 export function cleanArray(actual) { 107 export function cleanArray(actual) {
101 - const newArray = [] 108 + const newArray = [];
102 for (let i = 0; i < actual.length; i++) { 109 for (let i = 0; i < actual.length; i++) {
103 if (actual[i]) { 110 if (actual[i]) {
104 - newArray.push(actual[i]) 111 + newArray.push(actual[i]);
105 } 112 }
106 } 113 }
107 - return newArray 114 + return newArray;
108 } 115 }
109 116
110 /** 117 /**
...@@ -112,13 +119,13 @@ export function cleanArray(actual) { ...@@ -112,13 +119,13 @@ export function cleanArray(actual) {
112 * @returns {Array} 119 * @returns {Array}
113 */ 120 */
114 export function param(json) { 121 export function param(json) {
115 - if (!json) return '' 122 + if (!json) return "";
116 return cleanArray( 123 return cleanArray(
117 - Object.keys(json).map(key => { 124 + Object.keys(json).map((key) => {
118 - if (json[key] === undefined) return '' 125 + if (json[key] === undefined) return "";
119 - return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) 126 + return encodeURIComponent(key) + "=" + encodeURIComponent(json[key]);
120 }) 127 })
121 - ).join('&') 128 + ).join("&");
122 } 129 }
123 130
124 /** 131 /**
...@@ -126,21 +133,21 @@ export function param(json) { ...@@ -126,21 +133,21 @@ export function param(json) {
126 * @returns {Object} 133 * @returns {Object}
127 */ 134 */
128 export function param2Obj(url) { 135 export function param2Obj(url) {
129 - const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') 136 + const search = decodeURIComponent(url.split("?")[1]).replace(/\+/g, " ");
130 if (!search) { 137 if (!search) {
131 - return {} 138 + return {};
132 } 139 }
133 - const obj = {} 140 + const obj = {};
134 - const searchArr = search.split('&') 141 + const searchArr = search.split("&");
135 - searchArr.forEach(v => { 142 + searchArr.forEach((v) => {
136 - const index = v.indexOf('=') 143 + const index = v.indexOf("=");
137 if (index !== -1) { 144 if (index !== -1) {
138 - const name = v.substring(0, index) 145 + const name = v.substring(0, index);
139 - const val = v.substring(index + 1, v.length) 146 + const val = v.substring(index + 1, v.length);
140 - obj[name] = val 147 + obj[name] = val;
141 } 148 }
142 - }) 149 + });
143 - return obj 150 + return obj;
144 } 151 }
145 152
146 /** 153 /**
...@@ -148,9 +155,9 @@ export function param2Obj(url) { ...@@ -148,9 +155,9 @@ export function param2Obj(url) {
148 * @returns {string} 155 * @returns {string}
149 */ 156 */
150 export function html2Text(val) { 157 export function html2Text(val) {
151 - const div = document.createElement('div') 158 + const div = document.createElement("div");
152 - div.innerHTML = val 159 + div.innerHTML = val;
153 - return div.textContent || div.innerText 160 + return div.textContent || div.innerText;
154 } 161 }
155 162
156 /** 163 /**
...@@ -160,21 +167,21 @@ export function html2Text(val) { ...@@ -160,21 +167,21 @@ export function html2Text(val) {
160 * @returns {Object} 167 * @returns {Object}
161 */ 168 */
162 export function objectMerge(target, source) { 169 export function objectMerge(target, source) {
163 - if (typeof target !== 'object') { 170 + if (typeof target !== "object") {
164 - target = {} 171 + target = {};
165 } 172 }
166 if (Array.isArray(source)) { 173 if (Array.isArray(source)) {
167 - return source.slice() 174 + return source.slice();
168 } 175 }
169 - Object.keys(source).forEach(property => { 176 + Object.keys(source).forEach((property) => {
170 - const sourceProperty = source[property] 177 + const sourceProperty = source[property];
171 - if (typeof sourceProperty === 'object') { 178 + if (typeof sourceProperty === "object") {
172 - target[property] = objectMerge(target[property], sourceProperty) 179 + target[property] = objectMerge(target[property], sourceProperty);
173 } else { 180 } else {
174 - target[property] = sourceProperty 181 + target[property] = sourceProperty;
175 } 182 }
176 - }) 183 + });
177 - return target 184 + return target;
178 } 185 }
179 186
180 /** 187 /**
...@@ -183,18 +190,18 @@ export function objectMerge(target, source) { ...@@ -183,18 +190,18 @@ export function objectMerge(target, source) {
183 */ 190 */
184 export function toggleClass(element, className) { 191 export function toggleClass(element, className) {
185 if (!element || !className) { 192 if (!element || !className) {
186 - return 193 + return;
187 } 194 }
188 - let classString = element.className 195 + let classString = element.className;
189 - const nameIndex = classString.indexOf(className) 196 + const nameIndex = classString.indexOf(className);
190 if (nameIndex === -1) { 197 if (nameIndex === -1) {
191 - classString += '' + className 198 + classString += "" + className;
192 } else { 199 } else {
193 classString = 200 classString =
194 classString.substr(0, nameIndex) + 201 classString.substr(0, nameIndex) +
195 - classString.substr(nameIndex + className.length) 202 + classString.substr(nameIndex + className.length);
196 } 203 }
197 - element.className = classString 204 + element.className = classString;
198 } 205 }
199 206
200 /** 207 /**
...@@ -202,10 +209,10 @@ export function toggleClass(element, className) { ...@@ -202,10 +209,10 @@ export function toggleClass(element, className) {
202 * @returns {Date} 209 * @returns {Date}
203 */ 210 */
204 export function getTime(type) { 211 export function getTime(type) {
205 - if (type === 'start') { 212 + if (type === "start") {
206 - return new Date().getTime() - 3600 * 1000 * 24 * 90 213 + return new Date().getTime() - 3600 * 1000 * 24 * 90;
207 } else { 214 } else {
208 - return new Date(new Date().toDateString()) 215 + return new Date(new Date().toDateString());
209 } 216 }
210 } 217 }
211 218
...@@ -216,38 +223,38 @@ export function getTime(type) { ...@@ -216,38 +223,38 @@ export function getTime(type) {
216 * @return {*} 223 * @return {*}
217 */ 224 */
218 export function debounce(func, wait, immediate) { 225 export function debounce(func, wait, immediate) {
219 - let timeout, args, context, timestamp, result 226 + let timeout, args, context, timestamp, result;
220 227
221 const later = function () { 228 const later = function () {
222 // 据上一次触发时间间隔 229 // 据上一次触发时间间隔
223 - const last = +new Date() - timestamp 230 + const last = +new Date() - timestamp;
224 231
225 // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait 232 // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
226 if (last < wait && last > 0) { 233 if (last < wait && last > 0) {
227 - timeout = setTimeout(later, wait - last) 234 + timeout = setTimeout(later, wait - last);
228 } else { 235 } else {
229 - timeout = null 236 + timeout = null;
230 // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 237 // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
231 if (!immediate) { 238 if (!immediate) {
232 - result = func.apply(context, args) 239 + result = func.apply(context, args);
233 - if (!timeout) context = args = null 240 + if (!timeout) context = args = null;
234 - }
235 } 241 }
236 } 242 }
243 + };
237 244
238 return function (...args) { 245 return function (...args) {
239 - context = this 246 + context = this;
240 - timestamp = +new Date() 247 + timestamp = +new Date();
241 - const callNow = immediate && !timeout 248 + const callNow = immediate && !timeout;
242 // 如果延时不存在,重新设定延时 249 // 如果延时不存在,重新设定延时
243 - if (!timeout) timeout = setTimeout(later, wait) 250 + if (!timeout) timeout = setTimeout(later, wait);
244 if (callNow) { 251 if (callNow) {
245 - result = func.apply(context, args) 252 + result = func.apply(context, args);
246 - context = args = null 253 + context = args = null;
247 } 254 }
248 255
249 - return result 256 + return result;
250 - } 257 + };
251 } 258 }
252 259
253 /** 260 /**
...@@ -258,18 +265,18 @@ export function debounce(func, wait, immediate) { ...@@ -258,18 +265,18 @@ export function debounce(func, wait, immediate) {
258 * @returns {Object} 265 * @returns {Object}
259 */ 266 */
260 export function deepClone(source) { 267 export function deepClone(source) {
261 - if (!source && typeof source !== 'object') { 268 + if (!source && typeof source !== "object") {
262 - throw new Error('error arguments', 'deepClone') 269 + throw new Error("error arguments", "deepClone");
263 } 270 }
264 - const targetObj = source.constructor === Array ? [] : {} 271 + const targetObj = source.constructor === Array ? [] : {};
265 - Object.keys(source).forEach(keys => { 272 + Object.keys(source).forEach((keys) => {
266 - if (source[keys] && typeof source[keys] === 'object') { 273 + if (source[keys] && typeof source[keys] === "object") {
267 - targetObj[keys] = deepClone(source[keys]) 274 + targetObj[keys] = deepClone(source[keys]);
268 } else { 275 } else {
269 - targetObj[keys] = source[keys] 276 + targetObj[keys] = source[keys];
270 } 277 }
271 - }) 278 + });
272 - return targetObj 279 + return targetObj;
273 } 280 }
274 281
275 /** 282 /**
...@@ -277,16 +284,16 @@ export function deepClone(source) { ...@@ -277,16 +284,16 @@ export function deepClone(source) {
277 * @returns {Array} 284 * @returns {Array}
278 */ 285 */
279 export function uniqueArr(arr) { 286 export function uniqueArr(arr) {
280 - return Array.from(new Set(arr)) 287 + return Array.from(new Set(arr));
281 } 288 }
282 289
283 /** 290 /**
284 * @returns {string} 291 * @returns {string}
285 */ 292 */
286 export function createUniqueString() { 293 export function createUniqueString() {
287 - const timestamp = +new Date() + '' 294 + const timestamp = +new Date() + "";
288 - const randomNum = parseInt((1 + Math.random()) * 65536) + '' 295 + const randomNum = parseInt((1 + Math.random()) * 65536) + "";
289 - return (+(randomNum + timestamp)).toString(32) 296 + return (+(randomNum + timestamp)).toString(32);
290 } 297 }
291 298
292 /** 299 /**
...@@ -296,7 +303,7 @@ export function createUniqueString() { ...@@ -296,7 +303,7 @@ export function createUniqueString() {
296 * @returns {boolean} 303 * @returns {boolean}
297 */ 304 */
298 export function hasClass(ele, cls) { 305 export function hasClass(ele, cls) {
299 - return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) 306 + return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
300 } 307 }
301 308
302 /** 309 /**
...@@ -305,7 +312,7 @@ export function hasClass(ele, cls) { ...@@ -305,7 +312,7 @@ export function hasClass(ele, cls) {
305 * @param {string} cls 312 * @param {string} cls
306 */ 313 */
307 export function addClass(ele, cls) { 314 export function addClass(ele, cls) {
308 - if (!hasClass(ele, cls)) ele.className += ' ' + cls 315 + if (!hasClass(ele, cls)) ele.className += " " + cls;
309 } 316 }
310 317
311 /** 318 /**
...@@ -315,76 +322,148 @@ export function addClass(ele, cls) { ...@@ -315,76 +322,148 @@ export function addClass(ele, cls) {
315 */ 322 */
316 export function removeClass(ele, cls) { 323 export function removeClass(ele, cls) {
317 if (hasClass(ele, cls)) { 324 if (hasClass(ele, cls)) {
318 - const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') 325 + const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
319 - ele.className = ele.className.replace(reg, ' ') 326 + ele.className = ele.className.replace(reg, " ");
320 } 327 }
321 } 328 }
322 329
323 export function makeMap(str, expectsLowerCase) { 330 export function makeMap(str, expectsLowerCase) {
324 - const map = Object.create(null) 331 + const map = Object.create(null);
325 - const list = str.split(',') 332 + const list = str.split(",");
326 for (let i = 0; i < list.length; i++) { 333 for (let i = 0; i < list.length; i++) {
327 - map[list[i]] = true 334 + map[list[i]] = true;
328 } 335 }
329 - return expectsLowerCase 336 + return expectsLowerCase ? (val) => map[val.toLowerCase()] : (val) => map[val];
330 - ? val => map[val.toLowerCase()]
331 - : val => map[val]
332 } 337 }
333 338
334 -export const exportDefault = 'export default ' 339 +export const exportDefault = "export default ";
335 340
336 export const beautifierConf = { 341 export const beautifierConf = {
337 html: { 342 html: {
338 - indent_size: '2', 343 + indent_size: "2",
339 - indent_char: ' ', 344 + indent_char: " ",
340 - max_preserve_newlines: '-1', 345 + max_preserve_newlines: "-1",
341 preserve_newlines: false, 346 preserve_newlines: false,
342 keep_array_indentation: false, 347 keep_array_indentation: false,
343 break_chained_methods: false, 348 break_chained_methods: false,
344 - indent_scripts: 'separate', 349 + indent_scripts: "separate",
345 - brace_style: 'end-expand', 350 + brace_style: "end-expand",
346 space_before_conditional: true, 351 space_before_conditional: true,
347 unescape_strings: false, 352 unescape_strings: false,
348 jslint_happy: false, 353 jslint_happy: false,
349 end_with_newline: true, 354 end_with_newline: true,
350 - wrap_line_length: '110', 355 + wrap_line_length: "110",
351 indent_inner_html: true, 356 indent_inner_html: true,
352 comma_first: false, 357 comma_first: false,
353 e4x: true, 358 e4x: true,
354 - indent_empty_lines: true 359 + indent_empty_lines: true,
355 }, 360 },
356 js: { 361 js: {
357 - indent_size: '2', 362 + indent_size: "2",
358 - indent_char: ' ', 363 + indent_char: " ",
359 - max_preserve_newlines: '-1', 364 + max_preserve_newlines: "-1",
360 preserve_newlines: false, 365 preserve_newlines: false,
361 keep_array_indentation: false, 366 keep_array_indentation: false,
362 break_chained_methods: false, 367 break_chained_methods: false,
363 - indent_scripts: 'normal', 368 + indent_scripts: "normal",
364 - brace_style: 'end-expand', 369 + brace_style: "end-expand",
365 space_before_conditional: true, 370 space_before_conditional: true,
366 unescape_strings: false, 371 unescape_strings: false,
367 jslint_happy: true, 372 jslint_happy: true,
368 end_with_newline: true, 373 end_with_newline: true,
369 - wrap_line_length: '110', 374 + wrap_line_length: "110",
370 indent_inner_html: true, 375 indent_inner_html: true,
371 comma_first: false, 376 comma_first: false,
372 e4x: true, 377 e4x: true,
373 - indent_empty_lines: true 378 + indent_empty_lines: true,
374 - } 379 + },
375 -} 380 +};
376 381
377 // 首字母大小 382 // 首字母大小
378 export function titleCase(str) { 383 export function titleCase(str) {
379 - return str.replace(/( |^)[a-z]/g, L => L.toUpperCase()) 384 + return str.replace(/( |^)[a-z]/g, (L) => L.toUpperCase());
380 } 385 }
381 386
382 // 下划转驼峰 387 // 下划转驼峰
383 export function camelCase(str) { 388 export function camelCase(str) {
384 - return str.replace(/-[a-z]/g, str1 => str1.substr(-1).toUpperCase()) 389 + return str.replace(/-[a-z]/g, (str1) => str1.substr(-1).toUpperCase());
385 } 390 }
386 391
387 export function isNumberStr(str) { 392 export function isNumberStr(str) {
388 - return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) 393 + return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str);
394 +}
395 +
396 +// Array JsonValue 排序
397 +export function sortList(arr, key) {
398 + return arr.sort((a, b) => {
399 + return a[key].localeCompare(b[key]);
400 + });
389 } 401 }
390 402
403 +// 获取计算元素的属性的margin + padding + clientHeight
404 +function getPropertyValue(el) {
405 + let style, marginTop, marginBottom, paddingTop, paddingBottom;
406 + style = window.getComputedStyle(el, null);
407 + marginTop = style.getPropertyValue("margin-top");
408 + marginBottom = style.getPropertyValue("margin-bottom");
409 + paddingTop = style.getPropertyValue("padding-top");
410 + paddingBottom = style.getPropertyValue("padding-bottom");
411 + return (
412 + parseFloat(marginTop) +
413 + parseFloat(marginBottom) +
414 + parseFloat(paddingTop) +
415 + parseFloat(paddingBottom)
416 + );
417 +}
418 +
419 +// 获取页面内除了table其他模块所占的高
420 +export function restTableHeight($refs) {
421 + let heigth = 0;
422 + Object.keys($refs).map((key) => {
423 + if (key != "formHeaderRef") {
424 + if (key == "ylTable") {
425 + $refs[key].$children.map((item) => {
426 + if (item.$el.id == "group-btn") {
427 + // console.log("group-btn:", getPropertyValue(item.$el));
428 + // table表格组合按钮
429 + heigth += getPropertyValue(item.$el);
430 + heigth += item.$el.clientHeight;
431 + } else if (item.$el.className == "el-pagination is-background") {
432 + // table表格组合分页
433 + if (item.$el.offsetParent.className == "pagination-container") {
434 + // console.log(
435 + // "pagination:",
436 + // getPropertyValue(item.$el.offsetParent)
437 + // );
438 + // console.log(
439 + // "paginationClientHeight:",
440 + // getPropertyValue(item.$el.offsetParent.clientHeight)
441 + // );
442 + heigth += getPropertyValue(item.$el.offsetParent);
443 + heigth += item.$el.offsetParent.clientHeight;
444 + }
445 + }
446 + });
447 + } else {
448 + if ($refs[key].hasOwnProperty("$el")) {
449 + heigth += $refs[key].$el.clientHeight;
450 + heigth += getPropertyValue($refs[key].$el);
451 + // console.log(
452 + // "ruleForm:",
453 + // $refs[key].$el.clientHeight,
454 + // getPropertyValue($refs[key].$el)
455 + // );
456 + } else {
457 + // console.log("ruleForm:", $refs[key]);
458 + heigth += $refs[key].$el.clientHeight;
459 + heigth += getPropertyValue($refs[key]);
460 + }
461 + }
462 + } else if (key == "formHeaderRef") {
463 + // console.log("formHeaderRef:", getPropertyValue($refs[key]));
464 + heigth += getPropertyValue($refs[key]);
465 + }
466 + });
467 + // console.log("heigth:", heigth);
468 + return heigth;
469 +}
......
1 export const inputBlurValidate = { 1 export const inputBlurValidate = {
2 - data(){ 2 + data() {
3 return { 3 return {
4 queryForm: { 4 queryForm: {
5 minWeight: "", 5 minWeight: "",
...@@ -7,6 +7,7 @@ export const inputBlurValidate = { ...@@ -7,6 +7,7 @@ export const inputBlurValidate = {
7 minNumOfPieces: "", 7 minNumOfPieces: "",
8 maxNumOfPieces: "", 8 maxNumOfPieces: "",
9 }, 9 },
10 + validateForm: true,
10 }; 11 };
11 }, 12 },
12 methods: { 13 methods: {
...@@ -36,49 +37,76 @@ export const inputBlurValidate = { ...@@ -36,49 +37,76 @@ export const inputBlurValidate = {
36 }, 37 },
37 // 校验件数方法 【件数可以为空但件数不得为0】只能输入正整数 38 // 校验件数方法 【件数可以为空但件数不得为0】只能输入正整数
38 validateNumOfPieces(value, pieces) { 39 validateNumOfPieces(value, pieces) {
39 - if (value.length) { 40 + if (value.toString().length) {
41 + // 获取当前输入框有值的情况下
40 this.queryForm[pieces] = Number(value); 42 this.queryForm[pieces] = Number(value);
41 let markPieces = false; 43 let markPieces = false;
42 if (pieces == "minNumOfPieces" || pieces == "maxNumOfPieces") { 44 if (pieces == "minNumOfPieces" || pieces == "maxNumOfPieces") {
43 - if (this.queryForm.minNumOfPieces && this.queryForm.maxNumOfPieces) { 45 + // 最大件数和最小件数都不为空的情况下
44 - markPieces = Number(this.queryForm.maxNumOfPieces) < Number(this.queryForm.minNumOfPieces); 46 + if (
47 + this.queryForm.minNumOfPieces.toString() != "" &&
48 + this.queryForm.maxNumOfPieces.toString() != ""
49 + ) {
50 + this.validateForm = true;
51 + this.$refs.minNumOfPieces.innerHTML = "";
52 + markPieces = true;
53 + } else {
54 + markPieces = false;
45 } 55 }
46 } 56 }
47 if (/^\d+$/.test(this.queryForm[pieces])) { 57 if (/^\d+$/.test(this.queryForm[pieces])) {
48 if (markPieces) { 58 if (markPieces) {
59 + //当最大件数和最小件数都不为空的情况下,最大件数小于最小件数的时候
49 if (this.queryForm.maxNumOfPieces < this.queryForm.minNumOfPieces) { 60 if (this.queryForm.maxNumOfPieces < this.queryForm.minNumOfPieces) {
50 if (Array.isArray(this.$refs.minNumOfPieces)) { 61 if (Array.isArray(this.$refs.minNumOfPieces)) {
51 this.msgError("最小件数不得大于最大件数"); 62 this.msgError("最小件数不得大于最大件数");
63 + this.validateForm = false;
52 } else { 64 } else {
53 this.$refs.minNumOfPieces.innerHTML = ""; 65 this.$refs.minNumOfPieces.innerHTML = "";
54 - this.$refs.minNumOfPieces.innerHTML = "最小件数不得大于最大件数"; 66 + this.$refs.minNumOfPieces.innerHTML =
67 + "最小件数不得大于最大件数";
68 + this.validateForm = false;
55 } 69 }
56 - } else if ( 70 + }
57 - this.queryForm.minNumOfPieces < 1 || this.queryForm.maxNumOfPieces < 1 71 + //当最大件数和最小件数都不为空的情况下,最大件数和最小件数小于1的时候
72 + else if (
73 + this.queryForm.minNumOfPieces < 1 ||
74 + this.queryForm.maxNumOfPieces < 1
58 ) { 75 ) {
59 if (Array.isArray(this.$refs.minNumOfPieces)) { 76 if (Array.isArray(this.$refs.minNumOfPieces)) {
60 this.msgError("最小件数和最大件数不能小于1"); 77 this.msgError("最小件数和最大件数不能小于1");
78 + this.validateForm = false;
61 } else { 79 } else {
62 this.$refs.minNumOfPieces.innerHTML = ""; 80 this.$refs.minNumOfPieces.innerHTML = "";
63 - this.$refs.minNumOfPieces.innerHTML = "最小件数和最大件数不能小于1"; 81 + this.$refs.minNumOfPieces.innerHTML =
82 + "最小件数和最大件数不能小于1";
83 + this.validateForm = false;
64 } 84 }
65 - } else {
66 - if (!Array.isArray(this.$refs.minNumOfPieces)) {
67 - this.$refs.minNumOfPieces.innerHTML = "";
68 } 85 }
86 + //当最大件数和最小件数都不为空的情况下,最大件数和最小件数满足大于1左区间小于等于右区间的时候
87 + else {
88 + this.$refs.minNumOfPieces.innerHTML = "";
89 + this.validateForm = true;
69 } 90 }
70 } else { 91 } else {
92 + // 当左右区间其中一个有值的情况下
71 if (value.length) { 93 if (value.length) {
72 if (Number(value) < 1) { 94 if (Number(value) < 1) {
73 if (Array.isArray(this.$refs.minNumOfPieces)) { 95 if (Array.isArray(this.$refs.minNumOfPieces)) {
74 this.msgError("件数不得小于1"); 96 this.msgError("件数不得小于1");
97 + this.$refs.minNumOfPieces.innerHTML = "";
98 + this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
99 + this.validateForm = false;
75 } else { 100 } else {
101 + this.msgError("件数不得小于1");
76 this.$refs.minNumOfPieces.innerHTML = ""; 102 this.$refs.minNumOfPieces.innerHTML = "";
77 this.$refs.minNumOfPieces.innerHTML = "件数不得小于1"; 103 this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
104 + this.validateForm = false;
78 } 105 }
79 } else { 106 } else {
80 if (!Array.isArray(this.$refs.minNumOfPieces)) { 107 if (!Array.isArray(this.$refs.minNumOfPieces)) {
81 this.$refs.minNumOfPieces.innerHTML = ""; 108 this.$refs.minNumOfPieces.innerHTML = "";
109 + this.validateForm = true;
82 } 110 }
83 } 111 }
84 } 112 }
...@@ -90,9 +118,38 @@ export const inputBlurValidate = { ...@@ -90,9 +118,38 @@ export const inputBlurValidate = {
90 this.$refs.minNumOfPieces.innerHTML = ""; 118 this.$refs.minNumOfPieces.innerHTML = "";
91 this.$refs.minNumOfPieces.innerHTML = "请输入有效件数"; 119 this.$refs.minNumOfPieces.innerHTML = "请输入有效件数";
92 } 120 }
93 - return false; 121 + this.validateForm = false;
122 + }
123 + } else {
124 + // 【左右区间不是都有值的情况下】
125 + // 最小件数为空最大件数有值的情况下
126 + if (pieces == "minNumOfPieces" && this.queryForm.maxNumOfPieces > 0) {
127 + this.$refs.minNumOfPieces.innerHTML = "";
128 + this.validateForm = true;
129 + } else {
130 + this.$refs.minNumOfPieces.innerHTML = "";
131 + this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
132 + this.validateForm = false;
133 + }
134 + // 最大件数为空最小件数有值的情况下
135 + if (pieces == "maxNumOfPieces" && this.queryForm.minNumOfPieces > 0) {
136 + this.$refs.minNumOfPieces.innerHTML = "";
137 + this.validateForm = true;
138 + } else {
139 + this.$refs.minNumOfPieces.innerHTML = "";
140 + this.$refs.minNumOfPieces.innerHTML = "件数不得小于1";
141 + this.validateForm = false;
142 + }
143 + // 左右区间 都为空的情况下
144 + if (
145 + this.queryForm.minNumOfPieces.toString().length == 0 &&
146 + this.queryForm.maxNumOfPieces.toString().length == 0
147 + ) {
148 + this.$refs.minNumOfPieces.innerHTML = "";
149 + this.validateForm = true;
94 } 150 }
95 } 151 }
152 + return this.validateForm;
96 }, 153 },
97 // 校验重量方法 【重量可以为空为0 && 最小/大重量的范围0~34KG】允许保留1~5位小数。 154 // 校验重量方法 【重量可以为空为0 && 最小/大重量的范围0~34KG】允许保留1~5位小数。
98 validateWeight(value, weight) { 155 validateWeight(value, weight) {
...@@ -101,27 +158,34 @@ export const inputBlurValidate = { ...@@ -101,27 +158,34 @@ export const inputBlurValidate = {
101 let markWeight = false; 158 let markWeight = false;
102 if (weight == "minWeight" || weight == "maxWeight") { 159 if (weight == "minWeight" || weight == "maxWeight") {
103 if (this.queryForm.minWeight && this.queryForm.maxWeight) { 160 if (this.queryForm.minWeight && this.queryForm.maxWeight) {
104 - markWeight = Number(this.queryForm.maxWeight) < Number(this.queryForm.minWeight); 161 + markWeight =
162 + Number(this.queryForm.maxWeight) <
163 + Number(this.queryForm.minWeight);
105 } 164 }
106 } 165 }
107 if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(this.queryForm[weight])) { 166 if (/^(0|[1-9]\d*)(.\d{1,5})?$/.test(this.queryForm[weight])) {
108 if (this.queryForm[weight] >= 0) { 167 if (this.queryForm[weight] >= 0) {
109 if (markWeight) { 168 if (markWeight) {
110 if (Array.isArray(this.$refs.minWeight)) { 169 if (Array.isArray(this.$refs.minWeight)) {
170 + this.validateForm = false;
111 this.msgError("最小重量不得大于最大重量"); 171 this.msgError("最小重量不得大于最大重量");
112 } else { 172 } else {
173 + this.validateForm = false;
113 this.$refs.minWeight.innerHTML = ""; 174 this.$refs.minWeight.innerHTML = "";
114 this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量"; 175 this.$refs.minWeight.innerHTML = "最小重量不得大于最大重量";
115 } 176 }
116 } else if (this.queryForm[weight] > 34) { 177 } else if (this.queryForm[weight] > 34) {
178 + this.validateForm = false;
117 if (Array.isArray(this.$refs.minWeight)) { 179 if (Array.isArray(this.$refs.minWeight)) {
118 this.msgError("最大重量不能大于34KG"); 180 this.msgError("最大重量不能大于34KG");
119 } else { 181 } else {
182 + this.validateForm = false;
120 this.$refs.minWeight.innerHTML = ""; 183 this.$refs.minWeight.innerHTML = "";
121 this.$refs.minWeight.innerHTML = "最大重量不能大于34KG"; 184 this.$refs.minWeight.innerHTML = "最大重量不能大于34KG";
122 } 185 }
123 } else { 186 } else {
124 if (!Array.isArray(this.$refs.minWeight)) { 187 if (!Array.isArray(this.$refs.minWeight)) {
188 + this.validateForm = true;
125 this.$refs.minWeight.innerHTML = ""; 189 this.$refs.minWeight.innerHTML = "";
126 } 190 }
127 } 191 }
...@@ -129,13 +193,16 @@ export const inputBlurValidate = { ...@@ -129,13 +193,16 @@ export const inputBlurValidate = {
129 if (value.length) { 193 if (value.length) {
130 if (Number(value) > 34) { 194 if (Number(value) > 34) {
131 if (Array.isArray(this.$refs.minWeight)) { 195 if (Array.isArray(this.$refs.minWeight)) {
196 + this.validateForm = false;
132 this.msgError("最大重量不能大于34KG"); 197 this.msgError("最大重量不能大于34KG");
133 } else { 198 } else {
199 + this.validateForm = false;
134 this.$refs.minWeight.innerHTML = ""; 200 this.$refs.minWeight.innerHTML = "";
135 this.$refs.minWeight.innerHTML = "最大重量不能大于34KG"; 201 this.$refs.minWeight.innerHTML = "最大重量不能大于34KG";
136 } 202 }
137 } else { 203 } else {
138 if (!Array.isArray(this.$refs.minWeight)) { 204 if (!Array.isArray(this.$refs.minWeight)) {
205 + this.validateForm = true;
139 this.$refs.minWeight.innerHTML = ""; 206 this.$refs.minWeight.innerHTML = "";
140 } 207 }
141 } 208 }
...@@ -143,19 +210,21 @@ export const inputBlurValidate = { ...@@ -143,19 +210,21 @@ export const inputBlurValidate = {
143 } 210 }
144 } else { 211 } else {
145 if (Array.isArray(this.$refs.minWeight)) { 212 if (Array.isArray(this.$refs.minWeight)) {
213 + this.validateForm = false;
146 this.msgError("请输入正整数,小数保留5位"); 214 this.msgError("请输入正整数,小数保留5位");
147 } else { 215 } else {
216 + this.validateForm = false;
148 this.$refs.minWeight.innerHTML = ""; 217 this.$refs.minWeight.innerHTML = "";
149 this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位"; 218 this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位";
150 } 219 }
151 - return false;
152 } 220 }
153 } 221 }
222 + return this.validateForm;
154 }, 223 },
155 // 报价值【申报价值可以为空为0】 224 // 报价值【申报价值可以为空为0】
156 validateCustomVal(value, customVal) { 225 validateCustomVal(value, customVal) {
157 if (value.length) { 226 if (value.length) {
158 - this.queryForm[customVal] = Number(value); 227 + this[customVal] = Number(value);
159 let coin = { 228 let coin = {
160 minCNYCustomVal: "minCNYCustomVal", 229 minCNYCustomVal: "minCNYCustomVal",
161 maxCNYCustomVal: "minCNYCustomVal", 230 maxCNYCustomVal: "minCNYCustomVal",
...@@ -170,41 +239,56 @@ export const inputBlurValidate = { ...@@ -170,41 +239,56 @@ export const inputBlurValidate = {
170 }; 239 };
171 let markCoin = false; 240 let markCoin = false;
172 if (customVal == "minCNYCustomVal" || customVal == "maxCNYCustomVal") { 241 if (customVal == "minCNYCustomVal" || customVal == "maxCNYCustomVal") {
173 - if (this.queryForm.minCNYCustomVal && this.queryForm.maxCNYCustomVal) { 242 + if (this.minCNYCustomVal && this.maxCNYCustomVal) {
174 - markCoin = Number(this.queryForm.maxCNYCustomVal) < Number(this.queryForm.minCNYCustomVal); 243 + this.validateForm = false;
244 + markCoin =
245 + Number(this.maxCNYCustomVal) < Number(this.minCNYCustomVal);
175 } 246 }
176 } else { 247 } else {
177 - if (this.queryForm.minSUDCustomVal && this.queryForm.maxSUDCustomVal) { 248 + if (this.minSUDCustomVal && this.maxSUDCustomVal) {
178 - markCoin = Number(this.queryForm.maxSUDCustomVal) < Number(this.queryForm.minSUDCustomVal); 249 + this.validateForm = false;
250 + markCoin =
251 + Number(this.maxSUDCustomVal) < Number(this.minSUDCustomVal);
179 } 252 }
180 } 253 }
181 - if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(this.queryForm[customVal])) { 254 + if (/^(0|[1-9]\d*)(.\d{1,2})?$/.test(this[customVal])) {
182 - if (this.queryForm[customVal] >= 0) { 255 + if (this[customVal] >= 0) {
183 if (markCoin) { 256 if (markCoin) {
257 + this.validateForm = false;
184 this.$refs[coin[customVal]].innerHTML = ""; 258 this.$refs[coin[customVal]].innerHTML = "";
185 - this.$refs[coin[customVal]].innerHTML = "最小申报价值不得大于最大申报价值"; 259 + this.$refs[coin[customVal]].innerHTML =
186 - } else if (this.queryForm[customVal] > currency[customVal]) { 260 + "最小申报价值不得大于最大申报价值";
261 + } else if (this[customVal] > currency[customVal]) {
262 + this.validateForm = false;
187 this.$refs[coin[customVal]].innerHTML = ""; 263 this.$refs[coin[customVal]].innerHTML = "";
188 - this.$refs[coin[customVal]].innerHTML = `最大申报值不得大于${currency[customVal]}`; 264 + this.$refs[
265 + coin[customVal]
266 + ].innerHTML = `最大申报值不得大于${currency[customVal]}`;
189 } else { 267 } else {
268 + this.validateForm = true;
190 this.$refs[coin[customVal]].innerHTML = ""; 269 this.$refs[coin[customVal]].innerHTML = "";
191 } 270 }
192 } else { 271 } else {
193 if (value.length) { 272 if (value.length) {
194 if (Number(value) > currency[customVal]) { 273 if (Number(value) > currency[customVal]) {
274 + this.validateForm = false;
195 this.$refs[coin[customVal]].innerHTML = ""; 275 this.$refs[coin[customVal]].innerHTML = "";
196 - this.$refs[coin[customVal]].innerHTML = `最大申报值不得大于${currency[customVal]}`; 276 + this.$refs[
277 + coin[customVal]
278 + ].innerHTML = `最大申报值不得大于${currency[customVal]}`;
197 } else { 279 } else {
280 + this.validateForm = true;
198 this.$refs[coin[customVal]].innerHTML = ""; 281 this.$refs[coin[customVal]].innerHTML = "";
199 } 282 }
200 } 283 }
201 } 284 }
202 } else { 285 } else {
286 + this.validateForm = false;
203 this.$refs[coin[customVal]].innerHTML = ""; 287 this.$refs[coin[customVal]].innerHTML = "";
204 this.$refs[coin[customVal]].innerHTML = "请输入正确申报价值"; 288 this.$refs[coin[customVal]].innerHTML = "请输入正确申报价值";
205 - return false;
206 } 289 }
207 } 290 }
291 + return this.validateForm;
208 }, 292 },
209 }, 293 },
210 }; 294 };
......
...@@ -81,7 +81,7 @@ service.interceptors.response.use(res => { ...@@ -81,7 +81,7 @@ service.interceptors.response.use(res => {
81 type: 'error' 81 type: 'error'
82 }) 82 })
83 return Promise.reject(new Error(msg)) 83 return Promise.reject(new Error(msg))
84 - } else if (code !== 200 && code !== 201 && code !== 202 && code !== 203 && code !== 603) { 84 + } else if (code !== 200 && code !== 201 && code !== 202 && code != 203 && code != 603 && code != 402) {
85 Message({ 85 Message({
86 message: msg, 86 message: msg,
87 type: 'error' 87 type: 'error'
......
1 -<template>
2 - <div class=''></div>
3 - </template>
4 -
5 - <script>
6 -
7 - export default {
8 - name: '',
9 - components: {},
10 - data() {
11 -
12 - return {
13 -
14 - }
15 - },
16 -
17 - computed: {},
18 - created () {},
19 - mounted () {},
20 - methods: {}
21 - }
22 - </script>
23 - <style lang='scss' scoped>
24 -
25 - </style>
1 -<template>
2 - <div class=''></div>
3 - </template>
4 -
5 - <script>
6 -
7 - export default {
8 - name: '',
9 - components: {},
10 - data() {
11 -
12 - return {
13 -
14 - }
15 - },
16 -
17 - computed: {},
18 - created () {},
19 - mounted () {},
20 - methods: {}
21 - }
22 - </script>
23 - <style lang='scss' scoped>
24 -
25 - </style>
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 - <yl-table
12 - emptyText="请添加配舱航班"
13 - :attrs="tableAttr"
14 - :loadingTable="tableAttr.loadingTable"
15 - :tableData="tableData"
16 - :pageConfig="{
17 - isPagination: false,
18 - }"
19 - @add="addBtn"
20 - >
21 - <template #column>
22 - <el-table-column
23 - type="index"
24 - label="序号"
25 - width="50"
26 - align="center"
27 - ></el-table-column>
28 - <el-table-column
29 - label="航班号"
30 - prop="fltNo"
31 - min-width="100"
32 - align="center"
33 - >
34 - <template slot-scope="scope">
35 - <el-input
36 - v-model="scope.row.fltNo"
37 - clearable
38 - :readonly="scope.row.edit | isEdit"
39 - @focus="inputFocus(scope)"
40 - @input="inputEvent"
41 - placeholder="请输入航班号"
42 - size="small"
43 - />
44 - </template>
45 - </el-table-column>
46 - <el-table-column
47 - label="加减天数"
48 - prop="fltNoDate"
49 - width="100"
50 - align="center"
51 - >
52 - <template slot-scope="scope">
53 - <el-input
54 - type="number"
55 - v-model="scope.row.fltNoDate"
56 - :readonly="scope.row.edit | isEdit"
57 - :disabled="scope.row.edit | isEdit"
58 - min="-7"
59 - max="7"
60 - v-input-filter
61 - clearable
62 - placeholder=""
63 - size="small"
64 - />
65 - </template>
66 - </el-table-column>
67 - <el-table-column
68 - label="航线"
69 - prop="fltRoute"
70 - min-width="100"
71 - align="center"
72 - >
73 - <template slot-scope="scope">
74 - <el-select
75 - v-model="scope.row.fltRoute"
76 - placeholder="请选择"
77 - size="small"
78 - >
79 - <el-option
80 - v-for="item in scope.row.routeList"
81 - :key="item.id"
82 - :label="item.route"
83 - :value="item.route"
84 - >
85 - </el-option>
86 - </el-select>
87 - </template>
88 - </el-table-column>
89 - <el-table-column
90 - label="爆仓是否继续配舱"
91 - prop="isOn"
92 - min-width="100"
93 - align="center"
94 - >
95 - <template slot-scope="scope">
96 - <el-checkbox
97 - v-model="scope.row.isOn"
98 - :disabled="scope.row.edit | isEdit"
99 - @change="changeCheck(scope)"
100 - ></el-checkbox>
101 - </template>
102 - </el-table-column>
103 - <el-table-column label="操作" min-width="100" align="center">
104 - <template slot-scope="scope">
105 - <el-button
106 - size="mini"
107 - type="danger"
108 - :disabled="scope.row.edit"
109 - @click="deleBtn(scope.row, scope.$index)"
110 - >删除</el-button
111 - >
112 - </template>
113 - </el-table-column>
114 - </template>
115 - </yl-table>
116 - </el-col>
117 - </el-row>
118 - <!-- 航线维度设置 -->
119 - <el-row style="padding: 20px 0">
120 - <el-col>
121 - <el-divider content-position="left">航线维度设置</el-divider>
122 - </el-col>
123 - </el-row>
124 - <el-card shadow="always" class="box-card">
125 - <el-form
126 - :model="queryForm"
127 - label-position="right"
128 - label-width="120px"
129 - ref="ruleForm"
130 - class="config-form"
131 - >
132 - <el-row class="rowPadding">
133 - <el-col :span="12">
134 - <el-form-item label="原航班号">
135 - <el-input
136 - type="textarea"
137 - v-model="queryForm.fltNo"
138 - size="medium"
139 - maxlength="1000"
140 - show-word-limit
141 - :rows="4"
142 - placeholder="请输入原航班号"
143 - ></el-input>
144 - </el-form-item>
145 - </el-col>
146 - <el-col :span="24">
147 - <el-form-item label="服务种类">
148 - <el-col :span="4">
149 - <el-radio-group
150 - v-model="queryForm.isServiceCode"
151 - @change="isServiceCode"
152 - >
153 - <el-radio label="1">包含ServiceCode</el-radio>
154 - <el-radio label="2">不包含ServiceCode</el-radio>
155 - </el-radio-group>
156 - </el-col>
157 - <el-col :span="10" :offset="1">
158 - <el-input
159 - type="textarea"
160 - v-model="queryForm.serviceCode"
161 - size="medium"
162 - maxlength="1000"
163 - show-word-limit
164 - :rows="4"
165 - placeholder="请输入ServiceCode"
166 - @blur="serviceCodeBlur"
167 - ></el-input>
168 - </el-col>
169 - </el-form-item>
170 - </el-col>
171 -
172 - <el-col :span="24">
173 - <el-col :span="12">
174 - <el-form-item label="URSA包含">
175 - <el-input
176 - type="textarea"
177 - v-model="queryForm.includeUrsa"
178 - size="medium"
179 - maxlength="1000"
180 - show-word-limit
181 - :rows="4"
182 - placeholder="URSA之间用分号分隔,例:F2;F3;P_"
183 - ></el-input>
184 - </el-form-item>
185 - </el-col>
186 - <el-col :span="12">
187 - <el-form-item label="URSA不包含">
188 - <el-input
189 - type="textarea"
190 - v-model="queryForm.notIncludeUrsa"
191 - size="medium"
192 - maxlength="1000"
193 - show-word-limit
194 - :rows="4"
195 - placeholder="URSA之间用分号分隔,例:F2;F3;P_"
196 - ></el-input>
197 - </el-form-item>
198 - </el-col>
199 - </el-col>
200 -
201 - <el-col :span="24">
202 - <el-form-item label="申报类别">
203 - <el-card shadow="never">
204 - <el-checkbox-group
205 - v-model="checkboxClsssType"
206 - @change="checkboxCargoType"
207 - style="display: flex"
208 - v-if="queryForm.cargoType.length"
209 - >
210 - <el-checkbox
211 - v-for="item in queryForm.cargoType"
212 - :label="item.chineseName"
213 - :name="item.chineseName"
214 - :key="item.code"
215 - >
216 - <Tooltips :content="item.chineseName" :refName="item.code">
217 - </Tooltips>
218 - </el-checkbox>
219 - </el-checkbox-group>
220 - </el-card>
221 - </el-form-item>
222 - </el-col>
223 -
224 - <el-col :span="24">
225 - <el-col :span="3">
226 - <el-form-item label="单品名">
227 - <el-checkbox v-model="queryForm.singleName"></el-checkbox>
228 - </el-form-item>
229 - </el-col>
230 - <el-col :span="8">
231 - <el-form-item label="" class="custom-label">
232 - <span class="custom-label-title">重量(KG)</span>
233 - <el-col :span="10">
234 - <el-input
235 - v-model.trim="queryForm.minWeight"
236 - clearable
237 - placeholder="最小重量"
238 - @blur="inputBlurMinWeight($event)"
239 - ></el-input>
240 - <span ref="minWeight" class="el-form-item__error"></span>
241 - </el-col>
242 - <el-col style="text-align: center" :span="1">-</el-col>
243 - <el-col :span="10">
244 - <el-input
245 - v-model.trim="queryForm.maxWeight"
246 - clearable
247 - placeholder="最大重量"
248 - @blur="inputBlurMaxWeight($event)"
249 - ></el-input>
250 - </el-col>
251 - </el-form-item>
252 - </el-col>
253 -
254 - <el-col :span="8">
255 - <el-form-item label="件数" class="custom-label-pieces">
256 - <el-col :span="10">
257 - <el-input
258 - v-model.trim="queryForm.minNumOfPieces"
259 - clearable
260 - placeholder="最少件数"
261 - @blur="inputBlurMinPieces($event)"
262 - ></el-input>
263 - <span ref="minNumOfPieces" class="el-form-item__error"></span>
264 - </el-col>
265 - <el-col style="text-align: center" :span="1">-</el-col>
266 - <el-col :span="10">
267 - <el-input
268 - v-model.trim="queryForm.maxNumOfPieces"
269 - clearable
270 - placeholder="最多件数"
271 - @blur="inputBlurMaxPieces($event)"
272 - ></el-input>
273 - </el-col>
274 - </el-form-item>
275 - </el-col>
276 - </el-col>
277 -
278 - <el-col :span="24">
279 - <el-col :span="3">
280 - <el-form-item label="申报价值"></el-form-item>
281 - </el-col>
282 - <el-col :span="8">
283 - <el-form-item label="" class="custom-label">
284 - <span class="custom-label-title">人民币</span>
285 - <el-col :span="10">
286 - <el-input
287 - v-model.trim="queryForm.minCNYCustomVal"
288 - clearable
289 - placeholder="最小申报价值"
290 - @blur="inputBlurMin($event, 'minCNYCustomVal')"
291 - ></el-input>
292 - <span
293 - ref="minCNYCustomVal"
294 - class="el-form-item__error"
295 - ></span>
296 - </el-col>
297 - <el-col style="text-align: center" :span="1">-</el-col>
298 - <el-col :span="10">
299 - <el-input
300 - v-model.trim="queryForm.maxCNYCustomVal"
301 - clearable
302 - placeholder="最大申报价值"
303 - @blur="inputBlurMax($event, 'maxCNYCustomVal')"
304 - ></el-input>
305 - </el-col>
306 - </el-form-item>
307 - </el-col>
308 - <el-col :span="8">
309 - <el-form-item label="美元" class="custom-label-pieces">
310 - <el-col :span="10">
311 - <el-input
312 - v-model.trim="queryForm.minSUDCustomVal"
313 - clearable
314 - placeholder="最小申报价值"
315 - @blur="inputBlurMin($event, 'minSUDCustomVal')"
316 - ></el-input>
317 - <span
318 - ref="minSUDCustomVal"
319 - class="el-form-item__error"
320 - ></span>
321 - </el-col>
322 - <el-col style="text-align: center" :span="1">-</el-col>
323 - <el-col :span="10">
324 - <el-input
325 - v-model.trim="queryForm.maxSUDCustomVal"
326 - clearable
327 - placeholder="最大申报价值"
328 - @blur="inputBlurMax($event, 'maxSUDCustomVal')"
329 - ></el-input>
330 - </el-col>
331 - </el-form-item>
332 - </el-col>
333 - </el-col>
334 - <el-col :span="24">
335 - <el-form-item label="">
336 - <el-button type="primary" @click="submitForm('ruleForm')"
337 - >保存</el-button
338 - >
339 - </el-form-item>
340 - </el-col>
341 - </el-row>
342 - </el-form>
343 - </el-card>
344 - </div>
345 -</template>
346 -
347 -<script>
348 -import YlForm from "@/components/YlForm";
349 -import YlTable from "@/components/YlTable";
350 -import { formConfig } from "./formConfig";
351 -import { debounce } from "@/utils";
352 -import { inputBlurValidate } from "@/utils/mixins";
353 -import { tableAttr } from "./tableConfig";
354 -import {
355 - allDictData, // 获取全部字典
356 - queryRouteByFltNo, // 航线查询
357 - findDestinationFltRuleByFlightNo, // 获取航班下航线维度
358 -} from "@/api/destinationFlight";
359 -import indexMixins from "./mixins";
360 -export default {
361 - name: "edit",
362 - components: {
363 - YlForm,
364 - YlTable,
365 - },
366 - mixins: [indexMixins, inputBlurValidate],
367 - data() {
368 - return {
369 - formConfig: formConfig, // 表单配置项
370 - queryForm: {
371 - // 表单参数
372 - fltNo: "", // 原航班号
373 - isServiceCode: "1", // 服务种类
374 - serviceCode: "",
375 - includeUrsa: "", // URSA包含
376 - notIncludeUrsa: "", // URSA不包含
377 - cargoType: [], // 申报类别调用接口获取所有的申报类别
378 - checkboxCargoType: [], // 已勾选申报类别的数据
379 - singleName: false, // 单品名
380 - minWeight: "",
381 - maxWeight: "",
382 - minNumOfPieces: "",
383 - maxNumOfPieces: "",
384 - minCNYCustomVal: "", //
385 - maxCNYCustomVal: "", //
386 - minSUDCustomVal: "", //
387 - maxSUDCustomVal: "", //
388 - },
389 - tableAttr: tableAttr, // table配置项
390 - tableData: [],
391 - currentIndex: 0, // 记录当前table 列的索引位置
392 - id: 0,
393 - checkboxClsssType: [], // 申报类别
394 - serviceCodeData: [], // 【服务种类】调用接口获取服务种类所有的serviceCode
395 - };
396 - },
397 - computed: {},
398 - created() {
399 - this.tableData = [
400 - {
401 - id: this.id++,
402 - fltNo: "",
403 - fltNoDate: "",
404 - fltRoute: "",
405 - routeList: [],
406 - isOn: "0" ? false : true,
407 - sort: "0", // 排序字段
408 - },
409 - ];
410 - this.getAllDictData();
411 - this.getEdit();
412 - this.PostFindDestinationFltRuleByFlightNo();
413 - },
414 - mounted() {},
415 - directives: {
416 - // 处理加减天数
417 - "input-filter": {
418 - bind: function (el, binding) {
419 - el.handler = function (event) {
420 - if (event.data == "E" || event.data == "e") {
421 - // 无理数时
422 - event.target.value = "";
423 - }
424 - if (event.target.value) {
425 - if (Number(event.target.value) < -7) {
426 - event.target.value = "";
427 - } else if (Number(event.target.value) > 7) {
428 - event.target.value = "";
429 - } else if (/[\.]/.test(Number(event.target.value))) {
430 - // 浮点数时
431 - event.target.value = "";
432 - } else {
433 - }
434 - event.target.dispatchEvent(new Event("input"));
435 - }
436 - };
437 - el.addEventListener("input", el.handler);
438 - },
439 - unbind: function (el) {
440 - el.removeEventListener("input", el.handler);
441 - },
442 - },
443 - },
444 - filters: {
445 - isEdit: function (value) {
446 - switch (value) {
447 - case "新增":
448 - false;
449 - break;
450 - case "编辑":
451 - true;
452 - break;
453 - default:
454 - "新增";
455 - }
456 - },
457 - // 航线个数
458 - fltRoute(val) {
459 - if (val.length && val.split(",").length > 2) {
460 - return false;
461 - } else {
462 - return true;
463 - }
464 - },
465 - },
466 - methods: {
467 - // 获取编辑详情数据
468 - getEdit() {},
469 - // 获取所有数据字典
470 - getAllDictData() {
471 - allDictData().then((res) => {
472 - if (res.code != 200) {
473 - this.msgError(res.msg);
474 - return;
475 - }
476 - this.queryForm.cargoType = res.data.cargoType; // 申报类别
477 - if (res.data.serviceCode.length) {
478 - this.getObj(res.data);
479 - }
480 - });
481 - },
482 - // 航线查询
483 - getQueryRouteByFltNo(item) {
484 - this.tableAttr.loadingTable = true;
485 - queryRouteByFltNo(item).then((res) => {
486 - this.tableAttr.loadingTable = false;
487 - if (res.code == 200) {
488 - const list = res.data.list;
489 - let routeList = [];
490 - if (list.length) {
491 - list.map((item) => {
492 - routeList.push(item);
493 - });
494 - let isEtesRoute = list.filter((item) => item.isEtesRoute == "Y"); // 过滤普通航线
495 - if (isEtesRoute.length == 0) {
496 - this.msgError("该航班下的航线均为普通航线");
497 - }
498 - this.tableData[this.currentIndex].fltRoute = "";
499 - this.tableData[this.currentIndex].routeList = isEtesRoute;
500 - } else {
501 - this.msgError("暂无航线");
502 - this.tableData[this.currentIndex].routeList = [];
503 - this.tableData[this.currentIndex].fltRoute = "";
504 - }
505 - }
506 - });
507 - },
508 - // 获取航班下航线维度
509 - PostFindDestinationFltRuleByFlightNo() {
510 - let params = {};
511 - findDestinationFltRuleByFlightNo(params).then((res) => {
512 - console.log(res);
513 - });
514 - },
515 - // 航班号input 聚焦事件
516 - inputFocus({ $index }) {
517 - this.currentIndex = $index;
518 - },
519 - // 航班号input搜索事件
520 - inputEvent: debounce(function () {
521 - let params = {
522 - fltNo: this.tableData[this.currentIndex].fltNo,
523 - };
524 - if (params.fltNo) {
525 - this.getQueryRouteByFltNo(params);
526 - } else {
527 - this.tableData[this.currentIndex].fltRoute = "";
528 - this.tableData[this.currentIndex].routeList = [];
529 - this.msgError("请输入航班号");
530 - }
531 - }, 1000),
532 - // 添加ET86配舱航班顺位
533 - addBtn(item) {
534 - this.tableData.unshift({
535 - id: this.id++,
536 - fltNo: "",
537 - fltNoDate: "",
538 - fltRoute: "",
539 - routeList: [],
540 - isOn: "0" ? false : true,
541 - sort: "0", // 排序字段
542 - });
543 - },
544 - // 是否爆仓
545 - changeCheck({ $index, row }) {
546 - this.tableData.map((item, i) => {
547 - if ($index !== i) {
548 - item.isOn = false;
549 - }
550 - });
551 - },
552 - // 删除
553 - deleBtn(item, $index) {
554 - this.tableData.splice($index, 1);
555 - },
556 - // 类别
557 - checkboxCargoType(arr) {
558 - let include = this.queryForm.cargoType.filter((item) =>
559 - arr.some((val) => val == item.chineseName)
560 - );
561 - this.queryForm.checkboxCargoType = include; //已勾选申报类别的数据
562 - // console.log(arr, include);
563 - },
564 - // 表单提交
565 - submitForm(formName) {
566 - this.$refs[formName].validate((valid) => {
567 - if (valid) {
568 - let parmas = {
569 - fltInfoList: this.tableData,
570 - ...this.queryForm,
571 - };
572 - parmas.singleName = this.queryForm.singleName ? "Y" : "N"; // N为单品名,Y为多品名
573 - console.log(parmas);
574 - } else {
575 - console.log("error submit!!");
576 - return false;
577 - }
578 - });
579 - this.$emit("handleSearch");
580 - },
581 - },
582 -};
583 -</script>
584 -<style lang="scss" scoped>
585 -.rowPadding {
586 - padding: 10px 0;
587 - font-size: 12px;
588 -}
589 -::v-deep .custom-label {
590 - .el-form-item__content {
591 - display: flex;
592 - margin-left: 0 !important;
593 - span {
594 - font-size: 14px;
595 - color: #606266;
596 - font-weight: 700;
597 - float: right;
598 - margin-right: 10px;
599 - text-align: end;
600 - }
601 - .custom-label-title {
602 - width: 120px;
603 - }
604 - .el-input__suffix {
605 - right: -15px !important;
606 - }
607 - .el-form-item__error {
608 - color: #ff4949;
609 - font-size: 12px;
610 - line-height: 1;
611 - padding-top: 4px;
612 - position: absolute;
613 - top: 100%;
614 - left: 0;
615 - font-weight: 500;
616 - width: 100% !important;
617 - }
618 - }
619 -}
620 -::v-deep .custom-label-pieces {
621 - .el-form-item__content {
622 - width: 80%;
623 - }
624 -}
625 -</style>
1 -<template>
2 - <div class="form-header container">
3 - <el-row>
4 - <el-col>
5 - <yl-form
6 - ref="ruleForm"
7 - :formConfig="formConfig"
8 - :queryForm="queryForm"
9 - @input="inputEvent"
10 - @keyup="keyUpEvent"
11 - />
12 - </el-col>
13 - </el-row>
14 - <yl-table
15 - :attrs="tableAttr"
16 - :loadingTable="tableAttr.loadingTable"
17 - :columns="columns"
18 - :tableData="tableData"
19 - :pageConfig="pageConfig"
20 - @sizeChange="handleSizeChange"
21 - @currentChange="handleCurrentChange"
22 - @search="searchBtn"
23 - @restForm="restForm"
24 - @add="addBtn"
25 - >
26 - </yl-table>
27 - </div>
28 -</template>
29 -<script>
30 -import YlForm from "@/components/YlForm";
31 -import YlTable from "@/components/YlTable";
32 -import { formConfig } from "./formConfig";
33 -import { debounce } from "@/utils";
34 -import { tableAttr, columnHeader, tableData } from "./tableConfig";
35 -import {
36 - allDictData, // 获取全部字典
37 - queryRouteByFltNo, // 航线查询
38 -} from "@/api/destinationFlight";
39 -export default {
40 - components: {
41 - YlForm,
42 - YlTable,
43 - },
44 - data() {
45 - return {
46 - formConfig: formConfig, // 表单配置项
47 - queryForm: {
48 - // 表单参数
49 - status: "有效",
50 - },
51 - pageConfig: {
52 - // 分页配置项
53 - isPagination: true,
54 - total: 13,
55 - pageData: {
56 - page: 1,
57 - size: 10,
58 - },
59 - },
60 - tableAttr: tableAttr, // table配置项
61 - columns: columnHeader(this.viewRow, this.editRow, this.deleteRow), // 表头
62 - tableData: tableData, // 表格数据
63 - selectionList: [], // table复选框筛选集合
64 - };
65 - },
66 - created() {},
67 - mounted() {},
68 - methods: {
69 - // 航线查询
70 - queryRoute(item) {
71 - queryRouteByFltNo(item).then((res) => {
72 - if (res.code == 200) {
73 - const list = res.data.list;
74 - let routeList = "";
75 - if (list.length) {
76 - list.map((item) => {
77 - routeList += item.route + ",";
78 - });
79 - this.queryForm.fltRoute = routeList.substring(
80 - 0,
81 - routeList.length - 1
82 - );
83 - } else {
84 - this.queryForm = {
85 - fltNo: item.fltNo, // 航班号
86 - };
87 - }
88 - }
89 - });
90 - },
91 - // input事件
92 - inputEvent: debounce(function () {
93 - this.queryRoute({
94 - fltNo: this.queryForm.fltNo, // 航班号
95 - });
96 - }, 800),
97 - // 回车事件
98 - keyUpEvent(item) {
99 - this.queryRoute(item);
100 - },
101 - // table复选框事件
102 - selectionTable(e) {
103 - console.log("selectionTable:", e);
104 - this.selectionList = e;
105 - },
106 - //条数变化
107 - handleSizeChange(e) {
108 - this.pageConfig.pageData.size = e;
109 - this.pageConfig.pageData.page = 1;
110 - console.log("sizeChange:", e);
111 - },
112 - //页码变化
113 - handleCurrentChange(e) {
114 - this.pageConfig.pageData.page = e;
115 - console.log("currentChange:", e);
116 - },
117 - // 搜索
118 - searchBtn(row) {
119 - let params = {
120 - ...this.queryForm,
121 - };
122 - if (this.queryForm.status == "有效") {
123 - params.status = '1';
124 - }
125 - this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
126 - console.log(params);
127 - });
128 - },
129 - // 重置表单
130 - restForm() {
131 - this.$refs.ruleForm.resetFields("ruleForm");
132 - },
133 - // 添加
134 - addBtn(item) {
135 - console.log("add:", item);
136 - this.$router.push({
137 - name: "edit",
138 - params: {
139 - edit: 12,
140 - },
141 - });
142 - },
143 - // 编辑
144 - editRow(item) {
145 - this.$router.push({
146 - name: "edit",
147 - params: {
148 - edit: 12,
149 - },
150 - });
151 - console.log("修改:", item);
152 - },
153 - // 删除
154 - deleteRow(item) {
155 - this.$confirm("是否确认删除?", "提示", {
156 - confirmButtonText: "确定",
157 - cancelButtonText: "取消",
158 - type: "warning",
159 - center: true,
160 - })
161 - .then(() => {
162 - console.log("删除:", item);
163 - this.msgSuccess("删除成功!");
164 - })
165 - .catch(() => {});
166 - },
167 - // 查看
168 - viewRow({ row }) {
169 - this.$router.push({
170 - name: "edit",
171 - params: {
172 - edit: 12,
173 - },
174 - });
175 - console.log("查看:", row);
176 - },
177 - },
178 -};
179 -</script>
180 -<style lang="scss" scoped></style>
1 -const state = {
2 - 1: "有效",
3 - 3: "无效",
4 -};
5 -export const tableAttr = {
6 - border: true,
7 - loadingTable: false,
8 - isDragSort: false, // 拖拽tableData数据一定要加id字段
9 - maxHeight: 300,
10 - btnCofig: {
11 - isBtn: true,
12 - btnGroup: [
13 - {
14 - type: "primary", // text、primary、danger
15 - icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
16 - btnName: "搜索",
17 - size: "mini", // medium / small / mini
18 - round: false,
19 - loading: false,
20 - event: "search",
21 - },
22 - {
23 - type: "info",
24 - icon: "",
25 - btnName: "重置",
26 - size: "mini",
27 - round: false,
28 - loading: false,
29 - event: "restForm",
30 - },
31 - {
32 - type: "primary",
33 - icon: "el-icon-plus",
34 - btnName: "添加",
35 - size: "mini",
36 - round: false,
37 - loading: false,
38 - event: "add",
39 - },
40 - ],
41 - },
42 -};
43 -export const columnHeader = (viewRow, editRow, deleteRow) => [
44 - {
45 - type: "selection",
46 - align: "center",
47 - prop: "selection",
48 - width: "50",
49 - },
50 - {
51 - type: "index",
52 - label: "序号",
53 - prop: "id",
54 - align: "center",
55 - width: "50",
56 - },
57 - {
58 - label: "原航班号",
59 - prop: "fltNo",
60 - align: "center",
61 - minWidth: 100,
62 - },
63 - {
64 - label: "顺位航班",
65 - prop: "flightRand",
66 - align: "center",
67 - minWidth: 100,
68 - },
69 - {
70 - label: "URSA包含",
71 - prop: "includeUrsa",
72 - align: "center",
73 - minWidth: 100,
74 - },
75 - {
76 - label: "URSA不包含",
77 - prop: "notIncludeUrsa",
78 - align: "center",
79 - minWidth: 100,
80 - },
81 - {
82 - label: "状态",
83 - prop: "status",
84 - align: "center",
85 - minWidth: 100,
86 - render: (h, params) => {
87 - const { row } = params;
88 - return h("div", `${state[row.status]}`);
89 - },
90 - },
91 - {
92 - label: "创建时间",
93 - prop: "createTime",
94 - align: "center",
95 - minWidth: 100,
96 - sortable: true,
97 - "sort-method": (a, b) => b.createTime - a.createTime,
98 - },
99 - {
100 - label: "创建人",
101 - prop: "createUserName",
102 - align: "center",
103 - minWidth: 100,
104 - },
105 - {
106 - label: "修改时间",
107 - prop: "updateTime",
108 - align: "center",
109 - minWidth: 100,
110 - },
111 - {
112 - label: "修改人",
113 - prop: "updateUserName",
114 - align: "center",
115 - minWidth: 100,
116 - },
117 - {
118 - label: "操作",
119 - prop: "operate",
120 - align: "center",
121 - minWidth: 120,
122 - fixed: "right",
123 - render: (h, params) => {
124 - return h("div", [
125 - h(
126 - "el-button",
127 - {
128 - props: {
129 - type: "text",
130 - size: "mini",
131 - icon: "el-icon-view",
132 - },
133 - on: {
134 - click() {
135 - viewRow(params);
136 - },
137 - },
138 - },
139 - "查看"
140 - ),
141 - h(
142 - "el-button",
143 - {
144 - props: {
145 - type: "text",
146 - size: "mini",
147 - icon: "el-icon-edit",
148 - },
149 - on: {
150 - click() {
151 - editRow(params);
152 - },
153 - },
154 - },
155 - "修改"
156 - ),
157 - h(
158 - "el-button",
159 - {
160 - style: {
161 - color: "#ff4949",
162 - },
163 - props: {
164 - type: "text",
165 - size: "mini",
166 - icon: "el-icon-delete",
167 - },
168 - on: {
169 - click() {
170 - deleteRow(params);
171 - },
172 - },
173 - },
174 - "删除"
175 - ),
176 - ]);
177 - },
178 - },
179 -];
180 -
181 -export const tableData = [
182 - {
183 - id: "1",
184 - flightRand: "LZ003;LZ00",
185 - status: "1",
186 - fltNo: "FX0090",
187 - includeUrsa: "URSACODE191",
188 - notIncludeUrsa: "P_3",
189 - createTime: "2023-08-14",
190 - createUserName: "wjh",
191 - updateTime: "2023-08-14",
192 - updateUserName: "wjh",
193 - },
194 - {
195 - id: "2",
196 - flightRand: "LP001;LP004+1",
197 - status: "3",
198 - fltNo: "FX0090",
199 - includeUrsa: "P_;URSACODE105",
200 - notIncludeUrsa: "P_21",
201 - createTime: "2023-08-14",
202 - createUserName: "wjh",
203 - updateTime: "2023-08-14",
204 - updateUserName: "wjh",
205 - },
206 - {
207 - id: "3",
208 - flightRand: "CQ00;LZ003;CS0004",
209 - status: "1",
210 - fltNo: "CS0002",
211 - includeUrsa: "URSACODE12",
212 - notIncludeUrsa: "P_2",
213 - createTime: "2023-08-14",
214 - createUserName: "wjh",
215 - updateTime: "2023-08-14",
216 - updateUserName: "wjh",
217 - },
218 - {
219 - id: "4",
220 - flightRand: "LZ001;LZ002;LZ004",
221 - status: "1",
222 - fltNo: "FX0090",
223 - includeUrsa: "URSACODE192",
224 - notIncludeUrsa: "P_17",
225 - createTime: "2023-08-11",
226 - createUserName: "wjh",
227 - updateTime: "2023-08-11",
228 - updateUserName: "wjh",
229 - },
230 - {
231 - id: "5",
232 - flightRand: "PS001;PS003",
233 - status: "1",
234 - fltNo: "FX0091",
235 - includeUrsa: "URSACODE10",
236 - notIncludeUrsa: "P_28",
237 - createTime: "2023-08-11",
238 - createUserName: "wjh",
239 - updateTime: "2023-08-11",
240 - updateUserName: "wjh",
241 - },
242 - {
243 - id: "6",
244 - flightRand: "PS002;PS003",
245 - status: "3",
246 - fltNo: "XN007",
247 - includeUrsa: "URSACODE27",
248 - notIncludeUrsa: "P_4",
249 - createTime: "2023-08-11",
250 - createUserName: "wjh",
251 - updateTime: "2023-08-11",
252 - updateUserName: "wjh",
253 - },
254 - {
255 - id: "7",
256 - flightRand: "XN001;XN002;XN003;XN004",
257 - status: "1",
258 - fltNo: "XN001",
259 - includeUrsa: "URSACODE34",
260 - notIncludeUrsa: "P_7",
261 - createTime: "2023-08-10",
262 - createUserName: "wjh",
263 - updateTime: "2023-08-10",
264 - updateUserName: "wjh",
265 - },
266 - {
267 - id: "8",
268 - flightRand: "HA004",
269 - status: "3",
270 - fltNo: "LZ007",
271 - includeUrsa: "URSACODE71",
272 - notIncludeUrsa: "P_2",
273 - createTime: "2023-08-10",
274 - createUserName: "wjh",
275 - updateTime: "2023-08-10",
276 - updateUserName: "wjh",
277 - },
278 - {
279 - id: "9",
280 - flightRand: "AB0001;AB123",
281 - status: "1",
282 - fltNo: "AB0001",
283 - includeUrsa: "URSACODE87",
284 - notIncludeUrsa: "P_26",
285 - createTime: "2023-08-10",
286 - createUserName: "wjh",
287 - updateTime: "2023-08-10",
288 - updateUserName: "wjh",
289 - },
290 -];
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 + @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 + @search="searchBtn"
23 + @download="downloadTemplate"
24 + @upload="toUpload"
25 + @rmfile="onRemoveUpload"
26 + @export="exportTemplate"
27 + @delete="deleteData"
28 + @sizeChange="handleSizeChange"
29 + @currentChange="handleCurrentChange"
30 + @selectionEvent="tableSelectionChange"
31 + >
32 + </yl-table>
33 + <!-- <modle-view
34 + ref="modleViewRef"
35 + width="30%"
36 + title="导入Excel"
37 + confirmBtnName="导入Excel"
38 + @confirm="dialogConfirm"
39 + >
40 + <el-form
41 + :model="paramsForm"
42 + :rules="rules"
43 + ref="ruleForm"
44 + label-width="80px"
45 + >
46 + <el-row>
47 + <el-col :span="20">
48 + <el-form-item
49 + label="商品名称"
50 + prop="skuName"
51 + size="small"
52 + label-position="left"
53 + >
54 + <el-input
55 + v-model="paramsForm.skuName"
56 + placeholder="请输入商品名称"
57 + ></el-input>
58 + </el-form-item>
59 + </el-col>
60 + </el-row>
61 + <el-row>
62 + <el-col>
63 + <el-form-item prop="file">
64 + <el-upload
65 + ref="upload"
66 + action="/goods/uploadGoodsExcel"
67 + name="file"
68 + :http-request="toUpload"
69 + :on-remove="onRemoveUpload"
70 + :limit="1"
71 + accept=".xlsx"
72 + class="upload"
73 + >
74 + <el-button type="primary" icon="el-icon-upload2" size="small"
75 + >选择文件</el-button
76 + >
77 + </el-upload>
78 + </el-form-item>
79 + </el-col>
80 + </el-row>
81 + </el-form>
82 + </modle-view> -->
83 + </div>
84 +</template>
85 +<script>
86 +import YlForm from "@/components/YlForm";
87 +import YlTable from "@/components/YlTable";
88 +import ModleView from "./components/ModleView";
89 +import { formConfig } from "./formConfig";
90 +import { tableAttr, columnHeader } from "./tableConfig";
91 +import { restTableHeight } from "@/utils";
92 +import {
93 + findHsCodeList, // ShipmentDesc查询
94 + delBlackList, // ShipmentDesc删除
95 + downLoadTemplate, // ShipmentDesc下载模板
96 + uploadHsCode, // ShipmentDesc导入
97 +} from "@/api/et86HsCodeBlack";
98 +import { downLoadXlsx } from "@/utils/zipdownload";
99 +export default {
100 + name: "Et86HsCodeBlack",
101 + components: {
102 + YlForm,
103 + YlTable,
104 + ModleView,
105 + },
106 + data() {
107 + return {
108 + formConfig: formConfig, // 表单配置项
109 + queryForm: {
110 + searchValue: "",
111 + }, // 表单参数
112 + paramsForm: {
113 + skuName: "",
114 + file: null,
115 + },
116 + rules: {
117 + skuName: [
118 + { required: true, message: "请输入商品名称", trigger: "blur" },
119 + ],
120 + },
121 + pageConfig: {
122 + // 分页配置项
123 + isPagination: true,
124 + total: 0,
125 + pageData: {
126 + page: 1,
127 + size: 10,
128 + },
129 + },
130 + tableAttr: tableAttr, // table配置项
131 + columns: columnHeader(this.deleteRow), // 表头
132 + tableData: [], // 表格数据
133 + multipleSelection: [],
134 + };
135 + },
136 + created() {
137 + // 黑名单查询
138 + this.$nextTick(() => {
139 + this.searchBtn();
140 + });
141 + },
142 + mounted() {
143 + this.$nextTick(() => {
144 + this.tableAttr.maxHeight =
145 + window.innerHeight - restTableHeight(this.$refs);
146 + });
147 + },
148 + methods: {
149 + // HScode黑名单查询
150 + queryFindHsCodeList() {
151 + const { page, size } = this.pageConfig.pageData;
152 + let params = {
153 + limitStart: (page - 1) * size,
154 + limitSize: size,
155 + ...this.queryForm,
156 + };
157 + this.tableAttr.loadingTable = true;
158 + findHsCodeList(params)
159 + .then((res) => {
160 + this.tableAttr.loadingTable = false;
161 + const { code, data } = res;
162 + if (code == 200) {
163 + this.tableData = data.list;
164 + this.pageConfig.total = data.total;
165 + }
166 + })
167 + .catch(() => {});
168 + },
169 + // 删除黑名单
170 + toDelBlackList(params) {
171 + delBlackList(params)
172 + .then((res) => {
173 + const { code, msg } = res;
174 + if (code == 200) {
175 + this.searchBtn();
176 + this.msgSuccess(msg || "删除成功!");
177 + } else {
178 + this.$message.error(msg || "删除失败");
179 + }
180 + })
181 + .catch(() => {});
182 + },
183 + // 失焦事件
184 + blurEvent() {},
185 + // 选择上传【HScode黑名单导入】
186 + toUpload({ file }) {
187 + const formData = new FormData();
188 + formData.append("file", file);
189 + uploadHsCode(formData)
190 + .then((res) => {
191 + const { code, data, msg } = res;
192 + if (code == 200) {
193 + this.searchBtn();
194 + this.msgSuccess(msg || "导入成功!");
195 + } else {
196 + this.$message.error(msg || "导入失败");
197 + this.$router.push({
198 + path: "/errorInfo",
199 + query: {
200 + name: "errorInfo",
201 + error: code,
202 + data: JSON.stringify(data),
203 + },
204 + });
205 + }
206 + })
207 + .catch(() => {});
208 + },
209 + //移除上传
210 + onRemoveUpload(options) {
211 + console.log(options);
212 + },
213 + // 搜索
214 + searchBtn() {
215 + this.pageConfig.pageData.page = 1;
216 + this.pageConfig.pageData.size = 10;
217 + this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
218 + this.queryFindHsCodeList();
219 + });
220 + },
221 + // 确认对话框
222 + dialogConfirm() {},
223 + // 下载【HScode黑名单下载模板】
224 + downloadTemplate() {
225 + downLoadTemplate("hsCode")
226 + .then((res) => {
227 + if (res) {
228 + const blob = new Blob([res]);
229 + const link = document.createElement("a"); //创建a标签
230 + link.download = "HSCODE黑名单表.xlsx"; //a标签添加属性
231 + link.style.display = "none";
232 + link.href = URL.createObjectURL(blob);
233 + document.body.appendChild(link);
234 + link.click(); //执行下载
235 + URL.revokeObjectURL(link.href); //释放url
236 + document.body.removeChild(link); //释放标签
237 + } else {
238 + this.$message.error("下载失败");
239 + }
240 + })
241 + .catch(() => {});
242 + },
243 + // 上传
244 + upLoadTemplate() {
245 + // console.log(this.$refs.modleViewRef);
246 + },
247 + // 导出
248 + exportTemplate(row, i) {
249 + this.tableAttr.btnCofig.btnGroup[i].loading = true;
250 + downLoadXlsx("/etes/exportHsCodeList", this.queryForm, "HSCODE黑名单表")
251 + .then(() => {
252 + this.tableAttr.btnCofig.btnGroup[i].loading = false;
253 + })
254 + .catch(() => {
255 + this.$message.error("导出失败");
256 + });
257 + },
258 + // 删除
259 + deleteData(row) {
260 + if (this.multipleSelection.length) {
261 + let params = [];
262 + this.multipleSelection.map((item) => {
263 + params.push(item.id);
264 + });
265 + this.$confirm("是否确认删除?", "提示", {
266 + confirmButtonText: "确定",
267 + cancelButtonText: "取消",
268 + type: "warning",
269 + center: true,
270 + })
271 + .then(() => {
272 + this.toDelBlackList(params);
273 + })
274 + .catch(() => {});
275 + } else {
276 + this.$message.error("请勾选一条或者多条数据再操作!");
277 + }
278 + },
279 + //条数变化
280 + handleSizeChange(e) {
281 + this.pageConfig.pageData.size = e;
282 + this.pageConfig.pageData.page = 1;
283 + this.queryFindHsCodeList();
284 + },
285 + //页码变化
286 + handleCurrentChange(e) {
287 + this.pageConfig.pageData.page = e;
288 + this.queryFindHsCodeList();
289 + },
290 + // table勾选
291 + tableSelectionChange(val) {
292 + this.multipleSelection = val;
293 + },
294 + // 删除
295 + deleteRow({ row }) {
296 + this.$confirm("是否确认删除?", "提示", {
297 + confirmButtonText: "确定",
298 + cancelButtonText: "取消",
299 + type: "warning",
300 + center: true,
301 + })
302 + .then(() => {
303 + this.toDelBlackList([row.id]);
304 + })
305 + .catch(() => {});
306 + },
307 + },
308 +};
309 +</script>
310 +<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 = (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 + },
75 + {
76 + label: "HSCODE",
77 + prop: "blackValue",
78 + align: "center",
79 + minWidth: 100,
80 + },
81 + {
82 + label: "创建时间",
83 + prop: "createTime",
84 + align: "center",
85 + minWidth: 100,
86 + },
87 + {
88 + label: "创建人",
89 + prop: "createUserName",
90 + align: "center",
91 + minWidth: 100,
92 + },
93 + {
94 + label: "文件名",
95 + prop: "uploadFileName",
96 + align: "center",
97 + minWidth: 100,
98 + },
99 +
100 + {
101 + label: "操作",
102 + prop: "operate",
103 + align: "center",
104 + minWidth: 120,
105 + fixed: "right",
106 + render: (h, params) => {
107 + return h("div", [
108 + h(
109 + "el-button",
110 + {
111 + style: {
112 + color: "#ff4949",
113 + },
114 + props: {
115 + type: "text",
116 + size: "mini",
117 + icon: "el-icon-delete",
118 + },
119 + on: {
120 + click() {
121 + deleteRow(params);
122 + },
123 + },
124 + },
125 + "删除"
126 + ),
127 + ]);
128 + },
129 + },
130 +];
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>
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
10 }, 10 },
11 // 处理serviceCode包不包含 11 // 处理serviceCode包不包含
12 serviceCodeCofig() { 12 serviceCodeCofig() {
13 - let str = this.queryForm.serviceCode.replace(/;|;/g, ","); 13 + let str = this.serviceCode.replace(/;|;/g, ",");
14 let arr = str.split(","); 14 let arr = str.split(",");
15 if (arr[arr.length - 1] == "") { 15 if (arr[arr.length - 1] == "") {
16 arr.splice(arr.length - 1, 1); 16 arr.splice(arr.length - 1, 1);
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
28 }; 28 };
29 }, 29 },
30 // radio包含不包含serviceCode 30 // radio包含不包含serviceCode
31 - isServiceCode(val) { 31 + changeIsServiceCode(val) {
32 // 勾选的时候去校验 || 输入的时候去校验 32 // 勾选的时候去校验 || 输入的时候去校验
33 if (val == 1) { 33 if (val == 1) {
34 if (this.serviceCodeCofig().noInclude.length) { 34 if (this.serviceCodeCofig().noInclude.length) {
...@@ -44,15 +44,15 @@ export default { ...@@ -44,15 +44,15 @@ export default {
44 }, 44 },
45 // serviceCode失焦事件 45 // serviceCode失焦事件
46 serviceCodeBlur() { 46 serviceCodeBlur() {
47 - if (this.queryForm.isServiceCode == "1") { 47 + if (this.isServiceCode == "1") {
48 if (this.serviceCodeCofig().noInclude.length) { 48 if (this.serviceCodeCofig().noInclude.length) {
49 let tip = this.serviceCodeCofig().noInclude.toString(); 49 let tip = this.serviceCodeCofig().noInclude.toString();
50 - this.msgError(`${tip} 不包含`); 50 + // this.msgError(`${tip} 不包含`);
51 } 51 }
52 } else { 52 } else {
53 if (this.serviceCodeCofig().include.length) { 53 if (this.serviceCodeCofig().include.length) {
54 let tip = this.serviceCodeCofig().include.toString(); 54 let tip = this.serviceCodeCofig().include.toString();
55 - this.msgError(`${tip} 已包含`); 55 + // this.msgError(`${tip} 已包含`);
56 } 56 }
57 } 57 }
58 }, 58 },
......
...@@ -4,7 +4,7 @@ export const tableAttr = { ...@@ -4,7 +4,7 @@ export const tableAttr = {
4 isDragSort: true, // 拖拽tableData数据一定要加id字段 4 isDragSort: true, // 拖拽tableData数据一定要加id字段
5 maxHeight: 300, 5 maxHeight: 300,
6 btnCofig: { 6 btnCofig: {
7 - isBtn: true, 7 + isBtn: false,
8 btnGroup: [ 8 btnGroup: [
9 { 9 {
10 type: "primary", 10 type: "primary",
...@@ -22,32 +22,32 @@ export const tableAttr = { ...@@ -22,32 +22,32 @@ export const tableAttr = {
22 export const columnHeader = (deleteRow) => [ 22 export const columnHeader = (deleteRow) => [
23 { 23 {
24 label: "航班号", 24 label: "航班号",
25 - prop: "fltNo", 25 + prop: "flightNo",
26 align: "center", 26 align: "center",
27 minWidth: 100, 27 minWidth: 100,
28 }, 28 },
29 { 29 {
30 label: "航班日期", 30 label: "航班日期",
31 - prop: "fltNoDate", 31 + prop: "calculateDay",
32 align: "center", 32 align: "center",
33 minWidth: 100, 33 minWidth: 100,
34 // sortable: true, 34 // sortable: true,
35 // "sort-method": (a, b) => b.updateTime - a.updateTime, 35 // "sort-method": (a, b) => b.updateTime - a.updateTime,
36 }, 36 },
37 { 37 {
38 - label: "航线优先级", 38 + label: "航线",
39 - prop: "fltRoute", 39 + prop: "flightRoute",
40 align: "center", 40 align: "center",
41 minWidth: 100, 41 minWidth: 100,
42 }, 42 },
43 { 43 {
44 label: "爆仓是否继续配舱", 44 label: "爆仓是否继续配舱",
45 - prop: "isOn", 45 + prop: "permitOverweight",
46 align: "center", 46 align: "center",
47 minWidth: 100, 47 minWidth: 100,
48 render: (h, params) => { 48 render: (h, params) => {
49 const { row } = params; 49 const { row } = params;
50 - console.log(345678,row); 50 + console.log(345678, row);
51 // return h("div", `状态-${row.id}`); 51 // return h("div", `状态-${row.id}`);
52 }, 52 },
53 }, 53 },
...@@ -80,15 +80,3 @@ export const columnHeader = (deleteRow) => [ ...@@ -80,15 +80,3 @@ export const columnHeader = (deleteRow) => [
80 }, 80 },
81 }, 81 },
82 ]; 82 ];
83 -
84 -export const tableData = [
85 - {
86 - id: "1",
87 - fltNo: "A380",
88 - fltNoDate: "3",
89 - fltRoute: "",
90 - routeList: [],
91 - isOn: "1",
92 - sort: "1", // 排序字段
93 - },
94 -];
......
1 export const formConfig = [ 1 export const formConfig = [
2 { 2 {
3 - label: "创建时间(从)", 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: "修改时间 从",
4 type: "Date", 14 type: "Date",
5 name: "startTime", 15 name: "startTime",
6 prop: "startTime", 16 prop: "startTime",
7 - width: "140px",
8 placeholder: "请选择开始时间", 17 placeholder: "请选择开始时间",
9 - rules: { required: true, message: "请选择开始时间", trigger: "blur" }, 18 + // rules: { required: true, message: "请选择开始时间", trigger: "blur" },
19 + format: "yyyy-MM-dd",
20 + colWidth: "23%",
21 + inputWidth: "100%",
10 }, 22 },
11 { 23 {
12 - label: "创建时间(到)", 24 + label: "",
13 type: "Date", 25 type: "Date",
14 name: "endTime", 26 name: "endTime",
15 prop: "endTime", 27 prop: "endTime",
16 - width: "140px",
17 placeholder: "请选择结束时间", 28 placeholder: "请选择结束时间",
18 - rules: { required: true, message: "请选择结束时间", trigger: "blur" }, 29 + // rules: { required: true, message: "请选择结束时间", trigger: "blur" },
30 + format: "yyyy-MM-dd",
31 + colWidth: "20%",
32 + labelWidth: "20px",
33 + inputWidth: "100%",
19 }, 34 },
20 { 35 {
21 label: "规则状态", 36 label: "规则状态",
22 type: "Select", 37 type: "Select",
23 name: "status", 38 name: "status",
24 prop: "status", 39 prop: "status",
25 - width: "140px",
26 placeholder: "请选择状态", 40 placeholder: "请选择状态",
27 options: { 41 options: {
28 data: [ 42 data: [
...@@ -31,13 +45,16 @@ export const formConfig = [ ...@@ -31,13 +45,16 @@ export const formConfig = [
31 label: "有效", 45 label: "有效",
32 }, 46 },
33 { 47 {
34 - value: "3", 48 + value: "0",
35 label: "无效", 49 label: "无效",
36 }, 50 },
37 ], 51 ],
38 label: "有效", 52 label: "有效",
39 value: "1", 53 value: "1",
40 }, 54 },
55 + colWidth: "18%",
56 + labelWidth: "70px",
57 + inputWidth: "100%",
41 }, 58 },
42 ]; 59 ];
43 60
......
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 +];
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 + @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 + @search="searchBtn"
23 + @upload="toUpload"
24 + @rmfile="onRemoveUpload"
25 + @export="exportTemplate"
26 + @delete="deleteData"
27 + @sizeChange="handleSizeChange"
28 + @currentChange="handleCurrentChange"
29 + @selectionEvent="tableSelectionChange"
30 + >
31 + </yl-table>
32 + <!-- <modle-view
33 + ref="modleViewRef"
34 + width="30%"
35 + title="导入Excel"
36 + confirmBtnName="导入Excel"
37 + @confirm="dialogConfirm"
38 + >
39 + <el-form
40 + :model="paramsForm"
41 + :rules="rules"
42 + ref="ruleForm"
43 + label-width="80px"
44 + >
45 + <el-row>
46 + <el-col :span="20">
47 + <el-form-item
48 + label="商品名称"
49 + prop="skuName"
50 + size="small"
51 + label-position="left"
52 + >
53 + <el-input
54 + v-model="paramsForm.skuName"
55 + placeholder="请输入商品名称"
56 + ></el-input>
57 + </el-form-item>
58 + </el-col>
59 + </el-row>
60 + <el-row>
61 + <el-col>
62 + <el-form-item prop="file">
63 + <el-upload
64 + ref="upload"
65 + action="/goods/uploadGoodsExcel"
66 + name="file"
67 + :http-request="toUpload"
68 + :on-remove="onRemoveUpload"
69 + :limit="1"
70 + accept=".xlsx"
71 + class="upload"
72 + >
73 + <el-button type="primary" icon="el-icon-upload2" size="small"
74 + >选择文件</el-button
75 + >
76 + </el-upload>
77 + </el-form-item>
78 + </el-col>
79 + </el-row>
80 + </el-form>
81 + </modle-view> -->
82 + </div>
83 +</template>
84 +<script>
85 +import YlForm from "@/components/YlForm";
86 +import YlTable from "@/components/YlTable";
87 +import ModleView from "./components/ModleView";
88 +import { formConfig } from "./formConfig";
89 +import { tableAttr, columnHeader } from "./tableConfig";
90 +import { restTableHeight } from "@/utils";
91 +import {
92 + findShipmentDescList, // HScode英文品名黑名单查询
93 + uploadShipmentDesc, // HScode英文品名黑名单导入
94 + delBlackList, // HScode黑名单/英文品名删除
95 +} from "@/api/et86ShipmentDesc";
96 +import { downLoadXlsx } from "@/utils/zipdownload";
97 +export default {
98 + name: "et86ShipmentDesc",
99 + components: {
100 + YlForm,
101 + YlTable,
102 + ModleView,
103 + },
104 + data() {
105 + return {
106 + formConfig: formConfig, // 表单配置项
107 + queryForm: {
108 + searchValue: "",
109 + }, // 表单参数
110 + paramsForm: {
111 + skuName: "",
112 + file: null,
113 + },
114 + rules: {
115 + skuName: [
116 + { required: true, message: "请输入ShipmentDesc", trigger: "blur" },
117 + ],
118 + },
119 + pageConfig: {
120 + // 分页配置项
121 + isPagination: true,
122 + total: 0,
123 + pageData: {
124 + page: 1,
125 + size: 10,
126 + },
127 + },
128 + tableAttr: tableAttr, // table配置项
129 + columns: columnHeader(this.deleteRow), // 表头
130 + tableData: [], // 表格数据
131 + multipleSelection: [],
132 + };
133 + },
134 + created() {
135 + // 黑名单查询
136 + this.$nextTick(() => {
137 + this.searchBtn();
138 + });
139 + },
140 + mounted() {
141 + this.$nextTick(() => {
142 + this.tableAttr.maxHeight =
143 + window.innerHeight - restTableHeight(this.$refs);
144 + });
145 + },
146 + methods: {
147 + // HScode黑名单查询
148 + queryFindShipmentDescList() {
149 + const { page, size } = this.pageConfig.pageData;
150 + let params = {
151 + limitStart: (page - 1) * size,
152 + limitSize: size,
153 + ...this.queryForm,
154 + };
155 + this.tableAttr.loadingTable = true;
156 + findShipmentDescList(params)
157 + .then((res) => {
158 + this.tableAttr.loadingTable = false;
159 + const { code, data } = res;
160 + if (code == 200) {
161 + this.tableData = data.list;
162 + this.pageConfig.total = data.total;
163 + }
164 + })
165 + .catch(() => {});
166 + },
167 + // 删除黑名单
168 + toDelBlackList(params) {
169 + delBlackList(params)
170 + .then((res) => {
171 + const { code, msg } = res;
172 + if (code == 200) {
173 + this.searchBtn();
174 + this.msgSuccess(msg || "删除成功!");
175 + } else {
176 + this.$message.error(msg || "删除失败");
177 + }
178 + })
179 + .catch(() => {});
180 + },
181 + // 失焦事件
182 + blurEvent() {},
183 + // 选择上传【HScode黑名单导入】
184 + toUpload({ file }) {
185 + const formData = new FormData();
186 + formData.append("file", file);
187 + uploadShipmentDesc(formData)
188 + .then((res) => {
189 + const { code, data, msg } = res;
190 + if (code == 200) {
191 + this.searchBtn();
192 + this.msgSuccess(msg || "导入成功!");
193 + } else {
194 + this.$message.error(msg || "导入失败");
195 + this.$router.push({
196 + path: "/errorInfo",
197 + query: {
198 + name: "errorInfo",
199 + error: code,
200 + data: JSON.stringify(data),
201 + },
202 + });
203 + }
204 + })
205 + .catch(() => {});
206 + },
207 + //移除上传
208 + onRemoveUpload(options) {
209 + console.log(options);
210 + },
211 + // 搜索
212 + searchBtn() {
213 + this.pageConfig.pageData.page = 1;
214 + this.pageConfig.pageData.size = 10;
215 + this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
216 + this.queryFindShipmentDescList();
217 + });
218 + },
219 + // 确认对话框
220 + dialogConfirm() {},
221 + // 上传
222 + upLoadTemplate() {
223 + // console.log(this.$refs.modleViewRef);
224 + },
225 + // 导出
226 + exportTemplate(row, i) {
227 + this.tableAttr.btnCofig.btnGroup[i].loading = true;
228 + downLoadXlsx("/etes/exportShipmentDescList", this.queryForm, "HSCODE英文品名黑名单表")
229 + .then(() => {
230 + this.tableAttr.btnCofig.btnGroup[i].loading = false;
231 + })
232 + .catch(() => {
233 + this.$message.error("导出失败");
234 + });
235 + },
236 + // 删除
237 + deleteData(row) {
238 + if (this.multipleSelection.length) {
239 + let params = [];
240 + this.multipleSelection.map((item) => {
241 + params.push(item.id);
242 + });
243 + this.$confirm("是否确认删除?", "提示", {
244 + confirmButtonText: "确定",
245 + cancelButtonText: "取消",
246 + type: "warning",
247 + center: true,
248 + })
249 + .then(() => {
250 + this.toDelBlackList(params);
251 + })
252 + .catch(() => {});
253 + } else {
254 + this.$message.error("请勾选一条或者多条数据再操作!");
255 + }
256 + },
257 + //条数变化
258 + handleSizeChange(e) {
259 + this.pageConfig.pageData.size = e;
260 + this.pageConfig.pageData.page = 1;
261 + this.queryFindShipmentDescList();
262 + },
263 + //页码变化
264 + handleCurrentChange(e) {
265 + this.pageConfig.pageData.page = e;
266 + this.queryFindShipmentDescList();
267 + },
268 + // table勾选
269 + tableSelectionChange(val) {
270 + this.multipleSelection = val;
271 + },
272 + // 删除
273 + deleteRow({ row }) {
274 + this.$confirm("是否确认删除?", "提示", {
275 + confirmButtonText: "确定",
276 + cancelButtonText: "取消",
277 + type: "warning",
278 + center: true,
279 + })
280 + .then(() => {
281 + this.toDelBlackList([row.id]);
282 + })
283 + .catch(() => {});
284 + },
285 + },
286 +};
287 +</script>
288 +<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 = (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 + },
66 + {
67 + label: "ShipmentDesc",
68 + prop: "blackValue",
69 + align: "center",
70 + minWidth: 100,
71 + },
72 + {
73 + label: "创建时间",
74 + prop: "createTime",
75 + align: "center",
76 + minWidth: 100,
77 + },
78 + {
79 + label: "创建人",
80 + prop: "createUserName",
81 + align: "center",
82 + minWidth: 100,
83 + },
84 + {
85 + label: "文件名",
86 + prop: "uploadFileName",
87 + align: "center",
88 + minWidth: 100,
89 + },
90 +
91 + {
92 + label: "操作",
93 + prop: "operate",
94 + align: "center",
95 + minWidth: 120,
96 + fixed: "right",
97 + render: (h, params) => {
98 + return h("div", [
99 + h(
100 + "el-button",
101 + {
102 + style: {
103 + color: "#ff4949",
104 + },
105 + props: {
106 + type: "text",
107 + size: "mini",
108 + icon: "el-icon-delete",
109 + },
110 + on: {
111 + click() {
112 + deleteRow(params);
113 + },
114 + },
115 + },
116 + "删除"
117 + ),
118 + ]);
119 + },
120 + },
121 +];
...@@ -353,28 +353,18 @@ export default { ...@@ -353,28 +353,18 @@ export default {
353 如果该航线是普通航线直接删,如果是ET86航线,那么要查询该航线有没有设置维度, 353 如果该航线是普通航线直接删,如果是ET86航线,那么要查询该航线有没有设置维度,
354 如果没有直接删,如果已经设置了维度是否考虑将该航线下的维度删掉再进行操作; 354 如果没有直接删,如果已经设置了维度是否考虑将该航线下的维度删掉再进行操作;
355 */ 355 */
356 - // if(!val.isEtesRoute){ // 普通航线 356 + if(!val.isEtesRoute){ // 普通航线
357 - // this.routeDel({ data: [val], id: [val.id] }) 357 + this.routeDel({ data: [val], id: [val.id] })
358 - // }else{ // ET86航线 358 + }else{ // ET86航线
359 - // this.$confirm("该航线是ET86航线。是否要删除", "注意!", { 359 + this.$confirm("该航线是ET86航线。是否要删除", "注意!", {
360 - // closeOnClickModal: false, 360 + closeOnClickModal: false,
361 - // confirmButtonText: "确定删除", 361 + confirmButtonText: "确定删除",
362 - // cancelButtonText: "取消", 362 + cancelButtonText: "取消",
363 - // type: "warning", 363 + type: "warning",
364 - // }).then(() => { 364 + }).then(() => {
365 - // this.msgWarning('待联调!') 365 + this.routeDel({ data: [val], id: [val.id] })
366 - // // delDict(val).then(res => { 366 + }).catch(() => { })
367 - // // if (res.code === 200) { 367 + }
368 - // // this.msgSuccess(res.msg)
369 - // // } else {
370 - // // this.msgWarning(res.msg)
371 - // // }
372 - // // this.tableSelect() // 回调查询
373 - // // }).catch(err => {
374 - // // console.log(err)
375 - // // })
376 - // }).catch(() => { })
377 - // }
378 } else { 368 } else {
379 this.dicDel([val.id]) 369 this.dicDel([val.id])
380 } 370 }
......
...@@ -186,7 +186,7 @@ export default { ...@@ -186,7 +186,7 @@ export default {
186 cancelButtonText: '取消', 186 cancelButtonText: '取消',
187 type: "warning", 187 type: "warning",
188 }).then(() => { 188 }).then(() => {
189 - this.statusChange({ id: val.id, status: status }) 189 + this.statusChange({ id: val.id, status: status, tip: tip })
190 }).catch(() => { }) 190 }).catch(() => { })
191 } else { 191 } else {
192 this.msgWarning(res.msg) 192 this.msgWarning(res.msg)
...@@ -195,12 +195,12 @@ export default { ...@@ -195,12 +195,12 @@ export default {
195 console.log(err) 195 console.log(err)
196 }) 196 })
197 } else { 197 } else {
198 - this.$confirm(`是否要${tip}记录!`, "注意!", { 198 + this.$confirm(`是否要${tip}规则!`, "注意!", {
199 confirmButtonText: "确定", 199 confirmButtonText: "确定",
200 cancelButtonText: '取消', 200 cancelButtonText: '取消',
201 type: "warning", 201 type: "warning",
202 }).then(() => { 202 }).then(() => {
203 - this.statusChange({ id: val.id, status: status }) 203 + this.statusChange({ id: val.id, status: status, tip: tip })
204 }).catch(() => { }) 204 }).catch(() => { })
205 } 205 }
206 }, 206 },
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 </el-col> 17 </el-col>
18 <el-col :span="6"> 18 <el-col :span="6">
19 <el-form-item label="运单号"> 19 <el-form-item label="运单号">
20 - <el-input v-model="selectForm.awbNbr" class="formItem" placeholder="例: xxx;xxx;" clearable></el-input> 20 + <el-input v-model="selectForm.awbNbr" class="formItem" placeholder="请输入运单号" clearable></el-input>
21 </el-form-item> 21 </el-form-item>
22 </el-col> 22 </el-col>
23 <el-col :span="6"> 23 <el-col :span="6">
...@@ -138,6 +138,7 @@ export default { ...@@ -138,6 +138,7 @@ export default {
138 this.data = []; 138 this.data = [];
139 }, 139 },
140 mounted() { 140 mounted() {
141 + this.tableHeight = window.innerHeight - this.$refs.dmLogForm.$el.offsetHeight - 130;
141 }, 142 },
142 methods: { 143 methods: {
143 //数据查询 144 //数据查询
......