apply-clients 3.1.37 → 3.1.38

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.
@@ -57,7 +57,7 @@
57
57
  type="button"
58
58
  name="button"
59
59
  class="btn btn-link"
60
- :disabled="$parent.$parent.mark === 1 || row.f_charging_status === '作废'"
60
+ :disabled="$parent.$parent.mark === 1 || row.f_charge_state === '作废'"
61
61
  @click="$parent.$parent.showInvalidModal(row)"
62
62
  >作废</button>
63
63
  </nobr>
@@ -72,7 +72,69 @@
72
72
  <h4 class="modal-title">收费明细</h4>
73
73
  </header>
74
74
  <article slot="modal-body" class="modal-body clearfix">
75
-
75
+ <div v-if="data.f_apply_type === '散户报建'" class="form-group col-sm-12 panel panel-info">
76
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
77
+ <div class="col-sm-6 text-left">设备信息</div>
78
+ </div>
79
+ <div class="form-group col-sm-6">
80
+ <label class="col-sm-4 control-label">设备品牌:</label>
81
+ <div class="col-sm-8">
82
+ <input-select
83
+ class="select select_list"
84
+ :value.sync="userfile.devicesinfo.f_brand"
85
+ v-model="userfile.devicesinfo.f_brand"
86
+ :options="brandList"
87
+ :disable="mark === 1"
88
+ :valueSingle="true"></input-select>
89
+ </div>
90
+ </div>
91
+ <div class="form-group col-sm-6">
92
+ <label class="col-sm-4 control-label">设备类型:</label>
93
+ <div class="col-sm-8">
94
+ <input-select
95
+ class="select select_list"
96
+ :value.sync="userfile.devicesinfo.f_devices_type"
97
+ v-model="userfile.devicesinfo.f_devices_type"
98
+ :options="devicesType"
99
+ :disable="mark === 1"
100
+ :valueSingle="true"></input-select>
101
+ </div>
102
+ </div>
103
+ <div class="form-group col-sm-6">
104
+ <label class="col-sm-4 control-label">设备数量:</label>
105
+ <div class="col-sm-8">
106
+ <input class="form-control input_view" style="" type="number"
107
+ placeholder="设备数量"
108
+ v-model="userfile.devicesinfo.f_devices_num"
109
+ :readonly="mark === 1"/>
110
+ </div>
111
+ </div>
112
+ <div class="form-group col-sm-6">
113
+ <label class="col-sm-4 control-label">安&ensp;装&ensp;人:</label>
114
+ <div class="col-sm-8">
115
+ <input-select
116
+ class="select select_list"
117
+ v-model="userfile.devicesinfo.f_input_person"
118
+ :options="personList"
119
+ :disable="mark === 1"
120
+ :value.sync = "userfile.devicesinfo.f_input_person"
121
+ :valueSingle="true"></input-select>
122
+ </div>
123
+ </div>
124
+ <div class="form-group col-sm-6">
125
+ <label class="col-sm-4 control-label">安装日期:</label>
126
+ <div class="col-sm-8">
127
+ <datepicker
128
+ placeholder="安装日期"
129
+ :value.sync="userfile.devicesinfo.f_input_date"
130
+ v-model="userfile.devicesinfo.f_input_date"
131
+ format="yyyy-MM-dd HH:mm:ss"
132
+ :value="userfile.devicesinfo.f_input_date"
133
+ :disabled="mark === 1">
134
+ </datepicker>
135
+ </div>
136
+ </div>
137
+ </div>
76
138
  <div class="form-group col-sm-12">
77
139
  <span>点击刷新按钮刷新应交金额、累计缴费金额、欠费金额</span>
78
140
  <button type="button" class="btn btn-primary" @click="apply_data()" style="float: right">刷新</button>
@@ -80,7 +142,7 @@
80
142
  <div class="form-group col-sm-12" :class="charge.f_charge_money ? '':'has-error'">
