liuyg
2021-07-21 aedf54d825771471a208663bc8d627c71521864d
保安员管理和保安公司页面完善,,跟随群里文档中的指示调整样式
43 files modified
1 files renamed
18 files added
24723 ■■■■■ changed files
src/api/dispatch/dispatch.js 78 ●●●●● patch | view | raw | blame | history
src/api/qualificationExamination/qualificationExamination.js 32 ●●●● patch | view | raw | blame | history
src/api/qualificationExamination/signQualificationExamination.js 43 ●●●● patch | view | raw | blame | history
src/config/website.js 4 ●●●● patch | view | raw | blame | history
src/lang/zh.js 2 ●●● patch | view | raw | blame | history
src/option/system/dict.js 1 ●●●● patch | view | raw | blame | history
src/option/system/dictbiz.js 1 ●●●● patch | view | raw | blame | history
src/option/system/param.js 1 ●●●● patch | view | raw | blame | history
src/router/views/index.js 110 ●●●●● patch | view | raw | blame | history
src/styles/element-ui.scss 134 ●●●●● patch | view | raw | blame | history
src/styles/ourBackgroundColor.scss 6 ●●●●● patch | view | raw | blame | history
src/views/Juris/jurs.vue 560 ●●●● patch | view | raw | blame | history
src/views/authority/apiscope.vue 1191 ●●●● patch | view | raw | blame | history
src/views/authority/datascope.vue 1348 ●●●● patch | view | raw | blame | history
src/views/authority/role.vue 706 ●●●● patch | view | raw | blame | history
src/views/desk/notice.vue 5 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 295 ●●●●● patch | view | raw | blame | history
src/views/management/computents/achievement.vue 178 ●●●●● patch | view | raw | blame | history
src/views/management/computents/dispatch.vue 259 ●●●●● patch | view | raw | blame | history
src/views/management/computents/honor.vue 164 ●●●●● patch | view | raw | blame | history
src/views/management/computents/performance.vue 323 ●●●●● patch | view | raw | blame | history
src/views/management/computents/train.vue 168 ●●●●● patch | view | raw | blame | history
src/views/management/peopleDetails.vue 829 ●●●● patch | view | raw | blame | history
src/views/management/registerOLD.vue patch | view | raw | blame | history
src/views/onSiteInspection/company.js 378 ●●●●● patch | view | raw | blame | history
src/views/onSiteInspection/company.vue 389 ●●●●● patch | view | raw | blame | history
src/views/onSiteInspection/data.js 278 ●●●●● patch | view | raw | blame | history
src/views/onSiteInspection/securityStaff.vue 420 ●●●●● patch | view | raw | blame | history
src/views/onSiteInspection/securityStaffdata.js 198 ●●●●● patch | view | raw | blame | history
src/views/permit/permit.vue 452 ●●●● patch | view | raw | blame | history
src/views/qualificationExamination/qualificationExamination.vue 19 ●●●● patch | view | raw | blame | history
src/views/qualificationExamination/signQualificationExamination.vue 26 ●●●● patch | view | raw | blame | history
src/views/record/record.vue 808 ●●●● patch | view | raw | blame | history
src/views/recordk/recordk.vue 809 ●●●● patch | view | raw | blame | history
src/views/regulatoryInformation/index.vue 3 ●●●● patch | view | raw | blame | history
src/views/resource/attach.vue 233 ●●●●● patch | view | raw | blame | history
src/views/resource/oss.vue 761 ●●●● patch | view | raw | blame | history
src/views/revoke/revoke.vue 759 ●●●● patch | view | raw | blame | history
src/views/securityCompany/armed.vue 522 ●●●● patch | view | raw | blame | history
src/views/securityCompany/companyDetails.vue 1140 ●●●● patch | view | raw | blame | history
src/views/securityCompany/computents/equipment copy 4.vue 150 ●●●●● patch | view | raw | blame | history
src/views/securityCompany/computents/equipment.vue 280 ●●●●● patch | view | raw | blame | history
src/views/securityCompany/computents/punish.vue 150 ●●●●● patch | view | raw | blame | history
src/views/securityCompany/computents/service.vue 150 ●●●●● patch | view | raw | blame | history
src/views/securityCompany/computents/staff.vue 301 ●●●●● patch | view | raw | blame | history
src/views/securityCompany/confess.vue 522 ●●●● patch | view | raw | blame | history
src/views/securityCompany/dispatch.vue 522 ●●●● patch | view | raw | blame | history
src/views/securityCompany/security.vue 647 ●●●●● patch | view | raw | blame | history
src/views/securityCompany/train.vue 522 ●●●● patch | view | raw | blame | history
src/views/securityGuardManagement/dispatchChildoperable.vue 674 ●●●●● patch | view | raw | blame | history
src/views/securityGuardManagement/register.vue 995 ●●●●● patch | view | raw | blame | history
src/views/system/client.vue 593 ●●●● patch | view | raw | blame | history
src/views/system/dept.vue 614 ●●●● patch | view | raw | blame | history
src/views/system/dict.vue 186 ●●●● patch | view | raw | blame | history
src/views/system/dictbiz.vue 654 ●●●● patch | view | raw | blame | history
src/views/system/menu.vue 821 ●●●● patch | view | raw | blame | history
src/views/system/post.vue 490 ●●●● patch | view | raw | blame | history
src/views/system/tenant.vue 341 ●●●●● patch | view | raw | blame | history
src/views/system/topmenu.vue 628 ●●●● patch | view | raw | blame | history
src/views/system/user.vue 1844 ●●●● patch | view | raw | blame | history
src/views/workreport/workreply.vue 2 ●●●●● patch | view | raw | blame | history
src/views/workreport/workreport.vue 4 ●●● patch | view | raw | blame | history
src/api/dispatch/dispatch.js
New file
@@ -0,0 +1,78 @@
import request from '@/router/axios';
export const getdata = (current, size, params) => {
  return request({
    url: '/api/dispatcherUnit/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const adddata = (row) => {
  return request({
    url: '/api/dispatcherUnit/submit',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/dispatcherUnit/submit',
    method: 'post',
    data: row
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/dispatcherUnit/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const getdata1 = (current, size, params) => {
  // console.log(params,'set')
  return request({
    url: '/api/dispatcher/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const adddata1 = (row) => {
  return request({
    url: '/api/dispatcher/submit',
    method: 'post',
    data: row
  })
}
export const update1 = (row) => {
  return request({
    url: '/api/dispatcher/submit',
    method: 'post',
    data: row
  })
}
export const remove1 = (ids) => {
  return request({
    url: '/api/dispatcher/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
src/api/qualificationExamination/qualificationExamination.js
@@ -1,18 +1,18 @@
import request from '@/router/axios';
import axios from 'axios'
var newAxios = axios.create({
    baseURL: "http://192.168.0.105:812",
    withCredentials: false,
    // headers: {
    //     "Content-type": "application/x-ww-form-urlencoded"
    // }
})
// var newAxios = axios.create({
//     baseURL: "http://192.168.0.105:812",
//     withCredentials: false,
//     // headers: {
//     //     "Content-type": "application/x-ww-form-urlencoded"
//     // }
// })
export const getList = (current, size, params) => {
    // return request({
    return newAxios({
        url: '/api/punish/list',
    return request({
        // return newAxios({
        url: '/api/apply/page',
        method: 'get',
        params: {
            ...params,
@@ -23,8 +23,8 @@
}
export const adddata = (row) => {
    // return request({
    return newAxios({
    return request({
        // return newAxios({
        url: '/api/punish/save',
        // url: 'http://192.168.0.104:80/punish/save',
        method: 'post',
@@ -33,8 +33,8 @@
}
export const update = (row) => {
    // return request({
    return newAxios({
    return request({
        // return newAxios({
        url: '/api/punish/update',
        method: 'post',
        data: row
@@ -42,8 +42,8 @@
}
export const remove = (ids) => {
    // return request({
    return newAxios({
    return request({
        // return newAxios({
        url: '/api/punish/remove',
        method: 'post',
        params: {
src/api/qualificationExamination/signQualificationExamination.js
@@ -2,37 +2,18 @@
import axios from 'axios'
var newAxios = axios.create({
    baseURL: "http://192.168.0.105:812",
// var newAxios = axios.create({
//     baseURL: "http://192.168.0.105:812",
})
const newInstance = axios.create({
    baseURL: '',
    timeout: 5000,
    // headers: { 'Content-type': 'multipart/form-data' }
});
/*../../请根据自己的实际路径来获取*/
// newInstance.get('./../../static/json/guanzhou.json').then(res => {
//     console.log("获取本地的json文件" + JSON.stringify(res));
// })
export const getListJSON = (current, size, params) => {
    return newInstance({
        url: '../../api/qualificationExamination/signQualificationExamination.json',
        // return request({
        // url: '/api/apply/page',
        method: 'get'
    })
}
export const getList = (current, size, params) => {
    return newAxios({
        url: '/apply/page',
        // return request({
        // url: '/api/apply/page',
    // return newAxios({
    // url: '/apply/page',
    return request({
        url: '/api/apply/page',
        method: 'get',
        params: {
            ...params,
@@ -43,8 +24,8 @@
}
export const adddata = (row) => {
    // return request({
    return newAxios({
    return request({
        // return newAxios({
        url: '/api/apply/submit',
        // url: 'http://192.168.0.104:80/punish/save',
        method: 'post',
@@ -53,8 +34,8 @@
}
export const update = (row) => {
    // return request({
    return newAxios({
    return request({
        // return newAxios({
        url: '/api/punish/update',
        method: 'post',
        data: row
@@ -62,8 +43,8 @@
}
export const remove = (ids) => {
    // return request({
    return newAxios({
    return request({
        // return newAxios({
        url: '/api/apply/remove',
        method: 'post',
        params: {
src/config/website.js
@@ -19,8 +19,8 @@
  //配置首页不可关闭
  isFirstPage: false,
  fistPage: {
    label: "保安人员管理",
    value: "/register/index",
    label: "保安员查询",
    value: "/securityGuardManagement/register",
    params: {},
    query: {},
    meta: {
src/lang/zh.js
@@ -51,7 +51,7 @@
    info: '个人信息',
    website: 'bladex官网',
    avuexwebsite: 'avuex官网',
    dashboard: '保安人员管理',
    dashboard: '保安员查询',
    more: '更多',
    tags: '标签',
    store: '本地存储',
src/option/system/dict.js
@@ -5,6 +5,7 @@
  searchShow: true,
  searchMenuSpan: 10,
  border: true,
  searchShowBtn: false,
  index: true,
  selection: true,
  viewBtn: true,
src/option/system/dictbiz.js
@@ -7,6 +7,7 @@
  border: true,
  index: true,
  selection: true,
  searchShowBtn: false,
  viewBtn: true,
  menuWidth: 250,
  dialogWidth: 880,
src/option/system/param.js
@@ -6,6 +6,7 @@
  searchMenuSpan: 6,
  border: true,
  index: true,
  searchShowBtn: false,
  selection: true,
  viewBtn: true,
  dialogClickModal: false,
src/router/views/index.js
@@ -28,27 +28,27 @@
    {
        path: '/wel',
        component: () =>
            import ('@/views/home/index')
            // component: Layout,
            // redirect: '/wel/index',
            // children: [{
            //   path: 'index',
            //   name: '首页',
            //   meta: {
            //     i18n: 'dashboard'
            //   },
            //   component: () =>
            //     import( /* webpackChunkName: "views" */ '@/views/wel/index')
            // }, {
            //   path: 'dashboard',
            //   name: '控制台',
            //   meta: {
            //     i18n: 'dashboard',
            //     menu: false,
            //   },
            //   component: () =>
            //     import( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
            // }]
            import('@/views/home/index')
        // component: Layout,
        // redirect: '/wel/index',
        // children: [{
        //   path: 'index',
        //   name: '首页',
        //   meta: {
        //     i18n: 'dashboard'
        //   },
        //   component: () =>
        //     import( /* webpackChunkName: "views" */ '@/views/wel/index')
        // }, {
        //   path: 'dashboard',
        //   name: '控制台',
        //   meta: {
        //     i18n: 'dashboard',
        //     menu: false,
        //   },
        //   component: () =>
        //     import( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
        // }]
    },
@@ -64,7 +64,7 @@
                i18n: 'test'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/util/test')
                import( /* webpackChunkName: "views" */ '@/views/util/test')
        }]
    }, {
        path: '/dict-horizontal',
@@ -77,7 +77,7 @@
                i18n: 'dict'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/util/demo/dict-horizontal')
                import( /* webpackChunkName: "views" */ '@/views/util/demo/dict-horizontal')
        }]
    }, {
        path: '/dict-vertical',
@@ -90,7 +90,7 @@
                i18n: 'dict'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/util/demo/dict-vertical')
                import( /* webpackChunkName: "views" */ '@/views/util/demo/dict-vertical')
        }]
    }, {
        path: '/info',
@@ -103,7 +103,7 @@
                i18n: 'info'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/system/userinfo')
                import( /* webpackChunkName: "views" */ '@/views/system/userinfo')
        }]
    }, {
        path: '/work/process/leave',
@@ -116,7 +116,7 @@
                i18n: 'work'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/work/process/leave/form')
                import( /* webpackChunkName: "views" */ '@/views/work/process/leave/form')
        }, {
            path: 'handle/:taskId/:processInstanceId/:businessId',
            name: '处理请假流程',
@@ -124,7 +124,7 @@
                i18n: 'work'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/work/process/leave/handle')
                import( /* webpackChunkName: "views" */ '@/views/work/process/leave/handle')
        }, {
            path: 'detail/:processInstanceId/:businessId',
            name: '请假流程详情',
@@ -132,7 +132,7 @@
                i18n: 'work'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/work/process/leave/detail')
                import( /* webpackChunkName: "views" */ '@/views/work/process/leave/detail')
        }]
    }, {
        path: '/attach',
@@ -145,21 +145,35 @@
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/resource/attach')
                import( /* webpackChunkName: "views" */ '@/views/resource/attach')
        }]
    },
    // {
    //     path: '/register',
    //     redirect: '/management/index',
    //     component: Layout,
    //     children: [{
    //         path: 'index',
    //         name: '保安员查询',
    //         meta: {
    //             i18n: 'index',
    //         },
    //         component: () =>
    //             import( /* webpackChunkName: "views" */ '@/views/management/register')
    //     }]
    // },
    {
        path: '/register',
        redirect: '/management/index',
        path: '/securityGuardManagement',
        redirect: '/securityGuardManagement/register',
        component: Layout,
        children: [{
            path: 'index',
            name: '保安人员管理',
            path: 'register',
            name: '保安员查询',
            meta: {
                i18n: 'index',
                i18n: 'register',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/management/register')
                import( /* webpackChunkName: "views" */ '@/views/securityGuardManagement/register')
        }]
    },
    {
@@ -173,7 +187,7 @@
                i18n: 'dict'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/desk/notice')
                import( /* webpackChunkName: "views" */ '@/views/desk/notice')
        }]
    },
    {
@@ -187,7 +201,7 @@
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/resource/uploadNotice')
                import( /* webpackChunkName: "views" */ '@/views/resource/uploadNotice')
        }]
    }, {
        path: '/workreport',
@@ -200,7 +214,7 @@
                i18n: 'dict'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/workreport/workreport')
                import( /* webpackChunkName: "views" */ '@/views/workreport/workreport')
        }]
    },
    {
@@ -214,7 +228,7 @@
                i18n: 'dict'
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/workreport/workreply')
                import( /* webpackChunkName: "views" */ '@/views/workreport/workreply')
        }]
    }, {
        path: '/management',
@@ -222,12 +236,12 @@
        component: Layout,
        children: [{
            path: 'index',
            name: '保安详细资料',
            name: '保安详细信息',
            meta: {
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/management/peopleDetails')
                import( /* webpackChunkName: "views" */ '@/views/management/peopleDetails')
        }]
    }, {
        path: '/management',
@@ -240,9 +254,9 @@
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/management/idinformation')
                import( /* webpackChunkName: "views" */ '@/views/management/idinformation')
        }]
    },{
    }, {
        path: '/securityCompany',
        redirect: '/securityCompany/index',
        component: Layout,
@@ -253,12 +267,12 @@
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/securityCompany/companyDetails')
                import( /* webpackChunkName: "views" */ '@/views/securityCompany/companyDetails')
        }]
    }, {
        path: '/map',
        component: () =>
            import ( /* webpackChunkName: "views" */ '@/views/mapHome/index')
            import( /* webpackChunkName: "views" */ '@/views/mapHome/index')
    }, {
        path: '/regulatoryInformation',
        redirect: '/regulatoryInformation/index',
@@ -270,7 +284,7 @@
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/regulatoryInformation/index')
                import( /* webpackChunkName: "views" */ '@/views/regulatoryInformation/index')
        }]
    }, {
        path: '/securityUnitOperation/operationTable',
@@ -283,7 +297,7 @@
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/securityUnitOperation/operationTable')
                import( /* webpackChunkName: "views" */ '@/views/securityUnitOperation/operationTable')
        }]
    }, {
        path: '/securityUnitOperation/economicTable',
@@ -296,7 +310,7 @@
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/securityUnitOperation/economicTable')
                import( /* webpackChunkName: "views" */ '@/views/securityUnitOperation/economicTable')
        }]
    }
]
src/styles/element-ui.scss
@@ -4,11 +4,6 @@
  line-height: 28px !important;
}
//.el-card.is-always-shadow {
//  box-shadow: none;
//  border: none !important;
//}
.el-scrollbar__view {
  height: 100%;
}
@@ -141,8 +136,9 @@
  color: red !important;
}
.el-input__inner {
  background-color: $inputB !important;
  background-color: $inputqiu !important;
  color: $fontColor !important;
  border: 1px solid $inputBorder !important;
}
.el-tree-node__content {
  background-color: $mainB !important;
@@ -163,7 +159,7 @@
  color: $fontColor !important;
}
.el-tree {
  background-color: $inputB !important;
  background-color: $mainB !important;
  color: $fontColor !important;
}
.el-table th {
@@ -184,8 +180,13 @@
  color: $fontColor !important;
}
.w-e-toolbar {
  background-color: $inputB !important;
  // background-color: $inputB !important;
  background-color: #fff !important;
  color: $fontColor !important;
  // border: 1px solid $inputBorder !important;
}
.w-e-text-container {
  border: 1px solid $inputBorder !important;
}
.el-collapse-item__content {
  color: $fontColor !important;
@@ -212,6 +213,7 @@
//多行输入
.el-textarea__inner {
  background-color: $inputB1 !important;
  border: 1px solid $inputBorder !important;
}
// 数字type input
@@ -395,3 +397,119 @@
  overflow-y: scroll;
  overflow-x: hidden;
}
//菜单管理  左边展开
.el-table__expand-icon {
  color: $fontColor !important;
}
//所有表格 边框
.el-card {
  border: 1px solid transparent !important;
  box-shadow: 3px 3px 15px -2px rgb(0, 0, 0) !important;
}
// 左侧树形 阴影
// .el-card.is-always-shadow {
//   box-shadow: 3px 3px 15px -2px rgb(0, 0, 0);
// }
//表格斑马纹
.el-table tr:nth-child(2n -1) {
  background-color: #3457b1 !important;
}
//顶部搜索栏
.el-card.is-never-shadow.avue-crud__search {
  position: absolute;
  width: calc(100% - 180px);
  z-index: 500;
  border: none !important;
  box-shadow: none !important;
}
.registersss .el-card.is-never-shadow.avue-crud__search {
  width: calc(100% - 360px) !important;
}
.users .el-card.is-never-shadow.avue-crud__search {
  width: calc(100% - 800px) !important;
  left: 630px;
}
//有按钮的
.dispatchChildoperable .el-card.is-never-shadow.avue-crud__search {
  left: 120px;
  width: calc(100% - 300px);
}
.regulatoryInformation .el-card.is-never-shadow.avue-crud__search {
  left: 120px;
  width: calc(100% - 300px);
}
.notice .el-card.is-never-shadow.avue-crud__search {
  left: 120px;
  width: calc(100% - 300px);
}
.workreply .el-card.is-never-shadow.avue-crud__search {
  left: 200px;
  width: calc(100% - 380px);
}
.oos .el-card.is-never-shadow.avue-crud__search {
  left: 200px;
  width: calc(100% - 380px);
}
.role .el-card.is-never-shadow.avue-crud__search {
  left: 280px;
  width: calc(100% - 460px);
}
.dept .el-card.is-never-shadow.avue-crud__search {
  left: 200px;
  width: calc(100% - 380px);
}
.post .el-card.is-never-shadow.avue-crud__search {
  left: 200px;
  width: calc(100% - 380px);
}
.dict .el-card.is-never-shadow.avue-crud__search {
  left: 200px;
  width: calc(100% - 380px);
}
.dictbiz .el-card.is-never-shadow.avue-crud__search {
  left: 200px;
  width: calc(100% - 380px);
}
.menu .el-card.is-never-shadow.avue-crud__search {
  left: 200px;
  width: calc(100% - 380px);
}
.jurs .el-card.is-never-shadow.avue-crud__search {
  left: 200px;
  width: calc(100% - 380px);
}
.tenant .el-card.is-never-shadow.avue-crud__search {
  width: calc(100% - 800px) !important;
  left: 430px;
}
.avue-form {
  position: relative;
  top: 15px;
}
//顶部按钮栏
.avue-crud__menu {
  height: 60px;
}
//顶部按钮
.avue-crud .avue-crud__left .el-button,
.avue-crud .avue-crud__right .el-button,
.avue-form .avue-crud__left .el-button,
.avue-form .avue-crud__right .el-button {
  position: relative;
  top: 15px;
}
//编辑弹窗上横线
.avue-dialog .el-dialog__header {
  border-bottom: 1px solid #7ec9de;
}
//弹窗关闭和全屏按钮
.el-dialog__headerbtn .el-dialog__close,
.avue-crud__dialog__menu i {
  color: $close !important;
}
src/styles/ourBackgroundColor.scss
@@ -21,3 +21,9 @@
$buttonB: #7cbdff;
$inputB1: #2d5cc8;
$inputqiu: #2445926e;
$inputBorder: #7ec9de;
$close: #45bff2;
src/views/Juris/jurs.vue
@@ -1,31 +1,35 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :permission="permissionList"
               :before-open="beforeOpen"
               :before-close="beforeClose"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               @tree-load="treeLoad">
  <basic-container class="jurs">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      ref="crud"
      v-model="form"
      :permission="permissionList"
      :before-open="beforeOpen"
      :before-close="beforeClose"
      @row-del="rowDel"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
      @tree-load="treeLoad"
    >
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   v-if="permission.dept_delete"
                   plain
                   @click="handleDelete">删 除
        <el-button
          type="danger"
          size="small"
          icon="el-icon-delete"
          v-if="permission.dept_delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
      </template>
      <template slot-scope="scope" slot="menu">
@@ -33,164 +37,175 @@
          type="text"
          icon="el-icon-circle-plus-outline"
          size="small"
          @click.stop="handleAdd(scope.row,scope.index)"
          @click.stop="handleAdd(scope.row, scope.index)"
          v-if="userInfo.role_name.includes('admin')"
        >新增子项
          >新增子项
        </el-button>
      </template>
      <template slot-scope="{row}"
                slot="deptCategory">
        <el-tag>{{row.deptCategoryName}}</el-tag>
      <template slot-scope="{ row }" slot="deptCategory">
        <el-tag>{{ row.deptCategoryName }}</el-tag>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
  import {
    getLazyList,
    remove,
    update,
    add,
    getDept,
    getDeptTree
  } from "@/api/Jurs/jurs";
  import {mapGetters} from "vuex";
  import website from '@/config/website';
import {
  getLazyList,
  remove,
  update,
  add,
  getDept,
  getDeptTree,
} from "@/api/Jurs/jurs";
import { mapGetters } from "vuex";
import website from "@/config/website";
  export default {
    data() {
      return {
        form: {},
        selectionList: [],
        query: {},
        loading: true,
        parentId: 0,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        option: {
          lazy: true,
          tip: false,
          simplePage: true,
          searchShow: true,
          searchMenuSpan: 6,
          tree: true,
          border: true,
          index: true,
          selection: true,
          viewBtn: true,
          menuWidth: 300,
          dialogClickModal: false,
          column: [
            {
              label: "机构名称",
              prop: "deptName",
              search: true,
              rules: [{
export default {
  data() {
    return {
      form: {},
      selectionList: [],
      query: {},
      loading: true,
      parentId: 0,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      option: {
        lazy: true,
        tip: false,
        simplePage: true,
        searchShow: true,
        searchMenuSpan: 6,
        searchShowBtn: false,
        tree: true,
        border: true,
        index: true,
        selection: true,
        viewBtn: true,
        menuWidth: 300,
        dialogClickModal: false,
        column: [
          {
            label: "机构名称",
            prop: "deptName",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入机构名称",
                trigger: "blur"
              }]
            },
            {
              label: "所属租户",
              prop: "tenantId",
              type: "tree",
              dicUrl: "/api/blade-system/tenant/select",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: website.tenantMode,
              span: 24,
              props: {
                label: "tenantName",
                value: "tenantId"
                trigger: "blur",
              },
              hide: !website.tenantMode,
              search: website.tenantMode,
              rules: [{
            ],
          },
          {
            label: "所属租户",
            prop: "tenantId",
            type: "tree",
            dicUrl: "/api/blade-system/tenant/select",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: website.tenantMode,
            span: 24,
            props: {
              label: "tenantName",
              value: "tenantId",
            },
            hide: !website.tenantMode,
            search: website.tenantMode,
            rules: [
              {
                required: true,
                message: "请输入所属租户",
                trigger: "click"
              }]
            },
            {
              label: "机构全称",
              prop: "fullName",
              search: true,
              rules: [{
                trigger: "click",
              },
            ],
          },
          {
            label: "机构全称",
            prop: "fullName",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入机构全称",
                trigger: "blur"
              }]
            },
            {
              label: "上级机构",
              prop: "parentId",
              dicData: [],
              type: "tree",
              hide: true,
              addDisabled: false,
              props: {
                label: "title"
                trigger: "blur",
              },
              rules: [{
            ],
          },
          {
            label: "上级机构",
            prop: "parentId",
            dicData: [],
            type: "tree",
            hide: true,
            addDisabled: false,
            props: {
              label: "title",
            },
            rules: [
              {
                required: false,
                message: "请选择上级机构",
                trigger: "click"
              }]
            },
            {
              label: "备注",
              prop: "remark",
              rules: [{
                trigger: "click",
              },
            ],
          },
          {
            label: "备注",
            prop: "remark",
            rules: [
              {
                required: false,
                message: "请输入备注",
                trigger: "blur"
              }],
              hide: true
            }
          ]
        },
        data: []
                trigger: "blur",
              },
            ],
            hide: true,
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.jurs_add, false),
        viewBtn: this.vaildData(this.permission.jurs_view, false),
        delBtn: this.vaildData(this.permission.jurs_delete, false),
        editBtn: this.vaildData(this.permission.jurs_edit, false),
      };
    },
    computed: {
      ...mapGetters(["userInfo", "permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.jurs_add, false),
          viewBtn: this.vaildData(this.permission.jurs_view, false),
          delBtn: this.vaildData(this.permission.jurs_delete, false),
          editBtn: this.vaildData(this.permission.jurs_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    methods: {
      initData() {
        getDeptTree().then(res => {
          const column = this.findObject(this.option.column, "parentId");
          column.dicData = res.data.data;
        });
      },
      handleAdd(row) {
        this.parentId = row.id;
  },
  methods: {
    initData() {
      getDeptTree().then((res) => {
        const column = this.findObject(this.option.column, "parentId");
        column.value = row.id;
        column.addDisabled = true;
        this.$refs.crud.rowAdd();
      },
      rowSave(row, done, loading) {
        add(row).then((res) => {
        column.dicData = res.data.data;
      });
    },
    handleAdd(row) {
      this.parentId = row.id;
      const column = this.findObject(this.option.column, "parentId");
      column.value = row.id;
      column.addDisabled = true;
      this.$refs.crud.rowAdd();
    },
    rowSave(row, done, loading) {
      add(row).then(
        (res) => {
          // 获取新增数据的相关字段
          const data = res.data.data;
          row.id = data.id;
@@ -198,135 +213,142 @@
          row.tenantId = data.tenantId;
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          // 数据回调进行刷新
          done(row);
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          // 数据回调进行刷新
          done(row);
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row, index, done) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          // 数据回调进行刷新
          done(row);
        });
      },
      rowDel(row, index, done) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            // 数据回调进行刷新
            done(row);
        .then(() => {
          // 刷新表格数据并重载
          this.data = [];
          this.parentId = 0;
          this.$refs.crud.refreshTable();
          this.$refs.crud.toggleSelection();
          // 表格数据重载
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            // 刷新表格数据并重载
            this.data = [];
            this.parentId = 0;
            this.$refs.crud.refreshTable();
            this.$refs.crud.toggleSelection();
            // 表格数据重载
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.parentId = '';
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      beforeOpen(done, type) {
        if (["add", "edit"].includes(type)) {
          this.initData();
        }
        if (["edit", "view"].includes(type)) {
          getDept(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      beforeClose(done) {
        this.parentId = "";
        const column = this.findObject(this.option.column, "parentId");
        column.value = "";
        column.addDisabled = false;
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
        });
    },
    searchReset() {
      this.query = {};
      this.parentId = 0;
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.parentId = "";
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    beforeOpen(done, type) {
      if (["add", "edit"].includes(type)) {
        this.initData();
      }
      if (["edit", "view"].includes(type)) {
        getDept(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    beforeClose(done) {
      this.parentId = "";
      const column = this.findObject(this.option.column, "parentId");
      column.value = "";
      column.addDisabled = false;
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getLazyList(this.parentId, Object.assign(params, this.query)).then(
        (res) => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
      },
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
        getLazyList(parentId).then(res => {
          resolve(res.data.data);
        });
      }
    }
  };
        }
      );
    },
    treeLoad(tree, treeNode, resolve) {
      const parentId = tree.id;
      getLazyList(parentId).then((res) => {
        resolve(res.data.data);
      });
    },
  },
};
</script>
<style>
src/views/authority/apiscope.vue
@@ -1,70 +1,82 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :permission="permissionList"
               :before-open="beforeOpen"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               @tree-load="treeLoad">
      <template slot-scope="{row}" slot="menu">
        <el-button type="text"
                   icon="el-icon-setting"
                   size="small"
                   v-if="permission.api_scope_setting"
                   plain
                   style="border: 0;background-color: transparent !important;"
                   @click.stop="handleDataScope(row)">权限配置
  <basic-container class="apiscope">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      ref="crud"
      v-model="form"
      :permission="permissionList"
      :before-open="beforeOpen"
      @row-del="rowDel"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
      @tree-load="treeLoad"
    >
      <template slot-scope="{ row }" slot="menu">
        <el-button
          type="text"
          icon="el-icon-setting"
          size="small"
          v-if="permission.api_scope_setting"
          plain
          style="border: 0; background-color: transparent !important"
          @click.stop="handleDataScope(row)"
          >权限配置
        </el-button>
      </template>
      <template slot-scope="{row}" slot="source">
        <div style="text-align:center">
          <i :class="row.source"/>
      <template slot-scope="{ row }" slot="source">
        <div style="text-align: center">
          <i :class="row.source" />
        </div>
      </template>
    </avue-crud>
    <el-drawer :title="`[${scopeMenuName}] 接口权限配置`" :visible.sync="drawerVisible" :direction="direction"
               append-to-body
               :before-close="handleDrawerClose" size="1000px">
    <el-drawer
      :title="`[${scopeMenuName}] 接口权限配置`"
      :visible.sync="drawerVisible"
      :direction="direction"
      append-to-body
      :before-close="handleDrawerClose"
      size="1000px"
    >
      <basic-container>
        <avue-crud :option="optionScope"
                   :data="dataScope"
                   :page="pageScope"
                   v-model="formScope"
                   :table-loading="scopeLoading"
                   ref="crudScope"
                   @row-del="rowDelScope"
                   @row-update="rowUpdateScope"
                   @row-save="rowSaveScope"
                   :before-open="beforeOpenScope"
                   @search-change="searchChangeScope"
                   @search-reset="searchResetScope"
                   @selection-change="selectionChangeScope"
                   @current-change="currentChangeScope"
                   @size-change="sizeChangeScope"
                   @on-load="onLoadScope">
        <avue-crud
          :option="optionScope"
          :data="dataScope"
          :page="pageScope"
          v-model="formScope"
          :table-loading="scopeLoading"
          ref="crudScope"
          @row-del="rowDelScope"
          @row-update="rowUpdateScope"
          @row-save="rowSaveScope"
          :before-open="beforeOpenScope"
          @search-change="searchChangeScope"
          @search-reset="searchResetScope"
          @selection-change="selectionChangeScope"
          @current-change="currentChangeScope"
          @size-change="sizeChangeScope"
          @on-load="onLoadScope"
        >
          <template slot="menuLeft">
            <el-button type="danger"
                       size="small"
                       icon="el-icon-delete"
                       plain
                       @click="handleDeleteScope">删 除
            <el-button
              type="danger"
              size="small"
              icon="el-icon-delete"
              plain
              @click="handleDeleteScope"
              >删 除
            </el-button>
          </template>
          <template slot-scope="{row}"
                    slot="scopeType">
            <el-tag>{{row.scopeTypeName}}</el-tag>
          <template slot-scope="{ row }" slot="scopeType">
            <el-tag>{{ row.scopeTypeName }}</el-tag>
          </template>
        </avue-crud>
      </basic-container>
@@ -73,571 +85,598 @@
</template>
<script>
  import {
    add,
    remove,
    update,
    getLazyMenuList,
    getMenu
  } from "@/api/system/menu";
  import {
    addApiScope,
    removeApiScope,
    updateApiScope,
    getListApiScope,
    getMenuApiScope
  } from "@/api/system/scope";
  import {mapGetters} from "vuex";
  import iconList from "@/config/iconList";
import {
  add,
  remove,
  update,
  getLazyMenuList,
  getMenu,
} from "@/api/system/menu";
import {
  addApiScope,
  removeApiScope,
  updateApiScope,
  getListApiScope,
  getMenuApiScope,
} from "@/api/system/scope";
import { mapGetters } from "vuex";
import iconList from "@/config/iconList";
  export default {
    data() {
      return {
        form: {},
        selectionList: [],
        query: {},
        loading: true,
        parentId: 0,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        drawerVisible: false,
        direction: 'rtl',
        scopeLoading: false,
        scopeMenuId: 0,
        scopeMenuName: "菜单",
        menu: true,
        option: {
          lazy: true,
          tip: false,
          simplePage: true,
          searchShow: true,
          searchMenuSpan: 6,
          dialogWidth: "60%",
          tree: true,
          border: true,
          index: true,
          selection: true,
          viewBtn: false,
          editBtn: false,
          addBtn: false,
          delBtn: false,
          menuWidth: 150,
          dialogClickModal: false,
          column: [
            {
              label: "菜单名称",
              prop: "name",
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入菜单名称",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "路由地址",
              prop: "path",
              rules: [
                {
                  required: true,
                  message: "请输入路由地址",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "上级菜单",
              prop: "parentId",
              type: "tree",
              dicUrl: "/api/blade-system/menu/tree",
              hide: true,
              props: {
                label: "title"
export default {
  data() {
    return {
      form: {},
      selectionList: [],
      query: {},
      loading: true,
      parentId: 0,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      drawerVisible: false,
      direction: "rtl",
      scopeLoading: false,
      scopeMenuId: 0,
      scopeMenuName: "菜单",
      menu: true,
      option: {
        lazy: true,
        tip: false,
        simplePage: true,
        searchShow: true,
        searchMenuSpan: 6,
        dialogWidth: "60%",
        tree: true,
        border: true,
        searchShowBtn: false,
        index: true,
        selection: true,
        viewBtn: false,
        editBtn: false,
        addBtn: false,
        delBtn: false,
        menuWidth: 150,
        dialogClickModal: false,
        column: [
          {
            label: "菜单名称",
            prop: "name",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入菜单名称",
                trigger: "blur",
              },
              rules: [
                {
                  required: false,
                  message: "请选择上级菜单",
                  trigger: "click"
                }
              ]
            ],
          },
          {
            label: "路由地址",
            prop: "path",
            rules: [
              {
                required: true,
                message: "请输入路由地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "上级菜单",
            prop: "parentId",
            type: "tree",
            dicUrl: "/api/blade-system/menu/tree",
            hide: true,
            props: {
              label: "title",
            },
            {
              label: "菜单图标",
              prop: "source",
              type: "icon",
              slot: true,
              width: 80,
              iconList: iconList,
              rules: [
                {
                  required: true,
                  message: "请输入菜单图标",
                  trigger: "click"
                }
              ]
            },
            {
              label: "菜单编号",
              prop: "code",
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入菜单编号",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单类型",
              prop: "category",
              type: "radio",
              dicData: [
                {
                  label: "菜单",
                  value: 1
                },
                {
                  label: "按钮",
                  value: 2
                }
              ],
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择菜单类型",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单别名",
              prop: "alias",
              rules: [
                {
                  required: true,
                  message: "请输入菜单别名",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "按钮功能",
              prop: "action",
              type: "radio",
              dicData: [
                {
                  label: "工具栏",
                  value: 0
                },
                {
                  label: "操作栏",
                  value: 1
                },
                {
                  label: "工具操作栏",
                  value: 2
                }
              ],
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择按钮功能",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单排序",
              prop: "sort",
              type: "number",
              width: 80,
              rules: [
                {
                  required: true,
                  message: "请输入菜单排序",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "新窗口",
              prop: "isOpen",
              type: "radio",
              dicData: [
                {
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                },
              ],
              hide: true
            },
            {
              label: "菜单备注",
              prop: "remark",
              type: "textarea",
              span: 24,
              minRows: 6,
              hide: true
            }
          ]
        },
        data: [],
        formScope: {},
        selectionListScope: [],
        pageScope: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        optionScope: {
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          menuWidth: 200,
          dialogWidth: 900,
          dialogClickModal: false,
          column: [
            {
              label: "权限名称",
              prop: "scopeName",
              search: true,
              rules: [{
            rules: [
              {
                required: false,
                message: "请选择上级菜单",
                trigger: "click",
              },
            ],
          },
          {
            label: "菜单图标",
            prop: "source",
            type: "icon",
            slot: true,
            width: 80,
            iconList: iconList,
            rules: [
              {
                required: true,
                message: "请输入菜单图标",
                trigger: "click",
              },
            ],
          },
          {
            label: "菜单编号",
            prop: "code",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入菜单编号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "菜单类型",
            prop: "category",
            type: "radio",
            dicData: [
              {
                label: "菜单",
                value: 1,
              },
              {
                label: "按钮",
                value: 2,
              },
            ],
            hide: true,
            rules: [
              {
                required: true,
                message: "请选择菜单类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "菜单别名",
            prop: "alias",
            rules: [
              {
                required: true,
                message: "请输入菜单别名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "按钮功能",
            prop: "action",
            type: "radio",
            dicData: [
              {
                label: "工具栏",
                value: 0,
              },
              {
                label: "操作栏",
                value: 1,
              },
              {
                label: "工具操作栏",
                value: 2,
              },
            ],
            hide: true,
            rules: [
              {
                required: true,
                message: "请选择按钮功能",
                trigger: "blur",
              },
            ],
          },
          {
            label: "菜单排序",
            prop: "sort",
            type: "number",
            width: 80,
            rules: [
              {
                required: true,
                message: "请输入菜单排序",
                trigger: "blur",
              },
            ],
          },
          {
            label: "新窗口",
            prop: "isOpen",
            type: "radio",
            dicData: [
              {
                label: "否",
                value: 0,
              },
              {
                label: "是",
                value: 1,
              },
            ],
            hide: true,
          },
          {
            label: "菜单备注",
            prop: "remark",
            type: "textarea",
            span: 24,
            minRows: 6,
            hide: true,
          },
        ],
      },
      data: [],
      formScope: {},
      selectionListScope: [],
      pageScope: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      optionScope: {
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: true,
        viewBtn: true,
        selection: true,
        menuWidth: 200,
        dialogWidth: 900,
        dialogClickModal: false,
        column: [
          {
            label: "权限名称",
            prop: "scopeName",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入数据权限名称",
                trigger: "blur"
              }]
            },
            {
              label: "权限编号",
              prop: "resourceCode",
              search: true,
              width: 180,
              rules: [{
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur"
              }]
            },
            {
              label: "权限路径",
              prop: "scopePath",
              width: 180,
              rules: [{
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur"
              }]
            },
            {
              label: "接口类型",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=api_scope_type",
              props: {
                label: "dictValue",
                value: "dictKey"
                trigger: "blur",
              },
              dataType: "number",
              slot: true,
              width: 100,
              prop: "scopeType",
              rules: [{
            ],
          },
          {
            label: "权限编号",
            prop: "resourceCode",
            search: true,
            width: 180,
            rules: [
              {
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "权限路径",
            prop: "scopePath",
            width: 180,
            rules: [
              {
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "接口类型",
            type: "select",
            dicUrl: "/api/blade-system/dict/dictionary?code=api_scope_type",
            props: {
              label: "dictValue",
              value: "dictKey",
            },
            dataType: "number",
            slot: true,
            width: 100,
            prop: "scopeType",
            rules: [
              {
                required: true,
                message: "请输入通知类型",
                trigger: "blur"
              }]
            },
            {
              label: "备注",
              prop: "remark",
              span: 24,
              hide: true,
            },
          ]
        },
        dataScope: []
                trigger: "blur",
              },
            ],
          },
          {
            label: "备注",
            prop: "remark",
            span: 24,
            hide: true,
          },
        ],
      },
      dataScope: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.menu_add, false),
        viewBtn: this.vaildData(this.permission.menu_view, false),
        delBtn: this.vaildData(this.permission.menu_delete, false),
        editBtn: this.vaildData(this.permission.menu_edit, false),
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.menu_add, false),
          viewBtn: this.vaildData(this.permission.menu_view, false),
          delBtn: this.vaildData(this.permission.menu_delete, false),
          editBtn: this.vaildData(this.permission.menu_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
      scopeIds() {
        let ids = [];
        this.selectionListScope.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    methods: {
      // 菜单管理模块
      rowSave(row, done, loading) {
        add(row).then(() => {
    scopeIds() {
      let ids = [];
      this.selectionListScope.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    // 菜单管理模块
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
    },
    searchReset() {
      this.query = {};
      this.parentId = 0;
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.parentId = "";
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.parentId = '';
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenu(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getMenu(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(
        (res) => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
      },
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
        getLazyMenuList(parentId).then(res => {
          resolve(res.data.data);
        });
      },
      // 数据权限模块
      handleDataScope(row) {
        this.drawerVisible = true;
        this.scopeMenuId = row.id;
        this.scopeMenuName = row.name;
        this.onLoadScope(this.pageScope)
      },
      handleDrawerClose(hide) {
        hide();
      },
      rowSaveScope(row, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
        addApiScope(row).then(() => {
        }
      );
    },
    treeLoad(tree, treeNode, resolve) {
      const parentId = tree.id;
      getLazyMenuList(parentId).then((res) => {
        resolve(res.data.data);
      });
    },
    // 数据权限模块
    handleDataScope(row) {
      this.drawerVisible = true;
      this.scopeMenuId = row.id;
      this.scopeMenuName = row.name;
      this.onLoadScope(this.pageScope);
    },
    handleDrawerClose(hide) {
      hide();
    },
    rowSaveScope(row, done, loading) {
      row = {
        ...row,
        menuId: this.scopeMenuId,
      };
      addApiScope(row).then(
        () => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdateScope(row, index, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
        updateApiScope(row).then(() => {
        }
      );
    },
    rowUpdateScope(row, index, done, loading) {
      row = {
        ...row,
        menuId: this.scopeMenuId,
      };
      updateApiScope(row).then(
        () => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowDelScope(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }
      );
    },
    rowDelScope(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return removeApiScope(row.id);
        })
          .then(() => {
            return removeApiScope(row.id);
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
        .then(() => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      handleDeleteScope() {
        if (this.selectionListScope.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return removeApiScope(this.scopeIds);
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crudScope.toggleSelection();
          });
      },
      beforeOpenScope(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenuApiScope(this.formScope.id).then(res => {
            this.formScope = res.data.data;
          });
        }
        done();
      },
      searchResetScope() {
        this.onLoadScope(this.pageScope);
      },
      searchChangeScope(params, done) {
        this.onLoadScope(this.pageScope, params);
        done();
      },
      selectionChangeScope(list) {
        this.selectionListScope = list;
      },
      currentChangeScope(currentPage) {
        this.pageScope.currentPage = currentPage;
      },
      sizeChangeScope(pageSize) {
        this.pageScope.pageSize = pageSize;
      },
      onLoadScope(page, params = {}) {
        this.scopeLoading = true;
        const values = {
          ...params,
          menuId: this.scopeMenuId,
        }
        getListApiScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
          const data = res.data.data;
          this.pageScope.total = data.total;
          this.dataScope = data.records;
          this.selectionListScope = [];
          this.scopeLoading = false;
        });
      },
    }
  };
    },
    handleDeleteScope() {
      if (this.selectionListScope.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return removeApiScope(this.scopeIds);
        })
        .then(() => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crudScope.toggleSelection();
        });
    },
    beforeOpenScope(done, type) {
      if (["edit", "view"].includes(type)) {
        getMenuApiScope(this.formScope.id).then((res) => {
          this.formScope = res.data.data;
        });
      }
      done();
    },
    searchResetScope() {
      this.onLoadScope(this.pageScope);
    },
    searchChangeScope(params, done) {
      this.onLoadScope(this.pageScope, params);
      done();
    },
    selectionChangeScope(list) {
      this.selectionListScope = list;
    },
    currentChangeScope(currentPage) {
      this.pageScope.currentPage = currentPage;
    },
    sizeChangeScope(pageSize) {
      this.pageScope.pageSize = pageSize;
    },
    onLoadScope(page, params = {}) {
      this.scopeLoading = true;
      const values = {
        ...params,
        menuId: this.scopeMenuId,
      };
      getListApiScope(
        page.currentPage,
        page.pageSize,
        Object.assign(values, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.pageScope.total = data.total;
        this.dataScope = data.records;
        this.selectionListScope = [];
        this.scopeLoading = false;
      });
    },
  },
};
</script>
src/views/authority/datascope.vue
@@ -1,70 +1,82 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :permission="permissionList"
               :before-open="beforeOpen"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               @tree-load="treeLoad">
      <template slot-scope="{row}" slot="menu">
        <el-button type="text"
                   icon="el-icon-setting"
                   size="small"
                   v-if="permission.data_scope_setting"
                   plain
                   style="border: 0;background-color: transparent !important;"
                   @click.stop="handleDataScope(row)">权限配置
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      ref="crud"
      v-model="form"
      :permission="permissionList"
      :before-open="beforeOpen"
      @row-del="rowDel"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
      @tree-load="treeLoad"
    >
      <template slot-scope="{ row }" slot="menu">
        <el-button
          type="text"
          icon="el-icon-setting"
          size="small"
          v-if="permission.data_scope_setting"
          plain
          style="border: 0; background-color: transparent !important"
          @click.stop="handleDataScope(row)"
          >权限配置
        </el-button>
      </template>
      <template slot-scope="{row}" slot="source">
        <div style="text-align:center">
          <i :class="row.source"/>
      <template slot-scope="{ row }" slot="source">
        <div style="text-align: center">
          <i :class="row.source" />
        </div>
      </template>
    </avue-crud>
    <el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction"
               append-to-body
               :before-close="handleDrawerClose" size="1000px">
    <el-drawer
      :title="`[${scopeMenuName}] 数据权限配置`"
      :visible.sync="drawerVisible"
      :direction="direction"
      append-to-body
      :before-close="handleDrawerClose"
      size="1000px"
    >
      <basic-container>
        <avue-crud :option="optionScope"
                   :data="dataScope"
                   :page="pageScope"
                   v-model="formScope"
                   :table-loading="scopeLoading"
                   ref="crudScope"
                   @row-del="rowDelScope"
                   @row-update="rowUpdateScope"
                   @row-save="rowSaveScope"
                   :before-open="beforeOpenScope"
                   @search-change="searchChangeScope"
                   @search-reset="searchResetScope"
                   @selection-change="selectionChangeScope"
                   @current-change="currentChangeScope"
                   @size-change="sizeChangeScope"
                   @on-load="onLoadScope">
        <avue-crud
          :option="optionScope"
          :data="dataScope"
          :page="pageScope"
          v-model="formScope"
          :table-loading="scopeLoading"
          ref="crudScope"
          @row-del="rowDelScope"
          @row-update="rowUpdateScope"
          @row-save="rowSaveScope"
          :before-open="beforeOpenScope"
          @search-change="searchChangeScope"
          @search-reset="searchResetScope"
          @selection-change="selectionChangeScope"
          @current-change="currentChangeScope"
          @size-change="sizeChangeScope"
          @on-load="onLoadScope"
        >
          <template slot="menuLeft">
            <el-button type="danger"
                       size="small"
                       icon="el-icon-delete"
                       plain
                       @click="handleDeleteScope">删 除
            <el-button
              type="danger"
              size="small"
              icon="el-icon-delete"
              plain
              @click="handleDeleteScope"
              >删 除
            </el-button>
          </template>
          <template slot-scope="{row}"
                    slot="scopeType">
            <el-tag>{{row.scopeTypeName}}</el-tag>
          <template slot-scope="{ row }" slot="scopeType">
            <el-tag>{{ row.scopeTypeName }}</el-tag>
          </template>
        </avue-crud>
      </basic-container>
@@ -73,655 +85,687 @@
</template>
<script>
  import {
    add,
    remove,
    update,
    getLazyMenuList,
    getMenu
  } from "@/api/system/menu";
  import {
    addDataScope,
    removeDataScope,
    updateDataScope,
    getListDataScope,
    getMenuDataScope
  } from "@/api/system/scope";
  import {mapGetters} from "vuex";
  import iconList from "@/config/iconList";
  import func from "@/util/func";
import {
  add,
  remove,
  update,
  getLazyMenuList,
  getMenu,
} from "@/api/system/menu";
import {
  addDataScope,
  removeDataScope,
  updateDataScope,
  getListDataScope,
  getMenuDataScope,
} from "@/api/system/scope";
import { mapGetters } from "vuex";
import iconList from "@/config/iconList";
import func from "@/util/func";
  export default {
    data() {
      return {
        form: {},
        selectionList: [],
        query: {},
        loading: true,
        parentId: 0,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        drawerVisible: false,
        direction: 'rtl',
        scopeMenuId: 0,
        scopeMenuCode: '',
        scopeMenuName: "菜单",
        scopeLoading: false,
        menu: true,
        watchMode: true,
        option: {
          lazy: true,
          tip: false,
          simplePage: true,
          searchShow: true,
          searchMenuSpan: 6,
          dialogWidth: "60%",
          tree: true,
          border: true,
          index: true,
          selection: true,
          viewBtn: false,
          editBtn: false,
          addBtn: false,
          delBtn: false,
          menuWidth: 150,
          dialogClickModal: false,
          column: [
            {
              label: "菜单名称",
              prop: "name",
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入菜单名称",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "路由地址",
              prop: "path",
              rules: [
                {
                  required: true,
                  message: "请输入路由地址",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "上级菜单",
              prop: "parentId",
              type: "tree",
              dicUrl: "/api/blade-system/menu/tree",
              hide: true,
              props: {
                label: "title"
export default {
  data() {
    return {
      form: {},
      selectionList: [],
      query: {},
      loading: true,
      parentId: 0,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      drawerVisible: false,
      direction: "rtl",
      scopeMenuId: 0,
      scopeMenuCode: "",
      scopeMenuName: "菜单",
      scopeLoading: false,
      menu: true,
      watchMode: true,
      option: {
        lazy: true,
        tip: false,
        simplePage: true,
        searchShow: true,
        searchMenuSpan: 6,
        searchShowBtn: false,
        dialogWidth: "60%",
        tree: true,
        border: true,
        index: true,
        selection: true,
        viewBtn: false,
        editBtn: false,
        addBtn: false,
        delBtn: false,
        menuWidth: 150,
        dialogClickModal: false,
        column: [
          {
            label: "菜单名称",
            prop: "name",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入菜单名称",
                trigger: "blur",
              },
              rules: [
                {
                  required: false,
                  message: "请选择上级菜单",
                  trigger: "click"
                }
              ]
            ],
          },
          {
            label: "路由地址",
            prop: "path",
            rules: [
              {
                required: true,
                message: "请输入路由地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "上级菜单",
            prop: "parentId",
            type: "tree",
            dicUrl: "/api/blade-system/menu/tree",
            hide: true,
            props: {
              label: "title",
            },
            {
              label: "菜单图标",
              prop: "source",
              type: "icon",
              slot: true,
              width: 80,
              iconList: iconList,
              rules: [
                {
                  required: true,
                  message: "请输入菜单图标",
                  trigger: "click"
                }
              ]
            },
            {
              label: "菜单编号",
              prop: "code",
              search: true,
              rules: [
                {
                  required: true,
                  message: "请输入菜单编号",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单类型",
              prop: "category",
              type: "radio",
              dicData: [
                {
                  label: "菜单",
                  value: 1
                },
                {
                  label: "按钮",
                  value: 2
                }
              ],
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择菜单类型",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单别名",
              prop: "alias",
              rules: [
                {
                  required: true,
                  message: "请输入菜单别名",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "按钮功能",
              prop: "action",
              type: "radio",
              dicData: [
                {
                  label: "工具栏",
                  value: 0
                },
                {
                  label: "操作栏",
                  value: 1
                },
                {
                  label: "工具操作栏",
                  value: 2
                }
              ],
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择按钮功能",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "菜单排序",
              prop: "sort",
              type: "number",
              width: 80,
              rules: [
                {
                  required: true,
                  message: "请输入菜单排序",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "新窗口",
              prop: "isOpen",
              type: "radio",
              dicData: [
                {
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                },
              ],
              hide: true
            },
            {
              label: "菜单备注",
              prop: "remark",
              type: "textarea",
              span: 24,
              minRows: 6,
              hide: true
            }
          ]
        },
        data: [],
        formScope: {},
        selectionListScope: [],
        pageScope: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        optionScope: {
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          menuWidth: 200,
          dialogWidth: 900,
          dialogClickModal: false,
          column: [
            {
              label: "权限名称",
              prop: "scopeName",
              search: true,
              value: "",
              rules: [{
            rules: [
              {
                required: false,
                message: "请选择上级菜单",
                trigger: "click",
              },
            ],
          },
          {
            label: "菜单图标",
            prop: "source",
            type: "icon",
            slot: true,
            width: 80,
            iconList: iconList,
            rules: [
              {
                required: true,
                message: "请输入菜单图标",
                trigger: "click",
              },
            ],
          },
          {
            label: "菜单编号",
            prop: "code",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入菜单编号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "菜单类型",
            prop: "category",
            type: "radio",
            dicData: [
              {
                label: "菜单",
                value: 1,
              },
              {
                label: "按钮",
                value: 2,
              },
            ],
            hide: true,
            rules: [
              {
                required: true,
                message: "请选择菜单类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "菜单别名",
            prop: "alias",
            rules: [
              {
                required: true,
                message: "请输入菜单别名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "按钮功能",
            prop: "action",
            type: "radio",
            dicData: [
              {
                label: "工具栏",
                value: 0,
              },
              {
                label: "操作栏",
                value: 1,
              },
              {
                label: "工具操作栏",
                value: 2,
              },
            ],
            hide: true,
            rules: [
              {
                required: true,
                message: "请选择按钮功能",
                trigger: "blur",
              },
            ],
          },
          {
            label: "菜单排序",
            prop: "sort",
            type: "number",
            width: 80,
            rules: [
              {
                required: true,
                message: "请输入菜单排序",
                trigger: "blur",
              },
            ],
          },
          {
            label: "新窗口",
            prop: "isOpen",
            type: "radio",
            dicData: [
              {
                label: "否",
                value: 0,
              },
              {
                label: "是",
                value: 1,
              },
            ],
            hide: true,
          },
          {
            label: "菜单备注",
            prop: "remark",
            type: "textarea",
            span: 24,
            minRows: 6,
            hide: true,
          },
        ],
      },
      data: [],
      formScope: {},
      selectionListScope: [],
      pageScope: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      optionScope: {
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: true,
        viewBtn: true,
        selection: true,
        menuWidth: 200,
        dialogWidth: 900,
        dialogClickModal: false,
        column: [
          {
            label: "权限名称",
            prop: "scopeName",
            search: true,
            value: "",
            rules: [
              {
                required: true,
                message: "请输入数据权限名称",
                trigger: "blur"
              }]
            },
            {
              label: "权限编号",
              prop: "resourceCode",
              search: true,
              width: 100,
              rules: [{
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur"
              }]
            },
            {
              label: "权限字段",
              prop: "scopeColumn",
              width: 130,
              rules: [{
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur"
              }]
            },
            {
              label: "规则类型",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=data_scope_type",
              props: {
                label: "dictValue",
                value: "dictKey"
                trigger: "blur",
              },
              dataType: "number",
              slot: true,
              width: 140,
              prop: "scopeType",
              rules: [{
            ],
          },
          {
            label: "权限编号",
            prop: "resourceCode",
            search: true,
            width: 100,
            rules: [
              {
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "权限字段",
            prop: "scopeColumn",
            width: 130,
            rules: [
              {
                required: true,
                message: "请输入数据权限编号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "规则类型",
            type: "select",
            dicUrl: "/api/blade-system/dict/dictionary?code=data_scope_type",
            props: {
              label: "dictValue",
              value: "dictKey",
            },
            dataType: "number",
            slot: true,
            width: 140,
            prop: "scopeType",
            rules: [
              {
                required: true,
                message: "请输入通知类型",
                trigger: "blur"
              }]
            },
            {
              label: "可见字段",
              prop: "scopeField",
              span: 24,
              hide: true,
              value: "*",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "可见字段",
            prop: "scopeField",
            span: 24,
            hide: true,
            value: "*",
            rules: [
              {
                required: true,
                message: "请输入数据权限可见的字段",
                trigger: "blur"
              }],
            },
            {
              label: "权限类名",
              prop: "scopeClass",
              span: 24,
              hide: true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "权限类名",
            prop: "scopeClass",
            span: 24,
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入MybatisMapper对应方法的完整类名路径",
                trigger: "blur"
              }],
            },
            {
              label: "规则值",
              prop: "scopeValue",
              span: 24,
              minRows: 5,
              type: "textarea",
              display: true,
              hide: true,
            },
            {
              label: "备注",
              prop: "remark",
              span: 24,
              hide: true,
            },
          ]
        },
        dataScope: []
                trigger: "blur",
              },
            ],
          },
          {
            label: "规则值",
            prop: "scopeValue",
            span: 24,
            minRows: 5,
            type: "textarea",
            display: true,
            hide: true,
          },
          {
            label: "备注",
            prop: "remark",
            span: 24,
            hide: true,
          },
        ],
      },
      dataScope: [],
    };
  },
  watch: {
    "formScope.scopeType"() {
      this.initScope();
    },
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.menu_add, false),
        viewBtn: this.vaildData(this.permission.menu_view, false),
        delBtn: this.vaildData(this.permission.menu_delete, false),
        editBtn: this.vaildData(this.permission.menu_edit, false),
      };
    },
    watch: {
      'formScope.scopeType'() {
        this.initScope();
      }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.menu_add, false),
          viewBtn: this.vaildData(this.permission.menu_view, false),
          delBtn: this.vaildData(this.permission.menu_delete, false),
          editBtn: this.vaildData(this.permission.menu_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
      scopeIds() {
        let ids = [];
        this.selectionListScope.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    scopeIds() {
      let ids = [];
      this.selectionListScope.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    methods: {
      initScope() {
        const scopeType = func.toInt(this.formScope.scopeType);
        const watchMode = this.watchMode;
        let column = "-", name = "暂无";
        if (scopeType === 1) {
          column = "-";
          name = "全部可见";
        } else if (scopeType === 2) {
          column = "create_user";
          name = "本人可见";
        } else if (scopeType === 3) {
          column = "create_dept";
          name = "所在机构可见";
        } else if (scopeType === 4) {
          column = "create_dept";
          name = "所在机构可见及子级可见";
        } else if (scopeType === 5) {
          column = "";
          name = "自定义";
  },
  methods: {
    initScope() {
      const scopeType = func.toInt(this.formScope.scopeType);
      const watchMode = this.watchMode;
      let column = "-",
        name = "暂无";
      if (scopeType === 1) {
        column = "-";
        name = "全部可见";
      } else if (scopeType === 2) {
        column = "create_user";
        name = "本人可见";
      } else if (scopeType === 3) {
        column = "create_dept";
        name = "所在机构可见";
      } else if (scopeType === 4) {
        column = "create_dept";
        name = "所在机构可见及子级可见";
      } else if (scopeType === 5) {
        column = "";
        name = "自定义";
      }
      this.$refs.crudScope.option.column.filter((item) => {
        if (watchMode) {
          if (item.prop === "scopeName") {
            this.formScope.scopeName = `${this.scopeMenuName} [${name}]`;
          }
          if (item.prop === "resourceCode") {
            this.formScope.resourceCode = this.scopeMenuCode;
          }
          if (item.prop === "scopeColumn") {
            this.formScope.scopeColumn = column;
          }
        }
        this.$refs.crudScope.option.column.filter(item => {
          if (watchMode) {
            if (item.prop === "scopeName") {
              this.formScope.scopeName = `${this.scopeMenuName} [${name}]`;
            }
            if (item.prop === "resourceCode") {
              this.formScope.resourceCode = this.scopeMenuCode;
            }
            if (item.prop === "scopeColumn") {
              this.formScope.scopeColumn = column;
            }
          }
          if (item.prop === "scopeValue") {
            item.display = scopeType === 5;
          }
        });
      },
      // 菜单管理模块
      rowSave(row, done, loading) {
        add(row).then(() => {
        if (item.prop === "scopeValue") {
          item.display = scopeType === 5;
        }
      });
    },
    // 菜单管理模块
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
    },
    searchReset() {
      this.query = {};
      this.parentId = 0;
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.parentId = "";
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.parentId = '';
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenu(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getMenu(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(
        (res) => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
      },
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
        getLazyMenuList(parentId).then(res => {
          resolve(res.data.data);
        });
      },
      // 数据权限模块
      handleDataScope(row) {
        this.drawerVisible = true;
        this.scopeMenuId = row.id;
        this.scopeMenuCode = row.code;
        this.scopeMenuName = row.name;
        this.onLoadScope(this.pageScope)
      },
      handleDrawerClose(hide) {
        hide();
      },
      rowSaveScope(row, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
        addDataScope(row).then(() => {
        }
      );
    },
    treeLoad(tree, treeNode, resolve) {
      const parentId = tree.id;
      getLazyMenuList(parentId).then((res) => {
        resolve(res.data.data);
      });
    },
    // 数据权限模块
    handleDataScope(row) {
      this.drawerVisible = true;
      this.scopeMenuId = row.id;
      this.scopeMenuCode = row.code;
      this.scopeMenuName = row.name;
      this.onLoadScope(this.pageScope);
    },
    handleDrawerClose(hide) {
      hide();
    },
    rowSaveScope(row, done, loading) {
      row = {
        ...row,
        menuId: this.scopeMenuId,
      };
      addDataScope(row).then(
        () => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdateScope(row, index, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
        updateDataScope(row).then(() => {
        }
      );
    },
    rowUpdateScope(row, index, done, loading) {
      row = {
        ...row,
        menuId: this.scopeMenuId,
      };
      updateDataScope(row).then(
        () => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowDelScope(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }
      );
    },
    rowDelScope(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return removeDataScope(row.id);
        })
          .then(() => {
            return removeDataScope(row.id);
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
        .then(() => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      handleDeleteScope() {
        if (this.selectionListScope.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return removeDataScope(this.scopeIds);
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crudScope.toggleSelection();
          });
      },
      beforeOpenScope(done, type) {
        if (["add"].includes(type)) {
          this.watchMode = true;
          this.initScope();
        }
        if (["edit", "view"].includes(type)) {
          this.watchMode = false;
          getMenuDataScope(this.formScope.id).then(res => {
            this.formScope = res.data.data;
          });
        }
        done();
      },
      searchResetScope() {
        this.onLoadScope(this.pageScope);
      },
      searchChangeScope(params, done) {
        this.onLoadScope(this.pageScope, params);
        done();
      },
      selectionChangeScope(list) {
        this.selectionListScope = list;
      },
      currentChangeScope(currentPage) {
        this.pageScope.currentPage = currentPage;
      },
      sizeChangeScope(pageSize) {
        this.pageScope.pageSize = pageSize;
      },
      onLoadScope(page, params = {}) {
        this.scopeLoading = true;
        const values = {
          ...params,
          menuId: this.scopeMenuId,
        }
        getListDataScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
          const data = res.data.data;
          this.pageScope.total = data.total;
          this.dataScope = data.records;
          this.selectionListScope = [];
          this.scopeLoading = false;
        });
      },
    }
  };
    },
    handleDeleteScope() {
      if (this.selectionListScope.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return removeDataScope(this.scopeIds);
        })
        .then(() => {
          this.onLoadScope(this.pageScope);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crudScope.toggleSelection();
        });
    },
    beforeOpenScope(done, type) {
      if (["add"].includes(type)) {
        this.watchMode = true;
        this.initScope();
      }
      if (["edit", "view"].includes(type)) {
        this.watchMode = false;
        getMenuDataScope(this.formScope.id).then((res) => {
          this.formScope = res.data.data;
        });
      }
      done();
    },
    searchResetScope() {
      this.onLoadScope(this.pageScope);
    },
    searchChangeScope(params, done) {
      this.onLoadScope(this.pageScope, params);
      done();
    },
    selectionChangeScope(list) {
      this.selectionListScope = list;
    },
    currentChangeScope(currentPage) {
      this.pageScope.currentPage = currentPage;
    },
    sizeChangeScope(pageSize) {
      this.pageScope.pageSize = pageSize;
    },
    onLoadScope(page, params = {}) {
      this.scopeLoading = true;
      const values = {
        ...params,
        menuId: this.scopeMenuId,
      };
      getListDataScope(
        page.currentPage,
        page.pageSize,
        Object.assign(values, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.pageScope.total = data.total;
        this.dataScope = data.records;
        this.selectionListScope = [];
        this.scopeLoading = false;
      });
    },
  },
};
</script>
src/views/authority/role.vue
@@ -1,380 +1,412 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :permission="permissionList"
               :before-open="beforeOpen"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
  <basic-container class="role">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      ref="crud"
      v-model="form"
      :permission="permissionList"
      :before-open="beforeOpen"
      @row-del="rowDel"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   v-if="permission.role_delete"
                   plain
                   @click="handleDelete">删 除
        <el-button
          type="danger"
          size="small"
          icon="el-icon-delete"
          v-if="permission.role_delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
        <el-button size="small"
                   icon="el-icon-setting"
                   @click="handleRole"
                   v-if="userInfo.role_name.includes('admin')"
                   plain>权限设置
        <el-button
          size="small"
          icon="el-icon-setting"
          @click="handleRole"
          v-if="userInfo.role_name.includes('admin')"
          plain
          >权限设置
        </el-button>
      </template>
    </avue-crud>
    <el-dialog title="角色权限配置"
               append-to-body
               :visible.sync="box"
               width="345px">
    <el-dialog
      title="角色权限配置"
      append-to-body
      :visible.sync="box"
      width="345px"
    >
      <el-tabs type="border-card">
        <el-tab-pane label="菜单权限">
          <el-tree :data="menuGrantList"
                   show-checkbox
                   node-key="id"
                   ref="treeMenu"
                   :default-checked-keys="menuTreeObj"
                   :props="props">
          <el-tree
            :data="menuGrantList"
            show-checkbox
            node-key="id"
            ref="treeMenu"
            :default-checked-keys="menuTreeObj"
            :props="props"
          >
          </el-tree>
        </el-tab-pane>
        <el-tab-pane label="数据权限">
          <el-tree :data="dataScopeGrantList"
                   show-checkbox
                   node-key="id"
                   ref="treeDataScope"
                   :default-checked-keys="dataScopeTreeObj"
                   :props="props">
          <el-tree
            :data="dataScopeGrantList"
            show-checkbox
            node-key="id"
            ref="treeDataScope"
            :default-checked-keys="dataScopeTreeObj"
            :props="props"
          >
          </el-tree>
        </el-tab-pane>
        <el-tab-pane label="接口权限">
          <el-tree :data="apiScopeGrantList"
                   show-checkbox
                   node-key="id"
                   ref="treeApiScope"
                   :default-checked-keys="apiScopeTreeObj"
                   :props="props">
          <el-tree
            :data="apiScopeGrantList"
            show-checkbox
            node-key="id"
            ref="treeApiScope"
            :default-checked-keys="apiScopeTreeObj"
            :props="props"
          >
          </el-tree>
        </el-tab-pane>
      </el-tabs>
      <span slot="footer"
            class="dialog-footer">
      <span slot="footer" class="dialog-footer">
        <el-button @click="box = false">取 消</el-button>
        <el-button type="primary"
                   @click="submit">确 定</el-button>
        <el-button type="primary" @click="submit">确 定</el-button>
      </span>
    </el-dialog>
  </basic-container>
</template>
<script>
  import {add, getList, getRole, getRoleTreeById, grant, grantTree, remove, update} from "@/api/system/role";
  import {mapGetters} from "vuex";
  import website from '@/config/website';
import {
  add,
  getList,
  getRole,
  getRoleTreeById,
  grant,
  grantTree,
  remove,
  update,
} from "@/api/system/role";
import { mapGetters } from "vuex";
import website from "@/config/website";
  export default {
    data() {
      return {
        form: {},
        box: false,
        props: {
          label: "title",
          value: "key"
        },
        menuGrantList: [],
        dataScopeGrantList: [],
        apiScopeGrantList: [],
        apiGrantList: [],
        menuTreeObj: [],
        dataScopeTreeObj: [],
        apiScopeTreeObj: [],
        selectionList: [],
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        option: {
          tip: false,
          simplePage: true,
          searchShow: true,
          searchMenuSpan: 6,
          tree: true,
          border: true,
          index: true,
          selection: true,
          viewBtn: true,
          dialogWidth: 900,
          dialogClickModal: false,
          column: [
            {
              label: "角色名称",
              prop: "roleName",
              search: true,
              span: 24,
              rules: [
                {
                  required: true,
                  message: "请输入角色名称",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "所属租户",
              prop: "tenantId",
              type: "tree",
              dicUrl: "/api/blade-system/tenant/select",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: website.tenantMode,
              span: 24,
              props: {
                label: "tenantName",
                value: "tenantId"
export default {
  data() {
    return {
      form: {},
      box: false,
      props: {
        label: "title",
        value: "key",
      },
      menuGrantList: [],
      dataScopeGrantList: [],
      apiScopeGrantList: [],
      apiGrantList: [],
      menuTreeObj: [],
      dataScopeTreeObj: [],
      apiScopeTreeObj: [],
      selectionList: [],
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      option: {
        tip: false,
        simplePage: true,
        searchShow: true,
        searchMenuSpan: 6,
        tree: true,
        border: true,
        searchShowBtn: false,
        index: true,
        selection: true,
        viewBtn: true,
        dialogWidth: 900,
        dialogClickModal: false,
        column: [
          {
            label: "角色名称",
            prop: "roleName",
            search: true,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入角色名称",
                trigger: "blur",
              },
              hide: !website.tenantMode,
              search: website.tenantMode,
              rules: [{
            ],
          },
          {
            label: "所属租户",
            prop: "tenantId",
            type: "tree",
            dicUrl: "/api/blade-system/tenant/select",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: website.tenantMode,
            span: 24,
            props: {
              label: "tenantName",
              value: "tenantId",
            },
            hide: !website.tenantMode,
            search: website.tenantMode,
            rules: [
              {
                required: true,
                message: "请输入所属租户",
                trigger: "click"
              }]
            },
            {
              label: "角色别名",
              prop: "roleAlias",
              search: true,
              span: 24,
              rules: [
                {
                  required: true,
                  message: "请输入角色别名",
                  trigger: "blur"
                }
              ]
            },
            {
              label: "上级角色",
              prop: "parentId",
              dicData: [],
              type: "tree",
              hide: true,
              span: 24,
              props: {
                label: "title"
                trigger: "click",
              },
              rules: [
                {
                  required: false,
                  message: "请选择上级角色",
                  trigger: "click"
                }
              ]
            ],
          },
          {
            label: "角色别名",
            prop: "roleAlias",
            search: true,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入角色别名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "上级角色",
            prop: "parentId",
            dicData: [],
            type: "tree",
            hide: true,
            span: 24,
            props: {
              label: "title",
            },
            {
              label: "角色排序",
              prop: "sort",
              type: "number",
              span: 24,
              rules: [
                {
                  required: true,
                  message: "请输入角色排序",
                  trigger: "blur"
                }
              ]
            }
          ]
        },
        data: []
            rules: [
              {
                required: false,
                message: "请选择上级角色",
                trigger: "click",
              },
            ],
          },
          {
            label: "角色排序",
            prop: "sort",
            type: "number",
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入角色排序",
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.role_add, false),
        viewBtn: this.vaildData(this.permission.role_view, false),
        delBtn: this.vaildData(this.permission.role_delete, false),
        editBtn: this.vaildData(this.permission.role_edit, false),
      };
    },
    computed: {
      ...mapGetters(["userInfo", "permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.role_add, false),
          viewBtn: this.vaildData(this.permission.role_view, false),
          delBtn: this.vaildData(this.permission.role_delete, false),
          editBtn: this.vaildData(this.permission.role_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
      idsArray() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids;
      }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    methods: {
      initData(roleId){
        getRoleTreeById(roleId).then(res => {
          const column = this.findObject(this.option.column, "parentId");
          column.dicData = res.data.data;
    idsArray() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids;
    },
  },
  methods: {
    initData(roleId) {
      getRoleTreeById(roleId).then((res) => {
        const column = this.findObject(this.option.column, "parentId");
        column.dicData = res.data.data;
      });
    },
    submit() {
      const menuList = this.$refs.treeMenu.getCheckedKeys();
      const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
      const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
      grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => {
        this.box = false;
        this.$message({
          type: "success",
          message: "操作成功!",
        });
      },
      submit() {
        const menuList = this.$refs.treeMenu.getCheckedKeys();
        const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
        const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
        grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => {
          this.box = false;
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.onLoad(this.page);
        });
      },
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          window.console.log(error);
          loading();
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      beforeOpen(done, type) {
        if (["add", "edit"].includes(type)) {
          this.initData(this.form.id);
        }
        done();
      },
      handleRole() {
        if (this.selectionList.length !== 1) {
          this.$message.warning("只能选择一条数据");
          return;
        }
        this.menuTreeObj = [];
        this.dataScopeTreeObj = [];
        this.apiScopeTreeObj = [];
        grantTree()
          .then(res => {
            this.menuGrantList = res.data.data.menu;
            this.dataScopeGrantList = res.data.data.dataScope;
            this.apiScopeGrantList = res.data.data.apiScope;
            getRole(this.ids).then(res => {
              this.menuTreeObj = res.data.data.menu;
              this.dataScopeTreeObj = res.data.data.dataScope;
              this.apiScopeTreeObj = res.data.data.apiScope;
              this.box = true;
            });
      });
    },
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    beforeOpen(done, type) {
      if (["add", "edit"].includes(type)) {
        this.initData(this.form.id);
      }
    }
  };
      done();
    },
    handleRole() {
      if (this.selectionList.length !== 1) {
        this.$message.warning("只能选择一条数据");
        return;
      }
      this.menuTreeObj = [];
      this.dataScopeTreeObj = [];
      this.apiScopeTreeObj = [];
      grantTree().then((res) => {
        this.menuGrantList = res.data.data.menu;
        this.dataScopeGrantList = res.data.data.dataScope;
        this.apiScopeGrantList = res.data.data.apiScope;
        getRole(this.ids).then((res) => {
          this.menuTreeObj = res.data.data.menu;
          this.dataScopeTreeObj = res.data.data.dataScope;
          this.apiScopeTreeObj = res.data.data.apiScope;
          this.box = true;
        });
      });
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        this.data = res.data.data;
        this.loading = false;
        this.selectionClear();
      });
    },
  },
};
</script>
src/views/desk/notice.vue
@@ -1,5 +1,5 @@
<template>
  <basic-container>
  <basic-container class="notice">
    <avue-crud
      :option="option"
      :table-loading="loading"
@@ -81,6 +81,7 @@
        dialogWidth: 950,
        tip: false,
        searchShow: true,
        searchShowBtn: false,
        searchMenuSpan: 6,
        border: false,
        index: true,
@@ -88,7 +89,7 @@
        viewBtn: true,
        selection: true,
        excelBtn: false,
        menuWidth: 320,
        menuWidth: 380,
        dialogClickModal: false,
        column: [
          {
src/views/home/index.vue
@@ -3,7 +3,7 @@
    <div class="head-title">
      <span>智慧保安监管模块</span>
    </div>
    <span class='sub-title' @click.stop="goSystemHome">进入系统</span>
    <span class="sub-title" @click.stop="goSystemHome">进入系统</span>
    <div class="content">
      <div class="left">
        <div class="left1">
@@ -56,40 +56,128 @@
          <div class="rightbottom"></div>
          <el-table :data="tableData" stripe ref="indexTable">
            <template v-if="curTableType === 'car'">
              <el-table-column :key="curTableType"  type="index" label="序号" width="50">
              <el-table-column
                :key="curTableType"
                type="index"
                label="序号"
                width="50"
              >
              </el-table-column>
              <el-table-column :key="curTableType" prop="carNum" label="押运车辆车牌号" width="180">
              <el-table-column
                :key="curTableType"
                prop="carNum"
                label="押运车辆车牌号"
                width="180"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="location" label="实时位置">
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="location"
                label="实时位置"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="company" label="所属公司">
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="company"
                label="所属公司"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="linkman" label="联系人"> </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="tel" label="联系电话"> </el-table-column>
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="linkman"
                label="联系人"
              >
              </el-table-column>
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="tel"
                label="联系电话"
              >
              </el-table-column>
            </template>
            <template v-if="curTableType === 'peo'">
              <el-table-column :key="curTableType" type="index" label="序号" width="50">
              <el-table-column
                :key="curTableType"
                type="index"
                label="序号"
                width="50"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="name" label="押运人员名称" width="180">
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="name"
                label="押运人员名称"
                width="180"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="location" label="实时位置">
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="location"
                label="实时位置"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="company" label="所属公司">
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="company"
                label="所属公司"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="tel" label="联系电话"> </el-table-column>
              <el-table-column :key="curTableType" prop="bz" label="备注"> </el-table-column>
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="tel"
                label="联系电话"
              >
              </el-table-column>
              <el-table-column :key="curTableType" prop="bz" label="备注">
              </el-table-column>
            </template>
            <template v-if="curTableType === 'gun'">
              <el-table-column :key="curTableType" type="index" label="序号" width="50">
              <el-table-column
                :key="curTableType"
                type="index"
                label="序号"
                width="50"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="number" label="枪支编号" width="180">
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="number"
                label="枪支编号"
                width="180"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="location" label="实时位置">
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="location"
                label="实时位置"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="company" label="所属公司">
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="company"
                label="所属公司"
              >
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="linkman" label="负责人"> </el-table-column>
              <el-table-column :key="curTableType" prop="tel" label="联系电话"> </el-table-column>
              <el-table-column
                :key="curTableType"
                show-overflow-tooltip
                prop="linkman"
                label="负责人"
              >
              </el-table-column>
              <el-table-column :key="curTableType" prop="tel" label="联系电话">
              </el-table-column>
            </template>
          </el-table>
        </div>
@@ -216,53 +304,53 @@
      options1: [
        {
          value: "1",
          label: "南昌市公安局"
          label: "南昌市公安局",
        },
        {
          value: "2",
          label: "东湖分局"
          label: "东湖分局",
        },
        {
          value: "3",
          label: "西湖分局"
          label: "西湖分局",
        },
        {
          value: "4",
          label: "青云谱分局"
          label: "青云谱分局",
        },
        {
          value: "5",
          label: "青山湖分局"
        }
          label: "青山湖分局",
        },
      ],
      value2: "1",
      options2: [
        {
          value: "1",
          label: "南昌市公安局"
          label: "南昌市公安局",
        },
        {
          value: "2",
          label: "东湖分局"
          label: "东湖分局",
        },
        {
          value: "3",
          label: "西湖分局"
          label: "西湖分局",
        },
        {
          value: "4",
          label: "青云谱分局"
          label: "青云谱分局",
        },
        {
          value: "5",
          label: "青山湖分局"
        }
      ]
          label: "青山湖分局",
        },
      ],
    };
  },
  methods: {
    initEchart() {
      securityTotal().then(res => {
      securityTotal().then((res) => {
        if (res.data.code == 200) {
          let securityData = res.data.data;
          let left1Echart = echarts.init(
@@ -274,7 +362,7 @@
        }
      });
      holderNum().then(res => {
      holderNum().then((res) => {
        if (res.data.code === 200) {
          let data = res.data.data;
          let left2Echart = echarts.init(
@@ -312,16 +400,16 @@
        curLayer = this.carVectorLayer;
        imgUrl = car;
        geoData = [
          [115.838082,28.716823],
          [115.91627,28.794341],
          [115.821984,28.658519],
          [115.870277,28.633159],
          [115.960539,28.678295],
          [115.981811,28.611852],
          [115.924894,28.738615],
          [115.876745,28.656364],
          [115.845412,28.652814],
          [115.940992,28.660548]
          [115.838082, 28.716823],
          [115.91627, 28.794341],
          [115.821984, 28.658519],
          [115.870277, 28.633159],
          [115.960539, 28.678295],
          [115.981811, 28.611852],
          [115.924894, 28.738615],
          [115.876745, 28.656364],
          [115.845412, 28.652814],
          [115.940992, 28.660548],
        ];
        this.tableData = [
          {
@@ -329,51 +417,51 @@
            location: "南昌市红谷滩区清远路与瑞金路交叉路口往北约90米",
            company: "江西省卫民保安服务有限公司",
            linkman: "李琳",
            tel: "18928374611"
            tel: "18928374611",
          },
          {
            carNum: "赣BA6232",
            location: "顺外路1007",
            company: "南昌市公安局保安护卫公司",
            linkman: "王琦",
            tel: "13932743923"
            tel: "13932743923",
          },
          {
            carNum: "赣A2B297",
            location: "南昌市高新区绿地玫瑰城南昌高新区101智慧大厦二楼",
            company: "江西高创保安服务技术有限公司",
            linkman: "李梦",
            tel: "13214561324"
            tel: "13214561324",
          },
          {
            carNum: "赣B2E775",
            location: "江西省南昌市红谷滩区会展路莱蒙都会写字楼5A栋1110室",
            company: "江西海豹保安服务有限公司南昌分公司",
            linkman: "张强",
            tel: "13372889288"
            tel: "13372889288",
          },
          {
            carNum: "赣BF9252",
            location: "南昌市西湖区广场南路恒茂国际华城西南侧约90米",
            company: "南昌县神州保安分公司长运中队",
            linkman: "赵青",
            tel: "18937281746"
          }
            tel: "18937281746",
          },
        ];
      } else if (type === "peo") {
        curLayer = this.peoVectorLayer;
        imgUrl = peo;
        geoData = [
          [115.8835,28.622126],
          [115.861222,28.61477],
          [115.861653,28.640514],
          [115.917133,28.611852],
          [115.923888,28.602593],
          [115.89658,28.59828],
          [115.863091,28.597645],
          [115.979224,28.666379],
          [115.958239,28.610584],
          [115.867115,28.631638]
          [115.8835, 28.622126],
          [115.861222, 28.61477],
          [115.861653, 28.640514],
          [115.917133, 28.611852],
          [115.923888, 28.602593],
          [115.89658, 28.59828],
          [115.863091, 28.597645],
          [115.979224, 28.666379],
          [115.958239, 28.610584],
          [115.867115, 28.631638],
        ];
        this.tableData = [
          {
@@ -381,59 +469,59 @@
            location: "江西省南昌市南昌县向阳路807号",
            company: "南昌市赣洪保安服务有限公司",
            tel: "19876223615",
            bz: ""
            bz: "",
          },
          {
            name: "王桂林",
            location: "南昌市南昌县斗南路莲塘四小西南侧约150米",
            company: "江西天网保安公司",
            tel: "18723982376",
            bz: ""
            bz: "",
          },
          {
            name: "王蒙",
            location: "丰和南大道2111号世茂新城A-12地块商业4-8号商业楼401室",
            company: "南昌赛夫保安服务有限公司",
            tel: "18909872345",
            bz: ""
            bz: "",
          },
          {
            name: "李嘉",
            location: "新建大道463",
            company: "新建区公安局保安服务公司",
            tel: "13315276390",
            bz: ""
            bz: "",
          },
          {
            name: "李林",
            location: "江西省南昌市青云谱区洪都南大道东50米凯旋国际大厦",
            company: "江西蓝盾保安服务有限公司",
            tel: "19108372654",
            bz: ""
            bz: "",
          },
          {
            name: "张国庆",
            location: "江西省南昌市红谷滩区金融大街君成商厦1单元三楼",
            company: "华远卫士保安公司",
            tel: "13187234523",
            bz: ""
          }
            bz: "",
          },
        ];
      } else if (type === "gun") {
        curLayer = this.gunVectorLayer;
        imgUrl = gun;
        geoData = [
          [115.867115,28.631638],
          [115.867115,28.631638],
          [115.879548,28.713338],
          [115.904844,28.700032],
          [115.845628,28.679373],
          [115.831973,28.690654],
          [115.814726,28.660611],
          [115.868912,28.638168],
          [115.762121,28.632589],
          [115.78483,28.58794],
          [115.812139,28.655159]
          [115.867115, 28.631638],
          [115.867115, 28.631638],
          [115.879548, 28.713338],
          [115.904844, 28.700032],
          [115.845628, 28.679373],
          [115.831973, 28.690654],
          [115.814726, 28.660611],
          [115.868912, 28.638168],
          [115.762121, 28.632589],
          [115.78483, 28.58794],
          [115.812139, 28.655159],
        ];
        this.tableData = [
          {
@@ -441,43 +529,43 @@
            location: "红谷滩新区唐宁街b座",
            company: "鹏盛保安服务有限公司",
            linkman: "张强",
            tel: "13782143412"
            tel: "13782143412",
          },
          {
            number: "Q2111",
            location: "子安路89号银田大厦",
            company: "江西安泰保安服务有限公司",
            linkman: "张强",
            tel: "13999999999"
            tel: "13999999999",
          },
          {
            number: "Q2141",
            location: "南昌市进贤县人民大道(豪景壹品)",
            company: "江西省天网保安服务有限公司进贤分公司",
            linkman: "张强",
            tel: "13999999999"
            tel: "13999999999",
          },
          {
            number: "Q1321",
            location: "站前西路176号公交公司",
            company: "顺安保安服务有限公司",
            linkman: "张强",
            tel: "13999999999"
            tel: "13999999999",
          },
          {
            number: "Q1111",
            location: "南昌市西湖区八一大道长运大厦东侧约60米",
            company: "江西长运股份有限公司保安大队",
            linkman: "张强",
            tel: "13999999999"
            tel: "13999999999",
          },
          {
            number: "Q1331",
            location: "南昌市西湖区三眼井街南昌市第十八中学北侧约150米",
            company: "杭州振杰保安服务(江西分公司)",
            linkman: "张强",
            tel: "13789233124"
          }
            tel: "13789233124",
          },
        ];
      }
@@ -486,12 +574,12 @@
        image: new Icon({
          src: imgUrl,
          opacity: 1,
          scale: 0.5
        })
          scale: 0.5,
        }),
      });
      geoData.forEach(item => {
      geoData.forEach((item) => {
        let carFeature = new Feature({
          geometry: new Point(item)
          geometry: new Point(item),
        });
        carFeature.setStyle(style);
        features.push(carFeature);
@@ -515,38 +603,36 @@
            zIndex: 4,
            title: "影像",
            source: new XYZ({
              url:
                "http://t3.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0" // 行政区划
            })
              url: "http://t3.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0", // 行政区划
            }),
          }),
          new Tile({
            zIndex: 5,
            title: "道路+中文注记",
            source: new XYZ({
              url:
                "http://t3.tianditu.com/DataServer?T=cta_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0" // 注记
            })
          })
              url: "http://t3.tianditu.com/DataServer?T=cta_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0", // 注记
            }),
          }),
        ],
        view: new View({
          projection: "EPSG:4326",
          center: [115.892151, 28.676493],
          zoom: 11
        })
          zoom: 11,
        }),
      });
      this.carVectorLayer = new VectorLayer({
        zIndex: 99,
        source: new VectorSource()
        source: new VectorSource(),
      });
      this.peoVectorLayer = new VectorLayer({
        zIndex: 99,
        source: new VectorSource()
        source: new VectorSource(),
      });
      this.gunVectorLayer = new VectorLayer({
        zIndex: 99,
        source: new VectorSource()
        source: new VectorSource(),
      });
      this.map.addLayer(this.carVectorLayer);
      this.map.addLayer(this.peoVectorLayer);
@@ -556,14 +642,15 @@
    },
    goSystemHome() {
      this.$router.push({ path: "/register/index" });
    }
      // this.$router.push({ path: "/register/index" });
      this.$router.push({ path: "/securityGuardManagement/register" });
    },
  },
  mounted() {
    this.initEchart();
    // this.getTableData("car");
    this.initMap();
  }
  },
};
</script>
src/views/management/computents/achievement.vue
New file
@@ -0,0 +1,178 @@
<template>
  <avue-crud
    class="company-box"
    :option="equipmentOption"
    :search.sync="equipmentSearch"
    :table-loading="equipmentLoading"
    :data="equipmentData"
    ref="equipmentCrud"
    :page.sync="equipmentPage"
    @on-load="equipmentOnLoad"
    @selection-change="equipmentSelectionChange"
    @search-change="equipmentSearchChange"
    @search-reset="equipmentSearchReset"
    @current-change="equipmentCurrentChange"
    @size-change="equipmentSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      equipmentOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "姓名",
            prop: "rname",
            // slot: true,
            // display: false,
          },
          {
            label: "考试开始时间",
            prop: "examinationbegintime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            labelWidth: 120,
            searchSpan: 4,
            search: true,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "click",
              },
            ],
            // slot: true,
            // display: false,
            // formatter: function (row, value) {
            //   return (value = value + "%");
            // },
          },
          {
            label: "开始结束时间",
            prop: "examinationendtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            labelWidth: 120,
            searchSpan: 4,
            search: true,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "click",
              },
            ],
            // slot: true,
            // display: false,
            // formatter: function (row, value) {
            //   return (value = value + "万元");
            // },
          },
          {
            label: "考试类别",
            prop: "examinationtype",
            // slot: true,
            // display: false,
          },
          {
            label: "考试成绩",
            prop: "examinationc",
            // slot: true,
            // display: false,
          },
          {
            label: "考试地点",
            prop: "examinationaddress",
            // slot: true,
            // display: false,
          },
        ],
      },
      equipmentSearch: {},
      equipmentLoading: true,
      equipmentData: [],
      equipmentPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      equipmentQuery: {},
      equipmentSelectionList: [],
    };
  },
  methods: {
    equipmentOnLoad(page, params = {}) {
      this.equipmentLoading = true;
      console.log("success");
      //   getequipmentList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.equipmentQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.equipmentPage.total = data.total;
      //     this.equipmentData = data.records;
      this.equipmentLoading = false;
      //     this.$refs.equipmentCrud.refreshTable();
      //     this.$refs.equipmentCrud.doLayout();
      //     this.equipmentSelectionClear();
      //   });
    },
    equipmentSelectionClear() {
      this.equipmentSelectionList = [];
      this.$refs.equipmentCrud.toggleSelection();
    },
    equipmentSelectionChange(list) {
      this.equipmentSelectionList = list;
    },
    equipmentSearchChange(params, done) {
      this.equipmentQuery = params;
      this.equipmentPage.currentPage = 1;
      this.equipmentOnLoad(this.equipmentPage, params);
      done();
    },
    equipmentSearchReset() {
      this.equipmentQuery = {};
      this.equipmentOnLoad(this.equipmentPage);
    },
    equipmentCurrentChange(currentPage) {
      this.equipmentPage.currentPage = currentPage;
    },
    equipmentSizeChange(pageSize) {
      this.equipmentPage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/management/computents/dispatch.vue
New file
@@ -0,0 +1,259 @@
<template>
  <avue-crud
    class="company-box"
    :option="equipmentOption"
    :search.sync="equipmentSearch"
    :table-loading="equipmentLoading"
    :data="equipmentData"
    ref="equipmentCrud"
    :page.sync="equipmentPage"
    @on-load="equipmentOnLoad"
    @selection-change="equipmentSelectionChange"
    @search-change="equipmentSearchChange"
    @search-reset="equipmentSearchReset"
    @current-change="equipmentCurrentChange"
    @size-change="equipmentSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      equipmentOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 3,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          // {
          //   label: "id",
          //   prop: "id",
          //   hide: true,
          //   editDisplay: false,
          //   addDisplay: false,
          // },
          {
            label: "姓名",
            prop: "name",
            search: true,
            searchSpan: 3,
            rules: [
              {
                required: true,
                message: "请输入姓名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "身份证号",
            prop: "cardid",
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入编号",
            //     trigger: "blur",
            //   },
            // ],
            // search: true,
          }, //上面不显示
          {
            label: "派遣单位",
            prop: "dispatcher",
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入规格",
            //     trigger: "blur",
            //   },
            // ],
            // search: true,
          },
          {
            label: "保安公司",
            prop: "deptName",
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入规格",
            //     trigger: "blur",
            //   },
            // ],
            // search: true,
          },
          // {
          //   label: "派遣人",
          //   prop: "dispatcher",
          //   // rules: [
          //   //   {
          //   //     required: true,
          //   //     message: "请输入规格",
          //   //     trigger: "blur",
          //   //   },
          //   // ],
          //   // search: true,
          // },
          {
            label: "派遣时间",
            prop: "dispatchertime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            labelWidth: 120,
            searchSpan: 4,
            search: true,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "click",
              },
            ],
            // width: 70,
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入型号",
            //     trigger: "blur",
            //   },
            // ],
            // search: true,
          },
          {
            label: "结束时间",
            prop: "enddispatchertime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            labelWidth: 120,
            searchSpan: 4,
            search: true,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "click",
              },
            ],
            // width: 70,
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入型号",
            //     trigger: "blur",
            //   },
            // ],
            // search: true,
          },
          {
            label: "派遣地址",
            prop: "tenantName",
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入组织机构",
            //     trigger: "blur",
            //   },
            // ],
            // overHidden: true,
            // // addDisplay: true,
            // // editDisplay: true,
            // // viewDisplay: true,
            // // searchSpan: 5,
            // dicUrl:
            //   "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
            // props: {
            //   label: "title",
            //   value: "id",
            // },
            // // search: true,
            // type: "select",
            // // rules: [{
            // //     required: true,
            // //     message: "请选择学历",
            // //     trigger: "blur"
            // // }],
          },
        ],
      },
      equipmentSearch: {},
      equipmentLoading: true,
      equipmentData: [],
      equipmentPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      equipmentQuery: {},
      equipmentSelectionList: [],
    };
  },
  methods: {
    equipmentOnLoad(page, params = {}) {
      this.equipmentLoading = true;
      console.log("success");
      //   getequipmentList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.equipmentQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.equipmentPage.total = data.total;
      //     this.equipmentData = data.records;
      this.equipmentLoading = false;
      //     this.$refs.equipmentCrud.refreshTable();
      //     this.$refs.equipmentCrud.doLayout();
      //     this.equipmentSelectionClear();
      //   });
    },
    equipmentSelectionClear() {
      this.equipmentSelectionList = [];
      this.$refs.equipmentCrud.toggleSelection();
    },
    equipmentSelectionChange(list) {
      this.equipmentSelectionList = list;
    },
    equipmentSearchChange(params, done) {
      this.equipmentQuery = params;
      this.equipmentPage.currentPage = 1;
      this.equipmentOnLoad(this.equipmentPage, params);
      done();
    },
    equipmentSearchReset() {
      this.equipmentQuery = {};
      this.equipmentOnLoad(this.equipmentPage);
    },
    equipmentCurrentChange(currentPage) {
      this.equipmentPage.currentPage = currentPage;
    },
    equipmentSizeChange(pageSize) {
      this.equipmentPage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/management/computents/honor.vue
New file
@@ -0,0 +1,164 @@
<template>
  <avue-crud
    class="company-box"
    :option="punishOption"
    :search.sync="punishSearch"
    :table-loading="punishLoading"
    :data="punishData"
    ref="punishCrud"
    :page.sync="punishPage"
    @on-load="punishOnLoad"
    @selection-change="punishSelectionChange"
    @search-change="punishSearchChange"
    @search-reset="punishSearchReset"
    @current-change="punishCurrentChange"
    @size-change="punishSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      punishOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "姓名",
            prop: "name",
            // slot: true,
            // display: false,
          },
          {
            label: "身份证号",
            prop: "cardid",
            // slot: true,
            // display: false,
            // formatter: function (row, value) {
            //   return (value = value + "%");
            // },
          },
          {
            label: "荣誉",
            prop: "honor",
            // slot: true,
            // display: false,
            // formatter: function (row, value) {
            //   return (value = value + "万元");
            // },
          },
          {
            label: "获取时间",
            prop: "capitaltime",
            // slot: true,
            // display: false,
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            labelWidth: 120,
            searchSpan: 4,
            search: true,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "click",
              },
            ],
          },
          // {
          //   label: "身份证号",
          //   prop: "cardid",
          //   slot: true,
          //   display: false,
          // },
          // {
          //   label: "联系电话",
          //   prop: "cell",
          //   slot: true,
          //   display: false,
          // },
        ],
      },
      punishSearch: {},
      punishLoading: true,
      punishData: [],
      punishPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      punishQuery: {},
      punishSelectionList: [],
    };
  },
  methods: {
    punishOnLoad(page, params = {}) {
      this.punishLoading = true;
      console.log("success");
      //   getpunishList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.punishQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.punishPage.total = data.total;
      //     this.punishData = data.records;
      this.punishLoading = false;
      //     this.$refs.punishCrud.refreshTable();
      //     this.$refs.punishCrud.doLayout();
      //     this.punishSelectionClear();
      //   });
    },
    punishSelectionClear() {
      this.punishSelectionList = [];
      this.$refs.punishCrud.toggleSelection();
    },
    punishSelectionChange(list) {
      this.punishSelectionList = list;
    },
    punishSearchChange(params, done) {
      this.punishQuery = params;
      this.punishPage.currentPage = 1;
      this.punishOnLoad(this.punishPage, params);
      done();
    },
    punishSearchReset() {
      this.punishQuery = {};
      this.punishOnLoad(this.punishPage);
    },
    punishCurrentChange(currentPage) {
      this.punishPage.currentPage = currentPage;
    },
    punishSizeChange(pageSize) {
      this.punishPage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/management/computents/performance.vue
New file
@@ -0,0 +1,323 @@
<template>
  <avue-crud
    class="company-box"
    :option="staffOption"
    :search.sync="staffSearch"
    :table-loading="staffLoading"
    :data="staffData"
    ref="staffCrud"
    :page.sync="staffPage"
    @on-load="staffOnLoad"
    @selection-change="staffSelectionChange"
    @search-change="staffSearchChange"
    @search-reset="staffSearchReset"
    @current-change="staffCurrentChange"
    @size-change="staffSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      staffOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "姓名",
            prop: "name",
            // search: true,
            // searchSpan: 4,
            // display: false,
            // width: 78,
            searchSpan: 3,
            search: true,
          },
          {
            label: "身份证号",
            prop: "securityid",
            // search: true,
            // searchSpan: 4,
            // display: false,
            // width: 78,
          },
          {
            label: "工作态度",
            prop: "workingattitude",
            searchSpan: 3,
            search: true,
            // type: "select",
            // search: true,
            // searchSpan: 4,
            // searchLabelWidth: 50,
            // dicData: [
            //   {
            //     label: "女",
            //     value: 2,
            //   },
            //   {
            //     label: "男",
            //     value: 1,
            //   },
            // ],
            // slot: true,
            // display: false,
            // width: 48,
          },
          // {
          //   label: "保安公司",
          //   prop: "deptName",
          //   // width: 120,
          //   search: true,
          //   searchSpan: 4,
          //   overHidden: true,
          //   slot: true,
          //   display: false,
          // },
          {
            label: "工作能力",
            prop: "workingability",
            // display: false,
            // searchSpan: 4,
            // searchLabelWidth: 110,
            searchSpan: 3,
            search: true,
          },
          {
            label: "工作成效",
            prop: "achievements",
            // slot: true,
            // display: false,
            // width: 138,
          },
          {
            label: "评分",
            prop: "score",
            searchSpan: 3,
            search: true,
            // slot: true,
            // display: false,
            // width: 92,
          },
          {
            label: "时间",
            prop: "time",
            // slot: true,
            // display: false,
            // width: 82,
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            labelWidth: 120,
            searchSpan: 4,
            search: true,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "click",
              },
            ],
          },
          // {
          //   label: "所属角色",
          //   prop: "roleName",
          //   slot: true,
          //   display: false,
          //   width: 78,
          //   hide: true,
          // },
          // {
          //   label: "所属辖区",
          //   prop: "jurisdiction",
          //   // multiple: true,
          //   minWidth: 60,
          //   type: "tree",
          //   dicUrl: "/api/jurisdiction/lazy-tree?parentId=0",
          //   props: {
          //     label: "title",
          //     value: "id",
          //   },
          //   checkStrictly: true,
          //   slot: true,
          //   rules: [
          //     {
          //       required: true,
          //       message: "请选择所属辖区",
          //       trigger: "click",
          //     },
          //   ],
          // },
          // {
          //   label: "是否在职",
          //   prop: "status",
          //   type: "select",
          //   search: true,
          //   searchSpan: 3,
          //   dicData: [
          //     {
          //       label: "否",
          //       value: 0,
          //     },
          //     {
          //       label: "是",
          //       value: 1,
          //     },
          //   ],
          //   slot: true,
          //   display: false,
          //   width: 70,
          // },
          // {
          //   label: "是否持证",
          //   prop: "hold",
          //   type: "select",
          //   search: true,
          //   searchSpan: 3,
          //   dicData: [
          //     {
          //       label: "是",
          //       value: "0",
          //     },
          //     {
          //       label: "否",
          //       value: "1",
          //     },
          //     {
          //       label: "已吊销",
          //       value: "2",
          //     },
          //   ],
          //   slot: true,
          //   display: false,
          //   width: 70,
          // },
        ],
        // [
        //   {
        //     label: "投资人姓名",
        //     prop: "shareholder",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "投资比例",
        //     prop: "shareholdingratio",
        //     slot: true,
        //     display: false,
        //     formatter: function (row, value) {
        //       return (value = value + "%");
        //     },
        //   },
        //   {
        //     label: "出资金额",
        //     prop: "capital",
        //     slot: true,
        //     display: false,
        //     formatter: function (row, value) {
        //       return (value = value + "万元");
        //     },
        //   },
        //   {
        //     label: "投资时间",
        //     prop: "capitaltime",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "身份证号",
        //     prop: "cardid",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "联系电话",
        //     prop: "cell",
        //     slot: true,
        //     display: false,
        //   },
        // ],
      },
      staffSearch: {},
      staffLoading: true,
      staffData: [],
      staffPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      staffQuery: {},
      staffSelectionList: [],
    };
  },
  methods: {
    staffOnLoad(page, params = {}) {
      this.staffLoading = true;
      console.log("success");
      //   getstaffList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.staffQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.staffPage.total = data.total;
      //     this.staffData = data.records;
      this.staffLoading = false;
      //     this.$refs.staffCrud.refreshTable();
      //     this.$refs.staffCrud.doLayout();
      //     this.staffSelectionClear();
      //   });
    },
    staffSelectionClear() {
      this.staffSelectionList = [];
      this.$refs.staffCrud.toggleSelection();
    },
    staffSelectionChange(list) {
      this.staffSelectionList = list;
    },
    staffSearchChange(params, done) {
      this.staffQuery = params;
      this.staffPage.currentPage = 1;
      this.staffOnLoad(this.staffPage, params);
      done();
    },
    staffSearchReset() {
      this.staffQuery = {};
      this.staffOnLoad(this.staffPage);
    },
    staffCurrentChange(currentPage) {
      this.staffPage.currentPage = currentPage;
    },
    staffSizeChange(pageSize) {
      this.staffPage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/management/computents/train.vue
New file
@@ -0,0 +1,168 @@
<template>
  <avue-crud
    class="company-box"
    :option="serviceOption"
    :search.sync="serviceSearch"
    :table-loading="serviceLoading"
    :data="serviceData"
    ref="serviceCrud"
    :page.sync="servicePage"
    @on-load="serviceOnLoad"
    @selection-change="serviceSelectionChange"
    @search-change="serviceSearchChange"
    @search-reset="serviceSearchReset"
    @current-change="serviceCurrentChange"
    @size-change="serviceSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      serviceOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "姓名",
            prop: "rname",
            // slot: true,
            // display: false,
          },
          {
            label: "性别",
            prop: "sex",
            // slot: true,
            // display: false,
            // formatter: function (row, value) {
            //   return (value = value + "%");
            // },
          },
          {
            label: "身份证号",
            prop: "cardid",
            // slot: true,
            // display: false,
            // formatter: function (row, value) {
            //   return (value = value + "万元");
            // },
          },
          {
            label: "培训单位",
            prop: "train",
            // slot: true,
            // display: false,
          },
          {
            label: "培训内容",
            prop: "traincontent",
            // slot: true,
            // display: false,
          },
          {
            label: "培训时间",
            prop: "traintime",
            // slot: true,
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            labelWidth: 120,
            searchSpan: 4,
            search: true,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "click",
              },
            ],
          },
          {
            label: "培训地址",
            prop: "trainaddrss",
            // slot: true,
          },
        ],
      },
      serviceSearch: {},
      serviceLoading: true,
      serviceData: [],
      servicePage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      serviceQuery: {},
      serviceSelectionList: [],
    };
  },
  methods: {
    serviceOnLoad(page, params = {}) {
      this.serviceLoading = true;
      console.log("success");
      //   getserviceList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.serviceQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.servicePage.total = data.total;
      //     this.serviceData = data.records;
      this.serviceLoading = false;
      //     this.$refs.serviceCrud.refreshTable();
      //     this.$refs.serviceCrud.doLayout();
      //     this.serviceSelectionClear();
      //   });
    },
    serviceSelectionClear() {
      this.serviceSelectionList = [];
      this.$refs.serviceCrud.toggleSelection();
    },
    serviceSelectionChange(list) {
      this.serviceSelectionList = list;
    },
    serviceSearchChange(params, done) {
      this.serviceQuery = params;
      this.servicePage.currentPage = 1;
      this.serviceOnLoad(this.servicePage, params);
      done();
    },
    serviceSearchReset() {
      this.serviceQuery = {};
      this.serviceOnLoad(this.servicePage);
    },
    serviceCurrentChange(currentPage) {
      this.servicePage.currentPage = currentPage;
    },
    serviceSizeChange(pageSize) {
      this.servicePage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/management/peopleDetails.vue
@@ -6,454 +6,461 @@
 * menu-name 保安详细资料
 */
<template>
    <el-row class="morpheus-box">
        <el-col :span="24">
            <el-card>
                <div class="card-body">
                    <el-tabs v-model="activeName"
                             @tab-click="handleClick">
                        <el-tab-pane label="详细信息"
                                     name="first">
  <el-row class="morpheus-box">
    <el-col :span="24">
      <el-card>
        <div class="card-body">
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="基本信息" name="first">
              <el-form
                :model="form"
                label-position="right"
                size="mini"
                label-width="100px"
              >
                <el-row>
                  <el-col span="12">
                    <el-form-item label="姓名">
                      <el-input
                        disabled="true"
                        v-model="form.realName"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="性别">
                      <el-input
                        disabled="true"
                        :value="form.sex == 1 ? '男' : '女'"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col span="12">
                    <el-col span="12">
                      <el-form-item label="电子邮箱">
                        <el-input
                          disabled="true"
                          v-model="form.emails"
                          autocomplete="off"
                        ></el-input>
                      </el-form-item>
                    </el-col>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="联系方式">
                      <el-input
                        disabled="true"
                        v-model="form.phone"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                            <el-form :model="form"
                                     label-position="right"
                                     size="mini"
                                     label-width="100px">
                <el-row>
                  <el-col span="12">
                    <el-form-item label="身高">
                      <el-input
                        disabled="true"
                        v-model="form.height"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="联系地址">
                      <el-input
                        disabled="true"
                        v-model="form.address"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col span="12">
                    <el-form-item label="籍贯">
                      <el-input
                        disabled="true"
                        v-model="form.nativePlace"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="户口所在地">
                      <el-input
                        disabled="true"
                        v-model="form.registered"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="姓名">
                                            <el-input disabled="true"
                                                      v-model="form.realName"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="性别">
                                            <el-input disabled="true"
                                                      :value="form.sex == 1 ? '男' : '女'"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-col span="12">
                                            <el-form-item label="电子邮箱">
                                                <el-input disabled="true"
                                                          v-model="form.emails"
                                                          autocomplete="off"></el-input>
                                            </el-form-item>
                                        </el-col>
                <el-row>
                  <el-col span="12">
                    <el-form-item label="政治面貌">
                      <el-input
                        disabled="true"
                        v-model="form.politicaloutlook"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="身份证号">
                      <el-input
                        disabled="true"
                        v-model="form.cardid"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="联系方式">
                                            <el-input disabled="true"
                                                      v-model="form.phone"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                <el-row>
                  <el-col span="12">
                    <el-form-item label="所属角色">
                      <el-input
                        disabled="true"
                        v-model="form.roleName"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="所属公司">
                      <el-input
                        disabled="true"
                        v-model="form.deptName"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="身高">
                                            <el-input disabled="true"
                                                      v-model="form.height"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="联系地址">
                                            <el-input disabled="true"
                                                      v-model="form.address"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                <el-row>
                  <el-col span="12">
                    <el-form-item label="入职时间">
                      <el-input
                        disabled="true"
                        v-model="form.rtime"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="是否在职">
                      <el-input
                        disabled="true"
                        :value="form.sex == 1 ? '是' : '否'"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </el-tab-pane>
            <el-tab-pane label="现实表现" name="second">
              <performance></performance>
              <!-- <el-table :data="manifestationData" style="width: 100%">
                <el-table-column prop="name" label="姓名" align="center">
                </el-table-column>
                                    <el-col span="12">
                                        <el-form-item label="籍贯">
                                            <el-input disabled="true"
                                                      v-model="form.nativePlace"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="户口所在地">
                                            <el-input disabled="true"
                                                      v-model="form.registered"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                <el-table-column
                  prop="securityid"
                  label="身份证号"
                  align="center"
                >
                </el-table-column>
                                </el-row>
                <el-table-column
                  prop="workingattitude"
                  align="center"
                  label="工作态度"
                >
                </el-table-column>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="政治面貌">
                                            <el-input disabled="true"
                                                      v-model="form.politicaloutlook"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                <el-table-column
                  prop="workingability"
                  align="center"
                  label="工作能力"
                >
                </el-table-column>
                                        <el-form-item label="身份证号">
                                            <el-input disabled="true"
                                                      v-model="form.cardid"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                <el-table-column
                  prop="achievements"
                  align="center"
                  label="工作成效"
                >
                </el-table-column>
                                </el-row>
                <el-table-column prop="score" align="center" label="评分">
                </el-table-column>
                                <el-row>
                                    <el-col span="12">
                <el-table-column prop="time" align="center" label="时间">
                </el-table-column>
              </el-table> -->
            </el-tab-pane>
            <el-tab-pane label="派遣记录" name="third">
              <dispatch></dispatch>
              <!-- <el-table :data="dispatchData" style="width: 100%">
                <el-table-column prop="name" label="姓名" align="center">
                </el-table-column>
                                        <el-form-item label="所属角色">
                                            <el-input disabled="true"
                                                      v-model="form.roleName"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="所属公司">
                                            <el-input disabled="true"
                                                      v-model="form.deptName"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                <el-table-column prop="cardid" label="身份证号" align="center">
                </el-table-column>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="入职时间">
                                            <el-input disabled="true"
                                                      v-model="form.rtime"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="是否在职">
                                            <el-input disabled="true"
                                                      :value="form.sex == 1 ? '是' : '否'"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                <el-table-column
                  prop="dispatcher"
                  align="center"
                  label="派遣人"
                >
                </el-table-column>
                            </el-form>
                <el-table-column
                  prop="dispatchertime"
                  align="center"
                  label="派遣时间"
                >
                </el-table-column>
                        </el-tab-pane>
                        <el-tab-pane label="现实表现"
                                     name="second">
                            <el-table :data="manifestationData"
                                      style="width: 100%">
                <el-table-column
                  prop="dispatcheraddress"
                  align="center"
                  label="派遣地址"
                >
                </el-table-column>
              </el-table> -->
            </el-tab-pane>
            <el-tab-pane label="获取荣誉" name="fourth">
              <honor></honor>
              <!-- <el-table :data="honorchData" style="width: 100%">
                <el-table-column prop="name" label="姓名" align="center">
                </el-table-column>
                                <el-table-column prop="name"
                                                 label="姓名"
                                                 align="center">
                                </el-table-column>
                <el-table-column prop="cardid" label="身份证号" align="center">
                </el-table-column>
                                <el-table-column prop="securityid"
                                                 label="身份证号"
                                                 align="center">
                                </el-table-column>
                <el-table-column prop="honor" align="center" label="荣誉">
                </el-table-column>
                                <el-table-column prop="workingattitude"
                                                 align="center"
                                                 label="工作态度">
                                </el-table-column>
                <el-table-column
                  prop="honortime"
                  align="center"
                  label="获取时间"
                >
                </el-table-column>
              </el-table> -->
            </el-tab-pane>
            <el-tab-pane label="培训相关" name="fifth">
              <train></train>
              <!-- <el-table :data="trainData" style="width: 100%">
                <el-table-column prop="rname" label="姓名" align="center">
                </el-table-column>
                                <el-table-column prop="workingability"
                                                 align="center"
                                                 label="工作能力">
                                </el-table-column>
                <el-table-column prop="sex" label="性别" align="center">
                </el-table-column>
                                <el-table-column prop="achievements"
                                                 align="center"
                                                 label="工作成效">
                                </el-table-column>
                <el-table-column prop="cardid" label="身份证号" align="center">
                </el-table-column>
                                <el-table-column prop="score"
                                                 align="center"
                                                 label="评分">
                                </el-table-column>
                <el-table-column prop="train" align="center" label="培训单位">
                </el-table-column>
                                <el-table-column prop="time"
                                                 align="center"
                                                 label="时间">
                                </el-table-column>
                <el-table-column
                  prop="traincontent"
                  align="center"
                  label="培训内容"
                >
                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="派遣记录"
                                     name="third">
                            <el-table :data="dispatchData"
                                      style="width: 100%">
                <el-table-column
                  prop="traintime"
                  align="center"
                  label="培训时间"
                >
                </el-table-column>
                                <el-table-column prop="name"
                                                 label="姓名"
                                                 align="center">
                                </el-table-column>
                <el-table-column
                  prop="trainaddrss"
                  align="center"
                  label="培训地址"
                >
                </el-table-column>
              </el-table> -->
            </el-tab-pane>
            <el-tab-pane label="成绩相关" name="sixth">
              <achievement></achievement>
              <!-- <el-table :data="examinationData" style="width: 100%">
                <el-table-column prop="rname" label="姓名" align="center">
                </el-table-column>
                                <el-table-column prop="cardid"
                                                 label="身份证号"
                                                 align="center">
                                </el-table-column>
                <el-table-column
                  prop="examinationbegintime"
                  label="考试开始时间"
                  align="center"
                >
                </el-table-column>
                                <el-table-column prop="dispatcher"
                                                 align="center"
                                                 label="派遣人">
                                </el-table-column>
                <el-table-column
                  prop="examinationendtime"
                  label="开始结束时间"
                  align="center"
                >
                </el-table-column>
                                <el-table-column prop="dispatchertime"
                                                 align="center"
                                                 label="派遣时间">
                                </el-table-column>
                <el-table-column
                  prop="examinationtype"
                  align="center"
                  label="考试类别"
                >
                </el-table-column>
                                <el-table-column prop="dispatcheraddress"
                                                 align="center"
                                                 label="派遣地址">
                                </el-table-column>
                <el-table-column
                  prop="examinationc"
                  align="center"
                  label="考试成绩"
                >
                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="获取荣誉"
                                     name="fourth">
                            <el-table :data="honorchData"
                                      style="width: 100%">
                                <el-table-column prop="name"
                                                 label="姓名"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="cardid"
                                                 label="身份证号"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="honor"
                                                 align="center"
                                                 label="荣誉">
                                </el-table-column>
                                <el-table-column prop="honortime"
                                                 align="center"
                                                 label="获取时间">
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="培训相关"
                                     name="fifth">
                            <el-table :data="trainData"
                                      style="width: 100%">
                                <el-table-column prop="rname"
                                                 label="姓名"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="sex"
                                                 label="性别"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="cardid"
                                                 label="身份证号"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="train"
                                                 align="center"
                                                 label="培训单位">
                                </el-table-column>
                                <el-table-column prop="traincontent"
                                                 align="center"
                                                 label="培训内容">
                                </el-table-column>
                                <el-table-column prop="traintime"
                                                 align="center"
                                                 label="培训时间">
                                </el-table-column>
                                <el-table-column prop="trainaddrss"
                                                 align="center"
                                                 label="培训地址">
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="成绩相关"
                                     name="sixth">
                            <el-table :data="examinationData"
                                      style="width: 100%">
                                <el-table-column prop="rname"
                                                 label="姓名"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="examinationbegintime"
                                                 label="考试开始时间"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="examinationendtime"
                                                 label="开始结束时间"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="examinationtype"
                                                 align="center"
                                                 label="考试类别">
                                </el-table-column>
                                <el-table-column prop="examinationc"
                                                 align="center"
                                                 label="考试成绩">
                                </el-table-column>
                                <el-table-column prop="examinationaddress"
                                                 align="center"
                                                 label="考试地点">
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                    </el-tabs>
                </div>
            </el-card>
        </el-col>
    </el-row>
                <el-table-column
                  prop="examinationaddress"
                  align="center"
                  label="考试地点"
                >
                </el-table-column>
              </el-table> -->
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>
<script>
import {
    manifestationList,
    dispatchList,
    honorchList,
    trainList,
    examinationList
  manifestationList,
  dispatchList,
  honorchList,
  trainList,
  examinationList,
} from "@/api/management/peopleDetails";
import dispatch from "./computents/dispatch.vue"; //装备管理
import performance from "./computents/performance.vue"; //保安员信息
import honor from "./computents/honor.vue"; //处罚信息
import train from "./computents/train.vue"; //服务对象
import achievement from "./computents/achievement.vue"; //服务对象
export default {
    data () {
        return {
            activeName: 'first',
            form: {},
            manifestationData: [],
            dispatchData: [],
            honorchData: [],
            trainData: [],
            examinationData: [],
  components: {
    dispatch: dispatch,
    performance: performance,
    honor: honor,
    train: train,
    achievement: achievement,
  },
  data() {
    return {
      activeName: "first",
      form: {},
      manifestationData: [],
      dispatchData: [],
      honorchData: [],
      trainData: [],
      examinationData: [],
    };
  },
  created() {
    var flag = false,
      i = 0,
      ind = null;
    this.$store.state.tags.tagList.forEach((item, index) => {
      if (item.label == "保安详细资料") {
        if (flag == false) {
          ind = index;
          flag = true;
        }
    },
    created () {
        var flag = false, i = 0, ind = null
        this.$store.state.tags.tagList.forEach((item, index) => {
            if (item.label == "保安详细资料") {
                if (flag == false) {
                    ind = index
                    flag = true
                }
                i++
            }
        })
        if (i > 1) {
            this.$store.state.tags.tagList.splice(ind, 1)
        }
        this.form = this.$route.query;
    },
    mounted () {
        // this.$store.state.tags.tag.label = '保安详细资料'
    },
    methods: {
        handleClick (tab) {
            if (tab.index == 1) {
                this.getManifestationData()
            } else if (tab.index == 2) {
                this.getDispatchData()
            } else if (tab.index == 3) {
                this.getHonorchData()
            } else if (tab.index == 4) {
                this.getTrainData()
            } else if (tab.index == 5) {
                this.getExaminationData()
            }
        },
        getManifestationData () {
            manifestationList(this.form.cardid).then(res => {
                this.manifestationData = res.data.data.records
                this.manifestationData.forEach(item => {
                    item.name = this.form.realName
                    item.time = item.time.substring(0, 10)
                })
            })
        },
        getDispatchData () {
            dispatchList(this.form.cardid).then(res => {
                this.dispatchData = res.data.data.records
            })
        },
        getHonorchData () {
            honorchList(this.form.cardid).then(res => {
                this.honorchData = res.data.data.records
            })
        },
        getTrainData () {
            trainList(this.form.cardid).then(res => {
                this.trainData = res.data.data
                this.trainData.forEach(item => {
                    if (item.sex == 1) {
                        item.sex = '男'
                    } else {
                        item.sex = '女'
                    }
                })
            })
        },
        getExaminationData () {
            examinationList(this.form.cardid).then(res => {
                this.examinationData = res.data.data
                this.examinationData.forEach(item => {
                    if (item.stat == 1) {
                        item.stat = '不通过'
                    } else {
                        item.stat = '通过'
                    }
                })
            })
        }
        i++;
      }
    });
    if (i > 1) {
      this.$store.state.tags.tagList.splice(ind, 1);
    }
}
    this.form = this.$route.query;
  },
  mounted() {
    // this.$store.state.tags.tag.label = '保安详细资料'
  },
  methods: {
    handleClick(tab) {
      if (tab.index == 1) {
        this.getManifestationData();
      } else if (tab.index == 2) {
        this.getDispatchData();
      } else if (tab.index == 3) {
        this.getHonorchData();
      } else if (tab.index == 4) {
        this.getTrainData();
      } else if (tab.index == 5) {
        this.getExaminationData();
      }
    },
    getManifestationData() {
      manifestationList(this.form.cardid).then((res) => {
        this.manifestationData = res.data.data.records;
        this.manifestationData.forEach((item) => {
          item.name = this.form.realName;
          item.time = item.time.substring(0, 10);
        });
      });
    },
    getDispatchData() {
      dispatchList(this.form.cardid).then((res) => {
        this.dispatchData = res.data.data.records;
      });
    },
    getHonorchData() {
      honorchList(this.form.cardid).then((res) => {
        this.honorchData = res.data.data.records;
      });
    },
    getTrainData() {
      trainList(this.form.cardid).then((res) => {
        this.trainData = res.data.data;
        this.trainData.forEach((item) => {
          if (item.sex == 1) {
            item.sex = "男";
          } else {
            item.sex = "女";
          }
        });
      });
    },
    getExaminationData() {
      examinationList(this.form.cardid).then((res) => {
        this.examinationData = res.data.data;
        this.examinationData.forEach((item) => {
          if (item.stat == 1) {
            item.stat = "不通过";
          } else {
            item.stat = "通过";
          }
        });
      });
    },
  },
};
</script>
<style lang="scss" scoped>
src/views/management/registerOLD.vue
src/views/onSiteInspection/company.js
New file
@@ -0,0 +1,378 @@
export var datasing = {
    "code": 200,
    "success": true,
    "data": {
        "records": [{
            "id": "1415922341221867522",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:32:47",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-19 19:34:43",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "13576969155",
            "name": "王烽",
            "realName": "王烽",
            "avatar": "",
            "email": "",
            "phone": "13576969155",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602,1416225849858883585",
            "deptId": "1372091709474910209,1415620707473223681,1415635607746551809",
            "postId": "",
            "online_status": "0",
            "work_status": "0",
            "examination_type": "",
            "examination_mx": "",
            "tenantName": "平台运维",
            "userTypeName": "用户平台",
            "roleName": "群防群控队伍,普通群众",
            "deptName": "南昌市公安局,高新技术开发区分局,瑶湖派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "0.0",
            "wd": "0.0"
        }, {
            "id": "1415922434352193537",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:33:10",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 14:33:10",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "014421",
            "name": "",
            "realName": "黎辅齐",
            "avatar": "",
            "email": "",
            "phone": "13970047592",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620404103409666,1415634573724786690",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,经济技术开发区分局,蛟桥派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }, {
            "id": "1415922474940473346",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:33:19",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-17 12:31:14",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "六哥",
            "name": "",
            "realName": "罗健泰",
            "avatar": "https://web.byisf.com/minio/jfpt/upload/depl/fc9d92dd0e9f4849bc95b20039791a77.jpg",
            "email": "",
            "phone": "13807059002",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415619917295710209,1415622346330402817",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,西湖分局,桃花派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }, {
            "id": "1415922519416872961",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:33:30",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 14:33:30",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "014225",
            "name": "",
            "realName": "余春生",
            "avatar": "",
            "email": "",
            "phone": "13870696110",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620472965492738,1415635051854471170",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,红谷滩分局,九龙湖派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }, {
            "id": "1415922688380215297",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:34:10",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 14:34:10",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "1121577645",
            "name": "",
            "realName": "张书茂",
            "avatar": "",
            "email": "",
            "phone": "17607988072",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620472965492738,1415635051854471170",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,红谷滩分局,九龙湖派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }, {
            "id": "1415932008828346370",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 15:11:12",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 15:31:26",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": 1,
            "account": "gxzl",
            "name": "张垒",
            "realName": "张垒",
            "avatar": "",
            "email": "",
            "phone": "13870999707",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620707473223681,1415635420856754177",
            "postId": "",
            "online_status": "0",
            "work_status": "0",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "WEB",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,高新技术开发区分局,高新派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "0.0",
            "wd": "0.0"
        }, {
            "id": "1415932326664314881",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 15:12:28",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 15:31:10",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": 1,
            "account": "gxlty",
            "name": "刘天禹",
            "realName": "刘天禹",
            "avatar": "",
            "email": "",
            "phone": "19917932381",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620707473223681,1415635420856754177",
            "postId": "",
            "online_status": "0",
            "work_status": "0",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "WEB",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,高新技术开发区分局,高新派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "0.0",
            "wd": "0.0"
        }, {
            "id": "1415932534273974274",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 15:13:18",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 15:30:49",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": 1,
            "account": "gxlt",
            "name": "张涛",
            "realName": "张涛",
            "avatar": "",
            "email": "",
            "phone": "13617091698",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620707473223681,1415635420856754177",
            "postId": "",
            "online_status": "0",
            "work_status": "0",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "WEB",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,高新技术开发区分局,高新派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "0.0",
            "wd": "0.0"
        }, {
            "id": "1416224269130563585",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-17 10:32:33",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-17 10:32:33",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "gspcs",
            "name": "",
            "realName": "吴兵",
            "avatar": "",
            "email": "",
            "phone": "18979133669",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620404103409666,1415634727257284609",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,经济技术开发区分局,冠山派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }, {
            "id": "1416224308401831937",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-17 10:32:42",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-17 10:32:42",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "lcy",
            "name": "",
            "realName": "刘晨昱",
            "avatar": "",
            "email": "",
            "phone": "15797855096",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415619917295710209,1415622899219361793",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,西湖分局,广润门派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }],
        "total": 152,
        "size": 10,
        "current": 1,
        "orders": [],
        "optimizeCountSql": true,
        "hitCount": false,
        "countId": "",
        "maxLimit": -1,
        "searchCount": true,
        "pages": 16
    },
    "msg": "操作成功"
}
src/views/onSiteInspection/company.vue
New file
@@ -0,0 +1,389 @@
/*
 * @Author: Morpheus
 * @Date: 2021-07-07 17:30:05
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-07-10 16:06:14
 * menu-name 监管信息
 */
<template>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      v-model="form"
      ref="crud"
      @row-update="rowUpdates"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
</template>
<script>
import {
  getList,
  getListJSON,
} from "@/api/qualificationExamination/signQualificationExamination";
import { mapGetters } from "vuex";
// import { datasing } from "@api/qualificationExamination/datasignQualificationExamination";
import { datasing } from "./company";
export default {
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        // 操作栏多余按钮去除
        // delBtn: false,
        // editBtn: false,
        // addBtn: false,
        // selection: false,
        // menu: false,
        align: "center",
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        index: true,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "被检查单位名称",
            prop: "name",
            // labelWidth: 120,
            // searchLabelWidth: 120,
            // searchSpan: 5,
            // dicUrl:
            //   "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
            // props: {
            //   label: "title",
            //   value: "id",
            // },
            // search: true,
            // overHidden: true,
            // type: "select",
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入保安公司",
            //     trigger: "blur",
            //   },
            // ],
          },
          //   {
          //     label: "试卷名称",
          //     prop: "examName",
          //     // type: "select",
          //     // labelWidth: 120,
          //     // // display: false,
          //     // dicData: dic,
          //     // // props: {
          //     // //   label: "label",
          //     // //   value: "value",
          //     // // },
          //     // searchSpan: 5,
          //     // search: true,
          //     // width: 120,
          //   },
          {
            label: "检查人姓名",
            prop: "deptName",
            // display: false,
            // labelWidth: 120,
            // width: 200,
          },
          {
            label: "检查人单位",
            prop: "userId",
            // // display: false,
            // width: 200,
            // labelWidth: 120,
            // overHidden: true,
          },
          //   {
          //     label: "试卷分数",
          //     prop: "paperScore",
          //     // type: "date",
          //     // format: "yyyy-MM-dd",
          //     // valueFormat: "yyyy-MM-dd",
          //     // mock: {
          //     //   type: "datetime",
          //     //   labelWidth: 120,
          //     //   format: "yyyy-MM-dd",
          //     // },
          //     // // search: true,
          //     // searchSpan: 4,
          //     // // display: false,
          //     // width: 180,
          //   },
          {
            label: "检查日期",
            prop: "examTime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            mock: {
              type: "datetime",
              labelWidth: 120,
              format: "yyyy-MM-dd",
            },
            // search: true,
            searchSpan: 4,
            // display: false,
            width: 180,
          },
          {
            label: "检查内容",
            prop: "applyTime",
            // type: "date",
            // format: "yyyy-MM-dd",
            // valueFormat: "yyyy-MM-dd",
            // mock: {
            //   type: "datetime",
            //   labelWidth: 120,
            //   format: "yyyy-MM-dd",
            // },
            // // search: true,
            // searchSpan: 4,
            // // display: false,
            // width: 180,
          },
          // {
          //   label: "证件类型",
          //   prop: "certificatetype",
          //   // labelWidth: 120,
          //   // display: false,
          // },
          //   {
          //     label: "保安员证",
          //     prop: "certificate",
          //     // labelWidth: 120,
          //     // display: false,
          //   },
          {
            label: "检查结果",
            prop: "results",
            // // display: false,
            // width: 200,
            // labelWidth: 120,
            // overHidden: true,
          },
        ],
        // group: [
        //   {
        //     label: "详细信息",
        //     prop: "baseInfo",
        //     icon: "el-icon-user-solid",
        //     column: [
        //       {
        //         label: "公司名称",
        //         prop: "enterprisename",
        //         display: false,
        //       },
        //     ],
        //   },
        //   {
        //     label: "详细信息",
        //     prop: "detailInfo",
        //     icon: "el-icon-s-order",
        //     column: [],
        //   },
        //   {
        //     label: "职责信息",
        //     prop: "dutyInfo",
        //     icon: "el-icon-s-custom",
        //     column: [],
        //   },
        // ],
      },
      data: [
        // {
        //   deptid: "江西众泰保安公司",
        //   punishtype: 2,
        //   punishreason: "非法施工",
        //   punishresult: "没收全部非法所得财产,并罚款3W元",
        //   punishtime: "2021-01-01",
        //   punisnum: 110110110120,
        // },
      ],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
        viewBtn: this.vaildData(this.permission.post_view, false),
        delBtn: this.vaildData(this.permission.post_delete, false),
        editBtn: this.vaildData(this.permission.post_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    rowSave(row, done, loading) {
      adddata(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowUpdates(row, index, done, loading) {
      // console.log(42342);
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    // beforeOpen(done, type) {
    //   if (["edit", "view"].includes(type)) {
    //     getDetail(this.form.id).then((res) => {
    //       this.form = res.data.data;
    //     });
    //   }
    //   done();
    // },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      // this.loading = false;
      this.loading = true;
      //   getListJSON().then((res) => {
      //   axios
      //     .get(
      //       "../../api/qualificationExamination/signQualificationExamination.json"
      //     )
      //     .then((res) => {
      // page.currentPage,
      // page.pageSize,
      // Object.assign(params, this.query)
      if (datasing) {
        var res = datasing;
        console.log(res, "company");
        const data = res.data;
        // this.page.total = data.total;
        // this.data = data.records;
        var d = data.records;
        for (var k in d) {
          //   d[k].examination_mx = "正常";
          //   d[k].examination_type = "正常";
          //   d[k]["carid"] = "370111198807051124";
          //   d[k]["reviewTime"] = "2021-02-21";
          d[k]["results"] = "通过";
          d[k]["certificate"] = "拥有";
          d[k]["certificatetype"] = "保安员证";
          //   d[k]["onjob"] = "是";
        }
        this.data = d;
        this.loading = false;
      }
      // this.selectionClear();
      // });
    },
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安公司详细资料";
      this.$router.push({
        path: `/securityCompany/index`,
        query: obj,
      });
    },
  },
};
</script>
<style>
</style>
src/views/onSiteInspection/data.js
New file
@@ -0,0 +1,278 @@
var DIC = [
    {
        label: '招聘中',
        value: 1,
    }, {
        label: '停止招聘',
        value: 2,
    }
]
var DIC1 = [
    {
        label: '拥有',
        value: 1,
    }, {
        label: '未拥有',
        value: 2,
    }
]
var w = 160
    , s = 12;
export var column = [
    {
        label: "id",
        prop: "id",
        hide: true,
        editDisplay: false,
        addDisplay: false,
        viewDisplay: false,
    },
    // {
    //     label: "保安单位",
    //     prop: "tenantName",
    //     hide: true,
    //     editDisplay: false,
    //     addDisplay: false
    // },
    // {
    //     label: "保安id",
    //     prop: "deptId",
    //     hide: true,
    //     editDisplay: false,
    //     addDisplay: false,
    //     value: JSON.parse(window.localStorage.getItem("saber-userInfo")).content.dept_id
    // },//上面不显示
    {
        label: "保安姓名",
        prop: "tenantName",
        //     hide: true,
        //     editDisplay: false,
        //     addDisplay: false
    },
    {
        label: "保安公司",
        prop: "deptId",
        rules: [{
            required: true,
            message: "请输入保安公司",
            trigger: "blur"
        }],
        // addDisplay: true,
        // editDisplay: true,
        // viewDisplay: true,
        overHidden: true,
        searchSpan: 4,
        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
        props: {
            label: "title",
            value: "id"
        },
        hide: true,
        // search: true,
        type: "select",
    },
    {
        label: "招聘岗位",
        prop: "name",
        hide: true,
        // search: true,
    },
    {
        label: "招聘人数",
        prop: "number",
        width: 70,
        hide: true,
        // search: true,
    },
    {
        label: "保安证",
        prop: "permit",
        // addDisplay: true,
        // editDisplay: true,
        // viewDisplay: true,
        filter: false,
        type: 'tree',
        dicData: DIC1,
        searchSpan: 4,
        hide: true,
        // dicUrl: "/api/blade-system/dict-biz/dictionary?code=equipage",
        // props: {
        //     label: "dictValue",
        //     value: "dictKey"
        // },
        // search: true,
        // type: "select",
    },
    {
        label: "学历要求",
        prop: "education",
        addDisplay: true,
        editDisplay: true,
        viewDisplay: true,
        searchSpan: 4,
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType",
        props: {
            label: "dictValue",
            value: "dictKey"
        },
        hide: true,
        // search: true,
        type: "select",
        // rules: [{
        //     required: true,
        //     message: "请选择学历",
        //     trigger: "blur"
        // }],
    },
    {
        label: "工作经验",
        prop: "experience",
        addDisplay: true,
        editDisplay: true,
        viewDisplay: true,
        hide: true,
        searchSpan: 4,
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=experienceType",
        props: {
            label: "dictValue",
            value: "dictKey"
        },
        // search: true,
        type: "select",
        // rules: [{
        //     required: true,
        //     message: "请选择工作经验",
        //     trigger: "blur"
        // }],
    },
    {
        label: "工作任务",
        prop: "workDesc",
        // search: true,
        // width: 110,
        overHidden: true
    },
    {
        label: "福利",
        prop: "welfare",
        search: true,
        searchSpan: 5,
        overHidden: true
    },
    {
        label: "最低薪资",
        prop: "minSalary",
        width: 100,
        // search: true,
        searchSpan: 4,
    },
    {
        label: "最高薪资",
        prop: "maxSalary",
        width: 100,
        // search: true,
        searchSpan: 4,
    },
    {
        label: "单位性质",
        prop: "unitsNature",
        width: 70,
        addDisplay: true,
        editDisplay: true,
        viewDisplay: true,
        searchSpan: 4,
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=unitsNatureType",
        props: {
            label: "dictValue",
            value: "dictKey"
        },
        // search: true,
        type: "select",
        // rules: [{
        //     required: false,
        //     message: "请选择单位规模",
        //     trigger: "blur"
        // }],
    },
    {
        label: "单位规模",
        prop: "unitsScale",
        addDisplay: true,
        editDisplay: true,
        viewDisplay: true,
        width: 150,
        searchSpan: 4,
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=unitsScaleType",
        props: {
            label: "dictValue",
            value: "dictKey"
        },
        search: true,
        type: "select",
        // rules: [{
        //     required: true,
        //     message: "请选择单位规模",
        //     trigger: "blur"
        // }],
    },
    {
        label: "联系人",
        prop: "linkman",
        hide: true,
        // search: true,
    },
    {
        label: "联系人电话",
        prop: "phone",
        hide: true,
        // search: true,
        width: 110,
    },
    {
        label: "详细地址",
        prop: "address",
        width: 110,
        // search: true,
        hide: true,
        overHidden: true
    },
    {
        label: "开始时间",
        prop: "startTime",
        // search: true,
        hide: true,
        type: "date",
        format: "yyyy-MM-dd hh:mm:ss",
        valueFormat: "yyyy-MM-dd hh:mm:ss",
        width: 88,
    },
    {
        label: "结束时间",
        prop: "endTime",
        // search: true,
        hide: true,
        type: "date",
        format: "yyyy-MM-dd hh:mm:ss",
        valueFormat: "yyyy-MM-dd hh:mm:ss",
        width: 88,
    },
    {
        label: "招聘状态",
        // prop: "status",
        // search: true,
        // searchSpan: 4,
        width: 70,
        prop: 'status',
        hide: true,
        filter: false,
        type: 'tree',
        dicData: DIC,
        // rules: [{
        //     required: true,
        //     message: "请选择单位规模",
        //     trigger: "blur"
        // }],
    },
]
src/views/onSiteInspection/securityStaff.vue
New file
@@ -0,0 +1,420 @@
/*
 * @Author: Morpheus
 * @Date: 2021-07-07 17:30:05
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-07-10 16:06:14
 * menu-name 监管信息
 */
<template>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      v-model="form"
      ref="crud"
      @row-update="rowUpdates"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
</template>
<script>
import {
  getList,
  getDetail,
  adddata,
  update,
  remove,
} from "@/api/regulatoryInformation/regulatoryInformation";
import { mapGetters } from "vuex";
import { datasing } from "./securityStaffdata";
export default {
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        // 操作栏多余按钮去除
        // delBtn: false,
        // editBtn: false,
        // addBtn: false,
        // selection: false,
        // menu: false,
        align: "center",
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        index: true,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "保安员姓名",
            prop: "deptName",
            overHidden: true,
            // labelWidth: 120,
            // searchLabelWidth: 120,
            // searchSpan: 5,
            // dicUrl:
            //   "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
            // props: {
            //   label: "title",
            //   value: "id",
            // },
            // search: true,
            // overHidden: true,
            // type: "select",
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入保安公司",
            //     trigger: "blur",
            //   },
            // ],
          },
          {
            label: "保安员姓名",
            prop: "realName",
            //     hide: true,
            //     editDisplay: false,
            //     addDisplay: false
          },
          {
            label: "保安员身份证号",
            prop: "carid",
            // type: "select",
            // labelWidth: 120,
            // // display: false,
            // dicData: dic,
            // // props: {
            // //   label: "label",
            // //   value: "value",
            // // },
            // searchSpan: 5,
            // search: true,
            // width: 120,
          },
          {
            label: "保安员单位",
            prop: "sexName",
            // type: "select",
            // labelWidth: 120,
            // // display: false,
            // dicData: dic,
            // // props: {
            // //   label: "label",
            // //   value: "value",
            // // },
            // searchSpan: 5,
            // search: true,
            // width: 120,
          },
          // {
          //   label: "保安员证",
          //   prop: "certificate",
          //   // labelWidth: 120,
          //   // display: false,
          // },
          {
            label: "检查人姓名",
            prop: "phone",
            // display: false,
            // labelWidth: 120,
            // width: 200,
          },
          // {
          //   label: "所属角色",
          //   prop: "roleName",
          //   // display: false,
          //   overHidden: true,
          //   // width: 200,
          //   // labelWidth: 120,
          //   // overHidden: true,
          // },
          {
            label: "检查人单位",
            prop: "examination_type",
            // overHidden: true,
            // type: "date",
            // format: "yyyy-MM-dd",
            // valueFormat: "yyyy-MM-dd",
            // mock: {
            //   type: "datetime",
            //   labelWidth: 120,
            //   format: "yyyy-MM-dd",
            // },
            // // search: true,
            // searchSpan: 4,
            // // display: false,
            // width: 180,
          },
          {
            label: "检查日期",
            prop: "examination_mx",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            mock: {
              type: "datetime",
              labelWidth: 120,
              format: "yyyy-MM-dd",
            },
            // search: true,
            searchSpan: 4,
            // display: false,
            width: 180,
          },
          // {
          //   label: "审查结果",
          //   prop: "results",
          //   // labelWidth: 120,
          //   // display: false,
          // },
          {
            label: "检查内容",
            prop: "reviewTime",
            // labelWidth: 120,
            // display: false,
          },
          {
            label: "检查结果",
            prop: "onjob",
            // labelWidth: 120,
            // display: false,
          },
        ],
        // group: [
        //   {
        //     label: "详细信息",
        //     prop: "baseInfo",
        //     icon: "el-icon-user-solid",
        //     column: [
        //       {
        //         label: "公司名称",
        //         prop: "enterprisename",
        //         display: false,
        //       },
        //     ],
        //   },
        //   {
        //     label: "详细信息",
        //     prop: "detailInfo",
        //     icon: "el-icon-s-order",
        //     column: [],
        //   },
        //   {
        //     label: "职责信息",
        //     prop: "dutyInfo",
        //     icon: "el-icon-s-custom",
        //     column: [],
        //   },
        // ],
      },
      data: [
        // {
        //   deptid: "江西众泰保安公司",
        //   punishtype: 2,
        //   punishreason: "非法施工",
        //   punishresult: "没收全部非法所得财产,并罚款3W元",
        //   punishtime: "2021-01-01",
        //   punisnum: 110110110120,
        // },
      ],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
        viewBtn: this.vaildData(this.permission.post_view, false),
        delBtn: this.vaildData(this.permission.post_delete, false),
        editBtn: this.vaildData(this.permission.post_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    rowSave(row, done, loading) {
      adddata(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowUpdates(row, index, done, loading) {
      // console.log(42342);
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    // beforeOpen(done, type) {
    //   if (["edit", "view"].includes(type)) {
    //     getDetail(this.form.id).then((res) => {
    //       this.form = res.data.data;
    //     });
    //   }
    //   done();
    // },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    // onLoad(page, params = {}) {
    //   // this.loading = false;
    //   this.loading = true;
    //   getList(
    //     page.currentPage,
    //     page.pageSize,
    //     Object.assign(params, this.query)
    //   ).then((res) => {
    //     const data = res.data.data;
    //     this.page.total = data.total;
    //     this.data = data.records;
    //     this.loading = false;
    //     // this.selectionClear();
    //   });
    // },
    onLoad(page, params = {}) {
      // this.loading = false;
      this.loading = true;
      //   getListJSON().then((res) => {
      //   axios
      //     .get(
      //       "../../api/qualificationExamination/signQualificationExamination.json"
      //     )
      //     .then((res) => {
      // page.currentPage,
      // page.pageSize,
      // Object.assign(params, this.query)
      // console.log(datasing);
      if (datasing) {
        var res = datasing;
        console.log(res, "securityStaff");
        const data = res.data;
        // this.page.total = data.total;
        var d = data.records;
        for (var k in d) {
          d[k].examination_mx = "正常";
          d[k].examination_type = "正常";
          d[k]["carid"] = "370111198807051124";
          d[k]["certificate"] = "拥有";
          d[k]["reviewTime"] = "2021-02-21";
          d[k]["results"] = "通过";
          d[k]["onjob"] = "是";
        }
        this.data = d;
        this.loading = false;
      }
      // this.selectionClear();
      // });
    },
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安公司详细资料";
      this.$router.push({
        path: `/securityCompany/index`,
        query: obj,
      });
    },
  },
};
</script>
<style>
</style>
src/views/onSiteInspection/securityStaffdata.js
New file
@@ -0,0 +1,198 @@
export var datasing = {
    "code": 200,
    "success": true,
    "data": {
        "records": [{
            "id": "1415922341221867522",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:32:47",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-19 19:34:43",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "13576969155",
            "name": "王烽",
            "realName": "王烽",
            "avatar": "",
            "email": "",
            "phone": "13576969155",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602,1416225849858883585",
            "deptId": "1372091709474910209,1415620707473223681,1415635607746551809",
            "postId": "",
            "online_status": "0",
            "work_status": "0",
            "examination_type": "",
            "examination_mx": "",
            "tenantName": "平台运维",
            "userTypeName": "用户平台",
            "roleName": "群防群控队伍,普通群众",
            "deptName": "南昌市公安局,高新技术开发区分局,瑶湖派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "0.0",
            "wd": "0.0"
        }, {
            "id": "1415922434352193537",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:33:10",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 14:33:10",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "014421",
            "name": "",
            "realName": "黎辅齐",
            "avatar": "",
            "email": "",
            "phone": "13970047592",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620404103409666,1415634573724786690",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,经济技术开发区分局,蛟桥派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }, {
            "id": "1415922474940473346",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:33:19",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-17 12:31:14",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "六哥",
            "name": "",
            "realName": "罗健泰",
            "avatar": "https://web.byisf.com/minio/jfpt/upload/depl/fc9d92dd0e9f4849bc95b20039791a77.jpg",
            "email": "",
            "phone": "13807059002",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415619917295710209,1415622346330402817",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,西湖分局,桃花派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }, {
            "id": "1415922519416872961",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:33:30",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 14:33:30",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "014225",
            "name": "",
            "realName": "余春生",
            "avatar": "",
            "email": "",
            "phone": "13870696110",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620472965492738,1415635051854471170",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,红谷滩分局,九龙湖派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }, {
            "id": "1415922688380215297",
            "createUser": "1123598821738675201",
            "createDept": "1372091709474910209",
            "createTime": "2021-07-16 14:34:10",
            "updateUser": "1123598821738675201",
            "updateTime": "2021-07-16 14:34:10",
            "status": 1,
            "isDeleted": 0,
            "tenantId": "000000",
            "code": "",
            "userType": -1,
            "account": "1121577645",
            "name": "",
            "realName": "张书茂",
            "avatar": "",
            "email": "",
            "phone": "17607988072",
            "birthday": "",
            "sex": 1,
            "roleId": "1372092102682521602",
            "deptId": "1372091709474910209,1415620472965492738,1415635051854471170",
            "postId": "",
            "online_status": "",
            "work_status": "",
            "examination_type": "0",
            "examination_mx": "正常",
            "tenantName": "平台运维",
            "userTypeName": "",
            "roleName": "群防群控队伍",
            "deptName": "南昌市公安局,红谷滩分局,九龙湖派出所",
            "postName": "",
            "sexName": "男",
            "userExt": "",
            "jd": "",
            "wd": ""
        }],
        "total": 152,
        "size": 10,
        "current": 1,
        "orders": [],
        "optimizeCountSql": true,
        "hitCount": false,
        "countId": "",
        "maxLimit": -1,
        "searchCount": true,
        "pages": 16
    },
    "msg": "操作成功"
}
src/views/permit/permit.vue
@@ -1,58 +1,60 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               :row-style="rowStyle"
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
      :row-style="rowStyle"
    >
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.permit_delete"
                   @click="handleDelete">删 除
        <el-button
          type="danger"
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.permit_delete"
          @click="handleDelete"
          >删 除
        </el-button>
      </template>
      <template slot-scope="{type,size,row}"
                slot="menu">
        <el-button icon="icon-zhengjian"
                   :size="size"
                   :type="type"
                   class="zhengJian-icon"
                   @click.stop="handleCredentials(row)">附件查阅
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="icon-zhengjian"
          :size="size"
          :type="type"
          class="zhengJian-icon"
          @click.stop="handleCredentials(row)"
          >附件查阅
        </el-button>
        <el-button
          icon="el-icon-edit"
          :size="size"
          :type="type"
          @click.stop="rowDel(row)"
        >许可审批
          >许可审批
        </el-button>
      </template>
      <template class="tdtype" slot-scope="{ row }" slot="type">
        <el-tag class="dtype">
          {{
            row.type == "0" ? "通过" : row.type == "1" ? "不通过":"待审核"
          }}
          <i class="gz" v-if="row.type == '0' "></i>
          <i class="yj" v-if="row.type == '1' "></i>
          <i class="zc" v-if="row.type == '2' "></i>
          {{ row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审核" }}
          <i class="gz" v-if="row.type == '0'"></i>
          <i class="yj" v-if="row.type == '1'"></i>
          <i class="zc" v-if="row.type == '2'"></i>
        </el-tag>
      </template>
    </avue-crud>
@@ -60,8 +62,8 @@
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/permit/permit";
import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/permit/permit";
import { mapGetters } from "vuex";
export default {
  data() {
@@ -72,18 +74,20 @@
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
        total: 0,
      },
      selectionList: [],
      option: {
        height: 'auto',
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 8,
        menuWidth: 280,
        labelWidth: 130,
        headerAlign: 'center',
        align: 'center',
        headerAlign: "center",
        align: "center",
        border: true,
        index: true,
        viewBtn: true,
@@ -94,30 +98,37 @@
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [{
              required: true,
              message: "请输入统一社会信用代码",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业名称",
            search: true,
            prop: "enterprisename",
            rules: [{
              required: true,
              message: "请输入企业名称",
              trigger: "blur"
            }]
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            rules: [{
              required: true,
              message: "请输入法定代表人",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "成立日期",
@@ -125,96 +136,118 @@
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [{
              required: true,
              message: "请输入成立日期",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入成立日期",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            rules: [{
              required: true,
              message: "请输入注册资本",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            rules: [{
              required: true,
              message: "请输入组织机构代码",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            hide: true,
            prop: "registrationnumber",
            rules: [{
              required: true,
              message: "请输入工商注册号",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            rules: [{
              required: true,
              message: "请输入纳税人识别号",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            hide: true,
            prop: "enterprises",
            rules: [{
              required: true,
              message: "请输入企业类型",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            rules: [{
              required: true,
              message: "请输入注册地址",
              trigger: "blur"
            }]
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            hide: true,
            prop: "region",
            rules: [{
              required: true,
              message: "请输入所属地区",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            rules: [{
              required: true,
              message: "请输入登记机关",
              trigger: "blur"
            }]
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            hide: true,
            prop: "industry",
            rules: [{
              required: true,
              message: "请输入所属行业",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
@@ -225,7 +258,7 @@
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid"
              value: "deptid",
            },
          },
          {
@@ -236,17 +269,18 @@
            dicData: [
              {
                label: "保安服务许可",
                value: '0'
                value: "0",
              },
              {
                label: "保安培训许可",
                value: '1'
                value: "1",
              },
            ],
          },
          {
            label: "提交时间",
            prop: "permitime",
            overHidden: true,
            addDisplay: false,
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
@@ -260,59 +294,56 @@
            dicData: [
              {
                label: "通过",
                value: '0'
                value: "0",
              },
              {
                label: "不通过",
                value: '1'
                value: "1",
              },
              {
                label: "待审核",
                value: '2'
              }
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: 'AvueUeditor',
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [{
              required: true,
              message: "请输入经营范围",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur",
              },
            ],
          },
        ]
        ],
      },
      data: []
      data: [],
    };
  },
  computed: {
    ...
      mapGetters(["permission", "userInfo"]),
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.permit_add, false),
        viewBtn: this.vaildData(this.permission.permit_view, false),
        delBtn: this.vaildData(this.permission.permit_delete, false),
        editBtn: this.vaildData(this.permission.permit_edit, false)
        editBtn: this.vaildData(this.permission.permit_edit, false),
      };
    }
    ,
    },
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    }
    ,
  }
  ,
    },
  },
  // mounted() {
  //     console.log(this.userInfo.dept_id);
  // },
@@ -322,59 +353,61 @@
        path: "/attach/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: {deptid: row.deptid, type: '0'},
        query: { deptid: row.deptid, type: "0" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id
      add(row).then(() => {
        this.onLoad(this.page);
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
      }, error => {
        loading();
        window.console.log(error);
      });
    }
    ,
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          window.console.log(error);
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(() => {
        this.onLoad(this.page);
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
      }, error => {
        loading();
        console.log(error);
      });
    }
    ,
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定对选择的许可进行审批?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
        type: "warning",
      })
        .then(() => {
          row.type='0';
          row.type = "0";
          return update(row);
        }
        )
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
        });
    }
    ,
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
@@ -383,7 +416,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
@@ -392,57 +425,52 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
    }
    ,
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then(res => {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    }
    ,
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    }
    ,
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    }
    ,
    },
    selectionChange(list) {
      this.selectionList = list;
    }
    ,
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    }
    ,
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    }
    ,
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    }
    ,
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    }
    ,
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
@@ -450,32 +478,30 @@
        this.selectionClear();
      });
    },
    rowStyle({row}) {
    rowStyle({ row }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == '2') {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A"
            color: "#F34A4A",
          };
        }
        if(row.dtype=='1'){
        if (row.dtype == "1") {
          return {
            color: "#F48F57"
            color: "#F48F57",
          };
        }
      }
    }
  }
    },
  },
};
</script>
<style scoped>
.dtype{
.dtype {
  width: 80px;
}
.dx{
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -483,9 +509,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #DFDFDF;
  background: #dfdfdf;
}
.zc{
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -493,9 +519,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29C093;
  background: #29c093;
}
.yj{
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -503,9 +529,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #F34A4A;
  background: #f34a4a;
}
.gz{
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -513,13 +539,13 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #F48F57;
  background: #f48f57;
}
.el-tag{
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
  /*padding-right: 40px !important;*/
}
</style>
src/views/qualificationExamination/qualificationExamination.vue
@@ -31,15 +31,16 @@
</template>
<script>
import {
  getList,
  getDetail,
  adddata,
  update,
  remove,
} from "@/api/regulatoryInformation/regulatoryInformation";
// import {
//   getList,
//   getDetail,
//   adddata,
//   update,
//   remove,
// } from "@/api/regulatoryInformation/regulatoryInformation";
import { mapGetters } from "vuex";
import { datasing } from "./dataqualificationExamination";
import { getList } from "@/api/qualificationExamination/qualificationExamination";
export default {
  data() {
@@ -106,7 +107,7 @@
          {
            label: "性别",
            prop: "sexName",
            prop: "sex",
            // type: "select",
            // labelWidth: 120,
            // // display: false,
@@ -356,7 +357,7 @@
    //     // this.selectionClear();
    //   });
    // },
    onLoad(page, params = {}) {
    onLoad1(page, params = {}) {
      // this.loading = false;
      this.loading = true;
      //   getListJSON().then((res) => {
src/views/qualificationExamination/signQualificationExamination.vue
@@ -31,13 +31,14 @@
</template>
<script>
import {
  getList,
  getListJSON,
} from "@/api/qualificationExamination/signQualificationExamination";
// import {
//   getList,
//   getListJSON,
// } from "@/api/qualificationExamination/signQualificationExamination";
import { mapGetters } from "vuex";
// import { datasing } from "@api/qualificationExamination/datasignQualificationExamination";
import { datasing } from "./datasignQualificationExamination";
// import { getList } from "@/api/qualificationExamination/qualificationExamination";
export default {
  data() {
@@ -111,6 +112,7 @@
          {
            label: "保安公司",
            prop: "deptName",
            overHidden: true,
            // display: false,
            // labelWidth: 120,
            // width: 200,
@@ -118,6 +120,7 @@
          {
            label: "准考证号",
            prop: "userId",
            overHidden: true,
            // // display: false,
            // width: 200,
            // labelWidth: 120,
@@ -335,6 +338,21 @@
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    // onLoad(page, params = {}) {
    //   this.loading = false;
    //   this.loading = true;
    //   getList(
    //     page.currentPage,
    //     page.pageSize,
    //     Object.assign(params, this.query)
    //   ).then((res) => {
    //     const data = res.data.data;
    //     this.page.total = data.total;
    //     this.data = data.records;
    //     this.loading = false;
    //     // this.selectionClear();
    //   });
    // },
    onLoad(page, params = {}) {
      // this.loading = false;
      this.loading = true;
src/views/record/record.vue
@@ -1,55 +1,59 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.record_delete"
                   @click="handleDelete">删 除
        <el-button
          type="danger"
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.record_delete"
          @click="handleDelete"
          >删 除
        </el-button>
      </template>
      <template slot-scope="{type,size,row}"
                slot="menu">
        <el-button icon="icon-zhengjian"
                   :size="size"
                   :type="type"
                   class="zhengJian-icon"
                   @click.stop="handleCredentialsr(row)">附件查阅</el-button>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="icon-zhengjian"
          :size="size"
          :type="type"
          class="zhengJian-icon"
          @click.stop="handleCredentialsr(row)"
          >附件查阅</el-button
        >
        <el-button
          icon="el-icon-edit"
          :size="size"
          :type="type"
          @click.stop="rowDel(row)"
        >备案审批
          >备案审批
        </el-button>
      </template>
      <template class="tdtype" slot-scope="{ row }" slot="type">
        <el-tag class="dtype">
          {{
            row.type == "0" ? "通过" : row.type == "1" ? "不通过":"待审核"
          }}
          <i class="gz" v-if="row.type == '0' "></i>
          <i class="yj" v-if="row.type == '1' "></i>
          <i class="zc" v-if="row.type == '2' "></i>
          {{ row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审核" }}
          <i class="gz" v-if="row.type == '0'"></i>
          <i class="yj" v-if="row.type == '1'"></i>
          <i class="zc" v-if="row.type == '2'"></i>
        </el-tag>
      </template>
    </avue-crud>
@@ -57,405 +61,454 @@
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/record/record";
  import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/record/record";
import { mapGetters } from "vuex";
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        option: {
          height:'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          labelWidth:130,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          column: [
            {
              label: "社会信用代码",
              prop: "creditcode",
              hide: true,
              rules: [{
export default {
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        labelWidth: 130,
        menuWidth: 280,
        border: true,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur"
              }]
            },
            {
              label: "企业名称",
              prop: "enterprisename",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业名称",
            prop: "enterprisename",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur"
              }]
            },
            {
              label: "法定代表人",
              prop: "representative",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur"
              }]
            },
            {
              label: "成立日期",
              prop: "establishtime",
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "成立日期",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入成立日期",
                trigger: "blur"
              }]
            },
            {
              label: "注册资本",
              prop: "registeredcapital",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur"
              }]
            },
            {
              label: "组织机构代码",
              prop: "organizationcode",
              hide:true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur"
              }]
            },
            {
              label: "工商注册号",
              prop: "registrationnumber",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            prop: "registrationnumber",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur"
              }]
            },
            {
              label: "纳税人识别号",
              hide:true,
              prop: "identificationnumber",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            hide: true,
            prop: "identificationnumber",
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur"
              }]
            },
            {
              label: "企业类型",
              prop: "enterprises",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            prop: "enterprises",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur"
              }]
            },
            {
              label: "注册地址",
              prop: "address",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur"
              }]
            },
            {
              label: "所属地区",
              prop: "region",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur"
              }]
            },
            {
              label: "登记机关",
              prop: "registration",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur"
              }]
            },
            {
              label: "所属行业",
              prop: "industry",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            prop: "industry",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur"
              }]
            },
            {
              label: "所属机构",
              prop: "deptid",
              type: "select",
              hide: true,
              dicUrl: "/api/blade-system/dept/selectIn",
              props: {
                label: "deptname",
                value: "deptid"
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
          },
            {
              label: "单位许可编号",
              hide:true,
              prop: "perid",
              rules: [{
          {
            label: "单位许可编号",
            hide: true,
            prop: "perid",
            rules: [
              {
                required: true,
                message: "请输入服务单位许可编号",
                trigger: "blur"
              }]
            },
            {
              label: "许可发证机关",
              prop: "offices",
              hide:true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "许可发证机关",
            prop: "offices",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入许可发证机关",
                trigger: "blur"
              }]
            },
            {
              label: "发证时间",
              hide:true,
              prop: "officetime",
              type: "date",
              format: "yyyy-MM-dd HH:mm:ss",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "发证时间",
            hide: true,
            prop: "officetime",
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
            rules: [
              {
                required: true,
                message: "请输入发证时间",
                trigger: "blur"
              }]
            },
                trigger: "blur",
              },
            ],
          },
            {
              label: "审核状态",
              prop: "type",
              addDisplay:false,
              type: "select",
              dicData: [
                {
                  label: "通过",
                  value: '0'
                },
                {
                  label: "不通过",
                  value: '1'
                },
                {
                  label: "待审核",
                  value: '2'
                }
              ],
            },
            {
              label: "经营范围",
              prop: "business",
              component: 'AvueUeditor',
              hide: true,
              minRows: 6,
              span: 24,
              rules: [{
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "通过",
                value: "0",
              },
              {
                label: "不通过",
                value: "1",
              },
              {
                label: "待审核",
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur"
              }]
            },
          ]
        },
        data: []
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.record_add, false),
        viewBtn: this.vaildData(this.permission.record_view, false),
        delBtn: this.vaildData(this.permission.record_delete, false),
        editBtn: this.vaildData(this.permission.record_edit, false),
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.record_add, false),
          viewBtn: this.vaildData(this.permission.record_view, false),
          delBtn: this.vaildData(this.permission.record_delete, false),
          editBtn: this.vaildData(this.permission.record_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    methods: {
      handleCredentialsr(row) {
        this.$router.push({
          path: "/attach/index",
          // redirect: { name: "foo" },
          // query: { row: row },
          query: {deptid: row.deptid, type: '1'},
          // params: { row: row.identificationnumber },
        });
      },
      rowSave(row, done, loading) {
        row.deptid = this.userInfo.dept_id
        add(row).then(() => {
  },
  methods: {
    handleCredentialsr(row) {
      this.$router.push({
        path: "/attach/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.deptid, type: "1" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          loading();
          window.console.log(error);
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          loading();
          console.log(error);
        });
      },
      rowDel(row) {
        this.$confirm("确定对选择的备案进行审批?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            row.type='0'
            return update(row);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
      );
    },
    rowDel(row) {
      this.$confirm("确定对选择的备案进行审批?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          row.type = "0";
          return update(row);
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      },
      rowStyle({row, column, rowIndex}) {
        if (row.dtype != null && row.dtype != "") {
          if (row.dtype == '2') {
            return {
              color: "#F34A4A"
            };
          }
          if(row.dtype=='1'){
            return {
              color: "#F48F57"
            };
          }
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    rowStyle({ row, column, rowIndex }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A",
          };
        }
        if (row.dtype == "1") {
          return {
            color: "#F48F57",
          };
        }
      }
    }
  };
    },
  },
};
</script>
<style scoped>
.dtype{
.dtype {
  width: 80px;
}
.dx{
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -463,9 +516,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #DFDFDF;
  background: #dfdfdf;
}
.zc{
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -473,9 +526,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29C093;
  background: #29c093;
}
.yj{
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -483,9 +536,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #F34A4A;
  background: #f34a4a;
}
.gz{
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -493,13 +546,12 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #F48F57;
  background: #f48f57;
}
.el-tag{
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
</style>
src/views/recordk/recordk.vue
@@ -1,57 +1,60 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               :row-style="rowStyle"
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
      :row-style="rowStyle"
    >
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.recordk_delete"
                   @click="handleDelete">删 除
        <el-button
          type="danger"
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.recordk_delete"
          @click="handleDelete"
          >删 除
        </el-button>
      </template>
      <template slot-scope="{type,size,row}"
                slot="menu">
        <el-button icon="icon-zhengjian"
                   :size="size"
                   :type="type"
                   class="zhengJian-icon"
                   @click.stop="handleCredentials(row)">附件审查</el-button>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="icon-zhengjian"
          :size="size"
          :type="type"
          class="zhengJian-icon"
          @click.stop="handleCredentials(row)"
          >附件审查</el-button
        >
        <el-button
          icon="el-icon-edit"
          :size="size"
          :type="type"
          @click.stop="rowDel(row)"
        >备案审批
          >备案审批
        </el-button>
      </template>
      <template class="tdtype" slot-scope="{ row }" slot="type">
        <el-tag class="dtype">
          {{
            row.type == "0" ? "通过" : row.type == "1" ? "不通过":"待审核"
          }}
          <i class="gz" v-if="row.type == '0' "></i>
          <i class="yj" v-if="row.type == '1' "></i>
          <i class="zc" v-if="row.type == '2' "></i>
          {{ row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审核" }}
          <i class="gz" v-if="row.type == '0'"></i>
          <i class="yj" v-if="row.type == '1'"></i>
          <i class="zc" v-if="row.type == '2'"></i>
        </el-tag>
      </template>
    </avue-crud>
@@ -59,400 +62,455 @@
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/recordk/recordk";
  import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/recordk/recordk";
import { mapGetters } from "vuex";
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        option: {
          height:'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          labelWidth:130,
          selection: true,
          dialogClickModal: false,
          column: [
            {
              label: "社会信用代码",
              prop: "creditcode",
              rules: [{
export default {
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: true,
        viewBtn: true,
        menuWidth: 280,
        labelWidth: 130,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "社会信用代码",
            prop: "creditcode",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur"
              }]
            },
            {
              label: "企业名称",
              prop: "enterprisename",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业名称",
            prop: "enterprisename",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur"
              }]
            },
            {
              label: "法定代表人",
              prop: "representative",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur"
              }]
            },
            {
              label: "成立日期",
              prop: "establishtime",
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "成立日期",
            prop: "establishtime",
            overHidden: true,
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入成立日期",
                trigger: "blur"
              }]
            },
            {
              label: "注册资本",
              prop: "registeredcapital",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur"
              }]
            },
            {
              label: "组织机构代码",
              hide: true,
              prop: "organizationcode",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            hide: true,
            prop: "organizationcode",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur"
              }]
            },
            {
              label: "工商注册号",
              prop: "registrationnumber",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            prop: "registrationnumber",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur"
              }]
            },
            {
              label: "纳税人识别号",
              prop: "identificationnumber",
              hide: true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur"
              }]
            },
            {
              label: "企业类型",
              prop: "enterprises",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            prop: "enterprises",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur"
              }]
            },
            {
              label: "注册地址",
              prop: "address",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur"
              }]
            },
            {
              label: "所属地区",
              prop: "region",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur"
              }]
            },
            {
              label: "所属机构",
              prop: "deptid",
              type: "select",
              hide: true,
              dicUrl: "/api/blade-system/dept/selectIn",
              props: {
                label: "deptname",
                value: "deptid"
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
            {
              label: "登记机关",
              prop: "registration",
              rules: [{
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur"
              }]
            },
            {
              label: "所属行业",
              prop: "industry",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            prop: "industry",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur"
              }]
            },
            {
              label: "经营范围",
              prop: "business",
              component: 'AvueUeditor',
              hide: true,
              minRows: 6,
              span: 24,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur"
              }]
            },
            {
              label: "单位许可编号",
              hide:true,
              prop: "perid",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "单位许可编号",
            hide: true,
            prop: "perid",
            rules: [
              {
                required: true,
                message: "请输入单位许可编号",
                trigger: "blur"
              }]
            },
            {
              label: "许可发证机关",
              hide:true,
              prop: "offices",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "许可发证机关",
            hide: true,
            prop: "offices",
            rules: [
              {
                required: true,
                message: "请输入许可发证机关",
                trigger: "blur"
              }]
            },
            {
              label: "发证时间",
              prop: "officetime",
              type: "date",
              format: "yyyy-MM-dd HH:mm:ss",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "发证时间",
            prop: "officetime",
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
            rules: [
              {
                required: true,
                message: "请输入发证时间",
                trigger: "blur"
              }]
            },
            {
              label: "审核状态",
              prop: "type",
              addDisplay:false,
              type: "select",
              dicData: [
                {
                  label: "通过",
                  value: '0'
                },
                {
                  label: "不通过",
                  value: '1'
                },
                {
                  label: "待审核",
                  value: '2'
                }
              ],
            },
          ]
        },
        data: []
                trigger: "blur",
              },
            ],
          },
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "通过",
                value: "0",
              },
              {
                label: "不通过",
                value: "1",
              },
              {
                label: "待审核",
                value: "2",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.recordk_add, false),
        viewBtn: this.vaildData(this.permission.recordk_view, false),
        delBtn: this.vaildData(this.permission.recordk_delete, false),
        editBtn: this.vaildData(this.permission.recordk_edit, false),
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.recordk_add, false),
          viewBtn: this.vaildData(this.permission.recordk_view, false),
          delBtn: this.vaildData(this.permission.recordk_delete, false),
          editBtn: this.vaildData(this.permission.recordk_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    methods: {
      handleCredentials(row) {
        this.$router.push({
          path: "/attach/index",
          // redirect: { name: "foo" },
          // query: { row: row },
          query: {deptid: row.deptid, type: '3'},
          // params: { row: row.identificationnumber },
        });
      },
      rowSave(row, done, loading) {
        row.deptid = this.userInfo.dept_id
        add(row).then(() => {
  },
  methods: {
    handleCredentials(row) {
      this.$router.push({
        path: "/attach/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.deptid, type: "3" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          loading();
          window.console.log(error);
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          loading();
          console.log(error);
        });
      },
      rowDel(row) {
        this.$confirm("确定对选择的备案进行审批?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
      );
    },
    rowDel(row) {
      this.$confirm("确定对选择的备案进行审批?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      },
      rowStyle({row, column, rowIndex}) {
        if (row.dtype != null && row.dtype != "") {
          if (row.dtype == '2') {
            return {
              color: "#F34A4A"
            };
          }
          if(row.dtype=='1'){
            return {
              color: "#F48F57"
            };
          }
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    rowStyle({ row, column, rowIndex }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A",
          };
        }
        if (row.dtype == "1") {
          return {
            color: "#F48F57",
          };
        }
      }
    }
  };
    },
  },
};
</script>
<style scoped>
.dtype{
.dtype {
  width: 80px;
}
.dx{
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -460,9 +518,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #DFDFDF;
  background: #dfdfdf;
}
.zc{
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -470,9 +528,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29C093;
  background: #29c093;
}
.yj{
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -480,9 +538,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #F34A4A;
  background: #f34a4a;
}
.gz{
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -490,13 +548,12 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #F48F57;
  background: #f48f57;
}
.el-tag{
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
</style>
src/views/regulatoryInformation/index.vue
@@ -6,7 +6,7 @@
 * menu-name 监管信息
 */
<template>
  <basic-container>
  <basic-container class="regulatoryInformation">
    <avue-crud
      :option="option"
      :table-loading="loading"
@@ -100,6 +100,7 @@
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        searchShowBtn: false,
        index: true,
        viewBtn: true,
        dialogClickModal: false,
src/views/resource/attach.vue
@@ -1,22 +1,24 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               @row-click="rowClick"
               @row-del="rowDel"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-click="rowClick"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot="menuLeft">
        <!--        <el-button type="primary"-->
        <!--                   size="small"-->
@@ -32,31 +34,39 @@
        <!--        </el-button>-->
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button type="text"
                   icon="el-icon-download"
                   size="small"
                   @click="handleDownload(scope.row)">下载
        <el-button
          type="text"
          icon="el-icon-download"
          size="small"
          @click="handleDownload(scope.row)"
          >下载
        </el-button>
      </template>
      <template slot-scope="{row}"
                slot="attachSize">
      <template slot-scope="{ row }" slot="attachSize">
        <el-tag>{{ `${row.attachSize} KB` }}</el-tag>
      </template>
    </avue-crud>
    <el-dialog title="附件管理"
               append-to-body
               :visible.sync="attachBox"
               width="555px">
      <avue-form ref="form" :option="attachOption" v-model="attachForm" :upload-after="uploadAfter">
    <el-dialog
      title="附件管理"
      append-to-body
      :visible.sync="attachBox"
      width="555px"
    >
      <avue-form
        ref="form"
        :option="attachOption"
        v-model="attachForm"
        :upload-after="uploadAfter"
      >
      </avue-form>
    </el-dialog>
  </basic-container>
</template>
<script>
import {getList, getDetail, remove} from "@/api/resource/attach";
import {mapGetters} from "vuex";
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
import { getList, getDetail, remove } from "@/api/resource/attach";
import { mapGetters } from "vuex";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
export default {
  components: { ElImageViewer },
@@ -65,22 +75,23 @@
      form: {},
      query: {},
      loading: true,
      imgUrl: '',
      imgUrl: "",
      showViewer: false, // 显示查看器
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
        total: 0,
      },
      attachBox: false,
      selectionList: [],
      option: {
        height: 'auto',
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        headerAlign: 'center',
        searchShowBtn: false,
        headerAlign: "center",
        border: true,
        index: true,
        viewBtn: true,
@@ -90,60 +101,72 @@
          {
            label: "附件地址",
            prop: "link",
            rules: [{
              required: true,
              message: "请输入附件地址",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入附件地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件域名",
            prop: "domain",
            search: true,
            rules: [{
              required: true,
              message: "请输入附件域名",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入附件域名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件名称",
            prop: "name",
            search: true,
            rules: [{
              required: true,
              message: "请输入附件名称",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入附件名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件原名",
            prop: "originalName",
            search: true,
            rules: [{
              required: true,
              message: "请输入附件原名",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入附件原名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件拓展名",
            prop: "extension",
            rules: [{
              required: true,
              message: "请输入附件拓展名",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入附件拓展名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件大小",
            prop: "attachSize",
            slot: true,
            rules: [{
              required: true,
              message: "请输入附件大小",
              trigger: "blur"
            }]
            rules: [
              {
                required: true,
                message: "请输入附件大小",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
@@ -152,7 +175,7 @@
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid"
              value: "deptid",
            },
          },
          {
@@ -164,23 +187,23 @@
            dicData: [
              {
                label: "许可审批",
                value: '0'
                value: "0",
              },
              {
                label: "备案",
                value: '1'
                value: "1",
              },
              {
                label: "撤销",
                value: '2'
                value: "2",
              },
              {
                label: "跨区备案",
                value: '3'
              }
                value: "3",
              },
            ],
          },
        ]
        ],
      },
      data: [],
      attachForm: {},
@@ -189,64 +212,64 @@
        emptyBtn: false,
        column: [
          {
            label: '附件上传',
            prop: 'attachFile',
            type: 'upload',
            label: "附件上传",
            prop: "attachFile",
            type: "upload",
            drag: true,
            loadText: '模板上传中,请稍等',
            loadText: "模板上传中,请稍等",
            span: 24,
            propsHttp: {
              res: 'data'
              res: "data",
            },
            action: "/api/blade-resource/oss/endpoint/put-file-attach?deptid="
          }
        ]
      }
            action: "/api/blade-resource/oss/endpoint/put-file-attach?deptid=",
          },
        ],
      },
    };
  },
  created() {
    var flag = false, i = 0, ind = null
    var flag = false,
      i = 0,
      ind = null;
    this.$store.state.tags.tagList.forEach((item, index) => {
      if (item.label == "附件上传") {
        if (flag == false) {
          ind = index
          flag = true
          ind = index;
          flag = true;
        }
        i++
        i++;
      }
    })
    });
    if (i > 1) {
      this.$store.state.tags.tagList.splice(ind, 1)
      this.$store.state.tags.tagList.splice(ind, 1);
    }
    var deptid = this.$route.query.deptid;
    var type = this.$route.query.type;
    this.attachOption.column[0].action += deptid + "&type=" + type
    this.attachOption.column[0].action += deptid + "&type=" + type;
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: false,
        editBtn: false,
        viewBtn: false,
        delBtn: this.vaildData(this.permission.attach_delete, false)
        delBtn: this.vaildData(this.permission.attach_delete, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    }
    },
  },
  methods: {
    rowClick(row) {
      var that = this;
      that.imgUrl = row.link
      this.showViewer = true
      that.imgUrl = row.link;
      this.showViewer = true;
    },
    handleUpload() {
      this.attachBox = true;
@@ -264,7 +287,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
@@ -273,7 +296,7 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
        });
    },
@@ -285,7 +308,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
@@ -294,14 +317,14 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then(res => {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
@@ -335,7 +358,13 @@
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.$route.query.deptid, this.$route.query.type).then(res => {
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query),
        this.$route.query.deptid,
        this.$route.query.type
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
@@ -343,7 +372,7 @@
        this.selectionClear();
      });
    },
  }
  },
};
</script>
src/views/resource/oss.vue
@@ -1,415 +1,458 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               v-model="form"
               ref="crud"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
               :before-open="beforeOpen"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
  <basic-container class="oos">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      :before-open="beforeOpen"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.oss_delete"
                   @click="handleDelete">删 除
        <el-button
          type="danger"
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.oss_delete"
          @click="handleDelete"
          >删 除
        </el-button>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button type="text"
                   icon="el-icon-video-play"
                   size="small"
                   v-if="userInfo.role_name.includes('admin')"
                   @click="handleDebug(scope.row)">调试
        <el-button
          type="text"
          icon="el-icon-video-play"
          size="small"
          v-if="userInfo.role_name.includes('admin')"
          @click="handleDebug(scope.row)"
          >调试
        </el-button>
        <el-button type="text"
                   icon="el-icon-circle-check"
                   size="small"
                   v-if="permission.oss_enable"
                   @click.stop="handleEnable(scope.row)">启用
        <el-button
          type="text"
          icon="el-icon-circle-check"
          size="small"
          v-if="permission.oss_enable"
          @click.stop="handleEnable(scope.row)"
          >启用
        </el-button>
      </template>
      <template slot-scope="{row}"
                slot="status">
        <el-tag>{{row.statusName}}</el-tag>
      <template slot-scope="{ row }" slot="status">
        <el-tag>{{ row.statusName }}</el-tag>
      </template>
      <template slot-scope="{row}"
                slot="category">
        <el-tag>{{row.categoryName}}</el-tag>
      <template slot-scope="{ row }" slot="category">
        <el-tag>{{ row.categoryName }}</el-tag>
      </template>
    </avue-crud>
    <el-dialog title="对象存储上传调试"
               append-to-body
               :visible.sync="box"
               width="550px">
      <avue-form ref="form" :option="debugOption" v-model="debugForm" @submit="handleSubmit"/>
    <el-dialog
      title="对象存储上传调试"
      append-to-body
      :visible.sync="box"
      width="550px"
    >
      <avue-form
        ref="form"
        :option="debugOption"
        v-model="debugForm"
        @submit="handleSubmit"
      />
    </el-dialog>
  </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove, enable} from "@/api/resource/oss";
  import {mapGetters} from "vuex";
  import func from "@/util/func";
