safecheck-client 3.0.33-127 → 3.0.33-129

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