safecheck-client 4.0.2-44 → 4.0.2-47

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