81
143
  <label class="col-sm-2 control-label">收费金额:</label>
82
144
  <div class="col-sm-10">
83
- <input type="number"
145
+ <input type="text"
84
146
  class="form-control input_view"
85
147
  style="width: 100%"
86
148
  placeholder="0.00"
@@ -112,17 +174,6 @@
112
174
  v-model="charge.f_ticket_number" />
113
175
  </div>
114
176
  </div>
115
- <!-- <div class="from-group" v-show = "true">-->
116
- <!-- <label>交费日期</label>-->
117
- <!-- <div>-->
118
- <!-- <datepicker width="600.76px;"-->
119
- <!-- :value.sync="addItem.f_charge_date"-->
120
- <!-- :format="'yyyy-MM-dd'"-->
121
- <!-- v-model="addItem.f_charge_date"-->
122
- <!-- :show-reset-button="reset">-->
123
- <!-- </datepicker>-->
124
- <!-- </div>-->
125
- <!-- </div>-->
126
177
  <div class="form-group col-sm-12" :class="charge.f_charge_date ? '':'has-error'">
127
178
  <label class="col-sm-2 control-label">收费日期:</label>
128
179
  <div class="col-sm-10">
@@ -199,6 +250,70 @@
199
250
  <h4 class="modal-title">作废收费</h4>
200
251
  </header>
201
252
  <article slot="modal-body" class="modal-body clearfix">
253
+ <div v-for="(i, item) in model.userfile.devicesinfo" v-if="data.f_apply_type === '散户报建'" class="form-group col-sm-12 panel panel-info">
254
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
255
+ <div class="col-sm-6 text-left">设备信息</div>
256
+ </div>
257
+ <div class="form-group col-sm-6">
258
+ <label class="col-sm-4 control-label">设备品牌:</label>
259
+ <div class="col-sm-8">
260
+ <input-select
261
+ class="select select_list"
262
+ :value.sync="item.f_brand"
263
+ v-model="item.f_brand"
264
+ :options="brandList"
265
+ :disable="true"
266
+ :valueSingle="true"></input-select>
267
+ </div>
268
+ </div>
269
+ <div class="form-group col-sm-6">
270
+ <label class="col-sm-4 control-label">设备类型:</label>
271
+ <div class="col-sm-8">
272
+ <input-select
273
+ class="select select_list"
274
+ :value.sync="item.f_devices_type"
275
+ v-model="item.f_devices_type"
276
+ :options="devicesType"
277
+ :disable="true"
278
+ :valueSingle="true"></input-select>
279
+ </div>
280
+ </div>
281
+ <div class="form-group col-sm-6">
282
+ <label class="col-sm-4 control-label">设备数量:</label>
283
+ <div class="col-sm-8">
284
+ <input class="form-control input_view" style="" type="number"
285
+ placeholder="设备数量"
286
+ v-model="item.f_devices_num"
287
+ :value="item.f_devices_num"
288
+ readonly/>
289
+ </div>
290
+ </div>
291
+ <div class="form-group col-sm-6">
292
+ <label class="col-sm-4 control-label">安&ensp;装&ensp;人:</label>
293
+ <div class="col-sm-8">
294
+ <input-select
295
+ class="select select_list"
296
+ v-model="item.f_input_person"
297
+ :options="personList"
298
+ :disable="true"
299
+ :value.sync = "item.f_input_person"
300
+ :valueSingle="true"></input-select>
301
+ </div>
302
+ </div>
303
+ <div class="form-group col-sm-6">
304
+ <label class="col-sm-4 control-label">安装日期:</label>
305
+ <div class="col-sm-8">
306
+ <datepicker
307
+ placeholder="安装日期"
308
+ :value.sync="item.f_input_date"
309
+ v-model="item.f_input_date"
310
+ format="yyyy-MM-dd HH:mm:ss"
311
+ :value="item.f_input_date"
312
+ :disabled="true">
313
+ </datepicker>
314
+ </div>
315
+ </div>
316
+ </div>
202
317
  <!-- <div class="form-group col-sm-12">-->
