apply-clients 3.5.4-7 → 3.5.4-71

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 (105) hide show
  1. package/build/dev-server.js +7 -11
  2. package/package.json +2 -2
  3. package/src/App.vue +25 -25
  4. package/src/apply.js +2 -3
  5. package/src/applyAndroid.js +2 -0
  6. package/src/assets//344/270/213/350/275/275.png +0 -0
  7. package/src/components/android/AppCheckTakePic.vue +168 -0
  8. package/src/components/android/Process/AppServiceControl.vue +4 -0
  9. package/src/components/android/Process/Processes/AppAddMaterialScience.vue +493 -493
  10. package/src/components/android/Process/Processes/AppChargeManagementNew.vue +637 -0
  11. package/src/components/android/Process/Processes/AppInstallationDetails.vue +480 -480
  12. package/src/components/image/dxf.png +0 -0
  13. package/src/components/product/Function/Service/FunctionServiceControl.vue +1 -1
  14. package/src/components/product/Material/MaterialDetailed.vue +1 -1
  15. package/src/components/product/MaterialsManage/MaterialsBase.vue +5 -1
  16. package/src/components/product/MaterialsManage/MaterialsManage.vue +2 -2
  17. package/src/components/product/PcZhihuanManagement.vue +160 -0
  18. package/src/components/product/Process/ExplorationSelect.vue +4 -1
  19. package/src/components/product/Process/ExplorationUser.vue +1 -0
  20. package/src/components/product/Process/Processes/addMaterialScience.vue +471 -471
  21. package/src/components/product/Process/Processes/chargeManagement.vue +1 -1
  22. package/src/components/product/ServiceView.vue +22 -1
  23. package/src/components/product/Supervisory/SupervisoryControl.vue +141 -140
  24. package/src/components/product/Supervisory/SupervisoryList.vue +452 -452
  25. package/src/filiale/baiyin/android/AppServiceControl.vue +1762 -0
  26. package/src/filiale/baiyin/android/ByAddMaterialScience.vue +823 -0
  27. package/src/filiale/baiyin/android/ByDeviceManagement.vue +916 -0
  28. package/src/filiale/baiyin/android.js +8 -0
  29. package/src/filiale/fugou/android/AppAddMaterialScience.vue +442 -0
  30. package/src/filiale/fugou/android/AppChargeManagement.vue +126 -12
  31. package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -0
  32. package/src/filiale/fugou/android/AppInstallationDetails.vue +541 -0
  33. package/src/filiale/fugou/android/AppServiceControl.vue +21 -4
  34. package/src/filiale/fugou/android/AppZhihuanManagement.vue +191 -0
  35. package/src/filiale/fugou/android.js +6 -1
  36. package/src/filiale/fugou/pc/ExplorationSelect.vue +515 -0
  37. package/src/filiale/fugou/pc/InstallationDetails.vue +44 -32
  38. package/src/filiale/fugou/pc/ServiceControl.vue +124 -379
  39. package/src/filiale/fugou/pc/addMaterialScience.vue +482 -0
  40. package/src/filiale/fugou/pc/devicesManagement.vue +483 -0
  41. package/src/filiale/fugou/pc.js +4 -1
  42. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +20 -8
  43. package/src/filiale/gongyi/android/AppDisclosurerecord.vue +214 -0
  44. package/src/filiale/gongyi/android/AppInstallationDetails.vue +15 -10
  45. package/src/filiale/gongyi/android/AppLegacyIssues.vue +309 -0
  46. package/src/filiale/gongyi/android/AppSign.vue +16 -3
  47. package/src/filiale/gongyi/android/AppSupplementalAgreement.vue +298 -0
  48. package/src/filiale/gongyi/android.js +3 -0
  49. package/src/filiale/gongyi/pc/ApplyUpload.vue +31 -39
  50. package/src/filiale/gongyi/pc/PcAddLogs.vue +12 -4
  51. package/src/filiale/gongyi/pc/PcDisclosurerecord.vue +218 -0
  52. package/src/filiale/gongyi/pc/PcLegacyIssues.vue +309 -0
  53. package/src/filiale/gongyi/pc/SupervisoryServiceControl.vue +1 -1
  54. package/src/filiale/gongyi/pc/SupervisoryServiceView.vue +1005 -0
  55. package/src/filiale/gongyi/pc/addMaterialScience.vue +43 -7
  56. package/src/filiale/gongyi/pc/chargeManagement.vue +765 -0
  57. package/src/filiale/gongyi/pc/supplementalAgreement.vue +277 -0
  58. package/src/filiale/gongyi/pc.js +6 -1
  59. package/src/filiale/hongda/pc/SupervisoryList.vue +13 -0
  60. package/src/filiale/jinhuang/pc/ServiceControl.vue +1925 -0
  61. package/src/filiale/jinhuang/pc/chargeManagementNew.vue +589 -0
  62. package/src/filiale/jinhuang/pc.js +7 -0
  63. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -0
  64. package/src/filiale/qianneng/android/AppExplorationUser.vue +38 -0
  65. package/src/filiale/qianneng/android/AppInstallationDetails.vue +20 -11
  66. package/src/filiale/qianneng/android.js +2 -1
  67. package/src/filiale/qianneng/pc/ApplyUpload.vue +5 -4
  68. package/src/filiale/qianneng/pc/Applybatchdispatch.vue +11 -6
  69. package/src/filiale/qianneng/pc/Applydetail.vue +0 -5
  70. package/src/filiale/qianneng/pc/InstallFunction.vue +2 -2
  71. package/src/filiale/qianneng/pc/InstallationDetails.vue +32 -4
  72. package/src/filiale/qianneng/pc/ServiceControl.vue +1 -0
  73. package/src/filiale/qianneng/pc/printactivatecard.vue +6 -6
  74. package/src/filiale/ruihua/pc/InstallationDetails.vue +610 -610
  75. package/src/filiale/ruihua/pc/ServiceControl.vue +20 -0
  76. package/src/filiale/ruihua/pc/printVentilation.vue +21 -6
  77. package/src/filiale/ruihua/pc.js +12 -12
  78. package/src/filiale/shexian/android/AppServiceControl.vue +12 -2
  79. package/src/filiale/shexian/android/AppTakePic.vue +15 -55
  80. package/src/filiale/siyangRH/android/AppAddMaterialScience.vue +0 -2
  81. package/src/filiale/siyangRH/pc/chargeManagement.vue +810 -0
  82. package/src/filiale/siyangRH/pc.js +1 -0
  83. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +16 -1
  84. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +32 -2
  85. package/src/filiale/yangchunboneng/android/AppExplorationUser.vue +518 -506
  86. package/src/filiale/yangchunboneng/android/AppInstallationMaterial.vue +1083 -1092
  87. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +34 -1
  88. package/src/filiale/yangchunboneng/android/AppSuperServiceControl.vue +1524 -1524
  89. package/src/filiale/yangchunboneng/android/AppUpload.vue +205 -136
  90. package/src/filiale/yangchunboneng/android/MaterIialOne.vue +156 -144
  91. package/src/filiale/yangchunboneng/android.js +20 -20
  92. package/src/filiale/yangchunboneng/pc/ApplyUpload.vue +392 -375
  93. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +59 -19
  94. package/src/filiale/yangchunboneng/pc/ExplorationUser.vue +191 -0
  95. package/src/filiale/yangchunboneng/pc/InstallInfoSelect.vue +365 -365
  96. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +206 -2
  97. package/src/filiale/yangchunboneng/pc/SupervisoryControlNew.vue +142 -0
  98. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +590 -535
  99. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +628 -0
  100. package/src/filiale/yangchunboneng/pc/SupervisoryServiceControl.vue +902 -0
  101. package/src/filiale/yangchunboneng/pc/SupervisoryServiceControlNew.vue +901 -0
  102. package/src/filiale/yangchunboneng/pc/SupervisoryServiceView.vue +1117 -0
  103. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +111 -13
  104. package/src/filiale/yangchunboneng/pc.js +24 -18
  105. package/src/main.js +1 -1
