sale-client 3.6.284 → 3.6.286

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.284",
3
+ "version": "3.6.286",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -519,7 +519,7 @@ export default {
519
519
  this.data.baseinfo.base.f_cost_type = this.data.baseinfo.base.f_cost_type ? [this.data.baseinfo.base.f_cost_type] : '现金缴费'
520
520
  this.data.baseinfo.base.f_bz_type = this.data.baseinfo.base.f_bz_type ? [this.data.baseinfo.base.f_bz_type] : ''
521
521
 
522
- this.data.baseinfo.base.f_paper_type = this.data.baseinfo.base.f_paper_type ? [this.data.baseinfo.base.f_paper_type] : '电子发票'
522
+ this.data.baseinfo.base.f_paper_type = this.data.baseinfo.base.f_paper_type ? this.data.baseinfo.base.f_paper_type : '电子发票'
523
523
  this.data.baseinfo.bank.f_bank_name = this.data.baseinfo.bank.f_bank_name ? [this.data.baseinfo.bank.f_bank_name] : '中国银行'
524
524
  this.data.baseinfo.base.f_people_num = this.data.baseinfo.base.f_people_num ? this.data.baseinfo.base.f_people_num : (this.peopleNum ? this.peopleNum : 0)
525
525
  this.data.baseinfo.base.f_gas_pointsnumber = this.data.baseinfo.base.f_gas_pointsnumber ? this.data.baseinfo.base.f_gas_pointsnumber : (this.pointsNum ? this.pointsNum : 2)
@@ -55,7 +55,7 @@ export default {
55
55
  title: '基本信息',
56
56
  data () {
57
57
  return {
58
- papertype: this.$appdata.getParam('票据类型')
58
+ papertype: this.$appdata.getParam('票据类型') ? [{label: '请选择', value: ''}, ...this.$appdata.getParam('票据类型')] : []
59
59
  }
60
60
  },
61
61
  props: ['baseinfo']
@@ -73,7 +73,8 @@
73
73
  data2: {
74
74
  userid: array,
75
75
  instructtype: '阀门控制',
76
- isOpen: '关阀',
76
+ isOpen: '关阀',
77
+ instructTitle: '手动关阀',
77
78
  reasonInfo: '表具停用自动关阀',
78
79
  f_instruct_state: '待发送',
79
80
  inputtor: this.$login.f.name
@@ -112,7 +112,8 @@ let meterEnable = async function (self, model, row) {
112
112
  data2: {
113
113
  userid: array,
114
114
  instructtype: '阀门控制',
115
- isOpen: '开阀',
115
+ isOpen: '开阀',
116
+ instructTitle: '手动开阀',
116
117
  f_instruct_state: '待发送',
117
118
  inputtor: self.$login.f.name
118
119
  }
@@ -268,6 +268,9 @@
268
268
  <th>
269
269
  <nobr>小区名称</nobr>
270
270
  </th>
271
+ <th>
272
+ <nobr>身份证号</nobr>
273
+ </th>
271
274
  <th>
272
275
  <nobr>地址</nobr>
273
276
  </th>
@@ -365,6 +368,9 @@
365
368
  <td style="text-align: center;">
366
369
  <nobr>{{row.f_residential_area}}</nobr>
367
370
  </td>
371
+ <td style="text-align: center;">
372
+ <nobr>{{row.f_idnumber}}</nobr>
373
+ </td>
368
374
  <td style="text-align: center;">
369
375
  <nobr>{{row.f_address}}</nobr>
370
376
  </td>
@@ -891,7 +897,7 @@
891
897
  },
892
898
  getfield() {
893
899
  return {
894
- 'f_userinfo_code': '客户编号', 'f_user_name': '客户名称', 'f_residential_area': '小区名称', 'f_address': '客户地址',
900
+ 'f_userinfo_code': '客户编号', 'f_user_name': '客户名称', 'f_residential_area': '小区名称', 'f_idnumber':'身份证号','f_address': '客户地址',
895
901
  'f_user_phone': '客户电话','f_rent_phone': '备用电话','f_inputtor': '抄表员','f_book_name': '抄表册','f_user_type': '客户类型',
896
902
  'f_gasproperties': '用气性质', 'f_comments': '备注', 'c': '欠费期数', 'f_hand_date': '欠费区间', 'f_oughtamount': '用气量',
897
903
  'f_oughtfee': '用气金额','f_operate_date': '缴费时间', 'f_debt_money': '已交金额', 'f_oughtfee_new': '应交气费',
@@ -0,0 +1,316 @@
1
+ <template>
2
+ <div id="unit" class="flex-row three" v-show="listpage">
3
+ <div class="binary-left" style="overflow: scroll;width:15%" >
4
+ <mulitinfo :warninginfo="warningInfo" style="height:auto" @deal-msg="dealMsg" :data="row" :card-data="cardInfo" v-ref:info></mulitinfo>
5
+ </div>
6
+ <div class="binary-right" style="width:68%;overflow-y: scroll" >
7
+ <div :style="{height:(row?'auto':'100%')}">
8
+ <!--<div class="auto" v-if="sustainMoney != null">-->
9
+ <!--<h2 style="margin-top: 10px">当前连续收款金额: {{sustainMoney}}</h2>-->
10
+ <!--</div>-->
11
+ <div>
12
+ <charge-list :row="row" @select-oper="showWork" @dblclick="toBusiness" @deal-msg="dealMsg"
13
+ v-ref:list></charge-list>
14
+
15
+ <div class="auto" style="margin-top: 1%;" v-if="row">
16
+ <charge-oper :data.sync="row" :card-info="cardInfo" v-ref:oper></charge-oper>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ <div class="binary-right" style="width:22%" >
22
+ <ul class="nav nav-pills span" style="height:auto;margin:8px 0px;padding:4px 0;border-bottom: 1px solid #e7e7e7;" class="nav nav-tabs" >
23
+ <li ><a :style="selectFiled == '其他信息'?'color:#333333!important;':'color:#666666!important;'" :class="{'tel_voiceActive':selectFiled == '其他信息','tel_f_size':selectFiled != '其他信息'}" href="#" @click="setField('其他信息')">其他信息</a></li>
24
+ <li ><a :style="selectFiled == '历史操作'?'color:#333333!important;':'color:#666666!important;'" :class="{'tel_voiceActive':selectFiled == '历史操作','tel_f_size':selectFiled != '历史操作'}" href="#" @click="setField('历史操作')">历史操作</a></li>
25
+ <li v-if="row ?row.f_meter_type=='机表' : false"><a :style="selectFiled == '历史抄表'?'color:#333333!important;':'color:#666666!important;'" :class="{'tel_voiceActive':selectFiled == '历史抄表','tel_f_size':selectFiled != '历史抄表'}" href="#" @click="setField('历史抄表')">历史抄表</a></li>
26
+ </ul>
27
+ <div class="tab-content span" style="overflow-y: auto">
28
+ <otherinfo v-show="worktype === '其他信息'" style="height:auto" @deal-msg="dealMsg" :data="row" :card-data="cardInfo" v-ref:info></otherinfo>
29
+ <card-list v-show="worktype === '历史操作'" :btns="operatebtn" :f_orgid="f_orgid" :userinfoid="row ? row.f_userinfo_code : ''" @list-select-oper="recordCancel"
30
+ v-ref:card></card-list>
31
+ <hand-list v-if="worktype === '历史抄表'" :f_userfiles_id="row ? row.f_userfiles_id : ''" v-ref:hand></hand-list>
32
+ </div>
33
+
34
+ </div>
35
+
36
+ </div>
37
+ <div v-if="!listpage">
38
+ <user-info-detail-manage-new parentname="charge-manage" :f_userfiles_id="rowData.f_userfiles_id" @cancel-main="cancel" @cancel-re="cancelAndRefresh"></user-info-detail-manage-new>
39
+ </div>
40
+ <div v-if="showModal">
41
+ <charge-modal :warninginfo="warningInfo" :row="modalrow" :modal-show.sync="showModal" @close="close" @modalsuccess="modalsuccess"></charge-modal>
42
+ </div>
43
+ </template>
44
+ <script>
45
+ import ChargeOper from './ChargeOper'
46
+ import {HttpResetClass} from "vue-client";
47
+
48
+ export default {
49
+ title: '收费(综合)',
50
+ components: { ChargeOper },
51
+ data () {
52
+ return {
53
+ sustainMoney: null,
54
+ // 页面开关
55
+ listpage: true,
56
+ f_orgid: '',
57
+ row: null,
58
+ cardInfo: null,
59
+ warningInfo: null,
60
+ modalrow: null,
61
+ showModal: false,
62
+ rowData: {},
63
+ dibao_remind: this.$appdata.getSingleValue('低保快到期提醒') ? this.$appdata.getSingleValue('低保快到期提醒') : 0,
64
+ reSearchShowMsy: !!this.$appdata.getSingleValue('收费后验证'),
65
+ show: [true],
66
+ selectFiled: '其他信息',
67
+ worktype: '其他信息',
68
+ searchTime: 1000,
69
+ interval: null
70
+ }
71
+ },
72
+ destroyed () {
73
+ if(this.$appdata.getSingleValue('磁条卡读卡间隔')) {
74
+ clearInterval(this.interval)
75
+ }
76
+ },
77
+ ready () {
78
+ if(this.$appdata.getSingleValue('磁条卡读卡间隔')){
79
+ this.searchTime = this.$appdata.getSingleValue('磁条卡读卡间隔')
80
+ this.readCiTiaoCard()
81
+ }
82
+ this.setsustainMoney()
83
+ },
84
+ methods: {
85
+ async readCiTiaoCard () {
86
+ console.log('读磁条卡,开始,不停的循环')
87
+ let data = {}
88
+ let getUser = {data: []}
89
+ let forgid = this.$login.convertToIn([this.$login.f.orgid])
90
+ try {
91
+ this.interval = setInterval(() => {
92
+ // 1秒一轮回
93
+ let http = new HttpResetClass()
94
+ http.load('POST', 'http://127.0.0.1:8003/ReadCard_HEC', data, {
95
+ resolveMsg: null,
96
+ rejectMsg: null
97
+ }).then(async res => {
98
+ if (res.data.CardID !== '') {
99
+ if (res.data.Err === null && res.data.Exception) {
100
+ this.$showAlert(res.data.Exception, 'danger', 2000)
101
+ // clearInterval(interval)
102
+ } else {
103
+ if (res.data.Factory === 'CiTiao') {
104
+ // 获取用户信息
105
+ getUser = await this.$resetpost('rs/sql/sale_getUser', {
106
+ data: {
107
+ condition: `u.f_filialeid in ${forgid} and gb.f_meter_type in ('机表','物联网表') and i.f_userinfo_code='${res.data.CardID}'`,
108
+ orderitem: `f_userinfo_id`
109
+ }
110
+ }, {resolveMsg: null, rejectMsg: '读卡失败'})
111
+ this.$refs.list.model.rows = getUser.data
112
+ if (!this.row || (this.row && this.row.f_userinfo_code != getUser.data[0].f_userinfo_code)) {
113
+ await this.toBusiness(getUser.data[0])
114
+ }
115
+ }
116
+ }
117
+ }
118
+ })
119
+ }, this.searchTime * 1000)
120
+ } catch (error) {
121
+ console.log('捕获到异常', error)
122
+ }
123
+ },
124
+ setsustainMoney () {
125
+ this.sustainMoney = window.localStorage.getItem('sustainMoney')
126
+ },
127
+ setField (type) {
128
+ this.selectFiled = type
129
+ this.worktype = type
130
+ },
131
+ async toBusiness (obj) {
132
+ console.log('双击列表的时候传进来的数据:', obj)
133
+ if (!(obj instanceof Event)) {
134
+ // 对此数据进行验证
135
+ if (await this.validateRow(obj)) {
136
+ // 获取未写卡或者写卡失败记录
137
+ let getUnWriteSell = await this.$SqlService.singleTable('t_sellinggas', `f_state = '有效' and (f_write_card = '未写卡' or (f_write_card = '写卡失败' and f_operate_date >= DATEADD(HOUR, -3, GETDATE()))) and f_userfiles_id = '${obj.f_userfiles_id}'`)
138
+ console.log('获取未写卡记录', getUnWriteSell)
139
+ if (getUnWriteSell.data.length > 1) {
140
+ this.$showAlert('此卡已缴费多次未写卡。请核实后处理!!', 'warning', 5000)
141
+ } else {
142
+ this.row = obj
143
+ this.row.unWriteSell = getUnWriteSell.data
144
+ this.cardInfo = this.$refs.list.cardInfo
145
+ this.$refs.list.criteriaShow = false
146
+ // 将列表只显示该条数据
147
+ this.$refs.list.refreshRow(obj)
148
+ }
149
+ }
150
+ }
151
+ },
152
+ close () {
153
+ this.showModal = false
154
+ this.warningInfo = null
155
+ this.clean()
156
+ this.$refs.list.search()
157
+ // this.$refs.card.search()
158
+ },
159
+ async validateRow (obj) {
160
+ console.log('查看传进来的参数:', obj)
161
+ this.warningInfo = await this.$resetpost('rs/logic/getWarningMsg',
162
+ {data: {
163
+ f_userfiles_id: obj.f_userfiles_id,
164
+ f_userinfo_code: obj.f_userinfo_code,
165
+ f_userinfo_id: obj.f_userinfo_id
166
+ }
167
+ }
168
+ , {resolveMsg: '', rejectMsg: '获取提示失败'})
169
+ if (this.warningInfo.data.warningNum > 0 && obj.f_user_state !== '预备') {
170
+ this.modalrow = obj
171
+ this.showModal = true
172
+ return false
173
+ } else {
174
+ return true
175
+ }
176
+ },
177
+ clean () {
178
+ this.row = null
179
+ this.cardInfo = null
180
+ },
181
+ clearCondition () {
182
+ Object.keys(this.$refs.list.$refs.paged.$refs.cri.model).forEach((key) => {
183
+ console.log('key', key)
184
+ console.log('对应啥数据', this.$refs.list.$refs.paged.$refs.cri.model[key])
185
+ this.$refs.list.$refs.paged.$refs.cri.model[key] = []
186
+ })
187
+ // console.log('清数据。。。', this.$refs.list.$refs.paged.$refs.grid.model.rows)
188
+ // this.$set('$refs.list.$refs.paged.$refs.grid.model.rows', [])
189
+ },
190
+ dealMsg (obj) {
191
+ console.log('==================obj', obj)
192
+ this.listpage = false
193
+ this.rowData = obj
194
+ },
195
+ cancel (obj) {
196
+ this.listpage = true
197
+ },
198
+ cancelAndRefresh (obj) {
199
+ this.listpage = true
200
+ this.clean()
201
+ this.clearCondition()
202
+ this.$refs.list.searchNoData()
203
+ this.$refs.card.search()
204
+ },
205
+ modalsuccess (obj) {
206
+ this.showModal = false
207
+ this.$refs.list.criteriaShow = false
208
+ this.row = obj
209
+ this.cardInfo = this.$refs.list.cardInfo
210
+ // 将列表只显示该条数据
211
+ this.$refs.list.refreshRow(obj)
212
+ },
213
+ async serRow (obj) {
214
+ let newdata = await this.$resetpost('rs/sql/sale_getUser', {
215
+ data: {condition: `i.f_userinfo_code='${obj.f_userinfo_code}' and u.f_filialeid = '${obj.f_filialeid}'`, orderitem: `f_userinfo_id Desc`}
216
+ }, {resolveMsg: null, rejectMsg: '获取用户信息失败'})
217
+ this.toBusiness(newdata.data[0])
218
+ // this.$refs.list.search()
219
+ }
220
+ },
221
+ events: {
222
+ 'error' (name, row, res) {
223
+ this.clean()
224
+ },
225
+ 'row' (val) {
226
+
227
+ },
228
+
229
+ 'success' (name, row, res) {
230
+ this.setsustainMoney()
231
+ // name === '发卡售气' ? this.$refs.list.toNext(this.index) : null
232
+ if (name === '机表收费确认') {
233
+ this.serRow(row)
234
+ return
235
+ }
236
+ if (name === '卡表收费' && this.reSearchShowMsy) {
237
+ this.$refs.list.$refs.paged.$refs.cri.$refs.readcard.readCard()
238
+ this.$refs.oper.noButton = false
239
+ return
240
+ }
241
+ if (name === '物联网收费' && this.reSearchShowMsy) {
242
+ this.serRow(row)
243
+ return
244
+ }
245
+ console.log('成功事件')
246
+ this.clean()
247
+ this.$refs.list.search()
248
+ // this.clearCondition()
249
+ // this.$refs.card.search()
250
+ // this.$refs.info.$refs.recordstoryinfo.getdata()
251
+ },
252
+ 'clean' (row) {
253
+ // this.$refs.list.singleRefresh(row)
254
+ this.clean()
255
+ },
256
+ 'refresh' () {
257
+ this.setsustainMoney()
258
+ this.clean()
259
+ this.clearCondition()
260
+ this.$refs.list.searchNoData()
261
+ this.$refs.card.search()
262
+ },
263
+ 'resflushvalue' () {
264
+ this.$refs.info.$refs.valueaddinfo.reflush()
265
+ },
266
+ 'resflushrowdata' () {
267
+ this.toBusiness(this.row)
268
+ },
269
+ 'resflushdata' (data) {
270
+ this.toBusiness(data)
271
+ },
272
+ 'refreshrow' (val) {
273
+ console.log(val)
274
+ this.row = val
275
+ this.$refs.list.refreshRow(val)
276
+ // this.$refs.card.search()
277
+ },
278
+ 'cancelclean' (row) {
279
+ this.clean()
280
+ this.$refs.list.searchNoData()
281
+ // this.$refs.card.search()
282
+ }
283
+ },
284
+ watch: {
285
+ 'row' () {
286
+ // this.$refs.tab.$el.click()
287
+ }
288
+ }
289
+ }
290
+ </script>
291
+ <style>
292
+ .basic-main {
293
+ width: 79%;
294
+ }
295
+ .tel_voiceActive{
296
+ font-family: PingFang-SC-Bold;
297
+ font-size: 16px;
298
+ font-weight: normal!important;
299
+ font-stretch: normal!important;
300
+ line-height: 18px;
301
+ letter-spacing: 0px;
302
+ color: #333333!important;
303
+ border-bottom: 3px solid #599fe5;
304
+ padding:10px 10px!important;
305
+ }
306
+ .tel_f_size{
307
+ font-family: PingFang-SC-Medium;
308
+ font-size: 16px;
309
+ font-weight: normal;
310
+ font-stretch: normal;
311
+ line-height: 18px;
312
+ letter-spacing: 0px;
313
+ color: #666666!important;
314
+ padding:10px 10px!important;
315
+ }
316
+ </style>
@@ -0,0 +1,286 @@
1
+ <template>
2
+ <div class="form-inline" style="height: auto">
3
+ <div class="form-group" v-for="btn in operBtns">
4
+ <button :id="btn.name" type="button"
5
+ :style="['其他欠费','调价补差'].includes(btn.name) ?'color:#CA2C16':'color:black'"
6
+ :class="[($index === 0) ? 'btn btn-click' : 'btn btn-un-click']" @click="business(btn)"
7
+ :disabled="noButton"><span
8
+ :style="['其他欠费','调价补差'].includes(btn.name) ?'color:#CA2C16':'color:black'">{{ btn.name }}</span>
9
+ </button>
10
+
11
+ </div>
12
+ </div>
13
+ <div v-show="isBusiness" style="height: auto" class="select-overspread">
14
+ <route v-ref:route></route>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import {HttpResetClass} from 'vue-client'
20
+ import Vue from "vue";
21
+
22
+ let getNewmetermsg = async function (self, row) {
23
+ self.cardInfo = undefined
24
+ if (row.f_userfiles_id && row.f_userfiles_id.length > 0) {
25
+ // 获取用户信息
26
+ let getUser = await self.$resetpost('rs/sql/sale_getUser', {
27
+ data: {
28
+ condition: `u.f_userfiles_id='${row.f_userfiles_id}' `,
29
+ orderitem: `u.f_userfiles_id Desc`
30
+ }
31
+ }, {resolveMsg: '读卡新的用户成功', rejectMsg: '读卡新的用户失败'})
32
+ if (getUser.data.length > 0) {
33
+ await self.$showAlert('换表成功', 'success', 200)
34
+ self.data = getUser.data[0]
35
+ }
36
+ }
37
+ }
38
+ let getBtnsGen = async function (self) {
39
+ let http = new HttpResetClass()
40
+ let param = {
41
+ f_userfiles_id: self.data.f_userfiles_id
42
+ }
43
+ if (self.cardInfo) {
44
+ param.cardInfo = self.cardInfo
45
+ }
46
+ let res = await http.load('POST', 'rs/logic/getOperBtns', {
47
+ data: param
48
+ }, {
49
+ resolveMsg: null,
50
+ rejectMsg: '获取业务按钮失败!!'
51
+ })
52
+ let getBtns = res.data
53
+ console.log('获取的业务按钮', getBtns)
54
+ console.log('有没有用户信息', self.data)
55
+ if (self.$login.r.length === 0) {
56
+ self.$showAlert('您没有相关的业务操作权限, 请联系管理员!!', 'warning', 2000)
57
+ } else {
58
+ self.temp = []
59
+ for (let i = 0; i < getBtns.length; i++) {
60
+ // 不需要权限的按钮
61
+ let noInclude = getBtns[i].name === '垃圾费收费'
62
+ if (noInclude || self.$login.r.includes(getBtns[i].name)) {
63
+ // 进行权限验证
64
+ if (getBtns[i].name === '换表&清零') {
65
+ self.temp.push({
66
+ name: '换表',
67
+ value: getBtns[i].value
68
+ })
69
+ if (self.data.f_totalsplit_type !== '总表') {
70
+ self.temp.push({
71
+ name: '清零',
72
+ value: {
73
+ 'weight': getBtns[i].value.weight,
74
+ 'routeName': 'reset-meter'
75
+ }
76
+ })
77
+ }
78
+ } else {
79
+ self.temp.push(getBtns[i])
80
+ }
81
+ console.log(self.temp[i])
82
+ }
83
+ }
84
+ // 如果有未写卡记录,添加线下写卡按钮
85
+ if (self.data.unWriteSell) {
86
+ if (self.data.unWriteSell.length > 0) {
87
+ self.temp.push({
88
+ name: '线下写卡',
89
+ value: {
90
+ 'weight': 0,
91
+ 'routeName': 'un-write-card-center'
92
+ }
93
+ })
94
+ }
95
+ }
96
+ if (self.data.f_user_nature === '单位') {
97
+ self.temp.push({
98
+ name: '维管收费',
99
+ value: {
100
+ 'weight': 5,
101
+ 'routeName': 'repair-charge'
102
+ }
103
+ })
104
+ }
105
+ if (self.data.f_meter_type === '物联网表') {
106
+ if (self.data.f_hascard === '是') {
107
+ if (self.data.f_whether_hairpin === '未发') {
108
+ if (self.data.f_share_times !== '' && self.data.f_share_times === '是' && self.data.f_times > 0) {
109
+ self.temp.push({
110
+ name: '补卡',
111
+ value: {
112
+ 'weight': 2,
113
+ 'routeName': 'replace-card-manage'
114
+ }
115
+ })
116
+ } else {
117
+ }
118
+ }
119
+ }
120
+ }
121
+ // 如果卡上有气,添加购气撤销按钮
122
+ if (self.cardInfo && (self.cardInfo.Gas > 0 || self.cardInfo.Money > 0 || (self.cardInfo.TotalMoney > 0 && self.data.f_support_purchase === '是'))) {
123
+ self.temp.push({
124
+ name: '购气撤销',
125
+ value: {
126
+ 'weight': 0,
127
+ 'routeName': 'card-meter-charge-cancel'
128
+ }
129
+ })
130
+ if (self.data.unWriteSell && self.data.unWriteSell.length > 0) {
131
+ // 过滤掉线下写卡
132
+ self.temp = self.temp.filter((item) => {
133
+ return item.name !== '线下写卡'
134
+ })
135
+ self.data.unWriteSell.forEach(
136
+ async (item) => {
137
+ let sql = `update t_sellinggas set f_write_card = null where id = '${item.id}' and f_write_card ='写卡失败'`
138
+ await self.$resetpost('rs/logic/runSQL', { sql: sql })
139
+ }
140
+ )
141
+ }
142
+ }
143
+ /* // 如果是预备户,删除发卡售气按钮
144
+ if (self.data.f_user_state == '预备') {
145
+ self.temp.splice(self.temp.findIndex(item => item.name === '发卡售气'), 1)
146
+ } */
147
+
148
+ // 根据权重将业务按钮排序
149
+ self.operBtns = self.temp.sort((a, b) => {
150
+ return a.value.weight - b.value.weight
151
+ })
152
+
153
+ // 当有调价补差时,只展示调价补差按钮
154
+ let adjustSenders = self.operBtns.find((row) => {
155
+ return row.name == '调价补差'
156
+ })
157
+ if (adjustSenders) {
158
+ self.operBtns = []
159
+ self.operBtns.push(adjustSenders)
160
+ }
161
+
162
+ if (self.operBtns.length > 0) {
163
+ self.isBusiness = true
164
+ self.$refs.route.init(self.operBtns[0].value.routeName, {row: self.data, cardData: self.cardInfo})
165
+ self.styleChange(self.operBtns[0])
166
+ }
167
+ }
168
+ }
169
+
170
+ export default {
171
+ title: '业务操作',
172
+ data() {
173
+ return {
174
+ operBtns: [],
175
+ isBusiness: false,
176
+ noButton: false // 业务请求时禁止按钮点击
177
+ }
178
+ },
179
+ props: ['data', 'cardInfo'],
180
+ ready() {
181
+ getBtnsGen(this)
182
+ console.log('data,cardInfo', this.data, this.cardInfo)
183
+
184
+ },
185
+ methods: {
186
+ business(btn) {
187
+ // // 处理按钮样式
188
+ // this.styleChange(btn.name)
189
+ // this.isBusiness = true
190
+ // this.$refs.route.init(btn.value.routeName, {row: this.data, cardData: this.cardInfo})
191
+ if (this.$refs.route.cards.length > 0) {
192
+ if (this.$refs.route.cards[0].title == '增值服务管理') {
193
+ this.$showMessage('切换页面后,当前页面数据会丢失,是否切换?', ['confirm', 'cancel']).then(res => {
194
+ if (res == 'cancel') {
195
+ return;
196
+ } else {
197
+ // 处理按钮样式
198
+ this.styleChange(btn.name)
199
+ this.isBusiness = true
200
+ this.$refs.route.init(btn.value.routeName, {row: this.data, cardData: this.cardInfo})
201
+ }
202
+ })
203
+ } else {
204
+ // 处理按钮样式
205
+ this.styleChange(btn.name)
206
+ this.isBusiness = true
207
+ this.$refs.route.init(btn.value.routeName, {row: this.data, cardData: this.cardInfo})
208
+ }
209
+ }
210
+ },
211
+
212
+ styleChange(name) {
213
+ this.operBtns.forEach((res) => {
214
+ if (res.name === name) {
215
+ if (document.getElementById(res.name)) {
216
+ document.getElementById(res.name).style.backgroundColor = '#6aa6e2'
217
+ document.getElementById(res.name).style.color = 'white'
218
+ }
219
+ } else {
220
+ if (document.getElementById(res.name)) {
221
+ document.getElementById(res.name).style.backgroundColor = 'white'
222
+ document.getElementById(res.name).style.color = 'black'
223
+ }
224
+ }
225
+ })
226
+ }
227
+ },
228
+ watch: {
229
+ 'data'() {
230
+ getBtnsGen(this)
231
+ }
232
+ },
233
+ events: {
234
+ 'no-button'() {
235
+ this.noButton = true
236
+ },
237
+ 'has-button'() {
238
+ this.noButton = false
239
+ },
240
+ 'get-new-row'(row) {
241
+ console.log('xxxxxx', row)
242
+ // 发生换表成功
243
+ getNewmetermsg(this, row)
244
+ },
245
+ 'toroute' (buttonObj, data) {
246
+ console.log('指定按钮。。', buttonObj)
247
+ this.$resetpost('rs/sql/sale_getUser', {
248
+ data: {condition: `i.f_userinfo_code='${data.f_userinfo_code}' and u.f_filialeid = '${data.f_filialeid}'`, orderitem: `f_userinfo_id Desc`}
249
+ }, {resolveMsg: null, rejectMsg: '获取用户信息失败'}).then((res)=>{
250
+ if (buttonObj) {
251
+ this.$dispatch('resflushdata', res.data[0])
252
+ this.styleChange(buttonObj.name)
253
+ this.$refs.route.init(buttonObj.value, {row: res.data[0]})
254
+ }
255
+ })
256
+ },
257
+ 'button-specifies'(buttonObj, data) {
258
+ console.log('指定按钮。。', buttonObj)
259
+ // buttonObj 格式: {name:'机表收费', value: 'machine-meter-center'}
260
+ if (buttonObj) {
261
+ this.styleChange(buttonObj.name)
262
+ this.$refs.route.init(buttonObj.value, {row: data})
263
+ }
264
+ }
265
+ }
266
+ }
267
+ </script>
268
+
269
+ <style scoped>
270
+
271
+ .btn-click {
272
+ background-color: #6aa6e2;
273
+ border-radius: 5px;
274
+ color: white;
275
+ /*border-color: black;*/
276
+ border: solid 1px #c7c7c7;
277
+ }
278
+
279
+ .btn-un-click {
280
+ background-color: white;
281
+ border-radius: 5px;
282
+ color: black;
283
+ /*border-color: black;*/
284
+ border: solid 1px #c7c7c7;
285
+ }
286
+ </style>