sale-client 3.5.37 → 3.5.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <div id="unit" class="flex-row">
3
3
  <div class="flex basic-main" style="width:auto;">
4
- <param-set-default-list></param-set-default-list>
4
+ <param-set-default-list v-ref:defaultlist></param-set-default-list>
5
5
  </div>
6
6
  <div class="flex binary-right" style="flex:1; ">
7
7
  <work-busy :is-busy="seaching"></work-busy>
8
8
  <div class="row form-horizontal select-overspread container-fluid auto" partial>
9
9
  <div novalidate class="form-inline auto" partial>
10
- <div class="col-sm-5">
10
+ <div class="col-sm-8">
11
11
  <label class="font_normal_body">选择要设置参数的表具</label>
12
12
  <v-select
13
13
  placeholder='气表品牌'
@@ -33,8 +33,9 @@
33
33
  <span partial>
34
34
  {{ row.data.name }}
35
35
  <span style="float: right">
36
+ {{row.data.default_value ? `当前默认值为:${row.data.default_value}` : ''}}
36
37
  <button class="button_spacing button_clear" v-if="!row.data.children"
37
- @click.stop="$parent.$parent.modifyRes(row.data)">修改默认值</button>
38
+ @click.stop="$parent.$parent.modifyRes(row.data,row.parent.data.name)">修改默认值</button>
38
39
  </span>
39
40
  </span>
40
41
  </tree-grid-item>
@@ -43,23 +44,56 @@
43
44
  </tree-grid>
44
45
  </div>
45
46
  </div>
46
- <modal :show.sync="showDefault" title="修改默认值" v-ref:modal large backdrop="false">
47
- <article slot="modal-body" class="modal-body">
48
- <span> {{row.remark}}</span>
49
- </article>
50
- <footer slot="modal-footer" class="modal-footer">
51
- </footer>
52
- </modal>
47
+ <modal :show.sync="showDefault" title="修改默认值" v-ref:modal backdrop="false" @modal-close="setClose">
48
+ <article slot="modal-body" class="modal-body">
49
+ <div class="col-sm-12" style="height: auto">
50
+ <div class="col-sm-4">
51
+ <label class="font_normal_body" style="text-align:right;float:right">{{ row.name }}:</label>
52
+ </div>
53
+ <div class="col-sm-8" v-if="row.type!=='option'">
54
+ <input :type="row.type" v-model="paramSetVal" :value.sync="paramSetVal" style="width:70%" placeholder=""
55
+ class="input_search">
56
+ </div>
57
+ <div class="col-sm-8" v-if="row.type==='option'">
58
+ <v-select
59
+ :placeholder='row.name'
60
+ :value.sync="paramSetVal"
61
+ style="width:70%"
62
+ width="70%"
63
+ :value-single="true"
64
+ v-model="paramSetVal"
65
+ :options='row.params'
66
+ close-on-select
67
+ >
68
+ </v-select>
69
+ </div>
70
+ </div>
71
+ <center>
72
+ <span> {{ row.remark }}</span>
73
+ </center>
74
+ </article>
75
+ <footer slot="modal-footer" class="modal-footer">
76
+ <button type="button" class="btn btn-success" @click='setConfirm' :disabled="!paramSetVal">确认</button>
77
+ <button type="button" class="btn btn-default" @click='setClose'>取消</button>
78
+ </footer>
79
+ </modal>
53
80
  </div>
54
81
  </template>
55
82
  <script>
56
83
  import ParamSetDefaultList from './ParamSetDefaultList'
57
84
 
