manage-client 3.2.31 → 3.2.32

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,545 @@
1
+ <template>
2
+ <div id="unit" class="flex-row">
3
+ <div class="basic-main" @keyup.enter="search">
4
+ <div class="flex">
5
+ <div style="flex:1;" class="flex" v-if="!show">
6
+ <criteria-paged :model="model" v-ref:paged>
7
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
8
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
9
+ <div class="row">
10
+ <div class="col-sm-2 form-group" >
11
+ <label class="font_normal_body">客户编号</label>
12
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_userinfo_code"
13
+ condition="f_userinfo_code = '{}' " placeholder="客户编号">
14
+ </div>
15
+ <div class="col-sm-2 form-group" >
16
+ <label class="font_normal_body">客户名称</label>
17
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_user_name"
18
+ condition="f_user_name like '%{}%'" placeholder="客户名称">
19
+ </div>
20
+ <div class="col-sm-2 form-group" >
21
+ <label class="font_normal_body">客户电话</label>
22
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_user_phone"
23
+ condition="f_user_phone like '%{}%'" placeholder="客户电话">
24
+ </div>
25
+ <div class="span" style = "float:right;">
26
+ <button class="button_search button_spacing" @click="search()">查询</button>
27
+ <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
28
+ <!--<button class="btn btn-default" @click="$parent.$parent.stamp()">打印</button>-->
29
+
30
+ <export-excel :data="$parent.$parent.getCondition"
31
+ :field="$parent.$parent.getExportField"
32
+ :header="$parent.$parent.other"
33
+ v-if="$parent.$parent.authArr.includes('档案查询导出')"
34
+ sqlurl="rs/logic/exportfile" sql-name="deviceQuery" template-name='表具设备查询导出' :choose-col="true"></export-excel>
35
+ <print-data :sum-field="$parent.$parent.getExportField" :model="$parent.model" :field="$parent.$parent.getExportField"
36
+ :defaultfield="$parent.$parent.defaultfield"
37
+ titletable="表具设备查询"
38
+ :sumsmodel="$parent.$parent.sumsmodel"></print-data>
39
+ <div style="float: right" class="button_spacing" :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}" @click="$parent.$parent.hidden()"></div>
40
+ </div>
41
+ </div>
42
+ <div class="row" v-show="$parent.$parent.criteriaShow">
43
+ <div class="col-sm-2 form-group" >
44
+ <label class="font_normal_body">客户地址</label>
45
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_address"
46
+ condition="f_address like '%{}%'" placeholder='客户地址'>
47
+ </div>
48
+ <div class="col-sm-2 form-group" >
49
+ <label class="font_normal_body">客户状态</label>
50
+ <v-select :value.sync="model.f_user_state"
51
+ v-model="model.f_user_state"
52
+ :options='$parent.$parent.userstates' placeholder='请选择'
53
+ condition="f_user_state = '{}'"
54
+ close-on-select></v-select>
55
+ </div>
56
+ <div class="col-sm-2 form-group">
57
+ <label class="font_normal_body">客户类型</label>
58
+ <v-select :value.sync="model.f_user_type"
59
+ :options='$parent.$parent.usertypes' placeholder='请选择' v-model="model.f_user_type"
60
+ condition="f_user_type = '{}'"
61
+ close-on-select></v-select>
62
+ </div>
63
+ <div class="col-sm-2 form-group" >
64
+ <label class="font_normal_body">所属表&nbsp;&nbsp;&nbsp;</label>
65
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_meternumber"
66
+ condition="f_meternumber like '%{}%'" placeholder='所属表(表号)'>
67
+ </div>
68
+
69
+ <div class="col-sm-2 form-group" >
70
+ <label class="font_normal_body">设备类型</label>
71
+ <v-select :value.sync="model.f_devices_type"
72
+ v-model="model.f_devices_type"
73
+ :options='$parent.$parent.deviceTypes' placeholder='请选择'
74
+ condition="f_devices_type = '{}'"
75
+ close-on-select></v-select>
76
+ </div>
77
+ <div class="col-sm-2 form-group" >
78
+ <label class="font_normal_body">购买方式</label>
79
+ <v-select :value.sync="model.watchpurchase"
80
+ v-model="model.watchpurchase"
81
+ :options='$parent.$parent.watchpurchases' placeholder='请选择'
82
+ condition="watchpurchase = '{}'"
83
+ close-on-select></v-select>
84
+ </div>
85
+ <div class="col-sm-2 form-group" >
86
+ <label class="font_normal_body">管道类型</label>
87
+ <v-select :value.sync="model.f_pipe_type"
88
+ v-model="model.f_pipe_type"
89
+ :options='$parent.$parent.pipetype' placeholder='请选择'
90
+ condition="f_pipe_type = '{}'"
91
+ close-on-select></v-select>
92
+ </div>
93
+ <div class="col-sm-2 form-group">
94
+ <label class="font_normal_body">表&emsp;&emsp;号</label>
95
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_meter_number"
96
+ condition="f_meternumber = '{}'" placeholder='表号'>
97
+ </div>
98
+ <div class="col-sm-2 form-group">
99
+ <label class="font_normal_body">卡&emsp;&emsp;号</label>
100
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_card_id"
101
+ condition="f_card_id = '{}'" placeholder='卡号'>
102
+ </div>
103
+ <div class="col-sm-2 form-group" >
104
+ <label class="font_normal_body">设备编号</label>
105
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_devices_no"
106
+ condition="f_devices_no like '%{}%'" placeholder='设备编号'>
107
+ </div>
108
+ <div class="col-sm-2 form-group" >
109
+ <label class="font_normal_body">设备品牌</label>
110
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_brand"
111
+ condition="f_brand like '%{}%'" placeholder='设备品牌'>
112
+ </div>
113
+ <div class="col-sm-2 form-group" >
114
+ <label class="font_normal_body">设备型号</label>
115
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_devices_model"
116
+ condition="f_devices_model like '%{}%'" placeholder='设备型号'>
117
+ </div>
118
+ <div class="col-sm-2 form-group" >
119
+ <label class="font_normal_body">设备数量</label>
120
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_devices_num"
121
+ condition="f_devices_num = {}" placeholder='设备数量'>
122
+ </div>
123
+ <div class="col-sm-2 form-group" >
124
+ <label class="font_normal_body" title="安装日期大于">安装日期</label>
125
+ <datepicker placeholder="安装日期大于" style="width:60%"
126
+ v-model="model.f_input_start_date"
127
+ :value.sync="model.f_input_start_date"
128
+ :format="'yyyy-MM-dd'"
129
+ :show-reset-button="true"
130
+ condition="f_input_date >= '{} 00:00:00'">
131
+ </datepicker>
132
+ </div>
133
+ <div class="col-sm-2 form-group" >
134
+ <label class="font_normal_body" title="安装日期小于">安装日期</label>
135
+ <datepicker placeholder="安装日期小于" style="width:60%"
136
+ v-model="model.f_input_end_date"
137
+ :value.sync="model.f_input_end_date"
138
+ :format="'yyyy-MM-dd'"
139
+ :show-reset-button="true"
140
+ condition="f_input_date <= '{} 23:59:59'">
141
+ </datepicker>
142
+ </div>
143
+ <div class="col-sm-2 form-group" >
144
+ <label class="font_normal_body" >到期日期</label>
145
+ <datepicker placeholder="到期日期大于" style="width:60%"
146
+ v-model="model.f_expire_start_date"
147
+ :value.sync="model.f_expire_start_date"
148
+ :format="'yyyy-MM-dd'"
149
+ :show-reset-button="true"
150
+ condition="f_expire_date >= '{} 00:00:00'">
151
+ </datepicker>
152
+ </div>
153
+ <div class="col-sm-2 form-group" >
154
+ <label class="font_normal_body">到期日期</label>
155
+ <datepicker placeholder="到期日期小于" style="width:60%"
156
+ v-model="model.f_expire_end_date"
157
+ :value.sync="model.f_expire_end_date"
158
+ :format="'yyyy-MM-dd'"
159
+ :show-reset-button="true"
160
+ condition="f_expire_date <= '{} 23:59:59'">
161
+ </datepicker>
162
+ </div>
163
+ <div class="col-sm-2 form-group" >
164
+ <label class="font_normal_body" title="生产日期大于" >生产日期</label>
165
+ <datepicker placeholder="生产日期大于" style="width:60%"
166
+ v-model="model.f_make_start_date"
167
+ :value.sync="model.f_make_start_date"
168
+ :format="'yyyy-MM-dd'"
169
+ :show-reset-button="true"
170
+ condition="f_make_date >= '{} 00:00:00'">
171
+ </datepicker>
172
+ </div>
173
+ <div class="col-sm-2 form-group" >
174
+ <label class="font_normal_body" title="生产日期小于">生产日期</label>
175
+ <datepicker placeholder="生产日期小于" style="width:60%"
176
+ v-model="model.f_make_end_date"
177
+ :value.sync="model.f_make_end_date"
178
+ :format="'yyyy-MM-dd'"
179
+ :show-reset-button="true"
180
+ condition="f_make_date <= '{} 23:59:59'">
181
+ </datepicker>
182
+ </div>
183
+ <div class="col-sm-2 form-group" >
184
+ <label for="startDate" class="font_normal_body" title="操作开始日期">开始日期</label>
185
+ <datepicker id="startDate" placeholder="开始日期" style="width:60%"
186
+ v-model="model.startDate"
187
+ :value.sync="model.startDate"
188
+ :format="'yyyy-MM-dd'"
189
+ :show-reset-button="true"
190
+ condition="f_operate_date >= '{} 00:00:00'">
191
+ </datepicker>
192
+ </div>
193
+ <div class="col-sm-2 form-group" >
194
+ <label for="endDate" class="font_normal_body" title="操作结束日期">结束日期</label>
195
+ <datepicker id="endDate" placeholder="结束日期" style="width:60%"
196
+ v-model="model.endDate"
197
+ :value.sync="model.endDate"
198
+ :format="'yyyy-MM-dd'"
199
+ :show-reset-button="true"
200
+ condition="f_operate_date <= '{} 23:59:59'">
201
+ </datepicker>
202
+ </div>
203
+ <div class="col-sm-2 form-group" >
204
+ <label class="font_normal_body">使用年限</label>
205
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_service_life"
206
+ condition="f_service_life = '{}'" placeholder='使用年限'>
207
+ </div>
208
+ <div class="col-sm-2 form-group" >
209
+ <label class="font_normal_body">备注信息</label>
210
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_comments"
211
+ condition="f_comments like '%{}%'" placeholder='备注'>
212
+ </div>
213
+ <div class="col-sm-2 form-group">
214
+ <label class="font_normal_body" >抄表员&emsp;</label>
215
+ <v-select :value.sync="model.f_inputtor"
216
+ v-model="model.f_inputtor"
217
+ :options='$parent.$parent.inputtores' placeholder='请选择'
218
+ condition="f_inputtor = '{}'"
219
+ close-on-select :search="false">
220
+ </v-select>
221
+ </div>
222
+ <div class="col-sm-2 form-group">
223
+ <label class="font_normal_body">灶&ensp;前&ensp;阀</label>
224
+ <v-select :value.sync="model.f_zqf" v-model="model.f_zqf"
225
+ :options='$parent.$parent.zqf' placeholder='请选择'
226
+ condition="f_zqf = '{}'"
227
+ close-on-select></v-select>
228
+ </div>
229
+ <res-select-group :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes"></res-select-group>
230
+ </div>
231
+ </div>
232
+ </criteria>
233
+
234
+ <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid>
235
+ <template partial='head'>
236
+ <tr>
237
+ <th><nobr>客户编号</nobr></th>
238
+ <th><nobr>客户名称</nobr></th>
239
+ <th><nobr>客户电话</nobr></th>
240
+ <th><nobr>客户地址</nobr></th>
241
+ <th><nobr>客户状态</nobr></th>
242
+ <th><nobr>所属表具(表号)</nobr></th>
243
+ <th><nobr>购买方式</nobr></th>
244
+ <th><nobr>设备类型</nobr></th>
245
+ <th><nobr>设备编号</nobr></th>
246
+ <th><nobr>设备品牌</nobr></th>
247
+ <th><nobr>设备型号</nobr></th>
248
+ <th><nobr>设备数量</nobr></th>
249
+ <th><nobr>设备状态</nobr></th>
250
+ <th><nobr>管道类型</nobr></th>
251
+ <th><nobr>生产日期</nobr></th>
252
+ <th><nobr>使用年限</nobr></th>
253
+ <th><nobr>灶前阀</nobr></th>
254
+ <th><nobr>安装人</nobr></th>
255
+ <th><nobr>安装日期</nobr></th>
256
+ <th><nobr>到期日期</nobr></th>
257
+ <th><nobr>操作人</nobr></th>
258
+ <th><nobr>操作时间</nobr></th>
259
+ <th><nobr>备注</nobr></th>
260
+ </tr>
261
+ </template>
262
+ <template partial='body'>
263
+ <td style="text-align: center;"><nobr>
264
+ <span @click="$parent.$parent.$parent.showmsg(row)"><a>{{row.f_userinfo_code}}</a></span>
265
+ </nobr> </td>
266
+ <td style="text-align: center;"><nobr>{{row.f_user_name}}</nobr></td>
267
+ <td style="text-align: center;"><nobr>{{row.f_user_phone}}</nobr></td>
268
+ <td style="text-align: center;"><nobr>{{row.f_address}}</nobr></td>
269
+ <td style="text-align: center;"><nobr>{{row.f_user_state}}</nobr></td>
270
+ <td style="text-align: center;"><nobr>{{row.f_meternumber}}</nobr></td>
271
+ <td style="text-align: center;"><nobr>{{row.watchpurchase}}</nobr></td>
272
+ <td style="text-align: center;"><nobr>{{row.f_devices_type}}</nobr></td>
273
+ <td style="text-align: center;"><nobr>{{row.f_devices_no}}</nobr></td>
274
+ <td style="text-align: center;"><nobr>{{row.f_brand}}</nobr></td>
275
+ <td style="text-align: center;"><nobr>{{row.f_devices_model}}</nobr></td>
276
+ <td style="text-align: center;"><nobr>{{row.f_devices_num}}</nobr></td>
277
+ <td style="text-align: center;"><nobr>{{row.f_userinfodevices_state}}</nobr></td>
278
+ <td style="text-align: center;"><nobr>{{row.f_pipe_type}}</nobr></td>
279
+ <td style="text-align: center;"><nobr>{{row.f_make_date}}</nobr></td>
280
+ <td style="text-align: center;"><nobr>{{row.f_service_life}}</nobr></td>
281
+ <td style="text-align: center;"><nobr>{{row.f_zqf}}</nobr></td>
282
+ <td style="text-align: center;"><nobr>{{row.f_input_person}}</nobr></td>
283
+ <td style="text-align: center;"><nobr>{{row.f_input_date}}</nobr></td>
284
+ <td style="text-align: center;"><nobr>{{row.f_expire_date}}</nobr></td>
285
+ <td style="text-align: center;"><nobr>{{row.f_operator}}</nobr></td>
286
+ <td style="text-align: center;"><nobr>{{row.f_operate_date}}</nobr></td>
287
+ <td style="text-align: center;"><nobr>{{row.f_comments}}</nobr></td>
288
+ </template>
289
+ <template partial='foot'>
290
+
291
+ </template>
292
+ </data-grid>
293
+ </criteria-paged>
294
+
295
+ <table class="table-hover">
296
+ <tr style="position: relative" class="table-bordered">
297
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">汇总信息</td>
298
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">暂无合计字段</td>
299
+ </tr>
300
+ </table>
301
+
302
+ <modal :show.sync="printshow" v-ref:modal backdrop="false">
303
+ <header slot="modal-header" class="modal-header text-center">
304
+ <h4 class="modal-title">打印列选择</h4>
305
+ <input type="checkbox" class="" id="f_generations" v-model="all">
306
+ <label for="f_generations" class="font-size">全选</label>
307
+ </header>
308
+ <article slot="modal-body">
309
+ <div class="auto col-sm-11 col-md-offset-1" style="margin-top: 10px;">
310
+ <div class="col-sm-3" v-for="f in fields">
311
+ <input type="checkbox" class="" :id="'water-owe-details-'+$index" v-model="modelval" :value="$key">
312
+ <label :for="'water-owe-details-'+$index" class="font-size">{{f}}</label>
313
+ </div>
314
+ </div>
315
+ </article>
316
+ <footer slot="modal-footer" class="modal-footer">
317
+ <center>
318
+ <button v-show="printshow" type="button" class="btn btn-default" @click='close()'>取消</button>
319
+ <button v-show="printshow" type="button" class="btn btn-success" @click='print()'>打印</button>
320
+ <print-table :model='model' v-show="false" v-ref:print
321
+ :top='40' :left='60' :right='40' :bottom='60'
322
+ :thead="thead" :tfoot='tfoot' :attach="yangsen"
323
+ :fields="modelval" :printpage="true">
324
+ </print-table>
325
+ </center>
326
+ </footer>
327
+ </modal>
328
+ </div>
329
+ <div class="flex" v-if="show">
330
+ <user-info-detail-manage-new :f_userinfo_id="rowdata.f_userinfo_id" @cancel-main="cancel"></user-info-detail-manage-new>
331
+ </div>
332
+ </div></div></div>
333
+ </template>
334
+
335
+ <script>
336
+ import { PagedList } from 'vue-client'
337
+ import defaultPrint from './config/DefaultPrint'
338
+ import exportConfig from './config/exportConfig'
339
+
340
+
341
+ let readySomething = async function (self) {
342
+ self.defaultfield = [...self.defaultfield, ...self.config.defaultPrint]
343
+ self.$MagGetSaleParam.initinputtor();
344
+ self.getinputtores();
345
+ // self.$refs.paged.$refs.cri.model.startDate = self.$login.toStandardDateString()
346
+ // self.$refs.paged.$refs.cri.model.endDate = self.$login.toStandardDateString()
347
+ // await self.$refs.paged.$refs.cri.search()
348
+ }
349
+ export default {
350
+ title: '表具设备查询',
351
+ data() {
352
+ return {
353
+ other:[],
354
+ footer:[],
355
+ model: new PagedList('rs/sql/deviceQuery', 20),
356
+ criteriaShow: false,
357
+ orgCondtionStr: '',
358
+ modelval: [],
359
+ printshow: false,
360
+ all: false,
361
+ fields: {},
362
+ thead: '',
363
+ tfoot: '',
364
+ defaultfield: [],
365
+ config: {
366
+ defaultPrint: ['f_userinfo_code', 'f_user_name', 'f_user_phone']
367
+ },
368
+ show:false,
369
+ rowdata:{},
370
+ // 下拉框参数
371
+ inputtores:[],
372
+ zqf:this.$appdata.getParam('灶前阀') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('灶前阀')] : [],
373
+ usertypes:this.$appdata.getParam('用户类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')] : [],
374
+ userstates:this.$appdata.getParam('用户状态') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用户状态')] : [],
375
+ deviceTypes: this.$appdata.getParam('设备类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('设备类型')] : [],
376
+ // brand: this.$appdata.getParam('设备品牌') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('设备品牌')] : [],
377
+ watchpurchases: this.$appdata.getParam('购买方式') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('购买方式')] : [],
378
+ pipetype: this.$appdata.getParam('管道类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('管道类型')] : [],
379
+ initres: {
380
+ org:[this.$login.f.orgid],
381
+ dep:[],
382
+ user:[],
383
+ },
384
+ // 合计数据
385
+ sumsmodel: {}
386
+ }
387
+ },
388
+ ready(){
389
+ readySomething(this).then(() => {
390
+ this.$emit('ready')
391
+ }).catch((error) => {
392
+ this.$emit('error', error)
393
+ })
394
+ },
395
+ methods: {
396
+ async getinputtores () {
397
+ // 获取抄表员
398
+ let rs = []
399
+ if (this.$login.f.f_gasman.length > 0) {
400
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
401
+ let temp = {
402
+ label: this.$login.f.f_gasman[i].name,
403
+ value: this.$login.f.f_gasman[i].name
404
+ }
405
+ rs.push(temp)
406
+ }
407
+ }
408
+ this.inputtores = [{label: '全部', value: ''}, ...rs]
409
+ },
410
+ getotherfooter () {
411
+ // this.$refs.paged.$refs.cri.$refs.exports.otherData = [];
412
+ // this.$refs.paged.$refs.cri.$refs.exports.footerData = [];
413
+ this.other = [];
414
+ this.footer = [];
415
+ let exportdata = this.getCondition;
416
+ let otherInData = [];
417
+ otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`);
418
+ // let footerData = [], exportfield = this.getExportField;
419
+ // footerData.push("合计");
420
+ // let self = this;
421
+ // for (var field in self.sumsmodel) {
422
+ // footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`);
423
+ // }
424
+ // this.footer.push(footerData);
425
+ this.other.push(otherInData);
426
+ },
427
+ search(){
428
+ this.$refs.paged.$refs.cri.search()
429
+ },
430
+ cancel() {
431
+ this.show = false
432
+ },
433
+ showmsg(obj){
434
+ this.rowdata=obj
435
+ this.show=true
436
+ },
437
+ selfSearch (args) {
438
+ if (!this.orgCondtionStr) {
439
+ args.condition = `${args.condition}` + " and f_orgid = " + this.$login.f.orgid
440
+ } else {
441
+ args.condition = `${args.condition}` + this.orgCondtionStr
442
+ }
443
+
444
+ this.model.search(args.condition, args.model)
445
+ this.sumsmodel = this.$refs.paged.$refs.grid.model.sums
446
+ console.log('合计字段',this.sumsmodel)
447
+ },
448
+ clear(){
449
+ Object.keys(this.$refs.paged.$refs.cri.model).forEach((key) => {
450
+ this.$refs.paged.$refs.cri.model[key] = []
451
+ })
452
+ },
453
+ hidden(){
454
+ this.criteriaShow = !this.criteriaShow
455
+ },
456
+ getRes(obj) {
457
+ this.orgCondtionStr = obj
458
+ },
459
+ stamp () {
460
+ this.all = false
461
+ //默认选择要打印的列
462
+ this.modelval = defaultPrint.config
463
+ this.fields = this.getfield
464
+ console.log('所有打印字段',this.fields)
465
+ this.printshow = true
466
+ this.put()
467
+ },
468
+ put () {
469
+ // 对Modelval进行排序
470
+ this.sortModelval()
471
+ this.thead = `<tr><th colspan=${this.modelval.length}>设备查询统计报表</th></tr><tr>`
472
+ for (let key of this.modelval) {
473
+ this.thead += '<th>' + this.fields[key] + '</th>'
474
+ }
475
+ this.thead += '</tr>'
476
+ },
477
+ print () {
478
+ this.$refs.print.PrintAsFile()
479
+ this.printshow = false
480
+ },
481
+ close () {
482
+ this.printshow = false
483
+ this.all = false
484
+ },
485
+ // 对选择的列进行排序
486
+ sortModelval () {
487
+ let sortModel = []
488
+ Object.keys(this.fields).forEach((key) => {
489
+ if (this.modelval.includes(key)) {
490
+ sortModel.push(key)
491
+ }
492
+ })
493
+ this.modelval = sortModel
494
+ console.log('选择的打印的字段', this.modelval)
495
+ }
496
+ },
497
+ watch:{
498
+ 'all' (val) {
499
+ if (val) {
500
+ this.modelval = this.bodyData
501
+ } else {
502
+ this.modelval = defaultPrint.config
503
+ this.put()
504
+ }
505
+ },
506
+ sumsmodel:{
507
+ handler: function(val) {
508
+ this.getotherfooter();
509
+ },
510
+ deep: true
511
+ },
512
+ 'modelval.length' () {
513
+ this.put()
514
+ },
515
+ },
516
+ computed:{
517
+ authArr () {
518
+ return this.$login.r ? this.$login.r : []
519
+ },
520
+ getCondition(){
521
+ return {condition: `${this.$refs.paged.$refs.cri.condition}`+this.orgCondtionStr}
522
+ },
523
+ getfield(){
524
+ let data = {}
525
+ this.bodyData.forEach((value, index)=>{
526
+ data[this.bodyData[index]] = this.headData[index]
527
+ })
528
+ //合计字段打印
529
+ this.tfoot = `<tr><th colspan=${this.modelval.length}>全表汇总信息: `
530
+ if(this.sumsmodel){
531
+ Object.keys(this.sumsmodel).forEach((key) => {
532
+ this.tfoot += this.fields[key] + '合计: ' + `<font color="blue">${this.sumsmodel[key]} </font>`
533
+ })
534
+ }else{
535
+ this.tfoot += '暂无'
536
+ }
537
+ this.tfoot += '</th></tr>'
538
+ return data
539
+ },
540
+ getExportField() {
541
+ return exportConfig.deviceConfig
542
+ }
543
+ }
544
+ }
545
+ </script>