safecheck-client 4.0.0-66 → 4.0.0-68

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,1192 @@
1
+ <style scoped>
2
+ .bg {
3
+ background-color: blue;
4
+ height: 1px;
5
+ border: 0;
6
+ }
7
+ .app-row {
8
+ background-color: white;
9
+ padding: 10px 10px 0 10px;
10
+ border-bottom: 1px solid rgba(235, 235, 235, 0.5);
11
+ }
12
+ .search_input {
13
+ border: 0;
14
+ outline: none;
15
+ }
16
+ .font{
17
+ font: 15px PingFang-SC-Medium;
18
+ color: #666666;
19
+ }
20
+ .input-font{
21
+ font: 15px PingFang-SC-Medium;
22
+ color: #333333;
23
+ }
24
+ .btn-font{
25
+ font:600 16px PingFang-SC-Bold;
26
+ color: #499EDF;
27
+ }
28
+ .btn-color{
29
+ background-color: #FFFFFF;
30
+ border-radius: 10px ;
31
+ border: 1px solid #499EDF;
32
+ }
33
+ .app-text {
34
+ font-size: 12px;
35
+ }
36
+ .panel-self{
37
+ border-radius: 10px;
38
+ border:1px solid #499EDF;
39
+ background-color: #F8F8F8;
40
+ }
41
+ .yybtn-color{
42
+ background-color:#499edf;
43
+ border-radius: 4px ;
44
+ border: 1px solid #499EDF;
45
+ color: #FFFFFF;
46
+ font: 14px PingFang-SC-Bold;
47
+ }
48
+ .qxbtn-color{
49
+ background-color: #FFFFFF;
50
+ border-radius: 4px ;
51
+ color: #499edf;
52
+ font: 14px PingFang-SC-Bold;
53
+ border: 1px solid #499EDF;
54
+ }
55
+
56
+ .button_shrink_top {width: 35px; height: 35px; background-size:100%;background-image: url("../../../../static/newStyle/stretch_top.png")}
57
+ .button_shrink_bottom {width: 35px; height: 35px; background-size:100%;background-image: url("../../../../static/newStyle/stretch_bottom.png")}
58
+ .button_shrink_left {width: 35px; height: 35px; background-size:100%;background-image: url("../../../../static/newStyle/stretch_left.png")}
59
+ .button_shrink_right {width: 35px; height: 35px; background-size:100%;background-image: url("../../../../static/newStyle/stretch_right.png")}
60
+ .stats-bar {
61
+ display: flex;
62
+ justify-content: space-between;
63
+ align-items: center;
64
+ background: #fff;
65
+ border-radius: 10px;
66
+ box-shadow: 0 2px 8px rgba(0,0,0,0.03);
67
+ padding: 16px 8px;
68
+ margin: 12px 0 20px 0;
69
+ }
70
+ .stats-item {
71
+ flex: 1;
72
+ text-align: center;
73
+ }
74
+ .stats-item .stats-value {
75
+ font-size: 22px;
76
+ font-weight: bold;
77
+ margin-bottom: 2px;
78
+ display: block;
79
+ }
80
+ .stats-item .stats-label {
81
+ font-size: 13px;
82
+ color: #888;
83
+ }
84
+ .stats-value.blue { color: #499EDF; }
85
+ .stats-value.green { color: #4CAF50; }
86
+ .stats-value.red { color: #F44336; }
87
+ .stats-value.orange { color: #FF9800; }
88
+ </style>
89
+ <style>
90
+ .clear-select-with .dropdown-menu{
91
+ left: 0px !important;
92
+ width: 200% !important;
93
+ }
94
+ </style>
95
+ <template>
96
+ <div style="height: auto;width: 100%">
97
+ <criteria-paged :model="model" v-ref:paged>
98
+ <criteria partial='criteria' @condition-changed='search' v-ref:cri>
99
+ <div partial>
100
+ <form>
101
+ <div class="row app-row">
102
+ <!--小区名称-->
103
+ <v-select :value.sync="model.f_residential_area"
104
+ class="input-font clear-select-with"
105
+ :options='$parent.$parent.residentialAreaOptions'
106
+ placeholder='小区名称'
107
+ :width="'32.5%'"
108
+ v-model="model.f_residential_area"
109
+ condition="ti.f_residential_area = '{}'"
110
+ @change="$parent.$parent.getbuilds"
111
+ close-on-select clear-button>
112
+ </v-select>
113
+ <!--楼栋-->
114
+ <v-select :value.sync="model.f_building"
115
+ class="input-font"
116
+ :options='$parent.$parent.buildOptions'
117
+ placeholder='楼栋'
118
+ :width="'32.5%'"
119
+ v-model="model.f_building"
120
+ condition="ti.f_building = '{}'"
121
+ @change="$parent.$parent.getUnits"
122
+ close-on-select clear-button>
123
+ </v-select>
124
+ <!--单元-->
125
+ <v-select :value.sync="model.f_unit"
126
+ class="input-font"
127
+ :options='$parent.$parent.unitOptions'
128
+ placeholder='单元'
129
+ :width="'32.5%'"
130
+ v-model="model.f_unit"
131
+ condition="ti.f_unit = '{}'"
132
+ close-on-select clear-button>
133
+ </v-select>
134
+ </div>
135
+ <div class="row app-row">
136
+ <div class="col-xs-4">
137
+ <img src="../../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
138
+ <label for="f_userinfo_code" class="font text-left">用户编号:</label>
139
+ </div>
140
+ <div class="col-xs-8" >
141
+ <input id="f_userinfo_code" class="search_input input-font"
142
+ v-model=model.f_userinfo_code condition="f_userinfo_code like '%{}%'" />
143
+ </div>
144
+ </div>
145
+ <div class="row app-row">
146
+ <div class="col-xs-4">
147
+ <img src="../../../assets/用户姓名.png" style="width: 20px;margin-bottom: 5px" alt="">
148
+ <label class="font text-left">用户姓名:</label>
149
+ </div>
150
+ <div class="col-xs-8" >
151
+ <input class="search_input input-font" v-model=model.f_user_name condition="f_user_name like '%{}%'" />
152
+ </div>
153
+ </div>
154
+
155
+ <div class="row app-row">
156
+ <div class="col-xs-4">
157
+ <img src="../../../assets/安检状态.png" style="width: 20px;margin-bottom: 5px" alt="">
158
+ <label class="font text-left">用户证号:</label>
159
+ </div>
160
+ <div class="col-xs-8" >
161
+ <input class="search_input input-font" v-model=model.f_enter_number condition="f_enter_number like '%{}%'" />
162
+ </div>
163
+ </div>
164
+
165
+ <div class="row app-row" v-if="$parent.$parent.criteriaShow && !$parent.$parent.planName">
166
+ <div class="col-xs-4">
167
+ <img src="../../../assets/安检状态.png" style="width: 20px;margin-bottom: 5px" alt="">
168
+ <label for="f_plan_name" class="font text-left">计划名称:</label>
169
+ </div>
170
+ <v-select
171
+ id="f_plan_name"
172
+ :value.sync="model.f_plan_name"
173
+ class="input-font"
174
+ :options='$parent.$parent.planNameOptions'
175
+ placeholder='计划名称'
176
+ :width="'60%'"
177
+ v-model="model.f_plan_name"
178
+ condition="f_plan_name like '%{}%'"
179
+ close-on-select clear-button>
180
+ </v-select>
181
+ </div>
182
+
183
+ <div class="row app-row" v-if="$parent.$parent.criteriaShow">
184
+ <div class="col-xs-4">
185
+ <img src="../../../assets/是否已检.png" style="width: 20px;margin-bottom: 5px" alt="">
186
+ <label for="f_state" class="font text-left">是否已检:</label>
187
+ </div>
188
+ <v-select id="f_state"
189
+ :value.sync="model.f_state"
190
+ class="input-font"
191
+ :options='$parent.$parent.check_states'
192
+ placeholder='是否已检'
193
+ :width="'60%'"
194
+ v-model="model.f_state"
195
+ condition="f_state='{}'"
196
+ close-on-select clear-button>
197
+ </v-select>
198
+ </div>
199
+ <div class="row app-row" v-if="$parent.$parent.criteriaShow">
200
+ <div class="col-xs-4">
201
+ <img src="../../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
202
+ <label class="font text-left">表&emsp;&emsp;号:</label>
203
+ </div>
204
+ <div class="col-xs-5" >
205
+ <input class="search_input input-font"
206
+ v-model=model.f_meter_no condition="f_meter_no like '%{}%'" />
207
+ </div>
208
+ <div class="col-xs-3">
209
+ <button type="button" class="btn btn-lg btn-font btn-color" @click="$parent.$parent.scan()">扫码</button>
210
+ </div>
211
+ </div>
212
+ <div class="row app-row" v-if="$parent.$parent.criteriaShow">
213
+ <div class="col-xs-4">
214
+ <img src="../../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">
215
+ <label class="font text-left">客户电话:</label>
216
+ </div>
217
+ <div class="col-xs-8" >
218
+ <input class="search_input input-font"
219
+ v-model=model.f_user_phone condition="f_user_phone like '%{}%'" />
220
+ </div>
221
+ </div>
222
+
223
+ <div class="row app-row" v-if="$parent.$parent.criteriaShow">
224
+ <div class="col-xs-4">
225
+ <img src="../../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">
226
+ <label class="font text-left">用户地址:</label>
227
+ </div>
228
+ <div class="col-xs-8" >
229
+ <input class="search_input input-font"
230
+ v-model=model.f_keyword condition="f_address like '%{}%'" />
231
+ </div>
232
+ </div>
233
+ <div class="row app-row" v-if="$parent.$parent.criteriaShow">
234
+ <div class="col-xs-4">
235
+ <img src="../../../assets/用户类型.png" style="width: 20px;margin-bottom: 5px" alt="">
236
+ <label for="f_user_type" class="font text-left">用户类型:</label>
237
+ </div>
238
+ <v-select id="f_user_type" :value.sync="model.f_user_type" class="input-font"
239
+ :width="'60%'"
240
+ :options='$parent.$parent.user_types' placeholder='请选择用户类型'
241
+ v-model="model.f_user_type" condition="f_user_type='{}'" close-on-select clear-button></v-select>
242
+ </div>
243
+ <div class="row app-row" v-if="$parent.$parent.criteriaShow">
244
+ <div class="col-xs-6">
245
+ <img src="../../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
246
+ <label class="font text-left">到访不遇:</label>
247
+ </div>
248
+ <div class="col-xs-8" >
249
+ <input class="search_input input-font" type="number"
250
+ v-model=model.f_check_version condition="f_check_version <= '{}'" />
251
+ </div>
252
+ </div>
253
+ <div class="row app-row" v-if="$parent.$parent.criteriaShow">
254
+ <div class="col-xs-6" style="text-align: center">
255
+ <span class="font text-left">待办{{$parent.$parent.upcomingCount}}条</span>
256
+ </div>
257
+ <div class="col-xs-6" style="text-align: center">
258
+ <span class="font text-left">已办{{$parent.$parent.doneCount}}条</span>
259
+ </div>
260
+ <div class="col-xs-6" style="text-align: center">
261
+ <span class="font text-left">临时保存{{$parent.$parent.tempSaveCount}}条</span>
262
+ </div>
263
+ <div class="col-xs-6" style="text-align: center">
264
+ <span class="font text-left">总共{{$parent.$parent.allPlanCount}}条</span>
265
+ </div>
266
+ </div>
267
+
268
+ <div class="row text-center" style="margin-top: 20px;">
269
+ <button type="button" class="btn btn-lg btn-font btn-color" style="width: 25%;" @click="$parent.$parent.selfSearch">查询</button>
270
+ <button type="button" class="btn btn-lg btn-font btn-color" style="width: 25%; margin-left: 10px" @click="$parent.$parent.queryplanmany">转发</button>
271
+ <div style="float: right;margin-right: 3% " class="button_spacing" :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}" @click="$parent.$parent.hidden()"></div>
272
+ <img v-if="!$parent.$parent.planName" style="float: right;margin-right: 3%;width: 40px;padding: 5px;" @click="$parent.$parent.getNewOrder" src="../../../assets/shuaxindaiban1.png">
273
+ </div>
274
+ <div class="col-sm-12">
275
+ <!-- 统计区域开始 -->
276
+ <div class="stats-bar">
277
+ <div class="stats-item">
278
+ <span class="stats-value blue">{{ $parent.$parent.planTotal }}</span>
279
+ <span class="stats-label">计划总数</span>
280
+ </div>
281
+ <div class="stats-item">
282
+ <span class="stats-value orange">{{ $parent.$parent.notVisited }}</span>
283
+ <span class="stats-label">到访不遇</span>
284
+ </div>
285
+ <div class="stats-item">
286
+ <span class="stats-value green">{{ $parent.$parent.checked }}</span>
287
+ <span class="stats-label">已检数</span>
288
+ </div>
289
+ <div class="stats-item">
290
+ <span class="stats-value red">{{ $parent.$parent.notChecked }}</span>
291
+ <span class="stats-label">未检数</span>
292
+ </div>
293
+ <div class="stats-item">
294
+ <span class="stats-value blue">{{ $parent.$parent.enterRate }}%</span>
295
+ <span class="stats-label">入户率</span>
296
+ </div>
297
+ </div>
298
+ <!-- 统计区域结束 -->
299
+ </div>
300
+ <!--<div class="row app-btn">-->
301
+ <!--<button class="btn btn-primary col-xs-6" type="button" @click="search"><span class="glyphicon glyphicon-search" style="margin-right: 20px;">查询</span></button>-->
302
+ <!--</div>-->
303
+ <div style="height:30px;"></div>
304
+ </form>
305
+ </div>
306
+ </criteria>
307
+ <list :model="model" partial='list'>
308
+ <div partial>
309
+ <div class="auto app-text" style="margin-top: 5px;">
310
+ <div class="panel" style="padding: 10px 10px 5px 10px;">
311
+ <div class="panel-body panel-self">
312
+
313
+ <div class="col-xs-12">
314
+ <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>用户编号:</b></p>
315
+ <p class="panel-title col-xs-5 text-left input-font" style="width: 74%">{{ row.f_userinfo_code }}</p>
316
+ <p class="panel-title col-xs-2 text-left input-font" style="width: 5%;float:right">
317
+ <input type="checkbox" @click="$parent.$parent.$parent.setPlanParam(row.id, $event)"/>
318
+ </p>
319
+ </div>
320
+ <div class="col-xs-12">
321
+ <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>用户名称:</b></p>
322
+ <p class="panel-title col-xs-7 text-left input-font" style="width: 79%">{{ row.f_user_name }}</p>
323
+ </div>
324
+ <div class="col-xs-6">
325
+ <p class="panel-title col-xs-5 text-left font"><b>用户类型:</b></p>
326
+ <p class="panel-title col-xs-7 text-left input-font">{{ row.f_user_type }}
327
+ </p>
328
+ </div>
329
+ <div class="col-xs-6">
330
+ <p class="panel-title col-xs-5 text-left font"><b>计划名称:</b></p>
331
+ <p class="panel-title col-xs-7 text-left input-font">{{ row.f_plan_name }}</p>
332
+ </div>
333
+ <!-- <div class="col-xs-6">-->
334
+ <!-- <p class="panel-title col-xs-5 text-left font"><b>小区名称:</b></p>-->
335
+ <!-- <p class="panel-title col-xs-7 text-left input-font">{{ row.f_residential_area }}</p>-->
336
+ <!-- </div>-->
337
+ <div class="col-xs-12">
338
+ <p class="panel-title text-left font" style="width: 23%;float: left"><b>用户电话:</b></p>
339
+ <p class="panel-title text-left input-font" style="width: 77%">{{ row.f_user_phone }}
340
+ <img src="../../../assets/phone.png" style="width: 6%"
341
+ v-on:click.stop.prevent='$parent.$parent.$parent.makeAPhoneCall(row.f_user_phone)'/>
342
+ </p>
343
+ </div>
344
+ <div class="col-xs-12">
345
+ <p class="panel-title text-left font" style="width: 23%;float: left"><b>备用电话:</b></p>
346
+ <p class="panel-title text-left input-font" style="width: 77%">{{ row.f_rent_phone}}
347
+ <img v-if="row.f_rent_phone" src="../../../assets/phone.png" style="width: 6%"
348
+ v-on:click.stop.prevent='$parent.$parent.$parent.makeAPhoneCall(row.f_rent_phone)'/>
349
+ </p>
350
+ </div>
351
+ <div class="col-xs-12">
352
+ <p class="panel-title text-left font" style="width: 23%;float: left"><b>租户电话:</b></p>
353
+ <p class="panel-title text-left input-font" style="width: 77%">{{ row.f_zuhu_phone }}
354
+ <img v-if="row.f_zuhu_phone" src="../../../assets/phone.png" style="width: 6%"
355
+ v-on:click.stop.prevent='$parent.$parent.$parent.makeAPhoneCall(row.f_zuhu_phone)'/>
356
+ </p>
357
+ </div>
358
+
359
+ <div class="col-xs-12">
360
+ <p class="panel-title text-left font" style="width: 21%;float: left"><b>用户地址:</b></p>
361
+ <p class="panel-title text-left input-font" style="width: 79%">{{ row.f_address }}</p>
362
+ </div>
363
+
364
+ <!-- <div class="row">-->
365
+ <!-- <p class="panel-title col-xs-4 text-left font">计划年份</p>-->
366
+ <!-- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_plan_year }}</p>-->
367
+ <!-- </div>-->
368
+ <!-- <div class="row">-->
369
+ <!-- <p class="panel-title col-xs-4 text-left font">计划月份</p>-->
370
+ <!-- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_plan_month }}</p>-->
371
+ <!-- </div>-->
372
+ <!-- <div class="row">-->
373
+ <!-- <p class="panel-title col-xs-4 text-left font">预约时间</p>-->
374
+ <!-- <p class="panel-title col-xs-8 text-left input-font">{{ row.f_prearranged_date }}</p>-->
375
+ <!-- </div>-->
376
+ <!--<div class="row">-->
377
+ <!--<p class="panel-title col-xs-4 text-left font">上次安检状态</p>-->
378
+ <!--<p class="panel-title col-xs-8 text-left input-font">{{ row.f_last_check_state }}</p>-->
379
+ <!--</div>-->
380
+ <div class="col-xs-6">
381
+ <p class="panel-title col-xs-5 text-left font"><b>安检状态:</b></p>
382
+ <p class="panel-title col-xs-7 text-left input-font">{{ row.f_state == '已检'?'临时保存':row.f_state }}</p>
383
+ </div>
384
+ <div class="col-xs-6">
385
+ <p class="panel-title col-xs-5 text-left font"><b>上传状态:</b></p>
386
+ <p class="panel-title col-xs-7 text-left input-font">{{ row.f_upload_state }}</p>
387
+ </div>
388
+ <div class="col-xs-12" v-if="row.f_prearranged_date !=null">
389
+ <p class="panel-title col-xs-5 text-left font" style="width: 21%;float: left"><b>预约时间:</b></p>
390
+ <p class="panel-title col-xs-7 text-left input-font" style="width: 79%">{{ row.f_prearranged_date }}</p>
391
+ </div>
392
+ <div class="col-xs-6">
393
+ <p class="panel-title col-xs-5 text-left font"><b>安检类型:</b></p>
394
+ <p class="panel-title col-xs-7 text-left input-font">{{ row.f_safecheck_type }}</p>
395
+ </div>
396
+ <div class="col-xs-12">
397
+ <p class="panel-title col-xs-5 text-left font"><b>到访不遇次数:</b></p>
398
+ <p class="panel-title col-xs-7 text-left input-font">{{ row.f_check_version }}</p>
399
+ </div>
400
+ <!--<div class="col-xs-12">-->
401
+ <!--<p class="panel-title col-xs-5 text-left font"><b>送气期限:</b></p>-->
402
+ <!--<p class="panel-title col-xs-7 text-left input-font">{{timeSet(row.f_issue_time)}}</p>-->
403
+ <!--</div>-->
404
+ <div class="col-xs-12">
405
+ <button type="button" name="button" class="btn btn-primary" style="background-color:#499edf;float: right" @click="$parent.$parent.$parent.inspect(row)">处理</button>
406
+ <button type="button" name="button" class="btn btn-primary" style="background-color:#499edf;float: right;margin-right:10px;" @click="$parent.$parent.$parent.queryplan(row.id)">转发</button>
407
+ <!--<button type="button" class="btn btn-default" @click="$parent.$parent.$parent.ceshi">确认2</button>-->
408
+ </div>
409
+ <!-- <div class="row text-right" v-show="row.f_upload_state != '已传'" >-->
410
+ <!-- <button type="button" class="btn yybtn-color" v-on:click.stop.prevent='$parent.$parent.$parent.reserve($index)'>预约</button>&nbsp;-->
411
+ <!-- <button type="button" class="btn qxbtn-color" v-if ='row.f_prearranged_date'-->
412
+ <!-- v-on:click.stop.prevent='$parent.$parent.$parent.cancelReserve($index, row.id)'>取消预约</button>-->
413
+ <!-- </div>-->
414
+ </div>
415
+ </div>
416
+ </div>
417
+ </div>
418
+ </list>
419
+ </criteria-paged>
420
+ <modal :show.sync="showModal">
421
+ <div slot="modal-header" class="modal-header">
422
+ <h4 class="modal-title">
423
+ 选择预约时间
424
+ </h4>
425
+ </div>
426
+ <div slot="modal-body" class="modal-body">
427
+ <input type="datetime-local" v-model="f_preset_dt">
428
+ </div>
429
+ <div slot="modal-footer" class="modal-footer">
430
+ <button type="button" class="btn btn-default" @click="genuineReserve">确认</button>
431
+ </div>
432
+ </modal>
433
+ <!--<back-page :need-back='true' @flag="$back()"></back-page>-->
434
+ <modal :show.sync="showModal2" v-ref:modal>
435
+ <div slot="modal-header" class="modal-header">
436
+ <h4 class="modal-title">
437
+ 选择计划
438
+ </h4>
439
+ </div>
440
+ <div slot="modal-body" class="modal-body">
441
+ <div class="col-xs-12">
442
+
443
+ <div class="col-xs-4">
444
+ <v-select :value.sync="check" v-model='check'
445
+ :value-single="true"
446
+ class="select_list select"
447
+ :options='checkers' placeholder='安检员'
448
+ close-on-select width="100%"></v-select>
449
+ </div>
450
+
451
+ <div class="col-xs-1">
452
+ <!--<label style="font-size:20px;line-height: 35px">人员 </label>-->
453
+ </div>
454
+ <div class="col-xs-4" style="padding-left: 2px">
455
+ <input class="select-style" placeholder="计划名称" type="text" v-model="plan" style="border: 1px solid #93B2D3;height:34px;width: 100%;line-height: 35px"/>
456
+ </div>
457
+ <div class="col-xs-1" >
458
+ <!--<label style="font-size: 20px;line-height: 35px">计划</label>-->
459
+ </div>
460
+ <!--<input placeholder="安检员" type="text" v-model="check" style="height:30px;width: 100px"/>-->
461
+ <div class="col-xs-2" style="float: right">
462
+ <button type="button" class="btn btn-primary" @click="plansearch" style="background-color:#499edf;float: right;margin-right:10px;border: 1px solid #93B2D3;height:34px;width: 100%;line-height: 1px;padding-left: 12px">查询</button>
463
+ </div>
464
+ </div>
465
+ <table class="table table_sy">
466
+ <thead>
467
+ <tr>
468
+ <th style="width: 30px"></th>
469
+ <th style="font-family: 'Adobe 黑体 Std R'">计划名称</th>
470
+ </tr>
471
+ </thead>
472
+ <tbody>
473
+ <tr v-for="row in planoption">
474
+ <td @click="select(row, $index)" >{{row.selected==true ? '☆' : '&nbsp;&nbsp;&nbsp;&nbsp;'}}</td>
475
+ <td @click="select(row, $index)" style="text-align: center">{{row.label}}</td>
476
+
477
+
478
+ </tr>
479
+ </tbody>
480
+ </table>
481
+ </div>
482
+ <div slot="modal-footer" class="modal-footer">
483
+ <button class="btn btn-default" @click="isok()">确认</button>
484
+ <button class="btn btn-default" @click="iscancel()">取消</button>
485
+ </div>
486
+ </modal>
487
+ <modal :show.sync="showModal3" v-ref:modal>
488
+ <div slot="modal-header" class="modal-header">
489
+ <h4 class="modal-title">
490
+ 选择计划
491
+ </h4>
492
+ </div>
493
+ <div slot="modal-body" class="modal-body">
494
+ <div class="col-xs-12">
495
+
496
+ <div class="col-xs-4">
497
+ <v-select :value.sync="check" v-model='check'
498
+ :value-single="true"
499
+ class="select_list select"
500
+ :options='checkers' placeholder='安检员'
501
+ close-on-select width="100%"></v-select>
502
+ </div>
503
+
504
+ <div class="col-xs-1">
505
+ <!--<label style="font-size:20px;line-height: 35px">人员 </label>-->
506
+ </div>
507
+ <div class="col-xs-4" style="padding-left: 2px">
508
+ <input class="select-style" placeholder="计划名称" type="text" v-model="plan" style="border: 1px solid #93B2D3;height:34px;width: 100%;line-height: 35px"/>
509
+ </div>
510
+ <div class="col-xs-1" >
511
+ <!--<label style="font-size: 20px;line-height: 35px">计划</label>-->
512
+ </div>
513
+ <!--<input placeholder="安检员" type="text" v-model="check" style="height:30px;width: 100px"/>-->
514
+ <div class="col-xs-2" style="float: right">
515
+ <button type="button" class="btn btn-primary" @click="plansearch" style="background-color:#499edf;float: right;margin-right:10px;border: 1px solid #93B2D3;height:34px;width: 100%;line-height: 1px;padding-left: 12px">查询</button>
516
+ </div>
517
+ </div>
518
+ <table class="table table_sy">
519
+ <thead>
520
+ <tr>
521
+ <th style="width: 30px"></th>
522
+ <th style="font-family: 'Adobe 黑体 Std R'">计划名称</th>
523
+ </tr>
524
+ </thead>
525
+ <tbody>
526
+ <tr v-for="row in planoption">
527
+ <td @click="select(row, $index)" >{{row.selected==true ? '☆' : '&nbsp;&nbsp;&nbsp;&nbsp;'}}</td>
528
+ <td @click="select(row, $index)" style="text-align: center">{{row.label}}</td>
529
+
530
+
531
+ </tr>
532
+ </tbody>
533
+ </table>
534
+ </div>
535
+ <div slot="modal-footer" class="modal-footer">
536
+ <button class="btn btn-default" @click="manyisok()">确认</button>
537
+ <button class="btn btn-default" @click="iscancel()">取消</button>
538
+ </div>
539
+ </modal>
540
+ </div>
541
+
542
+ </template>
543
+
544
+ <script>
545
+ import LocalPagedList from '../../../plugins/LocalPagedList'
546
+ import Vue from 'vue'
547
+ import { PagedList,HttpResetClass } from 'vue-client'
548
+ import * as Util from '../../../components/Util'
549
+ import co from 'co'
550
+ let select = function * (self) {
551
+ let http = new HttpResetClass()
552
+ http.load('POST', `${self.$androidUtil.getProxyUrl()}/rs/search`, {
553
+ source: 'this.getSpecialResByType($user$).where(row.getAttributes().get($rolestr$)!=null ).where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1)',
554
+ userid: Vue.user.orgid
555
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
556
+ //tag
557
+ self.checkers.push({label: '全部', value: ''})
558
+ res.data.forEach((checker) => {
559
+ self.checkers.push({label: checker.name, value: checker.id})
560
+ })
561
+ })
562
+ }
563
+ export default {
564
+ title: '无计划安检查询',
565
+ props: ['planName'],
566
+ data() {
567
+ return {
568
+ f_filialeids: '(' + Vue.user.orgid + ')',
569
+ //f_filialeids:'(305)',
570
+ planparam: [],
571
+ check: '',
572
+ plan: '',
573
+ planid: '',
574
+ model: Vue.android ? new LocalPagedList('androidGetuserinfo', 20, {condition: 'this.condition'}) : new PagedList('AndroidRest/api/af-safecheck/sql/androidGetuserinfo', 20, {condition: 'this.condition'}),
575
+ showModal: false,
576
+ showModal2: false,
577
+ showModal3: false,
578
+ needid: '',
579
+ criteriaShow: false,
580
+ planoption: [],
581
+ condition: '',
582
+ checkers: [],
583
+ param: null,
584
+ f_preset_dt: Util.to3339TimeString(),
585
+ flow_direction: [
586
+ {label: '请选择挂表方式', value: ''},
587
+ {label: '左表', value: '左表'},
588
+ {label: '右表', value: '右表'}
589
+ ],
590
+ check_states: [
591
+ {label: '请选择安检状态', value: ''},
592
+ {label: '未检', value: '未检'},
593
+ {label: '临时保存', value: '已检'},
594
+ ],
595
+ last_check_states: [
596
+ {label: '请选择上次安检状态', value: ''},
597
+ {label: '入户', value: '入户'},
598
+ {label: '拒检', value: '拒检'},
599
+ {label: '到访不遇', value: '到访不遇'},
600
+ {label: '未使用天然气', value: '未使用天然气'}
601
+ ],
602
+ upload_states: [
603
+ {label: '请选择上传状态', value: ''},
604
+ {label: '未传', value: '未传'},
605
+ {label: '已传', value: '已传'}
606
+ ],
607
+ user_types: [
608
+ {label: '请选择用户类型', value: ''},
609
+ {label: '民用', value: '民用'},
610
+ {label: '非民用', value: '非民用'},
611
+ ],
612
+ verify_state: [
613
+ {label: '请选择审核状态', value: ''},
614
+ {label: '未审核', value: '未审核'},
615
+ {label: '打回', value: '打回'}
616
+ ],
617
+ residentialAreaOptions: [],
618
+ buildOptions: [],
619
+ unitOptions: [],
620
+ planNameOptions: [],
621
+ upcomingCount: 0,
622
+ doneCount: 0,
623
+ tempSaveCount: 0,
624
+ allPlanCount: 0,
625
+ planTotal: 0,
626
+ notVisited: 0,
627
+ checked: 0,
628
+ notChecked: 0,
629
+ enterRate: 0
630
+ }
631
+ },
632
+ ready() {
633
+ this.getAllArea()
634
+ this.getAllPlanName()
635
+ this.selfSearch()
636
+ let gen = select(this)
637
+ co(gen)
638
+ },
639
+ mounted() {
640
+ //tag
641
+ if (window.history && window.history.pushState) {
642
+ history.pushState(null, null, document.URL);
643
+ window.addEventListener('popstate', this.fun, false);//false阻止默认事件
644
+ }
645
+ },
646
+ destroyed() {
647
+ //tag
648
+ window.removeEventListener('popstate', this.fun, false);//false阻止默认事件
649
+ },
650
+ methods: {
651
+ scan() {
652
+ HostApp.__this__ = this,
653
+ HostApp.scanCode({callback: "javascript:HostApp.__this__.getCode();"})
654
+ },
655
+ getCode() {
656
+ const datapa = HostApp.getCode().data;
657
+ //tag
658
+ this.$refs.paged.$refs.cri.model.f_meter_no = datapa
659
+
660
+ },
661
+ fun() {
662
+ //tag
663
+ //tag
664
+ },
665
+ iscancel() {
666
+ this.showModal2 = false
667
+ this.showModal3 = false
668
+ this.planoption = []
669
+ },
670
+ timeSet(val) {
671
+ return val
672
+ },
673
+ async isok() {
674
+ if (this.planoption.length == 0) {
675
+ this.$showMessage("请选择计划")
676
+ return false
677
+ }
678
+ for (let i = 0; i < this.planoption.length; i++) {
679
+ if (this.planoption[i]["selected"] == true) {
680
+ this.planid = this.planoption[i].value
681
+ break
682
+ }
683
+ }
684
+ if (this.planid == '') {
685
+ this.$showMessage("请选择计划")
686
+ return false
687
+ }
688
+ await this.okput()
689
+ },
690
+ async manyisok() {
691
+ if (this.planoption.length == 0) {
692
+ this.$showMessage("请选择计划")
693
+ return false
694
+ }
695
+ for (let i = 0; i < this.planoption.length; i++) {
696
+ if (this.planoption[i]["selected"] == true) {
697
+ this.planid = this.planoption[i].value
698
+ break
699
+ }
700
+ }
701
+ if (this.planid == '') {
702
+ this.$showMessage("请选择计划")
703
+ return false
704
+ }
705
+ await this.manyokput()
706
+ },
707
+ changenull() {
708
+ this.showModal2 = false
709
+ this.showModal3 = false
710
+ this.planoption = []
711
+ this.plan = ''
712
+ this.check = ''
713
+ },
714
+ async okput() {
715
+ let result = this.$androidUtil.bzLogic('UpCheckPlanItemAndroid', {
716
+ condition: `id='` + this.needid + `'`,
717
+ f_plan_id: this.planid
718
+ })
719
+ if (result.code == 200) {
720
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-safecheck/logic/UpCheckPlanItem`, {
721
+ data: {
722
+ condition: `i.id='` + this.needid + `'`,
723
+ f_plan_id: this.planid,
724
+ switchCheckAll: false,
725
+ checkAll: false,
726
+ f_operator: Vue.user.name
727
+ }
728
+ })
729
+ await this.changenull()
730
+ }
731
+ },
732
+ async manyokput() {
733
+ let condition = `1=1`
734
+ let criteria = {
735
+ items: 'id',
736
+ tablename: 't_check_plan',
737
+ condition: `f_checker_id = '${Vue.user.id}'`,
738
+ groupitem: 'id'
739
+ }
740
+ let result = HostApp._executeTask({
741
+ 'type': 'sql',
742
+ 'data': {'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}
743
+ })
744
+ if (result.code == 200) {
745
+ condition = `1=1 and i.f_plan_id in (${result.data.rows.map(row => {
746
+ return `'${row.id}'`
747
+ }).join()})`
748
+ }
749
+ let result2 = this.$androidUtil.bzLogic('UpCheckPlanItemAndroid', {
750
+ condition: `f_plan_id in (${result.data.rows.map(row => {
751
+ return `'${row.id}'`
752
+ }).join()})`, f_plan_id: this.planid
753
+ })
754
+ if (result2.code == 200) {
755
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-safecheck/logic/UpCheckPlanItem`, {
756
+ data: {
757
+ columnName: "i.id",
758
+ condition: condition,
759
+ f_plan_id: this.planid,
760
+ switchCheckAll: true,
761
+ param: this.planparam,
762
+ checkAll: true,
763
+ f_operator: Vue.user.name
764
+ }
765
+ })
766
+ await this.changenull()
767
+ }
768
+ },
769
+ async plansearch() {
770
+ this.planoption = []
771
+ let condition = ` f_plan_year=${new Date().getFullYear()}`
772
+ if (this.check) {
773
+ condition += ` and f_checker_id= '${this.check}'`
774
+ }
775
+ if (this.plan) {
776
+ condition += ` and f_plan_name like '%${this.plan}%'`
777
+ }
778
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/预约计划下发`, {
779
+ data: {
780
+ condition: condition,
781
+ f_filialeids: this.f_filialeids,
782
+ groupitem: '',
783
+ orderitem: 'id'
784
+ }
785
+ })
786
+ let resoult = res.data
787
+ for (let i = 0; i < resoult.length; i++) {
788
+ this.planoption.push({label: resoult[i].f_plan_name, selected: false, value: resoult[i].id})
789
+ }
790
+ },
791
+
792
+ select(row, idx) {
793
+ this.$set('planoption[' + idx + '].selected', true)
794
+ for (let i = 0; i < this.planoption.length; i++) {
795
+ if (i != idx) {
796
+ this.planoption[i]["selected"] = false
797
+ }
798
+ }
799
+ },
800
+ planclose() {
801
+ this.showModal2 = false
802
+ this.showModal3 = false
803
+ },
804
+ queryplan(val) {
805
+ this.needid = val
806
+ this.showModal2 = true
807
+ },
808
+ queryplanmany() {
809
+
810
+ this.showModal3 = true
811
+ },
812
+ reload() {
813
+ // this.getAllArea()
814
+ // this.getAllPlanName()
815
+ this.selfSearch()
816
+ },
817
+ cancelReserve(idx, id) {
818
+ if (Vue.android) {
819
+ let res = this.$androidUtil.bzLogic('BookingCheck', {dt: '', id: id})
820
+ this.$set('model.rows[' + idx + '].f_prearranged_date', null)
821
+ if (res.code == 200) {
822
+ this.$showMessage("取消预约成功")
823
+ }
824
+ } else {
825
+ this.$androidUtil.bzLogic('PCbookingCheck', {dt: '', id: id}).then((repanse) => {
826
+ this.$set('model.rows[' + idx + '].f_prearranged_date', null)
827
+ if (repanse.data.code == 200) {
828
+ alert("取消预约成功!")
829
+ }
830
+ })
831
+ }
832
+ },
833
+ genuineReserve() {
834
+ if (Vue.android) {
835
+ if (!this.f_preset_dt) {
836
+ this.$showMessage('请选择一个日期')
837
+ return
838
+ }
839
+ let pdt = this.f_preset_dt.replace('T', ' ')
840
+ let respanse = this.$androidUtil.bzLogic('BookingCheck', {id: this.model.rows[this.param].id, dt: pdt})
841
+ this.$set('model.rows[' + this.param + '].f_prearranged_date', pdt)
842
+ if (respanse.code == 200) {
843
+ this.$showMessage("预约成功!")
844
+ }
845
+ this.showModal = false
846
+ } else {
847
+ if (!this.f_preset_dt) {
848
+ alert('请选择一个日期')
849
+ return
850
+ }
851
+ let pdt = this.f_preset_dt.replace('T', ' ')
852
+ this.$androidUtil.bzLogic('PCbookingCheck', {id: this.model.rows[this.param].id, dt: pdt}).then((res) => {
853
+ this.$set('model.rows[' + this.param + '].f_prearranged_date', pdt)
854
+ if (res.data.code == 200) {
855
+ alert("预约成功!")
856
+ }
857
+ this.showModal = false
858
+ })
859
+ }
860
+ },
861
+ inspect(row) {
862
+ var _this = this
863
+ let http = new HttpResetClass()
864
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/safe_singleTable_OrderBy`, {
865
+ data: {
866
+ items: 'id',
867
+ tablename: 't_check_plan_item',
868
+ condition: `id = '${row.id}'`,
869
+ orderitem: ' id '
870
+ }
871
+ }, {resolveMsg: null, rejectMsg: null}).then((getcheckplan) => {
872
+ this.getcheckplandata = getcheckplan.data[0]
873
+ if (this.getcheckplandata) {
874
+ if (row.f_upload_state == '未传' || (row.f_upload_state == '已传' && row.f_state == '未检' && row.f_no_checkplan != '无计划安检') || row.f_last_check_state == '到访不遇' || row.f_last_check_state == '拒检' ) {
875
+ _this.$resetpost(`${_this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/查询计划项表信息`, {data: {f_userid: row.f_userinfoid}}, {
876
+ resolveMsg: null,
877
+ rejectMsg: null
878
+ }).then((response) => {
879
+ row['f_plan_meters'] = response.data
880
+ var pardate = {
881
+ _this: _this,
882
+ title: '安全检查',
883
+ safe: true
884
+ }
885
+ _this.$dispatch('gotoson', pardate)
886
+ //tag
887
+ _this.$goto('safecheck-order-v', {
888
+ f_plan_id: row.f_plan_id,
889
+ item: row,
890
+ role: 'inspect',
891
+ parentPage: 'CurrentCreate'
892
+ }, 'self', _this.reload)
893
+ }).catch((msg) => {
894
+ this.$showMessage("网络异常,请检查网络后再试!")
895
+ })
896
+ } else {
897
+ this.$showMessage("该安检单已被上传!")
898
+ }
899
+ } else {
900
+ this.$showMessage("该用户安检单已被移除,请联系管理员确认!")
901
+ }
902
+ })
903
+ },
904
+ makeAPhoneCall(phoneNumber) {
905
+ this.$androidUtil.makeAPhoneCall(phoneNumber)
906
+ },
907
+ reserve(idx) {
908
+ this.param = idx
909
+ this.showModal = true
910
+ },
911
+ search(args) {
912
+ this.model.rows = []
913
+ this.model.search(args.condition, args.model)
914
+ },
915
+ selfSearch() {
916
+ this.getPlanCount()
917
+ let condition = ""
918
+ if (Array.isArray(this.$refs.paged.$refs.cri.model.f_residential_area) && this.$refs.paged.$refs.cri.model.f_residential_area.length > 0) {
919
+ condition += " and ti.f_residential_area = '" + this.$refs.paged.$refs.cri.model.f_residential_area[0] + "'"
920
+ } else if (this.$refs.paged.$refs.cri.model.f_residential_area instanceof String && this.$refs.paged.$refs.cri.model.f_residential_area) {
921
+ condition += " and ti.f_residential_area = '" + this.$refs.paged.$refs.cri.model.f_residential_area + "'"
922
+ }
923
+ if (this.$refs.paged.$refs.cri.model.f_building)
924
+ condition += ` and ti.f_building = '${this.$refs.paged.$refs.cri.model.f_building}'`
925
+ if (this.$refs.paged.$refs.cri.model.f_unit)
926
+ condition += ` and ti.f_unit = '${this.$refs.paged.$refs.cri.model.f_unit}'`
927
+ if (this.planName) {
928
+ condition += " and f_plan_name like '%" + this.planName + "%'"
929
+ } else {
930
+ if (this.$refs.paged.$refs.cri.model.f_plan_name)
931
+ condition += " and f_plan_name like '%" + this.$refs.paged.$refs.cri.model.f_plan_name + "%'"
932
+ }
933
+ // if(this.$refs.paged.$refs.cri.model.f_plan_year)
934
+ // condition += " and f_plan_year = '"+this.$refs.paged.$refs.cri.model.f_plan_year +"'"
935
+ // if(this.$refs.paged.$refs.cri.model.f_plan_month)
936
+ // condition += " and f_plan_month = '"+this.$refs.paged.$refs.cri.model.f_plan_month +"'"
937
+ if (this.$refs.paged.$refs.cri.model.f_userinfo_code)
938
+ condition += " and ti.f_userinfo_code like '%" + this.$refs.paged.$refs.cri.model.f_userinfo_code + "%'"
939
+ if (this.$refs.paged.$refs.cri.model.f_keyword)
940
+ condition += " and ti.f_address like '%" + this.$refs.paged.$refs.cri.model.f_keyword + "%'"
941
+ if (this.$refs.paged.$refs.cri.model.f_user_name)
942
+ condition += " and ti.f_user_name like '%" + this.$refs.paged.$refs.cri.model.f_user_name + "%'"
943
+ if (this.$refs.paged.$refs.cri.model.f_state[0])
944
+ condition += " and ti.f_state='" + this.$refs.paged.$refs.cri.model.f_state[0] + "'"
945
+ // if(this.$refs.paged.$refs.cri.model.f_last_state[0])
946
+ // condition += " and ti.f_last_check_state='"+this.$refs.paged.$refs.cri.model.f_last_state[0]+"'"
947
+ if (this.$refs.paged.$refs.cri.model.f_user_type[0])
948
+ condition += " and ti.f_user_type='" + this.$refs.paged.$refs.cri.model.f_user_type[0] + "'"
949
+ if (this.$refs.paged.$refs.cri.model.f_meter_no)
950
+ condition += " and tm.f_meter_no like '%" + this.$refs.paged.$refs.cri.model.f_meter_no + "%'"
951
+ // if(this.$refs.paged.$refs.cri.model.f_flow_direction[0])
952
+ // condition += " and tm.f_flow_direction = '"+this.$refs.paged.$refs.cri.model.f_flow_direction[0]+"'"
953
+ if (this.$refs.paged.$refs.cri.model.f_user_phone) {
954
+ condition += `and ti.f_user_phone like '%${this.$refs.paged.$refs.cri.model.f_user_phone}%'`
955
+ }
956
+ if (this.$refs.paged.$refs.cri.model.f_enter_number)
957
+ condition += " and ti.f_enter_number like '%" + this.$refs.paged.$refs.cri.model.f_enter_number + "%'"
958
+ if (this.$refs.paged.$refs.cri.model.f_check_version)
959
+ condition += " and ti.f_check_version <= " + this.$refs.paged.$refs.cri.model.f_check_version
960
+ //tag
961
+ this.model.search("((f_complete = '' or f_complete = null or f_complete = '未完成') or (f_state = '未检') or (f_last_check_state = '到访不遇' or f_last_check_state = '拒检')) and ti.f_no_checkplan = '有计划安检'" + condition)
962
+
963
+ },
964
+ getNewOrder() {
965
+ HostApp.__this__ = this
966
+ HostApp.logicWithHint({
967
+ // logic别名,key必须为logic
968
+ 'logic': 'SafeCheckServiceTimeOut',
969
+ // 回调执行方法名,key必须为callback
970
+ 'callback': 'javascript:HostApp.__this__.getNewOrderCallBack()',
971
+ // logic执行需要的业务参数
972
+ 'data': {params: ''},
973
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
974
+ // 执行回调方法传入key为backresult
975
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
976
+ 'backresult': 1
977
+ })
978
+ HostApp.logicWithHint({
979
+ // logic别名,key必须为logic
980
+ 'logic': 'FreshPlanItem',
981
+ // 回调执行方法名,key必须为callback
982
+ 'callback': 'javascript:HostApp.__this__.getNewOrderCallBack()',
983
+ // logic执行需要的业务参数
984
+ 'data': {params: ''},
985
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
986
+ // 执行回调方法传入key为backresult
987
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
988
+ 'backresult': 1
989
+ })
990
+ },
991
+ getNewOrderCallBack() {
992
+ this.selfSearch()
993
+ this.getAllArea()
994
+ this.getAllPlanName()
995
+ },
996
+ hidden() {
997
+ this.criteriaShow = !this.criteriaShow
998
+ },
999
+ getAllArea() {
1000
+ this.residentialAreaOptions = []
1001
+ this.buildOptions = []
1002
+ this.unitOptions = []
1003
+ this.$refs.paged.$refs.cri.model.f_residential_area = ''
1004
+ this.$refs.paged.$refs.cri.model.f_building = ''
1005
+ this.$refs.paged.$refs.cri.model.f_unit = ''
1006
+ let criteria = {
1007
+ items: 'f_residential_area',
1008
+ tablename: 't_check_plan_item',
1009
+ condition: `f_residential_area IS NOT NULL AND f_residential_area != '' AND f_state <> '已检'`,
1010
+ groupitem: 'f_residential_area'
1011
+ }
1012
+ let result = HostApp._executeTask({
1013
+ 'type': 'sql',
1014
+ 'data': {'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}
1015
+ })
1016
+ //tag)
1017
+ if (result.code == 200) {
1018
+ result.data.rows.forEach(item => this.residentialAreaOptions.push({
1019
+ label: item.f_residential_area,
1020
+ value: item.f_residential_area
1021
+ }))
1022
+ }
1023
+ //tag)
1024
+ },
1025
+ getbuilds(f_residential_area) {
1026
+ //tag)
1027
+ this.buildOptions = []
1028
+ this.unitOptions = []
1029
+ this.$refs.paged.$refs.cri.model.f_building = ''
1030
+ this.$refs.paged.$refs.cri.model.f_unit = ''
1031
+ if (!f_residential_area) {
1032
+ return
1033
+ }
1034
+ let criteria = {
1035
+ items: 'f_building',
1036
+ tablename: 't_check_plan_item',
1037
+ condition: `f_building IS NOT NULL AND f_building != '' AND f_state <> '已检' AND f_residential_area = '${f_residential_area}'`,
1038
+ groupitem: 'f_building order by f_building+0'
1039
+ }
1040
+ let result = HostApp._executeTask({
1041
+ 'type': 'sql',
1042
+ 'data': {'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}
1043
+ })
1044
+ if (result.code == 200) {
1045
+ result.data.rows.forEach(item => this.buildOptions.push({label: item.f_building, value: item.f_building}))
1046
+ }
1047
+ this.buildOptions.sort((a, b) => {
1048
+ return Number(a.label) - Number(b.label)
1049
+ })
1050
+ //tag)
1051
+ },
1052
+ getUnits(f_building) {
1053
+ f_building = f_building[0]
1054
+ //tag)
1055
+ this.unitOptions = []
1056
+ this.$refs.paged.$refs.cri.model.f_unit = ''
1057
+ if (!f_building) {
1058
+ return
1059
+ }
1060
+ let criteria = {
1061
+ items: 'f_unit',
1062
+ tablename: 't_check_plan_item',
1063
+ 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}'`,
1064
+ groupitem: 'f_unit'
1065
+ }
1066
+ let result = HostApp._executeTask({
1067
+ 'type': 'sql',
1068
+ 'data': {'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}
1069
+ })
1070
+ if (result.code == 200) {
1071
+ result.data.rows.forEach(item => this.unitOptions.push({label: item.f_unit, value: item.f_unit}))
1072
+ }
1073
+ this.unitOptions.sort((a, b) => {
1074
+ return Number(a.label) - Number(b.label)
1075
+ })
1076
+ },
1077
+ getPlanCount() {
1078
+ this.upcomingCount = 0
1079
+ this.tempSaveCount = 0
1080
+ this.doneCount = 0
1081
+ this.allPlanCount = 0
1082
+
1083
+ //获取统计区域数据
1084
+ let condition = ' 1=1 '
1085
+ if (this.planName) {
1086
+ condition += " and f_plan_name = '" + this.planName + "'"
1087
+ } else {
1088
+ if (this.$refs.paged.$refs.cri.model.f_plan_name){
1089
+ condition += " and f_plan_name = '" + this.$refs.paged.$refs.cri.model.f_plan_name + "'"
1090
+ }else {
1091
+ condition = ' 1 != 1'
1092
+ }
1093
+ }
1094
+ let tjData = {
1095
+ items: " COUNT(*) AS total_items, SUM(CASE WHEN tcpi.f_last_check_state= '到访不遇' THEN 1 ELSE 0 END) AS no_answer_count, SUM(CASE WHEN tcpi.f_state='已检' THEN 1 ELSE 0 END) AS yj_count, SUM(CASE WHEN tcpi.f_state='未检' THEN 1 ELSE 0 END) AS wj_count, ROUND(SUM(CASE WHEN tcp.f_entry_status='入户' THEN 1 ELSE 0 END)*100.0/COUNT(*),2) AS entry_rate_percent ",
1096
+ tablename: " t_check_plan tcpl LEFT JOIN t_check_plan_item tcpi ON tcpl.id=tcpi.f_plan_id LEFT JOIN t_check_paper tcp ON tcp.f_check_item_id= tcpi.id ",
1097
+ condition: condition,
1098
+ orderitem: '1'
1099
+ }
1100
+ let resultTj = HostApp._executeTask({'type':'sql', 'data':{'alias': 'safe_singleTable_OrderBy', 'criteria': tjData}})
1101
+ if (resultTj.code==200){
1102
+ const stat = resultTj.data.rows[0];
1103
+ this.planTotal = stat.total_items || 0;
1104
+ this.notVisited = stat.no_answer_count || 0;
1105
+ this.checked = stat.yj_count || 0;
1106
+ this.notChecked = stat.wj_count || 0;
1107
+ this.enterRate = stat.entry_rate_percent || 0;
1108
+ }
1109
+
1110
+ let criteria = {
1111
+ items: 'count(id) count',
1112
+ tablename: 't_check_plan_item',
1113
+ condition: `f_state = '未检'`,
1114
+ groupitem: 'f_state'
1115
+ }
1116
+ let result = HostApp._executeTask({
1117
+ 'type': 'sql',
1118
+ 'data': {'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}
1119
+ })
1120
+ if (result.code && result.code == 200) {
1121
+ if (result.data.rows[0] && !isNaN(result.data.rows[0].count)) {
1122
+ }
1123
+ }
1124
+ criteria = {
1125
+ items: 'count(id) count',
1126
+ tablename: 't_check_plan_item',
1127
+ condition: `(f_complete = '' or f_complete is null or f_complete = '未完成') AND f_state = '已检'`,
1128
+ groupitem: 'f_state'
1129
+ }
1130
+ result = HostApp._executeTask({
1131
+ 'type': 'sql',
1132
+ 'data': {'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}
1133
+ })
1134
+ if (result.code && result.code == 200) {
1135
+ if (result.data.rows[0] && !isNaN(result.data.rows[0].count)) {
1136
+ }
1137
+ }
1138
+ criteria = {
1139
+ items: 'count(id) count',
1140
+ tablename: 't_check_plan_item',
1141
+ condition: `f_complete = '已完成' AND f_state = '已检'`,
1142
+ groupitem: 'f_state'
1143
+ }
1144
+ result = HostApp._executeTask({
1145
+ 'type': 'sql',
1146
+ 'data': {'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}
1147
+ })
1148
+ if (result.code && result.code == 200) {
1149
+ if (result.data.rows[0] && !isNaN(result.data.rows[0].count)) {
1150
+ this.doneCount = result.data.rows[0].count
1151
+ }
1152
+ }
1153
+ this.allPlanCount = this.upcomingCount + this.tempSaveCount + this.doneCount
1154
+ },
1155
+ getAllPlanName() {
1156
+ this.planNameOptions = []
1157
+ this.$refs.paged.$refs.cri.model.f_plan_name = ''
1158
+ let criteria = {
1159
+ items: 'f_plan_name',
1160
+ tablename: 't_check_plan',
1161
+ condition: `f_plan_name IS NOT NULL AND f_plan_name != ''`,
1162
+ groupitem: 'f_plan_name'
1163
+ }
1164
+ let result = HostApp._executeTask({
1165
+ 'type': 'sql',
1166
+ 'data': {'alias': 'safe_singleTable_GroupBy', 'criteria': criteria}
1167
+ })
1168
+ //tag)
1169
+ if (result.code == 200) {
1170
+ result.data.rows.forEach(item => this.planNameOptions.push({label: item.f_plan_name, value: item.f_plan_name}))
1171
+ }
1172
+ //tag)
1173
+ },
1174
+ setPlanParam(detailsType, event) {
1175
+ if (event.srcElement.checked) {
1176
+ this.planparam.push(detailsType)
1177
+ //tag
1178
+ } else {
1179
+ if (this.planparam.length > 0) {
1180
+ let planid = this.planparam.findIndex((value) => {
1181
+ return value === detailsType
1182
+ })
1183
+ this.planparam.splice(planid, 1)
1184
+ //tag
1185
+
1186
+ }
1187
+
1188
+ }
1189
+ }
1190
+ }
1191
+ }
1192
+ </script>