58
- let handleTree = function (data) {
85
+ let handleTree = function (data, defaultData) {
59
86
  return data.map(item => {
60
- let children = item.params.map(item1 => {
61
- delete item1['size']
62
- return item1
87
+ let children = item.params.map(c => {
88
+ for (let i = 0; i < defaultData.length; i++) {
89
+ if (c.name === defaultData[i].f_param_name && item.name === defaultData[i].f_group_name && defaultData[i].f_param_title === c.title) {
90
+ c.default_value = defaultData[i].f_param_value
91
+ c.default_id = defaultData[i].default_id
92
+ break
93
+ }
94
+ }
95
+ delete c['size']
96
+ return c
63
97
  })
64
98
  return {label: item.name, name: item.name, value: item.name, children: children}
65
99
  })
@@ -89,25 +123,68 @@ export default {
89
123
  quanxian: this.$login.r,
90
124
  f_gasbrand_id: '',
91
125
  showDefault: '',
92
- row: {}
126
+ row: {},
127
+ groupName: '',
128
+ paramSetVal: ''
93
129
  }
94
130
  },
95
131
  ready () {
96
132
  initGen(this)
97
133
  },
98
134
  methods: {
135
+ setConfirm () {
136
+ let data = {
137
+ f_gasbrand_id: this.f_gasbrand_id,
138
+ f_group_name: this.groupName,
139
+ f_param_name: this.row.name,
140
+ f_param_title: this.row.title,
141
+ f_new_value: this.paramSetVal,
142
+ f_param_value: this.paramSetVal,
143
+ f_old_value: this.row.default_value,
144
+ default_id: this.row.default_id,
145
+ f_describe: `${this.$login.f.name}将 ${this.row.name} 默认值设置为 ${this.paramSetVal}`,
146
+ f_operator: this.$login.f.name,
147
+ f_operatorid: this.$login.f.id,
148
+ f_orgid: this.$login.f.orgid,
149
+ f_orgname: this.$login.f.orgs,
150
+ f_depid: this.$login.f.depids,
151
+ f_depname: this.$login.f.deps
152
+ }
153
+ this.$resetpost('/rs/logic/setDefaultValue', data, {
154
+ resolveMsg: null,
155
+ rejectMsg: null
156
+ }).then(() => {
157
+ this.searchData()
158
+ this.setClose()
159
+ })
160
+ },
161
+ setClose () {
162
+ this.row = {}
163
+ this.paramSetVal = ''
164
+ this.groupName = ''
165
+ this.showDefault = false
166
+ },
99
167
  async searchData () {
100
168
  this.seaching = true
101
- this.$resetpost('webmeter/rs/logic/getParamsByGasBrand', {data: {gasBrandId: this.f_gasbrand_id}}, {resolveMsg: null, rejectMsg: null}).then(({data}) => {
102
- this.model = handleTree(data)
169
+ this.$resetpost('webmeter/rs/logic/getParamsByGasBrand', {data: {gasBrandId: this.f_gasbrand_id}}, {
170
+ resolveMsg: null,
171
+ rejectMsg: null
172
+ }).then(async ({data}) => {
173
+ let allDefaultValue = await this.$resetpost('/rs/sql/getAllDefaultValues', {data: {gasBrandId: this.f_gasbrand_id}}, {
174
+ resolveMsg: null,
175
+ rejectMsg: null
176
+ })
177
+ this.model = handleTree(data, allDefaultValue.data)
178
+ this.$refs.defaultlist.search()
103
179
  })
104
180
  this.seaching = false
105
181
  },
106
182
  // 修改资源
107
- modifyRes (obj) {
108
- console.log(obj)
183
+ modifyRes (obj, groupName) {
109
184
  this.row = obj
110
- this.row.remark = `描述信息:${obj.max ? `最大值为${obj.max};` : ''}${obj.max ? `最小值为${obj.min};` : ''}`
185
+ this.paramSetVal = ''
186
+ this.groupName = groupName
187
+ this.row.remark = `描述信息:${obj.default_value ? `当前默认值为:${obj.default_value};` : ''} ${obj.max ? `最大值为${obj.max};` : ''}${obj.max ? `最小值为${obj.min};${obj.remark}` : obj.remark}`
111
188
  this.showDefault = true
112
189
  },
113
190
  async confirm () {
@@ -119,10 +196,7 @@ export default {
119
196
  watch: {
120
197
  'f_gasbrand_id' (newVal) {
121
198
  if (newVal) {
122
- this.$resetpost('webmeter/rs/logic/getParamsByGasBrand', {data: {gasBrandId: this.f_gasbrand_id}}, {resolveMsg: null, rejectMsg: null}).then(({data}) => {
123
- this.model = handleTree(data)
124
- }
125
- )
199
+ this.searchData()
126
200
  }
127
201
  }
128
202
  },
@@ -9,11 +9,12 @@
9
9
  <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid v-if="!$parent.row">
10
10
  <template partial='head'>
11
11
  <tr>
12
- <th style="white-space: nowrap;" colspan="6">参数维护记录</th>
12
+ <th style="white-space: nowrap;" colspan="7">参数维护记录</th>
13
13
  </tr>
14
14
  <tr>
15
15
  <th style="white-space: nowrap;">序号</th>
16
16
  <th style="white-space: nowrap;">操作描述</th>
17
+ <th style="white-space: nowrap;">操作时间</th>
17
18
  <th style="white-space: nowrap;">参数组别</th>
18
19
  <th style="white-space: nowrap;">参数名称</th>
19
20
  <th style="white-space: nowrap;">参数旧值</th>
@@ -22,11 +23,12 @@
22
23
  </template>
23
24
  <template partial='body'>
24
25
  <td style="text-align: center;">{{ $index + 1 }}</td>
25
- <td style="text-align: center;">{{ $index + 1 }}</td>
26
- <td style="text-align: center;">{{ $index + 1 }}</td>
27
- <td style="text-align: center;">{{ $index + 1 }}</td>
28
- <td style="text-align: center;">{{ $index + 1 }}</td>
29
- <td style="text-align: center;">{{ $index + 1 }}</td>
26
+ <td style="text-align: center;">{{ row.f_describe }}</td>
27
+ <td style="text-align: center;">{{ row.f_operate_date }}</td>
28
+ <td style="text-align: center;">{{ row.f_group_name }}</td>
29
+ <td style="text-align: center;">{{ row.f_param_name }}</td>
30
+ <td style="text-align: center;">{{ row.f_old_value }}</td>
31
+ <td style="text-align: center;">{{ row.f_new_value }}</td>
30
32
  </template>
31
33
  </data-grid>
32
34
  </criteria-paged>
@@ -43,12 +45,20 @@ export default {
43
45
  title: 'ParamSetDefaultList',
44
46
  data () {
45
47
  return {
46
- model: new PagedList('rs/sql/sale_getUser', 30, {orderitem: '"' + this.orderitem + ' DESC"'})
48
+ model: new PagedList('rs/sql/getAllDefaultRecord', 30, {})
47
49
  }
48
50
  },
49
51
  ready () {
52
+ this.search()
53
+ },
54
+ methods: {
55
+ search () {
56
+ this.$refs.paged.$refs.cri.search()
57
+ },
58
+ selfSearch (args) {
59
+ this.model.search(args.condition, args.model)
60
+ }
50
61
  },
51
- methods: {},
52
62
  watch: {},
53
63
  computed: {}
54
64
  }
@@ -20,28 +20,36 @@
20
20
  -&#45;&#45;&#45;&#45;{{row.overdueMessageValue}}
21
21
  <input :type="text" v-model="row.overdueMessageValue" :value.sync="row.overdueMessageValue" style="width:70%" placeholder="" class="input_search">
22
22
  </div>-->
23
- <div v-for="data in newmeterinfo" style="height: auto">
24
- <div class="col-sm-12" style="height: auto" v-if="data.name===paramtype" v-for="param in data.params">
23
+ <div v-for="(index,data) in newmeterinfo" style="height: auto">
24
+ <div class="col-sm-12" style="height: auto" v-if="data.name===paramtype" v-for="(param_index,param) in data.params">
25
25
  <div class="col-sm-4">
26
26
  <label class="font_normal_body" style="text-align:left">{{param.name}}:</label>
27
- <p class="glyphicon glyphicon-info-sign" style="margin-top:7%;color:#4a7cae" :title="param.remark"></p>
27
+ <p class="glyphicon glyphicon-info-sign" style="margin-top:5%;color:#4a7cae" :title="param.remark"></p>
28
28
  </div>
29
- <div class="col-sm-8" v-if="param.type!=='option'">
30
- <input :type="param.type" v-model="row[param.title]" :value.sync="row[param.title]" style="width:70%" placeholder="" class="input_search">
29
+ <div class="col-sm-4" >
30
+ <label class="font_normal_body" style="text-align:left">{{param.default_value ? `当前默认值为:${param.default_value};` : '当前未设置默认值'}}</label>
31
31
  </div>
32
- <div class="col-sm-8" v-if="param.type==='option'">
33
- <v-select
34
- :placeholder='param.name'
35
- :value.sync="row[param.title]"
36
- style="width:70%"
37
- width="70%"
38
- :value-single="true"
39
- v-model="row[param.title]"
40
- :options='param.params'
41
- close-on-select
42
- >
43
- </v-select>
32
+ <div class="col-sm-4" >
33
+ <radio-btn v-model="param.isenbale" :value.sync="param.isenbale" :disabled="!param.default_value"></radio-btn>
34
+ <!-- <label>启用<input type="radio" v-model="param.isenbale" @click="reMeterinfo(index,param_index,data.params)" :disabled="!param.default_value" value="启用"/></label>-->
35
+ <!-- <label>保持不变<input type="radio" v-model="param.isenbale" @click="reMeterinfo(index,param_index,data.params)" value="保持不变"/></label>-->
44
36
  </div>
37
+ <!-- <div class="col-sm-8" v-if="param.type!=='option'">-->
38
+ <!-- <input :type="param.type" v-model="row[param.title]" :value.sync="row[param.title]" style="width:70%" placeholder="" class="input_search">-->
39
+ <!-- </div>-->
40
+ <!-- <div class="col-sm-8" v-if="param.type==='option'">-->
41
+ <!-- <v-select-->
42
+ <!-- :placeholder='param.name'-->
43
+ <!-- :value.sync="row[param.title]"-->
44
+ <!-- style="width:70%"-->
45
+ <!-- width="70%"-->
46
+ <!-- :value-single="true"-->
47
+ <!-- v-model="row[param.title]"-->
48
+ <!-- :options='param.params'-->
49
+ <!-- close-on-select-->
50
+ <!-- >-->
51
+ <!-- </v-select>-->
52
+ <!-- </div>-->
45
53
  </div>
46
54
  </div>
47
55
  <div class="form-group col-sm-4" style="float:right;white-space: nowrap;width: auto">
@@ -118,11 +126,11 @@
118
126
 
119
127
  <script>
120
128
  import {HttpResetClass} from 'vue-client'
121
-
129
+ import RadioBtn from './RadioBtn'
122
130
  export default {
123
131
  title: '参数设置',
124
132
  props: ['user', 'checked1', 'gasbrandid', 'condition'],
125
-
133
+ components: {RadioBtn},
126
134
  data () {
127
135
  return {
128
136
  newmeterinfo: [{}],
@@ -131,7 +139,8 @@ export default {
131
139
  paramtypes: [],
132
140
  paramtype: '',
133
141
  param: {},
134
- history: []
142
+ history: [],
143
+ isenbale: false
135
144
  }
136
145
  },
137
146
  ready () {
@@ -183,18 +192,13 @@ export default {
183
192
  for (let i = 0; i < this.newmeterinfo.length; i++) {
184
193
  for (let j = 0; j < this.newmeterinfo[i].params.length; j++) {
185
194
  if (this.newmeterinfo[i].name === this.paramtype) {
186
- for (let key in this.row) {
187
- if (key === this.newmeterinfo[i].params[j].title) {
188
- let data = {}
189
- data.param_group = this.newmeterinfo[i].name
190
- data.param_name = this.newmeterinfo[i].params[j].name
191
- data.param_value = this.row[key] ? (this.row[key].code ? this.row[key].code : this.row[key]) : null
192
- data.param_content = this.row[key] ? (this.row[key].content ? this.row[key].content : this.row[key]) : null
193
- data.param_lname = this.newmeterinfo[i].params[j].title
194
- if (this.row[key]) {
195
- params.push(data)
196
- }
197
- }
195
+ if (this.newmeterinfo[i].params[j].isenbale) {
196
+ let data = {}
197
+ data.param_value = data.param_content = this.newmeterinfo[i].params[j].default_value
198
+ data.param_group = this.newmeterinfo[i].name
199
+ data.param_name = this.newmeterinfo[i].params[j].name
200
+ data.param_lname = this.newmeterinfo[i].params[j].title
201
+ params.push(data)
198
202
  }
199
203
  }
200
204
  }
@@ -232,19 +236,13 @@ export default {
232
236
  for (let i = 0; i < this.newmeterinfo.length; i++) {
233
237
  for (let j = 0; j < this.newmeterinfo[i].params.length; j++) {
234
238
  if (this.newmeterinfo[i].name === this.paramtype) {
235
- for (let key in this.row) {
236
- if (key === this.newmeterinfo[i].params[j].title) {
237
- let data = {}
238
- data.param_group = this.newmeterinfo[i].name
239
- data.param_name = this.newmeterinfo[i].params[j].name
240
- data.tag = this.newmeterinfo[i].params[j].tag
241
- data.param_value = this.row[key] ? (this.row[key].code ? this.row[key].code : this.row[key]) : null
242
- data.param_content = this.row[key] ? (this.row[key].content ? this.row[key].content : this.row[key]) : null
243
- data.param_lname = this.newmeterinfo[i].params[j].title
244
- if (this.row[key]) {
245
- params.push(data)
246
- }
247
- }
239
+ if (this.newmeterinfo[i].params[j].isenbale) {
240
+ let data = {}
241
+ data.param_value = data.param_content = this.newmeterinfo[i].params[j].default_value
242
+ data.param_group = this.newmeterinfo[i].name
243
+ data.param_name = this.newmeterinfo[i].params[j].name
244
+ data.param_lname = this.newmeterinfo[i].params[j].title
245
+ params.push(data)
248
246
  }
249
247
  }
250
248
  }
@@ -283,10 +281,22 @@ export default {
283
281
  this.newmeterinfo = [{}]
284
282
 
285
283
  let res = await this.$resetpost('/webmeter/rs/logic/getParamsByGasBrand', {data: {gasBrandId: val}}, {resolveMsg: '参数已加载', rejectMsg: null})
284
+ let allDefaultValue = await this.$resetpost('/rs/sql/getAllDefaultValues', {data: {gasBrandId: val}}, {
285
+ resolveMsg: null,
286
+ rejectMsg: null
287
+ })
286
288
  this.newmeterinfo = res.data
287
289
  for (let i = 0; i < this.newmeterinfo.length; i++) {
288
290
  this.paramtypes.push({label: this.newmeterinfo[i].name, value: this.newmeterinfo[i].name})
289
291
  for (let j = 0; j < this.newmeterinfo[i].params.length; j++) {
292
+ this.newmeterinfo[i].params[j].isenbale = false
293
+ for (let n = 0; n < allDefaultValue.data.length; n++) {
294
+ if (this.newmeterinfo[i].params[j].name === allDefaultValue.data[n].f_param_name && this.newmeterinfo[i].name === allDefaultValue.data[n].f_group_name && allDefaultValue.data[n].f_param_title === this.newmeterinfo[i].params[j].title) {
295
+ this.newmeterinfo[i].params[j].default_value = allDefaultValue.data[i].f_param_value
296
+ this.newmeterinfo[i].params[j].default_id = allDefaultValue.data[i].default_id
297
+ break
298
+ }
299
+ }
290
300
  if (this.newmeterinfo[i].params[j].params instanceof Array) {
291
301
  for (let k = 0; k < this.newmeterinfo[i].params[j].params.length; k++) {
292
302
  this.newmeterinfo[i].params[j].params[k].value = {
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <label>启用<input type="radio" v-model="value" @input="onChange(true)" :disabled="disabled" :value="true"/></label>
3
+ <label>保持不变<input type="radio" v-model="value" @click="onChange(false)" :value="false"/></label>
4
+ </template>
5
+
6
+ <script>
7
+ export default {
8
+ name: 'RadioBtn',
9
+ title: 'RadioBtn',
10
+ props: ['value', 'disabled'],
11
+ data () {
12
+ return {
13
+
14
+ }
15
+ },
16
+ model: {
17
+ prop: 'value'
18
+ },
19
+ methods: {
20
+ onChange (e) {
21
+ this.$emit('input', e)
22
+ }
23
+ }
24
+
25
+ }
26
+ </script>
27
+
28
+ <style scoped>
29
+
30
+ </style>
@@ -535,7 +535,7 @@ let offlineWriteGen = async function (row) {
535
535
  throw new Error(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`)
536
536
  } else {
537
537
  // 更新 上次写卡气量
538
- await getParamGen(row.f_userfiles_id, param.ql)
538
+ await modify(row.f_userfiles_id, param.ql)
539
539
  // 写卡成功 更新收费记录
540
540
  let update = {
541
541
  id: row.unWriteSell[0].id,
@@ -1006,8 +1006,8 @@ let sendCardSaleGasGenremanent = async function (model, row) {
1006
1006
  await modify(row.f_userfiles_id, params.ql)
1007
1007
  // 写卡成功
1008
1008
  // 更新卡密码
1009
- row.version = result.data.version - 1,
1010
- await Vue.CommonService.updatePassword(row, cardRes)
1009
+ row.version = result.data.version - 1
1010
+ await Vue.CommonService.updatePassword(row, cardRes)
1011
1011
  Vue.showAlert('补气购气成功', 'success', 2000)
1012
1012
  return result
1013
1013
  }