sale-client 3.4.110 → 3.4.113

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 (101) hide show
  1. package/.gradle/4.4/fileChanges/last-build.bin +0 -0
  2. package/.gradle/4.4/fileHashes/fileHashes.bin +0 -0
  3. package/.gradle/4.4/fileHashes/fileHashes.lock +0 -0
  4. package/build/dev-server.js +7 -7
  5. package/npm +0 -0
  6. package/package.json +1 -1
  7. package/src/components/FilesManage/MeterinfoTest.vue +0 -1
  8. package/src/components/FilesManage/TemplateManage.vue +167 -167
  9. package/src/components/FilesManage/UserGeneralInfoTest.vue +4 -2
  10. package/src/components/FilesManageNew/UserEssentialInfoTest.vue +1 -1
  11. package/src/components/FilesManageNew/UserGeneralInfoTest.vue +7 -7
  12. package/src/components/charge/business/CardChangeFill.vue +4 -4
  13. package/src/components/charge/business/CardMeterCenter.vue +4 -4
  14. package/src/components/charge/business/FilesComplete.vue +253 -253
  15. package/src/components/charge/business/IOTMeterCenter.vue +801 -801
  16. package/src/components/charge/business/refund/IOTRefund.vue +236 -236
  17. package/src/components/charge/business/refund/RefundManage.vue +28 -28
  18. package/src/components/chargeNew/thirdSurplus.vue +2 -0
  19. package/src/components/meterBook/MeterManger.vue +61 -61
  20. package/src/components/revenue/Common/MeterMessage.vue +184 -184
  21. package/src/components/revenue/HandManager/MeterBookList.vue +488 -488
  22. package/src/components/revenue/HandManager/MeterBookUser.vue +702 -702
  23. package/src/components/revenue/HandManager/OverdueSet.vue +45 -45
  24. package/src/components/revenue/base/leftview/MixPriceInfo.vue +60 -60
  25. package/src/components/revenue/base/leftview/SafeCheck.vue +311 -311
  26. package/src/components/revenue/base/leftview/Stairinfo.vue +156 -156
  27. package/src/components/revenue/base/leftview/meterinfodetail.vue +195 -195
  28. package/src/components/revenue/base/rightview/CardList.vue +477 -478
  29. package/src/components/revenue/comprehen/ComprehenOperation/OtherGas/OtherGas.vue +5 -1
  30. package/src/components/revenue/comprehen/ComprehenOperation/removeTable.vue +1 -1
  31. package/src/components/revenue/comprehen/Maintenance/hand/handListMaintain.vue +33 -10
  32. package/src/components/revenue/comprehen/Maintenance/revenue/StockListmain.vue +7 -7
  33. package/src/components/revenue/comprehen/SpecialUser/BlackList/BlackList.vue +1 -1
  34. package/src/components/revenue/comprehen/SpecialUser/BlackList/BlackListManage.vue +1 -1
  35. package/src/components/revenue/comprehen/handAudit/MeterReadAudit.vue +342 -342
  36. package/src/components/revenue/comprehen/replacement/replacementHandInfoRecord.vue +155 -155
  37. package/src/components/revenue/comprehen/wechatpay/WeChat.vue +62 -62
  38. package/src/components/revenue/machineHandManage/machineDown.vue +1105 -1105
  39. package/src/components/revenue/machineHandManage/machineHand.vue +1 -5
  40. package/src/components/webMeter/MeterManage/WebMeterBatchOperationValve.vue +8 -4
  41. package/src/filiale/{weinan → WEINAN}/AutomaticPurse.vue +0 -0
  42. package/src/filiale/{weinan → WEINAN}/CardList.vue +0 -0
  43. package/src/filiale/{weinan → WEINAN}/CardMeterCenter.vue +0 -0
  44. package/src/filiale/{weinan → WEINAN}/CardMeterChargeCancel.vue +0 -0
  45. package/src/filiale/{weinan → WEINAN}/ChangeMeter.vue +0 -0
  46. package/src/filiale/{weinan → WEINAN}/ChargeList.vue +0 -0
  47. package/src/filiale/{weinan → WEINAN}/ChargeManageNew.vue +0 -0
  48. package/src/filiale/{weinan → WEINAN}/ChargeQueryUser.vue +0 -0
  49. package/src/filiale/{weinan → WEINAN}/ChargeRecordQuery.vue +0 -0
  50. package/src/filiale/{weinan → WEINAN}/DisableManage.vue +0 -0
  51. package/src/filiale/{weinan → WEINAN}/EnableManage.vue +0 -0
  52. package/src/filiale/{weinan → WEINAN}/FileAddressManage.vue +0 -0
  53. package/src/filiale/{weinan → WEINAN}/FileUserAddress.vue +0 -0
  54. package/src/filiale/{weinan → WEINAN}/HighMeter.vue +0 -0
  55. package/src/filiale/{weinan → WEINAN}/IOTMeterCenter.vue +0 -0
  56. package/src/filiale/{weinan → WEINAN}/MachineMeterCenter.vue +0 -0
  57. package/src/filiale/{weinan → WEINAN}/MeterMessage.vue +0 -0
  58. package/src/filiale/{weinan → WEINAN}/MeterinfoTest.vue +0 -0
  59. package/src/filiale/{weinan → WEINAN}/OffGasAddGas.vue +0 -0
  60. package/src/filiale/{weinan → WEINAN}/OtherGas.vue +0 -0
  61. package/src/filiale/{weinan → WEINAN}/OverUseCharge.vue +0 -0
  62. package/src/filiale/{weinan → WEINAN}/RecordCancel.vue +0 -0
  63. package/src/filiale/{weinan → WEINAN}/RecordQueryUser.vue +0 -0
  64. package/src/filiale/{weinan → WEINAN}/ReplaceCardManage.vue +0 -0
  65. package/src/filiale/{weinan → WEINAN}/ShowCardSellGas.vue +0 -0
  66. package/src/filiale/{weinan → WEINAN}/Stairinfo.vue +0 -0
  67. package/src/filiale/{weinan → WEINAN}/TransferManage.vue +0 -0
  68. package/src/filiale/{weinan → WEINAN}/UserBaseInfoNew.vue +0 -0
  69. package/src/filiale/{weinan → WEINAN}/UserEssentialInfoTest.vue +0 -0
  70. package/src/filiale/{weinan → WEINAN}/UserGeneralInfoTest.vue +0 -0
  71. package/src/filiale/{weinan → WEINAN}/UserInfoDetailManageNew.vue +0 -0
  72. package/src/filiale/{weinan → WEINAN}/Userinfo.vue +0 -0
  73. package/src/filiale/{weinan → WEINAN}/gasmove.vue +0 -0
  74. package/src/filiale/{weinan → WEINAN}/meterinfodetail.vue +0 -0
  75. package/src/filiale/{weinan → WEINAN}/plugins/FileManageService.js +0 -0
  76. package/src/filiale/{weinan → WEINAN}/plugins/getTimeService.js +0 -0
  77. package/src/filiale/{weinan → WEINAN}/sale.js +0 -0
  78. package/src/filiale/{weinan → WEINAN}/sale.js~Stashed changes +0 -0
  79. package/src/filiale/{weinan → WEINAN}/static/mainicon//347/237/251/345/275/2421828.png +0 -0
  80. package/src/filiale/alashan/PrintBill.vue +116 -116
  81. package/src/filiale/jingwei/CardHand.vue +742 -742
  82. package/src/filiale/macheng/FilesManageNew/FileUserFiles.vue +743 -0
  83. package/src/filiale/macheng/FilesManageNew/UserEssentialInfoTest.vue +21 -1
  84. package/src/filiale/macheng/UserEssentialInfoTest.vue +4 -2
  85. package/src/filiale/meihekou/MeterinfoTest.vue +0 -1
  86. package/src/filiale/meihekou/PrintBill.vue +140 -140
  87. package/src/filiale/meihekou/ReissueBill.vue +322 -322
  88. package/src/filiale/qianneng/FilesManage/MeterinfoTest.vue +0 -1
  89. package/src/filiale/qianneng/HandManager.vue +1838 -1838
  90. package/src/filiale/qianneng/OtherChargeNew.vue +6 -2
  91. package/src/filiale/qianneng/revenue/comprehen/closeaccount/Batchmanage.vue +58 -58
  92. package/src/filiale/qianneng/sale.js +30 -30
  93. package/src/filiale/qingtongxia/UserGeneralInfoTest.vue +538 -533
  94. package/src/filiale/rongcheng/FilesManageNew/UserGeneralInfoTest.vue +608 -608
  95. package/src/filiale/rongchuang/OtherGas.vue +329 -329
  96. package/src/filiale/tongchuan/CardList.vue +482 -482
  97. package/src/filiale/zhongsheng/rightview/CardList.vue +492 -492
  98. package/src/filiale/zhongsheng/wechatpay/WeChatPayDetail.vue +469 -469
  99. package/src/main.js +1 -1
  100. package/src/plugins/CardService.js +1798 -1798
  101. package/src/plugins/ChangeMeterService.js +756 -756
