zhanbo.xu

feat: 开发监管场所管理

import request from '@/utils/request'
import request from "@/utils/request";
// 获取路由所有路由
export const getRouters = () => {
return request({
url: '/bus-customer/menu/selectMenu',
method: 'get'
})
}
url: "/bus-customer/menu/selectMenu",
method: "get",
});
};
//获取用户可访问的路由
export const getUserRouters = () => {
return request({
url: '/bus-customer/obtainUserRights',
method: 'post'
})
}
url: "/bus-customer/obtainUserRights",
method: "post",
});
};
// /menu/addMenu 添加菜单
export const addMenu = (data) => {
return request({
url: "/bus-customer/menu/addMenu",
method: "post",
data: data,
});
};
// PUT /menu​/deleteMenu 删除菜单
export const deleteMenu = (data) => {
return request({
url: `/bus-customer/menu/deleteMenu?menuId=${data.menuId}`,
method: "put",
});
};
// POST /menu​/updateMenu 更新菜单
export const updateMenu = (data) => {
return request({
url: "/bus-customer/menu/updateMenu",
method: "post",
data: data,
});
};
......
import request from "@/utils/request";
// POST
// ​/operatorPlace​/addOperatorPlace
// 新增监管场所
export function addOperatorPlace(data) {
return request({
url: "/bus-customer/operatorPlace​/addOperatorPlace",
method: "post",
data: data,
});
}
// POST
// ​/operatorPlace​/getOperatorPlaceList
// 查询监管场所列表
export function getOperatorPlaceList(data) {
return request({
url: "/bus-customer/operatorPlace​/getOperatorPlaceList",
method: "post",
data: data,
});
}
// POST
// ​/operatorPlace​/updateOperatorPlace
// 修改监管场所
export function updateOperatorPlace(data) {
return request({
url: "/bus-customer/operatorPlace​/updateOperatorPlace",
method: "post",
data: data,
});
}
@import './variables.scss';
@import './mixin.scss';
@import './transition.scss';
@import './element-ui.scss';
@import './sidebar.scss';
@import './btn.scss';
@import "./variables.scss";
@import "./mixin.scss";
@import "./transition.scss";
@import "./element-ui.scss";
@import "./sidebar.scss";
@import "./btn.scss";
//fedex样式
// .el-loading-spinner .path {
......@@ -70,7 +70,6 @@
}
}
.el-radio__label {
color: #999;
font-size: 12px;
......@@ -92,7 +91,7 @@
background-color: #fff !important;
}
.el-radio__input.is-checked+.el-radio__label {
.el-radio__input.is-checked + .el-radio__label {
color: $fedexButton !important;
}
......@@ -102,8 +101,6 @@
}
}
//button
.el-button {
border-radius: 0;
......@@ -150,7 +147,6 @@
}
.el-button-group {
.el-button,
.el-button.is-disabled {
border-top-color: $fedexBottonColor !important;
......@@ -163,7 +159,7 @@
border-left-color: $fedexBottonColor !important;
span {
color: $fedexBottonColor ;
color: $fedexBottonColor;
}
}
......@@ -172,24 +168,20 @@
border-left: 1px solid $fedexBottonColor !important;
.el-dropdown__icon {
color: $fedexBottonColor ;
color: $fedexBottonColor;
}
}
.is-disabled {
span,
.el-dropdown__icon {
color: $formDisabledColor !important;
}
}
}
.el-dropdown:hover {
.el-button-group {
.el-button,
.el-button.is-disabled {
border-top-color: $fedexBottonColor !important;
......@@ -202,10 +194,10 @@
border-left-color: $fedexBottonColor !important;
span {
color: $fedexBottonColor!important ;
color: $fedexBottonColor !important ;
svg {
color: $fedexBottonColor!important ;
color: $fedexBottonColor !important ;
}
}
}
......@@ -215,12 +207,11 @@
border-left: 1px solid $fedexBottonColor !important;
.el-dropdown__icon {
color: $fedexBottonColor!important ;
color: $fedexBottonColor !important ;
}
}
.is-disabled {
span {
color: $formDisabledColor !important;
......@@ -243,7 +234,6 @@
border: none;
}
.entrySave {
margin-top: 64px;
text-align: center;
......@@ -304,15 +294,11 @@
//update
.upload-demo {
.el-upload-list {
.el-upload-list__item {
margin: 0px;
line-height: normal;
}
}
}
......@@ -326,8 +312,6 @@
color: #fff;
}
//dialog
.el-dialog {
display: flex;
......@@ -363,7 +347,6 @@
.el-input,
.el-textarea,
.el-select {
input,
textarea {
border-radius: 0px !important;
......@@ -391,11 +374,11 @@ input:disabled {
border-color: $fedexBorder;
}
.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label::before {
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::before {
content: "";
}
.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:after {
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:after {
content: "*";
color: #ff4949;
margin-right: 4px;
......@@ -446,12 +429,12 @@ input:disabled {
font-weight: 700;
color: #333;
height: max-content;
padding: 0 0 0 .6rem;
padding: 0 0 0 0.6rem;
line-height: 14px;
/*设置行高,防止因为字体缩放导致元素高度变化*/
transform: translate3d(0, 10px, 0);
/*标题平移至合适位置*/
transition: all .2s ease;
transition: all 0.2s ease;
cursor: text;
z-index: 5;
}
......@@ -496,11 +479,9 @@ input:disabled {
background-color: transparent;
padding-top: 0.775rem;
// padding-right: 1.15rem;
padding-left: calc(.6rem + .1875rem);
padding-left: calc(0.6rem + 0.1875rem);
font-size: 0.875rem !important;
}
}
.el-range-editor.el-input__inner {
......@@ -520,7 +501,7 @@ input:disabled {
background-color: transparent;
padding-top: 0.775rem;
// padding-right: 1.15rem;
padding-left: calc(.6rem + .1875rem);
padding-left: calc(0.6rem + 0.1875rem);
font-size: 0.875rem !important;
}
......@@ -530,7 +511,7 @@ input:disabled {
background-color: transparent;
margin-top: 0.85rem;
// padding-right: 1.15rem;
padding-left: calc(.625rem + .1875rem);
padding-left: calc(0.625rem + 0.1875rem);
font-size: 1rem !important;
}
}
......@@ -550,8 +531,8 @@ input:disabled {
height: max-content;
line-height: 20px;
color: $fedexError;
font-size: .75rem;
padding: .225rem .9375rem;
font-size: 0.75rem;
padding: 0.225rem 0.9375rem;
background-color: #fff;
margin-top: 3px;
}
......@@ -561,7 +542,6 @@ input:disabled {
// display: none;
// }
// }
}
.el-form-item:has(.formError) {
......@@ -572,7 +552,6 @@ input:disabled {
.el-form-item__content {
.fedexFormItem {
&:first-child {
.formError {
position: absolute;
top: 50px;
......@@ -606,7 +585,6 @@ input:disabled {
}
.el-form-item__content {
.el-input,
.el-select,
.el-date-editor,
......@@ -634,10 +612,9 @@ input:disabled {
.el-form-item__content {
input {
color: $formDisabledColor ;
color: $formDisabledColor;
}
}
}
.is-error {
......@@ -655,12 +632,12 @@ input:disabled {
font-size: 0.625rem;
font-weight: 700;
height: max-content;
padding: 0 0 0 .6rem;
padding: 0 0 0 0.6rem;
line-height: 14px;
/*设置行高,防止因为字体缩放导致元素高度变化*/
transform: translate3d(0, 1px, 0);
/*标题平移至合适位置*/
transition: all .2s ease;
transition: all 0.2s ease;
z-index: 10;
}
}
......@@ -710,7 +687,7 @@ input:disabled {
.el-radio {
display: block;
margin-top: 25px;
margin-left: 5px
margin-left: 5px;
}
}
......@@ -724,7 +701,6 @@ input:disabled {
height: 100%;
.el-form-item {
.el-form-item__label {
width: 100%;
height: 34px;
......@@ -732,7 +708,7 @@ input:disabled {
font-size: 12px;
font-weight: 600;
color: #333;
background-color: #E3E3E3;
background-color: #e3e3e3;
padding-left: 16px;
}
......@@ -740,7 +716,7 @@ input:disabled {
width: 100%;
height: 100%;
min-height: 36px;
background-color: #F2F2F2;
background-color: #f2f2f2;
margin-top: 2px;
div {
......@@ -757,13 +733,11 @@ input:disabled {
background-color: transparent;
}
}
}
}
}
.backgroundCol {
.el-form-item {
.el-form-item__label {
color: $fedexBottonColor !important;
......@@ -773,8 +747,6 @@ input:disabled {
//table
.el-table {
.el-table__header-wrapper {
overflow-y: scroll;
}
......@@ -795,21 +767,19 @@ input:disabled {
font-size: 13px;
border-left-color: transparent;
border-right-color: transparent;
}
}
.el-table__body-wrapper {
.el-button [class*="el-icon-"]+span {
.el-button [class*="el-icon-"] + span {
margin-left: 1px;
}
}
}
.customTable {
.el-table th>.cell {
width: max-content !important
.el-table th > .cell {
width: max-content !important;
}
.activeTableCell {
......@@ -842,7 +812,7 @@ input:disabled {
height: 0;
}
.el-table tbody tr:hover>td {
.el-table tbody tr:hover > td {
background-color: rgba(0, 122, 183, 0.1) !important;
}
......@@ -870,9 +840,7 @@ input:disabled {
min-height: 100px;
.el-table__body {
tbody {
tr:not(.el-table__expanded-cell) {
width: 100%;
height: 50px !important;
......@@ -898,7 +866,6 @@ input:disabled {
}
}
&:first-child {
border-left: 1px solid $fedexTableBorderColor;
}
......@@ -944,7 +911,7 @@ input:disabled {
}
.expanded {
color: #409EFF;
color: #409eff;
}
.el-table__row_isError {
......@@ -1002,7 +969,6 @@ input:disabled {
}
.fedexFormTable {
.el-table__body-wrapper {
.el-table__body {
tbody {
......@@ -1013,7 +979,6 @@ input:disabled {
.el-form-item__conten {
line-height: 20px !important;
}
}
......@@ -1043,7 +1008,7 @@ input:disabled {
color: $formItemBackgroundColor;
}
&:hover>td {
&:hover > td {
background-color: none !important;
.formError {
......@@ -1054,7 +1019,6 @@ input:disabled {
}
}
}
}
}
}
......@@ -1075,7 +1039,7 @@ input:disabled {
// }
// }
.el-popper[x-placement^=bottom] {
.el-popper[x-placement^="bottom"] {
margin-top: 2px;
}
......@@ -1095,8 +1059,10 @@ input:disabled {
.el-dropdown-menu__item:not(.is-disabled):hover,
.el-dropdown-menu__item:focus {
color: #333;
background-color: $formItemBackgroundColor;
// color: #333;
// background-color: $formItemBackgroundColor;
color: #ffffff !important;
background-color: $fedexBottonColor !important;
}
.is-disabled {
......@@ -1129,7 +1095,7 @@ input:disabled {
width: 36px !important;
height: 36px !important;
display: block;
margin-right: 25px
margin-right: 25px;
}
}
......@@ -1175,8 +1141,6 @@ input:disabled {
// }
}
//other
.TemplateSave {
width: 240px;
......@@ -1215,7 +1179,6 @@ input:disabled {
border: 1px solid $fedexColor !important;
.el-input {
input {
border: none !important;
font-size: 20px;
......@@ -1232,9 +1195,7 @@ input:disabled {
}
}
.el-message-box {
.el-button {
border-color: $fedexBottonColor;
color: $fedexBottonColor;
......@@ -1255,7 +1216,6 @@ input:disabled {
.el-button--primary:focus {
background-color: rgba(255, 102, 0, 0.7);
}
}
.el-select-dropdown__item.selected {
......@@ -1323,7 +1283,7 @@ input:disabled {
.el-table__fixed,
.el-table__fixed-right {
height: calc(100% - 7px) !important;
box-shadow: -5px -2px 10px rgba(0, 0, 0, .12) !important;
box-shadow: -5px -2px 10px rgba(0, 0, 0, 0.12) !important;
.el-table__fixed-body-wrapper {
// height: calc(100% - 7px) !important;
......@@ -1331,7 +1291,7 @@ input:disabled {
}
// 当表格没有滚动条时
.el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right {
.el-table__body-wrapper.is-scrolling-none ~ .el-table__fixed-right {
height: 100% !important;
bottom: 0 !important;
box-shadow: none !important;
......@@ -1347,7 +1307,6 @@ input:disabled {
right: 0 !important;
}
::-webkit-scrollbar {
height: 8px;
width: 8px;
......@@ -1365,7 +1324,6 @@ input:disabled {
background-color: #409eff;
}
.el-scrollbar__wrap {
&::-webkit-scrollbar {
height: 0px;
......@@ -1398,13 +1356,10 @@ input:disabled {
margin-right: 80px;
}
}
}
}
.imgViewDialog {
.el-dialog__header {
.el-dialog__headerbtn {
font-size: 22px;
......@@ -1463,7 +1418,6 @@ input:disabled {
color: $fedexButton;
}
}
}
.el-image-viewer__canvas {
......@@ -1537,7 +1491,7 @@ input:disabled {
.el-button {
display: block;
color: $fedexButton ;
color: $fedexButton;
text-align: center;
margin-left: 0;
border: none !important;
......@@ -1546,10 +1500,7 @@ input:disabled {
font-size: 16px;
font-weight: 700;
}
}
}
}
......@@ -1578,7 +1529,6 @@ input:disabled {
}
}
.historyEmpty {
.el-empty__description {
font-weight: 700;
......@@ -1597,7 +1547,7 @@ input:disabled {
.el-pagination__jump {
margin-right: 10px;
.el-input>input {
.el-input > input {
border: none;
border-bottom: 1px solid #dcdfe6;
}
......@@ -1616,7 +1566,7 @@ input:disabled {
}
}
.textareaPopover+.popper__arrow {
.textareaPopover + .popper__arrow {
display: none;
}
......@@ -1624,7 +1574,7 @@ input:disabled {
.is-left {
.el-date-range-picker__header {
div:before {
content: '起 ';
content: "起 ";
}
}
}
......@@ -1632,7 +1582,7 @@ input:disabled {
.is-right {
.el-date-range-picker__header {
div:before {
content: '止 ';
content: "止 ";
}
}
}
......@@ -1640,7 +1590,7 @@ input:disabled {
.addLogin {
.el-input__inner {
border: 1px solid #DCDFE6 !important;
border: 1px solid #dcdfe6 !important;
}
}
......@@ -1710,7 +1660,6 @@ input:disabled {
color: #999;
}
}
}
}
}
......@@ -1749,7 +1698,6 @@ input:disabled {
}
.activeFormItemInfo {
.el-input__inner,
input {
font-weight: 700 !important;
......@@ -1758,7 +1706,6 @@ input:disabled {
}
.activeFormItemWarning {
.el-input__inner,
input {
font-weight: 700 !important;
......@@ -1767,7 +1714,6 @@ input:disabled {
}
.activeFormItemError {
.el-input__inner,
input {
font-weight: 700 !important;
......@@ -1775,7 +1721,6 @@ input:disabled {
}
}
.portLogPopper {
border: 2px solid $fedexColor;
// background-color: rgba(77, 20, 140, 0.1) !important;
......@@ -1811,7 +1756,7 @@ input:disabled {
.el-select__input {
position: absolute;
top: -2000px
top: -2000px;
}
}
}
......@@ -1842,7 +1787,6 @@ input:disabled {
}
}
.checkBoxGroupStyle1 {
label {
.el-checkbox__label {
......@@ -1885,7 +1829,6 @@ input:disabled {
.el-table__body {
tbody {
.tableErrorRow {
td,
.table_cell {
background-color: rgba(222, 0, 46, 0.2) !important;
......@@ -1893,7 +1836,6 @@ input:disabled {
}
.tableErrorRow:hover {
td,
.table_cell {
background-color: rgba(222, 0, 46, 0.2) !important;
......@@ -1901,12 +1843,10 @@ input:disabled {
}
}
}
}
}
.radioStatus {
.el-radio {
.el-radio__label {
font-weight: 700;
......@@ -1921,8 +1861,6 @@ input:disabled {
}
}
// #eagleMapContainer {
// overflow-y: auto;
// margin-top: 10px;
......
......@@ -31,7 +31,14 @@
:pageSizes="[20, 30, 50, 100]"
:totalCount="0"
:loading="tableLoading"
:emptyText="(loadingDatas && !rowData.popoverData.length) ? '数据加载中' : $t('portEntry.emptyText')"
:emptyText="
loadingDatas &&
rowData &&
rowData.popoverData &&
!rowData.popoverData.length
? '数据加载中'
: $t('portEntry.emptyText')
"
height="350px"
maxHeight="500px"
rowKey="id"
......@@ -82,20 +89,20 @@ export default {
},
data() {
return {
tableLoading: false
tableLoading: false,
};
},
computed:{
loadingDatas(){
return this.$store.state.viewOption.loadingDatas
}
computed: {
loadingDatas() {
return this.$store.state.viewOption.loadingDatas;
},
},
methods: {
//弹框关闭
popoverClose() {
this.$emit("popoverClose");
this.parentDom.$refs.tables.$refs.bodyWrapper.style.overflowY = "auto";
this.$store.dispatch('setLoadingState', true)
this.$store.dispatch("setLoadingState", true);
},
//弹框状态改版
popoverChange(data, type) {
......
import Vue from 'vue'
import Router from 'vue-router'
import Vue from "vue";
import Router from "vue-router";
Vue.use(Router)
Vue.use(Router);
/* Layout */
import Layout from '@/layout'
import ParentView from '@/components/ParentView';
import Layout from "@/layout";
import ParentView from "@/components/ParentView";
/**
* Note: 路由配置项
......@@ -28,37 +28,37 @@ import ParentView from '@/components/ParentView';
// 公共路由
export const constantRoutes = [
{
path: '/redirect',
path: "/redirect",
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path(.*)',
component: (resolve) => require(['@/views/redirect'], resolve)
}
]
path: "/redirect/:path(.*)",
component: (resolve) => require(["@/views/redirect"], resolve),
},
],
},
{
path: '/404',
component: (resolve) => require(['@/views/error/404'], resolve),
hidden: true
path: "/404",
component: (resolve) => require(["@/views/error/404"], resolve),
hidden: true,
},
{
path: '/401',
component: (resolve) => require(['@/views/error/401'], resolve),
hidden: true
path: "/401",
component: (resolve) => require(["@/views/error/401"], resolve),
hidden: true,
},
{
path: '/login',
component: (resolve) => require(['@/views/login'], resolve),
path: "/login",
component: (resolve) => require(["@/views/login"], resolve),
hidden: true,
meta: { noCache: true }
meta: { noCache: true },
},
{
path: '/relogin',
component: (resolve) => require(['@/views/redjrectLogin'], resolve),
path: "/relogin",
component: (resolve) => require(["@/views/redjrectLogin"], resolve),
hidden: true,
meta: { noCache: true, breadcrumb: false }
meta: { noCache: true, breadcrumb: false },
},
// {
// path: '',
......@@ -82,10 +82,10 @@ export const constantRoutes = [
// ]
// },
{
path: '/reporting',
path: "/reporting",
component: Layout,
hidden: false,
meta: { title: '申报数据管理', icon: 'upload' },
meta: { title: "申报数据管理", icon: "upload" },
children: [
// {
// path: '/reportingData',
......@@ -95,19 +95,20 @@ export const constantRoutes = [
// meta: { title: '申报数据管理', icon: 'upload' }
// },
{
path: '/editReportingData',
component: (resolve) => require(['@/views/editReportingData/index'], resolve),
path: "/editReportingData",
component: (resolve) =>
require(["@/views/editReportingData/index"], resolve),
hidden: true,
name: 'EditReportingData',
meta: { title: '申报数据编辑', icon: 'edit' }
name: "EditReportingData",
meta: { title: "申报数据编辑", icon: "edit" },
},
]
],
},
{
path: '/export',
path: "/export",
component: Layout,
hidden: false,
meta: { title: '查询管理', icon: 'fedexExportIcon' },
meta: { title: "查询管理", icon: "fedexExportIcon" },
children: [
// {
// path: '/exportBillQuery',
......@@ -117,25 +118,28 @@ export const constantRoutes = [
// meta: { title: '出口订单查询', icon: '' },
// },
{
path: '/exportBillDetail',
component: (resolve) => require(['@/views/exportBillDetail/index'], resolve),
path: "/exportBillDetail",
component: (resolve) =>
require(["@/views/exportBillDetail/index"], resolve),
hidden: true,
name: 'ExportBillDetail',
meta: { title: '出口订单详情', icon: '' },
name: "ExportBillDetail",
meta: { title: "出口订单详情", icon: "" },
},
{
path: '/exportTransportDetail',
component: (resolve) => require(['@/views/exportTransportDetail/index'], resolve),
path: "/exportTransportDetail",
component: (resolve) =>
require(["@/views/exportTransportDetail/index"], resolve),
hidden: true,
name: 'ExportTransportDetail',
meta: { title: '出口运单详情', icon: '' },
name: "ExportTransportDetail",
meta: { title: "出口运单详情", icon: "" },
},
{
path: '/exportListDetail',
component: (resolve) => require(['@/views/exportListDetail/index'], resolve),
path: "/exportListDetail",
component: (resolve) =>
require(["@/views/exportListDetail/index"], resolve),
hidden: true,
name: 'ExportListDetail',
meta: { title: '出口清单详情', icon: '' },
name: "ExportListDetail",
meta: { title: "出口清单详情", icon: "" },
},
// {
// path: '/exportTransportBillQuery',
......@@ -159,18 +163,20 @@ export const constantRoutes = [
// meta: { title: '清单总分单查询', icon: '' }
// },
{
path: '/listBranchDetail',
component: (resolve) => require(['@/views/listBranchDetail/index'], resolve),
name: 'ListBranchDetail',
path: "/listBranchDetail",
component: (resolve) =>
require(["@/views/listBranchDetail/index"], resolve),
name: "ListBranchDetail",
hidden: true,
meta: { title: '清单总分单详情', icon: '' }
meta: { title: "清单总分单详情", icon: "" },
},
{
path: '/logisticsExitDetail',
component: (resolve) => require(['@/views/logisticsExitDetail/index'], resolve),
name: 'LogisticsExitDetail',
path: "/logisticsExitDetail",
component: (resolve) =>
require(["@/views/logisticsExitDetail/index"], resolve),
name: "LogisticsExitDetail",
hidden: true,
meta: { title: '物流离境单详情', icon: '' }
meta: { title: "物流离境单详情", icon: "" },
},
// {
// path: '/logisticsExitQuery',
......@@ -184,20 +190,20 @@ export const constantRoutes = [
// name: 'ExportRevokeBillQuery',
// meta: { title: '出口撤销单查询', icon: '' }
// }
]
],
},
{
path: '/summary',
path: "/summary",
component: Layout,
hidden: false,
meta: { title: '汇总申报', icon: 'fedexSummary' },
meta: { title: "汇总申报", icon: "fedexSummary" },
children: [
{
path: '/summary',
component: (resolve) => require(['@/views/summaryEdit/index'], resolve),
path: "/summary",
component: (resolve) => require(["@/views/summaryEdit/index"], resolve),
hidden: false,
name: 'Summary',
meta: { title: '汇总申报', icon: '' }
name: "Summary",
meta: { title: "汇总申报", icon: "" },
},
// {
// path: '/summaryDataSearch',
......@@ -207,13 +213,14 @@ export const constantRoutes = [
// meta: { title: '汇总申请单查询', icon: '' }
// }
{
path: '/summaryDetail',
component: (resolve) => require(['@/views/summaryDetail/index'], resolve),
name: 'SummaryDetail',
path: "/summaryDetail",
component: (resolve) =>
require(["@/views/summaryDetail/index"], resolve),
name: "SummaryDetail",
hidden: true,
meta: { title: '汇总申请单详情', icon: '' }
}
]
meta: { title: "汇总申请单详情", icon: "" },
},
],
},
// {
// path: '/system',
......@@ -256,13 +263,13 @@ export const constantRoutes = [
// name: 'RoleConfig',
// meta: { title: '角色管理权限', icon: '' }
// },
// 监管场所管理 supervise-place-manage
// ]
// },
]
];
export default new Router({
mode: 'hash', // 去掉url中的#
mode: "hash", // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
routes: constantRoutes,
});
......
<template>
<el-dialog
class="entryDialog classCUploadDialog"
:title="title"
:visible.sync="outerVisible"
:show-close="false"
width="25%"
:close-on-click-modal="false"
:destroy-on-close="true"
v-loading="loadings.dialogLoading"
@close="close"
>
<div class="modelItem">
<el-form
v-if="type != 'menuChange'"
class="fedexFormStyle"
ref="formData"
:model="formData"
:rules="rules"
label-position="top"
size="small"
>
<Formitem label="上级名称" prop="parentMenuId" type="edit">
<el-input
type="text"
class="inputShadow"
id="inputInner-edit-roleName"
resize="none"
v-model="formData.parentMenuId"
clearable
placeholder=""
></el-input>
</Formitem>
<Formitem label="菜单名称" prop="menuName" type="edit">
<el-input
type="text"
class="inputShadow"
id="inputInner-edit-roleName"
resize="none"
v-model="formData.menuName"
clearable
placeholder=""
></el-input>
</Formitem>
<Formitem label="菜单名称" prop="menuName" type="edit">
<el-input
type="text"
class="inputShadow"
id="inputInner-edit-roleName"
resize="none"
v-model="formData.menuName"
clearable
placeholder=""
></el-input>
</Formitem>
<Formitem label="菜单名称" prop="menuName" type="edit">
<el-input
type="text"
class="inputShadow"
id="inputInner-edit-roleName"
resize="none"
v-model="formData.menuName"
clearable
placeholder=""
></el-input>
</Formitem>
</el-form>
<el-tree
ref="tree"
class="menuTree"
v-else
:data="treeData"
show-checkbox
default-expand-all
node-key="id"
:default-expanded-keys="expandedKeys"
:default-checked-keys="checkedKeys"
:props="defaultProps"
@check="treeCheckChange"
>
</el-tree>
</div>
<div class="dialogOption entrySave">
<el-button
class="entrySaveButton"
:disabled="loadings.submitLoading"
@click="submit"
>确 定</el-button
>
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
>关 闭</el-button
>
</div>
</el-dialog>
</template>
<script>
import {
addRoleData,
updateRoleData,
updateRoleMenuData,
getMenuByRoleId,
} from "@/api/system/user.js";
import { getRouters } from "@/api/menu";
export default {
props: {
outerVisible: {
type: Boolean,
default: false,
},
title: {
type: String,
default: "新增角色",
},
type: {
type: String,
default: "",
},
active: {
type: Object,
default: null,
},
},
watch: {
outerVisible(val) {
if (val) {
this.loadings.dialogLoading = false;
if (this.type == "update") {
this.formData = this.active;
} else if (this.type == "menuChange") {
this.formData = this.active;
this.searchTreeData();
this.loadCheckedKeys(); //加载已绑定的菜单
}
}
},
},
data() {
return {
formData: {
menuName: "",
icon: "",
order: 0,
parentMenuId: 0, //父级菜单id
physicalUrl: "", //前端地址
url: "", //后端地址
},
treeData: [],
treeCheckData: [],
expandedKeys: [],
checkedKeys: [],
rules: {
menuName: [
{
required: true,
trigger: "blur",
message: "菜单名称不能为空!",
},
],
},
defaultProps: {
children: "children",
label: "label",
},
searchForm: {},
loadings: {
dialogLoading: false,
uploadLoading: false,
submitLoading: false,
},
loadingText: "",
};
},
methods: {
//查询菜单数据
searchTreeData() {
this.loadings.dialogLoading = true;
getRouters()
.then((res) => {
if (res.code === "200") {
let arr = [];
res.data.forEach((item) => {
let status = true;
if (item.parentMenuId == 0) {
let obj = {
id: item.menuId,
label: item.menuName,
children: [],
};
arr.forEach((menuItem) => {
if (menuItem.id == item.menuId) {
status = false;
menuItem.label = item.menuName;
}
});
if (status) {
arr.push(obj);
}
} else {
let obj = {
id: item.menuId,
label: item.menuName,
};
arr.forEach((menuItem) => {
if (menuItem.id == item.parentMenuId) {
status = false;
menuItem.children.push(obj);
}
});
if (status) {
arr.push({
id: item.parentMenuId,
label: "",
children: [obj],
});
}
}
});
this.treeData = arr;
} else {
this.alertWarningMsg(res.message);
}
this.loadings.dialogLoading = false;
})
.catch((err) => {
console.log(err);
this.loadings.dialogLoading = false;
});
},
//数据保存
submit() {
this.loadings.dialogLoading = true;
let obj = {};
if (this.type == "add") {
this.$refs.formData.validate((valid) => {
if (valid) {
obj.menuName = this.formData.menuName;
this.addapi(obj);
} else {
this.loadings.dialogLoading = false;
}
});
} else if (this.type == "update") {
this.$refs.formData.validate((valid) => {
if (valid) {
obj.roleId = this.formData.roleId;
obj.menuName = this.formData.menuName;
this.updateapi(obj);
} else {
this.loadings.dialogLoading = false;
}
});
} else if (this.type == "menuChange") {
obj.menuId = this.treeCheckData; // 使用合并后的选中节点
obj.roleId = this.formData.roleId;
this.menuChangeapi(obj);
}
},
//新增
addapi(val) {
addRoleData(val)
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
}
})
.catch((err) => {
console.log(err);
this.loadings.dialogLoading = false;
});
},
//修改
updateapi(val) {
updateRoleData(val)
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
}
})
.catch((err) => {
console.log(err);
this.loadings.dialogLoading = false;
});
},
//菜单权限修改
menuChangeapi(val) {
updateRoleMenuData(val)
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.$store.dispatch("GenerateRoutes");
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
}
})
.catch((err) => {
console.log(err);
this.loadings.dialogLoading = false;
});
},
treeCheckChange(data, checked) {
console.log(data, checked);
let arr = [];
arr = checked.checkedKeys.concat(checked.halfCheckedKeys);
this.treeCheckData = arr;
},
close() {
this.formData = {
menuName: "",
};
this.checkedKeys = [];
this.$emit("close");
},
// 加载已绑定的菜单
loadCheckedKeys() {
if (this.formData.roleId) {
getMenuByRoleId(this.formData.roleId)
.then((res) => {
if (res.code === "200") {
this.checkedKeys = res.data
.filter((item) => item.isBinding && item.parentMenuId != 0)
.map((item) => item.menuId);
//console.log('初始 checkedKeys:', this.checkedKeys);
this.$nextTick(() => {
this.$refs.tree.setCheckedKeys(this.checkedKeys);
this.updateTreeCheckData();
});
} else {
this.alertWarningMsg(res.message);
}
})
.catch((err) => {
console.log(err);
});
}
},
//加载选中的节点及半选中的父节点
updateTreeCheckData() {
const checkedKeys = this.$refs.tree.getCheckedKeys();
const halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys();
this.treeCheckData = checkedKeys.concat(halfCheckedKeys);
//console.log('合并后的 treeCheckData:', this.treeCheckData);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.menuTree {
max-width: 350px;
max-height: 300px;
overflow: auto;
margin: 0 auto;
border: 1px solid #999;
padding: 10px;
}
</style>
<template>
<div class="entrySreach">
<el-form
class="fedexFormStyle fedexformSreach fedexformSreachBottomBorder"
ref="sreachForm"
:model="sreachFormData"
label-position="top"
size="small"
>
<el-row class="row-border">
<!-- 角色名称 -->
<el-col :span="5">
<Formitem label="菜单名称" prop="menuName">
<el-input
type="text"
class="inputShadow"
id="inputInner--roleName"
resize="none"
v-model="sreachFormData.menuName"
clearable
placeholder=""
></el-input>
</Formitem>
</el-col>
<el-col :span="2">
<el-form-item class="textCenter">
<el-button
class="entrySreachButton"
type="text"
icon="el-icon-search"
:loading="loadings.searchLoading"
@click="search(0)"
></el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="optionButton">
<el-button
class="entrySaveButton"
icon="el-icon-plus"
size="small"
@click="addHandle"
>
新增菜单
</el-button>
</div>
<Table
class="fedexDetialTable fedexSreachTable"
ref="entryTable"
:data="tableData"
:headerData="headerData"
:maxHeight="tableMaxheight"
:border="true"
:pagination="true"
:order="false"
:loading="loadings.searchLoading"
:page="page.pageIndex"
:pageSizes="[20, 30, 50, 100]"
:totalCount="page.total"
@sizeChange="sizeChange"
@currentChange="currentChange"
:selection="false"
:selectFixed="false"
:rowSelectDataType="false"
>
<template slot="optionColumn">
<el-table-column align="left" label="操作">
<template slot-scope="scope">
<el-button type="text" @click="update(scope.row)">
角色修改
</el-button>
<el-button type="text" @click="muenChange(scope.row)">
权限绑定
</el-button>
</template>
</el-table-column>
</template>
</Table>
<DialogVue
:outerVisible="outerVisible"
:title="dialogTitle"
:type="editType"
:active="activeData"
@close="dialogClose"
/>
</div>
</template>
<script>
import { getRoleList } from "@/api/system/user.js";
import DialogVue from "./dialog.vue";
import { addMenu, deleteMenu } from "@/api/menu";
export default {
name: "SupervisePlaceManage",
components: {
DialogVue,
},
data() {
return {
sreachFormData: {
menuName: "",
},
page: {
pageIndex: 1,
pageSize: 20,
total: 0,
},
activeData: null,
tableData: [],
headerData: [
{
name: "角色名",
value: "roleName",
width: "",
align: "left",
},
],
loadings: {
searchLoading: false,
},
tableMaxheight: null,
outerVisible: false,
dialogTitle: "",
editType: "",
};
},
created() {
this.search(0);
},
mounted() {
this.tableMaxheight = window.innerHeight - 300;
},
methods: {
//查询
search(val) {
this.loadings.searchLoading = true;
if (val == 0) {
this.page.pageIndex = 1;
}
let obj = this.sreachFormData;
obj.pageIndex = this.page.pageIndex;
obj.pageSize = this.page.pageSize;
getRoleList(obj)
.then((res) => {
if (res.code === "200") {
this.tableData = res.data.value;
this.page.total = res.data.totalItems;
this.tableData.forEach((item, idx) => {
item.index = idx;
});
} else {
this.alertWarningMsg(res.message);
}
this.loadings.searchLoading = false;
})
.catch((err) => {
console.log(err);
this.loadings.searchLoading = false;
});
},
addHandle() {
// this.dialogTitle = "新增菜单";
// this.editType = "add";
// this.outerVisible = true;
// let params = {
// icon: "",
// menuName: "监管场所管理",
// order: 4.4,
// parentMenuId: 90,
// physicalUrl: "/supervise-place-manage",
// url: "",
// };
deleteMenu({
menuId: 1,
}).then((res) => {
console.log(res);
});
// addMenu(params).then((res) => {
// console.log(res);
// });
},
update(val) {
this.dialogTitle = "修改角色";
this.editType = "update";
this.outerVisible = true;
this.activeData = val;
},
muenChange(val) {
this.dialogTitle = "绑定权限";
this.editType = "menuChange";
this.outerVisible = true;
this.activeData = val;
},
dialogClose() {
this.outerVisible = false;
this.activeData = null;
this.search(1);
},
//分页
currentChange(val) {
this.page.pageIndex = val.page;
this.search(1);
},
sizeChange(val) {
this.page.pageSize = val;
this.search(1);
},
input() {
this.$forceUpdate();
},
},
};
</script>
<style scoped lang="scss">
@import "@/assets/styles/variables.scss";
.entrySreach {
height: 100%;
background-color: $menuLightBg;
.entrySreachButton {
display: inline-block;
font-size: 20px;
color: $fedexButton !important;
}
.optionButton {
padding: 10px;
text-align: left;
.el-button {
color: $fedexButton;
border-color: $fedexButton !important;
svg {
display: inline-block;
margin-right: 5px;
fill: $fedexButton;
}
}
.entrySaveButton:hover,
.entrySaveButton:focus {
color: $menuLightBg !important;
background-color: $fedexButton !important;
}
}
}
.texttareaTip {
position: absolute;
top: 52%;
right: 20px;
transform: translate(0, -50%);
z-index: 10;
}
</style>
......@@ -137,6 +137,15 @@
>
批量修改
</el-button>
<el-button
class="entrySaveButton"
size="small"
icon="el-icon-download"
v-loading="loadings.exportDeclareLoading"
@click="downloadData"
>
导出
</el-button>
</div>
<div class="optionButton-right">
<el-dropdown
......@@ -172,13 +181,31 @@
>
</el-dropdown-menu>
</el-dropdown>
<!-- 运抵单申报按钮 -->
<el-button
size="small"
type="primary"
class="dropdown-style-button"
:loading="loadings.departureLoading"
@click="
declareData('departureLoading', '运抵单申报', 'logisticsDeparture')
"
>
<svg-icon
class="el-icon-user-solid"
icon-class="fedexDeclareIcon"
></svg-icon>
运抵单申报
</el-button>
<!-- 离境单申报按钮 -->
<el-button
size="small"
type="primary"
class="dropdown-style-button"
:loading="loadings.departureLoading"
@click="declareData('departureLoading', '离境单申报', 'logisticsDeparture')"
@click="
declareData('departureLoading', '离境单申报', 'logisticsDeparture')
"
>
<svg-icon
class="el-icon-user-solid"
......@@ -192,7 +219,7 @@
type="primary"
class="dropdown-style-button"
:loading="loadings.revokeLoading"
@click="declareData('revokeLoading', '撤销单申报' ,'cancellation')"
@click="declareData('revokeLoading', '撤销单申报', 'cancellation')"
>
<svg-icon
class="el-icon-user-solid"
......@@ -200,18 +227,9 @@
></svg-icon>
撤销单申报
</el-button>
<el-button
class="entrySaveButton"
size="small"
icon="el-icon-download"
v-loading="loadings.exportDeclareLoading"
@click="downloadData"
>
导出
</el-button>
</div>
</div>
<section style="position:fixed;top:350px;left: 500px;">
<section style="position: fixed; top: 350px; left: 500px">
<TablePopover
ref="allLogDataReceiptStatusPopover"
dataKey="allLogDataReceiptStatus"
......@@ -237,7 +255,7 @@
ref="entryTable"
:data="tableData"
:headerData="headerData"
:maxHeight="tableMaxheight"
:height="tableMaxheight"
:border="true"
:pagination="true"
:order="false"
......@@ -364,7 +382,9 @@
<el-table-column align="center" label="操作" width="150">
<template slot-scope="scope">
<el-button type="text" @click="update(scope.row)"> 修改 </el-button>
<el-button type="text" @click="showTotalLog(scope.row)">日志</el-button>
<el-button type="text" @click="showTotalLog(scope.row)"
>日志</el-button
>
</template>
</el-table-column>
</template>
......@@ -379,7 +399,8 @@
:showDialog="revokeVisible"
:selectedDatas="selected"
:dropdownCode="dropdownCode"
@cancelRevoke="cancelRevoke" />
@cancelRevoke="cancelRevoke"
/>
<TemplateDownloadDialog
:showDialog="templateDownloadVisible"
@cancelDownload="cancelDownload"
......@@ -408,9 +429,9 @@ import {
getTotalReceipt,
getLogisticsReceipt,
getDeclarationLog,
exportDeclareData
exportDeclareData,
} from "@/api/declareData-api.js";
import { getDictData } from '@/api/system/dict-api.js'
import { getDictData } from "@/api/system/dict-api.js";
import DialogVue from "./dialog.vue";
import RevokeDialog from "./revokeDialog.vue";
import TemplateDownloadDialog from "./templateDownloadDialog.vue";
......@@ -423,7 +444,7 @@ export default {
RevokeDialog,
TemplateDownloadDialog,
ExportDialog,
BatchModify
BatchModify,
},
data() {
return {
......@@ -505,6 +526,14 @@ export default {
slot: true,
},
{
// release-v1.0.9
name: "运抵单回执",
value: "listReceiptStatus",
width: "",
align: "left",
slot: true,
},
{
name: "清单总分单回执",
value: "totalSplitOrderStatus",
width: "",
......@@ -577,7 +606,7 @@ export default {
dwonloadModelLoading: false,
dropDownLoading: false,
logTableLoading: false,
exportDeclareLoading:false,
exportDeclareLoading: false,
revokeLoading: false, // 撤销单申报加载状态
departureLoading: false, // 离境单申报加载状态
},
......@@ -586,10 +615,10 @@ export default {
outerVisible: false,
dropdownName: "一键申报",
dropdownCode: "full",
revokeVisible:false,
templateDownloadVisible:false,
datasExportVisible:false,
batchModifyVisible:false
revokeVisible: false,
templateDownloadVisible: false,
datasExportVisible: false,
batchModifyVisible: false,
};
},
created() {
......@@ -597,10 +626,14 @@ export default {
// this.getCancellationReasons()
},
mounted() {
this.tableMaxheight = window.innerHeight - 355;
window.addEventListener('resize',()=>{
this.tableMaxheight = window.innerHeight - 355;
},false)
this.tableMaxheight = window.innerHeight - 280;
window.addEventListener(
"resize",
() => {
this.tableMaxheight = window.innerHeight - 280;
},
false
);
},
watch: {
$route(val, oldval) {
......@@ -608,7 +641,7 @@ export default {
},
},
beforeRouteEnter(to, from, next) {
next(vm => {
next((vm) => {
// 检查标志是否需要刷新数据
if (to.meta.needsRefresh) {
vm.search(0);
......@@ -678,12 +711,14 @@ export default {
//下载模板
dwonloadModelFile() {
this.loadings.dwonloadModelLoading = true;
this.$store.dispatch("GetInfo").then(res =>{
console.log('res====', res)
this.$store
.dispatch("GetInfo")
.then((res) => {
console.log("res====", res);
if (res.code == 200) {
console.log('port===', res.data?.port?.split(','))
if (res.data?.port?.split(',').length == 2) {
this.templateDownloadVisible = true
console.log("port===", res.data?.port?.split(","));
if (res.data?.port?.split(",").length == 2) {
this.templateDownloadVisible = true;
} else {
this.fileDownload
.downLoadZip(
......@@ -692,27 +727,27 @@ export default {
"申报数据模板.xlsx",
"xlsx",
"get",
{type: res.data?.port}
{ type: res.data?.port }
)
.finally(() => {
this.cancelDownload()
this.cancelDownload();
});
}
}
}).catch(err =>{
console.log(err)
})
.catch((err) => {
console.log(err);
});
},
datasDownload(dataSource){
datasDownload(dataSource) {
let obj = {
billNo: this.sreachFormData.billNo,
declareId: [],
logisticsNo: this.sreachFormData.logisticsNo,
orderNo: this.sreachFormData.orderNo,
receiptStatus: this.sreachFormData.receiptStatus,
dataSource
dataSource,
};
obj.startCreateTime = "";
obj.endCreateTime = "";
......@@ -723,45 +758,50 @@ export default {
this.selected.forEach((item) => {
obj.declareId.push(item.declareId);
});
exportDeclareData(obj).then((res)=>{
exportDeclareData(obj)
.then((res) => {
// if (res.code === "200") {
// // this.alertSuccessMsg(res.message);
// } else {
// console.log(res.message);
// this.alertWarningMsg(res.message);
// }
}).catch((err)=>{
})
.catch((err) => {
console.log(err);
this.alertErrorMsg(err);
}).finally(res =>{
this.loadings.exportDeclareLoading = false;
this.datasExportVisible = false
this.$refs.exportDialog.datasExportVisible = false
})
.finally((res) => {
this.loadings.exportDeclareLoading = false;
this.datasExportVisible = false;
this.$refs.exportDialog.datasExportVisible = false;
});
},
//导出
downloadData() {
this.loadings.exportDeclareLoading = true;
this.$store.dispatch("GetInfo").then(res =>{
console.log('res====', res)
this.$store
.dispatch("GetInfo")
.then((res) => {
console.log("res====", res);
if (res.code == 200) {
console.log('port===', res.data?.port?.split(','))
if (res.data?.port?.split(',').length == 2) {
this.datasExportVisible = true
console.log("port===", res.data?.port?.split(","));
if (res.data?.port?.split(",").length == 2) {
this.datasExportVisible = true;
} else {
this.datasDownload(res.data?.port)
this.datasDownload(res.data?.port);
}
}
}).catch(err =>{
console.log(err)
})
.catch((err) => {
console.log(err);
});
},
startDatasExport(dataSource){
this.datasDownload(dataSource)
startDatasExport(dataSource) {
this.datasDownload(dataSource);
},
cancelDatasExport(){
this.datasExportVisible = false
cancelDatasExport() {
this.datasExportVisible = false;
this.loadings.exportDeclareLoading = false;
},
......@@ -781,12 +821,12 @@ export default {
this.$set(this.loadings, loadingKey, true);
// 构造请求参数
const obj = {
declareIds: this.selected.map(item => item.declareId),
declareIds: this.selected.map((item) => item.declareId),
type: dropdownCode,
};
// 如果是撤销单申报,显示弹窗并返回
if (dropdownName === '撤销单申报') {
if (dropdownName === "撤销单申报") {
this.revokeVisible = true;
this.$set(this.loadings, loadingKey, false);
this.dropdownCode = dropdownCode;
......@@ -823,8 +863,8 @@ export default {
// }
this.search(1);
this.outerVisible = false;
this.tableMaxheight = window.innerHeight - 355;
this.$forceUpdate()
this.tableMaxheight = window.innerHeight - 280;
this.$forceUpdate();
},
popoverChange(val) {
this.tableData = val.tableData;
......@@ -839,7 +879,7 @@ export default {
})
.finally(() => {
this.$nextTick(() => {
this.$store.dispatch('setLoadingState', false)
this.$store.dispatch("setLoadingState", false);
this.$refs.orderReceiptStatusPopover.tableLoading = false;
this.$refs.wayBillReceiptPopover.tableLoading = false;
this.$refs.listReceiptStatusPopover.tableLoading = false;
......@@ -905,8 +945,7 @@ export default {
console.log(err);
reject();
});
}
else if (type == "logisticsReceiptStatus") {
} else if (type == "logisticsReceiptStatus") {
getLogisticsReceipt(obj)
.then((res) => {
if (res.code === "200") {
......@@ -919,8 +958,7 @@ export default {
console.log(err);
reject();
});
}
else if (type == "allLogDataReceiptStatus") {
} else if (type == "allLogDataReceiptStatus") {
getDeclarationLog(id)
.then((res) => {
if (res.code === "200") {
......@@ -980,10 +1018,10 @@ export default {
});
}
},
cancelRevoke(){
cancelRevoke() {
this.loadings.dropDownLoading = false;
this.revokeVisible = false
this.dropdownCode = 'full'
this.revokeVisible = false;
this.dropdownCode = "full";
},
update(val) {
this.$router.push({
......@@ -995,42 +1033,43 @@ export default {
showTotalLog(row) {
this.$store.state.viewOption.loadingDatas = true;
this.selectedLogRow = row;
this.$set(row, 'logLoading', true);
this.$set(row, "logLoading", true);
this.receiptApi(row.declareId, "allLogDataReceiptStatus")
.then((logData) => {
this.$set(row, 'popoverData', logData);
this.receiptApi(row.declareId, "allLogDataReceiptStatus").then(
(logData) => {
this.$set(row, "popoverData", logData);
if(!this.selectedLogRow.popoverData.length){
if (!this.selectedLogRow.popoverData.length) {
this.$store.state.viewOption.loadingDatas = false;
}
// 手动触发状态更新
this.$nextTick(() => {
// 强制设置弹窗状态为true
row.allLogDataReceiptStatusPopoverType = true
row.allLogDataReceiptStatusPopoverType = true;
// 强制更新表格
this.tableData = [...this.tableData];
});
})
}
);
},
cancelDownload(){
cancelDownload() {
this.loadings.dwonloadModelLoading = false;
this.templateDownloadVisible = false
this.templateDownloadVisible = false;
},
batchModify(){
batchModify() {
if (!this.selected.length) {
this.alertWarningMsg("请选择数据!");
return
return;
}
this.batchModifyVisible = true
this.batchModifyVisible = true;
},
cancelBatchModify(val){
this.batchModifyVisible = false
if(val === 1){
cancelBatchModify(val) {
this.batchModifyVisible = false;
if (val === 1) {
this.search(0);
}
}
},
},
};
</script>
......@@ -1060,6 +1099,11 @@ export default {
color: $fedexBottonColor !important;
font-size: 12px !important;
}
.el-button.dropdown-style-button:hover,
.el-button.dropdown-style-button:focus {
color: #ffffff !important;
background-color: $fedexBottonColor !important;
}
.el-button {
color: $fedexButton;
......@@ -1087,9 +1131,9 @@ export default {
transform: translate(0, -50%);
z-index: 10;
}
.revokeOperation{
margin-bottom:25px;
.revokeSubmitBtn{
.revokeOperation {
margin-bottom: 25px;
.revokeSubmitBtn {
margin-right: 30px;
}
}
......
<template>
<el-dialog
class="entryDialog classCUploadDialog"
:title="title"
:visible.sync="outerVisible"
:show-close="false"
width="25%"
:close-on-click-modal="false"
:destroy-on-close="true"
v-loading="loadings.dialogLoading"
@close="close"
>
<div class="modelItem">
<el-form
v-if="type != 'menuChange'"
class="fedexFormStyle"
ref="formData"
:model="formData"
:rules="rules"
label-position="top"
size="small"
>
<Formitem label="角色名称" prop="roleName" type="edit">
<el-input
type="text"
class="inputShadow"
id="inputInner-edit-roleName"
resize="none"
v-model="formData.roleName"
clearable
placeholder=""
></el-input>
</Formitem>
</el-form>
<el-tree
ref="tree"
class="menuTree"
v-else
:data="treeData"
show-checkbox
default-expand-all
node-key="id"
:default-expanded-keys="expandedKeys"
:default-checked-keys="checkedKeys"
:props="defaultProps"
@check="treeCheckChange"
>
</el-tree>
</div>
<div class="dialogOption entrySave">
<el-button
class="entrySaveButton"
:disabled="loadings.submitLoading"
@click="submit"
>确 定</el-button
>
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
>关 闭</el-button
>
</div>
</el-dialog>
</template>
<script>
import {
addRoleData,
updateRoleData,
updateRoleMenuData,
getMenuByRoleId,
} from "@/api/system/user.js";
import { getRouters } from "@/api/menu";
export default {
props: {
outerVisible: {
type: Boolean,
default: false,
},
title: {
type: String,
default: "新增角色",
},
type: {
type: String,
default: "",
},
active: {
type: Object,
default: null,
},
},
watch: {
outerVisible(val) {
if (val) {
this.loadings.dialogLoading = false;
if (this.type == "update") {
this.formData = this.active;
} else if (this.type == "menuChange") {
this.formData = this.active;
this.searchTreeData();
this.loadCheckedKeys();//加载已绑定的菜单
}
}
},
},
data() {
return {
formData: {
roleName: "",
},
treeData: [],
treeCheckData: [],
expandedKeys: [],
checkedKeys: [],
rules: {
roleName: [
{
required: true,
trigger: "blur",
message: "角色名称不能为空!",
},
],
},
defaultProps: {
children: "children",
label: "label",
},
searchForm: {},
loadings: {
dialogLoading: false,
uploadLoading: false,
submitLoading: false,
},
loadingText: "",
};
},
methods: {
//查询菜单数据
searchTreeData() {
this.loadings.dialogLoading = true;
getRouters()
.then((res) => {
if (res.code === "200") {
let arr = [];
res.data.forEach((item) => {
let status = true;
if (item.parentMenuId == 0) {
let obj = {
id: item.menuId,
label: item.menuName,
children: [],
};
arr.forEach((menuItem) => {
if (menuItem.id == item.menuId) {
status = false;
menuItem.label = item.menuName;
}
});
if (status) {
arr.push(obj);
}
} else {
let obj = {
id: item.menuId,
label: item.menuName,
};
arr.forEach((menuItem) => {
if (menuItem.id == item.parentMenuId) {
status = false;
menuItem.children.push(obj);
}
});
if (status) {
arr.push({
id: item.parentMenuId,
label: "",
children: [obj],
});
}
}
});
this.treeData = arr;
} else {
this.alertWarningMsg(res.message);
}
this.loadings.dialogLoading = false;
})
.catch((err) => {
console.log(err);
this.loadings.dialogLoading = false;
});
},
//数据保存
submit() {
this.loadings.dialogLoading = true;
let obj = {};
if (this.type == "add") {
this.$refs.formData.validate((valid) => {
if (valid) {
obj.roleName = this.formData.roleName;
this.addapi(obj);
} else {
this.loadings.dialogLoading = false;
}
});
} else if (this.type == "update") {
this.$refs.formData.validate((valid) => {
if (valid) {
obj.roleId = this.formData.roleId;
obj.roleName = this.formData.roleName;
this.updateapi(obj);
} else {
this.loadings.dialogLoading = false;
}
});
} else if (this.type == "menuChange") {
obj.menuId = this.treeCheckData; // 使用合并后的选中节点
obj.roleId = this.formData.roleId;
this.menuChangeapi(obj);
}
},
//新增
addapi(val) {
addRoleData(val)
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
}
})
.catch((err) => {
console.log(err);
this.loadings.dialogLoading = false;
});
},
//修改
updateapi(val) {
updateRoleData(val)
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
}
})
.catch((err) => {
console.log(err);
this.loadings.dialogLoading = false;
});
},
//菜单权限修改
menuChangeapi(val) {
updateRoleMenuData(val)
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.$store.dispatch('GenerateRoutes')
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
}
})
.catch((err) => {
console.log(err);
this.loadings.dialogLoading = false;
});
},
treeCheckChange(data, checked) {
console.log(data, checked);
let arr = [];
arr = checked.checkedKeys.concat(checked.halfCheckedKeys);
this.treeCheckData = arr;
},
close() {
this.formData = {
roleName: "",
};
this.checkedKeys = []
this.$emit("close");
},
// 加载已绑定的菜单
loadCheckedKeys() {
if (this.formData.roleId) {
getMenuByRoleId(this.formData.roleId)
.then((res) => {
if (res.code === "200") {
this.checkedKeys = res.data.filter(item => item.isBinding && (item.parentMenuId!=0 ) ).map(item => item.menuId);
//console.log('初始 checkedKeys:', this.checkedKeys);
this.$nextTick(() => {
this.$refs.tree.setCheckedKeys(this.checkedKeys);
this.updateTreeCheckData();
});
} else {
this.alertWarningMsg(res.message);
}
})
.catch((err) => {
console.log(err);
});
}
},
//加载选中的节点及半选中的父节点
updateTreeCheckData() {
const checkedKeys = this.$refs.tree.getCheckedKeys();
const halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys();
this.treeCheckData = checkedKeys.concat(halfCheckedKeys);
//console.log('合并后的 treeCheckData:', this.treeCheckData);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.menuTree {
max-width: 350px;
max-height: 300px;
overflow: auto;
margin: 0 auto;
border: 1px solid #999;
padding: 10px;
}
</style>
<template>
<div class="entrySreach">
<el-form
class="fedexFormStyle fedexformSreach fedexformSreachBottomBorder"
ref="sreachForm"
:model="sreachFormData"
label-position="top"
size="small"
>
<el-row class="row-border">
<!-- 角色名称 -->
<el-col :span="5">
<Formitem label="角色名称" prop="roleName">
<el-input
type="text"
class="inputShadow"
id="inputInner--roleName"
resize="none"
v-model="sreachFormData.roleName"
clearable
placeholder=""
></el-input>
</Formitem>
</el-col>
<el-col :span="5">
<Formitem label="角色名称" prop="roleName">
<el-input
type="text"
class="inputShadow"
id="inputInner--roleName"
resize="none"
v-model="sreachFormData.roleName"
clearable
placeholder=""
></el-input>
</Formitem>
</el-col>
<el-col :span="5">
<Formitem label="角色名称" prop="roleName">
<el-input
type="text"
class="inputShadow"
id="inputInner--roleName"
resize="none"
v-model="sreachFormData.roleName"
clearable
placeholder=""
></el-input>
</Formitem>
</el-col>
<el-col :span="2">
<el-form-item class="textCenter">
<el-button
class="entrySreachButton"
type="text"
icon="el-icon-search"
:loading="loadings.searchLoading"
@click="search(0)"
></el-button>
</el-form-item>
</el-col>
<el-col :span="2">
<!-- 清空查询条件-->
<el-form-item class="textLeft textCenter">
<el-button
type="text"
size="small"
icon="el-icon-refresh"
@click="clear"
>
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="optionButton">
<el-button
class="entrySaveButton"
icon="el-icon-plus"
size="small"
@click="addRole"
>
新增
</el-button>
</div>
<Table
class="fedexDetialTable fedexSreachTable"
ref="entryTable"
:data="tableData"
:headerData="headerData"
:maxHeight="tableMaxheight"
:border="true"
:pagination="true"
:order="false"
:loading="loadings.searchLoading"
:page="page.pageIndex"
:pageSizes="[20, 30, 50, 100]"
:totalCount="page.total"
@sizeChange="sizeChange"
@currentChange="currentChange"
:selection="false"
:selectFixed="false"
:rowSelectDataType="false"
>
<template slot="optionColumn">
<el-table-column align="left" label="操作">
<template slot-scope="scope">
<el-button type="text" @click="update(scope.row)">
角色修改
</el-button>
<el-button type="text" @click="muenChange(scope.row)">
权限绑定
</el-button>
</template>
</el-table-column>
</template>
</Table>
<DialogVue
:outerVisible="outerVisible"
:title="dialogTitle"
:type="editType"
:active="activeData"
@close="dialogClose"
/>
</div>
</template>
<script>
import { getRoleList } from "@/api/system/user.js";
import DialogVue from "./dialog.vue";
export default {
name: "SupervisePlaceManage",
components: {
DialogVue,
},
data() {
return {
sreachFormData: {
roleName: "",
},
page: {
pageIndex: 1,
pageSize: 20,
total: 0,
},
activeData: null,
tableData: [],
headerData: [
{
name: "角色名",
value: "roleName",
width: "",
align: "left",
},
],
loadings: {
searchLoading: false,
},
tableMaxheight: null,
outerVisible: false,
dialogTitle: "",
editType: "",
};
},
created() {
this.search(0);
},
mounted() {
this.tableMaxheight = window.innerHeight - 300;
},
methods: {
clear() {
this.$refs.sreachForm.resetFields();
},
//查询
search(val) {
this.loadings.searchLoading = true;
if (val == 0) {
this.page.pageIndex = 1;
}
let obj = this.sreachFormData;
obj.pageIndex = this.page.pageIndex;
obj.pageSize = this.page.pageSize;
getRoleList(obj)
.then((res) => {
if (res.code === "200") {
this.tableData = res.data.value;
this.page.total = res.data.totalItems;
this.tableData.forEach((item, idx) => {
item.index = idx;
});
} else {
this.alertWarningMsg(res.message);
}
this.loadings.searchLoading = false;
})
.catch((err) => {
console.log(err);
this.loadings.searchLoading = false;
});
},
addRole() {
this.dialogTitle = "新增角色";
this.editType = "add";
this.outerVisible = true;
},
update(val) {
this.dialogTitle = "修改角色";
this.editType = "update";
this.outerVisible = true;
this.activeData = val;
},
muenChange(val) {
this.dialogTitle = "绑定权限";
this.editType = "menuChange";
this.outerVisible = true;
this.activeData = val;
},
dialogClose() {
this.outerVisible = false;
this.activeData = null;
this.search(1);
},
//分页
currentChange(val) {
this.page.pageIndex = val.page;
this.search(1);
},
sizeChange(val) {
this.page.pageSize = val;
this.search(1);
},
input() {
this.$forceUpdate();
},
},
};
</script>
<style scoped lang="scss">
@import "@/assets/styles/variables.scss";
.entrySreach {
height: 100%;
background-color: $menuLightBg;
.entrySreachButton {
display: inline-block;
font-size: 20px;
color: $fedexButton !important;
}
.optionButton {
padding: 10px;
text-align: left;
.el-button {
color: $fedexButton;
border-color: $fedexButton !important;
svg {
display: inline-block;
margin-right: 5px;
fill: $fedexButton;
}
}
.entrySaveButton:hover,
.entrySaveButton:focus {
color: $menuLightBg !important;
background-color: $fedexButton !important;
}
}
}
.texttareaTip {
position: absolute;
top: 52%;
right: 20px;
transform: translate(0, -50%);
z-index: 10;
}
</style>