import {
  getList,
  getDetail,
  add,
  update,
  remove,
  enable,
} from "@/api/resource/oss";
import { mapGetters } from "vuex";
import func from "@/util/func";
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        box: false,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        option: {
          height: 'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          menuWidth: 300,
          labelWidth: 100,
          dialogWidth: 880,
          dialogClickModal: false,
          column: [
            {
              label: "分类",
              type: "radio",
              value: 1,
              span: 24,
              width: 100,
              searchLabelWidth: 50,
              row: true,
              dicUrl: "/api/blade-system/dict/dictionary?code=oss",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              dataType: "number",
              slot: true,
              prop: "category",
              search: true,
              rules: [{
export default {
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      box: false,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: true,
        searchShowBtn: false,
        viewBtn: true,
        selection: true,
        menuWidth: 300,
        labelWidth: 100,
        dialogWidth: 880,
        dialogClickModal: false,
        column: [
          {
            label: "分类",
            type: "radio",
            value: 1,
            span: 24,
            width: 100,
            searchLabelWidth: 50,
            row: true,
            dicUrl: "/api/blade-system/dict/dictionary?code=oss",
            props: {
              label: "dictValue",
              value: "dictKey",
            },
            dataType: "number",
            slot: true,
            prop: "category",
            search: true,
            rules: [
              {
                required: true,
                message: "请选择分类",
                trigger: "blur"
              }]
            },
            {
              label: "资源编号",
              prop: "ossCode",
              span: 24,
              width: 120,
              search: true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "资源编号",
            prop: "ossCode",
            span: 24,
            width: 120,
            search: true,
            rules: [
              {
                required: true,
                message: "请输入资源编号",
                trigger: "blur"
              }]
            },
            {
              label: "资源地址",
              prop: "endpoint",
              span: 24,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "资源地址",
            prop: "endpoint",
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入资源地址",
                trigger: "blur"
              }]
            },
            {
              label: "空间名",
              prop: "bucketName",
              span: 24,
              width: 120,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "空间名",
            prop: "bucketName",
            span: 24,
            width: 120,
            rules: [
              {
                required: true,
                message: "请输入空间名",
                trigger: "blur"
              }]
            },
            {
              label: "accessKey",
              prop: "accessKey",
              span: 24,
              search: true,
              width: 200,
              overHidden: true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "accessKey",
            prop: "accessKey",
            span: 24,
            search: true,
            width: 200,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入accessKey",
                trigger: "blur"
              }]
            },
            {
              label: "secretKey",
              prop: "secretKey",
              span: 24,
              width: 200,
              overHidden: true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "secretKey",
            prop: "secretKey",
            span: 24,
            width: 200,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入secretKey",
                trigger: "blur"
              }]
            },
            {
              label: "appId",
              prop: "appId",
              span: 24,
              hide: true,
              display: false,
            },
            {
              label: "region",
              prop: "region",
              span: 24,
              hide: true,
              display: false,
            },
            {
              label: "是否启用",
              prop: "status",
              span: 24,
              width: 80,
              align: "center",
              slot: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
            },
            {
              label: "备注",
              prop: "remark",
              span: 24,
              hide: true,
            },
          ]
        },
        data: [],
        debugForm: {
          code: '',
        },
        debugOption: {
          submitText: "提交",
          column: [
            {
              label: "资源编号",
              prop: "code",
              disabled: true,
              span: 24,
            },
            {
              label: "上传背景",
              prop: "backgroundUrl",
              type: 'upload',
              listType: 'picture-img',
              action: '/api/blade-resource/oss/endpoint/put-file',
              propsHttp: {
                res: 'data',
                url: 'link',
                trigger: "blur",
              },
              span: 24,
            ],
          },
          {
            label: "appId",
            prop: "appId",
            span: 24,
            hide: true,
            display: false,
          },
          {
            label: "region",
            prop: "region",
            span: 24,
            hide: true,
            display: false,
          },
          {
            label: "是否启用",
            prop: "status",
            span: 24,
            width: 80,
            align: "center",
            slot: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
          },
          {
            label: "备注",
            prop: "remark",
            span: 24,
            hide: true,
          },
        ],
      },
      data: [],
      debugForm: {
        code: "",
      },
      debugOption: {
        submitText: "提交",
        column: [
          {
            label: "资源编号",
            prop: "code",
            disabled: true,
            span: 24,
          },
          {
            label: "上传背景",
            prop: "backgroundUrl",
            type: "upload",
            listType: "picture-img",
            action: "/api/blade-resource/oss/endpoint/put-file",
            propsHttp: {
              res: "data",
              url: "link",
            },
          ]
            span: 24,
          },
        ],
      },
    };
  },
  watch: {
    "form.category"() {
      const category = func.toInt(this.form.category);
      this.$refs.crud.option.column.filter((item) => {
        if (item.prop === "appId") {
          item.display = category === 4;
        }
        if (item.prop === "region") {
          item.display = category === 4;
        }
      });
    },
    "debugForm.code"() {
      const column = this.findObject(this.debugOption.column, "backgroundUrl");
      column.action = `/api/blade-resource/oss/endpoint/put-file?code=${this.debugForm.code}`;
    },
  },
  computed: {
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.oss_add),
        viewBtn: this.vaildData(this.permission.oss_view),
        delBtn: this.vaildData(this.permission.oss_delete),
        editBtn: this.vaildData(this.permission.oss_edit),
      };
    },
    watch: {
      'form.category'() {
        const category = func.toInt(this.form.category);
        this.$refs.crud.option.column.filter(item => {
          if (item.prop === "appId") {
            item.display = category === 4;
          }
          if (item.prop === "region") {
            item.display = category === 4;
          }
        });
      },
      'debugForm.code'() {
        const column = this.findObject(this.debugOption.column, "backgroundUrl");
        column.action = `/api/blade-resource/oss/endpoint/put-file?code=${this.debugForm.code}`;
      }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    computed: {
      ...mapGetters(["userInfo", "permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.oss_add),
          viewBtn: this.vaildData(this.permission.oss_view),
          delBtn: this.vaildData(this.permission.oss_delete),
          editBtn: this.vaildData(this.permission.oss_edit)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
  },
  methods: {
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          window.console.log(error);
          loading();
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      handleEnable(row) {
        this.$confirm("是否确定启用这条配置?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return enable(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      handleDebug(row) {
        this.box = true;
        this.debugForm.code = row.ossCode;
        this.debugForm.backgroundUrl = '';
      },
      handleSubmit(form, done) {
        this.$message({
          type: "success",
          message: `获取到图片地址:[${form.backgroundUrl}]`
        });
        done();
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
        });
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    handleEnable(row) {
      this.$confirm("是否确定启用这条配置?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return enable(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        }
        done();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
          this.$refs.crud.toggleSelection();
        });
    },
    handleDebug(row) {
      this.box = true;
      this.debugForm.code = row.ossCode;
      this.debugForm.backgroundUrl = "";
    },
    handleSubmit(form, done) {
      this.$message({
        type: "success",
        message: `获取到图片地址:[${form.backgroundUrl}]`,
      });
      done();
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
    }
  };
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
  },
};
</script>
src/views/revoke/revoke.vue
@@ -1,55 +1,61 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.revoke_delete"
                   @click="handleDelete">删 除
        <el-button
          type="danger"
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.revoke_delete"
          @click="handleDelete"
          >删 除
        </el-button>
      </template>
      <template slot-scope="{type,size,row}"
                slot="menu">
        <el-button icon="icon-zhengjian"
                   :size="size"
                   :type="type"
                   class="zhengJian-icon"
                   @click.stop="handleCredentials(row)">附件审查</el-button>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="icon-zhengjian"
          :size="size"
          :type="type"
          class="zhengJian-icon"
          @click.stop="handleCredentials(row)"
          >附件审查</el-button
        >
        <el-button
          icon="el-icon-edit"
          :size="size"
          :type="type"
          @click.stop="rowDel(row)"
        >撤销审批
          >撤销审批
        </el-button>
      </template>
      <template class="tdtype" slot-scope="{ row }" slot="type">
        <el-tag class="dtype">
          {{
            row.type == "0" ? "已撤销" : row.type == "1" ? "未撤销":"待撤销"
            row.type == "0" ? "已撤销" : row.type == "1" ? "未撤销" : "待撤销"
          }}
          <i class="gz" v-if="row.type == '0' "></i>
          <i class="yj" v-if="row.type == '1' "></i>
          <i class="zc" v-if="row.type == '2' "></i>
          <i class="gz" v-if="row.type == '0'"></i>
          <i class="yj" v-if="row.type == '1'"></i>
          <i class="zc" v-if="row.type == '2'"></i>
        </el-tag>
      </template>
    </avue-crud>
