safecheck-client 3.0.35-12 → 3.0.35-13

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.
@@ -1,607 +1,607 @@
1
- <template>
2
- <div class="flex">
3
- <criteria-paged :model="model" v-ref:paged :pager="false">
4
- <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
5
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
- <div class="row">
7
- <!--<div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}">
8
- <label class="font_normal_body">组织机构</label>
9
- <res-select restype='organization'
10
- class="select select_list"
11
- style="width: 60%"
12
- @res-select="$parent.$parent.getorg"
13
- :initresid='$parent.$parent.curorgid'>
14
- </res-select>
15
- </div>-->
16
- <!-- <div :class="{'col-sm-6':$parent.$parent.$parent.isdetail,'col-sm-4':!$parent.$parent.$parent.isdetail}">-->
17
- <!-- <role-selector-safe-->
18
- <!-- role-name="安检员"-->
19
- <!-- role-lable="安&ensp;检&ensp;员"-->
20
- <!-- @re-res="$parent.$parent.getorg"-->
21
- <!-- :value.sync="model.f_checker_id"-->
22
- <!-- v-model="model.f_checker_id"-->
23
- <!-- condition="f_checker_name like '%{}%'">-->
24
- <!-- </role-selector-safe>-->
25
- <!-- </div>-->
26
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}">
27
- <label class="font_normal_body">小区名称</label>
28
- <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_area" placeholder='小区名称'
29
- condition="f_residential_area like '%{}%'" v-next-el="cx" v-el:qjmc>
30
- </div>
31
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}">
32
- <label class="font_normal_body">计划名称</label>
33
- <v-select class="select_list select" style="width: 60%"
34
- placeholder='计划名称'
35
- :search="true"
36
- v-model="model.f_plan_name"
37
- :value.sync="model.f_plan_name"
38
- :options='$parent.$parent.planName'
39
- condition="f_plan_id = '{}'"
40
- :value-single="true"
41
- close-on-select clear-button></v-select>
42
-
43
- </div>
44
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" style="float:right; padding-right: 25px">
45
- <div class="span" style="float:right;">
46
- <div style="float: right;margin-left:10px" class="button_spacing"
47
- :class="{'button_shrink_left':!$parent.$parent.$parent.isdetail,'button_shrink_right':$parent.$parent.$parent.isdetail}"
48
- @click="$parent.$parent.hiddenr()"></div>
49
- <div class="button_spacing" style="float: right;margin-left:10px"
50
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
51
- @click="$parent.$parent.hidden()">
52
- </div>
53
- <button id="btnaaaa" style="float: right" class="button_search"
54
- @click="$parent.$parent.exportexcel()"
55
- v-el:cx>导出</button>
56
- <button id="btnaaa" style="float: right" class="button_search"
57
- @click="$parent.$parent.getGroupName1(),search(),$parent.$parent.getexportExcelField(),$parent.$parent.$parent.isdetail=false,$parent.$parent.listflag=false"
58
- v-el:cx>查询</button>
59
- <button id="cle" style="float: right" class="button_search"
60
- @click="$parent.$parent.cleamsg()"
61
- v-el:cx>清空</button>
62
- </div>
63
- </div>
64
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
65
- <label class="font_normal_body">起始时间</label>
66
- <datepicker
67
- :value.sync="$parent.$parent.f_check_start"
68
- placeholder='起始时间' style="width:60%"
69
- :disabled-days-of-week="[]"
70
- :format="'yyyy-MM'"
71
- :select-month="true"
72
- :show-rest-button="reset">
73
- </datepicker>
74
- </div>
75
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
76
- <label class="font_normal_body">结束时间</label>
77
- <datepicker
78
- :value.sync="$parent.$parent.f_check_end"
79
- placeholder='结束时间' style="width:60%"
80
- :disabled-days-of-week="[]"
81
- :format="'yyyy-MM'"
82
- :select-month="true"
83
- :show-rest-button="reset">
84
- </datepicker>
85
- </div>
86
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
87
- <label class="font_normal_body">安检时间</label>
88
- <datepicker
89
- :value.sync="$parent.$parent.f_safe_start"
90
- placeholder='结束时间' style="width: 60%"
91
- :disabled-days-of-week="[]"
92
- :format="'yyyy-MM-dd 00:00:00'"
93
- :show-rest-button="reset"
94
- v-model="$parent.$parent.f_safe_start"
95
- >
96
- </datepicker>
97
- </div>
98
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
99
- <label class="font_normal_body">安检时间</label>
100
- <datepicker
101
- :value.sync="$parent.$parent.f_safe_end"
102
- placeholder='结束时间' style="width: 60%"
103
- :disabled-days-of-week="[]"
104
- :format="'yyyy-MM-dd 23:59:59'"
105
- :show-rest-button="reset"
106
- v-model="$parent.$parent.f_safe_end"
107
- >
108
- </datepicker>
109
- </div>
110
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
111
- <label class="font_normal_body" >区&emsp;&emsp;域</label>
112
- <v-select :value.sync="model.f_quyu" :value-single="true" v-model="model.f_quyu"
113
- :options='$parent.$parent.quyus' placeholder='区域' class="select_list select" style="width: 60%"
114
- @change="$parent.$parent.quyuChange"
115
- close-on-select>
116
- </v-select>
117
- </div>
118
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
119
- <label class="font_normal_body" >营&ensp;业&ensp;厅</label>
120
- <v-select :value.sync="model.f_bumen" :value-single="true" v-model="model.f_bumen"
121
- :options='$parent.$parent.bumens' placeholder='营业厅'
122
- @change="$parent.$parent.bumenChange" class="select_list select" style="width: 60%"
123
- close-on-select>
124
- </v-select>
125
- </div>
126
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
127
- <label class="font_normal_body">小&emsp;&emsp;组</label>
128
- <v-select :value.sync="model.f_team" :value-single="true" v-model="model.f_team"
129
- :options='$parent.$parent.teams' placeholder='小组'
130
- @change="$parent.$parent.teamChange" class="select_list select" style="width: 60%"
131
- close-on-select>
132
- </v-select>
133
- </div>
134
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
135
- <label class="font_normal_body" >安&ensp;检&ensp;员</label>
136
- <v-select :value.sync="model.f_checker_id" v-model="model.f_checker_id"
137
- :multiple="true" class="select_list select" style="width: 60%"
138
- :options='$parent.$parent.checkers' placeholder='安检员' condition="f_checker_name in {}"
139
- close-on-select>
140
- </v-select>
141
- </div>
142
- <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
143
- <label class="font_normal_body">用户类型</label>
144
- <v-select :value.sync="model.f_check_type" v-model='model.f_check_type'
145
- :value-single="true" style="width: 60%"
146
- class="select_list select"
147
- :options='$parent.$parent.checktype' placeholder='客户类型'
148
- close-on-select
149
- condition="f_check_type = '{}'"></v-select>
150
- </div>
151
- </div>
152
- <div class="row">
153
- <div class="col-sm-12">
154
- <label class="control-label" style="color: #c7254e">汇 总 项</label>
155
- <input type="checkbox" id="f_plan_month" value="f_plan_month" v-model="$parent.$parent.nameForSql"/>
156
- <label for="f_plan_month">计划月份</label>
157
- <input type="checkbox" id="f_no_checkplan" value="f_no_checkplan" v-model="$parent.$parent.nameForSql"/>
158
- <label for="f_no_checkplan">计划类型</label>
159
- <input type="checkbox" id="f_residential_area" value="f_residential_area" v-model="$parent.$parent.nameForSql"/>
160
- <label for="f_residential_area">小区名称</label>
161
- <input type="checkbox" id="f_plan_name" value="f_plan_name" v-model="$parent.$parent.nameForSql"/>
162
- <label for="f_plan_name">计划名称</label>
163
- <input type="checkbox" id="f_checker_name" value="f_checker_name" v-model="$parent.$parent.nameForSql"/>
164
- <label for="f_checker_name">安检员</label>
165
- <input type="checkbox" id="f_user_number" value="f_user_number" v-model="$parent.$parent.nameForSql"/>
166
- <label for="f_checker_name">档案数量</label>
167
- </div>
168
- </div>
169
- </div>
170
-
171
- </criteria>
172
- <data-grid id="excelid" :model="model" partial='list' class="list_area table_sy excelid" v-ref:grid>
173
- <template partial='head'>
174
- <tr>
175
- <th>
176
- <nobr>序号</nobr>
177
- </th>
178
- <th v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_month')"><nobr>计划月份</nobr></th>
179
- <th v-if="$parent.$parent.$parent.nameForSql.includes('f_no_checkplan')"><nobr>计划类型</nobr></th>
180
- <th v-if="$parent.$parent.$parent.nameForSql.includes('f_residential_area')"><nobr>小区名称</nobr></th>
181
- <th v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_name')"><nobr>计划名称</nobr></th>
182
- <th v-if="$parent.$parent.$parent.nameForSql.includes('f_checker_name')"><nobr>安检员</nobr></th>
183
- <th v-if="$parent.$parent.$parent.nameForSql.includes('f_user_number')"><nobr>档案数量</nobr></th>
184
- <th>
185
- <nobr>计划总数</nobr>
186
- </th>
187
- <th>
188
- <nobr>未检</nobr>
189
- </th>
190
- <th>
191
- <nobr>已检</nobr>
192
- </th>
193
- <th>
194
- <nobr>入户</nobr>
195
- </th>
196
- <th>
197
- <nobr>到访不遇</nobr>
198
- </th>
199
- <th>
200
- <nobr>拒检</nobr>
201
- </th>
202
- <th>
203
- <nobr>安检率</nobr>
204
- </th>
205
- <!--<th>-->
206
- <!--<nobr>查看</nobr>-->
207
- <!--</th>-->
208
- </tr>
209
- </template>
210
- <template partial='body'>
211
- <tr>
212
- <td style="text-align:center;border-right: 1px solid ">{{$index + 1}}</td>
213
- <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_month')">{{row.f_plan_month.indexOf('*&')!=-1?'':row.f_plan_month}}</td>-->
214
- <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_no_checkplan')">{{row.f_no_checkplan.indexOf('*&')!=-1?'':row.f_no_checkplan}}</td>-->
215
- <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_residential_area')">{{row.f_residential_area.indexOf('*&')!=-1?'':row.f_residential_area}}</td>-->
216
- <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_name')">{{row.f_plan_name.indexOf('*&')!=-1?'':row.f_plan_name}}</td>-->
217
- <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql && $parent.$parent.$parent.nameForSql.includes('f_checker_name')">{{row.f_checker_name && row.f_checker_name.indexOf('*&')!=-1?'':row.f_checker_name}}</td>-->
218
- <td style="text-align:center" :class="{'td-0':row.f_plan_month==undefined,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_plan_month.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_plan_month.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_plan_month.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_plan_month.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_month')">{{row.f_plan_month.indexOf('*&')!=-1?'':row.f_plan_month}}</td>
219
- <td style="text-align:center" :class="{'td-0':row.f_no_checkplan==undefined,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_no_checkplan.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_no_checkplan.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_no_checkplan.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_no_checkplan.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql.includes('f_no_checkplan')">{{row.f_no_checkplan.indexOf('*&')!=-1?'':row.f_no_checkplan}}</td>
220
- <td style="text-align:center" :class="{'td-0':row.f_residential_area==undefined,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_residential_area.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_residential_area.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_residential_area.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_residential_area.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql.includes('f_residential_area')">{{row.f_residential_area.indexOf('*&')!=-1?'':row.f_residential_area}}</td>
221
- <td style="text-align:center" :class="{'td-0':row.f_plan_name==undefined,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_plan_name.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_plan_name.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_plan_name.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_plan_name.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_name')">{{row.f_plan_name.indexOf('*&')!=-1?'':row.f_plan_name}}</td>
222
- <td style="text-align:center" :class="{'td-0':row && !row.f_checker_name,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_checker_name && row.f_checker_name.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_checker_name &&row.f_checker_name.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_checker_name &&row.f_checker_name.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_checker_name &&row.f_checker_name.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql && $parent.$parent.$parent.nameForSql.includes('f_checker_name')">{{row.f_checker_name && row.f_checker_name.indexOf('*&')!=-1?'':row.f_checker_name}}</td>
223
- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_user_number')">{{row.f_user_number}}</td>
224
- <td style="text-align:center">{{row.f_plan_total}}</td>
225
- <td style="text-align:center">{{row.f_weijian}}</td>
226
- <td style="text-align:center"><nobr>{{row.f_yijian}}</nobr></td>
227
- <td style="text-align:center"><nobr>{{row.f_ruhu}}</nobr></td>
228
- <td style="text-align:center">{{row.f_buyu}}</td>
229
- <td style="text-align:center"><nobr>{{row.f_jujian}}</nobr></td>
230
- <td style="text-align:center"><nobr>{{row.f_check_bv}}</nobr></td>
231
- <!--<td style="text-align: center;">-->
232
- <!--<button class="btn btn-link" @click.stop="$parent.$parent.$parent.showhistory(row)">查看</button>-->
233
- <!--</td>-->
234
- </tr>
235
- </template>
236
- <template partial='foot'></template>
237
- </data-grid>
238
- </criteria-paged>
239
- </div>
240
- </template>
241
-
242
- <script>
243
- /**
244
- *阶梯气价查询列表
245
- */
246
- import {PagedList} from 'vue-client'
247
- import { HttpResetClass } from 'vue-client'
248
- import XLSX from 'xlsx'
249
- export default {
250
- data () {
251
- return {
252
- checktype: this.$appdata.getParam('用户类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')]:[{label: '全部', value: ''}],
253
- allCheckers: [{label: '请选择', value: ''}],
254
- quyus: [{label: '请选择', value: ''}, ...this.$appdata.getParam('区域')],
255
- bumens: [{label: '请选择', value: ''}],
256
- teams: [{label: '请选择', value: ''}],
257
- checkers:[],
258
- model: new PagedList('rs/sql/getCheckPlanAreaList', 99999),
259
- // 公司下拉
260
- curorgid: [this.$login.f.orgid],
261
- row: {},
262
- f_orgid: '',
263
- nameForSql: [],
264
- groupNameForSql: '',
265
- listflag:false,
266
- nameflag:false,
267
- criteriaShow: false,
268
- f_check_start:new Date().getFullYear() + '-01',
269
- f_check_end:new Date().getFullYear() + '-12',
270
- f_safe_start:'',
271
- f_safe_end:'',
272
- planName:[{label: '全部', value: ''}],
273
- exportExcelField: {
274
- 'f_weijian':'未检',
275
- 'f_yijian':'已检',
276
- 'f_ruhu':'入户',
277
- 'f_buyu':'到访不遇',
278
- 'f_jujian':'拒检',
279
- 'f_check_bv':'安检率'
280
- }
281
- }
282
- },
283
- props: {
284
- row: {},
285
- config: {},
286
- ispartial: false,
287
- f_filialeid: {
288
- type: String
289
- }
290
- },
291
- ready () {
292
- this.nameForSql = ['f_plan_month', 'f_plan_name','f_checker_name']
293
- this.groupNameForSql = 'f_plan_month', 'f_plan_name','f_checker_name'
294
- this.pl()
295
- this.getAllChecker()
296
- // this.search()
297
-
298
- },
299
- methods: {
300
- cleamsg(){
301
- this.$refs.paged.$refs.cri.model= {}
302
- },
303
- getAllChecker() {
304
- new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
305
- data: {
306
- items: 'name',
307
- tablename: 't_user',
308
- condition: `state = '在职' and rolestr like '%安检员%'`,
309
- orderitem: 'id'
310
- }
311
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
312
- res.data.forEach(ress => {
313
- this.allCheckers.push({
314
- label: ress.name,
315
- value: ress.name
316
- })
317
- })
318
- this.checkers = this.allCheckers
319
- })
320
- },
321
- bumenChange(val) {
322
- if (val) {
323
- this.teams = this.$appdata.getParam(`工单-` + val) ? [{
324
- label: '请选择',
325
- value: ''
326
- }, ...this.$appdata.getParam(`工单-` + val)] : [{label: '请选择', value: ''}]
327
- }else {
328
- this.checkers = this.allCheckers
329
- }
330
- },
331
- teamChange(val) {
332
- if (val) {
333
- this.checkers = this.$appdata.getParam(val) ? [...this.$appdata.getParam(val)] : [{label: '请选择', value: ''}]
334
- }else {
335
- this.checkers = this.allCheckers
336
- }
337
- },
338
- quyuChange(val) {
339
- if (val) {
340
- this.bumens = this.$appdata.getParam(val) ? [{
341
- label: '请选择',
342
- value: ''
343
- }, ...this.$appdata.getParam(val)] : [{label: '请选择', value: ''}]
344
- }else {
345
- this.checkers = this.allCheckers
346
- }
347
- },
348
- exportexcel(){
349
- //tag
350
- // 以上四行也可以直接一行搞定,如果不需要对表格数据进行修改的话
351
- const aa = document.getElementsByClassName("list_area table_sy excelid")[0]
352
- console.log(aa)
353
- let workbook = XLSX.utils.table_to_book(document.getElementsByClassName("list_area table_sy excelid")[0])
354
- try {
355
- XLSX.writeFile(workbook, '安检情况汇总导出.xlsx');
356
- } catch(e) {
357
- //tag;
358
- }
359
- },
360
- // 获取导出列
361
- getexportExcelField(){
362
- this.exportExcelField = {
363
- 'f_weijian':'未检',
364
- 'f_yijian':'已检',
365
- 'f_ruhu':'入户',
366
- 'f_buyu':'到访不遇',
367
- 'f_jujian':'拒检',
368
- 'f_check_bv':'安检率',
369
- 'f_plan_total':'计划总数'
370
- }
371
- let forName = this.groupNameForSql.split(",")
372
- for (let i = 0; i < forName.length; i++) {
373
- let ff = forName[i]
374
- if (ff==='f_plan_month') {
375
- this.exportExcelField.f_plan_month='计划月份'
376
- }
377
- if (ff==='f_no_checkplan') {
378
- this.exportExcelField.f_no_checkplan='计划类型'
379
- }
380
- if (ff==='f_plan_name') {
381
- this.exportExcelField.f_plan_name='计划名称'
382
- }
383
- if (ff==='f_checker_name') {
384
- this.exportExcelField.f_checker_name='安检员'
385
- }if (ff==='f_residential_area') {
386
- this.exportExcelField.f_residential_area='小区名称'
387
- }if (ff==='f_user_number') {
388
- this.exportExcelField.f_user_number='档案数量'
389
- }
390
- }
391
- },
392
- pl() {
393
- let getGasman = new HttpResetClass()
394
- getGasman.load('POST', `rs/sql/safe_singleTable_OrderBy`, {
395
- data: {
396
- items: "id,f_plan_name",
397
- tablename: "t_check_plan",
398
- condition: `f_filialeid = '${this.curorgid}'`,
399
- orderitem: "id"
400
- }
401
- }, {resolveMsg: null, rejectMsg: null}).then((plne) => {
402
- //tag
403
- //tag
404
- //tag
405
- for (let i = 0; i < plne.data.length; i++) {
406
- this.planName.push({label: plne.data[i].f_plan_name, value: plne.data[i].id})
407
- }
408
- //tag
409
- })
410
- },
411
- hiddenr() {
412
- this.$parent.isdetail = !this.$parent.isdetail
413
- },
414
- hidden() {
415
- this.criteriaShow = !this.criteriaShow
416
- },
417
- search () {
418
- this.$refs.paged.$refs.cri.search()
419
- this.$dispatch('search')
420
- },
421
- getorg (val) {
422
- this.f_orgid = this.$login.convertToIn(val.resids)
423
- this.f_filialeid = val[0]
424
-
425
- },
426
- selfSearch (args) {
427
- if (!this.f_orgid) {
428
- this.getorg([this.$login.f.orgid])
429
- args.condition = `f_filialeid in ('${this.$login.f.orgid}') and ${args.condition}`
430
- }
431
- if (this.f_orgid) {
432
- args.condition = `f_filialeid in ${this.f_orgid} and ${args.condition}`
433
- }
434
- if(this.f_check_start && this.f_check_end){
435
- if(new Date(this.f_check_start).getFullYear() == new Date(this.f_check_end).getFullYear() ){
436
- args.condition += ` and f_year>=${new Date(this.f_check_start).getFullYear()} and f_month>=${new Date(this.f_check_start).getMonth()+1} and f_month<=${new Date(this.f_check_end).getMonth()+1}`
437
- }else {
438
- args.condition += ` and (
439
- (f_year = ${new Date(this.f_check_start).getFullYear()} and f_month >= ${new Date(this.f_check_start).getMonth()+1})
440
- or
441
- ( f_year > ${new Date(this.f_check_start).getFullYear()} and f_year < ${new Date(this.f_check_end).getFullYear()})
442
- or
443
- (f_year = ${new Date(this.f_check_end).getFullYear()} and f_month <= ${new Date(this.f_check_end).getMonth()+1}))`
444
- }
445
- } else {
446
- if(this.f_check_start){
447
- args.condition += ` and f_year>=${new Date(this.f_check_start).getFullYear()} and f_month>=${new Date(this.f_check_start).getMonth()+1}`
448
- }
449
- if(this.f_check_end){
450
- args.condition += ` and f_year<=${new Date(this.f_check_end).getFullYear()} and f_month<=${new Date(this.f_check_end).getMonth()+1}`
451
- }
452
- }
453
- if(this.f_safe_start && this.f_safe_end){
454
- args.condition += `and ch.f_offsite_time >= '${this.f_safe_start}' and ch.f_offsite_time <= '${this.f_safe_end}' `
455
- } else {
456
- if(this.f_safe_start){
457
- args.condition += ` and ch.f_offsite_time >='${this.f_safe_start}'`
458
- }
459
- if(this.f_safe_end){
460
- args.condition += ` and ch.f_offsite_time <='${this.f_safe_end}'`
461
- }
462
- }
463
- this.$refs.paged.$refs.grid.$el.scrollTop = 0
464
- if (this.groupNameForSql=='undefined'){
465
- //tag
466
- this.$showMessage("请至少选择一项进行汇总")
467
- return
468
- }
469
- this.model.paramSource = {groupName: `'${this.groupNameForSql}'`}
470
- this.model.search(args.condition, args.model)
471
- },
472
-
473
- // 拼接groupName1
474
- getGroupName1 () {
475
- var temp=['f_plan_month','f_no_checkplan','f_residential_area','f_plan_name','f_checker_name','f_user_number']
476
- var newtemp=[]
477
-
478
- for (var i=0;i<temp.length;i++){
479
- for (var j=0;j<this.nameForSql.length;j++){
480
- //tag
481
- if(temp[i]==this.nameForSql[j]){
482
- newtemp.push(this.nameForSql[j])
483
- }
484
- }
485
- }
486
- let str = ''
487
-
488
- for (var i=0;i < newtemp.length - 1; i++) {
489
- str += newtemp[i] + ','
490
- }
491
- str += newtemp[i]
492
- this.groupNameForSql = str.trim()
493
- }
494
- },
495
- watch: {
496
- // 'nameForSql' () {
497
- //
498
- // this.getGroupName1()
499
- // },
500
- 'nameForSql' () {
501
- var e = document.createEvent("MouseEvents");
502
- e.initEvent("click", true, true);
503
- document.getElementById("btnaaa").dispatchEvent(e);
504
- },
505
- 'model.rows'(){
506
- //tag
507
- if(this.listflag){
508
- return;
509
- }
510
- this.listflag=true
511
- //tag
512
- var temp=['f_plan_month','f_no_checkplan','f_residential_area','f_plan_name','f_checker_name','f_user_number']
513
- var newtemp=[]
514
- for (var i=0;i<temp.length;i++){
515
- for (var j=0;j<this.nameForSql.length;j++){
516
- //tag
517
- if(temp[i]==this.nameForSql[j]){
518
- newtemp.push(this.nameForSql[j])
519
- }
520
- }
521
- }
522
- if((newtemp.includes('f_user_number')&&newtemp.length==2)||(!newtemp.includes('f_user_number')&&newtemp.length==1)){
523
- return
524
- }
525
- var temp=JSON.parse(JSON.stringify(this.model.rows))
526
-
527
- //遍历查询结果 为指定列增加样式
528
- for (var i=0;i<newtemp.length-1;i++){
529
- if(newtemp[i]=='f_user_number'){
530
- return;
531
- }
532
- //tag
533
- var ss=''
534
- for (var j=0;j<temp.length;j++){
535
- if(j>0&&i>0){
536
- var flag=false
537
- for(var t=i-1;t>-1;t--){
538
- //tag
539
- //tag
540
- //tag
541
- //tag
542
- if(temp[j-1][newtemp[t]]!=temp[j][newtemp[t]]&&(temp[j][newtemp[t]] !=null && temp[j][newtemp[t]].indexOf('*&') )==-1){
543
- flag=true
544
- break
545
- }
546
- }
547
- //tag
548
- if(flag){
549
- ss=temp[j][newtemp[i]]
550
- continue
551
- }
552
- }
553
- if(temp[j][newtemp[i]]==ss){
554
- temp[j][newtemp[i]]=temp[j][newtemp[i]]+'*&'
555
- }else {
556
- ss=temp[j][newtemp[i]]
557
- }
558
- }
559
- }
560
- //tag
561
- this.model.rows=JSON.parse(JSON.stringify(temp))
562
- }
563
- },
564
- computed:{
565
- exportParameter(){
566
- // excel 导出条件拼接
567
- return {
568
- condition: this.$refs.paged.model.condition,
569
- groupName: this.groupNameForSql
570
- }
571
- }
572
- }
573
- }
574
- </script>
575
-
576
- <style scoped>
577
-
578
- .td-0{
579
- border: 1px solid #000000;
580
- }
581
-
582
- .td-1{
583
- border: none;
584
- border-top: 1px solid #000000;
585
- border-left: 1px solid #000000;
586
- border-right: 1px solid #000000;
587
- }
588
-
589
- .td-2{
590
- border: none;
591
- border-left: 1px solid #000000;
592
- border-right: 1px solid #000000;
593
- }
594
- .td-4{
595
- border: none;
596
- border-top: 1px solid #000000;
597
- border-left: 1px solid #000000;
598
- border-right: 1px solid #000000;
599
- border-bottom: 1px solid #000000;
600
- }
601
- .td-3{
602
- border: none;
603
- border-left: 1px solid #000000;
604
- border-right: 1px solid #000000;
605
- border-bottom: 1px solid #000000;
606
- }
607
- </style>
1
+ <template>
2
+ <div class="flex">
3
+ <criteria-paged :model="model" v-ref:paged :pager="false">
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row">
7
+ <!--<div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}">
8
+ <label class="font_normal_body">组织机构</label>
9
+ <res-select restype='organization'
10
+ class="select select_list"
11
+ style="width: 60%"
12
+ @res-select="$parent.$parent.getorg"
13
+ :initresid='$parent.$parent.curorgid'>
14
+ </res-select>
15
+ </div>-->
16
+ <!-- <div :class="{'col-sm-6':$parent.$parent.$parent.isdetail,'col-sm-4':!$parent.$parent.$parent.isdetail}">-->
17
+ <!-- <role-selector-safe-->
18
+ <!-- role-name="安检员"-->
19
+ <!-- role-lable="安&ensp;检&ensp;员"-->
20
+ <!-- @re-res="$parent.$parent.getorg"-->
21
+ <!-- :value.sync="model.f_checker_id"-->
22
+ <!-- v-model="model.f_checker_id"-->
23
+ <!-- condition="f_checker_name like '%{}%'">-->
24
+ <!-- </role-selector-safe>-->
25
+ <!-- </div>-->
26
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}">
27
+ <label class="font_normal_body">小区名称</label>
28
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_area" placeholder='小区名称'
29
+ condition="f_residential_area like '%{}%'" v-next-el="cx" v-el:qjmc>
30
+ </div>
31
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}">
32
+ <label class="font_normal_body">计划名称</label>
33
+ <v-select class="select_list select" style="width: 60%"
34
+ placeholder='计划名称'
35
+ :search="true"
36
+ v-model="model.f_plan_name"
37
+ :value.sync="model.f_plan_name"
38
+ :options='$parent.$parent.planName'
39
+ condition="f_plan_id = '{}'"
40
+ :value-single="true"
41
+ close-on-select clear-button></v-select>
42
+
43
+ </div>
44
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" style="float:right; padding-right: 25px">
45
+ <div class="span" style="float:right;">
46
+ <div style="float: right;margin-left:10px" class="button_spacing"
47
+ :class="{'button_shrink_left':!$parent.$parent.$parent.isdetail,'button_shrink_right':$parent.$parent.$parent.isdetail}"
48
+ @click="$parent.$parent.hiddenr()"></div>
49
+ <div class="button_spacing" style="float: right;margin-left:10px"
50
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
51
+ @click="$parent.$parent.hidden()">
52
+ </div>
53
+ <button id="btnaaaa" style="float: right" class="button_search"
54
+ @click="$parent.$parent.exportexcel()"
55
+ v-el:cx>导出</button>
56
+ <button id="btnaaa" style="float: right" class="button_search"
57
+ @click="$parent.$parent.getGroupName1(),search(),$parent.$parent.getexportExcelField(),$parent.$parent.$parent.isdetail=false,$parent.$parent.listflag=false"
58
+ v-el:cx>查询</button>
59
+ <button id="cle" style="float: right" class="button_search"
60
+ @click="$parent.$parent.cleamsg()"
61
+ v-el:cx>清空</button>
62
+ </div>
63
+ </div>
64
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
65
+ <label class="font_normal_body">起始时间</label>
66
+ <datepicker
67
+ :value.sync="$parent.$parent.f_check_start"
68
+ placeholder='起始时间' style="width:60%"
69
+ :disabled-days-of-week="[]"
70
+ :format="'yyyy-MM'"
71
+ :select-month="true"
72
+ :show-rest-button="reset">
73
+ </datepicker>
74
+ </div>
75
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
76
+ <label class="font_normal_body">结束时间</label>
77
+ <datepicker
78
+ :value.sync="$parent.$parent.f_check_end"
79
+ placeholder='结束时间' style="width:60%"
80
+ :disabled-days-of-week="[]"
81
+ :format="'yyyy-MM'"
82
+ :select-month="true"
83
+ :show-rest-button="reset">
84
+ </datepicker>
85
+ </div>
86
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
87
+ <label class="font_normal_body">安检时间</label>
88
+ <datepicker
89
+ :value.sync="$parent.$parent.f_safe_start"
90
+ placeholder='结束时间' style="width: 60%"
91
+ :disabled-days-of-week="[]"
92
+ :format="'yyyy-MM-dd 00:00:00'"
93
+ :show-rest-button="reset"
94
+ v-model="$parent.$parent.f_safe_start"
95
+ >
96
+ </datepicker>
97
+ </div>
98
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
99
+ <label class="font_normal_body">安检时间</label>
100
+ <datepicker
101
+ :value.sync="$parent.$parent.f_safe_end"
102
+ placeholder='结束时间' style="width: 60%"
103
+ :disabled-days-of-week="[]"
104
+ :format="'yyyy-MM-dd 23:59:59'"
105
+ :show-rest-button="reset"
106
+ v-model="$parent.$parent.f_safe_end"
107
+ >
108
+ </datepicker>
109
+ </div>
110
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
111
+ <label class="font_normal_body" >区&emsp;&emsp;域</label>
112
+ <v-select :value.sync="model.f_quyu" :value-single="true" v-model="model.f_quyu"
113
+ :options='$parent.$parent.quyus' placeholder='区域' class="select_list select" style="width: 60%"
114
+ @change="$parent.$parent.quyuChange"
115
+ close-on-select>
116
+ </v-select>
117
+ </div>
118
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
119
+ <label class="font_normal_body" >营&ensp;业&ensp;厅</label>
120
+ <v-select :value.sync="model.f_bumen" :value-single="true" v-model="model.f_bumen"
121
+ :options='$parent.$parent.bumens' placeholder='营业厅'
122
+ @change="$parent.$parent.bumenChange" class="select_list select" style="width: 60%"
123
+ close-on-select>
124
+ </v-select>
125
+ </div>
126
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
127
+ <label class="font_normal_body">小&emsp;&emsp;组</label>
128
+ <v-select :value.sync="model.f_team" :value-single="true" v-model="model.f_team"
129
+ :options='$parent.$parent.teams' placeholder='小组'
130
+ @change="$parent.$parent.teamChange" class="select_list select" style="width: 60%"
131
+ close-on-select>
132
+ </v-select>
133
+ </div>
134
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
135
+ <label class="font_normal_body" >安&ensp;检&ensp;员</label>
136
+ <v-select :value.sync="model.f_checker_id" v-model="model.f_checker_id"
137
+ :multiple="true" class="select_list select" style="width: 60%"
138
+ :options='$parent.$parent.checkers' placeholder='安检员' condition="f_checker_name in {}"
139
+ close-on-select>
140
+ </v-select>
141
+ </div>
142
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.isdetail,'form-group col-sm-2':!$parent.$parent.$parent.isdetail}" v-if="$parent.$parent.criteriaShow">
143
+ <label class="font_normal_body">用户类型</label>
144
+ <v-select :value.sync="model.f_check_type" v-model='model.f_check_type'
145
+ :value-single="true" style="width: 60%"
146
+ class="select_list select"
147
+ :options='$parent.$parent.checktype' placeholder='客户类型'
148
+ close-on-select
149
+ condition="f_check_type = '{}'"></v-select>
150
+ </div>
151
+ </div>
152
+ <div class="row">
153
+ <div class="col-sm-12">
154
+ <label class="control-label" style="color: #c7254e">汇 总 项</label>
155
+ <input type="checkbox" id="f_plan_month" value="f_plan_month" v-model="$parent.$parent.nameForSql"/>
156
+ <label for="f_plan_month">计划月份</label>
157
+ <input type="checkbox" id="f_no_checkplan" value="f_no_checkplan" v-model="$parent.$parent.nameForSql"/>
158
+ <label for="f_no_checkplan">计划类型</label>
159
+ <input type="checkbox" id="f_residential_area" value="f_residential_area" v-model="$parent.$parent.nameForSql"/>
160
+ <label for="f_residential_area">小区名称</label>
161
+ <input type="checkbox" id="f_plan_name" value="f_plan_name" v-model="$parent.$parent.nameForSql"/>
162
+ <label for="f_plan_name">计划名称</label>
163
+ <input type="checkbox" id="f_checker_name" value="f_checker_name" v-model="$parent.$parent.nameForSql"/>
164
+ <label for="f_checker_name">安检员</label>
165
+ <input type="checkbox" id="f_user_number" value="f_user_number" v-model="$parent.$parent.nameForSql"/>
166
+ <label for="f_checker_name">档案数量</label>
167
+ </div>
168
+ </div>
169
+ </div>
170
+
171
+ </criteria>
172
+ <data-grid id="excelid" :model="model" partial='list' class="list_area table_sy excelid" v-ref:grid>
173
+ <template partial='head'>
174
+ <tr>
175
+ <th>
176
+ <nobr>序号</nobr>
177
+ </th>
178
+ <th v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_month')"><nobr>计划月份</nobr></th>
179
+ <th v-if="$parent.$parent.$parent.nameForSql.includes('f_no_checkplan')"><nobr>计划类型</nobr></th>
180
+ <th v-if="$parent.$parent.$parent.nameForSql.includes('f_residential_area')"><nobr>小区名称</nobr></th>
181
+ <th v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_name')"><nobr>计划名称</nobr></th>
182
+ <th v-if="$parent.$parent.$parent.nameForSql.includes('f_checker_name')"><nobr>安检员</nobr></th>
183
+ <th v-if="$parent.$parent.$parent.nameForSql.includes('f_user_number')"><nobr>档案数量</nobr></th>
184
+ <th>
185
+ <nobr>计划总数</nobr>
186
+ </th>
187
+ <th>
188
+ <nobr>未检</nobr>
189
+ </th>
190
+ <th>
191
+ <nobr>已检</nobr>
192
+ </th>
193
+ <th>
194
+ <nobr>入户</nobr>
195
+ </th>
196
+ <th>
197
+ <nobr>到访不遇</nobr>
198
+ </th>
199
+ <th>
200
+ <nobr>拒检</nobr>
201
+ </th>
202
+ <th>
203
+ <nobr>安检率</nobr>
204
+ </th>
205
+ <!--<th>-->
206
+ <!--<nobr>查看</nobr>-->
207
+ <!--</th>-->
208
+ </tr>
209
+ </template>
210
+ <template partial='body'>
211
+ <tr>
212
+ <td style="text-align:center;border-right: 1px solid ">{{$index + 1}}</td>
213
+ <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_month')">{{row.f_plan_month.indexOf('*&')!=-1?'':row.f_plan_month}}</td>-->
214
+ <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_no_checkplan')">{{row.f_no_checkplan.indexOf('*&')!=-1?'':row.f_no_checkplan}}</td>-->
215
+ <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_residential_area')">{{row.f_residential_area.indexOf('*&')!=-1?'':row.f_residential_area}}</td>-->
216
+ <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_name')">{{row.f_plan_name.indexOf('*&')!=-1?'':row.f_plan_name}}</td>-->
217
+ <!-- <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql && $parent.$parent.$parent.nameForSql.includes('f_checker_name')">{{row.f_checker_name && row.f_checker_name.indexOf('*&')!=-1?'':row.f_checker_name}}</td>-->
218
+ <td style="text-align:center" :class="{'td-0':row.f_plan_month==undefined,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_plan_month.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_plan_month.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_plan_month.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_plan_month.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_month')">{{row.f_plan_month.indexOf('*&')!=-1?'':row.f_plan_month}}</td>
219
+ <td style="text-align:center" :class="{'td-0':row.f_no_checkplan==undefined,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_no_checkplan.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_no_checkplan.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_no_checkplan.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_no_checkplan.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql.includes('f_no_checkplan')">{{row.f_no_checkplan.indexOf('*&')!=-1?'':row.f_no_checkplan}}</td>
220
+ <td style="text-align:center" :class="{'td-0':row.f_residential_area==undefined,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_residential_area.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_residential_area.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_residential_area.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_residential_area.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql.includes('f_residential_area')">{{row.f_residential_area.indexOf('*&')!=-1?'':row.f_residential_area}}</td>
221
+ <td style="text-align:center" :class="{'td-0':row.f_plan_name==undefined,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_plan_name.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_plan_name.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_plan_name.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_plan_name.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql.includes('f_plan_name')">{{row.f_plan_name.indexOf('*&')!=-1?'':row.f_plan_name}}</td>
222
+ <td style="text-align:center" :class="{'td-0':row && !row.f_checker_name,'td-1':model.rows && model.rows.length!=($index+1)&&row.f_checker_name && row.f_checker_name.indexOf('*&')==-1,'td-2':model.rows && model.rows.length!=($index+1)&&row.f_checker_name &&row.f_checker_name.indexOf('*&')!=-1,'td-3':model.rows && model.rows.length==($index+1)&&row.f_checker_name &&row.f_checker_name.indexOf('*&')!=-1,'td-4':model.rows && model.rows.length==($index+1)&&row.f_checker_name &&row.f_checker_name.indexOf('*&')==-1}" v-if="$parent.$parent.$parent.nameForSql && $parent.$parent.$parent.nameForSql.includes('f_checker_name')">{{row.f_checker_name && row.f_checker_name.indexOf('*&')!=-1?'':row.f_checker_name}}</td>
223
+ <td style="text-align:center" v-if="$parent.$parent.$parent.nameForSql.includes('f_user_number')">{{row.f_user_number}}</td>
224
+ <td style="text-align:center">{{row.f_plan_total}}</td>
225
+ <td style="text-align:center">{{row.f_weijian}}</td>
226
+ <td style="text-align:center"><nobr>{{row.f_yijian}}</nobr></td>
227
+ <td style="text-align:center"><nobr>{{row.f_ruhu}}</nobr></td>
228
+ <td style="text-align:center">{{row.f_buyu}}</td>
229
+ <td style="text-align:center"><nobr>{{row.f_jujian}}</nobr></td>
230
+ <td style="text-align:center"><nobr>{{row.f_check_bv}}</nobr></td>
231
+ <!--<td style="text-align: center;">-->
232
+ <!--<button class="btn btn-link" @click.stop="$parent.$parent.$parent.showhistory(row)">查看</button>-->
233
+ <!--</td>-->
234
+ </tr>
235
+ </template>
236
+ <template partial='foot'></template>
237
+ </data-grid>
238
+ </criteria-paged>
239
+ </div>
240
+ </template>
241
+
242
+ <script>
243
+ /**
244
+ *阶梯气价查询列表
245
+ */
246
+ import {PagedList} from 'vue-client'
247
+ import { HttpResetClass } from 'vue-client'
248
+ import XLSX from 'xlsx'
249
+ export default {
250
+ data () {
251
+ return {
252
+ checktype: this.$appdata.getParam('用户类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')]:[{label: '全部', value: ''}],
253
+ allCheckers: [{label: '请选择', value: ''}],
254
+ quyus: [{label: '请选择', value: ''}, ...this.$appdata.getParam('区域')],
255
+ bumens: [{label: '请选择', value: ''}],
256
+ teams: [{label: '请选择', value: ''}],
257
+ checkers:[],
258
+ model: new PagedList('rs/sql/getCheckPlanAreaList', 99999),
259
+ // 公司下拉
260
+ curorgid: [this.$login.f.orgid],
261
+ row: {},
262
+ f_orgid: '',
263
+ nameForSql: [],
264
+ groupNameForSql: '',
265
+ listflag:false,
266
+ nameflag:false,
267
+ criteriaShow: false,
268
+ f_check_start:new Date().getFullYear() + '-01',
269
+ f_check_end:new Date().getFullYear() + '-12',
270
+ f_safe_start:'',
271
+ f_safe_end:'',
272
+ planName:[{label: '全部', value: ''}],
273
+ exportExcelField: {
274
+ 'f_weijian':'未检',
275
+ 'f_yijian':'已检',
276
+ 'f_ruhu':'入户',
277
+ 'f_buyu':'到访不遇',
278
+ 'f_jujian':'拒检',
279
+ 'f_check_bv':'安检率'
280
+ }
281
+ }
282
+ },
283
+ props: {
284
+ row: {},
285
+ config: {},
286
+ ispartial: false,
287
+ f_filialeid: {
288
+ type: String
289
+ }
290
+ },
291
+ ready () {
292
+ this.nameForSql = ['f_plan_month', 'f_plan_name','f_checker_name']
293
+ this.groupNameForSql = 'f_plan_month', 'f_plan_name','f_checker_name'
294
+ this.pl()
295
+ this.getAllChecker()
296
+ // this.search()
297
+
298
+ },
299
+ methods: {
300
+ cleamsg(){
301
+ this.$refs.paged.$refs.cri.model= {}
302
+ },
303
+ getAllChecker() {
304
+ new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
305
+ data: {
306
+ items: 'name',
307
+ tablename: 't_user',
308
+ condition: `state = '在职' and rolestr like '%安检员%'`,
309
+ orderitem: 'id'
310
+ }
311
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
312
+ res.data.forEach(ress => {
313
+ this.allCheckers.push({
314
+ label: ress.name,
315
+ value: ress.name
316
+ })
317
+ })
318
+ this.checkers = this.allCheckers
319
+ })
320
+ },
321
+ bumenChange(val) {
322
+ if (val) {
323
+ this.teams = this.$appdata.getParam(`工单-` + val) ? [{
324
+ label: '请选择',
325
+ value: ''
326
+ }, ...this.$appdata.getParam(`工单-` + val)] : [{label: '请选择', value: ''}]
327
+ }else {
328
+ this.checkers = this.allCheckers
329
+ }
330
+ },
331
+ teamChange(val) {
332
+ if (val) {
333
+ this.checkers = this.$appdata.getParam(val) ? [...this.$appdata.getParam(val)] : [{label: '请选择', value: ''}]
334
+ }else {
335
+ this.checkers = this.allCheckers
336
+ }
337
+ },
338
+ quyuChange(val) {
339
+ if (val) {
340
+ this.bumens = this.$appdata.getParam(val) ? [{
341
+ label: '请选择',
342
+ value: ''
343
+ }, ...this.$appdata.getParam(val)] : [{label: '请选择', value: ''}]
344
+ }else {
345
+ this.checkers = this.allCheckers
346
+ }
347
+ },
348
+ exportexcel(){
349
+ //tag
350
+ // 以上四行也可以直接一行搞定,如果不需要对表格数据进行修改的话
351
+ const aa = document.getElementsByClassName("list_area table_sy excelid")[0]
352
+ console.log(aa)
353
+ let workbook = XLSX.utils.table_to_book(document.getElementsByClassName("list_area table_sy excelid")[0])
354
+ try {
355
+ XLSX.writeFile(workbook, '安检情况汇总导出.xlsx');
356
+ } catch(e) {
357
+ //tag;
358
+ }
359
+ },
360
+ // 获取导出列
361
+ getexportExcelField(){
362
+ this.exportExcelField = {
363
+ 'f_weijian':'未检',
364
+ 'f_yijian':'已检',
365
+ 'f_ruhu':'入户',
366
+ 'f_buyu':'到访不遇',
367
+ 'f_jujian':'拒检',
368
+ 'f_check_bv':'安检率',
369
+ 'f_plan_total':'计划总数'
370
+ }
371
+ let forName = this.groupNameForSql.split(",")
372
+ for (let i = 0; i < forName.length; i++) {
373
+ let ff = forName[i]
374
+ if (ff==='f_plan_month') {
375
+ this.exportExcelField.f_plan_month='计划月份'
376
+ }
377
+ if (ff==='f_no_checkplan') {
378
+ this.exportExcelField.f_no_checkplan='计划类型'
379
+ }
380
+ if (ff==='f_plan_name') {
381
+ this.exportExcelField.f_plan_name='计划名称'
382
+ }
383
+ if (ff==='f_checker_name') {
384
+ this.exportExcelField.f_checker_name='安检员'
385
+ }if (ff==='f_residential_area') {
386
+ this.exportExcelField.f_residential_area='小区名称'
387
+ }if (ff==='f_user_number') {
388
+ this.exportExcelField.f_user_number='档案数量'
389
+ }
390
+ }
391
+ },
392
+ pl() {
393
+ let getGasman = new HttpResetClass()
394
+ getGasman.load('POST', `rs/sql/safe_singleTable_OrderBy`, {
395
+ data: {
396
+ items: "id,f_plan_name",
397
+ tablename: "t_check_plan",
398
+ condition: `f_filialeid = '${this.curorgid}'`,
399
+ orderitem: "id"
400
+ }
401
+ }, {resolveMsg: null, rejectMsg: null}).then((plne) => {
402
+ //tag
403
+ //tag
404
+ //tag
405
+ for (let i = 0; i < plne.data.length; i++) {
406
+ this.planName.push({label: plne.data[i].f_plan_name, value: plne.data[i].id})
407
+ }
408
+ //tag
409
+ })
410
+ },
411
+ hiddenr() {
412
+ this.$parent.isdetail = !this.$parent.isdetail
413
+ },
414
+ hidden() {
415
+ this.criteriaShow = !this.criteriaShow
416
+ },
417
+ search () {
418
+ this.$refs.paged.$refs.cri.search()
419
+ this.$dispatch('search')
420
+ },
421
+ getorg (val) {
422
+ this.f_orgid = this.$login.convertToIn(val.resids)
423
+ this.f_filialeid = val[0]
424
+
425
+ },
426
+ selfSearch (args) {
427
+ if (!this.f_orgid) {
428
+ this.getorg([this.$login.f.orgid])
429
+ args.condition = `f_filialeid in ('${this.$login.f.orgid}') and ${args.condition}`
430
+ }
431
+ if (this.f_orgid) {
432
+ args.condition = `f_filialeid in ${this.f_orgid} and ${args.condition}`
433
+ }
434
+ if(this.f_check_start && this.f_check_end){
435
+ if(new Date(this.f_check_start).getFullYear() == new Date(this.f_check_end).getFullYear() ){
436
+ args.condition += ` and f_year>=${new Date(this.f_check_start).getFullYear()} and f_month>=${new Date(this.f_check_start).getMonth()+1} and f_month<=${new Date(this.f_check_end).getMonth()+1}`
437
+ }else {
438
+ args.condition += ` and (
439
+ (f_year = ${new Date(this.f_check_start).getFullYear()} and f_month >= ${new Date(this.f_check_start).getMonth()+1})
440
+ or
441
+ ( f_year > ${new Date(this.f_check_start).getFullYear()} and f_year < ${new Date(this.f_check_end).getFullYear()})
442
+ or
443
+ (f_year = ${new Date(this.f_check_end).getFullYear()} and f_month <= ${new Date(this.f_check_end).getMonth()+1}))`
444
+ }
445
+ } else {
446
+ if(this.f_check_start){
447
+ args.condition += ` and f_year>=${new Date(this.f_check_start).getFullYear()} and f_month>=${new Date(this.f_check_start).getMonth()+1}`
448
+ }
449
+ if(this.f_check_end){
450
+ args.condition += ` and f_year<=${new Date(this.f_check_end).getFullYear()} and f_month<=${new Date(this.f_check_end).getMonth()+1}`
451
+ }
452
+ }
453
+ if(this.f_safe_start && this.f_safe_end){
454
+ args.condition += `and ch.f_offsite_time >= '${this.f_safe_start}' and ch.f_offsite_time <= '${this.f_safe_end}' `
455
+ } else {
456
+ if(this.f_safe_start){
457
+ args.condition += ` and ch.f_offsite_time >='${this.f_safe_start}'`
458
+ }
459
+ if(this.f_safe_end){
460
+ args.condition += ` and ch.f_offsite_time <='${this.f_safe_end}'`
461
+ }
462
+ }
463
+ this.$refs.paged.$refs.grid.$el.scrollTop = 0
464
+ if (this.groupNameForSql=='undefined'){
465
+ //tag
466
+ this.$showMessage("请至少选择一项进行汇总")
467
+ return
468
+ }
469
+ this.model.paramSource = {groupName: `'${this.groupNameForSql}'`}
470
+ this.model.search(args.condition, args.model)
471
+ },
472
+
473
+ // 拼接groupName1
474
+ getGroupName1 () {
475
+ var temp=['f_plan_month','f_no_checkplan','f_residential_area','f_plan_name','f_checker_name','f_user_number']
476
+ var newtemp=[]
477
+
478
+ for (var i=0;i<temp.length;i++){
479
+ for (var j=0;j<this.nameForSql.length;j++){
480
+ //tag
481
+ if(temp[i]==this.nameForSql[j]){
482
+ newtemp.push(this.nameForSql[j])
483
+ }
484
+ }
485
+ }
486
+ let str = ''
487
+
488
+ for (var i=0;i < newtemp.length - 1; i++) {
489
+ str += newtemp[i] + ','
490
+ }
491
+ str += newtemp[i]
492
+ this.groupNameForSql = str.trim()
493
+ }
494
+ },
495
+ watch: {
496
+ // 'nameForSql' () {
497
+ //
498
+ // this.getGroupName1()
499
+ // },
500
+ 'nameForSql' () {
501
+ var e = document.createEvent("MouseEvents");
502
+ e.initEvent("click", true, true);
503
+ document.getElementById("btnaaa").dispatchEvent(e);
504
+ },
505
+ 'model.rows'(){
506
+ //tag
507
+ if(this.listflag){
508
+ return;
509
+ }
510
+ this.listflag=true
511
+ //tag
512
+ var temp=['f_plan_month','f_no_checkplan','f_residential_area','f_plan_name','f_checker_name','f_user_number']
513
+ var newtemp=[]
514
+ for (var i=0;i<temp.length;i++){
515
+ for (var j=0;j<this.nameForSql.length;j++){
516
+ //tag
517
+ if(temp[i]==this.nameForSql[j]){
518
+ newtemp.push(this.nameForSql[j])
519
+ }
520
+ }
521
+ }
522
+ if((newtemp.includes('f_user_number')&&newtemp.length==2)||(!newtemp.includes('f_user_number')&&newtemp.length==1)){
523
+ return
524
+ }
525
+ var temp=JSON.parse(JSON.stringify(this.model.rows))
526
+
527
+ //遍历查询结果 为指定列增加样式
528
+ for (var i=0;i<newtemp.length-1;i++){
529
+ if(newtemp[i]=='f_user_number'){
530
+ return;
531
+ }
532
+ //tag
533
+ var ss=''
534
+ for (var j=0;j<temp.length;j++){
535
+ if(j>0&&i>0){
536
+ var flag=false
537
+ for(var t=i-1;t>-1;t--){
538
+ //tag
539
+ //tag
540
+ //tag
541
+ //tag
542
+ if(temp[j-1][newtemp[t]]!=temp[j][newtemp[t]]&&(temp[j][newtemp[t]] !=null && temp[j][newtemp[t]].indexOf('*&') )==-1){
543
+ flag=true
544
+ break
545
+ }
546
+ }
547
+ //tag
548
+ if(flag){
549
+ ss=temp[j][newtemp[i]]
550
+ continue
551
+ }
552
+ }
553
+ if(temp[j][newtemp[i]]==ss){
554
+ temp[j][newtemp[i]]=temp[j][newtemp[i]]+'*&'
555
+ }else {
556
+ ss=temp[j][newtemp[i]]
557
+ }
558
+ }
559
+ }
560
+ //tag
561
+ this.model.rows=JSON.parse(JSON.stringify(temp))
562
+ }
563
+ },
564
+ computed:{
565
+ exportParameter(){
566
+ // excel 导出条件拼接
567
+ return {
568
+ condition: this.$refs.paged.model.condition,
569
+ groupName: this.groupNameForSql
570
+ }
571
+ }
572
+ }
573
+ }
574
+ </script>
575
+
576
+ <style scoped>
577
+
578
+ .td-0{
579
+ border: 1px solid #000000;
580
+ }
581
+
582
+ .td-1{
583
+ border: none;
584
+ border-top: 1px solid #000000;
585
+ border-left: 1px solid #000000;
586
+ border-right: 1px solid #000000;
587
+ }
588
+
589
+ .td-2{
590
+ border: none;
591
+ border-left: 1px solid #000000;
592
+ border-right: 1px solid #000000;
593
+ }
594
+ .td-4{
595
+ border: none;
596
+ border-top: 1px solid #000000;
597
+ border-left: 1px solid #000000;
598
+ border-right: 1px solid #000000;
599
+ border-bottom: 1px solid #000000;
600
+ }
601
+ .td-3{
602
+ border: none;
603
+ border-left: 1px solid #000000;
604
+ border-right: 1px solid #000000;
605
+ border-bottom: 1px solid #000000;
606
+ }
607
+ </style>