safecheck-client 3.0.34-50 → 3.0.34-51

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,6 +45,23 @@
45
45
  color: #FFFFFF;
46
46
  font: 14px PingFang-SC-Bold;
47
47
  }
48
+ table {
49
+ text-align: center;
50
+ white-space: nowrap;
51
+ font-size: 12px;
52
+ width: 50%;
53
+ border-collapse: collapse;
54
+ margin: 20px 0;
55
+ margin: auto;
56
+ }
57
+ th, td {
58
+ padding: 12px;
59
+ border-bottom: 1px solid #ddd;
60
+ }
61
+ th {
62
+ background-color: #f2f2f2;
63
+ }
64
+ tr:hover {background-color: #f5f5f5;}
48
65
  .qxbtn-color{
49
66
  background-color: #FFFFFF;
50
67
  border-radius: 4px ;
@@ -66,8 +83,8 @@
66
83
  </style>
67
84
  <template>
68
85
  <div style="height: auto;width: 100%">
69
- <criteria-paged :model="model" v-ref:paged>
70
- <criteria partial='criteria' @condition-changed='search' v-ref:cri>
86
+ <criteria-paged :model="model" v-ref:paged :pager="false">
87
+ <criteria partial='criteria' @condition-changed='$parent.search' v-ref:cri>
71
88
  <div partial>
72
89
  <form>
73
90
  <div class="row app-row">
@@ -115,7 +132,7 @@
115
132
  v-model="model.f_start_date"
116
133
  class="input-font"
117
134
  :format="'yyyy-MM-dd 00:00:00'" condition="f_issue_time >= '{}'"
118
- readonly="readonly">
135
+ >
119
136
  </datepicker>-
120
137
  <datepicker id="f_end_date" style="width: 30%;"
121
138
  :value.sync="model.f_end_date"
@@ -123,11 +140,11 @@
123
140
  v-model="model.f_end_date"
124
141
  class="input-font"
125
142
  :format="'yyyy-MM-dd 23:59:00'" condition="f_issue_time <= '{}'"
126
- readonly="readonly">
143
+ >
127
144
  </datepicker>
128
145
  </div>
129
146
  <div class="row text-center" style="margin-top: 20px;">
130
- <button type="button" class="btn btn-lg btn-font btn-color" style="width: 25%;" @click="$parent.$parent.selfSearch">查询</button>
147
+ <button type="button" class="btn btn-lg btn-font btn-color" style="width: 25%;" @click="search">查询</button>
131
148
  <img @click="$parent.$parent.getNewOrder" src="../../assets/shuaxindaiban1.png" style="float: right;margin-right: 3%;width: 40px;padding: 5px; float:right">
132
149
  </div>
133
150
  <div class="col-sm-12">
@@ -140,19 +157,34 @@
140
157
  <div partial>
141
158
  <div class="auto app-text" style="margin-top: 5px;">
142
159
  <div class="panel" style="padding: 10px 10px 5px 10px;">
143
- <div class="panel-body panel-self">
160
+ <div class="panel-body panel-self" @click="$parent.$parent.$parent.gotoAreaSelect(row)">
161
+ <div class="col-xs-12">
162
+ <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>计划名称:</b></p>
163
+ <p class="panel-title col-xs-5 text-left input-font" style="width: 74%">{{ row.f_plan_name }}</p>
164
+ </div>
144
165
  <div class="col-xs-12">
145
- <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>用户编号:</b></p>
146
- <p class="panel-title col-xs-5 text-left input-font" style="width: 74%">{{ row.f_userinfo_code }}</p>
166
+ <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>计划发型:</b></p>
167
+ <p class="panel-title col-xs-7 text-left input-font" style="width: 79%">{{ row.f_safecheck_type }}</p>
147
168
  </div>
148
169
  <div class="col-xs-12">
149
- <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>用户名称:</b></p>
150
- <p class="panel-title col-xs-7 text-left input-font" style="width: 79%">{{ row.f_user_name }}</p>
170
+ <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>计划时间:</b></p>
171
+ <p class="panel-title col-xs-7 text-left input-font" style="width: 79%">{{ row.f_issue_time }}</p>
151
172
  </div>
152
- <div class="col-xs-6">
153
- <p class="panel-title col-xs-5 text-left font"><b>用户类型:</b></p>
154
- <p class="panel-title col-xs-7 text-left input-font">{{ row.f_user_type }}
155
- </p>
173
+ <div class="col-xs-12">
174
+ <table>
175
+ <tr>
176
+ <td style="color: #00A3F0">{{row.jihuazongshu}}</td>
177
+ <td style="color: #3CC51F">{{row.yijian}}</td>
178
+ <td style="color: coral">{{row.weijian}}</td>
179
+ <td style="color: red">{{row.daofangbuyu}}</td>
180
+ </tr>
181
+ <tr>
182
+ <th>计划总户数</th>
183
+ <th>已检户数</th>
184
+ <th>未检户数</th>
185
+ <th>到访不遇户数</th>
186
+ </tr>
187
+ </table>
156
188
  </div>
157
189
  </div>
158
190
  </div>
@@ -164,528 +196,42 @@
164
196
  </template>
165
197
  <script>
166
198
  import LocalPagedList from '../../plugins/LocalPagedList'
167
- import Vue from 'vue'
168
- import { PagedList,HttpResetClass } from 'vue-client'
169
- import * as Util from '../Util'
170
- import co from 'co'
171
- let select = function * (self) {
172
- let http = new HttpResetClass()
173
- http.load('POST', `${self.$androidUtil.getProxyUrl()}/rs/search`, {
174
- source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
175
- userid: Vue.user.id
176
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
177
- //tag
178
- self.checkers.push({label:'全部',value:''})
179
- res.data.forEach((checker)=>{
180
- self.checkers.push({label:checker.name,value:checker.id})
181
- })
182
- })
183
- }
184
199
  export default {
185
- title: '无计划安检查询',
200
+ title: '安检待办',
186
201
  props: ['planName'],
187
202
  data() {
188
203
  return {
204
+ planNameOptions:[{label: '请选择', value: ''},],
189
205
  safecheckTypes:[{label: '请选择', value: ''},{label: '年度安检', value: '年度安检'},{label: '抽检', value: '抽检'}],
190
- f_filialeids:'('+Vue.user.orgid+')',
191
- //f_filialeids:'(305)',
192
- planparam:[],
193
- check:'',
194
- plan:'',
195
- planid:'',
196
- model:Vue.android? new LocalPagedList('androidGetuserinfo',20,{condition:'this.condition'}): new PagedList( 'AndroidRest/rs/sql/androidGetuserinfo',20,{condition:'this.condition'}),
197
- showModal: false,
198
- showModal2:false,
199
- showModal3:false,
200
- needid:'',
201
- criteriaShow: false,
202
- planoption:[],
203
- condition:'',
204
- checkers:[],
205
- param: null,
206
- f_preset_dt : Util.to3339TimeString(),
207
- flow_direction:[
208
- {label: '请选择挂表方式', value: ''},
209
- {label: '左表', value: '左表'},
210
- {label: '右表', value: '右表'}
211
- ],
212
- check_states: [
213
- {label: '请选择安检状态', value: ''},
214
- {label: '未检', value: '未检'},
215
- {label: '临时保存', value: '已检'},
216
- ],
217
- last_check_states: [
218
- {label: '请选择上次安检状态', value: ''},
219
- {label: '入户', value: '入户'},
220
- {label: '拒检', value: '拒检'},
221
- {label: '到访不遇', value: '到访不遇'},
222
- {label: '未使用天然气', value: '未使用天然气'}
223
- ],
224
- upload_states: [
225
- {label: '请选择上传状态', value: ''},
226
- {label: '未传', value: '未传'},
227
- {label: '已传', value: '已传'}
228
- ],
229
- user_types: [
230
- {label: '请选择用户类型', value: ''},
231
- {label: '民用', value: '民用'},
232
- {label: '非民用', value: '非民用'},
233
- ],
234
- verify_state: [
235
- {label: '请选择审核状态', value: ''},
236
- {label: '未审核', value: '未审核'},
237
- {label: '打回', value: '打回'}
238
- ],
239
- residentialAreaOptions: [],
240
- buildOptions: [],
241
- unitOptions: [],
242
- planNameOptions: [],
243
- upcomingCount: 0,
244
- doneCount: 0,
245
- tempSaveCount: 0,
246
- allPlanCount: 0
206
+ model:new LocalPagedList('androidGetuserinfo',20,{condition:'this.condition'}),
247
207
  }
248
208
  },
249
209
  ready(){
250
- this.getAllArea()
251
210
  this.getAllPlanName()
252
- this.selfSearch()
253
- let gen = select(this)
254
- co(gen)
255
- },
256
- mounted(){
257
- //tag
258
- if (window.history && window.history.pushState) {
259
- history.pushState(null, null, document.URL);
260
- window.addEventListener('popstate', this.fun, false);//false阻止默认事件
261
- }
262
- },
263
- destroyed(){
264
- //tag
265
- window.removeEventListener('popstate', this.fun, false);//false阻止默认事件
266
211
  },
267
212
  methods: {
268
- scan(){
269
- HostApp.__this__=this,
270
- HostApp.scanCode({callback:"javascript:HostApp.__this__.getCode();"})
271
- },
272
- getCode(){
273
- const datapa = HostApp.getCode().data;
274
- //tag
275
- this.$refs.paged.$refs.cri.model.f_meter_no = datapa
276
-
277
- },
278
- fun () {
279
- //tag
280
- //tag
281
- },
282
- iscancel(){
283
- this.showModal2=false
284
- this.showModal3=false
285
- this.planoption=[]
286
- },
287
- timeSet(val){
288
- return val
289
- },
290
- async isok(){
291
- if(this.planoption.length==0){
292
- this.$showMessage("请选择计划")
293
- return false
294
- }
295
- for (let i = 0; i <this.planoption.length ; i++) {
296
- if (this.planoption[i]["selected"]==true){
297
- this.planid=this.planoption[i].value
298
- break
299
- }
300
- }
301
- if(this.planid==''){
302
- this.$showMessage("请选择计划")
303
- return false
304
- }
305
- await this.okput()
306
- },
307
- async manyisok(){
308
- if(this.planoption.length==0){
309
- this.$showMessage("请选择计划")
310
- return false
311
- }
312
- for (let i = 0; i <this.planoption.length ; i++) {
313
- if (this.planoption[i]["selected"]==true){
314
- this.planid=this.planoption[i].value
315
- break
316
- }
317
- }
318
- if(this.planid==''){
319
- this.$showMessage("请选择计划")
320
- return false
321
- }
322
- await this.manyokput()
323
- },
324
- changenull(){
325
- this.showModal2=false
326
- this.showModal3=false
327
- this.planoption=[]
328
- this.plan=''
329
- this.check=''
330
- },
331
- async okput(){
332
- let res= await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/UpCheckPlanItem`, {data:{
333
- condition:`i.id='`+this.needid+`'`,
334
- f_plan_id:this.planid,
335
- switchCheckAll:false,
336
- checkAll:false,
337
- f_operator:Vue.user.name
338
- }
339
- })
340
- this.$showMessage("上传成功,请等待审核")
341
- await this.changenull()
342
- await this.getNewOrder()
343
- },
344
- async manyokput(){
345
- let res= await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/UpCheckPlanItem`, {data:{
346
- columnName:"i.id",
347
- condition:"1=1",
348
- f_plan_id:this.planid,
349
- switchCheckAll:true,
350
- param:this.planparam,
351
- checkAll:false,
352
- f_operator:Vue.user.name
353
- }
354
- })
355
- await this.changenull()
356
- await this.getNewOrder()
357
- },
358
- async plansearch(){
359
- this.planoption=[]
360
- let condition= ` f_plan_year=${new Date().getFullYear()}`
361
- if(this.check){
362
- condition += ` and f_checker_id= '${this.check}'`
363
- }
364
- if(this.plan){
365
- condition += ` and f_plan_name like '%${this.plan}%'`
366
- }
367
- let res= await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/预约计划下发`, {data:{
368
- condition:condition,
369
- f_filialeids:this.f_filialeids,
370
- groupitem:'',
371
- orderitem:'id'
372
- }})
373
- let resoult=res.data
374
- for (let i = 0; i < resoult.length; i++) {
375
- this.planoption.push({label: resoult[i].f_plan_name,selected:false, value: resoult[i].id})
376
- }
377
- },
378
-
379
- select(row, idx) {
380
- this.$set('planoption[' + idx + '].selected', true)
381
- for (let i = 0; i <this.planoption.length ; i++) {
382
- if (i!=idx){
383
- this.planoption[i]["selected"]=false
384
- }
385
- }
386
- },
387
- planclose(){
388
- this.showModal2=false
389
- this.showModal3=false
390
- },
391
- queryplan(val){
392
- this.needid=val
393
- this.showModal2 = true
394
- },
395
- queryplanmany(){
396
-
397
- this.showModal3 = true
398
- },
399
- reload(){
400
- // this.getAllArea()
401
- // this.getAllPlanName()
402
- this.selfSearch()
403
- },
404
- cancelReserve (idx, id) {
405
- if(Vue.android){
406
- let res = this.$androidUtil.bzLogic('BookingCheck', {dt: '', id: id})
407
- this.$set('model.rows[' + idx + '].f_prearranged_date', null)
408
- if (res.code == 200) {
409
- this.$showMessage("取消预约成功")
410
- }
411
- }else {
412
- this.$androidUtil.bzLogic('PCbookingCheck', {dt: '', id: id}).then((repanse) => {
413
- this.$set('model.rows[' + idx + '].f_prearranged_date', null)
414
- if (repanse.data.code == 200) {
415
- alert("取消预约成功!")
416
- }
417
- })
418
- }},
419
- genuineReserve () {
420
- if(Vue.android){
421
- if (!this.f_preset_dt) {
422
- this.$showMessage('请选择一个日期')
423
- return
424
- }
425
- let pdt = this.f_preset_dt.replace('T', ' ')
426
- let respanse = this.$androidUtil.bzLogic('BookingCheck', {id: this.model.rows[this.param].id, dt: pdt})
427
- this.$set('model.rows[' + this.param + '].f_prearranged_date', pdt)
428
- if(respanse.code == 200) {
429
- this.$showMessage("预约成功!")
430
- }
431
- this.showModal = false
432
- }else {
433
- if (!this.f_preset_dt) {
434
- alert('请选择一个日期')
435
- return
436
- }
437
- let pdt = this.f_preset_dt.replace('T', ' ')
438
- this.$androidUtil.bzLogic('PCbookingCheck', {id: this.model.rows[this.param].id, dt: pdt}).then((res) => {
439
- this.$set('model.rows[' + this.param + '].f_prearranged_date', pdt)
440
- if(res.data.code == 200) {
441
- alert("预约成功!")
442
- }
443
- this.showModal = false
444
- })
213
+ gotoAreaSelect(row){
214
+ var pardate = {
215
+ _this:this,
216
+ title:'待办工作',
217
+ safe:false
445
218
  }
219
+ this.$dispatch('gotoson',pardate)
220
+ this.$goto('area-select', {row: row}, 'self')
446
221
  },
447
- inspect(row) {
448
- var _this = this
449
- let http = new HttpResetClass()
450
- http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {data: {
451
- items: 'id',
452
- tablename: 't_check_plan_item',
453
- condition: `id = '${row.id}'`,
454
- orderitem: ' id '
455
- }}, {resolveMsg: null, rejectMsg: null}).then((getcheckplan) => {
456
- console.log('getcheckplan=', JSON.stringify(getcheckplan))
457
- this.getcheckplandata = getcheckplan.data[0]
458
- if(this.getcheckplandata){
459
- if (row.f_upload_state == '未传' || (row.f_upload_state == '已传' && row.f_state == '未检' && row.f_no_checkplan != '无计划安检' ) ) {
460
- _this.$resetpost(`${_this.$androidUtil.getProxyUrl()}/rs/sql/查询计划项表信息`, {data: {f_userid: row.f_userinfoid}},{resolveMsg: null,rejectMsg: null}).then((response) => {
461
- row['f_plan_meters'] = response.data
462
- var pardate = {
463
- _this:_this,
464
- title:'安全检查',
465
- safe:true
466
- }
467
- _this.$dispatch('gotoson',pardate)
468
- //tag
469
- _this.$goto('safecheck-order-v', {f_plan_id: row.f_plan_id, item: row, role: 'inspect',parentPage:'CurrentCreate'}, 'self', _this.reload)
470
- }).catch ((msg)=>{
471
- this.$showMessage("网络异常,请检查网络后再试!")
472
- })
473
- }else{
474
- this.$showMessage("该安检单已被上传!")
475
- }
476
- }else {
477
- this.$showMessage("该用户安检单已被移除,请联系管理员确认!")
478
- }
479
- })
480
- },
481
- reserve (idx) {
482
- this.param = idx
483
- this.showModal = true
484
- },
485
- search(args) {
222
+ search(args){
223
+ let condition = '1=1'
486
224
  this.model.rows = []
487
- this.model.search(args.condition, args.model)
488
- },
489
- selfSearch () {
490
- this.getPlanCount()
491
- let condition = ""
492
- if (Array.isArray(this.$refs.paged.$refs.cri.model.f_residential_area) && this.$refs.paged.$refs.cri.model.f_residential_area.length >0){
493
- condition += " and ti.f_residential_area = '"+this.$refs.paged.$refs.cri.model.f_residential_area[0]+"'"
494
- }else if(this.$refs.paged.$refs.cri.model.f_residential_area instanceof String && this.$refs.paged.$refs.cri.model.f_residential_area){
495
- condition += " and ti.f_residential_area = '"+this.$refs.paged.$refs.cri.model.f_residential_area+"'"
496
- }
497
- if(this.$refs.paged.$refs.cri.model.f_building)
498
- condition += ` and ti.f_building = '${this.$refs.paged.$refs.cri.model.f_building}'`
499
- if(this.$refs.paged.$refs.cri.model.f_unit)
500
- condition += ` and ti.f_unit = '${this.$refs.paged.$refs.cri.model.f_unit}'`
501
- if (this.planName){
502
- condition += " and f_plan_name like '%"+this.planName +"%'"
503
- }else {
504
- if(this.$refs.paged.$refs.cri.model.f_plan_name)
505
- condition += " and f_plan_name like '%"+this.$refs.paged.$refs.cri.model.f_plan_name +"%'"
506
- }
507
- // if(this.$refs.paged.$refs.cri.model.f_plan_year)
508
- // condition += " and f_plan_year = '"+this.$refs.paged.$refs.cri.model.f_plan_year +"'"
509
- // if(this.$refs.paged.$refs.cri.model.f_plan_month)
510
- // condition += " and f_plan_month = '"+this.$refs.paged.$refs.cri.model.f_plan_month +"'"
511
- if(this.$refs.paged.$refs.cri.model.f_userinfo_code)
512
- condition += " and ti.f_userinfo_code like '%"+this.$refs.paged.$refs.cri.model.f_userinfo_code+"%'"
513
- if(this.$refs.paged.$refs.cri.model.f_keyword)
514
- condition += " and ti.f_address like '%"+this.$refs.paged.$refs.cri.model.f_keyword+"%'"
515
- if(this.$refs.paged.$refs.cri.model.f_user_name)
516
- condition += " and ti.f_user_name like '%"+this.$refs.paged.$refs.cri.model.f_user_name+"%'"
517
- if(this.$refs.paged.$refs.cri.model.f_state[0])
518
- condition += " and ti.f_state='"+this.$refs.paged.$refs.cri.model.f_state[0]+"'"
519
- // if(this.$refs.paged.$refs.cri.model.f_last_state[0])
520
- // condition += " and ti.f_last_check_state='"+this.$refs.paged.$refs.cri.model.f_last_state[0]+"'"
521
- if(this.$refs.paged.$refs.cri.model.f_user_type[0])
522
- condition += " and ti.f_user_type='"+this.$refs.paged.$refs.cri.model.f_user_type[0]+"'"
523
- if(this.$refs.paged.$refs.cri.model.f_meter_no)
524
- condition += " and tm.f_meter_no like '%"+this.$refs.paged.$refs.cri.model.f_meter_no+"%'"
525
- // if(this.$refs.paged.$refs.cri.model.f_flow_direction[0])
526
- // condition += " and tm.f_flow_direction = '"+this.$refs.paged.$refs.cri.model.f_flow_direction[0]+"'"
527
- if(this.$refs.paged.$refs.cri.model.f_user_phone){
528
- condition += `and ti.f_user_phone like '%${this.$refs.paged.$refs.cri.model.f_user_phone}%'`
529
- }
530
- if(this.$refs.paged.$refs.cri.model.f_enter_number)
531
- condition += " and ti.f_enter_number like '%"+this.$refs.paged.$refs.cri.model.f_enter_number+"%'"
532
- if(this.$refs.paged.$refs.cri.model.f_check_version)
533
- condition += " and ti.f_check_version <= "+this.$refs.paged.$refs.cri.model.f_check_version
534
- //tag
535
- this.model.search("((f_complete = '' or f_complete = null or f_complete = '未完成') or (f_state = '未检')) and ti.f_no_checkplan = '有计划安检'" + condition)
536
- },
537
- getNewOrder(){
538
- HostApp.__this__ = this
539
- HostApp.logicWithHint({
540
- // logic别名,key必须为logic
541
- 'logic': 'SafeCheckServiceTimeOut',
542
- // 回调执行方法名,key必须为callback
543
- 'callback': 'javascript:HostApp.__this__.getNewOrderCallBack()',
544
- // logic执行需要的业务参数
545
- 'data': {params: ''},
546
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
547
- // 执行回调方法传入key为backresult
548
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
549
- 'backresult': 1
550
- })
551
- HostApp.logicWithHint({
552
- // logic别名,key必须为logic
553
- 'logic': 'FreshPlanItem',
554
- // 回调执行方法名,key必须为callback
555
- 'callback': 'javascript:HostApp.__this__.getNewOrderCallBack()',
556
- // logic执行需要的业务参数
557
- 'data': {params: ''},
558
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
559
- // 执行回调方法传入key为backresult
560
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
561
- 'backresult': 1
562
- })
563
- },
564
- getNewOrderCallBack() {
565
- this.selfSearch()
566
- this.getAllArea()
567
- this.getAllPlanName()
568
- },
569
- hidden() {
570
- this.criteriaShow = !this.criteriaShow
571
- },
572
- getAllArea(){
573
- this.residentialAreaOptions = []
574
- this.buildOptions = []
575
- this.unitOptions = []
576
- this.$refs.paged.$refs.cri.model.f_residential_area = ''
577
- this.$refs.paged.$refs.cri.model.f_building = ''
578
- this.$refs.paged.$refs.cri.model.f_unit = ''
579
- let criteria = {
580
- items: 'f_residential_area',
581
- tablename: 't_check_plan_item',
582
- condition: `f_residential_area IS NOT NULL AND f_residential_area != '' AND f_state <> '已检'`,
583
- groupitem: 'f_residential_area'
584
- }
585
- let result = HostApp._executeTask({'type':'sql', 'data':{'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}})
586
- //tag)
587
- if(result.code == 200){
588
- result.data.rows.forEach(item => this.residentialAreaOptions.push({label:item.f_residential_area,value:item.f_residential_area}))
589
- }
590
- //tag)
591
- },
592
- getbuilds(f_residential_area){
593
- //tag)
594
- this.buildOptions = []
595
- this.unitOptions = []
596
- this.$refs.paged.$refs.cri.model.f_building = ''
597
- this.$refs.paged.$refs.cri.model.f_unit = ''
598
- if(!f_residential_area){
599
- return
600
- }
601
225
  let criteria = {
602
- items: 'f_building',
603
- tablename: 't_check_plan_item',
604
- condition: `f_building IS NOT NULL AND f_building != '' AND f_state <> '已检' AND f_residential_area = '${f_residential_area}'`,
605
- groupitem: 'f_building order by f_building+0'
226
+ items: `tcp.f_plan_name,tcp.f_issue_time,tcp.f_safecheck_type,COUNT(tcp.id) as jihuazongshu,sum( CASE WHEN tcpi.f_state = '未检' THEN 1 ELSE 0 END ) as weijian,sum( CASE WHEN tcpi.f_state = '已检' THEN 1 ELSE 0 END ) as yijian,sum( CASE WHEN tcpi.f_last_check_state = '到访不遇' THEN 1 ELSE 0 END ) as daofangbuyu`,
227
+ tablename: 't_check_plan tcp LEFT JOIN t_check_plan_item tcpi ON tcp.id = tcpi.f_plan_id',
228
+ condition: args.condition || condition,
229
+ groupitem: 'tcp.f_plan_name,tcp.f_issue_time,tcp.f_safecheck_type'
606
230
  }
607
231
  let result = HostApp._executeTask({'type':'sql', 'data':{'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}})
608
- if(result.code == 200){
609
- result.data.rows.forEach(item => this.buildOptions.push({label:item.f_building,value:item.f_building}))
610
- }
611
- this.buildOptions.sort((a,b)=>{
612
- return Number(a.label)- Number(b.label)
613
- })
614
- //tag)
615
- },
616
- getUnits(f_building){
617
- f_building = f_building[0]
618
- //tag)
619
- this.unitOptions = []
620
- this.$refs.paged.$refs.cri.model.f_unit = ''
621
- if(!f_building){
622
- return
623
- }
624
- let criteria = {
625
- items: 'f_unit',
626
- tablename: 't_check_plan_item',
627
- condition: `f_unit IS NOT NULL AND f_unit != '' AND f_state <> '已检' AND f_residential_area = '${this.$refs.paged.$refs.cri.model.f_residential_area}' AND f_building = '${f_building}'`,
628
- groupitem: 'f_unit'
629
- }
630
- let result = HostApp._executeTask({'type':'sql', 'data':{'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}})
631
- if(result.code == 200){
632
- result.data.rows.forEach(item => this.unitOptions.push({label:item.f_unit,value:item.f_unit}))
633
- }
634
- this.unitOptions.sort((a,b)=>{
635
- return Number(a.label)- Number(b.label)
636
- })
637
- },
638
- getPlanCount(){
639
- this.upcomingCount = 0
640
- this.tempSaveCount = 0
641
- this.doneCount = 0
642
- this.allPlanCount = 0
643
- let criteria = {
644
- items: 'count(id) count',
645
- tablename: 't_check_plan_item',
646
- condition: `f_state = '未检'`,
647
- groupitem: 'f_state'
648
- }
649
- let result = HostApp._executeTask({'type':'sql', 'data':{'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}})
650
- if(result.code && result.code == 200){
651
- if(result.data.rows[0] && !isNaN(result.data.rows[0].count)) {
652
- this.upcomingCount = result.data.rows[0].count
653
- }
654
- }
655
- criteria = {
656
- items: 'count(id) count',
657
- tablename: 't_check_plan_item',
658
- condition: `(f_complete = '' or f_complete is null or f_complete = '未完成') AND f_state = '已检'`,
659
- groupitem: 'f_state'
660
- }
661
- result = HostApp._executeTask({'type':'sql', 'data':{'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}})
662
- if(result.code && result.code == 200){
663
- if(result.data.rows[0] && !isNaN(result.data.rows[0].count)){
664
- this.tempSaveCount = result.data.rows[0].count
665
- }
666
- }
667
- criteria = {
668
- items: 'count(id) count',
669
- tablename: 't_check_plan_item',
670
- condition: `f_complete = '已完成' AND f_state = '已检'`,
671
- groupitem: 'f_state'
672
- }
673
- result = HostApp._executeTask({'type':'sql', 'data':{'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}})
674
- if(result.code && result.code == 200){
675
- if(result.data.rows[0] && !isNaN(result.data.rows[0].count)){
676
- this.doneCount = result.data.rows[0].count
677
- }
678
- }
679
- this.allPlanCount = this.upcomingCount + this.tempSaveCount + this.doneCount
680
-
681
- //tag
682
- //tag
683
- //tag
684
- //tag
232
+ this.model.rows = result.data.rows
685
233
  },
686
234
  getAllPlanName(){
687
- this.planNameOptions = []
688
- this.$refs.paged.$refs.cri.model.f_plan_name = ''
689
235
  let criteria = {
690
236
  items: 'f_plan_name',
691
237
  tablename: 't_check_plan',
@@ -693,11 +239,9 @@ export default {
693
239
  groupitem: 'f_plan_name'
694
240
  }
695
241
  let result = HostApp._executeTask({'type':'sql', 'data':{'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}})
696
- //tag)
697
242
  if(result.code == 200){
698
243
  result.data.rows.forEach(item => this.planNameOptions.push({label:item.f_plan_name,value:item.f_plan_name}))
699
244
  }
700
- //tag)
701
245
  },
702
246
  }
703
247
  }