sale-client 4.2.64 → 4.2.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/build/dev-server.js +68 -90
  2. package/index.html +2 -7
  3. package/package.json +1 -1
  4. package/src/App.vue +1 -1
  5. package/src/components/revenue/HandManager/MeterBookUser.vue +726 -726
  6. package/src/components/revenue/comprehen/ComprehenOperation/QrPay/QrPaymentDetailed.vue +423 -423
  7. package/src/components/revenue/comprehen/Maintenance/hand/handOperate.vue +469 -469
  8. package/src/components/revenue/machineHandManage/ArrearsQuery.vue +938 -938
  9. package/src/components/webMeter/MeterManage/WebMeterBatchOperationValve.vue +970 -970
  10. package/src/filiale/alashan/eticket/EticketRecordList.vue +428 -428
  11. package/src/filiale/bayan/ChargeList.vue +1010 -1010
  12. package/src/filiale/bayan/StockListmain.vue +543 -543
  13. package/src/filiale/bazhong/UserInfoDetailManageNew.vue +245 -245
  14. package/src/filiale/bazhong/ic_detail/ChangeMeterQueryUser.vue +370 -370
  15. package/src/filiale/bazhong/sale.js +8 -8
  16. package/src/filiale/beifangshiye/OtherChargeNew.vue +625 -625
  17. package/src/filiale/hongYa/revenue/comprehen/ComprehenOperation/newchangemeter/ChangeMeter.vue +1191 -0
  18. package/src/filiale/hongYa/sale.js +6 -0
  19. package/src/filiale/lixianV3/ArrearsQuery.vue +938 -938
  20. package/src/filiale/lixianV3/InsuranceChargesDetails.vue +425 -425
  21. package/src/filiale/meihekou/common/userinfo_detail/ic_detail/MachineRecordQuery.vue +281 -281
  22. package/src/filiale/qianneng/revenue/sms/AccountMessageList.vue +508 -508
  23. package/src/filiale/ronghao/ArrearsQuery.vue +974 -974
  24. package/src/filiale/ronghao/CardService.js +2144 -2144
  25. package/src/filiale/ronghao/InsuranceManage.vue +58 -58
  26. package/src/filiale/ronghao/MachineChargeService.js +149 -149
  27. package/src/filiale/ronghao/NoCardMeterCenter.vue +534 -534
  28. package/src/filiale/ronghao/PaymentCode.vue +174 -174
  29. package/src/filiale/ronghao/PriceChangeCompensation/CompensationManage.vue +26 -26
  30. package/src/filiale/ronghao/PriceChangeCompensation/IotCompensation.vue +318 -318
  31. package/src/filiale/ronghao/PriceChangeCompensation/JbCompensation.vue +343 -343
  32. package/src/filiale/ronghao/PriceChangeCompensation/SurplusRecordDetail.vue +74 -74
  33. package/src/filiale/ronghao/ReplaceCardManage.vue +415 -415
  34. package/src/filiale/ronghao/Upload.vue +654 -654
  35. package/src/filiale/ronghao/cardDown.vue +1141 -1141
  36. package/src/filiale/ronghao/changemeterOperate.vue +315 -315
  37. package/src/filiale/ronghao/fillgasSpecific.vue +313 -313
  38. package/src/filiale/ronghao/ic_detail/ChargeRecordQuery.vue +106 -106
  39. package/src/filiale/ronghao/ic_detail/WatchCollection.vue +115 -115
  40. package/src/filiale/ronghao/ic_detail/WebHandQueryUser.vue +411 -411
  41. package/src/filiale/ronghao/machineDown.vue +1176 -1176
  42. package/src/filiale/ronghao/replacementSingleInfoOperation.vue +315 -315
  43. package/src/filiale/ronghao/specificInformation.vue +537 -537
  44. package/src/filiale/yangchun/ChargeList.vue +954 -954
  45. package/src/filiale/yangchun/FilesManage/UserGeneralInfoTest.vue +837 -837
  46. package/src/filiale/yangchun/MeterinfoTest.vue +1212 -1212
  47. package/src/filiale/yuncheng/changemeterListMaintain.vue +504 -504
  48. package/src/filiale/zhongsheng/BlackListList.vue +293 -293
  49. package/src/filiale/zhongyi/HandQueryUser.vue +389 -389
  50. package/src/main.js +1 -1
