apply-clients 4.1.59-weinan → 4.1.61-weinan

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.
Files changed (31) hide show
  1. package/index.html +30 -30
  2. package/package.json +1 -1
  3. package/src/apply.js +81 -81
  4. package/src/applyAndroid.js +52 -52
  5. package/src/components/app_apply/AppChargeManagement.vue +749 -749
  6. package/src/components/app_apply/AppInstallationDetails.vue +529 -529
  7. package/src/components/app_apply/AppProcessSupervisory.vue +214 -214
  8. package/src/components/app_apply/AppSupervisoryCart.vue +68 -68
  9. package/src/components/app_apply/AppTakePic.vue +146 -146
  10. package/src/components/app_apply/AppdevicesDetails.vue +867 -867
  11. package/src/components/app_apply/ApplyInfo.vue +56 -56
  12. package/src/components/app_apply/ApplyToDoList.vue +292 -292
  13. package/src/components/app_apply/PlaceControler.vue +274 -274
  14. package/src/components/app_apply/ServiceControl.vue +440 -440
  15. package/src/components/app_apply/ServiceView.vue +394 -394
  16. package/src/components/app_apply/materialshoufei.vue +243 -243
  17. package/src/components/product/ApplyCharge/ApplyChargeList.vue +252 -252
  18. package/src/components/product/Process/ExplorationSelect.vue +377 -377
  19. package/src/components/product/Process/ExplorationUser.vue +134 -134
  20. package/src/components/product/Process/Processes/InstallationDetails.vue +515 -515
  21. package/src/components/product/Process/Processes/chargeManagement.vue +545 -545
  22. package/src/components/product/Process/Processes/devicesDetails.vue +843 -843
  23. package/src/components/product/Process/Processes/materialshoufei.vue +5 -0
  24. package/src/components/product/Process/Service/ServiceControl.vue +25 -2
  25. package/src/components/product/Stop/StopApply.vue +101 -101
  26. package/src/components/product/Stop/StopApplyList.vue +266 -266
  27. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +200 -200
  28. package/src/components/product/Supervisory/SupervisoryControl.vue +124 -124
  29. package/src/components/product/Supervisory/SupervisoryList.vue +221 -221
  30. package/src/components/product/VueUtils/ApplyUpload.vue +276 -276
  31. package/src/main.js +25 -25
