safecheck-client 3.0.35-gongyi → 3.0.35-gongyi-1

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