@@ -1,1092 +1,1083 @@
1
- <template>
2
- <work-busy :is-busy="button_state"></work-busy>
3
- <div>
4
- <div style="height: auto;width: 100%;margin: 30px 0" v-if="showQrCode">
5
- <div partial>
6
- <div class="" align="center">
7
- <div style="margin-bottom:10px "><img src="../../../assets/scanCode.png">请扫描下方二维码进行付款</div>
8
- <div class="row app-row">
9
- <div class="col-xs-12">
10
- <label class="font text-left">订单编号:{{ order.body.tradeNo }}</label>
11
- </div>
12
- <!-- <div class="col-xs-8">
13
- <input type="text" class ="search_input input-font" v-model="order.body.tradeNo" />
14
- </div>-->
15
- </div>
16
- <!-- <div class="row app-row">
17
- <div class="col-xs-4">
18
- <label class="font text-left">订单状态:</label>
19
- </div>
20
- <div class="col-xs-8">
21
- <input type="text" class ="search_input input-font" v-model="orderstatus.msg" />
22
- </div>
23
- </div>-->
24
- <!--<div @click="callBack('支付成功')">返回</div>-->
25
- </div>
26
- <div class="" align="center">
27
- <div class="QR-code" v-if="payType=='二维码支付'">
28
- <img src="../../../assets/qrcode_no.png" v-show="isTimeout" style="width: 266px;height: 266px"/>
29
- <div id="qrcode" style="margin-top: 25px;width: 266px;height: 266px"></div>
30
- </div>
31
- </div>
32
- </div>
33
- </div>
34
- <div v-show="!showQrCode">
35
- <material-one v-for="(i, item) in material " :index="$index" :item="item"
36
- :materialnameandcode="materialnameandcode"
37
- :newmaterialnameandcode="newmaterialnameandcode"
38
- :typenumbers="materialtypenumber" @number_chenge="getChangePayNumber"
39
- @delete_material="delete_material"></material-one>
40
- <div style="padding: 10px;display: flex;justify-content: space-around;">
41
- <button type="button" class="btn btn-primary" @click="addUserFile">添加</button>
42
- </div>
43
- <!-- <div class="y-form-item">
44
- <label class="text-justify lb-left" style="width: 100px;">材料清单</label>
45
- <img-area :model="materialImges" :sutitle="getsutitle('')" style="margin-left: 5%"></img-area>
46
- </div>-->
47
- <div class="row">
48
- <label class="text-justify lb-left" style="width: 100px">收款</label>
49
- <!-- <div class="row">
50
-
51
- <data-grid partial='list' v-ref:grid :model="{rows:summarize}" v-show="summarize.length>0" class="list_area table_sy">
52
- <template partial='head'>
53
- <tr>
54
- <th>
55
- <nobr>收费类型</nobr>
56
- </th>
57
- <th>
58
- <nobr>数量</nobr>
59
- </th>
60
- <th>
61
- <nobr>总金额</nobr>
62
- </th>
63
- </tr>
64
- </template>
65
- <template partial='body'>
66
- <td style="text-align: center;">
67
- <nobr>{{row.material_type }}</nobr>
68
- </td>
69
- <td style="text-align: center;">
70
- <nobr>{{ row.amount }}</nobr>
71
- </td>
72
- <td style="text-align: center;">
73
- <nobr>{{ row.money }}</nobr>
74
- </td>
75
- </template>
76
- </data-grid>
77
- &lt;!&ndash; <div v-for="item in summarize" style="display: flex;justify-content: center;">
78
- {{item.}} - {{item.}} - {{item.}}
79
- </div>&ndash;&gt;
80
- </div>-->
81
- <div class="row row_sty">
82
- <label class="lab_sty col-xs-4">收费优惠金额</label>
83
- <div class="col-xs-8">
84
- <input type="number" class="form-control" v-model="f_discounts_money_materials" :value.sync="f_discounts_money_materials" @change="getChangePayNumber()">
85
- </div>
86
- </div>
87
- <div class="row row_sty">
88
- <label class="lab_sty col-xs-4">总优惠金额</label>
89
- <div class="col-xs-8">
90
- <input type="number" class="form-control" v-model="f_discounts_money" :value.sync="f_discounts_money" readonly>
91
- </div>
92
- </div>
93
- <div class="row row_sty">
94
- <label class="lab_sty col-xs-4">合计金额</label>
95
- <div class="col-xs-8">
96
- <input type="number" class="form-control" v-model="payNumber" :value.sync="payNumber" readonly>
97
- </div>
98
- </div>
99
- <div class="row row_sty">
100
- <label class="lab_sty col-xs-4">收款方式</label>
101
- <div class="col-xs-8">
102
- <v-select
103
- :width="'100%'"
104
- :value.sync="payType"
105
- v-model="payType"
106
- :options='payTypes'
107
- placeholder='请选择'
108
- close-on-select
109
- :value-single="true"
110
- ></v-select>
111
- </div>
112
- </div>
113
- <!-- <div class="y-form-item" v-if="payType=='二维码支付'">
114
- <div id="qrcode" class="qrcode" v-ref:qrcode></div>
115
- </div>-->
116
- </div>
117
- <div style="padding: 10px;display: flex;justify-content: space-around;">
118
- <button type="button" name="button" class="btn btn-primary btn-sm" style="float: right;margin-right:10px;"
119
- @click="beforeSaveCharge()">保存
120
- </button>
121
- <button type="button" class="btn btn-primary" @click="cancel">取消</button>
122
- </div>
123
- </div>
124
- </div>
125
- </template>
126
-
127
- <script>
128
- import Vue from 'vue'
129
- import {HttpResetClass} from 'vue-client'
130
- import QRCode from 'qrcodejs2'
131
- import {isEmpty} from '../../../components/Util'
132
-
133
- export default {
134
- title: '材料添加',
135
- props: {
136
- selectdata: {
137
- type: Object
138
- }
139
- },
140
- data() {
141
- return {
142
- f_discounts_money_materials:0,
143
- f_discounts_money:0,
144
- materialname: [],
145
- materialTYPE: [],
146
- materialnameandcode: [],
147
- newmaterialnameandcode: [],
148
- materialtypenumber: [],
149
- category: {},
150
- //支付方式
151
- payType: '',
152
- //支付总额
153
- payNumber: 0,
154
- newPayNumber: 0,
155
- //支付方式选择框
156
- // payTypes: [{label: '现金', value: '现金'}, {label: '二维码支付', value: '二维码支付'}],
157
- payTypes: [{label: '现金', value: '现金'}],
158
- materialImges: [],
159
- showFile: false,
160
- material: [],
161
- positions: this.$appdata.getParam('品名及规格'), // 获取材料名称
162
- charge: {
163
- payment_terms: [{f_payment_term: '', f_charge_money: '', f_amount_words: '', f_payment_method: ''}]
164
- }, // 收费内容
165
- showCharge: false, // 收费显示
166
- timeLeft: 300, // 收费时间
167
- title1: '', // 二维码标题
168
- showQrCode: false, // 二维码显示
169
- order: {}, // 订单信息
170
- f_cost_sum: 0, // 总收费
171
- othercharge_id: '',
172
- button_state: false,
173
- summarize: []//材料收费方式汇总
174
- }
175
- },
176
- ready() {
177
-
178
- //this.search()
179
- this.getAllMaterial()
180
- // this.getmaterial()
181
- // this.getmaterialTYPE()
182
-
183
- },
184
- methods: {
185
- delete_material(i) {
186
- console.log('删除项====', i)
187
- this.material.splice(i, 1)
188
- this.getChangePayNumber()
189
- },
190
- async beforeSaveCharge() {
191
- console.log("977666")
192
- if (this.material.length == 0) {
193
- return this.$showMessage(`请先添加消耗的材料!`)
194
- }
195
- for (let index = 0; index < this.material.length; index++) {
196
- const item = this.material[index]
197
- if (!item.f_material_name) {
198
- this.$showMessage(`请选择材料${index + 1}的材料名称`)
199
- return;
200
- }
201
- if (!item.f_typenumber) {
202
- this.$showMessage(`请选择材料${index + 1}的型号`)
203
- return;
204
- }
205
- if (!item.f_material_price) {
206
- this.$showMessage(`请填写材料${index + 1}的单价`)
207
- return;
208
- }
209
- if (!item.f_material_number || item.f_material_number == 0) {
210
- this.$showMessage(`请填写材料${index + 1}的数量`)
211
- return;
212
- }
213
- }
214
- /*if(this.materialImges.length===0){
215
- this.$showMessage(`至少有一张材料照片`)
216
- return;
217
- }*/
218
- if (!this.payType) {
219
- this.$showMessage(`请选择缴费方式`)
220
- return;
221
- }
222
- this.button_state = true
223
- try {
224
- if (this.payType.indexOf('现金') != -1) {
225
- await this.saveUserFile('save')
226
- } else {
227
- await this.openQrCode()
228
- }
229
- this.button_state = false
230
- } catch (e) {
231
- this.$showMessage(`材料收费失败!请检查网络`)
232
- this.button_state = false
233
- }
234
- },
235
- cancel() {
236
- this.$emit('aftersave')
237
- },
238
- getAllMaterial() {
239
- new HttpResetClass().load('POST', this.$androidUtil.getProxyUrl() + `/rs/sql/tel_singleTable_OrderBy?pageNo=1&pageSize=99999`, {
240
- data: {
241
- items: '*',
242
- tablename: 't_material_info',
243
- condition: `org_id = '${Vue.user.orgid}'`,
244
- orderitem: 'id desc'
245
- }
246
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
247
- const typeNames = res.data.filter((item) => item.type === '报建')
248
- const materialNames = res.data.filter((item) => item.type === '材料')
249
- const materialNumbers = res.data.filter((item) => item.type === '型号')
250
- console.log(typeNames, materialNames, materialNumbers)
251
- const newMaterialNames = materialNames.map((item) => {
252
- const typeName = typeNames.filter((res) => {
253
- return res.id == item.parent_id
254
- })
255
- return {
256
- id: item.id,
257
- typeName: typeName[0],
258
- materialName: item
259
- }
260
- })
261
- console.log("988", newMaterialNames)
262
- this.materialtypenumber = this.sortArrayByCodeAscending(materialNumbers)
263
- const aMaterialnameandcode = []
264
- for (const item of this.materialtypenumber) {
265
- const newMaterialName = newMaterialNames.filter((res) => {
266
- return res.id == item.parent_id
267
- })
268
- if (newMaterialName && newMaterialName.length > 0) {
269
- aMaterialnameandcode.push({
270
- label: `${newMaterialName[0]['materialName']['name']}`,
271
- value: {
272
- typeName: newMaterialName[0]['typeName'],
273
- materialName: newMaterialName[0]['materialName'],
274
- materialNumber: item
275
- }
276
- })
277
- }
278
- }
279
- this.materialnameandcode = aMaterialnameandcode
280
- console.log('this.newmaterialnameandcode=', JSON.stringify(this.newmaterialnameandcode))
281
- this.newmaterialnameandcode = this.materialnameandcode.map((item) => {
282
- return {
283
- label: item.label,
284
- value: item.label
285
- }
286
- })
287
- }).catch((e) => {
288
- console.log("933", e)
289
- })
290
- },
291
- sortArrayByCodeAscending(dataArray) {
292
- // Convert the "code" property to a number for sorting
293
- dataArray.forEach(item => {
294
- item.newCode = parseFloat(item.code);
295
- });
296
-
297
- // Sort the array based on the "code" property
298
- dataArray.sort((a, b) => a.newCode - b.newCode);
299
-
300
- return dataArray;
301
- },
302
- getChangePayNumber() {
303
- this.payNumber = 0
304
- this.summarize = []
305
- this.f_discounts_money = 0
306
- for (let i = 0; i < this.material.length; i++) {
307
- this.material[i].f_fee = (this.material[i].f_material_price * this.material[i].f_material_number) + (this.material[i].f_overlength_unitprice * this.material[i].f_overlength_number) - this.material[i].f_discounts_money_detail
308
- this.payNumber += Number(this.material[i].f_fee)
309
- this.f_discounts_money += Number(this.material[i].f_discounts_money_detail)
310
- // let res=this.checkSummarize(this.material[i].material_type)
311
- /* if(res.has){
312
- this.summarize[res.idx].amount+= 1
313
- this.summarize[res.idx].money+= Number(this.material[i].f_fee)
314
- }else{
315
- this.summarize.push({material_type:this.material[i].material_type,amount:1,money:this.material[i].f_fee})
316
- } */
317
- }
318
- this.payNumber -= Number(this.f_discounts_money_materials)
319
- this.f_discounts_money += Number(this.f_discounts_money_materials)
320
- console.log('this.summarize------------', this.summarize)
321
- },
322
- checkSummarize(name) {
323
- let result = {idx: null, has: false}
324
- this.summarize.forEach((item, idx) => {
325
- if (item.material_type == name) {
326
- result.idx = idx
327
- result.has = true
328
- }
329
- })
330
- console.log('result', result)
331
- return result
332
- },
333
- getsutitle(val) {
334
- return val
335
- },
336
- loadOptions(index) {
337
- // const data = {
338
- // tablename: 't_material_info',
339
- // condition: "1 = 1 and code = '" + this.material[index].f_material_code + "'"
340
- // }
341
- // this.$resetpost(this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data}, {
342
- // resolveMsg: null,
343
- // rejectMsg: '获取数据失败'
344
- // }).then((res) => {
345
- // for (let material of res.data) {
346
- // switch (material.type) {
347
- // case '分类' :
348
- // this.$set('material[' + index + '].f_typename', material.name)
349
- // break
350
- // case '品名' :
351
- // this.$set('material[' + index + '].f_material_name', material.name)
352
- // break
353
- // case '型号' :
354
- // this.$set('material[' + index + '].f_typenumber', material.name)
355
- // this.$set('material[' + index + '].unit', material.unit)
356
- // this.$set('material[' + index + '].f_material_price', material.price)
357
- // break
358
- // }
359
- // }
360
- // this.$set('material', JSON.parse(JSON.stringify(this.material)))
361
- // })
362
- const data = {
363
- code: this.material[index].f_material_code
364
- }
365
- this.$resetpost(this.$androidUtil.getProxyUrl() + '/rs/sql/getMaterialByCode', {data}, {
366
- resolveMsg: null,
367
- rejectMsg: '获取数据失败'
368
- }).then((res) => {
369
- for (let material of res.data) {
370
- this.$set('material[' + index + '].f_typename', material.f_typename)
371
- this.$set('material[' + index + '].f_material_name', material.f_material_name)
372
- this.$set('material[' + index + '].f_typenumber', material.f_typenumber)
373
- this.$set('material[' + index + '].unit', material.unit)
374
- this.$set('material[' + index + '].f_material_price', material.f_material_price)
375
- }
376
- this.$set('material', JSON.parse(JSON.stringify(this.material)))
377
- })
378
-
379
- },
380
- // 删除未保存的材料信息
381
- async deleteUserFile(index) {
382
- this.material.splice(index, 1)
383
- },
384
- // 追加材料信息
385
- addUserFile() {
386
- this.material.push({
387
- f_material_name: "",
388
- unit: "",
389
- f_material_price: "",
390
- f_typenumber: "",
391
- f_typename: "",
392
- material_type: ""
393
- })
394
- },
395
- getmaterialTYPE() {
396
- let http = new HttpResetClass()
397
- let data = {
398
- tablename: 't_material_service',
399
- condition: `1=1`
400
- }
401
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
402
- resolveMsg: null,
403
- rejectMsg: '获取数据失败'
404
- }).then(res => {
405
- console.log("XXX", res.data.length)
406
- for (let i = 0; i < res.data.length; i++) {
407
-
408
- this.materialTYPE.push({
409
- label: res.data[i].f_typenumber,
410
- value: res.data[i].f_typenumber
411
- })
412
- }
413
- if (this.materialTYPE.length <= 0) {
414
- this.materialTYPE = [{}]
415
- }
416
- this.materialtypenumber = Array.from(new Set(this.materialTYPE.map(item => item.label)))
417
- .map(label => {
418
- return this.materialTYPE.find(item => item.label === label);
419
- })
420
- console.log("XXX", this.materialtypenumber)
421
- })
422
- return this.materialtypenumber
423
- },
424
- getmaterial() {
425
- let http = new HttpResetClass()
426
- let data = {
427
- tablename: 't_material_service',
428
- condition: `1=1`
429
- }
430
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
431
- resolveMsg: null,
432
- rejectMsg: '获取数据失败'
433
- }).then(res => {
434
- console.log("XXX", res.data.length)
435
- for (var i = 0; i < res.data.length; i++) {
436
-
437
- this.materialname.push({
438
- label: '[' + res.data[i].f_material_code + ']' + res.data[i].f_material_name,
439
- value: res.data[i].f_material_name
440
- }
441
- )
442
- }
443
- if (this.materialname.length <= 0) {
444
- this.materialname = [{}]
445
- }
446
- this.materialnameandcode = Array.from(new Set(this.materialname.map(item => item.label)))
447
- .map(label => {
448
- return this.materialname.find(item => item.label === label);
449
- })
450
- this.materialname = this.materialname.map(item => {
451
- item.label = item.label.replace(/null/g, "空")
452
- return item;
453
- });
454
- console.log("XXX", this.materialnameandcode)
455
- })
456
- return this.materialnameandcode
457
- },
458
- search() {
459
- let http = new HttpResetClass()
460
- let data = {
461
- tablename: 't_material_service',
462
- condition: `f_process_id = '${this.selectdata.f_process_id}'`
463
- }
464
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
465
- resolveMsg: null,
466
- rejectMsg: '获取数据失败'
467
- }).then(res => {
468
- this.material = res.data
469
- if (this.material.length <= 0) {
470
- this.addUserFile()
471
- } else {
472
- this.getAllMaterialImg()
473
- this.getChangePayNumber()
474
- }
475
- })
476
-
477
-
478
- },
479
- getAllMaterialImg() {
480
- let http = new HttpResetClass()
481
- let data = {
482
- tablename: 't_material_img',
483
- condition: `f_process_id = '${this.selectdata.f_process_id}'`
484
- }
485
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
486
- resolveMsg: null,
487
- rejectMsg: '获取数据失败'
488
- }).then(result => {
489
- let tempArr = []
490
- let tempArrary = []
491
- result = result.data
492
- for (let i = 0; i < result.length; i++) {
493
-
494
- if (!tempArr.includes(result[i].f_path)) {
495
- let temp = {}
496
- temp.id = result[i].id
497
- temp.android_file = result[i].f_path
498
- temp.imgpath = ''
499
- temp.path = 'http://newimg/storage/emulated/0/Download/safecheck/' + result[i].f_path
500
- tempArr.push(result[i].f_path)
501
- tempArrary.push(temp)
502
- }
503
- }
504
- this.materialImges = tempArrary
505
- })
506
- },
507
- // 获取品名规格
508
- setTypename(i, val) {
509
- let ac = this.$appdata.getParam(val)
510
- this.$set('material[' + i + '].typeNameList', ac)
511
- this.$set('material[' + i + '].typeNumberList', [])
512
- this.$set('material[' + i + '].f_typenumber', null)
513
- this.$set('material[' + i + '].f_material_price', 0)
514
- },
515
- // 获取类型
516
- setTypenumber(i, val) {
517
- let ac = this.$appdata.getParam(val)
518
- this.$set('material[' + i + '].typeNumberList', ac)
519
- this.$set('material[' + i + '].f_material_price', 0)
520
- },
521
- // 获取单价
522
- setmaterialprice(i, val) {
523
- var num
524
- if (val == null) {
525
- num = 0
526
- }
527
- num = this.$appdata.getSingleValue(val)
528
- this.$set('material[' + i + '].f_material_price', num)
529
- },
530
- // 金额计算
531
- smallnum(val, val1) {
532
- let num = Number(val) * Number(val1)
533
- return num
534
- },
535
- getCheckMessage() {
536
- let tempArr = this.material
537
- if (!tempArr.length > 0) {
538
- return '请选择材料后上传'
539
- }
540
- for (let i = 0; i < tempArr.length; i++) {
541
- if (tempArr[i].f_process_id) {
542
- continue
543
- }
544
-
545
- if (!tempArr[i].f_material_price) {
546
- return '请输入材料单价'
547
- }
548
- if (!tempArr[i].f_material_number) {
549
- return '请输入材料数量'
550
- }
551
- }
552
- /* if (this.materialImges.length == 0) {
553
- return '材料清单需拍照'
554
- } */
555
- return null
556
-
557
- },
558
- /*async saveUserFile1() {
559
- let message = this.getCheckMessage()
560
- if (message) {
561
- this.$showMessage(message)
562
- return
563
- }
564
- let imgs = []
565
- for (let i = 0; i < this.materialImges.length; i++) {
566
- let it = {}
567
- if (this.materialImges[i].id) {
568
- it = {
569
- f_path: this.materialImges[i].path,
570
- id: this.materialImges[i].id,
571
- f_process_id: this.selectdata.f_process_id
572
- }
573
- } else {
574
- it = {
575
- f_path: this.materialImges[i].path,
576
- f_process_id: this.selectdata.f_process_id
577
- }
578
- }
579
- imgs.push(it)
580
- }
581
- for (let i = 0; i < this.material.length; i++) {
582
- this.material[i].f_process_id = this.selectdata.f_process_id
583
- if (isEmpty(this.material[i].f_state)) {
584
- this.material[i].f_state = '未收费'
585
- }
586
- }
587
- let data = {
588
- model: this.material,
589
- imgs: imgs,
590
- f_process_id: this.selectdata.f_process_id
591
- }
592
- console.log('------------------',data)
593
- new HttpResetClass().load('POST',this.$androidUtil.getProxyUrl() +`/rs/logic/saveMaterialService`, data,{resolveMsg:null,rejectMsg:null}).then(res=>{
594
- console.log(res)
595
- this.model.rows=res.data
596
- }).catch((e)=>{
597
- console.log("933",e)
598
- })
599
- /!* console.log('------------------',data)
600
- HostApp.__this__ = this
601
- HostApp.logicWithHint({
602
- // logic别名,key必须为logic
603
- 'logic': 'saveMaterialServiceAndroid',
604
- // 回调执行方法名,key必须为callback
605
- 'callback': 'javascript:HostApp.__this__.uploadCallback1()',
606
- // logic执行需要的业务参数
607
- 'data': data,
608
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
609
- // 执行回调方法传入key为backresult
610
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
611
- 'backresult': 1
612
- }) *!/
613
- },*/
614
- uploadCallback1(result) {
615
-
616
- if (result.state == 'ok' && JSON.parse(result.result).code == 200) {
617
- this.$showMessage('材料保存成功!!!')
618
- } else {
619
- this.$showMessage(JSON.parse(result.result).msg)
620
- }
621
- },
622
- async saveUserFile(type) {
623
- for (let i = 0; i < this.material.length; i++) {
624
- this.material[i].f_process_id = this.selectdata.f_process_id
625
- this.material[i].f_department = Vue.user.f_department_name
626
- this.material[i].f_fee = this.material[i].f_material_price * this.material[i].f_material_number
627
- if (isEmpty(this.material[i].f_state)) {
628
- this.material[i].f_state = null
629
- }
630
- }
631
- await this.saveOrder(type)
632
- },
633
- async saveOrder(type) {
634
- console.log('this.material', this.material)
635
- let otherdetail = []
636
- if (this.payNumber == 0) {
637
- otherdetail.push({
638
- f_brand_spec: ['维修'],
639
- f_typename: ['材料费'],
640
- f_typenumber: [],
641
- f_unitprice: 0,
642
- f_number: this.material.length
643
- })
644
- } else {
645
- this.material.forEach((row) => {
646
- if (row.f_material_price != 0) {
647
- otherdetail.push({
648
- f_brand_spec: ['维修'],
649
- f_typename: [`${row.material_type ? row.material_type : '材料费'}`],
650
- f_typenumber: [],
651
- f_unitprice: row.f_material_price,
652
- f_number: row.f_material_number,
653
- f_overlength_unitprice:row.f_overlength_unitprice,
654
- f_overlength_number:row.f_overlength_number,
655
- f_discounts_money_detail:row.f_discounts_money_detail,
656
- f_actual_materials_detail:row.f_actual_materials_detail
657
- })
658
- }
659
- })
660
- }
661
-
662
- let param = {
663
- model: this.material,
664
- operator_type: type,
665
- othercharge_id: this.othercharge_id,
666
- f_process_id: this.selectdata.f_process_id,
667
- other: {
668
- "record_userinfo": this.selectdata.model.f_userinfo_id,
669
- //"f_userfiles_id": '',
670
- //"f_user_id": '',
671
- "f_user_name": this.selectdata.model.f_user_name,
672
- "f_address": this.selectdata.model.f_address,
673
- "f_user_type": this.selectdata.model.f_user_type,
674
- "f_gasproperties": "",
675
- "f_collection": this.payNumber,
676
- "f_comments": `${Vue.user.name}进行维修材料收费,收费方式-${this.payType} ${this.order.body && this.order.body.tradeNo ? '。支付订单号:' + this.order.body.tradeNo : ''}`,
677
- "f_payment": this.payType,
678
- "f_voucher_number": this.selectdata.f_process_id,
679
- "f_bill_style": "普通收据",
680
- "f_userinfo_id": this.selectdata.model.f_userinfo_id,
681
- "f_service_person": Vue.user.name,
682
- "f_operat_type": "维修收费",
683
- "f_describe": "",
684
- "f_serial_id": this.order.body ? this.order.body.tradeNo : null,
685
- "f_state": type == 'create' ? '无效' : '有效',
686
- "f_operator": Vue.user.name,
687
- "f_discounts_money_materials": this.f_discounts_money_materials,
688
- "f_discounts_money": this.f_discounts_money,
689
- "f_operatorid": Vue.user.id,
690
- "f_orgid": Vue.user.orgid,
691
- "f_orgname": Vue.user.orgs,
692
- "f_depid": Vue.user.depids,
693
- "f_depname": Vue.user.f_department_name,
694
- "t_userfees": "",
695
- "f_fee_type": "维修费用",
696
- "f_fee_time": "12",
697
- "otherdetail": otherdetail
698
- }
699
- }
700
- console.log("要保存了666-------data2", param)
701
- let res = await new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/saveMaterialService`, param, {
702
- resolveMsg: null,
703
- rejectMsg: null
704
- })
705
- console.log('res.data', res.data)
706
- if (res.data.code == 200) {
707
- if (type === 'create') {
708
- // this.$showMessage('收费记录创建成功!!!')
709
- this.othercharge_id = res.data.othercharge_id
710
- // this.$emit('aftersave')
711
- } else {
712
- this.$showMessage('材料保存成功!!!')
713
- this.$emit('aftersave')
714
- }
715
-
716
- } else {
717
- this.$showMessage(res.data.msg)
718
- }
719
- },
720
- uploadCallback(result) {
721
- if (result.state == 'ok' && JSON.parse(result.result).code == 200) {
722
- this.$showMessage('材料保存成功!!!')
723
- } else {
724
- this.$showMessage(JSON.parse(result.result).msg)
725
- }
726
- },
727
- // 关闭对话框
728
- closeModal() {
729
- this.showCharge = false
730
- this.charge = {
731
- payment_terms: [{
732
- f_payment_term: '',
733
- f_charge_money: '',
734
- f_amount_words: '',
735
- f_payment_method: this.charge.f_payment_method
736
- }]
737
- }
738
- },
739
- // 金额转大写
740
- handleInput(index) {
741
- // 通过正则过滤小数点后两位
742
- console.log('-----------------------')
743
- this.charge.payment_terms[index].f_charge_money = (this.charge.payment_terms[index].f_charge_money.match(/^\d*(\.?\d{0,2})/g)[0]) || null
744
- this.charge.payment_terms[index].f_amount_words = this.smalltoBIG(this.charge.payment_terms[index].f_charge_money)
745
- },
746
- // 金额转大写
747
- smalltoBIG(n) {
748
- let fraction = ['角', ''];
749
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
750
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
751
- let head = n < 0 ? '欠' : '';
752
- n = Math.abs(n);
753
-
754
- let s = '';
755
-
756
- for (var i = 0; i < fraction.length; i++) {
757
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
758
- }
759
- s = s || '';
760
- n = Math.floor(n);
761
-
762
- for (var i = 0; i < unit[0].length && n > 0; i++) {
763
- let p = '';
764
- for (var j = 0; j < unit[1].length && n > 0; j++) {
765
- p = digit[n % 10] + unit[1][j] + p;
766
- n = Math.floor(n / 10);
767
- }
768
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
769
- }
770
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
771
- },
772
- moneyChange(index) {
773
- console.log(`当前下标----${index}`)
774
- if (isEmpty(this.charge.payment_terms[index].f_charge_money) || Number(this.charge.payment_terms[index].f_charge_money) === 0) {
775
- this.$showMessage('单笔收费不能为0元!!!', 'warning', 3000)
776
- this.charge.payment_terms[index].f_charge_money = null
777
- return
778
- }
779
- },
780
- async TimeQrCode() {
781
- this.qrcodeTimer = setTimeout(() => {
782
- // 关闭二维码
783
- this.clearQrCode()
784
- // 将定时器清除
785
- this.qrcodeTimer = null;
786
- clearInterval(this.orderInterval)
787
- }, 60 * 1000)
788
-
789
- },
790
- generateRandomString(length) {
791
- let result = new Date().getTime().toString()
792
- const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
793
- const charactersLength = characters.length;
794
- for (let i = 0; i < length; i++) {
795
- result += characters.charAt(Math.floor(Math.random() * charactersLength));
796
- }
797
- return result.substring(0, 30);
798
- },
799
- // 打开二维码
800
- async openQrCode() {
801
- const merchantMsg = Vue.config.telephone.ApproveConfig.merchantMsg
802
- if (!merchantMsg){
803
- this.$showMessage('未配备商户号,请联系管理员!')
804
- return
805
- }
806
- const outTradeNo = this.generateRandomString(30)
807
- // 下订单
808
- let http = new HttpResetClass()
809
- const val = {
810
- "body": "燃气费",
811
- "detail": "燃气费",
812
- "totalAmount": (this.payNumber * 100).toString(),
813
- "merchantMsg": merchantMsg,//商户id
814
- "outTradeNo": outTradeNo,//随机数30位
815
- "service": "nativePay",//死值
816
- "tradeType": "wechat_jsapi"//死值
817
- }
818
- try {
819
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10001`, {data: val}, {
820
- resolveMsg: null,
821
- rejectMsg: null
822
- })
823
- if (res.data.status === 200) {
824
- console.log("调用结果", res.data, res.data.body.url)
825
- try {
826
- this.order = res.data
827
- this.othercharge_id = ''
828
- await this.saveOrder('create')
829
- if (this.othercharge_id) {
830
- this.isTimeout = false
831
- this.showQrCode = true
832
- console.log(this.order)
833
- this.$nextTick(() => {
834
- this.qrcode(res.data.body.url)
835
- })
836
- if (this.order.body.tradeNo) {
837
- this.timer1 = window.setInterval(this.getOrderInformation, 3000)
838
- }
839
- } else {
840
- this.$showMessage('创建订单失败!')
841
- }
842
- } catch (e) {
843
- this.$showMessage('创建订单失败!')
844
- }
845
- } else {
846
- this.$showMessage('获取二维码失败!')
847
- }
848
-
849
- } catch (e) {
850
- this.$showMessage('获取二维码失败,请检查网络!')
851
- }
852
- },
853
- qrcode(url) {
854
- new QRCode('qrcode', {
855
- text: url, // 设置二维码内容或跳转地址
856
- width: 266, // 设置宽度,单位像素
857
- height: 266, // 设置高度,单位像素
858
- correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
859
- })
860
- },
861
- // 获取订单信息
862
- async getOrderInformation() {
863
- const merchantMsg = Vue.config.telephone.ApproveConfig.merchantMsg
864
- // 查询订单信息
865
- console.log('查询订单信息!!!', this.order)
866
- try {
867
- let http = new HttpResetClass()
868
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10003`, {
869
- data: {
870
- "service": "queryOrder",
871
- "outTradeNo": this.order.body.outTradeNo,
872
- "merchantMsg": merchantMsg,
873
- "tradeNo": ""
874
- }
875
- }, {
876
- resolveMsg: null,
877
- rejectMsg: null
878
- })
879
- // 支付成功
880
- this.orderstatus = res.data
881
- console.log('查询结果=======', res.data)
882
- if (res.data.status == '200') {
883
- window.clearInterval(this.timer1)
884
- console.log('支付成功', this.orderstatus)
885
- this.saveUserFile('update')
886
- this.order = {}
887
- }
888
- } catch (e) {
889
- window.clearInterval(this.timer1)
890
- this.$showMessage('创建订单失败!')
891
- this.order = {}
892
- }
893
- },
894
- getPaymentTerm() {
895
- let term = ''
896
- this.charge.payment_terms.forEach((row) => {
897
- term += `${row.f_payment_term} `
898
- })
899
- return term
900
- },
901
- closeQRCode() {
902
- clearTimeout(this.paymentInterval)
903
- clearTimeout(this.orderInterval)
904
- this.timeLeft = 300
905
- this.closeOrder()
906
- // 清除二维码
907
- this.clearQrCode()
908
- this.showQrCode = false
909
- },
910
- clearQrCode() {
911
- document.getElementById('qrcode').innerHTML = ''
912
- },
913
- /* async closeOrder() {
914
- let data = {
915
- "flag": "JsApiWeiNan",
916
- "f_filiale": "weinanchengtou",
917
- "f_out_trade_no": this.order.f_out_trade_no,// 商户单号
918
- "isClose": "是",
919
- "f_sys_trace": this.order.f_sys_trace // 交易流水号
920
- }
921
- let http = new HttpResetClass()
922
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/microPayOrderStatus`, data, {
923
- resolveMsg: null,
924
- rejectMsg: '关闭失败!!!'
925
- })
926
- },*/
927
- async update() {
928
- let http = new HttpResetClass()
929
- for (let i = 0; i < this.material.length; i++) {
930
- if (this.material[i].f_state == '未收费') {
931
- this.material[i].f_state = '已收费'
932
- }
933
- }
934
- let data = {
935
- model: this.material
936
- }
937
- let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/logic/saveweinanmaterial', {data: data}, {
938
- resolveMsg: null,
939
- rejectMsg: '保存失败'
940
- })
941
- this.search()
942
- },
943
- async saveother() {
944
- let http = new HttpResetClass()
945
- let data1 = {
946
- tablename: 't_material_service',
947
- condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
948
- }
949
- let res1 = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data1}, {
950
- resolveMsg: null,
951
- rejectMsg: '获取数据失败'
952
- })
953
- let data = {
954
- tablename: 't_userfiles',
955
- condition: `f_userinfo_id = '${this.selectdata.model.f_userinfo_id}'`
956
- }
957
- let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
958
- resolveMsg: null,
959
- rejectMsg: '获取数据失败'
960
- })
961
- let otherdetails = []
962
- for (let i = 0; i < res1.data.length; i++) {
963
- otherdetails.push(
964
- {
965
- "f_brand_spec": [res1.data[i].f_material_name],
966
- "f_unitprice": res1.data[i].f_material_price,
967
- "f_typename": [res1.data[i].f_typename],
968
- "f_typenumber": [res1.data[i].f_typenumber],
969
- "f_number": res1.data[i].f_material_number
970
- }
971
- )
972
- }
973
-
974
- console.log("查询的用户信息", otherdetails)
975
- let data2 = {
976
- "record_userinfo": this.selectdata.model.f_userinfo_id,
977
- "f_userfiles_id": res.data[0].f_userfiles_id,
978
- "f_user_id": res.data[0].f_user_id,
979
- "f_user_name": this.selectdata.model.f_user_name,
980
- "f_address": this.selectdata.model.f_address,
981
- "f_user_type": this.selectdata.model.f_user_type,
982
- "f_gasproperties": "",
983
- "f_collection": this.f_cost_sum,
984
- "f_comments": "",
985
- "f_payment": this.charge.f_payment_method,
986
- "f_voucher_number": "",
987
- "f_bill_style": "普通收据",
988
- "f_userinfo_id": this.selectdata.model.f_userinfo_id,
989
- "f_service_person": Vue.user.name,
990
- "f_operat_type": "其他收费",
991
- "f_describe": "",
992
- "f_state": "有效",
993
- "f_operator": Vue.user.name,
994
- "f_operatorid": Vue.user.id,
995
- "f_orgid": Vue.user.orgid,
996
- "f_orgname": Vue.user.orgs,
997
- "f_depid": Vue.user.depids,
998
- "f_depname": Vue.user.f_department_name,
999
- "t_userfees": "",
1000
- "f_fee_type": "其他费用",
1001
- "f_fee_time": "12",
1002
- "otherdetail": otherdetails
1003
- }
1004
-
1005
- let res2 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/sale_othercharge_logic`, {data: data2}, {
1006
- resolveMsg: null,
1007
- rejectMsg: '保存数据失败'
1008
- })
1009
- },
1010
- async shoufei() {
1011
- let http = new HttpResetClass()
1012
- let data = {
1013
- tablename: 't_material_service',
1014
- condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
1015
- }
1016
- let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
1017
- resolveMsg: null,
1018
- rejectMsg: '获取数据失败'
1019
- })
1020
- if (res.data.length <= 0) {
1021
- this.$showMessage('请先添加未收费的材料!!!')
1022
- return
1023
- }
1024
- this.f_cost_sum = 0
1025
- for (let i = 0; i < res.data.length; i++) {
1026
- this.f_cost_sum += Number(res.data[i].f_fee)
1027
- }
1028
- this.showCharge = true
1029
- this.charge.payment_terms[0].f_charge_money = this.f_cost_sum
1030
- },
1031
- accMul(arg1, arg2) {
1032
- let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
1033
- try {
1034
- m += s1.split(".")[1].length
1035
- } catch (e) {
1036
- }
1037
- try {
1038
- m += s2.split(".")[1].length
1039
- } catch (e) {
1040
- }
1041
- return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
1042
- },
1043
- },
1044
- beforeDestroy() {
1045
- console.log('销毁了-----111', this.timer1)
1046
- window.clearInterval(this.timer1)
1047
- },
1048
- events: {},
1049
- computed: {
1050
- paymentMethod() {
1051
- return this.$appdata.getParam("付款方式")
1052
- },
1053
- paymentTerm() {
1054
- return this.$appdata.getParam("收费项目")
1055
- }
1056
- },
1057
- watch: {}
1058
- }
1059
- </script>
1060
- <style lang="less" scoped>
1061
- .head-but {
1062
- margin-left: 5px;
1063
- height: 34px;
1064
- /*background-color: #6aa6e2;*/
1065
- border-radius: 4px;
1066
- font-family: PingFang;
1067
- color: #ffffff;
1068
- }
1069
-
1070
- /*清除model中的浮动*/
1071
- .clearfix:after, .clearfix:before {
1072
- display: table;
1073
- }
1074
-
1075
- .clearfix:after {
1076
- clear: both;
1077
- }
1078
-
1079
- .lab_sty {
1080
- margin-bottom: 0;
1081
- display: flex;
1082
- flex-direction: row-reverse;
1083
- align-items: center;
1084
- }
1085
-
1086
- .row_sty {
1087
- display: flex;
1088
- align-items: center;
1089
- margin: 5px;
1090
- }
1091
-
1092
- </style>
1
+ <template>
2
+ <work-busy :is-busy="button_state"></work-busy>
3
+ <div>
4
+ <div style="height: auto;width: 100%;margin: 30px 0" v-if="showQrCode">
5
+ <div partial>
6
+ <div class="" align="center">
7
+ <div style="margin-bottom:10px "><img src="../../../assets/scanCode.png">请扫描下方二维码进行付款</div>
8
+ <div class="row app-row">
9
+ <div class="col-xs-12">
10
+ <label class="font text-left">订单编号:{{ order.body.tradeNo }}</label>
11
+ </div>
12
+ <!-- <div class="col-xs-8">
13
+ <input type="text" class ="search_input input-font" v-model="order.body.tradeNo" />
14
+ </div>-->
15
+ </div>
16
+ <!-- <div class="row app-row">
17
+ <div class="col-xs-4">
18
+ <label class="font text-left">订单状态:</label>
19
+ </div>
20
+ <div class="col-xs-8">
21
+ <input type="text" class ="search_input input-font" v-model="orderstatus.msg" />
22
+ </div>
23
+ </div>-->
24
+ <!--<div @click="callBack('支付成功')">返回</div>-->
25
+ </div>
26
+ <div class="" align="center">
27
+ <div class="QR-code" v-if="payType=='二维码支付'">
28
+ <img src="../../../assets/qrcode_no.png" v-show="isTimeout" style="width: 266px;height: 266px"/>
29
+ <div id="qrcode" style="margin-top: 25px;width: 266px;height: 266px"></div>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <div v-show="!showQrCode">
35
+ <apply-material-one v-for="(i, item) in material " :index="$index" :item="item"
36
+ :materialnameandcode="materialnameandcode"
37
+ :newmaterialnameandcode="newmaterialnameandcode"
38
+ :newmaterialnameandtype="newmaterialnameandtype"
39
+ :typenumbers="materialtypenumber" @number_chenge="getChangePayNumber"
40
+ @delete_material="delete_material"></apply-material-one>
41
+ <div style="padding: 10px;display: flex;justify-content: space-around;">
42
+ <button type="button" class="btn btn-primary" @click="addUserFile">添加</button>
43
+ </div>
44
+
45
+ <div class="row">
46
+ <label class="text-justify lb-left" style="width: 100px">收款</label>
47
+ <!-- <div class="row">
48
+
49
+ <data-grid partial='list' v-ref:grid :model="{rows:summarize}" v-show="summarize.length>0" class="list_area table_sy">
50
+ <template partial='head'>
51
+ <tr>
52
+ <th>
53
+ <nobr>收费类型</nobr>
54
+ </th>
55
+ <th>
56
+ <nobr>数量</nobr>
57
+ </th>
58
+ <th>
59
+ <nobr>总金额</nobr>
60
+ </th>
61
+ </tr>
62
+ </template>
63
+ <template partial='body'>
64
+ <td style="text-align: center;">
65
+ <nobr>{{row.material_type }}</nobr>
66
+ </td>
67
+ <td style="text-align: center;">
68
+ <nobr>{{ row.amount }}</nobr>
69
+ </td>
70
+ <td style="text-align: center;">
71
+ <nobr>{{ row.money }}</nobr>
72
+ </td>
73
+ </template>
74
+ </data-grid>
75
+ &lt;!&ndash; <div v-for="item in summarize" style="display: flex;justify-content: center;">
76
+ {{item.}} - {{item.}} - {{item.}}
77
+ </div>&ndash;&gt;
78
+ </div>-->
79
+ <div class="row row_sty">
80
+ <label class="lab_sty col-xs-4">收费优惠金额</label>
81
+ <div class="col-xs-8">
82
+ <input type="number" class="form-control" v-model="f_discounts_money_materials" :value.sync="f_discounts_money_materials" @change="getChangePayNumber()">
83
+ </div>
84
+ </div>
85
+ <div class="row row_sty">
86
+ <label class="lab_sty col-xs-4">总优惠金额</label>
87
+ <div class="col-xs-8">
88
+ <input type="number" class="form-control" v-model="f_discounts_money" :value.sync="f_discounts_money" readonly>
89
+ </div>
90
+ </div>
91
+ <div class="row row_sty">
92
+ <label class="lab_sty col-xs-4">合计金额</label>
93
+ <div class="col-xs-8">
94
+ <input type="number" class="form-control" v-model="payNumber" :value.sync="payNumber" readonly>
95
+ </div>
96
+ </div>
97
+ <div class="row row_sty">
98
+ <label class="lab_sty col-xs-4">收款方式</label>
99
+ <div class="col-xs-8">
100
+ <v-select
101
+ :width="'100%'"
102
+ :value.sync="payType"
103
+ v-model="payType"
104
+ :options='payTypes'
105
+ placeholder='请选择'
106
+ close-on-select
107
+ :value-single="true"
108
+ ></v-select>
109
+ </div>
110
+ </div>
111
+ <!-- <div class="y-form-item" v-if="payType=='二维码支付'">
112
+ <div id="qrcode" class="qrcode" v-ref:qrcode></div>
113
+ </div>-->
114
+ </div>
115
+ <div style="padding: 10px;display: flex;justify-content: space-around;">
116
+ <button type="button" name="button" class="btn btn-primary btn-sm" style="float: right;margin-right:10px;"
117
+ @click="beforeSaveCharge()">保存
118
+ </button>
119
+ <button type="button" class="btn btn-primary" @click="cancel">取消</button>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ </template>
124
+
125
+ <script>
126
+ import Vue from 'vue'
127
+ import {HttpResetClass} from 'vue-client'
128
+ import QRCode from 'qrcodejs2'
129
+ import {isEmpty} from '../../../components/Util'
130
+
131
+ export default {
132
+ title: '材料添加',
133
+ props: {
134
+ selectdata: {
135
+ type: Object
136
+ }
137
+ },
138
+ data() {
139
+ return {
140
+ f_discounts_money_materials:0,
141
+ f_discounts_money:0,
142
+ materialname: [],
143
+ materialTYPE: [],
144
+ materialnameandcode: [],
145
+ newmaterialnameandcode: [],
146
+ materialtypenumber: [],
147
+ newmaterialnameandtype: [],
148
+ category: {},
149
+ //支付方式
150
+ payType: '',
151
+ //支付总额
152
+ payNumber: 0,
153
+ newPayNumber: 0,
154
+ //支付方式选择框
155
+ // payTypes: [{label: '现金', value: '现金'}, {label: '二维码支付', value: '二维码支付'}],
156
+ payTypes: [{label: '现金', value: '现金'},{label: '扫码支付', value: '扫码支付'}],
157
+ materialImges: [],
158
+ showFile: false,
159
+ material: [],
160
+ positions: this.$appdata.getParam('品名及规格'), // 获取材料名称
161
+ charge: {
162
+ payment_terms: [{f_payment_term: '', f_charge_money: '', f_amount_words: '', f_payment_method: ''}]
163
+ }, // 收费内容
164
+ showCharge: false, // 收费显示
165
+ timeLeft: 300, // 收费时间
166
+ title1: '', // 二维码标题
167
+ showQrCode: false, // 二维码显示
168
+ order: {}, // 订单信息
169
+ f_cost_sum: 0, // 总收费
170
+ othercharge_id: '',
171
+ button_state: false,
172
+ summarize: []//材料收费方式汇总
173
+ }
174
+ },
175
+ ready() {
176
+
177
+ //this.search()
178
+ this.getAllMaterial()
179
+ // this.getmaterial()
180
+ // this.getmaterialTYPE()
181
+
182
+ },
183
+ methods: {
184
+ delete_material(i) {
185
+ console.log('删除项====', i)
186
+ this.material.splice(i, 1)
187
+ this.getChangePayNumber()
188
+ },
189
+ async beforeSaveCharge() {
190
+ console.log("977666")
191
+ if (this.material.length == 0) {
192
+ return this.$showMessage(`请先添加消耗的材料!`)
193
+ }
194
+ for (let index = 0; index < this.material.length; index++) {
195
+ const item = this.material[index]
196
+ if (!item.f_material_name) {
197
+ this.$showMessage(`请选择材料${index + 1}的材料名称`)
198
+ return;
199
+ }
200
+ if (!item.f_typenumber) {
201
+ this.$showMessage(`请选择材料${index + 1}的型号`)
202
+ return;
203
+ }
204
+ if (!item.f_material_price) {
205
+ this.$showMessage(`请填写材料${index + 1}的单价`)
206
+ return;
207
+ }
208
+ if (!item.f_material_number || item.f_material_number == 0) {
209
+ this.$showMessage(`请填写材料${index + 1}的数量`)
210
+ return;
211
+ }
212
+ }
213
+ /*if(this.materialImges.length===0){
214
+ this.$showMessage(`至少有一张材料照片`)
215
+ return;
216
+ }*/
217
+ if (!this.payType) {
218
+ this.$showMessage(`请选择缴费方式`)
219
+ return;
220
+ }
221
+ this.button_state = true
222
+ try {
223
+ if (this.payType.indexOf('现金') != -1) {
224
+ await this.saveUserFile('save')
225
+ } else {
226
+ await this.openQrCode()
227
+ }
228
+ this.button_state = false
229
+ } catch (e) {
230
+ this.$showMessage(`材料收费失败!请检查网络`)
231
+ this.button_state = false
232
+ }
233
+ },
234
+ cancel() {
235
+ this.$emit('aftersave')
236
+ },
237
+ getAllMaterial() {
238
+ new HttpResetClass().load('POST', this.$androidUtil.getProxyUrl() + `/rs/sql/tel_singleTable_OrderBy?pageNo=1&pageSize=99999`, {
239
+ data: {
240
+ items: '*',
241
+ tablename: 't_material_info',
242
+ condition: `org_id = '${Vue.user.orgid}'`,
243
+ orderitem: 'id desc'
244
+ }
245
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
246
+ const typeNames = res.data.filter((item) => item.type === '报建')
247
+ const materialNames = res.data.filter((item) => item.type === '材料')
248
+ const materialNumbers = res.data.filter((item) => item.type === '型号')
249
+ console.log(typeNames, materialNames, materialNumbers)
250
+ const newMaterialNames = materialNames.map((item) => {
251
+ const typeName = typeNames.filter((res) => {
252
+ return res.id == item.parent_id
253
+ })
254
+ return {
255
+ id: item.id,
256
+ typeName: typeName[0],
257
+ materialName: item
258
+ }
259
+ })
260
+ //所有材料
261
+ console.log("988", newMaterialNames)
262
+ for (let i = 0; i < newMaterialNames.length ; i++) {
263
+ this.newmaterialnameandcode.push({
264
+ label: newMaterialNames[i].materialName.name,
265
+ value: newMaterialNames[i].materialName,
266
+ })
267
+ }
268
+ // 所有型号
269
+ this.newmaterialnameandtype =materialNumbers
270
+ }).catch((e) => {
271
+ console.log("933", e)
272
+ })
273
+ },
274
+ sortArrayByCodeAscending(dataArray) {
275
+ // Convert the "code" property to a number for sorting
276
+ dataArray.forEach(item => {
277
+ item.newCode = parseFloat(item.code);
278
+ });
279
+
280
+ // Sort the array based on the "code" property
281
+ dataArray.sort((a, b) => a.newCode - b.newCode);
282
+
283
+ return dataArray;
284
+ },
285
+ getChangePayNumber() {
286
+ this.payNumber = 0
287
+ this.summarize = []
288
+ this.f_discounts_money = 0
289
+ for (let i = 0; i < this.material.length; i++) {
290
+ this.material[i].f_fee = (this.material[i].f_material_price * this.material[i].f_material_number) + (this.material[i].f_overlength_unitprice * this.material[i].f_overlength_number) - this.material[i].f_discounts_money_detail
291
+ this.payNumber += Number(this.material[i].f_fee)
292
+ this.f_discounts_money += Number(this.material[i].f_discounts_money_detail)
293
+ // let res=this.checkSummarize(this.material[i].material_type)
294
+ /* if(res.has){
295
+ this.summarize[res.idx].amount+= 1
296
+ this.summarize[res.idx].money+= Number(this.material[i].f_fee)
297
+ }else{
298
+ this.summarize.push({material_type:this.material[i].material_type,amount:1,money:this.material[i].f_fee})
299
+ } */
300
+ }
301
+ this.payNumber -= Number(this.f_discounts_money_materials)
302
+ this.f_discounts_money += Number(this.f_discounts_money_materials)
303
+ console.log('this.summarize------------', this.summarize)
304
+ },
305
+ checkSummarize(name) {
306
+ let result = {idx: null, has: false}
307
+ this.summarize.forEach((item, idx) => {
308
+ if (item.material_type == name) {
309
+ result.idx = idx
310
+ result.has = true
311
+ }
312
+ })
313
+ console.log('result', result)
314
+ return result
315
+ },
316
+ getsutitle(val) {
317
+ return val
318
+ },
319
+ loadOptions(index) {
320
+ // const data = {
321
+ // tablename: 't_material_info',
322
+ // condition: "1 = 1 and code = '" + this.material[index].f_material_code + "'"
323
+ // }
324
+ // this.$resetpost(this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data}, {
325
+ // resolveMsg: null,
326
+ // rejectMsg: '获取数据失败'
327
+ // }).then((res) => {
328
+ // for (let material of res.data) {
329
+ // switch (material.type) {
330
+ // case '分类' :
331
+ // this.$set('material[' + index + '].f_typename', material.name)
332
+ // break
333
+ // case '品名' :
334
+ // this.$set('material[' + index + '].f_material_name', material.name)
335
+ // break
336
+ // case '型号' :
337
+ // this.$set('material[' + index + '].f_typenumber', material.name)
338
+ // this.$set('material[' + index + '].unit', material.unit)
339
+ // this.$set('material[' + index + '].f_material_price', material.price)
340
+ // break
341
+ // }
342
+ // }
343
+ // this.$set('material', JSON.parse(JSON.stringify(this.material)))
344
+ // })
345
+ const data = {
346
+ code: this.material[index].f_material_code
347
+ }
348
+ this.$resetpost(this.$androidUtil.getProxyUrl() + '/rs/sql/getMaterialByCode', {data}, {
349
+ resolveMsg: null,
350
+ rejectMsg: '获取数据失败'
351
+ }).then((res) => {
352
+ for (let material of res.data) {
353
+ this.$set('material[' + index + '].f_typename', material.f_typename)
354
+ this.$set('material[' + index + '].f_material_name', material.f_material_name)
355
+ this.$set('material[' + index + '].f_typenumber', material.f_typenumber)
356
+ this.$set('material[' + index + '].unit', material.unit)
357
+ this.$set('material[' + index + '].f_material_price', material.f_material_price)
358
+ }
359
+ this.$set('material', JSON.parse(JSON.stringify(this.material)))
360
+ })
361
+
362
+ },
363
+ // 删除未保存的材料信息
364
+ async deleteUserFile(index) {
365
+ this.material.splice(index, 1)
366
+ },
367
+ // 追加材料信息
368
+ addUserFile() {
369
+ this.material.push({
370
+ f_material_name: "",
371
+ unit: 0,
372
+ f_material_price: 0,
373
+ f_typenumber: "",
374
+ f_typename: "",
375
+ material_type: "",
376
+ f_overlength_unitprice:"0",
377
+ f_overlength_number:"0",
378
+ f_discounts_money_detail:"0",
379
+ f_actual_materials_detail:"0"
380
+ })
381
+ },
382
+ getmaterialTYPE() {
383
+ let http = new HttpResetClass()
384
+ let data = {
385
+ tablename: 't_material_service',
386
+ condition: `1=1`
387
+ }
388
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
389
+ resolveMsg: null,
390
+ rejectMsg: '获取数据失败'
391
+ }).then(res => {
392
+ console.log("XXX", res.data.length)
393
+ for (let i = 0; i < res.data.length; i++) {
394
+
395
+ this.materialTYPE.push({
396
+ label: res.data[i].f_typenumber,
397
+ value: res.data[i].f_typenumber
398
+ })
399
+ }
400
+ if (this.materialTYPE.length <= 0) {
401
+ this.materialTYPE = [{}]
402
+ }
403
+ this.materialtypenumber = Array.from(new Set(this.materialTYPE.map(item => item.label)))
404
+ .map(label => {
405
+ return this.materialTYPE.find(item => item.label === label);
406
+ })
407
+ console.log("XXX", this.materialtypenumber)
408
+ })
409
+ return this.materialtypenumber
410
+ },
411
+ getmaterial() {
412
+ let http = new HttpResetClass()
413
+ let data = {
414
+ tablename: 't_material_service',
415
+ condition: `1=1`
416
+ }
417
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
418
+ resolveMsg: null,
419
+ rejectMsg: '获取数据失败'
420
+ }).then(res => {
421
+ console.log("XXX", res.data.length)
422
+ for (var i = 0; i < res.data.length; i++) {
423
+
424
+ this.materialname.push({
425
+ label: '[' + res.data[i].f_material_code + ']' + res.data[i].f_material_name,
426
+ value: res.data[i].f_material_name
427
+ }
428
+ )
429
+ }
430
+ if (this.materialname.length <= 0) {
431
+ this.materialname = [{}]
432
+ }
433
+ this.materialnameandcode = Array.from(new Set(this.materialname.map(item => item.label)))
434
+ .map(label => {
435
+ return this.materialname.find(item => item.label === label);
436
+ })
437
+ this.materialname = this.materialname.map(item => {
438
+ item.label = item.label.replace(/null/g, "空")
439
+ return item;
440
+ });
441
+ console.log("XXX", this.materialnameandcode)
442
+ })
443
+ return this.materialnameandcode
444
+ },
445
+ search() {
446
+ let http = new HttpResetClass()
447
+ let data = {
448
+ tablename: 't_material_service',
449
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
450
+ }
451
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
452
+ resolveMsg: null,
453
+ rejectMsg: '获取数据失败'
454
+ }).then(res => {
455
+ this.material = res.data
456
+ if (this.material.length <= 0) {
457
+ this.addUserFile()
458
+ } else {
459
+ this.getAllMaterialImg()
460
+ this.getChangePayNumber()
461
+ }
462
+ })
463
+
464
+
465
+ },
466
+ getAllMaterialImg() {
467
+ let http = new HttpResetClass()
468
+ let data = {
469
+ tablename: 't_material_img',
470
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
471
+ }
472
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
473
+ resolveMsg: null,
474
+ rejectMsg: '获取数据失败'
475
+ }).then(result => {
476
+ let tempArr = []
477
+ let tempArrary = []
478
+ result = result.data
479
+ for (let i = 0; i < result.length; i++) {
480
+
481
+ if (!tempArr.includes(result[i].f_path)) {
482
+ let temp = {}
483
+ temp.id = result[i].id
484
+ temp.android_file = result[i].f_path
485
+ temp.imgpath = ''
486
+ temp.path = 'http://newimg/storage/emulated/0/Download/safecheck/' + result[i].f_path
487
+ tempArr.push(result[i].f_path)
488
+ tempArrary.push(temp)
489
+ }
490
+ }
491
+ this.materialImges = tempArrary
492
+ })
493
+ },
494
+ // 获取品名规格
495
+ setTypename(i, val) {
496
+ let ac = this.$appdata.getParam(val)
497
+ this.$set('material[' + i + '].typeNameList', ac)
498
+ this.$set('material[' + i + '].typeNumberList', [])
499
+ this.$set('material[' + i + '].f_typenumber', null)
500
+ this.$set('material[' + i + '].f_material_price', 0)
501
+ },
502
+ // 获取类型
503
+ setTypenumber(i, val) {
504
+ let ac = this.$appdata.getParam(val)
505
+ this.$set('material[' + i + '].typeNumberList', ac)
506
+ this.$set('material[' + i + '].f_material_price', 0)
507
+ },
508
+ // 获取单价
509
+ setmaterialprice(i, val) {
510
+ var num
511
+ if (val == null) {
512
+ num = 0
513
+ }
514
+ num = this.$appdata.getSingleValue(val)
515
+ this.$set('material[' + i + '].f_material_price', num)
516
+ },
517
+ // 金额计算
518
+ smallnum(val, val1) {
519
+ let num = Number(val) * Number(val1)
520
+ return num
521
+ },
522
+ getCheckMessage() {
523
+ let tempArr = this.material
524
+ if (!tempArr.length > 0) {
525
+ return '请选择材料后上传'
526
+ }
527
+ for (let i = 0; i < tempArr.length; i++) {
528
+ if (tempArr[i].f_process_id) {
529
+ continue
530
+ }
531
+
532
+ if (!tempArr[i].f_material_price) {
533
+ return '请输入材料单价'
534
+ }
535
+ if (!tempArr[i].f_material_number) {
536
+ return '请输入材料数量'
537
+ }
538
+ }
539
+ /* if (this.materialImges.length == 0) {
540
+ return '材料清单需拍照'
541
+ } */
542
+ return null
543
+
544
+ },
545
+ /*async saveUserFile1() {
546
+ let message = this.getCheckMessage()
547
+ if (message) {
548
+ this.$showMessage(message)
549
+ return
550
+ }
551
+ let imgs = []
552
+ for (let i = 0; i < this.materialImges.length; i++) {
553
+ let it = {}
554
+ if (this.materialImges[i].id) {
555
+ it = {
556
+ f_path: this.materialImges[i].path,
557
+ id: this.materialImges[i].id,
558
+ f_process_id: this.selectdata.f_process_id
559
+ }
560
+ } else {
561
+ it = {
562
+ f_path: this.materialImges[i].path,
563
+ f_process_id: this.selectdata.f_process_id
564
+ }
565
+ }
566
+ imgs.push(it)
567
+ }
568
+ for (let i = 0; i < this.material.length; i++) {
569
+ this.material[i].f_process_id = this.selectdata.f_process_id
570
+ if (isEmpty(this.material[i].f_state)) {
571
+ this.material[i].f_state = '未收费'
572
+ }
573
+ }
574
+ let data = {
575
+ model: this.material,
576
+ imgs: imgs,
577
+ f_process_id: this.selectdata.f_process_id
578
+ }
579
+ console.log('------------------',data)
580
+ new HttpResetClass().load('POST',this.$androidUtil.getProxyUrl() +`/rs/logic/saveMaterialService`, data,{resolveMsg:null,rejectMsg:null}).then(res=>{
581
+ console.log(res)
582
+ this.model.rows=res.data
583
+ }).catch((e)=>{
584
+ console.log("933",e)
585
+ })
586
+ /!* console.log('------------------',data)
587
+ HostApp.__this__ = this
588
+ HostApp.logicWithHint({
589
+ // logic别名,key必须为logic
590
+ 'logic': 'saveMaterialServiceAndroid',
591
+ // 回调执行方法名,key必须为callback
592
+ 'callback': 'javascript:HostApp.__this__.uploadCallback1()',
593
+ // logic执行需要的业务参数
594
+ 'data': data,
595
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
596
+ // 执行回调方法传入key为backresult
597
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
598
+ 'backresult': 1
599
+ }) *!/
600
+ },*/
601
+ uploadCallback1(result) {
602
+
603
+ if (result.state == 'ok' && JSON.parse(result.result).code == 200) {
604
+ this.$showMessage('材料保存成功!!!')
605
+ } else {
606
+ this.$showMessage(JSON.parse(result.result).msg)
607
+ }
608
+ },
609
+ async saveUserFile(type) {
610
+ for (let i = 0; i < this.material.length; i++) {
611
+ this.material[i].f_process_id = this.selectdata.f_process_id
612
+ this.material[i].f_department = Vue.user.f_department_name
613
+ this.material[i].f_fee = this.material[i].f_material_price * this.material[i].f_material_number
614
+ if (isEmpty(this.material[i].f_state)) {
615
+ this.material[i].f_state = null
616
+ }
617
+ }
618
+ await this.saveOrder(type)
619
+ },
620
+ async saveOrder(type) {
621
+ console.log('this.material', this.material)
622
+ let otherdetail = []
623
+ if (this.payNumber == 0) {
624
+ otherdetail.push({
625
+ f_brand_spec: ['报建通气物料 '],
626
+ f_typename: ['材料费'],
627
+ f_typenumber: [],
628
+ f_unitprice: 0,
629
+ f_number: this.material.length
630
+ })
631
+ } else {
632
+ var str="报建通气物料"
633
+ this.material.forEach((row) => {
634
+ if (row.f_material_price != 0) {
635
+ if(row.f_material_name.name=="自闭阀"){
636
+ str="自闭阀"
637
+ }
638
+ otherdetail.push({
639
+ f_brand_spec: [`${str}`],
640
+ f_typename: [`${row.f_material_name.name}`],
641
+ f_typenumber: [`${row.f_typenumber.name}`],
642
+ f_unitprice: row.f_material_price,
643
+ f_number: row.f_material_number,
644
+ f_overlength_unitprice:row.f_overlength_unitprice,
645
+ f_overlength_number:row.f_overlength_number,
646
+ f_discounts_money_detail:row.f_discounts_money_detail,
647
+ f_actual_materials_detail:row.f_actual_materials_detail
648
+ })
649
+ }
650
+ })
651
+ }
652
+
653
+ let param = {
654
+ model: this.material,
655
+ operator_type: type,
656
+ othercharge_id: this.othercharge_id,
657
+ f_process_id: this.selectdata.f_process_id,
658
+ other: {
659
+ "record_userinfo": this.selectdata.model.f_userinfo_id,
660
+ //"f_userfiles_id": '',
661
+ //"f_user_id": '',
662
+ "f_user_name": this.selectdata.model.f_user_name,
663
+ "f_address": this.selectdata.model.f_address,
664
+ "f_user_type": this.selectdata.model.f_user_type,
665
+ "f_gasproperties": "",
666
+ "f_collection": this.payNumber,
667
+ "f_comments": `${Vue.user.name}进行维修材料收费,收费方式-${this.payType} ${this.order.body && this.order.body.tradeNo ? '。支付订单号:' + this.order.body.tradeNo : ''}`,
668
+ "f_payment": this.payType,
669
+ "f_voucher_number": this.selectdata.f_process_id,
670
+ "f_bill_style": "普通收据",
671
+ "f_userinfo_id": this.selectdata.model.f_userinfo_id,
672
+ "f_service_person": Vue.user.name,
673
+ "f_operat_type": "维修收费",
674
+ "f_describe": "",
675
+ "f_serial_id": this.order.body ? this.order.body.tradeNo : null,
676
+ "f_state": type == 'create' ? '无效' : '有效',
677
+ "f_operator": Vue.user.name,
678
+ "f_discounts_money_materials": this.f_discounts_money_materials,
679
+ "f_discounts_money": this.f_discounts_money,
680
+ "f_operatorid": Vue.user.id,
681
+ "f_orgid": Vue.user.orgid,
682
+ "f_orgname": Vue.user.orgs,
683
+ "f_depid": Vue.user.depids,
684
+ "f_depname": Vue.user.f_department_name,
685
+ "t_userfees": "",
686
+ "f_fee_type": "维修费用",
687
+ "f_fee_time": "12",
688
+ "otherdetail": otherdetail
689
+ }
690
+ }
691
+ console.log("要保存了666-------data2", param)
692
+ let res = await new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/saveMaterialService`, param, {
693
+ resolveMsg: null,
694
+ rejectMsg: null
695
+ })
696
+ console.log('res.data', res.data)
697
+ if (res.data.code == 200) {
698
+ if (type === 'create') {
699
+ // this.$showMessage('收费记录创建成功!!!')
700
+ this.othercharge_id = res.data.othercharge_id
701
+ // this.$emit('aftersave')
702
+ } else {
703
+ this.$showMessage('材料保存成功!!!')
704
+ this.$emit('aftersave')
705
+ }
706
+
707
+ } else {
708
+ this.$showMessage(res.data.msg)
709
+ }
710
+ },
711
+ uploadCallback(result) {
712
+ if (result.state == 'ok' && JSON.parse(result.result).code == 200) {
713
+ this.$showMessage('材料保存成功!!!')
714
+ } else {
715
+ this.$showMessage(JSON.parse(result.result).msg)
716
+ }
717
+ },
718
+ // 关闭对话框
719
+ closeModal() {
720
+ this.showCharge = false
721
+ this.charge = {
722
+ payment_terms: [{
723
+ f_payment_term: '',
724
+ f_charge_money: '',
725
+ f_amount_words: '',
726
+ f_payment_method: this.charge.f_payment_method
727
+ }]
728
+ }
729
+ },
730
+ // 金额转大写
731
+ handleInput(index) {
732
+ // 通过正则过滤小数点后两位
733
+ console.log('-----------------------')
734
+ this.charge.payment_terms[index].f_charge_money = (this.charge.payment_terms[index].f_charge_money.match(/^\d*(\.?\d{0,2})/g)[0]) || null
735
+ this.charge.payment_terms[index].f_amount_words = this.smalltoBIG(this.charge.payment_terms[index].f_charge_money)
736
+ },
737
+ // 金额转大写
738
+ smalltoBIG(n) {
739
+ let fraction = ['角', '分'];
740
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
741
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
742
+ let head = n < 0 ? '' : '';
743
+ n = Math.abs(n);
744
+
745
+ let s = '';
746
+
747
+ for (var i = 0; i < fraction.length; i++) {
748
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
749
+ }
750
+ s = s || '';
751
+ n = Math.floor(n);
752
+
753
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
754
+ let p = '';
755
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
756
+ p = digit[n % 10] + unit[1][j] + p;
757
+ n = Math.floor(n / 10);
758
+ }
759
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '') + unit[0][i] + s;
760
+ }
761
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
762
+ },
763
+ moneyChange(index) {
764
+ console.log(`当前下标----${index}`)
765
+ if (isEmpty(this.charge.payment_terms[index].f_charge_money) || Number(this.charge.payment_terms[index].f_charge_money) === 0) {
766
+ this.$showMessage('单笔收费不能为0元!!!', 'warning', 3000)
767
+ this.charge.payment_terms[index].f_charge_money = null
768
+ return
769
+ }
770
+ },
771
+ async TimeQrCode() {
772
+ this.qrcodeTimer = setTimeout(() => {
773
+ // 关闭二维码
774
+ this.clearQrCode()
775
+ // 将定时器清除
776
+ this.qrcodeTimer = null;
777
+ clearInterval(this.orderInterval)
778
+ }, 60 * 1000)
779
+
780
+ },
781
+ generateRandomString(length) {
782
+ let result = new Date().getTime().toString()
783
+ const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
784
+ const charactersLength = characters.length;
785
+ for (let i = 0; i < length; i++) {
786
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
787
+ }
788
+ return result.substring(0, 30);
789
+ },
790
+ // 打开二维码
791
+ async openQrCode() {
792
+ const merchantMsg = Vue.config.telephone.ApproveConfig.merchantMsg
793
+ if (!merchantMsg){
794
+ this.$showMessage('未配备商户号,请联系管理员!')
795
+ return
796
+ }
797
+ const outTradeNo = this.generateRandomString(30)
798
+ // 下订单
799
+ let http = new HttpResetClass()
800
+ const val = {
801
+ "body": "燃气费",
802
+ "detail": "燃气费",
803
+ "totalAmount": (this.payNumber * 100).toString(),
804
+ "merchantMsg": merchantMsg,//商户id
805
+ "outTradeNo": outTradeNo,//随机数30位
806
+ "service": "nativePay",//死值
807
+ "tradeType": "wechat_jsapi"//死值
808
+ }
809
+ try {
810
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10001`, {data: val}, {
811
+ resolveMsg: null,
812
+ rejectMsg: null
813
+ })
814
+ if (res.data.status === 200) {
815
+ console.log("调用结果", res.data, res.data.body.url)
816
+ try {
817
+ this.order = res.data
818
+ this.othercharge_id = ''
819
+ await this.saveOrder('create')
820
+ if (this.othercharge_id) {
821
+ this.isTimeout = false
822
+ this.showQrCode = true
823
+ console.log(this.order)
824
+ this.$nextTick(() => {
825
+ this.qrcode(res.data.body.url)
826
+ })
827
+ if (this.order.body.tradeNo) {
828
+ this.timer1 = window.setInterval(this.getOrderInformation, 3000)
829
+ }
830
+ } else {
831
+ this.$showMessage('创建订单失败!')
832
+ }
833
+ } catch (e) {
834
+ this.$showMessage('创建订单失败!')
835
+ }
836
+ } else {
837
+ this.$showMessage('获取二维码失败!')
838
+ }
839
+
840
+ } catch (e) {
841
+ this.$showMessage('获取二维码失败,请检查网络!')
842
+ }
843
+ },
844
+ qrcode(url) {
845
+ new QRCode('qrcode', {
846
+ text: url, // 设置二维码内容或跳转地址
847
+ width: 266, // 设置宽度,单位像素
848
+ height: 266, // 设置高度,单位像素
849
+ correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
850
+ })
851
+ },
852
+ // 获取订单信息
853
+ async getOrderInformation() {
854
+ const merchantMsg = Vue.config.telephone.ApproveConfig.merchantMsg
855
+ // 查询订单信息
856
+ console.log('查询订单信息!!!', this.order)
857
+ try {
858
+ let http = new HttpResetClass()
859
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10003`, {
860
+ data: {
861
+ "service": "queryOrder",
862
+ "outTradeNo": this.order.body.outTradeNo,
863
+ "merchantMsg": merchantMsg,
864
+ "tradeNo": ""
865
+ }
866
+ }, {
867
+ resolveMsg: null,
868
+ rejectMsg: null
869
+ })
870
+ // 支付成功
871
+ this.orderstatus = res.data
872
+ console.log('查询结果=======', res.data)
873
+ if (res.data.status == '200') {
874
+ window.clearInterval(this.timer1)
875
+ console.log('支付成功', this.orderstatus)
876
+ this.saveUserFile('update')
877
+ this.order = {}
878
+ }
879
+ } catch (e) {
880
+ window.clearInterval(this.timer1)
881
+ this.$showMessage('创建订单失败!')
882
+ this.order = {}
883
+ }
884
+ },
885
+ getPaymentTerm() {
886
+ let term = ''
887
+ this.charge.payment_terms.forEach((row) => {
888
+ term += `${row.f_payment_term} `
889
+ })
890
+ return term
891
+ },
892
+ closeQRCode() {
893
+ clearTimeout(this.paymentInterval)
894
+ clearTimeout(this.orderInterval)
895
+ this.timeLeft = 300
896
+ this.closeOrder()
897
+ // 清除二维码
898
+ this.clearQrCode()
899
+ this.showQrCode = false
900
+ },
901
+ clearQrCode() {
902
+ document.getElementById('qrcode').innerHTML = ''
903
+ },
904
+ /* async closeOrder() {
905
+ let data = {
906
+ "flag": "JsApiWeiNan",
907
+ "f_filiale": "weinanchengtou",
908
+ "f_out_trade_no": this.order.f_out_trade_no,// 商户单号
909
+ "isClose": "是",
910
+ "f_sys_trace": this.order.f_sys_trace // 交易流水号
911
+ }
912
+ let http = new HttpResetClass()
913
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/microPayOrderStatus`, data, {
914
+ resolveMsg: null,
915
+ rejectMsg: '关闭失败!!!'
916
+ })
917
+ },*/
918
+ async update() {
919
+ let http = new HttpResetClass()
920
+ for (let i = 0; i < this.material.length; i++) {
921
+ if (this.material[i].f_state == '未收费') {
922
+ this.material[i].f_state = '已收费'
923
+ }
924
+ }
925
+ let data = {
926
+ model: this.material
927
+ }
928
+ let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/logic/saveweinanmaterial', {data: data}, {
929
+ resolveMsg: null,
930
+ rejectMsg: '保存失败'
931
+ })
932
+ this.search()
933
+ },
934
+ async saveother() {
935
+ let http = new HttpResetClass()
936
+ let data1 = {
937
+ tablename: 't_material_service',
938
+ condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
939
+ }
940
+ let res1 = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data1}, {
941
+ resolveMsg: null,
942
+ rejectMsg: '获取数据失败'
943
+ })
944
+ let data = {
945
+ tablename: 't_userfiles',
946
+ condition: `f_userinfo_id = '${this.selectdata.model.f_userinfo_id}'`
947
+ }
948
+ let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
949
+ resolveMsg: null,
950
+ rejectMsg: '获取数据失败'
951
+ })
952
+ let otherdetails = []
953
+ for (let i = 0; i < res1.data.length; i++) {
954
+ otherdetails.push(
955
+ {
956
+ "f_brand_spec": [res1.data[i].f_material_name],
957
+ "f_unitprice": res1.data[i].f_material_price,
958
+ "f_typename": [res1.data[i].f_typename],
959
+ "f_typenumber": [res1.data[i].f_typenumber],
960
+ "f_number": res1.data[i].f_material_number
961
+ }
962
+ )
963
+ }
964
+
965
+ console.log("查询的用户信息", otherdetails)
966
+ let data2 = {
967
+ "record_userinfo": this.selectdata.model.f_userinfo_id,
968
+ "f_userfiles_id": res.data[0].f_userfiles_id,
969
+ "f_user_id": res.data[0].f_user_id,
970
+ "f_user_name": this.selectdata.model.f_user_name,
971
+ "f_address": this.selectdata.model.f_address,
972
+ "f_user_type": this.selectdata.model.f_user_type,
973
+ "f_gasproperties": "",
974
+ "f_collection": this.f_cost_sum,
975
+ "f_comments": "",
976
+ "f_payment": this.charge.f_payment_method,
977
+ "f_voucher_number": "",
978
+ "f_bill_style": "普通收据",
979
+ "f_userinfo_id": this.selectdata.model.f_userinfo_id,
980
+ "f_service_person": Vue.user.name,
981
+ "f_operat_type": "其他收费",
982
+ "f_describe": "",
983
+ "f_state": "有效",
984
+ "f_operator": Vue.user.name,
985
+ "f_operatorid": Vue.user.id,
986
+ "f_orgid": Vue.user.orgid,
987
+ "f_orgname": Vue.user.orgs,
988
+ "f_depid": Vue.user.depids,
989
+ "f_depname": Vue.user.f_department_name,
990
+ "t_userfees": "",
991
+ "f_fee_type": "其他费用",
992
+ "f_fee_time": "12",
993
+ "otherdetail": otherdetails
994
+ }
995
+
996
+ let res2 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/sale_othercharge_logic`, {data: data2}, {
997
+ resolveMsg: null,
998
+ rejectMsg: '保存数据失败'
999
+ })
1000
+ },
1001
+ async shoufei() {
1002
+ let http = new HttpResetClass()
1003
+ let data = {
1004
+ tablename: 't_material_service',
1005
+ condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
1006
+ }
1007
+ let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
1008
+ resolveMsg: null,
1009
+ rejectMsg: '获取数据失败'
1010
+ })
1011
+ if (res.data.length <= 0) {
1012
+ this.$showMessage('请先添加未收费的材料!!!')
1013
+ return
1014
+ }
1015
+ this.f_cost_sum = 0
1016
+ for (let i = 0; i < res.data.length; i++) {
1017
+ this.f_cost_sum += Number(res.data[i].f_fee)
1018
+ }
1019
+ this.showCharge = true
1020
+ this.charge.payment_terms[0].f_charge_money = this.f_cost_sum
1021
+ },
1022
+ accMul(arg1, arg2) {
1023
+ let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
1024
+ try {
1025
+ m += s1.split(".")[1].length
1026
+ } catch (e) {
1027
+ }
1028
+ try {
1029
+ m += s2.split(".")[1].length
1030
+ } catch (e) {
1031
+ }
1032
+ return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
1033
+ },
1034
+ },
1035
+ beforeDestroy() {
1036
+ console.log('销毁了-----111', this.timer1)
1037
+ window.clearInterval(this.timer1)
1038
+ },
1039
+ events: {},
1040
+ computed: {
1041
+ paymentMethod() {
1042
+ return this.$appdata.getParam("付款方式")
1043
+ },
1044
+ paymentTerm() {
1045
+ return this.$appdata.getParam("收费项目")
1046
+ }
1047
+ },
1048
+ watch: {}
1049
+ }
1050
+ </script>
1051
+ <style lang="less" scoped>
1052
+ .head-but {
1053
+ margin-left: 5px;
1054
+ height: 34px;
1055
+ /*background-color: #6aa6e2;*/
1056
+ border-radius: 4px;
1057
+ font-family: PingFang;
1058
+ color: #ffffff;
1059
+ }
1060
+
1061
+ /*清除model中的浮动*/
1062
+ .clearfix:after, .clearfix:before {
1063
+ display: table;
1064
+ }
1065
+
1066
+ .clearfix:after {
1067
+ clear: both;
1068
+ }
1069
+
1070
+ .lab_sty {
1071
+ margin-bottom: 0;
1072
+ display: flex;
1073
+ flex-direction: row-reverse;
1074
+ align-items: center;
1075
+ }
1076
+
1077
+ .row_sty {
1078
+ display: flex;
1079
+ align-items: center;
1080
+ margin: 5px;
1081
+ }
1082
+
1083
+ </style>