sale-client 4.0.53-preview → 4.0.54-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.
@@ -1,7 +1,7 @@
1
1
  var path = require('path')
2
2
  var checkVersion = require('./versionCheck.js')
3
3
  checkVersion()
4
- const [ serverRul, localUrl, v4Url ] = ['http://192.168.50.4:8400/', 'http://localhost:8080', 'http://localhost:9026/']
4
+ const [ serverRul, localUrl, v4Url ] = ['http://123.57.92.217:8900/', 'http://123.57.92.217:8900/', 'http://123.57.92.217:8900/']
5
5
  var merge = require('webpack-merge')
6
6
  var baseConfig = require('./webpack.dev.conf')
7
7
  var devConfig = {
@@ -19,26 +19,26 @@ var devConfig = {
19
19
  children: false // 不输出子模块构建信息
20
20
  },
21
21
  proxy: {
22
- '/api/af-revenue/logic': {
23
- pathRewrite: {
24
- '/api/af-revenue/logic': '/logic'
25
- },
26
- target: 'http://localhost:9026/'
27
- },
28
- '/api/af-revenue/file': {
29
- pathRewrite: {
30
- '/api/af-revenue/file': '/file'
31
- },
32
- target: 'http://localhost:9026/'
33
- },
34
- '/api/af-revenue/sql': {
35
- pathRewrite: {
36
- '/api/af-revenue/sql': '/sql'
37
- },
38
- target: 'http://localhost:9026/'
39
- },
22
+ // '/api/af-revenue/logic': {
23
+ // pathRewrite: {
24
+ // '/api/af-revenue/logic': '/logic'
25
+ // },
26
+ // target: 'http://localhost:9026/'
27
+ // },
28
+ // '/api/af-revenue/file': {
29
+ // pathRewrite: {
30
+ // '/api/af-revenue/file': '/file'
31
+ // },
32
+ // target: 'http://localhost:9026/'
33
+ // },
34
+ // '/api/af-revenue/sql': {
35
+ // pathRewrite: {
36
+ // '/api/af-revenue/sql': '/sql'
37
+ // },
38
+ // target: 'http://localhost:9026/'
39
+ // },
40
40
  '/api': {
41
- target: 'http://192.168.50.67:31567'
41
+ target: 'http://123.57.92.217:8900/'
42
42
  },
43
43
  '/invoice/rs/logic/getInvoice': {
44
44
  target: serverRul
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sale-client",
3
- "version": "4.0.53-preview",
3
+ "version": "4.0.54-preview",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -182,7 +182,7 @@
182
182
  <div class="row">
183
183
  <div class="col-sm-4 form-group" :class="[$m.name.required ? 'has-error' : '']">
184
184
  <label for="pricename" class="font_normal_body">气价名称</label>
185
- <v-select :value.sync="row.pricename" v-model="row.pricename" search min-width="230px"
185
+ <v-select :value.sync="row.pricename" v-model="row.pricename" search min-width="285px"
186
186
  placeholder='气价名称' :options="getPricenames" @change="priceChange"
187
187
  close-on-select :disabled="permissionPrice" v-ref:name></v-select>
188
188
  <input type="text" v-show="false" v-model="$refs.name.selectedItems" v-validate:name='{required: true }'>
@@ -43,7 +43,7 @@
43
43
  </div>
44
44
  </div>
45
45
  <div v-if="model.f_preamount" style="font-size: 18px; font-weight: bold; margin-left: 757px">
46
- 大写预购金额: {{ convertToChinese(model.f_preamount) }} 元
46
+ 大写预购金额: {{ convertToChinese(model.f_preamount) }}
47
47
  </div>
48
48
  <div class="row" style="margin-top:6px;">
49
49
  <div class="col-sm-4 form-group" :class="[$v.printstyle.required ? 'select-error' : '']">
@@ -624,22 +624,57 @@
624
624
  }
625
625
  },
626
626
  methods: {
627
- convertToChinese (num) {
628
- // 简单的数字转换为中文大写金额的函数
629
- const units = ['', '拾', '佰', '仟', '万', '亿', '兆']
630
- const chars = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
631
- const str = num.toString()
632
- let result = ''
633
- let unitIndex = 0
634
-
635
- for (let i = str.length - 1; i >= 0; i--) {
636
- const n = str[i]
637
- result = chars[n] + (n === '0' ? '' : units[unitIndex]) + result
638
- unitIndex++
627
+ convertToChinese(num) {
628
+ const units = ['', '拾', '佰', '仟', '万', '亿', '兆']
629
+ const chars = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
630
+ const str = num.toString()
631
+ const [integerPart, decimalPart] = str.split('.')
632
+
633
+ let result = ''
634
+ let unitIndex = 0
635
+ let zeroFlag = false
636
+ // 处理整数部分
637
+ for (let i = integerPart.length - 1; i >= 0; i--) {
638
+ const n = integerPart[i]
639
+ if (n === '0') {
640
+ if (!zeroFlag) {
641
+ result = chars[n] + result
642
+ zeroFlag = true
643
+ }
644
+ } else {
645
+ result = chars[n] + units[unitIndex] + result
646
+ zeroFlag = false
639
647
  }
648
+ unitIndex++
649
+ }
640
650
 
641
- return result.replace(/零+/g, '零').replace(/零$/, '')
642
- },
651
+ result = result.replace(/零+/g, '零').replace(/零$/, '')
652
+ if (result === '') {
653
+ result = '零'
654
+ }
655
+
656
+ result += '元'
657
+
658
+ // 处理小数部分
659
+ if (decimalPart) {
660
+ const jiao = decimalPart[0] || '0'
661
+ const fen = decimalPart[1] || '0'
662
+
663
+ if (jiao !== '0') {
664
+ result += chars[jiao] + '角'
665
+ }
666
+ if (fen !== '0') {
667
+ result += chars[fen] + '分'
668
+ }
669
+ if (jiao === '0' && fen === '0') {
670
+ result += '整'
671
+ }
672
+ } else {
673
+ result += '整'
674
+ }
675
+
676
+ return result
677
+ },
643
678
  // 根据收款金额计算划价信息
644
679
  // 需要配置 calculatePreByCollection = true
645
680
  async calculatePreByCollection () {
@@ -0,0 +1,552 @@
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">
8
+ <label for="f_paytype" class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
+ <v-select id="f_payment"
10
+ v-model="f_payment"
11
+ placeholder='请选择'
12
+ :value.sync="model.f_payment"
13
+ :options='paytype'
14
+ close-on-select clear-button></v-select>
15
+ </div>
16
+ <div class="col-sm-4"
17
+ :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
18
+ <label for="f_pregas" class=" font_normal_body">预购气量</label>
19
+ <input class="input_search" style="width:60%" type="number"
20
+ @blur="pregas()" v-model="model.f_pregas" id="fpregas"
21
+ v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
22
+ v-next-el='sk' >
23
+ </div>
24
+ <!-- <div class="col-sm-4" v-if="row.f_collection_type == '按金额'">
25
+ <label for="f_pregas" class=" font_normal_body">预购气量</label>
26
+ <input class="input_search" style="width:60%" type="number"
27
+ @blur="pregas()" v-model="model.f_pregas" placeholder="预购气量"
28
+ v-next-el='sk' disabled>
29
+ </div>-->
30
+
31
+ <div class="col-sm-4">
32
+ <label for="f_preamount" class=" font_normal_body">预购金额</label>
33
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_preamount"
34
+ v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ] }'
35
+ v-scale="[model.f_preamount, 4]" placeholder="预购金额" disabled>
36
+ </div>
37
+ </div>
38
+ <div v-if="model.f_preamount" style="font-size: 18px; font-weight: bold; margin-left: 757px">
39
+ 大写预购金额: {{ convertToChinese(model.f_preamount) }}
40
+ </div>
41
+ <div class="row" style="margin-top:6px;">
42
+
43
+ <div class="col-sm-4">
44
+ <label for="f_print" class="font_normal_body">打印格式</label>
45
+ <v-select id="print"
46
+ v-model="f_print"
47
+ placeholder='请选择'
48
+ :multiple="mulPrint"
49
+ :value.sync="model.f_print"
50
+ :options='printstyle'
51
+ close-on-select clear-button></v-select>
52
+ </div>
53
+ <div class="col-sm-4" v-if="hasLimit&&limitgas">
54
+ <label class="font_normal_body">购气上限</label>
55
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
56
+ v-scale="[maxgas, 2]" placeholder='限购余气' disabled>
57
+ </div>
58
+ <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
59
+ <label class="font_normal_body">金额上限</label>
60
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxmoney"
61
+ v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
62
+ </div>
63
+ <div class="col-sm-4" v-if="!hasLimit">
64
+ </div>
65
+
66
+ <div class="col-sm-4"
67
+ :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
68
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按气量'"
69
+ class=" font_normal_body">应收金额</label>
70
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
71
+ class=" font_normal_body">本次缴费</label>
72
+ <input class="input_search" style="width:60%" type="number"
73
+ @blur="preamount()" v-model="model.f_totalcost"
74
+ v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
75
+ v-next-el='sk' v-scale="[model.f_totalcost, 4]" >
76
+ </div>
77
+ </div>
78
+ <div class="row">
79
+ <div class="col-sm-4">
80
+ <label for="f_balance" class="font_normal_body">上期结余</label>
81
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
82
+ v-scale="[model.f_balance, 4]" placeholder="上期结余" disabled>
83
+ </div>
84
+ <div class="col-sm-4">
85
+ <label for="f_curbalance" class="font_normal_body">本期结余</label>
86
+ <input class="input_search" style="width:60%" type="number" v-model="curbalance"
87
+ v-scale="[model.f_curbalance, 4]" placeholder="本期结余" disabled>
88
+ </div>
89
+
90
+ <div class="col-sm-4" v-if="row.f_collection_type === '按气量'"
91
+ :class="[$v.f_collection.required ? 'has-error' : 'has-success']">
92
+ <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
93
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_collection"
94
+ v-validate:f_collection='{required: true, dctest: [model.f_totalcost, ">=" ] }'
95
+ v-el:sk v-scale="[model.f_totalcost, 2]">
96
+ </div>
97
+ <div class="col-sm-4" v-if="row.f_collection_type === '按金额'">
98
+ <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
99
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_collection"
100
+ v-el:sk v-scale="[model.f_collection, 4]" disabled>
101
+ </div>
102
+ </div>
103
+ <div class="row" style="margin-top:5px;">
104
+ <div class="col-sm-4" v-if="!mjshow" >
105
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
106
+ <input class="input_search" style="width:60%" type="text"
107
+ v-model="model.f_serial_number" placeholder="业务单号">
108
+ </div>
109
+ <div class="col-sm-4" v-if="mjshow" :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
110
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
111
+ <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
112
+ v-model="model.f_serial_number" placeholder="业务单号">
113
+ </div>
114
+ <div class="col-sm-4">
115
+ <label for="f_write_card" style="color: red" class=" font_normal_body">是否写卡</label>
116
+ <v-select id="f_write_card"
117
+ v-model="model.f_write_card"
118
+ placeholder='是否写卡'
119
+ value-single
120
+ :value.sync="model.f_write_card"
121
+ :options='writecard'
122
+ close-on-select clear-button></v-select>
123
+ </div>
124
+ </div>
125
+ <div class="row" style="margin-top:5px;">
126
+ <div class="col-sm-9">
127
+ </div>
128
+ <div class="col-sm-3">
129
+ <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
130
+ </div>
131
+ </div>
132
+ <div class="row" v-if="model.f_payment[0].includes('POS')">
133
+ <div class="col-sm-4">
134
+ <label for="f_voucher_number" class="font_normal_body">凭证号</label>
135
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number" placeholder="凭证号">
136
+ </div>
137
+ </div>
138
+ <div class="row" v-if="!config.notShowFormula">
139
+ <div class="col-sm-4 col-sm-offset-8">
140
+ <strong>计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong>
141
+ </div>
142
+ </div>
143
+ <div class="row">
144
+ <div class="col-sm-5" v-if="row.f_collection_type === '按气量'">
145
+ <strong style="color:blue">温馨提示: 此气表品牌是按气量收费!!</strong>
146
+ </div>
147
+ <div class="col-sm-4" v-if="row.f_collection_type === '按金额'">
148
+ <strong style="color:blue">温馨提示: 此气表品牌是按金额收费!!</strong>
149
+ </div>
150
+ </div>
151
+ </form>
152
+ <print-bill :show="print" :bill-config='config' v-ref:printbill :bill-data='billData' :data='row'
153
+ v-on:toggle="close" @printok="printok" :data='row'></print-bill>
154
+ <div style="text-align:right;height: 25%;">
155
+ <payment-code-button :clickable="!$v.valid || clickConfirm"
156
+ :payment.sync="model.f_payment" :payment-data="paytype"
157
+ @confirm-payment="confirm()">
158
+ </payment-code-button>
159
+ <button class="button_search btn-gn" @click="confirm()" :disabled='!$v.valid || clickConfirm'>确认</button>
160
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
161
+ </div>
162
+ </validator>
163
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_collection"></payment-code>
164
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" :businessid="randomBusinessId" isremark="true" fusetype="无卡收费"></upload>
165
+ </div>
166
+ </div>
167
+ </template>
168
+ <script>
169
+ /**
170
+ *综合业务
171
+ *卡表收费组件
172
+ */
173
+
174
+ // 输入金额,换算气量
175
+ let preamountGen = async function (self) {
176
+ let dymoney = 0
177
+ let calFee = (self.model.f_totalcost - 0) + (self.row.f_balance - 0)
178
+ let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
179
+ if (getGas.data.gas) {
180
+ if (self.row.f_isdecimal === '是') {
181
+ if (self.row.f_alias === 'QiaoSong') {
182
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
183
+ } else {
184
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(4)
185
+ }
186
+ } else {
187
+ let tempnum = Math.floor(getGas.data.gas - 0)
188
+ let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
189
+ dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney1.data.chargenum - 0).toFixed(2)
190
+ self.model.f_pregas = Math.floor(getGas.data.gas - 0)
191
+ }
192
+ }
193
+ self.model.f_preamount = calFee - (dymoney - 0)
194
+ self.model.chargeprice = getGas.data.chargeprice
195
+ Object.assign(self.model, self.model, getGas.data)
196
+ self.model.f_totalcost = ((self.model.f_totalcost - 0) - (dymoney - 0)).toFixed(4)
197
+ // self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
198
+ if(self.config.floor){
199
+ self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
200
+ }
201
+ self.calText(getGas.data.chargeprice)
202
+ }
203
+
204
+ // 输入气量,换算金额
205
+ let pregasGen = async function (self) {
206
+ if (self.row.f_isdecimal === '是') {
207
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
208
+ } else {
209
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
210
+ }
211
+ if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
212
+ self.model.f_meter_type = self.row.f_meter_type
213
+ let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
214
+ self.model.f_preamount = getAmount.data.chargenum
215
+ 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))
216
+ Object.assign(self.model, self.model, getAmount.data)
217
+ self.model.chargeprice = getAmount.data.chargeprice
218
+ self.model.f_collection = self.model.f_totalcost
219
+ if(self.config.floor){
220
+ self.model.f_collection=Math.ceil(self.model.f_collection)
221
+ }
222
+ self.calText(getAmount.data.chargeprice)
223
+ }
224
+ }
225
+
226
+ // 执行保存逻辑
227
+ let sellgasGen = async function (self) {
228
+ try {
229
+ self.model.f_write_money = self.model.f_preamount
230
+ if (self.row.f_price_type == '阶梯气价' && self.row.f_is_step == '否') {
231
+ self.model.f_write_money = (self.model.f_pregas * self.model.chargeprice[0].f_price)
232
+ self.model.f_write_money = self.model.f_write_money.toFixed(2)
233
+ }
234
+ // 加入扫码盒付款码支付流水号
235
+ self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
236
+
237
+ let res = await self.$CardService.noCardSellGas(self.model, self.row, self.cardallot)
238
+ console.log('卡表收费返回id', res, self.model)
239
+ if (self.config.showupload) {
240
+ let param = []
241
+ for (let row of self.resid) {
242
+ param.push({id: row.id})
243
+ }
244
+ let data = {
245
+ param: param,
246
+ f_blobid: res
247
+ }
248
+ await self.$resetpost('api/af-revenue/logic/updatefiles', data)
249
+ }
250
+ // 开始打票
251
+ if (self.config.hasPrint) {
252
+ if (self.model.f_print.indexOf('电子发票') == -1) {
253
+ if (self.config.hasBillManage) {
254
+ // 启用发票管理,获取票据管理中的票号并存储记录
255
+ self.row.id = res
256
+ self.row.f_bill_type = '卡表收费'
257
+ self.row.f_bill_style = self.model.f_print[0]
258
+ self.row.f_preamount = self.model.f_preamount
259
+ self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
260
+ self.row.f_collection = self.model.f_collection
261
+ self.print = true
262
+ } else {
263
+ self.row.id = res
264
+ self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
265
+ self.print = true
266
+ }
267
+ } else {
268
+ if (self.model.f_print[0] === '电子发票') {
269
+ await self.$CommonService.openEticket(res, '售气收费')
270
+ self.row.id = res
271
+ self.print = true
272
+ }
273
+ }
274
+ } else {
275
+ self.$dispatch('success')
276
+ }
277
+ self.clickConfirm = false
278
+ } catch (error) {
279
+ self.$showAlert(error, 'danger', 0)
280
+ self.$dispatch('refresh')
281
+ self.clickConfirm = false
282
+ }
283
+ }
284
+
285
+ let asyncCardMeterCenter = async function (self) {
286
+ await self.$getConfig(self, 'CardMeterCenter')
287
+ console.log('卡表收费config', self.config)
288
+ // 默认打印格式
289
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
290
+ self.model.f_payment = [self.config.payment]
291
+ self.mulPrint = self.config.printType instanceof Array
292
+ // 判断限购
293
+ let limit_param = {
294
+ f_userinfo_id: self.row.f_userinfo_id,
295
+ f_user_id: self.row.f_user_id,
296
+ f_stairprice_id: self.row.f_stairprice_id
297
+ }
298
+ let getLimit = await self.$resetpost('api/af-revenue/logic/sale_getLimitGas', {data: limit_param}, {resolveMsg: null, rejectMsg: '获取限购值失败!!'})
299
+ console.log('获取限购值', getLimit)
300
+ self.hasLimit = getLimit.data.hasLimit
301
+ if (self.hasLimit) {
302
+ if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
303
+ if (getLimit.data.f_limit_value < 0 || getLimit.data.f_limit_amount < 0) {
304
+ self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
305
+ self.$dispatch('refresh')
306
+ } else {
307
+ if (getLimit.data.f_limit_value) {
308
+ self.maxgas = (getLimit.data.f_limit_value - 0)
309
+ self.limitgas = true
310
+ }
311
+ if (getLimit.data.f_limit_amount) {
312
+ self.maxmoney = (getLimit.data.f_limit_amount - 0)
313
+ self.limitmoney = true
314
+ }
315
+ }
316
+ }
317
+ }
318
+ }
319
+ export default {
320
+ title: '无卡收费',
321
+ data () {
322
+ return {
323
+ serialShow: false,
324
+ resid: [], // 存放新增的f_files表中id
325
+ config: {
326
+ notShowFormula: false, // 不显示计算公式,默认显示
327
+ hasPrint: true, // 默认打票
328
+ hasBillManage: false, // 默认不启用发票管理
329
+ floor: false, //是否取整收费
330
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
331
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
332
+ showupload: true,
333
+ payment: '现金缴费'
334
+ },
335
+ model: {
336
+ f_purchase: 0,
337
+ f_write_card: '不写卡',
338
+ f_payment: '',
339
+ f_pregas: '',
340
+ f_preamount: 0,
341
+ f_totalcost: 0,
342
+ f_curbalance: 0,
343
+ f_collection: '',
344
+ f_balance: 0,
345
+ f_print: [],
346
+ f_meter_type: '',
347
+ f_voucher_number: ''
348
+ },
349
+ calculatedetail: '',
350
+ print: false,
351
+ billData: {
352
+ url: 'api/af-revenue/report/card_bill',
353
+ billnumber: ''
354
+ },
355
+ randomBusinessId: '',
356
+ hasLimit: false,
357
+ maxgas: 99999999, // 限购
358
+ maxmoney: 99999999,
359
+ limitmoney: false,
360
+ limitgas: false,
361
+ mulPrint: false,
362
+ clickConfirm: false, // 控制确认按钮只能点击一次
363
+ // 下拉框值
364
+ paytype: this.$appdata.getParam('付款方式'),
365
+ printstyle: this.$appdata.getParam('打印格式'),
366
+ writecard: [{label: '写卡',value:'写卡'},{label: '不写卡',value:'不写卡'}],
367
+ mjshow: false
368
+ }
369
+ },
370
+ props: ['row'],
371
+ ready () {
372
+ // this.getPurchase()
373
+ this.model.f_price_id = this.row.f_price_id
374
+ this.model.f_user_id = this.row.f_user_id
375
+ this.model.f_userfiles_id = this.row.f_userfiles_id
376
+ this.model.f_userinfo_id = this.row.f_userinfo_id
377
+ this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
378
+ if (this.row.f_collection_type == '按金额') {
379
+ this.model.f_totalcost = ''
380
+ this.model.f_pregas = 0
381
+ }
382
+ document.getElementById('fpregas').focus()
383
+ asyncCardMeterCenter(this)
384
+ this.getRandomId()
385
+ },
386
+ events: {
387
+ // 删除Resid数组元素
388
+ 'delResid' (val) {
389
+ this.resid.$remove({id: val, f_biobid: ''})
390
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
391
+ },
392
+ // 增加Resid数组元素
393
+ 'resid' (val) {
394
+ this.resid.push({id: val, f_biobid: ''})
395
+ }
396
+ },
397
+ methods: {
398
+ convertToChinese (num) {
399
+ const units = ['', '拾', '佰', '仟', '万', '亿', '兆']
400
+ const chars = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
401
+ const str = num.toString()
402
+ const [integerPart, decimalPart] = str.split('.')
403
+
404
+ let result = ''
405
+ let unitIndex = 0
406
+ let zeroFlag = false
407
+ // 处理整数部分
408
+ for (let i = integerPart.length - 1; i >= 0; i--) {
409
+ const n = integerPart[i]
410
+ if (n === '0') {
411
+ if (!zeroFlag) {
412
+ result = chars[n] + result
413
+ zeroFlag = true
414
+ }
415
+ } else {
416
+ result = chars[n] + units[unitIndex] + result
417
+ zeroFlag = false
418
+ }
419
+ unitIndex++
420
+ }
421
+
422
+ result = result.replace(/零+/g, '零').replace(/零$/, '')
423
+ if (result === '') {
424
+ result = '零'
425
+ }
426
+
427
+ result += '元'
428
+
429
+ // 处理小数部分
430
+ if (decimalPart) {
431
+ const jiao = decimalPart[0] || '0'
432
+ const fen = decimalPart[1] || '0'
433
+
434
+ if (jiao !== '0') {
435
+ result += chars[jiao] + '角'
436
+ }
437
+ if (fen !== '0') {
438
+ result += chars[fen] + '分'
439
+ }
440
+ if (jiao === '0' && fen === '0') {
441
+ result += '整'
442
+ }
443
+ } else {
444
+ result += '整'
445
+ }
446
+
447
+ return result
448
+ },
449
+ getRandomId () {
450
+ this.randomBusinessId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
451
+ let res = Math.random() * 16 | 0
452
+ let v = c == 'x' ? res : (res & 0x3 | 0x8)
453
+ return v.toString(16)
454
+ })
455
+ },
456
+ confirm () {
457
+ this.$showMessage(`对客户${this.row.f_user_name}进行收费。该操作只做收费,不做写卡,确定要进行该操作吗?`, ['confirm', 'cancel']).then(async (res) => {
458
+ if (res === 'confirm') {
459
+ let ss = await this.$refs.paymentcode.flowPath()
460
+ this.$refs.paymentcode.paymentCodeShow = false
461
+ console.log('付款码操作返回', ss)
462
+ if (!ss.result) return
463
+ this.clickConfirm = true
464
+ this.model.f_curbalance = this.curbalance
465
+ this.$dispatch('no-button')
466
+ sellgasGen(this)
467
+ }
468
+ })
469
+ },
470
+ clean () {
471
+ this.$info('取消操作')
472
+ this.$dispatch('refresh', this.row)
473
+ },
474
+ printok () {
475
+ // 收据打完,判断是否还有其他票据进行请求
476
+ for (let i = 0; i < this.model.f_print.length; i++) {
477
+ if (this.model.f_print[i] === '电子发票') {
478
+ this.$CommonService.openEticket(this.row.id, '售气收费')
479
+ }
480
+ }
481
+ this.$dispatch('success')
482
+ },
483
+ pregas () {
484
+ if (this.model.f_pregas && this.model.f_pregas > 0) {
485
+ try {
486
+ // 对气量进行验证
487
+ if ((this.row.f_topup_ceil - 0) > 0 && (this.model.f_pregas - 0) > (this.row.f_topup_ceil - 0)) {
488
+ this.$showAlert(`您输入的气量不能大于该表的充值上限: ${this.row.f_topup_ceil}`, 'warning', 5000)
489
+ this.model.f_pregas = null
490
+ } else {
491
+ pregasGen(this)
492
+ }
493
+ } catch (error) {
494
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
495
+ this.$dispatch('error', '发卡售气', this.model, error)
496
+ }
497
+ }
498
+ },
499
+ preamount () {
500
+ if ((this.model.f_totalcost && this.model.f_totalcost > 0) || this.row.f_balance > 0) {
501
+ try {
502
+ preamountGen(this)
503
+ } catch (error) {
504
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
505
+ this.$dispatch('error', '发卡售气', this.model, error)
506
+ }
507
+ }
508
+ },
509
+ calText (val) {
510
+ let str = ''
511
+ val.forEach((item) => {
512
+ str = str + item.f_price + ' x ' + item.f_gas + '+'
513
+ })
514
+ str = str.slice(0, str.length - 1)
515
+ this.calculatedetail = str
516
+ },
517
+ close () {
518
+ this.print = false
519
+ this.clean()
520
+ }
521
+ },
522
+ watch: {
523
+ 'model.f_payment' (val) {
524
+ if (val == '免交') {
525
+ this.mjshow = true
526
+ } else {
527
+ this.mjshow = false
528
+ }
529
+ }
530
+ },
531
+ computed: {
532
+ 'curbalance' () {
533
+ if (this.model.f_preamount) {
534
+ if (this.row.f_collection_type === '按金额') {
535
+ return ((this.model.f_totalcost - 0) + (this.row.f_balance - 0) - (this.model.f_preamount - 0)).toFixed(4)
536
+ } else {
537
+ if ((this.row.f_balance - 0) > (this.model.f_preamount - 0)) {
538
+ return ((this.row.f_balance - 0) - (this.model.f_preamount - 0)).toFixed(4)
539
+ } else {
540
+ return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
541
+ }
542
+ }
543
+ } else {
544
+ return 0
545
+ }
546
+ }
547
+ }
548
+ }
549
+ </script>
550
+
551
+ <style>
552
+ </style>
@@ -14,4 +14,6 @@ export default function () {
14
14
  Vue.component('file-user-address', (resolve) => { require(['./FilesManage/FileUserAddress'], resolve) })
15
15
  // 物联网表收费
16
16
  Vue.component('iot-meter-center', (resolve) => { require(['./IOTMeterCenter'], resolve) })
17
+ // 无卡收费
18
+ Vue.component('no-card-meter-center', (resolve) => { require(['./NoCardMeterCenter'], resolve) })
17
19
  }
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/xihu/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'
@@ -1,2 +0,0 @@
1
- #Mon Sep 09 09:42:20 CST 2024
2
- gradle.version=5.2.1
File without changes