From 5eb297ca090776f5e5e4daec219892f8c19592b4 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Sat, 25 Dec 2021 08:41:33 +0800
Subject: [PATCH] 保安公司列表,单位详情修改
---
src/views/securityUnit/localCompany.vue | 531 +--
src/views/securityUnitChild/manager.vue | 337 ++
src/views/securityGuard/securityGuard.vue | 34
public/securityInfo.html | 150
src/views/securityUnit/selfRecruitedSecurityGuard.vue | 514 +--
src/views/securityUnit/armedEscort.vue | 521 +--
src/views/securityUnit/data.js | 221 +
public/securityInfos1.html | 218 +
src/views/securityUnitChild/index copy.vue | 1182 ++++++++++
src/api/securityUnit/securityUnit.js | 266 +-
src/views/securityUnit/transRegionalcompany.vue | 512 +--
src/views/securityUnitChild/index.vue | 1231 ++--------
src/views/securityUnitChild/shareholder.vue | 383 +++
public/img/securityInfo/security.png | 0
src/views/securityUnitChild/data.js | 418 +--
src/views/securityUnit/securityTraining.vue | 534 +--
16 files changed, 3,940 insertions(+), 3,112 deletions(-)
diff --git a/public/img/securityInfo/security.png b/public/img/securityInfo/security.png
new file mode 100644
index 0000000..8b8991c
--- /dev/null
+++ b/public/img/securityInfo/security.png
Binary files differ
diff --git a/public/securityInfo.html b/public/securityInfo.html
index a9b3ea8..dff7853 100644
--- a/public/securityInfo.html
+++ b/public/securityInfo.html
@@ -13,11 +13,11 @@
justify-content: center;
flex-direction: column;
/* background-color: rgba(42, 66, 110, 0.8); */
- background: #0ED2F7;
+ /* background: #0ED2F7; */
/* fallback for old browsers */
- background: -webkit-linear-gradient(to left, #B2FEFA, #0ED2F7);
+ /* background: -webkit-linear-gradient(to left, #B2FEFA, #0ED2F7); */
/* Chrome 10-25, Safari 5.1-6 */
- background: linear-gradient(to left, #B2FEFA, #0ED2F7);
+ /* background: linear-gradient(to left, #B2FEFA, #0ED2F7); */
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
width: 100%;
height: 100%;
@@ -25,13 +25,14 @@
.top {
width: 100%;
- height: 224px;
+ margin-top: 15px;
+ /* height: 224px; */
/* background-color: aquamarine; */
- background: #0BB9C8;
+ /* background: #0BB9C8; */
/* fallback for old browsers */
- background: -webkit-linear-gradient(to left, #0BB9C8, #0cd9e7, #0cd9e7, #0BB9C8);
+ /* background: -webkit-linear-gradient(to left, #0BB9C8, #0cd9e7, #0cd9e7, #0BB9C8); */
/* Chrome 10-25, Safari 5.1-6 */
- background: linear-gradient(to left, #0BB9C8, #0cd9e7, #0cd9e7, #0BB9C8);
+ /* background: linear-gradient(to left, #0BB9C8, #0cd9e7, #0cd9e7, #0BB9C8); */
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
display: flex;
align-items: center;
@@ -40,51 +41,70 @@
}
.avatar {
- width: 80px;
- height: 80px;
- border-radius: 50px;
+ width: 98%;
+ height: 140px;
+ border-radius: 1px;
}
.avatar img {
width: 100%;
height: 100%;
- border-radius: 50px;
+ border-radius: 3px;
}
.realName {
margin-top: 15px;
- font-size: 16px;
+ font-size: 2rem;
letter-spacing: 1px;
color: #fff;
}
.content {
- margin: 5px 0;
- padding: 5px;
+ /* margin: 5px 0; */
+ /* padding: 5px; */
width: 95%;
- background-color: rgba(65, 64, 66, 0.1);
- border-radius: 5px;
+ /* background-color: rgba(65, 64, 66, 0.1); */
+ /* border-radius: 5px; */
display: flex;
flex-direction: column;
}
.row-content {
width: 100%;
- height: 60px;
+ height: 3.2rem;
/* background-color: seashell; */
display: flex;
align-items: center;
/* justify-content: center; */
- color: #fff;
+ color: #939393;
margin: 0 auto;
- border-bottom: 1px solid rgba(255, 255, 255, 0.5);
+ border-bottom: 1px solid rgba(220, 220, 220, 0.4);
+ }
+
+ .row-contents {
+ width: 100%;
+ height: 3.2rem;
+ /* background-color: seashell; */
+ display: flex;
+ align-items: center;
+ /* justify-content: center; */
+ color: #939393;
+ margin: 0 auto;
}
.title {
margin-left: 4%;
display: inline-block;
- width: 29%;
+ width: 30%;
min-width: 80px;
+ font-size: 0.9rem;
+ font-weight: 550;
+ }
+
+ .content-data {
+ position: absolute;
+ right: 1.8rem;
+ font-size: 0.95rem;
}
</style>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
@@ -94,6 +114,7 @@
<body>
<div class="securityInfo">
+
<!-- <div class="top">
<div class="avatar">
<img src="./img/bazbj.png">
@@ -111,20 +132,6 @@
<span class="title">公司名称</span>
<span> 南昌市保安服务公司</span>
</div>
- <div class="row-content">
- <span class="title">性别</span>
- <span> 男</span>
- </div>
- <div class="row-content">
- <span class="title">年龄</span>
- <span> 50</span>
- </div>
- <div class="row-content">
- <span class="title">保安证编号</span>
- <span> 赣洪202100001</span>
- </div>
-
-
</div> -->
</div>
<script>
@@ -135,12 +142,6 @@
return null;
};
var securityNumber = getData("securityNumber");
- // var realName = getData("realName");
- // var age = getData("age");
- // var sex = getData("sex");
- // var deptName = getData("deptName");
- // var avatar = getData("avatar");
- // alert(securityNumber);
axios.get('http://223.82.109.183:2080/api/qrCode/getUserInfo?securityNumber=' + securityNumber).then(function(res) {
@@ -148,62 +149,75 @@
var data = res.data;
// console.log(data, 456);
+ //计算生日
+ var birthday = data.cardid.substring(6, 10) + "." + data.cardid.substring(10, 12) + "." + data.cardid.substring(12, 14);
-
+ //计算发证机关
+ var fzjg = "";
+ if (data.securitynumber.indexOf("赣") != -1) {
+ fzjg = "南昌市公安局"
+ }
var str = `<div class="top">
<div class="avatar">
- <img src="${data.avatar}">
- </div>
- <div class="realName">
- <span>${data.realName}</span>
+ <img src="img/securityInfo/security.png">
</div>
</div>
<div class="content">
<div class="row-content">
- <span class="title">名 称</span>
- <span> ${data.realName}</span>
+ <span class="title">姓名:</span>
+ <span class="content-data"> ${data.realName}</span>
</div>
<div class="row-content">
- <span class="title">性 别</span>
- <span> ${data.sex == 1 ? '男' : data.sex == 2 ? '女' : ''}</span>
+ <span class="title">性别:</span>
+ <span class="content-data"> ${data.sex == 1 ? '男' : data.sex == 2 ? '女' : ''}</span>
</div>
<div class="row-content">
- <span class="title">年 龄</span>
- <span> ${data.age}</span>
+ <span class="title">联系电话:</span>
+ <span class="content-data"> ${data.phone}</span>
+ </div>
+ <div class="row-content">
+ <span class="title">身份证号:</span>
+ <span class="content-data"> ${data.cardid}</span>
+ </div>
+ <div class="row-content">
+ <span class="title">出身日期:</span>
+ <span class="content-data"> ${birthday}</span>
</div>
<div class="row-content">
- <span class="title">籍 贯</span></span></span>
- <span> ${data.nativeplace}</span>
+ <span class="title">年龄:</span>
+ <span class="content-data"> ${data.age}</span>
</div>
<div class="row-content">
- <span class="title">联系电话</span>
- <span> ${data.phone}</span>
+ <span class="title">发证机关:</span>
+ <span class="content-data"> ${fzjg}</span>
</div>
<div class="row-content">
- <span class="title">公司名称</span>
- <span> ${data.deptName}</span>
+ <span class="title">保安证编号:</span>
+ <span class="content-data"> ${data.securitynumber}</span>
</div>
<div class="row-content">
- <span class="title">保安证编号</span>
- <span> ${data.securitynumber}</span>
+ <span class="title">公司名称:</span>
+ <span class="content-data"> ${data.deptName}</span>
+ </div>
+
+
+ <div class="row-content">
+ <span class="title">派遣单位名称:</span>
+ <span class="content-data"> ${data.dispatchUnitName}</span>
</div>
<div class="row-content">
- <span class="title">派遣单位名称</span>
- <span> ${data.dispatchUnitName}</span>
+ <span class="title">派遣开始时间:</span>
+ <span class="content-data"> ${data.dispatchStartTime}</span>
</div>
- <div class="row-content">
- <span class="title">派遣开始时间</span>
- <span> ${data.dispatchStartTime}</span>
- </div>
- <div class="row-content">
- <span class="title">派遣结束时间</span>
- <span> ${data.dispatchEndTime}</span>
+ <div class="row-contents">
+ <span class="title">派遣结束时间:</span>
+ <span class="content-data"> ${data.dispatchEndTime}</span>
</div>
</div>`
diff --git a/public/securityInfos1.html b/public/securityInfos1.html
new file mode 100644
index 0000000..a9b3ea8
--- /dev/null
+++ b/public/securityInfos1.html
@@ -0,0 +1,218 @@
+<!DOCTYPE html>
+<html lang="en">
+<!-- 保安員信息 -->
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <style>
+ .securityInfo {
+ color: #000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ /* background-color: rgba(42, 66, 110, 0.8); */
+ background: #0ED2F7;
+ /* fallback for old browsers */
+ background: -webkit-linear-gradient(to left, #B2FEFA, #0ED2F7);
+ /* Chrome 10-25, Safari 5.1-6 */
+ background: linear-gradient(to left, #B2FEFA, #0ED2F7);
+ /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
+ width: 100%;
+ height: 100%;
+ }
+
+ .top {
+ width: 100%;
+ height: 224px;
+ /* background-color: aquamarine; */
+ background: #0BB9C8;
+ /* fallback for old browsers */
+ background: -webkit-linear-gradient(to left, #0BB9C8, #0cd9e7, #0cd9e7, #0BB9C8);
+ /* Chrome 10-25, Safari 5.1-6 */
+ background: linear-gradient(to left, #0BB9C8, #0cd9e7, #0cd9e7, #0BB9C8);
+ /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ }
+
+ .avatar {
+ width: 80px;
+ height: 80px;
+ border-radius: 50px;
+ }
+
+ .avatar img {
+ width: 100%;
+ height: 100%;
+ border-radius: 50px;
+ }
+
+ .realName {
+ margin-top: 15px;
+ font-size: 16px;
+ letter-spacing: 1px;
+ color: #fff;
+ }
+
+ .content {
+ margin: 5px 0;
+ padding: 5px;
+ width: 95%;
+ background-color: rgba(65, 64, 66, 0.1);
+ border-radius: 5px;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .row-content {
+ width: 100%;
+ height: 60px;
+ /* background-color: seashell; */
+ display: flex;
+ align-items: center;
+ /* justify-content: center; */
+ color: #fff;
+ margin: 0 auto;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.5);
+ }
+
+ .title {
+ margin-left: 4%;
+ display: inline-block;
+ width: 29%;
+ min-width: 80px;
+ }
+ </style>
+ <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+ <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
+</head>
+
+
+<body>
+ <div class="securityInfo">
+ <!-- <div class="top">
+ <div class="avatar">
+ <img src="./img/bazbj.png">
+ </div>
+ <div class="realName">
+ <span>張三</span>
+ </div>
+ </div>
+ <div class="content">
+ <div class="row-content">
+ <span class="title">名称</span>
+ <span> 张三</span>
+ </div>
+ <div class="row-content">
+ <span class="title">公司名称</span>
+ <span> 南昌市保安服务公司</span>
+ </div>
+ <div class="row-content">
+ <span class="title">性别</span>
+ <span> 男</span>
+ </div>
+ <div class="row-content">
+ <span class="title">年龄</span>
+ <span> 50</span>
+ </div>
+ <div class="row-content">
+ <span class="title">保安证编号</span>
+ <span> 赣洪202100001</span>
+ </div>
+
+
+ </div> -->
+ </div>
+ <script>
+ var getData = function(name) {
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
+ var r = window.location.search.substr(1).match(reg);
+ if (r != null) return decodeURI(r[2]);
+ return null;
+ };
+ var securityNumber = getData("securityNumber");
+ // var realName = getData("realName");
+ // var age = getData("age");
+ // var sex = getData("sex");
+ // var deptName = getData("deptName");
+ // var avatar = getData("avatar");
+ // alert(securityNumber);
+
+
+ axios.get('http://223.82.109.183:2080/api/qrCode/getUserInfo?securityNumber=' + securityNumber).then(function(res) {
+ // axios.get('http://192.168.0.114:81/qrCode/getUserInfo?securityNumber=赣洪202115423').then(function(res) {
+
+ var data = res.data;
+ // console.log(data, 456);
+
+
+ var str = `<div class="top">
+ <div class="avatar">
+ <img src="${data.avatar}">
+ </div>
+ <div class="realName">
+ <span>${data.realName}</span>
+ </div>
+ </div>
+ <div class="content">
+ <div class="row-content">
+ <span class="title">名 称</span>
+ <span> ${data.realName}</span>
+ </div>
+
+ <div class="row-content">
+ <span class="title">性 别</span>
+ <span> ${data.sex == 1 ? '男' : data.sex == 2 ? '女' : ''}</span>
+ </div>
+
+ <div class="row-content">
+ <span class="title">年 龄</span>
+ <span> ${data.age}</span>
+ </div>
+
+ <div class="row-content">
+ <span class="title">籍 贯</span></span></span>
+ <span> ${data.nativeplace}</span>
+ </div>
+
+ <div class="row-content">
+ <span class="title">联系电话</span>
+ <span> ${data.phone}</span>
+ </div>
+
+ <div class="row-content">
+ <span class="title">公司名称</span>
+ <span> ${data.deptName}</span>
+ </div>
+
+ <div class="row-content">
+ <span class="title">保安证编号</span>
+ <span> ${data.securitynumber}</span>
+ </div>
+ <div class="row-content">
+ <span class="title">派遣单位名称</span>
+ <span> ${data.dispatchUnitName}</span>
+ </div>
+ <div class="row-content">
+ <span class="title">派遣开始时间</span>
+ <span> ${data.dispatchStartTime}</span>
+ </div>
+ <div class="row-content">
+ <span class="title">派遣结束时间</span>
+ <span> ${data.dispatchEndTime}</span>
+ </div>
+
+ </div>`
+
+ var dom = $('.securityInfo');
+ dom.empty();
+ dom.append(str);
+ });
+ </script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/src/api/securityUnit/securityUnit.js b/src/api/securityUnit/securityUnit.js
index 9791802..3a99c02 100644
--- a/src/api/securityUnit/securityUnit.js
+++ b/src/api/securityUnit/securityUnit.js
@@ -1,183 +1,185 @@
import request from '@/router/axios';
export const getdata = (current, size, params) => {
- return request({
- url: '/api/information/page',
- // url: 'http://192.168.0.104:80/information/page',
- method: 'get',
- params: {
- ...params,
- current,
- size,
- }
- })
+ return request({
+ url: '/api/information/page',
+ method: 'get',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
}
export const getOncedata = (params) => {
- return request({
- url: '/api/information/detail',
- // url: 'http://192.168.0.104:80/information/page',
- method: 'get',
- params: {
- ...params,
- // current,
- // size,
- }
- })
+ return request({
+ url: '/api/information/detail',
+ method: 'get',
+ params: {
+ ...params,
+ }
+ })
}
export const adddata = (row) => {
- return request({
- url: '/api/information/save',
- // url: 'http://192.168.0.104:80/information/save',
- method: 'post',
- data: row
- })
+ return request({
+ url: '/api/information/save',
+ method: 'post',
+ data: row
+ })
}
export const update = (row) => {
- return request({
- url: '/api/information/update',
- // url: 'http://192.168.0.104:80/information/update',
- method: 'post',
- data: row
- })
+ return request({
+ url: '/api/information/update',
+ method: 'post',
+ data: row
+ })
}
export const remove = (ids, departmentid) => {
- console.log(ids)
- return request({
- url: '/api/information/remove',
- // url: 'http://192.168.0.104:80/information/remove',
- method: 'post',
- params: {
- creditcode: ids,
- departmentid: departmentid
- },
- })
+ console.log(ids)
+ return request({
+ url: '/api/information/remove',
+ method: 'post',
+ params: {
+ creditcode: ids,
+ departmentid: departmentid
+ },
+ })
}
export const getdata1 = (current, size, params) => {
- return request({
- url: '/api/shareholder/page',
- // url: 'http://192.168.0.104:80/shareholder/page',
- method: 'get',
- params: {
- ...params,
- current,
- size,
- }
- })
+ return request({
+ url: '/api/shareholder/page',
+ method: 'get',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
}
export const getdataOnce1 = (current, size, params) => {
- return request({
- url: '/api/shareholder/selectShareholderInfo',
- // url: 'http://192.168.0.104:80/shareholder/selectShareholderInfo',
- method: 'post',
- params: {
- ...params,
- current,
- size,
- }
- })
+ return request({
+ url: '/api/shareholder/selectShareholderInfo',
+ method: 'post',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
+}
+
+export const getDetail1 = (id) => {
+ return request({
+ url: '/api/shareholder/detail',
+ method: 'get',
+ params: {
+ id,
+ }
+ })
}
export const adddata1 = (row) => {
- return request({
- url: '/api/shareholder/save',
- // url: 'http://192.168.0.104:80/shareholder/save',
- method: 'post',
- data: row
- })
+ return request({
+ url: '/api/shareholder/save',
+ method: 'post',
+ data: row
+ })
}
export const update1 = (row) => {
- return request({
- url: '/api/shareholder/update',
- // url: 'http://192.168.0.104:80/shareholder/update',
- method: 'post',
- data: row
- })
+ return request({
+ url: '/api/shareholder/update',
+ method: 'post',
+ data: row
+ })
}
export const remove1 = (ids) => {
- return request({
- url: '/api/shareholder/remove',
- // url: 'http://192.168.0.104:80/shareholder/remove',
- method: 'post',
- params: {
- ids,
- }
- })
+ return request({
+ url: '/api/shareholder/remove',
+ method: 'post',
+ params: {
+ ids,
+ }
+ })
}
export const getdataOnce2 = (current, size, params) => {
- return request({
- url: '/api/member/selectMemberInfo',
- // url: 'http://192.168.0.104:80/member/selectMemberInfo',
- method: 'post',
- params: {
- ...params,
- current,
- size,
- }
- })
+ return request({
+ url: '/api/member/selectMemberInfo',
+ method: 'post',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
+}
+
+
+export const getDetail2 = (id) => {
+ return request({
+ url: '/api/member/detail',
+ method: 'get',
+ params: {
+ id,
+ }
+ })
}
export const getdata2 = (current, size, params) => {
- return request({
- // url: 'http://192.168.0.104:80/member/list',
- url: '/api/member/list',
- method: 'get',
- params: {
- ...params,
- current,
- size,
- }
- })
+ return request({
+ url: '/api/member/list',
+ method: 'get',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
}
export const adddata2 = (row) => {
- return request({
- // url: 'http://192.168.0.104:80/member/save',
- url: '/api/member/save',
- method: 'post',
- data: row
- })
+ return request({
+ url: '/api/member/save',
+ method: 'post',
+ data: row
+ })
}
export const update2 = (row) => {
- return request({
- // url: 'http://192.168.0.104:80/member/update',
- url: '/api/member/update',
- method: 'post',
- data: row
- })
+ return request({
+ url: '/api/member/update',
+ method: 'post',
+ data: row
+ })
}
export const remove2 = (ids) => {
- return request({
- // url: 'http://192.168.0.104:80/member/remove',
- url: '/api/member/remove',
- method: 'post',
- params: {
- ids,
- }
- })
+ return request({
+ url: '/api/member/remove',
+ method: 'post',
+ params: {
+ ids,
+ }
+ })
}
export const getDeptLazyTree = (parentId) => {
- return request({
- url: '/api/blade-system/dept/lazy-trees',
- // url: 'http://192.168.0.104:80/blade-system/dept/lazy-trees',
- method: 'get',
- // params: {
- // parentId
- // }
- })
-}
-
+ return request({
+ url: '/api/blade-system/dept/lazy-trees',
+ method: 'get',
+ // params: {
+ // parentId
+ // }
+ })
+}
\ No newline at end of file
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 54217a5..6dc40cc 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -988,7 +988,7 @@
rules: [
{
required: true,
- message: "请选择",
+ message: "请选择是否有持证",
trigger: "blur",
},
],
@@ -997,6 +997,12 @@
label: "保安员证编号",
prop: "securitynumber",
hide: true,
+ display:true,
+ rules: [{
+ required: false,
+ message: "请输入保安员证编号",
+ trigger: "blur",
+ }],
},
// {
// label: "发证日期",
@@ -1277,6 +1283,32 @@
this.initData(this.form.tenantId);
}
},
+ "form.hold":{
+ handler(val){
+ var securitynumbercolumn =this.findObject(this.option.group,'securitynumber')
+ // console.log(val,1234);
+ if(val==1){
+ securitynumbercolumn.display=true;
+ securitynumbercolumn.rules=[
+ {
+ required: true,
+ message: "请输入保安员证编号",
+ trigger: "blur",
+ }
+ ];
+ }else{
+ securitynumbercolumn.display=false;
+ securitynumbercolumn.rules=[
+ {
+ required: false,
+ message: "请输入保安员证编号",
+ trigger: "blur",
+ }
+ ];
+ }
+ },
+ immediate: true
+ },
"form.fingerprint"() {
let that = this;
if (this.form.fingerprint != undefined) {
diff --git a/src/views/securityUnit/armedEscort.vue b/src/views/securityUnit/armedEscort.vue
index 42eb7eb..a0fce85 100644
--- a/src/views/securityUnit/armedEscort.vue
+++ b/src/views/securityUnit/armedEscort.vue
@@ -49,14 +49,6 @@
</template>
<template slot="menuLeft">
<el-button
- type="primary"
- icon="el-icon-plus"
- size="small"
- plain
- @click.stop="rowSave"
- >新增</el-button
- >
- <el-button
type="danger"
size="small"
plain
@@ -74,22 +66,6 @@
</el-button>
</template>
</avue-crud>
- <el-dialog
- :visible.sync="forms"
- width="80%"
- top="5vh"
- :modal-append-to-body="false"
- class="addCompany"
- >
- <avue-form
- ref="form"
- v-model="obj0"
- :option="option0"
- v-if="forms"
- @submit="handleSubmit"
- >
- </avue-form>
- </el-dialog>
</div>
<el-dialog
title="保安单位导入"
@@ -119,15 +95,10 @@
adddata,
update,
remove,
- adddata1,
- adddata2,
- getDeptLazyTree,
} from "@/api/securityUnit/securityUnit";
import { mapGetters } from "vuex";
export default {
data() {
- var w = 160,
- s = 12;
return {
excelBox1: false,
excelForm1: {},
@@ -190,51 +161,14 @@
children: "children",
},
},
-
- obj0: {
- title0: "保安单位基本信息",
- },
- option0: {
- emptyBtn: false,
- submitBtn: true,
- gutter: 30,
- column: column0,
- },
- obj1: {
- title1: "保安单位出资人员",
- },
- option1: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column1,
- },
- obj2: {
- title2: "主要管理人员信息",
- },
- option2: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column2,
- },
-
forms: false,
- data0: {},
- data1: {},
- data2: {},
- b0: {},
- b1: {},
- b2: {},
noshehuibianma: 0,
nobumen: 0,
-
query: {},
data: [],
option: {
index: true,
- addBtn: false,
- // card: true,
+ addBtn: true,
tip: false,
searchSize: "mini",
searchMenuSpan: 6,
@@ -243,15 +177,214 @@
border: true,
align: "center",
selection: true,
- column: column,
- ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "企业名称",
+ prop: "enterprisename",
+ search: true,
+ searchSpan: 4,
+ labelWidth: 145,
+ minWidth: 160,
+ rules: [
+ {
+ required: true,
+ message: "请选择企业名称",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "所属辖区",
+ prop: "jurisdiction",
+ //父节点不能选
+ parent: false,
+ labelWidth: 145,
+ type: "tree",
+ dicUrl: "/api//jurisdiction/lazy-trees",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [
+ {
+ required: false,
+ message: "请选择所属辖区",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "法定代表人",
+ prop: "representative",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ rules: [
+ {
+ required: false,
+ message: "请输入法定代表人",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "法定代表人电话",
+ prop: "representativecell",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ rules: [
+ {
+ required: false,
+ message: "请输入法定代表人电话",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "联系人",
+ prop: "contacts",
+ labelWidth: 145,
+ hide: true,
+ },
+ {
+ label: "联系电话",
+ prop: "contactscell",
+ labelWidth: 145,
+ hide: true,
+ },
+ {
+ label: "保安人数",
+ labelWidth: 145,
+ prop: "znum",
+ searchSpan: 4,
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "派遣人数",
+ labelWidth: 145,
+ prop: "pnum",
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "持证人数",
+ labelWidth: 145,
+ prop: "cnum",
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "企业属性",
+ prop: "stats",
+ type: "tree",
+ hide: true,
+ labelWidth: 145,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=stats",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择企业属性",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "注册地址",
+ prop: "address",
+ labelWidth: 145,
+ // search: true,
+ hide: true,
+ },
+ {
+ label: "注册时间",
+ prop: "establishtime",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [
+ {
+ required: false,
+ message: "请选择注册时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "办公地址",
+ prop: "industry",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ hide:true,
+ rules: [{
+ required: false,
+ message: "请选择办公地址",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "登记机关",
+ prop: "registration",
+ // search: true,
+ labelWidth: 145,
+ // width: 88,
+ overHidden: true,
+ hide: true,
+ },
+ ],
...this.$store.state.control.clearOtherBut,
},
};
},
created() {
- this.option0.column[4].value = 3;
- this.option0.column[4].disabled = true;
+ const column = this.findObject(this.option.column, "stats");
+ column.value = "3";
+ column.editDisabled = true;
+ column.addDisabled = true;
+ if(this.userInfo.role_name == "administrator" ){
+ column.editDisabled = false;
+ column.addDisabled = false;
+ }
},
computed: {
...mapGetters(["userInfo"]),
@@ -275,7 +408,6 @@
},
methods: {
rowClickSelf(val) {
- // console.log(val.departmentid);
this.$router.push({
path: "/securityGuardOnce/index",
query: { departmentid: val.departmentid },
@@ -293,24 +425,6 @@
handleTemplate1() {
window.open(`/api/examSubjectChoices/export-template`);
},
-
- // handleChangeTABS(column) {
- // this.typeTABS = column;
- // // this.$message.success(JSON.stringify(column));
- // if (column.prop == "tab1") {
- // this.loading1 = false;
- // this.loading2 = false;
- // this.onLoad(this.page);
- // } else if (column.prop == "tab2") {
- // this.loading = false;
- // this.loading2 = false;
- // this.onLoad1(this.page1); //第二个表格不会自动执行
- // } else if (column.prop == "tab3") {
- // this.loading1 = false;
- // this.loading = false;
- // this.onLoad2(this.page2); //第二个表格不会自动执行
- // }
- // },
//保安单位基本信息
sizeChange(val) {
this.page1.currentPage = 1;
@@ -326,14 +440,23 @@
// this.$message.success("页码" + val);
},
rowSave(form, done, loading) {
- // console.log("save1");
- this.forms = true;
- var that = this;
- //先获取部门接口
- getDeptLazyTree().then((res) => {
- var d = res.data.data;
- that.treeData = d;
- // console.log(d);
+ form["createUserId"] = this.userInfo.Id;
+ adddata(form).then((res) => {
+ if (res.data.success) {
+ this.$message({
+ message: "操作成功",
+ type: "success",
+ });
+ this.refreshChange();
+ done();
+ this.forms = false;
+ } else {
+ this.$message({
+ message: "操作失败",
+ type: "warning",
+ });
+ done();
+ }
});
},
searchChange(params, done) {
@@ -419,14 +542,11 @@
this.onLoad(this.page, this.query);
},
rowClick(row) {
- // console.log(row);
- // row.identificationnumber; //统一社会信用代 码
window.localStorage.setItem("danweidata", JSON.stringify(row));
+ var data = JSON.stringify(row);
this.$router.push({
path: "/securityUnitChild",
- // redirect: { name: "foo" },
- query: { rowsecurity: "fromSecurity" },
- // params: { row: row.identificationnumber },
+ query: { data: data },
});
},
//跳转到附近列表页面
@@ -459,193 +579,6 @@
this.loading = false;
});
},
- // nodeClick(data) {//分局 不在这添加
- // // this.treeDeptId = data.id;
- // // this.page.currentPage = 1;
- // // this.onLoad(this.page);
- // // this.$message.success(JSON.stringify(data));
- // this.obj0["departmentid"] = data.title;
- // this.obj1["departmentid"] = data.title;
- // this.obj2["departmentid"] = data.title;
- // this.obj0["useid"] = data.id;
- // this.obj1["useid"] = data.id;
- // this.obj2["useid"] = data.id;
- // this.nobumen = 1;
- // },
- handleSubmit(form, done) {
- form["createUserId"] = this.userInfo.Id;
- // console.log(form);
- // done();
- // return;
- adddata(form).then((res) => {
- if (res.data.success) {
- this.$message({
- message: "提交成功",
- type: "success",
- });
- this.refreshChange();
- done();
- this.forms = false;
- } else {
- this.$message({
- message: "提交失败",
- type: "warning",
- });
- done();
- }
- });
- },
- tip0() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj0) {
- for (var i in column0) {
- if (k == column0[i].prop && k != "title0") {
- d[k] = this.obj0[k];
- }
- }
- }
- console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 0);
- this.data0 = d;
- this.forms = 1;
- },
- tip1() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj1) {
- for (var i in column1) {
- if (k == column1[i].prop && k != "title1") {
- d[k] = this.obj1[k];
- }
- }
- }
- d["capital"] = d["capital2"];
- delete d["capital2"];
- // console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 1);
- this.data1 = d;
- this.forms = 2;
- },
- tip2() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj2) {
- for (var i in column2) {
- if (k == column2[i].prop && k != "title2") {
- d[k] = this.obj2[k];
- }
- }
- }
- console.log(d);
- d["cardid"] = d["cardid2"];
- delete d["cardid2"];
- d["cell"] = d["cell2"];
- delete d["cell2"];
- // d["shareholdingratio"] = d["shareholdingratio2"];
- // delete d["shareholdingratio2"];
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 2);
- this.data2 = d;
-
- // this.data0.departmentid = this.data0.useid;
- // this.data1.departmentid = this.data1.useid;
- // this.data2.departmentid = this.data2.useid;
- // delete this.data0.useid;
- // delete this.data1.useid;
- // delete this.data2.useid;
-
- adddata(this.data0).then((res) => {
- console.log(res, 0);
- });
- adddata1(this.data1).then((res) => {
- console.log(res, 1);
- });
- adddata2(this.data2).then((res) => {
- console.log(res, 2);
- });
- var time = setTimeout(() => {
- this.onLoad(this.page, this.query);
- console.log(this.data0, this.data1, this.data2, "已刷新");
- }, 500);
- this.tipover();
- },
- tip1up1() {
- this.forms = true;
- },
- tip2up2() {
- this.forms = 1;
- },
- tipover() {
- this.forms = -1;
- this.obj0 = {
- title0: "保安单位基本信息",
- };
- this.obj1 = {
- title1: "保安单位出资人员",
- };
- this.obj2 = {
- title2: "主要管理人员信息",
- };
- this.data0 = {};
- this.data1 = {};
- this.data2 = {};
- this.noshehuibianma = 0;
- this.nobumen = 0;
- },
- panduanmeiyouziduan() {
- if (this.noshehuibianma == 0) {
- this.$message.warning("请输入统一社会信用代码");
- return true;
- }
- if (this.nobumen == 0) {
- return false;
- this.$message.warning("请选则部门");
- }
- return false;
- },
- },
- watch: {
- haveID() {
- // console.log(this.haveID);
- if (this.haveID != undefined) {
- if (this.haveID.length > 5) {
- //统一社会信用代码判断
- this.noshehuibianma = 1;
- } else {
- this.noshehuibianma = 0;
- }
- }
- },
- havedata() {
- console.log(this.havedata, "qqqqq");
- },
},
mounted() {},
};
@@ -658,14 +591,6 @@
// border: 1px solid #000;
box-sizing: border-box;
}
-// .el-card__body {
-// padding-bottom: 5px !important;
-// }
-// .avue-crud__tip,
-// .el-tag,
-// .el-tag--light {
-// padding: 0 !important;
-// }
.lod {
position: absolute;
diff --git a/src/views/securityUnit/data.js b/src/views/securityUnit/data.js
index 5e8b81e..d7da79f 100644
--- a/src/views/securityUnit/data.js
+++ b/src/views/securityUnit/data.js
@@ -25,21 +25,18 @@
}
};
-var DIC = [
- {
- label: '招聘中',
- value: 1,
- }, {
- label: '停止招聘',
- value: 2,
- }
-]
+var DIC = [{
+ label: '招聘中',
+ value: 1,
+}, {
+ label: '停止招聘',
+ value: 2,
+}]
-export var column = [
- {
+export var column = [{
label: "统一社会信用代码",
prop: "creditcode",
- width: 140,
+ // width: 140,
hide: true,
labelWidth: 160,
@@ -52,15 +49,15 @@
label: "企业名称",
prop: "enterprisename",
search: true,
- width: 260,
+ // width: 260,
searchSpan: 4,
labelWidth: 160,
- // width: 130,
+ minWidth: 160,
overHidden: true
},
{
- label: "企业类型",
+ label: "企业属性",
prop: "stats",
type: "tree",
hide: true,
@@ -70,20 +67,18 @@
label: "dictValue",
value: "dictKey"
},
- width: 130,
- rules: [
- {
- required: true,
- message: "请选择企业类型",
- trigger: "click",
- },
- ],
+ // width: 130,
+ rules: [{
+ required: true,
+ message: "请选择企业属性",
+ trigger: "click",
+ }, ],
},
{
label: "法定代表人",
labelWidth: 160,
prop: "representative",
- width: 110,
+ // width: 110,
search: true,
searchSpan: 4,
searchLabelWidth: 100
@@ -92,7 +87,7 @@
label: "法定代表人电话",
labelWidth: 160,
prop: "representativecell",
- width: 120,
+ // width: 120,
// search: true,
searchSpan: 4,
searchLabelWidth: 100,
@@ -102,7 +97,7 @@
label: "保安人数",
labelWidth: 160,
prop: "znum",
- width: 69,
+ // width: 69,
// search: true,
searchSpan: 4,
searchLabelWidth: 100
@@ -111,7 +106,7 @@
label: "派遣人数",
labelWidth: 160,
prop: "pnum",
- width: 69,
+ // width: 69,
// search: true,
searchSpan: 4,
searchLabelWidth: 100
@@ -120,7 +115,7 @@
label: "持证人数",
labelWidth: 160,
prop: "cnum",
- width: 69,
+ // width: 69,
// search: true,
searchSpan: 4,
searchLabelWidth: 100
@@ -142,18 +137,20 @@
hide: true,
labelWidth: 160,
// search: true,
- width: 80,
+ // width: 80,
},
{
label: "联系人",
prop: "contacts",
labelWidth: 160,
- width: 85,
+ // width: 85,
+ hide: true,
}, {
label: "联系电话",
prop: "contactscell",
labelWidth: 160,
- width: 95,
+ // width: 95,
+ hide: true,
},
{
@@ -184,16 +181,41 @@
},
// labelWidth: w,
// span: s,
- rules: [
- {
- required: true,
- message: "请选择所属辖区",
- trigger: "click",
- },
- ],
+ rules: [{
+ required: true,
+ message: "请选择所属辖区",
+ trigger: "click",
+ }, ],
// width: 110,
// search: true,
overHidden: true
+ },
+ {
+ label: "注册时间",
+ prop: "establishtime",
+ span: 12,
+ labelWidth: 130,
+ disabled: true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择注册时间",
+ trigger: "blur",
+ }, ],
},
{
label: "登记机关",
@@ -215,10 +237,9 @@
},
]
-var w = 160
- , s = 12;
-export var column0 = [
- {
+var w = 160,
+ s = 12;
+export var column0 = [{
label: "",
labelWidth: 20,
type: 'title',
@@ -253,13 +274,11 @@
},
labelWidth: w,
span: s,
- rules: [
- {
- required: true,
- message: "请选择所属辖区",
- trigger: "click",
- },
- ],
+ rules: [{
+ required: true,
+ message: "请选择所属辖区",
+ trigger: "click",
+ }, ],
},
{
label: "统一社会信用代码",
@@ -318,13 +337,15 @@
labelWidth: w,
span: s,
rules: [{
- required: true,
- message: "请输入法定代表人电话",
- trigger: "blur"
- },
- {
- validator: phones, trigger: ['change', 'blur']
- },]
+ required: true,
+ message: "请输入法定代表人电话",
+ trigger: "blur"
+ },
+ {
+ validator: phones,
+ trigger: ['change', 'blur']
+ },
+ ]
}, {
label: "联系人",
prop: "contacts",
@@ -342,13 +363,15 @@
labelWidth: w,
span: s,
rules: [{
- required: true,
- message: "请输入联系电话",
- trigger: "blur"
- },
- {
- validator: phones, trigger: ['change', 'blur']
- }]
+ required: true,
+ message: "请输入联系电话",
+ trigger: "blur"
+ },
+ {
+ validator: phones,
+ trigger: ['change', 'blur']
+ }
+ ]
},
// {
// label: "企业类型",
@@ -451,8 +474,7 @@
}
]
-export var column1 = [
- {
+export var column1 = [{
label: "",
labelWidth: 20,
type: 'title',
@@ -549,31 +571,34 @@
labelWidth: w,
span: s,
rules: [{
- required: true,
- message: "请输入身份证",
- trigger: "blur"
- },
- {
- validator: cardids, trigger: ['change', 'blur']
- }]
+ required: true,
+ message: "请输入身份证",
+ trigger: "blur"
+ },
+ {
+ validator: cardids,
+ trigger: ['change', 'blur']
+ }
+ ]
}, {
label: "联系电话",
prop: "cell",
labelWidth: w,
span: s,
rules: [{
- required: true,
- message: "请输入联系电话",
- trigger: "blur"
- },
- {
- validator: phones, trigger: ['change', 'blur']
- }]
+ required: true,
+ message: "请输入联系电话",
+ trigger: "blur"
+ },
+ {
+ validator: phones,
+ trigger: ['change', 'blur']
+ }
+ ]
},
]
-export var column2 = [
- {
+export var column2 = [{
label: "",
labelWidth: 20,
type: 'title',
@@ -640,26 +665,30 @@
labelWidth: w,
span: s,
rules: [{
- required: true,
- message: "请输入身份证",
- trigger: "blur"
- },
- {
- validator: cardids, trigger: ['change', 'blur']
- }]
+ required: true,
+ message: "请输入身份证",
+ trigger: "blur"
+ },
+ {
+ validator: cardids,
+ trigger: ['change', 'blur']
+ }
+ ]
}, {
label: "联系电话",
prop: "cell2",
labelWidth: w,
span: s,
rules: [{
- required: true,
- message: "请输入联系电话",
- trigger: "blur"
- },
- {
- validator: phones, trigger: ['change', 'blur']
- }]
+ required: true,
+ message: "请输入联系电话",
+ trigger: "blur"
+ },
+ {
+ validator: phones,
+ trigger: ['change', 'blur']
+ }
+ ]
}
// , {
// label: "持股比例(%)",
@@ -667,4 +696,4 @@
// labelWidth: w,
// span: s
// }
-]
+]
\ No newline at end of file
diff --git a/src/views/securityUnit/localCompany.vue b/src/views/securityUnit/localCompany.vue
index 268682b..25a8d97 100644
--- a/src/views/securityUnit/localCompany.vue
+++ b/src/views/securityUnit/localCompany.vue
@@ -49,14 +49,6 @@
</template>
<template slot="menuLeft">
<el-button
- type="primary"
- icon="el-icon-plus"
- size="small"
- plain
- @click.stop="rowSave"
- >新增</el-button
- >
- <el-button
type="danger"
size="small"
plain
@@ -74,22 +66,6 @@
</el-button>
</template>
</avue-crud>
- <el-dialog
- :visible.sync="forms"
- width="80%"
- top="5vh"
- :modal-append-to-body="false"
- class="addCompany"
- >
- <avue-form
- ref="form"
- v-model="obj0"
- :option="option0"
- v-if="forms"
- @submit="handleSubmit"
- >
- </avue-form>
- </el-dialog>
</div>
<el-dialog
title="保安单位导入"
@@ -113,21 +89,15 @@
</template>
<script>
-import { column, column0, column1, column2 } from "./data";
import {
getdata,
adddata,
update,
remove,
- adddata1,
- adddata2,
- getDeptLazyTree,
} from "@/api/securityUnit/securityUnit";
import { mapGetters } from "vuex";
export default {
data() {
- var w = 160,
- s = 12;
return {
excelBox1: false,
excelForm1: {},
@@ -156,7 +126,6 @@
},
],
},
-
loading: true, //保安单位基本信息
selectionList: [],
page: {
@@ -165,7 +134,6 @@
total: 0,
...this.$store.state.control.changePageSize,
},
-
treeData: [],
treeOption: {
title: "我是标题",
@@ -190,38 +158,6 @@
children: "children",
},
},
-
- obj0: {
- title0: "保安单位基本信息",
- },
- option0: {
- emptyBtn: false,
- submitBtn: true,
- gutter: 30,
- column: column0,
- ...this.$store.state.control.clearOtherBut,
- },
- obj1: {
- title1: "保安单位出资人员",
- },
- option1: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column1,
- ...this.$store.state.control.clearOtherBut,
- },
- obj2: {
- title2: "主要管理人员信息",
- },
- option2: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column2,
- ...this.$store.state.control.clearOtherBut,
- },
-
forms: false,
data0: {},
data1: {},
@@ -231,13 +167,11 @@
b2: {},
noshehuibianma: 0,
nobumen: 0,
-
query: {},
data: [],
option: {
index: true,
- addBtn: false,
- // card: true,
+ addBtn: true,
tip: false,
searchSize: "mini",
searchMenuSpan: 6,
@@ -246,15 +180,214 @@
border: true,
align: "center",
selection: true,
- column: column,
- ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "企业名称",
+ prop: "enterprisename",
+ search: true,
+ searchSpan: 4,
+ labelWidth: 145,
+ minWidth: 160,
+ rules: [
+ {
+ required: true,
+ message: "请选择企业名称",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "所属辖区",
+ prop: "jurisdiction",
+ //父节点不能选
+ parent: false,
+ labelWidth: 145,
+ type: "tree",
+ dicUrl: "/api//jurisdiction/lazy-trees",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [
+ {
+ required: false,
+ message: "请选择所属辖区",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "法定代表人",
+ prop: "representative",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ rules: [
+ {
+ required: false,
+ message: "请输入法定代表人",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "法定代表人电话",
+ prop: "representativecell",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ rules: [
+ {
+ required: false,
+ message: "请输入法定代表人电话",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "联系人",
+ prop: "contacts",
+ labelWidth: 145,
+ hide: true,
+ },
+ {
+ label: "联系电话",
+ prop: "contactscell",
+ labelWidth: 145,
+ hide: true,
+ },
+ {
+ label: "保安人数",
+ labelWidth: 145,
+ prop: "znum",
+ searchSpan: 4,
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "派遣人数",
+ labelWidth: 145,
+ prop: "pnum",
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "持证人数",
+ labelWidth: 145,
+ prop: "cnum",
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "企业属性",
+ prop: "stats",
+ type: "tree",
+ hide: true,
+ labelWidth: 145,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=stats",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择企业属性",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "注册地址",
+ prop: "address",
+ labelWidth: 145,
+ // search: true,
+ hide: true,
+ },
+ {
+ label: "注册时间",
+ prop: "establishtime",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [
+ {
+ required: false,
+ message: "请选择注册时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "办公地址",
+ prop: "industry",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ hide:true,
+ rules: [{
+ required: false,
+ message: "请选择办公地址",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "登记机关",
+ prop: "registration",
+ // search: true,
+ labelWidth: 145,
+ // width: 88,
+ overHidden: true,
+ hide: true,
+ },
+ ],
...this.$store.state.control.clearOtherBut,
},
};
},
created() {
- this.option0.column[4].value = 2;
- this.option0.column[4].disabled = true;
+ const column = this.findObject(this.option.column, "stats");
+ column.value = "2";
+ column.editDisabled = true;
+ column.addDisabled = true;
+ if(this.userInfo.role_name == "administrator" ){
+ column.editDisabled = false;
+ column.addDisabled = false;
+ }
},
computed: {
...mapGetters(["userInfo"]),
@@ -265,20 +398,9 @@
});
return ids.join(",");
},
- ids1() {
- let ids1 = [];
- this.selectionList.forEach((ele) => {
- ids1.push(ele.departmentid);
- });
- return ids1.join(",");
- },
- haveID() {
- return this.obj0.creditcode;
- },
},
methods: {
rowClickSelf(val) {
- // console.log(val.departmentid);
this.$router.push({
path: "/securityGuardOnce/index",
query: { departmentid: val.departmentid },
@@ -296,47 +418,35 @@
handleTemplate1() {
window.open(`/api/examSubjectChoices/export-template`);
},
-
- // handleChangeTABS(column) {
- // this.typeTABS = column;
- // // this.$message.success(JSON.stringify(column));
- // if (column.prop == "tab1") {
- // this.loading1 = false;
- // this.loading2 = false;
- // this.onLoad(this.page);
- // } else if (column.prop == "tab2") {
- // this.loading = false;
- // this.loading2 = false;
- // this.onLoad1(this.page1); //第二个表格不会自动执行
- // } else if (column.prop == "tab3") {
- // this.loading1 = false;
- // this.loading = false;
- // this.onLoad2(this.page2); //第二个表格不会自动执行
- // }
- // },
//保安单位基本信息
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) {
- // console.log("save1");
- this.forms = true;
- var that = this;
- //先获取部门接口
- getDeptLazyTree().then((res) => {
- var d = res.data.data;
- that.treeData = d;
- // console.log(d);
+ form["createUserId"] = this.userInfo.Id;
+ adddata(form).then((res) => {
+ if (res.data.success) {
+ this.$message({
+ message: "操作成功",
+ type: "success",
+ });
+ this.refreshChange();
+ done();
+ this.forms = false;
+ } else {
+ this.$message({
+ message: "操作失败",
+ type: "warning",
+ });
+ done();
+ }
});
},
searchChange(params, done) {
@@ -403,7 +513,6 @@
type: "warning",
})
.then(() => {
- // console.log(this.ids);
return remove(this.ids, this.ids1).then((res) => {
this.refreshChange();
});
@@ -422,14 +531,11 @@
this.onLoad(this.page, this.query);
},
rowClick(row) {
- // console.log(row);
- // row.identificationnumber; //统一社会信用代 码
window.localStorage.setItem("danweidata", JSON.stringify(row));
+ var data = JSON.stringify(row);
this.$router.push({
path: "/securityUnitChild",
- // redirect: { name: "foo" },
- query: { rowsecurity: "fromSecurity" },
- // params: { row: row.identificationnumber },
+ query: { data: data },
});
},
//跳转到附近列表页面
@@ -461,197 +567,6 @@
console.log(this.data);
this.loading = false;
});
- },
- // nodeClick(data) {//分局 不在这添加
- // // this.treeDeptId = data.id;
- // // this.page.currentPage = 1;
- // // this.onLoad(this.page);
- // // this.$message.success(JSON.stringify(data));
- // this.obj0["departmentid"] = data.title;
- // this.obj1["departmentid"] = data.title;
- // this.obj2["departmentid"] = data.title;
- // this.obj0["useid"] = data.id;
- // this.obj1["useid"] = data.id;
- // this.obj2["useid"] = data.id;
- // this.nobumen = 1;
- // },
- handleSubmit(form, done) {
- form["createUserId"] = this.userInfo.Id;
- // console.log(form);
- // done();
- // return;
- adddata(form).then((res) => {
- if (res.data.success) {
- this.$message({
- message: "提交成功",
- type: "success",
- });
- this.refreshChange();
- done();
- this.forms = false;
- } else {
- this.$message({
- message: "提交失败",
- type: "warning",
- });
- done();
- }
- });
- },
- tip0() {
- // if (this.panduanmeiyouziduan()) {
- // return;
- // }
- var d = {};
- for (var k in this.obj0) {
- for (var i in column0) {
- if (k == column0[i].prop && k != "title0") {
- d[k] = this.obj0[k];
- }
- }
- }
- console.log(d);
- for (var k in d) {
- if (d[k].prop == "capital") {
- continue;
- }
- let iisit0 = d[k] == "" || d[k] == undefined;
- if (iisit0) {
- console.log(d[k]);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 0);
- // this.data0 = d;
- // this.forms = 1;
- },
- tip1() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj1) {
- for (var i in column1) {
- if (k == column1[i].prop && k != "title1") {
- d[k] = this.obj1[k];
- }
- }
- }
- d["capital"] = d["capital2"];
- delete d["capital2"];
- // console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 1);
- this.data1 = d;
- this.forms = 2;
- },
- tip2() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj2) {
- for (var i in column2) {
- if (k == column2[i].prop && k != "title2") {
- d[k] = this.obj2[k];
- }
- }
- }
- console.log(d);
- d["cardid"] = d["cardid2"];
- delete d["cardid2"];
- d["cell"] = d["cell2"];
- delete d["cell2"];
- // d["shareholdingratio"] = d["shareholdingratio2"];
- // delete d["shareholdingratio2"];
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 2);
- this.data2 = d;
-
- // this.data0.departmentid = this.data0.useid;
- // this.data1.departmentid = this.data1.useid;
- // this.data2.departmentid = this.data2.useid;
- // delete this.data0.useid;
- // delete this.data1.useid;
- // delete this.data2.useid;
-
- adddata(this.data0).then((res) => {
- console.log(res, 0);
- });
- adddata1(this.data1).then((res) => {
- console.log(res, 1);
- });
- adddata2(this.data2).then((res) => {
- console.log(res, 2);
- });
- var time = setTimeout(() => {
- this.onLoad(this.page, this.query);
- console.log(this.data0, this.data1, this.data2, "已刷新");
- }, 500);
- this.tipover();
- },
- tip1up1() {
- this.forms = 0;
- },
- tip2up2() {
- this.forms = 1;
- },
- tipover() {
- this.forms = -1;
- this.obj0 = {
- title0: "保安单位基本信息",
- };
- this.obj1 = {
- title1: "保安单位出资人员",
- };
- this.obj2 = {
- title2: "主要管理人员信息",
- };
- this.data0 = {};
- this.data1 = {};
- this.data2 = {};
- this.noshehuibianma = 0;
- this.nobumen = 0;
- },
- panduanmeiyouziduan() {
- if (this.noshehuibianma == 0) {
- this.$message.warning("请输入统一社会信用代码");
- return true;
- }
- if (this.nobumen == 0) {
- return false;
- this.$message.warning("请选则部门");
- }
- return false;
- },
- },
- watch: {
- haveID() {
- // console.log(this.haveID);
- if (this.haveID != undefined) {
- if (this.haveID.length > 0) {
- //统一社会信用代码判断
- this.noshehuibianma = 1;
- } else {
- this.noshehuibianma = 0;
- }
- }
- },
- havedata() {
- console.log(this.havedata, "qqqqq");
},
},
mounted() {},
diff --git a/src/views/securityUnit/securityTraining.vue b/src/views/securityUnit/securityTraining.vue
index 891d8f6..1d5fbda 100644
--- a/src/views/securityUnit/securityTraining.vue
+++ b/src/views/securityUnit/securityTraining.vue
@@ -49,14 +49,6 @@
</template>
<template slot="menuLeft">
<el-button
- type="primary"
- icon="el-icon-plus"
- size="small"
- plain
- @click.stop="rowSave"
- >新增</el-button
- >
- <el-button
type="danger"
size="small"
plain
@@ -74,22 +66,6 @@
</el-button>
</template>
</avue-crud>
- <el-dialog
- :visible.sync="forms"
- width="80%"
- top="5vh"
- :modal-append-to-body="false"
- class="addCompany"
- >
- <avue-form
- ref="form"
- v-model="obj0"
- :option="option0"
- v-if="forms"
- @submit="handleSubmit"
- >
- </avue-form>
- </el-dialog>
</div>
<el-dialog
title="保安单位导入"
@@ -113,21 +89,15 @@
</template>
<script>
-import { column, column0, column1, column2 } from "./data";
import {
getdata,
adddata,
update,
remove,
- adddata1,
- adddata2,
- getDeptLazyTree,
} from "@/api/securityUnit/securityUnit";
import { mapGetters } from "vuex";
export default {
data() {
- var w = 160,
- s = 12;
return {
excelBox1: false,
excelForm1: {},
@@ -156,7 +126,6 @@
},
],
},
-
loading: true, //保安单位基本信息
selectionList: [],
page: {
@@ -165,7 +134,6 @@
total: 0,
...this.$store.state.control.changePageSize,
},
-
treeData: [],
treeOption: {
title: "我是标题",
@@ -190,80 +158,14 @@
children: "children",
},
},
- // treeOption: {
- // nodeKey: "id",
- // // lazy: true,
- // // treeLoad: function (node, resolve) {
- // // // const parentId = node.level === 0 ? 0 : node.data.id;
- // // getDeptLazyTree().then((res) => {
- // // resolve(
- // // res.data.data.map((item) => {
- // // console.log({
- // // ...item,
- // // leaf: !item.hasChildren,
- // // });
- // // return {
- // // ...item,
- // // leaf: !item.hasChildren,
- // // };
- // // })
- // // );
- // // });
- // // },
- // addBtn: false,
- // menu: false,
- // size: "small",
- // props: {
- // labelText: "标题",
- // label: "title",
- // value: "value",
- // children: "children",
- // },
- // },
-
- obj0: {
- title0: "保安单位基本信息",
- },
- option0: {
- emptyBtn: false,
- submitBtn: true,
- gutter: 30,
- column: column0,
- },
- obj1: {
- title1: "保安单位出资人员",
- },
- option1: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column1,
- },
- obj2: {
- title2: "主要管理人员信息",
- },
- option2: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column2,
- },
-
forms: false,
- data0: {},
- data1: {},
- data2: {},
- b0: {},
- b1: {},
- b2: {},
noshehuibianma: 0,
nobumen: 0,
-
query: {},
data: [],
option: {
index: true,
- addBtn: false,
+ addBtn: true,
// card: true,
tip: false,
searchSize: "mini",
@@ -274,15 +176,214 @@
menuWidth: 275,
align: "center",
selection: true,
- column: column,
- ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "企业名称",
+ prop: "enterprisename",
+ search: true,
+ searchSpan: 4,
+ labelWidth: 145,
+ minWidth: 160,
+ rules: [
+ {
+ required: true,
+ message: "请选择企业名称",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "所属辖区",
+ prop: "jurisdiction",
+ //父节点不能选
+ parent: false,
+ labelWidth: 145,
+ type: "tree",
+ dicUrl: "/api//jurisdiction/lazy-trees",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [
+ {
+ required: false,
+ message: "请选择所属辖区",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "法定代表人",
+ prop: "representative",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ rules: [
+ {
+ required: false,
+ message: "请输入法定代表人",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "法定代表人电话",
+ prop: "representativecell",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ rules: [
+ {
+ required: false,
+ message: "请输入法定代表人电话",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "联系人",
+ prop: "contacts",
+ labelWidth: 145,
+ hide: true,
+ },
+ {
+ label: "联系电话",
+ prop: "contactscell",
+ labelWidth: 145,
+ hide: true,
+ },
+ {
+ label: "保安人数",
+ labelWidth: 145,
+ prop: "znum",
+ searchSpan: 4,
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "派遣人数",
+ labelWidth: 145,
+ prop: "pnum",
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "持证人数",
+ labelWidth: 145,
+ prop: "cnum",
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "企业属性",
+ prop: "stats",
+ type: "tree",
+ hide: true,
+ labelWidth: 145,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=stats",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择企业属性",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "注册地址",
+ prop: "address",
+ labelWidth: 145,
+ // search: true,
+ hide: true,
+ },
+ {
+ label: "注册时间",
+ prop: "establishtime",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [
+ {
+ required: false,
+ message: "请选择注册时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "办公地址",
+ prop: "industry",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ hide:true,
+ rules: [{
+ required: false,
+ message: "请选择办公地址",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "登记机关",
+ prop: "registration",
+ // search: true,
+ labelWidth: 145,
+ // width: 88,
+ overHidden: true,
+ hide: true,
+ },
+ ],
...this.$store.state.control.clearOtherBut,
},
};
},
created() {
- this.option0.column[4].value = 1;
- this.option0.column[4].disabled = true;
+ const column = this.findObject(this.option.column, "stats");
+ column.value = "1";
+ column.editDisabled = true;
+ column.addDisabled = true;
+ if(this.userInfo.role_name == "administrator" ){
+ column.editDisabled = false;
+ column.addDisabled = false;
+ }
},
computed: {
...mapGetters(["userInfo"]),
@@ -292,16 +393,6 @@
ids.push(ele.creditcode);
});
return ids.join(",");
- },
- ids1() {
- let ids1 = [];
- this.selectionList.forEach((ele) => {
- ids1.push(ele.departmentid);
- });
- return ids1.join(",");
- },
- haveID() {
- return this.obj0.creditcode;
},
},
methods: {
@@ -324,24 +415,6 @@
handleTemplate1() {
window.open(`/api/examSubjectChoices/export-template`);
},
-
- // handleChangeTABS(column) {
- // this.typeTABS = column;
- // // this.$message.success(JSON.stringify(column));
- // if (column.prop == "tab1") {
- // this.loading1 = false;
- // this.loading2 = false;
- // this.onLoad(this.page);
- // } else if (column.prop == "tab2") {
- // this.loading = false;
- // this.loading2 = false;
- // this.onLoad1(this.page1); //第二个表格不会自动执行
- // } else if (column.prop == "tab3") {
- // this.loading1 = false;
- // this.loading = false;
- // this.onLoad2(this.page2); //第二个表格不会自动执行
- // }
- // },
//保安单位基本信息
sizeChange(val) {
this.page1.currentPage = 1;
@@ -354,28 +427,13 @@
this.page1.currentPage = val;
// this.getData();
this.onLoad(this.page, this.query);
- // this.$message.success("页码" + val);
},
rowSave(form, done, loading) {
- // console.log("save1");
- this.forms = true;
- var that = this;
- //先获取部门接口
- getDeptLazyTree().then((res) => {
- var d = res.data.data;
- that.treeData = d;
- // console.log(d);
- });
- },
- handleSubmit(form, done) {
form["createUserId"] = this.userInfo.Id;
- // console.log(form);
- // done();
- // return;
adddata(form).then((res) => {
if (res.data.success) {
this.$message({
- message: "提交成功",
+ message: "操作成功",
type: "success",
});
this.refreshChange();
@@ -383,7 +441,7 @@
this.forms = false;
} else {
this.$message({
- message: "提交失败",
+ message: "操作失败",
type: "warning",
});
done();
@@ -473,14 +531,11 @@
this.onLoad(this.page, this.query);
},
rowClick(row) {
- // console.log(row);
- // row.identificationnumber; //统一社会信用代 码
window.localStorage.setItem("danweidata", JSON.stringify(row));
+ var data = JSON.stringify(row);
this.$router.push({
path: "/securityUnitChild",
- // redirect: { name: "foo" },
- query: { rowsecurity: "fromSecurity" },
- // params: { row: row.identificationnumber },
+ query: { data: data },
});
},
//跳转到附近列表页面
@@ -513,170 +568,7 @@
this.loading = false;
});
},
- // nodeClick(data) {//分局 不在这添加
- // // this.treeDeptId = data.id;
- // // this.page.currentPage = 1;
- // // this.onLoad(this.page);
- // // this.$message.success(JSON.stringify(data));
- // this.obj0["departmentid"] = data.title;
- // this.obj1["departmentid"] = data.title;
- // this.obj2["departmentid"] = data.title;
- // this.obj0["useid"] = data.id;
- // this.obj1["useid"] = data.id;
- // this.obj2["useid"] = data.id;
- // this.nobumen = 1;
- // },
- tip0() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj0) {
- for (var i in column0) {
- if (k == column0[i].prop && k != "title0") {
- d[k] = this.obj0[k];
- }
- }
- }
- console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 0);
- this.data0 = d;
- this.forms = 1;
- },
- tip1() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj1) {
- for (var i in column1) {
- if (k == column1[i].prop && k != "title1") {
- d[k] = this.obj1[k];
- }
- }
- }
- d["capital"] = d["capital2"];
- delete d["capital2"];
- // console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 1);
- this.data1 = d;
- this.forms = 2;
- },
- tip2() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj2) {
- for (var i in column2) {
- if (k == column2[i].prop && k != "title2") {
- d[k] = this.obj2[k];
- }
- }
- }
- console.log(d);
- d["cardid"] = d["cardid2"];
- delete d["cardid2"];
- d["cell"] = d["cell2"];
- delete d["cell2"];
- // d["shareholdingratio"] = d["shareholdingratio2"];
- // delete d["shareholdingratio2"];
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 2);
- this.data2 = d;
-
- // this.data0.departmentid = this.data0.useid;
- // this.data1.departmentid = this.data1.useid;
- // this.data2.departmentid = this.data2.useid;
- // delete this.data0.useid;
- // delete this.data1.useid;
- // delete this.data2.useid;
-
- adddata(this.data0).then((res) => {
- console.log(res, 0);
- });
- adddata1(this.data1).then((res) => {
- console.log(res, 1);
- });
- adddata2(this.data2).then((res) => {
- console.log(res, 2);
- });
- var time = setTimeout(() => {
- this.onLoad(this.page, this.query);
- console.log(this.data0, this.data1, this.data2, "已刷新");
- }, 500);
- this.tipover();
- },
- tip1up1() {
- this.forms = true;
- },
- tip2up2() {
- this.forms = 1;
- },
- tipover() {
- this.forms = -1;
- this.obj0 = {
- title0: "保安单位基本信息",
- };
- this.obj1 = {
- title1: "保安单位出资人员",
- };
- this.obj2 = {
- title2: "主要管理人员信息",
- };
- this.data0 = {};
- this.data1 = {};
- this.data2 = {};
- this.noshehuibianma = 0;
- this.nobumen = 0;
- },
- panduanmeiyouziduan() {
- if (this.noshehuibianma == 0) {
- this.$message.warning("请输入统一社会信用代码");
- return true;
- }
- if (this.nobumen == 0) {
- return false;
- this.$message.warning("请选则部门");
- }
- return false;
- },
- },
- watch: {
- haveID() {
- // console.log(this.haveID);
- if (this.haveID != undefined) {
- if (this.haveID.length > 5) {
- //统一社会信用代码判断
- this.noshehuibianma = 1;
- } else {
- this.noshehuibianma = 0;
- }
- }
- },
- havedata() {
- console.log(this.havedata, "qqqqq");
- },
+
},
mounted() {},
};
@@ -689,14 +581,6 @@
// border: 1px solid #000;
box-sizing: border-box;
}
-// .el-card__body {
-// padding-bottom: 5px !important;
-// }
-// .avue-crud__tip,
-// .el-tag,
-// .el-tag--light {
-// padding: 0 !important;
-// }
.lod {
position: absolute;
diff --git a/src/views/securityUnit/selfRecruitedSecurityGuard.vue b/src/views/securityUnit/selfRecruitedSecurityGuard.vue
index 43caada..2d5b213 100644
--- a/src/views/securityUnit/selfRecruitedSecurityGuard.vue
+++ b/src/views/securityUnit/selfRecruitedSecurityGuard.vue
@@ -49,14 +49,6 @@
</template>
<template slot="menuLeft">
<el-button
- type="primary"
- icon="el-icon-plus"
- size="small"
- plain
- @click.stop="rowSave"
- >新增</el-button
- >
- <el-button
type="danger"
size="small"
plain
@@ -74,22 +66,6 @@
</el-button>
</template>
</avue-crud>
- <el-dialog
- :visible.sync="forms"
- width="80%"
- top="5vh"
- :modal-append-to-body="false"
- class="addCompany"
- >
- <avue-form
- ref="form"
- v-model="obj0"
- :option="option0"
- v-if="forms"
- @submit="handleSubmit"
- >
- </avue-form>
- </el-dialog>
</div>
<el-dialog
title="保安单位导入"
@@ -113,7 +89,7 @@
</template>
<script>
-import { column, column0, column1, column2 } from "./data";
+import { column0, column1, column2 } from "./data";
import {
getdata,
adddata,
@@ -126,8 +102,6 @@
import { mapGetters } from "vuex";
export default {
data() {
- var w = 160,
- s = 12;
return {
excelBox1: false,
excelForm1: {},
@@ -190,65 +164,6 @@
children: "children",
},
},
- // treeOption: {
- // nodeKey: "id",
- // // lazy: true,
- // // treeLoad: function (node, resolve) {
- // // // const parentId = node.level === 0 ? 0 : node.data.id;
- // // getDeptLazyTree().then((res) => {
- // // resolve(
- // // res.data.data.map((item) => {
- // // console.log({
- // // ...item,
- // // leaf: !item.hasChildren,
- // // });
- // // return {
- // // ...item,
- // // leaf: !item.hasChildren,
- // // };
- // // })
- // // );
- // // });
- // // },
- // addBtn: false,
- // menu: false,
- // size: "small",
- // props: {
- // labelText: "标题",
- // label: "title",
- // value: "value",
- // children: "children",
- // },
- // },
-
- obj0: {
- title0: "保安单位基本信息",
- },
- option0: {
- emptyBtn: false,
- submitBtn: true,
- gutter: 30,
- column: column0,
- },
- obj1: {
- title1: "保安单位出资人员",
- },
- option1: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column1,
- },
- obj2: {
- title2: "主要管理人员信息",
- },
- option2: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column2,
- },
-
forms: false,
data0: {},
data1: {},
@@ -258,13 +173,11 @@
b2: {},
noshehuibianma: 0,
nobumen: 0,
-
query: {},
data: [],
option: {
index: true,
- addBtn: false,
- // card: true,
+ addBtn: true,
tip: false,
searchSize: "mini",
searchMenuSpan: 6,
@@ -272,42 +185,185 @@
menuWidth: 275,
align: "center",
border: true,
-
selection: true,
...this.$store.state.control.clearOtherBut,
column: [
- ...column,
+ {
+ label: "企业名称",
+ prop: "enterprisename",
+ search: true,
+ searchSpan: 4,
+ labelWidth: 110,
+ minWidth: 160,
+ rules: [
+ {
+ required: true,
+ message: "请选择企业名称",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "所属辖区",
+ prop: "jurisdiction",
+ //父节点不能选
+ parent: false,
+ labelWidth: 110,
+ type: "tree",
+ dicUrl: "/api//jurisdiction/lazy-trees",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择所属辖区",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "联系人",
+ prop: "contacts",
+ labelWidth: 110,
+ hide: false,
+ },
+ {
+ label: "联系电话",
+ prop: "contactscell",
+ labelWidth: 110,
+ hide: false,
+ },
+ {
+ label: "保安人数",
+ labelWidth: 110,
+ prop: "znum",
+ searchSpan: 4,
+ addDisabled:false,
+ addDisplay:false,
+ editDisabled:false,
+ editDisplay:false,
+ viewDisabled:false,
+ viewDisplay:false,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "派遣人数",
+ labelWidth: 110,
+ prop: "pnum",
+ addDisabled:false,
+ addDisplay:false,
+ editDisabled:false,
+ editDisplay:false,
+ viewDisabled:false,
+ viewDisplay:false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "持证人数",
+ labelWidth: 110,
+ prop: "cnum",
+ addDisabled:false,
+ addDisplay:false,
+ editDisabled:false,
+ editDisplay:false,
+ viewDisabled:false,
+ viewDisplay:false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "企业属性",
+ prop: "stats",
+ type: "tree",
+ hide: true,
+ labelWidth: 110,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=stats",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择企业属性",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "注册地址",
+ prop: "address",
+ labelWidth: 110,
+ // search: true,
+ hide: true,
+ },
+ {
+ label: "注册时间",
+ prop: "establishtime",
+ span: 12,
+ labelWidth: 110,
+ disabled: true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [
+ {
+ required: true,
+ message: "请选择注册时间",
+ trigger: "blur",
+ },
+ ],
+ },
{
label: "服务区域",
- labelWidth: 160,
+ labelWidth: 110,
prop: "fregion",
- width: 69,
},
{
label: "服务时间",
- labelWidth: 160,
+ labelWidth: 110,
prop: "ftime",
- width: 69,
type: "date",
format: "yyyy-MM-dd",
- valueFormat: "timestamp",
+ valueFormat: "yyyy-MM-dd",
},
+ {
+ label: "登记机关",
+ prop: "registration",
+ // search: true,
+ labelWidth: 110,
+ // width: 88,
+ overHidden: true,
+ hide: true,
+ },
+
],
},
};
},
created() {
- this.option0.column[4].value = 0;
- this.option0.column[4].disabled = true;
- if (this.userInfo.role_name == "培训公司管理员") {
- for (let k in this.option0.column) {
- if (this.option0.column[k].prop == "enterprisename") {
- continue;
- }
- if (this.option0.column[k].rules) {
- delete this.option0.column[k].rules;
- }
- }
+ const column = this.findObject(this.option.column, "stats");
+ column.value = "0";
+ if(this.userInfo.role_name=="培训公司管理员"){
+ column.editDisabled = true;
+ column.addDisabled = true;
}
},
computed: {
@@ -318,16 +374,6 @@
ids.push(ele.creditcode);
});
return ids.join(",");
- },
- ids1() {
- let ids1 = [];
- this.selectionList.forEach((ele) => {
- ids1.push(ele.departmentid);
- });
- return ids1.join(",");
- },
- haveID() {
- return this.obj0.creditcode;
},
},
methods: {
@@ -350,47 +396,34 @@
handleTemplate1() {
window.open(`/api/examSubjectChoices/export-template`);
},
-
- // handleChangeTABS(column) {
- // this.typeTABS = column;
- // // this.$message.success(JSON.stringify(column));
- // if (column.prop == "tab1") {
- // this.loading1 = false;
- // this.loading2 = false;
- // this.onLoad(this.page);
- // } else if (column.prop == "tab2") {
- // this.loading = false;
- // this.loading2 = false;
- // this.onLoad1(this.page1); //第二个表格不会自动执行
- // } else if (column.prop == "tab3") {
- // this.loading1 = false;
- // this.loading = false;
- // this.onLoad2(this.page2); //第二个表格不会自动执行
- // }
- // },
//保安单位基本信息
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) {
- // console.log("save1");
- this.forms = true;
- var that = this;
- //先获取部门接口
- getDeptLazyTree().then((res) => {
- var d = res.data.data;
- that.treeData = d;
- // console.log(d);
+ form["createUserId"] = this.userInfo.Id;
+ adddata(form).then((res) => {
+ if (res.data.success) {
+ this.$message({
+ message: "操作成功",
+ type: "success",
+ });
+ this.refreshChange();
+ done();
+ this.forms = false;
+ } else {
+ this.$message({
+ message: "操作失败",
+ type: "warning",
+ });
+ done();
+ }
});
},
searchChange(params, done) {
@@ -476,14 +509,11 @@
this.onLoad(this.page, this.query);
},
rowClick(row) {
- // console.log(row);
- // row.identificationnumber; //统一社会信用代 码
window.localStorage.setItem("danweidata", JSON.stringify(row));
+ var data = JSON.stringify(row);
this.$router.push({
path: "/securityUnitChild",
- // redirect: { name: "foo" },
- query: { rowsecurity: "fromSecurity" },
- // params: { row: row.identificationnumber },
+ query: { data: data },
});
},
//跳转到附近列表页面
@@ -498,7 +528,6 @@
},
onLoad(page, params = {}) {
if (this.userInfo.role_id == "1414840172333842433") {
- console.log("是公安add jurisdiction");
params["jurisdiction"] = this.userInfo.jurisdiction;
}
if (this.userInfo.role_name == "培训公司管理员") {
@@ -518,177 +547,6 @@
console.log(this.data);
this.loading = false;
});
- },
- // nodeClick(data) {//分局 不在这添加
- // // this.treeDeptId = data.id;
- // // this.page.currentPage = 1;
- // // this.onLoad(this.page);
- // // this.$message.success(JSON.stringify(data));
- // this.obj0["departmentid"] = data.title;
- // this.obj1["departmentid"] = data.title;
- // this.obj2["departmentid"] = data.title;
- // this.obj0["useid"] = data.id;
- // this.obj1["useid"] = data.id;
- // this.obj2["useid"] = data.id;
- // this.nobumen = 1;
- // },
- handleSubmit(form, done) {
- form["createUserId"] = this.userInfo.Id;
- // console.log(form);
- // done();
- // return;
- adddata(form).then((res) => {
- if (res.data.success) {
- this.$message({
- message: "提交成功",
- type: "success",
- });
- this.refreshChange();
- done();
- this.forms = false;
- } else {
- this.$message({
- message: "提交失败",
- type: "warning",
- });
- done();
- }
- });
- },
- tip0() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj0) {
- for (var i in column0) {
- if (k == column0[i].prop && k != "title0") {
- d[k] = this.obj0[k];
- }
- }
- }
- console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 0);
- this.data0 = d;
- this.forms = 1;
- },
- tip1() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj1) {
- for (var i in column1) {
- if (k == column1[i].prop && k != "title1") {
- d[k] = this.obj1[k];
- }
- }
- }
- d["capital"] = d["capital2"];
- delete d["capital2"];
- // console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 1);
- this.data1 = d;
- this.forms = 2;
- },
- tip2() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj2) {
- for (var i in column2) {
- if (k == column2[i].prop && k != "title2") {
- d[k] = this.obj2[k];
- }
- }
- }
- console.log(d);
- d["cardid"] = d["cardid2"];
- delete d["cardid2"];
- d["cell"] = d["cell2"];
- delete d["cell2"];
- // d["shareholdingratio"] = d["shareholdingratio2"];
- // delete d["shareholdingratio2"];
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 2);
- this.data2 = d;
-
- // this.data0.departmentid = this.data0.useid;
- // this.data1.departmentid = this.data1.useid;
- // this.data2.departmentid = this.data2.useid;
- // delete this.data0.useid;
- // delete this.data1.useid;
- // delete this.data2.useid;
-
- adddata(this.data0).then((res) => {
- console.log(res, 0);
- });
- adddata1(this.data1).then((res) => {
- console.log(res, 1);
- });
- adddata2(this.data2).then((res) => {
- console.log(res, 2);
- });
- var time = setTimeout(() => {
- this.onLoad(this.page, this.query);
- console.log(this.data0, this.data1, this.data2, "已刷新");
- }, 500);
- this.tipover();
- },
- tip1up1() {
- this.forms = true;
- },
- tip2up2() {
- this.forms = 1;
- },
- tipover() {
- this.forms = false;
- this.obj0 = {
- title0: "保安单位基本信息",
- };
- this.obj1 = {
- title1: "保安单位出资人员",
- };
- this.obj2 = {
- title2: "主要管理人员信息",
- };
- this.data0 = {};
- this.data1 = {};
- this.data2 = {};
- this.noshehuibianma = 0;
- this.nobumen = 0;
- },
- panduanmeiyouziduan() {
- if (this.noshehuibianma == 0) {
- this.$message.warning("请输入统一社会信用代码");
- return true;
- }
- if (this.nobumen == 0) {
- return false;
- this.$message.warning("请选则部门");
- }
- return false;
},
},
watch: {
@@ -718,14 +576,6 @@
// border: 1px solid #000;
box-sizing: border-box;
}
-// .el-card__body {
-// padding-bottom: 5px !important;
-// }
-// .avue-crud__tip,
-// .el-tag,
-// .el-tag--light {
-// padding: 0 !important;
-// }
.lod {
position: absolute;
diff --git a/src/views/securityUnit/transRegionalcompany.vue b/src/views/securityUnit/transRegionalcompany.vue
index cd25153..aafd14b 100644
--- a/src/views/securityUnit/transRegionalcompany.vue
+++ b/src/views/securityUnit/transRegionalcompany.vue
@@ -50,15 +50,6 @@
</template>
<template slot="menuLeft">
<el-button
- type="primary"
- icon="el-icon-plus"
- size="small"
- plain
- @click.stop="rowSave"
- >新增</el-button
- >
-
- <el-button
type="danger"
size="small"
plain
@@ -76,22 +67,6 @@
</el-button>
</template>
</avue-crud>
- <el-dialog
- :visible.sync="forms"
- width="80%"
- top="5vh"
- :modal-append-to-body="false"
- class="addCompany"
- >
- <avue-form
- ref="form"
- v-model="obj0"
- :option="option0"
- v-if="forms"
- @submit="handleSubmit"
- >
- </avue-form>
- </el-dialog>
</div>
<el-dialog
title="保安单位导入"
@@ -115,15 +90,11 @@
</template>
<script>
-import { column, column0, column1, column2 } from "./data";
import {
getdata,
adddata,
update,
remove,
- adddata1,
- adddata2,
- getDeptLazyTree,
} from "@/api/securityUnit/securityUnit";
import { mapGetters } from "vuex";
export default {
@@ -158,7 +129,6 @@
},
],
},
-
loading: true, //保安单位基本信息
selectionList: [],
page: {
@@ -167,7 +137,6 @@
total: 0,
...this.$store.state.control.changePageSize,
},
-
treeData: [],
treeOption: {
title: "我是标题",
@@ -192,81 +161,14 @@
children: "children",
},
},
- // treeOption: {
- // nodeKey: "id",
- // // lazy: true,
- // // treeLoad: function (node, resolve) {
- // // // const parentId = node.level === 0 ? 0 : node.data.id;
- // // getDeptLazyTree().then((res) => {
- // // resolve(
- // // res.data.data.map((item) => {
- // // console.log({
- // // ...item,
- // // leaf: !item.hasChildren,
- // // });
- // // return {
- // // ...item,
- // // leaf: !item.hasChildren,
- // // };
- // // })
- // // );
- // // });
- // // },
- // addBtn: false,
- // menu: false,
- // size: "small",
- // props: {
- // labelText: "标题",
- // label: "title",
- // value: "value",
- // children: "children",
- // },
- // },
-
- obj0: {
- title0: "保安单位基本信息",
- },
- option0: {
- emptyBtn: false,
- submitBtn: true,
- gutter: 30,
- column: column0,
- },
- obj1: {
- title1: "保安单位出资人员",
- },
- option1: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column1,
- },
- obj2: {
- title2: "主要管理人员信息",
- },
- option2: {
- emptyBtn: false,
- submitBtn: false,
- gutter: 30,
- column: column2,
- },
-
forms: false,
- data0: {},
- data1: {},
- data2: {},
- b0: {},
- b1: {},
- b2: {},
noshehuibianma: 0,
nobumen: 0,
-
query: {},
data: [],
option: {
index: true,
- addBtn: false,
- // card: true,
+ addBtn: true,
tip: false,
searchSize: "mini",
searchMenuSpan: 6,
@@ -276,14 +178,214 @@
border: true,
selection: true,
- column: column,
+ column: [
+ {
+ label: "企业名称",
+ prop: "enterprisename",
+ search: true,
+ searchSpan: 4,
+ labelWidth: 145,
+ minWidth: 160,
+ rules: [
+ {
+ required: true,
+ message: "请选择企业名称",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "所属辖区",
+ prop: "jurisdiction",
+ //父节点不能选
+ parent: false,
+ labelWidth: 145,
+ type: "tree",
+ dicUrl: "/api//jurisdiction/lazy-trees",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [
+ {
+ required: false,
+ message: "请选择所属辖区",
+ trigger: "click",
+ },
+ ],
+ overHidden: true,
+ },
+ {
+ label: "分公司负责人",
+ prop: "representative",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ rules: [
+ {
+ required: false,
+ message: "请输入分公司负责人",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "分公司负责人电话",
+ prop: "representativecell",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ rules: [
+ {
+ required: false,
+ message: "请输入分公司负责人电话",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "联系人",
+ prop: "contacts",
+ labelWidth: 145,
+ hide: true,
+ },
+ {
+ label: "联系电话",
+ prop: "contactscell",
+ labelWidth: 145,
+ hide: true,
+ },
+ {
+ label: "保安人数",
+ labelWidth: 145,
+ prop: "znum",
+ searchSpan: 4,
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "派遣人数",
+ labelWidth: 145,
+ prop: "pnum",
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "持证人数",
+ labelWidth: 145,
+ prop: "cnum",
+ addDisabled: false,
+ addDisplay: false,
+ editDisabled: false,
+ editDisplay: false,
+ viewDisabled: false,
+ viewDisplay: false,
+ searchSpan: 4,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "企业属性",
+ prop: "stats",
+ type: "tree",
+ hide: true,
+ labelWidth: 145,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=stats",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择企业属性",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "注册地址",
+ prop: "address",
+ labelWidth: 145,
+ // search: true,
+ hide: true,
+ },
+ {
+ label: "注册时间",
+ prop: "establishtime",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [
+ {
+ required: false,
+ message: "请选择注册时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "办公地址",
+ prop: "industry",
+ span: 12,
+ labelWidth: 145,
+ disabled: false,
+ hide:true,
+ rules: [{
+ required: false,
+ message: "请选择办公地址",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "登记机关",
+ prop: "registration",
+ // search: true,
+ labelWidth: 145,
+ // width: 88,
+ overHidden: true,
+ hide: true,
+ },
+ ],
...this.$store.state.control.clearOtherBut,
},
};
},
created() {
- this.option0.column[4].value = 4;
- this.option0.column[4].disabled = true;
+ const column = this.findObject(this.option.column, "stats");
+ column.value = "4";
+ column.editDisabled = true;
+ column.addDisabled = true;
+ if(this.userInfo.role_name == "administrator" ){
+ column.editDisabled = false;
+ column.addDisabled = false;
+ }
},
computed: {
...mapGetters(["userInfo"]),
@@ -294,20 +396,9 @@
});
return ids.join(",");
},
- ids1() {
- let ids1 = [];
- this.selectionList.forEach((ele) => {
- ids1.push(ele.departmentid);
- });
- return ids1.join(",");
- },
- haveID() {
- return this.obj0.creditcode;
- },
},
methods: {
rowClickSelf(val) {
- // console.log(val.departmentid);
this.$router.push({
path: "/securityGuardOnce/index",
query: { departmentid: val.departmentid },
@@ -325,58 +416,22 @@
handleTemplate1() {
window.open(`/api/examSubjectChoices/export-template`);
},
-
- // handleChangeTABS(column) {
- // this.typeTABS = column;
- // // this.$message.success(JSON.stringify(column));
- // if (column.prop == "tab1") {
- // this.loading1 = false;
- // this.loading2 = false;
- // this.onLoad(this.page);
- // } else if (column.prop == "tab2") {
- // this.loading = false;
- // this.loading2 = false;
- // this.onLoad1(this.page1); //第二个表格不会自动执行
- // } else if (column.prop == "tab3") {
- // this.loading1 = false;
- // this.loading = false;
- // this.onLoad2(this.page2); //第二个表格不会自动执行
- // }
- // },
//保安单位基本信息
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) {
- // console.log("save1");
- this.forms = true;
- var that = this;
- //先获取部门接口
- getDeptLazyTree().then((res) => {
- var d = res.data.data;
- that.treeData = d;
- // console.log(d);
- });
- },
- handleSubmit(form, done) {
form["createUserId"] = this.userInfo.Id;
- // console.log(form);
- // done();
- // return;
adddata(form).then((res) => {
if (res.data.success) {
this.$message({
- message: "提交成功",
+ message: "操作成功",
type: "success",
});
this.refreshChange();
@@ -384,7 +439,7 @@
this.forms = false;
} else {
this.$message({
- message: "提交失败",
+ message: "操作成功",
type: "warning",
});
done();
@@ -474,14 +529,11 @@
this.onLoad(this.page, this.query);
},
rowClick(row) {
- // console.log(row);
- // row.identificationnumber; //统一社会信用代 码
window.localStorage.setItem("danweidata", JSON.stringify(row));
+ var data = JSON.stringify(row);
this.$router.push({
path: "/securityUnitChild",
- // redirect: { name: "foo" },
- query: { rowsecurity: "fromSecurity" },
- // params: { row: row.identificationnumber },
+ query: { data: data },
});
},
//跳转到附近列表页面
@@ -513,154 +565,6 @@
console.log(this.data);
this.loading = false;
});
- },
- // nodeClick(data) {//分局 不在这添加
- // // this.treeDeptId = data.id;
- // // this.page.currentPage = 1;
- // // this.onLoad(this.page);
- // // this.$message.success(JSON.stringify(data));
- // this.obj0["departmentid"] = data.title;
- // this.obj1["departmentid"] = data.title;
- // this.obj2["departmentid"] = data.title;
- // this.obj0["useid"] = data.id;
- // this.obj1["useid"] = data.id;
- // this.obj2["useid"] = data.id;
- // this.nobumen = 1;
- // },
- tip0() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj0) {
- for (var i in column0) {
- if (k == column0[i].prop && k != "title0") {
- d[k] = this.obj0[k];
- }
- }
- }
- console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 0);
- this.data0 = d;
- this.forms = 1;
- },
- tip1() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj1) {
- for (var i in column1) {
- if (k == column1[i].prop && k != "title1") {
- d[k] = this.obj1[k];
- }
- }
- }
- d["capital"] = d["capital2"];
- delete d["capital2"];
- // console.log(d);
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 1);
- this.data1 = d;
- this.forms = 2;
- },
- tip2() {
- if (this.panduanmeiyouziduan()) {
- return;
- }
- var d = {};
- for (var k in this.obj2) {
- for (var i in column2) {
- if (k == column2[i].prop && k != "title2") {
- d[k] = this.obj2[k];
- }
- }
- }
- console.log(d);
- d["cardid"] = d["cardid2"];
- delete d["cardid2"];
- d["cell"] = d["cell2"];
- delete d["cell2"];
- // d["shareholdingratio"] = d["shareholdingratio2"];
- // delete d["shareholdingratio2"];
- for (var k in d) {
- if (d[k] == "" || d[k] == undefined) {
- console.log(k);
- this.$message.warning("请检查表单是否填写完整!");
- return;
- }
- }
- console.log(d, 2);
- this.data2 = d;
-
- // this.data0.departmentid = this.data0.useid;
- // this.data1.departmentid = this.data1.useid;
- // this.data2.departmentid = this.data2.useid;
- // delete this.data0.useid;
- // delete this.data1.useid;
- // delete this.data2.useid;
-
- adddata(this.data0).then((res) => {
- console.log(res, 0);
- });
- adddata1(this.data1).then((res) => {
- console.log(res, 1);
- });
- adddata2(this.data2).then((res) => {
- console.log(res, 2);
- });
- var time = setTimeout(() => {
- this.onLoad(this.page, this.query);
- console.log(this.data0, this.data1, this.data2, "已刷新");
- }, 500);
- this.tipover();
- },
- tip1up1() {
- this.forms = true;
- },
- tip2up2() {
- this.forms = 1;
- },
- tipover() {
- this.forms = -1;
- this.obj0 = {
- title0: "保安单位基本信息",
- };
- this.obj1 = {
- title1: "保安单位出资人员",
- };
- this.obj2 = {
- title2: "主要管理人员信息",
- };
- this.data0 = {};
- this.data1 = {};
- this.data2 = {};
- this.noshehuibianma = 0;
- this.nobumen = 0;
- },
- panduanmeiyouziduan() {
- if (this.noshehuibianma == 0) {
- this.$message.warning("请输入统一社会信用代码");
- return true;
- }
- if (this.nobumen == 0) {
- return false;
- this.$message.warning("请选则部门");
- }
- return false;
},
},
watch: {
diff --git a/src/views/securityUnitChild/data.js b/src/views/securityUnitChild/data.js
index bd16da3..ce454d9 100644
--- a/src/views/securityUnitChild/data.js
+++ b/src/views/securityUnitChild/data.js
@@ -1,10 +1,3 @@
-var DIC = [{
- label: '招聘中',
- value: 1,
-}, {
- label: '停止招聘',
- value: 2,
-}]
var w = 160,
s = 12;
@@ -31,125 +24,15 @@
{
label: "企业名称",
prop: "enterprisename",
- span: 11,
- labelWidth: 130,
- disabled: true,
- },
- // {
- // label: "统一社会信用代码",
- // prop: "creditcode",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- {
- label: "法定代表人",
- prop: "representative",
- span: 11,
- labelWidth: 130,
+ span: 12,
+ labelWidth: 145,
disabled: true,
rules: [{
required: true,
- message: "请输入法定代表人",
- trigger: "blur",
- }, ],
- }, {
- label: "法定代表人电话",
- prop: "representativecell",
- span: 11,
- labelWidth: 130,
- disabled: true,
- rules: [{
- required: true,
- message: "请输入法定代表人电话",
+ message: "请输入企业名称",
trigger: "blur",
}, ],
},
- {
- label: "联系人",
- prop: "contacts",
- span: 11,
- labelWidth: 130,
- disabled: true,
- }, {
- label: "联系电话",
- prop: "contactscell",
- span: 11,
- labelWidth: 130,
- disabled: true,
- },
- // {
- // label: "注册时间",
- // prop: "establishtime",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- // {
- // label: "注册资本",
- // prop: "registeredcapital",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- // {
- // label: "实缴资本",
- // prop: "capital",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- // {
- // label: "组织机构代码",
- // prop: "organizationcode",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- // {
- // label: "工商注册号",
- // prop: "registrationnumber",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- // {
- // label: "纳税人识别号",
- // prop: "identificationnumber",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- {
- label: "企业类型",
- prop: "stats",
- type: "tree",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=stats",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- span: 11,
- labelWidth: 130,
- disabled: true,
- },
- {
- label: "注册地址",
- prop: "address",
- span: 11,
- labelWidth: 130,
- disabled: true,
- // search: true,
- },
- // {
- // label: "所属辖区",
- // prop: "region",
- // span: 11,
- // labelWidth: 130,
- // width: 110,
- // overHidden: true,
- // disabled: true,
- // },
{
label: "所属辖区",
prop: "jurisdiction",
@@ -162,43 +45,145 @@
label: "title",
value: "id",
},
- span: 11,
- labelWidth: 130,
+ span: 12,
+ labelWidth: 145,
width: 110,
overHidden: true,
disabled: true,
rules: [{
- required: false,
+ required: true,
message: "请选择所属辖区",
trigger: "click",
}, ],
},
{
- label: "所属行业",
- prop: "industry",
- span: 11,
- labelWidth: 130,
+ label: "法定代表人",
+ prop: "representative",
+ span: 12,
+ labelWidth: 145,
disabled: true,
+ rules: [{
+ required: true,
+ message: "请输入法定代表人",
+ trigger: "blur",
+ }, ],
+ }, {
+ label: "法定代表人电话",
+ prop: "representativecell",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ rules: [{
+ required: true,
+ message: "请输入法定代表人电话",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "联系人",
+ prop: "contacts",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ rules: [{
+ required: true,
+ message: "请输入联系人",
+ trigger: "blur",
+ }, ],
+ }, {
+ label: "联系电话",
+ prop: "contactscell",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ rules: [{
+ required: true,
+ message: "请输入联系电话",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "企业属性",
+ prop: "stats",
+ type: "tree",
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=statsType",
+ props: {
+ label: "dictValue",
+ value: "dictKey"
+ },
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ rules: [{
+ required: true,
+ message: "请输入企业属性",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "注册地址",
+ prop: "address",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ // search: true,
+ rules: [{
+ required: true,
+ message: "请输入注册地址",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "办公地址",
+ prop: "industry",
+ span: 12,
+ labelWidth: 145,
+ disabled: true,
+ rules: [{
+ required: true,
+ message: "请选择办公地址",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "服务区域",
+ labelWidth: 145,
+ prop: "fregion",
+ display: false,
+ rules: [{
+ required: true,
+ message: "请输入服务区域",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "服务时间",
+ labelWidth: 145,
+ prop: "ftime",
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ display: false,
+ rules: [{
+ required: true,
+ message: "请选择服务时间",
+ trigger: "blur",
+ }, ],
},
{
label: "登记机关",
prop: "registration",
// span: 11,
- labelWidth: 130,
+ labelWidth: 145,
disabled: true,
- span: 11,
+ span: 12,
+ rules: [{
+ required: true,
+ message: "请输入登记机关",
+ trigger: "blur",
+ }, ],
},
- {
- label: "经营范围",
- prop: "business",
- span: 24,
- labelWidth: 130,
- width: 110,
- // overHidden: true,
- type: 'textarea',
- showWordLimit: true,
- disabled: true,
- }
+
]
export var column11 = [{
label: "",
@@ -210,51 +195,17 @@
fontSize: '24px'
}
},
- // {
- // label: "企业名称",
- // prop: "enterprisename",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
{
label: "统一社会信用代码",
prop: "creditcode",
- span: 11,
+ span: 12,
labelWidth: 130,
disabled: true,
},
- // {
- // label: "法定代表人",
- // prop: "representative",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- // {
- // label: "法定代表人电话",
- // prop: "representativecell",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- // {
- // label: "联系人",
- // prop: "contacts",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // }, {
- // label: "联系电话",
- // prop: "contactscell",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
{
label: "注册时间",
prop: "establishtime",
- span: 11,
+ span: 12,
labelWidth: 130,
disabled: true,
type: "date",
@@ -278,118 +229,65 @@
trigger: "blur",
}, ],
},
+
{
label: "注册资本",
prop: "registeredcapital",
- span: 11,
- labelWidth: 130,
- disabled: true,
- },
- // {
- // label: "实缴资本",
- // prop: "capital",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // },
- {
- label: "组织机构代码",
- prop: "organizationcode",
- span: 11,
+ span: 12,
labelWidth: 130,
disabled: true,
},
{
- label: "工商注册号",
- prop: "registrationnumber",
- span: 11,
+ label: "经营范围",
+ prop: "business",
+ span: 12,
labelWidth: 130,
+ width: 110,
+ // overHidden: true,
+ // type: 'textarea',
+ showWordLimit: true,
disabled: true,
},
{
- label: "纳税人识别号",
- prop: "identificationnumber",
- span: 11,
+ label: '营业执照',
+ prop: 'businessLicense',
+ type: 'upload',
+ listType: 'picture-img',
+ span: 12,
+ propsHttp: {
+ res: 'data'
+ },
+ canvasOption: {
+ text: '',
+ ratio: 1.0
+ },
labelWidth: 130,
+ tip: '只能上传jpg/png格式图片,且不超过2Mb',
+ action: "/api/blade-resource/oss/endpoint/put-files",
disabled: true,
},
// {
- // label: "企业类型",
- // prop: "stats",
- // type: "tree",
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=stats",
- // props: {
- // label: "dictValue",
- // value: "dictKey"
- // },
+ // label: "组织机构代码",
+ // prop: "organizationcode",
// span: 11,
// labelWidth: 130,
// disabled: true,
// },
// {
- // label: "注册地址",
- // prop: "address",
- // span: 11,
- // labelWidth: 130,
- // disabled: true,
- // // search: true,
- // },
- // {
- // label: "所属辖区",
- // prop: "region",
- // span: 11,
- // labelWidth: 130,
- // width: 110,
- // overHidden: true,
- // disabled: true,
- // },
- // {
- // label: "所属辖区",
- // prop: "region",
- // // multiple: true,
- // type: "tree",
- // dicUrl: "/api/jurisdiction/lazy-tree",
- // props: {
- // label: "title",
- // value: "id",
- // },
- // span: 11,
- // labelWidth: 130,
- // width: 110,
- // overHidden: true,
- // disabled: true,
- // rules: [{
- // required: false,
- // message: "请选择所属辖区",
- // trigger: "click",
- // }, ],
- // },
- // {
- // label: "所属行业",
- // prop: "industry",
+ // label: "工商注册号",
+ // prop: "registrationnumber",
// span: 11,
// labelWidth: 130,
// disabled: true,
// },
// {
- // label: "登记机关",
- // prop: "registration",
- // // span: 11,
- // labelWidth: 130,
- // disabled: true,
+ // label: "纳税人识别号",
+ // prop: "identificationnumber",
// span: 11,
- // },
- // {
- // label: "经营范围",
- // prop: "business",
- // span: 24,
// labelWidth: 130,
- // width: 110,
- // // overHidden: true,
- // type: 'textarea',
- // showWordLimit: true,
// disabled: true,
- // }
+ // },
+
]
export var column1 = [{
label: "id",
diff --git a/src/views/securityUnitChild/index copy.vue b/src/views/securityUnitChild/index copy.vue
new file mode 100644
index 0000000..2b56522
--- /dev/null
+++ b/src/views/securityUnitChild/index copy.vue
@@ -0,0 +1,1182 @@
+<template>
+ <div class="dispatch">
+ <!-- <avue-tabs :option="optionTABS" @change="handleChangeTABS"></avue-tabs>
+ <span v-if="typeTABS.prop === 'tab1'" class="tab">
+ <basic-container>
+ <avue-form
+ ref="form"
+ v-model="obj0"
+ :option="option0"
+ @submit="submit0"
+ >
+ </avue-form>
+ </basic-container>
+ </span>
+ <span v-if="typeTABS.prop === 'tab11'" class="tab">
+ <basic-container>
+ <avue-form
+ ref="form"
+ v-model="obj0"
+ :option="option01"
+ @submit="submit0"
+ >
+ </avue-form>
+ </basic-container>
+ </span>
+ <span v-else-if="typeTABS.prop === 'tab2'" class="tab">
+ <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"
+ @on-load="onLoad1"
+ >
+ <template slot="menuLeft">
+ <el-button
+ type="danger"
+ size="small"
+ plain
+ icon="el-icon-delete"
+ @click="handleDelete1"
+ >删 除
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ @click="handleImport"
+ >批量导入
+ </el-button>
+ </template>
+ </avue-crud>
+ </basic-container>
+ </span>
+ <span v-else-if="typeTABS.prop === 'tab3'" class="tab">
+ <basic-container>
+ <avue-crud
+ :option="option2"
+ :data="data2"
+ :page.sync="page2"
+ ref="crudrec2"
+ :table-loading="loading2"
+ @row-save="rowSave2"
+ @search-change="searchChange2"
+ @search-reset="searchReset2"
+ @row-update="rowUpdate2"
+ @row-del="rowDel2"
+ @selection-change="selectionChange2"
+ @refresh-change="refreshChange2"
+ @on-load="onLoad2"
+ >
+ <template slot="menuLeft">
+ <el-button
+ type="danger"
+ size="small"
+ plain
+ icon="el-icon-delete"
+ @click="handleDelete2"
+ >删 除
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ @click="handleImport1"
+ >批量导入
+ </el-button>
+ </template>
+ </avue-crud>
+ </basic-container>
+ </span>
+ <span v-else-if="typeTABS.prop === 'tab4'" class="tab">
+ <equipments :fromDeptId="departmentid"></equipments>
+ </span>
+ <span v-else-if="typeTABS.prop === 'tab5'" class="tab">
+ <car :fromDeptId="departmentid"></car>
+ </span>
+ <span v-else-if="typeTABS.prop === 'tab9'" class="tab">
+ <social :deptid="obj0.departmentid"></social>
+ </span>
+ <span v-else-if="typeTABS.prop === 'tab7'" class="tab">
+ <businessLicense :row="obj0"></businessLicense>
+ </span>
+ <span v-else-if="typeTABS.prop === 'tab8'" class="tab">
+ <licence :row="obj0"></licence>
+ </span> -->
+ <el-tabs v-model="activeName" @tab-click="handleClick">
+ <!-- <span v-if="typeTABS.prop === 'tab1'" class="tab"> -->
+ <el-tab-pane label="保安单位基本信息" name="tab1">
+ <basic-container>
+ <avue-form
+ ref="form"
+ v-model="obj0"
+ :option="option0"
+ @submit="submit0"
+ >
+ </avue-form>
+ </basic-container>
+ <!-- </span> -->
+ </el-tab-pane>
+ <!-- <span v-if="typeTABS.prop === 'tab11'" class="tab"> -->
+ <el-tab-pane label="工商信息" name="tab11">
+ <basic-container>
+ <avue-form
+ ref="form"
+ v-model="obj0"
+ :option="option01"
+ @submit="submit0"
+ >
+ </avue-form>
+ </basic-container>
+ <!-- </span> -->
+ </el-tab-pane>
+ <!-- <span v-else-if="typeTABS.prop === 'tab2'" class="tab"> -->
+
+ <el-tab-pane
+ :label="tab2label"
+ name="tab2"
+ :class="[
+ $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
+ ]"
+ >
+ <div class="manager">
+ <basic-container>
+ <avue-crud
+ v-if="true"
+ :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"
+ @on-load="onLoad1"
+ >
+ <template slot="menuLeft">
+ <el-button
+ type="danger"
+ size="small"
+ plain
+ icon="el-icon-delete"
+ @click="handleDelete1"
+ >删 除
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ @click="handleImport"
+ >批量导入
+ </el-button>
+ </template>
+ </avue-crud>
+ </basic-container>
+ </div>
+ <!-- </span> -->
+ </el-tab-pane>
+
+ <!-- <span v-else-if="typeTABS.prop === 'tab3'" class="tab"> -->
+ <el-tab-pane
+ label="主要管理人员信息"
+ name="tab3"
+ :class="[
+ $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
+ ]"
+ >
+ <div class="manager">
+ <basic-container>
+ <avue-crud
+ v-if="true"
+ :option="option2"
+ :data="data2"
+ :page.sync="page2"
+ ref="crudrec2"
+ :table-loading="loading2"
+ @row-save="rowSave2"
+ @search-change="searchChange2"
+ @search-reset="searchReset2"
+ @row-update="rowUpdate2"
+ @row-del="rowDel2"
+ @selection-change="selectionChange2"
+ @refresh-change="refreshChange2"
+ @on-load="onLoad2"
+ >
+ <template slot="menuLeft">
+ <el-button
+ type="danger"
+ size="small"
+ plain
+ icon="el-icon-delete"
+ @click="handleDelete2"
+ >删 除
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ @click="handleImport1"
+ >批量导入
+ </el-button>
+ </template>
+ </avue-crud>
+ </basic-container>
+ </div>
+ <!-- </span> -->
+ </el-tab-pane>
+ <!-- <span v-else-if="typeTABS.prop === 'tab4'" class="tab"> -->
+ <el-tab-pane label="装备管理" name="tab4">
+ <!-- 装备管理 -->
+ <equipments
+ v-if="overzb"
+ :fromDeptId="departmentid"
+ :windowHeight="windowHeight"
+ ></equipments>
+ <!-- </span> -->
+ </el-tab-pane>
+ <!-- <span v-else-if="typeTABS.prop === 'tab5'" class="tab"> -->
+ <el-tab-pane label="车辆管理" name="tab5">
+ <!-- 车辆管理 -->
+ <car
+ :fromDeptId="departmentid"
+ v-if="overcar"
+ :windowHeight="windowHeight"
+ ></car>
+ <!-- </span> -->
+ </el-tab-pane>
+ <!-- <span v-else-if="typeTABS.prop === 'tab6'" class="tab">
+ 枪支管理
+ <gun :fromDeptId="departmentid"></gun>
+ </span> -->
+ <!-- <span v-else-if="typeTABS.prop === 'tab9'" class="tab"> -->
+ <el-tab-pane label="社保记录" name="tab9">
+ <!-- 社保记录 -->
+ <social
+ :deptid="obj0.departmentid"
+ :socialRE="social"
+ v-if="social"
+ ></social>
+ <!-- </span> -->
+ </el-tab-pane>
+ <!-- <span v-else-if="typeTABS.prop === 'tab7'" class="tab"> -->
+ <el-tab-pane label="营业执照" name="tab7">
+ <!-- 营业执照 -->
+ <businessLicense :row="obj0" v-if="overHtp"></businessLicense>
+ <!-- </span> -->
+ </el-tab-pane>
+ <!-- <span v-else-if="typeTABS.prop === 'tab8'" class="tab"> -->
+ <el-tab-pane label="许可证" name="tab8">
+ <!-- 许可证 -->
+ <licence :row="obj0" v-if="overHtp"></licence>
+ <!-- </span> -->
+ </el-tab-pane>
+ </el-tabs>
+ <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>
+
+ <el-dialog
+ title="管理人导入"
+ append-to-body
+ :visible.sync="excelBox1"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption1"
+ v-model="excelForm1"
+ :upload-after="uploadAfter1"
+ >
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate1">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import { column11, column, column1, column2 } from "./data";
+import {
+ getOncedata,
+ update,
+ getdataOnce1,
+ adddata1,
+ update1,
+ remove1,
+ getdataOnce2,
+ adddata2,
+ update2,
+ remove2,
+} from "@/api/securityUnit/securityUnit";
+import equipments from "../securityEquipment/equipments.vue";
+import car from "../securityEquipment/car.vue";
+import gun from "../securityEquipment/gun.vue";
+import licence from "./licence.vue";
+import businessLicense from "./businessLicense.vue";
+import social from "./social.vue";
+import { mapGetters } from "vuex";
+import { getRoleDetail } from "@/api/system/role";
+
+export default {
+ components: {
+ equipments: equipments,
+ car: car,
+ gun: gun,
+ licence: licence,
+ businessLicense: businessLicense,
+ social: social,
+ },
+ data() {
+ return {
+ tab2label:"",
+ visible: false,
+ overzb: false, //结决id传入、信息获取的优先级
+ overcar: false, //结决id传入、信息获取的优先级
+ social: false, //解决表格错乱
+ overHtp: false,
+ activeName: "tab1",
+ departmentid: "",
+ excelBox: false, //出资人
+ 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/shareholder/import-share",
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+
+ excelBox1: false, //管理人
+ excelForm1: {},
+ excelOption1: {
+ submitBtn: false,
+ emptyBtn: false,
+ ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "文件上传",
+ prop: "excelFile",
+ type: "upload",
+ drag: true,
+ loadText: "文件上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 .xls,.xlsx 标准格式文件",
+ action: "/api/member/import-member",
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+
+ typeTABS: {}, //标签页
+ optionTABS: {
+ column: [
+ {
+ // icon: "el-icon-info",
+ label: "保安单位基本信息",
+ prop: "tab1",
+ },
+ {
+ // icon: "el-icon-info",
+ label: "工商信息",
+ prop: "tab11",
+ },
+ {
+ // icon: "el-icon-info",
+ label: "保安单位出资人员",
+ prop: "tab2",
+ },
+ {
+ // icon: "el-icon-info",
+ label: "主要管理人员信息",
+ prop: "tab3",
+ },
+ {
+ // icon: "el-icon-info",
+ label: "装备管理 ",
+ prop: "tab4",
+ },
+ {
+ // icon: "el-icon-info",
+ label: "车辆管理 ",
+ prop: "tab5",
+ },
+ // {
+ // // icon: "el-icon-info",
+ // label: "枪支管理 ",
+ // prop: "tab6",
+ // },
+ {
+ // icon: "el-icon-info",
+ label: "社保记录 ",
+ prop: "tab9",
+ },
+ {
+ // icon: "el-icon-info",
+ label: "营业执照 ",
+ prop: "tab7",
+ },
+ {
+ // icon: "el-icon-info",
+ label: "许可证 ",
+ prop: "tab8",
+ },
+ ],
+ },
+
+ //全局单位统一社会信用代码
+ creditcode: "",
+ //保安单位信息表单
+ obj0: {
+ // title: "我是头部标题",
+ },
+ option0: {
+ emptyBtn: false,
+ submitBtn: false,
+ submitText: "保存",
+ gutter: 30,
+ column: column,
+ },
+
+ option01: {
+ emptyBtn: false,
+ submitBtn: false,
+ submitText: "保存",
+ gutter: 30,
+ column: column11,
+ },
+
+ loading1: true, //派遣记录
+ selectionList1: [],
+ page1: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ ...this.$store.state.control.changePageSize,
+ },
+ query1: {},
+ data1: [],
+ option1: {
+ // card: true,
+ tip: false,
+ searchSize: "mini",
+ searchMenuSpan: 8,
+ height: "auto",
+ menuWidth: 200,
+ align: "center",
+ selection: true,
+ ...this.$store.state.control.clearOtherBut,
+ column: column1,
+ },
+
+ loading2: true, //派遣记录
+ selectionList2: [],
+ page2: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ ...this.$store.state.control.changePageSize,
+ },
+ query2: {},
+ data2: [],
+ option2: {
+ // card: true,
+ tip: false,
+ searchSize: "mini",
+ searchMenuSpan: 8,
+ height: "auto",
+ menuWidth: 200,
+ menuAlign: "center",
+ align: "center",
+ selection: true,
+ ...this.$store.state.control.clearOtherBut,
+ column: column2,
+ },
+ };
+ },
+ computed: {
+ ...mapGetters(["userInfo", "windowHeight"]),
+ chuzitime() {
+ return this.data1.capitaltime;
+ },
+ // 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(",");
+ },
+ ids2() {
+ let ids2 = [];
+ this.selectionList2.forEach((ele) => {
+ ids2.push(ele.id);
+ });
+ return ids2.join(",");
+ },
+ },
+ methods: {
+ submit0(row, done, loading) {
+ // let nowTab = this.typeTABS.prop;
+ // console.log(this.typeTABS);
+ if (this.userInfo.role_name == "保安公司管理员") {
+ row["departmentid"] = this.userInfo.dept_id;
+ }
+ console.log(row);
+ update(row).then(
+ () => {
+ // this.onLoad(this.page);
+ // this.onloads();
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.onloads();
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+
+ done();
+ },
+ handleImport() {
+ //出资人
+ this.excelBox = true;
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox = false;
+ this.refreshChange1();
+ done();
+ },
+ handleTemplate() {
+ window.open(`/api/shareholder/export-template`);
+ },
+
+ handleImport1() {
+ //管理人
+ this.excelBox1 = true;
+ },
+ uploadAfter1(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox1 = false;
+ this.refreshChange2();
+ done();
+ },
+ handleTemplate1() {
+ window.open(`/api/member/export-template`);
+ },
+
+ // handleChangeTABS(column) {
+ // // this.typeTABS = column;
+ // // console.log(column.prop);
+ // // this.$message.success(JSON.stringify(column));
+ // if (column.prop == "tab1") {
+ // this.loading1 = false;
+ // this.loading2 = false;
+ // // this.onLoad(this.page);
+ // } else if (column.prop == "tab2") {
+ // // this.loading1 = false;
+ // this.loading2 = false;
+ // this.onLoad1(this.page1); //第二个表格不会自动执行
+ // } else if (column.prop == "tab3") {
+ // this.loading1 = false;
+ // // this.loading2 = false;
+ // this.onLoad2(this.page2); //第二个表格不会自动执行
+ // }
+ // },
+ handleClick(tab, event) {
+ // console.log(tab.name, event);
+ if (tab.name == "tab1") {
+ this.loading1 = false;
+ this.loading2 = false;
+ // this.onLoad(this.page);
+ } else if (tab.name == "tab5") {
+ this.overcar = true;
+ // this.onLoad(this.page);
+ } else if (tab.name == "tab4") {
+ this.overzb = true;
+ // this.onLoad(this.page);
+ } else if (tab.name == "tab2") {
+ // this.loading1 = false;
+ this.loading2 = false;
+ this.onLoad1(this.page1); //第二个表格不会自动执行
+ } else if (tab.name == "tab3") {
+ this.loading1 = false;
+ // this.loading2 = false;
+ this.onLoad2(this.page2); //第二个表格不会自动执行
+ } else if (tab.name == "tab9") {
+ this.social = true; //表格错乱
+ } else {
+ this.social = false;
+ this.overcar = false;
+ this.overzb = false;
+ this.overcar = 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.data[0];
+ // delete form.id;
+ // for (var k = 0; k < 13; k++) {
+ form["deptId"] = this.departmentid;
+ adddata1(form).then(
+ () => {
+ 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) {
+ delete row.shareholdingratio;
+ delete row.tenantId;
+
+ console.log(row);
+ row["deptId"] = this.departmentid;
+ 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;
+ },
+ handleDelete1() {
+ 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() {
+ this.onLoad1(this.page1, this.query1);
+ },
+
+ //
+ onLoad1(page, params = {}) {
+ this.loading1 = true;
+ // console.log(page, params, 3435434);
+ params["deptId"] = this.departmentid;
+ getdataOnce1(
+ 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);
+ this.loading1 = false;
+
+ // this.$refs.crudrec1.refreshTable();
+ // this.$refs.crudrec1.doLayout();
+ });
+ // onLoad1(page, params = {}) {
+ // this.loading1 = true;
+ // // 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);
+ // this.loading1 = false;
+ // });
+ },
+ //派遣记录
+
+ //派遣记录
+ sizeChange2(val) {
+ this.page2.currentPage = 1;
+ this.page2.pageSize = val;
+ // this.getData();
+ this.onLoad2(this.page2, this.query2);
+ // this.$message.success("行数" + val);
+ },
+ currentChange2(val) {
+ this.page2.currentPage = val;
+ // this.getData();
+ this.onLoad2(this.page2, this.query2);
+ // this.$message.success("页码" + val);
+ },
+ rowSave2(form, done, loading) {
+ // var that = this;
+ // var form = this.data[0];
+ // delete form.id;
+ // for (var k = 0; k < 13; k++) {
+ form["deptId"] = this.departmentid;
+ adddata2(form).then(
+ () => {
+ this.onLoad2(this.page1);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ // }
+ },
+ searchChange2(params, done) {
+ this.query2 = params;
+ this.page2.currentPage = 1;
+ this.onLoad2(this.page2, params);
+ done();
+ },
+ searchReset2() {
+ this.query = {};
+ this.onLoad2(this.page2);
+ },
+ rowUpdate2(row, index, done, loading) {
+ console.log(row);
+ delete row.shareholdingratio;
+ row["deptId"] = this.departmentid;
+ update2(row).then(
+ () => {
+ this.onLoad2(this.page2);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ rowDel2(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove2(row.id);
+ })
+ .then(() => {
+ this.onLoad2(this.page1);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ selectionChange2(list) {
+ this.selectionList2 = list;
+ },
+ handleDelete2() {
+ if (this.selectionList2.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove2(this.ids2);
+ })
+ .then(() => {
+ this.onLoad2(this.page2);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crudrec2.toggleSelection();
+ });
+ },
+ refreshChange2() {
+ this.onLoad2(this.page2, this.query2);
+ },
+
+ //
+ onLoad2(page, params = {}) {
+ this.loading2 = true;
+ // console.log(page);
+ // getdata2(
+ params["deptId"] = this.departmentid;
+ getdataOnce2(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query)
+ ).then((res) => {
+ // console.log(res);
+ const data = res.data.data;
+ this.page2.total = data.total;
+ this.data2 = data.records;
+ // console.log(this.data2);
+ this.loading2 = false;
+ this.$refs.crudrec2.refreshTable();
+ this.$refs.crudrec2.doLayout();
+ });
+ },
+ //派遣记录
+ saveLock(name, val) {
+ window.localStorage.setItem(name, val);
+ },
+ readLock(name) {
+ return window.localStorage.getItem(name);
+ },
+ onloads(tab) {
+ var that = this;
+ var doit = (a) => {
+ that.typeTABS = that.optionTABS.column[0];
+ // if (tab) {
+ // that.typeTABS.prop = tab;
+ // }
+ var row = {};
+ if (that.readLock("danweidata") != null) {
+ row = JSON.parse(that.readLock("danweidata"));
+ // that.obj0.title = row.enterprisename;
+ // console.log(row, "rowneibu");
+ that.departmentid = row.departmentid;
+ for (var k in row) {
+ that.obj0[k] = row[k];
+ }
+ if (row.creditcode == "") {
+ that.creditcode = 111;
+ } else {
+ that.creditcode = row.creditcode;
+ }
+ that.overHtp = true;
+ if (that.readLock("danweidataS") != null && a == 1) {
+ var b = JSON.parse(that.readLock("danweidataS"));
+ var i = 0;
+ for (var k in b) {
+ if (b[k].enterprisename == row.enterprisename) {
+ i = 1;
+ }
+ }
+ if (i == 1) {
+ // console.log("存在");
+ } else {
+ // console.log("已删除");
+
+ that.obj0 = {};
+ that.obj0.enterprisename = row.enterprisename + "该公司已删除";
+ window.localStorage.removeItem("danweidata");
+ that.creditcode = "";
+ }
+ }
+ } else {
+ // console.log("no");
+ that.obj0.enterprisename = "未选择查询单位";
+ }
+ };
+ 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);
+ }
+
+ var getdatas = (roleAlias) => {
+ var fromSecunityGuardId = that.$route.query.fromSecunityGuardId;
+ // var fromSecunityGuardId = that.$route.query;
+ if (fromSecunityGuardId != undefined || roleAlias == "保安公司管理员") {
+ var value = {
+ departmentid: fromSecunityGuardId || that.userInfo.dept_id,
+ };
+ getOncedata(value).then((res) => {
+ // console.log(res.data.data, "get");
+ window.localStorage.setItem(
+ "danweidata",
+ JSON.stringify(res.data.data)
+ );
+ doit();
+ });
+ // return;
+ } else {
+ doit(1);
+ }
+ };
+
+ // console.log(this.userInfo, "userInfo");
+ //获取当前登录人员的角色信息
+ var roleIds = this.userInfo.role_id.split(",");
+ roleIds.forEach((roleId) => {
+ getRoleDetail(roleId).then((res) => {
+ var roleAlias = res.data.data.roleAlias;
+ var d = that.option0.column;
+ var e = that.option01.column;
+ // console.log(roleAlias);
+ if (roleAlias == "保安公司管理员") {
+ that.option0.submitBtn = true;
+ that.option01.submitBtn = true;
+ for (var k in d) {
+ // if (d[k].label != "企业类型") {
+ d[k].disabled = false;
+ // }
+ }
+ for (var n in e) {
+ // if (d[k].label != "企业类型") {
+ e[n].disabled = false;
+ // }
+ }
+ } else {
+ that.option0.submitBtn = false;
+ that.option01.submitBtn = false;
+ for (var k in d) {
+ d[k].disabled = true;
+ }
+ for (var n in e) {
+ e[n].disabled = true;
+ }
+ }
+ getdatas(roleAlias);
+ });
+ });
+ },
+ //数据初始化
+ initData(){
+ var role_name = this.userInfo.role_name;
+ var data = this.$route.query.data;
+ var deptId = this.$route.query.data.departmentid;
+ console.log(this.$route.query,1111111);
+ //1.判断进入的入口,单位信息进入,单位列表查看进入
+ if(deptId){
+ //2.1 单位信息进入
+ //判断人员角色
+ if(role_name=="公安管理员" || role_name=="administrator"){
+ //3.1 判断按进入的公司类型
+ if(data.state=="2"){
+ //本市保安公司,对应的tab 条数
+
+ }
+ }
+ if(role_name=="保安公司管理员" || role_name=="分公司管理员"){
+ //3.2 判断按进入的公司类型
+ }
+
+ }else{
+ //单位列表进入
+ //判断人员角色
+
+ }
+ }
+ },
+ mounted() {
+ this.onloads();
+ },
+ created(){
+ //初始化信息
+ this.initData();
+ },
+ watch: {
+ // windowWidth() {
+ // console.log(this.windowWidth, "windowWidth");
+ // },
+ windowHeight() {
+ // console.log(this.windowHeight, "windowHeight");
+ // this.option1.height = this.windowHeight + 100;
+ // this.option2.height = this.windowHeight - 320;
+ this.visible = false;
+ this.$nextTick(() => {
+ this.visible = true;
+ this.refreshChange1();
+ this.refreshChange2();
+ });
+ },
+ },
+};
+</script>
+
+<style lang="scss" scoped>
+.dispatch {
+ width: 100%;
+ height: 100%;
+ // border: 1px solid #000;
+ box-sizing: border-box;
+}
+// .el-card__body {
+// padding-bottom: 5px !important;
+// }
+// .avue-crud__tip,
+// .el-tag,
+// .el-tag--light {
+// padding: 0 !important;
+// }
+
+.el-collapse-item {
+ padding-top: 15px !important;
+}
+
+.tab {
+ position: relative;
+ // border: 1px solid red;
+ background-color: #fff;
+ height: 92%;
+ display: inline-block;
+ width: 100%;
+ overflow: hidden;
+ top: -10px;
+}
+
+.manager{
+ height: 755px;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/securityUnitChild/index.vue b/src/views/securityUnitChild/index.vue
index 8df4ec1..6e7a136 100644
--- a/src/views/securityUnitChild/index.vue
+++ b/src/views/securityUnitChild/index.vue
@@ -1,352 +1,91 @@
<template>
<div class="dispatch">
- <!-- <avue-tabs :option="optionTABS" @change="handleChangeTABS"></avue-tabs>
- <span v-if="typeTABS.prop === 'tab1'" class="tab">
- <basic-container>
- <avue-form
- ref="form"
- v-model="obj0"
- :option="option0"
- @submit="submit0"
- >
- </avue-form>
- </basic-container>
- </span>
- <span v-if="typeTABS.prop === 'tab11'" class="tab">
- <basic-container>
- <avue-form
- ref="form"
- v-model="obj0"
- :option="option01"
- @submit="submit0"
- >
- </avue-form>
- </basic-container>
- </span>
- <span v-else-if="typeTABS.prop === 'tab2'" class="tab">
- <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"
- @on-load="onLoad1"
- >
- <template slot="menuLeft">
- <el-button
- type="danger"
- size="small"
- plain
- icon="el-icon-delete"
- @click="handleDelete1"
- >删 除
- </el-button>
- <el-button
- type="success"
- size="small"
- plain
- icon="el-icon-upload2"
- @click="handleImport"
- >批量导入
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </span>
- <span v-else-if="typeTABS.prop === 'tab3'" class="tab">
- <basic-container>
- <avue-crud
- :option="option2"
- :data="data2"
- :page.sync="page2"
- ref="crudrec2"
- :table-loading="loading2"
- @row-save="rowSave2"
- @search-change="searchChange2"
- @search-reset="searchReset2"
- @row-update="rowUpdate2"
- @row-del="rowDel2"
- @selection-change="selectionChange2"
- @refresh-change="refreshChange2"
- @on-load="onLoad2"
- >
- <template slot="menuLeft">
- <el-button
- type="danger"
- size="small"
- plain
- icon="el-icon-delete"
- @click="handleDelete2"
- >删 除
- </el-button>
- <el-button
- type="success"
- size="small"
- plain
- icon="el-icon-upload2"
- @click="handleImport1"
- >批量导入
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </span>
- <span v-else-if="typeTABS.prop === 'tab4'" class="tab">
- <equipments :fromDeptId="departmentid"></equipments>
- </span>
- <span v-else-if="typeTABS.prop === 'tab5'" class="tab">
- <car :fromDeptId="departmentid"></car>
- </span>
- <span v-else-if="typeTABS.prop === 'tab9'" class="tab">
- <social :deptid="obj0.departmentid"></social>
- </span>
- <span v-else-if="typeTABS.prop === 'tab7'" class="tab">
- <businessLicense :row="obj0"></businessLicense>
- </span>
- <span v-else-if="typeTABS.prop === 'tab8'" class="tab">
- <licence :row="obj0"></licence>
- </span> -->
<el-tabs v-model="activeName" @tab-click="handleClick">
- <!-- <span v-if="typeTABS.prop === 'tab1'" class="tab"> -->
- <el-tab-pane label="保安单位基本信息" name="tab1">
+ <!-- 基本信息 -->
+ <el-tab-pane :label="baseTitle" name="tab1">
<basic-container>
<avue-form
ref="form"
- v-model="obj0"
- :option="option0"
- @submit="submit0"
+ v-model="objBase"
+ :option="optionBase"
+ @submit="submitBase"
>
</avue-form>
</basic-container>
- <!-- </span> -->
</el-tab-pane>
- <!-- <span v-if="typeTABS.prop === 'tab11'" class="tab"> -->
+ <!-- 工商信息 -->
<el-tab-pane label="工商信息" name="tab11">
<basic-container>
<avue-form
ref="form"
- v-model="obj0"
+ v-model="obj"
:option="option01"
- @submit="submit0"
+ @submit="submitBase"
>
</avue-form>
</basic-container>
- <!-- </span> -->
</el-tab-pane>
- <!-- <span v-else-if="typeTABS.prop === 'tab2'" class="tab"> -->
-
- <el-tab-pane
- label="保安单位出资人员"
- name="tab2"
- :class="[
- $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
- ]"
- >
- <div class="manager">
- <basic-container>
- <avue-crud
- v-if="true"
- :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"
- @on-load="onLoad1"
- >
- <template slot="menuLeft">
- <el-button
- type="danger"
- size="small"
- plain
- icon="el-icon-delete"
- @click="handleDelete1"
- >删 除
- </el-button>
- <el-button
- type="success"
- size="small"
- plain
- icon="el-icon-upload2"
- @click="handleImport"
- >批量导入
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </div>
- <!-- </span> -->
+ <!-- 出资人列表信息 -->
+ <el-tab-pane :label="tab2label" name="tab2" v-if="shareholderVisiable">
+ <shareholder
+ v-if="overshareholder"
+ :deptid="departmentid"
+ :windowHeight="windowHeight"
+ ></shareholder>
</el-tab-pane>
-
- <!-- <span v-else-if="typeTABS.prop === 'tab3'" class="tab"> -->
- <el-tab-pane
- label="主要管理人员信息"
- name="tab3"
- :class="[
- $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
- ]"
- >
- <div class="manager">
- <basic-container>
- <avue-crud
- v-if="true"
- :option="option2"
- :data="data2"
- :page.sync="page2"
- ref="crudrec2"
- :table-loading="loading2"
- @row-save="rowSave2"
- @search-change="searchChange2"
- @search-reset="searchReset2"
- @row-update="rowUpdate2"
- @row-del="rowDel2"
- @selection-change="selectionChange2"
- @refresh-change="refreshChange2"
- @on-load="onLoad2"
- >
- <template slot="menuLeft">
- <el-button
- type="danger"
- size="small"
- plain
- icon="el-icon-delete"
- @click="handleDelete2"
- >删 除
- </el-button>
- <el-button
- type="success"
- size="small"
- plain
- icon="el-icon-upload2"
- @click="handleImport1"
- >批量导入
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </div>
- <!-- </span> -->
+ <!-- 主要管理人信息 -->
+ <el-tab-pane :label="managerLabel" name="tab3">
+ <manager
+ v-if="overmanager"
+ :deptid="departmentid"
+ ></manager>
</el-tab-pane>
- <!-- <span v-else-if="typeTABS.prop === 'tab4'" class="tab"> -->
- <el-tab-pane label="装备管理" name="tab4">
- <!-- 装备管理 -->
+ <!-- 装备管理列表 -->
+ <el-tab-pane label="装备管理" name="tab4" v-if="equipmentVisiable">
<equipments
v-if="overzb"
:fromDeptId="departmentid"
:windowHeight="windowHeight"
></equipments>
- <!-- </span> -->
</el-tab-pane>
- <!-- <span v-else-if="typeTABS.prop === 'tab5'" class="tab"> -->
- <el-tab-pane label="车辆管理" name="tab5">
- <!-- 车辆管理 -->
+ <!-- 车辆管理 -->
+ <el-tab-pane label="车辆管理" name="tab5" v-if="carVisiable">
<car
:fromDeptId="departmentid"
v-if="overcar"
:windowHeight="windowHeight"
></car>
- <!-- </span> -->
</el-tab-pane>
- <!-- <span v-else-if="typeTABS.prop === 'tab6'" class="tab">
- 枪支管理
- <gun :fromDeptId="departmentid"></gun>
- </span> -->
- <!-- <span v-else-if="typeTABS.prop === 'tab9'" class="tab"> -->
+ <!-- 社保记录 -->
<el-tab-pane label="社保记录" name="tab9">
- <!-- 社保记录 -->
<social
- :deptid="obj0.departmentid"
+ :deptid="objBase.departmentid"
:socialRE="social"
v-if="social"
></social>
<!-- </span> -->
</el-tab-pane>
- <!-- <span v-else-if="typeTABS.prop === 'tab7'" class="tab"> -->
- <el-tab-pane label="营业执照" name="tab7">
- <!-- 营业执照 -->
- <businessLicense :row="obj0" v-if="overHtp"></businessLicense>
- <!-- </span> -->
+ <!-- 营业执照 -->
+ <el-tab-pane label="营业执照" name="tab7" v-if="false">
+ <businessLicense :row="objBase" v-if="overHtp"></businessLicense>
</el-tab-pane>
- <!-- <span v-else-if="typeTABS.prop === 'tab8'" class="tab"> -->
- <el-tab-pane label="许可证" name="tab8">
- <!-- 许可证 -->
- <licence :row="obj0" v-if="overHtp"></licence>
- <!-- </span> -->
+ <!-- 许可证 -->
+ <el-tab-pane :label="licenceLabel" name="tab8" v-if="licenceVisiable">
+ <licence :row="objBase" v-if="overHtp"></licence>
+ </el-tab-pane>
+ <!-- 备案证 -->
+ <el-tab-pane label="备案证" name="tab12" v-if="certificdinedVisiable">
+ <licence :row="objBase" v-if="overHtp"></licence>
</el-tab-pane>
</el-tabs>
- <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>
-
- <el-dialog
- title="管理人导入"
- append-to-body
- :visible.sync="excelBox1"
- width="555px"
- >
- <avue-form
- :option="excelOption1"
- v-model="excelForm1"
- :upload-after="uploadAfter1"
- >
- <template slot="excelTemplate">
- <el-button type="primary" @click="handleTemplate1">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- </el-dialog>
</div>
</template>
<script>
-import { column11, column, column1, column2 } from "./data";
-import {
- getOncedata,
- // getdata,
- // adddata,
- update,
- // remove,
- getdataOnce1,
- getdata1,
- adddata1,
- update1,
- remove1,
- getdataOnce2,
- getdata2,
- adddata2,
- update2,
- remove2,
-} from "@/api/securityUnit/securityUnit";
+import { column11, column} from "./data";
+import { getOncedata, update} from "@/api/securityUnit/securityUnit";
+import manager from "./manager.vue";
+import shareholder from "./shareholder.vue";
import equipments from "../securityEquipment/equipments.vue";
import car from "../securityEquipment/car.vue";
import gun from "../securityEquipment/gun.vue";
@@ -358,229 +97,58 @@
export default {
components: {
- equipments: equipments,
- car: car,
- gun: gun,
- licence: licence,
- businessLicense: businessLicense,
- social: social,
+ equipments,
+ car,
+ gun,
+ licence,
+ businessLicense,
+ social,
+ manager,
+ shareholder,
},
data() {
- var DIC = {
- VAILD: [
- {
- label: "真",
- value: "true",
- },
- {
- label: "假",
- value: "false",
- },
- ],
- SEX: [
- {
- label: "男",
- value: 0,
- },
- {
- label: "女",
- value: 1,
- },
- ],
- };
return {
+ tab2label: "出资人信息",
+ managerLabel: "主要管理人信息",
+ licenceLabel: "许可证",
+ baseTitle: "基本信息",
visible: false,
- overcar: false, //结决id传入、信息获取的优先级
- overzb: false, //结决id传入、信息获取的优先级
- overcar: false, //结决id传入、信息获取的优先级
-
- social: false, //解决表格错乱
+ certificdinedVisiable: false,
+ licenceVisiable: true,
+ shareholderVisiable: true,
+ equipmentVisiable: true,
+ carVisiable: true,
+ //结决id传入、信息获取的优先级
+ overzb: false,
+ overmanager: false,
+ overshareholder: false,
+ //结决id传入、信息获取的优先级
+ overcar: false,
+ //解决表格错乱
+ social: false,
overHtp: false,
-
activeName: "tab1",
-
departmentid: "",
-
- excelBox: false, //出资人
- 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/shareholder/import-share",
- },
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24,
- },
- ],
- },
-
- excelBox1: false, //管理人
- excelForm1: {},
- excelOption1: {
- submitBtn: false,
- emptyBtn: false,
- ...this.$store.state.control.clearOtherBut,
- column: [
- {
- label: "文件上传",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "文件上传中,请稍等",
- span: 24,
- propsHttp: {
- res: "data",
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/member/import-member",
- },
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24,
- },
- ],
- },
-
- typeTABS: {}, //标签页
- optionTABS: {
- column: [
- {
- // icon: "el-icon-info",
- label: "保安单位基本信息",
- prop: "tab1",
- },
- {
- // icon: "el-icon-info",
- label: "工商信息",
- prop: "tab11",
- },
- {
- // icon: "el-icon-info",
- label: "保安单位出资人员",
- prop: "tab2",
- },
- {
- // icon: "el-icon-info",
- label: "主要管理人员信息",
- prop: "tab3",
- },
- {
- // icon: "el-icon-info",
- label: "装备管理 ",
- prop: "tab4",
- },
- {
- // icon: "el-icon-info",
- label: "车辆管理 ",
- prop: "tab5",
- },
- // {
- // // icon: "el-icon-info",
- // label: "枪支管理 ",
- // prop: "tab6",
- // },
- {
- // icon: "el-icon-info",
- label: "社保记录 ",
- prop: "tab9",
- },
- {
- // icon: "el-icon-info",
- label: "营业执照 ",
- prop: "tab7",
- },
- {
- // icon: "el-icon-info",
- label: "许可证 ",
- prop: "tab8",
- },
- ],
- },
-
//全局单位统一社会信用代码
creditcode: "",
//保安单位信息表单
- obj0: {
+ objBase: {
// title: "我是头部标题",
},
- option0: {
+ formData:{},
+ optionBase: {
emptyBtn: false,
submitBtn: false,
submitText: "保存",
gutter: 30,
column: column,
},
-
option01: {
emptyBtn: false,
submitBtn: false,
submitText: "保存",
gutter: 30,
column: column11,
- },
-
- loading1: true, //派遣记录
- selectionList1: [],
- page1: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- ...this.$store.state.control.changePageSize,
- },
- query1: {},
- data1: [],
- option1: {
- // card: true,
- tip: false,
- searchSize: "mini",
- searchMenuSpan: 8,
- height: "auto",
- menuWidth: 200,
- align: "center",
- selection: true,
- ...this.$store.state.control.clearOtherBut,
- column: column1,
- },
-
- loading2: true, //派遣记录
- selectionList2: [],
- page2: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- ...this.$store.state.control.changePageSize,
- },
- query2: {},
- data2: [],
- option2: {
- // card: true,
- tip: false,
- searchSize: "mini",
- searchMenuSpan: 8,
- height: "auto",
- menuWidth: 200,
- menuAlign: "center",
- align: "center",
- selection: true,
- ...this.$store.state.control.clearOtherBut,
- column: column2,
},
};
},
@@ -589,45 +157,24 @@
chuzitime() {
return this.data1.capitaltime;
},
- // 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(",");
- },
- ids2() {
- let ids2 = [];
- this.selectionList2.forEach((ele) => {
- ids2.push(ele.id);
- });
- return ids2.join(",");
- },
},
methods: {
- submit0(row, done, loading) {
- // let nowTab = this.typeTABS.prop;
- // console.log(this.typeTABS);
- if (this.userInfo.role_name == "保安公司管理员") {
+ submitBase(row, done, loading) {
+ var that = this;
+ if (this.userInfo.role_name == "保安公司管理员" ||
+ this.userInfo.role_name == "培训公司管理员" ||
+ this.userInfo.role_name == "分公司管理员") {
row["departmentid"] = this.userInfo.dept_id;
+ row["id"] = this.formData.id;
}
- console.log(row);
+ // console.log(row);
update(row).then(
() => {
- // this.onLoad(this.page);
- // this.onloads();
this.$message({
type: "success",
message: "操作成功!",
});
- this.onloads();
+ that.formData = row;
done();
},
(error) => {
@@ -638,422 +185,43 @@
done();
},
- handleImport() {
- //出资人
- this.excelBox = true;
+ //从 localStorage 获取数据
+ readLock(name) {
+ return window.localStorage.getItem(name);
},
- uploadAfter(res, done, loading, column) {
- window.console.log(column);
- this.excelBox = false;
- this.refreshChange1();
- done();
- },
- handleTemplate() {
- window.open(`/api/shareholder/export-template`);
- },
-
- handleImport1() {
- //管理人
- this.excelBox1 = true;
- },
- uploadAfter1(res, done, loading, column) {
- window.console.log(column);
- this.excelBox1 = false;
- this.refreshChange2();
- done();
- },
- handleTemplate1() {
- window.open(`/api/member/export-template`);
- },
-
- // handleChangeTABS(column) {
- // // this.typeTABS = column;
- // // console.log(column.prop);
- // // this.$message.success(JSON.stringify(column));
- // if (column.prop == "tab1") {
- // this.loading1 = false;
- // this.loading2 = false;
- // // this.onLoad(this.page);
- // } else if (column.prop == "tab2") {
- // // this.loading1 = false;
- // this.loading2 = false;
- // this.onLoad1(this.page1); //第二个表格不会自动执行
- // } else if (column.prop == "tab3") {
- // this.loading1 = false;
- // // this.loading2 = false;
- // this.onLoad2(this.page2); //第二个表格不会自动执行
- // }
- // },
handleClick(tab, event) {
- // console.log(tab.name, event);
if (tab.name == "tab1") {
this.loading1 = false;
- this.loading2 = false;
- // this.onLoad(this.page);
- } else if (tab.name == "tab5") {
+ }else if (tab.name == "tab11") {
+ this.obj = this.formData;
+ }else if (tab.name == "tab5") {
this.overcar = true;
- // this.onLoad(this.page);
} else if (tab.name == "tab4") {
this.overzb = true;
- // this.onLoad(this.page);
} else if (tab.name == "tab2") {
- // this.loading1 = false;
- this.loading2 = false;
- this.onLoad1(this.page1); //第二个表格不会自动执行
+ this.overshareholder = true;
} else if (tab.name == "tab3") {
- this.loading1 = false;
- // this.loading2 = false;
- this.onLoad2(this.page2); //第二个表格不会自动执行
+ this.overmanager = true;
} else if (tab.name == "tab9") {
- this.social = true; //表格错乱
- } else {
+ this.social = true;
+ }
+ else {
this.social = false;
this.overcar = false;
this.overzb = false;
this.overcar = false;
+ this.overmanager = false;
+ this.overshareholder = 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.data[0];
- // delete form.id;
- // for (var k = 0; k < 13; k++) {
- form["deptId"] = this.departmentid;
- adddata1(form).then(
- () => {
- 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) {
- delete row.shareholdingratio;
- delete row.tenantId;
-
- console.log(row);
- row["deptId"] = this.departmentid;
- 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;
- },
- handleDelete1() {
- 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() {
- this.onLoad1(this.page1, this.query1);
- },
-
- //
- onLoad1(page, params = {}) {
- this.loading1 = true;
- // console.log(page, params, 3435434);
- params["deptId"] = this.departmentid;
- getdataOnce1(
- 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);
- this.loading1 = false;
-
- // this.$refs.crudrec1.refreshTable();
- // this.$refs.crudrec1.doLayout();
- });
- // onLoad1(page, params = {}) {
- // this.loading1 = true;
- // // 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);
- // this.loading1 = false;
- // });
- },
- //派遣记录
-
- //派遣记录
- sizeChange2(val) {
- this.page2.currentPage = 1;
- this.page2.pageSize = val;
- // this.getData();
- this.onLoad2(this.page2, this.query2);
- // this.$message.success("行数" + val);
- },
- currentChange2(val) {
- this.page2.currentPage = val;
- // this.getData();
- this.onLoad2(this.page2, this.query2);
- // this.$message.success("页码" + val);
- },
- rowSave2(form, done, loading) {
- // var that = this;
- // var form = this.data[0];
- // delete form.id;
- // for (var k = 0; k < 13; k++) {
- form["deptId"] = this.departmentid;
- adddata2(form).then(
- () => {
- this.onLoad2(this.page1);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- },
- (error) => {
- window.console.log(error);
- loading();
- }
- );
- // }
- },
- searchChange2(params, done) {
- this.query2 = params;
- this.page2.currentPage = 1;
- this.onLoad2(this.page2, params);
- done();
- },
- searchReset2() {
- this.query = {};
- this.onLoad2(this.page2);
- },
- rowUpdate2(row, index, done, loading) {
- console.log(row);
- delete row.shareholdingratio;
- row["deptId"] = this.departmentid;
- update2(row).then(
- () => {
- this.onLoad2(this.page2);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- },
- (error) => {
- window.console.log(error);
- loading();
- }
- );
- },
- rowDel2(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove2(row.id);
- })
- .then(() => {
- this.onLoad2(this.page1);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- });
- },
- selectionChange2(list) {
- this.selectionList2 = list;
- },
- handleDelete2() {
- if (this.selectionList2.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove2(this.ids2);
- })
- .then(() => {
- this.onLoad2(this.page2);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- this.$refs.crudrec2.toggleSelection();
- });
- },
- refreshChange2() {
- this.onLoad2(this.page2, this.query2);
- },
-
- //
- onLoad2(page, params = {}) {
- this.loading2 = true;
- // console.log(page);
- // getdata2(
- params["deptId"] = this.departmentid;
- getdataOnce2(
- page.currentPage,
- page.pageSize,
- Object.assign(params, this.query)
- ).then((res) => {
- // console.log(res);
- const data = res.data.data;
- this.page2.total = data.total;
- this.data2 = data.records;
- // console.log(this.data2);
- this.loading2 = false;
- this.$refs.crudrec2.refreshTable();
- this.$refs.crudrec2.doLayout();
- });
- },
- //派遣记录
- saveLock(name, val) {
- window.localStorage.setItem(name, val);
- },
- readLock(name) {
- return window.localStorage.getItem(name);
- },
- onloads(tab) {
- var that = this;
- var doit = (a) => {
- that.typeTABS = that.optionTABS.column[0];
- // if (tab) {
- // that.typeTABS.prop = tab;
- // }
- var row = {};
- if (that.readLock("danweidata") != null) {
- row = JSON.parse(that.readLock("danweidata"));
- // that.obj0.title = row.enterprisename;
- // console.log(row, "rowneibu");
- that.departmentid = row.departmentid;
- for (var k in row) {
- that.obj0[k] = row[k];
- }
- if (row.creditcode == "") {
- that.creditcode = 111;
- } else {
- that.creditcode = row.creditcode;
- }
- that.overHtp = true;
- if (that.readLock("danweidataS") != null && a == 1) {
- var b = JSON.parse(that.readLock("danweidataS"));
- var i = 0;
- for (var k in b) {
- if (b[k].enterprisename == row.enterprisename) {
- i = 1;
- }
- }
- if (i == 1) {
- // console.log("存在");
- } else {
- // console.log("已删除");
-
- that.obj0 = {};
- that.obj0.enterprisename = row.enterprisename + "该公司已删除";
- window.localStorage.removeItem("danweidata");
- that.creditcode = "";
- }
- }
- } else {
- // console.log("no");
- that.obj0.enterprisename = "未选择查询单位";
- }
- };
+ //tag 防重复处理
+ tagTraim(){
+ //tag 防重复处理
var flag = false,
i = 0,
ind = null;
this.$store.state.tags.tagList.forEach((item, index) => {
- if (item.label == "保安单位详情") {
+ if (item.label == "单位详情") {
if (flag == false) {
ind = index;
flag = true;
@@ -1064,83 +232,179 @@
if (i > 1) {
this.$store.state.tags.tagList.splice(ind, 1);
}
-
- var getdatas = (roleAlias) => {
- var fromSecunityGuardId = that.$route.query.fromSecunityGuardId;
- // var fromSecunityGuardId = that.$route.query;
- if (fromSecunityGuardId != undefined || roleAlias == "保安公司管理员") {
- var value = {
- departmentid: fromSecunityGuardId || that.userInfo.dept_id,
- };
- getOncedata(value).then((res) => {
- // console.log(res.data.data, "get");
- window.localStorage.setItem(
- "danweidata",
- JSON.stringify(res.data.data)
- );
- doit();
- });
- // return;
- } else {
- doit(1);
- }
- };
-
- // console.log(this.userInfo, "userInfo");
+ },
+ //编辑状态控制
+ editController() {
+ var that = this;
//获取当前登录人员的角色信息
var roleIds = this.userInfo.role_id.split(",");
roleIds.forEach((roleId) => {
getRoleDetail(roleId).then((res) => {
var roleAlias = res.data.data.roleAlias;
- var d = that.option0.column;
+ var d = that.optionBase.column;
var e = that.option01.column;
- // console.log(roleAlias);
- if (roleAlias == "保安公司管理员") {
- that.option0.submitBtn = true;
+ //控制按钮,编辑状态
+ if (roleAlias == "保安公司管理员" ||
+ roleAlias == "分公司管理员" ||
+ roleAlias == "培训公司管理员") {
+ that.optionBase.submitBtn = true;
that.option01.submitBtn = true;
for (var k in d) {
- // if (d[k].label != "企业类型") {
d[k].disabled = false;
- // }
}
for (var n in e) {
- // if (d[k].label != "企业类型") {
e[n].disabled = false;
- // }
}
} else {
- that.option0.submitBtn = false;
+ that.optionBase.submitBtn = false;
that.option01.submitBtn = false;
- for (var k in d) {
- d[k].disabled = true;
+ for (var a in d) {
+ d[a].disabled = true;
}
- for (var n in e) {
- e[n].disabled = true;
+ for (var b in e) {
+ e[b].disabled = true;
}
}
- getdatas(roleAlias);
});
});
},
+ //获取保安公司数据
+ getdatas(data) {
+ //页面编辑状态控制
+ this.editController();
+ //数据读取
+ this.doit(data);
+ },
+ doit(data) {
+ var that = this;
+ var row = {};
+ if (data!= null) {
+ row = data;
+ that.departmentid = row.departmentid;
+ for (var k in row) {
+ that.objBase[k] = row[k];
+ }
+ if (row.creditcode == "") {
+ that.creditcode = 111;
+ } else {
+ that.creditcode = row.creditcode;
+ }
+ that.overHtp = true;
+ if(data.stats == "0"){
+ //自招保安单位
+ const industrycolumn = this.findObject(this.optionBase.column, "industry");
+ const representativecolumn = this.findObject(this.optionBase.column, "representative");
+ const representativecellcolumn = this.findObject(this.optionBase.column, "representativecell");
+ const fregioncolumn = this.findObject(this.optionBase.column, "fregion");
+ const ftimecolumn = this.findObject(this.optionBase.column, "ftime");
+
+ //法人及电话,办公地址不可见
+ industrycolumn.display = false;
+ representativecolumn.display=false;
+ representativecellcolumn.display=false;
+ //服务区域,时间可见
+ fregioncolumn.display=true;
+ ftimecolumn.display=true;
+ }
+ if(data.stats == "4"){
+ //分公司
+ const representativecolumn = this.findObject(this.optionBase.column, "representative");
+ const representativecellcolumn = this.findObject(this.optionBase.column, "representativecell");
+ //法人及电话不可见
+ representativecolumn.label="分公司负责人";
+ representativecellcolumn.label="分公司负责人电话";
+ }
+ // if (that.readLock("danweidataS") != null && a == 1) {
+ // var b = JSON.parse(that.readLock("danweidataS"));
+ // var i = 0;
+ // for (var k in b) {
+ // if (b[k].enterprisename == row.enterprisename) {
+ // i = 1;
+ // }
+ // }
+ // if (i != 1) {
+ // that.objBase = {};
+ // that.objBase.enterprisename = row.enterprisename + "该公司已删除";
+ // window.localStorage.removeItem("danweidata");
+ // that.creditcode = "";
+ // }
+ // }
+ } else {
+ that.objBase.enterprisename = "未选择查询单位";
+ }
+ },
+ //数据初始化
+ initData() {
+ // alert(1);
+ var that = this;
+ var datas = this.$route.query.data;
+ // console.log(datas,123456);
+ //判断进入的入口,单位信息进入,单位列表查看进入
+ if (datas) {
+ var data = JSON.parse(this.$route.query.data);
+ that.formData = data;
+ // console.log(data,3333333);
+ //单位列表进入
+ var stats = data.stats;
+ //初始tab控制
+ this.initController(stats);
+ //初始数据获取
+ this.getdatas(data);
+ } else {
+ //单位信息进入
+ var value = {
+ departmentid: that.userInfo.dept_id,
+ };
+ getOncedata(value).then((res) => {
+ that.formData = res.data.data;
+ var stats = res.data.data.stats;
+ //初始tab控制
+ this.initController(stats);
+ //初始数据获取
+ this.getdatas(res.data.data);
+ });
+ }
+ },
+ //tab 初始设置
+ initController(stats) {
+ var that = this;
+ // 判断按进入的公司类型
+ if (stats == "2") {
+ //本市保安公司
+ that.baseTitle = "保安单位基本信息";
+ }
+ if (stats == "0") {
+ //自招保安单位
+ that.baseTitle = "单位基本信息";
+ that.equipmentVisiable = false;
+ that.carVisiable = false;
+ that.shareholderVisiable = false;
+ that.certificdinedVisiable = true;
+ that.licenceVisiable = false;
+ }
+ if (stats == "4") {
+ //分公司
+ that.baseTitle = "保安单位基本信息";
+ that.certificdinedVisiable = true;
+ }
+ if (stats == "1") {
+ //培训学校
+ that.baseTitle = "学校基本信息";
+ that.managerLabel = "师资力量";
+ that.licenceLabel = "培训许可证";
+ that.carVisiable = false;
+ that.shareholderVisiable = false;
+ }
+ },
},
mounted() {
- this.onloads();
+ this.tagTraim();
+ },
+ created() {
+ //初始化信息
+ this.initData();
},
watch: {
- // windowWidth() {
- // console.log(this.windowWidth, "windowWidth");
- // },
- windowHeight() {
- // console.log(this.windowHeight, "windowHeight");
- // this.option1.height = this.windowHeight + 100;
- // this.option2.height = this.windowHeight - 320;
- this.visible = false;
- this.$nextTick(() => {
- this.visible = true;
- this.refreshChange1();
- this.refreshChange2();
- });
- },
},
};
</script>
@@ -1149,17 +413,8 @@
.dispatch {
width: 100%;
height: 100%;
- // border: 1px solid #000;
box-sizing: border-box;
}
-// .el-card__body {
-// padding-bottom: 5px !important;
-// }
-// .avue-crud__tip,
-// .el-tag,
-// .el-tag--light {
-// padding: 0 !important;
-// }
.el-collapse-item {
padding-top: 15px !important;
@@ -1176,7 +431,7 @@
top: -10px;
}
-.manager{
+.manager {
height: 755px;
}
</style>
\ No newline at end of file
diff --git a/src/views/securityUnitChild/manager.vue b/src/views/securityUnitChild/manager.vue
new file mode 100644
index 0000000..e6f1947
--- /dev/null
+++ b/src/views/securityUnitChild/manager.vue
@@ -0,0 +1,337 @@
+<template>
+ <basic-container
+ :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
+ >
+ <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
+ @click="handleDelete"
+ >删 除
+ <!-- v-if="permission.social_delete" -->
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ @click="handleImport"
+ >批量导入
+ </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>
+</template>
+
+<script>
+import {
+ getdataOnce2,
+ getDetail2,
+ adddata2,
+ update2,
+ remove2,
+} from "@/api/securityUnit/securityUnit";
+import { mapGetters } from "vuex";
+import { getToken } from "@/util/auth";
+export default {
+ props: ["deptid"],
+ data() {
+ var deptid = this.deptid;
+ if (deptid == undefined) {
+ deptid = this.$store.getters.userInfo.dept_id;
+ }
+ return {
+ visible: true,
+ form: { cardid: "" },
+
+ query: {},
+ loading: true,
+ excelBox: false,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ ...this.$store.state.control.changePageSize,
+ },
+ selectionList: [],
+ option: {
+ tip: false,
+ searchSize: "mini",
+ searchMenuSpan: 8,
+ height: "auto",
+ editBtn:true,
+ delBtn:true,
+ viewBtn:true,
+ menuWidth: 200,
+ menuAlign: "center",
+ align: "center",
+ selection: true,
+ ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "统一社会信用代码",
+ prop: "creditcode",
+ hide: true,
+ addDisplay: false,
+ editDisplay: false,
+ },
+ {
+ label: "id",
+ prop: "id",
+ hide: true,
+ addDisplay: false,
+ editDisplay: false,
+ },
+ {
+ label: "姓名",
+ prop: "name",
+ search: true,
+ },
+ {
+ label: "职务",
+ prop: "post",
+ search: true,
+ },
+ {
+ label: "身份证",
+ prop: "cardid",
+ },
+ {
+ label: "联系电话",
+ prop: "cell",
+ },
+ ],
+ },
+ data: [],
+ 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/member/import-member",
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ };
+ },
+ created() {
+ this.option.height = this.windowHeight - 320;
+ },
+ computed: {
+ ...mapGetters(["permission", "userInfo", "windowHeight"]),
+ // permissionList() {
+ // return {
+ // addBtn: this.vaildData(this.permission.social_add, true),
+ // viewBtn: this.vaildData(this.permission.social_view, false),
+ // delBtn: this.vaildData(this.permission.social_delete, false),
+ // editBtn: this.vaildData(this.permission.social_edit, false),
+ // };
+ // },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ methods: {
+ rowSave(row, done, loading) {
+ row['deptId'] = this.deptid;
+ adddata2(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ loading();
+ window.console.log(error);
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ row['deptId'] = this.deptid;
+ update2(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",
+ })
+ .then(() => {
+ return remove2(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ handleTemplate() {
+ window.open(
+ `/api/member/export-template?${this.website.tokenHeader}=${getToken()}`
+ );
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox = false;
+ this.refreshChange();
+ done();
+ },
+ handleImport() {
+ this.excelBox = true;
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove2(this.ids);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetail2(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;
+ params["deptId"] = this.deptid;
+ getdataOnce2(
+ 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>
+
+<style>
+</style>
diff --git a/src/views/securityUnitChild/shareholder.vue b/src/views/securityUnitChild/shareholder.vue
new file mode 100644
index 0000000..c86f816
--- /dev/null
+++ b/src/views/securityUnitChild/shareholder.vue
@@ -0,0 +1,383 @@
+<template>
+ <basic-container
+ :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
+ >
+ <avue-crud
+ v-if="visible"
+ :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
+ @click="handleDelete"
+ >删 除
+ <!-- v-if="permission.social_delete" -->
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ @click="handleImport"
+ >批量导入
+ </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>
+</template>
+
+<script>
+import {
+ getdataOnce1,
+ getDetail1,
+ adddata1,
+ update1,
+ remove1,
+} from "@/api/securityUnit/securityUnit";
+import { mapGetters } from "vuex";
+import { getToken } from "@/util/auth";
+
+const validatePassNumber = (rule, value, callback) => {
+ var test = /^[0-9]*$/gm;
+ if (!test.test(value)) {
+ callback(new Error("请输入数字"));
+ } else {
+ callback();
+ }
+};
+export default {
+ props: ["deptid"],
+ data() {
+ var deptid = this.deptid;
+ if (this.deptid == undefined) {
+ // deptid = this.userInfo
+ // console.log(this.$store.getters.userInfo.dept_id);
+ deptid = this.$store.getters.userInfo.dept_id;
+ }
+ return {
+ visible: true,
+ form: { cardid: "" },
+
+ query: {},
+ loading: true,
+ excelBox: false,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ ...this.$store.state.control.changePageSize,
+ },
+ selectionList: [],
+ option: {
+ tip: false,
+ searchSize: "mini",
+ searchMenuSpan: 8,
+ height: "auto",
+ menuWidth: 200,
+ menuAlign: "center",
+ align: "center",
+ selection: true,
+ ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "股东",
+ prop: "shareholder",
+ searchLabelWidth: 55,
+ search: true,
+ labelWidth:130,
+ },
+ {
+ label: "持股比例(%)",
+ prop: "shareholdingratio",
+ rules: [
+ {
+ required: true,
+ validator: validatePassNumber,
+ trigger: "blur",
+ },
+ ],
+ labelWidth:130,
+ },
+ {
+ label: "出资金额(万元)",
+ prop: "capital",
+ rules: [
+ {
+ required: true,
+ validator: validatePassNumber,
+ trigger: "blur",
+ },
+ ],
+ labelWidth:130,
+ },
+ {
+ label: "出资时间",
+ prop: "capitaltime",
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ labelWidth:130,
+ },
+ {
+ label: "身份证",
+ prop: "cardid",
+ search: true,
+ labelWidth:130,
+ },
+ {
+ label: "联系电话",
+ prop: "cell",
+ labelWidth:130,
+ },
+ {
+ label: "统一社会信用代码",
+ prop: "creditcode",
+ hide: true,
+ addDisplay: false,
+ editDisplay: false,
+ labelWidth:130,
+ },
+ ],
+ },
+ data: [],
+ 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/shareholder/import-share",
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ };
+ },
+ watch: {
+ windowHeight() {
+ console.log(this.windowHeight);
+ this.option.height = this.windowHeight - 320;
+ this.visible = false;
+ this.$nextTick(() => {
+ this.visible = true;
+ this.refreshChange();
+ });
+ },
+ },
+ created() {
+ this.option.height = this.windowHeight - 320;
+ },
+ computed: {
+ ...mapGetters(["permission", "userInfo", "windowHeight"]),
+ // permissionList() {
+ // return {
+ // addBtn: this.vaildData(this.permission.social_add, true),
+ // viewBtn: this.vaildData(this.permission.social_view, false),
+ // delBtn: this.vaildData(this.permission.social_delete, false),
+ // editBtn: this.vaildData(this.permission.social_edit, false),
+ // };
+ // },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ methods: {
+ rowSave(row, done, loading) {
+ row['deptId'] = this.deptid;
+ adddata1(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ loading();
+ window.console.log(error);
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ row['deptId'] = this.deptid;
+ update1(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",
+ })
+ .then(() => {
+ return remove1(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ handleTemplate() {
+ window.open(
+ `/api/shareholder/export-template?${this.website.tokenHeader}=${getToken()}`
+ );
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox = false;
+ this.refreshChange();
+ done();
+ },
+ handleImport() {
+ this.excelBox = true;
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove1(this.ids);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetail1(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;
+ params["deptId"] = this.deptid;
+ getdataOnce1(
+ 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>
+
+<style>
+</style>
--
Gitblit v1.9.3