safecheck-client 3.0.32-23 → 3.0.32-25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,951 @@
1
+ <template>
2
+ <work-busy :is-busy="isSend"></work-busy>
3
+ <div class="binary" style="background-color: #e8f4ff">
4
+ <!--左侧安检计划列表******************************************************-->
5
+ <div class="binary-left flex flex-column" style="width: 16%">
6
+ <div style="height: 9%">
7
+ <div class="row auto">
8
+ <img style="width: 20px;margin: 0 5px" src="../../../../static/images/searchhover.png"
9
+ @click="showUserCondition()"/>
10
+ <v-select :width="'80%'"
11
+ class="select select_list"
12
+ :search="false"
13
+ :value.sync="currentorder"
14
+ v-model="currentorder"
15
+ @change="loadCheckPlan"
16
+ :options='opt'
17
+ close-on-select value-single>
18
+ </v-select>
19
+ </div>
20
+ <div class="row auto safe-div-p">
21
+ <!--<span style="margin-right: 5px" @click="refresh()" style="cursor:default">测试</span>--><span
22
+ style="margin-right: 5px" @click="delCheckPlan()" style="cursor:default">删除</span> <span
23
+ @click="sendCheckPlan()" style="cursor:default">下发</span></div>
24
+ </div>
25
+ <div class="leftplan-center safe_plan_list">
26
+ <div class="row safe-leftplan safe_list_li" :class="{'safe-selectplan':selectPlan.id==row.id}"
27
+ v-for="row in checkplan.list.data" @click="selectPlanChange(row)">
28
+ <table style="width:100%;table-layout:fixed">
29
+ <tr class="safe-planfont">
30
+ <td rowspan="6"><input type="checkbox" style="pointer-events:auto"
31
+ v-show="row.plan_count==0 || row.f_issued=='未下发'"
32
+ onClick="event.cancelBubble = true"
33
+ :checked="checkplan.check.isChecked(row.f_check_item_id)"
34
+ @change="checkplan.check.setCheckes(row.id)"/></td>
35
+ <td colspan="6" class="safe_p">{{ row.f_plan_name }}</td>
36
+ <td colspan="2" style="text-align: center"><img width="20px" style="pointer-events:auto"
37
+ onClick="event.cancelBubble = true"
38
+ @click="showUpPlans(row)"
39
+ src="../../../../static/images/edit.png"/></td>
40
+ </tr>
41
+ <tr class="safe-bodyfont" style="color:#4792de">
42
+ <td colspan="6">{{ row.f_issued }}</td>
43
+ <td colspan="2" class="safe_p">{{ row.f_checker ? row.f_checker : '共享' }}</td>
44
+ </tr>
45
+ <tr class="safe-bodyfont">
46
+ <td colspan="4">{{ row.f_plan_year }}-{{ row.f_plan_month }}</td>
47
+ <td colspan="2">总 :</td>
48
+ <td colspan="2">{{ row.plan_count }}</td>
49
+ </tr>
50
+ <tr class="safe-bodyfont">
51
+ <td colspan="2">未检 :</td>
52
+ <td colspan="2">{{ row.unchecked }}</td>
53
+ <td colspan="2">已检 :</td>
54
+ <td colspan="2">{{ row.checked }}</td>
55
+ </tr>
56
+ <tr class="safe-bodyfont" v-if="row.f_create_time">
57
+ <td colspan="3">创建时间 :</td>
58
+ <td colspan="5" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
59
+ :title="row.f_create_time">{{ row.f_create_time }}
60
+ </td>
61
+ </tr>
62
+ <tr class="safe-bodyfont" v-if="row.f_safecheck_type">
63
+ <td colspan="3">安检类型 :</td>
64
+ <td colspan="5" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
65
+ :title="row.f_safecheck_type">{{ row.f_safecheck_type }}
66
+ </td>
67
+ </tr>
68
+ </table>
69
+ </div>
70
+ </div>
71
+ <div style="height: 11%">
72
+ <div class="row auto leftplan-center" style="padding: 8px">
73
+ <div class="col-sm-6" style="">
74
+ <span>共{{ checkplan.list.count }}条</span>
75
+ </div>
76
+ <div class="col-sm-6" style="text-align: end">
77
+ <span @click="loadMore('checkplan')"><img src="../../../../static/images/doubledown.png"/>&ensp;更多</span>
78
+ </div>
79
+ </div>
80
+ <div class="row auto" style="padding: 10px;text-align: center">
81
+ <img src="../../../../static/images/addnew.png" @click="showcCreatePlan()"/>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ <!--右侧列表**************************************************************************-->
86
+ <div class="binary-right" style="width: 84%;overflow: auto">
87
+ <div style="height: 5%">
88
+ <div class="col-sm-4">
89
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
90
+ <right-tree-safe :islist="false" :width="'60%'" @re-res="getRes"></right-tree-safe>
91
+ </div>
92
+ </div>
93
+ <div style="height: 95%">
94
+ <div style="height: 50%" class="leftplan-center">
95
+ <check-plan-list :selectplan="selectPlan" :userlogin="userlogin" v-ref:item></check-plan-list>
96
+ </div>
97
+ <div style="height: 50%">
98
+ <check-user-list :selectplan="selectPlan" :userlogin="userlogin" v-ref:user></check-user-list>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ <modal :show.sync="showCondtion" v-ref:modal :width="'50%'" :backdrop="false">
103
+ <div slot="modal-header" class="modal-header">
104
+ <h4 class="modal-title">
105
+ 计划查询条件
106
+ </h4>
107
+ </div>
108
+ <div slot="modal-body" class="modal-body">
109
+ <div class="row">
110
+ <div class="form-group col-sm-4">
111
+ <label class="font_normal_body">计划名称:</label>
112
+ <input type="text" class="input_search" v-model="planCondition.f_plan_name"
113
+ @change="setProperty('checkplan','f_plan_name',planCondition.f_plan_name)"
114
+ style="width: 60%" placeholder="请选择"/>
115
+ </div>
116
+ <div class="form-group col-sm-4">
117
+ <label class="font_normal_body">计划年份:</label>
118
+ <v-select
119
+ class="select select_list"
120
+ :value.sync="planCondition.f_plan_year"
121
+ v-model="planCondition.f_plan_year"
122
+ @change="setProperty('checkplan','f_plan_year',planCondition.f_plan_year)"
123
+ :search="false"
124
+ :options='getConList("yearList")'
125
+ placeholder='请选择'
126
+ close-on-select
127
+ value-single
128
+ >
129
+ </v-select>
130
+ </div>
131
+ <div class="form-group col-sm-4">
132
+ <label class="font_normal_body">开始时间</label>
133
+ <datepicker
134
+ :value.sync="planCondition.f_start_time"
135
+ :format="'yyyy-MM-dd HH:mm:ss'"
136
+ v-model="planCondition.f_start_time"
137
+ :show-reset-button="reset" placeholder="请输入开始时间" style="margin-bottom: 8px">
138
+ </datepicker>
139
+ </div>
140
+ <div class="form-group col-sm-4">
141
+ <label class="font_normal_body">结束时间:</label>
142
+ <datepicker
143
+ :value.sync="planCondition.f_end_time"
144
+ :format="'yyyy-MM-dd HH:mm:ss'"
145
+ v-model="planCondition.f_end_time"
146
+ :show-reset-button="reset" placeholder="请输入结束时间" style="margin-bottom: 8px">
147
+ </datepicker>
148
+ </div>
149
+ <div class="form-group col-sm-4">
150
+ <label class="font_normal_body">是否共享:</label>
151
+ <v-select
152
+ class="select select_list"
153
+ :value.sync="planCondition.isShare"
154
+ v-model="planCondition.isShare"
155
+ @change="setProperty('checkplan','isAndNot',planCondition.isShare)"
156
+ :options='getConList("conIsAndNot")'
157
+ :search="false"
158
+ placeholder='请选择'
159
+ close-on-select
160
+ value-single
161
+ >
162
+ </v-select>
163
+ </div>
164
+ <div class="form-group col-sm-4">
165
+ <label class="font_normal_body">是否下发:</label>
166
+ <v-select
167
+ class="select select_list"
168
+ :value.sync="planCondition.issued"
169
+ v-model="planCondition.issued"
170
+ :options='getConList("isAndNot")'
171
+ @change="setProperty('checkplan','issude',planCondition.issued)"
172
+ placeholder='请选择'
173
+ :search="false"
174
+ close-on-select
175
+ value-single
176
+ >
177
+ </v-select>
178
+ </div>
179
+ <div class="form-group col-sm-4">
180
+ <label class="font_normal_body">安&ensp;检&ensp;员:</label>
181
+ <v-select
182
+ class="select select_list"
183
+ :value.sync="planCondition.f_checker"
184
+ v-model="planCondition.f_checker"
185
+ @change="setProperty('checkplan','checkerid',planCondition.f_checker.id)"
186
+ :options='getConList("checker")'
187
+ placeholder='请选择'
188
+ close-on-select
189
+ value-single
190
+ >
191
+ </v-select>
192
+ </div>
193
+ <div class="form-group col-sm-4">
194
+ <label class="font_normal_body">创&ensp;建&ensp;人:</label>
195
+ <input type="text" class="input_search" v-model="planCondition.f_create_operator"
196
+ @change="setProperty('checkplan','f_create_operator',planCondition.f_create_operator)"
197
+ style="width: 60%" placeholder="创建人"/>
198
+ </div>
199
+ <div class="form-group col-sm-4">
200
+ <label class="font_normal_body">用气性质:</label>
201
+ <v-select
202
+ class="select select_list"
203
+ :value.sync="planCondition.f_gasproperties"
204
+ v-model="planCondition.f_gasproperties"
205
+ :search="false"
206
+ :options='gasproperties'
207
+ placeholder='请选择'
208
+ close-on-select
209
+ value-single
210
+ >
211
+ </v-select>
212
+ </div>
213
+ <div class="form-group col-sm-4">
214
+ <label class="font_normal_body">用户类型:</label>
215
+ <v-select
216
+ class="select select_list"
217
+ :value.sync="planCondition.f_user_type"
218
+ v-model="planCondition.f_user_type"
219
+ :search="false"
220
+ :options='userType'
221
+ placeholder='请选择'
222
+ close-on-select
223
+ value-single
224
+ >
225
+ </v-select>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
230
+ <button class="button_search" @click="loadCheckPlan" style="margin-right: 15px">查询</button>
231
+ <button class="button_search" @click="cancel">取消</button>
232
+ </div>
233
+ </modal>
234
+ <modal :show.sync="showCreatePlan" v-ref:modal1 :width="'50%'" :backdrop="false">
235
+ <div slot="modal-header" class="modal-header">
236
+ <h4 class="modal-title">
237
+ 新建计划
238
+ </h4>
239
+ </div>
240
+ <div slot="modal-body" class="modal-body">
241
+ <div class="row">
242
+ <div class="form-group col-sm-4">
243
+ <label class="font_normal_body">计划名称:</label>
244
+ <input type="text" class="input_search" v-model="createPlan.f_plan_name"
245
+ style="width: 60%" placeholder="请选择"/>
246
+ </div>
247
+ <div class="form-group col-sm-4">
248
+ <label class="font_normal_body">计划年份:</label>
249
+ <v-select
250
+ class="select select_list"
251
+ :value.sync="createPlan.f_plan_year"
252
+ v-model="createPlan.f_plan_year"
253
+ :search="false"
254
+ :options='yearList'
255
+ placeholder='请选择'
256
+ close-on-select
257
+ value-single
258
+ >
259
+ </v-select>
260
+ </div>
261
+ <div class="form-group col-sm-4">
262
+ <label class="font_normal_body">计划月份:</label>
263
+ <v-select
264
+ class="select select_list"
265
+ :value.sync="createPlan.f_plan_month"
266
+ v-model="createPlan.f_plan_month"
267
+ :search="false"
268
+ :options='monthList'
269
+ placeholder='请选择'
270
+ close-on-select
271
+ value-single>
272
+ </v-select>
273
+ </div>
274
+ <div class="form-group col-sm-4">
275
+ <label class="font_normal_body">开始时间</label>
276
+ <datepicker
277
+ :value.sync="createPlan.f_start_time"
278
+ :format="'yyyy-MM-dd HH:mm:ss'"
279
+ v-model="createPlan.f_start_time"
280
+ :show-reset-button="reset" placeholder="请输入开始时间" style="margin-bottom: 8px">
281
+ </datepicker>
282
+ </div>
283
+ <div class="form-group col-sm-4">
284
+ <label class="font_normal_body">结束时间:</label>
285
+ <datepicker
286
+ :value.sync="createPlan.f_end_time"
287
+ :format="'yyyy-MM-dd HH:mm:ss'"
288
+ v-model="createPlan.f_end_time"
289
+ :show-reset-button="reset" placeholder="请输入结束时间" style="margin-bottom: 8px">
290
+ </datepicker>
291
+ </div>
292
+ <div class="form-group col-sm-4">
293
+ <label class="font_normal_body">是否共享:</label>
294
+ <v-select
295
+ class="select select_list"
296
+ :search="false"
297
+ :value.sync="createPlan.isShare"
298
+ v-model="createPlan.isShare"
299
+ :options='isAndNot'
300
+ placeholder='请选择'
301
+ close-on-select
302
+ value-single
303
+ >
304
+ </v-select>
305
+ </div>
306
+ <div class="form-group col-sm-4" v-show="createPlan.isShare=='否'">
307
+ <label class="font_normal_body">安&ensp;检&ensp;员:</label>
308
+ <v-select
309
+ class="select select_list"
310
+ :value.sync="createPlan.checker"
311
+ v-model="createPlan.checker"
312
+ :options='checker'
313
+ placeholder='请选择'
314
+ close-on-select
315
+ value-single
316
+ >
317
+ </v-select>
318
+ </div>
319
+
320
+ <div class="form-group col-sm-4">
321
+ <label class="font_normal_body">安检类型:</label>
322
+ <v-select
323
+ class="select select_list"
324
+ :value.sync="createPlan.f_safecheck_type"
325
+ v-model="createPlan.f_safecheck_type"
326
+ :search="false"
327
+ :options='ntoway'
328
+ placeholder='请选择'
329
+ close-on-select
330
+ value-single
331
+ >
332
+ </v-select>
333
+ </div>
334
+ <div class="form-group col-sm-4">
335
+ <label class="font_normal_body">用气性质:</label>
336
+ <v-select
337
+ class="select select_list"
338
+ :value.sync="createPlan.f_gasproperties"
339
+ v-model="createPlan.f_gasproperties"
340
+ :search="false"
341
+ :options='gasproperties'
342
+ placeholder='请选择'
343
+ close-on-select
344
+ value-single
345
+ >
346
+ </v-select>
347
+ </div>
348
+ <div class="form-group col-sm-4">
349
+ <label class="font_normal_body">用户类型:</label>
350
+ <v-select
351
+ class="select select_list"
352
+ :value.sync="createPlan.f_user_type"
353
+ v-model="createPlan.f_user_type"
354
+ :search="false"
355
+ :options='userType'
356
+ placeholder='请选择'
357
+ close-on-select
358
+ value-single
359
+ >
360
+ </v-select>
361
+ </div>
362
+ </div>
363
+ </div>
364
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
365
+ <button class="button_search" style="margin-right: 15px" @click="addNewPlan()">创建计划</button>
366
+ <button class="button_search" @click="cancel">取消</button>
367
+ </div>
368
+ </modal>
369
+ <modal :show.sync="showUpPlan" v-ref:modal2 :backdrop="false">
370
+ <div slot="modal-header" class="modal-header">
371
+ <h4 class="modal-title">
372
+ 修改计划
373
+ </h4>
374
+ </div>
375
+ <div slot="modal-body" class="modal-body">
376
+ <div class="row">
377
+ <div class="form-group col-sm-4">
378
+ <label class="font_normal_body">计划名称:</label>
379
+ <input type="text" class="input_search" v-model="upCheckPlan.f_plan_name"
380
+ style="width: 60%"/>
381
+ </div>
382
+ <div class="form-group col-sm-4">
383
+ <label class="font_normal_body">计划年份:</label>
384
+ <v-select
385
+ class="select select_list"
386
+ :value.sync="upCheckPlan.f_plan_year"
387
+ v-model="upCheckPlan.f_plan_year"
388
+ :search="false"
389
+ :value="upCheckPlan.f_plan_year"
390
+ :options='yearList'
391
+
392
+ close-on-select
393
+ value-single>
394
+
395
+
396
+ </v-select>
397
+ <!-- <datepicker
398
+ placeholder='请选择'
399
+ style="width:60%"
400
+ :disabled-days-of-week="[]"
401
+ :format="'yyyy'"
402
+ :show-rest-button="reset"
403
+ :value.sync="upCheckPlan.f_plan_year"
404
+ v-model="upCheckPlan.f_plan_year">
405
+ </datepicker>-->
406
+ </div>
407
+ <div class="form-group col-sm-4">
408
+ <label class="font_normal_body">计划月份:</label>
409
+ <v-select
410
+ class="select select_list"
411
+ :value.sync="upCheckPlan.f_plan_month"
412
+ v-model="upCheckPlan.f_plan_month"
413
+
414
+ :options='monthList'
415
+ close-on-select
416
+ value-single>
417
+ </v-select>
418
+ </div>
419
+ <div class="form-group col-sm-4">
420
+ <label class="font_normal_body">是否共享:</label>
421
+ <v-select
422
+ class="select select_list"
423
+ :search="false"
424
+ :value.sync="upCheckPlan.isShare"
425
+ v-model="upCheckPlan.isShare"
426
+ :options='isAndNot'
427
+ placeholder='请选择'
428
+ close-on-select
429
+ value-single
430
+ >
431
+ </v-select>
432
+ </div>
433
+ <div class="form-group col-sm-4" v-show="upCheckPlan.isShare=='否'">
434
+ <label class="font_normal_body">安&ensp;检&ensp;员:</label>
435
+ <v-select
436
+ class="select select_list"
437
+ :value.sync="upCheckPlan.checker"
438
+ v-model="upCheckPlan.checker"
439
+ :options='checker'
440
+ close-on-select
441
+ value-single
442
+ >
443
+ </v-select>
444
+ </div>
445
+
446
+ <div class="form-group col-sm-4">
447
+ <label class="font_normal_body">安检类型:</label>
448
+ <v-select
449
+ class="select select_list"
450
+ :value.sync="upCheckPlan.f_safecheck_type"
451
+ v-model="upCheckPlan.f_safecheck_type"
452
+ :options='ntoway'
453
+ close-on-select
454
+ value-single
455
+ >
456
+ </v-select>
457
+ </div>
458
+ </div>
459
+ </div>
460
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
461
+ <button class="button_search" style="margin-right: 15px" @click="upPlan()">保存修改</button>
462
+ <button class="button_search" @click="cancel">取消</button>
463
+ </div>
464
+ </modal>
465
+ </div>
466
+ </template>
467
+
468
+ <script>
469
+ import {SearchList, HttpResetClass, PagedList} from "vue-client";
470
+ import * as Util from "../../../components/Util";
471
+ import Vue from "vue";
472
+
473
+ export default {
474
+ name: "PlanManage",
475
+ title: '计划管理',
476
+ data() {
477
+ return {
478
+ a: '1',
479
+ opt: [{label: "按时间降序", value: "按时间降序"}, {label: "按时间升序", value: "按时间升序"}],
480
+ currentorder: '按时间降序',
481
+ checkplan: new SearchList(true),
482
+ selectPlan: {id: ''},
483
+ upCheckPlan: {
484
+ f_plan_name: '',
485
+ f_safecheck_type: '',
486
+ f_plan_year: '',
487
+ f_plan_month: '',
488
+ f_checker_id: '',
489
+ isShare: '',
490
+ f_checker: '',
491
+ checker: {}
492
+ },
493
+ isSend: false,
494
+ createPlan: {
495
+ f_plan_name: '',
496
+ f_plan_year: '',
497
+ f_plan_month: '',
498
+ isShare: '否',
499
+ f_issued: '否',
500
+ f_checker_id: null,
501
+ checker: {},
502
+ f_checker: null,
503
+ f_safecheck_type: '',
504
+ f_end_time:'',
505
+ f_start_time:''
506
+ },
507
+ planCondition: {},
508
+ showCondtion: false,
509
+ showCreatePlan: false,
510
+ showUpPlan: false,
511
+ isAndNot: [{label: '是', value: '是'}, {label: '否', value: '否'}],
512
+ conIsAndNot: [{label: '是', value: 'is null'}, {label: '否', value: 'is not null'}],
513
+ yearList: [{label: 2020, value: 2020}, {label: 2021, value: 2021}, {label: 2022, value: 2022}, {
514
+ label: 2023,
515
+ value: 2023
516
+ }, {label: 2024, value: 2024}, {label: 2025, value: 2025}, {label: 2026, value: 2026}, {
517
+ label: 2027,
518
+ value: 2027
519
+ }, {label: 2028, value: 2028}, {label: 2029, value: 2029}, {label: 2030, value: 2030}],
520
+ monthList: [{label: "1", value: 1}, {label: "2", value: 2}, {label: "3", value: 3}, {
521
+ label: "4",
522
+ value: 4
523
+ }, {label: "5", value: 5}, {label: "6", value: 6}, {label: "7", value: 7}, {label: "8", value: 8}, {
524
+ label: "9",
525
+ value: 9
526
+ }, {label: "10", value: 10}, {label: "11", value: 11}, {label: "12", value: 12}],
527
+ safechecktype: [{label: '年度普检', value: '年度普检'}],
528
+ checker: [],
529
+ checkertCon: [],
530
+ userlogin: {
531
+ id: this.$login.f.id,
532
+ name: this.$login.f.name,
533
+ orgid: this.$login.f.orgid,
534
+ orgstr: this.$login.f.orgs,
535
+ }
536
+ //需要测试直接把下面放开即可
537
+ /*userlogin:{
538
+ id:'141701',
539
+ name:'hwq',
540
+ orgid:'35526',
541
+ orgstr:'西华县天然气有限公司'
542
+ }*/
543
+ }
544
+ },
545
+ async ready() {
546
+ await this.loadpage()
547
+ },
548
+ computed: {
549
+ ntoway() {
550
+ /*/!* return AppData.getParam('安检类型')*!/*/
551
+ return this.$appdata.getParam('安检类型')
552
+ },
553
+ gasproperties(){
554
+ return this.$appdata.getParam('用气性质')
555
+ },
556
+ userType(){
557
+ return this.$appdata.getParam('用户类型')
558
+ }
559
+
560
+ },
561
+ methods: {
562
+ /* ntoway() {
563
+ /!* return AppData.getParam('安检类型')*!/
564
+ return Vue.$appdata.getParam('安检类型')
565
+ },*/
566
+ async loadpage() {
567
+ //await this.checkplan.searchList("/rs/sql/预约计划下发", {},{groupitem:"",f_filialeids:"('"+this.userlogin.orgid+"')",orderitem:"f_create_time desc"})
568
+ await this.loadCheckPlan()
569
+ await this.searchChecker(this.userlogin.id)
570
+ },
571
+ getRes(obj) {
572
+ console.log("----obj" + JSON.stringify(obj.resids))
573
+ console.log(obj)
574
+ if (obj.resids.length > 0 && obj.resids[0] != this.userlogin.orgid && obj.resids[0]) {
575
+ this.userlogin.orgid = obj.resids[0]
576
+ this.userlogin.orgstr = obj.res[0]
577
+ if (this.$refs.item && this.$refs.user) {
578
+ this.loadpage()
579
+ this.selectPlan = {id: ""}
580
+ this.$refs.item.model.rows = []
581
+ this.$refs.user.model.rows = []
582
+ this.$refs.user.loadpage()
583
+ }
584
+ }
585
+ },
586
+ getConList(field) {
587
+ return [{label: '全部', value: ''}, ...this[field]]
588
+ },
589
+ selectPlanChange(plan) {
590
+ this.selectPlan = plan
591
+ //this.upCheckPlan=plan
592
+ },
593
+ showUserCondition() {
594
+ this.showCondtion = true
595
+ },
596
+ showcCreatePlan() {
597
+ this.showCreatePlan = true
598
+ },
599
+ cancel() {
600
+ this.showCondtion = false
601
+ this.showCreatePlan = false
602
+ this.showUpPlan = false
603
+ },
604
+ //新建计划
605
+ async addNewPlan() {
606
+ if (!this.validationCreatePlan()) {
607
+ return
608
+ }
609
+ this.isSend = true
610
+ let res = await new HttpResetClass().load("POST", "/rs/sql/getCheckplan", {
611
+ data: {
612
+ condition: "f_plan_name='" + this.createPlan.f_plan_name + "'",
613
+ sortfield: 'f_create_time desc'
614
+ }
615
+ })
616
+ console.log("结果-" + res.data.length)
617
+ if (res.data.length > 0) {
618
+ Vue.showMessage("计划名称不能重复!")
619
+ this.isSend = false
620
+ return
621
+ }
622
+ if (this.createPlan.isShare == "是") {
623
+ this.createPlan.f_checker_id = null
624
+ this.createPlan.f_checker = null
625
+ } else {
626
+ this.createPlan.f_checker_id = this.createPlan.checker.id
627
+ this.createPlan.f_checker = this.createPlan.checker.name
628
+ }
629
+ console.log("this.createPlan.f_checker:" + this.createPlan.f_checker)
630
+ this.createPlan.f_plan_type = '预约计划'
631
+ this.createPlan.f_subcompany = this.userlogin.orgstr
632
+ this.createPlan.f_filialeid = this.userlogin.orgid
633
+ this.createPlan.f_create_operator = this.userlogin.name
634
+ this.createPlan.f_create_time = Util.toStandardTimeString()
635
+ await new HttpResetClass().load('POST', "/rs/logic/createCheckPlan", {"data": this.createPlan}, {
636
+ resolveMsg: '新建计划成功!',
637
+ rejectMsg: '新建计划失败!'
638
+ })
639
+ //await this.loadCheckPlan('',()=>{})
640
+ this.createPlan = {
641
+ f_plan_name: '',
642
+ f_plan_year: '',
643
+ f_plan_month: '',
644
+ isShare: '否',
645
+ f_issued: '否',
646
+ f_checker_id: null,
647
+ checker: {},
648
+ f_checker: null,
649
+ f_safecheck_type: '',
650
+ f_create_operator: ''
651
+ }
652
+ await this.loadCheckPlan()
653
+ this.isSend = false
654
+
655
+ },
656
+ validationCreatePlan() {
657
+ if (!this.createPlan.f_plan_name) {
658
+ Vue.showMessage("请输入安检计划名称!")
659
+ return false
660
+ }
661
+ if (!this.createPlan.f_plan_year) {
662
+ Vue.showMessage("请选择安检年份!")
663
+ return false
664
+ }
665
+ if (!this.createPlan.f_plan_month) {
666
+ Vue.showMessage("请选择安检月份!")
667
+ return false
668
+ }
669
+ if (this.createPlan.isShare == "否") {
670
+ if (JSON.stringify(this.createPlan.checker) == '{}') {
671
+ Vue.showMessage("请选择安检人员!")
672
+ return false
673
+ }
674
+ } else {
675
+ this.createPlan.f_checker = ''
676
+ }
677
+ if (!this.createPlan.f_safecheck_type) {
678
+ Vue.showMessage("请选择安检类型!")
679
+ return false
680
+ }
681
+ return true
682
+ },
683
+ //查询安检员selectChanged
684
+ async searchChecker(id) {
685
+ let res = await new HttpResetClass().load('POST', '/rs/search', {
686
+ source: `root.getResourceById($${this.userlogin.orgid}$,$organization$).getSpecialResByType($user$).where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1)`,
687
+ userid: this.$login.f.id
688
+ }, {resolveMsg: null, rejectMsg: null})
689
+ let arr = []
690
+ res.data.forEach((resRow) => {
691
+ if (!arr.includes(resRow.name) && resRow.state == '在职') {
692
+ arr.push(resRow.name)
693
+ this.checker.push({label: resRow.name, value: resRow})
694
+ }
695
+ })
696
+ },
697
+ //设置属性值
698
+ setProperty(modulename, property, value) {
699
+ console.log(modulename + "新添--" + property + "--" + value)
700
+ if (value == '全部') {
701
+ this[modulename].search.setField(property, '')
702
+ } else {
703
+ this[modulename].search.setField(property, value)
704
+ }
705
+ },
706
+ //按条件查询所有安检计划
707
+ async loadCheckPlan() {
708
+ this.isSend = true
709
+ this.checkplan.check.checkes = []
710
+ let fieldValue = ''
711
+ switch (this.currentorder) {
712
+ case "按时间降序":
713
+ fieldValue = 'f_create_time desc'
714
+ break
715
+ case "按时间升序":
716
+ fieldValue = 'f_create_time'
717
+ break
718
+ }
719
+ console.log("--------fieldValue" + fieldValue)
720
+ this.cancel()
721
+ await this.checkplan.searchList("/rs/sql/预约计划下发",
722
+ {
723
+ "f_plan_name": "f_plan_name like '%{}%'",
724
+ "f_plan_year": "f_plan_year={}",
725
+ "f_plan_month": "f_plan_month={}",
726
+ "checkerid": "f_checker_id='{}'",
727
+ "isAndNot": "f_checker {}",
728
+ "safechecktype": "f_safecheck_type='{}'",
729
+ "issude": "f_issued = '{}'",
730
+ "f_create_operator": "f_create_operator like '%{}%'"
731
+ },
732
+ {
733
+ orderitem: fieldValue,
734
+ f_filialeids: "('" + this.userlogin.orgid + "')",
735
+ groupitem: ""
736
+ }
737
+ )
738
+
739
+ this.isSend = false
740
+ },
741
+ //加载更多数据
742
+ async loadMore(modelname) {
743
+ this.isSend = true
744
+ await this[modelname].list.loadMore()
745
+ this.isSend = false
746
+ },
747
+ showUpPlans(row) {
748
+ this.upCheckPlan.id = row.id
749
+ this.upCheckPlan.f_safecheck_type = row.f_safecheck_type
750
+ this.upCheckPlan.f_plan_name = row.f_plan_name
751
+ this.upCheckPlan.f_plan_year = row.f_plan_year
752
+ this.upCheckPlan.f_plan_month = row.f_plan_month
753
+ this.upCheckPlan.f_checker_id = row.f_checker_id ? row.f_checker_id : null
754
+ this.upCheckPlan.f_checker = row.f_checker ? row.f_checker : null
755
+ this.upCheckPlan.isShare = row.f_checker_id ? '否' : '是'
756
+ this.upCheckPlan.f_issued = row.f_issued
757
+ this.upCheckPlan.checker = {id: row.f_checker_id, name: row.f_checker}
758
+ this.showUpPlan = true
759
+ },
760
+ async upPlan() {
761
+ if (this.upCheckPlan.f_issued == '已下发') {
762
+ this.$showMessage("该计划已下发,无法进行修改!")
763
+ return
764
+ }
765
+ if (!this.upCheckPlan.f_plan_name) {
766
+ Vue.showMessage("请输入安检计划名称!")
767
+ return false
768
+ }
769
+ if (!this.upCheckPlan.f_plan_year) {
770
+ Vue.showMessage("请选择安检年份!")
771
+ return false
772
+ }
773
+ if (!this.upCheckPlan.f_plan_month) {
774
+ Vue.showMessage("请选择安检月份!")
775
+ return false
776
+ }
777
+ console.log(this.upCheckPlan)
778
+
779
+ if (this.upCheckPlan.isShare == "是") {
780
+ this.upCheckPlan.f_checker_id = null
781
+ this.upCheckPlan.f_checker = null
782
+ } else {
783
+ this.upCheckPlan.f_checker_id = this.upCheckPlan.checker.id
784
+ this.upCheckPlan.f_checker = this.upCheckPlan.checker.name
785
+ }
786
+ this.isSend = true
787
+ let res = await new HttpResetClass().load("POST", "/rs/logic/updateCheckPlan", {
788
+ data: {
789
+ f_checker: this.upCheckPlan.f_checker,
790
+ f_safecheck_type: this.upCheckPlan.f_safecheck_type,
791
+ f_checker_id: this.upCheckPlan.f_checker_id,
792
+ f_plan_name: this.upCheckPlan.f_plan_name,
793
+ f_plan_year: this.upCheckPlan.f_plan_year,
794
+ f_plan_month: this.upCheckPlan.f_plan_month,
795
+ f_plan_id: this.upCheckPlan.id
796
+ }
797
+ }, {resolveMsg: null, rejectMsg: null})
798
+ if (res.data.code == 200) {
799
+ this.$showMessage("修改成功!")
800
+ this.cancel()
801
+ await this.loadCheckPlan()
802
+ } else {
803
+ this.$showMessage("修改失败!")
804
+ }
805
+ this.isSend = false
806
+ },
807
+ //下发安检计划
808
+ async sendCheckPlan(f) {
809
+ if (this.checkplan.check.checkes.length < 1) {
810
+ this.$showMessage("请选择要下发的安检计划")
811
+ return
812
+ }
813
+ this.isSend = true
814
+ let res = await new HttpResetClass().load("POST", "/rs/logic/NewBespeakCheckPlan", {
815
+ data: {
816
+ f_issued: '是',
817
+ f_issue_time: Util.toStandardTimeString(),
818
+ f_send_operator: this.userlogin.name,
819
+ param: this.checkplan.check.checkes,
820
+ }
821
+ }, {resolveMsg: null, rejectMsg: null})
822
+ if (res.data.code == 200) {
823
+ //Vue.showMessage("下发成功!其中有"+res.data.repet+"个计划己经是下发状态")
824
+ this.$showMessage("下发成功!")
825
+ } else {
826
+ this.$showMessage("下发失败!")
827
+ }
828
+ await this.loadCheckPlan()
829
+ this.isSend = false
830
+ },
831
+ //删除安检计划
832
+ async delCheckPlan(f) {
833
+ if (this.checkplan.check.checkes.length < 1) {
834
+ this.$showMessage("请选择要删除的安检计划")
835
+ return
836
+ }
837
+ this.isSend = true
838
+ let res = await new HttpResetClass().load("POST", "/rs/logic/deleteCheckPlan", {
839
+ data: {
840
+ f_operator: this.userlogin.orgstr,//global.login.name,
841
+ condition: "",
842
+ switchCheckAll: true,
843
+ checkAll: false,
844
+ param: this.checkplan.check.checkes,
845
+ columnName: "f_plan_id"
846
+ }
847
+ }, {resolveMsg: null, rejectMsg: null})
848
+ console.log(JSON.stringify(res))
849
+ if (res.data.code == 200) {
850
+ this.$showMessage("删除成功!")
851
+ } else {
852
+ this.$showMessage("删除失败!")
853
+ }
854
+ if (this.checkplan.check.checkes.indexOf(this.selectPlan.id) != -1) {
855
+ this.selectPlan = {id: ''}
856
+ console.log("包含了清空selectplan")
857
+ }
858
+ await this.loadCheckPlan()
859
+ this.isSend = false
860
+ },
861
+ async refresh() {
862
+ this.$refs.item.$refs.paged.$refs.criteria.search()
863
+ this.$refs.user.$refs.paged.$refs.criteria.search()
864
+ await this.loadCheckPlan()
865
+ },
866
+ async refreshPlan() {
867
+ this.$refs.item.$refs.paged.$refs.criteria.search()
868
+ await this.loadCheckPlan()
869
+ }
870
+ }
871
+ }
872
+ </script>
873
+
874
+ <style scoped>
875
+ .safe-planfont {
876
+ font-family: MicrosoftYaHei;
877
+ font-size: 15px;
878
+ font-weight: normal;
879
+ font-stretch: normal;
880
+ letter-spacing: 2px;
881
+ color: #333333;
882
+ line-height: 25px;
883
+ }
884
+
885
+ .safe-bodyfont {
886
+ font-family: MicrosoftYaHei;
887
+ font-size: 14px;
888
+ font-weight: normal;
889
+ font-stretch: normal;
890
+ letter-spacing: 0px;
891
+ color: #999999;
892
+ line-height: 30px;
893
+ }
894
+
895
+ .safe-leftplan {
896
+ height: auto;
897
+ border-bottom: 1px solid #ececec;
898
+ padding: 10px 5px
899
+ }
900
+
901
+ .leftplan-center {
902
+ border-top: 1px solid #ececec;
903
+ border-bottom: 1px solid #ececec;
904
+ }
905
+
906
+ .safe_p {
907
+ white-space: nowrap;
908
+ overflow: hidden;
909
+ text-overflow: ellipsis;
910
+ }
911
+
912
+ .safe-div-p {
913
+ color: #4792de;
914
+ text-align: end;
915
+ padding: 8px 15px;
916
+ }
917
+
918
+ .safe_list_li:hover {
919
+ background-color: rgb(245, 246, 247);
920
+ }
921
+
922
+ .safe-selectplan {
923
+ pointer-events: none;
924
+ background-color: rgb(216, 234, 251);
925
+ }
926
+
927
+ .safe_plan_list {
928
+ height: 80%;
929
+ overflow: scroll;
930
+ }
931
+
932
+ </style>
933
+ <style>
934
+ .safe_plan_list::-webkit-scrollbar {
935
+ background-color: #F5F5F5;
936
+ }
937
+
938
+ /*定义滚动条轨道 内阴影+圆角*/
939
+ .safe_plan_list::-webkit-scrollbar-track {
940
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
941
+ border-radius: 10px;
942
+ background-color: #F5F5F5;
943
+ }
944
+
945
+ /*定义滑块 内阴影+圆角*/
946
+ .safe_plan_list::-webkit-scrollbar-thumb {
947
+ border-radius: 10px;
948
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
949
+ background-color: #F5F5F5;
950
+ }
951
+ </style>