sale-client 3.6.210 → 3.6.211

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.210",
3
+ "version": "3.6.211",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -24,7 +24,7 @@
24
24
  <div class="col-sm-4 form-group" :class="[$v.f_alias.required ? 'has-error' : 'has-success']">
25
25
  <label for="f_alias" class="font_normal_body">别&emsp;&emsp;名</label>
26
26
  <input class="input_search" style="width: 60%" type="text" v-model="gasmessage.f_alias"
27
- v-validate:f_alias='{required: true }'>
27
+ v-validate:f_alias='{required: true }' @blur="getInitMeterParamBefore">
28
28
  </div>
29
29
  <div class="col-sm-4 form-group">
30
30
  <label for="f_checkout_limit" class="font_normal_body ">校检年限</label>
@@ -199,6 +199,12 @@
199
199
  <p class="bg-info text-center" style="padding: 8px;margin: 8px">气表型号</p>
200
200
  <add-gas-model :data="gasmessage" :modelvalid.sync="modelvalid" v-on:toggle="getArrParam"
201
201
  v-ref:addgasmodel></add-gas-model>
202
+ <add-gas-meter-init-param :alias="alias"
203
+ :show="meterInitParamShow"
204
+ :paramstring="gasmessage.f_init_param"
205
+ v-if="meterInitParamShow"
206
+ >
207
+ </add-gas-meter-init-param>
202
208
  <div style="text-align:right;height:auto;margin-top:30px;margin-right:50px;">
203
209
  <button type="button" class="button_search " @click="confirm()" :disabled='!($v.valid && modelvalid) '
204
210
  v-if='isConfirm'>保存
@@ -206,6 +212,9 @@
206
212
  <button type="button" class="button_search " @click="modify()" :disabled='!($v.valid && modelvalid)'
207
213
  v-if='isModify'>修改
208
214
  </button>
215
+ <button type="button" class="button_search " v-if="permission('设置气表初始参数')"
216
+ @click="meterInitParamClick()">设置气表初始参数
217
+ </button>
209
218
  <button type="button" class="button_search " @click="delMeter()" v-if='data.counts===0 && isModify'>删除
210
219
  </button>
211
220
  <button type="button" class="button_clear" @click="cancel()">取消</button>
@@ -254,10 +263,13 @@ export default {
254
263
  f_is_step: [],
255
264
  f_meterverification: '',
256
265
  f_meternumber_len: '',
266
+ f_init_param: '',
257
267
  f_dynamic_expire: ''
258
268
  },
269
+ alias: '',
259
270
  modelvalid: false, // 验证型号
260
271
  colletype: false,
272
+ meterInitParamShow: false,
261
273
  // 默认分公司显示
262
274
  defaultOrg: [],
263
275
  // 记录使用改气表的分公司
@@ -302,7 +314,36 @@ export default {
302
314
  console.log(4)
303
315
  this.judgeInitValue(this.data)
304
316
  },
