safecheck-client 3.0.32-25 → 3.0.32-27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,160 +1,160 @@
1
- <template>
2
- <div id='AddTobook'>
3
- <div class="auto select-overspread">
4
- <validator name='v'>
5
- <ul class="nav nav-tabs">
6
- <p class="bg-info text-center" style="padding: 8px;">{{tabstitles[$parent.$refs.tabs.active]}}</p>
7
- </ul>
8
- <div class="form-horizontal select-overspread container-fluid auto" style="margin-top:20px;flex: 1;" v-show="!($parent.$refs.tabs.active == 2)">
9
- <div class="row" style="text-align: center">
10
-
11
- <div class="col-sm-12 form-group" :class="[$v.f_check_book_num.required ? 'has-error' : '']">
12
- <label class="font_normal_body" style="width: 26%;">目标安检册</label>
13
- <input type="text" v-model="model.f_check_book_num" v-show="false"
14
- v-validate:f_check_book_num='{required: true }'>
15
- <v-select :value.sync="model.f_check_book_num" v-model="model.f_check_book_num"
16
- :options='checkbook' placeholder='安检册'
17
- :value-single="true" :search="true"
18
- style="width:60%"
19
- close-on-select></v-select>
20
- </div>
21
- </div>
22
- </div>
23
- <div class="row" v-show="!($parent.$refs.tabs.active == 2)">
24
- <div style="float:right;margin-top: 250px;margin-right: 20px;">
25
- <button @click="confirm()" class="btn button_search" style="width: 70px" :disabled='!$v.valid'>
26
- <span class="glyphicon glyphicon-floppy-disk"></span>保存
27
- </button>
28
- </div>
29
- </div>
30
- </validator>
31
- </div>
32
- </div>
33
-
34
- </template>
35
-
36
- <script>
37
- import * as Util from '../../../components/Util'
38
- import {HttpResetClass} from "vue-client";
39
- import bus from "../../../bus";
40
- export default {
41
- name: 'AddTobook',
42
-
43
- data () {
44
- return {
45
- model:{
46
- f_check_book_num:''
47
- },
48
- checkbook: [],
49
- checkbooks:[],
50
- tabstitles:['请选择小区添加到目标安检册','请选择单位添加到目标安检册','用户无法单独添加到安检册内']
51
- }
52
- },
53
- created () {
54
- },
55
- ready () {
56
- // this.close()
57
- new HttpResetClass().load('POST','rs/sql/safe_singleTable_OrderBy',{data: {
58
- items: 'id,f_check_book_name,f_check_book_type,f_user_type',
59
- tablename: 't_check_book',
60
- condition: `1=1`,
61
- orderitem: 'id'
62
- }}, {resolveMsg: null, rejectMsg: null}).then(res=>{
63
- console.log("checkbook", res.data)
64
- res.data.forEach(item=>{
65
- this.checkbooks.push({
66
- f_user_type:item.f_user_type,
67
- booktype:item.f_check_book_type,
68
- label:item.f_check_book_name,
69
- value:item.id
70
- })
71
- })
72
- this.checkbook = this.checkbooks.filter(item=>item.f_user_type==='民用')
73
- })
74
- },
75
- methods: {
76
- selectbook(val){
77
-
78
- },
79
- close () {
80
-
81
- },
82
-
83
- confirm () {
84
- if (!this.model.f_check_book_num){
85
- this.$showMessage('请选择安检册')
86
- return
87
- }
88
- console.log(this.$parent.$refs.tabs.active)
89
- console.log(this.$parent.bookList)
90
- console.log(this.$parent.bookAll)
91
- console.log(this.$parent.bookCondition)
92
- let userCondition = ''
93
- if(this.$parent.bookAll){
94
- if(!this.$parent.bookCondition){
95
- this.$showMessage("请先查询")
96
- return
97
- }else{
98
- userCondition = this.$parent.bookCondition
99
- }
100
- }else if(this.$parent.bookList.length > 0){
101
- userCondition = this.$parent.$refs.tabs.active ===0? 'ta.id in (' + this.$parent.bookList.toString() + ')':
102
- 'tc.id in (' + this.$parent.bookList.toString() + ')'
103
- }else{
104
- this.$showMessage(this.$parent.$refs.tabs.active===0?'请选择小区':'请选择单位')
105
- return;
106
- }
107
- if(this.$parent.$refs.tabs.active ===0){
108
- new HttpResetClass().load('POST', 'rs/logic/updateCheckBook', {data: {f_check_book_id: this.model.f_check_book_num,
109
- f_check_book_type:'小区',condition:userCondition}},
110
- {resolveMsg: null, rejectMsg: '添加失败'}).then(res=>{
111
- if(res && res.data){
112
- this.model.f_check_book_num = ""
113
- this.$showMessage("本次成功添加"+res.data+"个小区",['confirm']).then(res=>{
114
- if(res==='confirm'){
115
- console.log("刷新了")
116
- bus.$emit('fresh-area')
117
- }
118
- })
119
- }else{
120
- this.$showMessage("添加失败")
121
- }
122
- })
123
- }else{
124
- new HttpResetClass().load('POST', 'rs/logic/updateCheckBook', {data: {f_check_book_id: this.model.f_check_book_num,
125
- f_check_book_type:'单位',condition:userCondition}},
126
- {resolveMsg: null, rejectMsg: '添加失败'}).then(res=>{
127
- if(res && res.data){
128
- this.model.f_check_book_num = ""
129
- this.$showMessage("本次成功添加"+res.data+"个单位",['confirm']).then(res=>{
130
- if(res==='confirm'){
131
- console.log("刷新了")
132
- bus.$emit('fresh-area')
133
- }
134
- })
135
- }else{
136
- this.$showMessage("添加失败")
137
- }
138
- })
139
- }
140
- }
141
- },
142
- watch:{
143
- '$parent.$refs.tabs.active'(val){
144
- if(val =='0'){
145
- this.checkbook = this.checkbooks.filter(item=>item.f_user_type==='民用')
146
- }else{
147
- this.checkbook = this.checkbooks.filter(item=>item.f_user_type==='非民用')
148
- }
149
- this.model.f_check_book_num = ''
150
- }
151
- },
152
- computed: {
153
-
154
- }
155
- }
156
- </script>
157
-
158
- <style lang="less">
159
-
160
- </style>
1
+ <template>
2
+ <div id='AddTobook'>
3
+ <div class="auto select-overspread">
4
+ <validator name='v'>
5
+ <ul class="nav nav-tabs">
6
+ <p class="bg-info text-center" style="padding: 8px;">{{tabstitles[$parent.$refs.tabs.active]}}</p>
7
+ </ul>
8
+ <div class="form-horizontal select-overspread container-fluid auto" style="margin-top:20px;flex: 1;" v-show="!($parent.$refs.tabs.active == 2)">
9
+ <div class="row" style="text-align: center">
10
+
11
+ <div class="col-sm-12 form-group" :class="[$v.f_check_book_num.required ? 'has-error' : '']">
12
+ <label class="font_normal_body" style="width: 26%;">目标安检册</label>
13
+ <input type="text" v-model="model.f_check_book_num" v-show="false"
14
+ v-validate:f_check_book_num='{required: true }'>
15
+ <v-select :value.sync="model.f_check_book_num" v-model="model.f_check_book_num"
16
+ :options='checkbook' placeholder='安检册'
17
+ :value-single="true" :search="true"
18
+ style="width:60%"
19
+ close-on-select></v-select>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <div class="row" v-show="!($parent.$refs.tabs.active == 2)">
24
+ <div style="float:right;margin-top: 250px;margin-right: 20px;">
25
+ <button @click="confirm()" class="btn button_search" style="width: 70px" :disabled='!$v.valid'>
26
+ <span class="glyphicon glyphicon-floppy-disk"></span>保存
27
+ </button>
28
+ </div>
29
+ </div>
30
+ </validator>
31
+ </div>
32
+ </div>
33
+
34
+ </template>
35
+
36
+ <script>
37
+ import * as Util from '../../../components/Util'
38
+ import {HttpResetClass} from "vue-client";
39
+ import bus from "../../../bus";
40
+ export default {
41
+ name: 'AddTobook',
42
+
43
+ data () {
44
+ return {
45
+ model:{
46
+ f_check_book_num:''
47
+ },
48
+ checkbook: [],
49
+ checkbooks:[],
50
+ tabstitles:['请选择小区添加到目标安检册','请选择单位添加到目标安检册','用户无法单独添加到安检册内']
51
+ }
52
+ },
53
+ created () {
54
+ },
55
+ ready () {
56
+ // this.close()
57
+ new HttpResetClass().load('POST','rs/sql/safe_singleTable_OrderBy',{data: {
58
+ items: 'id,f_check_book_name,f_check_book_type,f_user_type',
59
+ tablename: 't_check_book',
60
+ condition: `1=1`,
61
+ orderitem: 'id'
62
+ }}, {resolveMsg: null, rejectMsg: null}).then(res=>{
63
+ console.log("checkbook", res.data)
64
+ res.data.forEach(item=>{
65
+ this.checkbooks.push({
66
+ f_user_type:item.f_user_type,
67
+ booktype:item.f_check_book_type,
68
+ label:item.f_check_book_name,
69
+ value:item.id
70
+ })
71
+ })
72
+ this.checkbook = this.checkbooks.filter(item=>item.f_user_type==='民用')
73
+ })
74
+ },
75
+ methods: {
76
+ selectbook(val){
77
+
78
+ },
79
+ close () {
80
+
81
+ },
82
+
83
+ confirm () {
84
+ if (!this.model.f_check_book_num){
85
+ this.$showMessage('请选择安检册')
86
+ return
87
+ }
88
+ console.log(this.$parent.$refs.tabs.active)
89
+ console.log(this.$parent.bookList)
90
+ console.log(this.$parent.bookAll)
91
+ console.log(this.$parent.bookCondition)
92
+ let userCondition = ''
93
+ if(this.$parent.bookAll){
94
+ if(!this.$parent.bookCondition){
95
+ this.$showMessage("请先查询")
96
+ return
97
+ }else{
98
+ userCondition = this.$parent.bookCondition
99
+ }
100
+ }else if(this.$parent.bookList.length > 0){
101
+ userCondition = this.$parent.$refs.tabs.active ===0? 'ta.id in (' + this.$parent.bookList.toString() + ')':
102
+ 'tc.id in (' + this.$parent.bookList.toString() + ')'
103
+ }else{
104
+ this.$showMessage(this.$parent.$refs.tabs.active===0?'请选择小区':'请选择单位')
105
+ return;
106
+ }
107
+ if(this.$parent.$refs.tabs.active ===0){
108
+ new HttpResetClass().load('POST', 'rs/logic/updateCheckBook', {data: {f_check_book_id: this.model.f_check_book_num,
109
+ f_check_book_type:'小区',condition:userCondition}},
110
+ {resolveMsg: null, rejectMsg: '添加失败'}).then(res=>{
111
+ if(res && res.data){
112
+ this.model.f_check_book_num = ""
113
+ this.$showMessage("本次成功添加"+res.data+"个小区",['confirm']).then(res=>{
114
+ if(res==='confirm'){
115
+ console.log("刷新了")
116
+ bus.$emit('fresh-area')
117
+ }
118
+ })
119
+ }else{
120
+ this.$showMessage("添加失败")
121
+ }
122
+ })
123
+ }else{
124
+ new HttpResetClass().load('POST', 'rs/logic/updateCheckBook', {data: {f_check_book_id: this.model.f_check_book_num,
125
+ f_check_book_type:'单位',condition:userCondition}},
126
+ {resolveMsg: null, rejectMsg: '添加失败'}).then(res=>{
127
+ if(res && res.data){
128
+ this.model.f_check_book_num = ""
129
+ this.$showMessage("本次成功添加"+res.data+"个单位",['confirm']).then(res=>{
130
+ if(res==='confirm'){
131
+ console.log("刷新了")
132
+ bus.$emit('fresh-area')
133
+ }
134
+ })
135
+ }else{
136
+ this.$showMessage("添加失败")
137
+ }
138
+ })
139
+ }
140
+ }
141
+ },
142
+ watch:{
143
+ '$parent.$refs.tabs.active'(val){
144
+ if(val =='0'){
145
+ this.checkbook = this.checkbooks.filter(item=>item.f_user_type==='民用')
146
+ }else{
147
+ this.checkbook = this.checkbooks.filter(item=>item.f_user_type==='非民用')
148
+ }
149
+ this.model.f_check_book_num = ''
150
+ }
151
+ },
152
+ computed: {
153
+
154
+ }
155
+ }
156
+ </script>
157
+
158
+ <style lang="less">
159
+
160
+ </style>