sale-client 4.2.121 → 4.2.122

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