@@ -0,0 +1,1191 @@
1
+ <template>
2
+ <div class="auto" style="overflow:auto;" id="ChangeMeter">
3
+ <validator name='v'>
4
+ <form novalidate class="form-horizontal">
5
+ <div class="row auto">
6
+ <div class="col-sm-4 form-group">
7
+ <label for="f_type" class=" font_normal_body">换表类型</label>
8
+ <v-select id="f_type"
9
+ v-model="model.f_type"
10
+ title="参数:换表类型"
11
+ placeholder='请选择'
12
+ :value-single="true"
13
+ :value.sync="model.f_type"
14
+ :options='replacewatchtype'
15
+ @change="typeChange"
16
+ :disabled="!(row.f_meter_type.includes('卡表')||row.f_meter_type ==='物联网表')"
17
+ close-on-select clear-button>
18
+ </v-select>
19
+ </div>
20
+ <div class="col-sm-4 form-group" v-if="model.f_type === '老旧小区整改换表'">
21
+ <label class="font_normal_body">整体改管日期</label>
22
+ <datepicker placeholder="整体改管日期"
23
+ v-model="model.f_all_changetube_date"
24
+ :value.sync="model.f_all_changetube_date"
25
+ :format="'yyyy-MM-dd HH:mm:ss'"
26
+ style="width:60%"
27
+ ></datepicker>
28
+ </div>
29
+ <div class="col-sm-4 form-group" v-if="!config.f_change_operator">
30
+ <label for="f_change_operator" class=" font_normal_body">换&ensp;表&ensp;人</label>
31
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_change_operator"
32
+ placeholder="换表人">
33
+ </div>
34
+ <div class="col-sm-4 form-group" v-if="config.f_change_operator" :class="[$v.f_change_operator.required ? 'has-error' : '']">
35
+ <label for="f_change_operator" class=" font_normal_body">换&ensp;表&ensp;人</label>
36
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_change_operator"
37
+ v-validate:f_change_operator="{required: true }"
38
+ placeholder="换表人">
39
+ </div>
40
+
41
+ <div class="col-sm-4 form-group"
42
+ :class="[$v.f_using_base_old.required || $v.f_using_base_old.dctest ? 'has-error' : 'has-success']">
43
+ <label for="f_remanent_gas" class=" font_normal_body">旧表底数</label>
44
+ <input class="input_search" style="width:60%" type="number"
45
+ v-model="model.f_using_base_old"
46
+ placeholder="请输入旧表底数"
47
+ v-validate:f_using_base_old='{required: true, dctest: [-1, ">" ] }'
48
+ @blur="pregasChange()">
49
+ </div>
50
+ </div>
51
+ <!--<p class="bg-info text-center" v-if="!model.f_type.includes('清零')" style="padding: 8px;">新表信息</p>-->
52
+ <meter-message v-if="!model.f_type.includes('清零') && !model.f_type.includes('换卡控流量计')"
53
+ :f_userfiles_id="row.f_userfiles_id" :metermessage.sync="model.metermessage"
54
+ @valid="meterinfo = true"
55
+ @invalid="meterinfo = false" @gasmodel="gasModelChange" v-ref:metermsg></meter-message>
56
+
57
+ <div v-if="row.f_meter_type != '机表'">
58
+ <div class="row auto" style="margin-top: 10px"
59
+ v-if="changeType == 'gasToAmount' || changeType == 'amountToGas'">
60
+ <!-- 气量转金额 || 金额转签气量 -->
61
+ <div class="col-sm-4 form-group"
62
+ :class="[$v.f_remanent_gas.required || $v.f_remanent_gas.dctest ? 'has-error' : 'has-success']">
63
+ <label for="f_remanent_gas" class=" font_normal_body">补&ensp;气&ensp;量</label>
64
+ <input class="input_search" style="width:60%" type="number"
65
+ v-model="model.f_remanent_gas"
66
+ placeholder="补气量"
67
+ v-validate:f_remanent_gas='{required: true, dctest: [-1, ">" ] }'>
68
+ </div>
69
+ <div class="col-sm-4 form-group">
70
+ <label class=" font_normal_body">补气单价</label>
71
+ <input class="input_search" style="width:60%" type="number"
72
+ v-model="model.f_remanent_price"
73
+ placeholder="补气单价" readonly>
74
+ </div>
75
+ <div class="col-sm-4 form-group"
76
+ :class="[$v.f_remanent_money.required || $v.f_remanent_money.dctest ? 'has-error' : 'has-success']">
77
+ <label for="f_remanent_money" class=" font_normal_body">补气金额</label>
78
+ <input class="input_search" style="width:60%" type="number"
79
+ v-model="model.f_remanent_money"
80
+ placeholder="补气金额"
81
+ @blur="remanentChange"
82
+ v-validate:f_remanent_money='{required: true, dctest: [-1, ">" ] }'>
83
+ </div>
84
+ </div>
85
+ <div class="row auto" v-if="changeType == 'gasToGas'">
86
+ <!-- 气量转气量 -->
87
+ <div class="col-sm-4 form-group"
88
+ :class="[$v.f_remanent_gas.required || $v.f_remanent_gas.dctest ? 'has-error' : 'has-success']">
89
+ <label for="f_remanent_gas" class=" font_normal_body">补&ensp;气&ensp;量</label>
90
+ <input class="input_search" style="width:60%" type="number"
91
+ v-model="model.f_remanent_gas"
92
+ placeholder="补气量"
93
+ v-validate:f_remanent_gas='{required: true, dctest: [-1, ">" ] }'>
94
+ </div>
95
+ </div>
96
+
97
+ <div class="row auto" v-if="changeType == 'amountToAmount'">
98
+ <!-- 金额转金额 -->
99
+ <div class="col-sm-4 form-group"
100
+ :class="[$v.f_remanent_money.required || $v.f_remanent_money.dctest ? 'has-error' : 'has-success']">
101
+ <label for="f_remanent_money" class=" font_normal_body">补气金额</label>
102
+ <input class="input_search" style="width:60%" type="number"
103
+ v-model="model.f_remanent_money"
104
+ placeholder="补气金额"
105
+ v-scale="[model.f_remanent_money, row.f_fee_decimal || 4]"
106
+ v-validate:f_remanent_money='{required: true, dctest: [-1, ">" ] }'>
107
+ </div>
108
+ </div>
109
+ </div>
110
+
111
+ <div class="row auto" v-if="model.f_type.includes('换卡控流量计')">
112
+ <div class="col-sm-4 form-group">
113
+ <label class="font_normal_body" title="流量计表号">新流量计表号</label>
114
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_flowmeter_number"
115
+ placeholder='流量计表号'></input>
116
+ </div>
117
+ <div class="col-sm-4 form-group">
118
+ <label class="font_normal_body" title="流量计通经">新流量计通经</label>
119
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_flowmeter_pass"
120
+ placeholder='流量计通经'></input>
121
+ </div>
122
+ <div class="col-sm-4 form-group" :class="[$v.f_meter_base.required ? 'has-error' : '']">
123
+ <label class="font_normal_body">新表底数</label>
124
+ <input type="number" class="input_search" style="width:60%" v-validate:f_meter_base='{required: true }'
125
+ v-model="model.metermessage.f_meter_base" placeholder='表底数'>
126
+ </div>
127
+
128
+ <div class="col-sm-4 form-group">
129
+ <label class="font_normal_body" title="流量计品牌">新流量计品牌</label>
130
+ <v-select :value.sync="model.f_flowmeter_brand" :options='flowmeterbrands' value-single placeholder='流量计品牌'
131
+ close-on-select
132
+ search v-model='model.f_flowmeter_brand'></v-select>
133
+ </div>
134
+ <div class="col-sm-4 form-group">
135
+ <label class="font_normal_body" title="流量计型号">新流量计型号</label>
136
+ <v-select :value.sync="model.f_flowmeter_model" :options='flowmetermodels(model.f_flowmeter_brand)'
137
+ value-single placeholder='流量计型号' close-on-select
138
+ v-model='model.f_flowmeter_model' :disabled='model.f_flowmeter_brand.length === 0'></v-select>
139
+ </div>
140
+ <div class="col-sm-4 form-group">
141
+ <label class="font_normal_body" title="流量计精准度">新流量计精准度</label>
142
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_flowmeter_accuracy"
143
+ placeholder='流量计精准度'></input>
144
+ </div>
145
+ <div class="col-sm-4 form-group">
146
+ <label class="font_normal_body" title="流量计压力等级">新流量计压力等级</label>
147
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_flowmeter_mpa_level"
148
+ placeholder='流量计压力等级'></input>
149
+ </div>
150
+ <div class="col-sm-4 form-group">
151
+ <label class="font_normal_body" title="流量计安装日期">新流量计安装日期</label>
152
+ <datepicker style="width:60%" placeholder="流量计安装日期"
153
+ v-model="model.f_flowmeter_install_date"
154
+ :value.sync="model.f_flowmeter_install_date"
155
+ :format="'yyyy-MM-dd HH:mm:ss'"
156
+ ></datepicker>
157
+ </div>
158
+ <div class="col-sm-4 form-group">
159
+ <label class="font_normal_body">业务单号</label>
160
+ <input class="input_search" style="width:60%" type="text"
161
+ v-model="model.f_serial_number" placeholder="业务单号">
162
+ </div>
163
+ </div>
164
+
165
+
166
+ <div class="row auto">
167
+
168
+ <div class="col-sm-4 form-group">
169
+ <label for="f_changemeter_fee" class=" font_normal_body">换表金额</label>
170
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_changemeter_fee"
171
+ placeholder="换表金额">
172
+ </div>
173
+ <div class="col-sm-4 form-group">
174
+ <label for="f_paytype" class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
175
+ <v-select id="f_payment"
176
+ title="参数:付款方式"
177
+ v-model="f_payment"
178
+ placeholder='请选择'
179
+ :value-single="true"
180
+ :value.sync="model.f_payment"
181
+ :options='paytype'
182
+ close-on-select clear-button></v-select>
183
+ </div>
184
+ <div class="col-sm-4 form-group">
185
+ <label for="f_print" class="font_normal_body">打印格式</label>
186
+ <v-select id="print"
187
+ title="参数:打印格式"
188
+ v-model="f_print"
189
+ placeholder='请选择'
190
+ :multiple="mulPrint"
191
+ :value.sync="model.f_print"
192
+ :options='printstyle'
193
+ close-on-select clear-button></v-select>
194
+ </div>
195
+ </div>
196
+ <div class="row" v-if="!model.f_type.includes('换卡控流量计')">
197
+ <div class="col-sm-4 form-group" :class="[$m.type.required ? 'has-error' : '']">
198
+ <label class="font_normal_body">气价类型</label>
199
+ <v-select :value.sync="newinfo.pricetype" v-model="newinfo.pricetype"
200
+ placeholder='气价类型' :options="pricetypes"
201
+ close-on-select v-ref:type>
202
+ </v-select>
203
+ </div>
204
+ <div class="col-sm-4 form-group" :class="[$m.name.required ? 'has-error' : '']">
205
+ <label class="font_normal_body">气价名称</label>
206
+ <v-select :value.sync="newinfo.pricename" v-model="newinfo.pricename"
207
+ placeholder='气价名称' :options="getPricenames()"
208
+ close-on-select :disabled='newinfo.pricetype.length === 0 ' v-ref:name></v-select>
209
+ </div>
210
+ <div class="col-sm-4 form-group">
211
+ <label class="font_normal_body">新抄表册</label>
212
+ <v-select :value.sync="newinfo.f_meter_book"
213
+ v-model="newinfo.f_meter_book"
214
+ placeholder='新抄表册'
215
+ :options="meterbookoptions"
216
+ close-on-select>
217
+
218
+ </v-select>
219
+ </div>
220
+
221
+ </div>
222
+ <div class="row auto" v-if="!model.f_type.includes('换卡控流量计')">
223
+ <div class="col-sm-4 ">
224
+ <label for="f_comments" class=" font_normal_body">业务单号</label>
225
+ <input class="input_search" style="width:60%" type="text"
226
+ v-model="model.f_serial_number" placeholder="业务单号">
227
+ </div>
228
+ <div class="col-sm-4 ">
229
+ <label class=" font_normal_body">阶梯累计</label>
230
+ <v-select id="f_ladder_sync"
231
+ v-model="model.f_ladder_sync"
232
+ placeholder='是否累计'
233
+ :search="false"
234
+ :value-single="true"
235
+ :value.sync="model.f_ladder_sync"
236
+ :options='ladder'
237
+ close-on-select clear-button></v-select>
238
+ </div>
239
+ <div class="col-sm-4"
240
+ :class="[$v.f_stair_use.required || $v.f_stair_use.dctest ? 'has-error' : 'has-success']"
241
+ v-if=" model.metermessage.gasbrand[0].f_meter_type ==='物联网表'&& model.f_ladder_sync !=='不同步'">
242
+ <label class=" font_normal_body">阶梯用量</label>
243
+ <input class="input_search" style="width:60%" type="number"
244
+ v-validate:f_stair_use='{required: true, dctest: [0, ">=" ] }'
245
+ v-model="model.f_stair_use" placeholder="旧表阶梯使用量">
246
+ </div>
247
+ <div class="col-sm-4 "
248
+ v-if="(model.metermessage.gasbrand[0].f_meter_type ==='物联网表' && model.metermessage.gasbrand[0].f_hascard ==='是')
249
+ || (model.f_type.includes('清零') && row.f_meter_type ==='物联网表' && row.f_hascard ==='是')">
250
+ <label class=" font_normal_body">开户方式</label>
251
+ <v-select id="f_open_type"
252
+ v-model="model.f_open_type"
253
+ placeholder='开户方式'
254
+ :search="false"
255
+ :value-single="true"
256
+ :value.sync="model.f_open_type"
257
+ :options='opentype'
258
+ close-on-select clear-button></v-select>
259
+ </div>
260
+ <div v-if="config.aroundmeter" class="col-sm-4 form-group" :class="[$v.f_newaroundmeter.required ? 'has-error' : '']">
261
+ <label class="font_normal_body">新表表向</label>
262
+ <v-select :value.sync="model.f_newaroundmeter" :options='aroundmeters' placeholder='新表表向'
263
+ :value-single="true"
264
+ close-on-select
265
+ v-model='model.f_newaroundmeter'></v-select>
266
+ </div>
267
+ <div v-if="config.hasAudit" class="col-sm-4 form-group">
268
+ <label class="font_normal_body" :class="[$v.f_audit_person.required ? 'has-error' : 'has-success']">&nbsp;审核人员&nbsp;</label>
269
+ <input v-show="false" v-model="model.f_audit_person"
270
+ v-validate:f_audit_person='{required: true}'>
271
+ <v-select :value.sync="model.f_audit_person"
272
+ :options='auditor' placeholder='请选择'
273
+ selected="审核人员"
274
+ :value-single="true"
275
+ style="width:60%"
276
+ close-on-select></v-select>
277
+ </div>
278
+ </div>
279
+ <div class="row auto">
280
+ <div class="col-sm-12"
281
+ v-if="!commitflag"
282
+ >
283
+ <label class="font_normal_body ">备&emsp;&emsp;注</label>
284
+ <textarea class="input_textarea" rows="3" style="width:87%;" v-model="model.f_comments"></textarea>
285
+ </div>
286
+ <div class="col-sm-12"
287
+ :class="[$v.f_comments.required ? 'has-error' : 'has-success']"
288
+ v-if="commitflag"
289
+ >
290
+ <label class="font_normal_body ">备&emsp;&emsp;注</label>
291
+ <textarea class="input_textarea" rows="3" style="width:87%;" v-model="model.f_comments"
292
+ v-validate:f_comments='{required: true}'
293
+ ></textarea>
294
+ </div>
295
+ </div>
296
+
297
+ <div class="col-sm-12" v-if="config.changeReason">
298
+ <label class="font_normal_body ">换表原因</label>
299
+ <textarea class="input_textarea" rows="3" style="width:87%;" v-model="model.f_changetables_reason"></textarea>
300
+ </div>
301
+ <div style="text-align:right;height:auto;">
302
+ <button class="button_search" v-show="config.approve == true ? applyButtonShow : false" type="button" @click="apply()"
303
+ :disabled="(!meterinfo && !(model.f_type.includes('清零') || model.f_type.includes('换卡控流量计'))) || !$v.valid"
304
+ >换表审核
305
+ </button>
306
+ <button class="button_search" v-show="config.approve == true ? !applyButtonShow : true" type="button" @click="confirmbefore()"
307
+ :disabled="(!meterinfo && !(model.f_type.includes('清零') ||
308
+ model.f_type.includes('换卡控流量计'))) || !$v.valid"
309
+ >确认
310
+ </button>
311
+ <button class="button_clear" v-show="applyButtonShow" type="button" @click="clean()">取消
312
+ </button>
313
+ </div>
314
+ </form>
315
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
316
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' v-ref:printbill @toggle="close" :data='row' @printok="printok" ></print-bill>
317
+ </validator>
318
+ <modal :show.sync="addTaskModalShow" backdrop="false" width="40%" title="创建任务" small="true" @modal-close="addTaskModalClose()">
319
+ <article slot="modal-body" class="row" style="padding: 10px">
320
+ <add-apply-task :applytaskobj.sync="addTaskModel" @valid="addTaskValid = true" @invalid="addTaskValid = false">
321
+ </add-apply-task>
322
+ </article>
323
+ <footer slot="modal-footer" class="modal-footer" style="text-align: right;border: 0">
324
+ <button class="btn button_search" @click="addTask()"
325
+ :disabled="!addTaskValid">新增审核任务
326
+ </button>
327
+ </footer>
328
+ </modal>
329
+ </div>
330
+ <upload v-if="config.showupload" :blodid="row.f_userinfo_id" :businessid="model.randomBusinessId" isremark="true" fusetype="换表&清零"></upload>
331
+ </template>
332
+ <script>
333
+ /**
334
+ *换表管理
335
+ *组合界面,加载机表,物联网表,气量卡表,金额卡表旧表信息,以及控制显示换新表信息
336
+ */
337
+ import { HttpResetClass } from 'vue-client'
338
+ import Vue from 'vue'
339
+ let getPrice = async function (self) {
340
+ await self.$LoadParams.loadParam(self.$login.f.orgid)
341
+ await self.$getConfig(self, 'ChangeMeter')
342
+
343
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
344
+ self.model.f_payment = self.config.payment
345
+ self.model.f_ladder_sync = self.config.ladderSync
346
+ self.mulPrint = self.config.printType instanceof Array
347
+ self.model.f_use_type = self.config.billType
348
+ self.model.f_bill_type = self.model.f_print
349
+ self.hasValidateBill = self.config.hasBillManage
350
+ self.newinfo.f_meter_book = self.row.f_meter_book_num ? [self.row.f_meter_book_num] : []
351
+
352
+ self.model.f_open_type = self.config.open_way
353
+ self.isGas = (self.row.f_collection_type == '按气量')
354
+
355
+ let http = new HttpResetClass()
356
+ let param = {
357
+ tablename: 't_detailprice',
358
+ condition: `f_price_name = '1' and f_stairprice_id = '${self.row.f_stairprice_id}'`
359
+ }
360
+ let res = await http.load('POST', 'api/af-revenue/sql/saleSingleTable', {
361
+ data: param
362
+ }, {
363
+ resolveMsg: null,
364
+ rejectMsg: '获取一阶单价!!'
365
+ })
366
+ if (res.data.length > 0) {
367
+ self.model.f_remanent_price = res.data[0].f_price
368
+ }
369
+ let temp = {
370
+ tablename: 't_meter_book',
371
+ condition: `f_book_state='有效' and f_filiale_id='${self.$login.f.orgid}'`
372
+ }
373
+ let meterbooks = await http.load('POST', 'api/af-revenue/sql/saleSingleTable?pageNo=1&pageSize=9999', {data: temp},
374
+ {resolveMsg: null, rejectMsg: '获取抄表册信息失败!!'})
375
+ if (meterbooks.data.length > 0) {
376
+ let options = []
377
+ for (let i = 0; i < meterbooks.data.length; i++) {
378
+ let tmp = {label: meterbooks.data[i].f_book_name, value: meterbooks.data[i].id}
379
+ options.push(tmp)
380
+ }
381
+ self.meterbookoptions = options
382
+ }
383
+ if (self.row.f_price_type === '固定气价') {
384
+ self.model.f_stair_use = 0
385
+ } else {
386
+ let a = await http.load('POST', 'api/af-revenue/logic/commonCal', {data: {model: self.row, isGasValue: 0, value: 0}}, {resolveMsg: null, rejectMsg: '获取阶梯使用情况出错'})
387
+ self.model.f_stair_use = a.data.sumamount
388
+ }
389
+ self.newinfo.pricetype = [self.row.f_price_type]
390
+ let params = {
391
+ f_user_type: self.row.f_user_type,
392
+ f_gasproperties: self.row.f_gasproperties,
393
+ f_price_type: self.row.f_price_type,
394
+ filter: self.$login.f.orgid
395
+ }
396
+ let rs = self.$GetSaleParam.getPrice(params)
397
+ rs.forEach((val) => {
398
+ if (val.label == self.row.f_price_name) {
399
+ self.newinfo.pricename = [val.value]
400
+ }
401
+ })
402
+ self.initData()
403
+ }
404
+ export default {
405
+ title: '换表登记',
406
+ data () {
407
+ return {
408
+ resid: [], // 存放新增的f_files表中id
409
+ model: {
410
+ f_flowmeter_number: '',
411
+ f_flowmeter_pass: '',
412
+ f_flowmeter_brand: '',
413
+ f_flowmeter_model: '',
414
+ f_flowmeter_accuracy: '',
415
+ f_flowmeter_mpa_level: '',
416
+ f_flowmeter_install_date: this.$login.toStandardTimeString(),
417
+ metermessage: {
418
+ f_meter_type: '',
419
+ gasbrand: '',
420
+ gasmodel: '',
421
+ f_meternumber: '',
422
+ f_meter_base: '',
423
+ f_metertitles: '',
424
+ f_oldmeter_use_reference: 0 // 旧表使用量参考值
425
+ },
426
+ // 旧表底数
427
+ f_ladder_sync: '',
428
+ f_using_base_old: '',
429
+ // 换表补气量
430
+ f_remanent_gas: 0,
431
+ // 换表补气单价
432
+ f_remanent_price: 0,
433
+ f_open_type: '',
434
+ f_remanent_money: 0,
435
+ f_type: '换新表',
436
+ f_comments: '',
437
+ f_othereason: '',
438
+ f_stair_use: '',
439
+ f_payment: '现金缴费',
440
+ f_print: '普通收据',
441
+ f_state: '有效',
442
+ f_changemeter_date: this.$login.toStandardTimeString(),
443
+ f_changemeter_fee: this.$appdata.getSingleValue('换表金额') ? this.$appdata.getSingleValue('换表金额') : 0,
444
+ f_difference_reason: '',
445
+ // 金额表剩余金额
446
+ f_using_fee_old: 0,
447
+ randomBusinessId: ''
448
+ },
449
+ meterinfo: false,
450
+ meterbookoptions: [],
451
+ // 控制气量和金额的转换显示
452
+ changeType: '',
453
+ config: {
454
+ hasPrint: false, // 默认打票
455
+ hasBillManage: false, // 默认不启用发票管理
456
+ billType: '其他费用', // 票据类型(燃气费,其他费用,调用的发票代码不同)
457
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
458
+ payment: '现金缴费',
459
+ ladderSync: '同步',
460
+ open_way: '发卡开户',
461
+ hasArrearsChange: false, // 是否可以有欠费换表
462
+ f_change_operator: false, // 换表人是否必填
463
+ castInt: true,
464
+ aroundmeter: false, // 表向
465
+ changeReason: false, // 换表原因
466
+ changePrice: false, // 气价任意变更权限
467
+ dispatch: true, // 是否派工
468
+ showupload: true, //
469
+ hasAudit: false // 是否审核
470
+ },
471
+ print: false,
472
+ // 启用发票管理需要对票号进行验证
473
+ hasValidateBill: false,
474
+ validateOk: false,
475
+ billData: {
476
+ url: 'api/af-revenue/report/change_meter',
477
+ bill: ''
478
+ },
479
+ // 控制气量金额的编辑
480
+ isGas: false,
481
+ replacewatchtype: this.$appdata.getParam('换表类型'),
482
+ reason: this.$appdata.getParam('换表原因') ? this.$appdata.getParam('换表原因') : [],
483
+ paytype: this.$appdata.getParam('付款方式'),
484
+ printstyle: this.$appdata.getParam('打印格式'),
485
+ gasproperties: [],
486
+ addgasnum: 0,
487
+ addgas: false,
488
+ books: {
489
+ data: []
490
+ },
491
+ addbalance: false,
492
+ newinfo: {
493
+ f_user_type: '',
494
+ f_gasproperties: '',
495
+ f_meter_book: '',
496
+ pricetype: '',
497
+ pricename: '',
498
+ f_perform_date: this.$login.toStandardDateString() + ' 00:00:00' // 操作时间
499
+ },
500
+ ladder: [{label: '累计', value: '同步'}, {label: '不累计', value: '不同步'}],
501
+ auditor: [],
502
+ opentype: [{label: '指令开户', value: '指令开户'}, {label: '发卡开户', value: '发卡开户'}],
503
+ usertypes: this.$appdata.getParam('用户类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')] : [],
504
+ pricetypes: this.$appdata.getParam('气价类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('气价类型')] : [],
505
+ addTaskModel: {
506
+ f_task_name: '',
507
+ f_userinfo_code: '',
508
+ f_work_flow_name: '',
509
+ f_approval: '',
510
+ f_memorandum: ''
511
+ },
512
+ addTaskValid: false,
513
+ addTaskModalShow: false,
514
+ commitflag: false,
515
+ // 总欠费金额
516
+ alldue_fee: 0
517
+ }
518
+ },
519
+ props: {
520
+ row: {
521
+ type: Object,
522
+ default: undefined
523
+ },
524
+ applyButtonShow: {
525
+ type: Boolean,
526
+ default: true
527
+ },
528
+ dataModel: {
529
+ type: Object,
530
+ default: undefined
531
+ }
532
+ },
533
+ ready () {
534
+ getPrice(this)
535
+ this.getRandomId()
536
+ this.getAuditor()
537
+ },
538
+ events: {
539
+ // 删除Resid数组元素
540
+ 'delResid' (val) {
541
+ this.resid.$remove({id: val, f_biobid: ''})
542
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
543
+ },
544
+ // 增加Resid数组元素
545
+ 'resid' (val) {
546
+ this.resid.push({id: val, f_biobid: ''})
547
+ }
548
+ },
549
+ computed: {
550
+ aroundmeters () {
551
+ return this.$appdata.getParam('左右表')
552
+ },
553
+ flowmeterbrands () {
554
+ let gasbrand = this.$GetSaleParam.getGasbrand()
555
+ let flowmeterbrands = []
556
+ for (let row of gasbrand) {
557
+ flowmeterbrands.push({label: row.label, value: row.label})
558
+ }
559
+ return flowmeterbrands
560
+ }
561
+ },
562
+ methods: {
563
+ async getAuditor () {
564
+ await this.$GetSaleParam.initinputtor()
565
+ this.auditor = this.$GetSaleParam.getAudit(this.$login.f.orgid)
566
+ },
567
+ getRandomId () {
568
+ this.model.randomBusinessId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
569
+ let res = Math.random() * 16 | 0
570
+ let v = c == 'x' ? res : (res & 0x3 | 0x8)
571
+ return v.toString(16)
572
+ })
573
+ },
574
+ feeOldChange () {
575
+ if (this.model.f_using_fee_old) {
576
+ this.model.f_remanent_money = this.model.f_using_fee_old
577
+ }
578
+ },
579
+ addTaskModalClose () {
580
+ this.addTaskModel.f_work_flow_name = ''
581
+ this.addTaskModel.f_task_name = ''
582
+ this.addTaskModel.f_userinfo_code = ''
583
+ this.addTaskModel.f_approval = ''
584
+ this.addTaskModel.f_memorandum = ''
585
+ },
586
+ validateBill (val) {
587
+ this.validateOk = !val.isOk
588
+ this.billData.bill = val.bill
589
+ },
590
+ close () {
591
+ this.print = false
592
+ this.printok()
593
+ },
594
+ async printok () {
595
+ let msg = await this.$showMessage('已成功换表,是否进入补气或购气界面', ['confirm', 'cancel'])
596
+ if (msg == 'confirm') {
597
+ this.$dispatch('get-new-row', this.row)
598
+ } else {
599
+ this.$dispatch('success')
600
+ }
601
+ },
602
+ flowmetermodels (label) {
603
+ let gasbrand = this.$GetSaleParam.getGasbrand()
604
+ let flowmetermodels = []
605
+ for (let row of gasbrand) {
606
+ if (row.label == label) {
607
+ for (let gasmodel of row.value.gasmodel) {
608
+ flowmetermodels.push({label: gasmodel.label, value: gasmodel.label})
609
+ }
610
+ break
611
+ }
612
+ }
613
+ return flowmetermodels
614
+ },
615
+ getPricenames () {
616
+ console.log('气价。,。。', this.newinfo.pricetype)
617
+ let rs = []
618
+ if (this.row.f_user_type && this.row.f_gasproperties && this.newinfo.pricetype.length === 1) {
619
+ let params = {
620
+ f_user_type: this.row.f_user_type,
621
+ f_gasproperties: this.row.f_gasproperties,
622
+ f_price_type: this.newinfo.pricetype[0],
623
+ filter: this.$login.f.orgid
624
+ }
625
+ if (this.config.changePrice) {
626
+ rs = this.$GetSaleParam.getPriceAllOther(params)
627
+ } else {
628
+ rs = this.$GetSaleParam.getPrice(params)
629
+ }
630
+ }
631
+ if (rs.length === 0) {
632
+ this.newinfo.f_price_name = ''
633
+ }
634
+ return rs
635
+ },
636
+ userTypeChange () {
637
+ this.gasproperties = []
638
+ if (this.newinfo.f_user_type.length === 1) {
639
+ this.gasproperties = this.$appdata.getParam(this.newinfo.f_user_type[0])
640
+ }
641
+ },
642
+ // 返回
643
+ clean () {
644
+ this.$dispatch('success', '换表', this.row)
645
+ },
646
+ addTask () {
647
+ if (this.addTaskModel.f_userinfo_code != this.row.f_userinfo_code) {
648
+ this.$showAlert('请填写正确的用户编号!!!', 'warning', 3000)
649
+ return
650
+ }
651
+ let memorandum = {
652
+ f_memorandum: this.addTaskModel.f_memorandum
653
+ }
654
+ this.model.f_business_name = '换表'
655
+ this.model.f_user_name = this.row.f_user_name
656
+ this.model.fusetype = '换表&清零'
657
+ this.model.filesids = this.resid
658
+ let data = {
659
+ f_created_by: this.$login.f.name,
660
+ f_orgid: this.$login.f.orgid,
661
+ f_orgname: this.$login.f.orgs,
662
+ f_depid: this.$login.f.depids,
663
+ f_depname: this.$login.f.deps,
664
+ addModel: this.addTaskModel,
665
+ f_memorandum: JSON.stringify(memorandum),
666
+ f_userinfo_json: this.model,
667
+ f_userinfo_id: this.row.f_userinfo_id
668
+ }
669
+ this.$resetpost('api/af-revenue/logic/future_createWorkFlowTask', {'data': data}
670
+ , {resolveMsg: null, rejectMsg: '新增任务失败!!'}).then(
671
+ (res) => {
672
+ this.$showAlert(res.data.msg + '请等待审批完成后去流程页面进行操作!!!', 'info', 3000)
673
+ this.addTaskModalClose()
674
+ this.addTaskModalShow = false
675
+ }
676
+ )
677
+ },
678
+ async apply () {
679
+ this.addTaskModel.f_task_name = `用户:${this.row.f_user_name},编号:${this.row.f_userinfo_code} 申请换表`
680
+ this.addTaskModel.f_userinfo_code = this.row.f_userinfo_code
681
+ this.addTaskModalShow = true
682
+ },
683
+ async confirmbefore () {
684
+ if (this.model.metermessage.f_meter_type[0] !== '机表') {
685
+ if (!this.config.hasArrearsChange && this.books.data && this.books.data.length > 0) {
686
+ if (this.books.data[0].f_whether_pay === '否') {
687
+ this.$showAlert('换表失败,该表有欠费,请到机表缴费界面进行缴费', 'warning', 3000)
688
+ this.$dispatch('button-specifies', {name: '机表收费', value: 'machine-charge'}, this.row)
689
+ } else {
690
+ this.confirm()
691
+ }
692
+ } else {
693
+ this.confirm()
694
+ }
695
+ } else {
696
+ this.confirm()
697
+ }
698
+ },
699
+ async confirm () {
700
+ let msg = ''
701
+ if (this.row.f_meter_type.includes('机表') || this.row.f_meter_type.includes('物联网表')) {
702
+ let a = this.config.castInt ? parseInt(this.model.f_using_base_old) : this.model.f_using_base_old
703
+ let b = this.config.castInt ? parseInt(this.row.f_meter_base) : this.row.f_meter_base
704
+ if (a > b) {
705
+ msg = (this.row.f_meter_type === '机表' ? '该用户表底数大于上次抄表底数,请确定是否继续生成欠费记录' : '该用户表底数大于上次抄表底数,请确定是否进行结算')
706
+ } else if (this.row.f_capacity && this.row.f_capacity > 0 && (parseInt(this.model.f_using_base_old) < parseInt(this.row.f_meter_base))) {
707
+ msg = '该用户表底数大于上次抄表底数,且已超越最大量程,请确定是否继续生成欠费记录'
708
+ }
709
+ }
710
+ if ((this.row.f_meter_type.includes('机表') || this.row.f_meter_type.includes('物联网表')) && msg) {
711
+ this.$showMessage(msg, ['confirm', 'cancel']).then((res) => {
712
+ if (res === 'confirm') {
713
+ debugger
714
+ let url = this.row.f_meter_type.includes('物联网表') ? 'api/af-revenue/logic/changeMeterWebHand' : 'api/af-revenue/logic/changeMeterHand'
715
+ let data = {
716
+ downDate: this.$login.toStandardTimeString(),
717
+ startDate: this.$login.toStandardDateString(),
718
+ endDate: this.$login.toStandardDateString(),
719
+ condition: `f_userfiles_id = '${this.row.f_userfiles_id}'`,
720
+ f_operator: this.$login.f.name,
721
+ f_operatorid: this.$login.f.id,
722
+ f_meternumber: this.row.f_meternumber,
723
+ f_userinfo_id: this.row.f_userinfo_id,
724
+ f_userfiles_id: this.row.f_userfiles_id,
725
+ f_serial_number: this.model.f_serial_number,
726
+ f_meterbase: this.model.f_using_base_old,
727
+ f_meter_brand: this.row.f_meter_brand,
728
+ f_meter_classify: this.row.f_meter_type,
729
+ f_price_id: this.row.f_price_id
730
+ }
731
+ this.$resetpost(url, {data: data}, {resolveMsg: '生成欠费成功', rejectMsg: '生成欠费失败'}).then((res) => {
732
+ console.log('成功')
733
+
734
+ if (this.model.metermessage.f_meter_type[0] != '机表') {
735
+ console.log('换表失败,该表已产生欠费,清欠后重新进行换表操作1!')
736
+ this.$showAlert('换表失败,该表已产生欠费,请清欠后,重新进行换表操作!', 'warning', 5000)
737
+ console.log('换表失败,该表已产生欠费,清欠后重新进行换表操作2!')
738
+ this.$dispatch('refresh')
739
+ } else {
740
+ this.saveobj()
741
+ }
742
+ })
743
+ } else {
744
+
745
+ }
746
+ })
747
+ } else {
748
+ if (this.row.f_meter_type.includes('气量卡表') && (this.model.f_using_base_old > (this.row.f_total_gas + this.row.f_initial_base + this.row.f_remanent_gas))) {
749
+ await this.$showMessage(`该表可能存在超用,请确定是否继续进行换表操作!!!,或者取消进入超用收费!`, ['confirm', 'cancel']).then((res) => {
750
+ if (res === 'confirm') {
751
+ this.saveobj()
752
+ } else {
753
+ }
754
+ })
755
+ } else {
756
+ this.saveobj()
757
+ }
758
+ }
759
+ },
760
+ async saveobj () {
761
+ try {
762
+ this.model.f_operator = this.$login.f.name
763
+ this.model.f_operatorid = this.$login.f.id
764
+ this.model.f_orgid = this.$login.f.orgid
765
+ this.model.f_orgname = this.$login.f.orgs
766
+ this.model.f_depid = this.$login.f.depids
767
+ this.model.f_depname = this.$login.f.deps
768
+ this.model.f_zoneid = this.$login.f.zoneid
769
+ this.model.f_zones = this.$login.f.zones
770
+ this.model.alldue_fee = this.alldue_fee
771
+ let data = {
772
+ model: this.model,
773
+ f_meter_book: this.newinfo.f_meter_book[0],
774
+ old: this.row
775
+ }
776
+ // 如果更新了气价
777
+ if (this.newinfo.pricename.length > 0) {
778
+ data.newinfo = this.newinfo.pricename[0].f_price_id
779
+ }
780
+ let meterinfo = await this.$resetpost('api/af-revenue/logic/changeMeter', data, {
781
+ resolveMsg: null,
782
+ rejectMsg: '换表失败!!!'
783
+ })
784
+
785
+ if (this.config.showupload) {
786
+ let param = []
787
+ for (let row of this.resid) {
788
+ param.push({id: row.id})
789
+ }
790
+ let data1 = {
791
+ param: param,
792
+ f_blobid: meterinfo.data.id
793
+ }
794
+ console.log('-------------------------->', data1)
795
+ await this.$resetpost('api/af-revenue/logic/updatefiles', data1)
796
+ }
797
+ // 赋值【新表id】
798
+ this.row.f_userfiles_id = meterinfo.data.new_userfiles_id
799
+
800
+ if (this.newinfo.pricename.length > 0) {
801
+ let param = {
802
+ f_userinfo_id: this.row.f_userinfo_id,
803
+ f_userfiles_id: this.row.f_userfiles_id,
804
+ f_user_id: this.row.f_user_id,
805
+ f_user_name: this.row.f_user_name,
806
+ f_user_type: this.newinfo.f_user_type[0],
807
+ f_gasproperties: this.newinfo.f_gasproperties[0],
808
+ f_price_type: this.newinfo.pricetype[0],
809
+ f_price_id: this.newinfo.pricename[0].f_price_id,
810
+ f_filialeid: this.$login.f.orgid,
811
+ f_operator: this.$login.f.name,
812
+ f_operatorid: this.$login.f.id,
813
+ f_orgid: this.$login.f.orgid,
814
+ f_orgname: this.$login.f.orgs,
815
+ f_depid: this.$login.f.depids,
816
+ f_depname: this.$login.f.deps,
817
+ f_perform_date: this.newinfo.f_perform_date,
818
+ f_change_reason: '换表调价'
819
+ }
820
+
821
+ await this.$resetpost('api/af-revenue/logic/user_pricechange', {data: param}, {resolveMsg: '更新气价成功', rejectMsg: '更新气价失败'})
822
+ }
823
+ // 开始打票
824
+ if (this.config.hasPrint) {
825
+ if (this.model.f_print.indexOf('电子发票') == -1) {
826
+ if (this.config.hasBillManage) {
827
+ // 启用发票管理,获取票据管理中的票号并存储记录
828
+ this.row.id = meterinfo.data.id
829
+ this.row.f_bill_type = '换表'
830
+ this.row.f_bill_style = this.model.f_print[0]
831
+ this.print = true
832
+ } else {
833
+ this.row.id = meterinfo.data.id
834
+ this.print = true
835
+ }
836
+ } else {
837
+ this.printok()
838
+ }
839
+ }
840
+
841
+ if (this.config.dispatch) {
842
+ await this.$showMessage(`是否添加派工单`, ['confirm', 'cancel']).then((res) => {
843
+ if (res === 'confirm') {
844
+ let batch = {
845
+ sf_id: meterinfo.data.id,
846
+ f_userinfo_code: this.row.f_userinfo_code,
847
+ f_dispathch_name: this.row.f_user_name,
848
+ f_phone: this.row.f_user_phone,
849
+ f_dispathch_address: this.row.f_address,
850
+ f_dispathch_type: '安装',
851
+ f_source: '换表',
852
+ f_remarks: this.model.f_comments,
853
+ f_operator_date: this.$login.toStandardTimeString(),
854
+ f_orgid: this.$login.f.orgid,
855
+ f_dispathch_state: '待分配'
856
+ }
857
+ console.log('111:', batch)
858
+ this.$resetpost('api/af-revenue/logic/savePatch', batch).then((res1) => {
859
+ // this.params.rows.splice(index, 1)
860
+ console.log('更新成功!--------------------->', res1.data.id)
861
+ })
862
+ }
863
+ })
864
+ }
865
+ if (this.config.approve) {
866
+ await this.$dispatch('futureapply', meterinfo)
867
+ } else {
868
+ this.printok()
869
+ }
870
+ } catch (error) {
871
+ console.log('抛出的错误。。', error)
872
+ let res = error.data.toString()
873
+ this.$showAlert(res, 'danger', 2000)
874
+ this.$dispatch('refresh')
875
+ }
876
+ },
877
+ async pregasChange () {
878
+ if (parseInt(this.model.f_using_base_old) < parseInt(this.row.f_meter_base)) {
879
+ await this.$showMessage(`录入旧表底数小于系统旧表底数请再次核对!`, ['confirm', 'cancel']).then((res) => {
880
+ if (res === 'confirm') {
881
+ } else {
882
+ this.model.f_using_base_old = ''
883
+ }
884
+ })
885
+ }
886
+ this.commitflag = false
887
+ // 每种表对应的计算方式都不一样
888
+ if (this.row.f_meter_type == '气量卡表') {
889
+ this.calGasCardRemanent()
890
+ } else if (this.row.f_meter_type == '金额卡表') {
891
+ // this.$showAlert('金额卡表换表尚在开发中,敬请期待!!', 'warning', 5000)
892
+ // this.$dispatch('refresh')
893
+ this.calMoneyCardRemanent()
894
+ } else if (this.row.f_meter_type == '物联网表') {
895
+ this.Iotjisuan()
896
+ }
897
+ let msg = ''
898
+ if (this.row.f_meter_type.includes('机表') || this.row.f_meter_type.includes('物联网表')) {
899
+ let a = this.config.castInt ? parseInt(this.model.f_using_base_old) : this.model.f_using_base_old
900
+ let b = this.config.castInt ? parseInt(this.row.f_meter_base) : this.row.f_meter_base
901
+ if (a > b) {
902
+ msg = (this.row.f_meter_type === '机表' ? '该用户表底数大于上次抄表底数,请确定是否继续生成欠费记录' : '该用户表底数大于上次抄表底数,请确定是否进行结算')
903
+ } else if (this.row.f_capacity && this.row.f_capacity > 0 && (parseInt(this.model.f_using_base_old) < parseInt(this.row.f_meter_base))) {
904
+ msg = '该用户表底数大于上次抄表底数,且已超越最大量程,请确定是否继续生成欠费记录'
905
+ }
906
+ }
907
+ if ((this.row.f_meter_type.includes('机表') || this.row.f_meter_type.includes('物联网表')) && msg) {
908
+ this.$showMessage(msg, ['confirm', 'cancel']).then((res) => {
909
+ if (res === 'confirm') {
910
+ let url = this.row.f_meter_type.includes('物联网表') ? 'api/af-revenue/logic/changeMeterWebHand' : 'api/af-revenue/logic/changeMeterHand'
911
+ let data = {
912
+ downDate: this.$login.toStandardTimeString(),
913
+ startDate: this.$login.toStandardDateString(),
914
+ endDate: this.$login.toStandardDateString(),
915
+ condition: `f_userfiles_id = '${this.row.f_userfiles_id}'`,
916
+ f_operator: this.$login.f.name,
917
+ f_operatorid: this.$login.f.id,
918
+ f_meternumber: this.row.f_meternumber,
919
+ f_userinfo_id: this.row.f_userinfo_id,
920
+ f_userfiles_id: this.row.f_userfiles_id,
921
+ f_serial_number: this.model.f_serial_number,
922
+ f_meterbase: this.model.f_using_base_old,
923
+ f_meter_brand: this.row.f_meter_brand,
924
+ f_meter_classify: this.row.f_meter_type,
925
+ f_price_id: this.row.f_price_id
926
+ }
927
+ this.$resetpost(url, {data: data}, {resolveMsg: '生成欠费成功', rejectMsg: '生成欠费失败'}).then((res) => {
928
+ console.log('成功')
929
+ if (this.row.f_meter_type.includes('物联网表')) {
930
+ console.log('换表失败,该表已产生欠费,清欠后重新进行换表操作1!')
931
+ this.$showAlert('换表失败,该表已产生欠费,请清欠后,重新进行换表操作!', 'warning', 5000)
932
+ console.log('换表失败,该表已产生欠费,清欠后重新进行换表操作2!')
933
+ this.$dispatch('refresh')
934
+ } else {
935
+ this.$dispatch('resflushrowdata')
936
+ // this.$dispatch('button-specifies', {name: '机表收费', value: 'machine-charge'}, this.row)
937
+ }
938
+ })
939
+ }
940
+ })
941
+ }
942
+ },
943
+ async Iotjisuan () {
944
+ let gas = (this.model.f_using_base_old - 0) - (this.row.f_meter_base - 0)
945
+ let getAmount = await this.$CommonService.gasCalculate(this.row, gas)
946
+ let money = getAmount.data.chargenum
947
+ },
948
+ typeChange () {
949
+ if (this.model.f_type && this.model.f_type.includes('清零')) {
950
+ let oldMeter = {
951
+ f_meter_type: this.row.f_meter_type,
952
+ f_collection_type: this.row.f_collection_type
953
+ }
954
+ let newMeter = {
955
+ f_meter_type: this.row.f_meter_type,
956
+ f_collection_type: this.row.f_collection_type
957
+ }
958
+ let res = this.$ChangeMeter.changeMeter(oldMeter, newMeter, this.row)
959
+ console.log('看看新旧表的转换结果', res)
960
+ this.changeType = res.name
961
+ } else {
962
+ this.changeType = ''
963
+ }
964
+ },
965
+
966
+ initData () {
967
+ this.commitflag = false
968
+ if (this.row.f_meter_type == '物联网表') {
969
+ // 判断是否需要结算
970
+ if (this.row.f_collection_type == '按气量') {
971
+ this.calGasIOTRemanent()
972
+ } else {
973
+ this.calMoneyIOTRemanent()
974
+ }
975
+ } else if (this.row.f_meter_type == '机表') {
976
+ this.validateOwe()
977
+ } else {
978
+ this.pregasChange()
979
+ }
980
+ },
981
+
982
+ calGasCardRemanent () {
983
+ // 拿到旧表底数 和【累计购气量+初始底数】比较 这里剩余气量如果是清零补气的就不加,如果是换表补气的就加
984
+ let param = this.row.f_total_gas + this.row.f_initial_base
985
+
986
+ if (this.row.f_remanent_type == 1) {
987
+ param += this.row.f_remanent_gas
988
+ }
989
+
990
+ if (this.model.f_using_base_old > param) {
991
+ this.$showAlert('该表可能存在超用,请核实输入后进行换表操作!!', 'warning', 5000)
992
+ this.$dispatch('refresh')
993
+ }
994
+ if (this.model.f_remanent_price > 0) {
995
+ this.model.f_remanent_gas = (param - (this.model.f_using_base_old - 0)).toFixed(4)
996
+ }
997
+ },
998
+
999
+ calMoneyCardRemanent () {
1000
+ if (!this.model.f_remanent_money) {
1001
+ this.model.f_remanent_money = ''
1002
+ }
1003
+ },
1004
+
1005
+ calGasIOTRemanent () {
1006
+ this.model.f_remanent_gas = (this.row.f_balance_gas - 0)
1007
+ if (this.row.f_remanent_type == 1) {
1008
+ this.model.f_remanent_gas += (this.row.f_remanent_gas - 0)
1009
+ }
1010
+ },
1011
+ calMoneyIOTRemanent () {
1012
+ this.model.f_remanent_money = (this.row.f_balance_amount - 0).toFixed(4)
1013
+ if (this.row.f_remanent_type == 1) {
1014
+ if (this.row.f_remanent_gas > 0) {
1015
+ this.model.f_remanent_money = (this.model.f_remanent_money - 0) + ((this.row.f_remanent_gas - 0) * (this.row.f_remanent_price - 0)).toFixed(4)
1016
+ } else if (this.row.f_remanent_money > 0) {
1017
+ this.model.f_remanent_money = (this.model.f_remanent_money - 0) + (this.row.f_remanent_money - 0)
1018
+ }
1019
+ }
1020
+ },
1021
+
1022
+ gasModelChange (val) {
1023
+ console.log('新表信息', val)
1024
+ if (val.length > 0) {
1025
+ this.commitflag = false
1026
+ // 新气表信息已选
1027
+ let oldMeter = {
1028
+ f_meter_type: this.row.f_meter_type,
1029
+ f_collection_type: this.row.f_collection_type
1030
+ }
1031
+ let newMeter = {
1032
+ f_meter_type: val[0].f_meter_type,
1033
+ f_collection_type: val[0].f_collection_type
1034
+ }
1035
+ let res = this.$ChangeMeter.changeMeter(oldMeter, newMeter, this.row)
1036
+ console.log('看看新旧表的转换结果', res)
1037
+ this.changeType = res.name
1038
+ /* if (this.addbalance) {
1039
+ this.addbalance = false
1040
+ this.model.f_remanent_money = (this.model.f_remanent_money - 0) - (this.row.f_balance - 0)
1041
+ }
1042
+ if (this.addgas) {
1043
+ this.addgas = false
1044
+ this.model.f_remanent_gas = (this.model.f_remanent_gas - 0) - (this.addgasnum - 0)
1045
+ this.addgasnum = 0
1046
+ }
1047
+ if (newMeter.f_meter_type == '物联网表' && newMeter.f_collection_type == '按金额' && (!this.addbalance)) {
1048
+ this.addbalance = true
1049
+ this.model.f_remanent_money = this.model.f_remanent_money ? (this.model.f_remanent_money - 0) + (this.row.f_balance - 0) : (this.row.f_balance - 0)
1050
+ if (!this.isGas) {
1051
+ this.addgas = true
1052
+ }
1053
+ }
1054
+ if (newMeter.f_meter_type == '物联网表' && newMeter.f_collection_type == '按气量' && (!this.addgas)) {
1055
+ this.addgas = true
1056
+ debugger
1057
+ this.addgasnum = ((this.row.f_balance - 0) / this.model.f_remanent_price).toFixed(4)
1058
+ this.model.f_remanent_gas = this.model.f_remanent_gas ? (this.model.f_remanent_gas - 0) + (this.addgasnum - 0) : this.addgasnum
1059
+ if (!this.isGas) {
1060
+ this.addbalance = true
1061
+ this.model.f_remanent_money = this.model.f_remanent_money ? (this.model.f_remanent_money - 0) + (this.row.f_balance - 0) : (this.row.f_balance - 0)
1062
+ }
1063
+ } */
1064
+ }
1065
+ },
1066
+
1067
+ remanentChange () {
1068
+ this.commitflag = true
1069
+ // 气量转金额 或者 金额转气量的时候对气量和金额不做限制, 可以修改, 但是只变单价
1070
+ this.model.f_remanent_price = ((this.model.f_remanent_money) / (this.model.f_remanent_gas)).toFixed(4)
1071
+ if (this.model.f_remanent_price == 'NaN') {
1072
+ this.model.f_remanent_price = 0
1073
+ }
1074
+ },
1075
+
1076
+ async validateOwe () {
1077
+ let http = new HttpResetClass()
1078
+ // 有欠费是否能换表 如果能则需要获取到欠费金额
1079
+ if (this.config.hasArrearsChange) {
1080
+ let res = await http.load('POST', 'api/af-revenue/logic/sale_getOwe', {data: {f_userinfo_id: this.row.f_userinfo_id}}, {resolveMsg: null, rejectMsg: '获取欠费出错!!'})
1081
+ let owes = []
1082
+ for (let i = 0; i < res.data.length; i++) {
1083
+ for (let j = 0; j < res.data[i].rows.length; j++) {
1084
+ owes.push(res.data[i].rows[j])
1085
+ }
1086
+ }
1087
+ console.log('获取到的欠费记录', owes)
1088
+ this.alldue_fee = owes.reduce((total, item) => {
1089
+ return total + (item.f_oughtfee + item.overdue - item.f_debt_money)
1090
+ }, 0)
1091
+ console.log('总欠费金额为', this.alldue_fee)
1092
+ this.books = owes
1093
+ } else {
1094
+ // 如果 不能 则只需要获取到记录数,采用相对节省资源的查询
1095
+ let books = await http.load('POST', 'api/af-revenue/sql/singleTable_OrderBy', {
1096
+ data: {
1097
+ items: 'f_whether_pay',
1098
+ tablename: 't_handplan',
1099
+ condition: ` f_user_id = '${this.row.f_user_id}' and f_oughtfee > 0 and f_hand_state = '有效' and f_meter_state='已抄表' `,
1100
+ orderitem: ' id desc'
1101
+ }
1102
+ }, {resolveMsg: null, rejectMsg: null}
1103
+ )
1104
+ console.log('获取到的欠费记录', books)
1105
+ this.books = books
1106
+ // 如果是机表验证是否有欠费
1107
+ if ((this.row.f_balance - 0) < 0) {
1108
+ this.$showAlert('该表有欠费,请到机表缴费界面进行缴费', 'warning', 3000)
1109
+ this.$dispatch('button-specifies', {name: '机表收费', value: 'machine-charge'}, this.row)
1110
+ }
1111
+ }
1112
+ }
1113
+ },
1114
+
1115
+ watch: {
1116
+ 'row' () {
1117
+ console.log('-------------------------------')
1118
+ console.log(this.row)
1119
+ },
1120
+ 'model.f_remanent_money' (val) {
1121
+ console.log('观察补气金额', val)
1122
+ if (!this.isGas) {
1123
+ this.model.f_remanent_gas = (val / this.model.f_remanent_price).toFixed(4)
1124
+ }
1125
+ if (this.model.f_using_base_old) {
1126
+ this.commitflag = true
1127
+ }
1128
+ },
1129
+ 'model.f_remanent_gas' (val) {
1130
+ if (this.isGas) {
1131
+ this.model.f_remanent_money = (val * this.model.f_remanent_price).toFixed(4)
1132
+ }
1133
+ if (this.model.f_using_base_old) {
1134
+ this.commitflag = true
1135
+ }
1136
+ },
1137
+ 'dataModel' (val) {
1138
+ console.log('看看dataModel的值:', val)
1139
+ if (val) {
1140
+ this.$nextTick(() => {
1141
+ this.model = Object.assign({}, this.model, val)
1142
+ this.resid = this.model.filesids
1143
+ })
1144
+ }
1145
+ console.log('看看this.model的值:', this.model)
1146
+ },
1147
+ 'newinfoData' (val) {
1148
+ console.log('看看newinfoData的值:', val)
1149
+ if (val) {
1150
+ this.$nextTick(() => {
1151
+ this.newinfo = Object.assign({}, this.newinfo, val)
1152
+ })
1153
+ }
1154
+ console.log('看看this.newinfo的值:', this.newinfo)
1155
+ }
1156
+ }
1157
+ }
1158
+ </script>
1159
+ <style lang="less">
1160
+ #ChangeMeter {
1161
+ .col-sm-4 {
1162
+ .font_normal_body {
1163
+ width: 73px;
1164
+ overflow: auto;
1165
+ white-space: nowrap;
1166
+ // 指滚动条两边的按钮
1167
+ &::-webkit-scrollbar-button {
1168
+ display: none;
1169
+ }
1170
+ // 滚动条的宽度
1171
+ &::-webkit-scrollbar {
1172
+ width: 5px !important;
1173
+ height: 5px !important;
1174
+ }
1175
+ // 滚动条的设置
1176
+ &::-webkit-scrollbar-thumb {
1177
+ background-color: #ddd;
1178
+ background-clip: padding-box;
1179
+ }
1180
+ &::-webkit-scrollbar-thumb:hover {
1181
+ background-color: #bbb;
1182
+ }
1183
+ &::-webkit-scrollbar-track {
1184
+ /*滚动条里面轨道*/
1185
+ box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
1186
+ background: #ededed;
1187
+ }
1188
+ }
1189
+ }
1190
+ }
1191
+ </style>