safecheck-client 3.0.35-gongyi-7 → 3.0.35-gongyi-9
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/components/pc/CheckBookList.vue +586 -586
- package/src/components/pc/CheckBookManage.vue +1 -1
- package/src/components/pc/RoleSelector.vue +125 -125
- package/src/components/report/CheckPlanAreaList.vue +530 -530
- package/src/main.js +33 -33
@@ -1,586 +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="安 检 员 "
|
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="安 检 员 "
|
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">安 检 员</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>
|
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="安 检 员 "
|
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="安 检 员 "
|
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">安 检 员</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>
|