sale-client 4.2.124 → 4.2.126

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