@@ -1,749 +1,749 @@
1
- <template>
2
- <div>
3
- <div class="col-sm-12 col-xs-12 form-group app-btn">
4
- <button class="btn btn-info" @click.prevent="showChargeModal()">收费</button>
5
- </div>
6
- <!--<div class="col-sm-12 col-xs-12">
7
- <list :model="charge.payment_terms" partial='list'>
8
- <div partial class="auto app-text panel">
9
- <div class="panel-body panel-self">
10
- <div class="row">
11
- <p class="col-xs-4 text-left font"><b>收费项目</b></p>
12
- <p class="col-xs-8 text-left input-font">{{ row.f_payment_term }}</p>
13
- </div>
14
- <div class="row">
15
- <p class="col-xs-4 text-left font"><b>收费金额</b></p>
16
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_money }}</p>
17
- </div>
18
- <div class="row">
19
- <p class="col-xs-4 text-left font"><b>金额大写</b></p>
20
- <p class="col-xs-8 text-left input-font">{{ row.f_amount_words }}</p>
21
- </div>
22
- <div class="row">
23
- <p class="col-xs-4 text-left font"><b>收费状态</b></p>
24
- <p class="col-xs-8 text-left input-font">未缴费</p>
25
- </div>
26
- </div>
27
- </div>
28
- </list>
29
- </div>-->
30
- <div class="col-sm-12 col-xs-12">
31
- <list :model="model" partial='list'>
32
- <div partial class="auto app-text panel">
33
- <div class="panel-body panel-self">
34
- <div class="row" v-if="selectdata.f_apply_type !== '开发商集体报建'">
35
- <p class="col-xs-4 text-left font"><b>地址</b></p>
36
- <p class="col-xs-8 text-left input-font">{{ row.f_useraddres }}</p>
37
- </div>
38
- <div class="row">
39
- <p class="col-xs-4 text-left font"><b>缴费编号</b></p>
40
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_number }}</p>
41
- </div>
42
- <div class="row">
43
- <p class="col-xs-4 text-left font"><b>收费金额</b></p>
44
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_money }}</p>
45
- </div>
46
- <div class="row">
47
- <p class="col-xs-4 text-left font"><b>金额大写</b></p>
48
- <p class="col-xs-8 text-left input-font">{{ row.f_amount_words }}</p>
49
- </div>
50
- <!-- <div class="row">
51
- <p class="col-xs-4 text-left font"><b>收费项目</b></p>
52
- <p class="col-xs-8 text-left input-font">{{ row.f_payment_term }}</p>
53
- </div>-->
54
- <div class="row">
55
- <p class="col-xs-4 text-left font"><b>付款方式</b></p>
56
- <p class="col-xs-8 text-left input-font">{{ row.f_payment_method }}</p>
57
- </div>
58
- <div class="row" v-if="row.f_payment_method === '银行转账'">
59
- <p class="col-xs-4 text-left font"><b>付款方名称</b></p>
60
- <p class="col-xs-8 text-left input-font">{{ row.f_payer_name }}</p>
61
- </div>
62
- <div class="row" v-if="row.f_payment_method === '银行转账'">
63
- <p class="col-xs-4 text-left font"><b>付款方账号</b></p>
64
- <p class="col-xs-8 text-left input-font">{{ row.f_payer_account }}</p>
65
- </div>
66
- <div class="row" v-if="row.f_payment_method === '银行转账'">
67
- <p class="col-xs-4 text-left font"><b>付款流水号</b></p>
68
- <p class="col-xs-8 text-left input-font">{{ row.f_payer_number }}</p>
69
- </div>
70
- <div class="row">
71
- <p class="col-xs-4 text-left font"><b>收费人员</b></p>
72
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_collectors }}</p>
73
- </div>
74
- <div class="row">
75
- <p class="col-xs-4 text-left font"><b>收费日期</b></p>
76
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_date }}</p>
77
- </div>
78
- <div class="row">
79
- <p class="col-xs-4 text-left font"><b>支付状态</b></p>
80
- <p class="col-xs-8 text-left input-font">{{ row.f_paystate }}</p>
81
- </div>
82
- <div class="row">
83
- <p class="col-xs-4 text-left font"><b>备注</b></p>
84
- <p class="col-xs-8 text-left input-font">{{ row.f_charge_remarks }}</p>
85
- </div>
86
- </div>
87
- </div>
88
- </list>
89
- </div>
90
-
91
- <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :large="true" :backdrop="false" title="收费明细">
92
- <header slot="modal-header" class="modal-header">
93
- <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
94
- <h4 class="modal-title">收费明细</h4>
95
- </header>
96
- <article slot="modal-body" class="modal-body clearfix">
97
- <div class="form-group row vertical-center" :class="charge.f_payment_method ? '':'has-error'">
98
- <label class="col-xs-4 control-label">付款方式:</label>
99
- <div class="col-xs-8">
100
- <input-select class="select select_list"
101
- v-model="charge.f_payment_method"
102
- :value.sync="charge.f_payment_method"
103
- :options='paymentMethod'
104
- :value-single="true"
105
- close-on-select ></input-select>
106
- </div>
107
- </div>
108
- <div v-for="(index,payment) in charge.payment_terms">
109
- <div class="form-group row vertical-center" :class="payment.f_payment_term ? '':'has-error'">
110
- <label class="col-xs-4 control-label">收费项目:</label>
111
- <div class="col-xs-8">
112
- <input-select class="select select_list"
113
- v-model="payment.f_payment_term"
114
- :value.sync="payment.f_payment_term"
115
- :options='paymentTerm'
116
- :value-single="true"
117
- close-on-select ></input-select>
118
- </div>
119
- </div>
120
- <div class="form-group row vertical-center" :class="payment.f_charge_money ? '':'has-error'">
121
- <label class="col-xs-4 control-label">收费金额:</label>
122
- <div class="col-xs-8">
123
- <input class="form-control input_view" style="" type="number"
124
- v-model="payment.f_charge_money"
125
- @keyup="handleInput(index)"
126
- @change="moneyChange(index)"
127
- :readonly="true"/>
128
- </div>
129
- </div>
130
- <div class="form-group row vertical-center">
131
- <label class="col-xs-4 control-label">金额大写:</label>
132
- <div class="col-xs-8">
133
- <input class="form-control input_view" style=""
134
- v-model="payment.f_amount_words"
135
- :value="smalltoBIG(payment.f_charge_money)"
136
- :readonly="true"/>
137
- </div>
138
- </div>
139
- </div>
140
- <!-- <div class="row" style="display: flex"> <button type="button" style="margin: 0 auto;" class="btn btn-primary" @click.prevent="addPaymentTerms()">增加收费项目</button> </div>-->
141
- </article>
142
- <footer slot="modal-footer" class="modal-footer">
143
- <button type="button" class="btn btn-primary" @click.prevent="openQrCode()">确认</button>
144
- </footer>
145
- </modal>
146
-
147
- <modal :show.sync="showQrCode" v-ref:qrcodemodal :large="true" :backdrop="false" style="height: 100%">
148
- <header slot="modal-header" class="modal-header">
149
- <h4 class="modal-title">{{title1}}扫码支付</h4>
150
- </header>
151
- <article slot="modal-body" class="modal-body clearfix">
152
- <div class="text-center">
153
- <p><b>收费金额:{{ getTotalAmount() }}¥</b></p>
154
- <p><b>收费项目:{{ getPaymentTerm() }}</b></p>
155
- <div id="qrcode" class="qrcode" v-ref:qrcode></div>
156
- <p>
157
- 等待支付,剩余&ensp;<span style="color: #ff791a">{{timeLeft}}</span>&ensp;秒
158
- </p>
159
- <button type="button" @click="closeQRCode">取消支付</button>
160
- </div>
161
- </article>
162
- <footer slot="modal-footer"></footer>
163
- </modal>
164
- </div>
165
- </template>
166
- <script>
167
- import {getNowDate,isEmpty} from '../Util'
168
- import {PagedList} from 'vue-client'
169
- import {HttpResetClass} from 'vue-client'
170
- import QRCode from 'qrcodejs2'
171
- import Vue from "vue";
172
-
173
- export default {
174
- title: '收费管理',
175
- props: {
176
- selectdata: {
177
- type: Object
178
- },
179
- mark: {
180
- type: Number,
181
- default: 0
182
- }
183
- },
184
- data () {
185
- return {
186
- showCharge: false, // 收费明细
187
- showCharge1:false, // 付款方式
188
- showQrCode : false, // 二维码
189
- model: {
190
- rows: null
191
- }, // 记录
192
- useraddresList: [], // 地址列表
193
- /*charge: {
194
-
195
- },*/
196
- charge: {
197
- payment_terms:[{f_payment_term: '',f_charge_money: '',f_amount_words:'',f_payment_method : ''}]
198
- },
199
- order: {},
200
- timeLeft: 300,
201
- paymentInterval: null,
202
- orderInterval: null,
203
- filiale:"",
204
- config: {
205
-
206
- },
207
- title1:'',
208
- // 收费编号
209
- f_charge_number:'',
210
- state:'结束'
211
- }
212
- },
213
- ready () {
214
- this.search()
215
- },
216
- methods: {
217
- addPaymentTerms(){
218
- this.charge.payment_terms.push({f_payment_term: '',f_charge_money: '',f_payment_method : this.charge.f_payment_method})
219
- },
220
- // 新增收费
221
- /*async saveCharge() {
222
- let http = new HttpResetClass()
223
- let data = {
224
- apply: this.selectdata,
225
- charge: this.charge,
226
- user: Vue.user,
227
- f_out_trade_no:this.order.f_out_trade_no
228
- }
229
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/appaddApplyChargeRecord`, {data:data}, {
230
- resolveMsg: null,
231
- rejectMsg: '缴费失败!!!'
232
- })
233
- this.selectdata = res.data
234
-
235
- this.$dispatch('breakControl')
236
- },*/
237
- // 获取订单信息
238
- getOrderInformation () {
239
- this.state = '开始'
240
- // 查询订单信息
241
- console.log('查询订单信息!!!')
242
- // 查询订单状态
243
- try {
244
- let http = new HttpResetClass()
245
- let res = http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`, {
246
- data: {
247
- tablename: "t_weixinreturnxml",
248
- condition: ` f_out_trade_no = '${this.order.f_out_trade_no}' and f_order_state = '已支付' `,
249
- }
250
- }, {
251
- resolveMsg: null,
252
- rejectMsg: '订单查询失败!!!'
253
- })
254
- console.log('8888888888')
255
- console.log(this.order.f_out_trade_no)
256
- console.log(JSON.stringify(res))
257
- // 支付成功
258
- if (res.data.length > 0) {
259
- this.$showMessage('支付成功!!!')
260
- clearTimeout(this.paymentInterval)
261
- clearTimeout(this.orderInterval)
262
- this.timeLeft = 300
263
- // 修改支付状态
264
- this.updatestate('支付成功','有效')
265
- this.saveother()
266
- // 清除二维码
267
- this.clearQrCode()
268
- this.showQrCode = false
269
- }
270
- }catch (e){
271
- this.state = '结束'
272
- }
273
- this.state = '结束'
274
- },
275
- checkApplyModel(){
276
- console.log(this.charge.payment_terms)
277
- for(let row = 0;row<this.charge.payment_terms.length; row++){
278
- console.log(this.charge.payment_terms[row])
279
- if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
280
- console.log(1111)
281
- this.$showMessage('请选择收费项目!!!', 'warning', 3000)
282
- return
283
- }else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
284
- console.log(2222)
285
- this.$showMessage('请输入收费金额!!!', 'warning', 3000)
286
- return
287
- }
288
- }
289
- this.showCharge=false
290
- this.$dispatch('changeShowfei','待付款')
291
- },
292
- // 打开二维码
293
- async openQrCode () {
294
- console.log(this.charge.payment_terms)
295
- let http = new HttpResetClass()
296
- for(let row = 0;row<this.charge.payment_terms.length; row++){
297
- console.log(this.charge.payment_terms[row])
298
- if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
299
- console.log(1111)
300
- this.$showMessage('请选择收费项目!!!', 'warning', 3000)
301
- return
302
- }else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
303
- console.log(2222)
304
- this.$showMessage('请输入收费金额!!!', 'warning', 3000)
305
- return
306
- }
307
- }
308
-
309
- if (this.charge.f_payment_method !== '微信支付' && this.charge.f_payment_method !== '支付宝支付' ){
310
- let info = {
311
- apply: this.selectdata,
312
- charge: this.charge,
313
- user: Vue.user,
314
- f_out_trade_no:""
315
- }
316
- let data1 = {
317
- tablename: 't_userinfo',
318
- condition: `f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
319
- }
320
- await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data1}, {resolveMsg: null, rejectMsg: '获取数据失败'}).then(res1=>{
321
- this.$showMessage( `确认对${res1.data[0].f_user_name}进行${this.charge.f_payment_method}收费?`,['confirm', 'cancel']).then((res)=>{
322
- if (res=='confirm'){
323
- http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/beforeAddChargeRecord`,{data:info},{
324
- resolveMsg: null,
325
- rejectMsg: null
326
- }).then(async (res)=>{
327
- console.log(res.data)
328
- if (res.data.code == '200') {
329
- this.$showMessage('缴费成功!')
330
- this.saveother()
331
- this.search()
332
- this.showCharge=false
333
- }
334
- })
335
- }
336
- })
337
- })
338
- return
339
- }
340
- if (this.charge.f_payment_method == '微信支付'){
341
- this.title1 = '微信'
342
- }
343
- if (this.charge.f_payment_method == '支付宝支付'){
344
- this.title1 = '支付宝'
345
- }
346
- this.showCharge=false
347
- //this.$dispatch('changeShowfei','待付款')
348
- //this.saveCharge()
349
- // 接口金额 单位为:分
350
- let data = {
351
- money: this.accMul(this.getTotalAmount() ,1) + '',
352
- attach: {
353
- "f_apply_num": this.selectdata.f_apply_num,
354
- "f_user": Vue.user.id
355
- },
356
- orderType:'报装收费',
357
- userfilesid:'',
358
- flag: 'JsApiWeiNan',
359
- openid: '',
360
- filiale: 'weinanchengtou'
361
- }
362
- console.log('下单信息')
363
- console.log(JSON.stringify(data))
364
- // 下订单
365
- http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/jsApiPay`, data, {
366
- resolveMsg: null,
367
- rejectMsg: '订单生成失败!!!'
368
- }).then(
369
- res=>{
370
- console.log('=================================')
371
- console.log("数据测试"+JSON.stringify(res.data))
372
- this.order = res.data
373
- console.log("数据测试"+this.order)
374
- let info = {
375
- apply: this.selectdata,
376
- charge: this.charge,
377
- user: Vue.user,
378
- f_out_trade_no:this.order.f_out_trade_no
379
- }
380
- http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/beforeAddChargeRecord`,{data:info},{
381
- resolveMsg: null,
382
- rejectMsg: null
383
- }).then(ress=>{
384
- console.log('ress',ress)
385
- if(ress.data.code == '200'){
386
- this.f_charge_number = ress.data.f_charge_number
387
- this.showQrCode = true
388
- this.$nextTick(()=>{
389
- this.qrcode()
390
- })
391
- // 剩余支付时间
392
- this.paymentInterval = setInterval(() => {
393
- this.timeLeft = this.timeLeft - 1
394
- },1000)
395
-
396
- // 3秒查询一次订单支付信息
397
- this.orderInterval = setInterval(() => {
398
- if(this.state == '结束'){
399
- this.getOrderInformation()
400
- }
401
- },3000)
402
- }else{
403
- this.$showMessage('订单生成失败')
404
- }
405
- })
406
- }
407
- )
408
- },
409
- accMul(arg1,arg2) {
410
- let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
411
- try {
412
- m += s1.split(".")[1].length
413
- } catch (e) {
414
- }
415
- try {
416
- m += s2.split(".")[1].length
417
- } catch (e) {
418
- }
419
- return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
420
- },
421
- getTotalAmount(){
422
- let money=0
423
- this.charge.payment_terms.forEach((row)=>{
424
- money = Math.floor((Number(money)+Number(row.f_charge_money)) * 100) / 100
425
- })
426
- return money
427
- },
428
- getPaymentTerm(){
429
- let term=''
430
- this.charge.payment_terms.forEach((row)=>{
431
- term += `${row.f_payment_term} `
432
- })
433
- return term
434
- },
435
- qrcode () {
436
- let qrcode = new QRCode('qrcode',{
437
- text: this.order.appId, // 设置二维码内容或跳转地址
438
- width: 200, // 设置宽度,单位像素
439
- height: 200, // 设置高度,单位像素
440
- correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
441
- })
442
- },
443
- clearQrCode () {
444
- document.getElementById('qrcode').innerHTML = ''
445
- },
446
- moneyChange (index) {
447
- console.log(`当前下标----${index}`)
448
- if (isEmpty(this.charge.payment_terms[index].f_charge_money) || Number(this.charge.payment_terms[index].f_charge_money) === 0) {
449
- this.$showMessage('单笔收费不能为0元!!!', 'warning', 3000)
450
- this.charge.payment_terms[index].f_charge_money = null
451
- return
452
- }
453
-
454
- },
455
- /*moneyChange () {
456
- if (isEmpty(this.charge.f_charge_money) || Number(this.charge.f_charge_money) === 0) {
457
- this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
458
- this.charge.f_charge_money = null
459
- return
460
- }
461
- if (this.selectdata.f_apply_type === '散户集体报建' && Number(this.charge.f_charge_money) > Number(this.charge.f_outstanding_amount)) {
462
- this.$showAlert('单笔收费不能超过未交金额!!!', 'warning', 3000)
463
- this.charge.f_charge_money = null
464
- return
465
- }
466
- if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) {
467
- this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
468
- this.charge.f_charge_money = null
469
- return
470
- }
471
- },*/
472
- // 金额转大写
473
- handleInput(index) {
474
- // 通过正则过滤小数点后两位
475
- console.log('-----------------------')
476
- this.charge.payment_terms[index].f_charge_money = (this.charge.payment_terms[index].f_charge_money.match(/^\d*(\.?\d{0,2})/g)[0]) || null
477
- this.charge.payment_terms[index].f_amount_words = this.smalltoBIG( this.charge.payment_terms[index].f_charge_money)
478
- },
479
- // 金额转大写
480
- smalltoBIG(n) {
481
- let fraction = ['角', '分'];
482
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
483
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
484
- let head = n < 0 ? '欠' : '';
485
- n = Math.abs(n);
486
-
487
- let s = '';
488
-
489
- for (var i = 0; i < fraction.length; i++) {
490
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
491
- }
492
- s = s || '整';
493
- n = Math.floor(n);
494
-
495
- for (var i = 0; i < unit[0].length && n > 0; i++) {
496
- let p = '';
497
- for (var j = 0; j < unit[1].length && n > 0; j++) {
498
- p = digit[n % 10] + unit[1][j] + p;
499
- n = Math.floor(n / 10);
500
- }
501
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
502
- }
503
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
504
- },
505
- async getUserAddress() {
506
- let http = new HttpResetClass()
507
- let data = {}
508
- let url = null
509
- if (this.selectdata.f_apply_type === '改管报建' || this.selectdata.f_apply_type === '增容报建' || this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建') {
510
- data = {
511
- condition: `ui.f_userinfo_id = ${this.selectdata.f_userinfo_id}`
512
- }
513
- url = `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetUserinfos`
514
- } else {
515
- data = {
516
- condition: this.selectdata.f_apply_type === '散户集体报建' ? `nvl(cr.f_cumulative_payment_money, 0) < ${this.selectdata.f_price}` : '1=1',
517
- f_process_id: this.selectdata.f_process_id
518
- }
519
- url = `${this.$androidUtil.getProxyUrl()}/rs/sql/getAddresAndCumulativePayment`
520
- }
521
- let res = await http.load('POST', url, {data:data}, {
522
- resolveMsg: null,
523
- rejectMsg: '用户获取失败!!!'
524
- })
525
-
526
-
527
- this.useraddresList = res.data.map(item => {
528
- return {
529
- // 有用户姓名地址后拼接姓名
530
- label: `${item.f_address} ${isEmpty(item.f_user_name) ? '' : '--- ' + item.f_user_name}`,
531
- value: item
532
- }
533
- })
534
-
535
- },
536
- async showChargeModal() {
537
- let http = new HttpResetClass()
538
- let data = {
539
- condition: " 1=1",
540
- f_process_id: this.selectdata.f_process_id
541
- }
542
- let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
543
- resolveMsg: null,
544
- rejectMsg: null
545
- })
546
- if (res.data[0].f_user_id===null){
547
- this.$showMessage("请先添加表具信息!!!")
548
- return
549
- }
550
- this.getUserAddress()
551
- console.log("材料费",this.selectdata.f_cost_sum)
552
- this.charge.payment_terms[0].f_charge_money = this.selectdata.f_cost_sum
553
- this.showCharge = true
554
- },
555
- async search () {
556
- let http = new HttpResetClass()
557
- let data = {
558
- f_process_id: this.selectdata.f_process_id
559
- }
560
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyChargeRecord`, {data:data}, {
561
- resolveMsg: null,
562
- rejectMsg: '收费记录查询失败!!!'
563
- })
564
- this.model.rows = res.data
565
- },
566
- // 关闭对话框
567
- closeModal () {
568
- this.showCharge = false
569
- this.showInvalid = false
570
- this.showPrint = false
571
- this.charge = {
572
- payment_terms:[{f_payment_term: '',f_charge_money: '',f_amount_words:'',f_payment_method : this.charge.f_payment_method}]
573
- }
574
- this.search()
575
- },
576
- closeQRCode(){
577
- clearTimeout(this.paymentInterval)
578
- clearTimeout(this.orderInterval)
579
- this.timeLeft = 300
580
- // 修改支付状态
581
- this.updatestate('支付失败','无效')
582
- this.closeOrder()
583
- // 清除二维码
584
- this.clearQrCode()
585
- this.showQrCode = false
586
- },
587
- async updatestate(state,state1){
588
- let data = {
589
- state1:state1,
590
- f_charge_number:this.f_charge_number,
591
- f_paystate:state
592
- }
593
- let http = new HttpResetClass()
594
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/updatestate`, {data:data}, {
595
- resolveMsg: null,
596
- rejectMsg: '修改失败!!!'
597
- })
598
- this.search()
599
- },
600
- async closeOrder(){
601
- let data = {
602
- "flag":"JsApiWeiNan",
603
- "f_filiale": "weinanchengtou",
604
- "f_out_trade_no": this.order.f_out_trade_no,// 商户单号
605
- "isClose":"是",
606
- "f_sys_trace":this.order.f_sys_trace // 交易流水号
607
- }
608
- let http = new HttpResetClass()
609
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/microPayOrderStatus`, data, {
610
- resolveMsg: null,
611
- rejectMsg: '关闭失败!!!'
612
- })
613
- },
614
- async saveother(){
615
- let http = new HttpResetClass()
616
- let data = {
617
- condition: " 1=1",
618
- f_process_id: this.selectdata.f_process_id
619
- }
620
- let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
621
- resolveMsg: null,
622
- rejectMsg: null
623
- })
624
- let data1 = {
625
- tablename: 't_material_charges',
626
- condition: `f_process_id = '${this.selectdata.f_process_id}'`
627
- }
628
- let res1 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data1}, {resolveMsg: null, rejectMsg: '获取数据失败'})
629
-
630
- let otherdetails = []
631
- for(let i=0;i<res1.data.length;i++){
632
- otherdetails.push(
633
- {
634
- "f_brand_spec":[res1.data[i].f_material_name],
635
- "f_unitprice":res1.data[i].f_material_price,
636
- "f_typename":[res1.data[i].f_typename],
637
- "f_typenumber":[res1.data[i].f_typenumber],
638
- "f_number":res1.data[i].f_material_number
639
- }
640
- )
641
- }
642
- console.log("查询的用户信息",otherdetails)
643
- let data2 = {
644
- "record_userinfo":res.data[0].f_userinfo_id,
645
- "f_userfiles_id":res.data[0].f_userfiles_id,
646
- "f_user_id":res.data[0].f_user_id,
647
- "f_user_name":res.data[0].f_user_name,
648
- "f_address":res.data[0].f_address,
649
- "f_user_type":this.selectdata.f_user_type,
650
- "f_gasproperties":"",
651
- "f_collection":this.selectdata.f_cost_sum,
652
- "f_comments":"",
653
- "f_payment":this.charge.f_payment_method,
654
- "f_voucher_number":"",
655
- "f_bill_style":"普通收据",
656
- "f_userinfo_id":res.data[0].f_userinfo_id,
657
- "f_service_person":Vue.user.name,
658
- "f_operat_type":"其他收费",
659
- "f_describe":"",
660
- "f_state":"有效",
661
- "f_operator":Vue.user.name,
662
- "f_operatorid":Vue.user.id,
663
- "f_orgid":Vue.user.orgid,
664
- "f_orgname":Vue.user.orgs,
665
- "f_depid":Vue.user.depids,
666
- "f_depname":Vue.user.f_department_name,
667
- "t_userfees":"",
668
- "f_fee_type":"其他费用",
669
- "f_fee_time":"12",
670
- "otherdetail":otherdetails
671
- }
672
- let res2 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/sale_othercharge_logic`, {data: data2}, {resolveMsg: null, rejectMsg: '保存数据失败'})
673
- }
674
- // async getConfig () {
675
- // let http = new HttpResetClass()
676
- // let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/getWeiXinConfig`, null, {
677
- // resolveMsg: null,
678
- // rejectMsg: '获取配置失败!!!'
679
- // })
680
- //
681
- // console.log('==============================')
682
- // console.log(res.data)
683
- //
684
- // this.config = res.data
685
- //
686
- // this.timeLeft = 120
687
- // },
688
- },
689
- events: {
690
- },
691
- computed: {
692
- paymentMethod() {
693
- return this.$appdata.getParam("付款方式")
694
- },
695
- paymentTerm() {
696
- return this.$appdata.getParam("收费项目")
697
- //return [{label: '安装费', value: '安装费'}]
698
- }
699
- },
700
- watch: {
701
- timeLeft () {
702
- if (this.timeLeft <= 0) {
703
- clearTimeout(this.paymentInterval)
704
- clearTimeout(this.orderInterval)
705
-
706
- this.timeLeft = 300
707
- // 修改支付状态
708
- this.updatestate('支付失败','无效')
709
- this.closeOrder()
710
- // 清除二维码
711
- this.clearQrCode()
712
-
713
- this.showQrCode = false
714
-
715
- this.$showMessage('订单支付超时!!!,如果已支付成功,我们将在1-2两个工作日内退款')
716
- }
717
- },
718
- /*'selectdata.showfei' (val){
719
- console.log('---------'+val)
720
- if(val=='收款码'){
721
- this.openQrCode()
722
- }
723
- }*/
724
- }
725
- }
726
- </script>
727
- <style scoped lang="less">
728
- .qrcode {
729
- display: inline-block !important;
730
- margin: 10px 0px;
731
- }
732
- .panel-self{
733
- border-radius: 10px;
734
- border:1px solid #499EDF;
735
- background-color: #F8F8F8;
736
- }
737
- .vertical-center {
738
- display: flex;
739
- align-items: center;
740
- text-align: center;
741
- }
742
- /*清除model中的浮动*/
743
- .clearfix:after,.clearfix:before{
744
- display: table;
745
- }
746
- .clearfix:after{
747
- clear: both;
748
- }
749
- </style>
1
+ <template>
2
+ <div>
3
+ <div class="col-sm-12 col-xs-12 form-group app-btn">
4
+ <button class="btn btn-info" @click.prevent="showChargeModal()">收费</button>
5
+ </div>
6
+ <!--<div class="col-sm-12 col-xs-12">
7
+ <list :model="charge.payment_terms" partial='list'>
8
+ <div partial class="auto app-text panel">
9
+ <div class="panel-body panel-self">
10
+ <div class="row">
11
+ <p class="col-xs-4 text-left font"><b>收费项目</b></p>
12
+ <p class="col-xs-8 text-left input-font">{{ row.f_payment_term }}</p>
13
+ </div>
14
+ <div class="row">
15
+ <p class="col-xs-4 text-left font"><b>收费金额</b></p>
16
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_money }}</p>
17
+ </div>
18
+ <div class="row">
19
+ <p class="col-xs-4 text-left font"><b>金额大写</b></p>
20
+ <p class="col-xs-8 text-left input-font">{{ row.f_amount_words }}</p>
21
+ </div>
22
+ <div class="row">
23
+ <p class="col-xs-4 text-left font"><b>收费状态</b></p>
24
+ <p class="col-xs-8 text-left input-font">未缴费</p>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </list>
29
+ </div>-->
30
+ <div class="col-sm-12 col-xs-12">
31
+ <list :model="model" partial='list'>
32
+ <div partial class="auto app-text panel">
33
+ <div class="panel-body panel-self">
34
+ <div class="row" v-if="selectdata.f_apply_type !== '开发商集体报建'">
35
+ <p class="col-xs-4 text-left font"><b>地址</b></p>
36
+ <p class="col-xs-8 text-left input-font">{{ row.f_useraddres }}</p>
37
+ </div>
38
+ <div class="row">
39
+ <p class="col-xs-4 text-left font"><b>缴费编号</b></p>
40
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_number }}</p>
41
+ </div>
42
+ <div class="row">
43
+ <p class="col-xs-4 text-left font"><b>收费金额</b></p>
44
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_money }}</p>
45
+ </div>
46
+ <div class="row">
47
+ <p class="col-xs-4 text-left font"><b>金额大写</b></p>
48
+ <p class="col-xs-8 text-left input-font">{{ row.f_amount_words }}</p>
49
+ </div>
50
+ <!-- <div class="row">
51
+ <p class="col-xs-4 text-left font"><b>收费项目</b></p>
52
+ <p class="col-xs-8 text-left input-font">{{ row.f_payment_term }}</p>
53
+ </div>-->
54
+ <div class="row">
55
+ <p class="col-xs-4 text-left font"><b>付款方式</b></p>
56
+ <p class="col-xs-8 text-left input-font">{{ row.f_payment_method }}</p>
57
+ </div>
58
+ <div class="row" v-if="row.f_payment_method === '银行转账'">
59
+ <p class="col-xs-4 text-left font"><b>付款方名称</b></p>
60
+ <p class="col-xs-8 text-left input-font">{{ row.f_payer_name }}</p>
61
+ </div>
62
+ <div class="row" v-if="row.f_payment_method === '银行转账'">
63
+ <p class="col-xs-4 text-left font"><b>付款方账号</b></p>
64
+ <p class="col-xs-8 text-left input-font">{{ row.f_payer_account }}</p>
65
+ </div>
66
+ <div class="row" v-if="row.f_payment_method === '银行转账'">
67
+ <p class="col-xs-4 text-left font"><b>付款流水号</b></p>
68
+ <p class="col-xs-8 text-left input-font">{{ row.f_payer_number }}</p>
69
+ </div>
70
+ <div class="row">
71
+ <p class="col-xs-4 text-left font"><b>收费人员</b></p>
72
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_collectors }}</p>
73
+ </div>
74
+ <div class="row">
75
+ <p class="col-xs-4 text-left font"><b>收费日期</b></p>
76
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_date }}</p>
77
+ </div>
78
+ <div class="row">
79
+ <p class="col-xs-4 text-left font"><b>支付状态</b></p>
80
+ <p class="col-xs-8 text-left input-font">{{ row.f_paystate }}</p>
81
+ </div>
82
+ <div class="row">
83
+ <p class="col-xs-4 text-left font"><b>备注</b></p>
84
+ <p class="col-xs-8 text-left input-font">{{ row.f_charge_remarks }}</p>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </list>
89
+ </div>
90
+
91
+ <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :large="true" :backdrop="false" title="收费明细">
92
+ <header slot="modal-header" class="modal-header">
93
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
94
+ <h4 class="modal-title">收费明细</h4>
95
+ </header>
96
+ <article slot="modal-body" class="modal-body clearfix">
97
+ <div class="form-group row vertical-center" :class="charge.f_payment_method ? '':'has-error'">
98
+ <label class="col-xs-4 control-label">付款方式:</label>
99
+ <div class="col-xs-8">
100
+ <input-select class="select select_list"
101
+ v-model="charge.f_payment_method"
102
+ :value.sync="charge.f_payment_method"
103
+ :options='paymentMethod'
104
+ :value-single="true"
105
+ close-on-select ></input-select>
106
+ </div>
107
+ </div>
108
+ <div v-for="(index,payment) in charge.payment_terms">
109
+ <div class="form-group row vertical-center" :class="payment.f_payment_term ? '':'has-error'">
110
+ <label class="col-xs-4 control-label">收费项目:</label>
111
+ <div class="col-xs-8">
112
+ <input-select class="select select_list"
113
+ v-model="payment.f_payment_term"
114
+ :value.sync="payment.f_payment_term"
115
+ :options='paymentTerm'
116
+ :value-single="true"
117
+ close-on-select ></input-select>
118
+ </div>
119
+ </div>
120
+ <div class="form-group row vertical-center" :class="payment.f_charge_money ? '':'has-error'">
121
+ <label class="col-xs-4 control-label">收费金额:</label>
122
+ <div class="col-xs-8">
123
+ <input class="form-control input_view" style="" type="number"
124
+ v-model="payment.f_charge_money"
125
+ @keyup="handleInput(index)"
126
+ @change="moneyChange(index)"
127
+ :readonly="true"/>
128
+ </div>
129
+ </div>
130
+ <div class="form-group row vertical-center">
131
+ <label class="col-xs-4 control-label">金额大写:</label>
132
+ <div class="col-xs-8">
133
+ <input class="form-control input_view" style=""
134
+ v-model="payment.f_amount_words"
135
+ :value="smalltoBIG(payment.f_charge_money)"
136
+ :readonly="true"/>
137
+ </div>
138
+ </div>
139
+ </div>
140
+ <!-- <div class="row" style="display: flex"> <button type="button" style="margin: 0 auto;" class="btn btn-primary" @click.prevent="addPaymentTerms()">增加收费项目</button> </div>-->
141
+ </article>
142
+ <footer slot="modal-footer" class="modal-footer">
143
+ <button type="button" class="btn btn-primary" @click.prevent="openQrCode()">确认</button>
144
+ </footer>
145
+ </modal>
146
+
147
+ <modal :show.sync="showQrCode" v-ref:qrcodemodal :large="true" :backdrop="false" style="height: 100%">
148
+ <header slot="modal-header" class="modal-header">
149
+ <h4 class="modal-title">{{title1}}扫码支付</h4>
150
+ </header>
151
+ <article slot="modal-body" class="modal-body clearfix">
152
+ <div class="text-center">
153
+ <p><b>收费金额:{{ getTotalAmount() }}¥</b></p>
154
+ <p><b>收费项目:{{ getPaymentTerm() }}</b></p>
155
+ <div id="qrcode" class="qrcode" v-ref:qrcode></div>
156
+ <p>
157
+ 等待支付,剩余&ensp;<span style="color: #ff791a">{{timeLeft}}</span>&ensp;秒
158
+ </p>
159
+ <button type="button" @click="closeQRCode">取消支付</button>
160
+ </div>
161
+ </article>
162
+ <footer slot="modal-footer"></footer>
163
+ </modal>
164
+ </div>
165
+ </template>
166
+ <script>
167
+ import {getNowDate,isEmpty} from '../Util'
168
+ import {PagedList} from 'vue-client'
169
+ import {HttpResetClass} from 'vue-client'
170
+ import QRCode from 'qrcodejs2'
171
+ import Vue from "vue";
172
+
173
+ export default {
174
+ title: '收费管理',
175
+ props: {
176
+ selectdata: {
177
+ type: Object
178
+ },
179
+ mark: {
180
+ type: Number,
181
+ default: 0
182
+ }
183
+ },
184
+ data () {
185
+ return {
186
+ showCharge: false, // 收费明细
187
+ showCharge1:false, // 付款方式
188
+ showQrCode : false, // 二维码
189
+ model: {
190
+ rows: null
191
+ }, // 记录
192
+ useraddresList: [], // 地址列表
193
+ /*charge: {
194
+
195
+ },*/
196
+ charge: {
197
+ payment_terms:[{f_payment_term: '',f_charge_money: '',f_amount_words:'',f_payment_method : ''}]
198
+ },
199
+ order: {},
200
+ timeLeft: 300,
201
+ paymentInterval: null,
202
+ orderInterval: null,
203
+ filiale:"",
204
+ config: {
205
+
206
+ },
207
+ title1:'',
208
+ // 收费编号
209
+ f_charge_number:'',
210
+ state:'结束'
211
+ }
212
+ },
213
+ ready () {
214
+ this.search()
215
+ },
216
+ methods: {
217
+ addPaymentTerms(){
218
+ this.charge.payment_terms.push({f_payment_term: '',f_charge_money: '',f_payment_method : this.charge.f_payment_method})
219
+ },
220
+ // 新增收费
221
+ /*async saveCharge() {
222
+ let http = new HttpResetClass()
223
+ let data = {
224
+ apply: this.selectdata,
225
+ charge: this.charge,
226
+ user: Vue.user,
227
+ f_out_trade_no:this.order.f_out_trade_no
228
+ }
229
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/appaddApplyChargeRecord`, {data:data}, {
230
+ resolveMsg: null,
231
+ rejectMsg: '缴费失败!!!'
232
+ })
233
+ this.selectdata = res.data
234
+
235
+ this.$dispatch('breakControl')
236
+ },*/
237
+ // 获取订单信息
238
+ getOrderInformation () {
239
+ this.state = '开始'
240
+ // 查询订单信息
241
+ console.log('查询订单信息!!!')
242
+ // 查询订单状态
243
+ try {
244
+ let http = new HttpResetClass()
245
+ let res = http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`, {
246
+ data: {
247
+ tablename: "t_weixinreturnxml",
248
+ condition: ` f_out_trade_no = '${this.order.f_out_trade_no}' and f_order_state = '已支付' `,
249
+ }
250
+ }, {
251
+ resolveMsg: null,
252
+ rejectMsg: '订单查询失败!!!'
253
+ })
254
+ console.log('8888888888')
255
+ console.log(this.order.f_out_trade_no)
256
+ console.log(JSON.stringify(res))
257
+ // 支付成功
258
+ if (res.data.length > 0) {
259
+ this.$showMessage('支付成功!!!')
260
+ clearTimeout(this.paymentInterval)
261
+ clearTimeout(this.orderInterval)
262
+ this.timeLeft = 300
263
+ // 修改支付状态
264
+ this.updatestate('支付成功','有效')
265
+ this.saveother()
266
+ // 清除二维码
267
+ this.clearQrCode()
268
+ this.showQrCode = false
269
+ }
270
+ }catch (e){
271
+ this.state = '结束'
272
+ }
273
+ this.state = '结束'
274
+ },
275
+ checkApplyModel(){
276
+ console.log(this.charge.payment_terms)
277
+ for(let row = 0;row<this.charge.payment_terms.length; row++){
278
+ console.log(this.charge.payment_terms[row])
279
+ if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
280
+ console.log(1111)
281
+ this.$showMessage('请选择收费项目!!!', 'warning', 3000)
282
+ return
283
+ }else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
284
+ console.log(2222)
285
+ this.$showMessage('请输入收费金额!!!', 'warning', 3000)
286
+ return
287
+ }
288
+ }
289
+ this.showCharge=false
290
+ this.$dispatch('changeShowfei','待付款')
291
+ },
292
+ // 打开二维码
293
+ async openQrCode () {
294
+ console.log(this.charge.payment_terms)
295
+ let http = new HttpResetClass()
296
+ for(let row = 0;row<this.charge.payment_terms.length; row++){
297
+ console.log(this.charge.payment_terms[row])
298
+ if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
299
+ console.log(1111)
300
+ this.$showMessage('请选择收费项目!!!', 'warning', 3000)
301
+ return
302
+ }else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
303
+ console.log(2222)
304
+ this.$showMessage('请输入收费金额!!!', 'warning', 3000)
305
+ return
306
+ }
307
+ }
308
+
309
+ if (this.charge.f_payment_method !== '微信支付' && this.charge.f_payment_method !== '支付宝支付' ){
310
+ let info = {
311
+ apply: this.selectdata,
312
+ charge: this.charge,
313
+ user: Vue.user,
314
+ f_out_trade_no:""
315
+ }
316
+ let data1 = {
317
+ tablename: 't_userinfo',
318
+ condition: `f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
319
+ }
320
+ await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data1}, {resolveMsg: null, rejectMsg: '获取数据失败'}).then(res1=>{
321
+ this.$showMessage( `确认对${res1.data[0].f_user_name}进行${this.charge.f_payment_method}收费?`,['confirm', 'cancel']).then((res)=>{
322
+ if (res=='confirm'){
323
+ http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/beforeAddChargeRecord`,{data:info},{
324
+ resolveMsg: null,
325
+ rejectMsg: null
326
+ }).then(async (res)=>{
327
+ console.log(res.data)
328
+ if (res.data.code == '200') {
329
+ this.$showMessage('缴费成功!')
330
+ this.saveother()
331
+ this.search()
332
+ this.showCharge=false
333
+ }
334
+ })
335
+ }
336
+ })
337
+ })
338
+ return
339
+ }
340
+ if (this.charge.f_payment_method == '微信支付'){
341
+ this.title1 = '微信'
342
+ }
343
+ if (this.charge.f_payment_method == '支付宝支付'){
344
+ this.title1 = '支付宝'
345
+ }
346
+ this.showCharge=false
347
+ //this.$dispatch('changeShowfei','待付款')
348
+ //this.saveCharge()
349
+ // 接口金额 单位为:分
350
+ let data = {
351
+ money: this.accMul(this.getTotalAmount() ,1) + '',
352
+ attach: {
353
+ "f_apply_num": this.selectdata.f_apply_num,
354
+ "f_user": Vue.user.id
355
+ },
356
+ orderType:'报装收费',
357
+ userfilesid:'',
358
+ flag: 'JsApiWeiNan',
359
+ openid: '',
360
+ filiale: 'weinanchengtou'
361
+ }
362
+ console.log('下单信息')
363
+ console.log(JSON.stringify(data))
364
+ // 下订单
365
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/jsApiPay`, data, {
366
+ resolveMsg: null,
367
+ rejectMsg: '订单生成失败!!!'
368
+ }).then(
369
+ res=>{
370
+ console.log('=================================')
371
+ console.log("数据测试"+JSON.stringify(res.data))
372
+ this.order = res.data
373
+ console.log("数据测试"+this.order)
374
+ let info = {
375
+ apply: this.selectdata,
376
+ charge: this.charge,
377
+ user: Vue.user,
378
+ f_out_trade_no:this.order.f_out_trade_no
379
+ }
380
+ http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/beforeAddChargeRecord`,{data:info},{
381
+ resolveMsg: null,
382
+ rejectMsg: null
383
+ }).then(ress=>{
384
+ console.log('ress',ress)
385
+ if(ress.data.code == '200'){
386
+ this.f_charge_number = ress.data.f_charge_number
387
+ this.showQrCode = true
388
+ this.$nextTick(()=>{
389
+ this.qrcode()
390
+ })
391
+ // 剩余支付时间
392
+ this.paymentInterval = setInterval(() => {
393
+ this.timeLeft = this.timeLeft - 1
394
+ },1000)
395
+
396
+ // 3秒查询一次订单支付信息
397
+ this.orderInterval = setInterval(() => {
398
+ if(this.state == '结束'){
399
+ this.getOrderInformation()
400
+ }
401
+ },3000)
402
+ }else{
403
+ this.$showMessage('订单生成失败')
404
+ }
405
+ })
406
+ }
407
+ )
408
+ },
409
+ accMul(arg1,arg2) {
410
+ let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
411
+ try {
412
+ m += s1.split(".")[1].length
413
+ } catch (e) {
414
+ }
415
+ try {
416
+ m += s2.split(".")[1].length
417
+ } catch (e) {
418
+ }
419
+ return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
420
+ },
421
+ getTotalAmount(){
422
+ let money=0
423
+ this.charge.payment_terms.forEach((row)=>{
424
+ money = Math.floor((Number(money)+Number(row.f_charge_money)) * 100) / 100
425
+ })
426
+ return money
427
+ },
428
+ getPaymentTerm(){
429
+ let term=''
430
+ this.charge.payment_terms.forEach((row)=>{
431
+ term += `${row.f_payment_term} `
432
+ })
433
+ return term
434
+ },
435
+ qrcode () {
436
+ let qrcode = new QRCode('qrcode',{
437
+ text: this.order.appId, // 设置二维码内容或跳转地址
438
+ width: 200, // 设置宽度,单位像素
439
+ height: 200, // 设置高度,单位像素
440
+ correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
441
+ })
442
+ },
443
+ clearQrCode () {
444
+ document.getElementById('qrcode').innerHTML = ''
445
+ },
446
+ moneyChange (index) {
447
+ console.log(`当前下标----${index}`)
448
+ if (isEmpty(this.charge.payment_terms[index].f_charge_money) || Number(this.charge.payment_terms[index].f_charge_money) === 0) {
449
+ this.$showMessage('单笔收费不能为0元!!!', 'warning', 3000)
450
+ this.charge.payment_terms[index].f_charge_money = null
451
+ return
452
+ }
453
+
454
+ },
455
+ /*moneyChange () {
456
+ if (isEmpty(this.charge.f_charge_money) || Number(this.charge.f_charge_money) === 0) {
457
+ this.$showAlert('单笔收费不能为0元!!!', 'warning', 3000)
458
+ this.charge.f_charge_money = null
459
+ return
460
+ }
461
+ if (this.selectdata.f_apply_type === '散户集体报建' && Number(this.charge.f_charge_money) > Number(this.charge.f_outstanding_amount)) {
462
+ this.$showAlert('单笔收费不能超过未交金额!!!', 'warning', 3000)
463
+ this.charge.f_charge_money = null
464
+ return
465
+ }
466
+ if (Number(this.charge.f_charge_money) > Number(this.selectdata.f_surplus_money)) {
467
+ this.$showAlert('单笔收费不能超过未交总金额!!!', 'warning', 3000)
468
+ this.charge.f_charge_money = null
469
+ return
470
+ }
471
+ },*/
472
+ // 金额转大写
473
+ handleInput(index) {
474
+ // 通过正则过滤小数点后两位
475
+ console.log('-----------------------')
476
+ this.charge.payment_terms[index].f_charge_money = (this.charge.payment_terms[index].f_charge_money.match(/^\d*(\.?\d{0,2})/g)[0]) || null
477
+ this.charge.payment_terms[index].f_amount_words = this.smalltoBIG( this.charge.payment_terms[index].f_charge_money)
478
+ },
479
+ // 金额转大写
480
+ smalltoBIG(n) {
481
+ let fraction = ['角', '分'];
482
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
483
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
484
+ let head = n < 0 ? '欠' : '';
485
+ n = Math.abs(n);
486
+
487
+ let s = '';
488
+
489
+ for (var i = 0; i < fraction.length; i++) {
490
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
491
+ }
492
+ s = s || '整';
493
+ n = Math.floor(n);
494
+
495
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
496
+ let p = '';
497
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
498
+ p = digit[n % 10] + unit[1][j] + p;
499
+ n = Math.floor(n / 10);
500
+ }
501
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
502
+ }
503
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
504
+ },
505
+ async getUserAddress() {
506
+ let http = new HttpResetClass()
507
+ let data = {}
508
+ let url = null
509
+ if (this.selectdata.f_apply_type === '改管报建' || this.selectdata.f_apply_type === '增容报建' || this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建') {
510
+ data = {
511
+ condition: `ui.f_userinfo_id = ${this.selectdata.f_userinfo_id}`
512
+ }
513
+ url = `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetUserinfos`
514
+ } else {
515
+ data = {
516
+ condition: this.selectdata.f_apply_type === '散户集体报建' ? `nvl(cr.f_cumulative_payment_money, 0) < ${this.selectdata.f_price}` : '1=1',
517
+ f_process_id: this.selectdata.f_process_id
518
+ }
519
+ url = `${this.$androidUtil.getProxyUrl()}/rs/sql/getAddresAndCumulativePayment`
520
+ }
521
+ let res = await http.load('POST', url, {data:data}, {
522
+ resolveMsg: null,
523
+ rejectMsg: '用户获取失败!!!'
524
+ })
525
+
526
+
527
+ this.useraddresList = res.data.map(item => {
528
+ return {
529
+ // 有用户姓名地址后拼接姓名
530
+ label: `${item.f_address} ${isEmpty(item.f_user_name) ? '' : '--- ' + item.f_user_name}`,
531
+ value: item
532
+ }
533
+ })
534
+
535
+ },
536
+ async showChargeModal() {
537
+ let http = new HttpResetClass()
538
+ let data = {
539
+ condition: " 1=1",
540
+ f_process_id: this.selectdata.f_process_id
541
+ }
542
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
543
+ resolveMsg: null,
544
+ rejectMsg: null
545
+ })
546
+ if (res.data[0].f_user_id===null){
547
+ this.$showMessage("请先添加表具信息!!!")
548
+ return
549
+ }
550
+ this.getUserAddress()
551
+ console.log("材料费",this.selectdata.f_cost_sum)
552
+ this.charge.payment_terms[0].f_charge_money = this.selectdata.f_cost_sum
553
+ this.showCharge = true
554
+ },
555
+ async search () {
556
+ let http = new HttpResetClass()
557
+ let data = {
558
+ f_process_id: this.selectdata.f_process_id
559
+ }
560
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyChargeRecord`, {data:data}, {
561
+ resolveMsg: null,
562
+ rejectMsg: '收费记录查询失败!!!'
563
+ })
564
+ this.model.rows = res.data
565
+ },
566
+ // 关闭对话框
567
+ closeModal () {
568
+ this.showCharge = false
569
+ this.showInvalid = false
570
+ this.showPrint = false
571
+ this.charge = {
572
+ payment_terms:[{f_payment_term: '',f_charge_money: '',f_amount_words:'',f_payment_method : this.charge.f_payment_method}]
573
+ }
574
+ this.search()
575
+ },
576
+ closeQRCode(){
577
+ clearTimeout(this.paymentInterval)
578
+ clearTimeout(this.orderInterval)
579
+ this.timeLeft = 300
580
+ // 修改支付状态
581
+ this.updatestate('支付失败','无效')
582
+ this.closeOrder()
583
+ // 清除二维码
584
+ this.clearQrCode()
585
+ this.showQrCode = false
586
+ },
587
+ async updatestate(state,state1){
588
+ let data = {
589
+ state1:state1,
590
+ f_charge_number:this.f_charge_number,
591
+ f_paystate:state
592
+ }
593
+ let http = new HttpResetClass()
594
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/updatestate`, {data:data}, {
595
+ resolveMsg: null,
596
+ rejectMsg: '修改失败!!!'
597
+ })
598
+ this.search()
599
+ },
600
+ async closeOrder(){
601
+ let data = {
602
+ "flag":"JsApiWeiNan",
603
+ "f_filiale": "weinanchengtou",
604
+ "f_out_trade_no": this.order.f_out_trade_no,// 商户单号
605
+ "isClose":"是",
606
+ "f_sys_trace":this.order.f_sys_trace // 交易流水号
607
+ }
608
+ let http = new HttpResetClass()
609
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/microPayOrderStatus`, data, {
610
+ resolveMsg: null,
611
+ rejectMsg: '关闭失败!!!'
612
+ })
613
+ },
614
+ async saveother(){
615
+ let http = new HttpResetClass()
616
+ let data = {
617
+ condition: " 1=1",
618
+ f_process_id: this.selectdata.f_process_id
619
+ }
620
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
621
+ resolveMsg: null,
622
+ rejectMsg: null
623
+ })
624
+ let data1 = {
625
+ tablename: 't_material_charges',
626
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
627
+ }
628
+ let res1 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data1}, {resolveMsg: null, rejectMsg: '获取数据失败'})
629
+
630
+ let otherdetails = []
631
+ for(let i=0;i<res1.data.length;i++){
632
+ otherdetails.push(
633
+ {
634
+ "f_brand_spec":[res1.data[i].f_material_name],
635
+ "f_unitprice":res1.data[i].f_material_price,
636
+ "f_typename":[res1.data[i].f_typename],
637
+ "f_typenumber":[res1.data[i].f_typenumber],
638
+ "f_number":res1.data[i].f_material_number
639
+ }
640
+ )
641
+ }
642
+ console.log("查询的用户信息",otherdetails)
643
+ let data2 = {
644
+ "record_userinfo":res.data[0].f_userinfo_id,
645
+ "f_userfiles_id":res.data[0].f_userfiles_id,
646
+ "f_user_id":res.data[0].f_user_id,
647
+ "f_user_name":res.data[0].f_user_name,
648
+ "f_address":res.data[0].f_address,
649
+ "f_user_type":this.selectdata.f_user_type,
650
+ "f_gasproperties":"",
651
+ "f_collection":this.selectdata.f_cost_sum,
652
+ "f_comments":"",
653
+ "f_payment":this.charge.f_payment_method,
654
+ "f_voucher_number":this.order.f_out_trade_no,
655
+ "f_bill_style":"普通收据",
656
+ "f_userinfo_id":res.data[0].f_userinfo_id,
657
+ "f_service_person":Vue.user.name,
658
+ "f_operat_type":"其他收费",
659
+ "f_describe":"",
660
+ "f_state":"有效",
661
+ "f_operator":Vue.user.name,
662
+ "f_operatorid":Vue.user.id,
663
+ "f_orgid":Vue.user.orgid,
664
+ "f_orgname":Vue.user.orgs,
665
+ "f_depid":Vue.user.depids,
666
+ "f_depname":Vue.user.f_department_name,
667
+ "t_userfees":"",
668
+ "f_fee_type":"其他费用",
669
+ "f_fee_time":"12",
670
+ "otherdetail":otherdetails
671
+ }
672
+ let res2 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/sale_othercharge_logic`, {data: data2}, {resolveMsg: null, rejectMsg: '保存数据失败'})
673
+ }
674
+ // async getConfig () {
675
+ // let http = new HttpResetClass()
676
+ // let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/getWeiXinConfig`, null, {
677
+ // resolveMsg: null,
678
+ // rejectMsg: '获取配置失败!!!'
679
+ // })
680
+ //
681
+ // console.log('==============================')
682
+ // console.log(res.data)
683
+ //
684
+ // this.config = res.data
685
+ //
686
+ // this.timeLeft = 120
687
+ // },
688
+ },
689
+ events: {
690
+ },
691
+ computed: {
692
+ paymentMethod() {
693
+ return this.$appdata.getParam("付款方式")
694
+ },
695
+ paymentTerm() {
696
+ return this.$appdata.getParam("收费项目")
697
+ //return [{label: '安装费', value: '安装费'}]
698
+ }
699
+ },
700
+ watch: {
701
+ timeLeft () {
702
+ if (this.timeLeft <= 0) {
703
+ clearTimeout(this.paymentInterval)
704
+ clearTimeout(this.orderInterval)
705
+
706
+ this.timeLeft = 300
707
+ // 修改支付状态
708
+ this.updatestate('支付失败','无效')
709
+ this.closeOrder()
710
+ // 清除二维码
711
+ this.clearQrCode()
712
+
713
+ this.showQrCode = false
714
+
715
+ this.$showMessage('订单支付超时!!!,如果已支付成功,我们将在1-2两个工作日内退款')
716
+ }
717
+ },
718
+ /*'selectdata.showfei' (val){
719
+ console.log('---------'+val)
720
+ if(val=='收款码'){
721
+ this.openQrCode()
722
+ }
723
+ }*/
724
+ }
725
+ }
726
+ </script>
727
+ <style scoped lang="less">
728
+ .qrcode {
729
+ display: inline-block !important;
730
+ margin: 10px 0px;
731
+ }
732
+ .panel-self{
733
+ border-radius: 10px;
734
+ border:1px solid #499EDF;
735
+ background-color: #F8F8F8;
736
+ }
737
+ .vertical-center {
738
+ display: flex;
739
+ align-items: center;
740
+ text-align: center;
741
+ }
742
+ /*清除model中的浮动*/
743
+ .clearfix:after,.clearfix:before{
744
+ display: table;
745
+ }
746
+ .clearfix:after{
747
+ clear: both;
748
+ }
749
+ </style>