sale-client 3.5.100 → 3.5.101

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sale-client",
3
- "version": "3.5.100",
3
+ "version": "3.5.101",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -676,7 +676,7 @@ export default {
676
676
  f_user_type: row.f_user_type,
677
677
  f_gasproperties: row.f_gasproperties,
678
678
  f_position: row.f_position,
679
- f_meter_book_num: row.f_meter_book,
679
+ f_meter_book_num: row.f_meter_book ? row.f_meter_book : '',
680
680
  f_usestate: '正常',
681
681
  f_adjustable: row.f_adjustable_id,
682
682
  f_install_date: row.f_install_date,
@@ -44,7 +44,6 @@
44
44
  created () {
45
45
  },
46
46
  ready () {
47
- console.log('日你妈')
48
47
  },
49
48
  methods: {
50
49
  // 返回结果为true意味着可以通行
@@ -1,20 +1,20 @@
1
- // 分公司特殊组件页面注册
2
-
3
- const Vue = require("vue");
4
- let specialComp = {
5
- // 高拍仪
6
- 'high-meter-idcard': (resolve) => { require(['./HighMeterIdCard'], resolve) },
7
- // 物联网表收费
8
- 'iot-meter-center': (resolve) => { require(['./IOTMeterCenter'], resolve) },
9
- // MISPOS支付
10
- 'mis-pos-pay': (resolve) => { require(['./MisPosPay'], resolve) },
11
- // 购气撤销
12
- 'card-meter-charge-cancel': (resolve) => { require(['./CardMeterChargeCancel'], resolve) },
13
- // 换表补卡
14
- 'change_fill_sendcard': (resolve) => { require(['./ChangeSendCard'], resolve) },
15
- // 发卡售气
16
- 'show-card-sell-gas': (resolve) => { require(['./ShowCardSellGas'], resolve) },
17
- // 卡表收费
18
- 'card-meter-center': (resolve) => { require(['./CardMeterCenter'], resolve) }
19
- }
20
- exports.specialComp = specialComp
1
+ // 分公司特殊组件页面注册
2
+
3
+ const Vue = require("vue");
4
+ let specialComp = {
5
+ // 高拍仪
6
+ 'high-meter-idcard': (resolve) => { require(['./HighMeterIdCard'], resolve) },
7
+ // 物联网表收费
8
+ 'iot-meter-center': (resolve) => { require(['./IOTMeterCenter'], resolve) },
9
+ // MISPOS支付
10
+ 'mis-pos-pay': (resolve) => { require(['./MisPosPay'], resolve) },
11
+ // 购气撤销
12
+ 'card-meter-charge-cancel': (resolve) => { require(['./CardMeterChargeCancel'], resolve) },
13
+ // 换表补卡
14
+ 'change_fill_sendcard': (resolve) => { require(['./ChangeSendCard'], resolve) },
15
+ // 发卡售气
16
+ 'show-card-sell-gas': (resolve) => { require(['./ShowCardSellGas'], resolve) },
17
+ // 卡表收费
18
+ 'card-meter-center': (resolve) => { require(['./CardMeterCenter'], resolve) },
19
+ }
20
+ exports.specialComp = specialComp
@@ -0,0 +1,518 @@
1
+ <template>
2
+ <div class="auto select-overspread" >
3
+ <validator name='v'>
4
+ <form class="form-horizontal" novalidate>
5
+ <ul class="nav nav-tabs" style="margin-bottom: 10px">
6
+ <li class="active"><a href="#">气价信息</a></li>
7
+ </ul>
8
+ <div class="row">
9
+ <div :class="[$v.f_user_type.required ? 'has-error' : 'has-success']" class="col-sm-6 form-group">
10
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_user_type" v-show="false"
11
+ v-validate:f_user_type='{required: true }'>
12
+ <label title="参数:用户类型" class="font_normal_body" for="f_user_type">客户类型</label>
13
+ <v-select :disabled='isEdit'
14
+ :options='usertype'
15
+ :value-single="true"
16
+ :value.sync="model.f_user_type"
17
+ @change="usertypeChange"
18
+ close-on-select
19
+ placeholder='请选择'
20
+ v-model="model.f_user_type">
21
+ </v-select>
22
+ </div>
23
+ <div :class="[$v.f_gasproperties.required ? 'has-error' : 'has-success']" class="col-sm-6 form-group">
24
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_gasproperties" v-show="false"
25
+ v-validate:f_gasproperties='{required: true }'>
26
+ <label class="font_normal_body" for="f_gasproperties">用气性质</label>
27
+ <v-select :disabled='isEdit'
28
+ :options='gastype'
29
+ :value-single="true"
30
+ :value.sync="model.f_gasproperties"
31
+ close-on-select
32
+ placeholder='请选择'
33
+ v-model="model.f_gasproperties">
34
+ </v-select>
35
+ </div>
36
+ <div :class="[$v.f_price_type.required ? 'has-error' : 'has-success']" class="col-sm-6 form-group">
37
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_price_type" v-show="false"
38
+ v-validate:f_price_type='{required: true }'>
39
+ <label title="参数:气价类型" class="font_normal_body" for="f_price_type">气价类型</label>
40
+ <v-select :disabled='isEdit'
41
+ :options='pricetype'
42
+ :value-single="true"
43
+ :value.sync="model.f_price_type"
44
+ close-on-select
45
+ id="f_price_type"
46
+ placeholder='请选择'
47
+ v-model="model.f_price_type">
48
+ </v-select>
49
+ </div>
50
+ <div :class="[$v.f_price_name.required ? 'has-error' : 'has-success']" class="col-sm-6 form-group">
51
+ <label class="font_normal_body" for="f_price_name">气价名称</label>
52
+ <input :disabled='isEdit' class="input_search" placeholder="气价名称" style="width:60%" @blur="CheckDuplicate"
53
+ type="text" v-model="model.f_price_name" v-validate:f_price_name='{required: true }'>
54
+ </div>
55
+ </div>
56
+ <div class="row" v-if="model.f_price_type === '阶梯气价'">
57
+ <div :class="[$v.f_stairmonths.required || $v.f_stairmonths.dctest ? 'has-error' : 'has-success']" class="col-sm-6 form-group">
58
+ <label class="font_normal_body" for="f_stairmonths">阶段月数</label>
59
+ <input :disabled='isEdit' class="input_search" style="width:60%" type="number"
60
+ v-model="model.f_stairmonths" v-validate:f_stairmonths='{required: true, dctest: [ 12, "<=" ] }'>
61
+ <span class="help-block" v-if="$v.f_stairmonths.dctest">阶段月数不能大于12</span>
62
+ </div>
63
+ <div :class="[$v.f_stair_start_date.required ? 'has-error' : 'has-success']" class="col-sm-6 form-group" v-if="stairStartShow">
64
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_stair_start_date" v-show="false"
65
+ v-validate:f_stair_start_date='{required: true }'>
66
+ <label class="font_normal_body" for="f_stair_start_date">开始日期</label>
67
+ <datepicker :disabled='isEdit'
68
+ :format="'yyyy-MM-dd'"
69
+ :value.sync="model.f_stair_start_date"
70
+ class="datepicker"
71
+ id="f_stair_start_date"
72
+ placeholder="阶梯开始日期"
73
+ style="width: 60%"
74
+ v-model="model.f_stair_start_date">
75
+ </datepicker>
76
+ <span class="help-block" id="helpBlock" style="font-size: 1.4rem">本年或<br/>本月1号</span>
77
+ </div>
78
+ </div>
79
+ <div class="row">
80
+ <div :class="[$v.f_perform_date.required ? 'has-error' : 'has-success']" class="col-sm-6 form-group" class="col-sm-6">
81
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_perform_date" v-show="false"
82
+ v-validate:f_perform_date='{required: true }'>
83
+ <label class="font_normal_body" for="f_perform_date">生效日期</label>
84
+ <datepicker :disabled='isEdit'
85
+ :value.sync="model.f_perform_date"
86
+ id="f_perform_date"
87
+ placeholder="生效日期"
88
+ :format="'yyyy-MM-dd HH:mm:ss'"
89
+ style="width: 60%" v-model="model.f_perform_date">
90
+ </datepicker>
91
+ </div>
92
+ <div class="col-sm-6 form-group">
93
+ <label class="font_normal_body">是否低保</label>
94
+ <v-select :options='isLowIncomes'
95
+ :value-single="true"
96
+ :value.sync="model.f_islow_income"
97
+ close-on-select
98
+ placeholder='请选择'
99
+ style="width: 60%" v-model="model.f_islow_income">
100
+ </v-select>
101
+ </div>
102
+ <div :class="[$v.f_population_base.pattern ? 'has-error' : 'has-success']" class="col-sm-6 form-group" v-if="model.f_price_type === '阶梯气价'">
103
+ <label class="font_normal_body" for="f_population_base">人口基数</label>
104
+ <input :disabled='isEdit' :value.sync="model.f_population_base" class="input_search" placeholder="人口基数"
105
+ style="width:60%"
106
+ type="text" v-model="model.f_population_base" v-validate:f_population_base="{pattern: '/^[1-9]\\d*$/'}">
107
+ </div>
108
+ <div class="col-sm-6 form-group">
109
+ <label class="font_normal_body">使用公司</label>
110
+ <res-select :initresid='curorgid'
111
+ @res-select="getorg"
112
+ is-mul="false"
113
+ restype='organization'>
114
+ </res-select>
115
+ </div>
116
+ <unit-price :is-disable.sync='isEdit' :unitmodel.sync='model.detailprice' v-if="unitshow"></unit-price>
117
+ </div>
118
+
119
+ <div v-if="config.heatingSeason && model.f_price_type == '阶梯气价'">
120
+ <div class="row">
121
+ <div class="col-sm-6 form-group">
122
+ <label class="font_normal_body">是否采暖</label>
123
+ <v-select :options='isLowIncomes'
124
+ :value-single="true"
125
+ :value.sync="model.f_isheat"
126
+ close-on-select
127
+ placeholder='请选择'
128
+ style="width: 60%" v-model="model.f_isheat">
129
+ </v-select>
130
+ </div>
131
+ <div class="col-sm-6 form-group">
132
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_deduction_way" v-show="false"
133
+ v-validate:f_deduction_way='{required: true }'>
134
+ <label class="font_normal_body">扣费方式</label>
135
+ <v-select :options='deductionWays'
136
+ :value-single="true"
137
+ :value.sync="model.f_deduction_way"
138
+ @change="deductionChange"
139
+ close-on-select
140
+ placeholder='请选择'
141
+ style="width: 60%" v-model="model.f_deduction_way">
142
+ </v-select>
143
+ </div>
144
+
145
+ </div>
146
+ <div class="row" v-if="model.f_isheat == '1'">
147
+ <div :class="[$v.f_heat_start_date.required ? 'has-error' : 'has-success']" class="col-sm-6 form-group">
148
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_heat_start_date" v-show="false"
149
+ v-validate:f_heat_start_date='{required: true }'>
150
+ <label class="font_normal_body">采暖起始</label>
151
+ <datepicker :disabled='isEdit'
152
+ :format="'MM-dd'"
153
+ :value.sync="model.f_heat_start_date"
154
+ class="datepicker"
155
+ placeholder="阶梯开始日期"
156
+ style="width: 60%" v-model="model.f_heat_start_date">
157
+ </datepicker>
158
+ </div>
159
+ <div :class="[$v.f_heat_cycle.dctest ? 'has-error' : 'has-success']" class="col-sm-6 form-group" >
160
+ <label class="font_normal_body">采暖周期</label>
161
+ <input class="input_search" style="width:60%" type="number"
162
+ v-model="model.f_heat_cycle" v-validate:f_heat_cycle='{dctest: [ 12, "<=" ] }'>
163
+ </div>
164
+ </div>
165
+ </div>
166
+ <div class="row" >
167
+ <div class="col-sm-6 form-group">
168
+ <label class="font_normal_body ">优&ensp;先&ensp;级</label>
169
+ <input :disabled='isEdit' class="input_search" placeholder="优先级" style="width:60%"
170
+ type="text" v-model="model.f_priority" v-validate:f_priority='{required: true }'>
171
+ </div>
172
+ </div>
173
+ <div class="row">
174
+ <div class="col-sm-12 form-group" style="height: auto !important;">
175
+ <label class="font_normal_body ">备&emsp;&emsp;注</label>
176
+ <textarea class="input_textarea" rows="3" style="width:80%;margin-top:5px;" v-model="model.f_comments"></textarea>
177
+ </div>
178
+ </div>
179
+
180
+ </form>
181
+
182
+ <!--<div style="width: 40%;overflow-y: scroll">-->
183
+ <div class='auto' style="margin-top: 10px;">
184
+
185
+ <mix-price :is-disable.sync='isEdit' :mixmodel.sync='model.detailprice' v-if="mixshow"></mix-price>
186
+ <stair-price :is-disable.sync='isEdit' :isheat.sync="model.f_isheat" :stairmodel.sync='model.detailprice' style="height: 40%;"
187
+ v-if="stairshow"></stair-price>
188
+ </div>
189
+
190
+ <div style="text-align:right;height:auto;margin-top:6px;">
191
+ <button :disabled='!$v.valid' @click="confirm()" class="button_search" v-if="!isEdit">确认</button>
192
+ <button @click="deletePrice()" class="button_delete" v-if="!isEdit && data.usercount === 0 && data.usercountnew === 0">删除</button>
193
+ <button @click="limitClick" class="button_search" type="button" v-if="config.isLimit">限购配置</button>
194
+ <button @click="close()" class="button_clear">取消</button>
195
+ </div>
196
+ <div v-if="data" style="text-align:right;height:auto;margin-top:6px;">
197
+ <a @click="showChangeView">查看变更记录</a>
198
+ </div>
199
+ <!--</div>-->
200
+ </validator>
201
+ <limit-gas :f_price_id="model.id" :show.sync="limitShow" @limit="getLimitGas"></limit-gas>
202
+ <upload v-if="data" :blodid="blodid" cols="col-sm-12" isremark="true" fusetype="气价修改"></upload>
203
+ </div>
204
+ </template>
205
+ <script>
206
+ /**
207
+ *阶梯气价管理组件
208
+ */
209
+
210
+ import {HttpResetClass} from 'vue-client'
211
+ let initGen = async function (self, val) {
212
+ let http = new HttpResetClass()
213
+ self.blodid = self.data.id
214
+ // 启动流程的情况下 获取改气价有无正在审核的气价,若有则禁止编辑,若无则可编辑
215
+ let hasUnAudit = false
216
+ console.log('当前信息', val)
217
+ if (self.config.audit) {
218
+ let res = await http.load('POST', 'rs/sql/saleSingleTable', {
219
+ data: {
220
+ tablename: 't_stairprice',
221
+ condition: `f_price_id = '${val.f_price_id}' and f_filialeid = '${val.f_filialeids}' and f_state = '待审核'`
222
+ }
223
+ }, {resolveMsg: null, rejectMsg: '获取有无待审核气价时出错!!!'})
224
+ console.log('获取有无待审核气价', res)
225
+ // 这里默认待审核气价只有一条
226
+ if (res.data.length === 1) {
227
+ // 判断当前气价是否是待审核气价
228
+ hasUnAudit = res.data[0].id !== val.id
229
+ } else if (res.data.length > 1) {
230
+ self.$showAlert('意外获取到多条待审核记录!请联系管理人员!', 'danger', 0)
231
+ }
232
+ }
233
+ self.model = Object.assign({}, self.model, val)
234
+
235
+ self.model.f_filialeid = self.model.f_filialeid ? self.model.f_filialeid : self.f_filialeid
236
+ self.model.f_orgid = self.model.f_orgid ? self.model.f_orgid : self.$login.f.orgid
237
+ self.model.f_orgname = self.model.f_orgname ? self.model.f_orgname : self.$login.f.orgs
238
+ self.model.f_depid = self.model.f_depid ? self.model.f_depid : self.$login.f.depids
239
+ self.model.f_depname = self.model.f_depname ? self.model.f_depname : self.$login.f.deps
240
+
241
+ self.curorgid.push(self.model.f_filialeid)
242
+ self.model.f_islow_income = self.model.f_islow_income + ''
243
+ self.model.f_isheat = self.model.f_isheat + ''
244
+
245
+ self.stairStartShow = !self.model.f_deduction_way.includes('day')
246
+ self.isEdit = self.model.f_price_state === '已作废' || hasUnAudit
247
+ console.log('观察data里面的model', self.model, val)
248
+ if (self.model.id) {
249
+ let price = await http.load('POST', 'rs/sql/singleTable_OrderBy', {
250
+ data: {
251
+ items: 'f_price_name, f_gas, f_price, isnull(f_add_gas, 0) f_add_gas, isnull(f_add_gas_heat, 0) f_add_gas_heat',
252
+ tablename: 't_detailprice',
253
+ condition: `f_stairprice_id = '${self.model.id}'`,
254
+ orderitem: 'f_price_name asc'
255
+ }
256
+ }, {resolveMsg: null, rejectMsg: '获取气价明细出错!!!'})
257
+
258
+ if (self.model.f_price_type[0] === '混合气价') {
259
+ price.data[0].f_mixprice = [price.data[0].f_mixprice]
260
+ price.data[1].f_mixprice = [price.data[1].f_mixprice]
261
+ }
262
+ self.model.detailprice = price.data
263
+ }
264
+ }
265
+
266
+ export default {
267
+ data () {
268
+ return {
269
+ unitshow: false,
270
+ mixshow: false,
271
+ blodid: '',
272
+ stairshow: false,
273
+ model: {
274
+ f_price_type: [],
275
+ f_stairmonths: 1,
276
+ f_perform_date: '',
277
+ detailprice: [],
278
+ f_population_base: 4,
279
+ f_population_increment: 0,
280
+ f_stair_start_date: '',
281
+ f_heat_way: '按月',
282
+ f_deduction_way: this.config.deductionWay,
283
+ f_islow_income: '0',
284
+ f_isheat: '0',
285
+ f_comments: '',
286
+ f_priority: 100
287
+ },
288
+ // 编辑控制
289
+ isEdit: false,
290
+
291
+ // 扣费方式的改变 如果涉及日运算,则阶梯开始时间和生效时间不做显示
292
+ stairStartShow: true,
293
+
294
+ // 公司树状图信息
295
+ curorgid: [],
296
+
297
+ f_filialeid: '', // 所属公司
298
+ f_filialename: '', // 所属公司名称
299
+
300
+ // 限购配置
301
+ limitShow: false,
302
+ limit_gas: null,
303
+
304
+ // 下拉框数据
305
+ usertype: this.$appdata.getParam('用户类型'),
306
+ pricetype: this.$appdata.getParam('气价类型'),
307
+ hearways: [{label: '按月', value: '按月'}, {label: '按季', value: '按季'}],
308
+ isLowIncomes: [{label: '是', value: '1'}, {label: '否', value: '0'}],
309
+ deductionWays: [{label: '周期扣费', value: 'cycle'}, {label: '周期平均扣费', value: 'cycleMM'}, {label: '日运算扣费', value: 'day'}, {label: '采暖季独立扣费', value: 'singleHS'}, {label: '采暖季日扣费', value: 'dayHS'}],
310
+ gastype: []
311
+ }
312
+ },
313
+ props: ['data', 'config', 'f_filialeid'],
314
+ watch: {
315
+ 'data' (val) {
316
+ if (val) {
317
+ initGen(this, val)
318
+ } else {
319
+ this.initModel()
320
+ }
321
+ },
322
+ 'model.f_price_type' (val) {
323
+ this.unitshow = false
324
+ this.mixshow = false
325
+ this.stairshow = false
326
+ if (val === '固定气价') {
327
+ this.model.detailprice = []
328
+ this.unitshow = true
329
+ } else if (val === '混合气价') {
330
+ this.model.detailprice = []
331
+ this.mixshow = true
332
+ } else if (val === '阶梯气价') {
333
+ this.model.detailprice = [{f_gas: '', f_price: '', f_add_gas: 0, f_add_gas_heat: 0}]
334
+ if (this.model.f_deduction_way == undefined || this.model.f_deduction_way == '') {
335
+ this.model.f_deduction_way = 'cycle'
336
+ }
337
+ this.stairshow = true
338
+ }
339
+ }
340
+ },
341
+ ready () {
342
+ console.log('看看都传了什么', this.data, this.config)
343
+ initGen(this, this.data)
344
+ },
345
+ methods: {
346
+ async CheckDuplicate () {
347
+ if (!this.data) {
348
+ let http = new HttpResetClass()
349
+ let res = await http.load('post', 'rs/sql/getGasPriceInfo', {data: {condition: ` f_filialeid in ('${this.$login.f.orgid}') and 1=1 `, orderitem: 'f_price_id'}}, {resolveMsg: null, rejectMsg: null})
350
+ for (let i = 0; i < res.data.length; i++) {
351
+ if (res.data[i].f_price_name == this.model.f_price_name) {
352
+ this.$showAlert('气价名称重复,请重新输入', 'warning', 3000)
353
+ this.model.f_price_name = ''
354
+ return
355
+ }
356
+ }
357
+ }
358
+ },
359
+ async confirm () {
360
+ // 验证公司组织是否已选择
361
+ try {
362
+ if (!this.f_filialeid) {
363
+ this.$showAlert('请选择气价使用公司', 'warning', 2000)
364
+ return
365
+ }
366
+ if (this.data) {
367
+ if (this.data.f_perform_date == this.model.f_perform_date) {
368
+ this.$showAlert('请更改生效日期', 'warning', 2000)
369
+ return
370
+ }
371
+ let datenow = new Date()
372
+ let a = datenow.setDate(datenow.getDate() - 1)
373
+ let month = datenow.getMonth() + 1
374
+ let date = datenow.getDate()
375
+ let hour = datenow.getHours()
376
+ let min = datenow.getMinutes()
377
+ let sec = datenow.getSeconds()
378
+ a = datenow.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
379
+ a = a + ' 23:59:59'
380
+ if (this.model.f_perform_date <= this.data.f_perform_date) {
381
+ this.$showAlert('生效日期不能小于上次生效时间', 'warning', 2000)
382
+ return
383
+ }
384
+ }
385
+
386
+ // 验证此生效时间之后是否有待使用气价, 如果有提示是否作废待使用气价,
387
+ let validateResult = await this.$resetpost('rs/logic/sale_validatePrice', {data: this.model}, {
388
+ resolveMsg: null,
389
+ rejectMsg: '验证气价出错!!'
390
+ })
391
+ console.log('验证气价:', validateResult)
392
+ if (validateResult.data.toBeUsePrice.length > 0) {
393
+ // 有待使用气价, 将待使用气价信息展示
394
+ let awaitOper = await this.$showMessage(`此气价存在待使用记录, 将于${validateResult.data.toBeUsePrice[0].f_perform_date} 开始使用!是否将其作废?`, ['confirm', 'cancel'])
395
+ console.log('用户点击了:', {awaitOper})
396
+ if (awaitOper == 'confirm') {
397
+ // 传至后台用于新版本号的处理
398
+ this.model.toBeUsePriceId = validateResult.data.toBeUsePrice[0].id
399
+ this.model.toBeUsePriceVersion = validateResult.data.toBeUsePrice[0].f_version
400
+ this.savePrice()
401
+ }
402
+ } else {
403
+ this.savePrice()
404
+ }
405
+ } catch (e) {
406
+ this.$dispatch('error', '气价管理', this.data, res)
407
+ }
408
+ },
409
+
410
+ async savePrice () {
411
+ // 去除重复或者空的明细
412
+ if (this.model.f_price_type[0] === '阶梯气价') {
413
+ this.removeDuplication(this.model)
414
+ }
415
+ // 审核配置
416
+ this.model.audit = this.config.audit
417
+
418
+ console.log('进入保存气价方法')
419
+ this.model.f_filialeid = this.f_filialeid ? this.f_filialeid : this.$login.f.orgid
420
+
421
+ if (this.limit_gas) {
422
+ this.model.limit_gas = this.limit_gas
423
+ //this.model.limit_gas.f_start_date = this.model.f_perform_date
424
+ }
425
+ // 现调用气价修改的逻辑 返回:version 和之前的对比 增加的话, 进行提示操作 反之 结束
426
+ await this.$LogicService.gasPrice(this.model, this.data)
427
+ // 操作了气价 清空分公司initdata缓存
428
+ let http = new HttpResetClass()
429
+ await http.load('POST', 'rs/logic/delSaleInitData', {data: {}}, {resolveMsg: null, rejectMsg: null})
430
+
431
+ this.$dispatch('success', '气价管理', this.data)
432
+ this.initModel()
433
+ },
434
+
435
+ async deletePrice () {
436
+ let res = await this.$showMessage(`您确定要删除此气价吗?`, ['confirm', 'cancel'])
437
+ if (res === 'confirm') {
438
+ await this.$resetpost('rs/logic/delprice', {data: {id: this.model.id}}, {
439
+ resolveMsg: '删除气价成功',
440
+ rejectMsg: '删除气价失败'
441
+ })
442
+ let http = new HttpResetClass()
443
+ await http.load('POST', 'rs/logic/delSaleInitData', {data: {}}, {resolveMsg: null, rejectMsg: null})
444
+ }
445
+ this.$dispatch('success')
446
+ },
447
+
448
+ getLimitGas (val) {
449
+ console.log('获取到限购值。', val)
450
+ this.limit_gas = val
451
+ },
452
+
453
+ getorg (id, name) {
454
+ this.f_filialeid = id[0]
455
+ this.f_filialename = name[0]
456
+ },
457
+ initModel () {
458
+ this.model = {
459
+ f_user_type: '',
460
+ f_gasproperties: '',
461
+ f_price_type: '',
462
+ f_stairmonths: 1,
463
+ f_perform_date: '',
464
+ detailprice: [],
465
+ f_stair_start_date: '',
466
+ f_population_increment: 0,
467
+ f_population_base: 4,
468
+ f_comments: '',
469
+ f_deduction_way: this.config.deductionWay
470
+ }
471
+ },
472
+ close () {
473
+ this.$dispatch('close')
474
+ },
475
+ removeDuplication (val) {
476
+ if (val.detailprice.length > 0) {
477
+ let hash = []
478
+ let arr = []
479
+ for (var i = 0; i < val.detailprice.length; i++) {
480
+ // hash[val.detailprice[i].f_gas] != null
481
+ if (!val.detailprice[i].f_gas) {
482
+ continue
483
+ }
484
+ if (!hash[val.detailprice[i].f_gas]) {
485
+ arr.push(val.detailprice[i])
486
+ hash[val.detailprice[i].f_gas] = true
487
+ }
488
+ }
489
+ val.detailprice = arr
490
+ }
491
+ },
492
+ usertypeChange (val) {
493
+ if (val) {
494
+ this.gastype = this.$appdata.getParam(this.model.f_user_type)
495
+ }
496
+ },
497
+ deductionChange (val) {
498
+ // 扣费方式的改变 如果涉及日运算,则阶梯开始时间和生效时间不做显示
499
+ this.stairStartShow = !val.includes('day')
500
+ },
501
+ limitClick () {
502
+ this.limitShow = true
503
+ },
504
+ showChangeView () {
505
+ this.$parent.changeView = true
506
+ }
507
+ }
508
+ }
509
+ </script>
510
+ <style lang="less">
511
+ #gas-price-form {
512
+ .form-group {
513
+ margin-left: 0px;
514
+ margin-right: 0px;
515
+ }
516
+ }
517
+
518
+ </style>
@@ -0,0 +1,319 @@
1
+ <template>
2
+ <div @keyup.enter="search" class="flex">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria @condition-changed='$parent.selfSearch' partial='criteria' v-ref:cri>
5
+ <div class="form-horizontal select-overspread container-fluid auto" novalidate partial>
6
+ <div class="row">
7
+ <div :class="{'col-sm-2 form-group':!$parent.$parent.$parent.isdetail,'col-sm-3 form-group':$parent.$parent.$parent.isdetail}">
8
+ <label class="font_normal_body">组织机构</label>
9
+ <res-select :initresid='$parent.$parent.curorgid'
10
+ @res-select="$parent.$parent.getorg"
11
+ class="select select_list"
12
+ restype='organization'
13
+ style="width: 60%">
14
+ </res-select>
15
+ </div>
16
+ <div :class="{'col-sm-2 form-group':!$parent.$parent.$parent.isdetail,'col-sm-3 form-group':$parent.$parent.$parent.isdetail}">
17
+ <label class="font_normal_body">气价名称</label>
18
+ <input class="input_search" condition="f_price_name like '%{}%'" placeholder='气价名称' style="width:60%" type="text"
19
+ v-el:qjmc v-model="model.f_price_name" v-next-el="cx"
20
+ >
21
+ </div>
22
+ <!--<div class="col-sm-4">-->
23
+ <!--<label class="font_normal_body">生效时间大于</label>-->
24
+ <!--<datepicker :format="'yyyy-MM-dd'"-->
25
+ <!--:value.sync="model.performDate"-->
26
+ <!--placeholder="生效日期"-->
27
+ <!--condition="performDate > '{}'"-->
28
+ <!--v-model="model.performDate" style="width: 55%">-->
29
+ <!--</datepicker>-->
30
+ <!--</div>-->
31
+ <div class="form-group col-sm-6 button-range" style="margin-right: 10px" >
32
+ <button @click="$parent.$parent.batchAdjust()" class="button_new button_spacing">批量调价</button>
33
+ <button @click="$parent.$parent.search()" class="button_search button_spacing" v-el:cx>查询</button>
34
+ <button @click="$parent.$parent.add()" class="button_new button_spacing">新增</button>
35
+
36
+ <div :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
37
+ @click="$parent.$parent.criteriaShow=!$parent.$parent.criteriaShow"
38
+ class="button_spacing"
39
+ style="float: right"></div>
40
+ </div>
41
+ </div>
42
+ <div class="row" v-show="$parent.$parent.criteriaShow">
43
+ <div :class="{'col-sm-2 form-group':!$parent.$parent.$parent.isdetail,'col-sm-3 form-group':$parent.$parent.$parent.isdetail}">
44
+ <label class="font_normal_body">气价编号</label>
45
+ <input type="number" class="input_search" style="width: 60%" v-model="model.f_user_name" placeholder='气价编号'
46
+ condition="f_price_id = '{}'" >
47
+ </div>
48
+ <div :class="{'col-sm-2 form-group':!$parent.$parent.$parent.isdetail,'col-sm-3 form-group':$parent.$parent.$parent.isdetail}">
49
+ <label class="font_normal_body">气价来源</label>
50
+ <v-select :value.sync="model.f_custom" v-model="model.f_custom"
51
+ placeholder='气价来源' :options="$parent.$parent.custom"
52
+ condition="custom = '{}'"
53
+ close-on-select v-ref:type>
54
+ </v-select>
55
+ </div>
56
+ <div :class="{'col-sm-2 form-group':!$parent.$parent.$parent.isdetail,'col-sm-3 form-group':$parent.$parent.$parent.isdetail}">
57
+ <label class="font_normal_body">客户类型</label>
58
+ <v-select :value.sync="model.f_user_type"
59
+ @change="$parent.$parent.userTypeChange()"
60
+ :options='$parent.$parent.usertypes' placeholder='请选择' v-model="model.f_user_type"
61
+ condition="f_user_type = '{}'"
62
+ close-on-select></v-select>
63
+ </div>
64
+ <div :class="{'col-sm-2 form-group':!$parent.$parent.$parent.isdetail,'col-sm-3 form-group':$parent.$parent.$parent.isdetail}">
65
+ <label class="font_normal_body">用气性质</label>
66
+ <v-select :value.sync="model.f_gasproperties" v-model="model.f_gasproperties"
67
+ :options='$parent.$parent.gasproperties' placeholder='请选择'
68
+ condition="f_gasproperties = '{}'"
69
+ close-on-select></v-select>
70
+ </div>
71
+ <div :class="{'col-sm-2 form-group':!$parent.$parent.$parent.isdetail,'col-sm-3 form-group':$parent.$parent.$parent.isdetail}">
72
+ <label class="font_normal_body">气价类型</label>
73
+ <v-select :value.sync="model.pricetype" v-model="model.pricetype"
74
+ placeholder='气价类型' :options="$parent.$parent.pricetypes"
75
+ condition="f_price_type = '{}'"
76
+ close-on-select v-ref:type>
77
+ </v-select>
78
+ </div>
79
+ <div :class="{'col-sm-2 form-group':!$parent.$parent.$parent.isdetail,'col-sm-3 form-group':$parent.$parent.$parent.isdetail}">
80
+ <label class="font_normal_body">气价状态</label>
81
+ <v-select :value.sync="model.f_price_state" v-model="model.f_price_state"
82
+ placeholder='气价状态' :options="$parent.$parent.price_states"
83
+ condition="f_price_state = '{}'"
84
+ close-on-select v-ref:type>
85
+ </v-select>
86
+ </div>
87
+ </div>
88
+ </div>
89
+
90
+ </criteria>
91
+ <data-grid :model="model" class="list_area table_sy" partial='list' v-ref:grid>
92
+ <template partial='head'>
93
+ <tr>
94
+ <th>
95
+ <nobr>序号</nobr>
96
+ </th>
97
+ <th>
98
+ <nobr>气价编号</nobr>
99
+ </th>
100
+ <th v-show="!$parent.$parent.$parent.$parent.usershow && !($parent.$parent.$parent.$parent.isdetail && !$parent.$parent.$parent.$parent.usershow)">
101
+ <nobr>气价名称</nobr>
102
+ </th>
103
+ <th v-show="!$parent.$parent.$parent.$parent.usershow && !($parent.$parent.$parent.$parent.isdetail && !$parent.$parent.$parent.$parent.usershow)">
104
+ <nobr>客户类型</nobr>
105
+ </th>
106
+ <th v-show="!$parent.$parent.$parent.$parent.usershow && !($parent.$parent.$parent.$parent.isdetail && !$parent.$parent.$parent.$parent.usershow)">
107
+ <nobr>用气性质</nobr>
108
+ </th>
109
+ <th v-show="!$parent.$parent.$parent.$parent.usershow && !($parent.$parent.$parent.$parent.isdetail && !$parent.$parent.$parent.$parent.usershow)">
110
+ <nobr>气价类型</nobr>
111
+ </th>
112
+ <th>
113
+ <nobr>最新版本</nobr>
114
+ </th>
115
+ <th>
116
+ <nobr>气价信息</nobr>
117
+ </th>
118
+ <th>
119
+ <nobr>使用分公司</nobr>
120
+ </th>
121
+ <th>
122
+ <nobr>使用户数</nobr>
123
+ </th>
124
+ <th>
125
+ <nobr>报建使用户数</nobr>
126
+ </th>
127
+ <th>
128
+ <nobr>气价状态</nobr>
129
+ </th>
130
+ <th v-if="$parent.$parent.$parent.config.audit">
131
+ <nobr>操作</nobr>
132
+ </th>
133
+ <th>
134
+ <nobr>历史记录</nobr>
135
+ </th>
136
+ </tr>
137
+ </template>
138
+ <template partial='body'>
139
+ <tr>
140
+ <td style="text-align:center">{{$index + 1}}</td>
141
+ <td style="text-align:center">{{row.f_price_id}}</td>
142
+ <td style="text-align:center" v-show="!$parent.$parent.$parent.$parent.usershow && !($parent.$parent.$parent.$parent.isdetail && !$parent.$parent.$parent.$parent.usershow)"><nobr>{{row.f_price_name}}</nobr></td>
143
+ <td style="text-align:center" v-show="!$parent.$parent.$parent.$parent.usershow && !($parent.$parent.$parent.$parent.isdetail && !$parent.$parent.$parent.$parent.usershow)">{{row.f_user_type}}</td>
144
+ <td style="text-align:center" v-show="!$parent.$parent.$parent.$parent.usershow && !($parent.$parent.$parent.$parent.isdetail && !$parent.$parent.$parent.$parent.usershow)">{{row.f_gasproperties}}</td>
145
+ <td style="text-align:center" v-show="!$parent.$parent.$parent.$parent.usershow && !($parent.$parent.$parent.$parent.isdetail && !$parent.$parent.$parent.$parent.usershow)">{{row.f_price_type}}</td>
146
+ <td style="text-align:center">{{row.new_version}}</td>
147
+ <td style="text-align:center"><nobr>{{row.f_value}}</nobr></td>
148
+ <td style="text-align:center"><nobr>{{row.f_filiale_name}}</nobr></td>
149
+ <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>
150
+ <td style="text-align:center"><b>{{row.usercountnew}}</b></td>
151
+ <td style="text-align:center">{{row.f_price_state}}</td>
152
+ <td style="text-align:center" v-if="$parent.$parent.$parent.config.audit">
153
+ <button :disabled="$login.r.includes('气价审核')" @click.stop="$parent.$parent.$parent.passPrice(row)"
154
+ class="btn btn-link" v-if="row.f_state === '待审核'">通过
155
+ </button>
156
+ </td>
157
+ <td style="text-align: center;">
158
+ <button type="button" name="button" class="button_search-2 button_spacing width-60"
159
+ @click.stop="$parent.$parent.$parent.showhistory(row)">查看</button>
160
+ </td>
161
+ </tr>
162
+ </template>
163
+ <template partial='foot'></template>
164
+ </data-grid>
165
+ </criteria-paged>
166
+ <modal :backdrop="false" :show.sync="show" v-if="show" width="1000px">
167
+ <header class="modal-header" slot="modal-header">
168
+ <button @click="show=!show" class="close" type="button"><span>&times;</span></button>
169
+ <h4 class="modal-title">历史记录</h4>
170
+ </header>
171
+ <article class="modal-body" slot="modal-body" style="height:100%;width:100%" title="历史记录">
172
+ <price-change-history :row="row" :show.sync="show" @select-changed="historySeleted" v-on:toggle="close"></price-change-history>
173
+ </article>
174
+ <footer class="modal-footer" slot="modal-footer">
175
+
176
+ </footer>
177
+ </modal>
178
+ </div>
179
+ </template>
180
+
181
+ <script>
182
+ /**
183
+ *阶梯气价查询列表
184
+ */
185
+ import {PagedList} from 'vue-client'
186
+ import Vue from 'vue'
187
+
188
+ let passGen = async function (self, row) {
189
+ let param = {
190
+ id: row.id,
191
+ userid: self.$login.f.id
192
+ }
193
+ await self.$resetpost('rs/logic/priceNextFlow', param, {
194
+ warnMsg: `确定要通过气价名称为: ${row.f_price_name}的气价吗?`,
195
+ resolveMsg: '审核通过',
196
+ rejectMsg: '流程进行出错!!!'
197
+ })
198
+ self.$dispatch('success')
199
+ }
200
+
201
+ export default {
202
+ data () {
203
+ return {
204
+ model: new PagedList('rs/sql/getGasPriceInfo', 20, {performDate: 'this.model.performDate', orderitem: `'${this.orderitem}'`}),
205
+ show: false,
206
+ criteriaShow: false,
207
+ // 公司下拉
208
+ curorgid: [this.$login.f.orgid],
209
+ row: {},
210
+ f_orgid: '',
211
+ gasproperties: [],
212
+ custom: [{label: '全部', value: ''}, {label: '正常气价', value: '正常气价'}, {label: '自定义气价', value: '自定义气价'}],
213
+ price_states: [{label: '全部', value: ''}, {label: '使用中', value: '使用中'}, {label: '删除', value: '删除'}, {label: '已作废', value: '已作废'}],
214
+ usertypes: this.$appdata.getParam('用户类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')] : []
215
+ }
216
+ },
217
+ props: {
218
+ orderitem: {
219
+ type: String,
220
+ default: 'f_price_id'
221
+ },
222
+ row: {},
223
+ config: {},
224
+ ispartial: false,
225
+ f_filialeid: {
226
+ type: String
227
+ }
228
+ },
229
+ ready () {
230
+ this.$refs.paged.$refs.cri.model.performDate = this.$login.toStandardDateString()
231
+ this.$refs.paged.$refs.cri.model.f_price_state = '使用中'
232
+ this.search()
233
+ },
234
+ methods: {
235
+ batchAdjust () {
236
+ this.$parent.usershow = true
237
+ this.$parent.priceid = null
238
+ this.$parent.priceorgid = null
239
+ },
240
+ showhistory (row) {
241
+ this.show = true
242
+ this.row = row
243
+ },
244
+ userTypeChange () {
245
+ this.gasproperties = []
246
+ if (this.$refs.paged.$refs.cri.model !== null) {
247
+ this.$refs.paged.$refs.cri.model.f_gasproperties = ''
248
+ this.gasproperties = this.$appdata.getParam(this.$refs.paged.$refs.cri.model.f_user_type[0])
249
+ } else {
250
+ this.gasproperties = [{label: '全部', value: ''}]
251
+ }
252
+ },
253
+ operate (id, pricename, orgid) {
254
+ this.$parent.usershow = true
255
+ this.$parent.priceid = id
256
+ this.$parent.pricename = pricename
257
+ this.$parent.priceorgid = orgid
258
+ },
259
+ search () {
260
+ this.$refs.paged.$refs.cri.search()
261
+ this.$dispatch('search')
262
+ },
263
+ hidden () {
264
+ this.criteriaShow = !this.criteriaShow
265
+ },
266
+ getorg (val) {
267
+ this.f_orgid = this.$login.convertToIn(val)
268
+ this.f_filialeid = val[0]
269
+ },
270
+ selfSearch (args) {
271
+ if (!this.f_orgid) {
272
+ this.getorg([this.$login.f.orgid])
273
+ }
274
+ console.log('查询。。。', this.f_orgid)
275
+ if (this.f_orgid) {
276
+ args.condition = `f_filialeid in ${this.f_orgid} and ${args.condition}`
277
+ }
278
+ this.$refs.paged.$refs.grid.$el.scrollTop = 0
279
+ this.model.search(args.condition, args.model)
280
+ },
281
+ add () {
282
+ this.$dispatch('add')
283
+ },
284
+ passPrice (row) {
285
+ console.log('气价审核通过。。。', row, this.$refs.paged.$refs.grid.selected)
286
+ let selectedRow = this.$refs.paged.$refs.grid.selected
287
+ if (selectedRow) {
288
+ if (row.id !== selectedRow.id && selectedRow.f_state === '待审核') {
289
+ this.$showAlert('您通过的气价信息不是您选中的信息', 'warning', 3000)
290
+ } else {
291
+ passGen(this, row)
292
+ }
293
+ } else {
294
+ passGen(this, row)
295
+ }
296
+ },
297
+ historySeleted () {
298
+
299
+ }
300
+
301
+ },
302
+ watch: {
303
+ 'model.rows.length' (val) {
304
+ if (val === 1) {
305
+ this.$refs.paged.$refs.grid.select(this.model.rows[0])
306
+ this.$parent.usershow = false
307
+ }
308
+ }
309
+ },
310
+ computed: {
311
+ pricetypes () {
312
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('气价类型')]
313
+ },
314
+ bookstates () {
315
+ return [ {label: '有效', value: "= '有效'"}, {label: '无效', value: "= '无效'"} ]
316
+ }
317
+ }
318
+ }
319
+ </script>
@@ -36,6 +36,10 @@ let specialComp = {
36
36
  // 使用该抄表册的用户信息(使用户数)
37
37
  'meterbook-user':(resolve) => { require(['./MeterBookUser'], resolve) },
38
38
  // 补费扣费
39
- 'deduction-manage': (resolve) => { require(['./deductionManage'], resolve) }
39
+ 'deduction-manage': (resolve) => { require(['./deductionManage'], resolve) },
40
+ // 气价管理(新增)
41
+ 'gas-price': (resolve) => { require(['./comprehen/StairPrice/GasPrice'], resolve) },
42
+ // 所有气价信息列表
43
+ 'gas-price-list': (resolve) => { require(['./comprehen/StairPrice/GasPriceList'], resolve) }
40
44
  }
41
45
  exports.specialComp = specialComp