safecheck-client 3.0.32-24 → 3.0.32-25

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.
@@ -0,0 +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>
@@ -0,0 +1,301 @@
1
+ <template>
2
+ <!--安检综合查询主界面-->
3
+ <div id="unit" class="flex-row" :class="{'binary':showItem || showItemUser}">
4
+ <div :class="{'basic-main':!(showItem || showItemUser),'binary-left':showItem || showItemUser}">
5
+ <!--展示查询界面-->
6
+ <check-book-list class="flex" :tempval="hidden" :style="style" :style2="style2" :showtype="showtype" @select-changed="selected"
7
+ @canel-main="close"
8
+ @addbook="addbook"
9
+ :needprops="needProps"
10
+ @showdetails="showdetails"
11
+ v-ref:checkbook></check-book-list>
12
+ </div>
13
+ <div class="binary-right" v-if="showItemUser || showItem">
14
+ <div class="flex">
15
+ <check-book-user style="height: 100%" :row="rowData" v-if="showItemUser && rowData.f_check_book_type==='用户'"></check-book-user>
16
+ <check-book-area style="height: 100%" @showuser="showuser" :row="rowData" :needprops="needProps" v-if="showItemUser && rowData.f_user_type==='民用'"></check-book-area>
17
+ <check-book-company style="height: 100%" @showuser="showusercompany" :row="rowData" :needprops="needProps" v-if="showItemUser && rowData.f_user_type==='非民用'"></check-book-company>
18
+ <check-book-details style="height: 100%" :row="rowData" :showtype="showtype" v-if="showItem"></check-book-details>
19
+ </div>
20
+ </div>
21
+ </div>
22
+
23
+ </template>
24
+
25
+ <script>
26
+ import {HttpResetClass} from "vue-client";
27
+
28
+ export default {
29
+ title: '片区管理',
30
+ name: 'CheckPaperSearchUser',
31
+ props:['showtype'],
32
+ data () {
33
+ return {
34
+ style: 'col-sm-2 form-group',
35
+ style2: 'col-sm-4 form-group',
36
+ showItemUser: false,
37
+ hidden: true,
38
+ barwidth: '100%',
39
+ showItem: false,
40
+ rowData: {},
41
+ needProps:{
42
+ meter_gasbrand:[],
43
+ checkBooks:[],
44
+ entry_status:[],
45
+ userTypes:[],
46
+ userStates:[],
47
+ gasproperties:[],
48
+ areaList:[],
49
+ sliceArea:[],
50
+ cbc:[],
51
+ meterbooks:[],
52
+ checker:[],
53
+ },
54
+ }
55
+ },
56
+ ready(){
57
+ this.init()
58
+ },
59
+ methods: {
60
+ init(){
61
+ this.getCheckBook()
62
+ this.setConList()
63
+ this.loadpage()
64
+ this.getGasbrand()
65
+ this.searchChecker()
66
+ },
67
+ //查询安检员selectChanged
68
+ async searchChecker(){
69
+ let res=await new HttpResetClass().load('POST', '/rs/search', {
70
+ source: 'tool.getChildrenOfResName($安检员$)',
71
+ userid: this.$login.f.id
72
+ }, {resolveMsg: null, rejectMsg: null})
73
+ this.needProps.checker=[]
74
+ res.data.forEach((resRow) => {
75
+ if(resRow.orgid==this.$login.f.orgid){
76
+ this.needProps.checker.push({label:resRow.name,value:resRow})
77
+ }
78
+ })
79
+ },
80
+ getGasbrand(){
81
+ this.needProps.meter_gasbrand=[]
82
+ new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_GroupBy`, {
83
+ data: {
84
+ items: 'id,f_meter_brand',
85
+ tablename: 't_gasbrand',
86
+ condition: `f_orgid = '${this.$login.f.orgid}'`,
87
+ groupitem: 'id,f_meter_brand'
88
+ }
89
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
90
+ this.needProps.meter_gasbrand.push({label: '全部', value: ''})
91
+ //console.log('res=', JSON.stringify(res))
92
+ res.data.forEach(ress => {
93
+ //console.log('ress=', JSON.stringify(ress))
94
+ this.needProps.meter_gasbrand.push({
95
+ label: ress.f_meter_brand,
96
+ value: ress.id
97
+ })
98
+ })
99
+ })
100
+ },
101
+ getCheckBook(){
102
+ this.needProps.checkBooks=[]
103
+ new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
104
+ data: {
105
+ items: 'id,f_check_book_name,f_check_book_type',
106
+ tablename: 't_check_book',
107
+ condition: `f_orgid = '${this.$login.f.orgid}'`,
108
+ orderitem: 'id desc'
109
+ }
110
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
111
+ this.needProps.checkBooks.push({label: '全部', value: ''})
112
+ this.needProps.checkBooks.push({label: '未在片区内', value: '111111'})
113
+ res.data.forEach(ress => {
114
+ this.needProps.checkBooks.push({
115
+ label: ress.f_check_book_name,
116
+ value: `${ress.id}-${ress.f_check_book_type}`
117
+ })
118
+ })
119
+ })
120
+ },
121
+ loadpage(){
122
+ this.select_search()
123
+ this.Mreadibook()
124
+ this.getSliceArea()
125
+ },
126
+ select_search(text, type){
127
+ //tag
128
+ let pcdText=text?` and f_residential_area like '%${text}%'`:''
129
+ if (type == 'pqId'){
130
+ if(text.length==0){
131
+ pcdText=text?` and 1=1`:''
132
+ }else {
133
+ pcdText =text?`and f_check_book_id in (${text})`:''
134
+ }
135
+
136
+ }
137
+ new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/rs/sql/safe_singleTable_OrderBy`, {data:{items:"*",tablename:"t_area",orderitem:"id",condition:`f_orgid = '${this.$login.f.orgid}' ${pcdText} `}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
138
+ //tag)
139
+ this.needProps.areaList=[]
140
+ this.needProps.areaList.push({label:"全部",value:""})
141
+ res.data.forEach((result)=>{
142
+ this.needProps.areaList.push({label:result.f_residential_area,value:result.f_residential_area})
143
+ //console.log('this.areaList=', JSON.stringify(this.areaList))
144
+ })
145
+ //tag)
146
+ })
147
+
148
+
149
+ },
150
+ //获取抄表册
151
+ async Mreadibook(){
152
+ this.needProps.cbc=[]
153
+ this.needProps.sliceArea=[]
154
+ let http = new HttpResetClass()
155
+ let getMeterReadingBooks = await http.load('POST','rs/logic/getMeterBooksData',
156
+ {data: {f_orgid: "('"+this.$login.f.orgid+"')"}},
157
+ {resolveMsg: null, rejectMsg: '获取失败!!!'})
158
+ this.needProps.cbc = [{label: '全部', value: ''}]
159
+ //tag
160
+ //tag)
161
+ //tag
162
+ this.needProps.meterbooks=[]
163
+ this.needProps.meterbooks=getMeterReadingBooks.data.meterbooks
164
+ this.needProps.meterbooks.forEach((res) => {
165
+ this.needProps.cbc.push({label: res.f_book_name, value: res.id})
166
+ /*if(res.f_book_slice_area){
167
+ if(this.sliceArea.indexOf(res.f_book_slice_area)<0){
168
+ this.sliceArea.push(res.f_book_slice_area)
169
+ }
170
+ }*/
171
+ })
172
+
173
+ },
174
+ //片区获取
175
+ async getSliceArea() {
176
+ let http = new HttpResetClass()
177
+ let getAllArea = await http.load('POST', '/rs/search', {
178
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
179
+ userid: this.$login.f.id
180
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
181
+ this.needProps.sliceArea = [{label: '全部', value: ''}]
182
+ //tag
183
+ //tag
184
+ //tag
185
+ getAllArea.data.forEach((res) => {
186
+ if(res.parentid==this.$login.f.orgid){
187
+ this.needProps.sliceArea.push({label:res.name,value:res.name})
188
+ }
189
+ })
190
+ //tag
191
+ },
192
+ setConList(){
193
+ this.needProps.entry_status=this.$appdata.getParam('安检状态') ? [{
194
+ label: '全部',
195
+ value: ''
196
+ }, ...this.$appdata.getParam('安检状态')] : [{label: '全部', value: ''}]
197
+
198
+ this.needProps.userTypes=this.$appdata.getParam('用户类型') ? [{
199
+ label: '全部',
200
+ value: ''
201
+ }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
202
+ this.needProps.userStates=this.$appdata.getParam('安检用户状态') ? [{
203
+ label: '全部',
204
+ value: ''
205
+ }, ...this.$appdata.getParam('安检用户状态')] : [{label: '全部', value: ''}]
206
+ this.needProps.gasproperties=this.$appdata.getParam('用气性质') ? [{
207
+ label: '全部',
208
+ value: ''
209
+ }, ...this.$appdata.getParam('用气性质')] : [{label: '全部', value: ''}]
210
+ // this.meter_classifys=this.$appdata.getParam('气表类型') ? [{
211
+ // label: '全部',
212
+ // value: ''
213
+ // }, ...this.$appdata.getParam('气表类型')] : [{label: '全部', value: ''}]
214
+ },
215
+ show () {
216
+ this.showItem = this.showItem ? false : true
217
+ },
218
+ showdetails (row) {
219
+ console.log('showdetails',row)
220
+ this.rowData = row
221
+ this.showItem = false
222
+ this.showItemUser = true
223
+ },
224
+ showusercompany(row){
225
+ console.log('showuser',row)
226
+ this.rowData = row
227
+ this.showItem = false
228
+ this.rowData.f_check_book_type='用户'
229
+ this.rowData.f_check_book_type1='单位'
230
+ this.showItemUser = true
231
+ },
232
+ showuser(row){
233
+ console.log('showuser',row)
234
+ this.rowData = row
235
+ this.showItem = false
236
+ this.rowData.f_check_book_type='用户'
237
+ this.rowData.f_check_book_type1='小区'
238
+ this.showItemUser = true
239
+ },
240
+ addbook(){
241
+ this.rowData= {
242
+ f_is_auto:'否',
243
+ f_check_book_type:"用户",
244
+ }
245
+ this.showItem = true
246
+ },
247
+ selected (row) {
248
+ this.showItem = true
249
+ this.barwidth = '50%'
250
+ //tag
251
+ this.rowData = row.val
252
+ this.hidden = false
253
+ //tag
254
+ },
255
+
256
+ close () {
257
+ this.showItem = false
258
+ this.barwidth = '100%'
259
+ this.hidden = true
260
+ }
261
+ },
262
+ computed:{
263
+ showItemAll(){
264
+ return this.showItem && this.showItemUser
265
+ }
266
+ },
267
+ watch: {
268
+ 'showItemUser' (val) {
269
+ //tag
270
+ console.log("showItemUser",val)
271
+ if(val){
272
+ this.showItem = false
273
+ }
274
+ if (val || this.showItem) {
275
+ this.style = 'col-sm-3 form-group'
276
+ this.style2 = 'col-sm-6 form-group'
277
+
278
+ } else {
279
+ this.style = 'col-sm-2 form-group'
280
+ this.style2 = 'col-sm-4 form-group'
281
+ }
282
+ },
283
+ 'showItem' (val) {
284
+ console.log("showItem",val)
285
+ if(val){
286
+ this.showItemUser = false
287
+ }
288
+ if (val || this.showItemUser) {
289
+ this.style = 'col-sm-3 form-group'
290
+ this.style2 = 'col-sm-6 form-group'
291
+
292
+ } else {
293
+ this.style = 'col-sm-2 form-group'
294
+ this.style2 = 'col-sm-4 form-group'
295
+ }
296
+ }
297
+ }
298
+ }
299
+
300
+ </script>
301
+
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <tab-button v-ref:list :active="-1">
3
+ <tabs header="居民用户台账">
4
+ <check-book v-if="show.includes('居民用户台账')" @deal-msg="dealMsg" v-ref:papermain :showtype="'民用'"></check-book>
5
+ </tabs>
6
+ <tabs header="非居民用户台账">
7
+ <check-book v-if="show.includes('非居民用户台账')" @deal-msg="dealMsg" v-ref:paperfeimain :showtype="'非民用'"></check-book>
8
+ </tabs>
9
+ <!-- <tabs header="用户管理">-->
10
+ <!-- <check-book-manage v-if="show.includes('用户管理')" @deal-msg="dealMsg"></check-book-manage>-->
11
+ <!-- </tabs>-->
12
+ </tab-button>
13
+
14
+ </template>
15
+
16
+ <script>
17
+ import TabButton from '../../../components/safecheck/common/TabButton'
18
+ import Tabs from '../../../components/safecheck/common/Tabs'
19
+ // import { HttpResetClass } from 'vue-client'
20
+
21
+ export default {
22
+ name: 'checkBookAll',
23
+ title: '用户台账管理',
24
+ data() {
25
+ return {// 页面开关
26
+ residentialArea: [],
27
+ f_start_date: '',
28
+ f_end_date: '',
29
+ listpage: true,
30
+ width: {
31
+ left: '100%',
32
+ right: '0%'
33
+ },
34
+ rowData: {},
35
+ show: []
36
+ }
37
+ },
38
+ components: {Tabs, TabButton},
39
+ ready() {
40
+ //tag
41
+ //tag
42
+ //tag
43
+ this.$refs.list.handleTabListClick(0,this.$refs.list.renderData[0])
44
+ },
45
+ methods: {
46
+ // permission(name) {
47
+ // if (!this.$login.r.find(value => value == name)) {
48
+ // return true
49
+ // }
50
+ // return true
51
+ // },
52
+ cancel(obj) {
53
+ this.listpage = true
54
+ },
55
+ dealMsg(obj) {
56
+ this.rowData = obj
57
+ this.listpage = false
58
+ this.f_start_date = obj.model.startDate
59
+ this.f_end_date = obj.model.endDate
60
+ }
61
+ }
62
+ }
63
+ </script>
64
+
65
+ <style scoped>
66
+
67
+ </style>
@@ -0,0 +1,146 @@
1
+ <template>
2
+ <div class="auto select-overspread">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row">
7
+ <div class="form-group col-sm-3" >
8
+ <label class="font_normal_body">小区名称</label>
9
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_area" placeholder='小区名称'
10
+ condition="f_residential_area like '%{}%'" @keyup.enter="search()">
11
+ </div>
12
+ <div class="form-group col-sm-2 button-range" >
13
+ <button class="button_search" style="margin-right: 10px" @click="search()" v-el:cba>查询</button>
14
+ <button class="button_search" style="margin-right: 10px" @click="$parent.$parent.send()" v-el:cba>下发</button>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </criteria>
19
+ <data-grid :model="model" class="table_sy" partial='list' v-ref:grid >
20
+ <template partial='head' >
21
+ <tr>
22
+ <th><nobr><input type="checkbox" onClick="event.cancelBubble = true" :checked="$parent.$parent.$parent.checkAll" @change="$parent.$parent.$parent.setCheckAll()"/>全选</nobr></th>
23
+ <th><nobr>省市区/县</nobr></th>
24
+ <th><nobr>街道/乡镇</nobr></th>
25
+ <th><nobr>小区名称</nobr></th>
26
+ <th><nobr>用户数量</nobr></th>
27
+ <th><nobr>详细地址</nobr></th>
28
+ <th><nobr>小区备注</nobr></th>
29
+ </tr>
30
+ </template>
31
+ <template partial='body' >
32
+ <tr >
33
+ <td style="text-align: center;"><input type="checkbox" onClick="event.cancelBubble = true" :checked="$parent.$parent.$parent.isChecked(row.id)" @change="$parent.$parent.$parent.setCheckes(row.id)" /></td>
34
+ <td style="text-align:center">{{row.f_pcd}}</td>
35
+ <td style="text-align:center">{{row.f_street}}</td>
36
+ <td style="text-align:center">{{row.f_residential_area}}</td>
37
+ <td style="text-align:center"> <button @click.stop="$parent.$parent.$parent.details(row)" class="btn btn-link"><b>{{row.num?row.num:0}}</b></button></td>
38
+ <td style="text-align:center">{{row.f_area_address}}</td>
39
+ <td style="text-align:center">{{row.f_comments}}</td>
40
+ </tr>
41
+ </template>
42
+ <template partial='foot'></template>
43
+ </data-grid>
44
+ </criteria-paged>
45
+ <modal :show.sync="showSendModal" :backdrop="false" width="90%" height="90%">
46
+ <article slot="modal-body" class="modal-body" style="height: 80vh">
47
+ <check-book-search-user-list v-if="showSendModal" :row="row" :addcondata="addcondata" :bookrowsdata="{bookrows:checkes,checkAll:checkAll}" :needprops="needprops":userlogin="userlogin"></check-book-search-user-list>
48
+ </article>
49
+ <footer slot="modal-footer">
50
+ </footer>
51
+
52
+ </modal>
53
+ </div>
54
+ </template>
55
+
56
+ <script>
57
+ import {HttpResetClass, PagedList} from 'vue-client'
58
+
59
+ export default {
60
+ title: '安检记录列表',
61
+ props: ['row','needprops'],
62
+ data () {
63
+ return {
64
+ rowdata: this.row,
65
+ showSendModal:false,
66
+ checkBookRow:{
67
+ },
68
+ userlogin:{
69
+ id:this.$login.f.id,
70
+ name:this.$login.f.name,
71
+ orgid:this.$login.f.orgid,
72
+ orgstr:this.$login.f.orgs,
73
+ },
74
+ model: new PagedList('rs/sql/getCheckBookArea', 50),
75
+ checkAll:false,
76
+ checkes:[],
77
+ addcondata:''
78
+ }
79
+ },
80
+ ready(){
81
+ console.log(this.row)
82
+ const val = this.row
83
+ if (val) {
84
+ this.checkAll=false
85
+ this.checkes=[]
86
+ this.rowdata = val
87
+ const condition = `f_check_book_id =${val.id}`
88
+ this.model.search(condition)
89
+ }
90
+ },
91
+ watch: {
92
+ 'row' (val) {
93
+ if (val) {
94
+ this.checkAll=false
95
+ this.checkes=[]
96
+ this.rowdata = val
97
+ const condition = `f_check_book_id =${val.id}`
98
+ this.model.search(condition)
99
+ }
100
+ }
101
+ },
102
+ methods: {
103
+ setCheckAll() {
104
+ this.checkAll=this.checkAll?false:true;
105
+ // 全选改变后,清空选中数据
106
+ this.checkes = []
107
+ },
108
+ isChecked(v) {
109
+ // 如果全选,不在的按选中算,否则,在的按选中算
110
+ if (this.checkAll) {
111
+ return this.checkes.indexOf(v) == -1
112
+ } else {
113
+ return this.checkes.indexOf(v) != -1
114
+ }
115
+ },
116
+ setCheckes(id) {
117
+ let index=this.checkes.indexOf(id)
118
+ if(index<0){
119
+ this.checkes.push(id)
120
+ }else{
121
+ this.checkes.splice(index,1)
122
+ }
123
+ },
124
+ send(){
125
+ if(!this.checkAll && this.checkes.length == 0){
126
+ return this.$showMessage('请选择单位')
127
+ }
128
+ this.showSendModal = true
129
+ },
130
+ details(row){
131
+ this.$emit('showuser' ,row)
132
+ },
133
+ selfSearch (args) {
134
+ if (this.rowdata.id) {
135
+ this.checkAll=false
136
+ this.checkes=[]
137
+ args.condition += `and f_check_book_id =${this.rowdata.id}`
138
+ this.model.search(args.condition)
139
+ this.addcondata = args.model.f_residential_area ? ` and area.f_residential_area like '%${args.model.f_residential_area}%'`: ''
140
+ } else {
141
+ this.$showMessage('请选择片区')
142
+ }
143
+ }
144
+ }
145
+ }
146
+ </script>