telephone-clients 4.0.0-1-10 → 4.0.0-1-12

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,856 @@
1
+ <template>
2
+ <work-busy :is-busy="button_state"></work-busy>
3
+ <div v-for="(i, item) in material " class="y-form">
4
+ <div class="y-form-head">
5
+ <span style="text-align: center">材料{{ $index + 1 }}信息</span>
6
+ <button
7
+ style="float: right"
8
+ class="button_delete button_spacing"
9
+ v-if="i>0"
10
+ @click.prevent="deleteUserFile(i)"
11
+ >删除
12
+ </button>
13
+ </div>
14
+
15
+ <div class="y-form-item">
16
+ <label>材料分类</label>
17
+ <input-select
18
+ class="select select_list y-form-item-input"
19
+ :value.sync="item.f_typename"
20
+ v-model="item.f_typename"
21
+ :options="category.options"
22
+ @change="item.f_material_name = undefined, item.f_typenumber = undefined"
23
+ :valueSingle="true">
24
+ </input-select>
25
+ </div>
26
+
27
+ <div class="y-form-item">
28
+ <label>材料名称</label>
29
+ <input-select
30
+ class="select select_list y-form-item-input"
31
+ :value.sync="item.f_material_name"
32
+ v-model="item.f_material_name"
33
+ :options="category.children[item.f_typename].options"
34
+ @change="item.f_typenumber = undefined"
35
+ :valueSingle="true">
36
+ </input-select>
37
+ </div>
38
+ <div class="y-form-item">
39
+ <label>型号</label>
40
+ <input-select
41
+ class="select select_list y-form-item-input"
42
+ :value.sync="item.f_typenumber"
43
+ v-model="item.f_typenumber"
44
+ :options="category.children[item.f_typename].children[item.f_material_name].options"
45
+ :valueSingle="true">
46
+ </input-select>
47
+ </div>
48
+ <div class="y-form-item">
49
+ <label>单价(元/{{
50
+ category.children[item.f_typename].children[item.f_material_name].children[item.f_typenumber].unit
51
+ }})</label>
52
+ <input type="number" class="form-control y-form-item-input" v-model="item.f_material_price"
53
+ :value="category.children[item.f_typename].children[item.f_material_name].children[item.f_typenumber].price"
54
+ readonly>
55
+ </div>
56
+ <div class="y-form-item">
57
+ <label>数量</label>
58
+ <input type="number" class="form-control y-form-item-input" v-model="item.f_material_number">
59
+ </div>
60
+ <div class="y-form-item">
61
+ <label>金额</label>
62
+ <input type="number" class="form-control y-form-item-input" v-model="item.f_fee"
63
+ :value="smallnum(item.f_material_price,item.f_material_number)" readonly>
64
+ </div>
65
+ <div class="y-form-item">
66
+ <label>备注</label>
67
+ <textarea type="text" rows="2" class="form-control y-form-item-input" v-model="item.f_remarks"></textarea>
68
+ </div>
69
+ </div>
70
+ <div style="padding: 10px;display: flex;justify-content: space-around;">
71
+ <button type="button" class="btn btn-primary" @click="addUserFile">添加</button>
72
+ <button type="button" class="btn btn-primary" @click="showQrcodeButton">保存</button>
73
+ </div>
74
+ <div v-show="showQrCode">
75
+ <div class="row">
76
+ <label class="text-justify lb-left" style="width: 100px">收款</label>
77
+ <div class="row row_sty">
78
+ <label class="lab_sty col-xs-4">合计金额</label>
79
+ <div class="col-xs-8">
80
+ <input type="number" class="form-control" v-model="payNumber" :value.sync="payNumber" readonly>
81
+ </div>
82
+ </div>
83
+ <div class="row row_sty">
84
+ <label class="lab_sty col-xs-4">收款方式</label>
85
+ <div class="col-xs-8">
86
+ <v-select
87
+ :width="'100%'"
88
+ :value.sync="payType"
89
+ v-model="payType"
90
+ :options='payTypes'
91
+ placeholder='请选择'
92
+ close-on-select
93
+ :value-single="true"
94
+ ></v-select>
95
+ </div>
96
+ </div>
97
+ <div v-if="zfCode" style="margin-top: 20px; text-align: center;">
98
+ <div id="qrcode" style="margin-top: 25px;width: 266px;height: 266px"></div>
99
+ </div>
100
+ </div>
101
+ <div style="padding: 10px;display: flex;justify-content: space-around;">
102
+ <button type="button" name="button" class="btn btn-primary btn-sm" style="float: right;margin-right:10px;"
103
+ @click="beforeSaveCharge()">收费
104
+ </button>
105
+ <button type="button" class="btn btn-primary" @click="cancel">取消</button>
106
+ </div>
107
+ </div>
108
+ </template>
109
+ <script>
110
+ import Vue from 'vue'
111
+ import {HttpResetClass} from 'vue-client'
112
+ import QRCode from 'qrcodejs2'
113
+ import {getNowDate, isEmpty} from '../../../components/Util'
114
+
115
+ export default {
116
+ title: '材料添加',
117
+ props: {
118
+ selectdata: {
119
+ type: Object
120
+ }
121
+ },
122
+ data() {
123
+ return {
124
+ othercharge_id: '',
125
+ payState: false,
126
+ zfCode: false,
127
+ f_out_trade_no: '',
128
+ payTypes: this.$appdata.getParam('材料收费方式'),
129
+ payType: '',
130
+ payNumber: 0,
131
+ button_state: false,
132
+ category: {},
133
+ showFile: false,
134
+ material: [],
135
+ positions: this.$appdata.getParam('品名及规格'), // 获取材料名称
136
+ charge: {
137
+ payment_terms: [{f_payment_term: '', f_charge_money: '', f_amount_words: '', f_payment_method: ''}]
138
+ }, // 收费内容
139
+ showCharge: false, // 收费显示
140
+ timeLeft: 300, // 收费时间
141
+ title1: '', // 二维码标题
142
+ showQrCode: false, // 二维码显示
143
+ order: {}, // 订单信息
144
+ f_cost_sum: 0, // 总收费
145
+ }
146
+ },
147
+ ready() {
148
+ this.loadOptions()
149
+ },
150
+ methods: {
151
+ cancel() {
152
+ this.payNumber = 0
153
+ this.othercharge_id = ''
154
+ this.payState = false
155
+ this.zfCode = false
156
+ this.showQrCode = false
157
+ clearTimeout(this.orderInterval)
158
+ },
159
+ getChangePayNumber() {
160
+ this.payNumber = 0
161
+ for (let i = 0; i < this.material.length; i++) {
162
+ this.material[i].f_fee = this.material[i].f_material_price * this.material[i].f_material_number
163
+ this.payNumber += Number(this.material[i].f_fee)
164
+ }
165
+ },
166
+ showQrcodeButton() {
167
+ this.getChangePayNumber()
168
+ this.showQrCode = true
169
+ },
170
+ loadOptions() {
171
+ const data = {
172
+ tablename: 't_material_info',
173
+ condition: `org_id = '${Vue.user.orgid}'`
174
+ }
175
+ this.$resetpost(this.$androidUtil.getProxyUrl() + '/af-telephone/rs/sql/tel_singleTable', {data}, {
176
+ resolveMsg: null,
177
+ rejectMsg: '获取数据失败'
178
+ }).then((res) => {
179
+ const categories = []
180
+ const materials = []
181
+ const types = []
182
+ for (let material of res.data) {
183
+ if (material.type == '分类') {
184
+ categories.push(material)
185
+ } else if (material.type == '品名') {
186
+ materials.push(material)
187
+ } else if (material.type == '型号') {
188
+ types.push(material)
189
+ }
190
+ }
191
+ this.category.options = []
192
+ for (let category of categories) {
193
+ this.category.options.push({
194
+ label: category.name,
195
+ value: category.name
196
+ })
197
+ }
198
+
199
+ this.category.children = {}
200
+ for (let category of categories) {
201
+ this.category.children[category.name] = {}
202
+
203
+ this.category.children[category.name].options = []
204
+ this.category.children[category.name].children = {}
205
+ for (let material of materials) {
206
+ if (material.parent_id == category.id) {
207
+ this.category.children[category.name].options.push({
208
+ label: material.name,
209
+ value: material.name
210
+ })
211
+
212
+ this.category.children[category.name].children[material.name] = {}
213
+
214
+ this.category.children[category.name].children[material.name].options = []
215
+ this.category.children[category.name].children[material.name].children = {}
216
+ for (let type of types) {
217
+ if (type.parent_id == material.id) {
218
+ this.category.children[category.name].children[material.name].options.push({
219
+ label: type.name,
220
+ value: type.name
221
+ })
222
+ this.category.children[category.name].children[material.name].children[type.name] = type
223
+ }
224
+ }
225
+ }
226
+ }
227
+ }
228
+ console.log('this.category=', JSON.stringify(this.category))
229
+ this.search()
230
+ })
231
+ },
232
+ // 删除未保存的材料信息
233
+ async deleteUserFile(index) {
234
+ this.material.splice(index, 1)
235
+ this.cancel()
236
+ },
237
+ // 追加材料信息
238
+ addUserFile() {
239
+ this.material.push({})
240
+ this, this.cancel()
241
+ },
242
+ search() {
243
+ let http = new HttpResetClass()
244
+ let data = {
245
+ tablename: 't_material_service',
246
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
247
+ }
248
+ http.load('post', this.$androidUtil.getProxyUrl() + '/af-telephone/rs/sql/tel_singleTable', {data: data}, {
249
+ resolveMsg: null,
250
+ rejectMsg: '获取数据失败'
251
+ }).then(res => {
252
+ this.material = res.data
253
+ if (this.material.length <= 0) {
254
+ this.material = [{}]
255
+ }
256
+ })
257
+ },
258
+ // 获取品名规格
259
+ // setTypename(i, val) {
260
+ // let ac = this.$appdata.getParam(val)
261
+ // this.$set('material[' + i + '].typeNameList', ac)
262
+ // this.$set('material[' + i + '].typeNumberList', [])
263
+ // this.$set('material[' + i + '].f_typenumber', null)
264
+ // this.$set('material[' + i + '].f_material_price', 0)
265
+ // },
266
+ // 获取类型
267
+ // setTypenumber(i, val) {
268
+ // let ac = this.$appdata.getParam(val)
269
+ // this.$set('material[' + i + '].typeNumberList', ac)
270
+ // this.$set('material[' + i + '].f_material_price', 0)
271
+ // },
272
+ // 获取单价
273
+ // setmaterialprice(i, val) {
274
+ // var num
275
+ // if (val == null) {
276
+ // num = 0
277
+ // }
278
+ // num = this.$appdata.getSingleValue(val)
279
+ // this.$set('material[' + i + '].f_material_price', num)
280
+ // },
281
+ // 金额计算
282
+ smallnum(val, val1) {
283
+ let num = Number(val) * Number(val1)
284
+ return num
285
+ },
286
+ qrcode(url) {
287
+ new QRCode('qrcode', {
288
+ text: url, // 设置二维码内容或跳转地址
289
+ width: 266, // 设置宽度,单位像素
290
+ height: 266, // 设置高度,单位像素
291
+ correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
292
+ })
293
+ },
294
+ clearQrCode() {
295
+ if (document.getElementById('qrcode')) {
296
+ document.getElementById('qrcode').innerHTML = ''
297
+ }
298
+ },
299
+ async getOrderInformation() {
300
+ // 查询订单信息
301
+ console.log('查询订单信息!!!')
302
+ let http = new HttpResetClass()
303
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/weixin/orderStatus`, {
304
+ "f_filiale": "wensuxilong",
305
+ "out_trade_no": `${this.f_out_trade_no}`
306
+ }, {
307
+ resolveMsg: null,
308
+ rejectMsg: '订单查询失败!!!'
309
+ })
310
+ // 支付成功
311
+ if (res.data.trade_state_desc.includes('成功')) {
312
+ this.$showMessage('支付成功!!!')
313
+ await this.saveUserFile('save')
314
+ this.clearQrCode()
315
+ this.cancel()
316
+ }
317
+ },
318
+ async openQrcode() {
319
+ this.clearQrCode()
320
+ let data = {
321
+ tablename: 't_userfiles',
322
+ condition: `f_userinfo_id = '${this.selectdata.model.f_userinfo_id}'`
323
+ }
324
+ let res = await new HttpResetClass().load('post', this.$androidUtil.getProxyUrl() + '/af-telephone/rs/sql/tel_singleTable', {data: data}, {
325
+ resolveMsg: null,
326
+ rejectMsg: '获取数据失败'
327
+ })
328
+ let reqdata = {
329
+ "filiale": "wensuxilong",
330
+ "money": 1,
331
+ "str": "材料收费",
332
+ "attach": {
333
+ "f_userfiles_id": res.data[0].f_userfiles_id,
334
+ "f_userinfo_id": this.selectdata.model.f_userinfo_id
335
+ }
336
+ }
337
+ new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/weixin/gasgetcode`, reqdata).then(res => {
338
+ if (res.data.code === 200) {
339
+ this.f_out_trade_no = res.data.out_trade_no
340
+ this.zfCode = true
341
+ this.$nextTick(() => {
342
+ this.qrcode(res.data.url)
343
+ })
344
+ this.orderInterval = setInterval(() => {
345
+ this.getOrderInformation()
346
+ }, 3000)
347
+ } else {
348
+ this.$showMessage('网络异常。。。')
349
+ }
350
+ })
351
+ },
352
+ async beforeSaveCharge() {
353
+
354
+
355
+ if (this.material.length == 0) {
356
+ return this.$showMessage(`请先添加消耗的材料!`)
357
+ }
358
+ for (let index = 0; index < this.material.length; index++) {
359
+ const item = this.material[index]
360
+ if (!item.f_material_name) {
361
+ this.$showMessage(`请选择材料${index + 1}的材料名称`)
362
+ return;
363
+ }
364
+ if (!item.f_typenumber) {
365
+ this.$showMessage(`请选择材料${index + 1}的型号`)
366
+ return;
367
+ }
368
+ if (!item.f_material_price) {
369
+ this.$showMessage(`请填写材料${index + 1}的单价`)
370
+ return;
371
+ }
372
+ if (!item.f_material_number || item.f_material_number == 0) {
373
+ this.$showMessage(`请填写材料${index + 1}的数量`)
374
+ return;
375
+ }
376
+ }
377
+ if (!this.payType) {
378
+ this.$showMessage(`请选择缴费方式`)
379
+ return;
380
+ }
381
+ if (this.payType.includes('二维码') && this.payNumber>0) {
382
+ await this.openQrcode()
383
+ } else {
384
+ await this.saveUserFile('save')
385
+ }
386
+ },
387
+ async saveUserFile(type) {
388
+ for (let i = 0; i < this.material.length; i++) {
389
+ this.material[i].f_process_id = this.selectdata.f_process_id
390
+ this.material[i].f_department = Vue.user.f_department_name
391
+ this.material[i].f_fee = this.material[i].f_material_price * this.material[i].f_material_number
392
+ if (isEmpty(this.material[i].f_state)) {
393
+ this.material[i].f_state = null
394
+ }
395
+ }
396
+ await this.saveOrder(type)
397
+ },
398
+ async saveOrder(type) {
399
+ console.log('this.material', this.material)
400
+ let otherdetail = []
401
+ if (this.payNumber == 0) {
402
+ otherdetail.push({
403
+ f_brand_spec: ['维修'],
404
+ f_typename: ['材料费'],
405
+ f_typenumber: [],
406
+ f_unitprice: 0,
407
+ f_number: this.material.length
408
+ })
409
+ } else {
410
+ this.material.forEach((row) => {
411
+ if (row.f_material_price != 0) {
412
+ otherdetail.push({
413
+ f_brand_spec: ['维修'],
414
+ f_typename: [`${row.material_type ? row.material_type : '材料费'}`],
415
+ f_typenumber: [],
416
+ f_unitprice: row.f_material_price,
417
+ f_number: row.f_material_number
418
+ })
419
+ }
420
+ })
421
+ }
422
+ if (this.payState) {
423
+ let other = {
424
+ "record_userinfo": this.selectdata.model.f_userinfo_id,
425
+ //"f_userfiles_id": '',
426
+ //"f_user_id": '',
427
+ "f_user_name": this.selectdata.model.f_user_name,
428
+ "f_address": this.selectdata.model.f_address,
429
+ "f_user_type": this.selectdata.model.f_user_type,
430
+ "f_gasproperties": "",
431
+ "f_collection": this.payNumber,
432
+ "f_comments": `${Vue.user.name}进行维修材料收费,收费方式-${this.payType} ${this.order.body && this.order.body.tradeNo ? '。支付订单号:' + this.order.body.tradeNo : ''}`,
433
+ "f_payment": this.payType,
434
+ "f_voucher_number": this.selectdata.f_process_id,
435
+ "f_bill_style": "普通收据",
436
+ "f_userinfo_id": this.selectdata.model.f_userinfo_id,
437
+ "f_service_person": Vue.user.name,
438
+ "f_operat_type": "维修收费",
439
+ "f_describe": "",
440
+ "f_serial_id": this.order.body ? this.order.body.tradeNo : null,
441
+ "f_state": '有效',
442
+ "f_operator": Vue.user.name,
443
+ "f_operatorid": Vue.user.id,
444
+ "f_orgid": Vue.user.orgid,
445
+ "f_orgname": Vue.user.orgs,
446
+ "f_depid": Vue.user.depids,
447
+ "f_depname": Vue.user.f_department_name,
448
+ "t_userfees": "",
449
+ "f_fee_type": "维修费用",
450
+ "f_fee_time": "12",
451
+ "otherdetail": otherdetail
452
+ }
453
+ console.log("缴费记录保存", other)
454
+ let res1 = await new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/sale_othercharge_logic`, other, {
455
+ resolveMsg: null,
456
+ rejectMsg: null
457
+ })
458
+ this.othercharge_id = res1.data.othercharge_id
459
+ }
460
+
461
+ let param = {
462
+ model: this.material,
463
+ operator_type: type,
464
+ othercharge_id: this.othercharge_id,
465
+ f_process_id: this.selectdata.f_process_id,
466
+ f_userinfo_id: this.selectdata.model.f_userinfo_id
467
+ }
468
+ console.log("材料收费保存", param)
469
+ let res = await new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/saveMaterialService`, param, {
470
+ resolveMsg: null,
471
+ rejectMsg: null
472
+ })
473
+ if (res.data.code == 200) {
474
+ if (type === 'create') {
475
+ // this.$showMessage('收费记录创建成功!!!')
476
+ // this.othercharge_id = res.data.othercharge_id
477
+ // this.$emit('aftersave')
478
+ } else {
479
+ this.$showMessage('材料保存成功!!!')
480
+ this.$emit('aftersave')
481
+ }
482
+
483
+
484
+ } else {
485
+ this.$showMessage(res.data.msg)
486
+ }
487
+ },
488
+ // 关闭对话框
489
+ // closeModal() {
490
+ // this.showCharge = false
491
+ // this.charge = {
492
+ // payment_terms: [{
493
+ // f_payment_term: '',
494
+ // f_charge_money: '',
495
+ // f_amount_words: '',
496
+ // f_payment_method: this.charge.f_payment_method
497
+ // }]
498
+ // }
499
+ // },
500
+ // 金额转大写
501
+ // handleInput(index) {
502
+ // // 通过正则过滤小数点后两位
503
+ // console.log('-----------------------')
504
+ // this.charge.payment_terms[index].f_charge_money = (this.charge.payment_terms[index].f_charge_money.match(/^\d*(\.?\d{0,2})/g)[0]) || null
505
+ // this.charge.payment_terms[index].f_amount_words = this.smalltoBIG(this.charge.payment_terms[index].f_charge_money)
506
+ // },
507
+ // 金额转大写
508
+ // smalltoBIG(n) {
509
+ // let fraction = ['角', '分'];
510
+ // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
511
+ // let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
512
+ // let head = n < 0 ? '欠' : '';
513
+ // n = Math.abs(n);
514
+ //
515
+ // let s = '';
516
+ //
517
+ // for (var i = 0; i < fraction.length; i++) {
518
+ // s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
519
+ // }
520
+ // s = s || '整';
521
+ // n = Math.floor(n);
522
+ //
523
+ // for (var i = 0; i < unit[0].length && n > 0; i++) {
524
+ // let p = '';
525
+ // for (var j = 0; j < unit[1].length && n > 0; j++) {
526
+ // p = digit[n % 10] + unit[1][j] + p;
527
+ // n = Math.floor(n / 10);
528
+ // }
529
+ // s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
530
+ // }
531
+ // return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
532
+ // },
533
+ // moneyChange(index) {
534
+ // console.log(`当前下标----${index}`)
535
+ // if (isEmpty(this.charge.payment_terms[index].f_charge_money) || Number(this.charge.payment_terms[index].f_charge_money) === 0) {
536
+ // this.$showMessage('单笔收费不能为0元!!!', 'warning', 3000)
537
+ // this.charge.payment_terms[index].f_charge_money = null
538
+ // return
539
+ // }
540
+ //
541
+ // },
542
+ // 打开二维码
543
+ // async openQrCode() {
544
+ // let http = new HttpResetClass()
545
+ // for (let row = 0; row < this.charge.payment_terms.length; row++) {
546
+ // console.log(this.charge.payment_terms[row])
547
+ // if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
548
+ // this.$showMessage('请选择收费项目!!!', 'warning', 3000)
549
+ // return
550
+ // } else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
551
+ // this.$showMessage('请输入收费金额!!!', 'warning', 3000)
552
+ // return
553
+ // }
554
+ // }
555
+ // if (this.charge.f_payment_method !== '微信支付' && this.charge.f_payment_method !== '支付宝支付') {
556
+ // this.saveother()
557
+ // this.$showMessage('缴费成功!')
558
+ // this.update()
559
+ // this.showCharge = false
560
+ // return
561
+ // }
562
+ // if (this.charge.f_payment_method == '微信支付') {
563
+ // this.title1 = '微信'
564
+ // }
565
+ // if (this.charge.f_payment_method == '支付宝支付') {
566
+ // this.title1 = '支付宝'
567
+ // }
568
+ // this.showCharge = false
569
+ // // 接口金额 单位为:分
570
+ // let data = {
571
+ // money: this.accMul(this.getTotalAmount(), 1) + '',
572
+ // attach: {
573
+ // "f_user": Vue.user.id,
574
+ // "f_user_name": Vue.user.name
575
+ // },
576
+ // orderType: '工单收费',
577
+ // userfilesid: '',
578
+ // flag: 'JsApiWeiNan',
579
+ // openid: '',
580
+ // filiale: 'weinanchengtou'
581
+ // }
582
+ // // 下订单
583
+ // await http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/jsApiPay`, data, {
584
+ // resolveMsg: null,
585
+ // rejectMsg: '订单生成失败!!!'
586
+ // }).then(
587
+ // res => {
588
+ // this.order = res.data
589
+ // this.showQrCode = true
590
+ // this.$nextTick(() => {
591
+ // this.qrcode()
592
+ // })
593
+ // // 剩余支付时间
594
+ // this.paymentInterval = setInterval(() => {
595
+ // this.timeLeft = this.timeLeft - 1
596
+ // }, 1000)
597
+ //
598
+ // // 3秒查询一次订单支付信息
599
+ // this.orderInterval = setInterval(() => {
600
+ // this.getOrderInformation()
601
+ // }, 3000)
602
+ // }
603
+ // )
604
+ // },
605
+ // getTotalAmount() {
606
+ // let money = 0
607
+ // this.charge.payment_terms.forEach((row) => {
608
+ // money = Math.floor((Number(money) + Number(row.f_charge_money)) * 100) / 100
609
+ // })
610
+ // return money
611
+ // },
612
+ // getPaymentTerm() {
613
+ // let term = ''
614
+ // this.charge.payment_terms.forEach((row) => {
615
+ // term += `${row.f_payment_term} `
616
+ // })
617
+ // return term
618
+ // },
619
+ // closeQRCode() {
620
+ // clearTimeout(this.paymentInterval)
621
+ // clearTimeout(this.orderInterval)
622
+ // this.timeLeft = 300
623
+ // this.closeOrder()
624
+ // // 清除二维码
625
+ // this.clearQrCode()
626
+ // this.showQrCode = false
627
+ // },
628
+ // clearQrCode() {
629
+ // document.getElementById('qrcode').innerHTML = ''
630
+ // },
631
+ // async closeOrder() {
632
+ // let data = {
633
+ // "flag": "JsApiWeiNan",
634
+ // "f_filiale": "weinanchengtou",
635
+ // "f_out_trade_no": this.order.f_out_trade_no,// 商户单号
636
+ // "isClose": "是",
637
+ // "f_sys_trace": this.order.f_sys_trace // 交易流水号
638
+ // }
639
+ // let http = new HttpResetClass()
640
+ // let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/microPayOrderStatus`, data, {
641
+ // resolveMsg: null,
642
+ // rejectMsg: '关闭失败!!!'
643
+ // })
644
+ // },
645
+ // qrcode() {
646
+ // let qrcode = new QRCode('qrcode', {
647
+ // text: this.order.appId, // 设置二维码内容或跳转地址
648
+ // width: 200, // 设置宽度,单位像素
649
+ // height: 200, // 设置高度,单位像素
650
+ // correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
651
+ // })
652
+ // },
653
+ // // 获取订单信息
654
+ // async getOrderInformation() {
655
+ // // 查询订单信息
656
+ // console.log('查询订单信息!!!')
657
+ // let http = new HttpResetClass()
658
+ // let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable`, {
659
+ // data: {
660
+ // tablename: "t_weixinreturnxml",
661
+ // condition: ` f_out_trade_no = '${this.order.f_out_trade_no}' and f_order_state = '已支付' `,
662
+ // }
663
+ // }, {
664
+ // resolveMsg: null,
665
+ // rejectMsg: '订单查询失败!!!'
666
+ // })
667
+ // // 支付成功
668
+ // if (res.data.length > 0) {
669
+ // clearTimeout(this.paymentInterval)
670
+ // clearTimeout(this.orderInterval)
671
+ // this.timeLeft = 300
672
+ // // 修改支付状态
673
+ // this.saveother()
674
+ // this.$showMessage('支付成功!!!')
675
+ // this.update()
676
+ // // 清除二维码
677
+ // this.clearQrCode()
678
+ // this.showQrCode = false
679
+ // }
680
+ // },
681
+ // async update() {
682
+ // let http = new HttpResetClass()
683
+ // for (let i = 0; i < this.material.length; i++) {
684
+ // if (this.material[i].f_state == '未收费') {
685
+ // this.material[i].f_state = '已收费'
686
+ // }
687
+ // }
688
+ // let data = {
689
+ // model: this.material
690
+ // }
691
+ // let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/af-telephone/rs/logic/saveweinanmaterial', {data: data}, {
692
+ // resolveMsg: null,
693
+ // rejectMsg: '保存失败'
694
+ // })
695
+ // this.search()
696
+ // },
697
+ // async saveother() {
698
+ // let http = new HttpResetClass()
699
+ // let data1 = {
700
+ // tablename: 't_material_service',
701
+ // condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
702
+ // }
703
+ // let res1 = await http.load('post', this.$androidUtil.getProxyUrl() + '/af-telephone/rs/sql/tel_singleTable', {data: data1}, {
704
+ // resolveMsg: null,
705
+ // rejectMsg: '获取数据失败'
706
+ // })
707
+ // let data = {
708
+ // tablename: 't_userfiles',
709
+ // condition: `f_userinfo_id = '${this.selectdata.model.f_userinfo_id}'`
710
+ // }
711
+ // let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/af-telephone/rs/sql/tel_singleTable', {data: data}, {
712
+ // resolveMsg: null,
713
+ // rejectMsg: '获取数据失败'
714
+ // })
715
+ // let otherdetails = []
716
+ // for (let i = 0; i < res1.data.length; i++) {
717
+ // otherdetails.push(
718
+ // {
719
+ // "f_brand_spec": [res1.data[i].f_material_name],
720
+ // "f_unitprice": res1.data[i].f_material_price,
721
+ // "f_typename": [res1.data[i].f_typename],
722
+ // "f_typenumber": [res1.data[i].f_typenumber],
723
+ // "f_number": res1.data[i].f_material_number
724
+ // }
725
+ // )
726
+ // }
727
+ //
728
+ // console.log("查询的用户信息", otherdetails)
729
+ // let data2 = {
730
+ // "record_userinfo": this.selectdata.model.f_userinfo_id,
731
+ // "f_userfiles_id": res.data[0].f_userfiles_id,
732
+ // "f_user_id": res.data[0].f_user_id,
733
+ // "f_user_name": this.selectdata.model.f_user_name,
734
+ // "f_address": this.selectdata.model.f_address,
735
+ // "f_user_type": this.selectdata.model.f_user_type,
736
+ // "f_gasproperties": "",
737
+ // "f_collection": this.f_cost_sum,
738
+ // "f_comments": "",
739
+ // "f_payment": this.charge.f_payment_method,
740
+ // "f_voucher_number": "",
741
+ // "f_bill_style": "普通收据",
742
+ // "f_userinfo_id": this.selectdata.model.f_userinfo_id,
743
+ // "f_service_person": Vue.user.name,
744
+ // "f_operat_type": "其他收费",
745
+ // "f_describe": "",
746
+ // "f_state": "有效",
747
+ // "f_operator": Vue.user.name,
748
+ // "f_operatorid": Vue.user.id,
749
+ // "f_orgid": Vue.user.orgid,
750
+ // "f_orgname": Vue.user.orgs,
751
+ // "f_depid": Vue.user.depids,
752
+ // "f_depname": Vue.user.f_department_name,
753
+ // "t_userfees": "",
754
+ // "f_fee_type": "其他费用",
755
+ // "f_fee_time": "12",
756
+ // "otherdetail": otherdetails
757
+ // }
758
+ // let res2 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/logic/sale_othercharge_logic`, {data: data2}, {
759
+ // resolveMsg: null,
760
+ // rejectMsg: '保存数据失败'
761
+ // })
762
+ // },
763
+ // async shoufei() {
764
+ // let http = new HttpResetClass()
765
+ // let data = {
766
+ // tablename: 't_material_service',
767
+ // condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
768
+ // }
769
+ // let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/af-telephone/rs/sql/tel_singleTable', {data: data}, {
770
+ // resolveMsg: null,
771
+ // rejectMsg: '获取数据失败'
772
+ // })
773
+ // if (res.data.length <= 0) {
774
+ // this.$showMessage('请先添加未收费的材料!!!')
775
+ // return
776
+ // }
777
+ // this.f_cost_sum = 0
778
+ // for (let i = 0; i < res.data.length; i++) {
779
+ // this.f_cost_sum += Number(res.data[i].f_fee)
780
+ // }
781
+ // this.showCharge = true
782
+ // this.charge.payment_terms[0].f_charge_money = this.f_cost_sum
783
+ // },
784
+ // accMul(arg1, arg2) {
785
+ // let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
786
+ // try {
787
+ // m += s1.split(".")[1].length
788
+ // } catch (e) {
789
+ // }
790
+ // try {
791
+ // m += s2.split(".")[1].length
792
+ // } catch (e) {
793
+ // }
794
+ // return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
795
+ // },
796
+ },
797
+ events: {},
798
+ computed: {
799
+ paymentMethod() {
800
+ return this.$appdata.getParam("付款方式")
801
+ },
802
+ paymentTerm() {
803
+ return this.$appdata.getParam("收费项目")
804
+ }
805
+ },
806
+ watch: {}
807
+ }
808
+ </script>
809
+ <style lang="less" scoped>
810
+ .head-but {
811
+ margin-left: 5px;
812
+ height: 34px;
813
+ /*background-color: #6aa6e2;*/
814
+ border-radius: 4px;
815
+ font-family: PingFang;
816
+ color: #ffffff;
817
+ }
818
+
819
+ /*清除model中的浮动*/
820
+ .clearfix:after, .clearfix:before {
821
+ display: table;
822
+ }
823
+
824
+ .clearfix:after {
825
+ clear: both;
826
+ }
827
+
828
+ .y-form {
829
+ display: flex;
830
+ flex-flow: column;
831
+ gap: 10px;
832
+ padding: 10px 5px;
833
+
834
+ .y-form-head {
835
+ background-color: #e8f4ff;
836
+ display: flex;
837
+ padding: 10px 20px;
838
+ align-items: center;
839
+ justify-content: space-between;
840
+ }
841
+
842
+ .y-form-item {
843
+ display: flex;
844
+ gap: 10px;
845
+
846
+ label {
847
+ width: 30%;
848
+ text-align: right;
849
+ }
850
+
851
+ .y-form-item-input {
852
+ width: 70%;
853
+ }
854
+ }
855
+ }
856
+ </style>