317
+ events: {
318
+ 'init-param-cancel' () {
319
+ this.meterInitParamShow = false
320
+ this.alias = ''
321
+ },
322
+ 'init-param-confirm' (val) {
323
+ this.gasmessage.f_init_param = val
324
+ this.meterInitParamShow = false
325
+ this.alias = ''
326
+ }
327
+ },
305
328
  methods: {
329
+ permission (name) {
330
+ if (!this.$login.r.find(value => value == name)) {
331
+ return false
332
+ }
333
+ return true
334
+ },
335
+ meterInitParamClick () {
336
+ if (this.gasmessage.f_meter_type[0] !== '物联网表') {
337
+ this.$showMessage('只有物联网表才可以设置气表初始参数!!!', ['confirm'])
338
+ return
339
+ }
340
+ if (!this.gasmessage.f_alias) {
341
+ this.$showMessage('请输入气表别名!!!', ['confirm'])
342
+ return
343
+ }
344
+ this.alias = this.gasmessage.f_alias
345
+ this.meterInitParamShow = true
346
+ },
306
347
  getArrParam () {
307
348
  this.addGasModelArray = this.$refs.addgasmodel.addGasModelArr
308
349
  for (var i = 0; i < this.addGasModelArray.length; i++) {
@@ -0,0 +1,152 @@
1
+ <template>
2
+ <div class="auto">
3
+ <modal :show.sync="show" v-ref:modal large backdrop="false" width="80%">
4
+ <header slot="modal-header" class="modal-header">
5
+ <h3 style="color:black" class="modal-title">气表初始参数</h3>
6
+ </header>
7
+ <article slot="modal-body" class="modal-body">
8
+ <validator name='v'>
9
+ <form class="form-horizontal select-overspread">
10
+ <div class="row">
11
+ <div v-for="data in meterInitParam" style="height: auto">
12
+ <div class="col-sm-6 form-group" style="height: auto" v-for="param in data.params" >
13
+ <div class="col-sm-4" :class="[!row[param.title] ? 'has-error' : '']">
14
+ <label class="font_normal_body" style="text-align:left">{{ param.name }}:</label>
15
+ <p class="glyphicon glyphicon-info-sign" style="margin-top:4%;color:#4a7cae"
16
+ :title="param.remark" ></p>
17
+ </div>
18
+ <div class="col-sm-8" v-if="param.type!=='option'" :class="[!row[param.title] ? 'has-error' : '']">
19
+ <input :type="param.type"
20
+ v-model="row[param.title]"
21
+ :value.sync="row[param.title]"
22
+ style="width:70%"
23
+ placeholder=""
24
+ class="input_search">
25
+ </div>
26
+ <div class="col-sm-8" v-if="param.type==='option'" :class="[!row[param.title] ? 'has-error' : '']">
27
+ <v-select
28
+ :placeholder='param.name'
29
+ :value.sync="row[param.title]"
30
+ style="width:70%"
31
+ width="70%"
32
+ :multiple="param.multiple ? param.multiple : false"
33
+ v-model="row[param.title]"
34
+ :options='param.params'
35
+ :close-on-select="param.multiple ? param.multiple == true ? false : true :true"
36
+ >
37
+ </v-select>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </form>
43
+ </validator>
44
+ </article>
45
+ <footer slot="modal-footer" class="modal-footer">
46
+ <button type="button" class="button_search btn-gn" @click="confirm">确认</button>
47
+ <button type="button" class="button_clear btn-gn" @click="cancel">取消</button>
48
+ </footer>
49
+ </modal>
50
+ </div>
51
+ </template>
52
+ <script>
53
+
54
+ import {HttpResetClass} from 'vue-client'
55
+
56
+ export default {
57
+ title: '限购配置',
58
+ data () {
59
+ return {
60
+ meterInitParam: [{}],
61
+ row: {},
62
+ }
63
+ },
64
+ props: {
65
+ show: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+ alias: {
70
+ type: String,
71
+ default: ''
72
+ },
73
+ paramstring: {
74
+ type: String,
75
+ default: ''
76
+ }
77
+ },
78
+ ready () {
79
+ this.getInitMeterParam()
80
+ if (this.paramstring) {
81
+ this.row = JSON.parse(this.paramstring)
82
+ }
83
+ },
84
+ methods: {
85
+ async getInitMeterParam () {
86
+ this.meterInitParam = [{}]
87
+ try {
88
+ let data = {
89
+ f_alias: this.alias
90
+ }
91
+ let http = new HttpResetClass()
92
+ let res = await http.load('POST', '/webmeter/rs/logic/getOACallbackParamsByGasBrand',
93
+ { data: data }, {resolveMsg: null, rejectMsg: null})
94
+ console.log(JSON.stringify(res))
95
+ if (res.data) {
96
+ this.meterInitParam = res.data
97
+ }
98
+ } catch (e) {
99
+ console.log(e)
100
+ }
101
+ },
102
+ async confirm () {
103
+ let hasError = false
104
+ let yaError = false
105
+ let hasStr = ''
106
+ let yzStr = ''
107
+ for (let param of this.meterInitParam) {
108
+ for (let subparam of param.params) {
109
+ let value = this.row[subparam.title]
110
+ if (value) {
111
+ if (subparam.type === 'number') {
112
+ if (value < parseFloat(subparam.min) || value > parseFloat(subparam.max)) {
113
+ yaError = true
114
+ console.log(subparam.name)
115
+ yzStr = yzStr + subparam.name + ' '
116
+ }
117
+ }
118
+ if (Object.prototype.toString.call(value) === '[object Array]') {
119
+ if (!value[0]) {
120
+ hasError = true
121
+ hasStr = hasStr + subparam.name + ' '
122
+ }
123
+ }
124
+ } else {
125
+ hasError = true
126
+ hasStr = hasStr + subparam.name + ' '
127
+ }
128
+ }
129
+ }
130
+ if (hasError) {
131
+ this.$showMessage(`${hasStr}表单项没有填写,请填写完所有的表单项再点击确认!!!`, ['confirm'])
132
+ return
133
+ }
134
+ if (yaError) {
135
+ this.$showMessage(`${yzStr}表单项格式错误,请悬浮到表单标签右侧的图标,按照悬浮文字提供的格式来填写表单项!!!`, ['confirm'])
136
+ return
137
+ }
138
+ let meterInitParam = JSON.stringify(this.row, function (key, value) {
139
+ if (Array.isArray(value) && value.length === 1) {
140
+ // 对于长度为1的数组,转换为字符串
141
+ return value[0].toString()
142
+ }
143
+ return value
144
+ })
145
+ this.$dispatch('init-param-confirm', meterInitParam)
146
+ },
147
+ cancel () {
148
+ this.$dispatch('init-param-cancel')
149
+ }
150
+ }
151
+ }
152
+ </script>
@@ -184,6 +184,7 @@ let LogicService = {
184
184
  f_overdr_lines: model.f_overdr_lines ? model.f_overdr_lines : 0,
185
185
  f_meter_limit: model.f_meter_limit ? model.f_meter_limit : 0,
186
186
  f_checkout_limit: model.f_checkout_limit ? model.f_checkout_limit : 0,
187
+ f_init_param: model.f_init_param ? model.f_init_param : '',
187
188
  f_alias: model.f_alias,
188
189
  f_isdecimal: model.f_isdecimal,
189
190
  f_collection_type: model.f_collection_type,
package/src/sale.js CHANGED
@@ -627,6 +627,8 @@ export default function () {
627
627
  // 额外参数管理
628
628
  Vue.component('parames', (resolve) => { require(['./components/revenue/comprehen/gasbrand/Parames'], resolve) })
629
629
  Vue.component('add-json-parameter', (resolve) => { require(['./components/revenue/comprehen/gasbrand/AddJsonParameter'], resolve) })
630
+ // 设置气表初始化参数
631
+ Vue.component('add-gas-meter-init-param', (resolve) => { require(['./components/revenue/comprehen/gasbrand/AddGasMeterInitParam'], resolve) })
630
632
 
631
633
  /** ****************************短信管理**********************************************************/
632
634
  // 用户欠费记录查询,生成短信模板