safecheck-client 3.0.35-gongyi-7 → 3.0.35-gongyi-9

Sign up to get free protection for your applications and to get access to all the features.
@@ -501,7 +501,7 @@ export default {
501
501
 
502
502
  }
503
503
  },
504
- props:['f_check_book_name'],
504
+ props:['f_check_book_name','permission'],
505
505
  computed: {
506
506
  getgasbrand(){
507
507
  let ops=[{label:'全部',value:''}]
@@ -1,125 +1,125 @@
1
- <template>
2
- <div style="width: 100%;height: 100%">
3
- <div class="col-sm-6 form-group" style="margin-bottom: 0px">
4
- <label class="font_normal_body">公&emsp;&emsp;司</label>
5
- <right-tree-safe :width="leftWidth" @re-res="getRes"></right-tree-safe>
6
- </div>
7
- <div class="col-sm-6 form-group" style="margin-bottom: 0px">
8
- <label class="font_normal_body">{{roleLable}}</label>
9
- <v-select :value="changeval" v-model='changeval'
10
- :value-single="!valueMultiple"
11
- class="select_list select"
12
- :options='users' :placeholder='roleName'
13
- close-on-select
14
- :multiple="valueMultiple"
15
- :width="rightWidth"
16
- @change="valuechange">
17
- </v-select>
18
- </div>
19
- </div>
20
- </template>
21
-
22
- <script>
23
- import {HttpResetClass} from 'vue-client'
24
- export default {
25
- name: "RoleSelector",
26
- props: {
27
- valueMultiple: {
28
- type: Boolean,
29
- default: false
30
- },
31
- roleName: {
32
- type: String,
33
- default: '安检员'
34
- },
35
- roleLable: {
36
- type: String,
37
- default: '安检员'
38
- },
39
- leftWidth: {
40
- type: String,
41
- default: '60%'
42
- },
43
- rightWidth: {
44
- type: String,
45
- default: '60%'
46
- },
47
- value: {
48
- default: ''
49
- }
50
- },
51
- data() {
52
- return {
53
- source: `tool.getChildrenOfResName($${this.roleName}$)`,
54
- allUsers: [],
55
- users: [],
56
- resids: [],
57
- changeval: ''
58
- }
59
- },
60
- watch: {
61
- 'value' (val) {
62
- if (val) {
63
- this.changeval = val
64
- }
65
- }
66
- },
67
- ready () {
68
- let http = new HttpResetClass()
69
- http.load('POST', '/rs/search', {data: {source: this.source, userid: this.$login.f.id}}, {resolveMsg: null, rejectMsg: null})
70
- .then(res => {
71
- console.log('res-->' + JSON.stringify(res))
72
- this.allUsers = res.data
73
- this.filterUser(this.resids)
74
-
75
- })
76
- },
77
- methods: {
78
- valuechange(val){
79
- if(typeof val =='object' && val.hasOwnProperty('isTrusted')){
80
- return
81
- }
82
- this.changeval = val
83
- if(this.valueMultiple){
84
- if(val&&val.length > 0){
85
- var valuesele = `(`
86
- for (var i= 0;i<val.length;i++) {
87
- valuesele += `'${val[i]}',`
88
- }
89
- this.value = valuesele.substring(0,valuesele.length -1 ) + ')'
90
- }else{
91
- this.value = ''
92
- }
93
- }else{
94
- this.value = val
95
- }
96
- },
97
- getRes(obj) {
98
- this.resids = obj.resids
99
- console.log(this.resids)
100
- this.filterUser(this.resids)
101
- this.$dispatch('re-res',obj)
102
- },
103
- filterUser(resids) {
104
- // 处理第一次进入页面值异常问题
105
- if(resids.length > 0 && typeof resids[0] == "object"){
106
- resids = resids[0]
107
- }
108
- this.users = []
109
- this.allUsers.forEach(user => {
110
- if (resids.indexOf(user.orgid) != -1) {
111
- this.users.push({label: user.name, value: user.name})
112
- }
113
- })
114
- if(this.users.length > 0){
115
- this.users = [{label: '全部', value: ''},...this.users]
116
- }
117
- console.log(this.users)
118
- }
119
- }
120
- }
121
- </script>
122
-
123
- <style scoped>
124
-
125
- </style>
1
+ <template>
2
+ <div style="width: 100%;height: 100%">
3
+ <div class="col-sm-6 form-group" style="margin-bottom: 0px">
4
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
5
+ <right-tree-safe :width="leftWidth" @re-res="getRes"></right-tree-safe>
6
+ </div>
7
+ <div class="col-sm-6 form-group" style="margin-bottom: 0px">
8
+ <label class="font_normal_body">{{roleLable}}</label>
9
+ <v-select :value="changeval" v-model='changeval'
10
+ :value-single="!valueMultiple"
11
+ class="select_list select"
12
+ :options='users' :placeholder='roleName'
13
+ close-on-select
14
+ :multiple="valueMultiple"
15
+ :width="rightWidth"
16
+ @change="valuechange">
17
+ </v-select>
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import {HttpResetClass} from 'vue-client'
24
+ export default {
25
+ name: "RoleSelector",
26
+ props: {
27
+ valueMultiple: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ roleName: {
32
+ type: String,
33
+ default: '安检员'
34
+ },
35
+ roleLable: {
36
+ type: String,
37
+ default: '安检员'
38
+ },
39
+ leftWidth: {
40
+ type: String,
41
+ default: '60%'
42
+ },
43
+ rightWidth: {
44
+ type: String,
45
+ default: '60%'
46
+ },
47
+ value: {
48
+ default: ''
49
+ }
50
+ },
51
+ data() {
52
+ return {
53
+ source: `tool.getChildrenOfResName($${this.roleName}$)`,
54
+ allUsers: [],
55
+ users: [],
56
+ resids: [],
57
+ changeval: ''
58
+ }
59
+ },
60
+ watch: {
61
+ 'value' (val) {
62
+ if (val) {
63
+ this.changeval = val
64
+ }
65
+ }
66
+ },
67
+ ready () {
68
+ let http = new HttpResetClass()
69
+ http.load('POST', '/rs/search', {data: {source: this.source, userid: this.$login.f.id}}, {resolveMsg: null, rejectMsg: null})
70
+ .then(res => {
71
+ console.log('res-->' + JSON.stringify(res))
72
+ this.allUsers = res.data
73
+ this.filterUser(this.resids)
74
+
75
+ })
76
+ },
77
+ methods: {
78
+ valuechange(val){
79
+ if(typeof val =='object' && val.hasOwnProperty('isTrusted')){
80
+ return
81
+ }
82
+ this.changeval = val
83
+ if(this.valueMultiple){
84
+ if(val&&val.length > 0){
85
+ var valuesele = `(`
86
+ for (var i= 0;i<val.length;i++) {
87
+ valuesele += `'${val[i]}',`
88
+ }
89
+ this.value = valuesele.substring(0,valuesele.length -1 ) + ')'
90
+ }else{
91
+ this.value = ''
92
+ }
93
+ }else{
94
+ this.value = val
95
+ }
96
+ },
97
+ getRes(obj) {
98
+ this.resids = obj.resids
99
+ console.log(this.resids)
100
+ this.filterUser(this.resids)
101
+ this.$dispatch('re-res',obj)
102
+ },
103
+ filterUser(resids) {
104
+ // 处理第一次进入页面值异常问题
105
+ if(resids.length > 0 && typeof resids[0] == "object"){
106
+ resids = resids[0]
107
+ }
108
+ this.users = []
109
+ this.allUsers.forEach(user => {
110
+ if (resids.indexOf(user.orgid) != -1) {
111
+ this.users.push({label: user.name, value: user.name})
112
+ }
113
+ })
114
+ if(this.users.length > 0){
115
+ this.users = [{label: '全部', value: ''},...this.users]
116
+ }
117
+ console.log(this.users)
118
+ }
119
+ }
120
+ }
121
+ </script>
122
+
123
+ <style scoped>
124
+
125
+ </style>