safecheck-client 4.0.0-116 → 4.0.0-118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,418 @@
1
+ <template>
2
+ <div>
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
+ <div partial>
6
+ <div class="row">
7
+ <label class="form-group font_normal_body"><b>计划信息</b></label>
8
+ <div class="form-group col-sm-1" v-show="false">
9
+ <!--隐藏条件-->
10
+ <input type="text" class="input_search" v-model="model.f_plan_id"
11
+ style="width: 95%" placeholder="计划id" condition=" i.f_plan_id='{}'">
12
+ </div>
13
+ <div class="form-group col-sm-1" >
14
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
15
+ style="width: 95%" placeholder="客户编号" condition="i.f_userinfo_code='{}'">
16
+ </div>
17
+ <div class="form-group col-sm-1" >
18
+ <input type="text" class="input_search" v-model="model.f_user_name"
19
+ style="width: 95%" placeholder="客户名称" condition="i.f_user_name like '%{}%'">
20
+ </div>
21
+ <div class="form-group col-sm-1" >
22
+ <input type="text" class="input_search" v-model="model.f_address"
23
+ style="width: 95%" placeholder="客户地址" condition="i.f_address like '%{}%'">
24
+ </div>
25
+ <div class="form-group col-sm-1" >
26
+ <datepicker
27
+ placeholder='创建起始'
28
+ style="width:100%"
29
+ :disabled-days-of-week="[]"
30
+ :format="'yyyy-MM-dd'"
31
+ :show-rest-button="reset"
32
+ :value.sync="model.f_starcreate_time"
33
+ v-model="model.f_starcreate_time"
34
+ condition="i.f_create_time >='{} 00:00:00'">
35
+ </datepicker>
36
+ </div>
37
+ <div class="form-group col-sm-1" style="margin-left: 6px;margin-right: 6px;">
38
+ <datepicker
39
+ placeholder='创建结束'
40
+ :disabled-days-of-week="[]"
41
+ style="width:100%"
42
+ :format="'yyyy-MM-dd'"
43
+ :show-rest-button="reset"
44
+ :value.sync="model.f_endcreate_time"
45
+ v-model="model.f_endcreate_time"
46
+ condition="i.f_create_time <='{} 00:00:00'">
47
+ </datepicker>
48
+ </div>
49
+ <!--<div class="form-group col-sm-1" >
50
+ <v-select :width="'95%'"
51
+ class="select select_list"
52
+ :value.sync="$parent.$parent.f_state"
53
+ v-model="$parent.$parent.f_state"
54
+ :options='$parent.$parent.checkState'
55
+ placeholder='安检状态'
56
+ close-on-select
57
+ value-single
58
+ >
59
+ </v-select>
60
+ </div>-->
61
+ <div class="form-group col-sm-3" style="width: 20%;">
62
+ <button class="button_new" style="margin-right: 10px" @click="$parent.$parent.showUserCondition()">更多条件</button>
63
+ <button class="button_search" style="margin-right: 10px" @click="search()">查询</button>
64
+ <!-- <button class="button_search" style="margin-right: 10px" @click="clear()">清除</button>-->
65
+ <export-excel :data="$parent.$parent.exportParameter"
66
+ :field="$parent.$parent.exportExcelField"
67
+ style="margin-left: 0px"
68
+ sqlurl="api/af-safecheck/logic/exportfile" sql-name="planItem"
69
+ :template-name="'安检计划导出'" :choose-col="true">
70
+ </export-excel>
71
+ </div>
72
+ <div class="form-group col-sm-2 safe_p" style="width: 30%;">
73
+ <label class="font_normal_body" style="margin-right: 10px" :title="$parent.$parent.selectplan.f_plan_name">{{$parent.$parent.selectplan.f_plan_name?'当前选中 : '+$parent.$parent.selectplan.f_plan_name:''}}</label>
74
+ <button class="button_search" style="margin-right: 10px" @click="$parent.$parent.showplanModal()">计划调整</button>
75
+ <button class="button_search" @click="$parent.$parent.delPlanItem()" v-show="$parent.$parent.isdelete">移出计划</button>
76
+ </div>
77
+ <modal :show.sync="$parent.$parent.showCondtion" v-ref:modal :width="'50%'" :backdrop="false">
78
+ <div slot="modal-header" class="modal-header">
79
+ <h4 class="modal-title">
80
+ 计划内用户查询条件
81
+ </h4>
82
+ </div>
83
+ <div slot="modal-body" class="modal-body">
84
+ <div class="row">
85
+ <div class="form-group col-sm-4" >
86
+ <label class="font_normal_body">是否已检:</label>
87
+ <v-select
88
+ class="select select_list"
89
+ :value.sync="model.f_state"
90
+ v-model="model.f_state"
91
+ :options='$parent.$parent.checkState'
92
+ @change="$parent.$parent.checkStateChange(model.f_state)"
93
+ placeholder='请选择'
94
+ condition="i.f_state='{}'"
95
+ close-on-select
96
+ value-single
97
+ >
98
+ </v-select>
99
+ </div>
100
+ <div class="form-group col-sm-4" >
101
+ <label class="font_normal_body">安检结果:</label>
102
+ <v-select
103
+ class="select select_list"
104
+ :value.sync="model.f_check_state"
105
+ v-model="model.f_check_state"
106
+ :options='$parent.$parent.checkResults'
107
+ placeholder='请选择'
108
+ condition="i.f_last_check_state='{}'"
109
+ close-on-select
110
+ value-single
111
+ >
112
+ </v-select>
113
+ </div>
114
+ <div class="form-group col-sm-4" >
115
+ <label class="font_normal_body">安检起始:</label>
116
+ <datepicker
117
+ placeholder='请选择'
118
+ style="width:60%"
119
+ :disabled-days-of-week="[]"
120
+ :format="'yyyy-MM-dd'"
121
+ :show-rest-button="reset"
122
+ :value.sync="model.f_startfile_time"
123
+ v-model="model.f_startfile_time"
124
+ condition="i.f_last_check_date >='{} 00:00:00'">
125
+ </datepicker>
126
+ </div>
127
+ <div class="form-group col-sm-4" >
128
+ <label class="font_normal_body">安检截止:</label>
129
+ <datepicker
130
+ placeholder='请选择'
131
+ :disabled-days-of-week="[]"
132
+ style="width:60%"
133
+ :format="'yyyy-MM-dd'"
134
+ :show-rest-button="reset"
135
+ :value.sync="model.f_endfile_time"
136
+ v-model="model.f_endfile_time"
137
+ condition="i.f_last_check_date <='{} 00:00:00'">
138
+ </datepicker>
139
+ </div>
140
+ <!-- <div class="form-group col-sm-4" >-->
141
+ <!-- <label class="font_normal_body">创建起始:</label>-->
142
+ <!-- <datepicker-->
143
+ <!-- placeholder='请选择'-->
144
+ <!-- style="width:60%"-->
145
+ <!-- :disabled-days-of-week="[]"-->
146
+ <!-- :format="'yyyy-MM-dd'"-->
147
+ <!-- :show-rest-button="reset"-->
148
+ <!-- :value.sync="model.f_starcreate_time"-->
149
+ <!-- v-model="model.f_starcreate_time"-->
150
+ <!-- condition="i.f_create_time >='{} 00:00:00'">-->
151
+ <!-- </datepicker>-->
152
+ <!-- </div>-->
153
+ <!-- <div class="form-group col-sm-4" >-->
154
+ <!-- <label class="font_normal_body">创建截止:</label>-->
155
+ <!-- <datepicker-->
156
+ <!-- placeholder='请选择'-->
157
+ <!-- :disabled-days-of-week="[]"-->
158
+ <!-- style="width:60%"-->
159
+ <!-- :format="'yyyy-MM-dd'"-->
160
+ <!-- :show-rest-button="reset"-->
161
+ <!-- :value.sync="model.f_endcreate_time"-->
162
+ <!-- v-model="model.f_endcreate_time"-->
163
+ <!-- condition="i.f_create_time <='{} 00:00:00'">-->
164
+ <!-- </datepicker>-->
165
+ <!-- </div>-->
166
+ </div>
167
+ </div>
168
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
169
+ <button class="button_search" style="margin-right: 15px" @click="search()">查询</button>
170
+ <button class="button_search" @click="$parent.$parent.cancel">取消</button>
171
+ </div>
172
+ </modal>
173
+ </div>
174
+ </div>
175
+ </criteria>
176
+ <data-grid :model="model" partial='list' class="table_sy">
177
+
178
+ <template partial='head'>
179
+ <tr>
180
+ <th><nobr><input type="checkbox" onClick="event.cancelBubble = true" :checked="$parent.$parent.$parent.checkAll" @change="$parent.$parent.$parent.setCheckAll()"/> 全选</nobr></th>
181
+ <th><nobr>用户编号</nobr></th>
182
+ <th><nobr>用户名称</nobr></th>
183
+ <th><nobr>用户电话</nobr></th>
184
+ <th><nobr>用户类型</nobr></th>
185
+ <th><nobr>小区名称</nobr></th>
186
+ <th><nobr>安检状态</nobr></th>
187
+ <th><nobr>地址</nobr></th>
188
+ <th><nobr>创建时间</nobr></th>
189
+ </tr>
190
+ </template>
191
+ <template partial='body'>
192
+ <td style="text-align: center;white-space:nowrap;"><input type="checkbox" onClick="event.cancelBubble = true" :checked="$parent.$parent.$parent.isChecked(row.f_check_item_id)" @change="$parent.$parent.$parent.setCheckes(row.f_check_item_id)" /></td>
193
+ <td style="text-align: center"><nobr>{{row.f_userinfo_code}}</nobr></td>
194
+ <td style="text-align: center"><nobr>{{row.f_user_name}}</nobr></td>
195
+ <td style="text-align: center"><nobr>{{row.f_user_phone}}</nobr></td>
196
+ <td style="text-align: center"><nobr>{{row.f_user_type}}</nobr></td>
197
+ <td style="text-align: center"><nobr>{{row.f_residential_area}}</nobr></td>
198
+ <td style="text-align: center"><nobr>{{row.f_state==='已检'?row.f_last_check_state:'未检'}}</nobr></td>
199
+ <td style="text-align: center"><nobr>{{row.f_address}}</nobr></td>
200
+ <td style="text-align: center"><nobr>{{row.f_create_time}}</nobr></td>
201
+ </template>
202
+ </data-grid>
203
+ </criteria-paged>
204
+ <modal :show.sync="showPlanModal" v-ref:modalp>
205
+ <div slot="modal-header" class="modal-header">
206
+ <h4 class="modal-title">
207
+ 计划内用户调整
208
+ </h4>
209
+ </div>
210
+ <div slot="modal-body" class="modal-body">
211
+ <plan-chooser :f.sync="userlogin.orgid" v-ref:chooser></plan-chooser>
212
+ </div>
213
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
214
+ <button class="button_search" style="margin-right: 15px" @click="dragtoOtherPlanIteem">确认</button>
215
+ <button class="button_search" @click="cancel">取消</button>
216
+ </div>
217
+ </modal>
218
+ </div>
219
+ </template>
220
+
221
+ <script>
222
+ import {HttpResetClass, PagedList} from "vue-client";
223
+ import Vue from "vue";
224
+
225
+ export default {
226
+ name: "PlanManage",
227
+ title: '计划管理',
228
+ data() {
229
+ return {
230
+ model:new PagedList('/api/af-safecheck/sql/planItem', 100, {}),
231
+ isdelete:this.$login.r ? this.$login.r.includes("安检计划删除"):false,
232
+ a:'1',
233
+ opt:[{label:"测试",value:"测试"}],
234
+ showCondtion:false,
235
+ checkAll:false,
236
+ checkes:[],
237
+ checkResults:[{label:'到访不遇',value:'到访不遇'},{label:'拒检',value:'拒检'},{label:'入户',value:'入户'}],
238
+ checkState:[{label:'全部',value:''},{label:'未检',value:'未检'},{label:'已检',value:'已检'}],
239
+ showPlanModal:false,
240
+ exportExcelField: {
241
+ 'f_userinfo_code':'用户编号',
242
+ 'f_user_name':'用户名称',
243
+ 'f_user_type':'用户类型',
244
+ 'f_residential_area':'小区名称',
245
+ 'f_state':'安检状态',
246
+ 'f_address':'地址',
247
+ 'f_user_phone':'用户电话',
248
+ 'f_newfile_date':'建档日期'
249
+ }
250
+ }
251
+ },
252
+ props:["selectplan","userlogin"],
253
+ ready(){
254
+
255
+ },
256
+ computed:{
257
+ exportParameter(){
258
+ // excel 导出条件拼接
259
+ return {
260
+ condition: this.$refs.paged.model.condition,
261
+ groupName: this.groupNameForSql
262
+ }
263
+ }
264
+ },
265
+ methods:{
266
+ clear(){
267
+ this.model.f_plan_id = '';
268
+ this.model.f_userinfo_code = '';
269
+ this.model.f_user_name = '';
270
+ this.model.f_address='';
271
+ },
272
+ //将某个计划下的一项拖到另一个计划
273
+ async dragtoOtherPlanIteem() {
274
+ //tag)
275
+
276
+ if (!this.$refs.modalp.$children[0].selectedRow.id) {
277
+ this.$showMessage("请选择需要调整到那个计划中!")
278
+ return
279
+ }
280
+ this.$parent.isSend=true
281
+ try{
282
+ let res=await new HttpResetClass().load("POST", "/api/af-safecheck/logic/UpCheckPlanItem", {
283
+ data:{
284
+ f_operator:this.userlogin.name,
285
+ f_plan_id:this.$refs.modalp.$children[0].selectedRow.id,
286
+ condition:this.model.condition,
287
+ switchCheckAll:true,
288
+ checkAll:this.checkAll,
289
+ param:this.checkes,
290
+ columnName: "i.id"
291
+ }
292
+ }, {resolveMsg: null, rejectMsg: null})
293
+ this.$parent.isSend=false
294
+ if(res.data.code==200){
295
+ this.$showMessage("更换安检计划成功!")
296
+ this.$parent.refreshPlan()
297
+ }else{
298
+ this.$showMessage("更换安检计划失败!")
299
+ }
300
+ }catch (e) {
301
+ this.$parent.isSend=false
302
+ this.$showMessage("更换安检计划失败!")
303
+ }
304
+ },
305
+ showplanModal(){
306
+ if(!this.selectplan || !this.selectplan.id){
307
+ this.$showMessage("请先打开一个计划再进行操作")
308
+ return
309
+ }
310
+ if(!this.checkAll && this.checkes.length==0){
311
+ this.$showMessage("请先在计划中勾选你要调整的用户!")
312
+ return
313
+ }
314
+ this.showPlanModal=true
315
+ },
316
+ showUserCondition(){
317
+ this.showCondtion=true
318
+ },
319
+ isChecked(v) {
320
+ // 如果全选,不在的按选中算,否则,在的按选中算
321
+ if (this.checkAll) {
322
+ return this.checkes.indexOf(v) == -1
323
+ } else {
324
+ return this.checkes.indexOf(v) != -1
325
+ }
326
+ },
327
+ setCheckAll() {
328
+ this.checkAll=this.checkAll?false:true;
329
+ // 全选改变后,清空选中数据
330
+ this.checkes = []
331
+ },
332
+ setCheckes(id) {
333
+ let index=this.checkes.indexOf(id)
334
+ if(index<0){
335
+ this.checkes.push(id)
336
+ }else{
337
+ this.checkes.splice(index,1)
338
+ }
339
+ },
340
+ cancel(){
341
+ this.showCondtion=false
342
+ this.showPlanModal=false
343
+ },
344
+ selfSearch (args) {
345
+ if(!this.selectplan.id){
346
+ this.$showMessage("请先选择一个计划!")
347
+ return
348
+ }
349
+ this.cancel()
350
+ this.checkes=[]
351
+ this.checkAll=false
352
+ args.condition+= ` and i.f_state!= '作废'`
353
+ this.model.search(args.condition, args.model, args.condValue)
354
+ },
355
+ checkStateChange(val){
356
+ if(val=='未检'){
357
+ this.checkResults=[]
358
+ this.$refs.paged.$refs.criteria.model.f_check_state=''
359
+ }else{
360
+ this.checkResults=[{label:'到访不遇',value:'到访不遇'},{label:'拒检',value:'拒检'},{label:'入户',value:'入户'}]
361
+ }
362
+ },
363
+ //修改计划项状态为作废
364
+ async delPlanItem() {
365
+ if(!this.selectplan || !this.selectplan.id){
366
+ this.$showMessage("请先打开一个计划再进行操作")
367
+ return
368
+ }
369
+ if(!this.checkAll && this.checkes.length==0){
370
+ this.$showMessage("请先在计划中勾选你要作废的用户!")
371
+ return
372
+ }
373
+ this.$showMessage("此操作无法撤回,确定要执行作废安检单操作吗?",['confirm','cancel']).then((button)=>{
374
+ if(button=='confirm'){
375
+ let resu=new HttpResetClass().load("POST", "/api/af-safecheck/logic/UpCheckPlanItemState", {
376
+ data: {
377
+ f_operator:this.userlogin.name,
378
+ condition:this.model.condition,
379
+ switchCheckAll:true,
380
+ checkAll:this.checkAll,
381
+ param:this.checkes,
382
+ columnName: "i.id"
383
+ }
384
+ }, {resolveMsg: null, rejectMsg: null}).then((resu)=>{
385
+
386
+ //tag)
387
+ if(resu.data.code==200){
388
+ this.$showMessage("移除安检单成功! 成功移除:"+resu.data.res.up+"条"+(resu.data.res.noup>0?"有"+resu.data.res.noup+"条已经不是 ‘未检’ 状态!":""))
389
+ //this.checkes=[]
390
+ //this.checkAll=false
391
+ this.$parent.refresh()
392
+ }else{
393
+ this.$showMessage("取消安检计划失败!")
394
+ }
395
+ })
396
+ }
397
+ })
398
+ }
399
+ },
400
+ watch:{
401
+ 'selectplan.id' (){
402
+ //tag
403
+ if(this.selectplan.id){
404
+ this.$refs.paged.$refs.criteria.model.f_plan_id=this.selectplan.id
405
+ this.$refs.paged.$refs.criteria.search()
406
+ }
407
+ }
408
+ }
409
+ }
410
+ </script>
411
+
412
+ <style scoped>
413
+ .safe_p{
414
+ white-space: nowrap;
415
+ overflow: hidden;
416
+ text-overflow: ellipsis;
417
+ }
418
+ </style>