safecheck-client 3.0.35-gongyi-5 → 3.0.35-gongyi-7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,587 +1,586 @@
1
- <template>
2
- <div class="flex">
3
- <work-busy :is-busy="isSend"></work-busy>
4
- <criteria-paged :model="model" v-ref:paged>
5
- <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
6
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
- <div class="row" v-show="!$parent.$parent.$parent.showItem">
8
- <div :class="$parent.$parent.style2" style="margin: 0px">
9
- <role-selector-safe
10
- role-name="安检员"
11
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
12
- @re-res="$parent.$parent.getRes"
13
- :value.sync="model.f_checker_id"
14
- v-model="model.f_checker_id"
15
- condition=" f_checker_name = '{}'">
16
- </role-selector-safe>
17
- </div>
18
- <div :class="$parent.$parent.style" >
19
- <label class="font_normal_body">安检科室</label>
20
- <right-tree-safe islist :userid="$parent.$parent.userid" :source="$parent.$parent.source" v-on:re-res="$parent.$parent.reres2" :textContent="'选择科室'" :selectData="''" v-ref:f_reciever>
21
- </right-tree-safe>
22
- </div>
23
- <div :class="$parent.$parent.style" >
24
- <label class="font_normal_body">开始时间</label>
25
- <datepicker
26
- class="select_list select"
27
- :value.sync="model.f_check_start"
28
- placeholder='开始时间' style="width: 60%"
29
- :disabled-days-of-week="[]"
30
- :format="'yyyy-MM-dd'"
31
- :show-rest-button="reset"
32
- v-model="model.f_check_start"
33
- condition="f_run_date > ='{} 00:00:00'">
34
- </datepicker>
35
- </div>
36
- <div :class="$parent.$parent.style" >
37
- <label class="font_normal_body">结束时间</label>
38
- <datepicker
39
- :value.sync="model.f_check_end"
40
- placeholder='结束时间' style="width: 60%"
41
- :disabled-days-of-week="[]"
42
- :format="'yyyy-MM-dd'"
43
- :show-rest-button="reset"
44
- v-model="model.f_check_end"
45
- condition="f_run_date <= '{} 23:59:59'">
46
- </datepicker>
47
- </div>
48
-
49
- <div :class="$parent.$parent.style" >
50
- <label class="font_normal_body">执行时间</label>
51
- <datepicker
52
- :value.sync="model.f_check_process"
53
- placeholder='执行时间' style="width: 60%"
54
- :disabled-days-of-week="[]"
55
- :format="'yyyy-MM-dd'"
56
- :show-rest-button="reset"
57
- v-model="model.f_check_process"
58
- condition="f_run_date <= '{}'">
59
- </datepicker>
60
- </div>
61
- <div class="row" v-show="!$parent.$parent.$parent.showItem">
62
- <div :class="$parent.$parent.style">
63
- <label class="font_normal_body">安检册名</label>
64
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_check_book_name"
65
- placeholder="安检册名" condition="f_check_book_name like '%{}%'">
66
- </div>
67
- </div>
68
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
69
- <export-excel-safe :data="$parent.$parent.exportParameter"
70
- :field="$parent.$parent.excelHeaders"
71
- sqlurl="rs/logic/SafeExportExcel" sql-name="QueryCheckBook"
72
- template-name='安检册详情列表'></export-excel-safe>
73
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
74
- <div style="float: right" class="button_spacing"
75
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
76
- @click="$parent.$parent.$parent.showItem =! $parent.$parent.$parent.showItem"></div>
77
- <!-- <div style="float: right" class="button_spacing"-->
78
- <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
79
- <!-- @click="$parent.$parent.hidden()">-->
80
- <!-- </div>-->
81
- </div>
82
-
83
-
84
- </div>
85
-
86
-
87
- <div class="row" v-show="$parent.$parent.$parent.showItem">
88
- <div :class="$parent.$parent.style2" style="margin: 0px">
89
- <role-selector-safe
90
- role-name="安检员"
91
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
92
- @re-res="$parent.$parent.getRes"
93
- :value.sync="model.f_checker_id"
94
- v-model="model.f_checker_id"
95
- condition=" f_checker_name = '{}'">
96
- </role-selector-safe>
97
- </div>
98
- <div :class="$parent.$parent.style">
99
- <label class="font_normal_body">安检册名</label>
100
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_check_book_name" id="f_check_book_name"
101
- placeholder="安检册名" condition="f_check_book_name like '%{}%'">
102
- </div>
103
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
104
- <export-excel-safe :data="$parent.$parent.exportParameter"
105
- :field="$parent.$parent.excelHeaders"
106
- sqlurl="rs/logic/SafeExportExcel" sql-name="QueryCheckBook"
107
- template-name='安检册详情列表'></export-excel-safe>
108
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
109
- <div style="float: right" class="button_spacing"
110
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
111
- @click="$parent.$parent.$parent.showItem =! $parent.$parent.$parent.showItem"></div>
112
- <!-- <div style="float: right" class="button_spacing"-->
113
- <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
114
- <!-- @click="$parent.$parent.hidden()">-->
115
- <!-- </div>-->
116
- </div>
117
-
118
- </div>
119
- <div class="row" v-show="$parent.$parent.$parent.showItem">
120
- <div :class="$parent.$parent.style" v-if="$parent.$parent.permission === 'c1'">
121
- <label class="font_normal_body">安检科室</label>
122
- <right-tree-safe islist :userid="$parent.$parent.userid" :source="$parent.$parent.source" v-on:re-res="$parent.$parent.reres2" :textContent="选择科室" :selectData="''" v-ref:f_reciever>
123
- </right-tree-safe>
124
- </div>
125
-
126
- <div :class="$parent.$parent.style" >
127
- <label class="font_normal_body">开始时间</label>
128
- <datepicker
129
- class="select_list select"
130
- :value.sync="model.f_check_start"
131
- placeholder='开始时间' style="width: 60%"
132
- :disabled-days-of-week="[]"
133
- :format="'yyyy-MM-dd'"
134
- :show-rest-button="reset"
135
- v-model="model.f_check_start"
136
- condition="f_run_date > ='{} 00:00:00'">
137
- </datepicker>
138
- </div>
139
- <div :class="$parent.$parent.style" >
140
- <label class="font_normal_body">结束时间</label>
141
- <datepicker
142
- :value.sync="model.f_check_end"
143
- placeholder='结束时间' style="width: 60%"
144
- :disabled-days-of-week="[]"
145
- :format="'yyyy-MM-dd'"
146
- :show-rest-button="reset"
147
- v-model="model.f_check_end"
148
- condition="f_run_date <= '{} 23:59:59'">
149
- </datepicker>
150
- </div>
151
-
152
- <!-- <div :class="$parent.$parent.style" >-->
153
- <!-- <label class="font_normal_body">执行时间</label>-->
154
- <!-- <datepicker-->
155
- <!-- :value.sync="model.f_check_end"-->
156
- <!-- placeholder='执行时间' style="width: 60%"-->
157
- <!-- :disabled-days-of-week="[]"-->
158
- <!-- :format="'yyyy-MM-dd'"-->
159
- <!-- :show-rest-button="reset"-->
160
- <!-- v-model="model.f_check_end"-->
161
- <!-- condition="f_run_date <= '{} 23:59:59'">-->
162
- <!-- </datepicker>-->
163
- <!-- </div>-->
164
- </div>
165
- </div>
166
- </criteria>
167
- <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
168
- <template partial='head'>
169
- <tr>
170
- <th>
171
- <nobr>安检册名称</nobr>
172
- </th>
173
- <th>
174
- <nobr>创建日期</nobr>
175
- </th>
176
- <th>
177
- <nobr>创建人</nobr>
178
- </th>
179
- <th>
180
- <nobr>所属科室</nobr>
181
- </th>
182
- <th>
183
- <nobr>所属安检员</nobr>
184
- </th>
185
- <th>
186
- <nobr>执行日期</nobr>
187
- </th>
188
- <th>
189
- <nobr>执行周期</nobr>
190
- </th>
191
- <th>
192
- <nobr>用户数量</nobr>
193
- </th>
194
- <th>
195
- <nobr>下发时间</nobr>
196
- </th>
197
- <th>
198
- <nobr>操作</nobr>
199
- </th>
200
- </tr>
201
- </template>
202
- <template partial='body'>
203
- <td style="text-align: center;">{{ row.f_check_book_name }}</td>
204
- <td style="text-align: center;">{{ row.f_create_date }}</td>
205
- <td style="text-align: center;">{{ row.f_create_person }}</td>
206
- <td style="text-align: center;">{{ row.f_dep }}</td>
207
- <td style="text-align: center;">{{ row.f_checker_name }}</td>
208
- <td style="text-align: center;">{{ row.f_run_date }}</td>
209
- <td style="text-align: center;">{{ row.f_around_time }}{{ row.f_around_unit }}</td>
210
- <td style="text-align: center;">{{ row.num }}</td>
211
- <td style="text-align: center;">{{ row.f_issue_time }}</td>
212
- <td style="text-align: center;">
213
- <button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.deleteCheckBook(row)' v-if="$parent.$parent.$parent.permission === 'c1'">删除</button>
214
- <button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.updateCheckBook(row)'>修改</button>
215
- <button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.topPlanItem(row)' v-if="$parent.$parent.$parent.permission === 'c2'">下发</button>
216
- </td>
217
-
218
- </template>
219
- </data-grid>
220
- </criteria-paged>
221
- <modal :show.sync="showModal" :backdrop="false">
222
- <div slot="modal-header" class="modal-header">
223
- <h4 class="modal-title">
224
- 修改安检册
225
- </h4>
226
- </div>
227
- <div slot="modal-body" class="modal-body">
228
- <div v-if="true">
229
- <div class="row" style="margin-top: 10px">
230
- <!-- <label class="control-label font text-left" style="float:left;margin-left:10%;margin-top:5px">安检册名称</label>-->
231
- <!-- <div class="col-xs-8 col-md-8">-->
232
- <!-- <input type="text" class="input_search" style="width: 70%;" v-model="checkBook.f_check_book_name"/>-->
233
- <!-- </div>-->
234
- <div class="col-sm-6 form-group" style="margin-top: 20px" v-if="permission === 'c1' && showModal ">
235
- <label class="font_normal_body">安检科室</label>
236
- <right-tree-safe islist :userid="userid" :source="source" v-on:re-res="reres" :textContent="'选择科室'" :select-data="{id:checkBook.f_depid}" v-ref:f_reciever>
237
- </right-tree-safe>
238
- </div>
239
- <div class="col-sm-6 form-group" style="margin-top: 20px" v-if="permission === 'c2' ">
240
- <label class="font_normal_body">安&ensp;检&ensp;员</label>
241
- <v-select :value.sync="checkBook.f_checker_name" v-model='checkBook.f_checker_name'
242
- :value-single="true" style="width: 60%"
243
- class="select_list select"
244
- :options='checkers' placeholder='安检员'
245
- close-on-select></v-select>
246
- </div>
247
- <div class="form-group col-sm-6" style="margin-top: 20px">
248
- <label class="font_normal_body">安检册名</label>
249
- <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
250
- style="width: 60%" >
251
- </div>
252
- <div class="form-group col-sm-6" style="margin-top: 20px">
253
- <label class="font_normal_body">执行日期</label>
254
- <datepicker
255
- :value.sync="checkBook.f_run_date"
256
- style="width: 60%"
257
- :format="'yyyy-MM-dd'"
258
- v-model="checkBook.f_run_date"
259
- >
260
- </datepicker>
261
- </div>
262
- <div class="form-group col-sm-6" style="margin-top: 20px">
263
- <label class="font_normal_body">执行周期</label>
264
- <input type="number" class="input_search" v-model="checkBook.f_around_time"
265
- style="width: 60%" >
266
- </div>
267
- <div class="form-group col-sm-6" style="margin-top: 20px">
268
- <label class="font_normal_body">周期单位</label>
269
- <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
270
- :value-single="true" style="width: 60%"
271
- class="select_list select"
272
- :options='aroundUnit' placeholder=''
273
- close-on-select></v-select>
274
- </div>
275
- </div>
276
- </div>
277
- </div>
278
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
279
- <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
280
- <button class="button_search" @click="cancel">取消</button>
281
- </div>
282
- </modal>
283
- </div>
284
- </template>
285
-
286
- <script>
287
- import {PagedList} from 'vue-client'
288
- import {HttpResetClass} from 'vue-client'
289
- import co from 'co'
290
- import * as Util from './../Util'
291
- import Vue from 'vue'
292
- import {toEndDateString, toStartDateString} from "./../Util";
293
- export default {
294
- title: '用户安检情况',
295
- data () {
296
- return {
297
- searchData: {
298
- condition: '1=1'
299
- },
300
- isSend:false,
301
- aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
302
- showModal:false,
303
- excelHeaders: {
304
- 'f_check_book_name': '安检册名称',
305
- 'f_create_date': '创建日期',
306
- 'f_create_person': '创建人',
307
- 'f_dep': '所属科室',
308
- 'f_checker_name': '所属安检员',
309
- 'f_run_date': '执行日期',
310
- 'f_around_time': '执行周期',
311
- 'f_around_unit': '周期单位',
312
- 'num': '用户数量',
313
- 'f_issue_time': '下发时间'
314
- },
315
- checkers:[],
316
- f_depid:'',
317
- source:
318
- 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
319
- 'tool.getFullTree(dep.where(row.hasSpecialRole($安检册二次分配$)))',
320
- userid: this.$login.f.id,
321
- model: new PagedList('rs/sql/QueryCheckBook', 20),
322
- checkBook :{
323
- f_check_book_name: '',
324
- f_run_date: '',
325
- f_around_time: '',
326
- f_around_unit: '',
327
- f_create_date: '',
328
- f_create_person: '',
329
- f_orgid: '',
330
- f_depid:'',
331
- f_dep:'',
332
- f_checker_name: '',
333
- f_checker_id:''
334
- }
335
- }
336
- },
337
- props: {
338
- style: {
339
- type: String,
340
- default: 'col-sm-2 form-group'
341
- },
342
- style2: {
343
- type: String,
344
- default: 'col-sm-4 form-group'
345
- },
346
- permission:{
347
- type: String
348
- }
349
- },
350
- ready () {
351
- // 获取分公司信息
352
- console.log('执行这里',this.$refs.paged.$refs.criteria.model)
353
- this.$refs.paged.$refs.criteria.model.f_check_start = toStartDateString()
354
- this.$refs.paged.$refs.criteria.model.f_check_end = toEndDateString()
355
- console.log('permission3',this.permission)
356
- this.getChecker()
357
- },
358
- methods: {
359
- reres(val) {
360
- if (!val.resids || val.resids.length === 0 || val.resids[0] ==='undefined' || val.resids.length>1){
361
- return
362
- }
363
- console.log('val2',val)
364
- const resids = val.orgobj.filter(res=>res.resourcetype==='department')
365
- console.log('val2',resids)
366
- if (resids.length>0){
367
- this.checkBook.f_depid = resids[0].id
368
- this.checkBook.f_dep = resids[0].name
369
- }
370
- },
371
- reres2(val){
372
- if (!val.resids || val.resids.length === 0 || val.resids[0] ==='undefined' || !val.resids[0] || val.resids.length>1){
373
- console.log('未选择',val)
374
- this.f_depid = ''
375
- return
376
- }
377
- console.log('val2',val)
378
- const resids = val.orgobj.filter(res=>res.resourcetype==='department')
379
- if (resids.length>0){
380
- this.f_depid = resids[0].id
381
- }
382
- },
383
- topPlanItem(val){
384
- if(!val.f_depid){
385
- this.$showMessage('请补全科室后在进行下发')
386
- return
387
- }
388
- this.isSend = true
389
- console.log('val', val)
390
-
391
- let checkBook = Object.assign({},val)
392
- let nextDate = new Date(checkBook.f_run_date)
393
-
394
- let plan = {
395
- id:this.uuid(),
396
- f_plan_year:nextDate.getFullYear(),
397
- f_plan_month:nextDate.getMonth()+1,
398
- f_plan_name : `${nextDate.getFullYear()}年${nextDate.getMonth()+1}月${checkBook.f_check_book_name}`,
399
- f_plan_type : '预约计划',
400
- f_issued : '是',
401
- f_filialeid : this.$login.f.orgid,
402
- f_create_person : this.$login.f.name,
403
- f_create_time : Util.toStandardDateString(),
404
- f_safecheck_type : '年度普检',
405
- f_checker : checkBook.f_checker_name,
406
- f_checker_id:checkBook.f_checker_id,
407
- f_depid:checkBook.f_depid,
408
- f_dep:checkBook.f_dep
409
- }
410
-
411
- if (checkBook.f_around_unit === '年'){
412
- nextDate.setFullYear(nextDate.getFullYear()+parseInt(checkBook.f_around_time))
413
- }else if (checkBook.f_around_unit === '月'){
414
- nextDate.setMonth(nextDate.getMonth()+parseInt(checkBook.f_around_time))
415
- }else if (checkBook.f_around_time === '日'){
416
- nextDate.setDate(nextDate.getDate()+parseInt(checkBook.f_around_time))
417
- }
418
- let month = nextDate.getMonth()+1
419
- let date = nextDate.getDate()
420
- checkBook.f_run_date = nextDate.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
421
- checkBook.f_issue_time = nextDate.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
422
-
423
- let data ={
424
- checkBook,
425
- plan
426
- }
427
- let http = new HttpResetClass()
428
- http.load('POST', 'rs/logic/safeEntity', {data:{tableName:'t_check_plan',entityData:plan}},
429
- {resolveMsg: null, rejectMsg: '创建计划失败'}).then(res=>{
430
- if (res.data.code===200){
431
- if (typeof res.data.id ==='string'){
432
- const id = JSON.parse(res.data.id).id
433
- const item = {
434
- f_plan_id:id,
435
- f_filialeid:this.$login.f.orgid,
436
- f_check_book_id:checkBook.id
437
- }
438
- return http.load('POST', 'rs/logic/AddCheckPlanItemajc', {data:item}).then(res1=>{
439
- console.log('6666666661',res1)
440
- if (res1.data.code===200){
441
- return http.load('POST', 'rs/logic/safeEntity', {data:{tableName:'t_check_book',entityData:checkBook}}).then(res2=>{
442
- console.log('6666666662',res2)
443
- if (res2.data.code===200){
444
- this.$showMessage('下发成功')
445
- this.$refs.paged.$refs.criteria.search()
446
- this.isSend = false
447
- }
448
- })
449
- }
450
- this.$showMessage('添加计划失败')
451
- this.isSend = false
452
- })
453
- }
454
- }
455
- this.isSend = false
456
- this.$showMessage('创建计划失败')
457
- })
458
- console.log(data)
459
- },
460
- getChecker(){
461
- let http = new HttpResetClass()
462
- http.load('POST', '/rs/search', {data: {source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))', userid: this.$login.f.id}}, {resolveMsg: null, rejectMsg: null})
463
- .then(res => {
464
- console.log('res666-->' + JSON.stringify(res))
465
- this.checkers = res.data.map(res=>{
466
- return {label:res.name,value:res.name,id:res.id}
467
- })
468
- })
469
- },
470
- uuid() {
471
- try {
472
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
473
- var r = Math.random() * 16 | 0,
474
- v = c == 'x' ? r : (r & 0x3 | 0x8);
475
- return v.toString(16);
476
- })
477
- } catch (e) {
478
- //TODO handle the exception
479
- console.log(e)
480
- }
481
- },
482
- ok (){
483
- console.log('this.checkBook', this.checkBook)
484
- if (this.checkBook.f_checker_name){
485
- const checkers = this.checkers.filter(res=>res.value===this.checkBook.f_checker_name)
486
- if (checkers.length>0){
487
- console.log('8888888888888',checkers)
488
- this.checkBook.f_checker_id=checkers[0].id
489
- }
490
- }
491
- let http = new HttpResetClass()
492
- http.load('POST', 'rs/logic/safeEntity', {data:{tableName:'t_check_book',entityData:this.checkBook}},
493
- {resolveMsg: '更新安检册信息成功', rejectMsg: '保存安检册信息成功'}).then(res=>{
494
- if (res.data.code===200){
495
- this.$showMessage('修改成功')
496
- this.showModal = false
497
- this.clearBook()
498
- }
499
- })
500
- },
501
- clearBook(){
502
- this.checkBook= {
503
- f_check_book_name: '',
504
- f_run_date: '',
505
- f_around_time: '',
506
- f_around_unit: '',
507
- f_create_date: '',
508
- f_create_person: '',
509
- f_orgid: '',
510
- f_depid:'',
511
- f_dep:'',
512
- f_checker_name: '',
513
- f_checker_id:''
514
- }
515
- },
516
- cancel () {
517
- this.showModal = false
518
- this.clearBook()
519
-
520
- },
521
- updateCheckBook(val){
522
- console.log(val)
523
- this.checkBook=val
524
- console.log(this.checkBook)
525
- this.showModal = true
526
- },
527
- search (args) {
528
- // console.log('8888888888888', this.model.f_filialeids)
529
- args.condition += ` and f_orgid in ${this.model.f_filialeids}`
530
- if (this.permission === 'c2'){
531
- args.condition +=` and tcb.f_depid = '${this.$login.f.depids}'`
532
- }
533
- if (this.f_depid && this.permission === 'c1'){
534
- args.condition +=` and tcb.f_depid = '${this.f_depid}'`
535
- }
536
- return this.model.search(args.condition, args.model)
537
- },
538
- getRes (obj) {
539
- this.model.f_filialeids = this.$login.convertToIn(obj.resids)
540
- },
541
- async deleteCheckBook (val) {
542
- this.$showMessage('是否确认删除安检册,此操作无法撤销!', ['confirm', 'cancel']).then(async (res) => {
543
- if(res == 'confirm'){
544
- try {
545
- console.log('val', val.id)
546
- let http = new HttpResetClass()
547
- let upAddress = `update t_user_address set f_check_book_id = null where f_check_book_id = '${val.id}'`
548
- let delCheckBook= `delete from t_check_book where id ='${val.id}'`
549
- await http.load('POST', 'rs/logic/runSQL', {data: {sql: upAddress}},
550
- {resolveMsg: null, rejectMsg: '删除安检册失败'})
551
- await http.load('POST', 'rs/logic/runSQL', {data: {sql: delCheckBook}},
552
- {resolveMsg: null, rejectMsg: '删除安检册失败'})
553
- this.$showMessage('删除成功')
554
- this.$refs.paged.$refs.criteria.search()
555
- }catch (e) {
556
- this.$showMessage('删除失败',e)
557
- }
558
- }
559
- })
560
- }
561
- },
562
-
563
- watch: {
564
- },
565
- computed: {
566
- // 导出到Excel的条件构造
567
- exportParameter() {
568
- return {
569
- condition: this.$refs.paged.model.condition
570
- }
571
- },
572
- selected () {
573
- return this.$refs.paged.$refs.grid.selected
574
- }
575
- }
576
- }
577
- </script>
578
- <style scoped>
579
- .newcolor {
580
- color: red;
581
- }
582
-
583
- .table th {
584
- background-color: #f2f6fa;
585
- color: black;
586
- }
587
- </style>
1
+ <template>
2
+ <div class="flex">
3
+ <work-busy :is-busy="isSend"></work-busy>
4
+ <criteria-paged :model="model" v-ref:paged>
5
+ <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
6
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
+ <div class="row" v-show="!$parent.$parent.$parent.showItem">
8
+ <div :class="$parent.$parent.style2" style="margin: 0px">
9
+ <role-selector-safe
10
+ role-name="安检员"
11
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
12
+ @re-res="$parent.$parent.getRes"
13
+ :value.sync="model.f_checker_id"
14
+ v-model="model.f_checker_id"
15
+ condition=" f_checker_name = '{}'">
16
+ </role-selector-safe>
17
+ </div>
18
+ <div :class="$parent.$parent.style" >
19
+ <label class="font_normal_body">安检科室</label>
20
+ <right-tree-safe islist :userid="$parent.$parent.userid" :source="$parent.$parent.source" v-on:re-res="$parent.$parent.reres2" :textContent="'选择科室'" :selectData="''" v-ref:f_reciever>
21
+ </right-tree-safe>
22
+ </div>
23
+
24
+ <div :class="$parent.$parent.style" >
25
+ <label class="font_normal_body">开始时间</label>
26
+ <datepicker
27
+ class="select_list select"
28
+ :value.sync="model.f_check_start"
29
+ placeholder='执行开始时间' style="width: 60%"
30
+ :disabled-days-of-week="[]"
31
+ :format="'yyyy-MM-dd'"
32
+ :show-rest-button="reset"
33
+ v-model="model.f_check_start"
34
+ condition="f_run_date > ='{} 00:00:00'">
35
+ </datepicker>
36
+ </div>
37
+ <div :class="$parent.$parent.style" >
38
+ <label class="font_normal_body">结束时间</label>
39
+ <datepicker
40
+ :value.sync="model.f_check_end"
41
+ placeholder='执行结束时间' style="width: 60%"
42
+ :disabled-days-of-week="[]"
43
+ :format="'yyyy-MM-dd'"
44
+ :show-rest-button="reset"
45
+ v-model="model.f_check_end"
46
+ condition="f_run_date <= '{} 23:59:59'">
47
+ </datepicker>
48
+ </div>
49
+
50
+ <div :class="$parent.$parent.style" >
51
+ <label class="font_normal_body">执行时间</label>
52
+ <datepicker
53
+ :value.sync="model.f_check_process"
54
+ placeholder='执行时间' style="width: 60%"
55
+ :disabled-days-of-week="[]"
56
+ :format="'yyyy-MM-dd'"
57
+ :show-rest-button="reset"
58
+ v-model="model.f_check_process"
59
+ condition="f_run_date <= '{}'">
60
+ </datepicker>
61
+ </div>
62
+ <div class="row" v-show="!$parent.$parent.$parent.showItem">
63
+ <div :class="$parent.$parent.style">
64
+ <label class="font_normal_body">安检册名</label>
65
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_check_book_name"
66
+ placeholder="安检册名" condition="f_check_book_name like '%{}%'">
67
+ </div>
68
+ </div>
69
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
70
+ <export-excel-safe :data="$parent.$parent.exportParameter"
71
+ :field="$parent.$parent.excelHeaders"
72
+ sqlurl="rs/logic/SafeExportExcel" sql-name="QueryCheckBook"
73
+ template-name='安检册详情列表'></export-excel-safe>
74
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
75
+ <div style="float: right" class="button_spacing"
76
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
77
+ @click="$parent.$parent.$parent.showItem =! $parent.$parent.$parent.showItem"></div>
78
+ <!-- <div style="float: right" class="button_spacing"-->
79
+ <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
80
+ <!-- @click="$parent.$parent.hidden()">-->
81
+ <!-- </div>-->
82
+ </div>
83
+
84
+
85
+ </div>
86
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
87
+ <div :class="$parent.$parent.style2" style="margin: 0px">
88
+ <role-selector-safe
89
+ role-name="安检员"
90
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
91
+ @re-res="$parent.$parent.getRes"
92
+ :value.sync="model.f_checker_id"
93
+ v-model="model.f_checker_id"
94
+ condition=" f_checker_name = '{}'">
95
+ </role-selector-safe>
96
+ </div>
97
+ <div :class="$parent.$parent.style">
98
+ <label class="font_normal_body">安检册名</label>
99
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_check_book_name" id="f_check_book_name"
100
+ placeholder="安检册名" condition="f_check_book_name like '%{}%'">
101
+ </div>
102
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
103
+ <export-excel-safe :data="$parent.$parent.exportParameter"
104
+ :field="$parent.$parent.excelHeaders"
105
+ sqlurl="rs/logic/SafeExportExcel" sql-name="QueryCheckBook"
106
+ template-name='安检册详情列表'></export-excel-safe>
107
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
108
+ <div style="float: right" class="button_spacing"
109
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
110
+ @click="$parent.$parent.$parent.showItem =! $parent.$parent.$parent.showItem"></div>
111
+ <!-- <div style="float: right" class="button_spacing"-->
112
+ <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
113
+ <!-- @click="$parent.$parent.hidden()">-->
114
+ <!-- </div>-->
115
+ </div>
116
+
117
+ </div>
118
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
119
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.permission === 'c1'">
120
+ <label class="font_normal_body">安检科室</label>
121
+ <right-tree-safe islist :userid="$parent.$parent.userid" :source="$parent.$parent.source" v-on:re-res="$parent.$parent.reres2" :textContent="选择科室" :selectData="''" v-ref:f_reciever>
122
+ </right-tree-safe>
123
+ </div>
124
+
125
+ <div :class="$parent.$parent.style" >
126
+ <label class="font_normal_body">开始时间</label>
127
+ <datepicker
128
+ class="select_list select"
129
+ :value.sync="model.f_check_start"
130
+ placeholder='开始时间' style="width: 60%"
131
+ :disabled-days-of-week="[]"
132
+ :format="'yyyy-MM-dd'"
133
+ :show-rest-button="reset"
134
+ v-model="model.f_check_start"
135
+ condition="f_run_date > ='{} 00:00:00'">
136
+ </datepicker>
137
+ </div>
138
+ <div :class="$parent.$parent.style" >
139
+ <label class="font_normal_body">结束时间</label>
140
+ <datepicker
141
+ :value.sync="model.f_check_end"
142
+ placeholder='结束时间' style="width: 60%"
143
+ :disabled-days-of-week="[]"
144
+ :format="'yyyy-MM-dd'"
145
+ :show-rest-button="reset"
146
+ v-model="model.f_check_end"
147
+ condition="f_run_date <= '{} 23:59:59'">
148
+ </datepicker>
149
+ </div>
150
+
151
+ <!-- <div :class="$parent.$parent.style" >-->
152
+ <!-- <label class="font_normal_body">执行时间</label>-->
153
+ <!-- <datepicker-->
154
+ <!-- :value.sync="model.f_check_end"-->
155
+ <!-- placeholder='执行时间' style="width: 60%"-->
156
+ <!-- :disabled-days-of-week="[]"-->
157
+ <!-- :format="'yyyy-MM-dd'"-->
158
+ <!-- :show-rest-button="reset"-->
159
+ <!-- v-model="model.f_check_end"-->
160
+ <!-- condition="f_run_date <= '{} 23:59:59'">-->
161
+ <!-- </datepicker>-->
162
+ <!-- </div>-->
163
+ </div>
164
+ </div>
165
+ </criteria>
166
+ <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
167
+ <template partial='head'>
168
+ <tr>
169
+ <th>
170
+ <nobr>安检册名称</nobr>
171
+ </th>
172
+ <th>
173
+ <nobr>创建日期</nobr>
174
+ </th>
175
+ <th>
176
+ <nobr>创建人</nobr>
177
+ </th>
178
+ <th>
179
+ <nobr>所属科室</nobr>
180
+ </th>
181
+ <th>
182
+ <nobr>所属安检员</nobr>
183
+ </th>
184
+ <th>
185
+ <nobr>执行日期</nobr>
186
+ </th>
187
+ <th>
188
+ <nobr>执行周期</nobr>
189
+ </th>
190
+ <th>
191
+ <nobr>用户数量</nobr>
192
+ </th>
193
+ <th>
194
+ <nobr>下发时间</nobr>
195
+ </th>
196
+ <th>
197
+ <nobr>操作</nobr>
198
+ </th>
199
+ </tr>
200
+ </template>
201
+ <template partial='body'>
202
+ <td style="text-align: center;">{{ row.f_check_book_name }}</td>
203
+ <td style="text-align: center;">{{ row.f_create_date }}</td>
204
+ <td style="text-align: center;">{{ row.f_create_person }}</td>
205
+ <td style="text-align: center;">{{ row.f_dep }}</td>
206
+ <td style="text-align: center;">{{ row.f_checker_name }}</td>
207
+ <td style="text-align: center;">{{ row.f_run_date }}</td>
208
+ <td style="text-align: center;">{{ row.f_around_time }}{{ row.f_around_unit }}</td>
209
+ <td style="text-align: center;">{{ row.num }}</td>
210
+ <td style="text-align: center;">{{ row.f_issue_time }}</td>
211
+ <td style="text-align: center;">
212
+ <button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.deleteCheckBook(row)' v-if="$parent.$parent.$parent.permission === 'c1'">删除</button>
213
+ <button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.updateCheckBook(row)'>修改</button>
214
+ <button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.topPlanItem(row)' v-if="$parent.$parent.$parent.permission === 'c2'">下发</button>
215
+ </td>
216
+
217
+ </template>
218
+ </data-grid>
219
+ </criteria-paged>
220
+ <modal :show.sync="showModal" :backdrop="false">
221
+ <div slot="modal-header" class="modal-header">
222
+ <h4 class="modal-title">
223
+ 修改安检册
224
+ </h4>
225
+ </div>
226
+ <div slot="modal-body" class="modal-body">
227
+ <div v-if="true">
228
+ <div class="row" style="margin-top: 10px">
229
+ <!-- <label class="control-label font text-left" style="float:left;margin-left:10%;margin-top:5px">安检册名称</label>-->
230
+ <!-- <div class="col-xs-8 col-md-8">-->
231
+ <!-- <input type="text" class="input_search" style="width: 70%;" v-model="checkBook.f_check_book_name"/>-->
232
+ <!-- </div>-->
233
+ <div class="col-sm-6 form-group" style="margin-top: 20px" v-if="permission === 'c1' && showModal ">
234
+ <label class="font_normal_body">安检科室</label>
235
+ <right-tree-safe islist :userid="userid" :source="source" v-on:re-res="reres" :textContent="'选择科室'" :select-data="{id:checkBook.f_depid}" v-ref:f_reciever>
236
+ </right-tree-safe>
237
+ </div>
238
+ <div class="col-sm-6 form-group" style="margin-top: 20px" v-if="permission === 'c2' ">
239
+ <label class="font_normal_body">安&ensp;检&ensp;员</label>
240
+ <v-select :value.sync="checkBook.f_checker_name" v-model='checkBook.f_checker_name'
241
+ :value-single="true" style="width: 60%"
242
+ class="select_list select"
243
+ :options='checkers' placeholder='安检员'
244
+ close-on-select></v-select>
245
+ </div>
246
+ <div class="form-group col-sm-6" style="margin-top: 20px">
247
+ <label class="font_normal_body">安检册名</label>
248
+ <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
249
+ style="width: 60%" >
250
+ </div>
251
+ <div class="form-group col-sm-6" style="margin-top: 20px">
252
+ <label class="font_normal_body">执行日期</label>
253
+ <datepicker
254
+ :value.sync="checkBook.f_run_date"
255
+ style="width: 60%"
256
+ :format="'yyyy-MM-dd'"
257
+ v-model="checkBook.f_run_date"
258
+ >
259
+ </datepicker>
260
+ </div>
261
+ <div class="form-group col-sm-6" style="margin-top: 20px">
262
+ <label class="font_normal_body">执行周期</label>
263
+ <input type="number" class="input_search" v-model="checkBook.f_around_time"
264
+ style="width: 60%" >
265
+ </div>
266
+ <div class="form-group col-sm-6" style="margin-top: 20px">
267
+ <label class="font_normal_body">周期单位</label>
268
+ <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
269
+ :value-single="true" style="width: 60%"
270
+ class="select_list select"
271
+ :options='aroundUnit' placeholder=''
272
+ close-on-select></v-select>
273
+ </div>
274
+ </div>
275
+ </div>
276
+ </div>
277
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
278
+ <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
279
+ <button class="button_search" @click="cancel">取消</button>
280
+ </div>
281
+ </modal>
282
+ </div>
283
+ </template>
284
+
285
+ <script>
286
+ import {PagedList} from 'vue-client'
287
+ import {HttpResetClass} from 'vue-client'
288
+ import co from 'co'
289
+ import * as Util from './../Util'
290
+ import Vue from 'vue'
291
+ import {toEndDateString, toStartDateString} from "./../Util";
292
+ export default {
293
+ title: '用户安检情况',
294
+ data () {
295
+ return {
296
+ searchData: {
297
+ condition: '1=1'
298
+ },
299
+ isSend:false,
300
+ aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
301
+ showModal:false,
302
+ excelHeaders: {
303
+ 'f_check_book_name': '安检册名称',
304
+ 'f_create_date': '创建日期',
305
+ 'f_create_person': '创建人',
306
+ 'f_dep': '所属科室',
307
+ 'f_checker_name': '所属安检员',
308
+ 'f_run_date': '执行日期',
309
+ 'f_around_time': '执行周期',
310
+ 'f_around_unit': '周期单位',
311
+ 'num': '用户数量',
312
+ 'f_issue_time': '下发时间'
313
+ },
314
+ checkers:[],
315
+ f_depid:'',
316
+ source:
317
+ 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
318
+ 'tool.getFullTree(dep.where(row.hasSpecialRole($安检册二次分配$)))',
319
+ userid: this.$login.f.id,
320
+ model: new PagedList('rs/sql/QueryCheckBook', 20),
321
+ checkBook :{
322
+ f_check_book_name: '',
323
+ f_run_date: '',
324
+ f_around_time: '',
325
+ f_around_unit: '',
326
+ f_create_date: '',
327
+ f_create_person: '',
328
+ f_orgid: '',
329
+ f_depid:'',
330
+ f_dep:'',
331
+ f_checker_name: '',
332
+ f_checker_id:''
333
+ }
334
+ }
335
+ },
336
+ props: {
337
+ style: {
338
+ type: String,
339
+ default: 'col-sm-2 form-group'
340
+ },
341
+ style2: {
342
+ type: String,
343
+ default: 'col-sm-4 form-group'
344
+ },
345
+ permission:{
346
+ type: String
347
+ }
348
+ },
349
+ ready () {
350
+ // 获取分公司信息
351
+ console.log('执行这里',this.$refs.paged.$refs.criteria.model)
352
+ // this.$refs.paged.$refs.criteria.model.f_check_start = toStartDateString()
353
+ // this.$refs.paged.$refs.criteria.model.f_check_end = toEndDateString()
354
+ console.log('permission3',this.permission)
355
+ this.getChecker()
356
+ },
357
+ methods: {
358
+ reres(val) {
359
+ if (!val.resids || val.resids.length === 0 || val.resids[0] ==='undefined' || val.resids.length>1){
360
+ return
361
+ }
362
+ console.log('val2',val)
363
+ const resids = val.orgobj.filter(res=>res.resourcetype==='department')
364
+ console.log('val2',resids)
365
+ if (resids.length>0){
366
+ this.checkBook.f_depid = resids[0].id
367
+ this.checkBook.f_dep = resids[0].name
368
+ }
369
+ },
370
+ reres2(val){
371
+ if (!val.resids || val.resids.length === 0 || val.resids[0] ==='undefined' || !val.resids[0] || val.resids.length>1){
372
+ console.log('未选择',val)
373
+ this.f_depid = ''
374
+ return
375
+ }
376
+ console.log('val2',val)
377
+ const resids = val.orgobj.filter(res=>res.resourcetype==='department')
378
+ if (resids.length>0){
379
+ this.f_depid = resids[0].id
380
+ }
381
+ },
382
+ topPlanItem(val){
383
+ if(!val.f_depid){
384
+ this.$showMessage('请补全科室后在进行下发')
385
+ return
386
+ }
387
+ this.isSend = true
388
+ console.log('val', val)
389
+
390
+ let checkBook = Object.assign({},val)
391
+ let nextDate = new Date(checkBook.f_run_date)
392
+
393
+ let plan = {
394
+ id:this.uuid(),
395
+ f_plan_year:nextDate.getFullYear(),
396
+ f_plan_month:nextDate.getMonth()+1,
397
+ f_plan_name : `${nextDate.getFullYear()}年${nextDate.getMonth()+1}月${checkBook.f_check_book_name}`,
398
+ f_plan_type : '预约计划',
399
+ f_issued : '',
400
+ f_filialeid : this.$login.f.orgid,
401
+ f_create_person : this.$login.f.name,
402
+ f_create_time : Util.toStandardDateString(),
403
+ f_safecheck_type : '年度普检',
404
+ f_checker : checkBook.f_checker_name,
405
+ f_checker_id:checkBook.f_checker_id,
406
+ f_depid:checkBook.f_depid,
407
+ f_dep:checkBook.f_dep
408
+ }
409
+
410
+ if (checkBook.f_around_unit === '年'){
411
+ nextDate.setFullYear(nextDate.getFullYear()+parseInt(checkBook.f_around_time))
412
+ }else if (checkBook.f_around_unit === '月'){
413
+ nextDate.setMonth(nextDate.getMonth()+parseInt(checkBook.f_around_time))
414
+ }else if (checkBook.f_around_time === '日'){
415
+ nextDate.setDate(nextDate.getDate()+parseInt(checkBook.f_around_time))
416
+ }
417
+ let month = nextDate.getMonth()+1
418
+ let date = nextDate.getDate()
419
+ checkBook.f_run_date = nextDate.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
420
+ checkBook.f_issue_time = nextDate.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
421
+
422
+ let data ={
423
+ checkBook,
424
+ plan
425
+ }
426
+ let http = new HttpResetClass()
427
+ http.load('POST', 'rs/logic/safeEntity', {data:{tableName:'t_check_plan',entityData:plan}},
428
+ {resolveMsg: null, rejectMsg: '创建计划失败'}).then(res=>{
429
+ if (res.data.code===200){
430
+ if (typeof res.data.id ==='string'){
431
+ const id = JSON.parse(res.data.id).id
432
+ const item = {
433
+ f_plan_id:id,
434
+ f_filialeid:this.$login.f.orgid,
435
+ f_check_book_id:checkBook.id
436
+ }
437
+ return http.load('POST', 'rs/logic/AddCheckPlanItemajc', {data:item}).then(res1=>{
438
+ console.log('6666666661',res1)
439
+ if (res1.data.code===200){
440
+ return http.load('POST', 'rs/logic/safeEntity', {data:{tableName:'t_check_book',entityData:checkBook}}).then(res2=>{
441
+ console.log('6666666662',res2)
442
+ if (res2.data.code===200){
443
+ this.$showMessage('下发成功')
444
+ this.$refs.paged.$refs.criteria.search()
445
+ this.isSend = false
446
+ }
447
+ })
448
+ }
449
+ this.$showMessage('添加计划失败')
450
+ this.isSend = false
451
+ })
452
+ }
453
+ }
454
+ this.isSend = false
455
+ this.$showMessage('创建计划失败')
456
+ })
457
+ console.log(data)
458
+ },
459
+ getChecker(){
460
+ let http = new HttpResetClass()
461
+ http.load('POST', '/rs/search', {data: {source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))', userid: this.$login.f.id}}, {resolveMsg: null, rejectMsg: null})
462
+ .then(res => {
463
+ console.log('res666-->' + JSON.stringify(res))
464
+ this.checkers = res.data.map(res=>{
465
+ return {label:res.name,value:res.name,id:res.id}
466
+ })
467
+ })
468
+ },
469
+ uuid() {
470
+ try {
471
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
472
+ var r = Math.random() * 16 | 0,
473
+ v = c == 'x' ? r : (r & 0x3 | 0x8);
474
+ return v.toString(16);
475
+ })
476
+ } catch (e) {
477
+ //TODO handle the exception
478
+ console.log(e)
479
+ }
480
+ },
481
+ ok (){
482
+ console.log('this.checkBook', this.checkBook)
483
+ if (this.checkBook.f_checker_name){
484
+ const checkers = this.checkers.filter(res=>res.value===this.checkBook.f_checker_name)
485
+ if (checkers.length>0){
486
+ console.log('8888888888888',checkers)
487
+ this.checkBook.f_checker_id=checkers[0].id
488
+ }
489
+ }
490
+ let http = new HttpResetClass()
491
+ http.load('POST', 'rs/logic/safeEntity', {data:{tableName:'t_check_book',entityData:this.checkBook}},
492
+ {resolveMsg: '更新安检册信息成功', rejectMsg: '保存安检册信息成功'}).then(res=>{
493
+ if (res.data.code===200){
494
+ this.$showMessage('修改成功')
495
+ this.showModal = false
496
+ this.clearBook()
497
+ }
498
+ })
499
+ },
500
+ clearBook(){
501
+ this.checkBook= {
502
+ f_check_book_name: '',
503
+ f_run_date: '',
504
+ f_around_time: '',
505
+ f_around_unit: '',
506
+ f_create_date: '',
507
+ f_create_person: '',
508
+ f_orgid: '',
509
+ f_depid:'',
510
+ f_dep:'',
511
+ f_checker_name: '',
512
+ f_checker_id:''
513
+ }
514
+ },
515
+ cancel () {
516
+ this.showModal = false
517
+ this.clearBook()
518
+
519
+ },
520
+ updateCheckBook(val){
521
+ console.log(val)
522
+ this.checkBook=val
523
+ console.log(this.checkBook)
524
+ this.showModal = true
525
+ },
526
+ search (args) {
527
+ // console.log('8888888888888', this.model.f_filialeids)
528
+ args.condition += ` and f_orgid in ${this.model.f_filialeids}`
529
+ if (this.permission === 'c2'){
530
+ args.condition +=` and tcb.f_depid = '${this.$login.f.depids}'`
531
+ }
532
+ if (this.f_depid && this.permission === 'c1'){
533
+ args.condition +=` and tcb.f_depid = '${this.f_depid}'`
534
+ }
535
+ return this.model.search(args.condition, args.model)
536
+ },
537
+ getRes (obj) {
538
+ this.model.f_filialeids = this.$login.convertToIn(obj.resids)
539
+ },
540
+ async deleteCheckBook (val) {
541
+ this.$showMessage('是否确认删除安检册,此操作无法撤销!', ['confirm', 'cancel']).then(async (res) => {
542
+ if(res == 'confirm'){
543
+ try {
544
+ console.log('val', val.id)
545
+ let http = new HttpResetClass()
546
+ let upAddress = `update t_user_address set f_check_book_id = null where f_check_book_id = '${val.id}'`
547
+ let delCheckBook= `delete from t_check_book where id ='${val.id}'`
548
+ await http.load('POST', 'rs/logic/runSQL', {data: {sql: upAddress}},
549
+ {resolveMsg: null, rejectMsg: '删除安检册失败'})
550
+ await http.load('POST', 'rs/logic/runSQL', {data: {sql: delCheckBook}},
551
+ {resolveMsg: null, rejectMsg: '删除安检册失败'})
552
+ this.$showMessage('删除成功')
553
+ this.$refs.paged.$refs.criteria.search()
554
+ }catch (e) {
555
+ this.$showMessage('删除失败',e)
556
+ }
557
+ }
558
+ })
559
+ }
560
+ },
561
+
562
+ watch: {
563
+ },
564
+ computed: {
565
+ // 导出到Excel的条件构造
566
+ exportParameter() {
567
+ return {
568
+ condition: this.$refs.paged.model.condition
569
+ }
570
+ },
571
+ selected () {
572
+ return this.$refs.paged.$refs.grid.selected
573
+ }
574
+ }
575
+ }
576
+ </script>
577
+ <style scoped>
578
+ .newcolor {
579
+ color: red;
580
+ }
581
+
582
+ .table th {
583
+ background-color: #f2f6fa;
584
+ color: black;
585
+ }
586
+ </style>