Showing
15 changed files
with
1125 additions
and
51 deletions
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 | + |
| ... | @@ -80,6 +80,13 @@ export const constantRoutes = [ | ... | @@ -80,6 +80,13 @@ export const constantRoutes = [ |
| 80 | meta: { title: "ET86规则", icon: "user", noCache: false }, | 80 | meta: { title: "ET86规则", icon: "user", noCache: false }, |
| 81 | }, | 81 | }, |
| 82 | { | 82 | { |
| 83 | + path: "/errorInfo", | ||
| 84 | + component: (resolve) => | ||
| 85 | + require(["@/views/et86Config/errorInfo"], resolve), | ||
| 86 | + name: "errorInfo", | ||
| 87 | + meta: { title: "错误信息提示", icon: "user" }, | ||
| 88 | + }, | ||
| 89 | + { | ||
| 83 | 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", |
| 84 | component: (resolve) => | 91 | component: (resolve) => |
| 85 | require(["@/views/allocationConfig/flightAllocConfig/info"], resolve), | 92 | require(["@/views/allocationConfig/flightAllocConfig/info"], resolve), | ... | ... |
| ... | @@ -128,7 +128,7 @@ export const inputBlurValidate = { | ... | @@ -128,7 +128,7 @@ export const inputBlurValidate = { |
| 128 | this.validateForm = true; | 128 | this.validateForm = true; |
| 129 | } else { | 129 | } else { |
| 130 | this.$refs.minNumOfPieces.innerHTML = ""; | 130 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 131 | - this.$refs.minNumOfPieces.innerHTML = "件数不得小于1"; | 131 | + this.$refs.minNumOfPieces.innerHTML = "最大件数不得小于1"; |
| 132 | this.validateForm = false; | 132 | this.validateForm = false; |
| 133 | } | 133 | } |
| 134 | // 最大件数为空最小件数有值的情况下 | 134 | // 最大件数为空最小件数有值的情况下 |
| ... | @@ -137,8 +137,7 @@ export const inputBlurValidate = { | ... | @@ -137,8 +137,7 @@ export const inputBlurValidate = { |
| 137 | this.validateForm = true; | 137 | this.validateForm = true; |
| 138 | } else { | 138 | } else { |
| 139 | this.$refs.minNumOfPieces.innerHTML = ""; | 139 | this.$refs.minNumOfPieces.innerHTML = ""; |
| 140 | - this.$refs.minNumOfPieces.innerHTML = "件数不得小于1"; | 140 | + this.validateForm = true; |
| 141 | - this.validateForm = false; | ||
| 142 | } | 141 | } |
| 143 | // 左右区间 都为空的情况下 | 142 | // 左右区间 都为空的情况下 |
| 144 | if ( | 143 | if ( |
| ... | @@ -218,33 +217,42 @@ export const inputBlurValidate = { | ... | @@ -218,33 +217,42 @@ export const inputBlurValidate = { |
| 218 | this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位"; | 217 | this.$refs.minWeight.innerHTML = "请输入正整数,小数保留5位"; |
| 219 | } | 218 | } |
| 220 | } | 219 | } |
| 220 | + } else { | ||
| 221 | + this.validateForm = true; | ||
| 222 | + this.$refs.minWeight.innerHTML = ""; | ||
| 221 | } | 223 | } |
| 222 | return this.validateForm; | 224 | return this.validateForm; |
| 223 | }, | 225 | }, |
| 224 | // 报价值【申报价值可以为空为0】 | 226 | // 报价值【申报价值可以为空为0】 |
| 225 | validateCustomVal(value, customVal) { | 227 | validateCustomVal(value, customVal) { |
| 228 | + let coin = { | ||
| 229 | + minCNYCustomVal: "minCNYCustomVal", | ||
| 230 | + maxCNYCustomVal: "minCNYCustomVal", | ||
| 231 | + minSUDCustomVal: "minSUDCustomVal", | ||
| 232 | + maxSUDCustomVal: "minSUDCustomVal", | ||
| 233 | + }; | ||
| 234 | + let currency = { | ||
| 235 | + minCNYCustomVal: 2000, | ||
| 236 | + maxCNYCustomVal: 2000, | ||
| 237 | + minSUDCustomVal: 600, | ||
| 238 | + maxSUDCustomVal: 600, | ||
| 239 | + }; | ||
| 240 | + let markCoin = false; | ||
| 226 | if (value.length) { | 241 | if (value.length) { |
| 227 | this[customVal] = Number(value); | 242 | this[customVal] = Number(value); |
| 228 | - let coin = { | 243 | + // 其中一个有值的情况下 |
| 229 | - minCNYCustomVal: "minCNYCustomVal", | ||
| 230 | - maxCNYCustomVal: "minCNYCustomVal", | ||
| 231 | - minSUDCustomVal: "minSUDCustomVal", | ||
| 232 | - maxSUDCustomVal: "minSUDCustomVal", | ||
| 233 | - }; | ||
| 234 | - let currency = { | ||
| 235 | - minCNYCustomVal: 2000, | ||
| 236 | - maxCNYCustomVal: 2000, | ||
| 237 | - minSUDCustomVal: 600, | ||
| 238 | - maxSUDCustomVal: 600, | ||
| 239 | - }; | ||
| 240 | - let markCoin = false; | ||
| 241 | if (customVal == "minCNYCustomVal" || customVal == "maxCNYCustomVal") { | 244 | if (customVal == "minCNYCustomVal" || customVal == "maxCNYCustomVal") { |
| 242 | if (this.minCNYCustomVal && this.maxCNYCustomVal) { | 245 | if (this.minCNYCustomVal && this.maxCNYCustomVal) { |
| 243 | this.validateForm = false; | 246 | this.validateForm = false; |
| 244 | markCoin = | 247 | markCoin = |
| 245 | Number(this.maxCNYCustomVal) < Number(this.minCNYCustomVal); | 248 | Number(this.maxCNYCustomVal) < Number(this.minCNYCustomVal); |
| 249 | + } else { | ||
| 250 | + this.validateForm = true; | ||
| 251 | + this.$refs[coin[customVal]].innerHTML = ""; | ||
| 246 | } | 252 | } |
| 247 | - } else { | 253 | + } |
| 254 | + // 都有值的情况下 | ||
| 255 | + else { | ||
| 248 | if (this.minSUDCustomVal && this.maxSUDCustomVal) { | 256 | if (this.minSUDCustomVal && this.maxSUDCustomVal) { |
| 249 | this.validateForm = false; | 257 | this.validateForm = false; |
| 250 | markCoin = | 258 | markCoin = |
| ... | @@ -258,28 +266,31 @@ export const inputBlurValidate = { | ... | @@ -258,28 +266,31 @@ export const inputBlurValidate = { |
| 258 | this.$refs[coin[customVal]].innerHTML = ""; | 266 | this.$refs[coin[customVal]].innerHTML = ""; |
| 259 | this.$refs[coin[customVal]].innerHTML = | 267 | this.$refs[coin[customVal]].innerHTML = |
| 260 | "最小申报价值不得大于最大申报价值"; | 268 | "最小申报价值不得大于最大申报价值"; |
| 261 | - } else if (this[customVal] > currency[customVal]) { | ||
| 262 | - this.validateForm = false; | ||
| 263 | - this.$refs[coin[customVal]].innerHTML = ""; | ||
| 264 | - this.$refs[ | ||
| 265 | - coin[customVal] | ||
| 266 | - ].innerHTML = `最大申报值不得大于${currency[customVal]}`; | ||
| 267 | - } else { | ||
| 268 | - this.validateForm = true; | ||
| 269 | - this.$refs[coin[customVal]].innerHTML = ""; | ||
| 270 | } | 269 | } |
| 270 | + // 判断申报价值不得大于上限 | ||
| 271 | + // else if (this[customVal] > currency[customVal]) { | ||
| 272 | + // this.validateForm = false; | ||
| 273 | + // this.$refs[coin[customVal]].innerHTML = ""; | ||
| 274 | + // this.$refs[ | ||
| 275 | + // coin[customVal] | ||
| 276 | + // ].innerHTML = `最大申报值不得大于${currency[customVal]}`; | ||
| 277 | + // } else { | ||
| 278 | + // this.validateForm = true; | ||
| 279 | + // this.$refs[coin[customVal]].innerHTML = ""; | ||
| 280 | + // } | ||
| 271 | } else { | 281 | } else { |
| 272 | if (value.length) { | 282 | if (value.length) { |
| 273 | - if (Number(value) > currency[customVal]) { | 283 | + // 判断申报价值不得大于上限 |
| 274 | - this.validateForm = false; | 284 | + // if (Number(value) > currency[customVal]) { |
| 275 | - this.$refs[coin[customVal]].innerHTML = ""; | 285 | + // this.validateForm = false; |
| 276 | - this.$refs[ | 286 | + // this.$refs[coin[customVal]].innerHTML = ""; |
| 277 | - coin[customVal] | 287 | + // this.$refs[ |
| 278 | - ].innerHTML = `最大申报值不得大于${currency[customVal]}`; | 288 | + // coin[customVal] |
| 279 | - } else { | 289 | + // ].innerHTML = `最大申报值不得大于${currency[customVal]}`; |
| 280 | - this.validateForm = true; | 290 | + // } else { |
| 281 | - this.$refs[coin[customVal]].innerHTML = ""; | 291 | + // this.validateForm = true; |
| 282 | - } | 292 | + // this.$refs[coin[customVal]].innerHTML = ""; |
| 293 | + // } | ||
| 283 | } | 294 | } |
| 284 | } | 295 | } |
| 285 | } else { | 296 | } else { |
| ... | @@ -287,6 +298,9 @@ export const inputBlurValidate = { | ... | @@ -287,6 +298,9 @@ export const inputBlurValidate = { |
| 287 | this.$refs[coin[customVal]].innerHTML = ""; | 298 | this.$refs[coin[customVal]].innerHTML = ""; |
| 288 | this.$refs[coin[customVal]].innerHTML = "请输入正确申报价值"; | 299 | this.$refs[coin[customVal]].innerHTML = "请输入正确申报价值"; |
| 289 | } | 300 | } |
| 301 | + } else { | ||
| 302 | + this.validateForm = true; | ||
| 303 | + this.$refs[coin[customVal]].innerHTML = ""; | ||
| 290 | } | 304 | } |
| 291 | return this.validateForm; | 305 | return this.validateForm; |
| 292 | }, | 306 | }, | ... | ... |
| ... | @@ -71,20 +71,18 @@ | ... | @@ -71,20 +71,18 @@ |
| 71 | <el-button type="primary" v-if="val.status === '3'" size="mini" | 71 | <el-button type="primary" v-if="val.status === '3'" size="mini" |
| 72 | icon="el-icon-video-pause" @click="changeStatus(idx)"> | 72 | icon="el-icon-video-pause" @click="changeStatus(idx)"> |
| 73 | 启 用</el-button> | 73 | 启 用</el-button> |
| 74 | - <el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete" | 74 | + <el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete" @click="del(idx)"> |
| 75 | - @click="del(idx)">删 | 75 | + 删 除</el-button> |
| 76 | - 除 | ||
| 77 | - </el-button> | ||
| 78 | <div v-if="(routeSatus.indexOf('flightInformationMaintenance') >= 0)" | 76 | <div v-if="(routeSatus.indexOf('flightInformationMaintenance') >= 0)" |
| 79 | style="display: inline-block;"> | 77 | style="display: inline-block;"> |
| 80 | <span v-if="val.id">日期级别规则</span><span v-else>普通规则</span> | 78 | <span v-if="val.id">日期级别规则</span><span v-else>普通规则</span> |
| 81 | </div> | 79 | </div> |
| 82 | <div v-else-if="(routeSatus.indexOf('FlightAllocConfig') >= 0)" | 80 | <div v-else-if="(routeSatus.indexOf('FlightAllocConfig') >= 0)" |
| 83 | - style="display: inline-block;"> | 81 | + style="display: inline-block;"> |
| 84 | - <span | 82 | + <span |
| 85 | - v-if="infoForm.fltDate != null && infoForm.fltDate != '' && infoForm.fltDate != ' '">日期级别规则</span><span | 83 | + v-if="infoForm.fltDate != null && infoForm.fltDate != '' && infoForm.fltDate != ' '">日期级别规则</span><span |
| 86 | - v-else>普通规则</span> | 84 | + v-else>普通规则</span> |
| 87 | - </div> | 85 | + </div> |
| 88 | <el-divider></el-divider> | 86 | <el-divider></el-divider> |
| 89 | <el-col :span="24"> | 87 | <el-col :span="24"> |
| 90 | <el-form-item label="始发站"> | 88 | <el-form-item label="始发站"> |
| ... | @@ -216,7 +214,7 @@ | ... | @@ -216,7 +214,7 @@ |
| 216 | <el-col v-for="item in checkBoxItem.cargoStatus" :span="3" | 214 | <el-col v-for="item in checkBoxItem.cargoStatus" :span="3" |
| 217 | :key="item.id"> | 215 | :key="item.id"> |
| 218 | <el-checkbox v-if="item.status === 1" :label="item.chineseName" | 216 | <el-checkbox v-if="item.status === 1" :label="item.chineseName" |
| 219 | - :name="item.chineseName" :key="item.code"> | 217 | + :name="item.chineseName" :key="item.code" disabled> |
| 220 | <Tooltips :content="item.chineseName" :refName="item.code"> | 218 | <Tooltips :content="item.chineseName" :refName="item.code"> |
| 221 | </Tooltips> | 219 | </Tooltips> |
| 222 | </el-checkbox> | 220 | </el-checkbox> |
| ... | @@ -326,15 +324,13 @@ | ... | @@ -326,15 +324,13 @@ |
| 326 | <el-button type="primary" v-if="val.status === '3'" size="mini" icon="el-icon-video-pause" | 324 | <el-button type="primary" v-if="val.status === '3'" size="mini" icon="el-icon-video-pause" |
| 327 | @click="changeStatus(idx)"> | 325 | @click="changeStatus(idx)"> |
| 328 | 启 用</el-button> | 326 | 启 用</el-button> |
| 329 | - <el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete" style="margin-right:10px" | 327 | + <el-button v-if="val.id" type="danger" size="mini" icon="el-icon-delete" style="margin-right:10px" @click="del(idx)"> |
| 330 | - @click="del(idx)">删 除 | 328 | + 删 除</el-button> |
| 331 | - </el-button> | ||
| 332 | <div v-if="routeSatus.indexOf('flightInformationMaintenance') >= 0" style="display: inline-block;"> | 329 | <div v-if="routeSatus.indexOf('flightInformationMaintenance') >= 0" style="display: inline-block;"> |
| 333 | <span v-if="val.id">日期级别规则</span><span v-else>普通规则</span> | 330 | <span v-if="val.id">日期级别规则</span><span v-else>普通规则</span> |
| 334 | </div> | 331 | </div> |
| 335 | <div v-else-if="(routeSatus.indexOf('FlightAllocConfig') >= 0)" style="display: inline-block;"> | 332 | <div v-else-if="(routeSatus.indexOf('FlightAllocConfig') >= 0)" style="display: inline-block;"> |
| 336 | - <span | 333 | + <span v-if="infoForm.fltDate != null && infoForm.fltDate != '' && infoForm.fltDate != ' '">日期级别规则</span><span |
| 337 | - v-if="infoForm.fltDate != null && infoForm.fltDate != '' && infoForm.fltDate != ' '">日期级别规则</span><span | ||
| 338 | v-else>普通规则</span> | 334 | v-else>普通规则</span> |
| 339 | </div> | 335 | </div> |
| 340 | <el-divider></el-divider> | 336 | <el-divider></el-divider> | ... | ... |
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 | + /> | ||
| 12 | + </el-col> | ||
| 13 | + </el-row> | ||
| 14 | + <yl-table | ||
| 15 | + ref="ylTable" | ||
| 16 | + :attrs="tableAttr" | ||
| 17 | + :loadingTable="tableAttr.loadingTable" | ||
| 18 | + :columns="columns" | ||
| 19 | + :tableData="tableData" | ||
| 20 | + :pageConfig="pageConfig" | ||
| 21 | + @search="searchBtn" | ||
| 22 | + @download="downloadTemplate" | ||
| 23 | + @upload="toUpload" | ||
| 24 | + @export="exportTemplate" | ||
| 25 | + @delete="deleteData" | ||
| 26 | + @sizeChange="handleSizeChange" | ||
| 27 | + @currentChange="handleCurrentChange" | ||
| 28 | + @selectionEvent="tableSelectionChange" | ||
| 29 | + > | ||
| 30 | + </yl-table> | ||
| 31 | + </div> | ||
| 32 | +</template> | ||
| 33 | +<script> | ||
| 34 | +import YlForm from "@/components/YlForm"; | ||
| 35 | +import YlTable from "@/components/YlTable"; | ||
| 36 | +import { formConfig } from "./formConfig"; | ||
| 37 | +import { tableAttr, columnHeader } from "./tableConfig"; | ||
| 38 | +import { restTableHeight } from "@/utils"; | ||
| 39 | +import { | ||
| 40 | + findHsCodeList, // ShipmentDesc查询 | ||
| 41 | + delBlackList, // ShipmentDesc删除 | ||
| 42 | + downLoadTemplate, // ShipmentDesc下载模板 | ||
| 43 | + uploadHsCode, // ShipmentDesc导入 | ||
| 44 | +} from "@/api/et86HsCodeBlack"; | ||
| 45 | +import { downLoadXlsx } from "@/utils/zipdownload"; | ||
| 46 | +export default { | ||
| 47 | + name: "Et86HsCodeBlack", | ||
| 48 | + components: { | ||
| 49 | + YlForm, | ||
| 50 | + YlTable, | ||
| 51 | + }, | ||
| 52 | + data() { | ||
| 53 | + return { | ||
| 54 | + formConfig: formConfig, // 表单配置项 | ||
| 55 | + queryForm: { | ||
| 56 | + searchValue: "", | ||
| 57 | + }, // 表单参数 | ||
| 58 | + pageConfig: { | ||
| 59 | + // 分页配置项 | ||
| 60 | + isPagination: true, | ||
| 61 | + total: 0, | ||
| 62 | + pageData: { | ||
| 63 | + page: 1, | ||
| 64 | + size: 10, | ||
| 65 | + }, | ||
| 66 | + }, | ||
| 67 | + tableAttr: tableAttr, // table配置项 | ||
| 68 | + columns: columnHeader(this.indexAdd, this.deleteRow), // 表头 | ||
| 69 | + tableData: [], // 表格数据 | ||
| 70 | + multipleSelection: [], | ||
| 71 | + }; | ||
| 72 | + }, | ||
| 73 | + created() { | ||
| 74 | + // 黑名单查询 | ||
| 75 | + this.$nextTick(() => { | ||
| 76 | + this.searchBtn(); | ||
| 77 | + }); | ||
| 78 | + }, | ||
| 79 | + mounted() { | ||
| 80 | + this.$nextTick(() => { | ||
| 81 | + this.tableAttr.maxHeight = | ||
| 82 | + window.innerHeight - restTableHeight(this.$refs); | ||
| 83 | + }); | ||
| 84 | + }, | ||
| 85 | + methods: { | ||
| 86 | + // HScode黑名单查询 | ||
| 87 | + queryFindHsCodeList() { | ||
| 88 | + const { page, size } = this.pageConfig.pageData; | ||
| 89 | + let params = { | ||
| 90 | + limitStart: (page - 1) * size, | ||
| 91 | + limitSize: size, | ||
| 92 | + ...this.queryForm, | ||
| 93 | + }; | ||
| 94 | + this.tableAttr.loadingTable = true; | ||
| 95 | + findHsCodeList(params) | ||
| 96 | + .then((res) => { | ||
| 97 | + this.tableAttr.loadingTable = false; | ||
| 98 | + const { code, data } = res; | ||
| 99 | + if (code == 200) { | ||
| 100 | + this.tableData = data.list; | ||
| 101 | + this.pageConfig.total = data.total; | ||
| 102 | + } | ||
| 103 | + }) | ||
| 104 | + .catch(() => {}); | ||
| 105 | + }, | ||
| 106 | + // 删除黑名单 | ||
| 107 | + toDelBlackList(params) { | ||
| 108 | + delBlackList(params) | ||
| 109 | + .then((res) => { | ||
| 110 | + const { code, msg } = res; | ||
| 111 | + if (code == 200) { | ||
| 112 | + this.searchBtn(); | ||
| 113 | + this.msgSuccess(msg || "删除成功!"); | ||
| 114 | + } else { | ||
| 115 | + this.$message.error(msg || "删除失败"); | ||
| 116 | + } | ||
| 117 | + }) | ||
| 118 | + .catch(() => {}); | ||
| 119 | + }, | ||
| 120 | + // 选择上传【HScode黑名单导入】 | ||
| 121 | + toUpload({ file }) { | ||
| 122 | + const formData = new FormData(); | ||
| 123 | + formData.append("file", file); | ||
| 124 | + uploadHsCode(formData) | ||
| 125 | + .then((res) => { | ||
| 126 | + const { code, data, msg } = res; | ||
| 127 | + if (code == 200) { | ||
| 128 | + this.searchBtn(); | ||
| 129 | + this.msgSuccess(msg || "导入成功!"); | ||
| 130 | + } else { | ||
| 131 | + this.$message.error(msg || "导入失败"); | ||
| 132 | + this.$router.push({ | ||
| 133 | + path: "/errorInfo", | ||
| 134 | + query: { | ||
| 135 | + name: "errorInfo", | ||
| 136 | + error: code, | ||
| 137 | + data: JSON.stringify(data), | ||
| 138 | + }, | ||
| 139 | + }); | ||
| 140 | + } | ||
| 141 | + }) | ||
| 142 | + .catch(() => {}); | ||
| 143 | + }, | ||
| 144 | + // 下载【HScode黑名单下载模板】 | ||
| 145 | + downloadTemplate() { | ||
| 146 | + downLoadTemplate("hsCode") | ||
| 147 | + .then((res) => { | ||
| 148 | + if (res) { | ||
| 149 | + const blob = new Blob([res]); | ||
| 150 | + const link = document.createElement("a"); //创建a标签 | ||
| 151 | + link.download = "HSCODE黑名单表.xlsx"; //a标签添加属性 | ||
| 152 | + link.style.display = "none"; | ||
| 153 | + link.href = URL.createObjectURL(blob); | ||
| 154 | + document.body.appendChild(link); | ||
| 155 | + link.click(); //执行下载 | ||
| 156 | + URL.revokeObjectURL(link.href); //释放url | ||
| 157 | + document.body.removeChild(link); //释放标签 | ||
| 158 | + } else { | ||
| 159 | + this.$message.error("下载失败"); | ||
| 160 | + } | ||
| 161 | + }) | ||
| 162 | + .catch(() => {}); | ||
| 163 | + }, | ||
| 164 | + // 导出 | ||
| 165 | + exportTemplate(row, i) { | ||
| 166 | + this.tableAttr.btnCofig.btnGroup[i].loading = true; | ||
| 167 | + downLoadXlsx("/etes/exportHsCodeList", this.queryForm, "HSCODE黑名单表") | ||
| 168 | + .then(() => { | ||
| 169 | + this.tableAttr.btnCofig.btnGroup[i].loading = false; | ||
| 170 | + }) | ||
| 171 | + .catch(() => { | ||
| 172 | + this.$message.error("导出失败"); | ||
| 173 | + }); | ||
| 174 | + }, | ||
| 175 | + // 删除 | ||
| 176 | + deleteData(row) { | ||
| 177 | + if (this.multipleSelection.length) { | ||
| 178 | + let params = []; | ||
| 179 | + this.multipleSelection.map((item) => { | ||
| 180 | + params.push(item.id); | ||
| 181 | + }); | ||
| 182 | + this.$confirm("是否确认删除?", "提示", { | ||
| 183 | + confirmButtonText: "确定", | ||
| 184 | + cancelButtonText: "取消", | ||
| 185 | + type: "warning", | ||
| 186 | + center: true, | ||
| 187 | + }) | ||
| 188 | + .then(() => { | ||
| 189 | + this.toDelBlackList(params); | ||
| 190 | + }) | ||
| 191 | + .catch(() => {}); | ||
| 192 | + } else { | ||
| 193 | + this.$message.error("请勾选一条或者多条数据再操作!"); | ||
| 194 | + } | ||
| 195 | + }, | ||
| 196 | + // 搜索 | ||
| 197 | + searchBtn() { | ||
| 198 | + this.pageConfig.pageData.page = 1; | ||
| 199 | + this.pageConfig.pageData.size = 10; | ||
| 200 | + this.$refs.ruleForm.handleSearch("ruleForm", (val) => { | ||
| 201 | + this.queryFindHsCodeList(); | ||
| 202 | + }); | ||
| 203 | + }, | ||
| 204 | + // 翻页序号递增 | ||
| 205 | + indexAdd(index){ | ||
| 206 | + const page = this.pageConfig.pageData.page // 当前页码 | ||
| 207 | + const pagesize = this.pageConfig.pageData.size // 每页条数 | ||
| 208 | + return index + 1 + (page - 1) * pagesize | ||
| 209 | + }, | ||
| 210 | + //条数变化 | ||
| 211 | + handleSizeChange(e) { | ||
| 212 | + this.pageConfig.pageData.size = e; | ||
| 213 | + this.pageConfig.pageData.page = 1; | ||
| 214 | + this.queryFindHsCodeList(); | ||
| 215 | + }, | ||
| 216 | + //页码变化 | ||
| 217 | + handleCurrentChange(e) { | ||
| 218 | + this.pageConfig.pageData.page = e; | ||
| 219 | + this.queryFindHsCodeList(); | ||
| 220 | + }, | ||
| 221 | + // table勾选 | ||
| 222 | + tableSelectionChange(val) { | ||
| 223 | + this.multipleSelection = val; | ||
| 224 | + }, | ||
| 225 | + // 删除 | ||
| 226 | + deleteRow({ row }) { | ||
| 227 | + this.$confirm("是否确认删除?", "提示", { | ||
| 228 | + confirmButtonText: "确定", | ||
| 229 | + cancelButtonText: "取消", | ||
| 230 | + type: "warning", | ||
| 231 | + center: true, | ||
| 232 | + }) | ||
| 233 | + .then(() => { | ||
| 234 | + this.toDelBlackList([row.id]); | ||
| 235 | + }) | ||
| 236 | + .catch(() => {}); | ||
| 237 | + }, | ||
| 238 | + }, | ||
| 239 | +}; | ||
| 240 | +</script> | ||
| 241 | +<style lang="scss" scoped></style> |
| 1 | +export const tableAttr = { | ||
| 2 | + border: true, | ||
| 3 | + loadingTable: false, | ||
| 4 | + isDragSort: false, // 拖拽tableData数据一定要加id字段 | ||
| 5 | + maxHeight: 0, | ||
| 6 | + btnCofig: { | ||
| 7 | + isBtn: true, | ||
| 8 | + btnGroup: [ | ||
| 9 | + { | ||
| 10 | + type: "primary", // text、primary、danger | ||
| 11 | + icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right | ||
| 12 | + btnName: "搜索", | ||
| 13 | + size: "mini", // medium / small / mini | ||
| 14 | + round: false, | ||
| 15 | + loading: false, | ||
| 16 | + event: "search", | ||
| 17 | + }, | ||
| 18 | + { | ||
| 19 | + type: "primary", | ||
| 20 | + icon: "el-icon-download", | ||
| 21 | + btnName: "下载模板", | ||
| 22 | + size: "mini", | ||
| 23 | + round: false, | ||
| 24 | + loading: false, | ||
| 25 | + event: "download", | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + type: "primary", | ||
| 29 | + icon: "el-icon-upload", | ||
| 30 | + btnName: "导入", | ||
| 31 | + size: "mini", | ||
| 32 | + round: false, | ||
| 33 | + loading: false, | ||
| 34 | + event: "upLoad", | ||
| 35 | + action: "/goods/uploadGoodsExcel", | ||
| 36 | + fileName: "name", | ||
| 37 | + limit: 1, | ||
| 38 | + accept: ".xlsx", | ||
| 39 | + }, | ||
| 40 | + { | ||
| 41 | + type: "primary", | ||
| 42 | + icon: "el-icon-download", | ||
| 43 | + btnName: "导出", | ||
| 44 | + size: "mini", | ||
| 45 | + round: false, | ||
| 46 | + loading: false, | ||
| 47 | + event: "export", | ||
| 48 | + }, | ||
| 49 | + { | ||
| 50 | + type: "danger", | ||
| 51 | + icon: "el-icon-delete", | ||
| 52 | + btnName: "删除", | ||
| 53 | + size: "mini", | ||
| 54 | + round: false, | ||
| 55 | + loading: false, | ||
| 56 | + event: "delete", | ||
| 57 | + }, | ||
| 58 | + ], | ||
| 59 | + }, | ||
| 60 | +}; | ||
| 61 | +export const columnHeader = (indexAdd, deleteRow) => [ | ||
| 62 | + { | ||
| 63 | + type: "selection", | ||
| 64 | + align: "center", | ||
| 65 | + prop: "selection", | ||
| 66 | + width: "50", | ||
| 67 | + }, | ||
| 68 | + { | ||
| 69 | + type: "index", | ||
| 70 | + label: "序号", | ||
| 71 | + prop: "id", | ||
| 72 | + align: "center", | ||
| 73 | + width: "50", | ||
| 74 | + index: indexAdd, | ||
| 75 | + }, | ||
| 76 | + { | ||
| 77 | + label: "HSCODE", | ||
| 78 | + prop: "blackValue", | ||
| 79 | + align: "center", | ||
| 80 | + minWidth: 100, | ||
| 81 | + }, | ||
| 82 | + { | ||
| 83 | + label: "创建时间", | ||
| 84 | + prop: "createTime", | ||
| 85 | + align: "center", | ||
| 86 | + minWidth: 100, | ||
| 87 | + }, | ||
| 88 | + { | ||
| 89 | + label: "创建人", | ||
| 90 | + prop: "createUserName", | ||
| 91 | + align: "center", | ||
| 92 | + minWidth: 100, | ||
| 93 | + }, | ||
| 94 | + { | ||
| 95 | + label: "文件名", | ||
| 96 | + prop: "uploadFileName", | ||
| 97 | + align: "center", | ||
| 98 | + minWidth: 100, | ||
| 99 | + }, | ||
| 100 | + | ||
| 101 | + { | ||
| 102 | + label: "操作", | ||
| 103 | + prop: "operate", | ||
| 104 | + align: "center", | ||
| 105 | + minWidth: 120, | ||
| 106 | + fixed: "right", | ||
| 107 | + render: (h, params) => { | ||
| 108 | + return h("div", [ | ||
| 109 | + h( | ||
| 110 | + "el-button", | ||
| 111 | + { | ||
| 112 | + style: { | ||
| 113 | + color: "#ff4949", | ||
| 114 | + }, | ||
| 115 | + props: { | ||
| 116 | + type: "text", | ||
| 117 | + size: "mini", | ||
| 118 | + icon: "el-icon-delete", | ||
| 119 | + }, | ||
| 120 | + on: { | ||
| 121 | + click() { | ||
| 122 | + deleteRow(params); | ||
| 123 | + }, | ||
| 124 | + }, | ||
| 125 | + }, | ||
| 126 | + "删除" | ||
| 127 | + ), | ||
| 128 | + ]); | ||
| 129 | + }, | ||
| 130 | + }, | ||
| 131 | +]; |
| 1 | +<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 | + /> | ||
| 12 | + </el-col> | ||
| 13 | + </el-row> | ||
| 14 | + <yl-table | ||
| 15 | + ref="ylTable" | ||
| 16 | + :attrs="tableAttr" | ||
| 17 | + :loadingTable="tableAttr.loadingTable" | ||
| 18 | + :columns="columns" | ||
| 19 | + :tableData="tableData" | ||
| 20 | + :pageConfig="pageConfig" | ||
| 21 | + @search="searchBtn" | ||
| 22 | + @upload="toUpload" | ||
| 23 | + @export="exportTemplate" | ||
| 24 | + @delete="deleteData" | ||
| 25 | + @sizeChange="handleSizeChange" | ||
| 26 | + @currentChange="handleCurrentChange" | ||
| 27 | + @selectionEvent="tableSelectionChange" | ||
| 28 | + > | ||
| 29 | + </yl-table> | ||
| 30 | + </div> | ||
| 31 | +</template> | ||
| 32 | +<script> | ||
| 33 | +import YlForm from "@/components/YlForm"; | ||
| 34 | +import YlTable from "@/components/YlTable"; | ||
| 35 | +import { formConfig } from "./formConfig"; | ||
| 36 | +import { tableAttr, columnHeader } from "./tableConfig"; | ||
| 37 | +import { restTableHeight } from "@/utils"; | ||
| 38 | +import { | ||
| 39 | + findShipmentDescList, // HScode英文品名黑名单查询 | ||
| 40 | + uploadShipmentDesc, // HScode英文品名黑名单导入 | ||
| 41 | + delBlackList, // HScode黑名单/英文品名删除 | ||
| 42 | +} from "@/api/et86ShipmentDesc"; | ||
| 43 | +import { downLoadXlsx } from "@/utils/zipdownload"; | ||
| 44 | +export default { | ||
| 45 | + name: "et86ShipmentDesc", | ||
| 46 | + components: { | ||
| 47 | + YlForm, | ||
| 48 | + YlTable, | ||
| 49 | + }, | ||
| 50 | + data() { | ||
| 51 | + return { | ||
| 52 | + formConfig: formConfig, // 表单配置项 | ||
| 53 | + queryForm: { | ||
| 54 | + searchValue: "", | ||
| 55 | + }, // 表单参数 | ||
| 56 | + pageConfig: { | ||
| 57 | + // 分页配置项 | ||
| 58 | + isPagination: true, | ||
| 59 | + total: 0, | ||
| 60 | + pageData: { | ||
| 61 | + page: 1, | ||
| 62 | + size: 10, | ||
| 63 | + }, | ||
| 64 | + }, | ||
| 65 | + tableAttr: tableAttr, // table配置项 | ||
| 66 | + columns: columnHeader(this.indexAdd, this.deleteRow), // 表头 | ||
| 67 | + tableData: [], // 表格数据 | ||
| 68 | + multipleSelection: [], | ||
| 69 | + }; | ||
| 70 | + }, | ||
| 71 | + created() { | ||
| 72 | + // 黑名单查询 | ||
| 73 | + this.$nextTick(() => { | ||
| 74 | + this.searchBtn(); | ||
| 75 | + }); | ||
| 76 | + }, | ||
| 77 | + mounted() { | ||
| 78 | + this.$nextTick(() => { | ||
| 79 | + this.tableAttr.maxHeight = | ||
| 80 | + window.innerHeight - restTableHeight(this.$refs); | ||
| 81 | + }); | ||
| 82 | + }, | ||
| 83 | + methods: { | ||
| 84 | + // HScode黑名单查询 | ||
| 85 | + queryFindShipmentDescList() { | ||
| 86 | + const { page, size } = this.pageConfig.pageData; | ||
| 87 | + let params = { | ||
| 88 | + limitStart: (page - 1) * size, | ||
| 89 | + limitSize: size, | ||
| 90 | + ...this.queryForm, | ||
| 91 | + }; | ||
| 92 | + this.tableAttr.loadingTable = true; | ||
| 93 | + findShipmentDescList(params) | ||
| 94 | + .then((res) => { | ||
| 95 | + this.tableAttr.loadingTable = false; | ||
| 96 | + const { code, data } = res; | ||
| 97 | + if (code == 200) { | ||
| 98 | + this.tableData = data.list; | ||
| 99 | + this.pageConfig.total = data.total; | ||
| 100 | + } | ||
| 101 | + }) | ||
| 102 | + .catch(() => {}); | ||
| 103 | + }, | ||
| 104 | + // 删除黑名单 | ||
| 105 | + toDelBlackList(params) { | ||
| 106 | + delBlackList(params) | ||
| 107 | + .then((res) => { | ||
| 108 | + const { code, msg } = res; | ||
| 109 | + if (code == 200) { | ||
| 110 | + this.searchBtn(); | ||
| 111 | + this.msgSuccess(msg || "删除成功!"); | ||
| 112 | + } else { | ||
| 113 | + this.$message.error(msg || "删除失败"); | ||
| 114 | + } | ||
| 115 | + }) | ||
| 116 | + .catch(() => {}); | ||
| 117 | + }, | ||
| 118 | + // 选择上传【HScode黑名单导入】 | ||
| 119 | + toUpload({ file }) { | ||
| 120 | + const formData = new FormData(); | ||
| 121 | + formData.append("file", file); | ||
| 122 | + uploadShipmentDesc(formData) | ||
| 123 | + .then((res) => { | ||
| 124 | + const { code, data, msg } = res; | ||
| 125 | + if (code == 200) { | ||
| 126 | + this.searchBtn(); | ||
| 127 | + this.msgSuccess(msg || "导入成功!"); | ||
| 128 | + } else { | ||
| 129 | + this.$message.error(msg || "导入失败"); | ||
| 130 | + this.$router.push({ | ||
| 131 | + path: "/errorInfo", | ||
| 132 | + query: { | ||
| 133 | + name: "errorInfo", | ||
| 134 | + error: code, | ||
| 135 | + data: JSON.stringify(data), | ||
| 136 | + }, | ||
| 137 | + }); | ||
| 138 | + } | ||
| 139 | + }) | ||
| 140 | + .catch(() => {}); | ||
| 141 | + }, | ||
| 142 | + // 导出 | ||
| 143 | + exportTemplate(row, i) { | ||
| 144 | + this.tableAttr.btnCofig.btnGroup[i].loading = true; | ||
| 145 | + downLoadXlsx( | ||
| 146 | + "/etes/exportShipmentDescList", | ||
| 147 | + this.queryForm, | ||
| 148 | + "HSCODE英文品名黑名单表" | ||
| 149 | + ) | ||
| 150 | + .then(() => { | ||
| 151 | + this.tableAttr.btnCofig.btnGroup[i].loading = false; | ||
| 152 | + }) | ||
| 153 | + .catch(() => { | ||
| 154 | + this.$message.error("导出失败"); | ||
| 155 | + }); | ||
| 156 | + }, | ||
| 157 | + // 删除 | ||
| 158 | + deleteData(row) { | ||
| 159 | + if (this.multipleSelection.length) { | ||
| 160 | + let params = []; | ||
| 161 | + this.multipleSelection.map((item) => { | ||
| 162 | + params.push(item.id); | ||
| 163 | + }); | ||
| 164 | + this.$confirm("是否确认删除?", "提示", { | ||
| 165 | + confirmButtonText: "确定", | ||
| 166 | + cancelButtonText: "取消", | ||
| 167 | + type: "warning", | ||
| 168 | + center: true, | ||
| 169 | + }) | ||
| 170 | + .then(() => { | ||
| 171 | + this.toDelBlackList(params); | ||
| 172 | + }) | ||
| 173 | + .catch(() => {}); | ||
| 174 | + } else { | ||
| 175 | + this.$message.error("请勾选一条或者多条数据再操作!"); | ||
| 176 | + } | ||
| 177 | + }, | ||
| 178 | + // 搜索 | ||
| 179 | + searchBtn() { | ||
| 180 | + this.pageConfig.pageData.page = 1; | ||
| 181 | + this.pageConfig.pageData.size = 10; | ||
| 182 | + this.$refs.ruleForm.handleSearch("ruleForm", (val) => { | ||
| 183 | + this.queryFindShipmentDescList(); | ||
| 184 | + }); | ||
| 185 | + }, | ||
| 186 | + // 翻页序号递增 | ||
| 187 | + indexAdd(index){ | ||
| 188 | + const page = this.pageConfig.pageData.page // 当前页码 | ||
| 189 | + const pagesize = this.pageConfig.pageData.size // 每页条数 | ||
| 190 | + return index + 1 + (page - 1) * pagesize | ||
| 191 | + }, | ||
| 192 | + //条数变化 | ||
| 193 | + handleSizeChange(e) { | ||
| 194 | + this.pageConfig.pageData.size = e; | ||
| 195 | + this.pageConfig.pageData.page = 1; | ||
| 196 | + this.queryFindShipmentDescList(); | ||
| 197 | + }, | ||
| 198 | + //页码变化 | ||
| 199 | + handleCurrentChange(e) { | ||
| 200 | + this.pageConfig.pageData.page = e; | ||
| 201 | + this.queryFindShipmentDescList(); | ||
| 202 | + }, | ||
| 203 | + // table勾选 | ||
| 204 | + tableSelectionChange(val) { | ||
| 205 | + this.multipleSelection = val; | ||
| 206 | + }, | ||
| 207 | + // 删除 | ||
| 208 | + deleteRow({ row }) { | ||
| 209 | + this.$confirm("是否确认删除?", "提示", { | ||
| 210 | + confirmButtonText: "确定", | ||
| 211 | + cancelButtonText: "取消", | ||
| 212 | + type: "warning", | ||
| 213 | + center: true, | ||
| 214 | + }) | ||
| 215 | + .then(() => { | ||
| 216 | + this.toDelBlackList([row.id]); | ||
| 217 | + }) | ||
| 218 | + .catch(() => {}); | ||
| 219 | + }, | ||
| 220 | + }, | ||
| 221 | +}; | ||
| 222 | +</script> | ||
| 223 | +<style lang="scss" scoped></style> |
| 1 | +export const tableAttr = { | ||
| 2 | + border: true, | ||
| 3 | + loadingTable: false, | ||
| 4 | + isDragSort: false, // 拖拽tableData数据一定要加id字段 | ||
| 5 | + maxHeight: 300, | ||
| 6 | + btnCofig: { | ||
| 7 | + isBtn: true, | ||
| 8 | + btnGroup: [ | ||
| 9 | + { | ||
| 10 | + type: "primary", // text、primary、danger | ||
| 11 | + icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right | ||
| 12 | + btnName: "搜索", | ||
| 13 | + size: "mini", // medium / small / mini | ||
| 14 | + round: false, | ||
| 15 | + loading: false, | ||
| 16 | + event: "search", | ||
| 17 | + }, | ||
| 18 | + { | ||
| 19 | + type: "primary", | ||
| 20 | + icon: "el-icon-upload", | ||
| 21 | + btnName: "导入", | ||
| 22 | + size: "mini", | ||
| 23 | + round: false, | ||
| 24 | + loading: false, | ||
| 25 | + event: "upLoad", | ||
| 26 | + action: "/goods/uploadGoodsExcel", | ||
| 27 | + fileName: "name", | ||
| 28 | + limit: 1, | ||
| 29 | + accept: ".xlsx", | ||
| 30 | + }, | ||
| 31 | + { | ||
| 32 | + type: "primary", | ||
| 33 | + icon: "el-icon-download", | ||
| 34 | + btnName: "导出", | ||
| 35 | + size: "mini", | ||
| 36 | + round: false, | ||
| 37 | + loading: false, | ||
| 38 | + event: "export", | ||
| 39 | + }, | ||
| 40 | + { | ||
| 41 | + type: "danger", | ||
| 42 | + icon: "el-icon-delete", | ||
| 43 | + btnName: "删除", | ||
| 44 | + size: "mini", | ||
| 45 | + round: false, | ||
| 46 | + loading: false, | ||
| 47 | + event: "delete", | ||
| 48 | + }, | ||
| 49 | + ], | ||
| 50 | + }, | ||
| 51 | +}; | ||
| 52 | +export const columnHeader = (indexAdd, deleteRow) => [ | ||
| 53 | + { | ||
| 54 | + type: "selection", | ||
| 55 | + align: "center", | ||
| 56 | + prop: "selection", | ||
| 57 | + width: "50", | ||
| 58 | + }, | ||
| 59 | + { | ||
| 60 | + type: "index", | ||
| 61 | + label: "序号", | ||
| 62 | + prop: "id", | ||
| 63 | + align: "center", | ||
| 64 | + width: "50", | ||
| 65 | + index: indexAdd, | ||
| 66 | + }, | ||
| 67 | + { | ||
| 68 | + label: "ShipmentDesc", | ||
| 69 | + prop: "blackValue", | ||
| 70 | + align: "center", | ||
| 71 | + minWidth: 100, | ||
| 72 | + }, | ||
| 73 | + { | ||
| 74 | + label: "创建时间", | ||
| 75 | + prop: "createTime", | ||
| 76 | + align: "center", | ||
| 77 | + minWidth: 100, | ||
| 78 | + }, | ||
| 79 | + { | ||
| 80 | + label: "创建人", | ||
| 81 | + prop: "createUserName", | ||
| 82 | + align: "center", | ||
| 83 | + minWidth: 100, | ||
| 84 | + }, | ||
| 85 | + { | ||
| 86 | + label: "文件名", | ||
| 87 | + prop: "uploadFileName", | ||
| 88 | + align: "center", | ||
| 89 | + minWidth: 100, | ||
| 90 | + }, | ||
| 91 | + | ||
| 92 | + { | ||
| 93 | + label: "操作", | ||
| 94 | + prop: "operate", | ||
| 95 | + align: "center", | ||
| 96 | + minWidth: 120, | ||
| 97 | + fixed: "right", | ||
| 98 | + render: (h, params) => { | ||
| 99 | + return h("div", [ | ||
| 100 | + h( | ||
| 101 | + "el-button", | ||
| 102 | + { | ||
| 103 | + style: { | ||
| 104 | + color: "#ff4949", | ||
| 105 | + }, | ||
| 106 | + props: { | ||
| 107 | + type: "text", | ||
| 108 | + size: "mini", | ||
| 109 | + icon: "el-icon-delete", | ||
| 110 | + }, | ||
| 111 | + on: { | ||
| 112 | + click() { | ||
| 113 | + deleteRow(params); | ||
| 114 | + }, | ||
| 115 | + }, | ||
| 116 | + }, | ||
| 117 | + "删除" | ||
| 118 | + ), | ||
| 119 | + ]); | ||
| 120 | + }, | ||
| 121 | + }, | ||
| 122 | +]; |
-
Please register or login to post a comment