@@ -57,379 +63,425 @@
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/revoke/revoke";
  import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/revoke/revoke";
import { mapGetters } from "vuex";
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        option: {
          height:'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          labelWidth:130,
          selection: true,
          dialogClickModal: false,
          column: [
            {
              label: "社会信用代码",
              prop: "creditcode",
              hide: true,
              rules: [{
export default {
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        menuWidth: 280,
        index: true,
        viewBtn: true,
        labelWidth: 130,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur"
              }]
            },
            {
              label: "企业名称",
              prop: "enterprisename",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业名称",
            prop: "enterprisename",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur"
              }]
            },
            {
              label: "法定代表人",
              prop: "representative",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur"
              }]
            },
            {
              label: "成立日期",
              prop: "establishtime",
              type: "date",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "成立日期",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入成立日期",
                trigger: "blur"
              }]
            },
            {
              label: "注册资本",
              prop: "registeredcapital",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur"
              }]
            },
            {
              label: "组织机构代码",
              prop: "organizationcode",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur"
              }]
            },
            {
              label: "工商注册号",
              prop: "registrationnumber",
              hide: true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            prop: "registrationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur"
              }]
            },
            {
              label: "纳税人识别号",
              prop: "identificationnumber",
              hide: true,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur"
              }]
            },
            {
              label: "企业类型",
              prop: "enterprises",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            prop: "enterprises",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur"
              }]
            },
            {
              label: "注册地址",
              prop: "address",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur"
              }]
            },
            {
              label: "所属地区",
              prop: "region",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur"
              }]
            },
            {
              label: "登记机关",
              prop: "registration",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur"
              }]
            },
            {
              label: "所属行业",
              prop: "industry",
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            prop: "industry",
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur"
              }]
            },
            {
              label: "所属机构",
              prop: "deptid",
              type: "select",
              hide: true,
              dicUrl: "/api/blade-system/dept/selectIn",
              props: {
                label: "deptname",
                value: "deptid"
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
            {
              label: "撤销原因",
              prop: "reason",
              rules: [{
          },
          {
            label: "撤销原因",
            prop: "reason",
            rules: [
              {
                required: true,
                message: "请输入撤销原因",
                trigger: "blur"
              }]
            },
            {
              label: "审核状态",
              prop: "type",
              addDisplay:false,
              type: "select",
              dicData: [
                {
                  label: "已撤销",
                  value: '0'
                },
                {
                  label: "未撤销",
                  value: '1'
                },
                {
                  label: "待撤销",
                  value: '2'
                }
              ],
            },
            {
              label: "经营范围",
              prop: "business",
              component: 'AvueUeditor',
              hide: true,
              minRows: 6,
              span: 24,
              rules: [{
                trigger: "blur",
              },
            ],
          },
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "已撤销",
                value: "0",
              },
              {
                label: "未撤销",
                value: "1",
              },
              {
                label: "待撤销",
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            overHidden: true,
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur"
              }]
            },
          ]
        },
        data: []
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.revoke_add, false),
        viewBtn: this.vaildData(this.permission.revoke_view, false),
        delBtn: this.vaildData(this.permission.revoke_delete, false),
        editBtn: this.vaildData(this.permission.revoke_edit, false),
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.revoke_add, false),
          viewBtn: this.vaildData(this.permission.revoke_view, false),
          delBtn: this.vaildData(this.permission.revoke_delete, false),
          editBtn: this.vaildData(this.permission.revoke_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    methods: {
      handleCredentials(row) {
        this.$router.push({
          path: "/attach/index",
          // redirect: { name: "foo" },
          // query: { row: row },
          query: {deptid: row.deptid, type: '2'},
          // params: { row: row.identificationnumber },
        });
      },
      rowSave(row, done, loading) {
        row.deptid = this.userInfo.dept_id
        add(row).then(() => {
  },
  methods: {
    handleCredentials(row) {
      this.$router.push({
        path: "/attach/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.deptid, type: "2" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          loading();
          window.console.log(error);
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
            message: "操作成功!",
          });
          done();
        }, error => {
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定对选择的备案进行撤销?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          row.type = "0";
          return update(row);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
      },
      rowDel(row) {
        this.$confirm("确定对选择的备案进行撤销?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
          .then(() => {
            row.type='0'
            return update(row);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    rowStyle({row, column, rowIndex}) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == '2') {
          return {
            color: "#F34A4A"
          };
        }
        if(row.dtype=='1'){
          return {
            color: "#F48F57"
          };
        }
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
  },
  rowStyle({ row, column, rowIndex }) {
    if (row.dtype != null && row.dtype != "") {
      if (row.dtype == "2") {
        return {
          color: "#F34A4A",
        };
      }
      if (row.dtype == "1") {
        return {
          color: "#F48F57",
        };
      }
    }
  };
  },
};
</script>
<style scoped>
.dtype{
.dtype {
  width: 80px;
}
.dx{
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -437,9 +489,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #DFDFDF;
  background: #dfdfdf;
}
.zc{
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -447,9 +499,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29C093;
  background: #29c093;
}
.yj{
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -457,9 +509,9 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #F34A4A;
  background: #f34a4a;
}
.gz{
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
@@ -467,13 +519,12 @@
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #F48F57;
  background: #f48f57;
}
.el-tag{
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
</style>
src/views/securityCompany/armed.vue
@@ -6,275 +6,285 @@
 * menu-name 武装守押公司查询
 */
<template>
    <basic-container>
        <avue-crud :option="option"
                   :table-loading="loading"
                   :data="data"
                   :page.sync="page"
                   :permission="permissionList"
                   :before-open="beforeOpen"
                   v-model="form"
                   ref="crud"
                   @row-update="rowUpdate"
                   @row-save="rowSave"
                   @row-del="rowDel"
                   @search-change="searchChange"
                   @search-reset="searchReset"
                   @selection-change="selectionChange"
                   @current-change="currentChange"
                   @size-change="sizeChange"
                   @refresh-change="refreshChange"
                   @row-click="handleRowClick"
                   @on-load="onLoad">
        </avue-crud>
    </basic-container>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @row-click="handleRowClick"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/securityCompany/armed";
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/securityCompany/armed";
import { mapGetters } from "vuex";
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 6,
        index: true,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "公司名称",
            prop: "enterprisename",
            search: true,
            searchSpan: 4,
            display: false,
          },
          {
            label: "法定代表人",
            prop: "representative",
            display: false,
            width: 120,
          },
          {
            label: "成立日期",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            mock: {
              type: "datetime",
              format: "yyyy-MM-dd",
            },
            selectionList: [],
            option: {
                // 操作栏多余按钮去除
                delBtn: false,
                editBtn: false,
                addBtn: false,
                selection: false,
                menu: false,
                align: 'center',
                height: 'auto',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                index: true,
                viewBtn: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "公司名称",
                        prop: "enterprisename",
                        search: true,
                        searchSpan: 4,
                        display: false,
                    },
                    {
                        label: "法定代表人",
                        prop: "representative",
                        display: false,
                        width: 120
                    },
                    {
                        label: "成立日期",
                        prop: "establishtime",
                        type: "date",
                        format: 'yyyy-MM-dd',
                        valueFormat: 'yyyy-MM-dd',
                        mock: {
                            type: 'datetime',
                            format: 'yyyy-MM-dd'
                        },
                        search: true,
                        searchSpan: 4,
                        display: false,
                        width: 180
                    },
                    {
                        label: "注册资金",
                        prop: "registeredcapital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "实缴资金",
                        prop: "capital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "公司类型",
                        prop: "enterprises",
                        display: false,
                    },
                    {
                        label: "注册地址",
                        prop: "address",
                        display: false,
                        width: 200
                    }
                ]
                ,
                group: [
                    {
                        label: '详细信息',
                        prop: 'baseInfo',
                        icon: 'el-icon-user-solid',
                        column: [
                            {
                                label: "公司名称",
                                prop: "enterprisename",
                                display: false,
                            },
                        ]
                    },
                    {
                        label: '详细信息',
                        prop: 'detailInfo',
                        icon: 'el-icon-s-order',
                        column: [
                        ]
                    },
                    {
                        label: '职责信息',
                        prop: 'dutyInfo',
                        icon: 'el-icon-s-custom',
                        column: [
                        ]
                    },
                ]
            },
            data: []
        };
            search: true,
            searchSpan: 4,
            display: false,
            width: 180,
          },
          {
            label: "注册资金",
            prop: "registeredcapital",
            display: false,
            width: 200,
          },
          {
            label: "实缴资金",
            prop: "capital",
            display: false,
            width: 200,
          },
          {
            label: "公司类型",
            prop: "enterprises",
            display: false,
          },
          {
            label: "注册地址",
            prop: "address",
            display: false,
            width: 200,
          },
        ],
        group: [
          {
            label: "详细信息",
            prop: "baseInfo",
            icon: "el-icon-user-solid",
            column: [
              {
                label: "公司名称",
                prop: "enterprisename",
                display: false,
              },
            ],
          },
          {
            label: "详细信息",
            prop: "detailInfo",
            icon: "el-icon-s-order",
            column: [],
          },
          {
            label: "职责信息",
            prop: "dutyInfo",
            icon: "el-icon-s-custom",
            column: [],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
        viewBtn: this.vaildData(this.permission.post_view, false),
        delBtn: this.vaildData(this.permission.post_delete, false),
        editBtn: this.vaildData(this.permission.post_edit, false),
      };
    },
    computed: {
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.post_add, false),
                viewBtn: this.vaildData(this.permission.post_view, false),
                delBtn: this.vaildData(this.permission.post_delete, false),
                editBtn: this.vaildData(this.permission.post_edit, false)
            };
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        ids () {
            let ids = [];
            this.selectionList.forEach(ele => {
                ids.push(ele.id);
            });
            return ids.join(",");
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    methods: {
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id);
                })
                .then(() => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    });
                });
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getDetail(this.form.id).then(res => {
                    this.form = res.data.data;
                });
            }
            done();
        },
        searchReset () {
            this.query = {};
            this.onLoad(this.page);
        },
        searchChange (params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
        },
        selectionChange (list) {
            this.selectionList = list;
        },
        selectionClear () {
            this.selectionList = [];
            this.$refs.crud.toggleSelection();
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage;
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange () {
            this.onLoad(this.page, this.query);
        },
        onLoad (page, params = {}) {
            this.loading = true;
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query), 3).then(res => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
                this.selectionClear();
            });
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query),
        3
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
        // 行单击
        handleRowClick (row) {
            // delete (row["name"]);
            var obj = row
            obj["name"] = "保安公司详细资料"
            this.$router.push({
                path: `/securityCompany/index`,
                query: obj,
            });
        },
    }
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安公司详细资料";
      this.$router.push({
        path: `/securityCompany/index`,
        query: obj,
      });
    },
  },
};
</script>
src/views/securityCompany/companyDetails.vue
@@ -6,635 +6,563 @@
 * menu-name 保安公司详细资料
 */
