sale-client 4.2.37 → 4.2.39

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,2099 +1,2099 @@
1
- <template>
2
- <div class="flex-row" id="machineHandManager">
3
- <div class="basic-main">
4
- <criteria-paged :model="model" v-ref:paged @sort="sort">
5
- <criteria partial='criteria' v-ref:criteria @condition-changed="$parent.selfSearch">
6
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
- <modal :show.sync="$parent.$parent.upshow" width="500px" title="文件导入" v-ref:modal large backdrop="false">
8
- <article slot="modal-body" class="modal-body">
9
- <file-upload class="my-file-uploader " name="UploadFile" class="btn btn-success"
10
- style="border-radius: 2px;"
11
- action="api/af-revenue/file/uploadFile" tagname="导入" v-ref:filebattch :headers="headers"
12
- multiple></file-upload>
13
- </article>
14
- <footer slot="modal-footer" class="modal-footer">
15
- </footer>
16
- </modal>
17
- <div class="row">
18
- <!--<div class="col-sm-6">-->
19
- <!--style="border: 1px solid #a6d5ea; box-shadow: darkgrey 1px 1px 1px 2px;padding: 0.5%">-->
20
- <div class="col-sm-2 form-group">
21
- <label class="font_normal_body color-red">归属起始</label>
22
- <datepicker placeholder="开始日期"
23
- style="width:60%"
24
- class="datepicker"
25
- v-model="model.startDate"
26
- condition="f_hand_date >='{} 00:00:00'"
27
-
28
- :value.sync="model.startDate"
29
- :format="'yyyy-MM-dd'"
30
- ></datepicker>
31
- </div>
32
- <div class="col-sm-2 form-group">
33
- <label class="font_normal_body color-red">归属结束</label>
34
- <datepicker placeholder="结束日期"
35
- style="width:60%"
36
- v-model="model.endDate"
37
- :value.sync="model.endDate"
38
- condition="f_hand_date <='{} 23:59:59'"
39
- :format="'yyyy-MM-dd'"
40
- ></datepicker>
41
- </div>
42
-
43
- <div class="col-sm-2 form-group">
44
- <label class="font_normal_body">客户编号</label>
45
- <input type="text" style="width:60%" class="input_search" v-model="model.f_userinfo_code"
46
- condition="f_userinfo_code='{}'" placeholder='客户编号'>
47
- </div>
48
-
49
- <div class="span" style="float:right;">
50
- <button
51
- class="button_search button_spacing" style="width:90px" @click="$parent.$parent.danhuShow()">
52
- 单户抄表
53
- </button>
54
-
55
- <button class="button_search button_spacing" @click="$parent.$parent.search()">查询</button>
56
- <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
57
- <button class="button_delete button_spacing" @click="$parent.$parent.deletehand()">删除抄表</button>
58
- <button class="button_search button_spacing" style="width: 90px" @click="$parent.$parent.downloadFiles()">模板下载
59
- </button>
60
- <button class="button_search button_spacing" @click="$parent.$parent.clickupshow()">导入抄表</button>
61
-
62
- <export-excel
63
- :data="$parent.$parent.getCondition"
64
- :field="$parent.$parent.getfield"
65
- sqlurl="api/af-revenue/logic/saleExport" sql-name="getPlan" template-name='抄表导出'
66
- :choose-col="true">
67
- </export-excel>
68
- <div
69
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
70
- @click="$parent.$parent.hidden()" class="button_spacing" style="float: right"></div>
71
- </div>
72
- </div>
73
- <div class="row" v-show="$parent.$parent.criteriaShow">
74
- <!-- <div class="col-sm-2 form-group">-->
75
- <!-- <label class="font_normal_body">表&ensp;编&ensp;号</label>-->
76
- <!-- <input type="text" style="width:60%" class="input_search" v-model="model.f_user_id"-->
77
- <!-- condition="f_user_id='{}'" placeholder='表编号'>-->
78
- <!-- </div>-->
79
- <div class="col-sm-2 form-group">
80
- <label class="font_normal_body">抄表状态</label>
81
- <v-select :value.sync="model.f_audit_state"
82
- class="select_list select"
83
- v-model="model.f_audit_state"
84
- style="width: 60%"
85
- condition="f_meter_state = '{}'"
86
- :options='$parent.$parent.auditState' placeholder='抄表状态'
87
- close-on-select v-el:cc>
88
- </v-select>
89
- </div>
90
- <div class="col-sm-2 form-group">
91
- <label class="font_normal_body">表&emsp;&emsp;号</label>
92
- <input type="text" style="width:60%" class="input_search" v-model="model.f_meternumber"
93
- condition="f_meternumber like '%{}%'" placeholder='表号'>
94
- </div>
95
- <div class="col-sm-2 form-group">
96
- <label class="font_normal_body">客户姓名</label>
97
- <input type="text" style="width:60%" class="input_search" v-model="model.f_user_name" placeholder='客户姓名'
98
- condition="f_user_name = '{}'">
99
- </div>
100
- <div class="col-sm-2 form-group">
101
- <label class="font_normal_body">小&ensp;&ensp;&ensp;&ensp;区</label>
102
- <v-select :value.sync="model.f_residential_area"
103
- class="select_list select"
104
- enter-push
105
- v-model="model.f_residential_area"
106
- style="width: 60%"
107
- multiple="true"
108
- :options='$parent.$parent.residentialArea' placeholder='选择小区'
109
- close-on-select v-el:cc>
110
- </v-select>
111
- </div>
112
- <div class="col-sm-2 form-group">
113
- <label class="font_normal_body">楼&emsp;&emsp;栋</label>
114
- <input type="text" style="width:60%" class="input_search" v-model="model.f_building"
115
- condition="f_building = '{}'" placeholder='楼栋'>
116
- </div>
117
- <div class="col-sm-2 form-group">
118
- <label class="font_normal_body">单&emsp;&emsp;元</label>
119
- <input type="text" style="width:60%" class="input_search" v-model="model.f_unit"
120
- condition="f_unit = '{}'" placeholder='单元'>
121
- </div>
122
- <div class="col-sm-2 form-group">
123
- <label class="font_normal_body">楼&emsp;&emsp;层</label>
124
- <input type="text" style="width:60%" class="input_search" v-model="model.f_floor"
125
- condition="f_floor = '{}'" placeholder='楼层'>
126
- </div>
127
- <div class="col-sm-2 form-group">
128
- <label class="font_normal_body">门&ensp;牌&ensp;号</label>
129
- <input type="text" style="width:60%" class="input_search" v-model="model.f_room"
130
- condition="f_room like '%{}%'" placeholder='门牌号'>
131
- </div>
132
- <div class="col-sm-2 form-group">
133
- <label class="font_normal_body">客户地址</label>
134
- <input type="text" style="width:60%" class="input_search" v-model="model.f_address"
135
- condition="f_address like '%{}%'" placeholder='客户地址'>
136
- </div>
137
- <div class="col-sm-2 form-group">
138
- <label class="font_normal_body">抄&ensp;表&ensp;员</label>
139
- <v-select :value.sync="model.f_inputtor" v-model='model.f_inputtor'
140
- style="width:60%"
141
- multiple="true"
142
- :options='$parent.$parent.inputtores' placeholder='抄表员'
143
- close-on-select
144
- v-el:cc></v-select>
145
- </div>
146
- <!-- <div class="col-sm-2 form-group">-->
147
- <!-- <label class="font_normal_body">是否缴费</label>-->
148
- <!-- <v-select :value.sync="model.f_whether_pay" v-model='model.f_whether_pay'-->
149
- <!-- style="width:60%"-->
150
- <!-- :options='$parent.$parent.whetherpaies' placeholder='是否缴费'-->
151
- <!-- close-on-select-->
152
- <!-- condition="f_whether_pay = '{}'"></v-select>-->
153
- <!-- </div>-->
154
- <div class="col-sm-2 form-group">
155
- <label class="font_normal_body">抄表单状态</label>
156
- <v-select :value.sync="model.f_meter_state" v-model='model.f_meter_state'
157
- style="width:60%"
158
- :options='$parent.$parent.meterstates' placeholder='抄表单状态'
159
- close-on-select
160
- condition="f_meter_state = '{}'"></v-select>
161
- </div>
162
-
163
- <div class="col-sm-2 form-group">
164
- <label for="belongmonth" class="font_normal_body">所属年月</label>
165
- <datepicker placeholder="所属年月" style="width:60%"
166
- v-model="model.belongmonth"
167
- :value.sync="model.belongmonth"
168
- :format="'yyyy-MM'"
169
- :show-reset-button="true"
170
- condition="belongmonth = '{}'"
171
- :select-month="true">
172
- </datepicker>
173
- </div>
174
- <div class="col-sm-2 form-group">
175
- <label class="font_normal_body">客户类型</label>
176
- <v-select :value.sync="model.f_user_type" v-model="model.f_user_type"
177
- :options='$parent.$parent.usertypes' placeholder='客户类型'
178
- style="width:60%"
179
- close-on-select
180
- condition="f_user_type = '{}'"></v-select>
181
- </div>
182
- <div class="col-sm-2 form-group">
183
- <label class="font_normal_body">用户等级</label>
184
- <v-select :value.sync="model.f_user_level" v-model="model.f_user_level"
185
- :options='$parent.$parent.userlevels' placeholder='用户等级'
186
- style="width:60%"
187
- close-on-select
188
- condition="f_user_level = '{}'"></v-select>
189
- </div>
190
- <div class="col-sm-2 form-group">
191
- <label class="font_normal_body color-red">抄&ensp;表&ensp;册</label>
192
- <v-select :value.sync="model.f_meter_book" v-model="model.f_meter_book"
193
- :options='$parent.$parent.meterbooks' placeholder='抄表册'
194
- :multiple="true"
195
- style="width:60%"
196
- condition="f_meter_book_num in {}"></v-select>
197
- </div>
198
- <div class="col-sm-2 form-group">
199
- <label class="font_normal_body">抄表册编号</label>
200
- <v-select :value.sync="model.f_book_code" v-model="model.f_book_code"
201
- :options='$parent.$parent.bookcodes' placeholder='抄表册编号'
202
- style="width:60%"
203
- :multiple="true"
204
- condition="f_book_code in {}"></v-select>
205
- </div>
206
- <div class="col-sm-2 form-group">
207
- <label class="font_normal_body">调压箱名</label>
208
- <v-select :value.sync="model.f_adjustable_name" v-model="model.f_adjustable_name"
209
- :options='$parent.$parent.adjustablename' placeholder='调压箱名称'
210
- style="width:60%"
211
- close-on-select
212
- condition="f_adjustable_name = '{}'"></v-select>
213
- </div>
214
- <div class="col-sm-2 flex-row" style="white-space: nowrap" >
215
- <label class="font_normal_body">应交气量</label>
216
- <div class="row">
217
- <input type="text" style="width:30%" class="input_search" v-model="model.oughtamountmin"
218
- condition="f_oughtamount >= {} " placeholder="">
219
- <label class="font_normal_body"> ≤ x ≤ </label>
220
- <input type="text" style="width:30%" class="input_search" v-model="model.oughtamountmax"
221
- condition="f_oughtamount <= {} " placeholder="">
222
- </div>
223
- </div>
224
- <res-select-group :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes"
225
- v-ref:sel></res-select-group>
226
- </div>
227
-
228
-
229
- <!-- 多选框 -->
230
- <!--<div class="col-sm-2 form-group">-->
231
- <!--<button class="btn btn-success" @click="$parent.$parent.batchDownHand()">计划下发</button>-->
232
- <!--</div>-->
233
-
234
- <!--<div class="form-group" v-if="$parent.$parent.meter_state">-->
235
- <!--<button class="btn btn-success" @click="$parent.$parent.allDownHand()" >全部下发</button>-->
236
- <!--</div>-->
237
- <!-- 多选框结束 -->
238
-
239
- <!--<div class="col-sm-2 form-group">-->
240
- <!--<button class="btn btn-success" @click="$parent.$parent.adjust()">抄表员调整</button>-->
241
- <!--</div>-->
242
- <!--<div class="col-sm-2 form-group">-->
243
- <!--<button class="btn btn-success" @click="$parent.$parent.fileUpload()">文件上传</button>-->
244
- <!--</div>-->
245
- <!--<div class="col-sm-2 form-group">-->
246
- <!--<button class="btn btn-success" @click="search(), $parent.$parent.clean()">打印</button>-->
247
- <!--</div>-->
248
-
249
- </div>
250
- </criteria>
251
- <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid id="hand_manager_grid">
252
- <template partial='head'>
253
- <tr>
254
- <!--<th><input type='checkbox' v-model="$parent.$parent.$parent.all" @change="$parent.$parent.$parent.chooseAll"></th>-->
255
- <th>
256
- <nobr>序号</nobr>
257
- </th>
258
- <th>
259
- <nobr>
260
- <data-order field="f_userinfo_code" name="客户编号"
261
- :order.sync="$parent.$parent.$parent.orderFields.f_userinfo_code"></data-order>
262
- </nobr>
263
- </th>
264
- <!-- <th>-->
265
- <!-- <nobr>表编号</nobr>-->
266
- <!-- </th>-->
267
- <!-- <th>基本信息</th>-->
268
- <th>
269
- <nobr>
270
- <data-order field="f_address" name="基本信息"
271
- :order.sync="$parent.$parent.$parent.orderFields.f_address"></data-order>
272
- </nobr>
273
- </th>
274
- <th>
275
- <nobr>用户等级</nobr>
276
- </th>
277
- <!--<th><nobr><data-order field="f_building" name="楼号"-->
278
- <!--:order.sync="$parent.$parent.$parent.orderFields.f_building"></data-order></nobr>-->
279
- <!--</th>-->
280
- <!--<th><nobr><data-order field="f_unit" name="单元号"-->
281
- <!--:order.sync="$parent.$parent.$parent.orderFields.f_unit"></data-order></nobr>-->
282
- <!--</th>-->
283
- <!--<th><nobr><data-order field="f_room" name="房号"-->
284
- <!--:order.sync="$parent.$parent.$parent.orderFields.f_room"></data-order></nobr>-->
285
- <!--</th>-->
286
- <th>
287
- <nobr>所属年月</nobr>
288
- </th>
289
- <th>
290
- <nobr>上期结余</nobr>
291
- </th>
292
- <th>
293
- <nobr>表号</nobr>
294
- </th>
295
- <th>
296
- <nobr>用户电话</nobr>
297
- </th>
298
- <th>
299
- <nobr>上期底数</nobr>
300
- </th>
301
- <th>
302
- <nobr>本期底数</nobr>
303
- </th>
304
-
305
-
306
- <th>
307
- <nobr>应交气量</nobr>
308
- </th>
309
- <th>
310
- <nobr>增量值</nobr>
311
- </th>
312
- <th>
313
- <nobr>应交金额</nobr>
314
- </th>
315
- <th>
316
- <nobr>抄表结果状态</nobr>
317
- </th>
318
- <th>
319
- <nobr>是否缴费</nobr>
320
- </th>
321
- <!-- <th>上次抄表日期</th>-->
322
- <th>
323
- <nobr>
324
- <data-order field="f_last_input_date" name="上次抄表录入日期"
325
- :order.sync="$parent.$parent.$parent.orderFields.f_last_input_date"></data-order>
326
- </nobr>
327
- </th>
328
- <!-- <th>下发日期</th>-->
329
- <th>
330
- <nobr>
331
- <data-order field="f_hand_date" name="下发日期"
332
- :order.sync="$parent.$parent.$parent.orderFields.f_hand_date"></data-order>
333
- </nobr>
334
- </th>
335
- <!-- <th>抄表日期</th>-->
336
- <th>
337
- <nobr>
338
- <data-order field="f_input_date" name="抄表录入日期"
339
- :order.sync="$parent.$parent.$parent.orderFields.f_input_date"></data-order>
340
- </nobr>
341
- </th>
342
- <!-- <th>抄表册</th>-->
343
- <th>
344
- <nobr>
345
- <data-order field="f_book_name" name="抄表册"
346
- :order.sync="$parent.$parent.$parent.orderFields.f_book_name"></data-order>
347
- </nobr>
348
-
349
- </th>
350
- <th>
351
- <nobr>抄表册编号</nobr>
352
- </th>
353
- <th>
354
- <nobr>册内排序</nobr>
355
- </th>
356
- <th>
357
- <nobr>调压箱名称</nobr>
358
- </th>
359
- <th>
360
- <nobr>抄表员</nobr>
361
- </th>
362
- <th>
363
- <nobr>录入人员</nobr>
364
- </th>
365
- <th>
366
- <nobr>下发人员</nobr>
367
- </th>
368
- <th>
369
- <nobr>备注</nobr>
370
- </th>
371
- <th>
372
- <nobr>操作</nobr>
373
- </th>
374
- <!-- f_oughtfee-->
375
- </tr>
376
- </template>
377
- <template partial='body'>
378
- <!--<td style="text-align: center;">-->
379
- <!--<input v-if="row.f_meter_state === '未下发'"-->
380
- <!--:id="model.pageIndex" type='checkbox' @change="$parent.$parent.$parent.chooseOne($event,row,model.rows)"-->
381
- <!--:checked="$parent.$parent.$parent.ischecked(row)"/>-->
382
- <!--</td>-->
383
- <td style="text-align: center;">{{$index + 1}}</td>
384
- <td>{{row.f_userinfo_code}}</td>
385
- <td style="text-align: center;">{{row.f_user_name}}&nbsp;&nbsp;{{row.f_address}}</td>
386
- <td style="text-align: center;">{{row.f_user_level}}</td>
387
- <!--<td>{{row.f_building}}</td>-->
388
- <!--<td>{{row.f_unit}}</td>-->
389
- <!--<td>{{row.f_room}}</td>-->
390
- <td style="text-align: center;">{{row.belongmonth}}</td>
391
- <td style="text-align: center;">{{row.f_balance}}</td>
392
- <td style="text-align: center;">{{row.f_meternumber}}</td>
393
- <td style="text-align: center;">{{row.f_user_phone}}</td>
394
- <td style="text-align: center;">{{row.f_last_tablebase}}</td>
395
- <td id="hand-creat" v-if="row.f_meter_state === '未抄表' " style="text-align: center;">
396
- <div class="form-group" style="margin-bottom:0px;display: contents;" :class="{
397
- 'has-success has-feedback': !row.error,
398
- 'has-error has-feedback': row.error}"
399
- >
400
-
401
- <input title="可录入小数点后三位" type="text" class="input_search" v-model="row.f_tablebase"
402
- @blur="$parent.$parent.$parent.beforenter($index, row)"
403
- v-next-el="{id: $index+2}" :id="$index+1" style="width: 100px;padding: 6px;"
404
- @focus="$parent.$parent.$parent.clearError(row)"
405
- :disabled="row.state === '开始'">
406
- </div>
407
-
408
- <span v-if="row.error && row.error !== ''" style="color: #ff0000;">{{row.error}}</span>
409
- </td>
410
- <td id="hand-creat" v-if="row.f_meter_state !== '未抄表' " style="text-align: center;">
411
- {{row.f_tablebase}}
412
- </td>
413
- <!--<td style="text-align: center;" v-if="row.f_oughtamount">{{ row.f_oughtamount }}</td>-->
414
- <td style="text-align: center;">{{$parent.$parent.$parent.calculationBase(row)}}</td>
415
- <td style="text-align: center;">
416
- <div class="form-group" style="margin-bottom:0px;display: contents;" :class="{'has-success has-feedback': !row.error,'has-error has-feedback': row.error}"
417
- v-if="row.f_meter_state === '未抄表' && row.states !== 0 && $parent.$parent.$parent.jurisdiction.includes('增量录入')">
418
- <input title="底数最多只能输入小数点后3位" type="number" class="input_search" v-model="row.f_adjustment_volume"
419
- style="width: 100px;padding: 6px;"
420
- :disabled="row.state === '开始'">
421
- </div>
422
- <div v-else>
423
- {{row.f_adjustment_volume}}
424
- </div>
425
- </td>
426
- <td style="text-align: center;">{{row.f_oughtfee}}</td>
427
-
428
- <td style="text-align: center;">
429
- <div class="form-group" style="margin-bottom:0px;display: contents;" :class="{
430
- 'has-success has-feedback': !row.error,
431
- 'has-error has-feedback': row.error}"
432
- v-if="row.f_meter_state === '未抄表' && row.states !== 0">
433
- <v-select :value.sync="row.f_result_state" v-model="row.f_result_state"
434
- :options='$parent.$parent.$parent.resultstate' placeholder='抄表结果状态'
435
- style="margin-right:90px" width="100%"
436
- :value-single="true"
437
- close-on-select
438
- condition="f_adjustable_name = '{}'"></v-select>
439
- <!-- <span id="inputError2Status" class="sr-only">(error)</span> -->
440
- </div>
441
- <div style="text-align: center;" v-else>
442
- {{row.f_result_state}}
443
- </div>
444
- </td>
445
- <td style="text-align: center;">{{row.f_whether_pay}}</td>
446
- <td style="text-align: center;">{{row.f_last_input_date}}</td>
447
- <td style="text-align: center;">{{row.f_hand_date}}</td>
448
- <td style="text-align: center;">
449
- <div class="form-group" style="margin-bottom:0px;display: contents;" :class="{
450
- 'has-success has-feedback': !row.error,
451
- 'has-error has-feedback': row.error}"
452
- v-if="row.f_meter_state === '未抄表' && row.states !== 0 && $parent.$parent.$parent.jurisdiction.includes('录入日期修正')">
453
- <datepicker id="endDate" placeholder="抄表时间"
454
- v-model="row.f_input_date"
455
- :value.sync="row.f_input_date"
456
- :format="'yyyy-MM-dd HH:mm:ss'"
457
- :show-reset-button="true">
458
- </datepicker>
459
- </div>
460
- <div v-else>
461
- {{row.f_input_date}}
462
- </div>
463
- </td>
464
- <td style="text-align: center;">{{row.f_book_name}}</td>
465
- <td style="text-align: center;">{{row.f_book_code}}</td>
466
- <td style="text-align: center;">{{row.f_meter_book_sort}}</td>
467
- <td style="text-align: center;">{{row.f_adjustable_name}}</td>
468
- <td style="text-align: center;">{{row.f_inputtor}}</td>
469
- <td style="text-align: center;">{{row.f_input_person}}</td>
470
- <td style="text-align: center;">{{row.f_operator}}</td>
471
- <td style="text-align: center;">{{row.f_comments}}</td>
472
- <td style="text-align: center;"><nobr>
473
- <!-- 已抄表,还没审核-->
474
- <button type="button" name="button" class="button_search button_spacing width-60"
475
- v-if="row.f_meter_state === '待审核' && (row.id == row.maxid || !row.maxid)"
476
- @click.stop="$parent.$parent.$parent.cancelAuditHand(row)">撤销
477
- </button>
478
- <!-- 未抄表,删除计划,直接删表内数据-->
479
- <button type="button" name="button" class="btn btn-danger"
480
- v-if="row.f_meter_state === '未抄表'"
481
- @click.stop="$parent.$parent.$parent.delectHand(row) && row.states === 1"
482
- >删除
483
- </button>
484
- <!-- 已抄表,已审核,冲正(状态改为冲正,添加负记录,需要重新下发)-->
485
- <button type="button" name="button" class="button_search button_spacing width-60"
486
- @click.stop="$parent.$parent.$parent.cancelHand(row)"
487
- v-if="row.f_meter_state === '已抄表' && row.maxid==row.id && (row.f_whether_pay === '否' || row.f_accounts_state === '自动下账' || (row.f_whether_pay === '是' && row.f_oughtfee == 0 ))" >冲正
488
- </button>
489
-
490
- <!-- <button type="button" name="button" class="btn btn-link"-->
491
- <!-- v-if="row.f_meter_state === '待审核' ">待审核-->
492
- <!-- </button>-->
493
-
494
-
495
- </nobr>
496
- </td>
497
- </template>
498
- </data-grid>
499
- </criteria-paged>
500
- <table class="table-hover">
501
- <tr style="position: relative" class="table-bordered">
502
- <td
503
- style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
504
- 汇总信息
505
- </td>
506
- <td
507
- style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
508
- 应缴气量:&emsp;{{sumsmodel.f_oughtamount}}
509
- </td>
510
- <td
511
- style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
512
- 应缴金额:&emsp;{{sumsmodel.f_oughtfee}}
513
- </td>
514
- </tr>
515
- </table>
516
- <split-price :showdata="splitdata" :pricesplit="priceSplit" v-if="priceSplit"></split-price>
517
-
518
- <modal :show.sync="danhu.show" :title='danhutitle' backdrop="false" coverstyle="danhumodal">
519
- <article slot="modal-body" class="modal-body">
520
- <div class="panel panel-primary datapanel">
521
- <div class="row">
522
- <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">客户姓名:{{danhu.info.f_user_name}}</label>
523
- <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">客户编号:{{danhu.info.f_userinfo_code}}</label>
524
- <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">用户证号:{{danhu.info.f_book_no}}</label>
525
- <label class="control-label col-sm-12 flex-row" style="transform: translate(0,8px)">客户地址:{{danhu.info.f_address}}</label>
526
- <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">上次抄表日期:{{danhu.info.f_hand_date}}</label>
527
- <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">上期底数:{{danhu.info.f_tablebase}}</label>
528
- </div>
529
- </div>
530
- <div class="panel panel-primary datapanel">
531
- <div class="row">
532
- <div class="col-sm-6 flex-row" style="margin-top: 2px">
533
- <label for="danhucode" class="control-label" style="transform: translate(0,8px)">客户编号</label>
534
- <input id="danhucode" type="text" class="input_search " style="width: 60% !important;"
535
- v-model="danhu.f_userinfo_code" v-ref:danhucode @keyup.enter.stop="danhuCodeSearch"
536
- placeholder='客户编号'/>
537
- </div>
538
- <div class="col-sm-6 flex-row" style="margin-top: 2px">
539
- <label for="danhubase" class="control-label" style="transform: translate(0,8px)">本期底数</label>
540
- <input id="danhubase" type="number" class="input_search " style="width: 60% !important;"
541
- v-model="danhu.f_tablebase" @keyup.enter.stop="downAndHand"
542
- placeholder='本期底数'/>
543
- </div>
544
- </div>
545
- </div>
546
- </article>
547
- <footer slot="modal-footer">
548
- </footer>
549
- </modal>
550
-
551
- <modal :show.sync="uploadshow" v-ref:modal backdrop="false">
552
- <header slot="modal-header" class="modal-header">
553
- <button type="button" class="close" @click="close"><span>&times;</span></button>
554
- <h4 class="modal-title">文件上传</h4>
555
- </header>
556
- <article slot="modal-body" class="modal-body">
557
- <div class="col-sm-2 form-group">
558
- <file-upload class="my-file-uploader" name="myFile"
559
- action="api/af-revenue/file/uploadFile" tagname="文件上传" :headers="headers" multiple v-ref:file></file-upload>
560
- </div>
561
- </article>
562
-
563
- <footer slot="modal-footer" class="modal-footer">
564
- <!-- <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
565
- <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button> -->
566
- </footer>
567
- </modal>
568
- <modal :show.sync="examineshow" v-ref:modal backdrop="false">
569
- <header slot="modal-header" class="modal-header">
570
- <button type="button" class="close" @click="close"><span>&times;</span></button>
571
- <h4 class="modal-title">冲正审核</h4>
572
- </header>
573
- <article slot="modal-body" class="modal-body">
574
- <div class="row">
575
- <div class="col-sm-12 form-group">
576
- <label class="font_normal_body">冲正原因</label>
577
- <input type="text" style="width:90%" class="input_search" :disabled="examinetype"
578
- v-model="examinerow.f_examinereason"
579
- placeholder='冲正原因'>
580
- </div>
581
- <upload :blodid="examinerow.id" v-ref:upload :fusetype="uploadText" isremark="true"
582
- style="width:auto"></upload>
583
- </div>
584
-
585
- </article>
586
-
587
- <footer slot="modal-footer" class="modal-footer">
588
- <button v-show="examineshow" type="button" class="btn btn-default" @click='close'>取消</button>
589
- <button v-show="!examinetype" type="button" class="btn btn-success" @click='examineconfirm()'>确认</button>
590
- <button type="button" v-show="examinetype" class="btn btn-success" @click='cancelHand5()'>审核通过</button>
591
- </footer>
592
- </modal>
593
-
594
- <modal :show.sync="showerr" backdrop="false">
595
- <header slot="modal-header" class="modal-header">
596
- <button type="button" class="close" @click="closeerr"><span>&times;</span></button>
597
- <h4 class="modal-title">抄表出错!</h4>
598
- </header>
599
- <article slot="modal-body" class="modal-body">
600
- <div class="row">
601
- <p> {{err}}</p>
602
- <input type="text" class="form-control" @blur="paycodefocus" v-el:paycode>
603
- </div>
604
-
605
- </article>
606
-
607
- <footer slot="modal-footer" class="modal-footer">
608
- <button v-show="showerr" type="button" class="btn btn-default" @click='closeerr'>关闭</button>
609
- </footer>
610
- </modal>
611
-
612
- <modal :show.sync="detailsShow" v-ref:model_details backdrop="true" width="700px">
613
- <article slot="modal-body" class="modal-body">
614
- <div class="flex-row">
615
- <div style="width: 50%">
616
- <mix-price-info :data="row" v-if="row.f_price_type === '固定气价'" v-ref:mix_price></mix-price-info>
617
- <stairinfo :data="row" v-if="row.f_price_type === '阶梯气价'" v-ref:statir></stairinfo>
618
- </div>
619
- <div style="width: 50%" class="panel">
620
- <div class="panel-heading detail-panel">
621
- <h4>计算工具</h4>
622
- </div>
623
- <form class="form-horizontal" style="padding: 10px">
624
- <div class="form-group">
625
- <label class="col-sm-4 col-md-4 control-label" style="text-align: left">预购金额:</label>
626
- <div class="col-sm-8 col-md-8">
627
- <input type="number" class="form-control" placeholder="预购金额" @blur="computeAmount" v-el:inputmoney>
628
- </div>
629
- </div>
630
- <div class="form-group">
631
- <label class="col-sm-4 col-md-4 control-label" style="text-align: left">当前底数:</label>
632
- <div class="col-sm-8 col-md-8">
633
- <input type="number" class="form-control" placeholder="当前底数" v-model="row.f_last_tablebase" disabled>
634
- </div>
635
- </div>
636
- <div class="form-group">
637
- <label class="col-sm-4 col-md-4 control-label" style="text-align: left">应抄底数:</label>
638
- <div class="col-sm-8 col-md-8">
639
- <input type="number" class="form-control" placeholder="应抄底数" v-model="should_base" disabled>
640
- </div>
641
- </div>
642
- <div class="form-group">
643
- <label class="col-sm-12 col-md-12 control-label" style="text-align: center">计算公式</label>
644
- <div class="col-sm-12 col-md-12">
645
- <input type="text" class="form-control" placeholder="计算公式" v-model="designFormulas" disabled>
646
- </div>
647
- </div>
648
- </form>
649
- </div>
650
- </div>
651
- </article>
652
- <footer slot="modal-footer" class="modal-footer">
653
- <button type="button" class="button_search button_spacing" @click='customPricing()'>自定义划价</button>
654
- </footer>
655
- </modal>
656
-
657
- <modal :show.sync="priceModel" v-ref:modal backdrop="false">
658
- <header slot="modal-header" class="modal-header">
659
- <h4 class="modal-title">自定义划价</h4>
660
- </header>
661
- <article slot="modal-body" class="modal-body">
662
- <div>
663
- <mix-price-info :data="row" v-if="row.f_price_type === '固定气价'" v-ref:mix_price></mix-price-info>
664
- <stairinfo :data="row" v-if="row.f_price_type === '阶梯气价'" v-ref:statir></stairinfo>
665
- </div>
666
- <div class="row">
667
- <template v-if="row.f_price_type === '固定气价'">
668
- <div class="col-sm-4 form-group">
669
- <label class="font_normal_body">单价</label>
670
- <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_price1" placeholder='单价'></input>
671
- </div>
672
- <div class="col-sm-4 form-group">
673
- <label class="font_normal_body">数量</label>
674
- <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_gas1" placeholder='数量'></input>
675
- </div>
676
- <div class="col-sm-4 form-group">
677
- <label class="font_normal_body">金额</label>
678
- <p class="form-control" style="width:60%" disabled>{{ row.f_stair_money1 = stairMoney(row.f_stair_price1, row.f_stair_gas1) }}</p>
679
- </div>
680
- </template>
681
-
682
- <template v-if="row.f_price_type === '阶梯气价'">
683
- <div class="col-sm-4 form-group" >
684
- <label class="font_normal_body">阶梯一单价</label>
685
- <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_price1" placeholder='阶梯一单价'></input>
686
- </div>
687
- <div class="col-sm-4 form-group">
688
- <label class="font_normal_body">阶梯一数量</label>
689
- <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_gas1" placeholder='阶梯一数量'></input>
690
- </div>
691
- <div class="col-sm-4 form-group">
692
- <label class="font_normal_body">阶梯一金额</label>
693
- <p class="form-control" style="width:60%" disabled>{{ row.f_stair_money1 = stairMoney(row.f_stair_price1, row.f_stair_gas1) }}</p>
694
- </div>
695
- <div class="col-sm-4 form-group" >
696
- <label class="font_normal_body">阶梯二单价</label>
697
- <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_price2" placeholder='阶梯二单价'></input>
698
- </div>
699
- <div class="col-sm-4 form-group">
700
- <label class="font_normal_body">阶梯二数量</label>
701
- <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_gas2" placeholder='阶梯二数量'></input>
702
- </div>
703
- <div class="col-sm-4 form-group">
704
- <label class="font_normal_body">阶梯二金额</label>
705
- <p class="form-control" style="width:60%" disabled>{{ row.f_stair_money2 = stairMoney(row.f_stair_price2, row.f_stair_gas2) }}</p>
706
- </div>
707
- <div class="col-sm-4 form-group" >
708
- <label class="font_normal_body">阶梯三单价</label>
709
- <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_price3" placeholder='阶梯三单价'></input>
710
- </div>
711
- <div class="col-sm-4 form-group">
712
- <label class="font_normal_body">阶梯三数量</label>
713
- <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_gas3" placeholder='阶梯三数量'></input>
714
- </div>
715
- <div class="col-sm-4 form-group">
716
- <label class="font_normal_body">阶梯三金额</label>
717
- <p class="form-control" style="width:60%" disabled>{{ row.f_stair_money3 = stairMoney(row.f_stair_price3, row.f_stair_gas3) }}</p>
718
- </div>
719
- </template>
720
- <div class="col-sm-4 form-group" >
721
- </div>
722
- <div class="col-sm-4 form-group">
723
- <label class="font_normal_body">总用气量</label>
724
- <p class="form-control" style="width:60%" disabled>{{ ((row.f_stair_gas1 - 0)+(row.f_stair_gas2 - 0)+(row.f_stair_gas3 - 0)).toFixed(3) }}</p>
725
- </div>
726
- <div class="col-sm-4 form-group">
727
- <label class="font_normal_body">总用气金额</label>
728
- <p class="form-control" style="width:60%" disabled>{{ ((row.f_stair_money1 - 0)+(row.f_stair_money2 - 0)+(row.f_stair_money3 - 0)).toFixed(3) }}</p>
729
- </div>
730
- <p style="color: red">注意: 自定义气量总量必须等于本次抄表用气量, 本次抄表总量: {{row.f_oughtamount}}</p>
731
- </div>
732
- </article>
733
- <footer slot="modal-footer" class="modal-footer">
734
- <button type="button" class="button_clear button_spacing" @click="close()">取消</button>
735
- <button type="button" class="button_search button_spacing" @click='customPricingConfirm()'>确认</button>
736
- </footer>
737
- </modal>
738
- </div>
739
- </div>
740
- </template>
741
- <script>
742
- import MixPriceInfo from '../../components/revenue/base/leftview/MixPriceInfo'
743
- import {PagedList, HttpResetClass} from 'vue-client'
744
- import Vue from 'vue'
745
- import co from 'co'
746
-
747
- let readyGen = async function (self) {
748
- await self.$getConfig(self, 'HandManager')
749
- await self.$LoadParams.loadMeterBook(self.f_filialeid)
750
- self.loadMeterBooks()
751
- self.loadBookCodes()
752
- self.getfield = self.config.excelHeaders
753
- self.sumsmodel = self.$refs.paged.$refs.grid.model.sums
754
- self.reflash()
755
- }
756
-
757
- let downGen = function* (type, condition, data, self) {
758
- // if(data == 0 ) {
759
- // self.$showAlert('下发计划户数为0!请选择需要下发的计划!!', 'danger', 0)
760
- // return
761
- // }
762
- self.condition = condition
763
- self.msg = '确认下发计划'
764
- // 判断之前是否有未抄表数据
765
- let getUnhand = null
766
- // let getUnhand = yield Vue.resetpost('api/af-revenue/sql/getUnhand', {data: {startDate: self.startDate, condition: self.condition}}, {resolveMsg: null, rejectMsg: '获取未抄表数据异常!!'})
767
- // if (type === 'batch' || type === 'single') {
768
- if (type === 'single') {
769
- getUnhand = yield Vue.resetpost('api/af-revenue/sql/getUnhand', {
770
- data: {
771
- startDate: self.model.params.startDate,
772
- condition: condition
773
- }
774
- }, {resolveMsg: null, rejectMsg: '获取未抄表数据异常!!'})
775
- self.msg = `下发客户编号为${data.f_userinfo_code}的抄表计划?`
776
- // } else if (type === 'all') {
777
- } else if (type === 'batch') {
778
- let tempCondition = condition.replace("and f_meter_state = '未下发'", '')
779
- getUnhand = yield Vue.resetpost('api/af-revenue/sql/getUnhand', {
780
- data: {
781
- startDate: self.model.params.startDate,
782
- condition: tempCondition
783
- }
784
- }, {resolveMsg: null, rejectMsg: '获取未抄表数据异常!!'})
785
- self.msg = `确认下发当前总计: ${data} 户计划`
786
- }
787
- for (let i = 0; i < getUnhand.data.length; i++) {
788
- let temp = {
789
- id: getUnhand.data[i].id,
790
- f_user_id: getUnhand.data[i].f_user_id,
791
- f_userfiles_id: getUnhand.data[i].f_userfiles_id,
792
- f_adjustable_id: getUnhand.data[i].f_adjustable_id,
793
- f_adjustable_name: getUnhand.data[i].f_adjustable_name
794
- }
795
- console.log('=================================================================================')
796
- console.log('下发计划查看调压箱和调压箱编号', temp)
797
- console.log('========================================================================================')
798
- self.unhandplan.push(temp)
799
- }
800
- if (getUnhand.data.length > 0) {
801
- self.msg = self.msg + `, 警告: 之前有 ${getUnhand.data.length} 条未抄表数据`
802
- }
803
- self.show = true
804
- }
805
-
806
- let beforenterGen = async function (self, index, row) {
807
- // 验证是不是总表
808
- // self.enter(index, row)
809
- if (row.f_totalsplit_type === '总表') {
810
- let hasUnHand = await self.$HandService.getSplitInfo(row.f_userfiles_id)
811
- if (hasUnHand) {
812
- self.$showAlert('该表下面有未抄或未审核的分表信息!!请先抄录或审核分表信息!', 'danger', 0)
813
- row.f_tablebase = null
814
- } else {
815
- self.enter(index, row)
816
- }
817
- } else {
818
- self.enter(index, row)
819
- }
820
- }
821
-
822
- export default {
823
- title: '机表抄表',
824
- components: { MixPriceInfo },
825
- data () {
826
- return {
827
- priceModel: false,
828
- initres: {
829
- org: [this.$login.f.orgid],
830
- dep: [],
831
- user: []
832
- },
833
- sumsmodel: [],
834
- orgCondtionStr: '',
835
- priceSplit: false,
836
- deletestate: false,
837
- criteriaShow: false,
838
- model: new PagedList('api/af-revenue/sql/getPlan', 50, {orderitem: this.orderDefault ? '"' + this.orderDefault + ' "' : `'f_hand_date desc'`}, {
839
- f_oughtamount: 0,
840
- f_oughtfee: 0
841
- }),
842
- config: {
843
-
844
- // 导出列要和查询列相同
845
- excelHeaders: {
846
- 'f_user_id': '表编号',
847
- 'f_meternumber': '表号',
848
- 'f_inputtor': '抄表员',
849
- 'f_balance': '上期结余',
850
- 'f_last_input_date': '上次抄表',
851
- 'f_hand_date': '下发时间',
852
- 'f_input_date': '抄表日期',
853
- 'f_userinfo_code': '客户编号',
854
- 'f_address': '客户地址',
855
- 'f_residential_area': '小区名称',
856
- 'f_user_name': '客户姓名',
857
- 'f_last_tablebase': '上期底数',
858
- 'f_tablebase': '本期指数',
859
- 'f_oughtfee': '应交金额',
860
- 'f_oughtamount': '应交气量',
861
- 'f_whether_pay': '是否缴费',
862
- 'f_book_name': '抄表册',
863
- 'f_book_code': '抄表册编号',
864
- 'f_meter_book_sort': '册内排序',
865
- 'f_input_person': '录入人员',
866
- 'f_operator': '下发人员',
867
- 'f_meter_classify': '气表分类',
868
- 'f_meter_style': '气表型号',
869
- 'f_accounts_state': '下账标识',
870
- 'f_user_phone': '客户电话',
871
- 'f_adjustable_id': '表箱号',
872
- 'f_comments': '备注'
873
- },
874
- examine: true,
875
- customCal: false
876
- },
877
- meter_state: false, // 是否显示计划下发按钮
878
- downModel: {
879
- downDate: Vue.$login.toStandardTimeString(),
880
- downWay: 'downWithUserfiles',
881
- downInputtor: []
882
- },
883
- inputtorModel: {
884
- inputtor: [],
885
- reason: ''
886
- },
887
- auditState: [{label: '全部', value: ''}, {label: '未抄表', value: '未抄表'}, {label: '待审核', value: '待审核'}, {label: '已抄表', value: '已抄表'}],
888
-
889
- plans: [], // 记录当前行是否被勾选
890
- all: false, // 是否全选
891
- show: false, // 下发日期模态框显示
892
- unhandplan: [], // 之前是否有未抄表记录
893
- downConfirm: false, // 下发若有未抄记录,确认框
894
- uploadshow: false,
895
- // 小区
896
- residentialArea: [],
897
-
898
- // downDate: this.$login.toStandardYearMonth().replace("-", ""),
899
- msg: '',
900
- condition: '',
901
- headers: {'username': Vue.$login.f.name, 'blodid': Vue.$login.guid()},
902
- orderDefault: 'f_hand_date',
903
- orderFields: {
904
- f_userinfo_id: 'no'
905
- },
906
- getfield: {},
907
- outlet: '',
908
- filiale: '',
909
- condition2: '',
910
- area: [],
911
- inputtouPerson: [],
912
- meters: [{label: '全部', value: ''}, {label: '机表', value: '机表'}, {label: '物联网表', value: '物联网表'}],
913
- resultstate: this.$appdata.getParam('抄表结果状态'),
914
- meterstates: this.$appdata.getParam('抄表状态') ? [{
915
- label: '全部',
916
- value: ''
917
- }, ...this.$appdata.getParam('抄表状态')] : [],
918
- usertypes: this.$appdata.getParam('客户类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('客户类型')] : [],
919
- userlevels: this.$appdata.getParam('用户等级') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用户等级')] : [],
920
- adjustablename: this.$appdata.getParam('调压箱名称') ? [{
921
- label: '全部',
922
- value: ''
923
- }, ...this.$appdata.getParam('调压箱名称')] : [],
924
- inputtores2: [], // 下发时使用自定义抄表员,
925
- splitdata: '',
926
- f_filialeid: this.$login.f.orgid,
927
- meterbooks: [],
928
- bookcodes: [],
929
- upshow: false,
930
- inputid: 0,
931
- examineshow: false,
932
- examinerow: null,
933
- showfiles: false,
934
- uploadText: '抄表',
935
- examinetype: false,
936
- danhu: {
937
- show: false,
938
- f_userinfo_code: '',
939
- f_tablebase: '',
940
- info: {}
941
- },
942
- showerr: false,
943
- err: '',
944
- // 请求对象(批量导入,查询进度使用)
945
- HttpReset: new HttpResetClass(),
946
- // 气价使用详情展示
947
- detailsShow: false,
948
- row: null,
949
- // 应抄底数
950
- should_base: 0,
951
- // 计算公式
952
- designFormulas: null,
953
- usermlimit: this.$appdata.getSingleValue('民用自动审核区间'),
954
- userfmlimit: this.$appdata.getSingleValue('非民用自动审核区间')
955
- }
956
- },
957
- ready () {
958
- this.getaddress()
959
- readyGen(this)
960
- },
961
- mounted () {
962
- console.log(this.inputid)
963
- document.getElementById(this.inputid).focus()
964
- },
965
- methods: {
966
- stairMoney (price, gas) {
967
- return (price * gas).toFixed(3) - 0
968
- },
969
- async customPricingConfirm () {
970
- let sumGas = (this.row.f_stair_gas1 - 0) + (this.row.f_stair_gas2 - 0) + (this.row.f_stair_gas3 - 0)
971
- if (sumGas !== (this.row.f_oughtamount - 0)) {
972
- this.$showMessage('自定义划价总气量不符, 请检查')
973
- return
974
- }
975
- let row = {
976
- id: this.row.id,
977
- f_oughtfee: ((this.row.f_stair_money1 - 0) + (this.row.f_stair_money2 - 0) + (this.row.f_stair_money3 - 0)).toFixed(3),
978
- f_stair_price1: this.row.f_stair_price1,
979
- f_stair_gas1: this.row.f_stair_gas1,
980
- f_stair_money1: this.row.f_stair_money1,
981
- f_stair_price2: this.row.f_stair_price2,
982
- f_stair_gas2: this.row.f_stair_gas2,
983
- f_stair_money2: this.row.f_stair_money2,
984
- f_stair_price3: this.row.f_stair_price3,
985
- f_stair_gas3: this.row.f_stair_gas3,
986
- f_stair_money3: this.row.f_stair_money3
987
- }
988
- await this.$resetpost('api/af-revenue/logic/customPricing', {data: row}, {resolveMsg: '保存成功', rejectMsg: '保存失败'}).then(res => {
989
- this.close()
990
- this.search()
991
- })
992
- },
993
- customPricing () {
994
- if (!this.$login.r.find(value => value == '抄表自定义划价')) {
995
- this.$showMessage('当前登录用户没有【抄表自定义划价】权限, 请联系管理员!')
996
- return
997
- }
998
- if (this.row.f_meter_state !== '已抄表') {
999
- this.$showMessage('当前抄表单不是已抄表状态,无法进行自定义划价!')
1000
- return
1001
- }
1002
- if (this.row.f_whether_pay !== '否') {
1003
- this.$showMessage('当前抄表单已经缴费,无法进行自定义划价!')
1004
- return
1005
- }
1006
- this.detailsShow = false
1007
- this.priceModel = true
1008
- },
1009
- downloadFiles () {
1010
- let downurl = 'api/af-revenue/downloadfile/file?filename=机表抄表导入Excel模板'
1011
- this.$downFile(downurl,'机表抄表导入Excel模板.xlsx')
1012
- },
1013
- calculationBase (row) {
1014
- let oughtamount = null
1015
- if (row.f_tablebase) {
1016
- if (row.f_share_gas) {
1017
- oughtamount = (row.f_tablebase - 0 - (row.f_last_tablebase - 0)).toFixed(4) + (row.f_share_gas > 0 ? '+' : '') + row.f_share_gas.toFixed(3)
1018
- } else {
1019
- if (row.f_capacity && row.f_capacity > 0 && row.f_tablebase < row.f_last_tablebase) {
1020
- oughtamount = (row.f_tablebase - 0 + (row.f_capacity - row.f_last_tablebase)).toFixed(3)
1021
- } else {
1022
- oughtamount = (row.f_tablebase - 0 - (row.f_last_tablebase - 0)).toFixed(3)
1023
- }
1024
- }
1025
- } else {
1026
- oughtamount = 0
1027
- }
1028
- row.f_oughtamount = oughtamount
1029
- return oughtamount
1030
- },
1031
- cancelHand (row) {
1032
- if (this.config.examine) {
1033
- let handdate = new Date(row.f_hand_date)
1034
- let ima = new Date()
1035
- if (handdate.getMonth() == ima.getMonth()) {
1036
- this.cancelHand3(row)
1037
- } else {
1038
- if (!this.$login.r.find(value => value == '抄表隔月冲正')) {
1039
- this.$showMessage('当前登录用户没有【抄表隔月冲正】权限, 请联系管理员!')
1040
- } else {
1041
- this.cancelHand3(row)
1042
- }
1043
- }
1044
- } else {
1045
- this.cancelHand3(row)
1046
- }
1047
- },
1048
-
1049
- cancelHand3 (row) {
1050
- // 抄表加入权限
1051
- if (!this.$login.r.find(value => value == '机表抄表冲正')) {
1052
- this.$showMessage('当前登录用户没有冲正权限, 请联系管理员!')
1053
- return
1054
- }
1055
- // console.log('抄表冲正。、。。、', row)
1056
- let param = {
1057
- f_hand_id: row.id,
1058
- operInfo: {
1059
- f_operator: this.$login.f.name,
1060
- f_operatorid: this.$login.f.id,
1061
- f_orgid: this.$login.f.orgid,
1062
- f_orgname: this.$login.f.orgs,
1063
- f_depid: this.$login.f.depids,
1064
- f_depname: this.$login.f.deps
1065
- }
1066
- }
1067
- let url = 'api/af-revenue/logic/sale_commonEnterCancel'
1068
- this.$resetpost(url, {data: param}, {warnMsg: '确定对这条记录进行撤销吗?'}).then(() => {
1069
- this.search()
1070
- this.close()
1071
- })
1072
- },
1073
- cancelAuditHand (row) {
1074
- console.log('撤回本次录入。。。', row)
1075
- let handplan = {
1076
- id: row.id,
1077
- f_oughtamount: 0,
1078
- f_tablebase: 0,
1079
- f_input_date: null,
1080
- f_meter_state: '未抄表',
1081
- f_meter_source: null
1082
- }
1083
- this.$resetpost('api/af-revenue/entity/save/t_handplan', handplan, {
1084
- resolveMsg: null,
1085
- rejectMsg: '撤回失败'
1086
- }).then((res) => {
1087
- this.search()
1088
- })
1089
- },
1090
- async danhuCodeSearch () {
1091
- this.danhu.f_userinfo_code = this.danhu.f_userinfo_code.replace(/(^\s*)|(\s*$)/g, '')
1092
- await this.$resetpost('api/af-revenue/sql/getInfoOfDanhu', {
1093
- data: {
1094
- f_userinfo_code: this.danhu.f_userinfo_code,
1095
- f_orgid: this.f_filialeid
1096
- }
1097
- },
1098
- {resolveMsg: null, rejectMsg: '查询用户信息失败,网络错误'}).then(res => {
1099
- if (res.data.length !== 1) {
1100
- this.$showAlert(res.data.length === 0 ? '没有查询到用户' : '查询到多条用户信息', 'warning', 3000)
1101
- return
1102
- }
1103
- if (res.data[0].f_meter_state === '待审核') {
1104
- this.$showAlert('用户有待审核的记录', 'warning', 3000)
1105
- return
1106
- }
1107
- if (res.data[0].f_whether_pay === '否') {
1108
- this.$showAlert('用户有未缴费的抄表记录', 'warning', 3000)
1109
- }
1110
- this.danhu.info = res.data[0]
1111
- // = Object.assign(this.danhu,{info:res.data[0]})
1112
- document.getElementById('danhubase').focus()
1113
- })
1114
- },
1115
- // 单户抄表 下发计划并抄表
1116
- async downAndHand () {
1117
- if (!this.danhu.info.f_userinfo_code || this.danhu.info.f_userinfo_code === '') {
1118
- this.$showAlert(`请先查询用户信息`, 'warning', 2000)
1119
- return
1120
- }
1121
-
1122
- if (this.danhu.f_tablebase < 0) {
1123
- this.$showAlert(`底数不能小于0,请注意!`, 'warning', 2000)
1124
- return
1125
- } else if (this.danhu.f_tablebase.toString().split('.').length > 1 && this.danhu.f_tablebase.toString().split('.')[1].length > 3) {
1126
- this.$showAlert(`底数最多只能输入小数点后3位,请注意!`, 'warning', 2000)
1127
- return
1128
- } else if (this.danhu.f_tablebase < this.danhu.info.f_tablebase && !this.danhu.info.f_capacity) {
1129
- this.$showAlert(`本期表底数不能低于上期表底数`, 'warning', 2000)
1130
- return
1131
- } else {
1132
- if (this.danhu.f_tablebase < this.danhu.info.f_tablebase) {
1133
- this.$showMessage('本次抄表已超越最大量程, 请熟知!')
1134
- }
1135
- }
1136
- let param = {
1137
- downDate: this.downModel.downDate,
1138
- startDate: this.model.params.startDate,
1139
- endDate: this.model.params.endDate,
1140
- condition: ` f_userfiles_id = '${this.danhu.info.f_userfiles_id}' `,
1141
- f_operator: this.$login.f.name,
1142
- f_operatorid: this.$login.f.id,
1143
- danhu: true,
1144
- userfilesid: this.danhu.info.f_userfiles_id
1145
- }
1146
- console.log('下发参数:', param)
1147
- this.$resetpost('api/af-revenue/logic/downHand', {data: param}, {resolveMsg: null, rejectMsg: '下发失败,请检查该用户是否在该归属期内已有抄表记录'}).then((res) => {
1148
- console.log('下发计划成功', res)
1149
- this.$resetpost('/api/af-revenue/sql/querySingleTable', {
1150
- data: {
1151
- items: 'max(id) id',
1152
- tablename: 't_handplan',
1153
- condition: ` f_userfiles_id = '${this.danhu.info.f_userfiles_id}' `
1154
- }
1155
- }, {resolveMsg: null, rejectMsg: '查询抄表信息失败'}).then((res2) => {
1156
- let handParam = {
1157
- f_meter_classify: this.danhu.info.f_meter_classify,
1158
- f_meter_brand: this.danhu.info.f_meter_brand,
1159
- f_hand_id: res2.data[0].id,
1160
- f_tablebase: this.danhu.f_tablebase,
1161
- f_userinfo_id: this.danhu.info.f_userinfo_id
1162
- }
1163
- this.$resetpost('api/af-revenue/logic/sale_commonEnter', {data: handParam}, {
1164
- resolveMsg: null,
1165
- rejectMsg: null
1166
- })
1167
- }).then((res) => {
1168
- this.$showAlert(`单户抄表成功!`, 'success', 2000)
1169
- this.danhuShow()
1170
- }).catch((error) => {
1171
- this.danhu.show = false
1172
- this.$showAlert(`单户抄表失败!` + JSON.toString(error), 'danger', 2000)
1173
- })
1174
- }).catch((error) => {
1175
- this.danhu.show = false
1176
- this.$showAlert(`抄表失败,请注意查看,失败原因:` + JSON.toString(error), 'danger', 2000)
1177
- })
1178
- },
1179
- // 获得本月的最后一天。
1180
- getLastDayOfMonth (year, month) {
1181
- let new_year = year // 取当前的年份
1182
- let new_month = month++// 取下一个月的第一天,方便计算(最后一天不固定)
1183
- if (month > 12) // 如果当前大于12月,则年份转到下一年
1184
- {
1185
- new_month -= 12 // 月份减
1186
- new_year++ // 年份增
1187
- }
1188
- let new_date = new Date(new_year, new_month, 1) // 取当年当月中的第一天
1189
- let date_count = (new Date(new_date.getTime() - 1000 * 60 * 60 * 24)).getDate()// 获取当月的天数
1190
- // let last_date = new Date(new_date.getTime() - 1000 * 60 * 60 * 24);//获得当月最后一天的日期
1191
- return date_count
1192
- },
1193
- danhuShow () {
1194
- this.model.params.startDate = this.$refs.paged.$refs.criteria.model.startDate
1195
- this.model.params.endDate = this.$refs.paged.$refs.criteria.model.endDate
1196
- this.downModel.downDate = this.$login.toStandardTimeString()
1197
- this.danhu = {
1198
- show: true,
1199
- f_userinfo_code: '',
1200
- f_tablebase: '',
1201
- info: {}
1202
- }
1203
- setTimeout(() => {
1204
- document.getElementById('danhucode').focus()
1205
- this.$refs.paged.$refs.criteria.search()
1206
- }, 100)
1207
- },
1208
- paycodefocus () {
1209
- this.$nextTick(() => {
1210
- this.$els.paycode.focus()
1211
- })
1212
- },
1213
- getRes (obj) {
1214
- this.orgCondtionStr = obj
1215
- },
1216
- async getaddress () {
1217
- console.log('开始获取小区')
1218
- let HttpReset = new HttpResetClass()
1219
- var data = await HttpReset.load('POST', 'api/af-revenue/sql/manage_getarealist', {
1220
- data: {
1221
- condition: `1=1 and s.f_filialeid = '${this.$login.f.orgid}'`
1222
- }
1223
- }, {resolveMsg: null, rejectMsg: '获取小区失败!'})
1224
- console.log('小区', data)
1225
- let house = []
1226
- house.push()
1227
- for (let row of data.data) {
1228
- console.log('开始保存小区')
1229
- house.push({label: row.f_residential_area, value: row.f_residential_area})
1230
- }
1231
- this.residentialArea = house
1232
- },
1233
- loadMeterBooks () {
1234
- this.meterbooks = this.$GetSaleParam.getMeterBooks()
1235
- },
1236
- loadBookCodes () {
1237
- this.bookcodes = this.$GetSaleParam.getBookCodes()
1238
- },
1239
- fileterprice (row) {
1240
- this.splitdata = row
1241
- this.priceSplit = true
1242
- console.log('row==>', row)
1243
- },
1244
- hidden () {
1245
- this.criteriaShow = !this.criteriaShow
1246
- },
1247
- clear () {
1248
- Object.keys(this.$refs.paged.$refs.criteria.model).forEach((key) => {
1249
- this.$refs.paged.$refs.criteria.model[key] = []
1250
- })
1251
- },
1252
-
1253
- // 判断当前页是否全选
1254
- isChooseAll (rows) {
1255
- if (this.plans.length == 0 && rows.length == 0) {
1256
- return false
1257
- }
1258
- for (var i = 0; i < rows.length; i++) {
1259
- let flag = false
1260
- if (rows[i].f_meter_state == '未下发') {
1261
- for (let plan of this.plans) {
1262
- if (plan.id == rows[i].f_userfiles_id) {
1263
- flag = true
1264
- if (!plan.state) {
1265
- return false
1266
- }
1267
- }
1268
- }
1269
- if (!flag) {
1270
- return false
1271
- }
1272
- }
1273
- }
1274
- return true
1275
- },
1276
- // 选择需要下发的计划
1277
- chooseOne (e, row, rows) {
1278
- console.log('row', row)
1279
- let checked = e.target.checked
1280
- console.log('state', e.target.checked)
1281
- // 判断当前行是否被选中
1282
- if (checked) {
1283
- let onePlan = {
1284
- id: row.f_userfiles_id,
1285
- state: true
1286
- }
1287
- // 记录被选中计划的状态
1288
- let flag = false
1289
- for (let plan of this.plans) {
1290
- if (plan.id == row.f_userfiles_id) {
1291
- flag = true
1292
- plan.state = true
1293
- }
1294
- }
1295
- if (!flag) {
1296
- this.plans.push(onePlan)
1297
- }
1298
- } else {
1299
- for (let plan of this.plans) {
1300
- if (plan.id == row.f_userfiles_id) {
1301
- plan.state = false
1302
- }
1303
- }
1304
- }
1305
- // let param = {id:row.id,isChoose:true}
1306
-
1307
- if (this.isChooseAll(rows)) {
1308
- this.all = true
1309
- } else {
1310
- this.all = false
1311
- }
1312
- // this.delRepetition()
1313
- },
1314
- uploadFiles () {
1315
- this.showfiles = !this.showfiles
1316
- },
1317
- chooseAll () {
1318
- if (this.all) {
1319
- // this.chooseInfo[index-1] = []
1320
- // for (let row of this.model.rows){
1321
- // this.chooseInfo[index-1].push(row)
1322
- // }
1323
- // this.chooseInfo = Object.assign([],this.chooseInfo,this.model.rows)
1324
-
1325
- for (let row of this.model.rows) {
1326
- if (row.f_meter_state == '未下发') {
1327
- let onePlan = {
1328
- id: row.f_userfiles_id,
1329
- state: true
1330
- }
1331
- let flag = false
1332
- for (let plan of this.plans) {
1333
- if (plan.id == row.f_userfiles_id) {
1334
- flag = true
1335
- plan.state = true
1336
- }
1337
- }
1338
- if (!flag) {
1339
- this.plans.push(onePlan)
1340
- }
1341
- }
1342
- }
1343
- } else {
1344
- // this.chooseInfo[index-1] = []
1345
- // console.log("this.chooseInfo[index-1]",this.chooseInfo[index-1])
1346
- for (let row of this.model.rows) {
1347
- if (row.f_meter_state == '未下发') {
1348
- for (let plan of this.plans) {
1349
- if (plan.id == row.f_userfiles_id) {
1350
- plan.state = false
1351
- }
1352
- }
1353
- }
1354
- }
1355
- }
1356
- },
1357
- search () {
1358
- // 查询前清空选择项
1359
- this.plans = []
1360
- this.$refs.paged.$refs.criteria.search()
1361
- },
1362
- clickupshow () {
1363
- if (!this.$login.r.find(value => value == '机表抄表导入抄表')) {
1364
- this.$showMessage('你没有机表抄表导入抄表的权限,请联系管理员!')
1365
- return
1366
- }
1367
- this.upshow = !this.upshow
1368
- },
1369
- deletehand () {
1370
- if (!this.$login.r.find(value => value == '抄表计划删除')) {
1371
- this.$showMessage('你没有【抄表计划删除】的权限,请联系管理员!')
1372
- } else {
1373
- if (this.deletestate) {
1374
- console.log('mode', this.model)
1375
- let cons = this.model.params
1376
- this.$showMessage('删除后不可恢复,确认删除该批未抄表计划吗?', ['confirm', 'cancel']).then((res) => {
1377
- if (res === 'confirm') {
1378
- this.$resetpost('api/af-revenue/logic/deletePlanAll', {data: cons}).then((res) => {
1379
- this.$dispatch('refresh', '删除计划', cons)
1380
- console.log('ressss:', res)
1381
- this.$showAlert(`共计删除${res.data.index}条记录`, 'success', 2000)
1382
- this.search()
1383
- })
1384
- }
1385
- })
1386
- } else {
1387
- this.$showMessage('为保证误删操作,请先选择抄表单查询条件为未抄表,查询后,再点击删除计划按钮!')
1388
- }
1389
- }
1390
- },
1391
- searchPrint () {
1392
- console.log('mode', this.model)
1393
- let cons = this.model.params
1394
- let data = {
1395
- 'body': {
1396
- 'data': {
1397
- 'condition': ''
1398
- },
1399
- 'field': [],
1400
- 'templateName': '',
1401
- 'sqlName': ''
1402
- },
1403
- 'condition': cons,
1404
- 'sqlname': 'periodAlreadyIssuedOrder'
1405
- }
1406
- this.$resetpost('api/af-revenue/logic/allExportExcel', {data: data}, {resolveMsg: null, rejectMsg: '上传失败'}).then((res) => {
1407
- if (res.data === 'no user') {
1408
- this.$showAlert(`无匹配用户,无法导出对应excel`, 'warning', 2000)
1409
- } else {
1410
- var link = document.createElement('a')
1411
- res.data.forEach((item) => {
1412
- console.log('导出路径', item.filename)
1413
- let path = item.filename
1414
- // 本地
1415
- // let pathName = "http://" + location.host + "/excel" + path.split('excel')[1]
1416
- // 服务器
1417
- let pathName = 'http://' + location.host + '/webapps' + path.split('webapps')[1]
1418
- link.href = pathName
1419
- console.log('=============================', path.split('excel/')[1])
1420
- link.download = path.split('excel/')[1]
1421
- link.dispatchEvent(new MouseEvent('click'))
1422
- })
1423
- }
1424
- })
1425
- },
1426
- selfSearch (args) {
1427
- this.meter_state = args.condition.includes('未下发')
1428
- this.inputtor_change = args.condition.includes('未抄表')
1429
- console.log('=====抄表1====', args.condition.includes('未抄表'))
1430
- console.log('=====抄表1====', this.deletestate)
1431
- if (args.condition.includes('未抄表')) {
1432
- this.deletestate = true
1433
- } else {
1434
- this.deletestate = false
1435
- }
1436
- console.log('=====抄表1====', this.deletestate)
1437
- if (!this.orgCondtionStr) {
1438
- args.condition = `${args.condition}` + ' and f_orgid = ' + this.$login.f.orgid
1439
- } else {
1440
- args.condition = `${args.condition}` + this.orgCondtionStr
1441
- }
1442
-
1443
- // 抄表员查询条件
1444
- this.inputtouPerson = this.$refs.paged.$refs.criteria.model.f_inputtor
1445
- if (this.inputtouPerson.length !== 0) {
1446
- let str = JSON.stringify(this.inputtouPerson)
1447
- str = str.replace(/"/g, `'`)
1448
- str = str.replace(/\[/g, ``)
1449
- str = str.replace(/\]/g, ``)
1450
- console.log('=====抄表员model22222222222绑定====', str)
1451
- // 查询多个抄表员时条件
1452
- args.condition += ` and f_inputtor in ( ${str} )`
1453
- }
1454
- // 小区查询条件
1455
- this.area = this.$refs.paged.$refs.criteria.model.f_residential_area
1456
- console.log('=====小区model绑定====', this.area)
1457
- if (this.area.length !== 0) {
1458
- let str = JSON.stringify(this.area)
1459
- str = str.replace(/"/g, `'`)
1460
- str = str.replace(/\[/g, ``)
1461
- str = str.replace(/\]/g, ``)
1462
- console.log('=====小区model22222222222绑定====', str)
1463
- // 查询多个小区时条件
1464
- args.condition += ` and f_residential_area in ( ${str} )`
1465
- }
1466
-
1467
- if (args.model.f_meter_brand && args.model.f_meter_brand.length > 0) {
1468
- if (args.model.f_meter_brand[0].f_meter_brand) {
1469
- args.condition = `${args.condition} and f_meter_brand = '${args.model.f_meter_brand[0].f_meter_brand}'`
1470
- }
1471
- }
1472
- this.model.params.startDate = this.$refs.paged.$refs.criteria.model.startDate
1473
- this.model.params.endDate = this.$refs.paged.$refs.criteria.model.endDate
1474
- this.condition2 = args.condition
1475
- console.log('selfsearch..', args.condition, this.model)
1476
- this.model.search(args.condition, this.model)
1477
- },
1478
- reflash () {
1479
- this.$refs.paged.$refs.criteria.model.f_orgid = `${Vue.$login.f.orgid}`
1480
- this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStartAndEndDateString()[0]
1481
- this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStartAndEndDateString()[1]
1482
- this.search()
1483
- },
1484
- beforenter (index, row) {
1485
- this.inputid = index + 1
1486
- // 限制本次抄表不能低于上次
1487
- if (row.f_tablebase) {
1488
- if (row.f_tablebase < 0) {
1489
- row.state = '失败'
1490
- Vue.set(row, 'error', '底数不能小于0')
1491
- this.speckText('底数不能小于0,请注意!')
1492
- } else if (this.danhu.f_tablebase.toString().split('.').length > 1 && this.danhu.f_tablebase.toString().split('.')[1].length > 3) {
1493
- row.state = '失败'
1494
- Vue.set(row, 'error', '底数最多只能输入小数点后3位')
1495
- this.speckText('底数最多只能输入小数点后3位,请注意!')
1496
- } else if (row.f_tablebase < row.f_last_tablebase && !row.f_capacity) {
1497
- row.state = '失败'
1498
- Vue.set(row, 'error', '本期表底数不能低于上期表底数')
1499
- this.speckText('本期表底数不能低于上期表底数,请注意!')
1500
- } else {
1501
- if (row.f_tablebase < row.f_last_tablebase) {
1502
- this.$showMessage('本次抄表已超越最大量程, 请熟知!')
1503
- }
1504
- // 抄表结果状态没选默认给正常
1505
- row.f_result_state = row.f_result_state ? row.f_result_state : '正常'
1506
- beforenterGen(this, index, row)
1507
- }
1508
- }
1509
- },
1510
- enter (index, row) {
1511
- console.log('录入数据。..', row)
1512
- let auditFlag = false
1513
- let num = (row.f_tablebase - row.f_last_tablebase)
1514
- let reg = /^\d+,\d+$/
1515
- if (row.f_user_type === '民用' && this.usermlimit) {
1516
- if (!reg.test(this.usermlimit)) {
1517
- this.$showMessage('民用自动审核区间参数设置有误, 请检查!')
1518
- return
1519
- }
1520
- let limit = this.usermlimit.split(',')
1521
- if (!(limit[0] - 0 <= num && num <= limit[1] - 0)) {
1522
- auditFlag = true
1523
- }
1524
- } else if (row.f_user_type === '非民用' && this.userfmlimit) {
1525
- if (!reg.test(this.userfmlimit)) {
1526
- this.$showMessage('非民用自动审核区间参数设置有误, 请检查!')
1527
- return
1528
- }
1529
- let limit = this.userfmlimit.split(',')
1530
- if (!(limit[0] - 0 <= num && num <= limit[1] - 0)) {
1531
- auditFlag = true
1532
- }
1533
- } else if (this.$appdata.getSingleValue('抄表审核') === '启用') {
1534
- auditFlag = true
1535
- }
1536
- if (auditFlag) {
1537
- let f_input_date = Vue.$login.toStandardDateString()
1538
- if (row.f_input_date && row.f_input_date != '') {
1539
- f_input_date = row.f_input_date
1540
- }
1541
- let handplan = {
1542
- id: row.id,
1543
- f_oughtamount: row.f_oughtamount,
1544
- f_adjustment_volume: row.f_adjustment_volume ? row.f_adjustment_volume : 0,
1545
- f_tablebase: row.f_tablebase,
1546
- f_hand_date: row.f_hand_date,
1547
- f_input_date: f_input_date,
1548
- f_input_person: Vue.$login.f.name,
1549
- f_meter_state: '待审核',
1550
- f_meter_source: '手动录入',
1551
-
1552
- f_operator: Vue.$login.f.name,
1553
- f_operatorid: Vue.$login.f.id,
1554
- f_orgid: Vue.$login.f.orgid,
1555
- f_orgname: Vue.$login.f.orgs,
1556
- f_depid: Vue.$login.f.depids,
1557
- f_depname: Vue.$login.f.deps
1558
-
1559
- }
1560
- console.log('抄表负数。。0', handplan)
1561
- this.$resetpost('api/af-revenue/entity/save/t_handplan', handplan, {
1562
- resolveMsg: null,
1563
- rejectMsg: '抄表数据保存出错!!!'
1564
- }).then((res) => {
1565
- row.f_meter_state = '待审核'
1566
- row.f_whether_pay = '否'
1567
- row.f_input_date = res.data.f_input_date
1568
- // this.search()
1569
- }).catch((error) => {
1570
- row.state = '失败'
1571
- Vue.set(row, 'error', JSON.stringify(error))
1572
- this.speckText('抄表录入出错,请注意!')
1573
- })
1574
- } else {
1575
- // 没有启用抄表审核功能
1576
- row.f_input_person = this.$login.f.name
1577
- row.f_inputtor = row.f_inputtor
1578
- row.f_userinfo_id = row.f_userinfo_id + ''
1579
- row.f_userfiles_id = row.f_userfiles_id + ''
1580
- this.pass(row)
1581
- }
1582
- // 在方法结束前添加以下代码
1583
- this.$nextTick(() => {
1584
- // 获取下一行数据并设置为选中状态
1585
- const nextRowIndex = index + 1
1586
- if (nextRowIndex < this.model.rows.length) {
1587
- // 先清除当前选中
1588
- this.$refs.paged.$refs.grid.selectStore.selected = null
1589
- // 设置下一行为选中状态,这样会自动应用 success 样式
1590
- this.$refs.paged.$refs.grid.select(this.model.rows[nextRowIndex])
1591
- }
1592
- })
1593
- },
1594
- pass (row) {
1595
- let param = {
1596
- f_meter_classify: row.f_meter_classify,
1597
- f_meter_brand: row.f_meter_brand,
1598
- f_hand_id: row.id,
1599
- f_operator: Vue.$login.f.name,
1600
- f_tablebase: row.f_tablebase,
1601
- f_userinfo_id: row.f_userinfo_id,
1602
- f_adjustment_volume: row.f_adjustment_volume ? row.f_adjustment_volume : 0
1603
- }
1604
- this.$resetpost('api/af-revenue/logic/sale_commonEnter', {data: param}, {resolveMsg: null, rejectMsg: null, newly: true}).then((res) => {
1605
- row.f_meter_state = res.data.f_meter_state
1606
- row.f_whether_pay = res.data.f_whether_pay
1607
- row.f_oughtfee = res.data.f_oughtfee
1608
- row.f_oughtamount = res.data.f_oughtamount
1609
- // this.$resetpost('api/af-revenue/logic/getMeterSms', {data: param}, {resolveMsg: null, rejectMsg: null}).then((res) => {
1610
- // this.search()
1611
- let f_result_state = '正常'
1612
- if (row.f_result_state && row.f_result_state != '') {
1613
- f_result_state = row.f_result_state
1614
- }
1615
- let f_input_date = ''
1616
- if (row.f_input_date && row.f_input_date != '') {
1617
- f_input_date = ` ,f_input_date = '${row.f_input_date}'`
1618
- }
1619
- let sqldata = `update t_handplan set f_result_state = '${f_result_state}' ${f_input_date} where id = '${row.id}'`
1620
- this.$resetpost('api/af-revenue/logic/runSQL', {data: {sql: sqldata}}, {resolveMsg: null, rejectMsg: '业务单号保存失败', newly: true})
1621
- // }).catch((error) => {
1622
- // row.state = '失败'
1623
- // Vue.set(row, 'error', JSON.stringify(error))
1624
- // this.speckText('抄表出错,请注意!')
1625
- // })
1626
- // this.search()
1627
- }).catch((error) => {
1628
- row.state = '失败'
1629
- Vue.set(row, 'error', JSON.stringify(error))
1630
- this.speckText('抄表出错,请注意!')
1631
- })
1632
- },
1633
- nopass (row) {
1634
- console.log('不通过。。。', row)
1635
- let handplan = {
1636
- id: row.id,
1637
- f_oughtamount: 0,
1638
- f_tablebase: 0,
1639
- f_input_date: null,
1640
- f_meter_state: '未抄表',
1641
- f_meter_source: null
1642
- }
1643
- this.$resetpost('api/af-revenue/entity/save/t_handplan', handplan, {
1644
- resolveMsg: null,
1645
- rejectMsg: '未通过,抄表数据返回未抄表保存出错!!!'
1646
- }).then((res) => {
1647
- row.f_tablebase = null
1648
- row.f_meter_state = '未抄表'
1649
- row.f_whether_pay = '否'
1650
- this.search()
1651
- }).catch((error) => {
1652
- row.state = '失败'
1653
- Vue.set(row, 'error', JSON.stringify(error))
1654
- this.speckText('抄表录入出错,请注意!')
1655
- })
1656
- },
1657
- clearError (row) {
1658
- if (row.f_tablebase === 0) {
1659
- row.f_tablebase = ''
1660
- }
1661
- Vue.set(row, 'error', null)
1662
- },
1663
- async speckText (str) {
1664
- var url = 'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text=' + encodeURI(str)
1665
- await new Audio(url).play()
1666
- this.err = str
1667
- this.showerr = true
1668
- this.paycodefocus()
1669
- },
1670
- closeerr () {
1671
- this.showerr = false
1672
- },
1673
- fileUpload () {
1674
- this.uploadshow = true
1675
- },
1676
- // 删除这条计划
1677
- delectHand (row) {
1678
- this.$showMessage('删除后不可恢复,确认删除吗?', ['confirm', 'cancel']).then((res) => {
1679
- if (res === 'confirm') {
1680
- this.$resetpost('api/af-revenue/logic/deletePlan', {data: row}).then(() => {
1681
- this.$dispatch('refresh', '删除计划', row)
1682
- this.search()
1683
- })
1684
- }
1685
- })
1686
- },
1687
- cancelHand4 (row) {
1688
- this.examinerow = row
1689
- this.examineshow = true
1690
- this.examinetype = true
1691
- },
1692
- cancelHand2 (row) {
1693
- if (this.config.examine) {
1694
- let handdate = new Date(row.f_hand_date)
1695
- console.log('获取月份', handdate.getMonth())
1696
- let ima = new Date()
1697
- console.log('获取月份', ima.getMonth())
1698
- if (handdate.getMonth() == ima.getMonth()) {
1699
- this.cancelHand3(row)
1700
- } else {
1701
- if (!this.$login.r.find(value => value == '抄表隔月冲正')) {
1702
- this.$showMessage('当前登录用户没有隔月冲正权限, 请联系管理员!')
1703
- } else {
1704
- this.cancelHand3(row)
1705
- }
1706
- }
1707
- } else {
1708
- this.cancelHand3(row)
1709
- }
1710
- },
1711
- async cancelHand5 () {
1712
- let sqldata = `update t_handplan set f_audit_state ='已审核',f_audit_person='${this.$login.f.name}',
1713
- f_audit_date='${this.$login.toStandardTimeString()}' where id ='${this.examinerow.id}'`
1714
- await this.$resetpost('api/af-revenue/logic/runSQL', {data: {sql: sqldata}}, {resolveMsg: null, rejectMsg: '更新收费记录订单号失败'})
1715
-
1716
- this.cancelHand3(this.examinerow)
1717
- },
1718
- cancelHand3 (row) {
1719
- // 抄表加入权限
1720
- if (!this.$login.r.find(value => value == '机表抄表冲正')) {
1721
- this.$showMessage('当前登录用户没有冲正权限, 请联系管理员!')
1722
- return
1723
- }
1724
- // console.log('抄表冲正。、。。、', row)
1725
- let param = {
1726
- f_hand_id: row.id,
1727
- operInfo: {
1728
- f_operator: this.$login.f.name,
1729
- f_operatorid: this.$login.f.id,
1730
- f_orgid: this.$login.f.orgid,
1731
- f_orgname: this.$login.f.orgs,
1732
- f_depid: this.$login.f.depids,
1733
- f_depname: this.$login.f.deps
1734
- }
1735
- }
1736
- let url = 'api/af-revenue/logic/sale_commonEnterCancel'
1737
- this.$resetpost(url, {data: param}, {warnMsg: '确定对这条记录进行撤销吗?'}).then(() => {
1738
- this.search()
1739
- this.close()
1740
- })
1741
- },
1742
- down (type, condition, data) {
1743
- co(downGen(type, condition, data, this))
1744
- },
1745
- // 单条下发计划
1746
- downHand (row) {
1747
- console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' + row.f_userfiles_id)
1748
- this.down('single', `f_userfiles_id = '${row.f_userfiles_id}'`, row)
1749
- },
1750
- // 批量下发计划
1751
- batchDownHand () {
1752
- this.down('batch', this.model.condition, this.model.count)
1753
- },
1754
- // batchDownHand () {
1755
- // this.condition = ''
1756
- // let count = 0
1757
- // for (let plan of this.plans){
1758
- // if(plan.state){
1759
- // this.condition = this.condition + plan.id + ','
1760
- // count = count + 1
1761
- // }
1762
- // }
1763
- // this.down('batch', `f_user_id in (${this.condition.substring(0,this.condition.length-1)})`,count)
1764
- // },
1765
- // allDownHand () {
1766
- // this.down('all', this.model.condition, this.model.count)
1767
- // },
1768
-
1769
- validateDate () {
1770
- let currentDown = new Date(this.downModel.downDate)
1771
- console.log(new Date(this.$refs.paged.$refs.criteria.model.startDate))
1772
- console.log(new Date(this.$refs.paged.$refs.criteria.model.endDate))
1773
- return currentDown >= new Date(this.$refs.paged.$refs.criteria.model.startDate + ' 00:00:00') && currentDown <= new Date(this.$refs.paged.$refs.criteria.model.endDate + ' 23:59:59')
1774
- },
1775
-
1776
- async examineconfirm () {
1777
- let sqldata = `update t_handplan set f_audit_state ='审核中',f_examinereason='${this.examinerow.f_examinereason}' where id ='${this.examinerow.id}'`
1778
- await this.$resetpost('api/af-revenue/logic/runSQL', {data: {sql: sqldata}}, {resolveMsg: null, rejectMsg: null})
1779
- this.close()
1780
- this.search()
1781
- },
1782
- // 关闭下发计划得弹出框
1783
- close () {
1784
- this.show = false
1785
- this.inputtor_show = false
1786
- this.downConfirm = false
1787
- this.examineshow = false
1788
- this.examinetype = false
1789
- this.detailsShow = false
1790
- this.priceModel = false
1791
- // 初始化模态框数据
1792
- this.initModal()
1793
- if (this.uploadshow) {
1794
- this.uploadshow = false
1795
- // 讲选的文件清空
1796
- this.$refs.file.$el.querySelector('input').value = ''
1797
- }
1798
- },
1799
- initModal () {
1800
- this.downModel = {
1801
- downDate: Vue.$login.toStandardDateString(),
1802
- downWay: 'downWithUserfiles',
1803
- downInputtor: []
1804
- }
1805
- this.inputtorModel = {
1806
- inputtor: [],
1807
- reason: ''
1808
- }
1809
- },
1810
- // 判断当前登陆人是不是子公司的人员
1811
- isHead () {
1812
- return this.$login.f.parent.parent.name.includes('统一资源管理')
1813
- },
1814
- sort (field, rule) {
1815
- // 将所有排序方式设为不排序,实现相互排斥
1816
- for (let key in this.orderFields) {
1817
- if (key === field) {
1818
- this.orderFields[key] = rule
1819
- } else {
1820
- this.orderFields[key] = 'no'
1821
- }
1822
- }
1823
- // 如果新规则不排序,还原为默认排序
1824
- if (rule === 'no') {
1825
- this.model.paramSource.orderitem = `'${this.orderDefault}'`
1826
- } else {
1827
- this.model.paramSource.orderitem = `'${field} ${rule}'`
1828
- }
1829
- this.search()
1830
- },
1831
- guid () {
1832
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
1833
- let r = Math.random() * 16 | 0,
1834
- v = c == 'x' ? r : (r & 0x3 | 0x8)
1835
- return v.toString(16)
1836
- })
1837
- },
1838
- computeAmount (event) {
1839
- console.log('=============================>', event, this.row)
1840
- let money = event.target.value
1841
- if (this.row.f_price_type === '固定气价') {
1842
- let price = this.$refs.mix_price.model.f_price
1843
- // 可以购买的总气量
1844
- let purchaseSum = (money / price).toFixed(3)
1845
- // 计算应抄底数
1846
- this.should_base = (this.row.f_last_tablebase - 0) + (purchaseSum - 0)
1847
- // 计算公式
1848
- this.designFormulas = `${purchaseSum}X${price}`
1849
- } else {
1850
- let mydata = this.$refs.statir.mydata
1851
- // 剩余1阶气量
1852
- let surplus1 = (mydata.f_stair1ceiling - (mydata.f_hasuse1 > 0 ? mydata.f_hasuse1 : 0))
1853
- // 把1阶买完的钱
1854
- let price1 = surplus1 * mydata.f_stair1price
1855
- // 剩余2阶气量
1856
- let surplus2 = (mydata.f_stair2ceiling - mydata.f_stair1ceiling - (mydata.f_hasuse2 > 0 ? mydata.f_hasuse2 : 0)).toFixed(3)
1857
- // 把2阶买完的钱
1858
- let price2 = surplus2 * mydata.f_stair2price
1859
- // 兼容一下
1860
- if (this.$refs.statir.jt != 3) {
1861
- this.$showMessage('暂不支持该气价类型的运算,请联系开发人员!')
1862
- }
1863
- // 开始计算
1864
- // 可以购买各阶梯量
1865
- let purchase1 = 0
1866
- let purchase2 = 0
1867
- let purchase3 = 0
1868
- if (money <= price1) {
1869
- purchase1 = (money / mydata.f_stair1price).toFixed(3)
1870
- } else if (money <= (price1 + price2)) {
1871
- purchase1 = surplus1
1872
- purchase2 = ((money - price1) / mydata.f_stair2price).toFixed(3)
1873
- } else {
1874
- purchase1 = surplus1
1875
- purchase2 = surplus2
1876
- purchase3 = ((money - price1 - price2) / mydata.f_stair3price).toFixed(3)
1877
- }
1878
- // 可以购买的总气量
1879
- let purchaseSum = (purchase1 - 0) + (purchase2 - 0) + (purchase3 - 0)
1880
- // 计算应抄底数
1881
- this.should_base = (this.row.f_last_tablebase - 0) + purchaseSum
1882
- // 计算公式
1883
- this.designFormulas = `${purchase1}X${mydata.f_stair1price} + ${purchase2}X${mydata.f_stair2price} + ${purchase3}X${mydata.f_stair3price}`
1884
- }
1885
- this.should_base = this.should_base.toFixed(3) - 0
1886
- }
1887
- },
1888
- watch: {
1889
- 'downModel.downWay' (val) {
1890
- if (val === 'downWithSelf') {
1891
- console.log('抄表员。。', this.inputtores2)
1892
- if (this.inputtores2.length > 0) {
1893
- this.downModel.downInputtor = [this.inputtores2[0].value]
1894
- }
1895
- }
1896
- },
1897
- 'detailsShow' (val) {
1898
- if (!val) {
1899
- this.should_base = 0
1900
- this.designFormulas = null
1901
- this.$els.inputmoney.value = 0
1902
- }
1903
- }
1904
- // 'model.rows'(val){
1905
- // console.log('页面切换',val)
1906
- // if(this.isChooseAll(val)){
1907
- // this.all = true
1908
- // }else{
1909
- // this.all = false
1910
- // }
1911
- // },
1912
- },
1913
- computed: {
1914
- danhutitle () {
1915
- return '单户抄表 当前计划年月:' + this.downModel.downDate
1916
- },
1917
- getCondition () {
1918
- // return {condition: `${this.$refs.paged.$refs.cri.condition}` + this.orgCondtionStr}
1919
- return {
1920
- startDate: this.$refs.paged.$refs.criteria.model.startDate,
1921
- endDate: this.$refs.paged.$refs.criteria.model.endDate,
1922
- orderitem: this.orderDefault ? this.orderDefault : 'id',
1923
- condition: this.condition2
1924
- }
1925
- },
1926
-
1927
- inputtores () {
1928
- // 获取抄表员
1929
- console.log('获取抄表员', this.$login.f)
1930
- let rs = []
1931
- if (this.$login.f.f_gasman.length > 0) {
1932
- for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
1933
- let temp = {
1934
- label: this.$login.f.f_gasman[i].name,
1935
- value: this.$login.f.f_gasman[i].name
1936
- }
1937
- rs.push(temp)
1938
- }
1939
- }
1940
- this.inputtores2 = rs
1941
- return [...rs]
1942
- },
1943
- whetherpaies () {
1944
- return [
1945
- {label: '全部', value: ''},
1946
- {label: '已缴费', value: '是'},
1947
- {label: '未缴费', value: '否'}
1948
- ]
1949
- },
1950
- // 界面细节权限
1951
- jurisdiction () {
1952
- console.log('抄表界面细节', this.$login.r)
1953
- return this.$login.r ? this.$login.r : []
1954
- },
1955
- firestates () {
1956
- return [
1957
- {label: '全部', value: ''},
1958
- {label: '已点火', value: '1'},
1959
- {label: '未点火', value: '0'}
1960
- ]
1961
- },
1962
- ischecked () {
1963
- return function (row) {
1964
- for (let plan of this.plans) {
1965
- if (plan.id == row.f_userfiles_id) {
1966
- return plan.state
1967
- }
1968
- }
1969
- }
1970
- }
1971
- },
1972
- events: {
1973
- onFileUpload: async function (file, res) {
1974
- if (this.upshow) {
1975
- let uuid = this.guid()
1976
- let data = {
1977
- model: {
1978
- f_operator: this.$login.f.name,
1979
- f_end_date: this.$login.nextMonth20(this.$login.toStandardTimeString()),
1980
- f_operatorid: this.$login.f.id,
1981
- f_orgid: this.$login.f.orgid,
1982
- f_orgname: this.$login.f.orgs,
1983
- f_depid: this.$login.f.depids,
1984
- f_depname: this.$login.f.deps
1985
- },
1986
- uuid: uuid,
1987
- filepath: res.f_downloadpath
1988
- }
1989
- try {
1990
- await this.HttpReset.load('POST', 'api/af-revenue/logic/batchSettleFileupdate', data, {resolveMsg: null, rejectMsg: null}, 1000)
1991
- } catch (e) {}
1992
- this.$showAlert(`文件上传成功,正在后台批量结算, 请耐心等待结果......`, 'success')
1993
- // 启动定时器定时查询上传结果
1994
- let timer = setInterval(async () => {
1995
- let res = await this.HttpReset.load('POST', 'api/af-revenue/logic/getBatchOperaPro', {data: {uuid: uuid}}, {resolveMsg: null, rejectMsg: null})
1996
- console.log('查询进度返回: ', res)
1997
- if (res.data.msg || res.data.error) {
1998
- res.data.msg ? this.$showAlert(`${res.data.msg}`, 'success', 2000) : this.$showAlert(`${res.data.error}`, 'danger')
1999
- this.upshow = false
2000
- this.search()
2001
- clearInterval(timer)
2002
- }
2003
- }, 5000)
2004
- return
2005
- }
2006
- let data = {
2007
- model: {
2008
- f_operator: this.$login.f.name,
2009
- f_end_date: this.$login.nextMonth20(this.$login.toStandardTimeString())
2010
- },
2011
- filepath: res.path
2012
- }
2013
- if (res.f_downloadpath.includes('抄表数据')) {
2014
- console.log('进入了抄表上传')
2015
- let data1 = {
2016
- filepath: res.f_downloadpath
2017
- }
2018
- this.$resetpost('api/af-revenue/logic/upLoadHand', data1, {resolveMsg: null, rejectMsg: '上传失败'}, 0).then((res) => {
2019
- // console.log('终于成功了', res)
2020
- this.upshow = false
2021
- // this.$showAlert(`一共上传${res.data.total}条数据, 成功${res.data.successnum}条, 未抄下发${res.data.nohandnum}条, 失败下发${res.data.failednum}条, 异常下发${res.data.exceptionnum}条`, 'success', 2000)
2022
- // this.$parent.search()
2023
- })
2024
- } else if (data.filepath.includes('先锋')) {
2025
- this.$resetpost('api/af-revenue/logic/xfimport', data, {resolveMsg: null, rejectMsg: '上传失败'}, 0).then((res) => {
2026
- // console.log('终于成功了', res)
2027
- this.uploadshow = false
2028
- this.$showAlert(`一共上传${res.data.total}条数据, 成功${res.data.successnum}条, 未抄下发${res.data.nohandnum}条, 失败下发${res.data.failednum}条, 异常下发${res.data.exceptionnum}条`, 'success', 2000)
2029
- this.$parent.search()
2030
- })
2031
- } else if (data.filepath.includes('伦力')) {
2032
- this.$resetpost('api/af-revenue/logic/llimport', data, {resolveMsg: null, rejectMsg: '上传失败'}, 0).then((res) => {
2033
- // console.log('终于成功了', res)
2034
- this.uploadshow = false
2035
- this.$showAlert(`一共上传${res.data.total}条数据, 成功${res.data.successnum}条, 未抄下发${res.data.nohandnum}条, 失败下发${res.data.failednum}条, 异常下发${res.data.exceptionnum}条`, 'success', 2000)
2036
- this.$parent.search()
2037
- })
2038
- }
2039
- },
2040
- dblclick: function (row, index) {
2041
- this.row = row
2042
- this.detailsShow = true
2043
- }
2044
- }
2045
- }
2046
- </script>
2047
- <style lang="less">
2048
- #handManager {
2049
- display: flex;
2050
- justify-content: space-around;
2051
- align-items: center;
2052
-
2053
- .btn {
2054
- margin: 0px;
2055
- }
2056
-
2057
- .hand-loading {
2058
- border: 3px solid #ccc;
2059
- border-right-color: #337ab7;
2060
- border-radius: 50%;
2061
- animation: spin 0.6s linear;
2062
- position: absolute;
2063
- animation-iteration-count: infinite;
2064
- top: 0;
2065
- right: 50%;
2066
- z-index: 2;
2067
- display: block;
2068
- width: 28px;
2069
- height: 28px;
2070
- line-height: 28px;
2071
- text-align: center;
2072
- pointer-events: none;
2073
- }
2074
-
2075
- @keyframes spin {
2076
- 100% {
2077
- transform: rotate(360deg);
2078
- }
2079
- }
2080
- .detail-panel {
2081
- text-align: center;
2082
- color: #31708f;
2083
- background-color: #e8f1f9;
2084
- border-color: #F2F6FA;
2085
- }
2086
- }
2087
-
2088
- #hand_manager_grid {
2089
- thead {
2090
- position: relative;
2091
- z-index: 2;
2092
- }
2093
- }
2094
- #machineHandManager {
2095
- .color-red {
2096
- color: red;
2097
- }
2098
- }
2099
- </style>
1
+ <template>
2
+ <div class="flex-row" id="machineHandManager">
3
+ <div class="basic-main">
4
+ <criteria-paged :model="model" v-ref:paged @sort="sort">
5
+ <criteria partial='criteria' v-ref:criteria @condition-changed="$parent.selfSearch">
6
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
+ <modal :show.sync="$parent.$parent.upshow" width="500px" title="文件导入" v-ref:modal large backdrop="false">
8
+ <article slot="modal-body" class="modal-body">
9
+ <file-upload class="my-file-uploader " name="UploadFile" class="btn btn-success"
10
+ style="border-radius: 2px;"
11
+ action="api/af-revenue/file/uploadFile" tagname="导入" v-ref:filebattch :headers="headers"
12
+ multiple></file-upload>
13
+ </article>
14
+ <footer slot="modal-footer" class="modal-footer">
15
+ </footer>
16
+ </modal>
17
+ <div class="row">
18
+ <!--<div class="col-sm-6">-->
19
+ <!--style="border: 1px solid #a6d5ea; box-shadow: darkgrey 1px 1px 1px 2px;padding: 0.5%">-->
20
+ <div class="col-sm-2 form-group">
21
+ <label class="font_normal_body color-red">归属起始</label>
22
+ <datepicker placeholder="开始日期"
23
+ style="width:60%"
24
+ class="datepicker"
25
+ v-model="model.startDate"
26
+ condition="f_hand_date >='{} 00:00:00'"
27
+
28
+ :value.sync="model.startDate"
29
+ :format="'yyyy-MM-dd'"
30
+ ></datepicker>
31
+ </div>
32
+ <div class="col-sm-2 form-group">
33
+ <label class="font_normal_body color-red">归属结束</label>
34
+ <datepicker placeholder="结束日期"
35
+ style="width:60%"
36
+ v-model="model.endDate"
37
+ :value.sync="model.endDate"
38
+ condition="f_hand_date <='{} 23:59:59'"
39
+ :format="'yyyy-MM-dd'"
40
+ ></datepicker>
41
+ </div>
42
+
43
+ <div class="col-sm-2 form-group">
44
+ <label class="font_normal_body">客户编号</label>
45
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_userinfo_code"
46
+ condition="f_userinfo_code='{}'" placeholder='客户编号'>
47
+ </div>
48
+
49
+ <div class="span" style="float:right;">
50
+ <button
51
+ class="button_search button_spacing" style="width:90px" @click="$parent.$parent.danhuShow()">
52
+ 单户抄表
53
+ </button>
54
+
55
+ <button class="button_search button_spacing" @click="$parent.$parent.search()">查询</button>
56
+ <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
57
+ <button class="button_delete button_spacing" @click="$parent.$parent.deletehand()">删除抄表</button>
58
+ <button class="button_search button_spacing" style="width: 90px" @click="$parent.$parent.downloadFiles()">模板下载
59
+ </button>
60
+ <button class="button_search button_spacing" @click="$parent.$parent.clickupshow()">导入抄表</button>
61
+
62
+ <export-excel
63
+ :data="$parent.$parent.getCondition"
64
+ :field="$parent.$parent.getfield"
65
+ sqlurl="api/af-revenue/logic/saleExport" sql-name="getPlan" template-name='抄表导出'
66
+ :choose-col="true">
67
+ </export-excel>
68
+ <div
69
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
70
+ @click="$parent.$parent.hidden()" class="button_spacing" style="float: right"></div>
71
+ </div>
72
+ </div>
73
+ <div class="row" v-show="$parent.$parent.criteriaShow">
74
+ <!-- <div class="col-sm-2 form-group">-->
75
+ <!-- <label class="font_normal_body">表&ensp;编&ensp;号</label>-->
76
+ <!-- <input type="text" style="width:60%" class="input_search" v-model="model.f_user_id"-->
77
+ <!-- condition="f_user_id='{}'" placeholder='表编号'>-->
78
+ <!-- </div>-->
79
+ <div class="col-sm-2 form-group">
80
+ <label class="font_normal_body">抄表状态</label>
81
+ <v-select :value.sync="model.f_audit_state"
82
+ class="select_list select"
83
+ v-model="model.f_audit_state"
84
+ style="width: 60%"
85
+ condition="f_meter_state = '{}'"
86
+ :options='$parent.$parent.auditState' placeholder='抄表状态'
87
+ close-on-select v-el:cc>
88
+ </v-select>
89
+ </div>
90
+ <div class="col-sm-2 form-group">
91
+ <label class="font_normal_body">表&emsp;&emsp;号</label>
92
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_meternumber"
93
+ condition="f_meternumber like '%{}%'" placeholder='表号'>
94
+ </div>
95
+ <div class="col-sm-2 form-group">
96
+ <label class="font_normal_body">客户姓名</label>
97
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_user_name" placeholder='客户姓名'
98
+ condition="f_user_name = '{}'">
99
+ </div>
100
+ <div class="col-sm-2 form-group">
101
+ <label class="font_normal_body">小&ensp;&ensp;&ensp;&ensp;区</label>
102
+ <v-select :value.sync="model.f_residential_area"
103
+ class="select_list select"
104
+ enter-push
105
+ v-model="model.f_residential_area"
106
+ style="width: 60%"
107
+ multiple="true"
108
+ :options='$parent.$parent.residentialArea' placeholder='选择小区'
109
+ close-on-select v-el:cc>
110
+ </v-select>
111
+ </div>
112
+ <div class="col-sm-2 form-group">
113
+ <label class="font_normal_body">楼&emsp;&emsp;栋</label>
114
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_building"
115
+ condition="f_building = '{}'" placeholder='楼栋'>
116
+ </div>
117
+ <div class="col-sm-2 form-group">
118
+ <label class="font_normal_body">单&emsp;&emsp;元</label>
119
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_unit"
120
+ condition="f_unit = '{}'" placeholder='单元'>
121
+ </div>
122
+ <div class="col-sm-2 form-group">
123
+ <label class="font_normal_body">楼&emsp;&emsp;层</label>
124
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_floor"
125
+ condition="f_floor = '{}'" placeholder='楼层'>
126
+ </div>
127
+ <div class="col-sm-2 form-group">
128
+ <label class="font_normal_body">门&ensp;牌&ensp;号</label>
129
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_room"
130
+ condition="f_room like '%{}%'" placeholder='门牌号'>
131
+ </div>
132
+ <div class="col-sm-2 form-group">
133
+ <label class="font_normal_body">客户地址</label>
134
+ <input type="text" style="width:60%" class="input_search" v-model="model.f_address"
135
+ condition="f_address like '%{}%'" placeholder='客户地址'>
136
+ </div>
137
+ <div class="col-sm-2 form-group">
138
+ <label class="font_normal_body">抄&ensp;表&ensp;员</label>
139
+ <v-select :value.sync="model.f_inputtor" v-model='model.f_inputtor'
140
+ style="width:60%"
141
+ multiple="true"
142
+ :options='$parent.$parent.inputtores' placeholder='抄表员'
143
+ close-on-select
144
+ v-el:cc></v-select>
145
+ </div>
146
+ <!-- <div class="col-sm-2 form-group">-->
147
+ <!-- <label class="font_normal_body">是否缴费</label>-->
148
+ <!-- <v-select :value.sync="model.f_whether_pay" v-model='model.f_whether_pay'-->
149
+ <!-- style="width:60%"-->
150
+ <!-- :options='$parent.$parent.whetherpaies' placeholder='是否缴费'-->
151
+ <!-- close-on-select-->
152
+ <!-- condition="f_whether_pay = '{}'"></v-select>-->
153
+ <!-- </div>-->
154
+ <div class="col-sm-2 form-group">
155
+ <label class="font_normal_body">抄表单状态</label>
156
+ <v-select :value.sync="model.f_meter_state" v-model='model.f_meter_state'
157
+ style="width:60%"
158
+ :options='$parent.$parent.meterstates' placeholder='抄表单状态'
159
+ close-on-select
160
+ condition="f_meter_state = '{}'"></v-select>
161
+ </div>
162
+
163
+ <div class="col-sm-2 form-group">
164
+ <label for="belongmonth" class="font_normal_body">所属年月</label>
165
+ <datepicker placeholder="所属年月" style="width:60%"
166
+ v-model="model.belongmonth"
167
+ :value.sync="model.belongmonth"
168
+ :format="'yyyy-MM'"
169
+ :show-reset-button="true"
170
+ condition="belongmonth = '{}'"
171
+ :select-month="true">
172
+ </datepicker>
173
+ </div>
174
+ <div class="col-sm-2 form-group">
175
+ <label class="font_normal_body">客户类型</label>
176
+ <v-select :value.sync="model.f_user_type" v-model="model.f_user_type"
177
+ :options='$parent.$parent.usertypes' placeholder='客户类型'
178
+ style="width:60%"
179
+ close-on-select
180
+ condition="f_user_type = '{}'"></v-select>
181
+ </div>
182
+ <div class="col-sm-2 form-group">
183
+ <label class="font_normal_body">用户等级</label>
184
+ <v-select :value.sync="model.f_user_level" v-model="model.f_user_level"
185
+ :options='$parent.$parent.userlevels' placeholder='用户等级'
186
+ style="width:60%"
187
+ close-on-select
188
+ condition="f_user_level = '{}'"></v-select>
189
+ </div>
190
+ <div class="col-sm-2 form-group">
191
+ <label class="font_normal_body color-red">抄&ensp;表&ensp;册</label>
192
+ <v-select :value.sync="model.f_meter_book" v-model="model.f_meter_book"
193
+ :options='$parent.$parent.meterbooks' placeholder='抄表册'
194
+ :multiple="true"
195
+ style="width:60%"
196
+ condition="f_meter_book_num in {}"></v-select>
197
+ </div>
198
+ <div class="col-sm-2 form-group">
199
+ <label class="font_normal_body">抄表册编号</label>
200
+ <v-select :value.sync="model.f_book_code" v-model="model.f_book_code"
201
+ :options='$parent.$parent.bookcodes' placeholder='抄表册编号'
202
+ style="width:60%"
203
+ :multiple="true"
204
+ condition="f_book_code in {}"></v-select>
205
+ </div>
206
+ <div class="col-sm-2 form-group">
207
+ <label class="font_normal_body">调压箱名</label>
208
+ <v-select :value.sync="model.f_adjustable_name" v-model="model.f_adjustable_name"
209
+ :options='$parent.$parent.adjustablename' placeholder='调压箱名称'
210
+ style="width:60%"
211
+ close-on-select
212
+ condition="f_adjustable_name = '{}'"></v-select>
213
+ </div>
214
+ <div class="col-sm-2 flex-row" style="white-space: nowrap" >
215
+ <label class="font_normal_body">应交气量</label>
216
+ <div class="row">
217
+ <input type="text" style="width:30%" class="input_search" v-model="model.oughtamountmin"
218
+ condition="f_oughtamount >= {} " placeholder="">
219
+ <label class="font_normal_body"> ≤ x ≤ </label>
220
+ <input type="text" style="width:30%" class="input_search" v-model="model.oughtamountmax"
221
+ condition="f_oughtamount <= {} " placeholder="">
222
+ </div>
223
+ </div>
224
+ <res-select-group :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes"
225
+ v-ref:sel></res-select-group>
226
+ </div>
227
+
228
+
229
+ <!-- 多选框 -->
230
+ <!--<div class="col-sm-2 form-group">-->
231
+ <!--<button class="btn btn-success" @click="$parent.$parent.batchDownHand()">计划下发</button>-->
232
+ <!--</div>-->
233
+
234
+ <!--<div class="form-group" v-if="$parent.$parent.meter_state">-->
235
+ <!--<button class="btn btn-success" @click="$parent.$parent.allDownHand()" >全部下发</button>-->
236
+ <!--</div>-->
237
+ <!-- 多选框结束 -->
238
+
239
+ <!--<div class="col-sm-2 form-group">-->
240
+ <!--<button class="btn btn-success" @click="$parent.$parent.adjust()">抄表员调整</button>-->
241
+ <!--</div>-->
242
+ <!--<div class="col-sm-2 form-group">-->
243
+ <!--<button class="btn btn-success" @click="$parent.$parent.fileUpload()">文件上传</button>-->
244
+ <!--</div>-->
245
+ <!--<div class="col-sm-2 form-group">-->
246
+ <!--<button class="btn btn-success" @click="search(), $parent.$parent.clean()">打印</button>-->
247
+ <!--</div>-->
248
+
249
+ </div>
250
+ </criteria>
251
+ <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid id="hand_manager_grid">
252
+ <template partial='head'>
253
+ <tr>
254
+ <!--<th><input type='checkbox' v-model="$parent.$parent.$parent.all" @change="$parent.$parent.$parent.chooseAll"></th>-->
255
+ <th>
256
+ <nobr>序号</nobr>
257
+ </th>
258
+ <th>
259
+ <nobr>
260
+ <data-order field="f_userinfo_code" name="客户编号"
261
+ :order.sync="$parent.$parent.$parent.orderFields.f_userinfo_code"></data-order>
262
+ </nobr>
263
+ </th>
264
+ <!-- <th>-->
265
+ <!-- <nobr>表编号</nobr>-->
266
+ <!-- </th>-->
267
+ <!-- <th>基本信息</th>-->
268
+ <th>
269
+ <nobr>
270
+ <data-order field="f_address" name="基本信息"
271
+ :order.sync="$parent.$parent.$parent.orderFields.f_address"></data-order>
272
+ </nobr>
273
+ </th>
274
+ <th>
275
+ <nobr>用户等级</nobr>
276
+ </th>
277
+ <!--<th><nobr><data-order field="f_building" name="楼号"-->
278
+ <!--:order.sync="$parent.$parent.$parent.orderFields.f_building"></data-order></nobr>-->
279
+ <!--</th>-->
280
+ <!--<th><nobr><data-order field="f_unit" name="单元号"-->
281
+ <!--:order.sync="$parent.$parent.$parent.orderFields.f_unit"></data-order></nobr>-->
282
+ <!--</th>-->
283
+ <!--<th><nobr><data-order field="f_room" name="房号"-->
284
+ <!--:order.sync="$parent.$parent.$parent.orderFields.f_room"></data-order></nobr>-->
285
+ <!--</th>-->
286
+ <th>
287
+ <nobr>所属年月</nobr>
288
+ </th>
289
+ <th>
290
+ <nobr>上期结余</nobr>
291
+ </th>
292
+ <th>
293
+ <nobr>表号</nobr>
294
+ </th>
295
+ <th>
296
+ <nobr>用户电话</nobr>
297
+ </th>
298
+ <th>
299
+ <nobr>上期底数</nobr>
300
+ </th>
301
+ <th>
302
+ <nobr>本期底数</nobr>
303
+ </th>
304
+
305
+
306
+ <th>
307
+ <nobr>应交气量</nobr>
308
+ </th>
309
+ <th>
310
+ <nobr>增量值</nobr>
311
+ </th>
312
+ <th>
313
+ <nobr>应交金额</nobr>
314
+ </th>
315
+ <th>
316
+ <nobr>抄表结果状态</nobr>
317
+ </th>
318
+ <th>
319
+ <nobr>是否缴费</nobr>
320
+ </th>
321
+ <!-- <th>上次抄表日期</th>-->
322
+ <th>
323
+ <nobr>
324
+ <data-order field="f_last_input_date" name="上次抄表录入日期"
325
+ :order.sync="$parent.$parent.$parent.orderFields.f_last_input_date"></data-order>
326
+ </nobr>
327
+ </th>
328
+ <!-- <th>下发日期</th>-->
329
+ <th>
330
+ <nobr>
331
+ <data-order field="f_hand_date" name="下发日期"
332
+ :order.sync="$parent.$parent.$parent.orderFields.f_hand_date"></data-order>
333
+ </nobr>
334
+ </th>
335
+ <!-- <th>抄表日期</th>-->
336
+ <th>
337
+ <nobr>
338
+ <data-order field="f_input_date" name="抄表录入日期"
339
+ :order.sync="$parent.$parent.$parent.orderFields.f_input_date"></data-order>
340
+ </nobr>
341
+ </th>
342
+ <!-- <th>抄表册</th>-->
343
+ <th>
344
+ <nobr>
345
+ <data-order field="f_book_name" name="抄表册"
346
+ :order.sync="$parent.$parent.$parent.orderFields.f_book_name"></data-order>
347
+ </nobr>
348
+
349
+ </th>
350
+ <th>
351
+ <nobr>抄表册编号</nobr>
352
+ </th>
353
+ <th>
354
+ <nobr>册内排序</nobr>
355
+ </th>
356
+ <th>
357
+ <nobr>调压箱名称</nobr>
358
+ </th>
359
+ <th>
360
+ <nobr>抄表员</nobr>
361
+ </th>
362
+ <th>
363
+ <nobr>录入人员</nobr>
364
+ </th>
365
+ <th>
366
+ <nobr>下发人员</nobr>
367
+ </th>
368
+ <th>
369
+ <nobr>备注</nobr>
370
+ </th>
371
+ <th>
372
+ <nobr>操作</nobr>
373
+ </th>
374
+ <!-- f_oughtfee-->
375
+ </tr>
376
+ </template>
377
+ <template partial='body'>
378
+ <!--<td style="text-align: center;">-->
379
+ <!--<input v-if="row.f_meter_state === '未下发'"-->
380
+ <!--:id="model.pageIndex" type='checkbox' @change="$parent.$parent.$parent.chooseOne($event,row,model.rows)"-->
381
+ <!--:checked="$parent.$parent.$parent.ischecked(row)"/>-->
382
+ <!--</td>-->
383
+ <td style="text-align: center;">{{$index + 1}}</td>
384
+ <td>{{row.f_userinfo_code}}</td>
385
+ <td style="text-align: center;">{{row.f_user_name}}&nbsp;&nbsp;{{row.f_address}}</td>
386
+ <td style="text-align: center;">{{row.f_user_level}}</td>
387
+ <!--<td>{{row.f_building}}</td>-->
388
+ <!--<td>{{row.f_unit}}</td>-->
389
+ <!--<td>{{row.f_room}}</td>-->
390
+ <td style="text-align: center;">{{row.belongmonth}}</td>
391
+ <td style="text-align: center;">{{row.f_balance}}</td>
392
+ <td style="text-align: center;">{{row.f_meternumber}}</td>
393
+ <td style="text-align: center;">{{row.f_user_phone}}</td>
394
+ <td style="text-align: center;">{{row.f_last_tablebase}}</td>
395
+ <td id="hand-creat" v-if="row.f_meter_state === '未抄表' " style="text-align: center;">
396
+ <div class="form-group" style="margin-bottom:0px;display: contents;" :class="{
397
+ 'has-success has-feedback': !row.error,
398
+ 'has-error has-feedback': row.error}"
399
+ >
400
+
401
+ <input title="可录入小数点后三位" type="text" class="input_search" v-model="row.f_tablebase"
402
+ @blur="$parent.$parent.$parent.beforenter($index, row)"
403
+ v-next-el="{id: $index+2}" :id="$index+1" style="width: 100px;padding: 6px;"
404
+ @focus="$parent.$parent.$parent.clearError(row)"
405
+ :disabled="row.state === '开始'">
406
+ </div>
407
+
408
+ <span v-if="row.error && row.error !== ''" style="color: #ff0000;">{{row.error}}</span>
409
+ </td>
410
+ <td id="hand-creat" v-if="row.f_meter_state !== '未抄表' " style="text-align: center;">
411
+ {{row.f_tablebase}}
412
+ </td>
413
+ <!--<td style="text-align: center;" v-if="row.f_oughtamount">{{ row.f_oughtamount }}</td>-->
414
+ <td style="text-align: center;">{{$parent.$parent.$parent.calculationBase(row)}}</td>
415
+ <td style="text-align: center;">
416
+ <div class="form-group" style="margin-bottom:0px;display: contents;" :class="{'has-success has-feedback': !row.error,'has-error has-feedback': row.error}"
417
+ v-if="row.f_meter_state === '未抄表' && row.states !== 0 && $parent.$parent.$parent.jurisdiction.includes('增量录入')">
418
+ <input title="底数最多只能输入小数点后3位" type="number" class="input_search" v-model="row.f_adjustment_volume"
419
+ style="width: 100px;padding: 6px;"
420
+ :disabled="row.state === '开始'">
421
+ </div>
422
+ <div v-else>
423
+ {{row.f_adjustment_volume}}
424
+ </div>
425
+ </td>
426
+ <td style="text-align: center;">{{row.f_oughtfee}}</td>
427
+
428
+ <td style="text-align: center;">
429
+ <div class="form-group" style="margin-bottom:0px;display: contents;" :class="{
430
+ 'has-success has-feedback': !row.error,
431
+ 'has-error has-feedback': row.error}"
432
+ v-if="row.f_meter_state === '未抄表' && row.states !== 0">
433
+ <v-select :value.sync="row.f_result_state" v-model="row.f_result_state"
434
+ :options='$parent.$parent.$parent.resultstate' placeholder='抄表结果状态'
435
+ style="margin-right:90px" width="100%"
436
+ :value-single="true"
437
+ close-on-select
438
+ condition="f_adjustable_name = '{}'"></v-select>
439
+ <!-- <span id="inputError2Status" class="sr-only">(error)</span> -->
440
+ </div>
441
+ <div style="text-align: center;" v-else>
442
+ {{row.f_result_state}}
443
+ </div>
444
+ </td>
445
+ <td style="text-align: center;">{{row.f_whether_pay}}</td>
446
+ <td style="text-align: center;">{{row.f_last_input_date}}</td>
447
+ <td style="text-align: center;">{{row.f_hand_date}}</td>
448
+ <td style="text-align: center;">
449
+ <div class="form-group" style="margin-bottom:0px;display: contents;" :class="{
450
+ 'has-success has-feedback': !row.error,
451
+ 'has-error has-feedback': row.error}"
452
+ v-if="row.f_meter_state === '未抄表' && row.states !== 0 && $parent.$parent.$parent.jurisdiction.includes('录入日期修正')">
453
+ <datepicker id="endDate" placeholder="抄表时间"
454
+ v-model="row.f_input_date"
455
+ :value.sync="row.f_input_date"
456
+ :format="'yyyy-MM-dd HH:mm:ss'"
457
+ :show-reset-button="true">
458
+ </datepicker>
459
+ </div>
460
+ <div v-else>
461
+ {{row.f_input_date}}
462
+ </div>
463
+ </td>
464
+ <td style="text-align: center;">{{row.f_book_name}}</td>
465
+ <td style="text-align: center;">{{row.f_book_code}}</td>
466
+ <td style="text-align: center;">{{row.f_meter_book_sort}}</td>
467
+ <td style="text-align: center;">{{row.f_adjustable_name}}</td>
468
+ <td style="text-align: center;">{{row.f_inputtor}}</td>
469
+ <td style="text-align: center;">{{row.f_input_person}}</td>
470
+ <td style="text-align: center;">{{row.f_operator}}</td>
471
+ <td style="text-align: center;">{{row.f_comments}}</td>
472
+ <td style="text-align: center;"><nobr>
473
+ <!-- 已抄表,还没审核-->
474
+ <button type="button" name="button" class="button_search button_spacing width-60"
475
+ v-if="row.f_meter_state === '待审核' && (row.id == row.maxid || !row.maxid)"
476
+ @click.stop="$parent.$parent.$parent.cancelAuditHand(row)">撤销
477
+ </button>
478
+ <!-- 未抄表,删除计划,直接删表内数据-->
479
+ <button type="button" name="button" class="btn btn-danger"
480
+ v-if="row.f_meter_state === '未抄表'"
481
+ @click.stop="$parent.$parent.$parent.delectHand(row) && row.states === 1"
482
+ >删除
483
+ </button>
484
+ <!-- 已抄表,已审核,冲正(状态改为冲正,添加负记录,需要重新下发)-->
485
+ <button type="button" name="button" class="button_search button_spacing width-60"
486
+ @click.stop="$parent.$parent.$parent.cancelHand(row)"
487
+ v-if="row.f_meter_state === '已抄表' && row.maxid==row.id && (row.f_whether_pay === '否' || row.f_accounts_state === '自动下账' || (row.f_whether_pay === '是' && row.f_oughtfee == 0 ))" >冲正
488
+ </button>
489
+
490
+ <!-- <button type="button" name="button" class="btn btn-link"-->
491
+ <!-- v-if="row.f_meter_state === '待审核' ">待审核-->
492
+ <!-- </button>-->
493
+
494
+
495
+ </nobr>
496
+ </td>
497
+ </template>
498
+ </data-grid>
499
+ </criteria-paged>
500
+ <table class="table-hover">
501
+ <tr style="position: relative" class="table-bordered">
502
+ <td
503
+ style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
504
+ 汇总信息
505
+ </td>
506
+ <td
507
+ style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
508
+ 应缴气量:&emsp;{{sumsmodel.f_oughtamount}}
509
+ </td>
510
+ <td
511
+ style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
512
+ 应缴金额:&emsp;{{sumsmodel.f_oughtfee}}
513
+ </td>
514
+ </tr>
515
+ </table>
516
+ <split-price :showdata="splitdata" :pricesplit="priceSplit" v-if="priceSplit"></split-price>
517
+
518
+ <modal :show.sync="danhu.show" :title='danhutitle' backdrop="false" coverstyle="danhumodal">
519
+ <article slot="modal-body" class="modal-body">
520
+ <div class="panel panel-primary datapanel">
521
+ <div class="row">
522
+ <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">客户姓名:{{danhu.info.f_user_name}}</label>
523
+ <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">客户编号:{{danhu.info.f_userinfo_code}}</label>
524
+ <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">用户证号:{{danhu.info.f_book_no}}</label>
525
+ <label class="control-label col-sm-12 flex-row" style="transform: translate(0,8px)">客户地址:{{danhu.info.f_address}}</label>
526
+ <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">上次抄表日期:{{danhu.info.f_hand_date}}</label>
527
+ <label class="control-label col-sm-6 flex-row" style="transform: translate(0,8px)">上期底数:{{danhu.info.f_tablebase}}</label>
528
+ </div>
529
+ </div>
530
+ <div class="panel panel-primary datapanel">
531
+ <div class="row">
532
+ <div class="col-sm-6 flex-row" style="margin-top: 2px">
533
+ <label for="danhucode" class="control-label" style="transform: translate(0,8px)">客户编号</label>
534
+ <input id="danhucode" type="text" class="input_search " style="width: 60% !important;"
535
+ v-model="danhu.f_userinfo_code" v-ref:danhucode @keyup.enter.stop="danhuCodeSearch"
536
+ placeholder='客户编号'/>
537
+ </div>
538
+ <div class="col-sm-6 flex-row" style="margin-top: 2px">
539
+ <label for="danhubase" class="control-label" style="transform: translate(0,8px)">本期底数</label>
540
+ <input id="danhubase" type="number" class="input_search " style="width: 60% !important;"
541
+ v-model="danhu.f_tablebase" @keyup.enter.stop="downAndHand"
542
+ placeholder='本期底数'/>
543
+ </div>
544
+ </div>
545
+ </div>
546
+ </article>
547
+ <footer slot="modal-footer">
548
+ </footer>
549
+ </modal>
550
+
551
+ <modal :show.sync="uploadshow" v-ref:modal backdrop="false">
552
+ <header slot="modal-header" class="modal-header">
553
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
554
+ <h4 class="modal-title">文件上传</h4>
555
+ </header>
556
+ <article slot="modal-body" class="modal-body">
557
+ <div class="col-sm-2 form-group">
558
+ <file-upload class="my-file-uploader" name="myFile"
559
+ action="api/af-revenue/file/uploadFile" tagname="文件上传" :headers="headers" multiple v-ref:file></file-upload>
560
+ </div>
561
+ </article>
562
+
563
+ <footer slot="modal-footer" class="modal-footer">
564
+ <!-- <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
565
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button> -->
566
+ </footer>
567
+ </modal>
568
+ <modal :show.sync="examineshow" v-ref:modal backdrop="false">
569
+ <header slot="modal-header" class="modal-header">
570
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
571
+ <h4 class="modal-title">冲正审核</h4>
572
+ </header>
573
+ <article slot="modal-body" class="modal-body">
574
+ <div class="row">
575
+ <div class="col-sm-12 form-group">
576
+ <label class="font_normal_body">冲正原因</label>
577
+ <input type="text" style="width:90%" class="input_search" :disabled="examinetype"
578
+ v-model="examinerow.f_examinereason"
579
+ placeholder='冲正原因'>
580
+ </div>
581
+ <upload :blodid="examinerow.id" v-ref:upload :fusetype="uploadText" isremark="true"
582
+ style="width:auto"></upload>
583
+ </div>
584
+
585
+ </article>
586
+
587
+ <footer slot="modal-footer" class="modal-footer">
588
+ <button v-show="examineshow" type="button" class="btn btn-default" @click='close'>取消</button>
589
+ <button v-show="!examinetype" type="button" class="btn btn-success" @click='examineconfirm()'>确认</button>
590
+ <button type="button" v-show="examinetype" class="btn btn-success" @click='cancelHand5()'>审核通过</button>
591
+ </footer>
592
+ </modal>
593
+
594
+ <modal :show.sync="showerr" backdrop="false">
595
+ <header slot="modal-header" class="modal-header">
596
+ <button type="button" class="close" @click="closeerr"><span>&times;</span></button>
597
+ <h4 class="modal-title">抄表出错!</h4>
598
+ </header>
599
+ <article slot="modal-body" class="modal-body">
600
+ <div class="row">
601
+ <p> {{err}}</p>
602
+ <input type="text" class="form-control" @blur="paycodefocus" v-el:paycode>
603
+ </div>
604
+
605
+ </article>
606
+
607
+ <footer slot="modal-footer" class="modal-footer">
608
+ <button v-show="showerr" type="button" class="btn btn-default" @click='closeerr'>关闭</button>
609
+ </footer>
610
+ </modal>
611
+
612
+ <modal :show.sync="detailsShow" v-ref:model_details backdrop="true" width="700px">
613
+ <article slot="modal-body" class="modal-body">
614
+ <div class="flex-row">
615
+ <div style="width: 50%">
616
+ <mix-price-info :data="row" v-if="row.f_price_type === '固定气价'" v-ref:mix_price></mix-price-info>
617
+ <stairinfo :data="row" v-if="row.f_price_type === '阶梯气价'" v-ref:statir></stairinfo>
618
+ </div>
619
+ <div style="width: 50%" class="panel">
620
+ <div class="panel-heading detail-panel">
621
+ <h4>计算工具</h4>
622
+ </div>
623
+ <form class="form-horizontal" style="padding: 10px">
624
+ <div class="form-group">
625
+ <label class="col-sm-4 col-md-4 control-label" style="text-align: left">预购金额:</label>
626
+ <div class="col-sm-8 col-md-8">
627
+ <input type="number" class="form-control" placeholder="预购金额" @blur="computeAmount" v-el:inputmoney>
628
+ </div>
629
+ </div>
630
+ <div class="form-group">
631
+ <label class="col-sm-4 col-md-4 control-label" style="text-align: left">当前底数:</label>
632
+ <div class="col-sm-8 col-md-8">
633
+ <input type="number" class="form-control" placeholder="当前底数" v-model="row.f_last_tablebase" disabled>
634
+ </div>
635
+ </div>
636
+ <div class="form-group">
637
+ <label class="col-sm-4 col-md-4 control-label" style="text-align: left">应抄底数:</label>
638
+ <div class="col-sm-8 col-md-8">
639
+ <input type="number" class="form-control" placeholder="应抄底数" v-model="should_base" disabled>
640
+ </div>
641
+ </div>
642
+ <div class="form-group">
643
+ <label class="col-sm-12 col-md-12 control-label" style="text-align: center">计算公式</label>
644
+ <div class="col-sm-12 col-md-12">
645
+ <input type="text" class="form-control" placeholder="计算公式" v-model="designFormulas" disabled>
646
+ </div>
647
+ </div>
648
+ </form>
649
+ </div>
650
+ </div>
651
+ </article>
652
+ <footer slot="modal-footer" class="modal-footer">
653
+ <button type="button" class="button_search button_spacing" @click='customPricing()'>自定义划价</button>
654
+ </footer>
655
+ </modal>
656
+
657
+ <modal :show.sync="priceModel" v-ref:modal backdrop="false">
658
+ <header slot="modal-header" class="modal-header">
659
+ <h4 class="modal-title">自定义划价</h4>
660
+ </header>
661
+ <article slot="modal-body" class="modal-body">
662
+ <div>
663
+ <mix-price-info :data="row" v-if="row.f_price_type === '固定气价'" v-ref:mix_price></mix-price-info>
664
+ <stairinfo :data="row" v-if="row.f_price_type === '阶梯气价'" v-ref:statir></stairinfo>
665
+ </div>
666
+ <div class="row">
667
+ <template v-if="row.f_price_type === '固定气价'">
668
+ <div class="col-sm-4 form-group">
669
+ <label class="font_normal_body">单价</label>
670
+ <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_price1" placeholder='单价'></input>
671
+ </div>
672
+ <div class="col-sm-4 form-group">
673
+ <label class="font_normal_body">数量</label>
674
+ <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_gas1" placeholder='数量'></input>
675
+ </div>
676
+ <div class="col-sm-4 form-group">
677
+ <label class="font_normal_body">金额</label>
678
+ <p class="form-control" style="width:60%" disabled>{{ row.f_stair_money1 = stairMoney(row.f_stair_price1, row.f_stair_gas1) }}</p>
679
+ </div>
680
+ </template>
681
+
682
+ <template v-if="row.f_price_type === '阶梯气价'">
683
+ <div class="col-sm-4 form-group" >
684
+ <label class="font_normal_body">阶梯一单价</label>
685
+ <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_price1" placeholder='阶梯一单价'></input>
686
+ </div>
687
+ <div class="col-sm-4 form-group">
688
+ <label class="font_normal_body">阶梯一数量</label>
689
+ <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_gas1" placeholder='阶梯一数量'></input>
690
+ </div>
691
+ <div class="col-sm-4 form-group">
692
+ <label class="font_normal_body">阶梯一金额</label>
693
+ <p class="form-control" style="width:60%" disabled>{{ row.f_stair_money1 = stairMoney(row.f_stair_price1, row.f_stair_gas1) }}</p>
694
+ </div>
695
+ <div class="col-sm-4 form-group" >
696
+ <label class="font_normal_body">阶梯二单价</label>
697
+ <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_price2" placeholder='阶梯二单价'></input>
698
+ </div>
699
+ <div class="col-sm-4 form-group">
700
+ <label class="font_normal_body">阶梯二数量</label>
701
+ <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_gas2" placeholder='阶梯二数量'></input>
702
+ </div>
703
+ <div class="col-sm-4 form-group">
704
+ <label class="font_normal_body">阶梯二金额</label>
705
+ <p class="form-control" style="width:60%" disabled>{{ row.f_stair_money2 = stairMoney(row.f_stair_price2, row.f_stair_gas2) }}</p>
706
+ </div>
707
+ <div class="col-sm-4 form-group" >
708
+ <label class="font_normal_body">阶梯三单价</label>
709
+ <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_price3" placeholder='阶梯三单价'></input>
710
+ </div>
711
+ <div class="col-sm-4 form-group">
712
+ <label class="font_normal_body">阶梯三数量</label>
713
+ <input type="text" class="form-control" style="width:60%" v-model="row.f_stair_gas3" placeholder='阶梯三数量'></input>
714
+ </div>
715
+ <div class="col-sm-4 form-group">
716
+ <label class="font_normal_body">阶梯三金额</label>
717
+ <p class="form-control" style="width:60%" disabled>{{ row.f_stair_money3 = stairMoney(row.f_stair_price3, row.f_stair_gas3) }}</p>
718
+ </div>
719
+ </template>
720
+ <div class="col-sm-4 form-group" >
721
+ </div>
722
+ <div class="col-sm-4 form-group">
723
+ <label class="font_normal_body">总用气量</label>
724
+ <p class="form-control" style="width:60%" disabled>{{ ((row.f_stair_gas1 - 0)+(row.f_stair_gas2 - 0)+(row.f_stair_gas3 - 0)).toFixed(3) }}</p>
725
+ </div>
726
+ <div class="col-sm-4 form-group">
727
+ <label class="font_normal_body">总用气金额</label>
728
+ <p class="form-control" style="width:60%" disabled>{{ ((row.f_stair_money1 - 0)+(row.f_stair_money2 - 0)+(row.f_stair_money3 - 0)).toFixed(3) }}</p>
729
+ </div>
730
+ <p style="color: red">注意: 自定义气量总量必须等于本次抄表用气量, 本次抄表总量: {{row.f_oughtamount}}</p>
731
+ </div>
732
+ </article>
733
+ <footer slot="modal-footer" class="modal-footer">
734
+ <button type="button" class="button_clear button_spacing" @click="close()">取消</button>
735
+ <button type="button" class="button_search button_spacing" @click='customPricingConfirm()'>确认</button>
736
+ </footer>
737
+ </modal>
738
+ </div>
739
+ </div>
740
+ </template>
741
+ <script>
742
+ import MixPriceInfo from '../../components/revenue/base/leftview/MixPriceInfo'
743
+ import {PagedList, HttpResetClass} from 'vue-client'
744
+ import Vue from 'vue'
745
+ import co from 'co'
746
+
747
+ let readyGen = async function (self) {
748
+ await self.$getConfig(self, 'HandManager')
749
+ await self.$LoadParams.loadMeterBook(self.f_filialeid)
750
+ self.loadMeterBooks()
751
+ self.loadBookCodes()
752
+ self.getfield = self.config.excelHeaders
753
+ self.sumsmodel = self.$refs.paged.$refs.grid.model.sums
754
+ self.reflash()
755
+ }
756
+
757
+ let downGen = function* (type, condition, data, self) {
758
+ // if(data == 0 ) {
759
+ // self.$showAlert('下发计划户数为0!请选择需要下发的计划!!', 'danger', 0)
760
+ // return
761
+ // }
762
+ self.condition = condition
763
+ self.msg = '确认下发计划'
764
+ // 判断之前是否有未抄表数据
765
+ let getUnhand = null
766
+ // let getUnhand = yield Vue.resetpost('api/af-revenue/sql/getUnhand', {data: {startDate: self.startDate, condition: self.condition}}, {resolveMsg: null, rejectMsg: '获取未抄表数据异常!!'})
767
+ // if (type === 'batch' || type === 'single') {
768
+ if (type === 'single') {
769
+ getUnhand = yield Vue.resetpost('api/af-revenue/sql/getUnhand', {
770
+ data: {
771
+ startDate: self.model.params.startDate,
772
+ condition: condition
773
+ }
774
+ }, {resolveMsg: null, rejectMsg: '获取未抄表数据异常!!'})
775
+ self.msg = `下发客户编号为${data.f_userinfo_code}的抄表计划?`
776
+ // } else if (type === 'all') {
777
+ } else if (type === 'batch') {
778
+ let tempCondition = condition.replace("and f_meter_state = '未下发'", '')
779
+ getUnhand = yield Vue.resetpost('api/af-revenue/sql/getUnhand', {
780
+ data: {
781
+ startDate: self.model.params.startDate,
782
+ condition: tempCondition
783
+ }
784
+ }, {resolveMsg: null, rejectMsg: '获取未抄表数据异常!!'})
785
+ self.msg = `确认下发当前总计: ${data} 户计划`
786
+ }
787
+ for (let i = 0; i < getUnhand.data.length; i++) {
788
+ let temp = {
789
+ id: getUnhand.data[i].id,
790
+ f_user_id: getUnhand.data[i].f_user_id,
791
+ f_userfiles_id: getUnhand.data[i].f_userfiles_id,
792
+ f_adjustable_id: getUnhand.data[i].f_adjustable_id,
793
+ f_adjustable_name: getUnhand.data[i].f_adjustable_name
794
+ }
795
+ console.log('=================================================================================')
796
+ console.log('下发计划查看调压箱和调压箱编号', temp)
797
+ console.log('========================================================================================')
798
+ self.unhandplan.push(temp)
799
+ }
800
+ if (getUnhand.data.length > 0) {
801
+ self.msg = self.msg + `, 警告: 之前有 ${getUnhand.data.length} 条未抄表数据`
802
+ }
803
+ self.show = true
804
+ }
805
+
806
+ let beforenterGen = async function (self, index, row) {
807
+ // 验证是不是总表
808
+ // self.enter(index, row)
809
+ if (row.f_totalsplit_type === '总表') {
810
+ let hasUnHand = await self.$HandService.getSplitInfo(row.f_userfiles_id)
811
+ if (hasUnHand) {
812
+ self.$showAlert('该表下面有未抄或未审核的分表信息!!请先抄录或审核分表信息!', 'danger', 0)
813
+ row.f_tablebase = null
814
+ } else {
815
+ self.enter(index, row)
816
+ }
817
+ } else {
818
+ self.enter(index, row)
819
+ }
820
+ }
821
+
822
+ export default {
823
+ title: '机表抄表',
824
+ components: { MixPriceInfo },
825
+ data () {
826
+ return {
827
+ priceModel: false,
828
+ initres: {
829
+ org: [this.$login.f.orgid],
830
+ dep: [],
831
+ user: []
832
+ },
833
+ sumsmodel: [],
834
+ orgCondtionStr: '',
835
+ priceSplit: false,
836
+ deletestate: false,
837
+ criteriaShow: false,
838
+ model: new PagedList('api/af-revenue/sql/getPlan', 50, {orderitem: this.orderDefault ? '"' + this.orderDefault + ' "' : `'f_hand_date desc'`}, {
839
+ f_oughtamount: 0,
840
+ f_oughtfee: 0
841
+ }),
842
+ config: {
843
+
844
+ // 导出列要和查询列相同
845
+ excelHeaders: {
846
+ 'f_user_id': '表编号',
847
+ 'f_meternumber': '表号',
848
+ 'f_inputtor': '抄表员',
849
+ 'f_balance': '上期结余',
850
+ 'f_last_input_date': '上次抄表',
851
+ 'f_hand_date': '下发时间',
852
+ 'f_input_date': '抄表日期',
853
+ 'f_userinfo_code': '客户编号',
854
+ 'f_address': '客户地址',
855
+ 'f_residential_area': '小区名称',
856
+ 'f_user_name': '客户姓名',
857
+ 'f_last_tablebase': '上期底数',
858
+ 'f_tablebase': '本期指数',
859
+ 'f_oughtfee': '应交金额',
860
+ 'f_oughtamount': '应交气量',
861
+ 'f_whether_pay': '是否缴费',
862
+ 'f_book_name': '抄表册',
863
+ 'f_book_code': '抄表册编号',
864
+ 'f_meter_book_sort': '册内排序',
865
+ 'f_input_person': '录入人员',
866
+ 'f_operator': '下发人员',
867
+ 'f_meter_classify': '气表分类',
868
+ 'f_meter_style': '气表型号',
869
+ 'f_accounts_state': '下账标识',
870
+ 'f_user_phone': '客户电话',
871
+ 'f_adjustable_id': '表箱号',
872
+ 'f_comments': '备注'
873
+ },
874
+ examine: true,
875
+ customCal: false
876
+ },
877
+ meter_state: false, // 是否显示计划下发按钮
878
+ downModel: {
879
+ downDate: Vue.$login.toStandardTimeString(),
880
+ downWay: 'downWithUserfiles',
881
+ downInputtor: []
882
+ },
883
+ inputtorModel: {
884
+ inputtor: [],
885
+ reason: ''
886
+ },
887
+ auditState: [{label: '全部', value: ''}, {label: '未抄表', value: '未抄表'}, {label: '待审核', value: '待审核'}, {label: '已抄表', value: '已抄表'}],
888
+
889
+ plans: [], // 记录当前行是否被勾选
890
+ all: false, // 是否全选
891
+ show: false, // 下发日期模态框显示
892
+ unhandplan: [], // 之前是否有未抄表记录
893
+ downConfirm: false, // 下发若有未抄记录,确认框
894
+ uploadshow: false,
895
+ // 小区
896
+ residentialArea: [],
897
+
898
+ // downDate: this.$login.toStandardYearMonth().replace("-", ""),
899
+ msg: '',
900
+ condition: '',
901
+ headers: {'username': Vue.$login.f.name, 'blodid': Vue.$login.guid()},
902
+ orderDefault: 'f_hand_date',
903
+ orderFields: {
904
+ f_userinfo_id: 'no'
905
+ },
906
+ getfield: {},
907
+ outlet: '',
908
+ filiale: '',
909
+ condition2: '',
910
+ area: [],
911
+ inputtouPerson: [],
912
+ meters: [{label: '全部', value: ''}, {label: '机表', value: '机表'}, {label: '物联网表', value: '物联网表'}],
913
+ resultstate: this.$appdata.getParam('抄表结果状态'),
914
+ meterstates: this.$appdata.getParam('抄表状态') ? [{
915
+ label: '全部',
916
+ value: ''
917
+ }, ...this.$appdata.getParam('抄表状态')] : [],
918
+ usertypes: this.$appdata.getParam('客户类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('客户类型')] : [],
919
+ userlevels: this.$appdata.getParam('用户等级') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用户等级')] : [],
920
+ adjustablename: this.$appdata.getParam('调压箱名称') ? [{
921
+ label: '全部',
922
+ value: ''
923
+ }, ...this.$appdata.getParam('调压箱名称')] : [],
924
+ inputtores2: [], // 下发时使用自定义抄表员,
925
+ splitdata: '',
926
+ f_filialeid: this.$login.f.orgid,
927
+ meterbooks: [],
928
+ bookcodes: [],
929
+ upshow: false,
930
+ inputid: 0,
931
+ examineshow: false,
932
+ examinerow: null,
933
+ showfiles: false,
934
+ uploadText: '抄表',
935
+ examinetype: false,
936
+ danhu: {
937
+ show: false,
938
+ f_userinfo_code: '',
939
+ f_tablebase: '',
940
+ info: {}
941
+ },
942
+ showerr: false,
943
+ err: '',
944
+ // 请求对象(批量导入,查询进度使用)
945
+ HttpReset: new HttpResetClass(),
946
+ // 气价使用详情展示
947
+ detailsShow: false,
948
+ row: null,
949
+ // 应抄底数
950
+ should_base: 0,
951
+ // 计算公式
952
+ designFormulas: null,
953
+ usermlimit: this.$appdata.getSingleValue('民用自动审核区间'),
954
+ userfmlimit: this.$appdata.getSingleValue('非民用自动审核区间')
955
+ }
956
+ },
957
+ ready () {
958
+ this.getaddress()
959
+ readyGen(this)
960
+ },
961
+ mounted () {
962
+ console.log(this.inputid)
963
+ document.getElementById(this.inputid).focus()
964
+ },
965
+ methods: {
966
+ stairMoney (price, gas) {
967
+ return (price * gas).toFixed(3) - 0
968
+ },
969
+ async customPricingConfirm () {
970
+ let sumGas = (this.row.f_stair_gas1 - 0) + (this.row.f_stair_gas2 - 0) + (this.row.f_stair_gas3 - 0)
971
+ if (sumGas !== (this.row.f_oughtamount - 0)) {
972
+ this.$showMessage('自定义划价总气量不符, 请检查')
973
+ return
974
+ }
975
+ let row = {
976
+ id: this.row.id,
977
+ f_oughtfee: ((this.row.f_stair_money1 - 0) + (this.row.f_stair_money2 - 0) + (this.row.f_stair_money3 - 0)).toFixed(3),
978
+ f_stair_price1: this.row.f_stair_price1,
979
+ f_stair_gas1: this.row.f_stair_gas1,
980
+ f_stair_money1: this.row.f_stair_money1,
981
+ f_stair_price2: this.row.f_stair_price2,
982
+ f_stair_gas2: this.row.f_stair_gas2,
983
+ f_stair_money2: this.row.f_stair_money2,
984
+ f_stair_price3: this.row.f_stair_price3,
985
+ f_stair_gas3: this.row.f_stair_gas3,
986
+ f_stair_money3: this.row.f_stair_money3
987
+ }
988
+ await this.$resetpost('api/af-revenue/logic/customPricing', {data: row}, {resolveMsg: '保存成功', rejectMsg: '保存失败'}).then(res => {
989
+ this.close()
990
+ this.search()
991
+ })
992
+ },
993
+ customPricing () {
994
+ if (!this.$login.r.find(value => value == '抄表自定义划价')) {
995
+ this.$showMessage('当前登录用户没有【抄表自定义划价】权限, 请联系管理员!')
996
+ return
997
+ }
998
+ if (this.row.f_meter_state !== '已抄表') {
999
+ this.$showMessage('当前抄表单不是已抄表状态,无法进行自定义划价!')
1000
+ return
1001
+ }
1002
+ if (this.row.f_whether_pay !== '否') {
1003
+ this.$showMessage('当前抄表单已经缴费,无法进行自定义划价!')
1004
+ return
1005
+ }
1006
+ this.detailsShow = false
1007
+ this.priceModel = true
1008
+ },
1009
+ downloadFiles () {
1010
+ let downurl = 'api/af-revenue/downloadfile/file?filename=机表抄表导入Excel模板'
1011
+ this.$downFile(downurl,'机表抄表导入Excel模板.xlsx')
1012
+ },
1013
+ calculationBase (row) {
1014
+ let oughtamount = null
1015
+ if (row.f_tablebase) {
1016
+ if (row.f_share_gas) {
1017
+ oughtamount = (row.f_tablebase - 0 - (row.f_last_tablebase - 0)).toFixed(4) + (row.f_share_gas > 0 ? '+' : '') + row.f_share_gas.toFixed(3)
1018
+ } else {
1019
+ if (row.f_capacity && row.f_capacity > 0 && row.f_tablebase < row.f_last_tablebase) {
1020
+ oughtamount = (row.f_tablebase - 0 + (row.f_capacity - row.f_last_tablebase)).toFixed(3)
1021
+ } else {
1022
+ oughtamount = (row.f_tablebase - 0 - (row.f_last_tablebase - 0)).toFixed(3)
1023
+ }
1024
+ }
1025
+ } else {
1026
+ oughtamount = 0
1027
+ }
1028
+ row.f_oughtamount = oughtamount
1029
+ return oughtamount
1030
+ },
1031
+ cancelHand (row) {
1032
+ if (this.config.examine) {
1033
+ let handdate = new Date(row.f_hand_date)
1034
+ let ima = new Date()
1035
+ if (handdate.getMonth() == ima.getMonth()) {
1036
+ this.cancelHand3(row)
1037
+ } else {
1038
+ if (!this.$login.r.find(value => value == '抄表隔月冲正')) {
1039
+ this.$showMessage('当前登录用户没有【抄表隔月冲正】权限, 请联系管理员!')
1040
+ } else {
1041
+ this.cancelHand3(row)
1042
+ }
1043
+ }
1044
+ } else {
1045
+ this.cancelHand3(row)
1046
+ }
1047
+ },
1048
+
1049
+ cancelHand3 (row) {
1050
+ // 抄表加入权限
1051
+ if (!this.$login.r.find(value => value == '机表抄表冲正')) {
1052
+ this.$showMessage('当前登录用户没有冲正权限, 请联系管理员!')
1053
+ return
1054
+ }
1055
+ // console.log('抄表冲正。、。。、', row)
1056
+ let param = {
1057
+ f_hand_id: row.id,
1058
+ operInfo: {
1059
+ f_operator: this.$login.f.name,
1060
+ f_operatorid: this.$login.f.id,
1061
+ f_orgid: this.$login.f.orgid,
1062
+ f_orgname: this.$login.f.orgs,
1063
+ f_depid: this.$login.f.depids,
1064
+ f_depname: this.$login.f.deps
1065
+ }
1066
+ }
1067
+ let url = 'api/af-revenue/logic/sale_commonEnterCancel'
1068
+ this.$resetpost(url, {data: param}, {warnMsg: '确定对这条记录进行撤销吗?'}).then(() => {
1069
+ this.search()
1070
+ this.close()
1071
+ })
1072
+ },
1073
+ cancelAuditHand (row) {
1074
+ console.log('撤回本次录入。。。', row)
1075
+ let handplan = {
1076
+ id: row.id,
1077
+ f_oughtamount: 0,
1078
+ f_tablebase: 0,
1079
+ f_input_date: null,
1080
+ f_meter_state: '未抄表',
1081
+ f_meter_source: null
1082
+ }
1083
+ this.$resetpost('api/af-revenue/entity/save/t_handplan', handplan, {
1084
+ resolveMsg: null,
1085
+ rejectMsg: '撤回失败'
1086
+ }).then((res) => {
1087
+ this.search()
1088
+ })
1089
+ },
1090
+ async danhuCodeSearch () {
1091
+ this.danhu.f_userinfo_code = this.danhu.f_userinfo_code.replace(/(^\s*)|(\s*$)/g, '')
1092
+ await this.$resetpost('api/af-revenue/sql/getInfoOfDanhu', {
1093
+ data: {
1094
+ f_userinfo_code: this.danhu.f_userinfo_code,
1095
+ f_orgid: this.f_filialeid
1096
+ }
1097
+ },
1098
+ {resolveMsg: null, rejectMsg: '查询用户信息失败,网络错误'}).then(res => {
1099
+ if (res.data.length !== 1) {
1100
+ this.$showAlert(res.data.length === 0 ? '没有查询到用户' : '查询到多条用户信息', 'warning', 3000)
1101
+ return
1102
+ }
1103
+ if (res.data[0].f_meter_state === '待审核') {
1104
+ this.$showAlert('用户有待审核的记录', 'warning', 3000)
1105
+ return
1106
+ }
1107
+ if (res.data[0].f_whether_pay === '否') {
1108
+ this.$showAlert('用户有未缴费的抄表记录', 'warning', 3000)
1109
+ }
1110
+ this.danhu.info = res.data[0]
1111
+ // = Object.assign(this.danhu,{info:res.data[0]})
1112
+ document.getElementById('danhubase').focus()
1113
+ })
1114
+ },
1115
+ // 单户抄表 下发计划并抄表
1116
+ async downAndHand () {
1117
+ if (!this.danhu.info.f_userinfo_code || this.danhu.info.f_userinfo_code === '') {
1118
+ this.$showAlert(`请先查询用户信息`, 'warning', 2000)
1119
+ return
1120
+ }
1121
+
1122
+ if (this.danhu.f_tablebase < 0) {
1123
+ this.$showAlert(`底数不能小于0,请注意!`, 'warning', 2000)
1124
+ return
1125
+ } else if (this.danhu.f_tablebase.toString().split('.').length > 1 && this.danhu.f_tablebase.toString().split('.')[1].length > 3) {
1126
+ this.$showAlert(`底数最多只能输入小数点后3位,请注意!`, 'warning', 2000)
1127
+ return
1128
+ } else if (this.danhu.f_tablebase < this.danhu.info.f_tablebase && !this.danhu.info.f_capacity) {
1129
+ this.$showAlert(`本期表底数不能低于上期表底数`, 'warning', 2000)
1130
+ return
1131
+ } else {
1132
+ if (this.danhu.f_tablebase < this.danhu.info.f_tablebase) {
1133
+ this.$showMessage('本次抄表已超越最大量程, 请熟知!')
1134
+ }
1135
+ }
1136
+ let param = {
1137
+ downDate: this.downModel.downDate,
1138
+ startDate: this.model.params.startDate,
1139
+ endDate: this.model.params.endDate,
1140
+ condition: ` f_userfiles_id = '${this.danhu.info.f_userfiles_id}' `,
1141
+ f_operator: this.$login.f.name,
1142
+ f_operatorid: this.$login.f.id,
1143
+ danhu: true,
1144
+ userfilesid: this.danhu.info.f_userfiles_id
1145
+ }
1146
+ console.log('下发参数:', param)
1147
+ this.$resetpost('api/af-revenue/logic/downHand', {data: param}, {resolveMsg: null, rejectMsg: '下发失败,请检查该用户是否在该归属期内已有抄表记录'}).then((res) => {
1148
+ console.log('下发计划成功', res)
1149
+ this.$resetpost('/api/af-revenue/sql/querySingleTable', {
1150
+ data: {
1151
+ items: 'max(id) id',
1152
+ tablename: 't_handplan',
1153
+ condition: ` f_userfiles_id = '${this.danhu.info.f_userfiles_id}' `
1154
+ }
1155
+ }, {resolveMsg: null, rejectMsg: '查询抄表信息失败'}).then((res2) => {
1156
+ let handParam = {
1157
+ f_meter_classify: this.danhu.info.f_meter_classify,
1158
+ f_meter_brand: this.danhu.info.f_meter_brand,
1159
+ f_hand_id: res2.data[0].id,
1160
+ f_tablebase: this.danhu.f_tablebase,
1161
+ f_userinfo_id: this.danhu.info.f_userinfo_id
1162
+ }
1163
+ this.$resetpost('api/af-revenue/logic/sale_commonEnter', {data: handParam}, {
1164
+ resolveMsg: null,
1165
+ rejectMsg: null
1166
+ })
1167
+ }).then((res) => {
1168
+ this.$showAlert(`单户抄表成功!`, 'success', 2000)
1169
+ this.danhuShow()
1170
+ }).catch((error) => {
1171
+ this.danhu.show = false
1172
+ this.$showAlert(`单户抄表失败!` + JSON.toString(error), 'danger', 2000)
1173
+ })
1174
+ }).catch((error) => {
1175
+ this.danhu.show = false
1176
+ this.$showAlert(`抄表失败,请注意查看,失败原因:` + JSON.toString(error), 'danger', 2000)
1177
+ })
1178
+ },
1179
+ // 获得本月的最后一天。
1180
+ getLastDayOfMonth (year, month) {
1181
+ let new_year = year // 取当前的年份
1182
+ let new_month = month++// 取下一个月的第一天,方便计算(最后一天不固定)
1183
+ if (month > 12) // 如果当前大于12月,则年份转到下一年
1184
+ {
1185
+ new_month -= 12 // 月份减
1186
+ new_year++ // 年份增
1187
+ }
1188
+ let new_date = new Date(new_year, new_month, 1) // 取当年当月中的第一天
1189
+ let date_count = (new Date(new_date.getTime() - 1000 * 60 * 60 * 24)).getDate()// 获取当月的天数
1190
+ // let last_date = new Date(new_date.getTime() - 1000 * 60 * 60 * 24);//获得当月最后一天的日期
1191
+ return date_count
1192
+ },
1193
+ danhuShow () {
1194
+ this.model.params.startDate = this.$refs.paged.$refs.criteria.model.startDate
1195
+ this.model.params.endDate = this.$refs.paged.$refs.criteria.model.endDate
1196
+ this.downModel.downDate = this.$login.toStandardTimeString()
1197
+ this.danhu = {
1198
+ show: true,
1199
+ f_userinfo_code: '',
1200
+ f_tablebase: '',
1201
+ info: {}
1202
+ }
1203
+ setTimeout(() => {
1204
+ document.getElementById('danhucode').focus()
1205
+ this.$refs.paged.$refs.criteria.search()
1206
+ }, 100)
1207
+ },
1208
+ paycodefocus () {
1209
+ this.$nextTick(() => {
1210
+ this.$els.paycode.focus()
1211
+ })
1212
+ },
1213
+ getRes (obj) {
1214
+ this.orgCondtionStr = obj
1215
+ },
1216
+ async getaddress () {
1217
+ console.log('开始获取小区')
1218
+ let HttpReset = new HttpResetClass()
1219
+ var data = await HttpReset.load('POST', 'api/af-revenue/sql/manage_getarealist', {
1220
+ data: {
1221
+ condition: `1=1 and s.f_filialeid = '${this.$login.f.orgid}'`
1222
+ }
1223
+ }, {resolveMsg: null, rejectMsg: '获取小区失败!'})
1224
+ console.log('小区', data)
1225
+ let house = []
1226
+ house.push()
1227
+ for (let row of data.data) {
1228
+ console.log('开始保存小区')
1229
+ house.push({label: row.f_residential_area, value: row.f_residential_area})
1230
+ }
1231
+ this.residentialArea = house
1232
+ },
1233
+ loadMeterBooks () {
1234
+ this.meterbooks = this.$GetSaleParam.getMeterBooks()
1235
+ },
1236
+ loadBookCodes () {
1237
+ this.bookcodes = this.$GetSaleParam.getBookCodes()
1238
+ },
1239
+ fileterprice (row) {
1240
+ this.splitdata = row
1241
+ this.priceSplit = true
1242
+ console.log('row==>', row)
1243
+ },
1244
+ hidden () {
1245
+ this.criteriaShow = !this.criteriaShow
1246
+ },
1247
+ clear () {
1248
+ Object.keys(this.$refs.paged.$refs.criteria.model).forEach((key) => {
1249
+ this.$refs.paged.$refs.criteria.model[key] = []
1250
+ })
1251
+ },
1252
+
1253
+ // 判断当前页是否全选
1254
+ isChooseAll (rows) {
1255
+ if (this.plans.length == 0 && rows.length == 0) {
1256
+ return false
1257
+ }
1258
+ for (var i = 0; i < rows.length; i++) {
1259
+ let flag = false
1260
+ if (rows[i].f_meter_state == '未下发') {
1261
+ for (let plan of this.plans) {
1262
+ if (plan.id == rows[i].f_userfiles_id) {
1263
+ flag = true
1264
+ if (!plan.state) {
1265
+ return false
1266
+ }
1267
+ }
1268
+ }
1269
+ if (!flag) {
1270
+ return false
1271
+ }
1272
+ }
1273
+ }
1274
+ return true
1275
+ },
1276
+ // 选择需要下发的计划
1277
+ chooseOne (e, row, rows) {
1278
+ console.log('row', row)
1279
+ let checked = e.target.checked
1280
+ console.log('state', e.target.checked)
1281
+ // 判断当前行是否被选中
1282
+ if (checked) {
1283
+ let onePlan = {
1284
+ id: row.f_userfiles_id,
1285
+ state: true
1286
+ }
1287
+ // 记录被选中计划的状态
1288
+ let flag = false
1289
+ for (let plan of this.plans) {
1290
+ if (plan.id == row.f_userfiles_id) {
1291
+ flag = true
1292
+ plan.state = true
1293
+ }
1294
+ }
1295
+ if (!flag) {
1296
+ this.plans.push(onePlan)
1297
+ }
1298
+ } else {
1299
+ for (let plan of this.plans) {
1300
+ if (plan.id == row.f_userfiles_id) {
1301
+ plan.state = false
1302
+ }
1303
+ }
1304
+ }
1305
+ // let param = {id:row.id,isChoose:true}
1306
+
1307
+ if (this.isChooseAll(rows)) {
1308
+ this.all = true
1309
+ } else {
1310
+ this.all = false
1311
+ }
1312
+ // this.delRepetition()
1313
+ },
1314
+ uploadFiles () {
1315
+ this.showfiles = !this.showfiles
1316
+ },
1317
+ chooseAll () {
1318
+ if (this.all) {
1319
+ // this.chooseInfo[index-1] = []
1320
+ // for (let row of this.model.rows){
1321
+ // this.chooseInfo[index-1].push(row)
1322
+ // }
1323
+ // this.chooseInfo = Object.assign([],this.chooseInfo,this.model.rows)
1324
+
1325
+ for (let row of this.model.rows) {
1326
+ if (row.f_meter_state == '未下发') {
1327
+ let onePlan = {
1328
+ id: row.f_userfiles_id,
1329
+ state: true
1330
+ }
1331
+ let flag = false
1332
+ for (let plan of this.plans) {
1333
+ if (plan.id == row.f_userfiles_id) {
1334
+ flag = true
1335
+ plan.state = true
1336
+ }
1337
+ }
1338
+ if (!flag) {
1339
+ this.plans.push(onePlan)
1340
+ }
1341
+ }
1342
+ }
1343
+ } else {
1344
+ // this.chooseInfo[index-1] = []
1345
+ // console.log("this.chooseInfo[index-1]",this.chooseInfo[index-1])
1346
+ for (let row of this.model.rows) {
1347
+ if (row.f_meter_state == '未下发') {
1348
+ for (let plan of this.plans) {
1349
+ if (plan.id == row.f_userfiles_id) {
1350
+ plan.state = false
1351
+ }
1352
+ }
1353
+ }
1354
+ }
1355
+ }
1356
+ },
1357
+ search () {
1358
+ // 查询前清空选择项
1359
+ this.plans = []
1360
+ this.$refs.paged.$refs.criteria.search()
1361
+ },
1362
+ clickupshow () {
1363
+ if (!this.$login.r.find(value => value == '机表抄表导入抄表')) {
1364
+ this.$showMessage('你没有机表抄表导入抄表的权限,请联系管理员!')
1365
+ return
1366
+ }
1367
+ this.upshow = !this.upshow
1368
+ },
1369
+ deletehand () {
1370
+ if (!this.$login.r.find(value => value == '抄表计划删除')) {
1371
+ this.$showMessage('你没有【抄表计划删除】的权限,请联系管理员!')
1372
+ } else {
1373
+ if (this.deletestate) {
1374
+ console.log('mode', this.model)
1375
+ let cons = this.model.params
1376
+ this.$showMessage('删除后不可恢复,确认删除该批未抄表计划吗?', ['confirm', 'cancel']).then((res) => {
1377
+ if (res === 'confirm') {
1378
+ this.$resetpost('api/af-revenue/logic/deletePlanAll', {data: cons}).then((res) => {
1379
+ this.$dispatch('refresh', '删除计划', cons)
1380
+ console.log('ressss:', res)
1381
+ this.$showAlert(`共计删除${res.data.index}条记录`, 'success', 2000)
1382
+ this.search()
1383
+ })
1384
+ }
1385
+ })
1386
+ } else {
1387
+ this.$showMessage('为保证误删操作,请先选择抄表单查询条件为未抄表,查询后,再点击删除计划按钮!')
1388
+ }
1389
+ }
1390
+ },
1391
+ searchPrint () {
1392
+ console.log('mode', this.model)
1393
+ let cons = this.model.params
1394
+ let data = {
1395
+ 'body': {
1396
+ 'data': {
1397
+ 'condition': ''
1398
+ },
1399
+ 'field': [],
1400
+ 'templateName': '',
1401
+ 'sqlName': ''
1402
+ },
1403
+ 'condition': cons,
1404
+ 'sqlname': 'periodAlreadyIssuedOrder'
1405
+ }
1406
+ this.$resetpost('api/af-revenue/logic/allExportExcel', {data: data}, {resolveMsg: null, rejectMsg: '上传失败'}).then((res) => {
1407
+ if (res.data === 'no user') {
1408
+ this.$showAlert(`无匹配用户,无法导出对应excel`, 'warning', 2000)
1409
+ } else {
1410
+ var link = document.createElement('a')
1411
+ res.data.forEach((item) => {
1412
+ console.log('导出路径', item.filename)
1413
+ let path = item.filename
1414
+ // 本地
1415
+ // let pathName = "http://" + location.host + "/excel" + path.split('excel')[1]
1416
+ // 服务器
1417
+ let pathName = 'http://' + location.host + '/webapps' + path.split('webapps')[1]
1418
+ link.href = pathName
1419
+ console.log('=============================', path.split('excel/')[1])
1420
+ link.download = path.split('excel/')[1]
1421
+ link.dispatchEvent(new MouseEvent('click'))
1422
+ })
1423
+ }
1424
+ })
1425
+ },
1426
+ selfSearch (args) {
1427
+ this.meter_state = args.condition.includes('未下发')
1428
+ this.inputtor_change = args.condition.includes('未抄表')
1429
+ console.log('=====抄表1====', args.condition.includes('未抄表'))
1430
+ console.log('=====抄表1====', this.deletestate)
1431
+ if (args.condition.includes('未抄表')) {
1432
+ this.deletestate = true
1433
+ } else {
1434
+ this.deletestate = false
1435
+ }
1436
+ console.log('=====抄表1====', this.deletestate)
1437
+ if (!this.orgCondtionStr) {
1438
+ args.condition = `${args.condition}` + ' and f_orgid = ' + this.$login.f.orgid
1439
+ } else {
1440
+ args.condition = `${args.condition}` + this.orgCondtionStr
1441
+ }
1442
+
1443
+ // 抄表员查询条件
1444
+ this.inputtouPerson = this.$refs.paged.$refs.criteria.model.f_inputtor
1445
+ if (this.inputtouPerson.length !== 0) {
1446
+ let str = JSON.stringify(this.inputtouPerson)
1447
+ str = str.replace(/"/g, `'`)
1448
+ str = str.replace(/\[/g, ``)
1449
+ str = str.replace(/\]/g, ``)
1450
+ console.log('=====抄表员model22222222222绑定====', str)
1451
+ // 查询多个抄表员时条件
1452
+ args.condition += ` and f_inputtor in ( ${str} )`
1453
+ }
1454
+ // 小区查询条件
1455
+ this.area = this.$refs.paged.$refs.criteria.model.f_residential_area
1456
+ console.log('=====小区model绑定====', this.area)
1457
+ if (this.area.length !== 0) {
1458
+ let str = JSON.stringify(this.area)
1459
+ str = str.replace(/"/g, `'`)
1460
+ str = str.replace(/\[/g, ``)
1461
+ str = str.replace(/\]/g, ``)
1462
+ console.log('=====小区model22222222222绑定====', str)
1463
+ // 查询多个小区时条件
1464
+ args.condition += ` and f_residential_area in ( ${str} )`
1465
+ }
1466
+
1467
+ if (args.model.f_meter_brand && args.model.f_meter_brand.length > 0) {
1468
+ if (args.model.f_meter_brand[0].f_meter_brand) {
1469
+ args.condition = `${args.condition} and f_meter_brand = '${args.model.f_meter_brand[0].f_meter_brand}'`
1470
+ }
1471
+ }
1472
+ this.model.params.startDate = this.$refs.paged.$refs.criteria.model.startDate
1473
+ this.model.params.endDate = this.$refs.paged.$refs.criteria.model.endDate
1474
+ this.condition2 = args.condition
1475
+ console.log('selfsearch..', args.condition, this.model)
1476
+ this.model.search(args.condition, this.model)
1477
+ },
1478
+ reflash () {
1479
+ this.$refs.paged.$refs.criteria.model.f_orgid = `${Vue.$login.f.orgid}`
1480
+ this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStartAndEndDateString()[0]
1481
+ this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStartAndEndDateString()[1]
1482
+ this.search()
1483
+ },
1484
+ beforenter (index, row) {
1485
+ this.inputid = index + 1
1486
+ // 限制本次抄表不能低于上次
1487
+ if (row.f_tablebase) {
1488
+ if (row.f_tablebase < 0) {
1489
+ row.state = '失败'
1490
+ Vue.set(row, 'error', '底数不能小于0')
1491
+ this.speckText('底数不能小于0,请注意!')
1492
+ } else if (this.danhu.f_tablebase.toString().split('.').length > 1 && this.danhu.f_tablebase.toString().split('.')[1].length > 3) {
1493
+ row.state = '失败'
1494
+ Vue.set(row, 'error', '底数最多只能输入小数点后3位')
1495
+ this.speckText('底数最多只能输入小数点后3位,请注意!')
1496
+ } else if (row.f_tablebase < row.f_last_tablebase && !row.f_capacity) {
1497
+ row.state = '失败'
1498
+ Vue.set(row, 'error', '本期表底数不能低于上期表底数')
1499
+ this.speckText('本期表底数不能低于上期表底数,请注意!')
1500
+ } else {
1501
+ if (row.f_tablebase < row.f_last_tablebase) {
1502
+ this.$showMessage('本次抄表已超越最大量程, 请熟知!')
1503
+ }
1504
+ // 抄表结果状态没选默认给正常
1505
+ row.f_result_state = row.f_result_state ? row.f_result_state : '正常'
1506
+ beforenterGen(this, index, row)
1507
+ }
1508
+ }
1509
+ },
1510
+ enter (index, row) {
1511
+ console.log('录入数据。..', row)
1512
+ let auditFlag = false
1513
+ let num = (row.f_tablebase - row.f_last_tablebase)
1514
+ let reg = /^\d+,\d+$/
1515
+ if (row.f_user_type === '民用' && this.usermlimit) {
1516
+ if (!reg.test(this.usermlimit)) {
1517
+ this.$showMessage('民用自动审核区间参数设置有误, 请检查!')
1518
+ return
1519
+ }
1520
+ let limit = this.usermlimit.split(',')
1521
+ if (!(limit[0] - 0 <= num && num <= limit[1] - 0)) {
1522
+ auditFlag = true
1523
+ }
1524
+ } else if (row.f_user_type === '非民用' && this.userfmlimit) {
1525
+ if (!reg.test(this.userfmlimit)) {
1526
+ this.$showMessage('非民用自动审核区间参数设置有误, 请检查!')
1527
+ return
1528
+ }
1529
+ let limit = this.userfmlimit.split(',')
1530
+ if (!(limit[0] - 0 <= num && num <= limit[1] - 0)) {
1531
+ auditFlag = true
1532
+ }
1533
+ } else if (this.$appdata.getSingleValue('抄表审核') === '启用') {
1534
+ auditFlag = true
1535
+ }
1536
+ if (auditFlag) {
1537
+ let f_input_date = Vue.$login.toStandardDateString()
1538
+ if (row.f_input_date && row.f_input_date != '') {
1539
+ f_input_date = row.f_input_date
1540
+ }
1541
+ let handplan = {
1542
+ id: row.id,
1543
+ f_oughtamount: row.f_oughtamount,
1544
+ f_adjustment_volume: row.f_adjustment_volume ? row.f_adjustment_volume : 0,
1545
+ f_tablebase: row.f_tablebase,
1546
+ f_hand_date: row.f_hand_date,
1547
+ f_input_date: f_input_date,
1548
+ f_input_person: Vue.$login.f.name,
1549
+ f_meter_state: '待审核',
1550
+ f_meter_source: '手动录入',
1551
+
1552
+ f_operator: Vue.$login.f.name,
1553
+ f_operatorid: Vue.$login.f.id,
1554
+ f_orgid: Vue.$login.f.orgid,
1555
+ f_orgname: Vue.$login.f.orgs,
1556
+ f_depid: Vue.$login.f.depids,
1557
+ f_depname: Vue.$login.f.deps
1558
+
1559
+ }
1560
+ console.log('抄表负数。。0', handplan)
1561
+ this.$resetpost('api/af-revenue/entity/save/t_handplan', handplan, {
1562
+ resolveMsg: null,
1563
+ rejectMsg: '抄表数据保存出错!!!'
1564
+ }).then((res) => {
1565
+ row.f_meter_state = '待审核'
1566
+ row.f_whether_pay = '否'
1567
+ row.f_input_date = res.data.f_input_date
1568
+ // this.search()
1569
+ }).catch((error) => {
1570
+ row.state = '失败'
1571
+ Vue.set(row, 'error', JSON.stringify(error))
1572
+ this.speckText('抄表录入出错,请注意!')
1573
+ })
1574
+ } else {
1575
+ // 没有启用抄表审核功能
1576
+ row.f_input_person = this.$login.f.name
1577
+ row.f_inputtor = row.f_inputtor
1578
+ row.f_userinfo_id = row.f_userinfo_id + ''
1579
+ row.f_userfiles_id = row.f_userfiles_id + ''
1580
+ this.pass(row)
1581
+ }
1582
+ // 在方法结束前添加以下代码
1583
+ this.$nextTick(() => {
1584
+ // 获取下一行数据并设置为选中状态
1585
+ const nextRowIndex = index + 1
1586
+ if (nextRowIndex < this.model.rows.length) {
1587
+ // 先清除当前选中
1588
+ this.$refs.paged.$refs.grid.selectStore.selected = null
1589
+ // 设置下一行为选中状态,这样会自动应用 success 样式
1590
+ this.$refs.paged.$refs.grid.select(this.model.rows[nextRowIndex])
1591
+ }
1592
+ })
1593
+ },
1594
+ pass (row) {
1595
+ let param = {
1596
+ f_meter_classify: row.f_meter_classify,
1597
+ f_meter_brand: row.f_meter_brand,
1598
+ f_hand_id: row.id,
1599
+ f_operator: Vue.$login.f.name,
1600
+ f_tablebase: row.f_tablebase,
1601
+ f_userinfo_id: row.f_userinfo_id,
1602
+ f_adjustment_volume: row.f_adjustment_volume ? row.f_adjustment_volume : 0
1603
+ }
1604
+ this.$resetpost('api/af-revenue/logic/sale_commonEnter', {data: param}, {resolveMsg: null, rejectMsg: null, newly: true}).then((res) => {
1605
+ row.f_meter_state = res.data.f_meter_state
1606
+ row.f_whether_pay = res.data.f_whether_pay
1607
+ row.f_oughtfee = res.data.f_oughtfee
1608
+ row.f_oughtamount = res.data.f_oughtamount
1609
+ // this.$resetpost('api/af-revenue/logic/getMeterSms', {data: param}, {resolveMsg: null, rejectMsg: null}).then((res) => {
1610
+ // this.search()
1611
+ let f_result_state = '正常'
1612
+ if (row.f_result_state && row.f_result_state != '') {
1613
+ f_result_state = row.f_result_state
1614
+ }
1615
+ let f_input_date = ''
1616
+ if (row.f_input_date && row.f_input_date != '') {
1617
+ f_input_date = ` ,f_input_date = '${row.f_input_date}'`
1618
+ }
1619
+ let sqldata = `update t_handplan set f_result_state = '${f_result_state}' ${f_input_date} where id = '${row.id}'`
1620
+ this.$resetpost('api/af-revenue/logic/runSQL', {data: {sql: sqldata}}, {resolveMsg: null, rejectMsg: '业务单号保存失败', newly: true})
1621
+ // }).catch((error) => {
1622
+ // row.state = '失败'
1623
+ // Vue.set(row, 'error', JSON.stringify(error))
1624
+ // this.speckText('抄表出错,请注意!')
1625
+ // })
1626
+ // this.search()
1627
+ }).catch((error) => {
1628
+ row.state = '失败'
1629
+ Vue.set(row, 'error', JSON.stringify(error))
1630
+ this.speckText('抄表出错,请注意!')
1631
+ })
1632
+ },
1633
+ nopass (row) {
1634
+ console.log('不通过。。。', row)
1635
+ let handplan = {
1636
+ id: row.id,
1637
+ f_oughtamount: 0,
1638
+ f_tablebase: 0,
1639
+ f_input_date: null,
1640
+ f_meter_state: '未抄表',
1641
+ f_meter_source: null
1642
+ }
1643
+ this.$resetpost('api/af-revenue/entity/save/t_handplan', handplan, {
1644
+ resolveMsg: null,
1645
+ rejectMsg: '未通过,抄表数据返回未抄表保存出错!!!'
1646
+ }).then((res) => {
1647
+ row.f_tablebase = null
1648
+ row.f_meter_state = '未抄表'
1649
+ row.f_whether_pay = '否'
1650
+ this.search()
1651
+ }).catch((error) => {
1652
+ row.state = '失败'
1653
+ Vue.set(row, 'error', JSON.stringify(error))
1654
+ this.speckText('抄表录入出错,请注意!')
1655
+ })
1656
+ },
1657
+ clearError (row) {
1658
+ if (row.f_tablebase === 0) {
1659
+ row.f_tablebase = ''
1660
+ }
1661
+ Vue.set(row, 'error', null)
1662
+ },
1663
+ async speckText (str) {
1664
+ var url = 'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text=' + encodeURI(str)
1665
+ await new Audio(url).play()
1666
+ this.err = str
1667
+ this.showerr = true
1668
+ this.paycodefocus()
1669
+ },
1670
+ closeerr () {
1671
+ this.showerr = false
1672
+ },
1673
+ fileUpload () {
1674
+ this.uploadshow = true
1675
+ },
1676
+ // 删除这条计划
1677
+ delectHand (row) {
1678
+ this.$showMessage('删除后不可恢复,确认删除吗?', ['confirm', 'cancel']).then((res) => {
1679
+ if (res === 'confirm') {
1680
+ this.$resetpost('api/af-revenue/logic/deletePlan', {data: row}).then(() => {
1681
+ this.$dispatch('refresh', '删除计划', row)
1682
+ this.search()
1683
+ })
1684
+ }
1685
+ })
1686
+ },
1687
+ cancelHand4 (row) {
1688
+ this.examinerow = row
1689
+ this.examineshow = true
1690
+ this.examinetype = true
1691
+ },
1692
+ cancelHand2 (row) {
1693
+ if (this.config.examine) {
1694
+ let handdate = new Date(row.f_hand_date)
1695
+ console.log('获取月份', handdate.getMonth())
1696
+ let ima = new Date()
1697
+ console.log('获取月份', ima.getMonth())
1698
+ if (handdate.getMonth() == ima.getMonth()) {
1699
+ this.cancelHand3(row)
1700
+ } else {
1701
+ if (!this.$login.r.find(value => value == '抄表隔月冲正')) {
1702
+ this.$showMessage('当前登录用户没有隔月冲正权限, 请联系管理员!')
1703
+ } else {
1704
+ this.cancelHand3(row)
1705
+ }
1706
+ }
1707
+ } else {
1708
+ this.cancelHand3(row)
1709
+ }
1710
+ },
1711
+ async cancelHand5 () {
1712
+ let sqldata = `update t_handplan set f_audit_state ='已审核',f_audit_person='${this.$login.f.name}',
1713
+ f_audit_date='${this.$login.toStandardTimeString()}' where id ='${this.examinerow.id}'`
1714
+ await this.$resetpost('api/af-revenue/logic/runSQL', {data: {sql: sqldata}}, {resolveMsg: null, rejectMsg: '更新收费记录订单号失败'})
1715
+
1716
+ this.cancelHand3(this.examinerow)
1717
+ },
1718
+ cancelHand3 (row) {
1719
+ // 抄表加入权限
1720
+ if (!this.$login.r.find(value => value == '机表抄表冲正')) {
1721
+ this.$showMessage('当前登录用户没有冲正权限, 请联系管理员!')
1722
+ return
1723
+ }
1724
+ // console.log('抄表冲正。、。。、', row)
1725
+ let param = {
1726
+ f_hand_id: row.id,
1727
+ operInfo: {
1728
+ f_operator: this.$login.f.name,
1729
+ f_operatorid: this.$login.f.id,
1730
+ f_orgid: this.$login.f.orgid,
1731
+ f_orgname: this.$login.f.orgs,
1732
+ f_depid: this.$login.f.depids,
1733
+ f_depname: this.$login.f.deps
1734
+ }
1735
+ }
1736
+ let url = 'api/af-revenue/logic/sale_commonEnterCancel'
1737
+ this.$resetpost(url, {data: param}, {warnMsg: '确定对这条记录进行撤销吗?'}).then(() => {
1738
+ this.search()
1739
+ this.close()
1740
+ })
1741
+ },
1742
+ down (type, condition, data) {
1743
+ co(downGen(type, condition, data, this))
1744
+ },
1745
+ // 单条下发计划
1746
+ downHand (row) {
1747
+ console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' + row.f_userfiles_id)
1748
+ this.down('single', `f_userfiles_id = '${row.f_userfiles_id}'`, row)
1749
+ },
1750
+ // 批量下发计划
1751
+ batchDownHand () {
1752
+ this.down('batch', this.model.condition, this.model.count)
1753
+ },
1754
+ // batchDownHand () {
1755
+ // this.condition = ''
1756
+ // let count = 0
1757
+ // for (let plan of this.plans){
1758
+ // if(plan.state){
1759
+ // this.condition = this.condition + plan.id + ','
1760
+ // count = count + 1
1761
+ // }
1762
+ // }
1763
+ // this.down('batch', `f_user_id in (${this.condition.substring(0,this.condition.length-1)})`,count)
1764
+ // },
1765
+ // allDownHand () {
1766
+ // this.down('all', this.model.condition, this.model.count)
1767
+ // },
1768
+
1769
+ validateDate () {
1770
+ let currentDown = new Date(this.downModel.downDate)
1771
+ console.log(new Date(this.$refs.paged.$refs.criteria.model.startDate))
1772
+ console.log(new Date(this.$refs.paged.$refs.criteria.model.endDate))
1773
+ return currentDown >= new Date(this.$refs.paged.$refs.criteria.model.startDate + ' 00:00:00') && currentDown <= new Date(this.$refs.paged.$refs.criteria.model.endDate + ' 23:59:59')
1774
+ },
1775
+
1776
+ async examineconfirm () {
1777
+ let sqldata = `update t_handplan set f_audit_state ='审核中',f_examinereason='${this.examinerow.f_examinereason}' where id ='${this.examinerow.id}'`
1778
+ await this.$resetpost('api/af-revenue/logic/runSQL', {data: {sql: sqldata}}, {resolveMsg: null, rejectMsg: null})
1779
+ this.close()
1780
+ this.search()
1781
+ },
1782
+ // 关闭下发计划得弹出框
1783
+ close () {
1784
+ this.show = false
1785
+ this.inputtor_show = false
1786
+ this.downConfirm = false
1787
+ this.examineshow = false
1788
+ this.examinetype = false
1789
+ this.detailsShow = false
1790
+ this.priceModel = false
1791
+ // 初始化模态框数据
1792
+ this.initModal()
1793
+ if (this.uploadshow) {
1794
+ this.uploadshow = false
1795
+ // 讲选的文件清空
1796
+ this.$refs.file.$el.querySelector('input').value = ''
1797
+ }
1798
+ },
1799
+ initModal () {
1800
+ this.downModel = {
1801
+ downDate: Vue.$login.toStandardDateString(),
1802
+ downWay: 'downWithUserfiles',
1803
+ downInputtor: []
1804
+ }
1805
+ this.inputtorModel = {
1806
+ inputtor: [],
1807
+ reason: ''
1808
+ }
1809
+ },
1810
+ // 判断当前登陆人是不是子公司的人员
1811
+ isHead () {
1812
+ return this.$login.f.parent.parent.name.includes('统一资源管理')
1813
+ },
1814
+ sort (field, rule) {
1815
+ // 将所有排序方式设为不排序,实现相互排斥
1816
+ for (let key in this.orderFields) {
1817
+ if (key === field) {
1818
+ this.orderFields[key] = rule
1819
+ } else {
1820
+ this.orderFields[key] = 'no'
1821
+ }
1822
+ }
1823
+ // 如果新规则不排序,还原为默认排序
1824
+ if (rule === 'no') {
1825
+ this.model.paramSource.orderitem = `'${this.orderDefault}'`
1826
+ } else {
1827
+ this.model.paramSource.orderitem = `'${field} ${rule}'`
1828
+ }
1829
+ this.search()
1830
+ },
1831
+ guid () {
1832
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
1833
+ let r = Math.random() * 16 | 0,
1834
+ v = c == 'x' ? r : (r & 0x3 | 0x8)
1835
+ return v.toString(16)
1836
+ })
1837
+ },
1838
+ computeAmount (event) {
1839
+ console.log('=============================>', event, this.row)
1840
+ let money = event.target.value
1841
+ if (this.row.f_price_type === '固定气价') {
1842
+ let price = this.$refs.mix_price.model.f_price
1843
+ // 可以购买的总气量
1844
+ let purchaseSum = (money / price).toFixed(3)
1845
+ // 计算应抄底数
1846
+ this.should_base = (this.row.f_last_tablebase - 0) + (purchaseSum - 0)
1847
+ // 计算公式
1848
+ this.designFormulas = `${purchaseSum}X${price}`
1849
+ } else {
1850
+ let mydata = this.$refs.statir.mydata
1851
+ // 剩余1阶气量
1852
+ let surplus1 = (mydata.f_stair1ceiling - (mydata.f_hasuse1 > 0 ? mydata.f_hasuse1 : 0))
1853
+ // 把1阶买完的钱
1854
+ let price1 = surplus1 * mydata.f_stair1price
1855
+ // 剩余2阶气量
1856
+ let surplus2 = (mydata.f_stair2ceiling - mydata.f_stair1ceiling - (mydata.f_hasuse2 > 0 ? mydata.f_hasuse2 : 0)).toFixed(3)
1857
+ // 把2阶买完的钱
1858
+ let price2 = surplus2 * mydata.f_stair2price
1859
+ // 兼容一下
1860
+ if (this.$refs.statir.jt != 3) {
1861
+ this.$showMessage('暂不支持该气价类型的运算,请联系开发人员!')
1862
+ }
1863
+ // 开始计算
1864
+ // 可以购买各阶梯量
1865
+ let purchase1 = 0
1866
+ let purchase2 = 0
1867
+ let purchase3 = 0
1868
+ if (money <= price1) {
1869
+ purchase1 = (money / mydata.f_stair1price).toFixed(3)
1870
+ } else if (money <= (price1 + price2)) {
1871
+ purchase1 = surplus1
1872
+ purchase2 = ((money - price1) / mydata.f_stair2price).toFixed(3)
1873
+ } else {
1874
+ purchase1 = surplus1
1875
+ purchase2 = surplus2
1876
+ purchase3 = ((money - price1 - price2) / mydata.f_stair3price).toFixed(3)
1877
+ }
1878
+ // 可以购买的总气量
1879
+ let purchaseSum = (purchase1 - 0) + (purchase2 - 0) + (purchase3 - 0)
1880
+ // 计算应抄底数
1881
+ this.should_base = (this.row.f_last_tablebase - 0) + purchaseSum
1882
+ // 计算公式
1883
+ this.designFormulas = `${purchase1}X${mydata.f_stair1price} + ${purchase2}X${mydata.f_stair2price} + ${purchase3}X${mydata.f_stair3price}`
1884
+ }
1885
+ this.should_base = this.should_base.toFixed(3) - 0
1886
+ }
1887
+ },
1888
+ watch: {
1889
+ 'downModel.downWay' (val) {
1890
+ if (val === 'downWithSelf') {
1891
+ console.log('抄表员。。', this.inputtores2)
1892
+ if (this.inputtores2.length > 0) {
1893
+ this.downModel.downInputtor = [this.inputtores2[0].value]
1894
+ }
1895
+ }
1896
+ },
1897
+ 'detailsShow' (val) {
1898
+ if (!val) {
1899
+ this.should_base = 0
1900
+ this.designFormulas = null
1901
+ this.$els.inputmoney.value = 0
1902
+ }
1903
+ }
1904
+ // 'model.rows'(val){
1905
+ // console.log('页面切换',val)
1906
+ // if(this.isChooseAll(val)){
1907
+ // this.all = true
1908
+ // }else{
1909
+ // this.all = false
1910
+ // }
1911
+ // },
1912
+ },
1913
+ computed: {
1914
+ danhutitle () {
1915
+ return '单户抄表 当前计划年月:' + this.downModel.downDate
1916
+ },
1917
+ getCondition () {
1918
+ // return {condition: `${this.$refs.paged.$refs.cri.condition}` + this.orgCondtionStr}
1919
+ return {
1920
+ startDate: this.$refs.paged.$refs.criteria.model.startDate,
1921
+ endDate: this.$refs.paged.$refs.criteria.model.endDate,
1922
+ orderitem: this.orderDefault ? this.orderDefault : 'id',
1923
+ condition: this.condition2
1924
+ }
1925
+ },
1926
+
1927
+ inputtores () {
1928
+ // 获取抄表员
1929
+ console.log('获取抄表员', this.$login.f)
1930
+ let rs = []
1931
+ if (this.$login.f.f_gasman.length > 0) {
1932
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
1933
+ let temp = {
1934
+ label: this.$login.f.f_gasman[i].name,
1935
+ value: this.$login.f.f_gasman[i].name
1936
+ }
1937
+ rs.push(temp)
1938
+ }
1939
+ }
1940
+ this.inputtores2 = rs
1941
+ return [...rs]
1942
+ },
1943
+ whetherpaies () {
1944
+ return [
1945
+ {label: '全部', value: ''},
1946
+ {label: '已缴费', value: '是'},
1947
+ {label: '未缴费', value: '否'}
1948
+ ]
1949
+ },
1950
+ // 界面细节权限
1951
+ jurisdiction () {
1952
+ console.log('抄表界面细节', this.$login.r)
1953
+ return this.$login.r ? this.$login.r : []
1954
+ },
1955
+ firestates () {
1956
+ return [
1957
+ {label: '全部', value: ''},
1958
+ {label: '已点火', value: '1'},
1959
+ {label: '未点火', value: '0'}
1960
+ ]
1961
+ },
1962
+ ischecked () {
1963
+ return function (row) {
1964
+ for (let plan of this.plans) {
1965
+ if (plan.id == row.f_userfiles_id) {
1966
+ return plan.state
1967
+ }
1968
+ }
1969
+ }
1970
+ }
1971
+ },
1972
+ events: {
1973
+ onFileUpload: async function (file, res) {
1974
+ if (this.upshow) {
1975
+ let uuid = this.guid()
1976
+ let data = {
1977
+ model: {
1978
+ f_operator: this.$login.f.name,
1979
+ f_end_date: this.$login.nextMonth20(this.$login.toStandardTimeString()),
1980
+ f_operatorid: this.$login.f.id,
1981
+ f_orgid: this.$login.f.orgid,
1982
+ f_orgname: this.$login.f.orgs,
1983
+ f_depid: this.$login.f.depids,
1984
+ f_depname: this.$login.f.deps
1985
+ },
1986
+ uuid: uuid,
1987
+ filepath: res.f_downloadpath
1988
+ }
1989
+ try {
1990
+ await this.HttpReset.load('POST', 'api/af-revenue/logic/batchSettleFileupdate', data, {resolveMsg: null, rejectMsg: null}, 1000)
1991
+ } catch (e) {}
1992
+ this.$showAlert(`文件上传成功,正在后台批量结算, 请耐心等待结果......`, 'success')
1993
+ // 启动定时器定时查询上传结果
1994
+ let timer = setInterval(async () => {
1995
+ let res = await this.HttpReset.load('POST', 'api/af-revenue/logic/getBatchOperaPro', {data: {uuid: uuid}}, {resolveMsg: null, rejectMsg: null})
1996
+ console.log('查询进度返回: ', res)
1997
+ if (res.data.msg || res.data.error) {
1998
+ res.data.msg ? this.$showAlert(`${res.data.msg}`, 'success', 2000) : this.$showAlert(`${res.data.error}`, 'danger')
1999
+ this.upshow = false
2000
+ this.search()
2001
+ clearInterval(timer)
2002
+ }
2003
+ }, 5000)
2004
+ return
2005
+ }
2006
+ let data = {
2007
+ model: {
2008
+ f_operator: this.$login.f.name,
2009
+ f_end_date: this.$login.nextMonth20(this.$login.toStandardTimeString())
2010
+ },
2011
+ filepath: res.path
2012
+ }
2013
+ if (res.f_downloadpath.includes('抄表数据')) {
2014
+ console.log('进入了抄表上传')
2015
+ let data1 = {
2016
+ filepath: res.f_downloadpath
2017
+ }
2018
+ this.$resetpost('api/af-revenue/logic/upLoadHand', data1, {resolveMsg: null, rejectMsg: '上传失败'}, 0).then((res) => {
2019
+ // console.log('终于成功了', res)
2020
+ this.upshow = false
2021
+ // this.$showAlert(`一共上传${res.data.total}条数据, 成功${res.data.successnum}条, 未抄下发${res.data.nohandnum}条, 失败下发${res.data.failednum}条, 异常下发${res.data.exceptionnum}条`, 'success', 2000)
2022
+ // this.$parent.search()
2023
+ })
2024
+ } else if (data.filepath.includes('先锋')) {
2025
+ this.$resetpost('api/af-revenue/logic/xfimport', data, {resolveMsg: null, rejectMsg: '上传失败'}, 0).then((res) => {
2026
+ // console.log('终于成功了', res)
2027
+ this.uploadshow = false
2028
+ this.$showAlert(`一共上传${res.data.total}条数据, 成功${res.data.successnum}条, 未抄下发${res.data.nohandnum}条, 失败下发${res.data.failednum}条, 异常下发${res.data.exceptionnum}条`, 'success', 2000)
2029
+ this.$parent.search()
2030
+ })
2031
+ } else if (data.filepath.includes('伦力')) {
2032
+ this.$resetpost('api/af-revenue/logic/llimport', data, {resolveMsg: null, rejectMsg: '上传失败'}, 0).then((res) => {
2033
+ // console.log('终于成功了', res)
2034
+ this.uploadshow = false
2035
+ this.$showAlert(`一共上传${res.data.total}条数据, 成功${res.data.successnum}条, 未抄下发${res.data.nohandnum}条, 失败下发${res.data.failednum}条, 异常下发${res.data.exceptionnum}条`, 'success', 2000)
2036
+ this.$parent.search()
2037
+ })
2038
+ }
2039
+ },
2040
+ dblclick: function (row, index) {
2041
+ this.row = row
2042
+ this.detailsShow = true
2043
+ }
2044
+ }
2045
+ }
2046
+ </script>
2047
+ <style lang="less">
2048
+ #handManager {
2049
+ display: flex;
2050
+ justify-content: space-around;
2051
+ align-items: center;
2052
+
2053
+ .btn {
2054
+ margin: 0px;
2055
+ }
2056
+
2057
+ .hand-loading {
2058
+ border: 3px solid #ccc;
2059
+ border-right-color: #337ab7;
2060
+ border-radius: 50%;
2061
+ animation: spin 0.6s linear;
2062
+ position: absolute;
2063
+ animation-iteration-count: infinite;
2064
+ top: 0;
2065
+ right: 50%;
2066
+ z-index: 2;
2067
+ display: block;
2068
+ width: 28px;
2069
+ height: 28px;
2070
+ line-height: 28px;
2071
+ text-align: center;
2072
+ pointer-events: none;
2073
+ }
2074
+
2075
+ @keyframes spin {
2076
+ 100% {
2077
+ transform: rotate(360deg);
2078
+ }
2079
+ }
2080
+ .detail-panel {
2081
+ text-align: center;
2082
+ color: #31708f;
2083
+ background-color: #e8f1f9;
2084
+ border-color: #F2F6FA;
2085
+ }
2086
+ }
2087
+
2088
+ #hand_manager_grid {
2089
+ thead {
2090
+ position: relative;
2091
+ z-index: 2;
2092
+ }
2093
+ }
2094
+ #machineHandManager {
2095
+ .color-red {
2096
+ color: red;
2097
+ }
2098
+ }
2099
+ </style>