sale-client 3.6.248 → 3.6.250

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.6.248",
3
+ "version": "3.6.250",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <div class="auto">
3
+ <validator name='m'>
4
+ <form novalidate class="form-horizontal select-overspread">
5
+ <div class="row" style="margin-top:10px;">
6
+ <div class="col-sm-8">
7
+ <label for="f_address" class="font_normal_body ">新卡号</label>
8
+ <input class="input_search " style="width:80%" v-model="model.f_card_id_new" placeholder='新卡号' :value="row.f_card_id_new" >
9
+ </div>
10
+ <div class="col-sm-4">
11
+ <label for="f_idnumber" class="font_normal_body ">旧卡号</label>
12
+ <input class="input_search " style="width:60%" v-model="model.f_card_id" placeholder='旧卡号' :value="row.f_card_id" readonly>
13
+ </div>
14
+
15
+ </div>
16
+ <div class="row" style="margin-top:10px;">
17
+ <div class="col-sm-8">
18
+ <label for="f_user_phone" class="font_normal_body ">备&emsp;&emsp;注</label>
19
+ <input class="input_search " style="width:80%" v-model="model.f_nfc_comments" placeholder='备注' :value="row.f_nfc_comments">
20
+ </div>
21
+ </div>
22
+ </form>
23
+ <div style="text-align:right;">
24
+ <button class="button_search btn-gn" @click="confirm()">确认</button>
25
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
26
+ </div>
27
+ </validator>
28
+ </div>
29
+ </template>
30
+ <script>
31
+ export default {
32
+ title: 'NFC卡置换',
33
+ data () {
34
+ return {
35
+ model: {
36
+ f_card_id_new: '',
37
+ f_card_id: '',
38
+ f_user_id: '',
39
+ f_userfiles_id: '',
40
+ f_nfc_comments: '',
41
+ f_user_name: '',
42
+ f_filialeid: '',
43
+ f_userinfo_id: ''
44
+ }
45
+ }
46
+ },
47
+ props: ['row'],
48
+ ready () {
49
+ this.model.f_user_name = this.row.f_user_name
50
+ this.model.f_card_id = this.row.f_card_id
51
+ this.model.f_userfiles_id = this.row.f_userfiles_id
52
+ this.model.f_filialeid = this.$login.f.orgid
53
+ this.model.f_userinfo_id = this.row.f_userinfo_id
54
+ this.model.f_user_id = this.row.f_user_id
55
+ },
56
+ methods: {
57
+ async confirm () {
58
+ if (this.model.f_card_id_new === '' || this.model.f_card_id_new === null) {
59
+ this.$showAlert('请填写新卡号!!', 'warning', 2000)
60
+ return
61
+ }
62
+ this.model.f_operator = this.$login.f.name
63
+ this.model.f_operatorid = this.$login.f.id
64
+ this.model.f_orgid = this.$login.f.orgid
65
+ this.model.f_orgname = this.$login.f.orgs
66
+ this.model.f_depid = this.$login.f.depids
67
+ this.model.f_depname = this.$login.f.deps
68
+
69
+ await this.$resetpost('rs/logic/fileNfcCardUpdate', this.model, {resolveMsg: '档案信息已完善成功', rejectMsg: '档案信息完善失败'})
70
+ this.clean()
71
+ },
72
+ clean () {
73
+ this.$info('取消操作')
74
+ this.$dispatch('refresh', this.row)
75
+ },
76
+
77
+ printok () {
78
+ this.$dispatch('success')
79
+ }
80
+
81
+ },
82
+ computed: {
83
+ }
84
+ }
85
+ </script>
86
+
87
+ <style>
88
+ </style>
@@ -731,6 +731,10 @@ export default {
731
731
  f_meter_book: this.newinfo.f_meter_book[0],
732
732
  old: this.row
733
733
  }