<template>
    <el-row class="morpheus-box">
        <el-col :span="24">
            <el-card>
                <div class="card-body">
                    <el-tabs v-model="activeName"
                             @tab-click="handleClick">
                        <el-tab-pane label="详细信息"
                                     name="first">
  <el-row class="morpheus-box">
    <el-col :span="24">
      <el-card>
        <div class="card-body">
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="基本信息" name="first">
              <el-form
                :model="form"
                label-position="right"
                size="mini"
                label-width="100px"
              >
                <el-row>
                  <el-col span="12">
                    <el-form-item label="公司名称">
                      <el-input
                        disabled="true"
                        v-model="form.enterprisename"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="法定代表人">
                      <el-input
                        disabled="true"
                        v-model="form.representative"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                            <el-form :model="form"
                                     label-position="right"
                                     size="mini"
                                     label-width="100px">
                <el-row>
                  <el-col span="12">
                    <el-col span="12">
                      <el-form-item label="成立日期">
                        <el-input
                          disabled="true"
                          v-model="form.establishtime"
                          autocomplete="off"
                        ></el-input>
                      </el-form-item>
                    </el-col>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="注册资金">
                      <el-input
                        disabled="true"
                        v-model="form.registeredcapital"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="公司名称">
                                            <el-input disabled="true"
                                                      v-model="form.enterprisename"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="法定代表人">
                                            <el-input disabled="true"
                                                      v-model="form.representative"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                <el-row>
                  <el-col span="12">
                    <el-form-item label="实缴资金">
                      <el-input
                        disabled="true"
                        v-model="form.capital"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="组织机构代码">
                      <el-input
                        disabled="true"
                        v-model="form.organizationcode"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-col span="12">
                                            <el-form-item label="成立日期">
                                                <el-input disabled="true"
                                                          v-model="form.establishtime"
                                                          autocomplete="off"></el-input>
                                            </el-form-item>
                                        </el-col>
                <el-row>
                  <el-col span="12">
                    <el-form-item label="工商注册号">
                      <el-input
                        disabled="true"
                        v-model="form.registrationnumber"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="公司类型">
                      <el-input
                        disabled="true"
                        v-model="form.enterprises"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="注册资金">
                                            <el-input disabled="true"
                                                      v-model="form.registeredcapital"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                <el-row>
                  <el-col span="12">
                    <el-form-item label="所属地区">
                      <el-input
                        disabled="true"
                        v-model="form.region"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="所属行业">
                      <el-input
                        disabled="true"
                        v-model="form.industry"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="实缴资金">
                                            <el-input disabled="true"
                                                      v-model="form.capital"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="组织机构代码">
                                            <el-input disabled="true"
                                                      v-model="form.organizationcode"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                <el-row>
                  <el-col span="12">
                    <el-form-item label="登记机关">
                      <el-input
                        disabled="true"
                        v-model="form.registration"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col span="12">
                    <el-form-item label="注册地址">
                      <el-input
                        disabled="true"
                        v-model="form.address"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="工商注册号">
                                            <el-input disabled="true"
                                                      v-model="form.registrationnumber"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="公司类型">
                                            <el-input disabled="true"
                                                      v-model="form.enterprises"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="所属地区">
                                            <el-input disabled="true"
                                                      v-model="form.region"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="所属行业">
                                            <el-input disabled="true"
                                                      v-model="form.industry"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col span="12">
                                        <el-form-item label="登记机关">
                                            <el-input disabled="true"
                                                      v-model="form.registration"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                    <el-col span="12">
                                        <el-form-item label="注册地址">
                                            <el-input disabled="true"
                                                      v-model="form.address"
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col span="24">
                                        <el-form-item label="经营范围">
                                            <el-input type="textarea"
                                                      disabled="true"
                                                      v-model="form.business"
                                                      resize='none'
                                                      autocomplete="off"></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="投资人详情"
                                     name="second">
                            <avue-crud class="company-box"
                                       :option="investorOption"
                                       :search.sync="investorSearch"
                                       :table-loading="investorLoading"
                                       :data="investorData"
                                       ref="investorCrud"
                                       :page.sync="investorPage"
                                       @on-load="investorOnLoad"
                                       @selection-change="investorSelectionChange"
                                       @search-change="investorSearchChange"
                                       @search-reset="investorSearchReset"
                                       @current-change="investorCurrentChange"
                                       @size-change="investorSizeChange">
                            </avue-crud>
                        </el-tab-pane>
                        <el-tab-pane label="管理人详情"
                                     name="third">
                            <avue-crud class="company-box"
                                       :option="manageOption"
                                       :search.sync="manageSearch"
                                       :table-loading="manageLoading"
                                       :data="manageData"
                                       ref="manageCrud"
                                       :page.sync="managePage"
                                       @on-load="manageOnLoad"
                                       @selection-change="manageSelectionChange"
                                       @search-change="manageSearchChange"
                                       @search-reset="manageSearchReset"
                                       @current-change="manageCurrentChange"
                                       @size-change="manageSizeChange">
                            </avue-crud>
                        </el-tab-pane>
                        <!-- <el-tab-pane label="获取荣誉"
                                     name="fourth">
                            <el-table :data="honorchData"
                                      style="width: 100%">
                                <el-table-column prop="name"
                                                 label="姓名"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="cardid"
                                                 label="身份证号"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="honor"
                                                 align="center"
                                                 label="荣誉">
                                </el-table-column>
                                <el-table-column prop="honortime"
                                                 align="center"
                                                 label="获取时间">
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="培训相关"
                                     name="fifth">
                            <el-table :data="trainData"
                                      style="width: 100%">
                                <el-table-column prop="rname"
                                                 label="姓名"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="sex"
                                                 label="性别"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="cardid"
                                                 label="身份证号"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="train"
                                                 align="center"
                                                 label="培训单位">
                                </el-table-column>
                                <el-table-column prop="traincontent"
                                                 align="center"
                                                 label="培训内容">
                                </el-table-column>
                                <el-table-column prop="traintime"
                                                 align="center"
                                                 label="培训时间">
                                </el-table-column>
                                <el-table-column prop="trainaddrss"
                                                 align="center"
                                                 label="培训地址">
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="成绩相关"
                                     name="sixth">
                            <el-table :data="examinationData"
                                      style="width: 100%">
                                <el-table-column prop="rname"
                                                 label="姓名"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="examinationbegintime"
                                                 label="考试开始时间"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="examinationendtime"
                                                 label="开始结束时间"
                                                 align="center">
                                </el-table-column>
                                <el-table-column prop="examinationtype"
                                                 align="center"
                                                 label="考试类别">
                                </el-table-column>
                                <el-table-column prop="examinationc"
                                                 align="center"
                                                 label="考试成绩">
                                </el-table-column>
                                <el-table-column prop="examinationaddress"
                                                 align="center"
                                                 label="考试地点">
                                </el-table-column>
                            </el-table>
                        </el-tab-pane> -->
                    </el-tabs>
                </div>
            </el-card>
        </el-col>
    </el-row>
                <el-row>
                  <el-col span="24">
                    <el-form-item label="经营范围">
                      <el-input
                        type="textarea"
                        disabled="true"
                        v-model="form.business"
                        resize="none"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </el-tab-pane>
            <el-tab-pane label="投资人信息" name="second">
              <avue-crud
                class="company-box"
                :option="investorOption"
                :search.sync="investorSearch"
                :table-loading="investorLoading"
                :data="investorData"
                ref="investorCrud"
                :page.sync="investorPage"
                @on-load="investorOnLoad"
                @selection-change="investorSelectionChange"
                @search-change="investorSearchChange"
                @search-reset="investorSearchReset"
                @current-change="investorCurrentChange"
                @size-change="investorSizeChange"
              >
              </avue-crud>
            </el-tab-pane>
            <el-tab-pane label="管理人信息" name="third">
              <avue-crud
                class="company-box"
                :option="manageOption"
                :search.sync="manageSearch"
                :table-loading="manageLoading"
                :data="manageData"
                ref="manageCrud"
                :page.sync="managePage"
                @on-load="manageOnLoad"
                @selection-change="manageSelectionChange"
                @search-change="manageSearchChange"
                @search-reset="manageSearchReset"
                @current-change="manageCurrentChange"
                @size-change="manageSizeChange"
              >
              </avue-crud>
            </el-tab-pane>
            <el-tab-pane label="装备信息" name="fourth">
              <equipment></equipment>
            </el-tab-pane>
            <el-tab-pane label="保安员信息" name="fifth">
              <staff></staff>
            </el-tab-pane>
            <el-tab-pane label="处罚信息" name="sixth">
              <punish></punish>
            </el-tab-pane>
            <el-tab-pane label="服务对象" name="seventh">
              <service></service>
            </el-tab-pane>
            <el-tab-pane label="其他附件" name="eighth">
              其他附件
              <!-- <equipment></equipment> -->
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>
<script>
import {
    manifestationList,
    dispatchList,
    honorchList,
    trainList,
    examinationList,
    getInvestorList,
    getManageList
  manifestationList,
  dispatchList,
  honorchList,
  trainList,
  examinationList,
  getInvestorList,
  getManageList,
} from "@/api/securityCompany/companyDetails";
import equipment from "./computents/equipment.vue"; //装备管理
import staff from "./computents/staff.vue"; //保安员信息
import punish from "./computents/punish.vue"; //处罚信息
import service from "./computents/service.vue"; //服务对象
// import manage from "./computents/manage.vue"; //其他附件
export default {
    data () {
        return {
            activeName: 'first',
            form: {},
            manifestationData: [],
            dispatchData: [],
            honorchData: [],
            trainData: [],
            examinationData: [],
  components: {
    equipment: equipment,
    staff: staff,
    punish: punish,
    service: service,
  },
  data() {
    return {
      activeName: "first",
      form: {},
      manifestationData: [],
      dispatchData: [],
      honorchData: [],
      trainData: [],
      examinationData: [],
      investorOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchShowBtn: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
            investorOption: {
                // 操作栏多余按钮去除
                delBtn: false,
                editBtn: false,
                addBtn: false,
                selection: false,
                menu: false,
                align: 'center',
                height: 'auto',
                calcHeight: 250,
                tip: false,
                searchShow: false,
                searchMenuSpan: 4,
                index: false,
                viewBtn: true,
                //dialogType: 'drawer',
                dialogClickModal: false,
                // 操作栏宽度
                menuWidth: 156,
                column: [
                    {
                        label: "投资人姓名",
                        prop: "shareholder",
                        slot: true,
                        display: false,
                    },
                    {
                        label: "投资比例",
                        prop: "shareholdingratio",
                        slot: true,
                        display: false,
                        formatter: function (row, value) {
                            return value = value + "%"
                        }
                    },
                    {
                        label: "出资金额",
                        prop: "capital",
                        slot: true,
                        display: false,
                        formatter: function (row, value) {
                            return value = value + "万元"
                        }
                    },
                    {
                        label: "投资时间",
                        prop: "capitaltime",
                        slot: true,
                        display: false
                    },
                    {
                        label: "身份证号",
                        prop: "cardid",
                        slot: true,
                        display: false,
                    },
                    {
                        label: "联系电话",
                        prop: "cell",
                        slot: true,
                        display: false,
                    },
                ]
        column: [
          {
            label: "投资人姓名",
            prop: "shareholder",
            slot: true,
            display: false,
          },
          {
            label: "投资比例",
            prop: "shareholdingratio",
            slot: true,
            display: false,
            formatter: function (row, value) {
              return (value = value + "%");
            },
            investorSearch: {},
            investorLoading: true,
            investorData: [],
            investorPage: {
                pageSize: 10,
                currentPage: 1,
                total: 0
          },
          {
            label: "出资金额",
            prop: "capital",
            slot: true,
            display: false,
            formatter: function (row, value) {
              return (value = value + "万元");
            },
            investorQuery: {},
            investorSelectionList: [],
          },
          {
            label: "投资时间",
            prop: "capitaltime",
            slot: true,
            display: false,
          },
          {
            label: "身份证号",
            prop: "cardid",
            slot: true,
            display: false,
          },
          {
            label: "联系电话",
            prop: "cell",
            slot: true,
            display: false,
          },
        ],
      },
      investorSearch: {},
      investorLoading: true,
      investorData: [],
      investorPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      investorQuery: {},
      investorSelectionList: [],
      manageOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        searchShowBtn: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
            manageOption: {
                // 操作栏多余按钮去除
                delBtn: false,
                editBtn: false,
                addBtn: false,
                selection: false,
                menu: false,
        column: [
          {
            label: "管理人姓名",
            prop: "name",
            slot: true,
            display: false,
          },
          {
            label: "职务",
            prop: "post",
            slot: true,
            display: false,
          },
          {
            label: "身份证号",
            prop: "cardid",
            slot: true,
            display: false,
          },
          {
            label: "联系电话",
            prop: "cell",
            slot: true,
            display: false,
          },
        ],
      },
      manageSearch: {},
      manageLoading: true,
      manageData: [],
      managePage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      manageQuery: {},
      manageSelectionList: [],
    };
  },
  created() {
    var flag = false,
      i = 0,
      ind = null;
                align: 'center',
                height: 'auto',
                calcHeight: 250,
                tip: false,
                searchShow: false,
                searchMenuSpan: 4,
                index: false,
                viewBtn: true,
                //dialogType: 'drawer',
                dialogClickModal: false,
                // 操作栏宽度
                menuWidth: 156,
                column: [
                    {
                        label: "管理人姓名",
                        prop: "name",
                        slot: true,
                        display: false,
                    },
                    {
                        label: "职务",
                        prop: "post",
                        slot: true,
                        display: false,
                    },
                    {
                        label: "身份证号",
                        prop: "cardid",
                        slot: true,
                        display: false,
                    },
                    {
                        label: "联系电话",
                        prop: "cell",
                        slot: true,
                        display: false,
                    }
                ]
            },
            manageSearch: {},
            manageLoading: true,
            manageData: [],
            managePage: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            manageQuery: {},
            manageSelectionList: [],
    this.$store.state.tags.tagList.forEach((item, index) => {
      if (item.label == "保安详细资料") {
        if (flag == false) {
          ind = index;
          flag = true;
        }
    },
    created () {
        var flag = false, i = 0, ind = null
        this.$store.state.tags.tagList.forEach((item, index) => {
            if (item.label == "保安详细资料") {
                if (flag == false) {
                    ind = index
                    flag = true
                }
                i++
            }
        })
        if (i > 1) {
            this.$store.state.tags.tagList.splice(ind, 1)
        }
        this.form = this.$route.query;
        console.log(this.form, 1)
    },
    mounted () {
        // this.$store.state.tags.tag.label = '保安详细资料'
    },
    methods: {
        handleClick (tab) {
            if (tab.index == 1) {
                this.investorSearchReset()
            } else if (tab.index == 2) {
                this.manageSearchReset()
            } else if (tab.index == 3) {
                this.getHonorchData()
            } else if (tab.index == 4) {
                this.getTrainData()
            } else if (tab.index == 5) {
                this.getExaminationData()
            }
        },
        getManifestationData () {
            manifestationList(this.form.cardid).then(res => {
                this.manifestationData = res.data.data.records
                this.manifestationData.forEach(item => {
                    item.name = this.form.realName
                    item.time = item.time.substring(0, 10)
                })
            })
        },
        getDispatchData () {
            dispatchList(this.form.cardid).then(res => {
                this.dispatchData = res.data.data.records
            })
        },
        getHonorchData () {
            honorchList(this.form.cardid).then(res => {
                this.honorchData = res.data.data.records
            })
        },
        getTrainData () {
            trainList(this.form.cardid).then(res => {
                this.trainData = res.data.data
                this.trainData.forEach(item => {
                    if (item.sex == 1) {
                        item.sex = '男'
                    } else {
                        item.sex = '女'
                    }
                })
            })
        },
        getExaminationData () {
            examinationList(this.form.cardid).then(res => {
                this.examinationData = res.data.data
                this.examinationData.forEach(item => {
                    if (item.stat == 1) {
                        item.stat = '不通过'
                    } else {
                        item.stat = '通过'
                    }
                })
            })
        },
        investorOnLoad (page, params = {}) {
            this.investorLoading = true;
            getInvestorList(page.currentPage, page.pageSize, Object.assign(params, this.investorQuery), this.form.creditcode).then(res => {
                const data = res.data.data;
                this.investorPage.total = data.total;
                this.investorData = data.records;
                this.investorLoading = false;
                this.$refs.investorCrud.refreshTable();
                this.$refs.investorCrud.doLayout();
                this.investorSelectionClear();
            });
        },
        investorSelectionClear () {
            this.investorSelectionList = [];
            this.$refs.investorCrud.toggleSelection();
        },
        investorSelectionChange (list) {
            this.investorSelectionList = list;
        },
        investorSearchChange (params, done) {
            this.investorQuery = params;
            this.investorPage.currentPage = 1;
            this.investorOnLoad(this.investorPage, params);
            done();
        },
        investorSearchReset () {
            this.investorQuery = {};
            this.investorOnLoad(this.investorPage);
        },
        investorCurrentChange (currentPage) {
            this.investorPage.currentPage = currentPage;
        },
        investorSizeChange (pageSize) {
            this.investorPage.pageSize = pageSize;
        },
        manageOnLoad (page, params = {}) {
            this.manageLoading = true;
            getManageList(page.currentPage, page.pageSize, Object.assign(params, this.manageQuery), this.form.creditcode).then(res => {
                const data = res.data.data;
                this.managePage.total = data.total;
                this.manageData = data.records;
                this.manageLoading = false;
                this.$refs.manageCrud.refreshTable();
                this.$refs.manageCrud.doLayout();
                this.manageSelectionClear();
            });
        },
        manageSelectionClear () {
            this.manageSelectionList = [];
            this.$refs.manageCrud.toggleSelection();
        },
        manageSelectionChange (list) {
            this.manageSelectionList = list;
        },
        manageSearchChange (params, done) {
            this.manageQuery = params;
            this.managePage.currentPage = 1;
            this.manageOnLoad(this.managePage, params);
            done();
        },
        manageSearchReset () {
            this.manageQuery = {};
            this.manageOnLoad(this.managePage);
        },
        manageCurrentChange (currentPage) {
            this.managePage.currentPage = currentPage;
        },
        manageSizeChange (pageSize) {
            this.managePage.pageSize = pageSize;
        },
        i++;
      }
    });
    if (i > 1) {
      this.$store.state.tags.tagList.splice(ind, 1);
    }
}
    this.form = this.$route.query;
    console.log(this.form, 1);
  },
  mounted() {
    // this.$store.state.tags.tag.label = '保安详细资料'
  },
  methods: {
    handleClick(tab) {
      if (tab.index == 1) {
        this.investorSearchReset();
      } else if (tab.index == 2) {
        this.manageSearchReset();
      } else if (tab.index == 3) {
        this.getHonorchData();
      } else if (tab.index == 4) {
        this.getTrainData();
      } else if (tab.index == 5) {
        this.getExaminationData();
      }
    },
    getManifestationData() {
      manifestationList(this.form.cardid).then((res) => {
        this.manifestationData = res.data.data.records;
        this.manifestationData.forEach((item) => {
          item.name = this.form.realName;
          item.time = item.time.substring(0, 10);
        });
      });
    },
    getDispatchData() {
      dispatchList(this.form.cardid).then((res) => {
        this.dispatchData = res.data.data.records;
      });
    },
    getHonorchData() {
      honorchList(this.form.cardid).then((res) => {
        this.honorchData = res.data.data.records;
      });
    },
    getTrainData() {
      trainList(this.form.cardid).then((res) => {
        this.trainData = res.data.data;
        this.trainData.forEach((item) => {
          if (item.sex == 1) {
            item.sex = "男";
          } else {
            item.sex = "女";
          }
        });
      });
    },
    getExaminationData() {
      examinationList(this.form.cardid).then((res) => {
        this.examinationData = res.data.data;
        this.examinationData.forEach((item) => {
          if (item.stat == 1) {
            item.stat = "不通过";
          } else {
            item.stat = "通过";
          }
        });
      });
    },
    investorOnLoad(page, params = {}) {
      this.investorLoading = true;
      getInvestorList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.investorQuery),
        this.form.creditcode
      ).then((res) => {
        const data = res.data.data;
        this.investorPage.total = data.total;
        this.investorData = data.records;
        this.investorLoading = false;
        this.$refs.investorCrud.refreshTable();
        this.$refs.investorCrud.doLayout();
        this.investorSelectionClear();
      });
    },
    investorSelectionClear() {
      this.investorSelectionList = [];
      this.$refs.investorCrud.toggleSelection();
    },
    investorSelectionChange(list) {
      this.investorSelectionList = list;
    },
    investorSearchChange(params, done) {
      this.investorQuery = params;
      this.investorPage.currentPage = 1;
      this.investorOnLoad(this.investorPage, params);
      done();
    },
    investorSearchReset() {
      this.investorQuery = {};
      this.investorOnLoad(this.investorPage);
    },
    investorCurrentChange(currentPage) {
      this.investorPage.currentPage = currentPage;
    },
    investorSizeChange(pageSize) {
      this.investorPage.pageSize = pageSize;
    },
    manageOnLoad(page, params = {}) {
      this.manageLoading = true;
      getManageList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.manageQuery),
        this.form.creditcode
      ).then((res) => {
        const data = res.data.data;
        this.managePage.total = data.total;
        this.manageData = data.records;
        this.manageLoading = false;
        this.$refs.manageCrud.refreshTable();
        this.$refs.manageCrud.doLayout();
        this.manageSelectionClear();
      });
    },
    manageSelectionClear() {
      this.manageSelectionList = [];
      this.$refs.manageCrud.toggleSelection();
    },
    manageSelectionChange(list) {
      this.manageSelectionList = list;
    },
    manageSearchChange(params, done) {
      this.manageQuery = params;
      this.managePage.currentPage = 1;
      this.manageOnLoad(this.managePage, params);
      done();
    },
    manageSearchReset() {
      this.manageQuery = {};
      this.manageOnLoad(this.managePage);
    },
    manageCurrentChange(currentPage) {
      this.managePage.currentPage = currentPage;
    },
    manageSizeChange(pageSize) {
      this.managePage.pageSize = pageSize;
    },
  },
};
</script>
<style lang="scss" scoped>
src/views/securityCompany/computents/equipment copy 4.vue
New file
@@ -0,0 +1,150 @@
<template>
  <avue-crud
    class="company-box"
    :option="equipmentOption"
    :search.sync="equipmentSearch"
    :table-loading="equipmentLoading"
    :data="equipmentData"
    ref="equipmentCrud"
    :page.sync="equipmentPage"
    @on-load="equipmentOnLoad"
    @selection-change="equipmentSelectionChange"
    @search-change="equipmentSearchChange"
    @search-reset="equipmentSearchReset"
    @current-change="equipmentCurrentChange"
    @size-change="equipmentSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      equipmentOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "投资人姓名",
            prop: "shareholder",
            slot: true,
            display: false,
          },
          {
            label: "投资比例",
            prop: "shareholdingratio",
            slot: true,
            display: false,
            formatter: function (row, value) {
              return (value = value + "%");
            },
          },
          {
            label: "出资金额",
            prop: "capital",
            slot: true,
            display: false,
            formatter: function (row, value) {
              return (value = value + "万元");
            },
          },
          {
            label: "投资时间",
            prop: "capitaltime",
            slot: true,
            display: false,
          },
          {
            label: "身份证号",
            prop: "cardid",
            slot: true,
            display: false,
          },
          {
            label: "联系电话",
            prop: "cell",
            slot: true,
            display: false,
          },
        ],
      },
      equipmentSearch: {},
      equipmentLoading: true,
      equipmentData: [],
      equipmentPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      equipmentQuery: {},
      equipmentSelectionList: [],
    };
  },
  methods: {
    equipmentOnLoad(page, params = {}) {
      this.equipmentLoading = true;
      console.log("success");
      //   getequipmentList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.equipmentQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.equipmentPage.total = data.total;
      //     this.equipmentData = data.records;
      this.equipmentLoading = false;
      //     this.$refs.equipmentCrud.refreshTable();
      //     this.$refs.equipmentCrud.doLayout();
      //     this.equipmentSelectionClear();
      //   });
    },
    equipmentSelectionClear() {
      this.equipmentSelectionList = [];
      this.$refs.equipmentCrud.toggleSelection();
    },
    equipmentSelectionChange(list) {
      this.equipmentSelectionList = list;
    },
    equipmentSearchChange(params, done) {
      this.equipmentQuery = params;
      this.equipmentPage.currentPage = 1;
      this.equipmentOnLoad(this.equipmentPage, params);
      done();
    },
    equipmentSearchReset() {
      this.equipmentQuery = {};
      this.equipmentOnLoad(this.equipmentPage);
    },
    equipmentCurrentChange(currentPage) {
      this.equipmentPage.currentPage = currentPage;
    },
    equipmentSizeChange(pageSize) {
      this.equipmentPage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/securityCompany/computents/equipment.vue
New file
@@ -0,0 +1,280 @@
<template>
  <avue-crud
    class="company-box"
    :option="equipmentOption"
    :search.sync="equipmentSearch"
    :table-loading="equipmentLoading"
    :data="equipmentData"
    ref="equipmentCrud"
    :page.sync="equipmentPage"
    @on-load="equipmentOnLoad"
    @selection-change="equipmentSelectionChange"
    @search-change="equipmentSearchChange"
    @search-reset="equipmentSearchReset"
    @current-change="equipmentCurrentChange"
    @size-change="equipmentSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      equipmentOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "id",
            prop: "id",
            hide: true,
            editDisplay: false,
            addDisplay: false,
          },
          {
            label: "名称",
            prop: "name",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "编号",
            prop: "number",
            rules: [
              {
                required: true,
                message: "请输入编号",
                trigger: "blur",
              },
            ],
            search: true,
          }, //上面不显示
          {
            label: "规格",
            prop: "specifications",
            rules: [
              {
                required: true,
                message: "请输入规格",
                trigger: "blur",
              },
            ],
            // search: true,
          },
          {
            label: "型号",
            prop: "mode",
            width: 70,
            rules: [
              {
                required: true,
                message: "请输入型号",
                trigger: "blur",
              },
            ],
            // search: true,
          },
          {
            label: "保安公司",
            prop: "tenantName",
            rules: [
              {
                required: true,
                message: "请输入组织机构",
                trigger: "blur",
              },
            ],
            overHidden: true,
            // addDisplay: true,
            // editDisplay: true,
            // viewDisplay: true,
            // searchSpan: 5,
            dicUrl:
              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
            props: {
              label: "title",
              value: "id",
            },
            // search: true,
            type: "select",
            // rules: [{
            //     required: true,
            //     message: "请选择学历",
            //     trigger: "blur"
            // }],
          },
          {
            label: "负责人",
            prop: "personInCharge",
            rules: [
              {
                required: true,
                message: "请输入负责人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "厂商",
            prop: "brand",
            // search: true,
            width: 110,
            overHidden: true,
            search: true,
            rules: [
              {
                required: true,
                message: "请输入厂商",
                trigger: "blur",
              },
            ],
          },
          {
            label: "出厂日期",
            prop: "dateForProduction",
            // search: true,
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "timestamp",
            searchSpan: 4,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入出厂日期",
                trigger: "blur",
              },
            ],
          },
        ],
        //  [
        //   {
        //     label: "投资人姓名",
        //     prop: "shareholder",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "投资比例",
        //     prop: "shareholdingratio",
        //     slot: true,
        //     display: false,
        //     formatter: function (row, value) {
        //       return (value = value + "%");
        //     },
        //   },
        //   {
        //     label: "出资金额",
        //     prop: "capital",
        //     slot: true,
        //     display: false,
        //     formatter: function (row, value) {
        //       return (value = value + "万元");
        //     },
        //   },
        //   {
        //     label: "投资时间",
        //     prop: "capitaltime",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "身份证号",
        //     prop: "cardid",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "联系电话",
        //     prop: "cell",
        //     slot: true,
        //     display: false,
        //   },
        // ],
      },
      equipmentSearch: {},
      equipmentLoading: true,
      equipmentData: [],
      equipmentPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      equipmentQuery: {},
      equipmentSelectionList: [],
    };
  },
  methods: {
    equipmentOnLoad(page, params = {}) {
      this.equipmentLoading = true;
      console.log("success");
      //   getequipmentList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.equipmentQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.equipmentPage.total = data.total;
      //     this.equipmentData = data.records;
      this.equipmentLoading = false;
      //     this.$refs.equipmentCrud.refreshTable();
      //     this.$refs.equipmentCrud.doLayout();
      //     this.equipmentSelectionClear();
      //   });
    },
    equipmentSelectionClear() {
      this.equipmentSelectionList = [];
      this.$refs.equipmentCrud.toggleSelection();
    },
    equipmentSelectionChange(list) {
      this.equipmentSelectionList = list;
    },
    equipmentSearchChange(params, done) {
      this.equipmentQuery = params;
      this.equipmentPage.currentPage = 1;
      this.equipmentOnLoad(this.equipmentPage, params);
      done();
    },
    equipmentSearchReset() {
      this.equipmentQuery = {};
      this.equipmentOnLoad(this.equipmentPage);
    },
    equipmentCurrentChange(currentPage) {
      this.equipmentPage.currentPage = currentPage;
    },
    equipmentSizeChange(pageSize) {
      this.equipmentPage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/securityCompany/computents/punish.vue
New file
@@ -0,0 +1,150 @@
<template>
  <avue-crud
    class="company-box"
    :option="punishOption"
    :search.sync="punishSearch"
    :table-loading="punishLoading"
    :data="punishData"
    ref="punishCrud"
    :page.sync="punishPage"
    @on-load="punishOnLoad"
    @selection-change="punishSelectionChange"
    @search-change="punishSearchChange"
    @search-reset="punishSearchReset"
    @current-change="punishCurrentChange"
    @size-change="punishSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      punishOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "投资人姓名",
            prop: "shareholder",
            slot: true,
            display: false,
          },
          {
            label: "投资比例",
            prop: "shareholdingratio",
            slot: true,
            display: false,
            formatter: function (row, value) {
              return (value = value + "%");
            },
          },
          {
            label: "出资金额",
            prop: "capital",
            slot: true,
            display: false,
            formatter: function (row, value) {
              return (value = value + "万元");
            },
          },
          {
            label: "投资时间",
            prop: "capitaltime",
            slot: true,
            display: false,
          },
          {
            label: "身份证号",
            prop: "cardid",
            slot: true,
            display: false,
          },
          {
            label: "联系电话",
            prop: "cell",
            slot: true,
            display: false,
          },
        ],
      },
      punishSearch: {},
      punishLoading: true,
      punishData: [],
      punishPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      punishQuery: {},
      punishSelectionList: [],
    };
  },
  methods: {
    punishOnLoad(page, params = {}) {
      this.punishLoading = true;
      console.log("success");
      //   getpunishList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.punishQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.punishPage.total = data.total;
      //     this.punishData = data.records;
      this.punishLoading = false;
      //     this.$refs.punishCrud.refreshTable();
      //     this.$refs.punishCrud.doLayout();
      //     this.punishSelectionClear();
      //   });
    },
    punishSelectionClear() {
      this.punishSelectionList = [];
      this.$refs.punishCrud.toggleSelection();
    },
    punishSelectionChange(list) {
      this.punishSelectionList = list;
    },
    punishSearchChange(params, done) {
      this.punishQuery = params;
      this.punishPage.currentPage = 1;
      this.punishOnLoad(this.punishPage, params);
      done();
    },
    punishSearchReset() {
      this.punishQuery = {};
      this.punishOnLoad(this.punishPage);
    },
    punishCurrentChange(currentPage) {
      this.punishPage.currentPage = currentPage;
    },
    punishSizeChange(pageSize) {
      this.punishPage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/securityCompany/computents/service.vue
New file
@@ -0,0 +1,150 @@
<template>
  <avue-crud
    class="company-box"
    :option="serviceOption"
    :search.sync="serviceSearch"
    :table-loading="serviceLoading"
    :data="serviceData"
    ref="serviceCrud"
    :page.sync="servicePage"
    @on-load="serviceOnLoad"
    @selection-change="serviceSelectionChange"
    @search-change="serviceSearchChange"
    @search-reset="serviceSearchReset"
    @current-change="serviceCurrentChange"
    @size-change="serviceSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      serviceOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "投资人姓名",
            prop: "shareholder",
            slot: true,
            display: false,
          },
          {
            label: "投资比例",
            prop: "shareholdingratio",
            slot: true,
            display: false,
            formatter: function (row, value) {
              return (value = value + "%");
            },
          },
          {
            label: "出资金额",
            prop: "capital",
            slot: true,
            display: false,
            formatter: function (row, value) {
              return (value = value + "万元");
            },
          },
          {
            label: "投资时间",
            prop: "capitaltime",
            slot: true,
            display: false,
          },
          {
            label: "身份证号",
            prop: "cardid",
            slot: true,
            display: false,
          },
          {
            label: "联系电话",
            prop: "cell",
            slot: true,
            display: false,
          },
        ],
      },
      serviceSearch: {},
      serviceLoading: true,
      serviceData: [],
      servicePage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      serviceQuery: {},
      serviceSelectionList: [],
    };
  },
  methods: {
    serviceOnLoad(page, params = {}) {
      this.serviceLoading = true;
      console.log("success");
      //   getserviceList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.serviceQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.servicePage.total = data.total;
      //     this.serviceData = data.records;
      this.serviceLoading = false;
      //     this.$refs.serviceCrud.refreshTable();
      //     this.$refs.serviceCrud.doLayout();
      //     this.serviceSelectionClear();
      //   });
    },
    serviceSelectionClear() {
      this.serviceSelectionList = [];
      this.$refs.serviceCrud.toggleSelection();
    },
    serviceSelectionChange(list) {
      this.serviceSelectionList = list;
    },
    serviceSearchChange(params, done) {
      this.serviceQuery = params;
      this.servicePage.currentPage = 1;
      this.serviceOnLoad(this.servicePage, params);
      done();
    },
    serviceSearchReset() {
      this.serviceQuery = {};
      this.serviceOnLoad(this.servicePage);
    },
    serviceCurrentChange(currentPage) {
      this.servicePage.currentPage = currentPage;
    },
    serviceSizeChange(pageSize) {
      this.servicePage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/securityCompany/computents/staff.vue
New file
@@ -0,0 +1,301 @@
<template>
  <avue-crud
    class="company-box"
    :option="staffOption"
    :search.sync="staffSearch"
    :table-loading="staffLoading"
    :data="staffData"
    ref="staffCrud"
    :page.sync="staffPage"
    @on-load="staffOnLoad"
    @selection-change="staffSelectionChange"
    @search-change="staffSearchChange"
    @search-reset="staffSearchReset"
    @current-change="staffCurrentChange"
    @size-change="staffSizeChange"
  >
  </avue-crud>
</template>
<script>
export default {
  data() {
    return {
      staffOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 250,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
        column: [
          {
            label: "保安姓名",
            prop: "realName",
            search: true,
            searchSpan: 4,
            display: false,
            width: 78,
          },
          {
            label: "性别",
            prop: "sex",
            type: "select",
            // search: true,
            searchSpan: 4,
            searchLabelWidth: 50,
            dicData: [
              {
                label: "女",
                value: 2,
              },
              {
                label: "男",
                value: 1,
              },
            ],
            slot: true,
            display: false,
            width: 48,
          },
          // {
          //   label: "保安公司",
          //   prop: "deptName",
          //   // width: 120,
          //   search: true,
          //   searchSpan: 4,
          //   overHidden: true,
          //   slot: true,
          //   display: false,
          // },
          {
            label: "保安证编号",
            prop: "securitynumber",
            display: false,
            searchSpan: 4,
            searchLabelWidth: 110,
            search: true,
          },
          {
            label: "身份证号",
            prop: "cardid",
            slot: true,
            display: false,
            width: 138,
          },
          {
            label: "联系方式",
            prop: "phone",
            slot: true,
            display: false,
            width: 92,
          },
          {
            label: "联系地址",
            prop: "address",
            slot: true,
            display: false,
            hide: true,
          },
          {
            label: "入职时间",
            prop: "rtime",
            slot: true,
            display: false,
            width: 82,
          },
          {
            label: "所属角色",
            prop: "roleName",
            slot: true,
            display: false,
            width: 78,
            hide: true,
          },
          {
            label: "所属辖区",
            prop: "jurisdiction",
            // multiple: true,
            minWidth: 60,
            type: "tree",
            dicUrl: "/api/jurisdiction/lazy-tree?parentId=0",
            props: {
              label: "title",
              value: "id",
            },
            checkStrictly: true,
            slot: true,
            rules: [
              {
                required: true,
                message: "请选择所属辖区",
                trigger: "click",
              },
            ],
          },
          {
            label: "是否在职",
            prop: "status",
            type: "select",
            search: true,
            searchSpan: 3,
            dicData: [
              {
                label: "否",
                value: 0,
              },
              {
                label: "是",
                value: 1,
              },
            ],
            slot: true,
            display: false,
            width: 70,
          },
          {
            label: "是否持证",
            prop: "hold",
            type: "select",
            search: true,
            searchSpan: 3,
            dicData: [
              {
                label: "是",
                value: "0",
              },
              {
                label: "否",
                value: "1",
              },
              {
                label: "已吊销",
                value: "2",
              },
            ],
            slot: true,
            display: false,
            width: 70,
          },
        ],
        // [
        //   {
        //     label: "投资人姓名",
        //     prop: "shareholder",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "投资比例",
        //     prop: "shareholdingratio",
        //     slot: true,
        //     display: false,
        //     formatter: function (row, value) {
        //       return (value = value + "%");
        //     },
        //   },
        //   {
        //     label: "出资金额",
        //     prop: "capital",
        //     slot: true,
        //     display: false,
        //     formatter: function (row, value) {
        //       return (value = value + "万元");
        //     },
        //   },
        //   {
        //     label: "投资时间",
        //     prop: "capitaltime",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "身份证号",
        //     prop: "cardid",
        //     slot: true,
        //     display: false,
        //   },
        //   {
        //     label: "联系电话",
        //     prop: "cell",
        //     slot: true,
        //     display: false,
        //   },
        // ],
      },
      staffSearch: {},
      staffLoading: true,
      staffData: [],
      staffPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      staffQuery: {},
      staffSelectionList: [],
    };
  },
  methods: {
    staffOnLoad(page, params = {}) {
      this.staffLoading = true;
      console.log("success");
      //   getstaffList(
      //     page.currentPage,
      //     page.pageSize,
      //     Object.assign(params, this.staffQuery),
      //     this.form.creditcode
      //   ).then((res) => {
      //     const data = res.data.data;
      //     this.staffPage.total = data.total;
      //     this.staffData = data.records;
      this.staffLoading = false;
      //     this.$refs.staffCrud.refreshTable();
      //     this.$refs.staffCrud.doLayout();
      //     this.staffSelectionClear();
      //   });
    },
    staffSelectionClear() {
      this.staffSelectionList = [];
      this.$refs.staffCrud.toggleSelection();
    },
    staffSelectionChange(list) {
      this.staffSelectionList = list;
    },
    staffSearchChange(params, done) {
      this.staffQuery = params;
      this.staffPage.currentPage = 1;
      this.staffOnLoad(this.staffPage, params);
      done();
    },
    staffSearchReset() {
      this.staffQuery = {};
      this.staffOnLoad(this.staffPage);
    },
    staffCurrentChange(currentPage) {
      this.staffPage.currentPage = currentPage;
    },
    staffSizeChange(pageSize) {
      this.staffPage.pageSize = pageSize;
    },
  },
};
</script>
<style>
</style>
src/views/securityCompany/confess.vue
@@ -6,275 +6,285 @@
 * menu-name 自招保安单位查询
 */
<template>
    <basic-container>
        <avue-crud :option="option"
                   :table-loading="loading"
                   :data="data"
                   :page.sync="page"
                   :permission="permissionList"
                   :before-open="beforeOpen"
                   v-model="form"
                   ref="crud"
                   @row-update="rowUpdate"
                   @row-save="rowSave"
                   @row-del="rowDel"
                   @search-change="searchChange"
                   @search-reset="searchReset"
                   @selection-change="selectionChange"
                   @current-change="currentChange"
                   @size-change="sizeChange"
                   @refresh-change="refreshChange"
                   @row-click="handleRowClick"
                   @on-load="onLoad">
        </avue-crud>
    </basic-container>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @row-click="handleRowClick"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/securityCompany/confess";
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/securityCompany/confess";
import { mapGetters } from "vuex";
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        index: true,
        searchShowBtn: false,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "公司名称",
            prop: "enterprisename",
            search: true,
            searchSpan: 4,
            display: false,
          },
          {
            label: "法定代表人",
            prop: "representative",
            display: false,
            width: 120,
          },
          {
            label: "成立日期",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            mock: {
              type: "datetime",
              format: "yyyy-MM-dd",
            },
            selectionList: [],
            option: {
                // 操作栏多余按钮去除
                delBtn: false,
                editBtn: false,
                addBtn: false,
                selection: false,
                menu: false,
                align: 'center',
                height: 'auto',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                index: true,
                viewBtn: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "公司名称",
                        prop: "enterprisename",
                        search: true,
                        searchSpan: 4,
                        display: false,
                    },
                    {
                        label: "法定代表人",
                        prop: "representative",
                        display: false,
                        width: 120
                    },
                    {
                        label: "成立日期",
                        prop: "establishtime",
                        type: "date",
                        format: 'yyyy-MM-dd',
                        valueFormat: 'yyyy-MM-dd',
                        mock: {
                            type: 'datetime',
                            format: 'yyyy-MM-dd'
                        },
                        search: true,
                        searchSpan: 4,
                        display: false,
                        width: 180
                    },
                    {
                        label: "注册资金",
                        prop: "registeredcapital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "实缴资金",
                        prop: "capital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "公司类型",
                        prop: "enterprises",
                        display: false,
                    },
                    {
                        label: "注册地址",
                        prop: "address",
                        display: false,
                        width: 200
                    },
                ]
                ,
                group: [
                    {
                        label: '详细信息',
                        prop: 'baseInfo',
                        icon: 'el-icon-user-solid',
                        column: [
                            {
                                label: "公司名称",
                                prop: "enterprisename",
                                display: false,
                            },
                        ]
                    },
                    {
                        label: '详细信息',
                        prop: 'detailInfo',
                        icon: 'el-icon-s-order',
                        column: [
                        ]
                    },
                    {
                        label: '职责信息',
                        prop: 'dutyInfo',
                        icon: 'el-icon-s-custom',
                        column: [
                        ]
                    },
                ]
            },
            data: []
        };
            search: true,
            searchSpan: 4,
            display: false,
            width: 180,
          },
          {
            label: "注册资金",
            prop: "registeredcapital",
            display: false,
            width: 200,
          },
          {
            label: "实缴资金",
            prop: "capital",
            display: false,
            width: 200,
          },
          {
            label: "公司类型",
            prop: "enterprises",
            display: false,
          },
          {
            label: "注册地址",
            prop: "address",
            display: false,
            width: 200,
          },
        ],
        group: [
          {
            label: "详细信息",
            prop: "baseInfo",
            icon: "el-icon-user-solid",
            column: [
              {
                label: "公司名称",
                prop: "enterprisename",
                display: false,
              },
            ],
          },
          {
            label: "详细信息",
            prop: "detailInfo",
            icon: "el-icon-s-order",
            column: [],
          },
          {
            label: "职责信息",
            prop: "dutyInfo",
            icon: "el-icon-s-custom",
            column: [],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
        viewBtn: this.vaildData(this.permission.post_view, false),
        delBtn: this.vaildData(this.permission.post_delete, false),
        editBtn: this.vaildData(this.permission.post_edit, false),
      };
    },
    computed: {
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.post_add, false),
                viewBtn: this.vaildData(this.permission.post_view, false),
                delBtn: this.vaildData(this.permission.post_delete, false),
                editBtn: this.vaildData(this.permission.post_edit, false)
            };
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        ids () {
            let ids = [];
            this.selectionList.forEach(ele => {
                ids.push(ele.id);
            });
            return ids.join(",");
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    methods: {
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id);
                })
                .then(() => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    });
                });
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getDetail(this.form.id).then(res => {
                    this.form = res.data.data;
                });
            }
            done();
        },
        searchReset () {
            this.query = {};
            this.onLoad(this.page);
        },
        searchChange (params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
        },
        selectionChange (list) {
            this.selectionList = list;
        },
        selectionClear () {
            this.selectionList = [];
            this.$refs.crud.toggleSelection();
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage;
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange () {
            this.onLoad(this.page, this.query);
        },
        onLoad (page, params = {}) {
            this.loading = true;
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query), 0).then(res => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
                this.selectionClear();
            });
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query),
        0
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
        // 行单击
        handleRowClick (row) {
            // delete (row["name"]);
            var obj = row
            obj["name"] = "保安公司详细资料"
            this.$router.push({
                path: `/securityCompany/index`,
                query: obj,
            });
        },
    }
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安公司详细资料";
      this.$router.push({
        path: `/securityCompany/index`,
        query: obj,
      });
    },
  },
};
</script>
src/views/securityCompany/dispatch.vue
@@ -6,275 +6,285 @@
 * menu-name 派遣公司查询
 */
