Elements-SY

Merge branch 'test' into uat

Showing 40 changed files with 1882 additions and 704 deletions
import request from "@/utils/request";
// ET86查询
/**
* @param createTimeStart; 开始时间
* @param createTimeEnd; 结束时间
* @param status; 1-有效 0-无效 不传查全部
*/
export function findAllEtesRules(data) {
return request({
url: "/etes/findAllEtesRules",
method: "post",
data: data,
});
}
// ET86新增
export function add(data) {
return request({
url: "/etes/add",
method: "post",
data: data,
});
}
// ET86详情
export function findEtesRuleById(data) {
return request({
url: "/etes/findEtesRuleById",
method: "post",
data: data,
});
}
// ET86编辑
export function update(data) {
return request({
url: "/etes/update",
method: "post",
data: data,
});
}
// ET86删除
export function deleteEtesRuleById(data) {
return request({
url: "/etes/deleteEtesRuleById",
method: "post",
data: data,
});
}
import request from "@/utils/request";
// HScode黑名单查询
export function findHsCodeList(data) {
return request({
url: "/etes/findHsCodeList",
method: "post",
data: data,
});
}
// HScode黑名单删除
export function delBlackList(data) {
return request({
url: "/etes/delBlackList",
method: "post",
data: data,
});
}
// HScode黑名单下载模板
export function downLoadTemplate(template) {
return request({
url: "/etes/downLoadTemplate?template=" + template,
method: "get",
responseType: "blob",
});
}
// HScode黑名单导入
export function uploadHsCode(data) {
return request({
url: "/etes/uploadHsCode",
method: "post",
data: data,
});
}
import request from "@/utils/request";
// HScode英文品名黑名单查询
export function findShipmentDescList(data) {
return request({
url: "/etes/findShipmentDescList",
method: "post",
data: data,
});
}
// HScode英文品名黑名单导入
export function uploadShipmentDesc(data) {
return request({
url: "/etes/uploadShipmentDesc",
method: "post",
data: data,
});
}
// HScode黑名单/英文品名删除
export function delBlackList(data) {
return request({
url: "/etes/delBlackList ",
method: "post",
data: data,
});
}
......@@ -7,22 +7,45 @@
<el-form
:model="tempQueryForm"
:inline="inline"
:label-position="position"
:label-width="formWidth"
:loading="loading"
ref="ruleForm"
:size="size"
>
<el-form-item
<el-row
:gutter="rowGutter"
:type="rowType"
:justify="rowJustify"
:align="rowAlign"
:tag="rowTag"
>
<el-col
v-for="item in tempFormConfig"
:label="item.label"
:span="item.span"
:offset="item.offset"
:tag="item.tag"
:push="item.push"
:pull="item.pull"
:xs="item.xs"
:sm="item.sm"
:md="item.md"
:lg="item.lg"
:xl="item.xl"
:style="{ width: item.colWidth }"
:key="item.prop"
>
<el-form-item
:label="item.label"
:prop="item.prop"
:rules="item.rules"
:label-width="item.labelWidth"
>
<!-- 输入框 -->
<el-input
v-if="item.type === 'Input'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请输入' + item.label
......@@ -46,7 +69,7 @@
:min="item.min"
:max="item.max"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="
item.placeholder ? item.placeholder : '请输入' + item.label
......@@ -62,20 +85,21 @@
:min="0"
:max="10"
:size="item.size"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
label="描述文字"
></el-input-number>
<template v-if="view">
<span v-text="tempQueryForm[item.prop]"></span>
</template>
<!-- 下拉选择 -->
<el-select
v-if="item.type === 'Select'"
:multiple="item.multiple"
:filterable="item.filterable"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:loading="searchLoading"
:placeholder="
......@@ -91,11 +115,12 @@
>
</el-option>
</el-select>
<!-- 远程搜索 -->
<template v-if="item.type === 'Search'">
<el-autocomplete
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
:debounce="1500"
:fetch-suggestions="querySearchAsync"
:placeholder="
......@@ -111,9 +136,10 @@
<el-date-picker
v-if="item.type === 'Date'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="item.placeholder ? item.placeholder : '请选择日期'"
:value-format="item.format"
clearable
>
</el-date-picker>
......@@ -122,7 +148,7 @@
<el-time-select
v-if="item.type === 'Time'"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:placeholder="item.placeholder ? item.placeholder : '请选择时间'"
clearable
......@@ -145,7 +171,7 @@
v-if="item.type === 'datetimerange'"
type="datetimerange"
v-model.trim="tempQueryForm[item.prop]"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
range-separator="至"
start-placeholder="开始日期"
......@@ -188,7 +214,7 @@
v-if="item.type === 'textarea'"
v-model.trim="tempQueryForm[item.prop]"
type="textarea"
:style="{ width: item.width }"
:style="{ width: item.inputWidth }"
:disabled="item.disable"
:rows="item.row"
:autosize="item.autosize"
......@@ -198,6 +224,7 @@
clearable
>
</el-input>
<!-- 多选框 -->
<template v-if="item.type === 'Checkbox'">
<el-checkbox
......@@ -206,6 +233,7 @@
></el-checkbox>
</template>
</el-form-item>
</el-col>
<!-- 查询按钮 de-->
<span v-show="inline & hiddenFormBtn">
<el-form-item v-show="show">
......@@ -223,6 +251,7 @@
<el-button @click="resetFields('ruleForm')">重置</el-button>
</el-form-item>
</span>
</el-row>
</el-form>
</div>
</template>
......@@ -232,30 +261,25 @@ import request from "@/utils/request";
import { deepClone } from "@/utils";
export default {
props: {
marginBottom: {
rowGutter: {
type: Number,
default: 30,
default: 24,
},
view: {
type: Boolean,
default: false,
},
formBtn: {
rowType: {
type: String,
default: "查询",
default: "",
},
btnLoading: {
type: Boolean,
default: false,
rowJustify: {
type: String,
default: "",
},
loading: {
//加载
type: Boolean,
default: false,
rowAlign: {
type: String,
default: "",
},
isBtnSave: {
type: Boolean,
default: false,
rowTag: {
type: String,
default: "div",
},
// 由inline属性决定form表单是普通表单,还是行内表单
inline: {
......@@ -272,14 +296,14 @@ export default {
type: Boolean,
default: false,
},
labelWidth: {
type: String,
default: "120px",
},
formWidth: {
//form表单宽度
type: String,
default: "200px",
default: "auto",
},
position: {
type: String,
default: "",
},
formConfig: {
type: Array,
......@@ -294,6 +318,31 @@ export default {
type: String,
default: "small",
},
marginBottom: {
type: Number,
default: 0,
},
view: {
type: Boolean,
default: false,
},
formBtn: {
type: String,
default: "查询",
},
btnLoading: {
type: Boolean,
default: false,
},
loading: {
//加载
type: Boolean,
default: false,
},
isBtnSave: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -310,7 +359,7 @@ export default {
methods: {
// input事件绑定和注册
inputEvent(e, item) {
this.$emit("input", this.tempQueryForm);
this.$emit(item.trigger, this.tempQueryForm);
},
// 回车事件
toEnterSearch() {
......
<template>
<div class="table-container">
<el-row v-if="attrs.btnCofig.isBtn" style="margin-bottom: 15px">
<el-row
v-if="attrs.btnCofig.isBtn"
style="margin-bottom: 15px"
id="group-btn"
>
<el-col>
<span
v-for="(item, i) in attrs.btnCofig.btnGroup"
:key="item.btnName"
:class="i == 0 ? 'first-span' : 'span'"
>
<el-button
:type="item.type"
:icon="item.icon"
:round="item.round"
:size="item.size"
:loading="item.loading"
@click="handleClick(item, i)"
v-if="item.btnName !== '导入' && item.btnName !== '增加'"
>{{ item.btnName }}</el-button
>
<el-upload
v-else
ref="upload"
:action="item.action"
:fileName="item.fileName"
:http-request="toUpload"
:on-remove="onRemoveUpload"
:limit="item.limit"
:accept="item.accept"
:show-file-list="false"
class="upload"
>
<el-button
v-for="item in attrs.btnCofig.btnGroup"
:key="item.icon"
:type="item.type"
:icon="item.icon"
:round="item.round"
:size="item.size"
:loading="item.loading"
@click="handleClick(item)"
>{{ item.btnName }}</el-button
>
</el-upload>
</span>
</el-col>
</el-row>
<el-table
......@@ -27,8 +57,8 @@
:header-cell-class-name="headerCellClassName"
>
<template v-if="columns.length">
<template v-for="(item, index) in columns">
<column v-if="!item.hidden" :key="index" :attrs="item"></column>
<template v-for="item in columns">
<column v-if="!item.hidden" :key="item.id" :attrs="item"></column>
</template>
</template>
<slot name="column" v-else></slot>
......@@ -36,8 +66,10 @@
<!-- 分页 -->
<div
v-if="pageConfig.isPagination"
id="pagination"
class="pagination-container"
:style="{ textAlign: pageConfig.position || 'right' }"
ref="paginationRef"
>
<el-pagination
background
......@@ -193,8 +225,8 @@ export default {
this.$emit("currentChange", e);
},
// btn点击事件注册
handleClick(item) {
this.$emit(item.event, item);
handleClick(item, i) {
this.$emit(item.event, item, i);
},
// 拖拽行更新排序
rowDrop() {
......@@ -231,6 +263,17 @@ export default {
},
});
},
// 选择上传
toUpload(options) {
this.$refs.upload.map((item) => {
item.clearFiles(); //上传成功之后清除历史记录
});
this.$emit("upload", options);
},
//移除上传
onRemoveUpload(file, fileList) {
this.$emit("rmfile", { file, fileList });
},
},
watch: {
data() {
......@@ -250,4 +293,10 @@ export default {
padding: 0;
}
}
.first-span,.span{
display: inline-block;
}
.span{
margin-left: 6px;
}
</style>
......
......@@ -8,7 +8,7 @@
<navbar />
<tags-view v-if="needTagsView" />
</div>
<app-main />
<app-main ref="appMainBlock" />
<right-panel v-if="false">
<settings />
</right-panel>
......
import store from '@/store'
import store from "@/store";
const { body } = document
const WIDTH = 992 // refer to Bootstrap's responsive design
const { body } = document;
const WIDTH = 992; // refer to Bootstrap's responsive design
export default {
watch: {
$route(route) {
if (this.device === 'mobile' && this.sidebar.opened) {
store.dispatch('app/closeSideBar', { withoutAnimation: false })
}
this.getBlockCurrentHeight();
if (this.device === "mobile" && this.sidebar.opened) {
store.dispatch("app/closeSideBar", { withoutAnimation: false });
}
},
},
beforeMount() {
window.addEventListener('resize', this.$_resizeHandler)
window.addEventListener("resize", this.$_resizeHandler);
},
beforeDestroy() {
window.removeEventListener('resize', this.$_resizeHandler)
window.removeEventListener("resize", this.$_resizeHandler);
},
mounted() {
const isMobile = this.$_isMobile()
const isMobile = this.$_isMobile();
if (isMobile) {
store.dispatch('app/toggleDevice', 'mobile')
store.dispatch('app/closeSideBar', { withoutAnimation: true })
store.dispatch("app/toggleDevice", "mobile");
store.dispatch("app/closeSideBar", { withoutAnimation: true });
}
this.$nextTick(()=>{
this.getBlockCurrentHeight();
})
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_isMobile() {
const rect = body.getBoundingClientRect()
return rect.width - 1 < WIDTH
const rect = body.getBoundingClientRect();
return rect.width - 1 < WIDTH;
},
$_resizeHandler() {
if (!document.hidden) {
const isMobile = this.$_isMobile()
store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop')
const isMobile = this.$_isMobile();
store.dispatch("app/toggleDevice", isMobile ? "mobile" : "desktop");
if (isMobile) {
store.dispatch('app/closeSideBar', { withoutAnimation: true })
}
}
store.dispatch("app/closeSideBar", { withoutAnimation: true });
}
}
}
},
getBlockCurrentHeight() {
let height = this.$refs.appMainBlock.$el.clientHeight;
this.$store.dispatch("app/setAppMainBlockCH", height);
},
},
};
......
......@@ -73,19 +73,18 @@ export const constantRoutes = [
hidden: true,
children: [
{
path: "/et86",
path: "/edit",
component: (resolve) =>
require(["@/views/allocationConfig/et86"], resolve),
name: "et86",
meta: { title: "ET86", icon: "user" },
children: [],
require(["@/views/et86Config/et86RuleConfig/edit"], resolve),
name: "edit",
meta: { title: "ET86规则", icon: "user", noCache: false },
},
{
path: "/et86/:edit",
path: "/errorInfo",
component: (resolve) =>
require(["@/views/allocationConfig/et86/edit"], resolve),
name: "edit",
meta: { title: "编辑", icon: "user" },
require(["@/views/et86Config/errorInfo"], resolve),
name: "errorInfo",
meta: { title: "错误信息提示", icon: "user" },
},
{
path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status",
......
const getters = {
sidebar: state => state.app.sidebar,
size: state => state.app.size,
device: state => state.app.device,
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
id: state => state.user.id,
activePortName: state => state.user.activePortName,
portName: state => state.user.portName,
introduction: state => state.user.introduction,
roles: state => state.user.roles,
permissions: state => state.user.permissions,
permission_routes: state => state.permission.routes,
topbarRouters: state => state.permission.topbarRouters,
defaultRoutes: state => state.permission.defaultRoutes,
sidebarRouters: state => state.permission.sidebarRouters,
filghtAllData: state => state.permission.filghtAllData,
tableHeader: state => state.user.tableHeader
}
sidebar: (state) => state.app.sidebar,
size: (state) => state.app.size,
device: (state) => state.app.device,
appMainBlockClientHeight: (state) => state.app.appMainBlockClientHeight,
visitedViews: (state) => state.tagsView.visitedViews,
cachedViews: (state) => state.tagsView.cachedViews,
token: (state) => state.user.token,
avatar: (state) => state.user.avatar,
name: (state) => state.user.name,
id: (state) => state.user.id,
activePortName: (state) => state.user.activePortName,
portName: (state) => state.user.portName,
introduction: (state) => state.user.introduction,
roles: (state) => state.user.roles,
permissions: (state) => state.user.permissions,
permission_routes: (state) => state.permission.routes,
topbarRouters: (state) => state.permission.topbarRouters,
defaultRoutes: (state) => state.permission.defaultRoutes,
sidebarRouters: (state) => state.permission.sidebarRouters,
filghtAllData: (state) => state.permission.filghtAllData,
tableHeader: (state) => state.user.tableHeader,
};
export default getters
......
......@@ -2,13 +2,16 @@
const state = {
sidebar: {
opened: localStorage.getItem('sidebarStatus') ? !!+localStorage.getItem('sidebarStatus') : true,
withoutAnimation: false
opened: localStorage.getItem("sidebarStatus")
? !!+localStorage.getItem("sidebarStatus")
: true,
withoutAnimation: false,
},
device: 'desktop',
device: "desktop",
//size: Cookies.get('size') || 'medium'
size: localStorage.getItem('size') || 'medium'
}
size: localStorage.getItem("size") || "medium",
appMainBlockClientHeight: null
};
const mutations = {
TOGGLE_SIDEBAR: state => {
......@@ -35,23 +38,30 @@ const mutations = {
state.size = size
//Cookies.set('size', size)
localStorage.setItem('size', size)
}
},
SET_APPMAINBLOCKCH: (state, height) => {
state.appMainBlockClientHeight = height;
},
}
const actions = {
toggleSideBar({ commit }) {
commit('TOGGLE_SIDEBAR')
commit("TOGGLE_SIDEBAR");
},
closeSideBar({ commit }, { withoutAnimation }) {
commit('CLOSE_SIDEBAR', withoutAnimation)
commit("CLOSE_SIDEBAR", withoutAnimation);
},
toggleDevice({ commit }, device) {
commit('TOGGLE_DEVICE', device)
commit("TOGGLE_DEVICE", device);
},
setSize({ commit }, size) {
commit('SET_SIZE', size)
}
}
commit("SET_SIZE", size);
},
setAppMainBlockCH({ commit }, height) {
commit("SET_APPMAINBLOCKCH", height);
},
};
export default {
namespaced: true,
......
......@@ -54,26 +54,6 @@ const permission = {
return new Promise((resolve) => {
// 向后端请求路由数据
getRouters().then((res) => {
// const newUrl = {
// id: 24,
// name: "et86",
// path: "/et86",
// hidden: false,
// component: "allocationConfig/et86",
// meta: {
// title: "ET86",
// icon: "edit",
// permissions: "allocation:rand:list",
// noCache: false,
// },
// alwaysShow: false,
// children: null,
// };
// res.data.map((item) => {
// if (item.name == "AllocationConfig") {
// item.children.push(newUrl);
// }
// });
res.data = hasPermi.routerPer(res.data);
const sdata = JSON.parse(JSON.stringify(res.data));
const rdata = JSON.parse(JSON.stringify(res.data));
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
......@@ -81,7 +81,7 @@ service.interceptors.response.use(res => {
type: 'error'
})
return Promise.reject(new Error(msg))
} else if (code !== 200 && code !== 201 && code !== 202 && code !== 203 && code !== 603) {
} else if (code !== 200 && code !== 201 && code !== 202 && code != 203 && code != 603 && code != 402) {
Message({
message: msg,
type: 'error'
......
<template>
<div class=''></div>
</template>
<script>
export default {
name: '',
components: {},
data() {
return {
}
},
computed: {},
created () {},
mounted () {},
methods: {}
}
</script>
<style lang='scss' scoped>
</style>
<template>
<div class=''></div>
</template>
<script>
export default {
name: '',
components: {},
data() {
return {
}
},
computed: {},
created () {},
mounted () {},
methods: {}
}
</script>
<style lang='scss' scoped>
</style>
This diff is collapsed. Click to expand it.
<template>
<div class="form-header container">
<el-row>
<el-col>
<yl-form
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
@input="inputEvent"
@keyup="keyUpEvent"
/>
</el-col>
</el-row>
<yl-table
:attrs="tableAttr"
:loadingTable="tableAttr.loadingTable"
:columns="columns"
:tableData="tableData"
:pageConfig="pageConfig"
@sizeChange="handleSizeChange"
@currentChange="handleCurrentChange"
@search="searchBtn"
@restForm="restForm"
@add="addBtn"
>
</yl-table>
</div>
</template>
<script>
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import { formConfig } from "./formConfig";
import { debounce } from "@/utils";
import { tableAttr, columnHeader, tableData } from "./tableConfig";
import {
allDictData, // 获取全部字典
queryRouteByFltNo, // 航线查询
} from "@/api/destinationFlight";
export default {
components: {
YlForm,
YlTable,
},
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
// 表单参数
status: "有效",
},
pageConfig: {
// 分页配置项
isPagination: true,
total: 13,
pageData: {
page: 1,
size: 10,
},
},
tableAttr: tableAttr, // table配置项
columns: columnHeader(this.viewRow, this.editRow, this.deleteRow), // 表头
tableData: tableData, // 表格数据
selectionList: [], // table复选框筛选集合
};
},
created() {},
mounted() {},
methods: {
// 航线查询
queryRoute(item) {
queryRouteByFltNo(item).then((res) => {
if (res.code == 200) {
const list = res.data.list;
let routeList = "";
if (list.length) {
list.map((item) => {
routeList += item.route + ",";
});
this.queryForm.fltRoute = routeList.substring(
0,
routeList.length - 1
);
} else {
this.queryForm = {
fltNo: item.fltNo, // 航班号
};
}
}
});
},
// input事件
inputEvent: debounce(function () {
this.queryRoute({
fltNo: this.queryForm.fltNo, // 航班号
});
}, 800),
// 回车事件
keyUpEvent(item) {
this.queryRoute(item);
},
// table复选框事件
selectionTable(e) {
console.log("selectionTable:", e);
this.selectionList = e;
},
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
console.log("sizeChange:", e);
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
console.log("currentChange:", e);
},
// 搜索
searchBtn(row) {
let params = {
...this.queryForm,
};
if (this.queryForm.status == "有效") {
params.status = '1';
}
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
console.log(params);
});
},
// 重置表单
restForm() {
this.$refs.ruleForm.resetFields("ruleForm");
},
// 添加
addBtn(item) {
console.log("add:", item);
this.$router.push({
name: "edit",
params: {
edit: 12,
},
});
},
// 编辑
editRow(item) {
this.$router.push({
name: "edit",
params: {
edit: 12,
},
});
console.log("修改:", item);
},
// 删除
deleteRow(item) {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
console.log("删除:", item);
this.msgSuccess("删除成功!");
})
.catch(() => {});
},
// 查看
viewRow({ row }) {
this.$router.push({
name: "edit",
params: {
edit: 12,
},
});
console.log("查看:", row);
},
},
};
</script>
<style lang="scss" scoped></style>
const state = {
1: "有效",
3: "无效",
};
export const tableAttr = {
border: true,
loadingTable: false,
isDragSort: false, // 拖拽tableData数据一定要加id字段
maxHeight: 300,
btnCofig: {
isBtn: true,
btnGroup: [
{
type: "primary", // text、primary、danger
icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
btnName: "搜索",
size: "mini", // medium / small / mini
round: false,
loading: false,
event: "search",
},
{
type: "info",
icon: "",
btnName: "重置",
size: "mini",
round: false,
loading: false,
event: "restForm",
},
{
type: "primary",
icon: "el-icon-plus",
btnName: "添加",
size: "mini",
round: false,
loading: false,
event: "add",
},
],
},
};
export const columnHeader = (viewRow, editRow, deleteRow) => [
{
type: "selection",
align: "center",
prop: "selection",
width: "50",
},
{
type: "index",
label: "序号",
prop: "id",
align: "center",
width: "50",
},
{
label: "原航班号",
prop: "fltNo",
align: "center",
minWidth: 100,
},
{
label: "顺位航班",
prop: "flightRand",
align: "center",
minWidth: 100,
},
{
label: "URSA包含",
prop: "includeUrsa",
align: "center",
minWidth: 100,
},
{
label: "URSA不包含",
prop: "notIncludeUrsa",
align: "center",
minWidth: 100,
},
{
label: "状态",
prop: "status",
align: "center",
minWidth: 100,
render: (h, params) => {
const { row } = params;
return h("div", `${state[row.status]}`);
},
},
{
label: "创建时间",
prop: "createTime",
align: "center",
minWidth: 100,
sortable: true,
"sort-method": (a, b) => b.createTime - a.createTime,
},
{
label: "创建人",
prop: "createUserName",
align: "center",
minWidth: 100,
},
{
label: "修改时间",
prop: "updateTime",
align: "center",
minWidth: 100,
},
{
label: "修改人",
prop: "updateUserName",
align: "center",
minWidth: 100,
},
{
label: "操作",
prop: "operate",
align: "center",
minWidth: 120,
fixed: "right",
render: (h, params) => {
return h("div", [
h(
"el-button",
{
props: {
type: "text",
size: "mini",
icon: "el-icon-view",
},
on: {
click() {
viewRow(params);
},
},
},
"查看"
),
h(
"el-button",
{
props: {
type: "text",
size: "mini",
icon: "el-icon-edit",
},
on: {
click() {
editRow(params);
},
},
},
"修改"
),
h(
"el-button",
{
style: {
color: "#ff4949",
},
props: {
type: "text",
size: "mini",
icon: "el-icon-delete",
},
on: {
click() {
deleteRow(params);
},
},
},
"删除"
),
]);
},
},
];
export const tableData = [
{
id: "1",
flightRand: "LZ003;LZ00",
status: "1",
fltNo: "FX0090",
includeUrsa: "URSACODE191",
notIncludeUrsa: "P_3",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "2",
flightRand: "LP001;LP004+1",
status: "3",
fltNo: "FX0090",
includeUrsa: "P_;URSACODE105",
notIncludeUrsa: "P_21",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "3",
flightRand: "CQ00;LZ003;CS0004",
status: "1",
fltNo: "CS0002",
includeUrsa: "URSACODE12",
notIncludeUrsa: "P_2",
createTime: "2023-08-14",
createUserName: "wjh",
updateTime: "2023-08-14",
updateUserName: "wjh",
},
{
id: "4",
flightRand: "LZ001;LZ002;LZ004",
status: "1",
fltNo: "FX0090",
includeUrsa: "URSACODE192",
notIncludeUrsa: "P_17",
createTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "5",
flightRand: "PS001;PS003",
status: "1",
fltNo: "FX0091",
includeUrsa: "URSACODE10",
notIncludeUrsa: "P_28",
createTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "6",
flightRand: "PS002;PS003",
status: "3",
fltNo: "XN007",
includeUrsa: "URSACODE27",
notIncludeUrsa: "P_4",
createTime: "2023-08-11",
createUserName: "wjh",
updateTime: "2023-08-11",
updateUserName: "wjh",
},
{
id: "7",
flightRand: "XN001;XN002;XN003;XN004",
status: "1",
fltNo: "XN001",
includeUrsa: "URSACODE34",
notIncludeUrsa: "P_7",
createTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
{
id: "8",
flightRand: "HA004",
status: "3",
fltNo: "LZ007",
includeUrsa: "URSACODE71",
notIncludeUrsa: "P_2",
createTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
{
id: "9",
flightRand: "AB0001;AB123",
status: "1",
fltNo: "AB0001",
includeUrsa: "URSACODE87",
notIncludeUrsa: "P_26",
createTime: "2023-08-10",
createUserName: "wjh",
updateTime: "2023-08-10",
updateUserName: "wjh",
},
];
<template>
<div class="form-header container">
<yl-table
:attrs="tableAttr"
:loadingTable="tableAttr.loadingTable"
:columns="columns"
:tableData="tableData"
:pageConfig="pageConfig"
@sizeChange="handleSizeChange"
@currentChange="handleCurrentChange"
>
</yl-table>
</div>
</template>
<script>
import YlTable from "@/components/YlTable";
import { tableAttr, columnHeader } from "./tableConfig";
export default {
name: "ErrorInfo",
components: {
YlTable,
},
data() {
return {
pageConfig: {
// 分页配置项
isPagination: false,
total: 0,
pageData: {
page: 1,
size: 10,
},
},
tableAttr: tableAttr, // table配置项
columns: columnHeader(), // 表头
tableData: [], // 表格数据
};
},
created() {
const { data } = this.$route.query;
this.tableData = JSON.parse(data);
},
methods: {
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.searchBtn();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.searchBtn();
},
// 搜索
searchBtn() {},
},
};
</script>
<style lang="scss" scoped></style>
export const tableAttr = {
border: true,
loadingTable: false,
isDragSort: false, // 拖拽tableData数据一定要加id字段
maxHeight: 300,
btnCofig: {
isBtn: false,
btnGroup: [],
},
};
export const columnHeader = () => [
{
type: "index",
label: "序号",
prop: "rowNum",
align: "center",
width: "70",
},
{
label: "错误信息",
prop: "msg",
align: "center",
minWidth: 150,
},
];
<template>
<div class="error-container">
<el-dialog
:width="width"
:title="title"
:center="center"
:visible.sync="dialogVisible"
:close-on-click-modal="onModalClickClose"
@open="dialogOpenEvent"
@close="dialogCloseEvent"
>
<slot></slot>
<span slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">{{
confirmBtnName
}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
width: {
type: String,
default: "50%",
},
title: {
type: String,
default: "标题",
},
center: {
type: String,
default: "center",
},
confirmBtnName: {
type: String,
default: "确 定",
},
onModalClickClose: {
type: Boolean,
default: false,
},
},
data() {
return {
dialogVisible: false,
};
},
computed: {},
created() {},
mounted() {},
methods: {
dialogOpenEvent(data) {
if (data && data.length) {
console.log(data);
}
this.dialogVisible = true;
this.$emit("open");
},
dialogCloseEvent() {
this.dialogVisible = false;
this.$emit("close");
},
// 确认事件
confirm() {
this.dialogVisible = false;
this.$emit("confirm");
},
// 取消事件
cancel() {
this.dialogVisible = false;
this.$emit("cancel");
},
},
};
</script>
<style lang='scss' scoped>
</style>
export const formConfig = [
{
label: "HSCODE",
type: "Input",
name: "searchValue",
prop: "searchValue",
placeholder: "根据Hscode查询",
span: 6,
trigger: "blur", // 事件名
},
];
<template>
<div ref="formHeaderRef" class="form-header container">
<el-row>
<el-col>
<yl-form
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
:inline="false"
formWidth="auto"
@blur="blurEvent"
/>
</el-col>
</el-row>
<yl-table
ref="ylTable"
:attrs="tableAttr"
:loadingTable="tableAttr.loadingTable"
:columns="columns"
:tableData="tableData"
:pageConfig="pageConfig"
@search="searchBtn"
@download="downloadTemplate"
@upload="toUpload"
@rmfile="onRemoveUpload"
@export="exportTemplate"
@delete="deleteData"
@sizeChange="handleSizeChange"
@currentChange="handleCurrentChange"
@selectionEvent="tableSelectionChange"
>
</yl-table>
<!-- <modle-view
ref="modleViewRef"
width="30%"
title="导入Excel"
confirmBtnName="导入Excel"
@confirm="dialogConfirm"
>
<el-form
:model="paramsForm"
:rules="rules"
ref="ruleForm"
label-width="80px"
>
<el-row>
<el-col :span="20">
<el-form-item
label="商品名称"
prop="skuName"
size="small"
label-position="left"
>
<el-input
v-model="paramsForm.skuName"
placeholder="请输入商品名称"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item prop="file">
<el-upload
ref="upload"
action="/goods/uploadGoodsExcel"
name="file"
:http-request="toUpload"
:on-remove="onRemoveUpload"
:limit="1"
accept=".xlsx"
class="upload"
>
<el-button type="primary" icon="el-icon-upload2" size="small"
>选择文件</el-button
>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</modle-view> -->
</div>
</template>
<script>
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import ModleView from "./components/ModleView";
import { formConfig } from "./formConfig";
import { tableAttr, columnHeader } from "./tableConfig";
import { restTableHeight } from "@/utils";
import {
findHsCodeList, // ShipmentDesc查询
delBlackList, // ShipmentDesc删除
downLoadTemplate, // ShipmentDesc下载模板
uploadHsCode, // ShipmentDesc导入
} from "@/api/et86HsCodeBlack";
import { downLoadXlsx } from "@/utils/zipdownload";
export default {
name: "Et86HsCodeBlack",
components: {
YlForm,
YlTable,
ModleView,
},
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
searchValue: "",
}, // 表单参数
paramsForm: {
skuName: "",
file: null,
},
rules: {
skuName: [
{ required: true, message: "请输入商品名称", trigger: "blur" },
],
},
pageConfig: {
// 分页配置项
isPagination: true,
total: 0,
pageData: {
page: 1,
size: 10,
},
},
tableAttr: tableAttr, // table配置项
columns: columnHeader(this.deleteRow), // 表头
tableData: [], // 表格数据
multipleSelection: [],
};
},
created() {
// 黑名单查询
this.$nextTick(() => {
this.searchBtn();
});
},
mounted() {
this.$nextTick(() => {
this.tableAttr.maxHeight =
window.innerHeight - restTableHeight(this.$refs);
});
},
methods: {
// HScode黑名单查询
queryFindHsCodeList() {
const { page, size } = this.pageConfig.pageData;
let params = {
limitStart: (page - 1) * size,
limitSize: size,
...this.queryForm,
};
this.tableAttr.loadingTable = true;
findHsCodeList(params)
.then((res) => {
this.tableAttr.loadingTable = false;
const { code, data } = res;
if (code == 200) {
this.tableData = data.list;
this.pageConfig.total = data.total;
}
})
.catch(() => {});
},
// 删除黑名单
toDelBlackList(params) {
delBlackList(params)
.then((res) => {
const { code, msg } = res;
if (code == 200) {
this.searchBtn();
this.msgSuccess(msg || "删除成功!");
} else {
this.$message.error(msg || "删除失败");
}
})
.catch(() => {});
},
// 失焦事件
blurEvent() {},
// 选择上传【HScode黑名单导入】
toUpload({ file }) {
const formData = new FormData();
formData.append("file", file);
uploadHsCode(formData)
.then((res) => {
const { code, data, msg } = res;
if (code == 200) {
this.searchBtn();
this.msgSuccess(msg || "导入成功!");
} else {
this.$message.error(msg || "导入失败");
this.$router.push({
path: "/errorInfo",
query: {
name: "errorInfo",
error: code,
data: JSON.stringify(data),
},
});
}
})
.catch(() => {});
},
//移除上传
onRemoveUpload(options) {
console.log(options);
},
// 搜索
searchBtn() {
this.pageConfig.pageData.page = 1;
this.pageConfig.pageData.size = 10;
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
this.queryFindHsCodeList();
});
},
// 确认对话框
dialogConfirm() {},
// 下载【HScode黑名单下载模板】
downloadTemplate() {
downLoadTemplate("hsCode")
.then((res) => {
if (res) {
const blob = new Blob([res]);
const link = document.createElement("a"); //创建a标签
link.download = "HSCODE黑名单表.xlsx"; //a标签添加属性
link.style.display = "none";
link.href = URL.createObjectURL(blob);
document.body.appendChild(link);
link.click(); //执行下载
URL.revokeObjectURL(link.href); //释放url
document.body.removeChild(link); //释放标签
} else {
this.$message.error("下载失败");
}
})
.catch(() => {});
},
// 上传
upLoadTemplate() {
// console.log(this.$refs.modleViewRef);
},
// 导出
exportTemplate(row, i) {
this.tableAttr.btnCofig.btnGroup[i].loading = true;
downLoadXlsx("/etes/exportHsCodeList", this.queryForm, "HSCODE黑名单表")
.then(() => {
this.tableAttr.btnCofig.btnGroup[i].loading = false;
})
.catch(() => {
this.$message.error("导出失败");
});
},
// 删除
deleteData(row) {
if (this.multipleSelection.length) {
let params = [];
this.multipleSelection.map((item) => {
params.push(item.id);
});
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
this.toDelBlackList(params);
})
.catch(() => {});
} else {
this.$message.error("请勾选一条或者多条数据再操作!");
}
},
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.queryFindHsCodeList();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.queryFindHsCodeList();
},
// table勾选
tableSelectionChange(val) {
this.multipleSelection = val;
},
// 删除
deleteRow({ row }) {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
this.toDelBlackList([row.id]);
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped></style>
export const tableAttr = {
border: true,
loadingTable: false,
isDragSort: false, // 拖拽tableData数据一定要加id字段
maxHeight: 0,
btnCofig: {
isBtn: true,
btnGroup: [
{
type: "primary", // text、primary、danger
icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
btnName: "搜索",
size: "mini", // medium / small / mini
round: false,
loading: false,
event: "search",
},
{
type: "primary",
icon: "el-icon-download",
btnName: "下载模板",
size: "mini",
round: false,
loading: false,
event: "download",
},
{
type: "primary",
icon: "el-icon-upload",
btnName: "导入",
size: "mini",
round: false,
loading: false,
event: "upLoad",
action: "/goods/uploadGoodsExcel",
fileName: "name",
limit: 1,
accept: ".xlsx",
},
{
type: "primary",
icon: "el-icon-download",
btnName: "导出",
size: "mini",
round: false,
loading: false,
event: "export",
},
{
type: "danger",
icon: "el-icon-delete",
btnName: "删除",
size: "mini",
round: false,
loading: false,
event: "delete",
},
],
},
};
export const columnHeader = (deleteRow) => [
{
type: "selection",
align: "center",
prop: "selection",
width: "50",
},
{
type: "index",
label: "序号",
prop: "id",
align: "center",
width: "50",
},
{
label: "HSCODE",
prop: "blackValue",
align: "center",
minWidth: 100,
},
{
label: "创建时间",
prop: "createTime",
align: "center",
minWidth: 100,
},
{
label: "创建人",
prop: "createUserName",
align: "center",
minWidth: 100,
},
{
label: "文件名",
prop: "uploadFileName",
align: "center",
minWidth: 100,
},
{
label: "操作",
prop: "operate",
align: "center",
minWidth: 120,
fixed: "right",
render: (h, params) => {
return h("div", [
h(
"el-button",
{
style: {
color: "#ff4949",
},
props: {
type: "text",
size: "mini",
icon: "el-icon-delete",
},
on: {
click() {
deleteRow(params);
},
},
},
"删除"
),
]);
},
},
];
This diff is collapsed. Click to expand it.
......@@ -10,7 +10,7 @@ export default {
},
// 处理serviceCode包不包含
serviceCodeCofig() {
let str = this.queryForm.serviceCode.replace(/;|;/g, ",");
let str = this.serviceCode.replace(/;|;/g, ",");
let arr = str.split(",");
if (arr[arr.length - 1] == "") {
arr.splice(arr.length - 1, 1);
......@@ -28,7 +28,7 @@ export default {
};
},
// radio包含不包含serviceCode
isServiceCode(val) {
changeIsServiceCode(val) {
// 勾选的时候去校验 || 输入的时候去校验
if (val == 1) {
if (this.serviceCodeCofig().noInclude.length) {
......@@ -44,15 +44,15 @@ export default {
},
// serviceCode失焦事件
serviceCodeBlur() {
if (this.queryForm.isServiceCode == "1") {
if (this.isServiceCode == "1") {
if (this.serviceCodeCofig().noInclude.length) {
let tip = this.serviceCodeCofig().noInclude.toString();
this.msgError(`${tip} 不包含`);
// this.msgError(`${tip} 不包含`);
}
} else {
if (this.serviceCodeCofig().include.length) {
let tip = this.serviceCodeCofig().include.toString();
this.msgError(`${tip} 已包含`);
// this.msgError(`${tip} 已包含`);
}
}
},
......
......@@ -4,7 +4,7 @@ export const tableAttr = {
isDragSort: true, // 拖拽tableData数据一定要加id字段
maxHeight: 300,
btnCofig: {
isBtn: true,
isBtn: false,
btnGroup: [
{
type: "primary",
......@@ -22,32 +22,32 @@ export const tableAttr = {
export const columnHeader = (deleteRow) => [
{
label: "航班号",
prop: "fltNo",
prop: "flightNo",
align: "center",
minWidth: 100,
},
{
label: "航班日期",
prop: "fltNoDate",
prop: "calculateDay",
align: "center",
minWidth: 100,
// sortable: true,
// "sort-method": (a, b) => b.updateTime - a.updateTime,
},
{
label: "航线优先级",
prop: "fltRoute",
label: "航线",
prop: "flightRoute",
align: "center",
minWidth: 100,
},
{
label: "爆仓是否继续配舱",
prop: "isOn",
prop: "permitOverweight",
align: "center",
minWidth: 100,
render: (h, params) => {
const { row } = params;
console.log(345678,row);
console.log(345678, row);
// return h("div", `状态-${row.id}`);
},
},
......@@ -80,15 +80,3 @@ export const columnHeader = (deleteRow) => [
},
},
];
export const tableData = [
{
id: "1",
fltNo: "A380",
fltNoDate: "3",
fltRoute: "",
routeList: [],
isOn: "1",
sort: "1", // 排序字段
},
];
......
export const formConfig = [
{
label: "创建时间(从)",
label: "原航班",
type: "Input",
name: "originOfFlightNo",
prop: "originOfFlightNo",
placeholder: "请输入原航班号",
span: 5,
trigger: "blur",
labelWidth: "55px",
},
{
label: "修改时间 从",
type: "Date",
name: "startTime",
prop: "startTime",
width: "140px",
placeholder: "请选择开始时间",
rules: { required: true, message: "请选择开始时间", trigger: "blur" },
// rules: { required: true, message: "请选择开始时间", trigger: "blur" },
format: "yyyy-MM-dd",
colWidth: "23%",
inputWidth: "100%",
},
{
label: "创建时间(到)",
label: "",
type: "Date",
name: "endTime",
prop: "endTime",
width: "140px",
placeholder: "请选择结束时间",
rules: { required: true, message: "请选择结束时间", trigger: "blur" },
// rules: { required: true, message: "请选择结束时间", trigger: "blur" },
format: "yyyy-MM-dd",
colWidth: "20%",
labelWidth: "20px",
inputWidth: "100%",
},
{
label: "规则状态",
type: "Select",
name: "status",
prop: "status",
width: "140px",
placeholder: "请选择状态",
options: {
data: [
......@@ -31,13 +45,16 @@ export const formConfig = [
label: "有效",
},
{
value: "3",
value: "0",
label: "无效",
},
],
label: "有效",
value: "1",
},
colWidth: "18%",
labelWidth: "70px",
inputWidth: "100%",
},
];
......
<template>
<div ref="formHeaderRef" class="form-header container">
<el-row>
<el-col>
<yl-form
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
:inline="false"
formWidth="auto"
@blur="blurEvent"
/>
</el-col>
</el-row>
<yl-table
ref="ylTable"
:attrs="tableAttr"
:loadingTable="tableAttr.loadingTable"
:columns="columns"
:tableData="tableData"
:pageConfig="pageConfig"
@sizeChange="handleSizeChange"
@currentChange="handleCurrentChange"
@search="searchBtn"
@add="addBtn"
>
</yl-table>
</div>
</template>
<script>
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import { formConfig } from "./formConfig";
import { tableAttr, columnHeader } from "./tableConfig";
import { restTableHeight, sortList } from "@/utils";
import {
findAllEtesRules, // ET86查询
deleteEtesRuleById, // 删除
} from "@/api/et86";
export default {
components: {
YlForm,
YlTable,
},
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
// 表单参数
status: "有效",
},
pageConfig: {
// 分页配置项
isPagination: true,
total: 0,
pageData: {
page: 1,
size: 10,
},
},
tableAttr: tableAttr, // table配置项
columns: columnHeader(this.viewRow, this.editRow, this.deleteRow), // 表头
tableData: [], // 表格数据
};
},
created() {
// ET86查询
this.$nextTick(() => {
this.searchBtn();
});
},
mounted() {
this.$nextTick(() => {
this.tableAttr.maxHeight =
window.innerHeight - restTableHeight(this.$refs);
});
},
methods: {
// ET86查询
queryFindAllEtesRules() {
const { page, size } = this.pageConfig.pageData;
let params = {
originOfFlightNo: this.queryForm.originOfFlightNo,
updateTimeStart: this.queryForm.startTime
? this.queryForm.startTime
: "",
updateTimeEnd: this.queryForm.endTime ? this.queryForm.endTime : "",
limitStart: (page - 1) * size,
limitSize: size,
status: this.queryForm.status,
};
if (this.queryForm.status == "有效") {
params.status = "1";
}
this.tableAttr.loadingTable = true;
findAllEtesRules(params)
.then((res) => {
this.tableAttr.loadingTable = false;
const { code, data } = res;
if (code == 200) {
const valid = data.list.filter((item) => item.status == "1"); // 有效
const invalid = data.list.filter((item) => item.status == "0"); // 无效
// valid.reverse(); // 有效航班修改时间排序
// invalid.reverse(); //
// const newValid = sortList(valid, "originOfFlightNo"); // 有效原航班按字母排序
// const newInvalid = sortList(invalid, "originOfFlightNo");
// this.tableData = newValid.concat(newInvalid);
this.tableData = valid.concat(invalid);
this.pageConfig.total = data.total;
}
})
.catch(() => {});
},
// 失焦事件
blurEvent({ originOfFlightNo }) {
this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo);
},
// 搜索
searchBtn() {
this.pageConfig.pageData.page = 1;
this.pageConfig.pageData.size = 10;
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
this.queryFindAllEtesRules();
});
},
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.queryFindAllEtesRules();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.queryFindAllEtesRules();
},
// 添加
addBtn(item) {
this.$router.push({
path: "/edit",
query: {
name: "add",
},
});
},
// 重置表单
restForm() {
this.$refs.ruleForm.resetFields("ruleForm");
},
// 查看
viewRow({ row }) {
this.$router.push({
path: "/edit",
query: {
name: "view",
id: row.id,
status: row.status,
},
});
},
// 编辑
editRow({ row }) {
this.$router.push({
path: "/edit",
query: {
name: "edit",
id: row.id,
status: row.status,
},
});
},
// 删除
deleteRow({ row }) {
this.$confirm("是否确认删除? 删除后该规则设置为无效,不可恢复", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
deleteEtesRuleById({ id: row.id }).then((res) => {
const { code, msg } = res;
if (code == 200) {
this.searchBtn();
this.msgSuccess("删除成功!");
} else {
this.msgError(msg || "删除失败");
}
});
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped></style>
const state = {
1: "有效",
0: "无效",
};
export const tableAttr = {
border: true,
loadingTable: false,
isDragSort: false, // 拖拽tableData数据一定要加id字段
maxHeight: 0,
// defaultSort: { prop: "updateTime", order: "descending" },
btnCofig: {
isBtn: true,
btnGroup: [
{
type: "primary", // text、primary、danger
icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
btnName: "搜索",
size: "mini", // medium / small / mini
round: false,
loading: false,
event: "search",
},
{
type: "primary",
icon: "el-icon-plus",
btnName: "添加",
size: "mini",
round: false,
loading: false,
event: "add",
},
],
},
};
export const columnHeader = (viewRow, editRow, deleteRow) => [
{
type: "index",
label: "序号",
prop: "id",
align: "center",
width: "50",
},
{
label: "原航班",
prop: "originOfFlightNo",
align: "center",
minWidth: 80,
},
{
label: "配载航班",
prop: "rankFltNoStr",
align: "center",
minWidth: 120,
},
{
label: "航线",
prop: "rankFltRouteStr",
align: "center",
minWidth: 140,
},
{
label: "状态",
prop: "status",
align: "center",
minWidth: 50,
render: (h, params) => {
const { row } = params;
return h("div", `${state[row.status]}`);
},
},
{
label: "修改时间",
prop: "updateTime",
align: "center",
minWidth: 80,
// sortable: true,
// "sort-method": (a, b) => a.createTime - b.createTime,
},
{
label: "修改人",
prop: "updateUserName",
align: "center",
minWidth: 60,
},
{
label: "操作",
prop: "operate",
align: "center",
minWidth: 90,
fixed: "right",
render: (h, params) => {
let operateData = []
if (params.row.status == "1") {
operateData = [
h(
"el-button",
{
props: {
type: "text",
size: "mini",
icon: "el-icon-view",
},
on: {
click() {
viewRow(params);
},
},
},
"查看"
),
h(
"el-button",
{
props: {
type: "text",
size: "mini",
icon: "el-icon-edit",
},
on: {
click() {
editRow(params);
},
},
},
"修改"
),
h(
"el-button",
{
style: {
color: "#ff4949",
},
props: {
type: "text",
size: "mini",
icon: "el-icon-delete",
},
on: {
click() {
deleteRow(params);
},
},
},
"删除"
),
];
}else{
operateData = [
h(
"el-button",
{
props: {
type: "text",
size: "mini",
icon: "el-icon-view",
},
on: {
click() {
viewRow(params);
},
},
},
"查看"
),
];
}
return h("div", operateData);
},
},
];
<template>
<div class="error-container">
<el-dialog
:width="width"
:title="title"
:center="center"
:visible.sync="dialogVisible"
:close-on-click-modal="onModalClickClose"
@open="dialogOpenEvent"
@close="dialogCloseEvent"
>
<slot></slot>
<span slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">{{
confirmBtnName
}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
width: {
type: String,
default: "50%",
},
title: {
type: String,
default: "标题",
},
center: {
type: String,
default: "center",
},
confirmBtnName: {
type: String,
default: "确 定",
},
onModalClickClose: {
type: Boolean,
default: false,
},
},
data() {
return {
dialogVisible: false,
};
},
computed: {},
created() {},
mounted() {},
methods: {
dialogOpenEvent(data) {
if (data && data.length) {
console.log(data);
}
this.dialogVisible = true;
this.$emit("open");
},
dialogCloseEvent() {
this.dialogVisible = false;
this.$emit("close");
},
// 确认事件
confirm() {
this.dialogVisible = false;
this.$emit("confirm");
},
// 取消事件
cancel() {
this.dialogVisible = false;
this.$emit("cancel");
},
},
};
</script>
<style lang='scss' scoped>
</style>
export const formConfig = [
{
label: "ShipmentDesc",
type: "Input",
name: "searchValue",
prop: "searchValue",
placeholder: "根据ShipmentDesc查询",
span: 7,
trigger: "blur", // 事件名
},
];
<template>
<div ref="formHeaderRef" class="form-header container">
<el-row>
<el-col>
<yl-form
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
:inline="false"
formWidth="auto"
@blur="blurEvent"
/>
</el-col>
</el-row>
<yl-table
ref="ylTable"
:attrs="tableAttr"
:loadingTable="tableAttr.loadingTable"
:columns="columns"
:tableData="tableData"
:pageConfig="pageConfig"
@search="searchBtn"
@upload="toUpload"
@rmfile="onRemoveUpload"
@export="exportTemplate"
@delete="deleteData"
@sizeChange="handleSizeChange"
@currentChange="handleCurrentChange"
@selectionEvent="tableSelectionChange"
>
</yl-table>
<!-- <modle-view
ref="modleViewRef"
width="30%"
title="导入Excel"
confirmBtnName="导入Excel"
@confirm="dialogConfirm"
>
<el-form
:model="paramsForm"
:rules="rules"
ref="ruleForm"
label-width="80px"
>
<el-row>
<el-col :span="20">
<el-form-item
label="商品名称"
prop="skuName"
size="small"
label-position="left"
>
<el-input
v-model="paramsForm.skuName"
placeholder="请输入商品名称"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item prop="file">
<el-upload
ref="upload"
action="/goods/uploadGoodsExcel"
name="file"
:http-request="toUpload"
:on-remove="onRemoveUpload"
:limit="1"
accept=".xlsx"
class="upload"
>
<el-button type="primary" icon="el-icon-upload2" size="small"
>选择文件</el-button
>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</modle-view> -->
</div>
</template>
<script>
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import ModleView from "./components/ModleView";
import { formConfig } from "./formConfig";
import { tableAttr, columnHeader } from "./tableConfig";
import { restTableHeight } from "@/utils";
import {
findShipmentDescList, // HScode英文品名黑名单查询
uploadShipmentDesc, // HScode英文品名黑名单导入
delBlackList, // HScode黑名单/英文品名删除
} from "@/api/et86ShipmentDesc";
import { downLoadXlsx } from "@/utils/zipdownload";
export default {
name: "et86ShipmentDesc",
components: {
YlForm,
YlTable,
ModleView,
},
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
searchValue: "",
}, // 表单参数
paramsForm: {
skuName: "",
file: null,
},
rules: {
skuName: [
{ required: true, message: "请输入ShipmentDesc", trigger: "blur" },
],
},
pageConfig: {
// 分页配置项
isPagination: true,
total: 0,
pageData: {
page: 1,
size: 10,
},
},
tableAttr: tableAttr, // table配置项
columns: columnHeader(this.deleteRow), // 表头
tableData: [], // 表格数据
multipleSelection: [],
};
},
created() {
// 黑名单查询
this.$nextTick(() => {
this.searchBtn();
});
},
mounted() {
this.$nextTick(() => {
this.tableAttr.maxHeight =
window.innerHeight - restTableHeight(this.$refs);
});
},
methods: {
// HScode黑名单查询
queryFindShipmentDescList() {
const { page, size } = this.pageConfig.pageData;
let params = {
limitStart: (page - 1) * size,
limitSize: size,
...this.queryForm,
};
this.tableAttr.loadingTable = true;
findShipmentDescList(params)
.then((res) => {
this.tableAttr.loadingTable = false;
const { code, data } = res;
if (code == 200) {
this.tableData = data.list;
this.pageConfig.total = data.total;
}
})
.catch(() => {});
},
// 删除黑名单
toDelBlackList(params) {
delBlackList(params)
.then((res) => {
const { code, msg } = res;
if (code == 200) {
this.searchBtn();
this.msgSuccess(msg || "删除成功!");
} else {
this.$message.error(msg || "删除失败");
}
})
.catch(() => {});
},
// 失焦事件
blurEvent() {},
// 选择上传【HScode黑名单导入】
toUpload({ file }) {
const formData = new FormData();
formData.append("file", file);
uploadShipmentDesc(formData)
.then((res) => {
const { code, data, msg } = res;
if (code == 200) {
this.searchBtn();
this.msgSuccess(msg || "导入成功!");
} else {
this.$message.error(msg || "导入失败");
this.$router.push({
path: "/errorInfo",
query: {
name: "errorInfo",
error: code,
data: JSON.stringify(data),
},
});
}
})
.catch(() => {});
},
//移除上传
onRemoveUpload(options) {
console.log(options);
},
// 搜索
searchBtn() {
this.pageConfig.pageData.page = 1;
this.pageConfig.pageData.size = 10;
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
this.queryFindShipmentDescList();
});
},
// 确认对话框
dialogConfirm() {},
// 上传
upLoadTemplate() {
// console.log(this.$refs.modleViewRef);
},
// 导出
exportTemplate(row, i) {
this.tableAttr.btnCofig.btnGroup[i].loading = true;
downLoadXlsx("/etes/exportShipmentDescList", this.queryForm, "HSCODE英文品名黑名单表")
.then(() => {
this.tableAttr.btnCofig.btnGroup[i].loading = false;
})
.catch(() => {
this.$message.error("导出失败");
});
},
// 删除
deleteData(row) {
if (this.multipleSelection.length) {
let params = [];
this.multipleSelection.map((item) => {
params.push(item.id);
});
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
this.toDelBlackList(params);
})
.catch(() => {});
} else {
this.$message.error("请勾选一条或者多条数据再操作!");
}
},
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.queryFindShipmentDescList();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.queryFindShipmentDescList();
},
// table勾选
tableSelectionChange(val) {
this.multipleSelection = val;
},
// 删除
deleteRow({ row }) {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
this.toDelBlackList([row.id]);
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped></style>
export const tableAttr = {
border: true,
loadingTable: false,
isDragSort: false, // 拖拽tableData数据一定要加id字段
maxHeight: 300,
btnCofig: {
isBtn: true,
btnGroup: [
{
type: "primary", // text、primary、danger
icon: "el-icon-search", // el-icon-edit 、el-icon-delete、el-icon-plus、el-icon-download、el-icon-upload el-icon--right
btnName: "搜索",
size: "mini", // medium / small / mini
round: false,
loading: false,
event: "search",
},
{
type: "primary",
icon: "el-icon-upload",
btnName: "导入",
size: "mini",
round: false,
loading: false,
event: "upLoad",
action: "/goods/uploadGoodsExcel",
fileName: "name",
limit: 1,
accept: ".xlsx",
},
{
type: "primary",
icon: "el-icon-download",
btnName: "导出",
size: "mini",
round: false,
loading: false,
event: "export",
},
{
type: "danger",
icon: "el-icon-delete",
btnName: "删除",
size: "mini",
round: false,
loading: false,
event: "delete",
},
],
},
};
export const columnHeader = (deleteRow) => [
{
type: "selection",
align: "center",
prop: "selection",
width: "50",
},
{
type: "index",
label: "序号",
prop: "id",
align: "center",
width: "50",
},
{
label: "ShipmentDesc",
prop: "blackValue",
align: "center",
minWidth: 100,
},
{
label: "创建时间",
prop: "createTime",
align: "center",
minWidth: 100,
},
{
label: "创建人",
prop: "createUserName",
align: "center",
minWidth: 100,
},
{
label: "文件名",
prop: "uploadFileName",
align: "center",
minWidth: 100,
},
{
label: "操作",
prop: "operate",
align: "center",
minWidth: 120,
fixed: "right",
render: (h, params) => {
return h("div", [
h(
"el-button",
{
style: {
color: "#ff4949",
},
props: {
type: "text",
size: "mini",
icon: "el-icon-delete",
},
on: {
click() {
deleteRow(params);
},
},
},
"删除"
),
]);
},
},
];
......@@ -353,28 +353,18 @@ export default {
如果该航线是普通航线直接删,如果是ET86航线,那么要查询该航线有没有设置维度,
如果没有直接删,如果已经设置了维度是否考虑将该航线下的维度删掉再进行操作;
*/
// if(!val.isEtesRoute){ // 普通航线
// this.routeDel({ data: [val], id: [val.id] })
// }else{ // ET86航线
// this.$confirm("该航线是ET86航线。是否要删除", "注意!", {
// closeOnClickModal: false,
// confirmButtonText: "确定删除",
// cancelButtonText: "取消",
// type: "warning",
// }).then(() => {
// this.msgWarning('待联调!')
// // delDict(val).then(res => {
// // if (res.code === 200) {
// // this.msgSuccess(res.msg)
// // } else {
// // this.msgWarning(res.msg)
// // }
// // this.tableSelect() // 回调查询
// // }).catch(err => {
// // console.log(err)
// // })
// }).catch(() => { })
// }
if(!val.isEtesRoute){ // 普通航线
this.routeDel({ data: [val], id: [val.id] })
}else{ // ET86航线
this.$confirm("该航线是ET86航线。是否要删除", "注意!", {
closeOnClickModal: false,
confirmButtonText: "确定删除",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.routeDel({ data: [val], id: [val.id] })
}).catch(() => { })
}
} else {
this.dicDel([val.id])
}
......
......@@ -186,7 +186,7 @@ export default {
cancelButtonText: '取消',
type: "warning",
}).then(() => {
this.statusChange({ id: val.id, status: status })
this.statusChange({ id: val.id, status: status, tip: tip })
}).catch(() => { })
} else {
this.msgWarning(res.msg)
......@@ -195,12 +195,12 @@ export default {
console.log(err)
})
} else {
this.$confirm(`是否要${tip}记录!`, "注意!", {
this.$confirm(`是否要${tip}规则!`, "注意!", {
confirmButtonText: "确定",
cancelButtonText: '取消',
type: "warning",
}).then(() => {
this.statusChange({ id: val.id, status: status })
this.statusChange({ id: val.id, status: status, tip: tip })
}).catch(() => { })
}
},
......
......@@ -17,7 +17,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="运单号">
<el-input v-model="selectForm.awbNbr" class="formItem" placeholder="例: xxx;xxx;" clearable></el-input>
<el-input v-model="selectForm.awbNbr" class="formItem" placeholder="请输入运单号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
......@@ -138,6 +138,7 @@ export default {
this.data = [];
},
mounted() {
this.tableHeight = window.innerHeight - this.$refs.dmLogForm.$el.offsetHeight - 130;
},
methods: {
//数据查询
......