safecheck-client 3.0.34-gongyi → 3.0.35-gongyi-2

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