<template>
    <basic-container>
        <avue-crud :option="option"
                   :table-loading="loading"
                   :data="data"
                   :page.sync="page"
                   :permission="permissionList"
                   :before-open="beforeOpen"
                   v-model="form"
                   ref="crud"
                   @row-update="rowUpdate"
                   @row-save="rowSave"
                   @row-del="rowDel"
                   @search-change="searchChange"
                   @search-reset="searchReset"
                   @selection-change="selectionChange"
                   @current-change="currentChange"
                   @size-change="sizeChange"
                   @refresh-change="refreshChange"
                   @row-click="handleRowClick"
                   @on-load="onLoad">
        </avue-crud>
    </basic-container>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @row-click="handleRowClick"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/securityCompany/dispatch";
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/securityCompany/dispatch";
import { mapGetters } from "vuex";
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        index: true,
        searchShowBtn: false,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "公司名称",
            prop: "enterprisename",
            search: true,
            searchSpan: 4,
            display: false,
          },
          {
            label: "法定代表人",
            prop: "representative",
            display: false,
            width: 120,
          },
          {
            label: "成立日期",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            mock: {
              type: "datetime",
              format: "yyyy-MM-dd",
            },
            selectionList: [],
            option: {
                // 操作栏多余按钮去除
                delBtn: false,
                editBtn: false,
                addBtn: false,
                selection: false,
                menu: false,
                align: 'center',
                height: 'auto',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                index: true,
                viewBtn: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "公司名称",
                        prop: "enterprisename",
                        search: true,
                        searchSpan: 4,
                        display: false,
                    },
                    {
                        label: "法定代表人",
                        prop: "representative",
                        display: false,
                        width: 120
                    },
                    {
                        label: "成立日期",
                        prop: "establishtime",
                        type: "date",
                        format: 'yyyy-MM-dd',
                        valueFormat: 'yyyy-MM-dd',
                        mock: {
                            type: 'datetime',
                            format: 'yyyy-MM-dd'
                        },
                        search: true,
                        searchSpan: 4,
                        display: false,
                        width: 180
                    },
                    {
                        label: "注册资金",
                        prop: "registeredcapital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "实缴资金",
                        prop: "capital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "公司类型",
                        prop: "enterprises",
                        display: false,
                    },
                    {
                        label: "注册地址",
                        prop: "address",
                        display: false,
                        width: 200
                    }
                ]
                ,
                group: [
                    {
                        label: '详细信息',
                        prop: 'baseInfo',
                        icon: 'el-icon-user-solid',
                        column: [
                            {
                                label: "公司名称",
                                prop: "enterprisename",
                                display: false,
                            },
                        ]
                    },
                    {
                        label: '详细信息',
                        prop: 'detailInfo',
                        icon: 'el-icon-s-order',
                        column: [
                        ]
                    },
                    {
                        label: '职责信息',
                        prop: 'dutyInfo',
                        icon: 'el-icon-s-custom',
                        column: [
                        ]
                    },
                ]
            },
            data: []
        };
            search: true,
            searchSpan: 4,
            display: false,
            width: 180,
          },
          {
            label: "注册资金",
            prop: "registeredcapital",
            display: false,
            width: 200,
          },
          {
            label: "实缴资金",
            prop: "capital",
            display: false,
            width: 200,
          },
          {
            label: "公司类型",
            prop: "enterprises",
            display: false,
          },
          {
            label: "注册地址",
            prop: "address",
            display: false,
            width: 200,
          },
        ],
        group: [
          {
            label: "详细信息",
            prop: "baseInfo",
            icon: "el-icon-user-solid",
            column: [
              {
                label: "公司名称",
                prop: "enterprisename",
                display: false,
              },
            ],
          },
          {
            label: "详细信息",
            prop: "detailInfo",
            icon: "el-icon-s-order",
            column: [],
          },
          {
            label: "职责信息",
            prop: "dutyInfo",
            icon: "el-icon-s-custom",
            column: [],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
        viewBtn: this.vaildData(this.permission.post_view, false),
        delBtn: this.vaildData(this.permission.post_delete, false),
        editBtn: this.vaildData(this.permission.post_edit, false),
      };
    },
    computed: {
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.post_add, false),
                viewBtn: this.vaildData(this.permission.post_view, false),
                delBtn: this.vaildData(this.permission.post_delete, false),
                editBtn: this.vaildData(this.permission.post_edit, false)
            };
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        ids () {
            let ids = [];
            this.selectionList.forEach(ele => {
                ids.push(ele.id);
            });
            return ids.join(",");
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    methods: {
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id);
                })
                .then(() => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    });
                });
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getDetail(this.form.id).then(res => {
                    this.form = res.data.data;
                });
            }
            done();
        },
        searchReset () {
            this.query = {};
            this.onLoad(this.page);
        },
        searchChange (params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
        },
        selectionChange (list) {
            this.selectionList = list;
        },
        selectionClear () {
            this.selectionList = [];
            this.$refs.crud.toggleSelection();
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage;
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange () {
            this.onLoad(this.page, this.query);
        },
        onLoad (page, params = {}) {
            this.loading = true;
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query), 4).then(res => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
                this.selectionClear();
            });
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query),
        4
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
        // 行单击
        handleRowClick (row) {
            // delete (row["name"]);
            var obj = row
            obj["name"] = "保安公司详细资料"
            this.$router.push({
                path: `/securityCompany/index`,
                query: obj,
            });
        },
    }
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安公司详细资料";
      this.$router.push({
        path: `/securityCompany/index`,
        query: obj,
      });
    },
  },
};
</script>
src/views/securityCompany/security.vue
@@ -6,275 +6,418 @@
 * menu-name 保安服务公司查询
 */
