sale-client 3.6.94 → 3.6.96

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