safecheck-client 3.0.34-28 → 3.0.34-29

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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/src/App-/345/215/225/351/241/265/351/235/242/346/211/223/345/214/205/347/224/250.vue +55 -55
  3. package/src/App.vue +31 -31
  4. package/src/components/android/ImgSelfAndroid.vue +181 -181
  5. package/src/components/android/QRCode/QRCodeBinding.vue +247 -247
  6. package/src/components/android/QRCode/QRCodePage.vue +199 -199
  7. package/src/components/android/SafecheckDevices.vue +1298 -1298
  8. package/src/components/android/examples/SafeListExamples.vue +95 -95
  9. package/src/components/android/examples/UserExamples.vue +125 -125
  10. package/src/filiale/baiyin/android/AndroidDefectDeal.vue +633 -633
  11. package/src/filiale/baiyin/pc/CheckPlanAreaList.vue +485 -485
  12. package/src/filiale/baiyin/pc/CheckSearchUser.vue +1067 -1067
  13. package/src/filiale/baiyin/pc/DefectListNew.vue +597 -597
  14. package/src/filiale/baiyin/pc/DefectMainNew.vue +63 -63
  15. package/src/filiale/baiyin/pc/DefectPaperNew.vue +1052 -1052
  16. package/src/filiale/baiyin/pc/PaperList.vue +790 -790
  17. package/src/filiale/baiyin/pc/PlanChooser.vue +167 -167
  18. package/src/filiale/baiyin/pc/PlanManage.vue +834 -834
  19. package/src/filiale/baiyin/pc/RightTreeSafe.vue +348 -348
  20. package/src/filiale/baiyin/pc/RoleSelector.vue +160 -160
  21. package/src/filiale/bayan/android/SafecheckOrderV.vue +2866 -2866
  22. package/src/filiale/jiaxian/android/AddPlanItem.vue +447 -447
  23. package/src/filiale/jiaxian/android/PhoneUpUserinfo.vue +1231 -0
  24. package/src/filiale/jiaxian/android/SafecheckDevices.vue +1298 -1298
  25. package/src/filiale/jiaxian/android/SafecheckOrderV.vue +2811 -2811
  26. package/src/filiale/jiaxian/android/SafecheckUserInfo.vue +784 -784
  27. package/src/filiale/jiaxian/android.js +14 -13
  28. package/src/filiale/jiaxian/pc.js +12 -12
  29. package/src/filiale/kelai/pc/CheckPlanAreaList.vue +476 -476
  30. package/src/filiale/qingjian/android/PhoneUpUserinfo.vue +1270 -1270
  31. package/src/filiale/qingjian/android/SafecheckOrderV.vue +2844 -2844
  32. package/src/filiale/yangchunboneng/android/NewCheckpaperAndroid.vue +1362 -1362
  33. package/src/filiale/yangchunboneng/android/PhoneUpUserinfo.vue +1235 -1235
  34. package/src/filiale/yangchunboneng/android/SafecheckOrderV.vue +2845 -2845
  35. package/src/filiale/yangchunboneng/pc/CheckBookSearchUser.vue +649 -649
  36. package/src/filiale/yangchunboneng/pc/CheckSearchUser.vue +1192 -1192
  37. package/src/main-/345/215/225/351/241/265/351/235/242/346/211/223/345/214/205/347/224/250.js +24 -24
  38. package/src/main.js +1 -1