<template>
    <basic-container>
        <avue-crud :option="option"
                   :table-loading="loading"
                   :data="data"
                   :page.sync="page"
                   :permission="permissionList"
                   :before-open="beforeOpen"
                   v-model="form"
                   ref="crud"
                   @row-update="rowUpdate"
                   @row-save="rowSave"
                   @row-del="rowDel"
                   @search-change="searchChange"
                   @search-reset="searchReset"
                   @selection-change="selectionChange"
                   @current-change="currentChange"
                   @size-change="sizeChange"
                   @refresh-change="refreshChange"
                   @row-click="handleRowClick"
                   @on-load="onLoad">
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @row-click="handleRowClick"
      @on-load="onLoad"
    >
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          :size="size"
          :type="type"
          class="zhengJian-icon"
          @click.stop="punish(row)"
          >处罚</el-button
        >
      </template></avue-crud
    >
    <el-dialog
      title="处罚"
      :visible.sync="dialogVisible"
      width="60%"
      :before-close="handleClose"
      :modal-append-to-body="false"
      center
    >
      <!-- <span>这是一段信息</span> -->
      <avue-form
        :option="optionf"
        v-model="objf"
        @submit="submitf"
        @error="errorf"
      >
        <template slot-scope="{ type, size, row }" slot="menuForm">
          <el-button
            :size="size"
            icon="el-icon-error"
            :type="type"
            @click="close(row)"
            >关闭</el-button
          >
        </template>
      </avue-form>
      <!-- <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        >
      </span> -->
    </el-dialog>
  </basic-container>
