safecheck-client 3.0.35-gongyi → 3.0.35-gongyi-3

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