safecheck-client 3.0.33-104 → 3.0.33-106

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