Elements-SY

et86黑名单维护

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 <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>
5 <span 9 <span
6 v-for="(item, i) in attrs.btnCofig.btnGroup" 10 v-for="(item, i) in attrs.btnCofig.btnGroup"
...@@ -13,8 +17,8 @@ ...@@ -13,8 +17,8 @@
13 :round="item.round" 17 :round="item.round"
14 :size="item.size" 18 :size="item.size"
15 :loading="item.loading" 19 :loading="item.loading"
16 - @click="handleClick(item)" 20 + @click="handleClick(item, i)"
17 - v-if="item.btnName !== '导入' && item.btnName !== '导出'" 21 + v-if="item.btnName !== '导入' && item.btnName !== '增加'"
18 >{{ item.btnName }}</el-button 22 >{{ item.btnName }}</el-button
19 > 23 >
20 <el-upload 24 <el-upload
...@@ -62,8 +66,10 @@ ...@@ -62,8 +66,10 @@
62 <!-- 分页 --> 66 <!-- 分页 -->
63 <div 67 <div
64 v-if="pageConfig.isPagination" 68 v-if="pageConfig.isPagination"
69 + id="pagination"
65 class="pagination-container" 70 class="pagination-container"
66 :style="{ textAlign: pageConfig.position || 'right' }" 71 :style="{ textAlign: pageConfig.position || 'right' }"
72 + ref="paginationRef"
67 > 73 >
68 <el-pagination 74 <el-pagination
69 background 75 background
...@@ -219,8 +225,8 @@ export default { ...@@ -219,8 +225,8 @@ export default {
219 this.$emit("currentChange", e); 225 this.$emit("currentChange", e);
220 }, 226 },
221 // btn点击事件注册 227 // btn点击事件注册
222 - handleClick(item) { 228 + handleClick(item, i) {
223 - this.$emit(item.event, item); 229 + this.$emit(item.event, item, i);
224 }, 230 },
225 // 拖拽行更新排序 231 // 拖拽行更新排序
226 rowDrop() { 232 rowDrop() {
...@@ -259,6 +265,9 @@ export default { ...@@ -259,6 +265,9 @@ export default {
259 }, 265 },
260 // 选择上传 266 // 选择上传
261 toUpload(options) { 267 toUpload(options) {
268 + this.$refs.upload.map((item) => {
269 + item.clearFiles(); //上传成功之后清除历史记录
270 + });
262 this.$emit("upload", options); 271 this.$emit("upload", options);
263 }, 272 },
264 //移除上传 273 //移除上传
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 <sidebar class="sidebar-container" 4 <sidebar class="sidebar-container"
5 :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }" /> 5 :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }" />
6 <div :class="{ hasTagsView: needTagsView }" class="main-container"> 6 <div :class="{ hasTagsView: needTagsView }" class="main-container">
7 - <div :class="{ 'fixed-header': fixedHeader }" ref="headerBlock"> 7 + <div :class="{ 'fixed-header': fixedHeader }">
8 <navbar /> 8 <navbar />
9 <tags-view v-if="needTagsView" /> 9 <tags-view v-if="needTagsView" />
10 </div> 10 </div>
......
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 + this.getBlockCurrentHeight();
9 if (this.device === "mobile" && this.sidebar.opened) { 10 if (this.device === "mobile" && this.sidebar.opened) {
10 store.dispatch("app/closeSideBar", { withoutAnimation: false }); 11 store.dispatch("app/closeSideBar", { withoutAnimation: false });
11 } 12 }
...@@ -23,7 +24,9 @@ export default { ...@@ -23,7 +24,9 @@ export default {
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 }
26 - this.getBlockCurrentHeight(); 27 + this.$nextTick(()=>{
28 + this.getBlockCurrentHeight();
29 + })
27 }, 30 },
28 methods: { 31 methods: {
29 // use $_ for mixins properties 32 // use $_ for mixins properties
...@@ -42,9 +45,9 @@ export default { ...@@ -42,9 +45,9 @@ export default {
42 } 45 }
43 } 46 }
44 }, 47 },
45 - getBlockCurrentHeight(){; 48 + getBlockCurrentHeight() {
46 - // console.log(this.$refs.headerBlock, this.$refs.headerBlock.clientHeight); 49 + let height = this.$refs.appMainBlock.$el.clientHeight;
47 - // console.log(this.$refs.appMainBlock); 50 + this.$store.dispatch("app/setAppMainBlockCH", height);
48 - } 51 + },
49 }, 52 },
50 }; 53 };
......
...@@ -82,7 +82,7 @@ export const constantRoutes = [ ...@@ -82,7 +82,7 @@ export const constantRoutes = [
82 { 82 {
83 path: "/errorInfo", 83 path: "/errorInfo",
84 component: (resolve) => 84 component: (resolve) =>
85 - require(["@/views/et86Config/et86HsCodeBlack/errorInfo"], resolve), 85 + require(["@/views/et86Config/errorInfo"], resolve),
86 name: "errorInfo", 86 name: "errorInfo",
87 meta: { title: "错误信息提示", icon: "user" }, 87 meta: { title: "错误信息提示", icon: "user" },
88 }, 88 },
......
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,
......
This diff is collapsed. Click to expand it.
...@@ -79,7 +79,7 @@ service.interceptors.response.use(res => { ...@@ -79,7 +79,7 @@ service.interceptors.response.use(res => {
79 type: 'error' 79 type: 'error'
80 }) 80 })
81 return Promise.reject(new Error(msg)) 81 return Promise.reject(new Error(msg))
82 - } else if (code !== 200 && code !== 201 && code !== 202 && code != 203 && code != 603) { 82 + } else if (code !== 200 && code !== 201 && code !== 202 && code != 203 && code != 603 && code != 402) {
83 Message({ 83 Message({
84 message: msg, 84 message: msg,
85 type: 'error' 85 type: 'error'
......
...@@ -37,7 +37,10 @@ export default { ...@@ -37,7 +37,10 @@ export default {
37 tableData: [], // 表格数据 37 tableData: [], // 表格数据
38 }; 38 };
39 }, 39 },
40 - created() {}, 40 + created() {
41 + const { data } = this.$route.query;
42 + this.tableData = JSON.parse(data);
43 + },
41 methods: { 44 methods: {
42 //条数变化 45 //条数变化
43 handleSizeChange(e) { 46 handleSizeChange(e) {
...@@ -50,10 +53,8 @@ export default { ...@@ -50,10 +53,8 @@ export default {
50 this.pageConfig.pageData.page = e; 53 this.pageConfig.pageData.page = e;
51 this.searchBtn(); 54 this.searchBtn();
52 }, 55 },
53 - // table勾选 56 + // 搜索
54 - handleSelectionChange(val) { 57 + searchBtn() {},
55 - this.multipleSelection = val;
56 - },
57 }, 58 },
58 }; 59 };
59 </script> 60 </script>
......
...@@ -12,19 +12,13 @@ export const columnHeader = () => [ ...@@ -12,19 +12,13 @@ export const columnHeader = () => [
12 { 12 {
13 type: "index", 13 type: "index",
14 label: "序号", 14 label: "序号",
15 - prop: "id", 15 + prop: "rowNum",
16 align: "center", 16 align: "center",
17 width: "70", 17 width: "70",
18 }, 18 },
19 { 19 {
20 - label: "运单号",
21 - prop: "waybillNo",
22 - align: "center",
23 - width: 150,
24 - },
25 - {
26 label: "错误信息", 20 label: "错误信息",
27 - prop: "errorMessage", 21 + prop: "msg",
28 align: "center", 22 align: "center",
29 minWidth: 150, 23 minWidth: 150,
30 }, 24 },
......
...@@ -2,8 +2,8 @@ export const formConfig = [ ...@@ -2,8 +2,8 @@ export const formConfig = [
2 { 2 {
3 label: "商品名", 3 label: "商品名",
4 type: "Input", 4 type: "Input",
5 - name: "skuCode", 5 + name: "searchValue",
6 - prop: "skuCode", 6 + prop: "searchValue",
7 placeholder: "根据Hscode查询", 7 placeholder: "根据Hscode查询",
8 span: 6, 8 span: 6,
9 trigger: "blur", // 事件名 9 trigger: "blur", // 事件名
......
1 <template> 1 <template>
2 - <div class="form-header container"> 2 + <div ref="formHeaderRef" class="form-header container">
3 <el-row> 3 <el-row>
4 <el-col> 4 <el-col>
5 <yl-form 5 <yl-form
...@@ -22,9 +22,11 @@ ...@@ -22,9 +22,11 @@
22 @download="downloadTemplate" 22 @download="downloadTemplate"
23 @upload="toUpload" 23 @upload="toUpload"
24 @rmfile="onRemoveUpload" 24 @rmfile="onRemoveUpload"
25 + @export="exportTemplate"
25 @delete="deleteData" 26 @delete="deleteData"
26 @sizeChange="handleSizeChange" 27 @sizeChange="handleSizeChange"
27 @currentChange="handleCurrentChange" 28 @currentChange="handleCurrentChange"
29 + @selectionEvent="tableSelectionChange"
28 > 30 >
29 </yl-table> 31 </yl-table>
30 <!-- <modle-view 32 <!-- <modle-view
...@@ -85,6 +87,14 @@ import YlTable from "@/components/YlTable"; ...@@ -85,6 +87,14 @@ import YlTable from "@/components/YlTable";
85 import ModleView from "./components/ModleView"; 87 import ModleView from "./components/ModleView";
86 import { formConfig } from "./formConfig"; 88 import { formConfig } from "./formConfig";
87 import { tableAttr, columnHeader } from "./tableConfig"; 89 import { tableAttr, columnHeader } from "./tableConfig";
90 +import { restTableHeight } from "@/utils";
91 +import {
92 + findHsCodeList, // HScode黑名单查询
93 + delBlackList, // HScode黑名单删除
94 + downLoadTemplate, // HScode黑名单下载模板
95 + uploadHsCode, // HScode黑名单导入
96 +} from "@/api/et86HsCodeBlack";
97 +import { downLoadXlsx } from "@/utils/zipdownload";
88 export default { 98 export default {
89 name: "Et86HsCodeBlack", 99 name: "Et86HsCodeBlack",
90 components: { 100 components: {
...@@ -95,7 +105,9 @@ export default { ...@@ -95,7 +105,9 @@ export default {
95 data() { 105 data() {
96 return { 106 return {
97 formConfig: formConfig, // 表单配置项 107 formConfig: formConfig, // 表单配置项
98 - queryForm: {}, // 表单参数 108 + queryForm: {
109 + searchValue: "",
110 + }, // 表单参数
99 paramsForm: { 111 paramsForm: {
100 skuName: "", 112 skuName: "",
101 file: null, 113 file: null,
...@@ -120,13 +132,79 @@ export default { ...@@ -120,13 +132,79 @@ export default {
120 multipleSelection: [], 132 multipleSelection: [],
121 }; 133 };
122 }, 134 },
123 - created() {}, 135 + created() {
136 + // 黑名单查询
137 + this.$nextTick(() => {
138 + this.searchBtn();
139 + });
140 + },
141 + mounted() {
142 + this.$nextTick(() => {
143 + let app = document.querySelector(".app-main");
144 + if (this.$store.getters.appMainBlockClientHeight) {
145 + this.tableAttr.maxHeight =
146 + this.$store.getters.appMainBlockClientHeight -
147 + restTableHeight(this.$refs);
148 + } else {
149 + this.tableAttr.maxHeight =
150 + app.clientHeight - restTableHeight(this.$refs);
151 + }
152 + });
153 + },
124 methods: { 154 methods: {
155 + // HScode黑名单查询
156 + queryFindHsCodeList(params) {
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 + },
125 // 失焦事件 183 // 失焦事件
126 blurEvent() {}, 184 blurEvent() {},
127 - // 选择上传 185 + // 选择上传【HScode黑名单导入】
128 - toUpload(options) { 186 + toUpload({ file }) {
129 - console.log(options); 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(() => {});
130 }, 208 },
131 //移除上传 209 //移除上传
132 onRemoveUpload(options) { 210 onRemoveUpload(options) {
...@@ -134,22 +212,74 @@ export default { ...@@ -134,22 +212,74 @@ export default {
134 }, 212 },
135 // 搜索 213 // 搜索
136 searchBtn() { 214 searchBtn() {
137 - this.$refs.ruleForm.handleSearch("ruleForm", (val) => {}); 215 + const { page, size } = this.pageConfig.pageData;
216 + this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
217 + let params = {
218 + limitStart: (page - 1) * size,
219 + limitSize: size,
220 + ...this.queryForm,
221 + };
222 + this.queryFindHsCodeList(params);
223 + });
138 }, 224 },
139 // 确认对话框 225 // 确认对话框
140 dialogConfirm() {}, 226 dialogConfirm() {},
141 - // 下载 227 + // 下载【HScode黑名单下载模板】
142 downloadTemplate() { 228 downloadTemplate() {
143 - // this.$refs.modleViewRef.dialogOpenEvent(); 229 + downLoadTemplate("hsCode")
230 + .then((res) => {
231 + if (res) {
232 + const blob = new Blob([res]);
233 + const link = document.createElement("a"); //创建a标签
234 + link.download = "HSCODE黑名单表.xlsx"; //a标签添加属性
235 + link.style.display = "none";
236 + link.href = URL.createObjectURL(blob);
237 + document.body.appendChild(link);
238 + link.click(); //执行下载
239 + URL.revokeObjectURL(link.href); //释放url
240 + document.body.removeChild(link); //释放标签
241 + } else {
242 + this.$message.error("下载失败");
243 + }
244 + })
245 + .catch(() => {});
144 }, 246 },
145 // 上传 247 // 上传
146 upLoadTemplate() { 248 upLoadTemplate() {
147 // console.log(this.$refs.modleViewRef); 249 // console.log(this.$refs.modleViewRef);
148 }, 250 },
149 // 导出 251 // 导出
150 - exportTemplate() {}, 252 + exportTemplate(row, i) {
253 + this.tableAttr.btnCofig.btnGroup[i].loading = true;
254 + downLoadXlsx("/etes/exportHsCodeList", this.queryForm, "HSCODE黑名单表")
255 + .then(() => {
256 + this.tableAttr.btnCofig.btnGroup[i].loading = false;
257 + })
258 + .catch(() => {
259 + this.$message.error("导出失败");
260 + });
261 + },
151 // 删除 262 // 删除
152 - deleteData() {}, 263 + deleteData(row) {
264 + if (this.multipleSelection.length) {
265 + let params = [];
266 + this.multipleSelection.map((item) => {
267 + params.push(item.id);
268 + });
269 + this.$confirm("是否确认删除?", "提示", {
270 + confirmButtonText: "确定",
271 + cancelButtonText: "取消",
272 + type: "warning",
273 + center: true,
274 + })
275 + .then(() => {
276 + this.toDelBlackList(params);
277 + })
278 + .catch(() => {});
279 + } else {
280 + this.$message.error("请勾选一条或者多条数据再操作!");
281 + }
282 + },
153 //条数变化 283 //条数变化
154 handleSizeChange(e) { 284 handleSizeChange(e) {
155 this.pageConfig.pageData.size = e; 285 this.pageConfig.pageData.size = e;
...@@ -162,11 +292,11 @@ export default { ...@@ -162,11 +292,11 @@ export default {
162 this.searchBtn(); 292 this.searchBtn();
163 }, 293 },
164 // table勾选 294 // table勾选
165 - handleSelectionChange(val) { 295 + tableSelectionChange(val) {
166 this.multipleSelection = val; 296 this.multipleSelection = val;
167 }, 297 },
168 // 删除 298 // 删除
169 - deleteRow() { 299 + deleteRow({ row }) {
170 this.$confirm("是否确认删除?", "提示", { 300 this.$confirm("是否确认删除?", "提示", {
171 confirmButtonText: "确定", 301 confirmButtonText: "确定",
172 cancelButtonText: "取消", 302 cancelButtonText: "取消",
...@@ -174,7 +304,7 @@ export default { ...@@ -174,7 +304,7 @@ export default {
174 center: true, 304 center: true,
175 }) 305 })
176 .then(() => { 306 .then(() => {
177 - this.msgSuccess("删除成功!"); 307 + this.toDelBlackList([row.id]);
178 }) 308 })
179 .catch(() => {}); 309 .catch(() => {});
180 }, 310 },
......
...@@ -2,7 +2,7 @@ export const tableAttr = { ...@@ -2,7 +2,7 @@ export const tableAttr = {
2 border: true, 2 border: true,
3 loadingTable: false, 3 loadingTable: false,
4 isDragSort: false, // 拖拽tableData数据一定要加id字段 4 isDragSort: false, // 拖拽tableData数据一定要加id字段
5 - maxHeight: 300, 5 + maxHeight: 0,
6 btnCofig: { 6 btnCofig: {
7 isBtn: true, 7 isBtn: true,
8 btnGroup: [ 8 btnGroup: [
...@@ -27,7 +27,7 @@ export const tableAttr = { ...@@ -27,7 +27,7 @@ export const tableAttr = {
27 { 27 {
28 type: "primary", 28 type: "primary",
29 icon: "el-icon-upload", 29 icon: "el-icon-upload",
30 - btnName: "导入", 30 + btnName: "增加",
31 size: "mini", 31 size: "mini",
32 round: false, 32 round: false,
33 loading: false, 33 loading: false,
...@@ -45,10 +45,6 @@ export const tableAttr = { ...@@ -45,10 +45,6 @@ export const tableAttr = {
45 round: false, 45 round: false,
46 loading: false, 46 loading: false,
47 event: "export", 47 event: "export",
48 - action: "/goods/uploadGoodsExcel",
49 - fileName: "name",
50 - limit: 1,
51 - accept: ".xlsx",
52 }, 48 },
53 { 49 {
54 type: "danger", 50 type: "danger",
...@@ -77,14 +73,8 @@ export const columnHeader = (deleteRow) => [ ...@@ -77,14 +73,8 @@ export const columnHeader = (deleteRow) => [
77 width: "50", 73 width: "50",
78 }, 74 },
79 { 75 {
80 - label: "口岸",
81 - prop: "portName",
82 - align: "center",
83 - minWidth: 100,
84 - },
85 - {
86 label: "HSCODE", 76 label: "HSCODE",
87 - prop: "goodsCode", 77 + prop: "blackValue",
88 align: "center", 78 align: "center",
89 minWidth: 100, 79 minWidth: 100,
90 }, 80 },
...@@ -102,7 +92,7 @@ export const columnHeader = (deleteRow) => [ ...@@ -102,7 +92,7 @@ export const columnHeader = (deleteRow) => [
102 }, 92 },
103 { 93 {
104 label: "文件名", 94 label: "文件名",
105 - prop: "fileName", 95 + prop: "uploadFileName",
106 align: "center", 96 align: "center",
107 minWidth: 100, 97 minWidth: 100,
108 }, 98 },
......
1 <template> 1 <template>
2 - <div class="form-header container"> 2 + <div ref="formHeaderRef" class="form-header container">
3 <el-row> 3 <el-row>
4 <el-col> 4 <el-col>
5 <yl-form 5 <yl-form
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
13 </el-col> 13 </el-col>
14 </el-row> 14 </el-row>
15 <yl-table 15 <yl-table
16 + ref="ylTable"
16 :attrs="tableAttr" 17 :attrs="tableAttr"
17 :loadingTable="tableAttr.loadingTable" 18 :loadingTable="tableAttr.loadingTable"
18 :columns="columns" 19 :columns="columns"
...@@ -31,6 +32,7 @@ import YlForm from "@/components/YlForm"; ...@@ -31,6 +32,7 @@ import YlForm from "@/components/YlForm";
31 import YlTable from "@/components/YlTable"; 32 import YlTable from "@/components/YlTable";
32 import { formConfig } from "./formConfig"; 33 import { formConfig } from "./formConfig";
33 import { tableAttr, columnHeader } from "./tableConfig"; 34 import { tableAttr, columnHeader } from "./tableConfig";
35 +import { restTableHeight } from "@/utils";
34 import { 36 import {
35 findAllEtesRules, // ET86查询 37 findAllEtesRules, // ET86查询
36 deleteEtesRuleById, // 删除 38 deleteEtesRuleById, // 删除
...@@ -67,7 +69,20 @@ export default { ...@@ -67,7 +69,20 @@ export default {
67 this.searchBtn(); 69 this.searchBtn();
68 }); 70 });
69 }, 71 },
70 - mounted() {}, 72 + mounted() {
73 + this.$nextTick(() => {
74 + let app = document.querySelector(".app-main");
75 + if (this.$store.getters.appMainBlockClientHeight) {
76 + this.tableAttr.maxHeight =
77 + this.$store.getters.appMainBlockClientHeight -
78 + restTableHeight(this.$refs);
79 + } else {
80 + this.tableAttr.maxHeight =
81 + app.clientHeight - restTableHeight(this.$refs);
82 + }
83 + console.log(this.tableAttr.maxHeight);
84 + });
85 + },
71 methods: { 86 methods: {
72 // ET86查询 87 // ET86查询
73 queryFindAllEtesRules(params) { 88 queryFindAllEtesRules(params) {
......
...@@ -6,7 +6,7 @@ export const tableAttr = { ...@@ -6,7 +6,7 @@ export const tableAttr = {
6 border: true, 6 border: true,
7 loadingTable: false, 7 loadingTable: false,
8 isDragSort: false, // 拖拽tableData数据一定要加id字段 8 isDragSort: false, // 拖拽tableData数据一定要加id字段
9 - maxHeight: 300, 9 + maxHeight: 0,
10 btnCofig: { 10 btnCofig: {
11 isBtn: true, 11 isBtn: true,
12 btnGroup: [ 12 btnGroup: [
......
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: "ShipmentDesc",
6 + prop: "ShipmentDesc",
7 + placeholder: "根据ShipmentDesc查询",
8 + span: 7,
9 + trigger: "blur", // 事件名
10 + },
11 +];
1 +<template>
2 + <div ref="formHeaderRef" class="form-header container">
3 + <el-row>
4 + <el-col>
5 + <yl-form
6 + ref="ruleForm"
7 + :formConfig="formConfig"
8 + :queryForm="queryForm"
9 + :inline="false"
10 + formWidth="auto"
11 + @blur="blurEvent"
12 + />
13 + </el-col>
14 + </el-row>
15 + <yl-table
16 + :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 + @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 + findHsCodeList, // HScode黑名单查询
93 + delBlackList, // HScode黑名单删除
94 + downLoadTemplate, // HScode黑名单下载模板
95 + uploadHsCode, // HScode黑名单导入
96 +} from "@/api/et86HsCodeBlack";
97 +import { downLoadXlsx } from "@/utils/zipdownload";
98 +export default {
99 + name: "Et86HsCodeBlack",
100 + components: {
101 + YlForm,
102 + YlTable,
103 + ModleView,
104 + },
105 + data() {
106 + return {
107 + formConfig: formConfig, // 表单配置项
108 + queryForm: {
109 + searchValue: "",
110 + }, // 表单参数
111 + paramsForm: {
112 + skuName: "",
113 + file: null,
114 + },
115 + rules: {
116 + skuName: [
117 + { required: true, message: "请输入商品名称", trigger: "blur" },
118 + ],
119 + },
120 + pageConfig: {
121 + // 分页配置项
122 + isPagination: true,
123 + total: 0,
124 + pageData: {
125 + page: 1,
126 + size: 10,
127 + },
128 + },
129 + tableAttr: tableAttr, // table配置项
130 + columns: columnHeader(this.deleteRow), // 表头
131 + tableData: [], // 表格数据
132 + multipleSelection: [],
133 + };
134 + },
135 + created() {
136 + // 黑名单查询
137 + this.$nextTick(() => {
138 + this.searchBtn();
139 + });
140 + },
141 + mounted() {
142 + this.$nextTick(() => {
143 + let app = document.querySelector(".app-main");
144 + if (this.$store.getters.appMainBlockClientHeight) {
145 + this.tableAttr.maxHeight =
146 + this.$store.getters.appMainBlockClientHeight -
147 + restTableHeight(this.$refs);
148 + } else {
149 + this.tableAttr.maxHeight =
150 + app.clientHeight - restTableHeight(this.$refs);
151 + }
152 + console.log(this.tableAttr.maxHeight);
153 + });
154 + },
155 + methods: {
156 + // HScode黑名单查询
157 + queryFindHsCodeList(params) {
158 + this.tableAttr.loadingTable = true;
159 + findHsCodeList(params)
160 + .then((res) => {
161 + this.tableAttr.loadingTable = false;
162 + const { code, data } = res;
163 + if (code == 200) {
164 + this.tableData = data.list;
165 + this.pageConfig.total = data.total;
166 + }
167 + })
168 + .catch(() => {});
169 + },
170 + // 删除黑名单
171 + toDelBlackList(params) {
172 + delBlackList(params)
173 + .then((res) => {
174 + const { code, msg } = res;
175 + if (code == 200) {
176 + this.searchBtn();
177 + this.msgSuccess(msg || "删除成功!");
178 + } else {
179 + this.$message.error(msg || "删除失败");
180 + }
181 + })
182 + .catch(() => {});
183 + },
184 + // 失焦事件
185 + blurEvent() {},
186 + // 选择上传【HScode黑名单导入】
187 + toUpload({ file }) {
188 + const formData = new FormData();
189 + formData.append("file", file);
190 + uploadHsCode(formData)
191 + .then((res) => {
192 + const { code, data, msg } = res;
193 + if (code == 200) {
194 + this.searchBtn();
195 + this.msgSuccess(msg || "增加成功!");
196 + } else {
197 + this.$message.error(msg || "增加失败");
198 + this.$router.push({
199 + path: "/errorInfo",
200 + query: {
201 + name: "errorInfo",
202 + error: code,
203 + data: JSON.stringify(data),
204 + },
205 + });
206 + }
207 + })
208 + .catch(() => {});
209 + },
210 + //移除上传
211 + onRemoveUpload(options) {
212 + console.log(options);
213 + },
214 + // 搜索
215 + searchBtn() {
216 + const { page, size } = this.pageConfig.pageData;
217 + this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
218 + let params = {
219 + limitStart: (page - 1) * size,
220 + limitSize: size,
221 + ...this.queryForm,
222 + };
223 + this.queryFindHsCodeList(params);
224 + });
225 + },
226 + // 确认对话框
227 + dialogConfirm() {},
228 + // 下载【HScode黑名单下载模板】
229 + downloadTemplate() {
230 + downLoadTemplate("hsCode")
231 + .then((res) => {
232 + if (res) {
233 + const blob = new Blob([res]);
234 + const link = document.createElement("a"); //创建a标签
235 + link.download = "HSCODE黑名单表.xlsx"; //a标签添加属性
236 + link.style.display = "none";
237 + link.href = URL.createObjectURL(blob);
238 + document.body.appendChild(link);
239 + link.click(); //执行下载
240 + URL.revokeObjectURL(link.href); //释放url
241 + document.body.removeChild(link); //释放标签
242 + } else {
243 + this.$message.error("下载失败");
244 + }
245 + })
246 + .catch(() => {});
247 + },
248 + // 上传
249 + upLoadTemplate() {
250 + // console.log(this.$refs.modleViewRef);
251 + },
252 + // 导出
253 + exportTemplate(row, i) {
254 + this.tableAttr.btnCofig.btnGroup[i].loading = true;
255 + downLoadXlsx("/etes/exportHsCodeList", this.queryForm, "HSCODE黑名单表")
256 + .then(() => {
257 + this.tableAttr.btnCofig.btnGroup[i].loading = false;
258 + })
259 + .catch(() => {
260 + this.$message.error("导出失败");
261 + });
262 + },
263 + // 删除
264 + deleteData(row) {
265 + if (this.multipleSelection.length) {
266 + let params = [];
267 + this.multipleSelection.map((item) => {
268 + params.push(item.id);
269 + });
270 + this.$confirm("是否确认删除?", "提示", {
271 + confirmButtonText: "确定",
272 + cancelButtonText: "取消",
273 + type: "warning",
274 + center: true,
275 + })
276 + .then(() => {
277 + this.toDelBlackList(params);
278 + })
279 + .catch(() => {});
280 + } else {
281 + this.$message.error("请勾选一条或者多条数据再操作!");
282 + }
283 + },
284 + //条数变化
285 + handleSizeChange(e) {
286 + this.pageConfig.pageData.size = e;
287 + this.pageConfig.pageData.page = 1;
288 + this.searchBtn();
289 + },
290 + //页码变化
291 + handleCurrentChange(e) {
292 + this.pageConfig.pageData.page = e;
293 + this.searchBtn();
294 + },
295 + // table勾选
296 + tableSelectionChange(val) {
297 + this.multipleSelection = val;
298 + },
299 + // 删除
300 + deleteRow({ row }) {
301 + this.$confirm("是否确认删除?", "提示", {
302 + confirmButtonText: "确定",
303 + cancelButtonText: "取消",
304 + type: "warning",
305 + center: true,
306 + })
307 + .then(() => {
308 + this.toDelBlackList([row.id]);
309 + })
310 + .catch(() => {});
311 + },
312 + },
313 +};
314 +</script>
315 +<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-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: "ShipmentDesc",
77 + prop: "ShipmentDesc",
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 +];
...@@ -195,7 +195,7 @@ export default { ...@@ -195,7 +195,7 @@ 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",
......
...@@ -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 //数据查询
......