203
318
  <!-- <label class="col-sm-2 control-label">缴费地址:</label>-->
204
319
  <!-- <div class="col-sm-10">-->
@@ -271,16 +386,29 @@
271
386
  import {getNowDate,isEmpty} from '../../../Util'
272
387
  import {PagedList} from 'vue-client'
273
388
  import {HttpResetClass} from 'vue-client'
389
+ import Vue from 'vue'
274
390
 
275
391
  export default {
276
392
  title: '收费管理',
277
- props: ['data'],
393
+ props: {
394
+ selectdata: {
395
+ type: Object
396
+ },
397
+ data: {
398
+ type: Object
399
+ },
400
+ mark: {
401
+ type: Number,
402
+ default: 0
403
+ }
404
+ },
278
405
  data () {
279
406
  return {
280
407
  showCharge: false,
281
408
  showInvalid: false,
282
409
  model: {
283
- data: null
410
+ data: null,
411
+ userfile: null
284
412
  },
285
413
  charge: {
286
414
 
@@ -291,10 +419,13 @@ export default {
291
419
  f_arrears_money: 0.00
292
420
  },
293
421
  useraddressList: [],
294
- chargeUseraddress: null
422
+ chargeUseraddress: null,
423
+ userfile: null,
424
+ personList: []
295
425
  }
296
426
  },
297
427
  ready () {
428
+ this.installPerson()
298
429
  this.search()
299
430
  // 获取数据
300
431
  this.apply_data()
@@ -325,12 +456,18 @@ export default {
325
456
  } catch (e) {
326
457
  this.$showAlert(e.data, 'danger', 3000)
327
458
  }
328
-
329
-
330
- this.$dispatch('breakControl', this.selectdata)
459
+ if (this.data.f_apply_type === '散户报建'){
460
+ this.deleteDevice(this.charge)
461
+ this.refund_data(this.charge)
462
+ }
463
+ this.closeModal()
464
+ this.search()
331
465
  },
332
466
  showInvalidModal(row) {
333
467
  this.charge = row
468
+ if (this.data.f_apply_type === '散户报建'){
469
+ this.openDevicesModal(row)
470
+ }
334
471
  this.showInvalid = true
335
472
  },
336
473
  handleInput(e) {
@@ -348,7 +485,7 @@ export default {
348
485
  this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
349
486
  return
350
487
  }
351
- if (Number(this.charge.f_charge_money) > Number(this.applydata.f_arrears_money)) {
488
+ if ((Number(this.charge.f_charge_money) > Number(this.applydata.f_arrears_money)) && this.mark !== 2) {
352
489
  this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
353
490
  return
354
491
  }
@@ -368,6 +505,7 @@ export default {
368
505
  }
369
506
  let http = new HttpResetClass()
370
507
  let data = {
508
+ selectdata: this.data,
371
509
  tablename: 't_charge_record',
372
510
  parameters : {
373
511
  f_charge_money: this.charge.f_charge_money,
@@ -385,7 +523,7 @@ export default {
385
523
  }
386
524
  console.log("开始收费:" + JSON.stringify(data))
387
525
  try {
388
- let res = await http.load('POST', 'rs/logic/currencySaveUpdate', {data: data}, {
526
+ let res = await http.load('POST', 'rs/logic/addCharge', {data: data}, {
389
527
  resolveMsg: null,
390
528
  rejectMsg: null
391
529
  })
@@ -393,6 +531,9 @@ export default {
393
531
  } catch (e) {
394
532
  this.$showAlert(e.data, 'danger', 3000)
395
533
  }
534
+ if (this.data.f_apply_type === '散户报建'){
535
+ this.addDevice()
536
+ }
396
537
  this.showCharge = false
397
538
  this.charge.f_charge_money = 0
398
539
  this.charge.f_amount_words = ''
@@ -475,6 +616,17 @@ export default {
475
616
  rejectMsg: null
476
617
  })
477
618
  this.model.data = res.data
619
+ if (this.data.f_apply_type === '散户报建') {
620
+ data = {
621
+ f_process_id: this.data.f_process_id,
622
+ condition: `f_userinfo_id = '${this.data.f_userinfo_id}'`
623
+ }
624
+ res = await http.load('POST', 'rs/sql/getUserFilesAndDevicesAmount', {data: data}, {
625
+ resolveMsg: null,
626
+ rejectMsg: '获取表具失败!!!'
627
+ })
628
+ this.model.userfile = res.data
629
+ }
478
630
  },
479
631
  async apply_data () {
480
632
  for (let i = 0; i < this.data.fields.length; i++) {
@@ -505,19 +657,133 @@ export default {
505
657
  for (let i = 0; i < this.data.fields.length; i++) {
506
658
  if (this.data.fields[i].label == '累计缴费金额') {
507
659
  this.data.fields[i].value = Number(this.applydata.f_cumulative_money) + Number(this.charge.f_charge_money)
660
+ this.data.f_cumulative_money = Number(this.applydata.f_cumulative_money) + Number(this.charge.f_charge_money)
508
661
  }
509
662
  if (this.data.fields[i].label == '欠费金额') {
510
663
  this.data.fields[i].value = Number(this.applydata.f_arrears_money) - Number(this.charge.f_charge_money)
664
+ this.data.f_arrears_money = Number(this.applydata.f_arrears_money) - Number(this.charge.f_charge_money)
511
665
  }
512
666
  }
667
+ if (this.data.f_apply_type === '散户报建'){
668
+ let http = new HttpResetClass()
669
+ let data = {
670
+ tablename: 't_apply',
671
+ parameters : this.data
672
+ }
673
+ console.log("datasasda",data)
674
+ let res = await http.load('POST', 'rs/logic/currencySaveUpdate', {data: data}, {
675
+ resolveMsg: null,
676
+ rejectMsg: null
677
+ })
678
+ }
679
+
680
+ },
681
+ // 更新欠费金额和累计缴费金额
682
+ async refund_data (row) {
683
+ for (let i = 0; i < this.data.fields.length; i++) {
684
+ if (this.data.fields[i].label == '累计缴费金额') {
685
+ this.data.fields[i].value = Number(this.data.f_cumulative_money) - Number(row.f_charge_money)
686
+ }
687
+ if (this.data.fields[i].label == '欠费金额') {
688
+ this.data.fields[i].value = Number(this.data.f_arrears_money) + Number(row.f_charge_money)
689
+ }
690
+ }
691
+ },
692
+ async openDevicesModal (row) {
693
+ let data = {
694
+ tablename: 't_devices',
695
+ condition: `f_process_id = '${this.data.f_process_id}' and f_ticket_number = '${row.f_ticket_number}' and f_devices_state = '有效'`
696
+ }
697
+ let res = await this.$resetpost(
698
+ `rs/sql/singleTable`,
699
+ {data: data},
700
+ {resolveMsg: null, rejectMsg: '设备查询失败!!!'}
701
+ )
702
+
703
+ Vue.set(this.model.userfile, 'devicesinfo', res.data)
704
+ console.log("设备信息",this.model.userfile.devicesinfo)
705
+ },
706
+ async addDevice () {
707
+ let data = {
708
+ selectdata: this.data,
709
+ userfile: this.userfile,
710
+ user: this.$login.f
711
+ }
712
+ data.userfile.devicesinfo.f_ticket_number = this.charge.f_ticket_number
713
+ console.log("添加设备",data.userfile.devicesinfo)
714
+ let res = await this.$resetpost(
715
+ `rs/logic/applyAddDevice`,
716
+ {data: data},
717
+ {resolveMsg: null, rejectMsg: '设备添加失败!!!'}
718
+ )
719
+ },
720
+ async deleteDevice (row) {
721
+ let data = {
722
+ f_process_id: this.data.f_process_id,
723
+ f_ticket_number: row.f_ticket_number,
724
+ user: this.$login.f
725
+ }
726
+ let res = await this.$resetpost(
727
+ `rs/logic/applydeleteDevice`,
728
+ {data: data},
729
+ {resolveMsg: null, rejectMsg: '设备作废失败!!!'}
730
+ )
513
731
  },
514
732
  // 关闭对话框
515
733
  closeModal() {
516
734
  this.showCharge = false
517
735
  this.showInvalid = false
736
+ if (this.data.f_apply_type === '散户报建') {
737
+ this.model.userfile = null
738
+ }
518
739
  this.charge = {}
519
740
  this.chargeUseraddress = null
520
741
  this.search()
742
+ },
743
+ // 安装人
744
+ async installPerson() {
745
+ // return function (f_install_person) {
746
+ // if (isEmpty(f_install_person)) {
747
+ // return this.$login.f.name
748
+ // }
749
+ // return f_install_person
750
+ // }
751
+ console.log("当前数据",this.data)
752
+ console.log("当前数据",this.selectdata)
753
+ if (!this.data){
754
+ this.data = this.selectdata
755
+ }
756
+ let data = {
757
+ source: 'this.getParentByType($organization$).getChildByName($工程部负责人$).getChildren()',
758
+ userid: this.$login.f.id
759
+ }
760
+
761
+ let http = new HttpResetClass()
762
+ let res = await http.load(
763
+ 'POST',
764
+ `rs/search`,
765
+ {data: data},
766
+ {resolveMsg: null, rejectMsg: '人员查询失败!!!'}
767
+ )
768
+
769
+ this.personList = res.data.map(item => {
770
+ return {
771
+ label: item.name,
772
+ value: item.name
773
+ }
774
+ })
775
+ },
776
+ expireDate (index) {
777
+
778
+ if (isEmpty(this.userfile.devicesinfo[index].f_make_date) || isEmpty(this.userfile.devicesinfo[index].f_service_life)) {
779
+ return
780
+ }
781
+ let f_make_date = new Date(this.userfile.devicesinfo[index].f_make_date)
782
+ let year = (f_make_date.getFullYear() - 0) + (this.userfile.devicesinfo[index].f_service_life - 0)
783
+ let month = (f_make_date.getMonth() - 0) + 1
784
+ let day = f_make_date.getDate()
785
+
786
+ Vue.set(this.userfile.devicesinfo[index], 'f_expire_date', year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day))
521
787
  }
522
788
  },
523
789
  events: {
@@ -531,6 +797,35 @@ export default {
531
797
  },
532
798
  outstandingAmount() {
533
799
  return this.selectdata.f_price - this.cumulativePaymentMoney
800
+ },
801
+ // 安装人
802
+ installperson(f_input_person) {
803
+ return function (f_input_person) {
804
+ if (isEmpty(f_input_person)) {
805
+ return this.$login.f.name
806
+ }
807
+ return f_input_person
808
+ }
809
+ },
810
+ installdate(f_install_date) {
811
+ return function (f_install_date) {
812
+ if (isEmpty(f_install_date)) {
813
+ return new Date().Format('yyyy-MM-dd HH:mm:ss')
814
+ }
815
+ return f_install_date
816
+ }
817
+ },
818
+ installType() {
819
+ return this.$appdata.getParam("安装方式")
820
+ },
821
+ pipeType() {
822
+ return this.$appdata.getParam("管道类型")
823
+ },
824
+ devicesType() {
825
+ return this.$appdata.getParam("设备类型")
826
+ },
827
+ brandList() {
828
+ return this.$appdata.getParam("设备品牌")
534
829
  }
535
830
  },
536
831
  watch: {