sale-client 4.0.73-preview → 4.0.74-preview

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sale-client",
3
- "version": "4.0.73-preview",
3
+ "version": "4.0.74-preview",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -0,0 +1,1059 @@
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="span" style="overflow-y: hidden">
4
+ <validator name='v'>
5
+ <form novalidate class="form-horizontal">
6
+ <div class="row">
7
+ <div class="col-sm-4" :class="[$v.payment.required ? 'has-error' : '']">
8
+ <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems"
10
+ v-validate:payment='{required: true }'>
11
+ <v-select v-model="f_payment"
12
+ placeholder='请选择'
13
+ :value.sync="model.f_payment"
14
+ :options='paytype' clear-button v-ref:payment></v-select>
15
+ </div>
16
+
17
+ <div class="col-sm-4" v-if="row.f_collection_type == '按气量'"
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" :disabled="config.calculatePreByCollection"
21
+ @blur="pregas()" v-model="model.f_pregas" v-el:fpregas
22
+ v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
23
+ v-scale="[model.f_pregas, row.f_gas_decimal||4 ]"
24
+ v-next-el='fcollection'>
25
+ </div>
26
+ <div class="col-sm-4" v-if="row.f_collection_type == '按金额'">
27
+ <label for="f_pregas" class=" font_normal_body">*预购气量</label>
28
+ <input class="input_search" style="width:60%" type="number" v-el:fpregas
29
+ @keyup.enter="pregas('enter')" @blur="pregas()" v-model="model.f_pregas" placeholder="预购气量"
30
+ v-scale="[model.f_pregas, row.f_gas_decimal||4 ]"
31
+ v-next-el='fcollection' :disabled="config.calculatePreByCollection"/>
32
+ </div>
33
+ <div class="col-sm-4"
34
+ :class="[$v.f_preamount.required || $v.f_preamount.dctest || model.f_preamount === 0 ? 'has-error' : 'has-success']">
35
+ <label for="f_pregas" class=" font_normal_body">*预购金额</label>
36
+ <input class="input_search" style="width:60%" type="number"
37
+ @blur="preamount()" v-model="model.f_preamount"
38
+ :disabled="config.calculatePreByCollection"
39
+ v-scale="[model.f_preamount, row.f_fee_decimal||4 ]"
40
+ v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ]}' placeholder="预购金额">
41
+ </div>
42
+ <!--
43
+ <div class="col-sm-4" v-if="row.f_collection_type == '按气量'">
44
+ <label for="f_preamount" class=" font_normal_body">&nbsp;预购金额</label>
45
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_preamount"
46
+ v-scale="[model.f_preamount, 4]" placeholder="预购金额" disabled>
47
+ </div>-->
48
+
49
+ </div>
50
+ <div v-if="model.f_preamount" style="font-size: 18px; font-weight: bold; margin-left: 757px">
51
+ 大写预购金额: {{ convertToChinese(model.f_preamount) }}
52
+ </div>
53
+ <div class="row" style="margin-top:6px;">
54
+ <div class="col-sm-4" :class="[$v.printstyle.required ? 'has-error' : '']">
55
+ <label for="f_print" class="font_normal_body">打印格式</label>
56
+ <input type="text" v-show="false" v-model="$refs.printstyle.selectedItems"
57
+ v-validate:printstyle='{required: true }'>
58
+ <v-select id="print"
59
+ v-model="f_print"
60
+ placeholder='请选择'
61
+ :multiple="mulPrint"
62
+ :value.sync="model.f_print"
63
+ :options='printstyle'
64
+ close-on-select clear-button v-ref:printstyle>
65
+ </v-select>
66
+ </div>
67
+ <div class="col-sm-4 " v-if="hasLimit&&limitgas">
68
+ <label class="font_normal_body">&ensp;购气上限</label>
69
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
70
+ v-scale="[maxgas, 4]" placeholder='限购余气' disabled>
71
+ </div>
72
+ <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
73
+ <label class="font_normal_body">金额上限</label>
74
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxmoney"
75
+ v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
76
+ </div>
77
+ <div class="col-sm-4" v-if="mingas > 0 ">
78
+ <label class="font_normal_body">&ensp;购气下限</label>
79
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="mingas"
80
+ v-scale="[mingas, 4]" placeholder='最低购气量' disabled>
81
+ </div>
82
+
83
+ <div class="col-sm-4"
84
+ :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
85
+ <label for="f_temp_amount"
86
+ class=" font_normal_body">&nbsp;应收金额</label>
87
+ <input class="input_search" style="width:60%" type="number"
88
+ @blur="preamount()" v-model="model.f_totalcost"
89
+ v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
90
+ v-next-el='fcollection' v-scale="[model.f_totalcost, row.f_fee_decimal||4]" disabled>
91
+ </div>
92
+ </div>
93
+ <div class="row">
94
+
95
+ <div class="col-sm-4">
96
+ <label for="f_balance" class="font_normal_body">上期结余</label>
97
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
98
+ v-scale="[model.f_balance, row.f_fee_decimal||4]" placeholder="上期结余" disabled>
99
+ </div>
100
+
101
+ <div class="col-sm-4">
102
+ <label for="f_curbalance" class="font_normal_body">&nbsp;本期结余</label>
103
+ <input class="input_search" style="width:60%" type="number" v-model="curbalance"
104
+ v-scale="[curbalance, row.f_fee_decimal||4]" placeholder="本期结余" disabled>
105
+ </div>
106
+
107
+ <div class="col-sm-3" v-if="row.f_collection_type === '按气量' && model.f_payment!='赠气' && row.f_meter_type.includes('卡表') && !config.calculatePreByCollection"
108
+ :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
109
+ <label for="f_collection" class=" font_normal_body">*收&emsp;&emsp;款</label>
110
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
111
+ v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0), ">=" ] }'
112
+ v-el:fcollection @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
113
+ v-scale="[model.f_totalcost, row.f_fee_decimal||4]" :disabled="$refs.givechange.promptText != ''"/>
114
+ </div>
115
+ <div class="col-sm-3" v-if="row.f_collection_type === '按气量' && model.f_payment!='赠气' && row.f_meter_type.includes('卡表') && config.calculatePreByCollection"
116
+ :class="[$v.f_collection.required ? 'has-error' : 'has-success']">
117
+ <label for="f_collection" class=" font_normal_body">*收&emsp;&emsp;款</label>
118
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
119
+ v-validate:f_collection='{required: true }'
120
+ @blur="calculatePreByCollection()"
121
+ v-el:fcollection
122
+ @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"/>
123
+ </div>
124
+ <div class="col-sm-3" v-if="row.f_collection_type === '按气量' && model.f_payment=='赠气' && row.f_meter_type.includes('卡表')"
125
+ :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
126
+ <label for="f_collection" class=" font_normal_body"><font size="4px" style="font-weight:bold">*收&emsp;款</font></label>
127
+ <input id="f_collection" class="input_search" style="width:60%;font-size: 18px;font-weight:bold;" type="number" v-model="model.f_collection"
128
+ @blur="config.calculatePreByCollection && calculatePreByCollection()"
129
+ v-el:fcollection @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))" v-scale="[model.f_totalcost, row.f_fee_decimal||4]" :disabled="$refs.givechange.promptText != ''">
130
+ </div>
131
+ <div class="col-sm-3" v-if="row.f_collection_type === '按金额' && row.f_meter_type.includes('卡表')">
132
+ <label for="f_collection" class=" font_normal_body"><font size="4px" style="font-weight:bold">*收&emsp;款</font></label>
133
+ <input id="f_collection" class="input_search" style="width:50%;font-size: 18px;font-weight:bold;" type="number" v-model="model.f_collection"
134
+ @blur="config.calculatePreByCollection && calculatePreByCollection()"
135
+ v-el:fcollection @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))" v-scale="[model.f_collection, row.f_fee_decimal||4]" :disabled="$refs.givechange.promptText != ''">
136
+ </div>
137
+ <div class="col-sm-4" v-if="!row.f_meter_type.includes('卡表')">
138
+ <label for="f_collection" class=" font_normal_body"><font size="4px"
139
+ style="font-weight:bold">*收&emsp;款</font></label>
140
+ <input id="f_collection" class="input_search" style="width:50%;font-size: 18px;font-weight:bold;"
141
+ type="number" v-model="model.f_collection"
142
+ v-el:fcollection
143
+ @blur="config.calculatePreByCollection && calculatePreByCollection()"
144
+ @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
145
+ v-scale="[model.f_collection, row.f_fee_decimal||4]">
146
+ </div>
147
+ <div class="col-sm-1 form-group" v-show=" row.f_meter_type.includes('卡表')">
148
+ <give-change :curbalance="curbalance" :collection.sync="model.f_collection" v-ref:givechange></give-change>
149
+ </div>
150
+ </div>
151
+ <div class="row" style="margin-top:5px;" v-if="!config.calculatePreByCollection">
152
+ <div class="col-sm-9">
153
+ </div>
154
+ <div class="col-sm-3">
155
+ <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
156
+ </div>
157
+ </div>
158
+
159
+ <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
160
+ <div class="col-sm-4">
161
+ <label class="font_normal_body">优惠方式</label>
162
+ <v-select v-model="model.f_privilege_id" @blur.native.capture="privilegeCalculate"
163
+ placeholder='请选择'
164
+ :value.sync="model.f_privilege_id"
165
+ :options='privilegeList' clear-button value-single>
166
+ </v-select>
167
+ </div>
168
+ <div class="col-sm-4">
169
+ <label for="f_preamount" class=" font_normal_body">&nbsp;优惠金额</label>
170
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_privilege_money"
171
+ v-scale="[model.f_privilege_money, row.f_fee_decimal||4]" placeholder="优惠金额" disabled>
172
+ </div>
173
+ <div class="col-sm-4">
174
+ <label for="f_preamount" class=" font_normal_body">&nbsp;实际收款</label>
175
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_after_discount"
176
+ v-scale="[model.f_after_discount, row.f_fee_decimal||4]" placeholder="优惠后收款" disabled>
177
+ </div>
178
+ </div>
179
+
180
+ <div class="row" v-if="model.f_payment[0].includes('POS')">
181
+ <div class="col-sm-4">
182
+ <label for="f_voucher_number" class="font_normal_body">凭证号</label>
183
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number"
184
+ placeholder="凭证号">
185
+ </div>
186
+ </div>
187
+ <div class="row" style="padding-top: 0.5em;">
188
+ <div class="col-sm-4" v-if="!mjshow">
189
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
190
+ <input class="input_search" style="width:60%" type="text"
191
+ v-model="model.f_serial_number" placeholder="业务单号">
192
+ </div>
193
+ <div class="col-sm-4" v-if="mjshow"
194
+ :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
195
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
196
+ <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
197
+ v-model="model.f_serial_number" placeholder="业务单号">
198
+ </div>
199
+
200
+
201
+ <div class="col-sm-8">
202
+ <label for="f_comments" class="font_normal_body">&nbsp;备&emsp;&emsp;注</label>
203
+ <input class="input_search" style="width:77%" v-model="model.f_comments" rows="1" placeholder="备注">
204
+ </div>
205
+ </div>
206
+
207
+ <div v-if="paymentModel.length >1">
208
+ <div class="row" style="margin-top:10px;">
209
+ <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../static/juxing.png"/><strong
210
+ style="margin-left: 4%">付款明细</strong></p>
211
+ </div>
212
+ <div class="row" style="margin-top:10px;">
213
+ <div class="col-sm-4 " v-for="pay in paymentModel">
214
+ <label class="font_normal_body">{{pay.f_payment}}:</label>
215
+ <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
216
+ </div>
217
+ <div class="col-sm-4 ">
218
+ <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ </form>
223
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
224
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' :data='row' @toggle="close"
225
+ @printok="printok" v-ref:printbill></print-bill>
226
+ <div style="text-align:right; height: 25%">
227
+ <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
228
+ <strong style="font-size: large" v-if="!config.notShowFormula">计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
229
+ <strong style="font-size: large" v-if="deductdetail">{{deductdetail ? deductdetail : ' 暂无'}}</strong><br/>
230
+ <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm|| model.f_preamount === 0"
231
+ :payment.sync="model.f_payment" :payment-data="paytype"
232
+ @confirm-payment="confirm()">
233
+ </payment-code-button>
234
+ <button class="button_search btn-gn" type="submit" @click="checkInvoiceMsg()"
235
+ :disabled='!$v.valid || validateOk || !islegal || clickConfirm || model.f_preamount === 0'>确认
236
+ </button>
237
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
238
+ </div>
239
+ </validator>
240
+ <eticket-modal :show="eticket_msg" @closemodalshow="eticket_msg = false" :row="row" @confirm="confirm"></eticket-modal>
241
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
242
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_after_discount"></payment-code>
243
+ </div>
244
+ </div>
245
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" :businessid="randomBusinessId" isremark="true" fusetype="卡表收费"></upload>
246
+ </template>
247
+ <script>
248
+ import {HttpResetClass} from 'vue-client'
249
+
250
+ /**
251
+ *综合业务
252
+ *卡表收费组件
253
+ */
254
+
255
+ // 输入金额,换算气量
256
+ let preamountGen = async function (self) {
257
+ let calFee = ((self.model.f_preamount - 0)).toFixed(self.row.f_fee_decimal || 4)
258
+ if (self.model.f_payment == '赠气') {
259
+ calFee = (self.model.f_preamount - 0).toFixed(self.row.f_fee_decimal || 4)
260
+ }
261
+ // 通过金额进行划价
262
+ let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
263
+ if (getGas.data.gas) {
264
+ if (self.row.f_isdecimal === '是') {
265
+ if (self.row.f_alias === 'QiaoSong') {
266
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
267
+ } else {
268
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(self.row.f_gas_decimal || 4)
269
+ }
270
+ if (self.row.f_collection_type === '按金额') {
271
+ self.dymoney = 0
272
+ } else {
273
+ let dymoney2 = await self.$CommonService.gasCalculate(self.model, (getGas.data.gas - 0).toFixed(self.row.f_gas_decimal || 4))
274
+ self.dymoney = (getGas.data.chargenum - 0).toFixed(4) - (dymoney2.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 4)
275
+ }
276
+ } else {
277
+ // 如果不支持小数,将划价出的多余非整数气量进行划价为金额
278
+ let tempnum = Math.floor(getGas.data.gas - 0)
279
+ let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(self.row.f_fee_decimal || 4))
280
+ self.dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney1.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 4)
281
+ self.model.f_pregas = Math.floor(getGas.data.gas - 0)
282
+ }
283
+ }
284
+ self.model.getDeduct = 0
285
+ // 计算抵扣包间费用抵扣金额
286
+ if (self.row.f_project_money && self.row.f_project_money > 0) {
287
+ self.model.getDeduct = (self.$CommonService.getDeduct(self.row, self.model.f_pregas) - 0)
288
+ }
289
+ // end
290
+ self.model.f_totalcost = ((self.row.f_balance - 0) >= ((self.model.f_preamount - 0) + self.model.getDeduct) ? 0 : ((self.model.f_preamount - 0) + self.model.getDeduct) - self.row.f_balance)
291
+
292
+ self.model.chargeprice = getGas.data.chargeprice
293
+ Object.assign(self.model, self.model, getGas.data)
294
+ if (self.model.f_payment == '赠气') {
295
+ self.model.f_totalcost = self.model.f_preamount
296
+ self.model.f_collection = 0
297
+ } else {
298
+ self.model.f_collection = self.config.autoCollection ? self.model.f_totalcost : 0
299
+ self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(self.row.f_fee_decimal || 4)
300
+ }
301
+ self.model.f_preamount = (calFee - (self.dymoney - 0)).toFixed(self.row.f_fee_decimal || 4)
302
+ self.calText(getGas.data.chargeprice, self.model.getDeduct)
303
+ }
304
+
305
+ // 输入气量,换算金额
306
+ let pregasGen = async function (self) {
307
+ if (self.row.f_isdecimal === '是') {
308
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(self.row.f_gas_decimal || 4)
309
+ } else {
310
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
311
+ }
312
+ if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0 || (self.model.f_pregas - 0) - (self.mingas - 0) >= 0) {
313
+ self.model.f_meter_type = self.row.f_meter_type
314
+ let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
315
+ self.model.getDeduct = 0
316
+ // 计算抵扣包间费用抵扣金额
317
+ if (self.row.f_project_money && self.row.f_project_money > 0) {
318
+ self.model.getDeduct = (self.$CommonService.getDeduct(self.row, self.model.f_pregas) - 0)
319
+ }
320
+ self.model.f_preamount = (getAmount.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 4)
321
+ self.model.f_totalcost = ((self.row.f_balance - 0) > ((getAmount.data.chargenum - 0) + self.model.getDeduct - 0) ? 0 : (((getAmount.data.chargenum - 0) + self.model.getDeduct - 0) - (self.row.f_balance - 0)).toFixed(self.row.f_fee_decimal || 4))
322
+ Object.assign(self.model, self.model, getAmount.data)
323
+ self.model.chargeprice = getAmount.data.chargeprice
324
+ if (self.model.f_payment == '赠气') {
325
+ self.model.f_totalcost = getAmount.data.chargenum
326
+ self.model.f_collection = 0
327
+ } else {
328
+ self.model.f_collection = self.config.autoCollection ? self.model.f_totalcost : 0
329
+ if (self.config.floor) {
330
+ self.model.f_collection = Math.ceil(self.model.f_collection)
331
+ }
332
+ }
333
+ self.calText(getAmount.data.chargeprice, self.model.getDeduct)
334
+ }
335
+ }
336
+ // 执行保存逻辑
337
+ let sellgasGen = async function (self) {
338
+ try {
339
+ self.row.cardInfo = self.cardData
340
+
341
+ if (self.paymentModel.length === 0) {
342
+ self.paymentModel = [{
343
+ f_payment: self.model.f_payment[0],
344
+ f_money: self.model.f_preamount
345
+ }]
346
+ }
347
+ self.model.xiekamoney = self.model.f_preamount
348
+ if (self.row.f_price_type == '阶梯气价' && self.row.f_is_step == '否' && self.row.f_collection_type == '按金额') {
349
+ self.model.xiekamoney = (self.model.f_pregas * self.model.chargeprice[0].f_price)
350
+ self.model.xiekamoney = self.model.xiekamoney.toFixed(4)
351
+ }
352
+
353
+ self.model.payments = self.paymentModel
354
+ // 加入扫码盒付款码支付流水号
355
+ self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
356
+ let res = await self.$CardService.sellgas(self.model, self.row)
357
+ let localeSustainMoney = window.localStorage.getItem('sustainMoney')
358
+ if (localeSustainMoney != null) {
359
+ localeSustainMoney = (localeSustainMoney - 0) + (self.model.f_collection - 0)
360
+ window.localStorage.setItem('sustainMoney', localeSustainMoney)
361
+ }
362
+ if (self.config.showupload) {
363
+ let param = []
364
+ for (let row of self.resid) {
365
+ param.push({id: row.id})
366
+ }
367
+ let writeid
368
+ if (res.data && res.data.id) {
369
+ writeid = res.data.id
370
+ } else {
371
+ writeid = res
372
+ }
373
+ let data = {
374
+ param: param,
375
+ f_blobid: writeid
376
+ }
377
+
378
+ await self.$resetpost('api/af-revenue/logic/updatefiles', data)
379
+ }
380
+ console.log(self.config, self.config.hasPrint && !self.$login.r.includes('不打印发票'))
381
+ // 开始打票
382
+ if (self.config.hasPrint && !self.$login.r.includes('不打印发票')) {
383
+ if (self.printInvoiceType.indexOf(self.model.f_print) === -1) {
384
+ if (self.$login.r.includes('非民用纸质票据拆分')) {
385
+ if (self.row.f_user_type === '非民用') {
386
+ self.billData.url = 'api/af-revenue/report/fmy_card_bill'
387
+ }
388
+ }
389
+ if (self.row.f_meter_type === '金额卡表' && self.$appdata.getSingleValue('金额气量区分卡表票据')) {
390
+ self.billData.url = 'api/af-revenue/report/fee_card_bill'
391
+ }
392
+ if (self.config.hasBillManage) {
393
+ // 启用发票管理,获取票据管理中的票号并存储记录
394
+ self.row.id = res
395
+ self.row.f_bill_type = '卡表收费'
396
+ self.row.f_bill_style = self.model.f_print[0]
397
+ self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
398
+ self.print = true
399
+ } else {
400
+ self.row.id = res
401
+ self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
402
+ self.print = true
403
+ }
404
+ } else {
405
+ if (self.printInvoiceType.indexOf(self.model.f_print[0]) !== -1) {
406
+ self.row.id = res
407
+ self.eticket_show = true
408
+ self.row.f_print = self.model.f_print[0]
409
+ // 应铜川需要卡表显示
410
+ await self.$refs.eticketbill.openETicket(res, self.row, '卡表收费')
411
+ // await self.$CommonService.openEticket(res, '售气收费')
412
+ // self.print = true
413
+ }
414
+ }
415
+ } else {
416
+ self.$dispatch('success', '卡表收费', self.row)
417
+ }
418
+ self.clickConfirm = false
419
+ } catch (error) {
420
+ console.log('捕获到异常', error)
421
+ if (error instanceof Object) {
422
+ self.$showAlert(error.data, 'danger', 0)
423
+ } else {
424
+ self.$showAlert(error, 'danger', 0)
425
+ }
426
+ self.$dispatch('refresh')
427
+ self.clickConfirm = false
428
+ }
429
+ }
430
+
431
+ let asyncCardMeterCenter = async function (self) {
432
+ await self.$getConfig(self, 'CardMeterCenter')
433
+ console.log('卡表收费config', self.config)
434
+ // 添加 “系统余额透支” 付款方式
435
+ let i = -1
436
+ for (const index in self.paytype) {
437
+ if (self.paytype[index].value == '系统余额透支') {
438
+ i = index
439
+ break
440
+ }
441
+ }
442
+ if (self.canOverdraftBalance()) {
443
+ if (i == -1) {
444
+ self.paytype.push({
445
+ label: '系统余额透支',
446
+ value: '系统余额透支'
447
+ })
448
+ }
449
+ } else {
450
+ if (i != -1) {
451
+ self.paytype.splice(i, 1)
452
+ }
453
+ }
454
+
455
+ // 默认打印格式
456
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
457
+ self.model.f_payment = [self.config.payment]
458
+ self.mulPrint = self.config.printType instanceof Array
459
+
460
+ // 获取当前票号用
461
+ self.model.f_use_type = self.config.billType
462
+ self.model.f_bill_type = self.model.f_print
463
+ self.hasValidateBill = self.config.hasBillManage
464
+ self.mingas = self.config.MinSellGas
465
+ // 判断限购
466
+ let limit_param = {
467
+ f_userinfo_id: self.row.f_userinfo_id,
468
+ f_user_id: self.row.f_user_id,
469
+ f_stairprice_id: self.row.f_stairprice_id
470
+ }
471
+ let getLimit = await self.$resetpost('api/af-revenue/logic/sale_getLimitGas', {data: limit_param}, {
472
+ resolveMsg: null,
473
+ rejectMsg: '获取限购值失败!!'
474
+ })
475
+ console.log('获取限购值', getLimit)
476
+ self.hasLimit = getLimit.data.hasLimit
477
+ if (self.hasLimit) {
478
+ if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
479
+ if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
480
+ self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
481
+ self.$dispatch('refresh')
482
+ } else {
483
+ if (getLimit.data.f_limit_value) {
484
+ self.maxgas = (getLimit.data.f_limit_value - 0)
485
+ self.limitgas = true
486
+ }
487
+ if (getLimit.data.f_limit_amount) {
488
+ self.maxmoney = (getLimit.data.f_limit_amount - 0)
489
+ self.limitmoney = true
490
+ }
491
+ }
492
+ }
493
+ }
494
+ let nowrite_param = {
495
+ f_userfiles_id: self.row.f_userfiles_id
496
+ }
497
+ let getNoWriteCard = await self.$resetpost('api/af-revenue/sql/getnowritecard', {data: nowrite_param}, {
498
+ resolveMsg: null,
499
+ rejectMsg: '获取最近卡表收费记录失败!!'
500
+ })
501
+ if (getNoWriteCard.data.length > 0) {
502
+ self.$showMessage(`三小时内存在写卡失败的记录,是否重新写卡?`, ['confirm', 'cancel']).then(async (res) => {
503
+ if (res === 'confirm') {
504
+ let url = 'http://127.0.0.1:8003/' + getNoWriteCard.data[0].f_cardpost
505
+ let param = JSON.parse(getNoWriteCard.data[0].f_cardparam)
506
+ let cardRes = await self.$resetpost(url, param, {resolveMsg: null, rejectMsg: '重新写卡失败'})
507
+ if (cardRes.data.Err || cardRes.data.Exception) {
508
+ self.$showAlert(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`, 'danger', 3000)
509
+ self.$dispatch('refresh', self.row)
510
+ } else {
511
+ self.$resetpost('api/af-revenue/logic/writeCardAgin', getNoWriteCard.data[0], {resolveMsg: '重新写卡成功', rejectMsg: '重新写卡失败'})
512
+ self.$dispatch('success', '卡表收费', self.row)
513
+ }
514
+ } else {
515
+ self.$dispatch('refresh', self.row)
516
+ }
517
+ })
518
+ }
519
+ }
520
+ export default {
521
+ title: '卡表收费',
522
+ data () {
523
+ return {
524
+ mjshow: false,
525
+ serialShow: false,
526
+ randomBusinessId: '',
527
+ resid: [], // 存放新增的f_files表中id
528
+ config: {
529
+ calculatePreByCollection: false, // 可以更具收款来反向计算预购
530
+ notShowFormula: false, // 不显示计算公式,默认显示
531
+ autoCollection: true, // 自动填写收款
532
+ quickSale: false,
533
+ showupload: true, // 显示上传
534
+ hasPrint: true, // 默认打票
535
+ MinSellGas: 0,
536
+ hasBillManage: false, // 默认不启用发票管理
537
+ taxforidnumber: true, // 身份证号同步到纳税人识别号
538
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
539
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
540
+ payment: '',
541
+ floor: false,
542
+ overdraftBalance: false // 是否支持系统余额透支
543
+ },
544
+ mingas: 0,
545
+ eticket_msg: false,
546
+ eticket_show: false,
547
+ invoice_is_pax: '不征税',
548
+ is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
549
+ model: {
550
+ f_purchase: 0,
551
+ f_payment: [],
552
+ f_pregas: '',
553
+ f_preamount: 0,
554
+ f_totalcost: 0,
555
+ f_curbalance: 0,
556
+ f_collection: '',
557
+ f_balance: 0,
558
+ f_print: [],
559
+ f_meter_type: '',
560
+ f_voucher_number: '',
561
+ f_banktransfer_person: '',
562
+ f_banktransfer_date: '',
563
+ f_privilege_id: 0,
564
+ f_privilege_money: 0,
565
+ f_after_discount: 0,
566
+ getDeduct: 0
567
+ },
568
+ calculatedetail: '',
569
+ deductdetail: '',
570
+
571
+ // 启用发票管理需要对票号进行验证
572
+ hasValidateBill: false,
573
+ validateOk: false,
574
+
575
+ print: false,
576
+ billData: {
577
+ url: 'api/af-revenue/report/card_bill',
578
+ billnumber: ''
579
+ },
580
+ hasLimit: false,
581
+ maxgas: 99999999, // 限购
582
+ maxmoney: 99999999,
583
+ limitmoney: false,
584
+ limitgas: false,
585
+
586
+ paymentModel: [], // 多笔付款方式
587
+
588
+ mulPrint: false,
589
+ clickConfirm: false, // 控制确认按钮只能点击一次
590
+ // 下拉框值
591
+ paytype: [],
592
+ printstyle: this.$appdata.getParam('打印格式'),
593
+ printInvoiceType: this.$appdata.getSingleValue('电子票打印类型') ? this.$appdata.getSingleValue('电子票打印类型') : '电子发票',
594
+ privilegeList: [{label: '无优惠', value: '0'}],
595
+ BankTransfer: false,
596
+ // 小数是否支持,导致划价产生的多余气量,金额
597
+ dymoney: 0
598
+ }
599
+ },
600
+ props: ['row', 'cardData'],
601
+ async ready () {
602
+ if (this.authArr.includes('余额写卡限定')) {
603
+ this.paytype = [{label: '余额写卡', value: '余额写卡'}]
604
+ } else {
605
+ this.paytype = await this.$appdata.getParam('付款方式') ? await this.$appdata.getParam('付款方式') : []
606
+ if (!this.$login.r.includes('免交充值付款')) {
607
+ this.paytype = this.paytype.filter((item) => {
608
+ return item.label != '免交'
609
+ })
610
+ }
611
+ }
612
+ // this.getPurchase()
613
+ this.model.f_price_id = this.row.f_price_id
614
+ this.model.f_user_id = this.row.f_user_id
615
+ this.model.f_userfiles_id = this.row.f_userfiles_id
616
+ this.model.f_userinfo_id = this.row.f_userinfo_id
617
+ this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
618
+ if (this.row.f_collection_type == '按金额') {
619
+ this.model.f_preamount = ''
620
+ this.model.f_pregas = 0
621
+ }
622
+ this.$els.fpregas.focus()
623
+ this.getRandomId()
624
+ asyncCardMeterCenter(this)
625
+ },
626
+ watch: {
627
+ 'model.f_payment.length' (val) {
628
+ console.log('付款方式多选。。', val)
629
+ if (val > 1 && !this.model.f_preamount) {
630
+ this.model.f_payment = ['现金缴费']
631
+ this.$showAlert('请先计算付款金额', 'warning', 2000)
632
+ } else {
633
+ this.paymentModel = []
634
+
635
+ this.model.f_payment.forEach((res) => {
636
+ let temp = {
637
+ f_payment: res,
638
+ f_money: 0
639
+ }
640
+ this.paymentModel.push(temp)
641
+ })
642
+ this.$resetValidation()
643
+
644
+ // 获取计算优惠
645
+ this.getPrivilegeList()
646
+ }
647
+ },
648
+ 'model.f_payment' (val) {
649
+ let _payment = this.$appdata.getSingleValue('需要输入业务单号的付款方式') || ''
650
+ if (val == '免交' || _payment.includes(val)) {
651
+ this.mjshow = true
652
+ } else if (val == '赠气' && (this.model.f_preamount || this.model.f_preamount != '')) {
653
+ if (this.row.f_collection_type == '按气量') {
654
+ this.pregas()
655
+ } else {
656
+ this.preamount()
657
+ }
658
+ } else {
659
+ this.mjshow = false
660
+ }
661
+ // if(this.row.f_collection_type == '按气量'){
662
+ // this.pregas();
663
+ // }else{
664
+ // this.preamount();
665
+ // }
666
+ },
667
+ 'model.f_collection' (val) {
668
+ // 获取计算优惠
669
+ this.getPrivilegeList()
670
+ }
671
+ },
672
+ events: {
673
+ // 删除Resid数组元素
674
+ 'delResid' (val) {
675
+ this.resid.$remove({id: val, f_biobid: ''})
676
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
677
+ },
678
+ // 增加Resid数组元素
679
+ 'resid' (val) {
680
+ this.resid.push({id: val, f_biobid: ''})
681
+ }
682
+ },
683
+ methods: {
684
+ convertToChinese(num) {
685
+ const units = ['', '拾', '佰', '仟', '万', '亿', '兆']
686
+ const smallUnits = ['', '拾', '佰', '仟']
687
+ const chars = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
688
+ const str = num.toString()
689
+ const [integerPart, decimalPart] = str.split('.')
690
+
691
+ let result = ''
692
+ let zeroFlag = false
693
+ let segmentCount = 0
694
+
695
+ // 处理整数部分
696
+ for (let i = integerPart.length - 1; i >= 0; i -= 4) {
697
+ let segment = ''
698
+ let segmentEmpty = true
699
+
700
+ for (let j = 0; j < 4; j++) {
701
+ const pos = i - j
702
+ if (pos < 0) break
703
+ const n = integerPart[pos]
704
+ if (n === '0') {
705
+ if (!zeroFlag && segment.length > 0) {
706
+ segment = chars[n] + segment
707
+ zeroFlag = true
708
+ }
709
+ } else {
710
+ segment = chars[n] + smallUnits[j] + segment
711
+ zeroFlag = false
712
+ segmentEmpty = false
713
+ }
714
+ }
715
+
716
+ if (!segmentEmpty) {
717
+ if (segmentCount > 0) {
718
+ segment += units[segmentCount + 3]
719
+ }
720
+ result = segment + result
721
+ }
722
+ segmentCount++
723
+ }
724
+
725
+ result = result.replace(/零+/g, '零').replace(/零$/, '')
726
+ if (result === '') {
727
+ result = '零'
728
+ }
729
+
730
+ result += '元'
731
+
732
+ // 处理小数部分
733
+ if (decimalPart) {
734
+ const jiao = decimalPart[0] || '0'
735
+ const fen = decimalPart[1] || '0'
736
+
737
+ if (jiao !== '0') {
738
+ result += chars[jiao] + '角'
739
+ }
740
+ if (fen !== '0') {
741
+ result += chars[fen] + '分'
742
+ }
743
+ if (jiao === '0' && fen === '0') {
744
+ result += '整'
745
+ }
746
+ } else {
747
+ result += '整'
748
+ }
749
+
750
+ return result
751
+ },
752
+ getRandomId () {
753
+ this.randomBusinessId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
754
+ let res = Math.random() * 16 | 0
755
+ let v = c == 'x' ? res : (res & 0x3 | 0x8)
756
+ return v.toString(16)
757
+ })
758
+ },
759
+ // 根据收款金额计算划价信息
760
+ // 需要配置 calculatePreByCollection = true
761
+ async calculatePreByCollection () {
762
+ try {
763
+ this.model.f_collection = (this.model.f_collection - 0)
764
+ let calFee = ((this.model.f_collection - 0) + (this.row.f_balance)).toFixed(4)
765
+ // 通过收款进行划价
766
+ let getGas = await this.$CommonService.feeCalculate(this.model, calFee)
767
+ this.model.f_pregas = parseInt(getGas.data.gas)
768
+ let dymoney2 = await this.$CommonService.gasCalculate(this.model, this.model.f_pregas)
769
+ this.model.chargeprice = dymoney2.data.chargeprice
770
+ Object.assign(this.model, this.model, dymoney2.data)
771
+ this.model.f_totalcost = dymoney2.data.chargenum
772
+ this.model.f_preamount = dymoney2.data.chargenum
773
+ this.model.getDeduct = 0
774
+ if (this.row.f_project_money && this.row.f_project_money > 0) {
775
+ this.model.getDeduct = (this.$CommonService.getDeduct(this.row, this.model.f_pregas) - 0)
776
+ this.model.f_totalcost = (this.model.f_totalcost - 0 ) + (this.model.getDeduct- 0 )
777
+ this.model.f_collection = (this.model.f_collection - 0 ) + (this.model.getDeduct- 0 )
778
+ }
779
+ this.calText(dymoney2.data.chargeprice, this.model.getDeduct)
780
+ } catch (error) {
781
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
782
+ this.$dispatch('error', '发卡售气', this.model, error)
783
+ }
784
+ },
785
+ // 校验发票信息
786
+ checkInvoiceMsg (flag) {
787
+ // 校验是否超出最大透支余额
788
+ if (this.model.f_payment == '系统余额透支') {
789
+ const maxOverdraftBalance = -(this.$appdata.getSingleValue('最大透支余额') - 0)
790
+ const curSysBalance = (this.row.f_sys_balance - 0) - (this.model.f_totalcost - 0)
791
+ if (curSysBalance < maxOverdraftBalance) {
792
+ this.$showAlert('您的系统余额将超出最大透支余额,请使用别的付款方式!', 'danger', 5000)
793
+ return
794
+ }
795
+ this.model.f_sys_balance = curSysBalance
796
+ }
797
+
798
+ // 收款回车时, 如果确认按钮是灰色不进行任何操作
799
+ if (flag) return
800
+ console.log(this.model.f_print[0])
801
+ if (this.printInvoiceType.indexOf(this.model.f_print[0]) !== -1) {
802
+ if (!this.row.f_taxpayer_id && this.config.taxforidnumber) {
803
+ this.row.f_taxpayer_id = this.row.f_idnumber
804
+ }
805
+ if (!this.row.f_paper_name) {
806
+ this.row.f_paper_name = this.row.f_user_name
807
+ }
808
+ if (!this.row.f_address_phone) {
809
+ this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
810
+ }
811
+ if (!this.row.f_email) {
812
+ this.row.f_email = this.row.f_email
813
+ }
814
+ this.eticket_msg = true
815
+ } else {
816
+ this.confirm()
817
+ }
818
+ },
819
+ confirm () {
820
+ this.eticket_msg = false
821
+ if (this.model.f_payment.length > 0 && this.model.f_payment.includes('余额写卡')) {
822
+ if (this.model.f_collection > this.row.f_balance) {
823
+ this.$showAlert('请注意!您的账户余额小于当前写卡金额,无法进行余额写卡,请修改后重试', 'warning', 2000)
824
+ return
825
+ }
826
+
827
+ if (this.model.f_collection > 0) {
828
+ this.$showAlert('请注意!进行余额写卡,收款不能大于0', 'warning', 1000)
829
+ return
830
+ }
831
+ }
832
+ this.$showMessage(`确定对用户${this.row.f_user_name}进行卡表收费吗?`, ['confirm', 'cancel']).then(async (res) => {
833
+ if (res === 'confirm') {
834
+ this.clickConfirm = true
835
+ // 先调用付款码支付组件流程
836
+ let ss = await this.$refs.paymentcode.flowPath()
837
+ this.$refs.paymentcode.paymentCodeShow = false
838
+ console.log('付款码操作返回', ss)
839
+ if (!ss.result) return
840
+
841
+ this.model.f_curbalance = this.curbalance
842
+ this.$dispatch('no-button')
843
+ sellgasGen(this)
844
+ }
845
+ })
846
+ },
847
+ eticket_toggle () {
848
+ this.eticket_show = false
849
+ this.$dispatch('success', '卡表收费')
850
+ },
851
+ clean () {
852
+ this.$info('取消操作')
853
+ this.$dispatch('refresh', this.row)
854
+ },
855
+ validateBill (val) {
856
+ this.validateOk = !val.isOk
857
+ this.billData.bill = val.bill
858
+ },
859
+ printok () {
860
+ this.$dispatch('success', '卡表收费')
861
+ },
862
+ pregas (val) {
863
+ this.dymoney = 0
864
+ if (this.model.f_pregas && this.model.f_pregas > 0) {
865
+ try {
866
+ // 对气量进行验证
867
+ if ((this.row.f_topup_ceil - 0) > 0 && (this.model.f_pregas - 0) > (this.row.f_topup_ceil - 0)) {
868
+ this.$showAlert(`您输入的气量不能大于该表的充值上限: ${this.row.f_topup_ceil}`, 'warning', 5000)
869
+ this.model.f_pregas = null
870
+ } else if ((this.model.f_pregas - 0) - (this.mingas - 0) < 0) {
871
+ this.$showAlert(`注意:购气量最少为:${this.mingas}m³`, 'warning', 3000)
872
+ } else {
873
+ pregasGen(this)
874
+ if (this.config.quickSale) {
875
+ this.$els.fcollection.focus()
876
+ }
877
+ }
878
+ } catch (error) {
879
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
880
+ this.$dispatch('error', '发卡售气', this.model, error)
881
+ }
882
+ } else {
883
+ this.model.f_pregas = null
884
+ }
885
+ },
886
+ preamount () {
887
+ this.dymoney = 0
888
+ this.model.f_price_id = this.row.f_price_id
889
+ this.model.f_user_id = this.row.f_user_id
890
+ this.model.f_userfiles_id = this.row.f_userfiles_id
891
+ this.model.f_userinfo_id = this.row.f_userinfo_id
892
+ try {
893
+ preamountGen(this)
894
+ } catch (error) {
895
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
896
+ this.$dispatch('error', '发卡售气', this.model, error)
897
+ }
898
+ },
899
+ calText (val, getDeduct = 0) {
900
+ let str = ''
901
+ let num = 0
902
+ val.forEach((item) => {
903
+ if (item.f_gas > 0) {
904
+ num = num + 1
905
+ }
906
+ if (this.row.f_isdecimal === '是') {
907
+ str = str + item.f_price + ' x ' + item.f_gas + '+'
908
+ } else {
909
+ str = str + item.f_price + ' x ' + Math.floor(item.f_gas) + '+'
910
+ }
911
+ })
912
+ if (getDeduct > 0) {
913
+ if ((this.model.f_pregas * this.row.f_gas_type) > this.row.f_project_money) {
914
+ this.deductdetail = '当前未结金额' + this.row.f_project_money + '元,不足抵扣,以未结金额为准'
915
+ } else {
916
+ this.deductdetail = '未结金额计算公式:' + this.row.f_gas_type + ' x ' + this.model.f_pregas + '=' + getDeduct
917
+ }
918
+ }
919
+ str = str.slice(0, str.length - 1)
920
+ this.calculatedetail = str
921
+ if (num > 1) {
922
+ if (this.$login.r.find(item => item == '阶梯提示无按钮')) {
923
+ this.$showAlert('友好提示:本次购气已跨阶梯', 'warning', 3000)
924
+ } else {
925
+ this.$showMessage('友好提示:本次购气已跨阶梯', ['confirm', 'cancel'])
926
+ }
927
+ }
928
+ },
929
+ close () {
930
+ this.print = false
931
+ this.clean()
932
+ },
933
+ paymentchange () {
934
+ if (JSON.stringify(this.model.f_payment).indexOf('转账') !== -1) {
935
+ // 进入转账筛选条件
936
+ this.model.f_banktransfer_person = ''
937
+ this.model.f_banktransfer_date = ''
938
+ this.BankTransfer = true
939
+ } else {
940
+ this.model.f_banktransfer_person = ''
941
+ this.model.f_banktransfer_date = ''
942
+ this.BankTransfer = false
943
+ }
944
+ },
945
+ // 根据选择的付款方式 获取优惠列表
946
+ async getPrivilegeList () {
947
+ // 初始化下拉选择列表
948
+ this.privilegeList = [{label: '无优惠', value: '0'}]
949
+ // 初始为无优惠
950
+ this.model.f_privilege_id = '0'
951
+ if (this.model.f_payment && this.model.f_payment.length) {
952
+ // 查询条件
953
+ let payments = JSON.stringify(this.model.f_payment)
954
+ payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
955
+ let HttpReset = new HttpResetClass()
956
+ let privilege = await HttpReset.load('POST', 'api/af-revenue/sql/singleTable_OrderBy', {
957
+ data: {
958
+ items: 'id,f_privilege_name,f_privilege_type',
959
+ tablename: 't_privilege',
960
+ 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 = '有效'`,
961
+ orderitem: 'id'
962
+ }
963
+ }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
964
+ // 查询结果放到下拉列表
965
+ for (let p of privilege.data) {
966
+ this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
967
+ }
968
+ this.privilegeCalculate()
969
+ }
970
+ },
971
+ // 优惠计算
972
+ async privilegeCalculate () {
973
+ // 初始化减免金额
974
+ this.model.f_privilege_money = 0
975
+ this.model.f_after_discount = this.model.f_collection
976
+ // 判断是否是自定义优惠
977
+ if (parseInt(this.model.f_privilege_id)) {
978
+ for (let p of this.privilegeList) {
979
+ if (p.value == this.model.f_privilege_id && p.type == '自定义') {
980
+ this.model.f_privilege_money = window.prompt('请输入你想优惠的金额')
981
+ if (!(/^[1-9]\d*(\.\d+)?$/).test(this.model.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.model.f_privilege_money)) {
982
+ this.$showMessage('金额输入格式不正确!')
983
+ this.model.f_privilege_money = 0
984
+ return
985
+ }
986
+ if ((this.model.f_privilege_money - 0) >= this.model.f_collection) {
987
+ this.$showMessage('减免金额不能大于等于收款金额')
988
+ this.model.f_privilege_money = 0
989
+ return
990
+ }
991
+ }
992
+ }
993
+ }
994
+ // 优惠方式, 收款 缺一不计算
995
+ if (this.model.f_payment && this.model.f_payment.length && parseInt(this.model.f_privilege_id) && this.model.f_collection) {
996
+ let c = {
997
+ f_privilege_id: this.model.f_privilege_id,
998
+ f_collection: this.model.f_collection,
999
+ f_privilege_money: this.model.f_privilege_money
1000
+ }
1001
+ let privilegeData = await this.$resetpost('api/af-revenue/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
1002
+ // 减免金额
1003
+ this.model.f_privilege_money = privilegeData.data.f_privilege_money
1004
+ // 减免后收款金额
1005
+ this.model.f_after_discount = privilegeData.data.f_collection
1006
+ }
1007
+ },
1008
+ // 判断当前用户是否可以使用系统余额透支
1009
+ canOverdraftBalance () {
1010
+ return this.config.overdraftBalance && this.row.f_user_type != '民用'
1011
+ }
1012
+ },
1013
+ computed: {
1014
+ authArr () {
1015
+ return this.$login.r ? this.$login.r : []
1016
+ },
1017
+ 'curbalance' () {
1018
+ if (this.model.f_payment == '赠气') {
1019
+ return this.model.f_balance
1020
+ }
1021
+ if (this.model.f_preamount) {
1022
+ if (this.config.calculatePreByCollection) {
1023
+ return ((this.model.f_collection - 0) + (this.row.f_balance - 0) - this.model.f_preamount).toFixed(4)
1024
+ }
1025
+ // if (this.row.f_collection_type === '按金额') {
1026
+ // return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
1027
+ // } else {
1028
+ if ((this.row.f_balance - 0) > (this.model.f_preamount - 0)) {
1029
+ return ((this.row.f_balance - 0) - (this.model.f_preamount - 0) + (this.model.f_collection - 0)).toFixed(4)
1030
+ } else {
1031
+ return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
1032
+ }
1033
+ // return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
1034
+ // }
1035
+ } else {
1036
+ return this.row.f_balance
1037
+ }
1038
+ },
1039
+ 'invoice_show_gas' () {
1040
+ return this.row.f_collection_type === '按气量' ? '是' : '否'
1041
+ },
1042
+ 'islegal' () {
1043
+ console.log('支付分离。。。', this.paymentModel.length, this.model.f_collection)
1044
+ if (this.paymentModel.length > 1 && this.model.f_collection) {
1045
+ let sum = 0
1046
+ this.paymentModel.forEach((res) => {
1047
+ sum += (res.f_money - 0)
1048
+ })
1049
+ return (this.model.f_collection - 0) === (sum - 0)
1050
+ } else {
1051
+ return true
1052
+ }
1053
+ }
1054
+ }
1055
+ }
1056
+ </script>
1057
+
1058
+ <style>
1059
+ </style>
@@ -16,4 +16,6 @@ export default function () {
16
16
  Vue.component('iot-meter-center', (resolve) => { require(['./IOTMeterCenter'], resolve) })
17
17
  // 无卡收费
18
18
  Vue.component('no-card-meter-center', (resolve) => { require(['./NoCardMeterCenter'], resolve) })
19
+ // 卡表收费
20
+ Vue.component('card-meter-center', (resolve) => { require(['./CardMeterCenter'], resolve) })
19
21
  }
package/src/main.js CHANGED
@@ -3,7 +3,7 @@ import all from 'vue-client/src/all'
3
3
  import App from './App'
4
4
  import system from 'system-clients/src/system'
5
5
  import sale from './sale'
6
- import FilialeSale from './filiale/ronghao/sale'
6
+ import FilialeSale from './filiale/ruihua/sale'
7
7
  import address from 'address-client/src/address'
8
8
  import ldap from 'ldap-clients/src/ldap'
9
9
  import VueClipboard from 'vue-clipboard2'
File without changes
@@ -1,2 +0,0 @@
1
- #Mon Dec 30 14:38:17 CST 2024
2
- gradle.version=5.2.1
File without changes