734
+ // 如果更新了气价
735
+ if (this.newinfo.pricename.length > 0) {
736
+ data.newinfo = this.newinfo.pricename[0].f_price_id
737
+ }
734
738
  let meterinfo = await this.$resetpost('rs/logic/changeMeter', data, {
735
739
  resolveMsg: null,
736
740
  rejectMsg: '换表失败!!!'
@@ -831,13 +835,12 @@ export default {
831
835
  this.$dispatch('refresh')
832
836
  }
833
837
  },
834
- async pregasChange() {
838
+ async pregasChange () {
835
839
  if (parseInt(this.model.f_using_base_old) < parseInt(this.row.f_meter_base)) {
836
840
  await this.$showMessage(`录入旧表底数小于系统就表底数请再次核对!`, ['confirm', 'cancel']).then((res) => {
837
841
  if (res === 'confirm') {
838
842
  } else {
839
843
  this.model.f_using_base_old = ''
840
- return
841
844
  }
842
845
  })
843
846
  }
@@ -1048,13 +1051,13 @@ export default {
1048
1051
  } else {
1049
1052
  // 如果 不能 则只需要获取到记录数,采用相对节省资源的查询
1050
1053
  let books = await http.load('POST', 'rs/sql/singleTable_OrderBy', {
1051
- data: {
1052
- items: 'f_whether_pay',
1053
- tablename: 't_handplan',
1054
- condition: ` f_user_id = '${this.row.f_user_id}' and f_oughtfee > 0 and f_hand_state = '有效' and f_meter_state='已抄表' `,
1055
- orderitem: ' id desc'
1056
- }
1057
- }, {resolveMsg: null, rejectMsg: null}
1054
+ data: {
1055
+ items: 'f_whether_pay',
1056
+ tablename: 't_handplan',
1057
+ condition: ` f_user_id = '${this.row.f_user_id}' and f_oughtfee > 0 and f_hand_state = '有效' and f_meter_state='已抄表' `,
1058
+ orderitem: ' id desc'
1059
+ }
1060
+ }, {resolveMsg: null, rejectMsg: null}
1058
1061
  )
1059
1062
  console.log('获取到的欠费记录', books)
1060
1063
  this.books = books
@@ -0,0 +1,524 @@
1
+ <template>
2
+ <div class="auto select-overspread" style="padding-left: 10px;">
3
+ <ul class="nav nav-tabs" style="margin-bottom: 10px">
4
+ <li role="presentation" class="active"><a href="#">气表品牌</a></li>
5
+ </ul>
6
+ <validator name='v'>
7
+ <form novalidate class="form-horizontal select-overspread container-fluid auto">
8
+ <div class="row">
9
+ <div class="col-sm-4 form-group" :class="[$v.f_meter_brand.required ? 'has-error' : 'has-success']">
10
+ <label for="f_meter_brand" class="font_normal_body">气表品牌</label>
11
+ <input class="input_search" style="width: 60%" type="text" v-model="gasmessage.f_meter_brand"
12
+ v-validate:f_meter_brand="['required']">
13
+ </div>
14
+
15
+ <div class="col-sm-4 form-group" :class="[$v.metertype.required ? 'has-error' : '']">
16
+ <label for="f_meter_type" class="font_normal_body">气表类型</label>
17
+ <input type="text" class="input_search" style="width: 60%" v-show="false"
18
+ v-model="$refs.metertype.selectedItems" v-validate:metertype='{required: true }'>
19
+ <v-select :value.sync="gasmessage.f_meter_type"
20
+ v-model="gasmessage.f_meter_type"
21
+ :options='meterType' placeholder='气表类型'
22
+ close-on-select v-ref:metertype style="width: 60%"></v-select>
23
+ </div>
24
+ <div class="col-sm-4 form-group" :class="[$v.f_alias.required ? 'has-error' : 'has-success']">
25
+ <label for="f_alias" class="font_normal_body">别&emsp;&emsp;名</label>
26
+ <input class="input_search" style="width: 60%" type="text" v-model="gasmessage.f_alias"
27
+ v-validate:f_alias='{required: true }' @blur="getInitMeterParamBefore">
28
+ </div>
29
+ <div class="col-sm-4 form-group">
30
+ <label for="f_checkout_limit" class="font_normal_body ">校检年限</label>
31
+ <input class="input_search" style="width: 60%" type="number" v-model="gasmessage.f_checkout_limit">
32
+ </div>
33
+ <div class="col-sm-4 form-group">
34
+ <label for="f_collection_type" class="font_normal_body">缴费方式</label>
35
+ <v-select :value.sync="gasmessage.f_collection_type"
36
+ v-model="gasmessage.f_collection_type"
37
+ :options='collectiontypes' placeholder='缴费方式'
38
+ close-on-select :disabled='colletype' style="width: 60%"></v-select>
39
+ </div>
40
+ <div class="col-sm-4 form-group">
41
+ <label for="f_isdecimal" class="font_normal_body">支持小数</label>
42
+ <v-select :value.sync="gasmessage.f_isdecimal"
43
+ v-model="gasmessage.f_isdecimal"
44
+ :options='isdecimal' placeholder='是否支持小数'
45
+ close-on-select style="width: 60%"></v-select>
46
+ </div>
47
+ <div class="col-sm-4 form-group" v-if="gasmessage.f_isdecimal[0] ==='是'">
48
+ <label for="f_isdecimal" class="font_normal_body">气量位数</label>
49
+ <v-select :value.sync="gasmessage.f_gas_decimal"
50
+ v-model="gasmessage.f_gas_decimal"
51
+ :value-single="true"
52
+ :search="false"
53
+ :options='decimalArray' placeholder='气量位数'
54
+ close-on-select style="width: 60%"></v-select>
55
+ </div>
56
+ <div class="col-sm-4 form-group" v-if="gasmessage.f_isdecimal[0] ==='是'">
57
+ <label for="f_isdecimal" class="font_normal_body">金额位数</label>
58
+ <v-select :value.sync="gasmessage.f_fee_decimal"
59
+ v-model="gasmessage.f_fee_decimal"
60
+ :value-single="true"
61
+ :search="false"
62
+ :options='decimalArray' placeholder='金额位数'
63
+ close-on-select style="width: 60%"></v-select>
64
+ </div>
65
+ <div class="col-sm-4 form-group" v-if="gasmessage.f_meter_type[0].includes('物联网')"
66
+ :class="[$v.calculation.required ? 'select-error' : '']">
67
+ <label for="f_calculation" class="font_normal_body">结算方式</label>
68
+ <input type="text" v-show="false" v-model="$refs.calculation.selectedItems"
69
+ v-validate:calculation='{required: true }'>
70
+ <v-select :value.sync="gasmessage.f_calculation" :width="'60%'" :options='calculation'
71
+ placeholder='结算方式' close-on-select v-ref:calculation>
72
+ </v-select>
73
+ </div>
74
+ <div class="col-sm-4 form-group" v-if="gasmessage.f_meter_type[0].includes('物联网') && gasmessage.f_calculation.length
75
+ && gasmessage.f_calculation[0] == '表端结算'">
76
+ <label for="f_calculation" class="font_normal_body">系统结算</label>
77
+ <v-select :value.sync="gasmessage.f_system_settlement" :width="'60%'"
78
+ v-model="gasmessage.f_system_settlement"
79
+ :search="false"
80
+ :options='isdecimal' placeholder='系统是否结算' close-on-select>
81
+ </v-select>
82
+ </div>
83
+ <div class="col-sm-4 form-group" v-if="gasmessage.f_meter_type[0].includes('物联网')">
84
+ <label for="f_hascard" class="font_normal_body">是否带卡</label>
85
+
86
+ <v-select :value.sync="gasmessage.f_hascard"
87
+ v-model="gasmessage.f_hascard"
88
+ :options='isdecimal' placeholder='是否带卡'
89
+ close-on-select style="width: 60%"></v-select>
90
+
91
+ </div>
92
+ <div class="col-sm-4 form-group"
93
+ v-if="gasmessage.f_meter_type[0].includes('物联网') && gasmessage.f_hascard[0]==='是'">
94
+ <label for="f_hascard" class="font_normal_body">共用次数</label>
95
+
96
+ <v-select :value.sync="gasmessage.f_share_times"
97
+ v-model="gasmessage.f_share_times"
98
+ :options='isdecimal' placeholder='是否共用次数'
99
+ close-on-select style="width: 60%"></v-select>
100
+
101
+ </div>
102
+ <div class="col-sm-4 form-group"
103
+ v-if="gasmessage.f_meter_type[0].includes('物联网') && gasmessage.f_hascard[0]==='是'">
104
+ <label for="f_hascard" class="font_normal_body">共用开户</label>
105
+
106
+ <v-select :value.sync="gasmessage.f_share_open"
107
+ v-model="gasmessage.f_share_open"
108
+ :value-single="true"
109
+ :options='isdecimal' placeholder='是否共用开户'
110
+ close-on-select style="width: 60%"></v-select>
111
+
112
+ </div>
113
+ <div class="col-sm-4 form-group" v-if="gasmessage.f_meter_type[0].includes('气量卡表')">
114
+ <label for="hasCard" class="font_normal_body">支持蓝牙</label>
115
+
116
+ <v-select :value.sync="gasmessage.f_support_bluetooth"
117
+ :value-single="true"
118
+ v-model="gasmessage.f_support_bluetooth"
119
+ :options='isdecimal' placeholder='是否支持蓝牙'
120
+ close-on-select style="width: 60%"></v-select>
121
+
122
+ </div>
123
+ <div class="col-sm-4 form-group"
124
+ v-if="gasmessage.f_meter_type[0].includes('卡表')||gasmessage.f_meter_type[0].includes('物联网表')">
125
+ <label for="hasCard" class="font_normal_body">是否累购</label>
126
+ <v-select :value.sync="gasmessage.f_support_purchase"
127
+ :value-single="true"
128
+ v-model="gasmessage.f_support_purchase"
129
+ :options='isdecimal' placeholder='是否支持累购'
130
+ close-on-select style="width: 60%"></v-select>
131
+ </div>
132
+ <div class="col-sm-4 form-group" v-if="gasmessage.f_meter_type[0].includes('物联网表')">
133
+ <label for="hasCard" class="font_normal_body">是否扣费</label>
134
+ <v-select :value.sync="gasmessage.f_issupport_feededuction"
135
+ :value-single="true"
136
+ v-model="gasmessage.f_issupport_feededuction"
137
+ :options='isdecimal' placeholder='是否支持扣费'
138
+ close-on-select style="width: 60%"></v-select>
139
+ </div>
140
+ <div v-if="gasmessage.f_meter_type[0].includes('卡表') || gasmessage.f_hascard[0]==='是'" class="row">
141
+ <div class="col-sm-4 form-group" :class="[$v.f_cardnumber.required ? 'has-error' : 'has-success']">
142
+ <label for="f_card_password" class="font_normal_body">&nbsp;&nbsp;&nbsp;卡号&nbsp;&nbsp;&nbsp;</label>
143
+ <input class="input_search" style="width: 60%" type="text" v-model="gasmessage.f_cardnumber"
144
+ v-validate:f_cardnumber='{required: true }'>
145
+ </div>
146
+ <div class="col-sm-4 form-group">
147
+ <label for="f_card_password" class="font_normal_body">卡&ensp;密&ensp;码</label>
148
+ <input class="input_search" style="width: 60%" type="text" v-model="gasmessage.f_card_password">
149
+ </div>
150
+ </div>
151
+ <div class="col-sm-4 form-group"
152
+ v-if="gasmessage.f_meter_type[0].includes('卡表')">
153
+ <label for="hasCard" class="font_normal_body">是否支持置换</label>
154
+ <v-select :value.sync="gasmessage.f_is_replacement"
155
+ :value-single="true"
156
+ v-model="gasmessage.f_is_replacement"
157
+ :options='isreplacement' placeholder='是否支持置换'
158
+ close-on-select style="width: 60%"></v-select>
159
+ </div>
160
+
161
+ <div class="col-sm-4 form-group">
162
+ <label class="font_normal_body ">优&ensp;先&ensp;级</label>
163
+ <input class="input_search" placeholder="优先级" style="width:60%" type="text"
164
+ v-model="gasmessage.f_priority">
165
+ </div>
166
+ <div class="col-sm-4 form-group">
167
+ <label for="f_is_check" class="font_normal_body">是否校验</label>
168
+ <v-select :value.sync="gasmessage.f_is_check"
169
+ v-model="gasmessage.f_is_check"
170
+ :options='ischeck' placeholder='是否校验'
171
+ close-on-select style="width: 60%"></v-select>
172
+ </div>
173
+ <div class="col-sm-4 form-group">
174
+ <label for="f_is_step" class="font_normal_body">支持阶梯</label>
175
+ <v-select :value.sync="gasmessage.f_is_step"
176
+ v-model="gasmessage.f_is_step"
177
+ :options='isstep' placeholder='是否支持阶梯'
178
+ close-on-select style="width: 60%"></v-select>
179
+ </div>
180
+ <div class="col-sm-4 form-group">
181
+ <label for="f_is_step" class="font_normal_body">表计验证</label>
182
+ <v-select :value.sync="gasmessage.f_meterverification" value-single
183
+ v-model="gasmessage.f_meterverification"
184
+ :options='isstep' placeholder='是否表计强验证'
185
+ close-on-select style="width: 60%"></v-select>
186
+ </div>
187
+ <div class="col-sm-4 form-group">
188
+ <label class="font_normal_body ">表号长度</label>
189
+ <input class="input_search" placeholder="表号长度" style="width:60%" type="number"
190
+ v-model="gasmessage.f_meternumber_len">
191
+ </div>
192
+ <div class="col-sm-4 form-group" v-if="gasmessage.f_meter_type[0].includes('卡表')">
193
+ <label for="hasCard" class="font_normal_body">动&ensp;态&ensp;库<br/>到&ensp;期&ensp;日</label>
194
+ <datepicker placeholder="动态库到期日" style="width: 60%"
195
+ v-model="gasmessage.f_dynamic_expire"
196
+ :value.sync="gasmessage.f_dynamic_expire"
197
+ :format="'yyyy-MM-dd'">
198
+ </datepicker>
199
+ </div>
200
+
201
+
202
+ <div class="col-sm-12 form-group" style="height: auto !important;">
203
+ <label class="font_normal_body " style="margin-top:-20px">备&emsp;&emsp;注</label>
204
+ <textarea class="input_textarea" rows="3" style="width:87%;margin-top:5px"
205
+ v-model="gasmessage.f_comments"></textarea>
206
+ </div>
207
+ </div>
208
+ <p class="bg-info text-center" style="padding: 8px;margin: 8px">气表型号</p>
209
+ <add-gas-model :data="gasmessage" :modelvalid.sync="modelvalid" v-on:toggle="getArrParam"
210
+ v-ref:addgasmodel></add-gas-model>
211
+ <add-gas-meter-init-param :alias="alias"
212
+ :show="meterInitParamShow"
213
+ :paramstring="gasmessage.f_init_param"
214
+ v-if="meterInitParamShow"
215
+ >
216
+ </add-gas-meter-init-param>
217
+ <div style="text-align:right;height:auto;margin-top:30px;margin-right:50px;">
218
+ <button type="button" class="button_search " @click="confirm()" :disabled='!($v.valid && modelvalid) '
219
+ v-if='isConfirm'>保存
220
+ </button>
221
+ <button type="button" class="button_search " @click="modify()" :disabled='!($v.valid && modelvalid)'
222
+ v-if='isModify'>修改
223
+ </button>
224
+ <button type="button" class="button_search " v-if="permission('设置气表初始参数')"
225
+ @click="meterInitParamClick()">设置气表初始参数
226
+ </button>
227
+ <button type="button" class="button_search " @click="delMeter()" v-if='data.counts===0 && isModify'>删除
228
+ </button>
229
+ <button type="button" class="button_clear" @click="cancel()">取消</button>
230
+ </div>
231
+ </form>
232
+ </validator>
233
+ </div>
234
+ </template>
235
+ <script>
236
+
237
+ import ViewOrg from '../../components/revenue/comprehen/gasbrand/ViewOrg'
238
+ import AddGasModel from '../../components/revenue/comprehen/gasbrand/AddGasModel'
239
+ import {HttpResetClass} from 'vue-client'
240
+
241
+ /**
242
+ *阶梯气价管理组件
243
+ */
244
+ export default {
245
+ components: {AddGasModel, ViewOrg},
246
+ title: '修改气表品牌',
247
+ data () {
248
+ return {
249
+ model: {},
250
+ addGasModelArray: [],
251
+ isConfirm: true,
252
+ isModify: false,
253
+ gasmessage: {
254
+ id: '',
255
+ f_meter_type: '',
256
+ f_isdecimal: [],
257
+ f_gas_decimal: 4,
258
+ f_fee_decimal: 4,
259
+ f_meter_brand: '',
260
+ f_alias: '',
261
+ f_calculation: '',
262
+ f_comments: '',
263
+ f_hascard: '',
264
+ f_support_bluetooth: '',
265
+ f_support_purchase: '',
266
+ f_issupport_feededuction: '',
267
+ f_system_settlement: '',
268
+ f_share_times: '',
269
+ f_share_open: '',
270
+ f_priority: 100,
271
+ f_is_check: [],
272
+ f_is_step: [],
273
+ f_meterverification: '',
274
+ f_meternumber_len: '',
275
+ f_init_param: '',
276
+ f_is_replacement: '',
277
+ f_dynamic_expire: ''
278
+ },
279
+ alias: '',
280
+ modelvalid: false, // 验证型号
281
+ colletype: false,
282
+ meterInitParamShow: false,
283
+ // 默认分公司显示
284
+ defaultOrg: [],
285
+ // 记录使用改气表的分公司
286
+ useOrg: [],
287
+ // 分公司详情展示
288
+ orgShow: false,
289
+ ischeck: [{label: '否', value: '否'}, {label: '是', value: '是'}],
290
+ isstep: [{label: '否', value: '否'}, {label: '是', value: '是'}],
291
+ isdecimal: [{label: '否', value: '否'}, {label: '是', value: '是'}],
292
+ isreplacement: [{label: '否', value: '否'}, {label: '是', value: '是'}],
293
+ decimalArray: [{label: 1, value: 1}, {label: 2, value: 2}, {label: 3, value: 3}, {label: 4, value: 4}],
294
+ collectiontypes: [{label: '按金额', value: '按金额'}, {label: '按气量', value: '按气量'}],
295
+ meterType: [{label: '金额卡表', value: '金额卡表'}, {label: '气量卡表', value: '气量卡表'}, {
296
+ label: '机表',
297
+ value: '机表'
298
+ }, {label: '物联网表', value: '物联网表'}],
299
+ calculation: [{label: '表端结算', value: '表端结算'}, {label: '系统结算', value: '系统结算'}]
300
+ }
301
+ },
302
+ props: ['data', 'f_filialeid'],
303
+ watch: {
304
+ 'data' (val) {
305
+ this.judgeInitValue(val)
306
+ },
307
+ 'gasmessage.f_meter_type' (val) {
308
+ if (val.length > 0) {
309
+ if (this.gasmessage.f_meter_type[0].includes('卡表')) {
310
+ if (this.gasmessage.f_meter_type[0] === '金额卡表') {
311
+ this.colletype = true
312
+ this.gasmessage.f_collection_type = ['按金额']
313
+ } else {
314
+ this.colletype = true
315
+ this.gasmessage.f_collection_type = ['按气量']
316
+ }
317
+ } else {
318
+ // this.gasmessage.f_collection_type =['按金额']
319
+ this.colletype = false
320
+ }
321
+ }
322
+ }
323
+ },
324
+ ready () {
325
+ console.log(4)
326
+ this.judgeInitValue(this.data)
327
+ },
328
+ events: {
329
+ 'init-param-cancel' () {
330
+ this.meterInitParamShow = false
331
+ this.alias = ''
332
+ },
333
+ 'init-param-confirm' (val) {
334
+ this.gasmessage.f_init_param = val
335
+ this.meterInitParamShow = false
336
+ this.alias = ''
337
+ }
338
+ },
339
+ methods: {
340
+ permission (name) {
341
+ if (!this.$login.r.find(value => value == name)) {
342
+ return false
343
+ }
344
+ return true
345
+ },
346
+ meterInitParamClick () {
347
+ if (this.gasmessage.f_meter_type[0] !== '物联网表') {
348
+ this.$showMessage('只有物联网表才可以设置气表初始参数!!!', ['confirm'])
349
+ return
350
+ }
351
+ if (!this.gasmessage.f_alias) {
352
+ this.$showMessage('请输入气表别名!!!', ['confirm'])
353
+ return
354
+ }
355
+ this.alias = this.gasmessage.f_alias
356
+ this.meterInitParamShow = true
357
+ },
358
+ getArrParam () {
359
+ this.addGasModelArray = this.$refs.addgasmodel.addGasModelArr
360
+ for (var i = 0; i < this.addGasModelArray.length; i++) {
361
+ this.addGasModelArray[i].f_type = this.addGasModelArray[i].type[0]
362
+ if (this.gasmessage.f_meter_type[0] === '物联网表') {
363
+ } else {
364
+ this.addGasModelArray[i].f_size_card = this.addGasModelArray[i].cardsize[0]
365
+ }
366
+ }
367
+ },
368
+ async judgeInitValue (val) {
369
+ this.initgasmessage()
370
+ if (!this.isEmpty(val)) {
371
+ this.gasmessage = Object.assign({}, this.gasmessage, val)
372
+ console.log('========this.gasmessage=======>', this.gasmessage)
373
+ this.gasmessage.f_meter_type = [this.gasmessage.f_meter_type]
374
+ this.gasmessage.f_isdecimal = this.gasmessage.f_isdecimal ? [this.gasmessage.f_isdecimal] : []
375
+ this.gasmessage.f_is_check = this.gasmessage.f_is_check ? [this.gasmessage.f_is_check] : []
376
+ this.gasmessage.f_is_step = this.gasmessage.f_is_step ? [this.gasmessage.f_is_step] : []
377
+ this.gasmessage.f_collection_type = this.gasmessage.f_collection_type ? [this.gasmessage.f_collection_type] : ''
378
+ this.gasmessage.f_calculation = this.gasmessage.f_calculation ? [this.gasmessage.f_calculation] : ''
379
+ this.gasmessage.f_system_settlement = this.gasmessage.f_system_settlement ? [this.gasmessage.f_system_settlement] : ''
380
+ this.isConfirm = false
381
+ this.gasmessage.f_hascard = this.gasmessage.f_hascard ? [this.gasmessage.f_hascard] : []
382
+ this.gasmessage.f_share_times = this.gasmessage.f_share_times ? [this.gasmessage.f_share_times] : []
383
+ this.gasmessage.f_share_open = this.gasmessage.f_share_open ? this.gasmessage.f_share_open : 0
384
+ this.gasmessage.f_support_bluetooth = this.gasmessage.f_support_bluetooth ? [this.gasmessage.f_support_bluetooth] : []
385
+ this.isModify = true
386
+ } else {
387
+ this.defaultOrg = [this.f_filialeid]
388
+ this.isConfirm = true
389
+ this.isModify = false
390
+ }
391
+ this.$resetValidation()
392
+ },
393
+ confirm () {
394
+ this.model = Object.assign({}, this.gasmessage)
395
+ console.log(this.model, '=========================')
396
+ this.model.f_is_replacement = this.model.f_is_replacement[0]
397
+ this.model.f_meter_type = this.model.f_meter_type[0]
398
+ this.model.f_is_check = this.model.f_is_check[0]
399
+ this.model.f_is_step = this.model.f_is_step[0]
400
+ this.model.f_hascard = this.model.f_hascard[0]
401
+ this.model.f_share_open = this.model.f_share_open ? this.model.f_share_open : ''
402
+ this.model.f_share_times = this.model.f_share_times[0]
403
+ this.model.f_support_bluetooth = this.model.f_support_bluetooth[0]
404
+ this.model.f_isdecimal = this.model.f_meter_type.includes('物联网') ? '是' : this.model.f_isdecimal[0]
405
+ this.model.f_collection_type = this.model.f_collection_type[0] ? this.model.f_collection_type[0]: ''
406
+ this.model.f_calculation = this.model.f_calculation[0] ? this.model.f_calculation[0] : ''
407
+ this.model.f_system_settlement = this.model.f_system_settlement ? this.model.f_system_settlement[0] : ''
408
+ this.model.useOrg = this.useOrg
409
+ this.getArrParam()
410
+ this.$LogicService.addGasBrand(this.model, this.addGasModelArray)
411
+ .then(
412
+ (res) => {
413
+ this.$dispatch('success', '气表品牌增加', this.data, res)
414
+ }
415
+ ).catch(
416
+ (error) => {
417
+ this.$dispatch('error', '气表品牌增加', this.data, error)
418
+ }
419
+ )
420
+ this.data = {}
421
+ },
422
+ getorg (val) {
423
+ this.useOrg = val
424
+ },
425
+ delMeter () {
426
+ this.$showMessage(`确定要将气表品牌${this.data.f_meter_brand}删除吗?`, ['confirm', 'cancel']).then((res) => {
427
+ if (res === 'confirm') {
428
+ this.$LogicService.delGasBrand(this.data)
429
+ .then(
430
+ (res) => {
431
+ let http = new HttpResetClass()
432
+ http.load('POST', 'rs/logic/delSaleInitData', {data: {}}, {resolveMsg: null, rejectMsg: null})
433
+ this.$dispatch('success')
434
+ }
435
+ ).catch(
436
+ (error) => {
437
+ this.$dispatch('error', '气表品牌删除', this.data, error)
438
+ }
439
+ )
440
+ }
441
+ })
442
+ },
443
+ transfer () {
444
+ console.log('+++++++++++++', this.model)
445
+ if (this.model.f_meter_type !== '物联网表') {
446
+ // this.model.f_hascard ='否'
447
+ // this.model.f_share_times = '否'
448
+ }
449
+ if (this.model.f_meter_type !== '气量卡表') {
450
+ // this.model.f_support_bluetooth = '否'
451
+ }
452
+ this.model.f_isdecimal = this.model.f_isdecimal[0]
453
+ this.model.f_collection_type = this.model.f_collection_type[0]
454
+ this.model.f_calculation = this.model.f_calculation[0]
455
+ this.model.f_system_settlement = this.model.f_system_settlement[0]
456
+ this.$LogicService.modifyGasBrand(this.model, this.addGasModelArray)
457
+ .then(
458
+ (res) => {
459
+ let http = new HttpResetClass()
460
+ http.load('POST', 'rs/logic/delSaleInitData', {data: {}}, {resolveMsg: null, rejectMsg: null})
461
+ this.$dispatch('success', '气表品牌修改', this.data, res)
462
+ }
463
+ ).catch(
464
+ (error) => {
465
+ this.$dispatch('error', '气表品牌修改', this.data, error)
466
+ }
467
+ )
468
+ },
469
+ cancel () {
470
+ this.$dispatch('close')
471
+ },
472
+ valida (bool) {
473
+ this.modelvalid = bool
474
+ },
475
+ modify () {
476
+ this.model = Object.assign({}, this.gasmessage)
477
+ this.model.f_meter_type = this.model.f_meter_type[0]
478
+ this.model.f_is_check = this.model.f_is_check[0]
479
+ this.model.f_is_step = this.model.f_is_step[0]
480
+ this.model.f_hascard = this.model.f_hascard[0]
481
+ this.model.f_share_open = this.model.f_share_open ? this.model.f_share_open : ''
482
+ this.model.f_share_times = this.model.f_share_times[0]
483
+ this.model.f_support_bluetooth = this.model.f_support_bluetooth[0]
484
+ this.getArrParam()
485
+ this.transfer()
486
+ this.data = {}
487
+ },
488
+ initgasmessage () {
489
+ this.gasmessage = {
490
+ f_meter_brand: '',
491
+ f_meter_type: [],
492
+ f_isdecimal: [],
493
+ f_collection_type: [],
494
+ f_alias: '',
495
+ f_calculation: '',
496
+ f_comments: '',
497
+ f_cardnumber: '',
498
+ f_card_password: '',
499
+ f_hascard: '',
500
+ f_support_bluetooth: '',
501
+ f_support_purchase: '',
502
+ f_issupport_feededuction: '',
503
+ f_police_gas: '',
504
+ f_overdr_lines: '',
505
+ f_share_times: '',
506
+ f_gas_decimal: 4,
507
+ f_fee_decimal: 4,
508
+ f_is_check: [],
509
+ f_is_step: []
510
+ }
511
+ },
512
+ isEmpty (value) {
513
+ for (let id in value) {
514
+ return false
515
+ }
516
+ return true
517
+ },
518
+
519
+ viewOrg () {
520
+ this.orgShow = true
521
+ }
522
+ }
523
+ }
524
+ </script>