manage-client 3.3.94-wn2 → 3.3.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,554 +1,553 @@
1
- <template>
2
- <div id="unit" class="flex-row">
3
- <div class="basic-main" @keyup.enter="search">
4
- <div class="flex" v-if="!show">
5
- <criteria-paged :model="model" v-ref:paged>
6
- <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
7
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
8
- <div class="row">
9
- <div :class="$parent.$parent.style">
10
- <label for="startDate" class="font_normal_body">开始日期</label>
11
- <datepicker id="startDate" placeholder="开始日期" style="width:60%"
12
- v-model="$parent.$parent.startDate"
13
- :value.sync="$parent.$parent.startDate"
14
- :format="'yyyy-MM-dd'"
15
- :show-reset-button="true">
16
- </datepicker>
17
- </div>
18
- <div :class="$parent.$parent.style">
19
- <label for="endDate" class="font_normal_body">结束日期</label>
20
- <datepicker id="endDate" placeholder="结束日期" style="width:60%"
21
- v-model="$parent.$parent.endDate"
22
- :value.sync="$parent.$parent.endDate"
23
- :format="'yyyy-MM-dd'"
24
- :show-reset-button="true">
25
- </datepicker>
26
- </div>
27
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showDetail">
28
- <label class="font_normal_body">单位编号</label>
29
- <input type="text" style="width:60%" class="input_search" v-model="model.id"
30
- condition="id = '{}' " placeholder="单位编号">
31
- </div>
32
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showDetail">
33
- <label for="endDate" class="font_normal_body">单位名称</label>
34
- <input type="text" style="width:60%" class="input_search" v-model="model.f_company_name"
35
- condition="f_company_name like '%{}%' " placeholder="单位名称">
36
- <!-- <v-select :value.sync="model.f_company_id"-->
37
- <!-- class="select_list select"-->
38
- <!-- enter-push :disabled="$parent.$parent.isCompanyShow"-->
39
- <!-- v-model="model.f_company_id" multiple="true"-->
40
- <!-- :options='$parent.$parent.corporatename' placeholder='单位名称'-->
41
- <!-- condition="f_company_id in {}">-->
42
- <!-- </v-select>-->
43
- </div>
44
- <div class="span" style="float:right;">
45
- <button class="button_search button_spacing" @click="search()">查询</button>
46
- <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
47
- <export-excel :data="$parent.$parent.getCondition"
48
- :field="$parent.$parent.getfield"
49
- :header="$parent.$parent.other"
50
- :footer="$parent.$parent.footer"
51
- sqlurl="rs/logic/exportfile"
52
- sql-name="manage_companyGasSummary"
53
- template-name='单位用气售气汇总'
54
- :choose-col="true"></export-excel>
55
- <print-data :sum-field="$parent.$parent.getfield" :model="$parent.model"
56
- :field="$parent.$parent.getfield"
57
- titletable="单位用气售气汇总" :starthead="$parent.$parent.startDate"
58
- :defaultfield="$parent.$parent.defaultfield"
59
- :sumsmodel="$parent.$parent.sumsmodel"></print-data>
60
- <div
61
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
62
- @click="$parent.$parent.hidden()"
63
- class="button_spacing"
64
- style="float: right"></div>
65
- </div>
66
- </div>
67
- <div class="row" v-if="$parent.$parent.criteriaShow">
68
- <res-select-group
69
- :style="$parent.$parent.style"
70
- :show-component="['company','slicearea']"
71
- :initres="$parent.$parent.initres"
72
- @re-res="$parent.$parent.getRes"
73
- v-ref:sel
74
- ></res-select-group>
75
- <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.showDetail">
76
- <label class="font_normal_body">单位编号</label>
77
- <input type="text" style="width:60%" class="input_search" v-model="model.id"
78
- condition="id = '{}' " placeholder="单位编号">
79
- </div>
80
- <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.showDetail">
81
- <label for="endDate" class="font_normal_body">单位名称</label>
82
- <input type="text" style="width:60%" class="input_search" v-model="model.f_company_name"
83
- condition="f_company_name like '%{}%' " placeholder="单位名称">
84
- <!-- <v-select :value.sync="model.f_company_id"-->
85
- <!-- class="select_list select"-->
86
- <!-- enter-push :disabled="$parent.$parent.isCompanyShow"-->
87
- <!-- v-model="model.f_company_id" multiple="true"-->
88
- <!-- :options='$parent.$parent.corporatename' placeholder='单位名称'-->
89
- <!-- condition="f_company_id in {}">-->
90
- <!-- </v-select>-->
91
- </div>
92
- <div class="col-sm-2 form-group">
93
- <label class="font_normal_body">用户类型</label>
94
- <v-select :value.sync="model.f_user_type"
95
- :options='$parent.$parent.usertypes'
96
- @change="$parent.$parent.userTypeChange()"
97
- :value-single="true"
98
- placeholder='请选择' v-model="model.f_user_type"
99
- ></v-select>
100
- </div>
101
- <div class="col-sm-2 form-group">
102
- <label for="f_user_usetype" class="font_normal_body ">用气类型</label>
103
- <v-select :value.sync="model.f_userusetype" :search="false"
104
- @change="$parent.$parent.userUseTypeChange()"
105
- v-model="model.f_userusetype"
106
- :multiple="true"
107
- :options='$parent.$parent.userusetypes'
108
- placeholder='用气类型'>
109
- </v-select>
110
- </div>
111
- <div class="col-sm-2 form-group">
112
- <label for="f_use_institution" class="font_normal_body">用气机构</label>
113
- <v-select :value.sync="model.f_use_institution" :search="false"
114
- @change="$parent.$parent.userUseInstitutionChange()"
115
- v-model="model.f_use_institution"
116
- :value-single="true"
117
- :options='$parent.$parent.useinstitutions'
118
- placeholder='用气机构'
119
- close-on-select>
120
- </v-select>
121
- </div>
122
- <div class="col-sm-2 form-group">
123
- <label for="f_user_usenature" class="font_normal_body ">使用性质</label>
124
- <v-select :value.sync="model.f_user_usenature" :search="false"
125
- v-model="model.f_user_usenature"
126
- :value-single="true"
127
- :options='$parent.$parent.userusenatures'
128
- placeholder='使用性质'
129
- close-on-select>
130
- </v-select>
131
- </div>
132
- <!-- <div class="col-sm-2 form-group">-->
133
- <!-- <label for="endDate" class="font_normal_body">小区名称</label>-->
134
- <!-- <v-select :value.sync="model.f_residential_area_id"-->
135
- <!-- class="select_list select"-->
136
- <!-- enter-push :disabled="$parent.$parent.isAreaShow"-->
137
- <!-- v-model="model.f_residential_area_id" multiple="true"-->
138
- <!-- @select-search="$parent.$parent.getAreaList"-->
139
- <!-- :options='$parent.$parent.areaList' placeholder='小区名称'-->
140
- <!-- condition="f_residential_area_id in {}">-->
141
- <!-- </v-select>-->
142
- <!-- </div>-->
143
- </div>
144
- </div>
145
- </criteria>
146
- <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid :classname="$parent.classname">
147
- <template partial='head'>
148
- <tr>
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
- <th>
171
- <nobr>表具数量</nobr>
172
- </th>
173
- </tr>
174
- </template>
175
- <template partial='body'>
176
- <td style="text-align:center">
177
- <nobr>{{ $index + 1 }}</nobr>
178
- </td>
179
- <td style="text-align: center;">
180
- <nobr>{{ row.id }}</nobr>
181
- </td>
182
- <td style="text-align: center;">
183
- <nobr>{{ row.f_company_name }}</nobr>
184
- </td>
185
- <td style="text-align: center;">
186
- <nobr>{{ row.f_oughtamount }}</nobr>
187
- </td>
188
- <td style="text-align: center;">
189
- <nobr>{{ row.f_oughtfee }}</nobr>
190
- </td>
191
- <td style="text-align: center;">
192
- <nobr>{{ row.f_pregas }}</nobr>
193
- </td>
194
- <td style="text-align: center;">
195
- <nobr>{{ row.f_collection }}</nobr>
196
- </td>
197
- <td style="text-align: center;">
198
- <nobr>{{ row.f_table_num }}</nobr>
199
- </td>
200
- </template>
201
- <template partial='foot'></template>
202
- </data-grid>
203
- </criteria-paged>
204
- <table class="table-hover">
205
- <tr style="position: relative" class="table-bordered">
206
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
207
- 汇总信息
208
- </td>
209
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
210
- 用气量:&emsp;{{ sumsmodel.f_oughtamount.toFixed(2) }}m³
211
- </td>
212
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
213
- 用气金额:&emsp;{{ sumsmodel.f_oughtfee.toFixed(2) }}元
214
- </td>
215
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
216
- 售气量:&emsp;{{ sumsmodel.f_pregas.toFixed(2) }}m³
217
- </td>
218
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
219
- 售气金额:&emsp;{{ sumsmodel.f_collection.toFixed(2) }}元
220
- </td>
221
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
222
- 表具数量:&emsp;{{ sumsmodel.f_table_num }}
223
- </td>
224
- </tr>
225
- </table>
226
- </div>
227
- </div>
228
- </div>
229
- </template>
230
- <script>
231
- import {PagedList, HttpResetClass} from 'vue-client'
232
- import defaultPrint from './config/DefaultPrint'
233
- import exportConfig from './config/exportConfig'
234
- import PrintDataSelf from '../../components/sale/common/PrintDataSelf'
235
-
236
- let readySomething = async function (self) {
237
- self.startDate = self.getCurrentMonthFirst()
238
- self.endDate = self.getCurrentMonthLast()
239
- // self.getCompanyList()
240
- }
241
- export default {
242
- title: '单位用气售气',
243
- data () {
244
- return {
245
- depresid: [],
246
- userresid: [],
247
- f_orgid: this.$login.f.orgid,
248
- f_depid: this.$login.f.depids,
249
- f_operatorid: this.$login.f.id,
250
- operatorid: [],
251
- depid: [],
252
- orgname: '',
253
- depname: [],
254
- operatorname: '',
255
- condition: '',
256
- orgConditionStr: '',
257
- data: {},
258
- other: [],
259
- footer: [],
260
- model: new PagedList('rs/sql/manage_companyGasSummary', 20, {
261
- startDate: 'this.model.startDate',
262
- endDate: 'this.model.endDate',
263
- f_user_type : 'this.model.f_user_type',
264
- f_user_usetype : 'this.model.f_user_usetype',
265
- f_user_usenature : 'this.model.f_user_usenature',
266
- f_use_institution : 'this.model.f_use_institution'
267
- }, {
268
- f_oughtamount: 0,
269
- f_oughtfee: 0,
270
- f_pregas: 0,
271
- f_collection: 0,
272
- f_table_num: 0
273
- }),
274
- gasproperties: [],
275
- show: false,
276
- rowdata: {},
277
- areaList: [],
278
- modelval: [],
279
- startDate: '',
280
- endDate: '',
281
- inputtouPerson: [],
282
- printshow: false,
283
- all: false,
284
- fields: {},
285
- thead: '',
286
- tfoot: '',
287
- defaultfield: [],
288
- sumsmodel: {},
289
- sumExport: { 'f_oughtamount': '期间用气量', 'f_pregas': '期间售气量'},
290
- initres: {
291
- org: [this.$login.f.orgid],
292
- slice_area: [],
293
- },
294
- criteriaShow: true,
295
- userusetypes: [],
296
- useinstitutions: [],
297
- userusenatures: [],
298
- corporatename: []
299
- }
300
- },
301
- props: {
302
- style: {
303
- type: String,
304
- default: 'col-sm-2 form-group'
305
- }
306
- },
307
- ready () {
308
- readySomething(this).then(() => {
309
- this.$emit('ready')
310
- }).catch((error) => {
311
- this.$emit('error', error)
312
- })
313
- },
314
- methods: {
315
- getCurrentMonthFirst() {
316
- let date = new Date()
317
- date.setDate(1)
318
- let month = parseInt(date.getMonth() + 1)
319
- let day = date.getDate()
320
- if (month < 10) month = '0' + month
321
- if (day < 10) day = '0' + day
322
- return date.getFullYear() + '-' + month + '-' + day
323
- },
324
- getCurrentMonthLast() {
325
- let date = new Date()
326
- let year = date.getFullYear()
327
- let month = date.getMonth() + 1
328
- month = month < 10 ? '0' + month : month
329
- let day = new Date(year, month, 0)
330
- return year + '-' + month + '-' + day.getDate()
331
- },
332
- // async getCompanyList(searchText){
333
- // let condition = ' 1 = 1 '
334
- // if (searchText) {
335
- // condition = ` f_company_name like '%${searchText}%' `
336
- // }
337
- // let HttpReset = new HttpResetClass()
338
- // HttpReset.load('POST', 'rs/sql/saleSingleTable?pageNo=1&pageSize=100', {
339
- // data: {
340
- // items: 'f_company_name, id',
341
- // tablename: 't_company',
342
- // orderitem: 'id desc',
343
- // condition: condition
344
- // }
345
- // }, {resolveMsg: null, rejectMsg: '获取单位信息失败!'}).then((req) => {
346
- // let redata = []
347
- // req.data.forEach((row, n) => {
348
- // redata[n] = {
349
- // label: row.f_company_name,
350
- // value: row.id
351
- // }
352
- // })
353
- // this.corporatename = [{label: '全部', value: ''}, ...redata]
354
- // })
355
- // },
356
- clear() {
357
- //清空部门和人员
358
- this.$refs.paged.$refs.cri.$refs.sel.$children[1].selectres = []
359
- //部门和人员变为全选
360
- this.$refs.paged.$refs.cri.$refs.sel.$children[1].$children[0].isSelectAll = false
361
- this.$refs.paged.$refs.cri.$refs.sel.$children[2].$children[0].isSelectAll = false
362
- Object.keys(this.$refs.paged.$refs.cri.model).forEach((key) => {
363
- this.$refs.paged.$refs.cri.model[key] = []
364
- })
365
- },
366
- userTypeChange () {
367
- console.log("======"+this.$refs.paged.$refs.cri.model.f_user_type)
368
- this.userusetypes = []
369
- this.userusenatures = []
370
- this.useinstitutions = []
371
- this.$refs.paged.$refs.cri.model.f_userusetype = []
372
- this.$refs.paged.$refs.cri.model.f_use_institution = ''
373
- this.$refs.paged.$refs.cri.model.f_user_usenature = ''
374
- if (this.$refs.paged.$refs.cri.model.f_user_type) {
375
- let str = this.$refs.paged.$refs.cri.model.f_user_type + '用气类型'
376
- this.userusetypes = this.$appdata.getParam(str)
377
- }
378
- },
379
- userUseTypeChange () {
380
- this.useinstitutions = []
381
- this.userusenatures = []
382
- this.$refs.paged.$refs.cri.model.f_use_institution = ''
383
- this.$refs.paged.$refs.cri.model.f_user_usenature = ''
384
- if (this.$refs.paged.$refs.cri.model.f_userusetype.length > 0) {
385
- for (var i = 0; i < this.$refs.paged.$refs.cri.model.f_userusetype.length; i++) {
386
- let str = this.$refs.paged.$refs.cri.model.f_userusetype[i] + '机构'
387
- let getParam = this.$appdata.getParam(str)
388
- Array.prototype.push.apply(this.useinstitutions, getParam);
389
- }
390
- }
391
- let temp = {}
392
- this.useinstitutions = this.useinstitutions.filter(function(item) {
393
- var key = JSON.stringify(item);
394
- return temp.hasOwnProperty(key) ? false : (temp[key] = true);
395
- });
396
- },
397
- userUseInstitutionChange () {
398
- this.userusenatures = []
399
- this.$refs.paged.$refs.cri.model.f_user_usenature = ''
400
- if (this.$refs.paged.$refs.cri.model.f_use_institution) {
401
- let str = this.$refs.paged.$refs.cri.model.f_use_institution + '使用性质'
402
- this.userusenatures = this.$appdata.getParam(str)
403
- }
404
- },
405
- hidden () {
406
- this.criteriaShow = !this.criteriaShow
407
- },
408
- getotherfooter () {
409
- this.other = []
410
- this.footer = []
411
- let exportdata = this.getCondition
412
- let otherInData = []
413
- otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`)
414
- let footerData = [], exportfield = this.sumExport
415
- footerData.push('合计')
416
- let self = this
417
- for (var field in self.sumsmodel) {
418
- footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`)
419
- }
420
- this.footer.push(footerData)
421
- this.other.push(otherInData)
422
- },
423
- search () {
424
- this.$refs.paged.$refs.cri.search()
425
- },
426
- appendCondition (data) {
427
- console.log('data=====>',data)
428
- let stringValue = ''
429
- for (var i = 0; i < data.length; i++) {
430
- if (data[i]) {
431
- if (i === data.length - 1) {
432
- stringValue = stringValue + "'" + data[i] + "'"
433
- } else {
434
- stringValue = stringValue + "'" + data[i] + "',"
435
- }
436
- }
437
- }
438
- return stringValue
439
- },
440
- async selfSearch (args) {
441
- let companyCondition2 = '1=1'
442
- if (this.$refs.paged.$refs.cri.model.f_userusetype.length > 0) {
443
- this.$refs.paged.$refs.cri.model.f_user_usetype = this.appendCondition(this.$refs.paged.$refs.cri.model.f_userusetype)
444
- } else {
445
- this.$refs.paged.$refs.cri.model.f_user_usetype = ''
446
- }
447
- if (!this.orgConditionStr) {
448
- args.condition = `${args.condition}` + ' and f_orgid = ' + this.$login.f.orgid
449
- } else {
450
- args.condition = `${args.condition}` + this.orgConditionStr
451
- }
452
- this.$refs.paged.$refs.cri.model.startDate = this.startDate
453
- this.$refs.paged.$refs.cri.model.endDate = this.endDate
454
- this.condition = args.condition
455
- console.log("查看条件",this.condition)
456
- await this.model.search(args.condition, args.model)
457
- this.sumsmodel = this.$refs.paged.$refs.grid.model.sums
458
- this.card = ''
459
- this.IdCardInfo = ''
460
- console.log('合计字段', this.sumsmodel)
461
- this.$dispatch('cancel')
462
- },
463
- getRes (obj) {
464
- this.orgConditionStr = obj
465
- },
466
- stamp () {
467
- this.all = false
468
- //默认选择要打印的列
469
- this.modelval = defaultPrint.config
470
- this.fields = this.getfield
471
- console.log('所有打印字段', this.fields)
472
- this.printshow = true
473
- this.put()
474
- },
475
- put () {
476
- // 对Modelval进行排序
477
- this.sortModelval()
478
- this.thead = `<tr><th colspan=${this.modelval.length}>用户查询</th></tr><tr>`
479
- for (let key of this.modelval) {
480
- this.thead += '<th>' + this.fields[key] + '</th>'
481
- }
482
- this.thead += '</tr>'
483
- },
484
- print () {
485
- this.$refs.print.PrintAsFile()
486
- this.printshow = false
487
- },
488
- dealmsg (val) {
489
- console.log('---------------dealmsg')
490
- this.rowdata = val
491
- this.show = true
492
- val.model = this.model.model
493
- this.$dispatch('deal-msg', val)
494
- },
495
- close () {
496
- this.printshow = false
497
- this.all = false
498
- },
499
- // 对选择的列进行排序
500
- sortModelval () {
501
- let sortModel = []
502
- Object.keys(this.fields).forEach((key) => {
503
- if (this.modelval.includes(key)) {
504
- sortModel.push(key)
505
- }
506
- })
507
- this.modelval = sortModel
508
- console.log('选择的打印的字段', this.modelval)
509
- }
510
- },
511
- watch: {
512
- 'all' (val) {
513
- if (val) {
514
- this.modelval = this.bodyData
515
- } else {
516
- this.modelval = defaultPrint.config
517
- this.put()
518
- }
519
- },
520
- sumsmodel: {
521
- handler: function (val) {
522
- this.getotherfooter()
523
- },
524
- deep: true
525
- },
526
- 'modelval.length' () {
527
- this.put()
528
- }
529
- },
530
- computed: {
531
- getCondition () {
532
- return {
533
- condition: this.condition,
534
- startDate: this.startDate,
535
- endDate: this.endDate,
536
- f_user_usetype : this.$refs.paged.$refs.cri.model.f_user_usetype,
537
- f_user_type : this.$refs.paged.$refs.cri.model.f_user_type,
538
- f_user_usenature : this.$refs.paged.$refs.cri.model.f_user_usenature,
539
- f_use_institution : this.$refs.paged.$refs.cri.model.f_use_institution
540
- }
541
- },
542
- getfield () {
543
- return exportConfig.manageCompanyGasSummary
544
- },
545
- useTypes () {
546
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('使用类型')]
547
- },
548
- usertypes () {
549
- return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('用户类型')]
550
- }
551
- }
552
- }
553
- </script>
554
-
1
+ <template>
2
+ <div id="unit" class="flex-row">
3
+ <div class="basic-main" @keyup.enter="search">
4
+ <div class="flex" v-if="!show">
5
+ <criteria-paged :model="model" v-ref:paged>
6
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
7
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
8
+ <div class="row">
9
+ <div :class="$parent.$parent.style">
10
+ <label for="startDate" class="font_normal_body">开始日期</label>
11
+ <datepicker id="startDate" placeholder="开始日期" style="width:60%"
12
+ v-model="$parent.$parent.startDate"
13
+ :value.sync="$parent.$parent.startDate"
14
+ :format="'yyyy-MM-dd'"
15
+ :show-reset-button="true">
16
+ </datepicker>
17
+ </div>
18
+ <div :class="$parent.$parent.style">
19
+ <label for="endDate" class="font_normal_body">结束日期</label>
20
+ <datepicker id="endDate" placeholder="结束日期" style="width:60%"
21
+ v-model="$parent.$parent.endDate"
22
+ :value.sync="$parent.$parent.endDate"
23
+ :format="'yyyy-MM-dd'"
24
+ :show-reset-button="true">
25
+ </datepicker>
26
+ </div>
27
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showDetail">
28
+ <label class="font_normal_body">单位编号</label>
29
+ <input type="text" style="width:60%" class="input_search" v-model="model.id"
30
+ condition="id = '{}' " placeholder="单位编号">
31
+ </div>
32
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showDetail">
33
+ <label for="endDate" class="font_normal_body">单位名称</label>
34
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_company_name"
35
+ condition="f_company_name like '%{}%' " placeholder="单位名称">
36
+ <!-- <v-select :value.sync="model.f_company_id"-->
37
+ <!-- class="select_list select"-->
38
+ <!-- enter-push :disabled="$parent.$parent.isCompanyShow"-->
39
+ <!-- v-model="model.f_company_id" multiple="true"-->
40
+ <!-- :options='$parent.$parent.corporatename' placeholder='单位名称'-->
41
+ <!-- condition="f_company_id in {}">-->
42
+ <!-- </v-select>-->
43
+ </div>
44
+ <div class="span" style="float:right;">
45
+ <button class="button_search button_spacing" @click="search()">查询</button>
46
+ <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
47
+ <export-excel :data="$parent.$parent.getCondition"
48
+ :field="$parent.$parent.getfield"
49
+ :header="$parent.$parent.other"
50
+ :footer="$parent.$parent.footer"
51
+ sqlurl="rs/logic/exportfile"
52
+ sql-name="manage_companyGasSummary"
53
+ template-name='单位用气售气汇总'
54
+ :choose-col="true"></export-excel>
55
+ <print-data :sum-field="$parent.$parent.getfield" :model="$parent.model"
56
+ :field="$parent.$parent.getfield"
57
+ titletable="单位用气售气汇总" :starthead="$parent.$parent.startDate"
58
+ :defaultfield="$parent.$parent.defaultfield"
59
+ :sumsmodel="$parent.$parent.sumsmodel"></print-data>
60
+ <div
61
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
62
+ @click="$parent.$parent.hidden()"
63
+ class="button_spacing"
64
+ style="float: right"></div>
65
+ </div>
66
+ </div>
67
+ <div class="row" v-if="$parent.$parent.criteriaShow">
68
+ <res-select-group
69
+ :style="$parent.$parent.style"
70
+ :show-component="['company','slicearea']"
71
+ :initres="$parent.$parent.initres"
72
+ @re-res="$parent.$parent.getRes"
73
+ v-ref:sel
74
+ ></res-select-group>
75
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.showDetail">
76
+ <label class="font_normal_body">单位编号</label>
77
+ <input type="text" style="width:60%" class="input_search" v-model="model.id"
78
+ condition="id = '{}' " placeholder="单位编号">
79
+ </div>
80
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.showDetail">
81
+ <label for="endDate" class="font_normal_body">单位名称</label>
82
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_company_name"
83
+ condition="f_company_name like '%{}%' " placeholder="单位名称">
84
+ <!-- <v-select :value.sync="model.f_company_id"-->
85
+ <!-- class="select_list select"-->
86
+ <!-- enter-push :disabled="$parent.$parent.isCompanyShow"-->
87
+ <!-- v-model="model.f_company_id" multiple="true"-->
88
+ <!-- :options='$parent.$parent.corporatename' placeholder='单位名称'-->
89
+ <!-- condition="f_company_id in {}">-->
90
+ <!-- </v-select>-->
91
+ </div>
92
+ <div class="col-sm-2 form-group">
93
+ <label class="font_normal_body">用户类型</label>
94
+ <v-select :value.sync="model.f_user_type"
95
+ :options='$parent.$parent.usertypes'
96
+ @change="$parent.$parent.userTypeChange()"
97
+ :value-single="true"
98
+ placeholder='请选择' v-model="model.f_user_type"
99
+ ></v-select>
100
+ </div>
101
+ <div class="col-sm-2 form-group">
102
+ <label for="f_user_usetype" class="font_normal_body ">用气类型</label>
103
+ <v-select :value.sync="model.f_userusetype" :search="false"
104
+ @change="$parent.$parent.userUseTypeChange()"
105
+ v-model="model.f_userusetype"
106
+ :multiple="true"
107
+ :options='$parent.$parent.userusetypes'
108
+ placeholder='用气类型'>
109
+ </v-select>
110
+ </div>
111
+ <div class="col-sm-2 form-group">
112
+ <label for="f_use_institution" class="font_normal_body">用气机构</label>
113
+ <v-select :value.sync="model.f_use_institution" :search="false"
114
+ @change="$parent.$parent.userUseInstitutionChange()"
115
+ v-model="model.f_use_institution"
116
+ :value-single="true"
117
+ :options='$parent.$parent.useinstitutions'
118
+ placeholder='用气机构'
119
+ close-on-select>
120
+ </v-select>
121
+ </div>
122
+ <div class="col-sm-2 form-group">
123
+ <label for="f_user_usenature" class="font_normal_body ">使用性质</label>
124
+ <v-select :value.sync="model.f_user_usenature" :search="false"
125
+ v-model="model.f_user_usenature"
126
+ :value-single="true"
127
+ :options='$parent.$parent.userusenatures'
128
+ placeholder='使用性质'
129
+ close-on-select>
130
+ </v-select>
131
+ </div>
132
+ <!-- <div class="col-sm-2 form-group">-->
133
+ <!-- <label for="endDate" class="font_normal_body">小区名称</label>-->
134
+ <!-- <v-select :value.sync="model.f_residential_area_id"-->
135
+ <!-- class="select_list select"-->
136
+ <!-- enter-push :disabled="$parent.$parent.isAreaShow"-->
137
+ <!-- v-model="model.f_residential_area_id" multiple="true"-->
138
+ <!-- @select-search="$parent.$parent.getAreaList"-->
139
+ <!-- :options='$parent.$parent.areaList' placeholder='小区名称'-->
140
+ <!-- condition="f_residential_area_id in {}">-->
141
+ <!-- </v-select>-->
142
+ <!-- </div>-->
143
+ </div>
144
+ </div>
145
+ </criteria>
146
+ <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid :classname="$parent.classname">
147
+ <template partial='head'>
148
+ <tr>
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
+ <th>
171
+ <nobr>表具数量</nobr>
172
+ </th>
173
+ </tr>
174
+ </template>
175
+ <template partial='body'>
176
+ <td style="text-align:center">
177
+ <nobr>{{ $index + 1 }}</nobr>
178
+ </td>
179
+ <td style="text-align: center;">
180
+ <nobr>{{ row.id }}</nobr>
181
+ </td>
182
+ <td style="text-align: center;">
183
+ <nobr>{{ row.f_company_name }}</nobr>
184
+ </td>
185
+ <td style="text-align: center;">
186
+ <nobr>{{ row.f_oughtamount }}</nobr>
187
+ </td>
188
+ <td style="text-align: center;">
189
+ <nobr>{{ row.f_oughtfee }}</nobr>
190
+ </td>
191
+ <td style="text-align: center;">
192
+ <nobr>{{ row.f_pregas }}</nobr>
193
+ </td>
194
+ <td style="text-align: center;">
195
+ <nobr>{{ row.f_collection }}</nobr>
196
+ </td>
197
+ <td style="text-align: center;">
198
+ <nobr>{{ row.f_table_num }}</nobr>
199
+ </td>
200
+ </template>
201
+ <template partial='foot'></template>
202
+ </data-grid>
203
+ </criteria-paged>
204
+ <table class="table-hover">
205
+ <tr style="position: relative" class="table-bordered">
206
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
207
+ 汇总信息
208
+ </td>
209
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
210
+ 用气量:&emsp;{{ sumsmodel.f_oughtamount.toFixed(2) }}m³
211
+ </td>
212
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
213
+ 用气金额:&emsp;{{ sumsmodel.f_oughtfee.toFixed(2) }}元
214
+ </td>
215
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
216
+ 售气量:&emsp;{{ sumsmodel.f_pregas.toFixed(2) }}m³
217
+ </td>
218
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
219
+ 售气金额:&emsp;{{ sumsmodel.f_collection.toFixed(2) }}元
220
+ </td>
221
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
222
+ 表具数量:&emsp;{{ sumsmodel.f_table_num }}
223
+ </td>
224
+ </tr>
225
+ </table>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ </template>
230
+ <script>
231
+ import {PagedList, HttpResetClass} from 'vue-client'
232
+ import defaultPrint from './config/DefaultPrint'
233
+ import exportConfig from './config/exportConfig'
234
+ import PrintDataSelf from '../../components/sale/common/PrintDataSelf'
235
+
236
+ let readySomething = async function (self) {
237
+ self.startDate = self.getCurrentMonthFirst()
238
+ self.endDate = self.getCurrentMonthLast()
239
+ // self.getCompanyList()
240
+ }
241
+ export default {
242
+ title: '单位用气售气',
243
+ data () {
244
+ return {
245
+ depresid: [],
246
+ userresid: [],
247
+ f_orgid: this.$login.f.orgid,
248
+ f_depid: this.$login.f.depids,
249
+ f_operatorid: this.$login.f.id,
250
+ operatorid: [],
251
+ depid: [],
252
+ orgname: '',
253
+ depname: [],
254
+ operatorname: '',
255
+ condition: '',
256
+ orgConditionStr: '',
257
+ data: {},
258
+ other: [],
259
+ footer: [],
260
+ model: new PagedList('rs/sql/manage_companyGasSummary', 20, {
261
+ startDate: 'this.model.startDate',
262
+ endDate: 'this.model.endDate',
263
+ f_user_type : 'this.model.f_user_type',
264
+ f_user_usetype : 'this.model.f_user_usetype',
265
+ f_user_usenature : 'this.model.f_user_usenature',
266
+ f_use_institution : 'this.model.f_use_institution'
267
+ }, {
268
+ f_oughtamount: 0,
269
+ f_oughtfee: 0,
270
+ f_pregas: 0,
271
+ f_collection: 0,
272
+ f_table_num: 0
273
+ }),
274
+ gasproperties: [],
275
+ show: false,
276
+ rowdata: {},
277
+ areaList: [],
278
+ modelval: [],
279
+ startDate: '',
280
+ endDate: '',
281
+ inputtouPerson: [],
282
+ printshow: false,
283
+ all: false,
284
+ fields: {},
285
+ thead: '',
286
+ tfoot: '',
287
+ defaultfield: [],
288
+ sumsmodel: {},
289
+ sumExport: { 'f_oughtamount': '期间用气量', 'f_pregas': '期间售气量'},
290
+ initres: {
291
+ org: [this.$login.f.orgid],
292
+ slice_area: [],
293
+ },
294
+ criteriaShow: true,
295
+ userusetypes: [],
296
+ useinstitutions: [],
297
+ userusenatures: [],
298
+ corporatename: []
299
+ }
300
+ },
301
+ props: {
302
+ style: {
303
+ type: String,
304
+ default: 'col-sm-2 form-group'
305
+ }
306
+ },
307
+ ready () {
308
+ readySomething(this).then(() => {
309
+ this.$emit('ready')
310
+ }).catch((error) => {
311
+ this.$emit('error', error)
312
+ })
313
+ },
314
+ methods: {
315
+ getCurrentMonthFirst() {
316
+ let date = new Date()
317
+ date.setDate(1)
318
+ let month = parseInt(date.getMonth() + 1)
319
+ let day = date.getDate()
320
+ if (month < 10) month = '0' + month
321
+ if (day < 10) day = '0' + day
322
+ return date.getFullYear() + '-' + month + '-' + day
323
+ },
324
+ getCurrentMonthLast() {
325
+ let date = new Date()
326
+ let year = date.getFullYear()
327
+ let month = date.getMonth() + 1
328
+ month = month < 10 ? '0' + month : month
329
+ let day = new Date(year, month, 0)
330
+ return year + '-' + month + '-' + day.getDate()
331
+ },
332
+ // async getCompanyList(searchText){
333
+ // let condition = ' 1 = 1 '
334
+ // if (searchText) {
335
+ // condition = ` f_company_name like '%${searchText}%' `
336
+ // }
337
+ // let HttpReset = new HttpResetClass()
338
+ // HttpReset.load('POST', 'rs/sql/saleSingleTable?pageNo=1&pageSize=100', {
339
+ // data: {
340
+ // items: 'f_company_name, id',
341
+ // tablename: 't_company',
342
+ // orderitem: 'id desc',
343
+ // condition: condition
344
+ // }
345
+ // }, {resolveMsg: null, rejectMsg: '获取单位信息失败!'}).then((req) => {
346
+ // let redata = []
347
+ // req.data.forEach((row, n) => {
348
+ // redata[n] = {
349
+ // label: row.f_company_name,
350
+ // value: row.id
351
+ // }
352
+ // })
353
+ // this.corporatename = [{label: '全部', value: ''}, ...redata]
354
+ // })
355
+ // },
356
+ clear() {
357
+ //清空部门和人员
358
+ this.$refs.paged.$refs.cri.$refs.sel.$children[1].selectres = []
359
+ //部门和人员变为全选
360
+ this.$refs.paged.$refs.cri.$refs.sel.$children[1].$children[0].isSelectAll = false
361
+ this.$refs.paged.$refs.cri.$refs.sel.$children[2].$children[0].isSelectAll = false
362
+ Object.keys(this.$refs.paged.$refs.cri.model).forEach((key) => {
363
+ this.$refs.paged.$refs.cri.model[key] = []
364
+ })
365
+ },
366
+ userTypeChange () {
367
+ console.log("======"+this.$refs.paged.$refs.cri.model.f_user_type)
368
+ this.userusetypes = []
369
+ this.userusenatures = []
370
+ this.useinstitutions = []
371
+ this.$refs.paged.$refs.cri.model.f_userusetype = []
372
+ this.$refs.paged.$refs.cri.model.f_use_institution = ''
373
+ this.$refs.paged.$refs.cri.model.f_user_usenature = ''
374
+ if (this.$refs.paged.$refs.cri.model.f_user_type) {
375
+ let str = this.$refs.paged.$refs.cri.model.f_user_type + '用气类型'
376
+ this.userusetypes = this.$appdata.getParam(str)
377
+ }
378
+ },
379
+ userUseTypeChange () {
380
+ this.useinstitutions = []
381
+ this.userusenatures = []
382
+ this.$refs.paged.$refs.cri.model.f_use_institution = ''
383
+ this.$refs.paged.$refs.cri.model.f_user_usenature = ''
384
+ if (this.$refs.paged.$refs.cri.model.f_userusetype.length > 0) {
385
+ for (var i = 0; i < this.$refs.paged.$refs.cri.model.f_userusetype.length; i++) {
386
+ let str = this.$refs.paged.$refs.cri.model.f_userusetype[i] + '机构'
387
+ let getParam = this.$appdata.getParam(str)
388
+ Array.prototype.push.apply(this.useinstitutions, getParam);
389
+ }
390
+ }
391
+ let temp = {}
392
+ this.useinstitutions = this.useinstitutions.filter(function(item) {
393
+ var key = JSON.stringify(item);
394
+ return temp.hasOwnProperty(key) ? false : (temp[key] = true);
395
+ });
396
+ },
397
+ userUseInstitutionChange () {
398
+ this.userusenatures = []
399
+ this.$refs.paged.$refs.cri.model.f_user_usenature = ''
400
+ if (this.$refs.paged.$refs.cri.model.f_use_institution) {
401
+ let str = this.$refs.paged.$refs.cri.model.f_use_institution + '使用性质'
402
+ this.userusenatures = this.$appdata.getParam(str)
403
+ }
404
+ },
405
+ hidden () {
406
+ this.criteriaShow = !this.criteriaShow
407
+ },
408
+ getotherfooter () {
409
+ this.other = []
410
+ this.footer = []
411
+ let exportdata = this.getCondition
412
+ let otherInData = []
413
+ otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`)
414
+ let footerData = [], exportfield = this.sumExport
415
+ footerData.push('合计')
416
+ let self = this
417
+ for (var field in self.sumsmodel) {
418
+ footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`)
419
+ }
420
+ this.footer.push(footerData)
421
+ this.other.push(otherInData)
422
+ },
423
+ search () {
424
+ this.$refs.paged.$refs.cri.search()
425
+ },
426
+ appendCondition (data) {
427
+ console.log('data=====>',data)
428
+ let stringValue = ''
429
+ for (var i = 0; i < data.length; i++) {
430
+ if (data[i]) {
431
+ if (i === data.length - 1) {
432
+ stringValue = stringValue + "'" + data[i] + "'"
433
+ } else {
434
+ stringValue = stringValue + "'" + data[i] + "',"
435
+ }
436
+ }
437
+ }
438
+ return stringValue
439
+ },
440
+ async selfSearch (args) {
441
+ let companyCondition2 = '1=1'
442
+ if (this.$refs.paged.$refs.cri.model.f_userusetype.length > 0) {
443
+ this.$refs.paged.$refs.cri.model.f_user_usetype = this.appendCondition(this.$refs.paged.$refs.cri.model.f_userusetype)
444
+ } else {
445
+ this.$refs.paged.$refs.cri.model.f_user_usetype = ''
446
+ }
447
+ if (!this.orgConditionStr) {
448
+ args.condition = `${args.condition}` + ' and f_orgid = ' + this.$login.f.orgid
449
+ } else {
450
+ args.condition = `${args.condition}` + this.orgConditionStr
451
+ }
452
+ this.$refs.paged.$refs.cri.model.startDate = this.startDate
453
+ this.$refs.paged.$refs.cri.model.endDate = this.endDate
454
+ this.condition = args.condition
455
+ console.log("查看条件",this.condition)
456
+ await this.model.search(args.condition, args.model)
457
+ this.sumsmodel = this.$refs.paged.$refs.grid.model.sums
458
+ this.card = ''
459
+ this.IdCardInfo = ''
460
+ console.log('合计字段', this.sumsmodel)
461
+ },
462
+ getRes (obj) {
463
+ this.orgConditionStr = obj
464
+ },
465
+ stamp () {
466
+ this.all = false
467
+ //默认选择要打印的列
468
+ this.modelval = defaultPrint.config
469
+ this.fields = this.getfield
470
+ console.log('所有打印字段', this.fields)
471
+ this.printshow = true
472
+ this.put()
473
+ },
474
+ put () {
475
+ // 对Modelval进行排序
476
+ this.sortModelval()
477
+ this.thead = `<tr><th colspan=${this.modelval.length}>用户查询</th></tr><tr>`
478
+ for (let key of this.modelval) {
479
+ this.thead += '<th>' + this.fields[key] + '</th>'
480
+ }
481
+ this.thead += '</tr>'
482
+ },
483
+ print () {
484
+ this.$refs.print.PrintAsFile()
485
+ this.printshow = false
486
+ },
487
+ dealmsg (val) {
488
+ console.log('---------------dealmsg')
489
+ this.rowdata = val
490
+ this.show = true
491
+ val.model = this.model.model
492
+ this.$dispatch('deal-msg', val)
493
+ },
494
+ close () {
495
+ this.printshow = false
496
+ this.all = false
497
+ },
498
+ // 对选择的列进行排序
499
+ sortModelval () {
500
+ let sortModel = []
501
+ Object.keys(this.fields).forEach((key) => {
502
+ if (this.modelval.includes(key)) {
503
+ sortModel.push(key)
504
+ }
505
+ })
506
+ this.modelval = sortModel
507
+ console.log('选择的打印的字段', this.modelval)
508
+ }
509
+ },
510
+ watch: {
511
+ 'all' (val) {
512
+ if (val) {
513
+ this.modelval = this.bodyData
514
+ } else {
515
+ this.modelval = defaultPrint.config
516
+ this.put()
517
+ }
518
+ },
519
+ sumsmodel: {
520
+ handler: function (val) {
521
+ this.getotherfooter()
522
+ },
523
+ deep: true
524
+ },
525
+ 'modelval.length' () {
526
+ this.put()
527
+ }
528
+ },
529
+ computed: {
530
+ getCondition () {
531
+ return {
532
+ condition: this.condition,
533
+ startDate: this.startDate,
534
+ endDate: this.endDate,
535
+ f_user_usetype : this.$refs.paged.$refs.cri.model.f_user_usetype,
536
+ f_user_type : this.$refs.paged.$refs.cri.model.f_user_type,
537
+ f_user_usenature : this.$refs.paged.$refs.cri.model.f_user_usenature,
538
+ f_use_institution : this.$refs.paged.$refs.cri.model.f_use_institution
539
+ }
540
+ },
541
+ getfield () {
542
+ return exportConfig.manageCompanyGasSummary
543
+ },
544
+ useTypes () {
545
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('使用类型')]
546
+ },
547
+ usertypes () {
548
+ return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('用户类型')]
549
+ }
550
+ }
551
+ }
552
+ </script>
553
+