</template>
        </avue-crud>
    </basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/securityCompany/security";
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/securityCompany/security";
import { mapGetters } from "vuex";
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
  data() {
    return {
      objf: {},
      optionf: {
        column: [
          {
            label: "公司名称",
            prop: "enterprisename",
            span: 24,
            labelWidth: 110,
            rules: [
              {
                required: true,
                message: "请输入身份证号码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "处罚原因",
            prop: "sex",
            span: 24,
            labelWidth: 110,
            rules: [
              {
                required: true,
                message: "请输入荣誉名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "处罚内容",
            prop: "sex1",
            span: 24,
            type: "textarea",
            labelWidth: 110,
          },
          //   {
          //     label: "授予单位名称",
          //     prop: "sex2",
          //     span: 24,
          //     labelWidth: 110,
          //   },
        ],
      },
      dialogVisible: false,
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        searchShowBtn: false,
        // menu: false,
        align: "center",
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        menuWidth: 100,
        searchMenuSpan: 6,
        index: true,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "公司名称",
            prop: "enterprisename",
            search: true,
            searchSpan: 4,
            width: 150,
            overHidden: true,
            display: false,
          },
          {
            label: "法定代表人",
            prop: "representative",
            display: false,
            width: 120,
          },
          {
            label: "成立日期",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            mock: {
              type: "datetime",
              format: "yyyy-MM-dd",
            },
            selectionList: [],
            option: {
                // 操作栏多余按钮去除
                delBtn: false,
                editBtn: false,
                addBtn: false,
                selection: false,
                menu: false,
                align: 'center',
                height: 'auto',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                index: true,
                viewBtn: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "公司名称",
                        prop: "enterprisename",
                        search: true,
                        searchSpan: 4,
                        display: false,
                    },
                    {
                        label: "法定代表人",
                        prop: "representative",
                        display: false,
                        width: 120
                    },
                    {
                        label: "成立日期",
                        prop: "establishtime",
                        type: "date",
                        format: 'yyyy-MM-dd',
                        valueFormat: 'yyyy-MM-dd',
                        mock: {
                            type: 'datetime',
                            format: 'yyyy-MM-dd'
                        },
                        search: true,
                        searchSpan: 4,
                        display: false,
                        width: 180
                    },
                    {
                        label: "注册资金",
                        prop: "registeredcapital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "实缴资金",
                        prop: "capital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "公司类型",
                        prop: "enterprises",
                        display: false,
                    },
                    {
                        label: "注册地址",
                        prop: "address",
                        display: false,
                        width: 200
                    }
                ]
                ,
                group: [
                    {
                        label: '详细信息',
                        prop: 'baseInfo',
                        icon: 'el-icon-user-solid',
                        column: [
                            {
                                label: "公司名称",
                                prop: "enterprisename",
                                display: false,
                            },
                        ]
                    },
                    {
                        label: '详细信息',
                        prop: 'detailInfo',
                        icon: 'el-icon-s-order',
                        column: [
                        ]
                    },
                    {
                        label: '职责信息',
                        prop: 'dutyInfo',
                        icon: 'el-icon-s-custom',
                        column: [
                        ]
                    },
                ]
            },
            data: []
        };
            search: true,
            searchSpan: 4,
            display: false,
            width: 180,
          },
          {
            label: "注册资金",
            prop: "registeredcapital",
            display: false,
            width: 200,
          },
          {
            label: "实缴资金",
            prop: "capital",
            display: false,
            width: 200,
          },
          {
            label: "公司类型",
            prop: "enterprises",
            display: false,
            overHidden: true,
          },
          {
            label: "注册地址",
            prop: "address",
            display: false,
            width: 200,
          },
        ],
        group: [
          {
            label: "详细信息",
            prop: "baseInfo",
            icon: "el-icon-user-solid",
            column: [
              {
                label: "公司名称",
                prop: "enterprisename",
                display: false,
              },
            ],
          },
          {
            label: "详细信息",
            prop: "detailInfo",
            icon: "el-icon-s-order",
            column: [],
          },
          {
            label: "职责信息",
            prop: "dutyInfo",
            icon: "el-icon-s-custom",
            column: [],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
        viewBtn: this.vaildData(this.permission.post_view, false),
        delBtn: this.vaildData(this.permission.post_delete, false),
        editBtn: this.vaildData(this.permission.post_edit, false),
      };
    },
    computed: {
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.post_add, false),
                viewBtn: this.vaildData(this.permission.post_view, false),
                delBtn: this.vaildData(this.permission.post_delete, false),
                editBtn: this.vaildData(this.permission.post_edit, false)
            };
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    close(row) {
      this.dialogVisible = false;
    },
    submit(form, done) {
      this.$message.success(JSON.stringify(form));
      done();
    },
    error(err) {
      this.$message.success("请查看控制台");
      console.log(err);
    },
    handleClose(done) {
      this.objf = {};
      done();
    },
    punish(row) {
      //打开处罚
      // console.log(row);
      this.objf = {
        enterprisename: row.enterprisename,
      };
      this.dialogVisible = true;
    },
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        ids () {
            let ids = [];
            this.selectionList.forEach(ele => {
                ids.push(ele.id);
            });
            return ids.join(",");
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    methods: {
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id);
                })
                .then(() => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    });
                });
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getDetail(this.form.id).then(res => {
                    this.form = res.data.data;
                });
            }
            done();
        },
        searchReset () {
            this.query = {};
            this.onLoad(this.page);
        },
        searchChange (params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
        },
        selectionChange (list) {
            this.selectionList = list;
        },
        selectionClear () {
            this.selectionList = [];
            this.$refs.crud.toggleSelection();
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage;
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange () {
            this.onLoad(this.page, this.query);
        },
        onLoad (page, params = {}) {
            this.loading = true;
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query), 2).then(res => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
                this.selectionClear();
            });
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query),
        2
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安公司详细信息";
      this.$router.push({
        path: `/securityCompany/index`,
        query: obj,
      });
        // 行单击
        handleRowClick (row) {
            // delete (row["name"]);
            var obj = row
            obj["name"] = "保安公司详细资料"
            this.$router.push({
                path: `/securityCompany/index`,
                query: obj,
            });
      var flag = false,
        i = 0,
        ind = null;
        },
    }
      this.$store.state.tags.tagList.forEach((item, index) => {
        if (item.label == "保安公司详细信息") {
          if (flag == false) {
            ind = index;
            flag = true;
          }
          i++;
        }
      });
      if (i > 1) {
        this.$store.state.tags.tagList.splice(ind, 1);
      }
    },
  },
};
</script>
src/views/securityCompany/train.vue
@@ -6,275 +6,285 @@
 * menu-name 保安培训单位查询
 */
