manage-client 3.3.82 → 3.3.83-wn2

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,514 +1,540 @@
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="model.startDate"
13
- :value.sync="model.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="model.endDate"
22
- :value.sync="model.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']"
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
- close-on-select></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_user_usetype" :search="false"
104
- @change="$parent.$parent.userUseTypeChange()"
105
- v-model="model.f_user_usetype"
106
- :value-single="true"
107
- :options='$parent.$parent.userusetypes'
108
- placeholder='用气类型'
109
- close-on-select>
110
- </v-select>
111
- </div>
112
- <div class="col-sm-2 form-group">
113
- <label for="f_use_institution" class="font_normal_body">用气机构</label>
114
- <v-select :value.sync="model.f_use_institution" :search="false"
115
- @change="$parent.$parent.userUseInstitutionChange()"
116
- v-model="model.f_use_institution"
117
- :value-single="true"
118
- :options='$parent.$parent.useinstitutions'
119
- placeholder='用气机构'
120
- close-on-select>
121
- </v-select>
122
- </div>
123
- <div class="col-sm-2 form-group">
124
- <label for="f_user_usenature" class="font_normal_body ">使用性质</label>
125
- <v-select :value.sync="model.f_user_usenature" :search="false"
126
- v-model="model.f_user_usenature"
127
- :value-single="true"
128
- :options='$parent.$parent.userusenatures'
129
- placeholder='使用性质'
130
- close-on-select>
131
- </v-select>
132
- </div>
133
- <!-- <div class="col-sm-2 form-group">-->
134
- <!-- <label for="endDate" class="font_normal_body">小区名称</label>-->
135
- <!-- <v-select :value.sync="model.f_residential_area_id"-->
136
- <!-- class="select_list select"-->
137
- <!-- enter-push :disabled="$parent.$parent.isAreaShow"-->
138
- <!-- v-model="model.f_residential_area_id" multiple="true"-->
139
- <!-- @select-search="$parent.$parent.getAreaList"-->
140
- <!-- :options='$parent.$parent.areaList' placeholder='小区名称'-->
141
- <!-- condition="f_residential_area_id in {}">-->
142
- <!-- </v-select>-->
143
- <!-- </div>-->
144
- </div>
145
- </div>
146
- </criteria>
147
- <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid :classname="$parent.classname">
148
- <template partial='head'>
149
- <tr>
150
- <th>
151
- <nobr>序号</nobr>
152
- </th>
153
- <th>
154
- <nobr>单位编号</nobr>
155
- </th>
156
- <th>
157
- <nobr>单位名称</nobr>
158
- </th>
159
- <th>
160
- <nobr>期间用气量</nobr>
161
- </th>
162
- <th>
163
- <nobr>期间售气量</nobr>
164
- </th>
165
- <th>
166
- <nobr>表具数量</nobr>
167
- </th>
168
- </tr>
169
- </template>
170
- <template partial='body'>
171
- <td style="text-align:center">
172
- <nobr>{{ $index + 1 }}</nobr>
173
- </td>
174
- <td style="text-align: center;">
175
- <nobr>{{ row.id }}</nobr>
176
- </td>
177
- <td style="text-align: center;">
178
- <nobr>{{ row.f_company_name }}</nobr>
179
- </td>
180
- <td style="text-align: center;">
181
- <nobr>{{ row.f_oughtamount }}</nobr>
182
- </td>
183
- <td style="text-align: center;">
184
- <nobr>{{ row.f_pregas }}</nobr>
185
- </td>
186
- <td style="text-align: center;">
187
- <nobr>{{ row.f_table_num }}</nobr>
188
- </td>
189
- </template>
190
- <template partial='foot'></template>
191
- </data-grid>
192
- </criteria-paged>
193
- <table class="table-hover">
194
- <tr style="position: relative" class="table-bordered">
195
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
196
- 汇总信息
197
- </td>
198
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
199
- 用气量:&emsp;{{ sumsmodel.f_oughtamount.toFixed(2) }}m³
200
- </td>
201
- <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
202
- 售气量:&emsp;{{ sumsmodel.f_pregas.toFixed(2) }}m³
203
- </td>
204
- </tr>
205
- </table>
206
- </div>
207
- </div>
208
- </div>
209
- </template>
210
- <script>
211
- import {PagedList, HttpResetClass} from 'vue-client'
212
- import defaultPrint from './config/DefaultPrint'
213
- import exportConfig from './config/exportConfig'
214
- import PrintDataSelf from '../../components/sale/common/PrintDataSelf'
215
-
216
- let readySomething = async function (self) {
217
- self.$refs.paged.$refs.cri.model.startDate = self.getCurrentMonthFirst()
218
- self.$refs.paged.$refs.cri.model.endDate = self.getCurrentMonthLast()
219
- // self.getCompanyList()
220
- }
221
- export default {
222
- title: '单位用气售气',
223
- data () {
224
- return {
225
- depresid: [],
226
- userresid: [],
227
- f_orgid: this.$login.f.orgid,
228
- f_depid: this.$login.f.depids,
229
- f_operatorid: this.$login.f.id,
230
- operatorid: [],
231
- depid: [],
232
- orgname: '',
233
- depname: [],
234
- operatorname: '',
235
- condition: '',
236
- orgConditionStr: '',
237
- data: {},
238
- other: [],
239
- footer: [],
240
- model: new PagedList('rs/sql/manage_companyGasSummary', 20, {
241
- startDate: 'this.model.startDate',
242
- endDate: 'this.model.endDate',
243
- f_user_type : 'this.model.f_user_type',
244
-
245
- f_user_usetype : 'this.model.f_user_usetype',
246
- f_user_usenature : 'this.model.f_user_usenature',
247
- f_use_institution : 'this.model.f_use_institution'
248
- }, {
249
- f_oughtamount: 0,
250
- f_pregas: 0
251
- }),
252
- gasproperties: [],
253
- show: false,
254
- rowdata: {},
255
- areaList: [],
256
- modelval: [],
257
- startDate: '',
258
- endDate: '',
259
- inputtouPerson: [],
260
- printshow: false,
261
- all: false,
262
- fields: {},
263
- thead: '',
264
- tfoot: '',
265
- defaultfield: [],
266
- sumsmodel: {},
267
- sumExport: { 'f_oughtamount': '期间用气量', 'f_pregas': '期间售气量'},
268
- initres: {
269
- org: [this.$login.f.orgid],
270
- },
271
- criteriaShow: false,
272
- userusetypes: [],
273
- useinstitutions: [],
274
- userusenatures: [],
275
- corporatename: []
276
- }
277
- },
278
- props: {
279
- style: {
280
- type: String,
281
- default: 'col-sm-2 form-group'
282
- }
283
- },
284
- ready () {
285
- readySomething(this).then(() => {
286
- this.$emit('ready')
287
- }).catch((error) => {
288
- this.$emit('error', error)
289
- })
290
- },
291
- methods: {
292
- getCurrentMonthFirst() {
293
- let date = new Date()
294
- date.setDate(1)
295
- let month = parseInt(date.getMonth() + 1)
296
- let day = date.getDate()
297
- if (month < 10) month = '0' + month
298
- if (day < 10) day = '0' + day
299
- return date.getFullYear() + '-' + month + '-' + day
300
- },
301
- getCurrentMonthLast() {
302
- let date = new Date()
303
- let year = date.getFullYear()
304
- let month = date.getMonth() + 1
305
- month = month < 10 ? '0' + month : month
306
- let day = new Date(year, month, 0)
307
- return year + '-' + month + '-' + day.getDate()
308
- },
309
- // async getCompanyList(searchText){
310
- // let condition = ' 1 = 1 '
311
- // if (searchText) {
312
- // condition = ` f_company_name like '%${searchText}%' `
313
- // }
314
- // let HttpReset = new HttpResetClass()
315
- // HttpReset.load('POST', 'rs/sql/saleSingleTable?pageNo=1&pageSize=100', {
316
- // data: {
317
- // items: 'f_company_name, id',
318
- // tablename: 't_company',
319
- // orderitem: 'id desc',
320
- // condition: condition
321
- // }
322
- // }, {resolveMsg: null, rejectMsg: '获取单位信息失败!'}).then((req) => {
323
- // let redata = []
324
- // req.data.forEach((row, n) => {
325
- // redata[n] = {
326
- // label: row.f_company_name,
327
- // value: row.id
328
- // }
329
- // })
330
- // this.corporatename = [{label: '全部', value: ''}, ...redata]
331
- // })
332
- // },
333
- clear() {
334
- //清空部门和人员
335
- this.$refs.paged.$refs.cri.$refs.sel.$children[1].selectres = []
336
- //部门和人员变为全选
337
- this.$refs.paged.$refs.cri.$refs.sel.$children[1].$children[0].isSelectAll = false
338
- this.$refs.paged.$refs.cri.$refs.sel.$children[2].$children[0].isSelectAll = false
339
- Object.keys(this.$refs.paged.$refs.cri.model).forEach((key) => {
340
- this.$refs.paged.$refs.cri.model[key] = []
341
- })
342
- },
343
- userTypeChange () {
344
- this.userusetypes = []
345
- this.userusenatures = []
346
- this.useinstitutions = []
347
- this.$refs.paged.$refs.cri.model.f_user_usetype = ''
348
- this.$refs.paged.$refs.cri.model.f_use_institution = ''
349
- this.$refs.paged.$refs.cri.model.f_user_usenature = ''
350
- if (this.$refs.paged.$refs.cri.model.f_user_type) {
351
- let str = this.$refs.paged.$refs.cri.model.f_user_type + '用气类型'
352
- this.userusetypes = this.$appdata.getParam(str)
353
- }
354
- },
355
- userUseTypeChange () {
356
- this.useinstitutions = []
357
- this.userusenatures = []
358
- this.$refs.paged.$refs.cri.model.f_use_institution = ''
359
- this.$refs.paged.$refs.cri.model.f_user_usenature = ''
360
- if (this.$refs.paged.$refs.cri.model.f_user_usetype) {
361
- let str = this.$refs.paged.$refs.cri.model.f_user_usetype + '机构'
362
- this.useinstitutions = this.$appdata.getParam(str)
363
- }
364
- },
365
- userUseInstitutionChange () {
366
- this.userusenatures = []
367
- this.$refs.paged.$refs.cri.model.f_user_usenature = ''
368
- if (this.$refs.paged.$refs.cri.model.f_use_institution) {
369
- let str = this.$refs.paged.$refs.cri.model.f_use_institution + '使用性质'
370
- this.userusenatures = this.$appdata.getParam(str)
371
- }
372
- },
373
- hidden () {
374
- this.criteriaShow = !this.criteriaShow
375
- },
376
- getotherfooter () {
377
- this.other = []
378
- this.footer = []
379
- let exportdata = this.getCondition
380
- let otherInData = []
381
- otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`)
382
- let footerData = [], exportfield = this.sumExport
383
- footerData.push('合计')
384
- let self = this
385
- for (var field in self.sumsmodel) {
386
- footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`)
387
- }
388
- this.footer.push(footerData)
389
- this.other.push(otherInData)
390
- },
391
- search () {
392
- this.$refs.paged.$refs.cri.search()
393
- },
394
- appendCondition (data) {
395
- console.log('data=====>',data)
396
- let stringValue = ''
397
- for (var i = 0; i < data.length; i++) {
398
- if (data[i]) {
399
- if (i === data.length - 1) {
400
- stringValue = stringValue + "'" + data[i] + "'"
401
- } else {
402
- stringValue = stringValue + "'" + data[i] + "',"
403
- }
404
- }
405
- }
406
- return stringValue
407
- },
408
- async selfSearch (args) {
409
- let companyCondition2 = '1=1'
410
- if (!this.orgConditionStr) {
411
- args.condition = `${args.condition}` + ' and f_orgid = ' + this.$login.f.orgid
412
- } else {
413
- args.condition = `${args.condition}` + this.orgConditionStr
414
- }
415
- this.condition = args.condition
416
- console.log("查看条件",this.condition)
417
- await this.model.search(args.condition, args.model)
418
- this.sumsmodel = this.$refs.paged.$refs.grid.model.sums
419
- this.card = ''
420
- this.IdCardInfo = ''
421
- console.log('合计字段', this.sumsmodel)
422
- },
423
- getRes (obj) {
424
- this.orgConditionStr = obj
425
- },
426
- stamp () {
427
- this.all = false
428
- //默认选择要打印的列
429
- this.modelval = defaultPrint.config
430
- this.fields = this.getfield
431
- console.log('所有打印字段', this.fields)
432
- this.printshow = true
433
- this.put()
434
- },
435
- put () {
436
- // 对Modelval进行排序
437
- this.sortModelval()
438
- this.thead = `<tr><th colspan=${this.modelval.length}>用户查询</th></tr><tr>`
439
- for (let key of this.modelval) {
440
- this.thead += '<th>' + this.fields[key] + '</th>'
441
- }
442
- this.thead += '</tr>'
443
- },
444
- print () {
445
- this.$refs.print.PrintAsFile()
446
- this.printshow = false
447
- },
448
- dealmsg (val) {
449
- console.log('---------------dealmsg')
450
- this.rowdata = val
451
- this.show = true
452
- val.model = this.model.model
453
- this.$dispatch('deal-msg', val)
454
- },
455
- close () {
456
- this.printshow = false
457
- this.all = false
458
- },
459
- // 对选择的列进行排序
460
- sortModelval () {
461
- let sortModel = []
462
- Object.keys(this.fields).forEach((key) => {
463
- if (this.modelval.includes(key)) {
464
- sortModel.push(key)
465
- }
466
- })
467
- this.modelval = sortModel
468
- console.log('选择的打印的字段', this.modelval)
469
- }
470
- },
471
- watch: {
472
- 'all' (val) {
473
- if (val) {
474
- this.modelval = this.bodyData
475
- } else {
476
- this.modelval = defaultPrint.config
477
- this.put()
478
- }
479
- },
480
- sumsmodel: {
481
- handler: function (val) {
482
- this.getotherfooter()
483
- },
484
- deep: true
485
- },
486
- 'modelval.length' () {
487
- this.put()
488
- }
489
- },
490
- computed: {
491
- getCondition () {
492
- return {
493
- condition: this.condition,
494
- startDate: this.$refs.paged.$refs.cri.model.startDate,
495
- endDate: this.$refs.paged.$refs.cri.model.endDate,
496
- f_user_usetype : this.$refs.paged.$refs.cri.model.f_user_usetype,
497
- f_user_type : this.$refs.paged.$refs.cri.model.f_user_type,
498
- f_user_usenature : this.$refs.paged.$refs.cri.model.f_user_usenature,
499
- f_use_institution : this.$refs.paged.$refs.cri.model.f_use_institution
500
- }
501
- },
502
- getfield () {
503
- return exportConfig.manageCompanyGasSummary
504
- },
505
- useTypes () {
506
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('使用类型')]
507
- },
508
- usertypes () {
509
- return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('用户类型')]
510
- }
511
- }
512
- }
513
- </script>
514
-
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']"
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_user_usetype" :search="false"
104
+ @change="$parent.$parent.userUseTypeChange()"
105
+ v-model="model.f_user_usetype"
106
+ :value-single="true"
107
+ :options='$parent.$parent.userusetypes'
108
+ placeholder='用气类型'
109
+ close-on-select>
110
+ </v-select>
111
+ </div>
112
+ <div class="col-sm-2 form-group">
113
+ <label for="f_use_institution" class="font_normal_body">用气机构</label>
114
+ <v-select :value.sync="model.f_use_institution" :search="false"
115
+ @change="$parent.$parent.userUseInstitutionChange()"
116
+ v-model="model.f_use_institution"
117
+ :value-single="true"
118
+ :options='$parent.$parent.useinstitutions'
119
+ placeholder='用气机构'
120
+ close-on-select>
121
+ </v-select>
122
+ </div>
123
+ <div class="col-sm-2 form-group">
124
+ <label for="f_user_usenature" class="font_normal_body ">使用性质</label>
125
+ <v-select :value.sync="model.f_user_usenature" :search="false"
126
+ v-model="model.f_user_usenature"
127
+ :value-single="true"
128
+ :options='$parent.$parent.userusenatures'
129
+ placeholder='使用性质'
130
+ close-on-select>
131
+ </v-select>
132
+ </div>
133
+ <!-- <div class="col-sm-2 form-group">-->
134
+ <!-- <label for="endDate" class="font_normal_body">小区名称</label>-->
135
+ <!-- <v-select :value.sync="model.f_residential_area_id"-->
136
+ <!-- class="select_list select"-->
137
+ <!-- enter-push :disabled="$parent.$parent.isAreaShow"-->
138
+ <!-- v-model="model.f_residential_area_id" multiple="true"-->
139
+ <!-- @select-search="$parent.$parent.getAreaList"-->
140
+ <!-- :options='$parent.$parent.areaList' placeholder='小区名称'-->
141
+ <!-- condition="f_residential_area_id in {}">-->
142
+ <!-- </v-select>-->
143
+ <!-- </div>-->
144
+ </div>
145
+ </div>
146
+ </criteria>
147
+ <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid :classname="$parent.classname">
148
+ <template partial='head'>
149
+ <tr>
150
+ <th>
151
+ <nobr>序号</nobr>
152
+ </th>
153
+ <th>
154
+ <nobr>单位编号</nobr>
155
+ </th>
156
+ <th>
157
+ <nobr>单位名称</nobr>
158
+ </th>
159
+ <th>
160
+ <nobr>期间用气量</nobr>
161
+ </th>
162
+ <th>
163
+ <nobr>期间用气金额</nobr>
164
+ </th>
165
+ <th>
166
+ <nobr>期间售气量</nobr>
167
+ </th>
168
+ <th>
169
+ <nobr>期间售气金额</nobr>
170
+ </th>
171
+ <th>
172
+ <nobr>表具数量</nobr>
173
+ </th>
174
+ </tr>
175
+ </template>
176
+ <template partial='body'>
177
+ <td style="text-align:center">
178
+ <nobr>{{ $index + 1 }}</nobr>
179
+ </td>
180
+ <td style="text-align: center;">
181
+ <nobr>{{ row.id }}</nobr>
182
+ </td>
183
+ <td style="text-align: center;">
184
+ <nobr>{{ row.f_company_name }}</nobr>
185
+ </td>
186
+ <td style="text-align: center;">
187
+ <nobr>{{ row.f_oughtamount }}</nobr>
188
+ </td>
189
+ <td style="text-align: center;">
190
+ <nobr>{{ row.f_oughtfee }}</nobr>
191
+ </td>
192
+ <td style="text-align: center;">
193
+ <nobr>{{ row.f_pregas }}</nobr>
194
+ </td>
195
+ <td style="text-align: center;">
196
+ <nobr>{{ row.f_collection }}</nobr>
197
+ </td>
198
+ <td style="text-align: center;">
199
+ <nobr>{{ row.f_table_num }}</nobr>
200
+ </td>
201
+ </template>
202
+ <template partial='foot'></template>
203
+ </data-grid>
204
+ </criteria-paged>
205
+ <table class="table-hover">
206
+ <tr style="position: relative" class="table-bordered">
207
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
208
+ 汇总信息
209
+ </td>
210
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
211
+ 用气量:&emsp;{{ sumsmodel.f_oughtamount.toFixed(2) }}m³
212
+ </td>
213
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
214
+ 用气金额:&emsp;{{ sumsmodel.f_oughtfee.toFixed(2) }}元
215
+ </td>
216
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
217
+ 售气量:&emsp;{{ sumsmodel.f_pregas.toFixed(2) }}m³
218
+ </td>
219
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
220
+ 售气金额:&emsp;{{ sumsmodel.f_collection.toFixed(2) }}元
221
+ </td>
222
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
223
+ 表具数量:&emsp;{{ sumsmodel.f_table_num }}
224
+ </td>
225
+ </tr>
226
+ </table>
227
+ </div>
228
+ </div>
229
+ </div>
230
+ </template>
231
+ <script>
232
+ import {PagedList, HttpResetClass} from 'vue-client'
233
+ import defaultPrint from './config/DefaultPrint'
234
+ import exportConfig from './config/exportConfig'
235
+ import PrintDataSelf from '../../components/sale/common/PrintDataSelf'
236
+
237
+ let readySomething = async function (self) {
238
+ self.startDate = self.getCurrentMonthFirst()
239
+ self.endDate = self.getCurrentMonthLast()
240
+ // self.getCompanyList()
241
+ }
242
+ export default {
243
+ title: '单位用气售气',
244
+ data () {
245
+ return {
246
+ depresid: [],
247
+ userresid: [],
248
+ f_orgid: this.$login.f.orgid,
249
+ f_depid: this.$login.f.depids,
250
+ f_operatorid: this.$login.f.id,
251
+ operatorid: [],
252
+ depid: [],
253
+ orgname: '',
254
+ depname: [],
255
+ operatorname: '',
256
+ condition: '',
257
+ orgConditionStr: '',
258
+ data: {},
259
+ other: [],
260
+ footer: [],
261
+ model: new PagedList('rs/sql/manage_companyGasSummary', 20, {
262
+ startDate: 'this.model.startDate',
263
+ endDate: 'this.model.endDate',
264
+ f_user_type : 'this.model.f_user_type',
265
+ f_user_usetype : 'this.model.f_user_usetype',
266
+ f_user_usenature : 'this.model.f_user_usenature',
267
+ f_use_institution : 'this.model.f_use_institution'
268
+ }, {
269
+ f_oughtamount: 0,
270
+ f_oughtfee: 0,
271
+ f_pregas: 0,
272
+ f_collection: 0,
273
+ f_table_num: 0
274
+ }),
275
+ gasproperties: [],
276
+ show: false,
277
+ rowdata: {},
278
+ areaList: [],
279
+ modelval: [],
280
+ startDate: '',
281
+ endDate: '',
282
+ inputtouPerson: [],
283
+ printshow: false,
284
+ all: false,
285
+ fields: {},
286
+ thead: '',
287
+ tfoot: '',
288
+ defaultfield: [],
289
+ sumsmodel: {},
290
+ sumExport: { 'f_oughtamount': '期间用气量', 'f_pregas': '期间售气量'},
291
+ initres: {
292
+ org: [this.$login.f.orgid],
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_user_usetype = ''
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_user_usetype) {
385
+ let str = this.$refs.paged.$refs.cri.model.f_user_usetype + '机构'
386
+ this.useinstitutions = this.$appdata.getParam(str)
387
+ }
388
+ },
389
+ userUseInstitutionChange () {
390
+ this.userusenatures = []
391
+ this.$refs.paged.$refs.cri.model.f_user_usenature = ''
392
+ if (this.$refs.paged.$refs.cri.model.f_use_institution) {
393
+ let str = this.$refs.paged.$refs.cri.model.f_use_institution + '使用性质'
394
+ this.userusenatures = this.$appdata.getParam(str)
395
+ }
396
+ },
397
+ hidden () {
398
+ this.criteriaShow = !this.criteriaShow
399
+ },
400
+ getotherfooter () {
401
+ this.other = []
402
+ this.footer = []
403
+ let exportdata = this.getCondition
404
+ let otherInData = []
405
+ otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`)
406
+ let footerData = [], exportfield = this.sumExport
407
+ footerData.push('合计')
408
+ let self = this
409
+ for (var field in self.sumsmodel) {
410
+ footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`)
411
+ }
412
+ this.footer.push(footerData)
413
+ this.other.push(otherInData)
414
+ },
415
+ search () {
416
+ this.$refs.paged.$refs.cri.search()
417
+ },
418
+ appendCondition (data) {
419
+ console.log('data=====>',data)
420
+ let stringValue = ''
421
+ for (var i = 0; i < data.length; i++) {
422
+ if (data[i]) {
423
+ if (i === data.length - 1) {
424
+ stringValue = stringValue + "'" + data[i] + "'"
425
+ } else {
426
+ stringValue = stringValue + "'" + data[i] + "',"
427
+ }
428
+ }
429
+ }
430
+ return stringValue
431
+ },
432
+ async selfSearch (args) {
433
+ let companyCondition2 = '1=1'
434
+ if (!this.orgConditionStr) {
435
+ args.condition = `${args.condition}` + ' and f_orgid = ' + this.$login.f.orgid
436
+ } else {
437
+ args.condition = `${args.condition}` + this.orgConditionStr
438
+ }
439
+ this.$refs.paged.$refs.cri.model.startDate = this.startDate
440
+ this.$refs.paged.$refs.cri.model.endDate = this.endDate
441
+ this.condition = args.condition
442
+ console.log("查看条件",this.condition)
443
+ await this.model.search(args.condition, args.model)
444
+ this.sumsmodel = this.$refs.paged.$refs.grid.model.sums
445
+ this.card = ''
446
+ this.IdCardInfo = ''
447
+ console.log('合计字段', this.sumsmodel)
448
+ },
449
+ getRes (obj) {
450
+ this.orgConditionStr = obj
451
+ },
452
+ stamp () {
453
+ this.all = false
454
+ //默认选择要打印的列
455
+ this.modelval = defaultPrint.config
456
+ this.fields = this.getfield
457
+ console.log('所有打印字段', this.fields)
458
+ this.printshow = true
459
+ this.put()
460
+ },
461
+ put () {
462
+ // 对Modelval进行排序
463
+ this.sortModelval()
464
+ this.thead = `<tr><th colspan=${this.modelval.length}>用户查询</th></tr><tr>`
465
+ for (let key of this.modelval) {
466
+ this.thead += '<th>' + this.fields[key] + '</th>'
467
+ }
468
+ this.thead += '</tr>'
469
+ },
470
+ print () {
471
+ this.$refs.print.PrintAsFile()
472
+ this.printshow = false
473
+ },
474
+ dealmsg (val) {
475
+ console.log('---------------dealmsg')
476
+ this.rowdata = val
477
+ this.show = true
478
+ val.model = this.model.model
479
+ this.$dispatch('deal-msg', val)
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
+ getCondition () {
518
+ return {
519
+ condition: this.condition,
520
+ startDate: this.startDate,
521
+ endDate: this.endDate,
522
+ f_user_usetype : this.$refs.paged.$refs.cri.model.f_user_usetype,
523
+ f_user_type : this.$refs.paged.$refs.cri.model.f_user_type,
524
+ f_user_usenature : this.$refs.paged.$refs.cri.model.f_user_usenature,
525
+ f_use_institution : this.$refs.paged.$refs.cri.model.f_use_institution
526
+ }
527
+ },
528
+ getfield () {
529
+ return exportConfig.manageCompanyGasSummary
530
+ },
531
+ useTypes () {
532
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('使用类型')]
533
+ },
534
+ usertypes () {
535
+ return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('用户类型')]
536
+ }
537
+ }
538
+ }
539
+ </script>
540
+