Showing
40 changed files
with
1882 additions
and
704 deletions
src/api/et86.js
0 → 100644
| 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 | +} |
src/api/et86HsCodeBlack.js
0 → 100644
| 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 | + |
src/api/et86ShipmentDesc.js
0 → 100644
| 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)); | ... | ... |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
| ... | @@ -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' | ... | ... |
File mode changed
| 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> |
This diff is collapsed. Click to expand it.
| 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 | -]; |
src/views/et86Config/errorInfo/index.vue
0 → 100644
| 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 | +<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 | +]; |
This diff is collapsed. Click to expand it.
| ... | @@ -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 | +<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 | //数据查询 | ... | ... |
-
Please register or login to post a comment