manage-client 3.2.159 → 3.2.160

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,582 @@
1
+ <template>
2
+ <div id="unit" class="flex-row">
3
+ <div class="basic-main" @keyup.enter="search" v-if="!show">
4
+ <div class="flex">
5
+ <div style="flex:1;" class="flex" >
6
+ <criteria-paged :model="model" v-ref:paged @sort="sort">
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
+ <res-select-group :show-component="['company']" :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes" v-ref:sel></res-select-group>
11
+ <div class="col-sm-2 form-group">
12
+ <label for="startDate" class="font_normal_body">审核日期起</label>
13
+ <datepicker id="startDate" placeholder="审核日期起" style="width:60%"
14
+ v-model="model.startDate"
15
+ :value.sync="model.startDate"
16
+ :format="'yyyy-MM-dd'"
17
+ :show-reset-button="true"
18
+ condition="f_audit_date >= '{} 00:00:00'">
19
+ </datepicker>
20
+ </div>
21
+ <div class="col-sm-2 form-group">
22
+ <label for="endDate" class="font_normal_body">审核日期止</label>
23
+ <datepicker id="endDate" placeholder="审核日期止" style="width:60%"
24
+ v-model="model.endDate"
25
+ :value.sync="model.endDate"
26
+ :format="'yyyy-MM-dd'"
27
+ :show-reset-button="true"
28
+ condition="f_audit_date <= '{} 23:59:59'">
29
+ </datepicker>
30
+ </div>
31
+
32
+ <div class="col-sm-2 form-group">
33
+ <label class="font_normal_body">气表类型</label>
34
+ <v-select :value.sync="model.f_meter_classify"
35
+ :options='$parent.$parent.metertypes' placeholder='请选择' v-model="model.f_meter_classify"
36
+ condition="f_meter_classify in {}"
37
+ close-on-select></v-select>
38
+ </div>
39
+
40
+ <div class="col-sm-2 form-group">
41
+ <label class="font_normal_body">结算方式</label>
42
+ <v-select :value.sync="model.f_calculation"
43
+ :options='$parent.$parent.fcalculation' placeholder='请选择' v-model="model.f_calculation"
44
+ condition="f_calculation in {}"
45
+ close-on-select></v-select>
46
+ </div>
47
+
48
+ <div class="span" style="float:right;">
49
+ <button class="button_search button_spacing" @click="$parent.$parent.search()">查询</button>
50
+ <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
51
+ <!--<button class="btn btn-default" @click="$parent.$parent.stamp()">打印</button>-->
52
+
53
+ <export-excel :data="$parent.$parent.getCondition"
54
+ :field="$parent.$parent.getExportField"
55
+ :footer="$parent.$parent.footer"
56
+ :header="$parent.$parent.other"
57
+ sqlurl="rs/logic/exportfile" sql-name="qnChaobiaoyhhz" template-name='抄表按用户汇总导出'
58
+ :choose-col="true"></export-excel>
59
+
60
+ <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>
61
+ </div>
62
+ </div>
63
+ <div class="row" v-show="$parent.$parent.criteriaShow">
64
+ <div class="col-sm-2 form-group">
65
+ <label class="font_normal_body">客户编号</label>
66
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_userinfo_code"
67
+ condition="f_userinfo_code = '{}' " placeholder="客户编号">
68
+ </div>
69
+ <div class="col-sm-2 form-group">
70
+ <label class="font_normal_body">客户名称</label>
71
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_user_name"
72
+ condition="f_user_name like '%{}%'" placeholder="客户名称">
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </criteria>
77
+
78
+ <data-grid :model="model" partial='list' class="list_area table_sy" @dblclick="$parent.dblclick" v-ref:grid>
79
+ <template partial='head'>
80
+ <tr>
81
+ <th>
82
+ <nobr>用户号</nobr>
83
+ </th>
84
+ <th>
85
+ <nobr>用户名</nobr>
86
+ </th>
87
+ <th>
88
+ <nobr>表号</nobr>
89
+ </th>
90
+ <th>
91
+ <nobr>客户类型</nobr>
92
+ </th>
93
+ <th>
94
+ <nobr>用气性质</nobr>
95
+ </th>
96
+ <th>
97
+ <nobr>起方</nobr>
98
+ </th>
99
+ <th>
100
+ <nobr>止方</nobr>
101
+ </th>
102
+ <th>
103
+ <nobr>单价</nobr>
104
+ </th>
105
+ <th>
106
+ <nobr>气量</nobr>
107
+ </th>
108
+ <th>
109
+ <nobr>金额</nobr>
110
+ </th>
111
+ </tr>
112
+ </template>
113
+ <template partial='body'>
114
+ <td style="text-align: center;">
115
+ <nobr>{{row.f_userinfo_code}}</nobr>
116
+ </td>
117
+ <td style="text-align: center;">
118
+ <nobr>{{row.f_user_name}}</nobr>
119
+ </td>
120
+ <td style="text-align: center;">
121
+ <nobr>{{row.f_meternumber}}</nobr>
122
+ </td>
123
+ <td style="text-align: center;">
124
+ <nobr>{{row.f_user_type}}</nobr>
125
+ </td>
126
+ <td style="text-align: center;">
127
+ <nobr>{{row.f_gasproperties}}</nobr>
128
+ </td>
129
+ <td style="text-align: center;">
130
+ <nobr>{{row.f_last_tablebase}}</nobr>
131
+ </td>
132
+ <td style="text-align: center;">
133
+ <nobr>{{row.f_tablebase}}</nobr>
134
+ </td>
135
+ <td style="text-align: center;">
136
+ <nobr>{{row.f_price}}</nobr>
137
+ </td>
138
+ <td style="text-align: center;">
139
+ <nobr>{{row.f_gas}}</nobr>
140
+ </td>
141
+ <td style="text-align: center;">
142
+ <nobr>{{row.f_money}}</nobr>
143
+ </td>
144
+ </template>
145
+ <template partial='foot'>
146
+ </template>
147
+ </data-grid>
148
+ </criteria-paged>
149
+ <table class="table-hover">
150
+ <tr style="position: relative" class="table-bordered">
151
+ <td
152
+ style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
153
+ 汇总信息
154
+ </td>
155
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
156
+ 气量合计:&emsp;{{sumsmodel.f_gas}}&emsp;&emsp;金额合计:&emsp;{{sumsmodel.f_money}}
157
+ </td>
158
+ </tr>
159
+ </table>
160
+ </div>
161
+
162
+ </div>
163
+ </div>
164
+ <div class="basic-main" style="width:99%;height:98%;margin-bottom:0px" v-if="show">
165
+ <user-info-detail-manage-new :f_userinfo_id="rowdata.f_userinfo_id" @cancel-main="cancel"></user-info-detail-manage-new>
166
+ </div>
167
+ </div>
168
+ </template>
169
+
170
+ <script>
171
+ import {HttpResetClass, PagedList} from 'vue-client'
172
+ import defaultPrint from '../../components/sale/config/DefaultPrint'
173
+ import exportConfig from './exportConfig'
174
+
175
+ let readySomething = async function (self) {
176
+ self.$MagGetSaleParam.initinputtor();
177
+ self.getinputtores();
178
+ // 获取区县
179
+ self.$refs.paged.$refs.cri.model.startDate = self.$login.toStandardDateString()
180
+ self.$refs.paged.$refs.cri.model.endDate = self.$login.toStandardDateString()
181
+ // await self.$refs.paged.$refs.cri.search()
182
+ self.sumsmodel = self.$refs.paged.$refs.grid.model.sums
183
+ self.defaultfield = [...self.defaultfield, ...self.config.defaultPrint]
184
+ }
185
+
186
+ export default {
187
+ title: '抄表按用户汇总',
188
+ data() {
189
+ return {
190
+ other:[],
191
+ footer:[],
192
+ model: new PagedList('rs/sql/qnChaobiaoyhhz', 20, {}, {f_gas: 0, f_money: 0}),
193
+ criteriaShow: false,
194
+ orgCondtionStr: '',
195
+ modelval: [],
196
+ printshow: false,
197
+ all: false,
198
+ fields: {},
199
+ //排序
200
+ orderitem:'',
201
+ orderFields: {
202
+
203
+ },
204
+ //默认打印列
205
+ defaultfield: [],
206
+ config: {
207
+ defaultPrint: []
208
+ },
209
+ balance2:'',
210
+ thead: '',
211
+ tfoot: '',
212
+ area: [],
213
+ //合计数据
214
+ sumsmodel: {},
215
+ initres: {
216
+ org:[this.$login.f.orgid],
217
+ dep:[],
218
+ user:[],
219
+ },
220
+ userdetail: {
221
+ show: false,
222
+ f_userinfo_code: '',
223
+ f_filialeids: ''
224
+ },
225
+
226
+ show:false,
227
+ rowdata:{},
228
+ meterInfo:{},
229
+ deviceInfo:{},
230
+ condition2:'',
231
+
232
+
233
+ weixinSign:[{label:"全部",value:""},{label:"已绑定",value:"已绑定"},{label:"未绑定",value:"未绑定"}],
234
+ //小区
235
+ residentialArea: [],
236
+ //表册片区
237
+ bookSlice:[{label: '全部',value: ''}],
238
+ inputtores:[{label: '全部',value: ''}], //抄表员
239
+ allorgid:[],
240
+ f_filialeid: this.$login.f.f_orgid,
241
+ dypayment:[{label:"全部",value:""},{label:"银行代扣",value:"银行代扣",},{label:"现金缴费",value:"现金缴费",}],
242
+ }
243
+ },
244
+ ready() {
245
+ this.getaddress()
246
+ // this.$refs.paged.$refs.cri.model.f_user_state=['正常']
247
+ readySomething(this).then(() => {
248
+ this.$emit('ready')
249
+ }).catch((error) => {
250
+ this.$emit('error', error)
251
+ })
252
+ this.initAreas(this.$login.f.orgid)
253
+ self.$refs.paged.$refs.cri.model.startDate = self.$login.toStandardDateString()
254
+ self.$refs.paged.$refs.cri.model.endDate = self.$login.toStandardDateString()
255
+ },
256
+ methods: {
257
+ async getinputtores () {
258
+ // 获取抄表员
259
+ let rs = []
260
+ if (this.$login.f.f_gasman.length > 0) {
261
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
262
+ let temp = {
263
+ label: this.$login.f.f_gasman[i].name,
264
+ value: this.$login.f.f_gasman[i].name
265
+ }
266
+ rs.push(temp)
267
+ }
268
+ }
269
+ this.inputtores = [{label: '全部', value: ''}, ...rs]
270
+ },
271
+ async updateParams() {
272
+ await this.$MagLoadParams.loadParam(this.f_filialeid)
273
+ this.inputtores = [];
274
+ this.inputtores.push({label: "全部", value: ""})
275
+ this.initSlice(this.f_filialeid)
276
+ if(this.allorgid!=null){
277
+ this.allorgid.forEach((res)=>{
278
+ this.inputtores = this.inputtores.concat(this.$MagGetSaleParam.getresinputtor(res));
279
+ })
280
+ }
281
+ },
282
+ getotherfooter () {
283
+ // this.$refs.paged.$refs.cri.$refs.exports.otherData = [];
284
+ // this.$refs.paged.$refs.cri.$refs.exports.footerData = [];
285
+ this.other = [];
286
+ this.footer = [];
287
+ let exportdata = this.getCondition;
288
+ let otherInData = [];
289
+ otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`);
290
+ let footerData = [], exportfield = this.getExportField;
291
+ footerData.push("合计");
292
+ let self = this;
293
+ for (var field in self.sumsmodel) {
294
+ footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`);
295
+ }
296
+ this.footer.push(footerData);
297
+ this.other.push(otherInData);
298
+ },
299
+ async getaddress(){
300
+ console.log('开始获取小区')
301
+ let HttpReset = new HttpResetClass()
302
+ var data = await HttpReset.load('POST', 'rs/sql/manage_getarealist', {
303
+ data: {
304
+ condition: `1=1 and s.f_filialeid = '${this.$login.f.orgid}'`
305
+ }
306
+ }, {resolveMsg: null, rejectMsg: '获取小区失败!'})
307
+ console.log('小区',data)
308
+ let house = []
309
+ for (let row of data.data){
310
+ console.log('开始保存小区')
311
+ house.push({label: row.f_residential_area, value: row.f_residential_area})
312
+ }
313
+ this.residentialArea = house
314
+ },
315
+
316
+ //把数据库查询数据转换为下拉数据
317
+ calculate(rows){
318
+ let data = []
319
+ rows.forEach((row, n) => {
320
+ data[n] = {label: row.f_residential_area, value: row.id}
321
+ })
322
+ return data
323
+ },
324
+ search(){
325
+ console.log("=====search====")
326
+ //this.$refs.paged.$refs.cri.search()
327
+ this.$refs.paged.$refs.cri.search()
328
+ },
329
+ cancel(obj) {
330
+ console.log("=====cancel====" + obj)
331
+ this.show = false
332
+ },
333
+ showmsg(obj){
334
+ this.rowdata=obj
335
+ this.show=true
336
+ // let http = new HttpResetClass()
337
+ // http.load('POST','rs/sql/getUserMeter',{data: {condition: `f_userinfo_id ='${obj.f_userinfo_id}'`}},
338
+ // {resolveMsg: null, rejectMsg: null}).then((res) => {
339
+ // this.meterInfo = res.data})
340
+ // let http2 = new HttpResetClass()
341
+ // http2.load('POST','rs/sql/deviceQuery',{data: {condition: `f_userinfo_id ='${obj.f_userinfo_id}'`}},
342
+ // {resolveMsg: null, rejectMsg: null}).then((res) => {
343
+ // this.deviceInfo = res.data})
344
+
345
+ // this.f_userinfo_id=obj.f_userinfo_id
346
+ },
347
+ //初始化片区
348
+ async initSlice (val) {
349
+ if (val) {
350
+ let getAllArea = await this.$resetpost('/rs/search', {
351
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
352
+ userid: this.$login.f.id
353
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
354
+ let arr = getAllArea.data.filter((res) => {
355
+ return res.parentid == val
356
+ })
357
+ this.bookSlice = []
358
+ console.log('过滤之后的片区-------------------', arr)
359
+ arr.forEach((res) => {
360
+ this.bookSlice.push({label: res.name, value: res.name})
361
+ })
362
+ }
363
+ },
364
+ async initAreas (val) {
365
+
366
+ if (val) {
367
+ let getAllArea = await this.$resetpost('/rs/search', {
368
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
369
+ userid: this.$login.f.id
370
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
371
+
372
+ let arr = getAllArea.data.filter((res) => {
373
+ return res.parentid == val
374
+ })
375
+ console.log('过滤之后的片区', arr)
376
+ this.sliceArea = []
377
+ arr.forEach((res) => {
378
+ this.sliceArea.push({label: res.name, value: res.name})
379
+ })
380
+ }
381
+ },
382
+ selfSearch(args) {
383
+ console.log('args', args)
384
+ console.log('this.orgCondtionStr', this.orgCondtionStr)
385
+ if (!this.orgCondtionStr) {
386
+ args.condition = `${args.condition}` + " and tr.f_orgid = " + this.$login.f.orgid
387
+ } else {
388
+ args.condition = `${args.condition}` + this.orgCondtionStr
389
+ }
390
+ this.condition2 = args.condition
391
+ this.model.search(args.condition, args.model)
392
+ this.sumsmodel = this.$refs.paged.$refs.grid.model.sums
393
+ console.log('合计字段', this.sumsmodel)
394
+ },
395
+ clear() {
396
+ Object.keys(this.$refs.paged.$refs.cri.model).forEach((key) => {
397
+ this.$refs.paged.$refs.cri.model[key] = []
398
+ })
399
+ },
400
+ hidden() {
401
+ this.criteriaShow = !this.criteriaShow
402
+ },
403
+ getRes(obj) {
404
+ this.orgCondtionStr = obj
405
+ },
406
+ stamp() {
407
+ this.all = false
408
+ //默认选择要打印的列
409
+ this.modelval = defaultPrint.config
410
+ this.fields = this.getfield
411
+ console.log('所有打印字段', this.fields)
412
+ this.printshow = true
413
+ this.put()
414
+ },
415
+ put() {
416
+ // 对Modelval进行排序
417
+ this.sortModelval()
418
+ this.thead = `<tr><th colspan=${this.modelval.length}>用户查询统计报表</th></tr><tr>`
419
+ for (let key of this.modelval) {
420
+ this.thead += '<th>' + this.fields[key] + '</th>'
421
+ }
422
+ this.thead += '</tr>'
423
+ },
424
+ print() {
425
+ this.$refs.print.PrintAsFile()
426
+ this.printshow = false
427
+ },
428
+ close() {
429
+ this.printshow = false
430
+ },
431
+ // 对选择的列进行排序
432
+ sortModelval() {
433
+ let sortModel = []
434
+ Object.keys(this.fields).forEach((key) => {
435
+ if (this.modelval.includes(key)) {
436
+ sortModel.push(key)
437
+ }
438
+ })
439
+ this.modelval = sortModel
440
+ console.log('选择的打印的字段', this.modelval)
441
+ },
442
+ dblclick(row, index) {
443
+ console.log('双击之后数据', row, index)
444
+ this.userdetail.show = true
445
+ this.userdetail.f_userinfo_code = row.f_userinfo_code
446
+ this.userdetail.f_filialeids = row.f_filialeids
447
+ },
448
+ sort (field, rule) {
449
+ // 将所有排序方式设为不排序,实现相互排斥
450
+ for (let key in this.orderFields) {
451
+ if (key === field) {
452
+ this.orderFields[key] = rule
453
+ } else {
454
+ this.orderFields[key] = 'no'
455
+ }
456
+ }
457
+ // 如果新规则不排序,还原为默认排序
458
+ if (rule === 'no') {
459
+ this.model.paramSource.orderitem = `'${this.orderitem}'`
460
+ } else {
461
+ this.model.paramSource.orderitem = `'${field} ${rule}'`
462
+ }
463
+
464
+ this.search()
465
+ }
466
+ },
467
+
468
+ watch: {
469
+ 'all'(val) {
470
+ if (val) {
471
+ this.modelval = this.bodyData
472
+ } else {
473
+ this.modelval = defaultPrint.config
474
+ this.put()
475
+ }
476
+ },
477
+ 'modelval.length'() {
478
+ this.put()
479
+ },
480
+ sumsmodel:{
481
+ handler: function(val) {
482
+ this.getotherfooter();
483
+ },
484
+ deep: true
485
+ },
486
+ 'orgCondtionStr'(val) {
487
+ let res = val.match(/'(.*?)'/)
488
+ console.log('正则提取:',res && res[1])
489
+ if (res) {
490
+ this.f_filialeid = res[1]
491
+ if(res.input !=null){
492
+ let resorgid = res.input.substring(res.input.indexOf("'"));
493
+ if(resorgid!= null && resorgid!=''){
494
+ resorgid = resorgid.substring(0,resorgid.lastIndexOf("'")+1);
495
+ // resorgid = resorgid.replaceAll("'","");
496
+ resorgid = resorgid.replace(/'/g,"");
497
+ this.allorgid = resorgid.split(",")
498
+ }
499
+ }
500
+ this.updateParams()
501
+ }
502
+ },
503
+ },
504
+ computed: {
505
+ // defaultexport() {
506
+ // return exportConfig.chargeexportConfig
507
+ // },
508
+ authArr () {
509
+ return this.$login.r ? this.$login.r : []
510
+ },
511
+
512
+ getCondition() {
513
+ return {condition: this.condition2,orderitem:this.orderitem}
514
+ },
515
+ getfield() {
516
+ let data = {}
517
+ this.bodyData.forEach((value, index) => {
518
+ data[this.bodyData[index]] = this.headData[index]
519
+ })
520
+ //合计字段打印
521
+ this.tfoot = `<tr><th colspan=${this.modelval.length}>全表汇总信息: `
522
+ if (this.sumsmodel) {
523
+ Object.keys(this.sumsmodel).forEach((key) => {
524
+ this.tfoot += this.fields[key] + '合计: ' + `<font color="blue">${this.sumsmodel[key]} </font>`
525
+ })
526
+ } else {
527
+ this.tfoot += '暂无'
528
+ }
529
+ this.tfoot += '</th></tr>'
530
+ return data
531
+ },
532
+ getExportField() {
533
+ return exportConfig.qnChaobiaoyhhz
534
+ },
535
+ inputtor () {
536
+ // 获取抄表员
537
+ console.log('获取抄表员', this.$login.f)
538
+ let rs = []
539
+ if (this.$login.f.f_gasman.length > 0) {
540
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
541
+ let temp = {
542
+ label: this.$login.f.f_gasman[i].name,
543
+ value: this.$login.f.f_gasman[i].name
544
+ }
545
+ rs.push(temp)
546
+ }
547
+ }
548
+
549
+ return [{label: '全部', value: ''}, ...rs]
550
+ },
551
+ userstates() {
552
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('客户状态')]
553
+ },
554
+ userLevels () {
555
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('用户等级')]
556
+ },
557
+ userTypes () {
558
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')]
559
+ },
560
+ hairpin() {
561
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('发卡状态')]
562
+ },
563
+ addressstate() {
564
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
565
+ },
566
+ fcalculation() {
567
+ return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('结算方式')]
568
+ },
569
+ metertypes() {
570
+ return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('气表类型')]
571
+ }
572
+ }
573
+ }
574
+ </script>
575
+ <style>
576
+ .back-red{ /* 红色背景 */
577
+ background-color: #F6C6CE;
578
+ }
579
+ .back-blue{ /* 蓝色背景 */
580
+
581
+ }
582
+ </style>