<template>
    <basic-container>
        <avue-crud :option="option"
                   :table-loading="loading"
                   :data="data"
                   :page.sync="page"
                   :permission="permissionList"
                   :before-open="beforeOpen"
                   v-model="form"
                   ref="crud"
                   @row-update="rowUpdate"
                   @row-save="rowSave"
                   @row-del="rowDel"
                   @search-change="searchChange"
                   @search-reset="searchReset"
                   @selection-change="selectionChange"
                   @current-change="currentChange"
                   @size-change="sizeChange"
                   @refresh-change="refreshChange"
                   @row-click="handleRowClick"
                   @on-load="onLoad">
        </avue-crud>
    </basic-container>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @row-click="handleRowClick"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/securityCompany/train";
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/securityCompany/train";
import { mapGetters } from "vuex";
export default {
    data () {
        return {
            form: {},
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        menu: false,
        align: "center",
        height: "auto",
        calcHeight: 30,
        searchShowBtn: false,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        index: true,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "公司名称",
            prop: "enterprisename",
            search: true,
            searchSpan: 4,
            display: false,
          },
          {
            label: "法定代表人",
            prop: "representative",
            display: false,
            width: 120,
          },
          {
            label: "成立日期",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            mock: {
              type: "datetime",
              format: "yyyy-MM-dd",
            },
            selectionList: [],
            option: {
                // 操作栏多余按钮去除
                delBtn: false,
                editBtn: false,
                addBtn: false,
                selection: false,
                menu: false,
                align: 'center',
                height: 'auto',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                index: true,
                viewBtn: true,
                dialogClickModal: false,
                column: [
                    {
                        label: "公司名称",
                        prop: "enterprisename",
                        search: true,
                        searchSpan: 4,
                        display: false,
                    },
                    {
                        label: "法定代表人",
                        prop: "representative",
                        display: false,
                        width: 120
                    },
                    {
                        label: "成立日期",
                        prop: "establishtime",
                        type: "date",
                        format: 'yyyy-MM-dd',
                        valueFormat: 'yyyy-MM-dd',
                        mock: {
                            type: 'datetime',
                            format: 'yyyy-MM-dd'
                        },
                        search: true,
                        searchSpan: 4,
                        display: false,
                        width: 180
                    },
                    {
                        label: "注册资金",
                        prop: "registeredcapital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "实缴资金",
                        prop: "capital",
                        display: false,
                        width: 200
                    },
                    {
                        label: "公司类型",
                        prop: "enterprises",
                        display: false,
                    },
                    {
                        label: "注册地址",
                        prop: "address",
                        display: false,
                        width: 200
                    }
                ]
                ,
                group: [
                    {
                        label: '详细信息',
                        prop: 'baseInfo',
                        icon: 'el-icon-user-solid',
                        column: [
                            {
                                label: "公司名称",
                                prop: "enterprisename",
                                display: false,
                            },
                        ]
                    },
                    {
                        label: '详细信息',
                        prop: 'detailInfo',
                        icon: 'el-icon-s-order',
                        column: [
                        ]
                    },
                    {
                        label: '职责信息',
                        prop: 'dutyInfo',
                        icon: 'el-icon-s-custom',
                        column: [
                        ]
                    },
                ]
            },
            data: []
        };
            search: true,
            searchSpan: 4,
            display: false,
            width: 180,
          },
          {
            label: "注册资金",
            prop: "registeredcapital",
            display: false,
            width: 200,
          },
          {
            label: "实缴资金",
            prop: "capital",
            display: false,
            width: 200,
          },
          {
            label: "公司类型",
            prop: "enterprises",
            display: false,
          },
          {
            label: "注册地址",
            prop: "address",
            display: false,
            width: 200,
          },
        ],
        group: [
          {
            label: "详细信息",
            prop: "baseInfo",
            icon: "el-icon-user-solid",
            column: [
              {
                label: "公司名称",
                prop: "enterprisename",
                display: false,
              },
            ],
          },
          {
            label: "详细信息",
            prop: "detailInfo",
            icon: "el-icon-s-order",
            column: [],
          },
          {
            label: "职责信息",
            prop: "dutyInfo",
            icon: "el-icon-s-custom",
            column: [],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
        viewBtn: this.vaildData(this.permission.post_view, false),
        delBtn: this.vaildData(this.permission.post_delete, false),
        editBtn: this.vaildData(this.permission.post_edit, false),
      };
    },
    computed: {
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.post_add, false),
                viewBtn: this.vaildData(this.permission.post_view, false),
                delBtn: this.vaildData(this.permission.post_delete, false),
                editBtn: this.vaildData(this.permission.post_edit, false)
            };
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        ids () {
            let ids = [];
            this.selectionList.forEach(ele => {
                ids.push(ele.id);
            });
            return ids.join(",");
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    methods: {
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id);
                })
                .then(() => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    });
                });
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getDetail(this.form.id).then(res => {
                    this.form = res.data.data;
                });
            }
            done();
        },
        searchReset () {
            this.query = {};
            this.onLoad(this.page);
        },
        searchChange (params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
        },
        selectionChange (list) {
            this.selectionList = list;
        },
        selectionClear () {
            this.selectionList = [];
            this.$refs.crud.toggleSelection();
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage;
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange () {
            this.onLoad(this.page, this.query);
        },
        onLoad (page, params = {}) {
            this.loading = true;
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query), 1).then(res => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
                this.selectionClear();
            });
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query),
        1
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
        // 行单击
        handleRowClick (row) {
            // delete (row["name"]);
            var obj = row
            obj["name"] = "保安公司详细资料"
            this.$router.push({
                path: `/securityCompany/index`,
                query: obj,
            });
        },
    }
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安公司详细资料";
      this.$router.push({
        path: `/securityCompany/index`,
        query: obj,
      });
    },
  },
};
</script>
src/views/securityGuardManagement/dispatchChildoperable.vue
New file
@@ -0,0 +1,674 @@
<template>
  <div class="dispatchChildoperable">
    <basic-container>
      <avue-crud
        :option="option1"
        :data="data1"
        :page.sync="page1"
        ref="crudrec1"
        :table-loading="loading1"
        @row-save="rowSave1"
        @search-change="searchChange1"
        @search-reset="searchReset1"
        @row-update="rowUpdate1"
        @row-del="rowDel1"
        @selection-change="selectionChange1"
        @refresh-change="refreshChange1"
      >
      </avue-crud>
    </basic-container>
  </div>
</template>
<script>
import {
  // getdata,
  // adddata,
  // update,
  // remove,
  getdata1,
  adddata1,
  update1,
  remove1,
} from "@/api/dispatch/dispatch";
import { getDept } from "@/api/system/dept";
export default {
  data() {
    return {
      // typeTABS: {}, //标签页
      // optionTABS: {
      //   column: [
      //     {
      //       // icon: "el-icon-info",
      //       label: "派遣服务公司详情",
      //       prop: "tab1",
      //     },
      //     {
      //       // icon: "el-icon-info",
      //       label: "派遣记录",
      //       prop: "tab2",
      //     },
      //     // {
      //     //   icon: "el-icon-info",
      //     //   label: "选项卡3",
      //     //   prop: "tab3",
      //     // },
      //   ],
      // },
      // id: "", //记录归属id
      // //基本信息
      // //保安单位信息表单
      // obj0: {
      //   // title: "我是头部标题",
      // },
      // option0: {
      //   emptyBtn: false,
      //   submitBtn: false,
      //   gutter: 30,
      //   column: column,
      // },
      // loading: true, //派遣服务公司登记
      // selectionList: [],
      // page: {
      //   pageSize: 10,
      //   currentPage: 1,
      //   total: 0,
      // },
      // query: {},
      // data: [],
      // option: {
      //   card: true,
      //   searchSize: "mini",
      //   searchMenuSpan: 6,
      //   height: 547,
      //   menuWidth: 160,
      //   align: "center",
      //   selection: true,
      //   column: column,
      // },
      deptCategory: "",
      deptId: "",
      loading1: true, //派遣记录
      selectionList1: [],
      page1: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      query1: {},
      data1: [],
      option1: {
        // card: true,
        tip: false,
        index: true,
        menu: false,
        searchShowBtn: false,
        searchSize: "mini",
        searchMenuSpan: 8,
        height: 600,
        cellBtn: false,
        // addBtn: false,
        // menuWidth: 160,
        align: "center",
        // selection: true,
        column: [
          // 派遣服务公司登记
          // {
          //     label: "id",
          //     prop: "id",
          //     // search: true,
          //     // searchSpan: 4,
          //     // overHidden: true,
          //     // hide: true,
          //     // editDisplay: false,
          //     // addDisplay: false
          // },
          {
            label: "保安公司",
            prop: "deptId",
            labelWidth: 120,
            searchLabelWidth: 120,
            searchSpan: 5,
            dicUrl:
              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
            props: {
              label: "title",
              value: "id",
            },
            search: true,
            overHidden: true,
            type: "select",
            rules: [
              {
                required: true,
                message: "请输入保安公司",
                trigger: "blur",
              },
            ],
          },
          {
            label: "派遣单位",
            prop: "dispatcherCompany",
            addDisplay: false,
            editDisplay: false,
          },
          {
            label: "派遣单位",
            prop: "dispatcherUnitId",
            labelWidth: 120,
            searchLabelWidth: 120,
            dicUrl: "/api/dispatcherUnit/page-tree",
            props: {
              label: "name",
              value: "id",
            },
            hide: true,
            searchSpan: 5,
            search: true,
            overHidden: true,
            type: "tree",
            rules: [
              {
                required: true,
                message: "请输入保安公司",
                trigger: "blur",
              },
            ],
          },
          {
            label: "保安人名称",
            prop: "name",
            search: true,
            searchSpan: 5,
            labelWidth: 120,
            searchLabelWidth: 110,
            // overHidden: true
            rules: [
              {
                required: true,
                message: "请输入保安人名称",
                trigger: "click",
              },
            ],
          },
          {
            label: "身份证",
            prop: "cardid",
            labelWidth: 120,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入身份证",
                trigger: "click",
              },
            ],
            // search: true,
            // searchSpan: 4,
            // overHidden: true
          },
          // {
          //     label: "派遣人",
          //     prop: "dispatcher",
          //     // search: true,
          //     // searchSpan: 4,
          //     // overHidden: true
          // },
          {
            label: "派遣时间",
            prop: "dispatchertime",
            type: "date",
            format: "yyyy-MM-dd hh:mm:ss",
            valueFormat: "yyyy-MM-dd hh:mm:ss",
            labelWidth: 120,
            searchLabelWidth: 110,
            searchSpan: 4,
            // search: true,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入派遣时间",
                trigger: "click",
              },
            ],
            // overHidden: true
          },
          {
            label: "结束时间",
            prop: "endTime",
            type: "date",
            format: "yyyy-MM-dd hh:mm:ss",
            valueFormat: "yyyy-MM-dd hh:mm:ss",
            labelWidth: 120,
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入结束时间",
                trigger: "click",
              },
            ],
            // search: true,
            // searchSpan: 5,
            // overHidden: true
          },
          {
            label: "派遣地址",
            prop: "dispatcheraddress",
            labelWidth: 120,
            rules: [
              {
                required: true,
                message: "请输入派遣地址",
                trigger: "click",
              },
            ],
            // search: true,
            // searchSpan: 4,
            // overHidden: true
          },
          // {
          //     label: "派遣单位",
          //     // prop: "dispatcherCompany",
          //     prop: "tenantName",
          //     type: "tree",
          //     dicUrl: "/api/blade-system/dept/lazy-tree?parentId=0",
          //     props: {
          //         label: "title",
          //         value: "id"
          //     },
          //     // hide: !website.tenantMode,
          //     // addDisplay: website.tenantMode,
          //     // editDisplay: website.tenantMode,
          //     // viewDisplay: website.tenantMode,
          //     rules: [{
          //         required: true,
          //         message: "请输入派遣单位",
          //         trigger: "click"
          //     }],
          // search: true,
          // searchSpan: 4,
          // overHidden: true
          // },
        ],
      },
    };
  },
  computed: {
    // ids() {
    //   let ids = [];
    //   this.selectionList.forEach((ele) => {
    //     ids.push(ele.id);
    //   });
    //   return ids.join(",");
    // },
    ids1() {
      let ids1 = [];
      this.selectionList1.forEach((ele) => {
        ids1.push(ele.id);
      });
      return ids1.join(",");
    },
  },
  methods: {
    handleChangeTABS(column) {
      this.typeTABS = column;
      if (column.prop == "tab1") {
        this.loading1 = false;
        // this.onLoad(this.page);
      } else if (column.prop == "tab2") {
        // this.loading = false;
        console.log(document.getElementsByClassName("el-card__body")[0]);
        this.onLoad1(this.page1); //第二个表格不会自动执行
      }
      // this.$message.success(JSON.stringify(column));
    },
    //派遣服务公司登记
    // sizeChange(val) {
    //   this.page1.currentPage = 1;
    //   this.page1.pageSize = val;
    //   // this.getData();
    //   this.onLoad(this.page, this.query);
    //   //   this.$message.success("行数" + val);
    // },
    // currentChange(val) {
    //   this.page1.currentPage = val;
    //   // this.getData();
    //   this.onLoad(this.page, this.query);
    //   //   this.$message.success("页码" + val);
    // },
    // rowSave(form, done, loading) {
    //   var that = this;
    //   var form = this.data[0];
    //   delete form.id;
    //   for (var k = 0; k < 13; k++) {
    //     adddata(form).then(
    //       (res) => {
    //         this.onLoad(this.page);
    //         this.$message({
    //           type: "success",
    //           message: "操作成功!",
    //         });
    //         done();
    //       },
    //       (error) => {
    //         window.console.log(error);
    //         loading();
    //       }
    //     );
    //   }
    // },
    // searchChange(params, done) {
    //   this.query = params;
    //   this.page.currentPage = 1;
    //   this.onLoad(this.page, params);
    //   done();
    // },
    // searchReset() {
    //   this.query = {};
    //   this.onLoad(this.page);
    // },
    // rowUpdate(row, index, done, loading) {
    //   console.log(row);
    //   update(row).then(
    //     () => {
    //       this.onLoad(this.page);
    //       this.$message({
    //         type: "success",
    //         message: "操作成功!",
    //       });
    //       done();
    //     },
    //     (error) => {
    //       window.console.log(error);
    //       loading();
    //     }
    //   );
    // },
    // rowDel(row) {
    //   this.$confirm("确定将选择数据删除?", {
    //     confirmButtonText: "确定",
    //     cancelButtonText: "取消",
    //     type: "warning",
    //   })
    //     .then(() => {
    //       return remove(row.id);
    //     })
    //     .then(() => {
    //       this.onLoad(this.page);
    //       this.$message({
    //         type: "success",
    //         message: "操作成功!",
    //       });
    //     });
    // },
    // selectionChange(list) {
    //   this.selectionList = list;
    // },
    // handleDelete() {
    //   if (this.selectionList.length === 0) {
    //     this.$message.warning("请选择至少一条数据");
    //     return;
    //   }
    //   this.$confirm("确定将选择数据删除?", {
    //     confirmButtonText: "确定",
    //     cancelButtonText: "取消",
    //     type: "warning",
    //   })
    //     .then(() => {
    //       return remove(this.ids);
    //     })
    //     .then(() => {
    //       this.onLoad(this.page);
    //       this.$message({
    //         type: "success",
    //         message: "操作成功!",
    //       });
    //       this.$refs.crudrec.toggleSelection();
    //     });
    // },
    // refreshChange() {
    //   this.onLoad(this.page, this.query);
    // },
    // onLoad(page, params = {}) {
    //   this.loading = true;
    //   getdata(
    //     page.currentPage,
    //     page.pageSize,
    //     Object.assign(params, this.query)
    //   ).then((res) => {
    //     // console.log(res);
    //     const data = res.data.data;
    //     this.page.total = data.total;
    //     this.data = data.records;
    //     console.log(this.data);
    //     this.loading = false;
    //   });
    // },
    //派遣服务公司登记
    //派遣记录
    sizeChange1(val) {
      this.page1.currentPage = 1;
      this.page1.pageSize = val;
      // this.getData();
      this.onLoad1(this.page1, this.query1);
      //   this.$message.success("行数" + val);
    },
    currentChange1(val) {
      this.page1.currentPage = val;
      // this.getData();
      this.onLoad1(this.page1, this.query1);
      //   this.$message.success("页码" + val);
    },
    rowSave1(form, done, loading) {
      // var that = this;
      // var form = this.data1[0];
      // delete form.id;
      // for (var k = 0; k < 13; k++) {
      // form["deptId"] = form.tenantName;
      // form["tenantName"] = form.$tenantName;
      // form["dispatcherUnitId"] = this.id;
      // console.log(form);
      adddata1(form).then(
        (res) => {
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
      // }
    },
    searchChange1(params, done) {
      this.query1 = params;
      this.page1.currentPage = 1;
      this.onLoad1(this.page1, params);
      done();
    },
    searchReset1() {
      this.query = {};
      this.onLoad1(this.page1);
    },
    rowUpdate1(row, index, done, loading) {
      // row["deptId"] = row.tenantName;
      // row["tenantName"] = row.$tenantName;
      // row["dispatcherUnitId"] = this.id;
      // console.log(row, "row");
      update1(row).then(
        () => {
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel1(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove1(row.id);
        })
        .then(() => {
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    selectionChange1(list) {
      this.selectionList1 = list;
      // console.log(this.selectionList1.length);
    },
    handleDelete1() {
      console.log(this.selectionList1);
      if (this.selectionList1.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove1(this.ids1);
        })
        .then(() => {
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crudrec1.toggleSelection();
        });
    },
    refreshChange1() {
      // console.log(4534)
      this.onLoad1(this.page1, this.query1);
    },
    //
    onLoad1(page, params = {}) {
      this.loading1 = true;
      // params["cardid"] = this.cardid;
      // params["name"] = this.name;
      // params["dispatcherCompany"] = this.dispatcherCompany;
      // params["dispatcherUnitId"] = this.id;
      // console.log(params, "get");
      // console.log(page);
      getdata1(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        // console.log(res);
        const data = res.data.data;
        this.page1.total = data.total;
        this.data1 = data.records;
        console.log(this.data1, 1);
        this.loading1 = false;
      });
    },
    //派遣记录
    // saveLock(name, val) {
    //   localStorage.setItem(name, val);
    // },
    // readLock(name) {
    //   return localStorage.getItem(name);
    // },
  },
  mounted() {
    this.onLoad1(this.page1, this.query1);
    //去掉缓存
    // this.typeTABS = this.optionTABS.column[0];
    // var row = {};
    // if (this.readLock("paqiandata") != null) {
    //   row = JSON.parse(this.readLock("paqiandata"));
    //   this.obj0.name = row.name;
    //   for (var k in row) {
    //     this.obj0[k] = row[k];
    //   }
    //   console.log(this.obj0, 11111111);
    //   this.id = row.id;
    //   if (this.readLock("paqiandataS") != null) {
    //     var b = JSON.parse(this.readLock("paqiandataS"));
    //     var i = 0;
    //     for (var k in b) {
    //       if (b[k].name == row.name) {
    //         i = 1;
    //       }
    //     }
    //     if (i == 1) {
    //       // console.log("存在");
    //     } else {
    //       // console.log("已删除");
    //       this.obj0 = {};
    //       this.obj0.name = row.name + " 该派遣单位已删除";
    //       window.localStorage.removeItem("paqiandata");
    //       this.id = 1244241;
    //     }
    //   }
    // } else {
    //   // console.log("no");
    //   this.obj0.name = " 未选择派遣单位";
    // }
  },
  // onLoad(page, params = {}) {
  //   this.deptId = JSON.parse(
  //       window.localStorage.getItem("saber-userInfo")
  //     ).content.dept_id;
  //     //获取当前用户部门信息,判断是否为公安,如果是公安,则只能查看公告信息
  //     var that = this;
  //     getDept(this.deptId).then((res) => {
  //       var deptCategory = res.data.data.deptCategory;
  //       deptCategory == 1
  //         ? (that.deptCategory = true)
  //         : (that.deptCategory = false);
  //       if (that.deptCategory) {
  //         params["deptId"] = this.deptId;
  //       }
  //       let values = {
  //         ...params,
  //       };
  //    })
  // }
};
</script>
<style lang="scss" scoped>
.dispatch {
  width: 100%;
  height: 100%;
  //   border: 1px solid #000;
  box-sizing: border-box;
}
.el-collapse-item {
  padding-top: 15px !important;
}
</style>
src/views/securityGuardManagement/register.vue
New file
@@ -0,0 +1,995 @@
/*
 * @Author: Morpheus
 * @Date: 2021-07-05 16:31:54
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-07-10 15:41:13
 * menu-name 保安员注册查询
 */
<template>
  <div>
    <el-row>
      <el-col :span="3">
        <div class="box">
          <el-scrollbar>
            <basic-container>
              <avue-tree
                :option="treeOption"
                :data="treeData"
                @node-click="nodeClick"
              />
            </basic-container>
          </el-scrollbar>
        </div>
      </el-col>
      <el-col :span="21" class="registersss">
        <basic-container>
          <avue-crud
            :option="option"
            :search.sync="search"
            :table-loading="loading"
            :data="data"
            ref="crud"
            v-model="form"
            :permission="permissionList"
            @row-save="rowSave"
            :before-open="beforeOpen"
            :page.sync="page"
            @search-change="searchChange"
            @search-reset="searchReset"
            @selection-change="selectionChange"
            @current-change="currentChange"
            @size-change="sizeChange"
            @refresh-change="refreshChange"
            @row-click="handleRowClick"
            @on-load="onLoad"
          >
            <!-- <template slot-scope="{row}"
                              slot="tenantName">
                        <el-tag>{{row.tenantName}}</el-tag>
                    </template>
                    <template slot-scope="{row}"
                              slot="roleName">
                        <el-tag>{{row.roleName}}</el-tag>
                    </template>
                    <template slot-scope="{row}"
                              slot="deptName">
                        <el-tag>{{row.deptName}}</el-tag>
                    </template>
                    <template slot-scope="{row}"
                              slot="userTypeName">
                        <el-tag>{{row.userTypeName}}</el-tag>
                    </template> -->
            <template slot-scope="{ type, size, row }" slot="menu">
              <el-button
                :size="size"
                :type="type"
                class="zhengJian-icon"
                @click.stop="honor(row)"
                >荣誉录入</el-button
              >
              <el-button
                :size="size"
                :type="type"
                class="zhengJian-icon"
                @click.stop="handleViewCredentials(row)"
                >查看证件</el-button
              >
              <el-button
                icon="icon-zhengjian"
                :size="size"
                :type="type"
                class="zhengJian-icon"
                @click.stop="handleCredentials(row)"
                >证件吊销</el-button
              >
            </template>
          </avue-crud>
          <el-dialog
            title="用户数据导入"
            append-to-body
            :visible.sync="excelBox"
            width="555px"
          >
            <avue-form
              :option="excelOption"
              v-model="excelForm"
              :upload-after="uploadAfter"
            >
              <template slot="excelTemplate">
                <el-button type="primary" @click="handleTemplate">
                  点击下载<i class="el-icon-download el-icon--right"></i>
                </el-button>
              </template>
            </avue-form>
          </el-dialog>
        </basic-container>
      </el-col>
    </el-row>
    <el-dialog
      title="荣誉录入"
      :visible.sync="dialogVisible"
      width="60%"
      :before-close="handleClose"
      :modal-append-to-body="false"
      center
    >
      <!-- <span>这是一段信息</span> -->
      <avue-form
        :option="optionf"
        v-model="objf"
        @submit="submitf"
        @error="errorf"
      >
        <template slot-scope="{ type, size, row }" slot="menuForm">
          <el-button
            :size="size"
            icon="el-icon-error"
            :type="type"
            @click="close(row)"
            >关闭</el-button
          >
        </template>
      </avue-form>
      <!-- <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        >
      </span> -->
    </el-dialog>
  </div>
</template>
<script>
import { getUser, add, updateHold } from "@/api/management/user";
import { getListSecurity } from "@/api/system/user";
import { getDeptLazyTree } from "@/api/Jurs/jurs";
// import { getDeptTree, getDeptLazyTree } from "@/api/system/dept";
import { getDeptTree } from "@/api/system/dept";
import { getRoleTree } from "@/api/system/role";
import { getPostList } from "@/api/system/post";
import { mapGetters } from "vuex";
import website from "@/config/website";
import { getToken } from "@/util/auth";
export default {
  data() {
    const validatePass = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入密码"));
      } else {
        callback();
      }
    };
    const validatePass2 = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"));
      } else if (value !== this.form.password) {
        callback(new Error("两次输入密码不一致!"));
      } else {
        callback();
      }
    };
    return {
      objf: {},
      optionf: {
        column: [
          {
            label: "身份证号码",
            prop: "cardid",
            span: 24,
            labelWidth: 110,
            rules: [
              {
                required: true,
                message: "请输入身份证号码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "荣誉名称",
            prop: "sex",
            span: 24,
            labelWidth: 110,
            rules: [
              {
                required: true,
                message: "请输入荣誉名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "荣誉内容",
            prop: "sex1",
            span: 24,
            type: "textarea",
            labelWidth: 110,
          },
          {
            label: "授予单位名称",
            prop: "sex2",
            span: 24,
            labelWidth: 110,
          },
        ],
      },
      dialogVisible: false,
      form: {},
      search: {},
      excelBox: false,
      initFlag: true,
      selectionList: [],
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      init: {
        roleTree: [],
        deptTree: [],
      },
      treeDeptId: "",
      jurisdiction: "",
      treeData: [],
      treeOption: {
        nodeKey: "id",
        defaultExpandAll: true,
        lazy: true,
        treeLoad: function (node, resolve) {
          const parentId = node.level === 0 ? 0 : node.data.id;
          getDeptLazyTree(parentId).then((res) => {
            resolve(
              res.data.data.map((item) => {
                return {
                  ...item,
                  leaf: !item.hasChildren,
                };
              })
            );
          });
        },
        addBtn: false,
        menu: false,
        size: "small",
        props: {
          labelText: "标题",
          label: "title",
          value: "value",
          children: "children",
        },
      },
      option: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        align: "center",
        height: "auto",
        calcHeight: 80,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 4,
        index: true,
        viewBtn: false,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 280,
        column: [
          {
            label: "保安姓名",
            prop: "realName",
            search: true,
            searchSpan: 4,
            display: false,
            width: 78,
          },
          {
            label: "性别",
            prop: "sex",
            type: "select",
            // search: true,
            searchSpan: 4,
            searchLabelWidth: 50,
            dicData: [
              {
                label: "女",
                value: 2,
              },
              {
                label: "男",
                value: 1,
              },
            ],
            slot: true,
            display: false,
            width: 48,
          },
          {
            label: "保安公司",
            prop: "deptName",
            // width: 120,
            search: true,
            searchSpan: 4,
            overHidden: true,
            slot: true,
            display: false,
          },
          {
            label: "保安证编号",
            prop: "securitynumber",
            display: false,
            searchSpan: 4,
            searchLabelWidth: 110,
            search: true,
          },
          {
            label: "身份证号",
            prop: "cardid",
            slot: true,
            display: false,
            width: 138,
          },
          {
            label: "联系方式",
            prop: "phone",
            slot: true,
            display: false,
            width: 92,
          },
          {
            label: "联系地址",
            prop: "address",
            slot: true,
            display: false,
            hide: true,
          },
          {
            label: "入职时间",
            prop: "rtime",
            slot: true,
            display: false,
            width: 82,
          },
          {
            label: "所属角色",
            prop: "roleName",
            slot: true,
            display: false,
            width: 78,
            hide: true,
          },
          {
            label: "所属辖区",
            prop: "jurisdiction",
            // multiple: true,
            minWidth: 60,
            type: "tree",
            dicUrl: "/api/jurisdiction/lazy-tree?parentId=0",
            props: {
              label: "title",
              value: "id",
            },
            checkStrictly: true,
            slot: true,
            rules: [
              {
                required: true,
                message: "请选择所属辖区",
                trigger: "click",
              },
            ],
          },
          {
            label: "是否在职",
            prop: "status",
            type: "select",
            search: true,
            searchSpan: 3,
            dicData: [
              {
                label: "否",
                value: 0,
              },
              {
                label: "是",
                value: 1,
              },
            ],
            slot: true,
            display: false,
            width: 70,
          },
          {
            label: "是否持证",
            prop: "hold",
            type: "select",
            search: true,
            searchSpan: 3,
            dicData: [
              {
                label: "是",
                value: "0",
              },
              {
                label: "否",
                value: "1",
              },
              {
                label: "已吊销",
                value: "2",
              },
            ],
            slot: true,
            display: false,
            width: 70,
          },
        ],
        group: [
          {
            label: "基础信息",
            prop: "baseInfo",
            icon: "el-icon-user-solid",
            column: [
              {
                label: "所属机构",
                prop: "tenantId",
                type: "tree",
                dicUrl: "/api/blade-system/tenant/select",
                props: {
                  label: "tenantName",
                  value: "tenantId",
                },
                hide: !website.tenantMode,
                addDisplay: website.tenantMode,
                editDisplay: website.tenantMode,
                viewDisplay: website.tenantMode,
                rules: [
                  {
                    required: true,
                    message: "请输入所属机构",
                    trigger: "click",
                  },
                ],
                span: 24,
              },
              {
                label: "登录账号",
                prop: "account",
                rules: [
                  {
                    required: true,
                    message: "请输入登录账号",
                    trigger: "blur",
                  },
                ],
              },
              {
                label: "用户平台",
                type: "select",
                dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
                props: {
                  label: "dictValue",
                  value: "dictKey",
                },
                dataType: "number",
                slot: true,
                prop: "userType",
                rules: [
                  {
                    required: true,
                    message: "请选择用户平台",
                    trigger: "blur",
                  },
                ],
              },
              {
                label: "密码",
                prop: "password",
                hide: true,
                editDisplay: false,
                viewDisplay: false,
                rules: [
                  { required: true, validator: validatePass, trigger: "blur" },
                ],
              },
              {
                label: "确认密码",
                prop: "password2",
                hide: true,
                editDisplay: false,
                viewDisplay: false,
                rules: [
                  { required: true, validator: validatePass2, trigger: "blur" },
                ],
              },
            ],
          },
          {
            label: "详细信息",
            prop: "detailInfo",
            icon: "el-icon-s-order",
            column: [
              {
                label: "用户昵称",
                prop: "name",
                hide: true,
                rules: [
                  {
                    required: true,
                    message: "请输入用户昵称",
                    trigger: "blur",
                  },
                ],
              },
              {
                label: "用户姓名",
                prop: "realName",
                rules: [
                  {
                    required: true,
                    message: "请输入用户姓名",
                    trigger: "blur",
                  },
                  {
                    min: 2,
                    max: 5,
                    message: "姓名长度在2到5个字符",
                  },
                ],
              },
              {
                label: "手机号码",
                prop: "phone",
                overHidden: true,
              },
              {
                label: "电子邮箱",
                prop: "email",
                hide: true,
                overHidden: true,
              },
              {
                label: "用户性别",
                prop: "sex",
                type: "select",
                dicData: [
                  {
                    label: "男",
                    value: 1,
                  },
                  {
                    label: "女",
                    value: 2,
                  },
                  {
                    label: "未知",
                    value: 3,
                  },
                ],
                hide: true,
              },
              {
                label: "用户生日",
                type: "date",
                prop: "birthday",
                format: "yyyy-MM-dd hh:mm:ss",
                valueFormat: "yyyy-MM-dd hh:mm:ss",
                hide: true,
              },
              {
                label: "账号状态",
                prop: "statusName",
                hide: true,
                display: false,
              },
            ],
          },
          {
            label: "职责信息",
            prop: "dutyInfo",
            icon: "el-icon-s-custom",
            column: [
              {
                label: "用户编号",
                prop: "code",
              },
              {
                label: "所属角色",
                prop: "roleId",
                multiple: true,
                type: "tree",
                dicData: [],
                props: {
                  label: "title",
                },
                checkStrictly: true,
                slot: true,
                rules: [
                  {
                    required: true,
                    message: "请选择所属角色",
                    trigger: "click",
                  },
                ],
              },
              {
                label: "所属单位",
                prop: "deptId",
                type: "tree",
                multiple: true,
                dicData: [],
                props: {
                  label: "title",
                },
                checkStrictly: true,
                slot: true,
                rules: [
                  {
                    required: true,
                    message: "请选择所属部门",
                    trigger: "click",
                  },
                ],
              },
              {
                label: "所属岗位",
                prop: "postId",
                type: "tree",
                multiple: true,
                dicData: [],
                props: {
                  label: "postName",
                  value: "id",
                },
                rules: [
                  {
                    required: true,
                    message: "请选择所属岗位",
                    trigger: "click",
                  },
                ],
              },
            ],
          },
        ],
      },
      data: [],
      platformQuery: {},
      platformSelectionList: [],
      excelForm: {},
      excelOption: {
        submitBtn: false,
        emptyBtn: false,
        column: [
          {
            label: "模板上传",
            prop: "excelFile",
            type: "upload",
            drag: true,
            loadText: "模板上传中,请稍等",
            span: 24,
            propsHttp: {
              res: "data",
            },
            tip: "请上传 .xls,.xlsx 标准格式文件",
            action: "/api/blade-user/import-user",
          },
          {
            label: "数据覆盖",
            prop: "isCovered",
            type: "switch",
            align: "center",
            width: 80,
            dicData: [
              {
                label: "否",
                value: 0,
              },
              {
                label: "是",
                value: 1,
              },
            ],
            value: 0,
            slot: true,
            rules: [
              {
                required: true,
                message: "请选择是否覆盖",
                trigger: "blur",
              },
            ],
          },
          {
            label: "模板下载",
            prop: "excelTemplate",
            formslot: true,
            span: 24,
          },
        ],
      },
    };
  },
  watch: {
    "form.tenantId"() {
      if (this.form.tenantId !== "" && this.initFlag) {
        this.initData(this.form.tenantId);
      }
    },
    "excelForm.isCovered"() {
      if (this.excelForm.isCovered !== "") {
        const column = this.findObject(this.excelOption.column, "excelFile");
        column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
      }
    },
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.user_add, false),
        viewBtn: this.vaildData(this.permission.user_view, false),
        delBtn: this.vaildData(this.permission.user_delete, false),
        editBtn: this.vaildData(this.permission.user_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  mounted() {
    // 非租户模式默认加载管理组数据
    if (!website.tenantMode) {
      this.initData(website.tenantId);
    }
  },
  methods: {
    close(row) {
      this.dialogVisible = false;
    },
    submit(form, done) {
      this.$message.success(JSON.stringify(form));
      done();
    },
    error(err) {
      this.$message.success("请查看控制台");
      console.log(err);
    },
    handleClose(done) {
      this.objf = {};
      done();
    },
    honor(row) {
      //打开荣誉录入
      // console.log(row);
      this.objf = {
        cardid: row.cardid,
      };
      this.dialogVisible = true;
    },
    nodeClick(data) {
      //   this.treeDeptId = data.id;
      this.jurisdiction = data.id;
      this.page.currentPage = 1;
      this.onLoad(this.page);
    },
    initData(tenantId) {
      getRoleTree(tenantId).then((res) => {
        const column = this.findObject(this.option.group, "roleId");
        column.dicData = res.data.data;
      });
      getDeptTree(tenantId).then((res) => {
        const column = this.findObject(this.option.group, "deptId");
        column.dicData = res.data.data;
      });
      getPostList(tenantId).then((res) => {
        const column = this.findObject(this.option.group, "postId");
        column.dicData = res.data.data;
      });
    },
    rowSave(row, done, loading) {
      row.deptId = row.deptId.join(",");
      row.roleId = row.roleId.join(",");
      row.postId = row.postId.join(",");
      add(row).then(
        () => {
          this.initFlag = false;
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    searchReset() {
      this.query = {};
      this.treeDeptId = "";
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    uploadAfter(res, done, loading, column) {
      window.console.log(column);
      this.excelBox = false;
      this.refreshChange();
      done();
    },
    handleTemplate() {
      window.open(
        `/api/blade-user/export-template?${
          this.website.tokenHeader
        }=${getToken()}`
      );
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getUser(this.form.id).then((res) => {
          this.form = res.data.data;
          if (this.form.hasOwnProperty("deptId")) {
            this.form.deptId = this.form.deptId.split(",");
          }
          if (this.form.hasOwnProperty("roleId")) {
            this.form.roleId = this.form.roleId.split(",");
          }
          if (this.form.hasOwnProperty("postId")) {
            this.form.postId = this.form.postId.split(",");
          }
        });
      }
      this.initFlag = true;
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["jurisdiction"] = this.jurisdiction;
      getListSecurity(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    platformSelectionClear() {
      this.platformSelectionList = [];
      this.$refs.platformCrud.toggleSelection();
    },
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安详细信息";
      this.$router.push({
        path: `/management/index`,
        query: obj,
      });
      var flag = false,
        i = 0,
        ind = null;
      this.$store.state.tags.tagList.forEach((item, index) => {
        if (item.label == "保安详细信息") {
          if (flag == false) {
            ind = index;
            flag = true;
          }
          i++;
        }
      });
      if (i > 1) {
        this.$store.state.tags.tagList.splice(ind, 1);
      }
    },
    //证件查看
    handleViewCredentials(row) {
      var obj = row;
      obj["name"] = "保安证件信息";
      this.$router.push({
        path: `/management/idinformation`,
        query: obj,
      });
    },
    // 证件吊销事件
    handleCredentials(row) {
      if (row.hold == 1) {
        this.$message({
          type: "info",
          message: "证件未拥有!",
        });
      } else if (row.hold == 2) {
        this.$message({
          type: "info",
          message: "证件已吊销!",
        });
      } else {
        this.$confirm("此操作将吊销该人员的证件, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            updateHold(2, row.cardid).then((res) => {
              console.log(res);
              this.$message({
                type: "success",
                message: "删除成功!",
              });
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消删除",
            });
          });
      }
    },
  },
};
</script>
<style lang='scss' scoped>
.box {
  height: 800px;
}
.el-scrollbar {
  height: 100%;
}
.box .el-scrollbar__wrap {
  overflow: scroll;
}
</style>
Diff truncated after the above file
src/views/system/client.vue src/views/system/dept.vue src/views/system/dict.vue src/views/system/dictbiz.vue src/views/system/menu.vue src/views/system/post.vue src/views/system/tenant.vue src/views/system/topmenu.vue src/views/system/user.vue src/views/workreport/workreply.vue src/views/workreport/workreport.vue