sale-client 3.6.148 → 3.6.149

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