safecheck-client 4.0.0-96 → 4.0.0-97

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,308 @@
1
+ <template>
2
+ <div>
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' class="search_area" @condition-changed='$parent.search' 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-6':$parent.$parent.$parent.showItem,'form-group col-sm-4':!$parent.$parent.$parent.showItem}" style="margin: 0">
8
+ <role-selector-safe-dep
9
+ role-name="安检员"
10
+ role-lable="安&ensp;检&ensp;员"
11
+ @re-res="$parent.$parent.getRes"
12
+ @alluser="$parent.$parent.getchecker"
13
+ :value.sync="model.f_checker_id"
14
+ v-model="model.f_checker_id">
15
+ </role-selector-safe-dep>
16
+ </div>
17
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.showItem,'form-group col-sm-2':!$parent.$parent.$parent.showItem}">
18
+ <label class="font_normal_body">计划起始</label>
19
+ <datepicker
20
+ :value.sync="$parent.$parent.f_check_start"
21
+ placeholder='起始月份' style="width:60%"
22
+ :disabled-days-of-week="[]"
23
+ :format="'yyyy-MM'"
24
+ :select-month="true"
25
+ :show-rest-button="reset">
26
+ </datepicker>
27
+ </div>
28
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.showItem,'form-group col-sm-2':!$parent.$parent.$parent.showItem}">
29
+ <label class="font_normal_body">计划截止</label>
30
+ <datepicker
31
+ :value.sync="$parent.$parent.f_check_end"
32
+ placeholder='结束月份' style="width:60%"
33
+ :disabled-days-of-week="[]"
34
+ :format="'yyyy-MM'"
35
+ :select-month="true"
36
+ :show-rest-button="reset">
37
+ </datepicker>
38
+ </div>
39
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.showItem,'form-group col-sm-2':!$parent.$parent.$parent.showItem}">
40
+ <label class="font_normal_body">安检起始</label>
41
+ <datepicker
42
+ :value.sync="$parent.$parent.f_start_time"
43
+ placeholder='安检起始' style="width:60%"
44
+ :show-rest-button="reset">
45
+ </datepicker>
46
+ </div>
47
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.showItem,'form-group col-sm-2':!$parent.$parent.$parent.showItem}">
48
+ <label class="font_normal_body">安检截止</label>
49
+ <datepicker
50
+ :value.sync="$parent.$parent.f_end_time"
51
+ placeholder='安检截止' style="width:60%"
52
+ :show-rest-button="reset">
53
+ </datepicker>
54
+ </div>
55
+ <div :class="{'form-group col-sm-3':$parent.$parent.$parent.showItem,'form-group col-sm-2':!$parent.$parent.$parent.showItem}">
56
+ <label class="font_normal_body" >小&emsp;&emsp;区</label>
57
+ <input type="text" class="input_search" v-model="model.f_residential_area"
58
+ style="width: 60%" placeholder="小区" >
59
+ </div>
60
+ <div style="width: auto;margin-top:8px;float: right" :class="{'form-group col-sm-3':$parent.$parent.$parent.showItem,'form-group col-sm-2':!$parent.$parent.$parent.showItem}">
61
+ <export-excel :data="$parent.$parent.searchData"
62
+ :field="$parent.$parent.excelHeaders"
63
+ progress="safeGetExportProgress"
64
+ sqlurl="api/af-safecheck/logic/exportfile" sql-name="planCount" template-name='安检计划明细' ></export-excel>
65
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
66
+ <div class="button_spacing"
67
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
68
+ @click="$parent.$parent.hiddenr()"></div>
69
+ </div>
70
+ </div>
71
+ </div>
72
+ </criteria>
73
+ <data-grid :model="model" partial='list' v-ref:grid class="list_area table_sy">
74
+ <template partial='head'>
75
+ <tr>
76
+ <th>安检员</th>
77
+ <th>总入户量</th>
78
+ <th>总到访不遇量</th>
79
+ <th>总拒检量</th>
80
+ <th>安检总量</th>
81
+ <th>计划总数</th>
82
+ <th>入户</th>
83
+ <th>到访不遇</th>
84
+ <th>拒检</th>
85
+ <th>无计划总数</th>
86
+ <th>无计划入户</th>
87
+ <th>无计划到访不遇</th>
88
+ <th>无计划拒检</th>
89
+ </tr>
90
+ </template>
91
+ <template partial='body'>
92
+ <td style="text-align: center">{{row.f_checker}}</td>
93
+ <td style="text-align: center">{{row.ruhu_total}}</td>
94
+ <td style="text-align: center">{{row.daofang_total}}</td>
95
+ <td style="text-align: center">{{row.jujian_total}}</td>
96
+ <td style="text-align: center">{{row.total_sum}}</td>
97
+ <td style="text-align: center">{{row.plannum}}</td>
98
+ <td style="text-align: center">{{row.ruhu}}</td>
99
+ <td style="text-align: center">{{row.daofang}}</td>
100
+ <td style="text-align: center">{{row.jujian}}</td>
101
+ <td style="text-align: center">{{row.no_plan_num}}</td>
102
+ <td style="text-align: center">{{row.noruhu}}</td>
103
+ <td style="text-align: center">{{row.nodaofang}}</td>
104
+ <td style="text-align: center">{{row.nojujian}}</td>
105
+ </template>
106
+ <template partial="foot">
107
+ <td style="text-align: center"><span><b>合计:</b></span></td>
108
+ <td style="text-align: center">{{model.sums.ruhu_total}}</td>
109
+ <td style="text-align: center">{{model.sums.daofang_total}}</td>
110
+ <td style="text-align: center">{{model.sums.jujian_total}}</td>
111
+ <td style="text-align: center">{{model.sums.total_sum}}</td>
112
+ <td style="text-align: center">{{model.sums.plannum}}</td>
113
+ <td style="text-align: center">{{model.sums.ruhu}}</td>
114
+ <td style="text-align: center">{{model.sums.daofang}}</td>
115
+ <td style="text-align: center">{{model.sums.jujian}}</td>
116
+ <td style="text-align: center">{{model.sums.no_plan_num}}</td>
117
+ <td style="text-align: center">{{model.sums.noruhu}}</td>
118
+ <td style="text-align: center">{{model.sums.nodaofang}}</td>
119
+ <td style="text-align: center">{{model.sums.nojujian}}</td>
120
+ </template>
121
+ </data-grid>
122
+ </criteria-paged>
123
+ </div>
124
+ </template>
125
+ <script>
126
+ import {PagedList} from 'vue-client'
127
+
128
+
129
+ export default {
130
+ title: '安检计划查询',
131
+ data() {
132
+ let options = []
133
+ let year = (new Date()).getFullYear()
134
+ for (let i = year - 8; i <= year + 1; i++)
135
+ options.push({label: i + '', value: i + ''})
136
+ let model = new PagedList('api/af-safecheck/sql/planCount', 20, {
137
+ f_filialeids: 'this.f_filialeids',
138
+ f_start_time: 'this.f_start_time',
139
+ condition1:'this.condition1',
140
+ condition2:'this.condition2',
141
+ condition3:'this.condition3',
142
+ f_end_time: 'this.f_end_time'
143
+ }, {plannum: '', ruhu: '', jujian: '', daofang: '',no_plan_num:'',noruhu:'',nodaofang:'',nojujian:'',ruhu_total:'',daofang_total:'',jujian_total:'',total_sum:''})
144
+ model.f_filialeids = '('+this.$login.f.orgid+')'
145
+ return {
146
+ excelHeaders:{
147
+ 'f_checker': '安检员',
148
+ 'plannum': '计划总数',
149
+ 'ruhu': '入户',
150
+ 'jujian': '拒检',
151
+ 'daofang': '到访不遇',
152
+ 'no_plan_num': '无计划总数',
153
+ 'noruhu': '无计划入户',
154
+ 'nojujian': '无计划拒检',
155
+ 'nodaofang': '无计划到访不遇'
156
+ },
157
+ searchData:{
158
+ condition:"1=1",
159
+ condition1:"1=1",
160
+ condition2:"1=1",
161
+ condition3:"and 1=1",
162
+ f_plan_year:year[0],
163
+ f_checker:'',
164
+ f_filialeids:'('+this.$login.f.orgid+')',
165
+ f_start_time:'',
166
+ f_end_time:''
167
+ },
168
+ checker: this.$login.f,
169
+ checkers: [],
170
+ checkersname: [],
171
+ checkStates: this.$appdata.getParam('安检状态'),
172
+ f: this.$login.f,
173
+ criteriaShow: false,
174
+ model: model,
175
+ c_year_list: options,
176
+ f_check_start:'',
177
+ f_check_end: '',
178
+ f_start_time:'',
179
+ f_end_time:'',
180
+ checker_name:''
181
+ }
182
+ },
183
+ methods: {
184
+ getchecker(val){
185
+ this.$refs.paged.$refs.cri.model.f_checker_id = ''
186
+ if(val && val.length > 0){
187
+ this.checker_name = ''
188
+ val.forEach(user => {
189
+ this.checker_name += `'${user.name}',`
190
+ })
191
+ this.checker_name = this.checker_name.slice(0,this.checker_name.length-1)
192
+ }else{
193
+ this.checker_name = ''
194
+ }
195
+ },
196
+ hidden() {
197
+ this.criteriaShow = !this.criteriaShow
198
+ },
199
+ hiddenr() {
200
+ this.$parent.showItem = !this.$parent.showItem
201
+ },
202
+ search(args) {
203
+ let tempStr = args.condition
204
+ let condition1 = tempStr
205
+ let condition2 = tempStr
206
+ let condition3 = ' and 1=1 '
207
+ if (this.f_check_start) {
208
+ condition1 += ` AND f_plan_year >= ${this.f_check_start.substr(0,4)} `
209
+ condition1 += ` AND f_plan_month >= ${this.f_check_start.substr(5,2)} `
210
+ }
211
+ if (this.f_check_end) {
212
+ condition1 += ` AND f_plan_year <= ${this.f_check_end.substr(0,4)} `
213
+ condition1 += ` AND f_plan_month <= ${this.f_check_end.substr(5,2)} `
214
+ }
215
+ if(args.model.f_residential_area){
216
+ condition1 += ` AND tcpi.f_residential_area like '${args.model.f_residential_area}' `
217
+ condition2 += ` AND f_residential_area like '${args.model.f_residential_area}' `
218
+
219
+ }
220
+ if(this.f_start_time){
221
+ condition2 += ` AND f_offsite_time >= '${this.f_start_time} 00:00:00'`
222
+ }
223
+ if (this.f_end_time){
224
+ condition2 += ` AND f_offsite_time <= '${this.f_end_time} 23:59:59'`
225
+ }
226
+ if (this.$refs.paged.$refs.cri.model.f_checker_id){
227
+ condition3 += ` AND f_checker = '${this.$refs.paged.$refs.cri.model.f_checker_id}' `
228
+ condition2 += ` AND f_checker_name = '${this.$refs.paged.$refs.cri.model.f_checker_id}' `
229
+ }
230
+ if(this.checker_name){
231
+ condition3 += ` and f_checker in (${this.checker_name}) `
232
+ condition2 += ` AND f_checker_name in (${this.checker_name}) `
233
+ }
234
+ this.model.f_start_time=this.f_start_time
235
+ this.model.f_end_time=this.f_end_time
236
+ this.model.condition1=condition1
237
+ this.model.condition2=condition2
238
+ this.model.condition3=condition3
239
+
240
+ this.searchData.condition1=condition1
241
+ this.searchData.condition2=condition2
242
+ this.searchData.condition3=condition3
243
+
244
+ this.model.search(args.condition, args.model)
245
+ },
246
+ getRes(obj){
247
+ if(obj.orgobj[0]){
248
+ this.model.f_filialeid = this.$login.convertToIn(obj.orgobj[0].parentid)
249
+ }else{
250
+ this.model.f_filialeid = this.$login.convertToIn(this.$login.f.orgid)
251
+ }
252
+ }
253
+ },
254
+ ready() {
255
+ this.model.id = this.$login.f.id
256
+ this.model.f_subcompany = this.$login.f.f_fengongsi
257
+ this.model.f_filialeid = this.$login.f.orgid
258
+ },
259
+
260
+ watch: {
261
+ 'model.condition'(val) {
262
+ if(val){
263
+ this.searchData.condition = val
264
+ }
265
+ },
266
+ 'model.f_checker'(val) {
267
+ if(val){
268
+ this.searchData.f_checker = val
269
+ }
270
+ },
271
+ 'f_start_time'(val) {
272
+ if(val){
273
+ this.searchData.f_start_time = val
274
+ }
275
+ },
276
+ 'f_end_time'(val) {
277
+ if(val){
278
+ this.searchData.f_end_time = val
279
+ }
280
+ },
281
+ 'checker'() {
282
+ // //tag
283
+ //tag
284
+ this.model.chosenOrg = this.checker[0]
285
+ },
286
+ 'model.rows.length'() {
287
+ // 如果查询无结果,将合计置为0
288
+ if(this.model.rows.length < 1 &&this. model.sums){
289
+ this.model.sums.yrj = 0
290
+ this.model.sums.no_plan_num = 0
291
+ this.model.sums.wrj = 0
292
+ this.model.sums.ruhu = 0
293
+ this.model.sums.jujian = 0
294
+ this.model.sums.daofang = 0
295
+ this.model.sums.ruhu_total=0
296
+ this.model.sums.daofang_total=0
297
+ this.model.sums.jujian_total=0
298
+ this.model.sums.total_sum=0
299
+ }
300
+ }
301
+ },
302
+ computed: {
303
+ selected() {
304
+ return this.$refs.paged.$refs.grid.selected
305
+ }
306
+ }
307
+ }
308
+ </script>