@@ -1,649 +1,649 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="basic-main">
4
- <criteria-paged :model="model" v-ref:paged>
5
- <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
- <div class="row">
8
- <div class="form-group col-sm-4">
9
- <label class="font_normal_body">客户编号</label>
10
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
11
- style="width: 60%" placeholder="客户编号" condition="f_userinfo_code='{}'">
12
- </div>
13
- <div class="form-group col-sm-4">
14
- <label class="font_normal_body">客户名称</label>
15
- <input type="text" class="input_search" v-model="model.f_user_name"
16
- style="width: 60%" placeholder="客户名称" condition="f_user_name like '%{}%'">
17
- </div>
18
- <div class="form-group col-sm-4">
19
- <button class="button_spacing button_search" @click="search()">查询</button>
20
- <div style="float: right" class="button_spacing"
21
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
22
- @click="$parent.$parent.hidden()"></div>
23
- </div>
24
- </div>
25
- <div class="row">
26
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
27
- <label class="font_normal_body">地&emsp;&emsp;址</label>
28
- <input type="text" class="input_search" v-model="model.f_address"
29
- style="width: 60%" placeholder="地址" condition="f_address like '%{}%'">
30
- </div>
31
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
32
- <label class="font_normal_body">小区名称</label>
33
- <input type="text" class="input_search" v-model="model.f_residential_area"
34
- style="width: 60%" placeholder="小区名称" condition="f_residential_area like '%{}%'">
35
- </div>
36
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
37
- <label class="font_normal_body">客户类型</label>
38
- <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'
39
- :value-single="true" style="width: 60%"
40
- class="select_list select"
41
- :options='$parent.$parent.userTypes' placeholder='客户类型'
42
- close-on-select
43
- condition="f_user_type ='{}'"></v-select>
44
- </div>
45
- <div class="col-sm-4 form-group" style="margin-bottom: 0px" v-show="$parent.$parent.criteriaShow">
46
- <label class="font_normal_body">公&emsp;&emsp;司</label>
47
- <right-tree-safe @re-res="$parent.$parent.getResm" v-model="model.f_orgid" condition="ui.f_orgid in {}"></right-tree-safe>
48
- </div>
49
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
50
- <label class="font_normal_body">安&ensp;检&ensp;册</label>
51
- <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
52
- :value-single="true" style="width: 60%"
53
- class="select_list select"
54
- :options='$parent.$parent.checkBooks' placeholder='安检册名称'
55
- close-on-select
56
- condition="f_check_book_id ='{}'"></v-select>
57
- </div>
58
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
59
- <label class="font_normal_body">是否在册</label>
60
- <v-select :value.sync="model.f_is_checkbook" v-model='model.f_is_checkbook'
61
- :value-single="true" style="width: 60%"
62
- class="select_list select"
63
- @change="$parent.$parent.changeState"
64
- :options='$parent.$parent.isCheckBook' placeholder='有无所属安检册'
65
- close-on-select
66
- condition="{}"></v-select>
67
- </div>
68
- </div>
69
- <div class="row">
70
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
71
- <label class="font_normal_body">通气开始</label>
72
- <datepicker
73
- :value.sync="model.f_gas_date_str"
74
- style="width: 60%"
75
- placeholder='用户首次通气'
76
- :format="'yyyy-MM-dd 00:00:00'"
77
- v-model="model.f_gas_date_str"
78
- condition="f_uservent_date > '{}'"
79
- >
80
- </datepicker>
81
- </div>
82
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
83
- <label class="font_normal_body">通气结束</label>
84
- <datepicker
85
- :value.sync="model.f_gas_date_end"
86
- style="width: 60%"
87
- placeholder='用户首次通气'
88
- :format="'yyyy-MM-dd 23:59:59'"
89
- v-model="model.f_gas_date_end"
90
- condition="f_uservent_date < '{}'"
91
- >
92
- </datepicker>
93
- </div>
94
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow" >
95
- <label class="font_normal_body">开始时间</label>
96
- <datepicker
97
- :value.sync="model.f_check_start"
98
- placeholder='表具通气时间' style="width: 60%"
99
- :disabled-days-of-week="[]"
100
- :format="'yyyy-MM-dd'"
101
- :show-rest-button="reset"
102
- v-model="model.f_check_start"
103
- condition="f_gas_date > ='{} 00:00:00'">
104
- </datepicker>
105
- </div>
106
- <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow" >
107
- <label class="font_normal_body">结束时间</label>
108
- <datepicker
109
- :value.sync="model.f_check_end"
110
- placeholder='表具通气时间' style="width: 60%"
111
- :disabled-days-of-week="[]"
112
- :format="'yyyy-MM-dd'"
113
- :show-rest-button="reset"
114
- v-model="model.f_check_end"
115
- condition="f_gas_date <= '{} 23:59:59'">
116
- </datepicker>
117
- </div>
118
- </div>
119
- </div>
120
- </criteria>
121
- <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
122
- <template partial='head'>
123
- <tr @dblclick.stop="">
124
- <th>
125
- <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
126
- </th>
127
- <th>
128
- <nobr>客户姓名</nobr>
129
- </th>
130
- <th>
131
- <nobr>客户编号</nobr>
132
- </th>
133
- <th>
134
- <nobr>客户类型</nobr>
135
- </th>
136
- <th>
137
- <nobr>客户电话</nobr>
138
- </th>
139
- <th>
140
- <nobr>用户单位</nobr>
141
- </th>
142
- <th>
143
- <nobr>客户地址</nobr>
144
- </th>
145
- <th>
146
- <nobr>首次通气时间</nobr>
147
- </th>
148
- <th>
149
- <nobr>所属安检册</nobr>
150
- </th>
151
- </tr>
152
- </template>
153
- <template partial='body'>
154
- <td style="text-align: center">
155
- <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"
156
- @change="$parent.$parent.$parent.checkChange(row, $event)"></input>
157
- </nobr>
158
- </td>
159
- <td style="text-align: center">{{ row.f_user_name }}</td>
160
- <td style="text-align: center">{{ row.f_userinfo_code }}</td>
161
- <td style="text-align: center">{{ row.f_user_type }}</td>
162
- <td style="text-align: center">{{ row.f_user_phone }}</td>
163
- <td style="text-align: center">{{ row.f_residential_area }}</td>
164
- <td style="text-align: center">{{ row.f_address }}</td>
165
- <td style="text-align: center">{{ row.f_uservent_date }}</td>
166
- <td style="text-align: center">{{ row.f_check_book_name }}</td>
167
- </template>
168
- </data-grid>
169
- </criteria-paged>
170
- </div>
171
- <modal :show.sync="showModal" :backdrop="false">
172
- <div slot="modal-header" class="modal-header">
173
- <h4 class="modal-title">
174
- 创建片区
175
- </h4>
176
- </div>
177
- <div slot="modal-body" class="modal-body">
178
- <div v-if="true">
179
- <div class="row" style="margin-top: 10px">
180
- <div class="col-sm-12 form-group" style="margin: 0">
181
- <role-selector-safe
182
- @re-res="getRes"
183
- role-name="安检员"
184
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
185
- :value.sync="checkBook.f_checker_name"
186
- v-model="checkBook.f_checker_name">
187
- </role-selector-safe>
188
- </div>
189
- <div class="form-group col-sm-6" style="margin-top: 20px">
190
- <label class="font_normal_body">片区名</label>
191
- <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
192
- style="width: 60%" >
193
- </div>
194
- <div class="form-group col-sm-6" style="margin-top: 20px">
195
- <label class="font_normal_body">执行日期</label>
196
- <datepicker
197
- :value.sync="checkBook.f_run_date"
198
- style="width: 60%"
199
- :format="'yyyy-MM-dd'"
200
- v-model="checkBook.f_run_date"
201
- >
202
- </datepicker>
203
- </div>
204
- <div class="form-group col-sm-6" style="margin-top: 20px">
205
- <label class="font_normal_body">执行周期</label>
206
- <input type="number" class="input_search" v-model="checkBook.f_around_time"
207
- style="width: 60%" >
208
- </div>
209
- <div class="form-group col-sm-6" style="margin-top: 20px">
210
- <label class="font_normal_body">周期单位</label>
211
- <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
212
- :value-single="true" style="width: 60%"
213
- class="select_list select"
214
- :options='aroundUnit' placeholder=''
215
- close-on-select></v-select>
216
- </div>
217
- </div>
218
- </div>
219
- </div>
220
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
221
- <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
222
- <button class="button_search" @click="cancel">取消</button>
223
- </div>
224
- </modal>
225
- <modal :show.sync="showModal2" :backdrop="false">
226
- <div slot="modal-header" class="modal-header">
227
- <h4 class="modal-title">
228
- 添加用户
229
- </h4>
230
- </div>
231
- <div slot="modal-body" class="modal-body">
232
- <div v-if="true">
233
- <div class="row" style="margin-top: 10px">
234
- <div class="form-group col-sm-12" style="margin-top: 20px">
235
- <label class="font_normal_body">片&ensp;区&ensp;名</label>
236
- <v-select :value.sync="selectBook" v-model='selectBook'
237
- :value-single="true" style="width: 80%"
238
- class="select_list select"
239
- :options='checkBooks' placeholder=''
240
- close-on-select></v-select>
241
- </div>
242
- </div>
243
- </div>
244
- </div>
245
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
246
- <button class="button_search" style="margin-right: 20px" @click="ok2">确认</button>
247
- <button class="button_search" @click="cancel2">取消</button>
248
- </div>
249
- </modal>
250
- <modal :show.sync="showModal3" :backdrop="false">
251
- <div slot="modal-header" class="modal-header">
252
- <h4 class="modal-title">
253
- 调整用户
254
- </h4>
255
- </div>
256
- <div slot="modal-body" class="modal-body">
257
- <div v-if="true">
258
- <div class="row" style="margin-top: 10px;text-align: center">
259
- <div class="form-group col-sm-12" style="margin-top: 20px">
260
- <label class="font_normal_body">安&ensp;检&ensp;册</label>
261
- <v-select :value.sync="selectBook" v-model='selectBook'
262
- :value-single="true" style="width: 80%"
263
- class="select_list select"
264
- :options='checkBooks' placeholder=''
265
- close-on-select></v-select>
266
- </div>
267
- </div>
268
- </div>
269
- </div>
270
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
271
- <button class="button_search" style="margin-right: 20px" @click="ok3">确认</button>
272
- <button class="button_search" @click="cancel3">取消</button>
273
- </div>
274
- </modal>
275
-
276
- </div>
277
- </template>
278
-
279
- <script>
280
- import {PagedList, HttpResetClass} from 'vue-client'
281
- import * as Util from "../../../components/Util";
282
- import bus from "../../../bus";
283
-
284
- export default {
285
- title: '片区管理',
286
- data () {
287
- let model = new PagedList('rs/sql/getUserByCheckBookuser', 20)
288
- return {
289
- model: model,
290
- criteriaShow: false,
291
- excelHeaders: {},
292
- checkBooks: [],
293
- f_orgid: '',
294
- bookAll: false,
295
- bookList: [],
296
- selectBook:'',
297
- userTypes: [{label: '全部', value: ''},{label: '民用', value: '民用'}, {label: '非民用', value: '非民用'}],
298
- // init:false,
299
- aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
300
- isCheckBook: [{label: '全部', value: ''}, {label: '是', value: 'f_check_book_name is not null'}, {label: '否', value: 'f_check_book_name is null'}],
301
- isSearch: false,
302
- checkBook: {
303
- f_check_book_name: '',
304
- f_run_date: '',
305
- f_around_time: '',
306
- f_around_unit: '',
307
- f_create_date: Util.toStandardDateString(),
308
- f_create_person: this.$login.f.name,
309
- f_orgid: '',
310
- f_checker_name: ''
311
- },
312
- showModal: false,
313
- showModal2: false,
314
- showModal3: false
315
- }
316
- },
317
- computed: {
318
- searchData () {
319
- return {condition: this.model.condition}
320
- },
321
- bookCondition () {
322
- return this.model.condition
323
- },
324
- isCreateBook () {
325
- return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is null'
326
- },
327
- isChangeBook () {
328
- return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is not null'
329
- }
330
- },
331
- watch:{
332
- 'bookList'(){
333
- this.$emit('book-list',this.bookList)
334
- },
335
- 'bookAll'(val){
336
- if(!val){
337
- this.bookList=[]
338
- }
339
- this.bookList=[]
340
- for (let row of this.model.rows){
341
- this.bookList.push({f_userinfo_id:row.f_userinfo_id,f_plan_id:row.f_plan_id})
342
- }
343
- // this.$emit('book-all',this.bookAll)
344
- }
345
- },
346
- methods: {
347
- async ok2() {
348
- if (!this.selectBook) {
349
- this.$showMessage('请选择片区')
350
- return
351
- }
352
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
353
- let userCondition = ''
354
- if (this.bookList.length < 1) {
355
- //tag
356
- userCondition = this.bookCondition
357
- } else {
358
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
359
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
360
- }
361
- let addUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
362
- FROM
363
- t_userinfo tui
364
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
365
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
366
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
367
- WHERE
368
- tui.f_user_state = '正常'
369
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
370
- AND ${userCondition}`
371
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: addUser}},
372
- {resolveMsg: null, rejectMsg: '添加用户失败'})
373
- this.$showMessage('添加用户成功')
374
- this.selectBook = ''
375
- this.bookAll = false
376
- this.bookList = []
377
- this.showModal2 = false
378
- this.$refs.paged.$refs.criteria.search()
379
- }
380
- },
381
- async ok3() {
382
- if (!this.selectBook) {
383
- this.$showMessage('请选择片区')
384
- return
385
- }
386
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
387
- let userCondition = ''
388
- if (this.bookList.length < 1) {
389
- //tag
390
- userCondition = this.bookCondition
391
- } else {
392
- //tag)
393
-
394
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
395
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
396
- //tag
397
- }
398
- let upUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
399
- FROM
400
- t_userinfo tui
401
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
402
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
403
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
404
- WHERE
405
- tui.f_user_state = '正常'
406
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
407
- AND ${userCondition}`
408
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: upUser}},
409
- {resolveMsg: null, rejectMsg: '调整用户失败'})
410
- this.$showMessage('调整用户成功')
411
- this.selectBook = ''
412
- this.bookAll = false
413
- this.bookList = []
414
- this.showModal3 = false
415
- this.$refs.paged.$refs.criteria.search()
416
- }
417
- },
418
- cancel2(){
419
- this.selectBook = ''
420
- this.bookAll = false
421
- this.bookList = []
422
- this.showModal2 = false
423
- this.$refs.paged.$refs.criteria.search()
424
- },
425
- cancel3(){
426
- this.selectBook = ''
427
- this.bookAll = false
428
- this.bookList = []
429
- this.showModal3 = false
430
- this.$refs.paged.$refs.criteria.search()
431
- },
432
- addUser () {
433
- if (!this.isCreateBook) {
434
- this.$showMessage('请选择查询未划分片区的用户')
435
- return
436
- }
437
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
438
- this.showModal2 = true
439
- this.freshCheckBook()
440
- return
441
- }
442
- this.$showMessage('请选择用户')
443
- },
444
- upUser () {
445
- if (!this.isChangeBook) {
446
- this.$showMessage('请选择查询已划分片区的用户')
447
- return
448
- }
449
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
450
- this.showModal3 = true
451
- this.freshCheckBook()
452
- return
453
- }
454
- this.$showMessage('请选择用户')
455
- },
456
- async delUser () {
457
- if (!this.isChangeBook) {
458
- this.$showMessage('请选择查询已划分片区的用户')
459
- return
460
- }
461
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
462
- let userCondition= ''
463
- if (this.bookList.length < 1) {
464
- //tag
465
- userCondition = this.bookCondition
466
- } else {
467
- //tag)
468
-
469
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
470
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
471
- //tag
472
- }
473
- let delUser= `update t_user_address set f_check_book_id =null
474
- FROM
475
- t_userinfo tui
476
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
477
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
478
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
479
- WHERE
480
- tui.f_user_state = '正常'
481
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
482
- AND ${userCondition}`
483
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: delUser}},
484
- {resolveMsg: null, rejectMsg: '删除片区失败'})
485
- this.$showMessage('从片区删除所选用户成功')
486
- this.selectBook = ''
487
- this.bookAll = false
488
- this.bookList = []
489
- this.showModal3 = false
490
- this.$refs.paged.$refs.criteria.search()
491
- return
492
- }
493
- this.$showMessage('请选择用户')
494
- },
495
- beforeCreateBook () {
496
- if (!this.isCreateBook) {
497
- this.$showMessage('请选择查询未划分片区的用户')
498
- return
499
- }
500
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
501
- this.showModal = true
502
- return
503
- }
504
- this.$showMessage('请选择用户')
505
- },
506
- ok () {
507
- //tag)
508
- let condition = ''
509
- if (!this.checkBook.f_check_book_name) {
510
- return this.$showMessage('请填写册名')
511
- }
512
- if (!this.checkBook.f_checker_name) {
513
- return this.$showMessage('请选择安检员')
514
- }
515
- if (!this.checkBook.f_around_time || !this.checkBook.f_around_unit) {
516
- return this.$showMessage('请选填写周期信息')
517
- }
518
- if (!this.checkBook.f_run_date) {
519
- return this.$showMessage('执行日期')
520
- }
521
- if (this.bookList.length < 1) {
522
- //tag
523
- condition = this.bookCondition
524
- } else {
525
- //tag)
526
-
527
- condition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
528
- condition = 'tui.f_userinfo_id in (' + condition + ')'
529
- //tag
530
- }
531
- let data = {
532
- checkBook: this.checkBook,
533
- sqlStr: condition
534
- }
535
- new HttpResetClass().load('post', 'rs/logic/AddCheckBook', {data}).then(res => {
536
- //tag)
537
- if (res.data.id) {
538
- this.$showMessage('创建成功')
539
- this.showModal = false
540
- this.isSearch = false
541
- this.bookList = []
542
- this.bookAll = false
543
- this.freshCheckBook()
544
- this.$refs.paged.$refs.criteria.search()
545
- }
546
- })
547
- },
548
- changeState (val) {
549
- //tag
550
- //tag
551
- this.bookAll = false
552
- this.bookList = []
553
- if (this.$refs.paged.$refs.criteria.model.f_orgid){
554
- this.$refs.paged.$refs.criteria.search()
555
- }
556
- },
557
- cancel () {
558
- this.bookAll = false
559
- this.bookList = []
560
- this.showModal = false
561
- this.$refs.paged.$refs.criteria.search()
562
- },
563
- checkModel (row) {
564
- if (this.bookAll) {
565
- return true
566
- } else {
567
- if (this.bookList.findIndex(res => res === row.f_userinfo_id) !== -1) {
568
- return true
569
- } else {
570
- return false
571
- }
572
- }
573
- },
574
- checkChange (row, e) {
575
- if (e.target.checked) {
576
- this.bookList.push({f_userinfo_id:row.f_userinfo_id,f_plan_id:row.f_plan_id})
577
- } else {
578
- this.bookList.splice(this.bookList.findIndex(res => res.f_userinfo_id === row.f_userinfo_id), 1)
579
- }
580
- },
581
- getRes (obj) {
582
- this.checkBook.f_orgid = obj.resids[0]
583
- },
584
- getResm (obj) {
585
- this.$refs.paged.$refs.criteria.model.f_orgid = this.$login.convertToIn(obj.resids)
586
- },
587
- hidden () {
588
- this.criteriaShow = !this.criteriaShow
589
- },
590
- selfSearch (args) {
591
- this.isSearch = true
592
- this.bookAll = false
593
- this.bookList = []
594
-
595
- console.log("查询66666666666666666")
596
- this.$emit('book-condition',args.condition)
597
- // if (this.$refs.paged.$refs.criteria.model.f_orgid){
598
- // args.condition += `f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`
599
- // }
600
- this.model.search(args.condition, args.model)
601
- },
602
- freshCheckBook () {
603
- this.checkBooks = []
604
- new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
605
- data: {
606
- items: 'id,f_check_book_name,f_check_book_type',
607
- tablename: 't_check_book',
608
- condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`:'1=1',
609
- orderitem: 'id desc'
610
- }
611
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
612
- this.checkBooks.push({label: '全部', value: ''})
613
- res.data.forEach(ress => {
614
- console.log("片区类型",ress)
615
- if(ress.f_check_book_type ==='用户'){
616
- this.checkBooks.push({
617
- label: ress.f_check_book_name,
618
- value: ress.id
619
- })
620
- }
621
-
622
- })
623
- })
624
- }
625
- },
626
- beforeDestroy() {
627
- //tag
628
- bus.$off('fresh-user')
629
- },
630
- ready () {
631
- // bus.$on('fresh-user',()=>{
632
- // console.log("进入方法")
633
- // this.bookAll = false
634
- // this.bookList = []
635
- // this.$refs.paged.$refs.criteria.search()
636
- // })
637
- // this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_name is null'
638
- // //tag
639
- // // this.init=true
640
- this.freshCheckBook()
641
- }
642
- }
643
- </script>
644
- <style scoped>
645
- /*.btn-group > .btn:first-child {*/
646
- /* margin-left: 0;*/
647
- /* width: 100%;*/
648
- /*}*/
649
- </style>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="basic-main">
4
+ <criteria-paged :model="model" v-ref:paged>
5
+ <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
+ <div class="row">
8
+ <div class="form-group col-sm-4">
9
+ <label class="font_normal_body">客户编号</label>
10
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
11
+ style="width: 60%" placeholder="客户编号" condition="f_userinfo_code='{}'">
12
+ </div>
13
+ <div class="form-group col-sm-4">
14
+ <label class="font_normal_body">客户名称</label>
15
+ <input type="text" class="input_search" v-model="model.f_user_name"
16
+ style="width: 60%" placeholder="客户名称" condition="f_user_name like '%{}%'">
17
+ </div>
18
+ <div class="form-group col-sm-4">
19
+ <button class="button_spacing button_search" @click="search()">查询</button>
20
+ <div style="float: right" class="button_spacing"
21
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
22
+ @click="$parent.$parent.hidden()"></div>
23
+ </div>
24
+ </div>
25
+ <div class="row">
26
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
27
+ <label class="font_normal_body">地&emsp;&emsp;址</label>
28
+ <input type="text" class="input_search" v-model="model.f_address"
29
+ style="width: 60%" placeholder="地址" condition="f_address like '%{}%'">
30
+ </div>
31
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
32
+ <label class="font_normal_body">小区名称</label>
33
+ <input type="text" class="input_search" v-model="model.f_residential_area"
34
+ style="width: 60%" placeholder="小区名称" condition="f_residential_area like '%{}%'">
35
+ </div>
36
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
37
+ <label class="font_normal_body">客户类型</label>
38
+ <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'
39
+ :value-single="true" style="width: 60%"
40
+ class="select_list select"
41
+ :options='$parent.$parent.userTypes' placeholder='客户类型'
42
+ close-on-select
43
+ condition="f_user_type ='{}'"></v-select>
44
+ </div>
45
+ <div class="col-sm-4 form-group" style="margin-bottom: 0px" v-show="$parent.$parent.criteriaShow">
46
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
47
+ <right-tree-safe @re-res="$parent.$parent.getResm" v-model="model.f_orgid" condition="ui.f_orgid in {}"></right-tree-safe>
48
+ </div>
49
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
50
+ <label class="font_normal_body">安&ensp;检&ensp;册</label>
51
+ <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
52
+ :value-single="true" style="width: 60%"
53
+ class="select_list select"
54
+ :options='$parent.$parent.checkBooks' placeholder='安检册名称'
55
+ close-on-select
56
+ condition="f_check_book_id ='{}'"></v-select>
57
+ </div>
58
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
59
+ <label class="font_normal_body">是否在册</label>
60
+ <v-select :value.sync="model.f_is_checkbook" v-model='model.f_is_checkbook'
61
+ :value-single="true" style="width: 60%"
62
+ class="select_list select"
63
+ @change="$parent.$parent.changeState"
64
+ :options='$parent.$parent.isCheckBook' placeholder='有无所属安检册'
65
+ close-on-select
66
+ condition="{}"></v-select>
67
+ </div>
68
+ </div>
69
+ <div class="row">
70
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
71
+ <label class="font_normal_body">通气开始</label>
72
+ <datepicker
73
+ :value.sync="model.f_gas_date_str"
74
+ style="width: 60%"
75
+ placeholder='用户首次通气'
76
+ :format="'yyyy-MM-dd 00:00:00'"
77
+ v-model="model.f_gas_date_str"
78
+ condition="f_uservent_date > '{}'"
79
+ >
80
+ </datepicker>
81
+ </div>
82
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow">
83
+ <label class="font_normal_body">通气结束</label>
84
+ <datepicker
85
+ :value.sync="model.f_gas_date_end"
86
+ style="width: 60%"
87
+ placeholder='用户首次通气'
88
+ :format="'yyyy-MM-dd 23:59:59'"
89
+ v-model="model.f_gas_date_end"
90
+ condition="f_uservent_date < '{}'"
91
+ >
92
+ </datepicker>
93
+ </div>
94
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow" >
95
+ <label class="font_normal_body">开始时间</label>
96
+ <datepicker
97
+ :value.sync="model.f_check_start"
98
+ placeholder='表具通气时间' style="width: 60%"
99
+ :disabled-days-of-week="[]"
100
+ :format="'yyyy-MM-dd'"
101
+ :show-rest-button="reset"
102
+ v-model="model.f_check_start"
103
+ condition="f_gas_date > ='{} 00:00:00'">
104
+ </datepicker>
105
+ </div>
106
+ <div class="form-group col-sm-4" v-show="$parent.$parent.criteriaShow" >
107
+ <label class="font_normal_body">结束时间</label>
108
+ <datepicker
109
+ :value.sync="model.f_check_end"
110
+ placeholder='表具通气时间' style="width: 60%"
111
+ :disabled-days-of-week="[]"
112
+ :format="'yyyy-MM-dd'"
113
+ :show-rest-button="reset"
114
+ v-model="model.f_check_end"
115
+ condition="f_gas_date <= '{} 23:59:59'">
116
+ </datepicker>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </criteria>
121
+ <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
122
+ <template partial='head'>
123
+ <tr @dblclick.stop="">
124
+ <th>
125
+ <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
126
+ </th>
127
+ <th>
128
+ <nobr>客户姓名</nobr>
129
+ </th>
130
+ <th>
131
+ <nobr>客户编号</nobr>
132
+ </th>
133
+ <th>
134
+ <nobr>客户类型</nobr>
135
+ </th>
136
+ <th>
137
+ <nobr>客户电话</nobr>
138
+ </th>
139
+ <th>
140
+ <nobr>用户单位</nobr>
141
+ </th>
142
+ <th>
143
+ <nobr>客户地址</nobr>
144
+ </th>
145
+ <th>
146
+ <nobr>首次通气时间</nobr>
147
+ </th>
148
+ <th>
149
+ <nobr>所属安检册</nobr>
150
+ </th>
151
+ </tr>
152
+ </template>
153
+ <template partial='body'>
154
+ <td style="text-align: center">
155
+ <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"
156
+ @change="$parent.$parent.$parent.checkChange(row, $event)"></input>
157
+ </nobr>
158
+ </td>
159
+ <td style="text-align: center">{{ row.f_user_name }}</td>
160
+ <td style="text-align: center">{{ row.f_userinfo_code }}</td>
161
+ <td style="text-align: center">{{ row.f_user_type }}</td>
162
+ <td style="text-align: center">{{ row.f_user_phone }}</td>
163
+ <td style="text-align: center">{{ row.f_residential_area }}</td>
164
+ <td style="text-align: center">{{ row.f_address }}</td>
165
+ <td style="text-align: center">{{ row.f_uservent_date }}</td>
166
+ <td style="text-align: center">{{ row.f_check_book_name }}</td>
167
+ </template>
168
+ </data-grid>
169
+ </criteria-paged>
170
+ </div>
171
+ <modal :show.sync="showModal" :backdrop="false">
172
+ <div slot="modal-header" class="modal-header">
173
+ <h4 class="modal-title">
174
+ 创建片区
175
+ </h4>
176
+ </div>
177
+ <div slot="modal-body" class="modal-body">
178
+ <div v-if="true">
179
+ <div class="row" style="margin-top: 10px">
180
+ <div class="col-sm-12 form-group" style="margin: 0">
181
+ <role-selector-safe
182
+ @re-res="getRes"
183
+ role-name="安检员"
184
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
185
+ :value.sync="checkBook.f_checker_name"
186
+ v-model="checkBook.f_checker_name">
187
+ </role-selector-safe>
188
+ </div>
189
+ <div class="form-group col-sm-6" style="margin-top: 20px">
190
+ <label class="font_normal_body">片区名</label>
191
+ <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
192
+ style="width: 60%" >
193
+ </div>
194
+ <div class="form-group col-sm-6" style="margin-top: 20px">
195
+ <label class="font_normal_body">执行日期</label>
196
+ <datepicker
197
+ :value.sync="checkBook.f_run_date"
198
+ style="width: 60%"
199
+ :format="'yyyy-MM-dd'"
200
+ v-model="checkBook.f_run_date"
201
+ >
202
+ </datepicker>
203
+ </div>
204
+ <div class="form-group col-sm-6" style="margin-top: 20px">
205
+ <label class="font_normal_body">执行周期</label>
206
+ <input type="number" class="input_search" v-model="checkBook.f_around_time"
207
+ style="width: 60%" >
208
+ </div>
209
+ <div class="form-group col-sm-6" style="margin-top: 20px">
210
+ <label class="font_normal_body">周期单位</label>
211
+ <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
212
+ :value-single="true" style="width: 60%"
213
+ class="select_list select"
214
+ :options='aroundUnit' placeholder=''
215
+ close-on-select></v-select>
216
+ </div>
217
+ </div>
218
+ </div>
219
+ </div>
220
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
221
+ <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
222
+ <button class="button_search" @click="cancel">取消</button>
223
+ </div>
224
+ </modal>
225
+ <modal :show.sync="showModal2" :backdrop="false">
226
+ <div slot="modal-header" class="modal-header">
227
+ <h4 class="modal-title">
228
+ 添加用户
229
+ </h4>
230
+ </div>
231
+ <div slot="modal-body" class="modal-body">
232
+ <div v-if="true">
233
+ <div class="row" style="margin-top: 10px">
234
+ <div class="form-group col-sm-12" style="margin-top: 20px">
235
+ <label class="font_normal_body">片&ensp;区&ensp;名</label>
236
+ <v-select :value.sync="selectBook" v-model='selectBook'
237
+ :value-single="true" style="width: 80%"
238
+ class="select_list select"
239
+ :options='checkBooks' placeholder=''
240
+ close-on-select></v-select>
241
+ </div>
242
+ </div>
243
+ </div>
244
+ </div>
245
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
246
+ <button class="button_search" style="margin-right: 20px" @click="ok2">确认</button>
247
+ <button class="button_search" @click="cancel2">取消</button>
248
+ </div>
249
+ </modal>
250
+ <modal :show.sync="showModal3" :backdrop="false">
251
+ <div slot="modal-header" class="modal-header">
252
+ <h4 class="modal-title">
253
+ 调整用户
254
+ </h4>
255
+ </div>
256
+ <div slot="modal-body" class="modal-body">
257
+ <div v-if="true">
258
+ <div class="row" style="margin-top: 10px;text-align: center">
259
+ <div class="form-group col-sm-12" style="margin-top: 20px">
260
+ <label class="font_normal_body">安&ensp;检&ensp;册</label>
261
+ <v-select :value.sync="selectBook" v-model='selectBook'
262
+ :value-single="true" style="width: 80%"
263
+ class="select_list select"
264
+ :options='checkBooks' placeholder=''
265
+ close-on-select></v-select>
266
+ </div>
267
+ </div>
268
+ </div>
269
+ </div>
270
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
271
+ <button class="button_search" style="margin-right: 20px" @click="ok3">确认</button>
272
+ <button class="button_search" @click="cancel3">取消</button>
273
+ </div>
274
+ </modal>
275
+
276
+ </div>
277
+ </template>
278
+
279
+ <script>
280
+ import {PagedList, HttpResetClass} from 'vue-client'
281
+ import * as Util from "../../../components/Util";
282
+ import bus from "../../../bus";
283
+
284
+ export default {
285
+ title: '片区管理',
286
+ data () {
287
+ let model = new PagedList('rs/sql/getUserByCheckBookuser', 20)
288
+ return {
289
+ model: model,
290
+ criteriaShow: false,
291
+ excelHeaders: {},
292
+ checkBooks: [],
293
+ f_orgid: '',
294
+ bookAll: false,
295
+ bookList: [],
296
+ selectBook:'',
297
+ userTypes: [{label: '全部', value: ''},{label: '民用', value: '民用'}, {label: '非民用', value: '非民用'}],
298
+ // init:false,
299
+ aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
300
+ isCheckBook: [{label: '全部', value: ''}, {label: '是', value: 'f_check_book_name is not null'}, {label: '否', value: 'f_check_book_name is null'}],
301
+ isSearch: false,
302
+ checkBook: {
303
+ f_check_book_name: '',
304
+ f_run_date: '',
305
+ f_around_time: '',
306
+ f_around_unit: '',
307
+ f_create_date: Util.toStandardDateString(),
308
+ f_create_person: this.$login.f.name,
309
+ f_orgid: '',
310
+ f_checker_name: ''
311
+ },
312
+ showModal: false,
313
+ showModal2: false,
314
+ showModal3: false
315
+ }
316
+ },
317
+ computed: {
318
+ searchData () {
319
+ return {condition: this.model.condition}
320
+ },
321
+ bookCondition () {
322
+ return this.model.condition
323
+ },
324
+ isCreateBook () {
325
+ return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is null'
326
+ },
327
+ isChangeBook () {
328
+ return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is not null'
329
+ }
330
+ },
331
+ watch:{
332
+ 'bookList'(){
333
+ this.$emit('book-list',this.bookList)
334
+ },
335
+ 'bookAll'(val){
336
+ if(!val){
337
+ this.bookList=[]
338
+ }
339
+ this.bookList=[]
340
+ for (let row of this.model.rows){
341
+ this.bookList.push({f_userinfo_id:row.f_userinfo_id,f_plan_id:row.f_plan_id})
342
+ }
343
+ // this.$emit('book-all',this.bookAll)
344
+ }
345
+ },
346
+ methods: {
347
+ async ok2() {
348
+ if (!this.selectBook) {
349
+ this.$showMessage('请选择片区')
350
+ return
351
+ }
352
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
353
+ let userCondition = ''
354
+ if (this.bookList.length < 1) {
355
+ //tag
356
+ userCondition = this.bookCondition
357
+ } else {
358
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
359
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
360
+ }
361
+ let addUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
362
+ FROM
363
+ t_userinfo tui
364
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
365
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
366
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
367
+ WHERE
368
+ tui.f_user_state = '正常'
369
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
370
+ AND ${userCondition}`
371
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: addUser}},
372
+ {resolveMsg: null, rejectMsg: '添加用户失败'})
373
+ this.$showMessage('添加用户成功')
374
+ this.selectBook = ''
375
+ this.bookAll = false
376
+ this.bookList = []
377
+ this.showModal2 = false
378
+ this.$refs.paged.$refs.criteria.search()
379
+ }
380
+ },
381
+ async ok3() {
382
+ if (!this.selectBook) {
383
+ this.$showMessage('请选择片区')
384
+ return
385
+ }
386
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
387
+ let userCondition = ''
388
+ if (this.bookList.length < 1) {
389
+ //tag
390
+ userCondition = this.bookCondition
391
+ } else {
392
+ //tag)
393
+
394
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
395
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
396
+ //tag
397
+ }
398
+ let upUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
399
+ FROM
400
+ t_userinfo tui
401
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
402
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
403
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
404
+ WHERE
405
+ tui.f_user_state = '正常'
406
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
407
+ AND ${userCondition}`
408
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: upUser}},
409
+ {resolveMsg: null, rejectMsg: '调整用户失败'})
410
+ this.$showMessage('调整用户成功')
411
+ this.selectBook = ''
412
+ this.bookAll = false
413
+ this.bookList = []
414
+ this.showModal3 = false
415
+ this.$refs.paged.$refs.criteria.search()
416
+ }
417
+ },
418
+ cancel2(){
419
+ this.selectBook = ''
420
+ this.bookAll = false
421
+ this.bookList = []
422
+ this.showModal2 = false
423
+ this.$refs.paged.$refs.criteria.search()
424
+ },
425
+ cancel3(){
426
+ this.selectBook = ''
427
+ this.bookAll = false
428
+ this.bookList = []
429
+ this.showModal3 = false
430
+ this.$refs.paged.$refs.criteria.search()
431
+ },
432
+ addUser () {
433
+ if (!this.isCreateBook) {
434
+ this.$showMessage('请选择查询未划分片区的用户')
435
+ return
436
+ }
437
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
438
+ this.showModal2 = true
439
+ this.freshCheckBook()
440
+ return
441
+ }
442
+ this.$showMessage('请选择用户')
443
+ },
444
+ upUser () {
445
+ if (!this.isChangeBook) {
446
+ this.$showMessage('请选择查询已划分片区的用户')
447
+ return
448
+ }
449
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
450
+ this.showModal3 = true
451
+ this.freshCheckBook()
452
+ return
453
+ }
454
+ this.$showMessage('请选择用户')
455
+ },
456
+ async delUser () {
457
+ if (!this.isChangeBook) {
458
+ this.$showMessage('请选择查询已划分片区的用户')
459
+ return
460
+ }
461
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
462
+ let userCondition= ''
463
+ if (this.bookList.length < 1) {
464
+ //tag
465
+ userCondition = this.bookCondition
466
+ } else {
467
+ //tag)
468
+
469
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
470
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
471
+ //tag
472
+ }
473
+ let delUser= `update t_user_address set f_check_book_id =null
474
+ FROM
475
+ t_userinfo tui
476
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
477
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
478
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
479
+ WHERE
480
+ tui.f_user_state = '正常'
481
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
482
+ AND ${userCondition}`
483
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: delUser}},
484
+ {resolveMsg: null, rejectMsg: '删除片区失败'})
485
+ this.$showMessage('从片区删除所选用户成功')
486
+ this.selectBook = ''
487
+ this.bookAll = false
488
+ this.bookList = []
489
+ this.showModal3 = false
490
+ this.$refs.paged.$refs.criteria.search()
491
+ return
492
+ }
493
+ this.$showMessage('请选择用户')
494
+ },
495
+ beforeCreateBook () {
496
+ if (!this.isCreateBook) {
497
+ this.$showMessage('请选择查询未划分片区的用户')
498
+ return
499
+ }
500
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
501
+ this.showModal = true
502
+ return
503
+ }
504
+ this.$showMessage('请选择用户')
505
+ },
506
+ ok () {
507
+ //tag)
508
+ let condition = ''
509
+ if (!this.checkBook.f_check_book_name) {
510
+ return this.$showMessage('请填写册名')
511
+ }
512
+ if (!this.checkBook.f_checker_name) {
513
+ return this.$showMessage('请选择安检员')
514
+ }
515
+ if (!this.checkBook.f_around_time || !this.checkBook.f_around_unit) {
516
+ return this.$showMessage('请选填写周期信息')
517
+ }
518
+ if (!this.checkBook.f_run_date) {
519
+ return this.$showMessage('执行日期')
520
+ }
521
+ if (this.bookList.length < 1) {
522
+ //tag
523
+ condition = this.bookCondition
524
+ } else {
525
+ //tag)
526
+
527
+ condition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
528
+ condition = 'tui.f_userinfo_id in (' + condition + ')'
529
+ //tag
530
+ }
531
+ let data = {
532
+ checkBook: this.checkBook,
533
+ sqlStr: condition
534
+ }
535
+ new HttpResetClass().load('post', 'rs/logic/AddCheckBook', {data}).then(res => {
536
+ //tag)
537
+ if (res.data.id) {
538
+ this.$showMessage('创建成功')
539
+ this.showModal = false
540
+ this.isSearch = false
541
+ this.bookList = []
542
+ this.bookAll = false
543
+ this.freshCheckBook()
544
+ this.$refs.paged.$refs.criteria.search()
545
+ }
546
+ })
547
+ },
548
+ changeState (val) {
549
+ //tag
550
+ //tag
551
+ this.bookAll = false
552
+ this.bookList = []
553
+ if (this.$refs.paged.$refs.criteria.model.f_orgid){
554
+ this.$refs.paged.$refs.criteria.search()
555
+ }
556
+ },
557
+ cancel () {
558
+ this.bookAll = false
559
+ this.bookList = []
560
+ this.showModal = false
561
+ this.$refs.paged.$refs.criteria.search()
562
+ },
563
+ checkModel (row) {
564
+ if (this.bookAll) {
565
+ return true
566
+ } else {
567
+ if (this.bookList.findIndex(res => res === row.f_userinfo_id) !== -1) {
568
+ return true
569
+ } else {
570
+ return false
571
+ }
572
+ }
573
+ },
574
+ checkChange (row, e) {
575
+ if (e.target.checked) {
576
+ this.bookList.push({f_userinfo_id:row.f_userinfo_id,f_plan_id:row.f_plan_id})
577
+ } else {
578
+ this.bookList.splice(this.bookList.findIndex(res => res.f_userinfo_id === row.f_userinfo_id), 1)
579
+ }
580
+ },
581
+ getRes (obj) {
582
+ this.checkBook.f_orgid = obj.resids[0]
583
+ },
584
+ getResm (obj) {
585
+ this.$refs.paged.$refs.criteria.model.f_orgid = this.$login.convertToIn(obj.resids)
586
+ },
587
+ hidden () {
588
+ this.criteriaShow = !this.criteriaShow
589
+ },
590
+ selfSearch (args) {
591
+ this.isSearch = true
592
+ this.bookAll = false
593
+ this.bookList = []
594
+
595
+ console.log("查询66666666666666666")
596
+ this.$emit('book-condition',args.condition)
597
+ // if (this.$refs.paged.$refs.criteria.model.f_orgid){
598
+ // args.condition += `f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`
599
+ // }
600
+ this.model.search(args.condition, args.model)
601
+ },
602
+ freshCheckBook () {
603
+ this.checkBooks = []
604
+ new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
605
+ data: {
606
+ items: 'id,f_check_book_name,f_check_book_type',
607
+ tablename: 't_check_book',
608
+ condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`:'1=1',
609
+ orderitem: 'id desc'
610
+ }
611
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
612
+ this.checkBooks.push({label: '全部', value: ''})
613
+ res.data.forEach(ress => {
614
+ console.log("片区类型",ress)
615
+ if(ress.f_check_book_type ==='用户'){
616
+ this.checkBooks.push({
617
+ label: ress.f_check_book_name,
618
+ value: ress.id
619
+ })
620
+ }
621
+
622
+ })
623
+ })
624
+ }
625
+ },
626
+ beforeDestroy() {
627
+ //tag
628
+ bus.$off('fresh-user')
629
+ },
630
+ ready () {
631
+ // bus.$on('fresh-user',()=>{
632
+ // console.log("进入方法")
633
+ // this.bookAll = false
634
+ // this.bookList = []
635
+ // this.$refs.paged.$refs.criteria.search()
636
+ // })
637
+ // this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_name is null'
638
+ // //tag
639
+ // // this.init=true
640
+ this.freshCheckBook()
641
+ }
642
+ }
643
+ </script>
644
+ <style scoped>
645
+ /*.btn-group > .btn:first-child {*/
646
+ /* margin-left: 0;*/
647
+ /* width: 100%;*/
648
+ /*}*/
649
+ </style>