Elements-SY

modify

1 +import request from "@/utils/request";
2 +
3 +// HScode黑名单查询
4 +export function findHsCodeList(data) {
5 + return request({
6 + url: "/etes/findHsCodeList",
7 + method: "post",
8 + data: data,
9 + });
10 +}
11 +
12 +// HScode黑名单删除
13 +export function delBlackList(data) {
14 + return request({
15 + url: "/etes/delBlackList",
16 + method: "post",
17 + data: data,
18 + });
19 +}
20 +
21 +// HScode黑名单下载模板
22 +export function downLoadTemplate(template) {
23 + return request({
24 + url: "/etes/downLoadTemplate?template=" + template,
25 + method: "get",
26 + responseType: "blob",
27 + });
28 +}
29 +
30 +// HScode黑名单导入
31 +export function uploadHsCode(data) {
32 + return request({
33 + url: "/etes/uploadHsCode",
34 + method: "post",
35 + data: data,
36 + });
37 +}
38 +
1 +import request from "@/utils/request";
2 +
3 +// HScode英文品名黑名单查询
4 +export function findShipmentDescList(data) {
5 + return request({
6 + url: "/etes/findShipmentDescList",
7 + method: "post",
8 + data: data,
9 + });
10 +}
11 +
12 +// HScode英文品名黑名单导入
13 +export function uploadShipmentDesc(data) {
14 + return request({
15 + url: "/etes/uploadShipmentDesc",
16 + method: "post",
17 + data: data,
18 + });
19 +}
20 +
21 +// HScode黑名单/英文品名删除
22 +export function delBlackList(data) {
23 + return request({
24 + url: "/etes/delBlackList ",
25 + method: "post",
26 + data: data,
27 + });
28 +}
29 +
30 +
...@@ -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),
......
1 +<template>
2 + <div class="form-header container">
3 + <yl-table
4 + :attrs="tableAttr"
5 + :loadingTable="tableAttr.loadingTable"
6 + :columns="columns"
7 + :tableData="tableData"
8 + :pageConfig="pageConfig"
9 + @sizeChange="handleSizeChange"
10 + @currentChange="handleCurrentChange"
11 + >
12 + </yl-table>
13 + </div>
14 +</template>
15 +
16 +<script>
17 +import YlTable from "@/components/YlTable";
18 +import { tableAttr, columnHeader } from "./tableConfig";
19 +export default {
20 + name: "ErrorInfo",
21 + components: {
22 + YlTable,
23 + },
24 + data() {
25 + return {
26 + pageConfig: {
27 + // 分页配置项
28 + isPagination: false,
29 + total: 0,
30 + pageData: {
31 + page: 1,
32 + size: 10,
33 + },
34 + },
35 + tableAttr: tableAttr, // table配置项
36 + columns: columnHeader(), // 表头
37 + tableData: [], // 表格数据
38 + };
39 + },
40 + created() {
41 + const { data } = this.$route.query;
42 + this.tableData = JSON.parse(data);
43 + },
44 + methods: {
45 + //条数变化
46 + handleSizeChange(e) {
47 + this.pageConfig.pageData.size = e;
48 + this.pageConfig.pageData.page = 1;
49 + this.searchBtn();
50 + },
51 + //页码变化
52 + handleCurrentChange(e) {
53 + this.pageConfig.pageData.page = e;
54 + this.searchBtn();
55 + },
56 + // 搜索
57 + searchBtn() {},
58 + },
59 +};
60 +</script>
61 +<style lang="scss" scoped></style>
1 +export const tableAttr = {
2 + border: true,
3 + loadingTable: false,
4 + isDragSort: false, // 拖拽tableData数据一定要加id字段
5 + maxHeight: 300,
6 + btnCofig: {
7 + isBtn: false,
8 + btnGroup: [],
9 + },
10 +};
11 +export const columnHeader = () => [
12 + {
13 + type: "index",
14 + label: "序号",
15 + prop: "rowNum",
16 + align: "center",
17 + width: "70",
18 + },
19 + {
20 + label: "错误信息",
21 + prop: "msg",
22 + align: "center",
23 + minWidth: 150,
24 + },
25 +];
1 +<template>
2 + <div class="error-container">
3 + <el-dialog
4 + :width="width"
5 + :title="title"
6 + :center="center"
7 + :visible.sync="dialogVisible"
8 + :close-on-click-modal="onModalClickClose"
9 + @open="dialogOpenEvent"
10 + @close="dialogCloseEvent"
11 + >
12 + <slot></slot>
13 + <span slot="footer" class="dialog-footer">
14 + <el-button @click="cancel">取 消</el-button>
15 + <el-button type="primary" @click="confirm">{{
16 + confirmBtnName
17 + }}</el-button>
18 + </span>
19 + </el-dialog>
20 + </div>
21 +</template>
22 +
23 +<script>
24 +export default {
25 + props: {
26 + width: {
27 + type: String,
28 + default: "50%",
29 + },
30 + title: {
31 + type: String,
32 + default: "标题",
33 + },
34 + center: {
35 + type: String,
36 + default: "center",
37 + },
38 + confirmBtnName: {
39 + type: String,
40 + default: "确 定",
41 + },
42 + onModalClickClose: {
43 + type: Boolean,
44 + default: false,
45 + },
46 + },
47 + data() {
48 + return {
49 + dialogVisible: false,
50 + };
51 + },
52 + computed: {},
53 + created() {},
54 + mounted() {},
55 + methods: {
56 + dialogOpenEvent(data) {
57 + if (data && data.length) {
58 + console.log(data);
59 + }
60 + this.dialogVisible = true;
61 + this.$emit("open");
62 + },
63 + dialogCloseEvent() {
64 + this.dialogVisible = false;
65 + this.$emit("close");
66 + },
67 + // 确认事件
68 + confirm() {
69 + this.dialogVisible = false;
70 + this.$emit("confirm");
71 + },
72 + // 取消事件
73 + cancel() {
74 + this.dialogVisible = false;
75 + this.$emit("cancel");
76 + },
77 + },
78 +};
79 +</script>
80 +<style lang='scss' scoped>
81 +
82 +</style>
1 +export const formConfig = [
2 + {
3 + label: "HSCODE",
4 + type: "Input",
5 + name: "searchValue",
6 + prop: "searchValue",
7 + placeholder: "根据Hscode查询",
8 + span: 6,
9 + trigger: "blur", // 事件名
10 + },
11 +];
1 +<template>
2 + <div ref="formHeaderRef" class="form-header container">
3 + <el-row>
4 + <el-col>
5 + <yl-form
6 + ref="ruleForm"
7 + :formConfig="formConfig"
8 + :queryForm="queryForm"
9 + :inline="false"
10 + formWidth="auto"
11 + />
12 + </el-col>
13 + </el-row>
14 + <yl-table
15 + ref="ylTable"
16 + :attrs="tableAttr"
17 + :loadingTable="tableAttr.loadingTable"
18 + :columns="columns"
19 + :tableData="tableData"
20 + :pageConfig="pageConfig"
21 + @search="searchBtn"
22 + @download="downloadTemplate"
23 + @upload="toUpload"
24 + @export="exportTemplate"
25 + @delete="deleteData"
26 + @sizeChange="handleSizeChange"
27 + @currentChange="handleCurrentChange"
28 + @selectionEvent="tableSelectionChange"
29 + >
30 + </yl-table>
31 + </div>
32 +</template>
33 +<script>
34 +import YlForm from "@/components/YlForm";
35 +import YlTable from "@/components/YlTable";
36 +import { formConfig } from "./formConfig";
37 +import { tableAttr, columnHeader } from "./tableConfig";
38 +import { restTableHeight } from "@/utils";
39 +import {
40 + findHsCodeList, // ShipmentDesc查询
41 + delBlackList, // ShipmentDesc删除
42 + downLoadTemplate, // ShipmentDesc下载模板
43 + uploadHsCode, // ShipmentDesc导入
44 +} from "@/api/et86HsCodeBlack";
45 +import { downLoadXlsx } from "@/utils/zipdownload";
46 +export default {
47 + name: "Et86HsCodeBlack",
48 + components: {
49 + YlForm,
50 + YlTable,
51 + },
52 + data() {
53 + return {
54 + formConfig: formConfig, // 表单配置项
55 + queryForm: {
56 + searchValue: "",
57 + }, // 表单参数
58 + pageConfig: {
59 + // 分页配置项
60 + isPagination: true,
61 + total: 0,
62 + pageData: {
63 + page: 1,
64 + size: 10,
65 + },
66 + },
67 + tableAttr: tableAttr, // table配置项
68 + columns: columnHeader(this.indexAdd, this.deleteRow), // 表头
69 + tableData: [], // 表格数据
70 + multipleSelection: [],
71 + };
72 + },
73 + created() {
74 + // 黑名单查询
75 + this.$nextTick(() => {
76 + this.searchBtn();
77 + });
78 + },
79 + mounted() {
80 + this.$nextTick(() => {
81 + this.tableAttr.maxHeight =
82 + window.innerHeight - restTableHeight(this.$refs);
83 + });
84 + },
85 + methods: {
86 + // HScode黑名单查询
87 + queryFindHsCodeList() {
88 + const { page, size } = this.pageConfig.pageData;
89 + let params = {
90 + limitStart: (page - 1) * size,
91 + limitSize: size,
92 + ...this.queryForm,
93 + };
94 + this.tableAttr.loadingTable = true;
95 + findHsCodeList(params)
96 + .then((res) => {
97 + this.tableAttr.loadingTable = false;
98 + const { code, data } = res;
99 + if (code == 200) {
100 + this.tableData = data.list;
101 + this.pageConfig.total = data.total;
102 + }
103 + })
104 + .catch(() => {});
105 + },
106 + // 删除黑名单
107 + toDelBlackList(params) {
108 + delBlackList(params)
109 + .then((res) => {
110 + const { code, msg } = res;
111 + if (code == 200) {
112 + this.searchBtn();
113 + this.msgSuccess(msg || "删除成功!");
114 + } else {
115 + this.$message.error(msg || "删除失败");
116 + }
117 + })
118 + .catch(() => {});
119 + },
120 + // 选择上传【HScode黑名单导入】
121 + toUpload({ file }) {
122 + const formData = new FormData();
123 + formData.append("file", file);
124 + uploadHsCode(formData)
125 + .then((res) => {
126 + const { code, data, msg } = res;
127 + if (code == 200) {
128 + this.searchBtn();
129 + this.msgSuccess(msg || "导入成功!");
130 + } else {
131 + this.$message.error(msg || "导入失败");
132 + this.$router.push({
133 + path: "/errorInfo",
134 + query: {
135 + name: "errorInfo",
136 + error: code,
137 + data: JSON.stringify(data),
138 + },
139 + });
140 + }
141 + })
142 + .catch(() => {});
143 + },
144 + // 下载【HScode黑名单下载模板】
145 + downloadTemplate() {
146 + downLoadTemplate("hsCode")
147 + .then((res) => {
148 + if (res) {
149 + const blob = new Blob([res]);
150 + const link = document.createElement("a"); //创建a标签
151 + link.download = "HSCODE黑名单表.xlsx"; //a标签添加属性
152 + link.style.display = "none";
153 + link.href = URL.createObjectURL(blob);
154 + document.body.appendChild(link);
155 + link.click(); //执行下载
156 + URL.revokeObjectURL(link.href); //释放url
157 + document.body.removeChild(link); //释放标签
158 + } else {
159 + this.$message.error("下载失败");
160 + }
161 + })
162 + .catch(() => {});
163 + },
164 + // 导出
165 + exportTemplate(row, i) {
166 + this.tableAttr.btnCofig.btnGroup[i].loading = true;
167 + downLoadXlsx("/etes/exportHsCodeList", this.queryForm, "HSCODE黑名单表")
168 + .then(() => {
169 + this.tableAttr.btnCofig.btnGroup[i].loading = false;
170 + })
171 + .catch(() => {
172 + this.$message.error("导出失败");
173 + });
174 + },
175 + // 删除
176 + deleteData(row) {
177 + if (this.multipleSelection.length) {
178 + let params = [];
179 + this.multipleSelection.map((item) => {
180 + params.push(item.id);
181 + });
182 + this.$confirm("是否确认删除?", "提示", {
183 + confirmButtonText: "确定",
184 + cancelButtonText: "取消",
185 + type: "warning",
186 + center: true,
187 + })
188 + .then(() => {
189 + this.toDelBlackList(params);
190 + })
191 + .catch(() => {});
192 + } else {
193 + this.$message.error("请勾选一条或者多条数据再操作!");
194 + }
195 + },
196 + // 搜索
197 + searchBtn() {
198 + this.pageConfig.pageData.page = 1;
199 + this.pageConfig.pageData.size = 10;
200 + this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
201 + this.queryFindHsCodeList();
202 + });
203 + },
204 + // 翻页序号递增
205 + indexAdd(index){
206 + const page = this.pageConfig.pageData.page // 当前页码
207 + const pagesize = this.pageConfig.pageData.size // 每页条数
208 + return index + 1 + (page - 1) * pagesize
209 + },
210 + //条数变化
211 + handleSizeChange(e) {
212 + this.pageConfig.pageData.size = e;
213 + this.pageConfig.pageData.page = 1;
214 + this.queryFindHsCodeList();
215 + },
216 + //页码变化
217 + handleCurrentChange(e) {
218 + this.pageConfig.pageData.page = e;
219 + this.queryFindHsCodeList();
220 + },
221 + // table勾选
222 + tableSelectionChange(val) {
223 + this.multipleSelection = val;
224 + },
225 + // 删除
226 + deleteRow({ row }) {
227 + this.$confirm("是否确认删除?", "提示", {
228 + confirmButtonText: "确定",
229 + cancelButtonText: "取消",
230 + type: "warning",
231 + center: true,
232 + })
233 + .then(() => {
234 + this.toDelBlackList([row.id]);
235 + })
236 + .catch(() => {});
237 + },
238 + },
239 +};
240 +</script>
241 +<style lang="scss" scoped></style>
1 +export const tableAttr = {
2 + border: true,
3 + loadingTable: false,
4 + isDragSort: false, // 拖拽tableData数据一定要加id字段
5 + maxHeight: 0,
6 + btnCofig: {
7 + isBtn: true,
8 + btnGroup: [
9 + {
10 + type: "primary", // text、primary、danger
11 + icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
12 + btnName: "搜索",
13 + size: "mini", // medium / small / mini
14 + round: false,
15 + loading: false,
16 + event: "search",
17 + },
18 + {
19 + type: "primary",
20 + icon: "el-icon-download",
21 + btnName: "下载模板",
22 + size: "mini",
23 + round: false,
24 + loading: false,
25 + event: "download",
26 + },
27 + {
28 + type: "primary",
29 + icon: "el-icon-upload",
30 + btnName: "导入",
31 + size: "mini",
32 + round: false,
33 + loading: false,
34 + event: "upLoad",
35 + action: "/goods/uploadGoodsExcel",
36 + fileName: "name",
37 + limit: 1,
38 + accept: ".xlsx",
39 + },
40 + {
41 + type: "primary",
42 + icon: "el-icon-download",
43 + btnName: "导出",
44 + size: "mini",
45 + round: false,
46 + loading: false,
47 + event: "export",
48 + },
49 + {
50 + type: "danger",
51 + icon: "el-icon-delete",
52 + btnName: "删除",
53 + size: "mini",
54 + round: false,
55 + loading: false,
56 + event: "delete",
57 + },
58 + ],
59 + },
60 +};
61 +export const columnHeader = (indexAdd, deleteRow) => [
62 + {
63 + type: "selection",
64 + align: "center",
65 + prop: "selection",
66 + width: "50",
67 + },
68 + {
69 + type: "index",
70 + label: "序号",
71 + prop: "id",
72 + align: "center",
73 + width: "50",
74 + index: indexAdd,
75 + },
76 + {
77 + label: "HSCODE",
78 + prop: "blackValue",
79 + align: "center",
80 + minWidth: 100,
81 + },
82 + {
83 + label: "创建时间",
84 + prop: "createTime",
85 + align: "center",
86 + minWidth: 100,
87 + },
88 + {
89 + label: "创建人",
90 + prop: "createUserName",
91 + align: "center",
92 + minWidth: 100,
93 + },
94 + {
95 + label: "文件名",
96 + prop: "uploadFileName",
97 + align: "center",
98 + minWidth: 100,
99 + },
100 +
101 + {
102 + label: "操作",
103 + prop: "operate",
104 + align: "center",
105 + minWidth: 120,
106 + fixed: "right",
107 + render: (h, params) => {
108 + return h("div", [
109 + h(
110 + "el-button",
111 + {
112 + style: {
113 + color: "#ff4949",
114 + },
115 + props: {
116 + type: "text",
117 + size: "mini",
118 + icon: "el-icon-delete",
119 + },
120 + on: {
121 + click() {
122 + deleteRow(params);
123 + },
124 + },
125 + },
126 + "删除"
127 + ),
128 + ]);
129 + },
130 + },
131 +];
1 +<template>
2 + <div class="error-container">
3 + <el-dialog
4 + :width="width"
5 + :title="title"
6 + :center="center"
7 + :visible.sync="dialogVisible"
8 + :close-on-click-modal="onModalClickClose"
9 + @open="dialogOpenEvent"
10 + @close="dialogCloseEvent"
11 + >
12 + <slot></slot>
13 + <span slot="footer" class="dialog-footer">
14 + <el-button @click="cancel">取 消</el-button>
15 + <el-button type="primary" @click="confirm">{{
16 + confirmBtnName
17 + }}</el-button>
18 + </span>
19 + </el-dialog>
20 + </div>
21 +</template>
22 +
23 +<script>
24 +export default {
25 + props: {
26 + width: {
27 + type: String,
28 + default: "50%",
29 + },
30 + title: {
31 + type: String,
32 + default: "标题",
33 + },
34 + center: {
35 + type: String,
36 + default: "center",
37 + },
38 + confirmBtnName: {
39 + type: String,
40 + default: "确 定",
41 + },
42 + onModalClickClose: {
43 + type: Boolean,
44 + default: false,
45 + },
46 + },
47 + data() {
48 + return {
49 + dialogVisible: false,
50 + };
51 + },
52 + computed: {},
53 + created() {},
54 + mounted() {},
55 + methods: {
56 + dialogOpenEvent(data) {
57 + if (data && data.length) {
58 + console.log(data);
59 + }
60 + this.dialogVisible = true;
61 + this.$emit("open");
62 + },
63 + dialogCloseEvent() {
64 + this.dialogVisible = false;
65 + this.$emit("close");
66 + },
67 + // 确认事件
68 + confirm() {
69 + this.dialogVisible = false;
70 + this.$emit("confirm");
71 + },
72 + // 取消事件
73 + cancel() {
74 + this.dialogVisible = false;
75 + this.$emit("cancel");
76 + },
77 + },
78 +};
79 +</script>
80 +<style lang='scss' scoped>
81 +
82 +</style>
1 +export const formConfig = [
2 + {
3 + label: "ShipmentDesc",
4 + type: "Input",
5 + name: "searchValue",
6 + prop: "searchValue",
7 + placeholder: "根据ShipmentDesc查询",
8 + span: 7,
9 + trigger: "blur", // 事件名
10 + },
11 +];
1 +<template>
2 + <div ref="formHeaderRef" class="form-header container">
3 + <el-row>
4 + <el-col>
5 + <yl-form
6 + ref="ruleForm"
7 + :formConfig="formConfig"
8 + :queryForm="queryForm"
9 + :inline="false"
10 + formWidth="auto"
11 + />
12 + </el-col>
13 + </el-row>
14 + <yl-table
15 + ref="ylTable"
16 + :attrs="tableAttr"
17 + :loadingTable="tableAttr.loadingTable"
18 + :columns="columns"
19 + :tableData="tableData"
20 + :pageConfig="pageConfig"
21 + @search="searchBtn"
22 + @upload="toUpload"
23 + @export="exportTemplate"
24 + @delete="deleteData"
25 + @sizeChange="handleSizeChange"
26 + @currentChange="handleCurrentChange"
27 + @selectionEvent="tableSelectionChange"
28 + >
29 + </yl-table>
30 + </div>
31 +</template>
32 +<script>
33 +import YlForm from "@/components/YlForm";
34 +import YlTable from "@/components/YlTable";
35 +import { formConfig } from "./formConfig";
36 +import { tableAttr, columnHeader } from "./tableConfig";
37 +import { restTableHeight } from "@/utils";
38 +import {
39 + findShipmentDescList, // HScode英文品名黑名单查询
40 + uploadShipmentDesc, // HScode英文品名黑名单导入
41 + delBlackList, // HScode黑名单/英文品名删除
42 +} from "@/api/et86ShipmentDesc";
43 +import { downLoadXlsx } from "@/utils/zipdownload";
44 +export default {
45 + name: "et86ShipmentDesc",
46 + components: {
47 + YlForm,
48 + YlTable,
49 + },
50 + data() {
51 + return {
52 + formConfig: formConfig, // 表单配置项
53 + queryForm: {
54 + searchValue: "",
55 + }, // 表单参数
56 + pageConfig: {
57 + // 分页配置项
58 + isPagination: true,
59 + total: 0,
60 + pageData: {
61 + page: 1,
62 + size: 10,
63 + },
64 + },
65 + tableAttr: tableAttr, // table配置项
66 + columns: columnHeader(this.indexAdd, this.deleteRow), // 表头
67 + tableData: [], // 表格数据
68 + multipleSelection: [],
69 + };
70 + },
71 + created() {
72 + // 黑名单查询
73 + this.$nextTick(() => {
74 + this.searchBtn();
75 + });
76 + },
77 + mounted() {
78 + this.$nextTick(() => {
79 + this.tableAttr.maxHeight =
80 + window.innerHeight - restTableHeight(this.$refs);
81 + });
82 + },
83 + methods: {
84 + // HScode黑名单查询
85 + queryFindShipmentDescList() {
86 + const { page, size } = this.pageConfig.pageData;
87 + let params = {
88 + limitStart: (page - 1) * size,
89 + limitSize: size,
90 + ...this.queryForm,
91 + };
92 + this.tableAttr.loadingTable = true;
93 + findShipmentDescList(params)
94 + .then((res) => {
95 + this.tableAttr.loadingTable = false;
96 + const { code, data } = res;
97 + if (code == 200) {
98 + this.tableData = data.list;
99 + this.pageConfig.total = data.total;
100 + }
101 + })
102 + .catch(() => {});
103 + },
104 + // 删除黑名单
105 + toDelBlackList(params) {
106 + delBlackList(params)
107 + .then((res) => {
108 + const { code, msg } = res;
109 + if (code == 200) {
110 + this.searchBtn();
111 + this.msgSuccess(msg || "删除成功!");
112 + } else {
113 + this.$message.error(msg || "删除失败");
114 + }
115 + })
116 + .catch(() => {});
117 + },
118 + // 选择上传【HScode黑名单导入】
119 + toUpload({ file }) {
120 + const formData = new FormData();
121 + formData.append("file", file);
122 + uploadShipmentDesc(formData)
123 + .then((res) => {
124 + const { code, data, msg } = res;
125 + if (code == 200) {
126 + this.searchBtn();
127 + this.msgSuccess(msg || "导入成功!");
128 + } else {
129 + this.$message.error(msg || "导入失败");
130 + this.$router.push({
131 + path: "/errorInfo",
132 + query: {
133 + name: "errorInfo",
134 + error: code,
135 + data: JSON.stringify(data),
136 + },
137 + });
138 + }
139 + })
140 + .catch(() => {});
141 + },
142 + // 导出
143 + exportTemplate(row, i) {
144 + this.tableAttr.btnCofig.btnGroup[i].loading = true;
145 + downLoadXlsx(
146 + "/etes/exportShipmentDescList",
147 + this.queryForm,
148 + "HSCODE英文品名黑名单表"
149 + )
150 + .then(() => {
151 + this.tableAttr.btnCofig.btnGroup[i].loading = false;
152 + })
153 + .catch(() => {
154 + this.$message.error("导出失败");
155 + });
156 + },
157 + // 删除
158 + deleteData(row) {
159 + if (this.multipleSelection.length) {
160 + let params = [];
161 + this.multipleSelection.map((item) => {
162 + params.push(item.id);
163 + });
164 + this.$confirm("是否确认删除?", "提示", {
165 + confirmButtonText: "确定",
166 + cancelButtonText: "取消",
167 + type: "warning",
168 + center: true,
169 + })
170 + .then(() => {
171 + this.toDelBlackList(params);
172 + })
173 + .catch(() => {});
174 + } else {
175 + this.$message.error("请勾选一条或者多条数据再操作!");
176 + }
177 + },
178 + // 搜索
179 + searchBtn() {
180 + this.pageConfig.pageData.page = 1;
181 + this.pageConfig.pageData.size = 10;
182 + this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
183 + this.queryFindShipmentDescList();
184 + });
185 + },
186 + // 翻页序号递增
187 + indexAdd(index){
188 + const page = this.pageConfig.pageData.page // 当前页码
189 + const pagesize = this.pageConfig.pageData.size // 每页条数
190 + return index + 1 + (page - 1) * pagesize
191 + },
192 + //条数变化
193 + handleSizeChange(e) {
194 + this.pageConfig.pageData.size = e;
195 + this.pageConfig.pageData.page = 1;
196 + this.queryFindShipmentDescList();
197 + },
198 + //页码变化
199 + handleCurrentChange(e) {
200 + this.pageConfig.pageData.page = e;
201 + this.queryFindShipmentDescList();
202 + },
203 + // table勾选
204 + tableSelectionChange(val) {
205 + this.multipleSelection = val;
206 + },
207 + // 删除
208 + deleteRow({ row }) {
209 + this.$confirm("是否确认删除?", "提示", {
210 + confirmButtonText: "确定",
211 + cancelButtonText: "取消",
212 + type: "warning",
213 + center: true,
214 + })
215 + .then(() => {
216 + this.toDelBlackList([row.id]);
217 + })
218 + .catch(() => {});
219 + },
220 + },
221 +};
222 +</script>
223 +<style lang="scss" scoped></style>
1 +export const tableAttr = {
2 + border: true,
3 + loadingTable: false,
4 + isDragSort: false, // 拖拽tableData数据一定要加id字段
5 + maxHeight: 300,
6 + btnCofig: {
7 + isBtn: true,
8 + btnGroup: [
9 + {
10 + type: "primary", // text、primary、danger
11 + icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
12 + btnName: "搜索",
13 + size: "mini", // medium / small / mini
14 + round: false,
15 + loading: false,
16 + event: "search",
17 + },
18 + {
19 + type: "primary",
20 + icon: "el-icon-upload",
21 + btnName: "导入",
22 + size: "mini",
23 + round: false,
24 + loading: false,
25 + event: "upLoad",
26 + action: "/goods/uploadGoodsExcel",
27 + fileName: "name",
28 + limit: 1,
29 + accept: ".xlsx",
30 + },
31 + {
32 + type: "primary",
33 + icon: "el-icon-download",
34 + btnName: "导出",
35 + size: "mini",
36 + round: false,
37 + loading: false,
38 + event: "export",
39 + },
40 + {
41 + type: "danger",
42 + icon: "el-icon-delete",
43 + btnName: "删除",
44 + size: "mini",
45 + round: false,
46 + loading: false,
47 + event: "delete",
48 + },
49 + ],
50 + },
51 +};
52 +export const columnHeader = (indexAdd, deleteRow) => [
53 + {
54 + type: "selection",
55 + align: "center",
56 + prop: "selection",
57 + width: "50",
58 + },
59 + {
60 + type: "index",
61 + label: "序号",
62 + prop: "id",
63 + align: "center",
64 + width: "50",
65 + index: indexAdd,
66 + },
67 + {
68 + label: "ShipmentDesc",
69 + prop: "blackValue",
70 + align: "center",
71 + minWidth: 100,
72 + },
73 + {
74 + label: "创建时间",
75 + prop: "createTime",
76 + align: "center",
77 + minWidth: 100,
78 + },
79 + {
80 + label: "创建人",
81 + prop: "createUserName",
82 + align: "center",
83 + minWidth: 100,
84 + },
85 + {
86 + label: "文件名",
87 + prop: "uploadFileName",
88 + align: "center",
89 + minWidth: 100,
90 + },
91 +
92 + {
93 + label: "操作",
94 + prop: "operate",
95 + align: "center",
96 + minWidth: 120,
97 + fixed: "right",
98 + render: (h, params) => {
99 + return h("div", [
100 + h(
101 + "el-button",
102 + {
103 + style: {
104 + color: "#ff4949",
105 + },
106 + props: {
107 + type: "text",
108 + size: "mini",
109 + icon: "el-icon-delete",
110 + },
111 + on: {
112 + click() {
113 + deleteRow(params);
114 + },
115 + },
116 + },
117 + "删除"
118 + ),
119 + ]);
120 + },
121 + },
122 +];