@@ -1,801 +1,801 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="span" style="overflow-y: auto;">
4
- <validator name='v'>
5
- <form novalidate class="form-horizontal">
6
- <div class="row">
7
- <div class="col-sm-4 form-group" :class="[$v.payment.required ? 'select-error' : '']">
8
- <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
- <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
10
- <v-select v-model="f_payment"
11
- placeholder='请选择'
12
- :value.sync="model.f_payment"
13
- close-on-select
14
- :options='paytype' clear-button v-ref:payment></v-select>
15
- </div>
16
-
17
- <div class="col-sm-4 form-group"
18
- :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
19
- <label for="f_pregas" class=" font_normal_body">预购气量</label>
20
- <input class="input_search" style="width:60%" type="number" id="pregasFocue"
21
- @blur="pregas()" v-model="model.f_pregas"
22
- v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
23
- v-next-el='sk' >
24
- </div>
25
- <!-- <div class="col-sm-4 form-group" v-if="row.f_collection_type == '按金额'">
26
- <label for="f_pregas" class=" font_normal_body">预购气量</label>
27
- <input class="input_search" style="width:60%" type="number" v-model="model.f_pregas" placeholder="预购气量" disabled>
28
- </div>-->
29
-
30
- <div class="col-sm-4 form-group"
31
- :class="[$v.f_preamount.required || $v.f_preamount.dctest? 'has-error' : 'has-success']">
32
- <label for="f_preamount" class=" font_normal_body">预购金额</label>
33
- <input class="input_search" style="width:60%" @blur="preamount()" type="number" v-model="model.f_preamount"
34
- v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ] }'
35
- v-scale="[model.f_preamount, 2]" placeholder="预购金额" >
36
- </div>
37
- </div>
38
- <div class="row" style="margin-top:6px;">
39
- <div class="col-sm-4 form-group" :class="[$v.printstyle.required ? 'select-error' : '']">
40
- <label for="f_print" class="font_normal_body">打印格式</label>
41
- <input type="text" v-show="false" v-model="$refs.printstyle.selectedItems" v-validate:printstyle='{required: true }'>
42
- <v-select id="print"
43
- v-model="f_print"
44
- placeholder='请选择'
45
- :multiple="false"
46
- :value.sync="model.f_print"
47
- :options='printstyle'
48
- close-on-select clear-button v-ref:printstyle>
49
- </v-select>
50
- </div>
51
- <div class="col-sm-4 form-group" v-if="hasLimit&&limitgas">
52
- <label class="font_normal_body">购气上限</label>
53
- <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
54
- v-scale="[maxgas, 2]" placeholder='限购余气' disabled>
55
- </div>
56
- <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
57
- <label class="font_normal_body">金额上限</label>
58
- <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxmoney"
59
- v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
60
- </div>
61
- <div class="col-sm-4 form-group" v-if="!hasLimit">
62
- </div>
63
-
64
- <div class="col-sm-4 form-group"
65
- :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
66
- <label for="f_temp_amount" v-if="row.f_collection_type === '按气量'"
67
- class=" font_normal_body">应收金额</label>
68
- <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
69
- class=" font_normal_body">本次缴费</label>
70
- <input class="input_search" style="width:60%" type="number"
71
- @blur="preamount()" v-model="model.f_totalcost"
72
- v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
73
- v-next-el='sk' v-scale="[model.f_totalcost, 2]" disabled>
74
- </div>
75
- </div>
76
- <div class="row">
77
- <div class="col-sm-4 form-group">
78
- <label for="f_balance" class="font_normal_body">上期结余</label>
79
- <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
80
- v-scale="[model.f_balance, 2]" placeholder="上期结余" disabled>
81
- </div>
82
-
83
- <div class="col-sm-4 form-group">
84
- <label for="f_curbalance" class="font_normal_body">本期结余</label>
85
- <input class="input_search" style="width:60%" type="number" v-model="curbalance"
86
- v-scale="[model.f_curbalance, 2]" placeholder="本期结余" disabled>
87
- </div>
88
-
89
- <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按气量' && model.f_payment!='赠气'"
90
- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
91
- <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
92
- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
93
- v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0), ">=" ] }'
94
- v-el:sk v-scale="[model.f_totalcost, 2]" :disabled="$refs.givechange.promptText != ''">
95
- </div>
96
- <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按气量' && model.f_payment=='赠气'"
97
- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
98
- <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
99
- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
100
- v-el:sk v-scale="[model.f_totalcost, 2]" :disabled="$refs.givechange.promptText != ''">
101
- </div>
102
- <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按金额'">
103
- <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
104
- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
105
- v-el:sk v-scale="[model.f_collection, 2]" disabled>
106
- </div>
107
- <div class="col-sm-1 form-group">
108
- <give-change :curbalance="curbalance" :collection.sync="model.f_collection" v-ref:givechange></give-change>
109
- </div>
110
- </div>
111
- <div class="row" style="margin-top:5px;">
112
- <div class="col-sm-9">
113
- </div>
114
- <div class="col-sm-3">
115
- <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
116
- </div>
117
- </div>
118
- <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
119
- <div class="col-sm-4 form-group">
120
- <label class="font_normal_body">优惠方式</label>
121
- <v-select v-model="model.f_privilege_id" @blur.native.capture="privilegeCalculate"
122
- placeholder='请选择'
123
- :value.sync="model.f_privilege_id"
124
- :options='privilegeList' clear-button value-single>
125
- </v-select>
126
- </div>
127
- <div class="col-sm-4 form-group">
128
- <label for="f_preamount" class=" font_normal_body">&nbsp;优惠金额</label>
129
- <input class="input_search" style="width:60%" type="number" v-model="model.f_privilege_money"
130
- v-scale="[model.f_privilege_money, 2]" placeholder="优惠金额" disabled>
131
- </div>
132
- <div class="col-sm-4 form-group">
133
- <label for="f_preamount" class=" font_normal_body">&nbsp;实际收款</label>
134
- <input class="input_search" style="width:60%" type="number" v-model="model.f_after_discount"
135
- v-scale="[model.f_after_discount, 2]" placeholder="优惠后收款" disabled>
136
- </div>
137
- </div>
138
- <div class="row" v-if="model.f_payment[0].includes('POS')">
139
- <div class="col-sm-4 form-group">
140
- <label for="f_voucher_number" class="font_normal_body">凭证号</label>
141
- <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number" placeholder="凭证号">
142
- </div>
143
- </div>
144
- <div class="row" style="padding-top: 0.5em;">
145
- <div class="col-sm-4" v-if="!mjshow" >
146
- <label for="f_serial_number" class=" font_normal_body">业务单号</label>
147
- <input class="input_search" style="width:60%" type="text"
148
- v-model="model.f_serial_number" placeholder="业务单号">
149
- </div>
150
- <div class="col-sm-4" v-if="mjshow" :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
151
- <label for="f_serial_number" class=" font_normal_body">业务单号</label>
152
- <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
153
- v-model="model.f_serial_number" placeholder="业务单号">
154
- </div>
155
-
156
- <div class="col-sm-8">
157
- <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备&nbsp;注&nbsp;&nbsp;&nbsp;</label>
158
- <input class="input_search" style="width:77%" v-model="model.f_comments" rows="1" placeholder="备注">
159
- </div>
160
- </div>
161
-
162
- <div v-if="paymentModel.length >1">
163
- <div class="row" style="margin-top:10px;" >
164
- <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../../static/juxing.png"/><strong style="margin-left: 4%">付款明细</strong></p>
165
- </div>
166
- <div class="row" style="margin-top:10px;" >
167
- <div class="col-sm-4 form-group " v-for="pay in paymentModel" >
168
- <label class="font_normal_body">{{pay.f_payment}}:</label>
169
- <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
170
- </div>
171
- <div class="col-sm-4 form-group ">
172
- <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
173
- </div>
174
- </div>
175
- </div>
176
- </form>
177
- <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
178
- <print-bill :show="print" :bill-config='config' :bill-data='billData' :data='row' @toggle="close" @printok="printok" v-ref:printbill></print-bill>
179
- <div style="text-align:right; height: 25%">
180
- <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
181
- <strong style="font-size: large" v-if="!config.notShowFormula">计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
182
- <button class="button_search" style="width: max-content" @click="uploadFiles()">上传附件</button>
183
- <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"
184
- :payment.sync="model.f_payment" :payment-data="paytype"
185
- @confirm-payment="confirm()">
186
- </payment-code-button>
187
- <button class="button_search btn-gn" type="submit" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>确认</button>
188
- <button class="button_clear btn-gn" @click="clean()">取消</button>
189
- </div>
190
- </validator>
191
- </div>
192
- <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_after_discount"></payment-code>
193
- </div>
194
- <modal :show.sync="eticket_msg" v-ref:modal large backdrop="false" :width="900">
195
- <header slot="modal-header" class="modal-header">
196
- <button type="button" class="close" @click="eticket_msg = false"><span>&times;</span></button>
197
- <h4 class="modal-title">发票信息</h4>
198
- </header>
199
- <article slot="modal-body" class="modal-body">
200
- <div class="auto select-overspread form-horizontal">
201
- <div class="row auto">
202
- <div class="col-sm-6 form-group form-input-group" :class="[!row.f_paper_name ? 'has-error' : '']">
203
- <label class="control-label">开票名称:</label>
204
- <input class="form-control col-sm-2"
205
- v-model="row.f_paper_name" placeholder="开票名称">
206
- </div>
207
- <div class="col-sm-6 form-group form-input-group">
208
- <nobr class="col-sm-4"><label class="control-label">是否征税:</label></nobr>
209
- <v-select v-model="invoice_is_pax"
210
- placeholder='请选择'
211
- :value.sync="invoice_is_pax"
212
- close-on-select
213
- :width="60"
214
- :value-single="true"
215
- :search="false"
216
- :options='is_pax' clear-button>
217
- </v-select>
218
- </div>
219
- <div class="col-sm-12 form-group form-input-group">
220
- <label class="control-label">开户行及账号:</label>
221
- <input class="form-control col-sm-2"
222
- v-model="row.f_paper_account" placeholder="购方开户行及账号">
223
- </div>
224
- <div class="col-sm-12 form-group form-input-group" :class="[!row.f_taxpayer_id ? 'has-error' : '']">
225
- <label class="control-label">纳税人识别号:</label>
226
- <input class="form-control col-sm-2"
227
- v-model="row.f_taxpayer_id" placeholder="纳税人识别号">
228
- </div>
229
- <div class="col-sm-12 form-group form-input-group" :class="[!row.f_address_phone ? 'has-error' : '']">
230
- <label class="control-label">开票地址电话:</label>
231
- <input class="form-control col-sm-2"
232
- v-model="row.f_address_phone" placeholder="开票地址">
233
- </div>
234
- </div>
235
- </div>
236
- </article>
237
- <footer slot="modal-footer" class="modal-footer">
238
- <button type="button" class="btn button_search"
239
- :disabled="!(row.f_taxpayer_id&&row.f_paper_name&&row.f_address_phone)"
240
- @click='confirm'>确认收费
241
- </button>
242
- </footer>
243
- </modal>
244
- <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
245
- <!--<upload v-if="config.showupload" isremark="true" fusetype="物联网表收费"></upload>-->
246
- <modal :show.sync="showfiles" width="80%"style="width:auto;" v-ref:modal middle backdrop="false">
247
- <article slot="modal-body">
248
- <upload :blodid="model.id" v-ref:upload :fusetype="uploadText" isremark="true" style="width:auto" ></upload>
249
- </article>
250
- <footer slot="modal-footer" class="modal-footer">
251
- </footer>
252
- </modal>
253
- <!--文件上传按钮-->
254
-
255
- </template>
256
- <script>
257
- /**
258
- *综合业务
259
- *卡表收费组件
260
- */
261
-
262
- import {HttpResetClass} from 'vue-client'
263
- import XML from '../../../plugins/ObjTree'
264
-
265
- // 输入金额,换算气量
266
- /* let preamountGen = async function (self) {
267
- let calFee = (self.model.f_totalcost - 0) + (self.row.f_balance - 0)
268
- self.model.f_preamount = calFee
269
- self.model.f_collection = self.model.f_totalcost
270
- } */
271
- let preamountGen = async function (self) {
272
- let calFee = self.model.f_preamount
273
- let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
274
- if (getGas.data.gas) {
275
- if (self.row.f_isdecimal === '是') {
276
- if (self.row.f_alias === 'QiaoSong') {
277
- self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
278
- } else {
279
- self.model.f_pregas = (getGas.data.gas - 0).toFixed(4)
280
- }
281
- self.dymoney = 0
282
- } else {
283
- // 如果不支持小数,将划价出的多余非整数气量进行划价为金额
284
- let tempnum = Math.floor(getGas.data.gas - 0)
285
- if (getGas.data.gas > tempnum) { // getGas.data.gas-tempnum-0
286
- let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
287
- if (dymoney1.data.money) {
288
- self.dymoney = (getGas.data.money - 0).toFixed(2) - (dymoney1.data.money - 0).toFixed(2)
289
- }
290
- } else {
291
- self.dymoney = 0
292
- }
293
- self.model.f_pregas = Math.floor(getGas.data.gas - 0)
294
- }
295
- }
296
- // 不划气量,归零
297
- if (self.config.priceCalculation) {
298
- self.model.f_pregas = 0
299
- }
300
- self.model.f_totalcost = ((self.row.f_balance - 0) > (self.model.f_preamount - 0) ? 0 : ((self.model.f_preamount - 0) - (self.row.f_balance - 0)).toFixed(4))
301
-
302
- self.model.chargeprice = getGas.data.chargeprice
303
- Object.assign(self.model, self.model, getGas.data)
304
- self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(2)
305
- self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
306
- self.model.f_collection = self.model.f_totalcost
307
- self.model.f_preamount = ((getGas.data.chargenum - 0) - (self.dymoney - 0))
308
- if (self.model.f_payment == '赠气') {
309
- self.model.f_totalcost = self.model.f_preamount
310
- self.model.f_collection = 0
311
- }
312
- self.calText(getGas.data.chargeprice)
313
- }
314
- // 输入气量,换算金额
315
- let pregasGen = async function (self) {
316
- if (self.row.f_isdecimal === '是') {
317
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
318
- } else {
319
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
320
- }
321
- if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
322
- self.model.f_meter_type = self.row.f_meter_type
323
- let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
324
- self.model.f_preamount = getAmount.data.chargenum
325
- self.model.f_totalcost = (self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(4)
326
- Object.assign(self.model, self.model, getAmount.data)
327
- self.model.chargeprice = getAmount.data.chargeprice
328
- self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
329
- self.model.f_collection = self.model.f_totalcost
330
- if (self.model.f_payment == '赠气') {
331
- self.model.f_totalcost = getAmount.data.chargenum
332
- self.model.f_collection = 0
333
- }
334
- self.calText(getAmount.data.chargeprice)
335
- }
336
- }
337
-
338
- let IOTChargeGen = async function (self) {
339
- try {
340
- if (self.paymentModel.length === 0) {
341
- self.paymentModel = [{
342
- f_payment: self.model.f_payment[0],
343
- f_money: self.model.f_preamount
344
- }]
345
- }
346
-
347
- self.model.payments = self.paymentModel
348
-
349
- let param = Object.assign({}, {}, self.model)
350
- param.f_payment = self.model.f_payment.toString()
351
- param.f_print = self.model.f_print.toString()
352
- param.f_serial_number = self.model.f_serial_number ? self.model.f_serial_number : ''
353
- // 加入扫码盒付款码支付流水号
354
- param.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
355
- let res = await self.$resetpost('rs/logic/sale_IOTCharge_logic', {data: param}, {
356
- resolveMsg: '物联网收费成功!!',
357
- rejectMsg: '物联网收费出错!!!'
358
- })
359
- let localeSustainMoney = window.localStorage.getItem('sustainMoney')
360
- if (localeSustainMoney != null) {
361
- localeSustainMoney = (localeSustainMoney - 0) + (param.f_collection - 0)
362
- window.localStorage.setItem('sustainMoney', localeSustainMoney)
363
- }
364
- let param1 = []
365
- for (let row of self.resid) {
366
- param1.push({id: row.id})
367
- }
368
- let data = {
369
- param: param1,
370
- f_blobid: res.data.id
371
- }
372
- await self.$resetpost('rs/logic/updatefiles', data)
373
- console.log('物联网收费返回。。。', res.data.id)
374
- // 开始打票
375
- console.log('开始打票', self.config)
376
- if (self.config.hasPrint) {
377
- if (self.model.f_print.indexOf('电子发票') == -1) {
378
- console.log('self.config.hasBillManage', self.config.hasBillManage)
379
- if (self.config.hasBillManage) {
380
- // 启用发票管理,获取票据管理中的票号并存储记录
381
- self.row.id = res.data.id
382
- self.row.f_bill_type = '物联网收费'
383
- self.row.f_bill_style = self.model.f_print[0]
384
- self.print = true
385
- } else {
386
- self.row.id = res.data.id
387
- self.print = true
388
- }
389
- } else if (self.config.printType === '国税发票') {
390
- // TODO
391
- } else if (self.model.f_print[0] === '电子发票') {
392
- self.eticket_show = true
393
- await self.$refs.eticketbill.openETicket([res.data.id], self.row, self.invoice_show_gas, self.invoice_is_pax, '物联网收费')
394
-
395
- // self.$CommonService.openEticket(res.data.id, '其他收费')
396
- // self.$dispatch('success')
397
- }
398
- } else {
399
- self.$dispatch('success')
400
- }
401
- } catch (error) {
402
- if (error.status === 301) {
403
- self.$dispatch('refresh')
404
- } else {
405
- if (error) {
406
- self.$showAlert(error, 'danger', 0)
407
- }
408
- }
409
-
410
- self.$dispatch('refresh')
411
- }
412
- }
413
- let asyncCardMeterCenter = async function (self) {
414
- await self.$getConfig(self, 'IOTMeterCenter')
415
- console.log('卡表收费config', self.config)
416
- // 默认打印格式
417
- self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
418
- self.model.f_payment = [self.config.payment]
419
- self.mulPrint = self.config.printType instanceof Array
420
-
421
- // 获取当前票号用
422
- self.model.f_use_type = self.config.billType
423
- self.model.f_bill_type = self.model.f_print
424
- self.hasValidateBill = self.config.hasBillManage
425
-
426
- // 判断限购
427
- let limit_param = {
428
- f_userinfo_id: self.row.f_userinfo_id,
429
- f_user_id: self.row.f_user_id,
430
- f_stairprice_id: self.row.f_stairprice_id
431
- }
432
- let getLimit = await self.$resetpost('rs/logic/sale_getLimitGas', {data: limit_param}, {resolveMsg: null, rejectMsg: '获取限购值失败!!'})
433
- console.log('获取限购值', getLimit)
434
- self.hasLimit = getLimit.data.hasLimit
435
- if (self.hasLimit) {
436
- if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
437
- if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
438
- self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
439
- self.$dispatch('refresh')
440
- } else {
441
- if (getLimit.data.f_limit_value) {
442
- self.maxgas = (getLimit.data.f_limit_value - 0)
443
- self.limitgas = true
444
- }
445
- if (getLimit.data.f_limit_amount) {
446
- self.maxmoney = (getLimit.data.f_limit_amount - 0)
447
- self.limitmoney = true
448
- }
449
- }
450
- }
451
- }
452
- }
453
- export default {
454
- title: '卡表收费',
455
- data () {
456
- return {
457
- resid: [], // 存放新增的f_files表中id
458
- config: {
459
- notShowFormula: false, // 不显示计算公式,默认显示
460
- priceCalculation: false, // 划气量控制
461
- showupload: true, // 默认不显示附件上传组件
462
- hasPrint: false, // 默认打票
463
- hasBillManage: false, // 默认不启用发票管理
464
- billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
465
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
466
- payment: '现金缴费'
467
- },
468
- model: {
469
- f_purchase: 0,
470
- f_payment: [],
471
- f_pregas: 0,
472
- f_preamount: 0,
473
- f_totalcost: 0,
474
- f_curbalance: 0,
475
- f_collection: '',
476
- f_balance: 0,
477
- f_print: [],
478
- f_meter_type: '',
479
- f_voucher_number: '',
480
- f_privilege_id: 0,
481
- f_privilege_money: 0,
482
- f_after_discount: 0
483
- },
484
- eticket_msg: false,
485
- eticket_show: false,
486
- invoice_is_pax: '不征税',
487
- is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
488
-
489
- calculatedetail: '',
490
- // 启用发票管理需要对票号进行验证
491
- hasValidateBill: false,
492
- validateOk: false,
493
-
494
- print: false,
495
- billData: {
496
- url: 'rs/report/iot_bill',
497
- operator: this.$login.f.name,
498
- billnumber: ''
499
- },
500
- hasLimit: false,
501
- maxgas: 99999999, // 限购
502
- maxmoney: 99999999,
503
- limitmoney: false,
504
- limitgas: false,
505
- paymentModel: [], // 多笔付款方式
506
-
507
- mulPrint: false,
508
- clickConfirm: false, // 控制确认按钮只能点击一次
509
- // 下拉框值
510
- paytype: this.$appdata.getParam('付款方式'),
511
- printstyle: this.$appdata.getParam('打印格式'),
512
- privilegeList: [{label: '无优惠', value: '0'}],
513
- showfiles: false,
514
- serialShow: false,
515
- mjshow: false,
516
- dymoney: 0
517
- }
518
- },
519
- props: ['row'],
520
- mounted() {
521
- this.$refs.email.focus()
522
- },
523
- ready () {
524
- this.paytype = this.$appdata.getParam('付款方式')
525
- if (!this.$login.r.includes('免交充值付款')) {
526
- this.paytype = this.paytype.filter((item) => {
527
- return item.label != '免交'
528
- })
529
- }
530
- // this.getPurchase()
531
- this.model.f_price_id = this.row.f_price_id
532
- this.model.f_user_id = this.row.f_user_id
533
- this.model.f_userfiles_id = this.row.f_userfiles_id
534
- this.model.f_userinfo_id = this.row.f_userinfo_id
535
- this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
536
- if (this.row.f_collection_type == '按金额') {
537
- this.model.f_preamount = ''
538
- this.model.f_pregas = 0
539
- }
540
- document.getElementById('pregasFocue').focus()
541
- asyncCardMeterCenter(this)
542
- },
543
- watch: {
544
- 'model.f_payment.length' (val) {
545
- console.log('付款方式多选。。', val)
546
- if (val > 1 && !this.model.f_preamount) {
547
- this.model.f_payment = ['现金缴费']
548
- this.$showAlert('请先计算付款金额', 'warning', 2000)
549
- } else {
550
- this.paymentModel = []
551
-
552
- this.model.f_payment.forEach((res) => {
553
- let temp = {
554
- f_payment: res,
555
- f_money: 0
556
- }
557
- this.paymentModel.push(temp)
558
- })
559
- this.$resetValidation()
560
-
561
- // 获取计算优惠
562
- this.getPrivilegeList()
563
- }
564
- },
565
- 'model.f_collection' (val) {
566
- // 获取计算优惠
567
- this.getPrivilegeList()
568
- },
569
- 'model.f_payment' (val) {
570
- if (val == '免交') {
571
- this.mjshow = true
572
- } else if (val == '赠气' && (this.model.f_preamount || this.model.f_preamount != '')) {
573
- if (this.row.f_collection_type == '按气量') {
574
- this.pregas()
575
- } else {
576
- this.preamount()
577
- }
578
- } else {
579
- this.mjshow = false
580
- }
581
- if (this.row.f_collection_type == '按气量') {
582
- this.pregas()
583
- } else {
584
- this.preamount()
585
- }
586
- }
587
- },
588
- events: {
589
- // 删除Resid数组元素
590
- 'delResid' (val) {
591
- this.resid.$remove({id: val, f_biobid: ''})
592
- // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
593
- },
594
- // 增加Resid数组元素
595
- 'resid' (val) {
596
- console.log('-=', val)
597
- this.resid.push({id: val, f_biobid: ''})
598
- }
599
- },
600
- methods: {
601
- // 校验发票信息
602
- checkInvoiceMsg () {
603
- if (this.model.f_print[0] === '电子发票') {
604
- if (!this.row.f_taxpayer_id) {
605
- this.row.f_taxpayer_id = this.row.f_idnumber
606
- }
607
- if (!this.row.f_paper_name) {
608
- this.row.f_paper_name = this.row.f_user_name
609
- }
610
- if (!this.row.f_address_phone) {
611
- this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
612
- }
613
- this.eticket_msg = true
614
- } else {
615
- this.confirm()
616
- }
617
- },
618
- eticket_toggle () {
619
- this.eticket_show = false
620
- this.$dispatch('success')
621
- },
622
- uploadFiles () {
623
- this.showfiles = !this.showfiles
624
- },
625
- async confirm () {
626
- let res = await this.$showMessage(`确定对客户${this.row.f_user_name}进行物联网表缴费吗?`, ['confirm', 'cancel'])
627
- if (res != 'confirm') return
628
- // 先调用付款码支付组件流程
629
- let ss = await this.$refs.paymentcode.flowPath()
630
- this.$refs.paymentcode.paymentCodeShow = false
631
- console.log('付款码操作返回', ss)
632
- if (!ss.result) return
633
- this.eticket_msg = false
634
- this.clickConfirm = true
635
- this.model.f_curbalance = this.curbalance
636
- this.$dispatch('no-button')
637
- console.log('model and row', this.model, this.row)
638
- this.model.f_userinfo_id = this.row.f_userinfo_id
639
- this.model.f_userfiles_id = this.row.f_userfiles_id
640
- this.model.f_user_id = this.row.f_user_id
641
- this.model.userinfo_version = this.row.userinfo_version
642
- this.model.version = this.row.version
643
- this.model.f_total_fee = (this.row.f_total_fee - 0) + (this.model.f_preamount - 0)
644
- this.model.f_total_gas = (this.row.f_total_gas - 0) + (this.model.f_pregas - 0)
645
- this.model.f_operator = this.$login.f.name
646
- this.model.f_operatorid = this.$login.f.id
647
- this.model.f_orgid = this.$login.f.orgid
648
- this.model.f_orgname = this.$login.f.orgs
649
- this.model.f_depid = this.$login.f.depids
650
- this.model.f_depname = this.$login.f.deps
651
- IOTChargeGen(this)
652
- },
653
- clean () {
654
- this.$info('取消操作')
655
- this.$dispatch('refresh', this.row)
656
- },
657
- validateBill (val) {
658
- this.validateOk = !val.isOk
659
- this.billData.bill = val.bill
660
- },
661
- printok () {
662
- // 收据打完,判断是否还有其他票据进行请求
663
- for (let i = 0; i < this.model.f_print.length; i++) {
664
- if (this.model.f_print[i] === '电子发票') {
665
- this.$CommonService.openEticket(this.row.id, '售气收费')
666
- }
667
- }
668
- this.$dispatch('success')
669
- },
670
- pregas () {
671
- this.dymoney = 0
672
- if (this.model.f_pregas && this.model.f_pregas > 0) {
673
- try {
674
- pregasGen(this)
675
- } catch (error) {
676
- this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
677
- this.$dispatch('error', '发卡售气', this.model, error)
678
- }
679
- } else {
680
- this.model.f_pregas = null
681
- }
682
- },
683
- preamount () {
684
- if (this.model.f_preamount && this.model.f_preamount > 0) {
685
- try {
686
- preamountGen(this)
687
- } catch (error) {
688
- this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
689
- this.$dispatch('error', '发卡售气', this.model, error)
690
- }
691
- } else {
692
- this.model.f_preamount = null
693
- }
694
- },
695
- calText (val) {
696
- let str = ''
697
- val.forEach((item) => {
698
- str = str + item.f_price + ' x ' + item.f_gas + '+'
699
- })
700
- str = str.slice(0, str.length - 1)
701
- this.calculatedetail = str
702
- },
703
- close () {
704
- this.print = false
705
- this.clean()
706
- },
707
- // 根据选择的付款方式 获取优惠列表
708
- async getPrivilegeList () {
709
- // 初始化下拉选择列表
710
- this.privilegeList = [{label: '无优惠', value: '0'}]
711
- // 初始为无优惠
712
- this.model.f_privilege_id = '0'
713
- if (this.model.f_payment && this.model.f_payment.length) {
714
- // 查询条件
715
- let payments = JSON.stringify(this.model.f_payment)
716
- payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
717
- let HttpReset = new HttpResetClass()
718
- let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
719
- data: {
720
- items: 'id,f_privilege_name,f_privilege_type',
721
- tablename: 't_privilege',
722
- condition: `f_payment in ${payments} and f_gasproperties = '${this.row.f_gasproperties}' and f_user_type = '${this.row.f_user_type}' and f_perform_date <= GETDATE() and f_end_date >= GETDATE() and f_state = '有效'`,
723
- orderitem: 'id'
724
- }
725
- }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
726
- // 查询结果放到下拉列表
727
- for (let p of privilege.data) {
728
- this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
729
- }
730
- this.privilegeCalculate()
731
- }
732
- },
733
- // 优惠计算
734
- async privilegeCalculate () {
735
- // 初始化减免金额
736
- this.model.f_privilege_money = 0
737
- this.model.f_after_discount = this.model.f_collection
738
- // 判断是否是自定义优惠
739
- if (parseInt(this.data.f_privilege_id)) {
740
- for (let p of this.privilegeList) {
741
- if (p.value == this.data.f_privilege_id && p.type == '自定义') {
742
- this.data.f_privilege_money = window.prompt('请输入你想优惠的金额')
743
- if (!(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money)) {
744
- this.$showMessage('金额输入格式不正确!')
745
- this.data.f_privilege_money = 0
746
- return
747
- }
748
- if ((this.data.f_privilege_money - 0) >= this.data.f_collection) {
749
- this.$showMessage('减免金额不能大于等于收款金额')
750
- this.data.f_privilege_money = 0
751
- return
752
- }
753
- }
754
- }
755
- }
756
- // 优惠方式, 收款 缺一不计算
757
- if (this.model.f_payment && this.model.f_payment.length && parseInt(this.model.f_privilege_id) && this.model.f_collection) {
758
- let c = {
759
- f_privilege_id: this.model.f_privilege_id,
760
- f_collection: this.model.f_collection,
761
- f_privilege_money: this.data.f_privilege_money
762
- }
763
- let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
764
- // 减免金额
765
- this.model.f_privilege_money = privilegeData.data.f_privilege_money
766
- // 减免后收款金额
767
- this.model.f_after_discount = privilegeData.data.f_collection
768
- }
769
- }
770
- },
771
- computed: {
772
- authArr () {
773
- return this.$login.r ? this.$login.r : []
774
- },
775
- 'curbalance' () {
776
- if (this.model.f_payment == '赠气') {
777
- return this.row.f_balance
778
- }
779
- if (this.model.f_preamount) {
780
- return ((this.model.f_collection - 0) - (this.model.f_preamount - 0) + (this.row.f_balance - 0)).toFixed(2) - 0
781
- } else {
782
- return 0
783
- }
784
- },
785
- 'islegal' () {
786
- if (this.paymentModel.length > 1 && this.model.f_collection) {
787
- let sum = 0
788
- this.paymentModel.forEach((res) => {
789
- sum += (res.f_money - 0)
790
- })
791
- return (this.model.f_collection - 0) === (sum - 0)
792
- } else {
793
- return true
794
- }
795
- }
796
- }
797
- }
798
- </script>
799
-
800
- <style>
801
- </style>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="span" style="overflow-y: auto;">
4
+ <validator name='v'>
5
+ <form novalidate class="form-horizontal">
6
+ <div class="row">
7
+ <div class="col-sm-4 form-group" :class="[$v.payment.required ? 'select-error' : '']">
8
+ <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
10
+ <v-select v-model="f_payment"
11
+ placeholder='请选择'
12
+ :value.sync="model.f_payment"
13
+ close-on-select
14
+ :options='paytype' clear-button v-ref:payment></v-select>
15
+ </div>
16
+
17
+ <div class="col-sm-4 form-group"
18
+ :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
19
+ <label for="f_pregas" class=" font_normal_body">预购气量</label>
20
+ <input class="input_search" style="width:60%" type="number" id="pregasFocue"
21
+ @blur="pregas()" v-model="model.f_pregas"
22
+ v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
23
+ v-next-el='sk' >
24
+ </div>
25
+ <!-- <div class="col-sm-4 form-group" v-if="row.f_collection_type == '按金额'">
26
+ <label for="f_pregas" class=" font_normal_body">预购气量</label>
27
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_pregas" placeholder="预购气量" disabled>
28
+ </div>-->
29
+
30
+ <div class="col-sm-4 form-group"
31
+ :class="[$v.f_preamount.required || $v.f_preamount.dctest? 'has-error' : 'has-success']">
32
+ <label for="f_preamount" class=" font_normal_body">预购金额</label>
33
+ <input class="input_search" style="width:60%" @blur="preamount()" type="number" v-model="model.f_preamount"
34
+ v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ] }'
35
+ v-scale="[model.f_preamount, 2]" placeholder="预购金额" >
36
+ </div>
37
+ </div>
38
+ <div class="row" style="margin-top:6px;">
39
+ <div class="col-sm-4 form-group" :class="[$v.printstyle.required ? 'select-error' : '']">
40
+ <label for="f_print" class="font_normal_body">打印格式</label>
41
+ <input type="text" v-show="false" v-model="$refs.printstyle.selectedItems" v-validate:printstyle='{required: true }'>
42
+ <v-select id="print"
43
+ v-model="f_print"
44
+ placeholder='请选择'
45
+ :multiple="false"
46
+ :value.sync="model.f_print"
47
+ :options='printstyle'
48
+ close-on-select clear-button v-ref:printstyle>
49
+ </v-select>
50
+ </div>
51
+ <div class="col-sm-4 form-group" v-if="hasLimit&&limitgas">
52
+ <label class="font_normal_body">购气上限</label>
53
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
54
+ v-scale="[maxgas, 2]" placeholder='限购余气' disabled>
55
+ </div>
56
+ <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
57
+ <label class="font_normal_body">金额上限</label>
58
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxmoney"
59
+ v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
60
+ </div>
61
+ <div class="col-sm-4 form-group" v-if="!hasLimit">
62
+ </div>
63
+
64
+ <div class="col-sm-4 form-group"
65
+ :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
66
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按气量'"
67
+ class=" font_normal_body">应收金额</label>
68
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
69
+ class=" font_normal_body">本次缴费</label>
70
+ <input class="input_search" style="width:60%" type="number"
71
+ @blur="preamount()" v-model="model.f_totalcost"
72
+ v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
73
+ v-next-el='sk' v-scale="[model.f_totalcost, 2]" disabled>
74
+ </div>
75
+ </div>
76
+ <div class="row">
77
+ <div class="col-sm-4 form-group">
78
+ <label for="f_balance" class="font_normal_body">上期结余</label>
79
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
80
+ v-scale="[model.f_balance, 2]" placeholder="上期结余" disabled>
81
+ </div>
82
+
83
+ <div class="col-sm-4 form-group">
84
+ <label for="f_curbalance" class="font_normal_body">本期结余</label>
85
+ <input class="input_search" style="width:60%" type="number" v-model="curbalance"
86
+ v-scale="[model.f_curbalance, 2]" placeholder="本期结余" disabled>
87
+ </div>
88
+
89
+ <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按气量' && model.f_payment!='赠气'"
90
+ :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
91
+ <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
92
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
93
+ v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0), ">=" ] }'
94
+ v-el:sk v-scale="[model.f_totalcost, 2]" :disabled="$refs.givechange.promptText != ''">
95
+ </div>
96
+ <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按气量' && model.f_payment=='赠气'"
97
+ :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
98
+ <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
99
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
100
+ v-el:sk v-scale="[model.f_totalcost, 2]" :disabled="$refs.givechange.promptText != ''">
101
+ </div>
102
+ <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按金额'">
103
+ <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
104
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
105
+ v-el:sk v-scale="[model.f_collection, 2]" disabled>
106
+ </div>
107
+ <div class="col-sm-1 form-group">
108
+ <give-change :curbalance="curbalance" :collection.sync="model.f_collection" v-ref:givechange></give-change>
109
+ </div>
110
+ </div>
111
+ <div class="row" style="margin-top:5px;">
112
+ <div class="col-sm-9">
113
+ </div>
114
+ <div class="col-sm-3">
115
+ <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
116
+ </div>
117
+ </div>
118
+ <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
119
+ <div class="col-sm-4 form-group">
120
+ <label class="font_normal_body">优惠方式</label>
121
+ <v-select v-model="model.f_privilege_id" @blur.native.capture="privilegeCalculate"
122
+ placeholder='请选择'
123
+ :value.sync="model.f_privilege_id"
124
+ :options='privilegeList' clear-button value-single>
125
+ </v-select>
126
+ </div>
127
+ <div class="col-sm-4 form-group">
128
+ <label for="f_preamount" class=" font_normal_body">&nbsp;优惠金额</label>
129
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_privilege_money"
130
+ v-scale="[model.f_privilege_money, 2]" placeholder="优惠金额" disabled>
131
+ </div>
132
+ <div class="col-sm-4 form-group">
133
+ <label for="f_preamount" class=" font_normal_body">&nbsp;实际收款</label>
134
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_after_discount"
135
+ v-scale="[model.f_after_discount, 2]" placeholder="优惠后收款" disabled>
136
+ </div>
137
+ </div>
138
+ <div class="row" v-if="model.f_payment[0].includes('POS')">
139
+ <div class="col-sm-4 form-group">
140
+ <label for="f_voucher_number" class="font_normal_body">凭证号</label>
141
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number" placeholder="凭证号">
142
+ </div>
143
+ </div>
144
+ <div class="row" style="padding-top: 0.5em;">
145
+ <div class="col-sm-4" v-if="!mjshow" >
146
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
147
+ <input class="input_search" style="width:60%" type="text"
148
+ v-model="model.f_serial_number" placeholder="业务单号">
149
+ </div>
150
+ <div class="col-sm-4" v-if="mjshow" :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
151
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
152
+ <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
153
+ v-model="model.f_serial_number" placeholder="业务单号">
154
+ </div>
155
+
156
+ <div class="col-sm-8">
157
+ <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备&nbsp;注&nbsp;&nbsp;&nbsp;</label>
158
+ <input class="input_search" style="width:77%" v-model="model.f_comments" rows="1" placeholder="备注">
159
+ </div>
160
+ </div>
161
+
162
+ <div v-if="paymentModel.length >1">
163
+ <div class="row" style="margin-top:10px;" >
164
+ <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../../static/juxing.png"/><strong style="margin-left: 4%">付款明细</strong></p>
165
+ </div>
166
+ <div class="row" style="margin-top:10px;" >
167
+ <div class="col-sm-4 form-group " v-for="pay in paymentModel" >
168
+ <label class="font_normal_body">{{pay.f_payment}}:</label>
169
+ <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
170
+ </div>
171
+ <div class="col-sm-4 form-group ">
172
+ <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </form>
177
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
178
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' :data='row' @toggle="close" @printok="printok" v-ref:printbill></print-bill>
179
+ <div style="text-align:right; height: 25%">
180
+ <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
181
+ <strong style="font-size: large" v-if="!config.notShowFormula">计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
182
+ <button class="button_search" style="width: max-content" @click="uploadFiles()">上传附件</button>
183
+ <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"
184
+ :payment.sync="model.f_payment" :payment-data="paytype"
185
+ @confirm-payment="confirm()">
186
+ </payment-code-button>
187
+ <button class="button_search btn-gn" type="submit" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>确认</button>
188
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
189
+ </div>
190
+ </validator>
191
+ </div>
192
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_after_discount"></payment-code>
193
+ </div>
194
+ <modal :show.sync="eticket_msg" v-ref:modal large backdrop="false" :width="900">
195
+ <header slot="modal-header" class="modal-header">
196
+ <button type="button" class="close" @click="eticket_msg = false"><span>&times;</span></button>
197
+ <h4 class="modal-title">发票信息</h4>
198
+ </header>
199
+ <article slot="modal-body" class="modal-body">
200
+ <div class="auto select-overspread form-horizontal">
201
+ <div class="row auto">
202
+ <div class="col-sm-6 form-group form-input-group" :class="[!row.f_paper_name ? 'has-error' : '']">
203
+ <label class="control-label">开票名称:</label>
204
+ <input class="form-control col-sm-2"
205
+ v-model="row.f_paper_name" placeholder="开票名称">
206
+ </div>
207
+ <div class="col-sm-6 form-group form-input-group">
208
+ <nobr class="col-sm-4"><label class="control-label">是否征税:</label></nobr>
209
+ <v-select v-model="invoice_is_pax"
210
+ placeholder='请选择'
211
+ :value.sync="invoice_is_pax"
212
+ close-on-select
213
+ :width="60"
214
+ :value-single="true"
215
+ :search="false"
216
+ :options='is_pax' clear-button>
217
+ </v-select>
218
+ </div>
219
+ <div class="col-sm-12 form-group form-input-group">
220
+ <label class="control-label">开户行及账号:</label>
221
+ <input class="form-control col-sm-2"
222
+ v-model="row.f_paper_account" placeholder="购方开户行及账号">
223
+ </div>
224
+ <div class="col-sm-12 form-group form-input-group" :class="[!row.f_taxpayer_id ? 'has-error' : '']">
225
+ <label class="control-label">纳税人识别号:</label>
226
+ <input class="form-control col-sm-2"
227
+ v-model="row.f_taxpayer_id" placeholder="纳税人识别号">
228
+ </div>
229
+ <div class="col-sm-12 form-group form-input-group" :class="[!row.f_address_phone ? 'has-error' : '']">
230
+ <label class="control-label">开票地址电话:</label>
231
+ <input class="form-control col-sm-2"
232
+ v-model="row.f_address_phone" placeholder="开票地址">
233
+ </div>
234
+ </div>
235
+ </div>
236
+ </article>
237
+ <footer slot="modal-footer" class="modal-footer">
238
+ <button type="button" class="btn button_search"
239
+ :disabled="!(row.f_taxpayer_id&&row.f_paper_name&&row.f_address_phone)"
240
+ @click='confirm'>确认收费
241
+ </button>
242
+ </footer>
243
+ </modal>
244
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
245
+ <!--<upload v-if="config.showupload" isremark="true" fusetype="物联网表收费"></upload>-->
246
+ <modal :show.sync="showfiles" width="80%"style="width:auto;" v-ref:modal middle backdrop="false">
247
+ <article slot="modal-body">
248
+ <upload :blodid="model.id" v-ref:upload :fusetype="uploadText" isremark="true" style="width:auto" ></upload>
249
+ </article>
250
+ <footer slot="modal-footer" class="modal-footer">
251
+ </footer>
252
+ </modal>
253
+ <!--文件上传按钮-->
254
+
255
+ </template>
256
+ <script>
257
+ /**
258
+ *综合业务
259
+ *卡表收费组件
260
+ */
261
+
262
+ import {HttpResetClass} from 'vue-client'
263
+ import XML from '../../../plugins/ObjTree'
264
+
265
+ // 输入金额,换算气量
266
+ /* let preamountGen = async function (self) {
267
+ let calFee = (self.model.f_totalcost - 0) + (self.row.f_balance - 0)
268
+ self.model.f_preamount = calFee
269
+ self.model.f_collection = self.model.f_totalcost
270
+ } */
271
+ let preamountGen = async function (self) {
272
+ let calFee = self.model.f_preamount
273
+ let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
274
+ if (getGas.data.gas) {
275
+ if (self.row.f_isdecimal === '是') {
276
+ if (self.row.f_alias === 'QiaoSong') {
277
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
278
+ } else {
279
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(4)
280
+ }
281
+ self.dymoney = 0
282
+ } else {
283
+ // 如果不支持小数,将划价出的多余非整数气量进行划价为金额
284
+ let tempnum = Math.floor(getGas.data.gas - 0)
285
+ if (getGas.data.gas > tempnum) { // getGas.data.gas-tempnum-0
286
+ let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
287
+ if (dymoney1.data.money) {
288
+ self.dymoney = (getGas.data.money - 0).toFixed(2) - (dymoney1.data.money - 0).toFixed(2)
289
+ }
290
+ } else {
291
+ self.dymoney = 0
292
+ }
293
+ self.model.f_pregas = Math.floor(getGas.data.gas - 0)
294
+ }
295
+ }
296
+ // 不划气量,归零
297
+ if (self.config.priceCalculation) {
298
+ self.model.f_pregas = 0
299
+ }
300
+ self.model.f_totalcost = ((self.row.f_balance - 0) > (self.model.f_preamount - 0) ? 0 : ((self.model.f_preamount - 0) - (self.row.f_balance - 0)).toFixed(4))
301
+
302
+ self.model.chargeprice = getGas.data.chargeprice
303
+ Object.assign(self.model, self.model, getGas.data)
304
+ self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(2)
305
+ self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
306
+ self.model.f_collection = self.model.f_totalcost
307
+ self.model.f_preamount = ((getGas.data.chargenum - 0) - (self.dymoney - 0))
308
+ if (self.model.f_payment == '赠气') {
309
+ self.model.f_totalcost = self.model.f_preamount
310
+ self.model.f_collection = 0
311
+ }
312
+ self.calText(getGas.data.chargeprice)
313
+ }
314
+ // 输入气量,换算金额
315
+ let pregasGen = async function (self) {
316
+ if (self.row.f_isdecimal === '是') {
317
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
318
+ } else {
319
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
320
+ }
321
+ if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
322
+ self.model.f_meter_type = self.row.f_meter_type
323
+ let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
324
+ self.model.f_preamount = getAmount.data.chargenum
325
+ self.model.f_totalcost = (self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(4)
326
+ Object.assign(self.model, self.model, getAmount.data)
327
+ self.model.chargeprice = getAmount.data.chargeprice
328
+ self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
329
+ self.model.f_collection = self.model.f_totalcost
330
+ if (self.model.f_payment == '赠气') {
331
+ self.model.f_totalcost = getAmount.data.chargenum
332
+ self.model.f_collection = 0
333
+ }
334
+ self.calText(getAmount.data.chargeprice)
335
+ }
336
+ }
337
+
338
+ let IOTChargeGen = async function (self) {
339
+ try {
340
+ if (self.paymentModel.length === 0) {
341
+ self.paymentModel = [{
342
+ f_payment: self.model.f_payment[0],
343
+ f_money: self.model.f_preamount
344
+ }]
345
+ }
346
+
347
+ self.model.payments = self.paymentModel
348
+
349
+ let param = Object.assign({}, {}, self.model)
350
+ param.f_payment = self.model.f_payment.toString()
351
+ param.f_print = self.model.f_print.toString()
352
+ param.f_serial_number = self.model.f_serial_number ? self.model.f_serial_number : ''
353
+ // 加入扫码盒付款码支付流水号
354
+ param.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
355
+ let res = await self.$resetpost('rs/logic/sale_IOTCharge_logic', {data: param}, {
356
+ resolveMsg: '物联网收费成功!!',
357
+ rejectMsg: '物联网收费出错!!!'
358
+ })
359
+ let localeSustainMoney = window.localStorage.getItem('sustainMoney')
360
+ if (localeSustainMoney != null) {
361
+ localeSustainMoney = (localeSustainMoney - 0) + (param.f_collection - 0)
362
+ window.localStorage.setItem('sustainMoney', localeSustainMoney)
363
+ }
364
+ let param1 = []
365
+ for (let row of self.resid) {
366
+ param1.push({id: row.id})
367
+ }
368
+ let data = {
369
+ param: param1,
370
+ f_blobid: res.data.id
371
+ }
372
+ await self.$resetpost('rs/logic/updatefiles', data)
373
+ console.log('物联网收费返回。。。', res.data.id)
374
+ // 开始打票
375
+ console.log('开始打票', self.config)
376
+ if (self.config.hasPrint) {
377
+ if (self.model.f_print.indexOf('电子发票') == -1) {
378
+ console.log('self.config.hasBillManage', self.config.hasBillManage)
379
+ if (self.config.hasBillManage) {
380
+ // 启用发票管理,获取票据管理中的票号并存储记录
381
+ self.row.id = res.data.id
382
+ self.row.f_bill_type = '物联网收费'
383
+ self.row.f_bill_style = self.model.f_print[0]
384
+ self.print = true
385
+ } else {
386
+ self.row.id = res.data.id
387
+ self.print = true
388
+ }
389
+ } else if (self.config.printType === '国税发票') {
390
+ // TODO
391
+ } else if (self.model.f_print[0] === '电子发票') {
392
+ self.eticket_show = true
393
+ await self.$refs.eticketbill.openETicket([res.data.id], self.row, self.invoice_show_gas, self.invoice_is_pax, '物联网收费')
394
+
395
+ // self.$CommonService.openEticket(res.data.id, '其他收费')
396
+ // self.$dispatch('success')
397
+ }
398
+ } else {
399
+ self.$dispatch('success')
400
+ }
401
+ } catch (error) {
402
+ if (error.status === 301) {
403
+ self.$dispatch('refresh')
404
+ } else {
405
+ if (error) {
406
+ self.$showAlert(error, 'danger', 0)
407
+ }
408
+ }
409
+
410
+ self.$dispatch('refresh')
411
+ }
412
+ }
413
+ let asyncCardMeterCenter = async function (self) {
414
+ await self.$getConfig(self, 'IOTMeterCenter')
415
+ console.log('卡表收费config', self.config)
416
+ // 默认打印格式
417
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
418
+ self.model.f_payment = [self.config.payment]
419
+ self.mulPrint = self.config.printType instanceof Array
420
+
421
+ // 获取当前票号用
422
+ self.model.f_use_type = self.config.billType
423
+ self.model.f_bill_type = self.model.f_print
424
+ self.hasValidateBill = self.config.hasBillManage
425
+
426
+ // 判断限购
427
+ let limit_param = {
428
+ f_userinfo_id: self.row.f_userinfo_id,
429
+ f_user_id: self.row.f_user_id,
430
+ f_stairprice_id: self.row.f_stairprice_id
431
+ }
432
+ let getLimit = await self.$resetpost('rs/logic/sale_getLimitGas', {data: limit_param}, {resolveMsg: null, rejectMsg: '获取限购值失败!!'})
433
+ console.log('获取限购值', getLimit)
434
+ self.hasLimit = getLimit.data.hasLimit
435
+ if (self.hasLimit) {
436
+ if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
437
+ if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
438
+ self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
439
+ self.$dispatch('refresh')
440
+ } else {
441
+ if (getLimit.data.f_limit_value) {
442
+ self.maxgas = (getLimit.data.f_limit_value - 0)
443
+ self.limitgas = true
444
+ }
445
+ if (getLimit.data.f_limit_amount) {
446
+ self.maxmoney = (getLimit.data.f_limit_amount - 0)
447
+ self.limitmoney = true
448
+ }
449
+ }
450
+ }
451
+ }
452
+ }
453
+ export default {
454
+ title: '卡表收费',
455
+ data () {
456
+ return {
457
+ resid: [], // 存放新增的f_files表中id
458
+ config: {
459
+ notShowFormula: false, // 不显示计算公式,默认显示
460
+ priceCalculation: false, // 划气量控制
461
+ showupload: true, // 默认不显示附件上传组件
462
+ hasPrint: false, // 默认打票
463
+ hasBillManage: false, // 默认不启用发票管理
464
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
465
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
466
+ payment: '现金缴费'
467
+ },
468
+ model: {
469
+ f_purchase: 0,
470
+ f_payment: [],
471
+ f_pregas: 0,
472
+ f_preamount: 0,
473
+ f_totalcost: 0,
474
+ f_curbalance: 0,
475
+ f_collection: '',
476
+ f_balance: 0,
477
+ f_print: [],
478
+ f_meter_type: '',
479
+ f_voucher_number: '',
480
+ f_privilege_id: 0,
481
+ f_privilege_money: 0,
482
+ f_after_discount: 0
483
+ },
484
+ eticket_msg: false,
485
+ eticket_show: false,
486
+ invoice_is_pax: '不征税',
487
+ is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
488
+
489
+ calculatedetail: '',
490
+ // 启用发票管理需要对票号进行验证
491
+ hasValidateBill: false,
492
+ validateOk: false,
493
+
494
+ print: false,
495
+ billData: {
496
+ url: 'rs/report/iot_bill',
497
+ operator: this.$login.f.name,
498
+ billnumber: ''
499
+ },
500
+ hasLimit: false,
501
+ maxgas: 99999999, // 限购
502
+ maxmoney: 99999999,
503
+ limitmoney: false,
504
+ limitgas: false,
505
+ paymentModel: [], // 多笔付款方式
506
+
507
+ mulPrint: false,
508
+ clickConfirm: false, // 控制确认按钮只能点击一次
509
+ // 下拉框值
510
+ paytype: this.$appdata.getParam('付款方式'),
511
+ printstyle: this.$appdata.getParam('打印格式'),
512
+ privilegeList: [{label: '无优惠', value: '0'}],
513
+ showfiles: false,
514
+ serialShow: false,
515
+ mjshow: false,
516
+ dymoney: 0
517
+ }
518
+ },
519
+ props: ['row'],
520
+ mounted() {
521
+ this.$refs.email.focus()
522
+ },
523
+ ready () {
524
+ this.paytype = this.$appdata.getParam('付款方式')
525
+ if (!this.$login.r.includes('免交充值付款')) {
526
+ this.paytype = this.paytype.filter((item) => {
527
+ return item.label != '免交'
528
+ })
529
+ }
530
+ // this.getPurchase()
531
+ this.model.f_price_id = this.row.f_price_id
532
+ this.model.f_user_id = this.row.f_user_id
533
+ this.model.f_userfiles_id = this.row.f_userfiles_id
534
+ this.model.f_userinfo_id = this.row.f_userinfo_id
535
+ this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
536
+ if (this.row.f_collection_type == '按金额') {
537
+ this.model.f_preamount = ''
538
+ this.model.f_pregas = 0
539
+ }
540
+ document.getElementById('pregasFocue').focus()
541
+ asyncCardMeterCenter(this)
542
+ },
543
+ watch: {
544
+ 'model.f_payment.length' (val) {
545
+ console.log('付款方式多选。。', val)
546
+ if (val > 1 && !this.model.f_preamount) {
547
+ this.model.f_payment = ['现金缴费']
548
+ this.$showAlert('请先计算付款金额', 'warning', 2000)
549
+ } else {
550
+ this.paymentModel = []
551
+
552
+ this.model.f_payment.forEach((res) => {
553
+ let temp = {
554
+ f_payment: res,
555
+ f_money: 0
556
+ }
557
+ this.paymentModel.push(temp)
558
+ })
559
+ this.$resetValidation()
560
+
561
+ // 获取计算优惠
562
+ this.getPrivilegeList()
563
+ }
564
+ },
565
+ 'model.f_collection' (val) {
566
+ // 获取计算优惠
567
+ this.getPrivilegeList()
568
+ },
569
+ 'model.f_payment' (val) {
570
+ if (val == '免交') {
571
+ this.mjshow = true
572
+ } else if (val == '赠气' && (this.model.f_preamount || this.model.f_preamount != '')) {
573
+ if (this.row.f_collection_type == '按气量') {
574
+ this.pregas()
575
+ } else {
576
+ this.preamount()
577
+ }
578
+ } else {
579
+ this.mjshow = false
580
+ }
581
+ if (this.row.f_collection_type == '按气量') {
582
+ this.pregas()
583
+ } else {
584
+ this.preamount()
585
+ }
586
+ }
587
+ },
588
+ events: {
589
+ // 删除Resid数组元素
590
+ 'delResid' (val) {
591
+ this.resid.$remove({id: val, f_biobid: ''})
592
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
593
+ },
594
+ // 增加Resid数组元素
595
+ 'resid' (val) {
596
+ console.log('-=', val)
597
+ this.resid.push({id: val, f_biobid: ''})
598
+ }
599
+ },
600
+ methods: {
601
+ // 校验发票信息
602
+ checkInvoiceMsg () {
603
+ if (this.model.f_print[0] === '电子发票') {
604
+ if (!this.row.f_taxpayer_id) {
605
+ this.row.f_taxpayer_id = this.row.f_idnumber
606
+ }
607
+ if (!this.row.f_paper_name) {
608
+ this.row.f_paper_name = this.row.f_user_name
609
+ }
610
+ if (!this.row.f_address_phone) {
611
+ this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
612
+ }
613
+ this.eticket_msg = true
614
+ } else {
615
+ this.confirm()
616
+ }
617
+ },
618
+ eticket_toggle () {
619
+ this.eticket_show = false
620
+ this.$dispatch('success')
621
+ },
622
+ uploadFiles () {
623
+ this.showfiles = !this.showfiles
624
+ },
625
+ async confirm () {
626
+ let res = await this.$showMessage(`确定对客户${this.row.f_user_name}进行物联网表缴费吗?`, ['confirm', 'cancel'])
627
+ if (res != 'confirm') return
628
+ // 先调用付款码支付组件流程
629
+ let ss = await this.$refs.paymentcode.flowPath()
630
+ this.$refs.paymentcode.paymentCodeShow = false
631
+ console.log('付款码操作返回', ss)
632
+ if (!ss.result) return
633
+ this.eticket_msg = false
634
+ this.clickConfirm = true
635
+ this.model.f_curbalance = this.curbalance
636
+ this.$dispatch('no-button')
637
+ console.log('model and row', this.model, this.row)
638
+ this.model.f_userinfo_id = this.row.f_userinfo_id
639
+ this.model.f_userfiles_id = this.row.f_userfiles_id
640
+ this.model.f_user_id = this.row.f_user_id
641
+ this.model.userinfo_version = this.row.userinfo_version
642
+ this.model.version = this.row.version
643
+ this.model.f_total_fee = (this.row.f_total_fee - 0) + (this.model.f_preamount - 0)
644
+ this.model.f_total_gas = (this.row.f_total_gas - 0) + (this.model.f_pregas - 0)
645
+ this.model.f_operator = this.$login.f.name
646
+ this.model.f_operatorid = this.$login.f.id
647
+ this.model.f_orgid = this.$login.f.orgid
648
+ this.model.f_orgname = this.$login.f.orgs
649
+ this.model.f_depid = this.$login.f.depids
650
+ this.model.f_depname = this.$login.f.deps
651
+ IOTChargeGen(this)
652
+ },
653
+ clean () {
654
+ this.$info('取消操作')
655
+ this.$dispatch('refresh', this.row)
656
+ },
657
+ validateBill (val) {
658
+ this.validateOk = !val.isOk
659
+ this.billData.bill = val.bill
660
+ },
661
+ printok () {
662
+ // 收据打完,判断是否还有其他票据进行请求
663
+ for (let i = 0; i < this.model.f_print.length; i++) {
664
+ if (this.model.f_print[i] === '电子发票') {
665
+ this.$CommonService.openEticket(this.row.id, '售气收费')
666
+ }
667
+ }
668
+ this.$dispatch('success')
669
+ },
670
+ pregas () {
671
+ this.dymoney = 0
672
+ if (this.model.f_pregas && this.model.f_pregas > 0) {
673
+ try {
674
+ pregasGen(this)
675
+ } catch (error) {
676
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
677
+ this.$dispatch('error', '发卡售气', this.model, error)
678
+ }
679
+ } else {
680
+ this.model.f_pregas = null
681
+ }
682
+ },
683
+ preamount () {
684
+ if (this.model.f_preamount && this.model.f_preamount > 0) {
685
+ try {
686
+ preamountGen(this)
687
+ } catch (error) {
688
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
689
+ this.$dispatch('error', '发卡售气', this.model, error)
690
+ }
691
+ } else {
692
+ this.model.f_preamount = null
693
+ }
694
+ },
695
+ calText (val) {
696
+ let str = ''
697
+ val.forEach((item) => {
698
+ str = str + item.f_price + ' x ' + item.f_gas + '+'
699
+ })
700
+ str = str.slice(0, str.length - 1)
701
+ this.calculatedetail = str
702
+ },
703
+ close () {
704
+ this.print = false
705
+ this.clean()
706
+ },
707
+ // 根据选择的付款方式 获取优惠列表
708
+ async getPrivilegeList () {
709
+ // 初始化下拉选择列表
710
+ this.privilegeList = [{label: '无优惠', value: '0'}]
711
+ // 初始为无优惠
712
+ this.model.f_privilege_id = '0'
713
+ if (this.model.f_payment && this.model.f_payment.length) {
714
+ // 查询条件
715
+ let payments = JSON.stringify(this.model.f_payment)
716
+ payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
717
+ let HttpReset = new HttpResetClass()
718
+ let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
719
+ data: {
720
+ items: 'id,f_privilege_name,f_privilege_type',
721
+ tablename: 't_privilege',
722
+ condition: `f_payment in ${payments} and f_gasproperties = '${this.row.f_gasproperties}' and f_user_type = '${this.row.f_user_type}' and f_perform_date <= GETDATE() and f_end_date >= GETDATE() and f_state = '有效'`,
723
+ orderitem: 'id'
724
+ }
725
+ }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
726
+ // 查询结果放到下拉列表
727
+ for (let p of privilege.data) {
728
+ this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
729
+ }
730
+ this.privilegeCalculate()
731
+ }
732
+ },
733
+ // 优惠计算
734
+ async privilegeCalculate () {
735
+ // 初始化减免金额
736
+ this.model.f_privilege_money = 0
737
+ this.model.f_after_discount = this.model.f_collection
738
+ // 判断是否是自定义优惠
739
+ if (parseInt(this.data.f_privilege_id)) {
740
+ for (let p of this.privilegeList) {
741
+ if (p.value == this.data.f_privilege_id && p.type == '自定义') {
742
+ this.data.f_privilege_money = window.prompt('请输入你想优惠的金额')
743
+ if (!(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money)) {
744
+ this.$showMessage('金额输入格式不正确!')
745
+ this.data.f_privilege_money = 0
746
+ return
747
+ }
748
+ if ((this.data.f_privilege_money - 0) >= this.data.f_collection) {
749
+ this.$showMessage('减免金额不能大于等于收款金额')
750
+ this.data.f_privilege_money = 0
751
+ return
752
+ }
753
+ }
754
+ }
755
+ }
756
+ // 优惠方式, 收款 缺一不计算
757
+ if (this.model.f_payment && this.model.f_payment.length && parseInt(this.model.f_privilege_id) && this.model.f_collection) {
758
+ let c = {
759
+ f_privilege_id: this.model.f_privilege_id,
760
+ f_collection: this.model.f_collection,
761
+ f_privilege_money: this.data.f_privilege_money
762
+ }
763
+ let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
764
+ // 减免金额
765
+ this.model.f_privilege_money = privilegeData.data.f_privilege_money
766
+ // 减免后收款金额
767
+ this.model.f_after_discount = privilegeData.data.f_collection
768
+ }
769
+ }
770
+ },
771
+ computed: {
772
+ authArr () {
773
+ return this.$login.r ? this.$login.r : []
774
+ },
775
+ 'curbalance' () {
776
+ if (this.model.f_payment == '赠气') {
777
+ return this.row.f_balance
778
+ }
779
+ if (this.model.f_preamount) {
780
+ return ((this.model.f_collection - 0) - (this.model.f_preamount - 0) + (this.row.f_balance - 0)).toFixed(2) - 0
781
+ } else {
782
+ return 0
783
+ }
784
+ },
785
+ 'islegal' () {
786
+ if (this.paymentModel.length > 1 && this.model.f_collection) {
787
+ let sum = 0
788
+ this.paymentModel.forEach((res) => {
789
+ sum += (res.f_money - 0)
790
+ })
791
+ return (this.model.f_collection - 0) === (sum - 0)
792
+ } else {
793
+ return true
794
+ }
795
+ }
796
+ }
797
+ }
798
+ </script>
799
+
800
+ <style>
801
+ </style>