sale-client 3.6.86 → 3.6.87

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.86",
3
+ "version": "3.6.87",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -180,7 +180,7 @@
180
180
  data () {
181
181
  return {
182
182
  condition: '1=1',
183
- model: new PagedList('rs/sql/sale_HandplanQuery', 20, {}, {
183
+ model: new PagedList('rs/sql/sale_HandplanQuery', 20, {f_user_id: this.row.f_user_id}, {
184
184
  f_oughtfee: 0,
185
185
  f_oughtamount: 0,
186
186
  f_qianfei_fee: 0,
@@ -0,0 +1,574 @@
1
+ <template>
2
+ <div @keyup.enter="search">
3
+ <partial-view v-ref:pv>
4
+ <criteria-paged :model="model" :pager="false" v-ref:paged>
5
+ <criteria @condition-changed='$parent.$parent.selfSearch' partial='criteria' v-ref:cri>
6
+ <div class="form-horizontal" novalidate partial>
7
+ <div class="row">
8
+ <div class="form-group col-sm-4">
9
+ <!-- <label>用户编号:</label> -->
10
+ <input class="input_search" condition="f_userinfo_code = '{}'" placeholder='客户编号' style="width: 80%"
11
+ type="text"
12
+ v-model="model.f_userinfo_code">
13
+ </div>
14
+ <div class="form-group col-sm-4" style="flex: 1;width: max-content">
15
+ <!-- <label>操作类型:</label> -->
16
+ <v-select :options='$parent.$parent.$parent.operationtypes'
17
+
18
+ :value.sync="model.f_operat_type"
19
+ :width="'100%'"
20
+ close-on-select
21
+ condition="f_operat_type = '{}'"
22
+ id="f_paytype"
23
+ placeholder='操作类型'
24
+ style="width: 100%"
25
+ v-model="model.f_operat_type"></v-select>
26
+ </div>
27
+ <div class="form-group col-sm-2 button-range" style="padding-right: 10px">
28
+ <button @click="search()" class="button_search">查询</button>
29
+ <div
30
+ :class="{'button_shrink_top':$parent.$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.$parent.criteriaShow}"
31
+ @click="$parent.$parent.$parent.criteriaShow=!$parent.$parent.$parent.criteriaShow" class="button_spacing" style="float: right"></div>
32
+ </div>
33
+ <div class="form-group col-sm-5" v-show="$parent.$parent.$parent.criteriaShow">
34
+ <!-- <label>用户编号:</label> -->
35
+ <input class="input_search" condition="r.f_operator like '%{}%'" placeholder='操作员' style="width: 80%"
36
+ type="text"
37
+ v-model="model.f_operator">
38
+ </div>
39
+ </div>
40
+ <!-- <partial name="cardcriteria"></partial> -->
41
+ <!-- <div class="form-group">
42
+ <partial name="cardcriteria"></partial>
43
+ </div> -->
44
+ </div>
45
+ </criteria>
46
+ <div partial="list" style="overflow-y: scroll;height: 90%">
47
+ <accordion :one-at-atime="true" type="info" >
48
+ <panel :is-click="false" :is-open="true" type="info" v-for="row in model.rows" >
49
+ <span @click="$parent.$parent.$parent.selected(row)" class="panel-title row" slot="header"
50
+ style="cursor: pointer;">
51
+ <div class="col-sm-11">
52
+ <!-- <div class="row" v-if="row.f_state==='冲正' " style="color: red">-->
53
+ <!-- <strong :title="row.f_userinfo_code" class="col-sm-4" show-overflow-tooltip="true">{{row.f_userinfo_code.length>9?''+row.f_userinfo_code.substring(0,9)+'...':row.f_userinfo_code}}</strong>-->
54
+ <!-- <span class="col-sm-4">{{$parent.$parent.$parent.dateDes(row.f_operate_date)}}</span>-->
55
+ <!-- <span class="col-sm-4">{{row.type}}</span>-->
56
+ <!-- </div>-->
57
+ <div class="row">
58
+ <strong :title="row.f_userinfo_code" class="col-sm-4" show-overflow-tooltip="true">{{row.f_userinfo_code.length>9?''+row.f_userinfo_code.substring(0,9)+'...':row.f_userinfo_code}}</strong>
59
+ <span class="col-sm-4">{{$parent.$parent.$parent.dateDes(row.f_operate_date)}}</span>
60
+ <span class="col-sm-4">{{row.type}}</span>
61
+ </div>
62
+ </div>
63
+ <div class="col-sm-1" v-if="$parent.$parent.$parent.isOperate" title="涉及权限:冲正权限">
64
+ <dropdown class="auto"
65
+ v-if="(row.type ==='机表收费撤销' || row.type ==='卡表收费撤销' || row.type ==='物联网收费撤销' || row.type ==='其他收费撤销'
66
+ || row.type ==='气损收费撤销' || row.type ==='预存缴费' || row.type === '补卡' || row.type === '物联网收费' ||
67
+ row.type === '用户退费' || row.type === '机表收费' || row.type === '数码表收费' ||
68
+ row.type === '卡表收费' || row.type === '超用收费' || row.type === '发卡售气' || row.type === '其他收费' ||
69
+ row.type === '换表' || row.state === 1 || row.type==='调价补费' || row.type==='卡表赠气' ||
70
+ row.type==='物联网赠气'|| row.type==='物联网赠费'|| row.type==='卡表赠费'|| row.type==='卡表赠气'||
71
+ row.type==='卡表收费撤销'||row.type==='物联网补费' || row.type==='物联网扣费'||row.type==='机表补费'||
72
+ row.type==='机表扣费'||row.type==='物联网补气'||row.type==='物联网扣气'||row.type==='气损收费' ||
73
+ row.type === '气表清零' || row.type === '掉气补气' || row.type === '其他补气' || row.type === '清零补气' ||
74
+ row.type === '换表补气' || row.type === '过户'|| row.type ==='价格补差' || row.type ==='价格补差撤销') && row.type!=='新增户档案' && row.type!=='转气转出' && row.type!=='转气转入'">
75
+ <button data-toggle="dropdown" style="border: 0px;background: none;" type="button"
76
+ v-if="row.f_user_state==='正常'||row.f_user_state==='预备'||row.type==='气损收费' ">
77
+ <span class="glyphicon glyphicon-th-list"></span>
78
+ </button>
79
+ <ul class="dropdown-menu dropdown-menu-right" slot="dropdown-menu" style=" min-width: 60px;" v-if="row.f_user_state==='正常'||row.f_user_state==='预备'||row.type==='气损收费' ">
80
+ <!-- <li-->
81
+ <!-- v-if="row.type === '换新表' || row.type === '气表清零' || row.type === '掉气补气' || row.type === '其他补气' || row.type === '清零补气' || row.type === '换表补气'-->
82
+ <!-- || row.type === '补卡' || row.type === '物联网开户' || row.type === '物联网收费' || row.type === '用户退费' || row.type === '机表收费' || row.type === '数码表收费' || row.type === '卡表收费' || row.type === '超用收费' || row.type === '发卡售气' || row.type === '其他收费' || row.type === '换表' || row.type === '过户'|| row.type==='预存缴费'|| row.type==='退费'|| row.type==='调价补费' ||row.type==='卡表收费撤销'||row.type==='物联网补费' || row.type==='物联网扣费'||row.type==='机表补费'||row.type==='机表扣费'||row.type==='物联网补气'||row.type==='物联网扣气'||row.type==='气损收费' ">-->
83
+ <!-- <a @click.stop="$parent.$parent.$parent.operate('票据补打', row)" href="#">票据补打</a>-->
84
+ <!-- </li>-->
85
+ <!-- <li-->
86
+ <!-- v-if="row.state === 1 && (row.type === '其他收费欠费登记' || row.type === '迁表' || row.type === '调价预存' || row.type === '拆表' || row.type === '物联网开户' || row.type === '物联网收费'|| row.type === '卡表收费' || row.type === '其他收费'|| row.type === '气费减免'||row.type === '维修收费' || row.type === '过户' || row.type === '换新表' || row.type === '气表清零' || row.type === '机表收费' || row.type === '超用收费' || row.type === '其他收费' || row.type === '补卡'|| row.type === '调价补费'|| row.type=='预存缴费' || row.type==='卡表赠气'|| row.type==='物联网赠费'|| row.type==='卡表赠费'|| row.type==='物联网赠气')">-->
87
+ <!-- <a @click.stop="$parent.$parent.$parent.operate('撤销', row)" href="#">撤销</a>-->
88
+ <!-- </li>-->
89
+ <li>
90
+ <a @click.stop="$parent.$parent.$parent.operate('票据补打', row)" href="#">票据补打</a>
91
+ </li>
92
+ <li>
93
+ <a @click.stop="$parent.$parent.$parent.operate('撤销', row)" href="#">撤销</a>
94
+ </li>
95
+ </ul>
96
+ </dropdown>
97
+ </div>
98
+
99
+ </span>
100
+ <div class="panel-body" v-if="$parent.$parent.$parent.isSelected(row)">
101
+ <salecardgas-detail :data="row" v-if="row.type === '发卡售气'"></salecardgas-detail>
102
+ <movemeter-detail :data="row" v-if="row.type === '迁表'"></movemeter-detail>
103
+ <salecardgas-detail :data="row" v-if="row.type === '换表发卡'"></salecardgas-detail>
104
+ <cardmetercenter-detail :data="row" v-if="row.type === '卡表收费'||row.type === '数码表收费' "></cardmetercenter-detail>
105
+ <movegas-detail :data="row" v-if="row.type === '转气转出'"></movegas-detail>
106
+ <movegas-detail :data="row" v-if="row.type === '转气转入'"></movegas-detail>
107
+ <machinemetercenter-detail :data="row" v-if="row.type === '机表收费'"></machinemetercenter-detail>
108
+ <autoaccounts-detail :data="row" v-if="row.type === '自动下账'"></autoaccounts-detail>
109
+ <bankdk-detail :data="row" v-if="row.type === '银行代扣'"></bankdk-detail>
110
+ <bank-pay :data="row" v-if="row.type === '银行支付'"></bank-pay>
111
+ <wechat-pay :data="row" v-if="row.type === '微信支付'"></wechat-pay>
112
+ <disablemanage-detail :data="row" v-if="row.type === '停用'"></disablemanage-detail>
113
+ <enablemanage-detail :data="row" v-if="row.type === '启用'"></enablemanage-detail>
114
+ <replacecardmanage-detail :data="row" v-if="row.type === '补卡'"></replacecardmanage-detail>
115
+ <machinecard-detail :data="row" v-if="row.type === '机表补卡'"></machinecard-detail>
116
+ <transfermanage-detail :data="row" v-if="row.type === '过户'"></transfermanage-detail>
117
+ <othercharge-detail :data="row" v-if="row.type === '其他收费欠费登记'||row.type === '其他收费'||row.type === '维修收费'"></othercharge-detail>
118
+ <inputtorchange-detail :data="row" v-if="row.type === '抄表员变更'"></inputtorchange-detail>
119
+ <offgasaddgas-detail :data="row" v-if=" row.type === '换表补气' ||row.type === '其他补气' || row.type === '清零补气' || row.type === '掉气补气'||row.type==='物联网补费'||row.type==='物联网扣费'||row.type==='机表补费'||row.type==='机表扣费'||row.type==='物联网补气'||row.type==='物联网扣气' " ></offgasaddgas-detail>
120
+ <iotopen-detail :data="row" v-if="row.type === '开通'"></iotopen-detail>
121
+ <iotmetercenter-detail :data="row" v-if="row.type === '物联网收费' || row.type === '物联网开户' || row.type === '调价退费' || row.type === '调价补费'||row.type === '退押金' "></iotmetercenter-detail>
122
+ <overuserchange-detail :data="row" v-if="row.type === '超用收费'"></overuserchange-detail>
123
+ <adduser-detail :data="row" v-if="row.type === '新增户档案'"></adduser-detail>
124
+ <gaspricechange-detail :data="row" v-if="row.type === '气价变更'"></gaspricechange-detail>
125
+ <userchange-detail :data="row" v-if="row.type === '档案变更'"></userchange-detail>
126
+ <changemeter-detail :data="row" v-if="row.type === '换新表' || row.type === '气表清零'"></changemeter-detail>
127
+ <changeflowmeter-detail :data="row" v-if="row.type === '换卡控流量计'"></changeflowmeter-detail>
128
+ <cardoveruser-detail :data="row" v-if="row.type === '卡表超用'||row.type === '超用'"></cardoveruser-detail>
129
+ <cancellation-detail :data="row" v-if="row.type === '销户'"></cancellation-detail>
130
+ <refund-detail :data="row" v-if="row.type === '退费' || row.type == '卡表退费'"></refund-detail>
131
+
132
+ <change-meter-cancel :data="row" v-if="row.type === '换表撤销'"></change-meter-cancel>
133
+ <autoaccounts-cancel-detail :data="row" v-if="row.type === '自动下账撤销'"></autoaccounts-cancel-detail>
134
+ <transfermanage-cancel-detail :data="row" v-if="row.type === '过户撤销'"></transfermanage-cancel-detail>
135
+ <cardmetercenter-cancel-detail :data="row" v-if="row.type === '卡表收费撤销'"></cardmetercenter-cancel-detail>
136
+ <machinemetercenter-cancel-detail :data="row" v-if="row.type === '机表收费撤销'"></machinemetercenter-cancel-detail>
137
+ <machinemetercenter-cancel-detail :data="row" v-if="row.type == '预存缴费撤销'"></machinemetercenter-cancel-detail>
138
+ <othercharge-cancel-detail :data="row" v-if="row.type === '其他收费撤销'"></othercharge-cancel-detail>
139
+ <replacecardmanage-cancel-detail :data="row" v-if="row.type === '补卡撤销'"></replacecardmanage-cancel-detail>
140
+ <iotmetercenter-cancel-detail :data="row" v-if="row.type === '物联网收费撤销'"></iotmetercenter-cancel-detail>
141
+ <feededuction-detail :data="row" v-if="row.type === '补费' ||row.type === '扣费' ||row.type === '补气' ||row.type === '扣气' "></feededuction-detail>
142
+ <with-gas :data="row" v-if="row.type==='物联网赠气' || row.type==='物联网赠费'||row.type==='卡表赠气'||row.type==='卡表赠费'"></with-gas>
143
+ <replace-card-manageDetail :data="row" v-if=" row.type==='物联网补费'||row.type==='物联网扣费'||row.type==='机表补费'||row.type==='机表扣费'||row.type==='物联网补气'||row.type==='物联网扣气' "></replace-card-manageDetail>
144
+ <blacklist-detail :data="row" v-if="row.type ==='拉黑' ||row.type === '取消拉黑' "></blacklist-detail>
145
+ <advance-delivery-detail :data="row" v-if="row.type ==='卡表预交' "></advance-delivery-detail>
146
+ <machinemetercenter-detail :data="row" v-if="row.type === '预存缴费'||row.type == '调价预存'"></machinemetercenter-detail>
147
+ <price-adjustment-detail :data="row" v-if="row.type === '价格补差'"></price-adjustment-detail>
148
+ <gasloss-detail :data="row" v-if="row.type === '气损收费' || row.type === '气损收费撤销'"></gasloss-detail>
149
+ <garbage-detail :data="row" v-if="row.type === '垃圾费收费'"></garbage-detail>
150
+ </div>
151
+ <div style="margin-top: 8px;background: #FFF;" v-if="!$parent.$parent.$parent.isSelected(row)">
152
+ <span>{{row.f_describe}}</span>
153
+ </div>
154
+ </panel>
155
+ </accordion>
156
+ </div>
157
+
158
+ </criteria-paged>
159
+ </partial-view>
160
+ <record-cancel :data="cancel_data" :show.sync="cancel_show" @cancel="cancelOper()" @cancel-success="cancelSucc()" v-if="cancel_show"></record-cancel>
161
+ <reissue-bill :data="reissue_data" :show.sync="reissue_show" @cancel="reissueOper()" @reissue-success="reissueSucc()" v-if="reissue_show"></reissue-bill>
162
+ </div>
163
+ </template>
164
+ <script>
165
+ /**
166
+ *操作记录信息
167
+ */
168
+ import {PagedList} from 'vue-client'
169
+ import co from 'co'
170
+
171
+ let cancelGen = function *(self, data) {
172
+ let msgRet = yield self.$showMessage('撤销后数据不可恢复,确认撤销录入吗?', ['confirm', 'cancel'])
173
+ if (msgRet === 'cancel') return
174
+ // 撤销操作完成,刷新界面
175
+ self.search()
176
+ }
177
+
178
+ /**
179
+ * 发票补打
180
+ */
181
+ let reprintGen = async function* (self, row) {
182
+ try {
183
+ row.billUrl = self.getBillUrl(row)
184
+ if (!row.billUrl) {
185
+ self.$showMessage('当前操作类型暂时没有票据')
186
+ return
187
+ }
188
+ row.f_bill_type = row.type
189
+ row.f_bill_style = '普通收据'
190
+ row.f_operator = self.$login.f.name
191
+ row.f_operatorid = self.$login.f.id
192
+ row.f_orgid = self.$login.f.orgid
193
+ row.f_orgname = self.$login.f.orgs
194
+ row.f_depid = self.$login.f.depids
195
+ row.f_depname = self.$login.f.deps
196
+ self.reissue_data = JSON.parse(JSON.stringify(row))
197
+ if (row.type === '调价预存') {
198
+ let id = await self.$resetpost('rs/sql/singleTable_OrderBy', {
199
+ data: {
200
+ items: 'f_surplus_id',
201
+ tablename: 't_sellinggas',
202
+ condition: `id = '${row.id}'`,
203
+ orderitem: 'id'
204
+ }
205
+ }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
206
+ self.reissue_data.id = id.data[0].f_surplus_id
207
+ }
208
+ self.reissue_show = true
209
+ } catch (error) {
210
+ if (error.status) {
211
+ self.$warn(`加载数据出错, ${JSON.stringify(error)}`, 'CardList')
212
+ }
213
+ throw error
214
+ }
215
+ }
216
+ let asyncCardList = async function (self) {
217
+ await self.$getConfig(self, 'CardList')
218
+ console.log('操作汇总config', self.config)
219
+ }
220
+ export default {
221
+ title: '操作汇总',
222
+ data () {
223
+ return {
224
+ config: {
225
+ cancleother: false, // 默认可以撤销别人的操作
226
+ cancletime: true // 默认可以冲正今天以前的操作
227
+ },
228
+ model: new PagedList(`${this.sqlurl}`, 9999,
229
+ {
230
+ items: '"' + this.items + '"',
231
+ tablename: '"' + this.tablename + '"',
232
+ orderitem: '"' + this.orderitem + '"'
233
+ }),
234
+ show: false,
235
+ asideTitle: '用户操作',
236
+ row: Object,
237
+ comp: null,
238
+ operationtypes: this.$appdata.getParam('操作类型') ? [{
239
+ label: '全部',
240
+ value: ''
241
+ }, ...this.$appdata.getParam('操作类型')] : [],
242
+
243
+ cancel_show: false,
244
+ cancel_data: null,
245
+ criteriaShow: false,
246
+ reissue_show: false,
247
+ reissue_data: null,
248
+ authArr: this.$login.r ? this.$login.r : []
249
+ }
250
+ },
251
+ props: {
252
+ sqlurl: {
253
+ type: String,
254
+ default: 'rs/sql/getRecord'
255
+ },
256
+ items: {
257
+ type: String,
258
+ default: '*'
259
+ },
260
+ tablename: {
261
+ type: String,
262
+ default: 't_record'
263
+ },
264
+ orderitem: {
265
+ type: String,
266
+ default: 'f_operate_date desc'
267
+ },
268
+ btns: {
269
+ type: Array
270
+ },
271
+ operationtype: {
272
+ type: String,
273
+ default: ''
274
+ },
275
+ userinfoid: {},
276
+ isOperate: {
277
+ type: Boolean,
278
+ default: true
279
+ },
280
+ f_orgid: ''
281
+ },
282
+ ready () {
283
+ this.$refs.paged.$refs.cri.model.f_operat_type = [this.operationtype]
284
+ asyncCardList(this)
285
+ // this.search()
286
+ },
287
+ methods: {
288
+ dateDes (date) {
289
+ return this.$login.dateDescripte(date)
290
+ },
291
+ selected (row) {
292
+ if (this.row === row) {
293
+ this.row = null
294
+ } else {
295
+ this.row = row
296
+ }
297
+ },
298
+ isSelected (row) {
299
+ return this.row === row
300
+ },
301
+ search () {
302
+ let condition = '1=1'
303
+ if (this.f_orgid) {
304
+ condition += `and (u.f_filialeid in ${this.f_orgid} or g.f_orgid in ${this.f_orgid}) `
305
+ } else {
306
+ condition += `and (u.f_filialeid = '${this.$login.f.orgid}' or g.f_orgid ='${this.$login.f.orgid}')`
307
+ }
308
+ this.$refs.pv.load(this.sqlurl, {data: {condition: condition}}).then((a) => {
309
+ if (a.data.length === 0) {
310
+ this.model.rows = []
311
+ this.model.state = '错误'
312
+ this.model.error = '没有符合条件的记录'
313
+ return
314
+ }
315
+ this.model.state = '正确'
316
+ this.model.rows = a.data
317
+ })
318
+ },
319
+ disEvent (btn) {
320
+ this.$dispatch(`${btn.eventName}`)
321
+ },
322
+ async operate (title, row) {
323
+ console.log('撤销的这条数据的信息', row)
324
+ if (title === '撤销') {
325
+ // 验证是否能撤销
326
+ let res = await this.$resetpost('rs/logic/recordRepealJudge', {data: row}, {
327
+ resolveMsg: null,
328
+ rejectMsg: '验证权限错误!!'
329
+ })
330
+
331
+ if (!res.data.pass) {
332
+ this.$showMessage(res.data.msg)
333
+ return
334
+ }
335
+ if(row.type==='政府补贴'){
336
+ if(row.f_state ==='有效'){
337
+ let condition =` u.f_userfiles_id = '${row.f_userfiles_id}'`
338
+ let user = await this.$resetpost('rs/sql/sale_getUser', {data: {condition:condition}}, {
339
+ resolveMsg: null,
340
+ rejectMsg: '获取用户失败!!'
341
+ })
342
+ if(user.data.length>0){
343
+ if(user.data[0].f_issupport_feededuction==='否'){
344
+ return this.$showAlert('当前表型不支持撤销扣费操作', 'warning', 1500)
345
+ }
346
+ } else {
347
+ return this.$showAlert('获取用户信息失败', 'warning', 1500)
348
+ }
349
+ } else {
350
+ return this.$showAlert('该记录已撤销请勿重复操作', 'warning', 1500)
351
+ }
352
+
353
+ }
354
+ if (row.type === '卡表收费') {
355
+ if (!this.authArr.includes('无卡收费撤销权限')) {
356
+ this.$showAlert('当前用户没有【无卡收费撤销权限】,请联系管理员获取此权限后再进行该操作!', 'warning', 3000)
357
+ return
358
+ }
359
+ }
360
+ if (row.type === '物联网收费' || row.type === '卡表赠气' || row.type === '物联网赠费' || row.type === '卡表赠费' || row.type === '物联网赠气') {
361
+ let table_name = this.$appdata.getSingleValue('新抄表')? 't_web_handplan' : 't_handplan'
362
+ let getWebHand = await this.$SqlService.singleTable(table_name, `f_hand_state = '有效' and f_input_date > '${row.f_operate_date}' and f_userfiles_id = '${row.f_userfiles_id}'`)
363
+ console.log('长度', getWebHand)
364
+ if (getWebHand.data.length > 0) {
365
+ this.$showAlert('此次物联网收费之后有结算,不能撤销此纪录', 'warning', 1500)
366
+ return
367
+ }
368
+ } else if (row.type === '机表收费') {
369
+ let getWebHand = await this.$SqlService.singleTable('t_handplan', `f_hand_state = '有效' and f_input_date > '${row.f_operate_date}' and f_whether_pay = '是' and f_userfiles_id = '${row.f_userfiles_id}'`)
370
+
371
+ console.log('长度', getWebHand)
372
+ if (getWebHand.data.length > 0) {
373
+ this.$showAlert('此次机表收费之后有自动下账,不能撤销此纪录', 'warning', 1500)
374
+ return
375
+ }
376
+ let sql = `select th.*from t_handplan th
377
+ left join t_sellinghand tsh on th.id=tsh.f_hand_id
378
+ where th.f_hand_state = '有效' and th.f_input_date > '${row.f_operate_date}' and tsh.f_debt_money>0
379
+ and th.f_userfiles_id = '${row.f_userfiles_id}' and tsh.f_state='有效'`
380
+ let getwate = await this.$resetpost('rs/logic/sqlquery', {data: {sql: sql}}, {
381
+ resolveMsg: null,
382
+ rejectMsg: '获取记录详情出错!!'
383
+ })
384
+ if (getwate.data.length > 0) {
385
+ this.$showAlert('此次机表收费之后有自动下账,不能撤销此纪录', 'warning', 1500)
386
+ return
387
+ }
388
+ } else {
389
+ if (this.authArr.includes('冲正权限')) {
390
+ if (this.config.cancleother) {
391
+ if (row.f_operator != this.$login.f.name) {
392
+ this.$showAlert('不能撤销不是自己进行的操作', 'warning', 1500)
393
+ return
394
+ }
395
+ }
396
+ if (this.config.cancletime) {
397
+ let a = this.$login.toStandardYearMonth()
398
+ console.log('当前时间', a < row.f_operate_date)
399
+ if (!this.authArr.includes('跨月撤销')) {
400
+ if (row.f_operate_date < a) {
401
+ this.$showAlert('不能撤销非本月的记录,请联系管理员获取【跨月撤销】的权限。', 'warning', 1500)
402
+ return
403
+ }
404
+ }
405
+ }
406
+ } else {
407
+ this.$showAlert('当前用户没有【冲正权限】', 'warning', 1500)
408
+ return
409
+ }
410
+ }
411
+ }
412
+
413
+ if (title === '撤销') {
414
+ this.cancel_show = true
415
+ this.cancel_data = row
416
+ } else {
417
+ let reprint = reprintGen(this, row)
418
+ return co(reprint)
419
+ }
420
+ },
421
+ cancelOper () {
422
+ this.cancel_data = null
423
+ this.cancel_show = false
424
+ },
425
+ cancelSucc () {
426
+ console.log('-----------------------------撤销成功了,隐藏掉')
427
+ this.cancel_show = false
428
+ this.$dispatch('refresh')
429
+ },
430
+ reissueOper () {
431
+ this.reissue_data = null
432
+ this.reissue_show = false
433
+ },
434
+ reissueSucc () {
435
+ this.reissue_show = false
436
+ this.$dispatch('refresh')
437
+ },
438
+
439
+ getBillUrl (row) {
440
+ let type = row.type
441
+ let name = ''
442
+ // 根据type数据 选择调用的Logic
443
+ if (type === '过户') {
444
+ name = 'rs/report/transfer_bill'
445
+ } else if (type === '换新表' || type === '气表清零') {
446
+ name = 'rs/report/change_meter'
447
+ } else if (type === '机表收费' || type === '机表收费撤销') {
448
+ if (row.f_user_type === '非民用' && this.$login.r.includes('非民用纸质票据拆分')) {
449
+ name = 'rs/report/fmy_machine_bill'
450
+ } else {
451
+ name = 'rs/report/machine_bill'
452
+ }
453
+ } else if (type === '物联网收费' || type === '物联网收费撤销' || type === '物联网开户' || type === '物联网赠气') {
454
+ if (row.f_user_type === '非民用' && this.$login.r.includes('非民用纸质票据拆分')) {
455
+ name = 'rs/report/fmy_iot_bill'
456
+ } else {
457
+ name = 'rs/report/iot_bill'
458
+ }
459
+ } else if (type === '物联网补费' || type === '物联网扣费' || type === '物联网补气' || type === '物联网扣气' || type === '机表补费' || type === '机表扣费') {
460
+ name = 'rs/report/MakeUp'
461
+ } else if (type === '超用收费') {
462
+ name = 'rs/report/overuse_bill'
463
+ } else if (type === '其他收费' || type === '其他收费撤销') {
464
+ name = 'rs/report/otherCharge_bill'
465
+ } else if (type === '补卡') {
466
+ name = 'rs/report/replace_sell'
467
+ } else if (type === '发卡售气') {
468
+ if (row.f_user_type === '非民用' && this.$login.r.includes('非民用纸质票据拆分')) {
469
+ name = 'rs/report/fmy_sendCard_bill'
470
+ } else {
471
+ if (row.f_meter_classify === '金额卡表' && this.$appdata.getSingleValue('金额气量区分卡表票据')) {
472
+ name = 'rs/report/fee_sendCard_bill'
473
+ } else {
474
+ name = 'rs/report/sendCard_bill'
475
+ }
476
+ }
477
+ } else if (type === '卡表收费' || type === '卡表收费撤销' || type === '卡表赠气' || type === '卡表收费撤销') {
478
+ if (row.f_user_type === '非民用' && this.$login.r.includes('非民用纸质票据拆分')) {
479
+ name = 'rs/report/fmy_card_bill'
480
+ } else {
481
+ if (row.f_meter_classify === '金额卡表' && this.$appdata.getSingleValue('金额气量区分卡表票据')) {
482
+ name = 'rs/report/fee_card_bill'
483
+ } else {
484
+ name = 'rs/report/card_bill'
485
+ }
486
+ }
487
+ } else if (type === '预存缴费') {
488
+ name = 'rs/report/pre_sell'
489
+ } else if (type === '调价预存') {
490
+ name = 'rs/report/refund_sell'
491
+ } else if (type === '退费') {
492
+ name = 'rs/report/refund_sell'
493
+ } else if (type === '调价补费') {
494
+ name = 'rs/report/compensation_bill'
495
+ } else if (type === '数码表收费') {
496
+ name = 'rs/report/digtial_bill'
497
+ } else if (type === '气损收费' || type === '气损收费撤销') {
498
+ name = 'rs/report/gasloss_bill'
499
+ } else if (type === '掉气补气') {
500
+ name = 'rs/report/acceptOffGasAddGas_bill'
501
+ } else if (type === '其他补气') {
502
+ name = 'rs/report/acceptOtherGas_bill'
503
+ } else if (type === '清零补气' || type === '换表补气') {
504
+ if (row.f_meter_classify.indexOf('卡表') > -1) {
505
+ name = 'rs/report/card_gas_bill'
506
+ } else {
507
+ name = 'rs/report/iot_sell'
508
+ }
509
+ } else if (type === '垃圾费收费') {
510
+ name = 'rs/report/garbageChargeReport'
511
+ }
512
+ return name
513
+ },
514
+ // 撤销为统一操作,所以写到基础组件中
515
+ operateCancel (row) {
516
+ let cancel = cancelGen(this, row)
517
+ co(cancel)
518
+ },
519
+ selfSearch (args) {
520
+ // if (!this.$login.f.parent.parent.name.includes('统一资源管理')) {
521
+ // args.condition += `and f_filialeids = '${this.$login.f.f_orgids}'`
522
+ // }
523
+ if (this.f_orgid) {
524
+ args.condition += `and r.f_orgid in ${this.f_orgid}`
525
+ } else {
526
+ args.condition += `and r.f_orgid = '${this.$login.f.orgid}'`
527
+ }
528
+ if (this.authArr.includes('操作记录查询限定')) {
529
+ args.condition += ` and r.f_operatorid = '${this.$login.f.id}'`
530
+ }
531
+ this.model.search(args.condition, args.model)
532
+ }
533
+ },
534
+ watch: {
535
+ // 'userinfoid' (newVal) {
536
+ // this.model.rows={}
537
+ // if (newVal && newVal !== '') {
538
+ // this.$nextTick(function () {
539
+ // this.$refs.paged.$refs.cri.model.f_userinfo_code = newVal
540
+ // }.bind(this))
541
+ // }else{
542
+ // this.$nextTick(function () {
543
+ // this.$refs.paged.$refs.cri.model.f_userinfo_code = ""
544
+ // }.bind(this))
545
+ // }
546
+ // this.$refs.paged.$refs.cri.model.f_operat_type = ''
547
+ // }
548
+ 'userinfoid' (newVal) {
549
+ if (newVal && newVal !== '') {
550
+ this.$nextTick(function () {
551
+ this.$refs.paged.$refs.cri.model.f_userinfo_code = newVal
552
+ }.bind(this))
553
+ this.$refs.paged.$refs.cri.model.f_operat_type = ''
554
+ let condition = `f_userinfo_code = '${newVal}' and u.f_filialeid = '${this.$login.f.orgid}'`
555
+ this.$refs.pv.load(this.sqlurl, {data: {condition: condition}}).then((a) => {
556
+ if (a.data.length === 0) {
557
+ this.model.rows = []
558
+ this.model.state = '错误'
559
+ this.model.error = '没有符合条件的记录'
560
+ return
561
+ }
562
+ this.model.state = '正确'
563
+ this.model.rows = a.data
564
+ })
565
+ } else {
566
+ this.model.rows = {}
567
+ this.$nextTick(function () {
568
+ this.$refs.paged.$refs.cri.model.f_userinfo_code = ''
569
+ }.bind(this))
570
+ }
571
+ }
572
+ }
573
+ }
574
+ </script>
@@ -0,0 +1,322 @@
1
+ <template>
2
+ <div class="auto">
3
+ <modal :show.sync="show" v-ref:modal large backdrop="false">
4
+ <header slot="modal-header" class="modal-header" style="text-align: center">
5
+ <h4 class="modal-title">{{data.type}}撤销</h4>
6
+ </header>
7
+ <article slot="modal-body" class="modal-body">
8
+ <validator name='v'>
9
+ <form class="form-horizontal select-overspread">
10
+ <div class="form-group" v-if="config.hasBillManage">
11
+ <label class=" col-sm-2 control-label">发票撤销类型:</label>
12
+ <div class="col-sm-2">
13
+ <v-select v-model="f_cancel_type"
14
+ placeholder='请选择'
15
+ :value.sync="model.f_cancel_type"
16
+ :options='cancelTypes'
17
+ @change='cancelTypeChange'
18
+ :value-single="true"
19
+ close-on-select clear-button>
20
+ </v-select>
21
+ </div>
22
+ </div>
23
+ <div class="form-group" :class="[$v.f_cancel_reason.required ? 'has-error' : 'has-success']">
24
+ <label for="f_cancel_reason" class=" col-sm-2 control-label">撤销原因:</label>
25
+ <div class="col-sm-8">
26
+ <textarea class="form-control" v-model="model.f_cancel_reason" rows="3"
27
+ placeholder="请填写原因" v-validate:f_cancel_reason='{required: true}'></textarea>
28
+ </div>
29
+ </div>
30
+ <div class="form-group" :class="[$v.payment.required ? 'has-error' : '']"
31
+ v-if="data.type ==='批量收费'||data.type ==='团体收费'||data.type ==='物联网收费'|| data.type === '机表收费' || data.type === '卡表收费'|| data.type === '超用收费' || data.type === '发卡售气'|| data.type === '其他收费' ">
32
+ <label class="col-sm-2 font_normal_body" title="参数名称:付款方式">收款方式:</label>
33
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems"
34
+ v-validate:payment='{required: true }'>
35
+ <div class="col-sm-4">
36
+ <v-select v-model="f_payment"
37
+ placeholder='请选择'
38
+ :value.sync="model.f_payment"
39
+ :options='paytype' clear-button v-ref:payment></v-select></div>
40
+ </div>
41
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
42
+ </form>
43
+ </validator>
44
+ </article>
45
+ <footer slot="modal-footer" class="modal-footer">
46
+ <button class="btn btn-success" @click="confirm()" :disabled="!$v.valid">确认</button>
47
+ <button class="btn btn-default" @click="clean()">取消</button>
48
+ </footer>
49
+ </modal>
50
+ <correct-bill :show="print" :bill-config='config' :bill-data='billData'
51
+ @printok="printok" @toggle="printCancel" :data='printModel' v-ref:printbill ></correct-bill>
52
+ </div>
53
+ </template>
54
+
55
+ <script>
56
+ let postGen = async function (self, name) {
57
+ let url = 'rs/logic/' + name
58
+
59
+ // 获取冲正后的记录
60
+ let res = await self.$CancelService.cancel(url, self.model, self.data)
61
+ console.log('冲正后的记录。。', res, self.model)
62
+
63
+ // 判断需不需要判断冲正发票(发票管理)
64
+ if (false) {
65
+ if (self.model.f_cancel_type === 'newBill') {
66
+ // 显示发票信息,
67
+ self.printModel.id = res.data.record
68
+ self.printModel.f_type = res.data.type
69
+ self.printModel.f_use_type = self.model.f_use_type
70
+ self.billData.url = self.getBillUrl(self.data.type)
71
+ self.print = true
72
+ } else if (self.model.f_cancel_type === 'abort') {
73
+ await self.$CommonService.correctPaperBill(res.data.record, res.data.type, null, null, 'abort')
74
+ self.$dispatch('cancel-success')
75
+ }
76
+ } else {
77
+ console.log('准备刷新了!。。', res, self.model)
78
+ self.$dispatch('cancel-success')
79
+ }
80
+
81
+ // 判断需不需要冲正电子票
82
+ // if (self.isNeedEticket(getRecord.data, self.data.type)) {
83
+ // console.log('冲正打票,', getRecord.data.id, self.data.type)
84
+ // let getEticket = await self.$resetpost('rs/sql/singleTable', {
85
+ // data: {
86
+ // tablename: 't_eticket',
87
+ // condition: `f_sell_id = '${getRecord.data.id}' and f_type = '${self.data.type}'`
88
+ // }
89
+ // }, {resolveMsg: null, rejectMsg: '获取电子票明细失败!!'})
90
+ // console.log('获取电子票信息', getEticket)
91
+ // if (getEticket.data.length > 0) {
92
+ // await self.$CommonService.correctEticket(getRecord.data.id, self.data.type)
93
+ // }
94
+ // }
95
+ }
96
+
97
+ let readyGen = async function (self) {
98
+ await self.$getConfig(self, 'RecordCancel')
99
+ console.log('冲正业务config', self.config)
100
+ // 验证是否是卡表,如果是卡表提示卡表需要读卡撤销
101
+ console.log('卡看看有没有是卡表的标识', self.data)
102
+ if (self.data.type !== '气损收费') {
103
+ // 查询获取表状态
104
+ let res = await self.$resetpost('rs/sql/sale_getUserfilesDetail', {
105
+ data: {
106
+ condition: `f_userfiles_id = '${self.data.f_userfiles_id}'`
107
+ }
108
+ }, {resolveMsg: null, rejectMsg: '获取客户信息失败'})
109
+
110
+ if (res.data[0].f_meter_type.includes('卡表') && self.data.type === '换表补气') {
111
+ self.$showAlert(`您这是${res.data[0].f_meter_type}客户,撤销需要进行读卡撤销。`, 'warning', 5000)
112
+ self.$dispatch('cancel')
113
+ }
114
+ if (res.data[0].f_meter_type.includes('机表') && self.data.type === '换表补气') {
115
+ self.$showAlert(`您这是${res.data[0].f_meter_type}客户,暂不支持撤销。`, 'warning', 5000)
116
+ self.$dispatch('cancel')
117
+ }
118
+
119
+ if (res.data[0].f_meter_type.includes('物联网表') && (self.data.type === '' || self.data.type === '气表清零')) {
120
+ self.$showAlert(`您这是${res.data[0].f_meter_type}客户,暂不支持撤销。`, 'warning', 5000)
121
+ self.$dispatch('cancel')
122
+ }
123
+
124
+ // 获取原来收费记录使用的发票类型
125
+ let param = {
126
+ id: self.data.id,
127
+ type: self.data.type
128
+ }
129
+ let oldUseType = await self.$resetpost('rs/logic/sale_getOldUseType', {data: param}, {resolveMsg: null, rejectMsg: '获取原始票据信息出错!!'})
130
+ console.log('获取原始票据信息。。。', oldUseType)
131
+ if (self.config.hasBillManage && self.config.cancelType === 'newBill' && oldUseType.data.billtype) {
132
+ self.model.f_use_type = oldUseType.data.f_use_type
133
+ self.model.f_bill_type = [oldUseType.data.billtype]
134
+ self.hasValidateBill = self.config.hasBillManage
135
+ }
136
+ self.model.f_cancel_type = self.config.cancelType
137
+ if (self.data.type === '物联网收费' || self.data.type === '机表收费' || self.data.type === '卡表收费' || self.data.type === '超用收费' || self.data.type === '发卡售气') {
138
+ let getWebHand = await self.$SqlService.singleTable('t_sellinggas', `id = '${self.data.id}'`)
139
+ console.log('-----a--a-a-a-a-a-', getWebHand)
140
+ self.model.f_payment = [getWebHand.data[0].f_payment]
141
+ }
142
+ if (self.data.type === '其他收费') {
143
+ let getWebHand = await self.$SqlService.singleTable('t_othercharge', `id = '${self.data.id}'`)
144
+ console.log('-----a--a-a-a-a-a-', getWebHand)
145
+ self.model.f_payment = [getWebHand.data[0].f_payment]
146
+ }
147
+ }
148
+ }
149
+
150
+ export default {
151
+ props: ['show', 'data'],
152
+ title: '操作撤销',
153
+ data () {
154
+ return {
155
+ config: {
156
+ hasPrint: true,
157
+ hasBillManage: true, // 默认不启用发票管理
158
+ cancelType: 'newBill'
159
+ },
160
+ model: {
161
+ f_cancel_type: '',
162
+ f_cancel_reason: '',
163
+ f_cancel_name: this.$login.f.name,
164
+ f_operator: this.$login.f.name,
165
+ f_operatorid: this.$login.f.id,
166
+ f_orgid: this.$login.f.orgid,
167
+ f_orgname: this.$login.f.orgs,
168
+ f_depid: this.$login.f.depids,
169
+ f_depname: this.$login.f.deps,
170
+ record_id: ''
171
+ },
172
+
173
+ // 发票信息
174
+ printModel: {},
175
+ print: false,
176
+ paytype: this.$appdata.getParam('付款方式'),
177
+ billData: {
178
+ url: '',
179
+ bill: ''
180
+ },
181
+ // 启用发票管理需要对票号进行验证
182
+ hasValidateBill: false,
183
+ validateOk: false
184
+ }
185
+ },
186
+ ready () {
187
+ readyGen(this)
188
+ },
189
+ methods: {
190
+ confirm () {
191
+ // 整理数据
192
+ let name = this.sortdata()
193
+ // 撤销操作请求
194
+ postGen(this, name)
195
+ },
196
+ clean () {
197
+ this.$dispatch('cancel', this.model)
198
+ },
199
+ // 判断type类型 整理数据
200
+ sortdata () {
201
+ this.model.record_id = this.data.id
202
+ let type = this.data.type
203
+ let name
204
+ // 根据type数据 选择调用的Logic
205
+ if (type === '过户') {
206
+ name = 'transferCancel'
207
+ } else if (type === '换新表' || type === '气表清零') {
208
+ name = 'changemeterCancel'
209
+ } else if (type === '机表收费') {
210
+ name = 'machineChargeCancelPay'
211
+ } else if (type === '物联网收费' || type === '物联网开户' || type === '卡表赠气' || type === '物联网赠费' || type === '卡表赠费' || type === '物联网赠气') {
212
+ name = 'iotMeterChargeCancel'
213
+ } else if (type === '开通') {
214
+ name = 'iotOpenCancel'
215
+ } else if (type === '卡表超用') {
216
+ name = 'cardOverCancel'
217
+ } else if (type === '超用收费') {
218
+ name = 'overuseCancel'
219
+ } else if (type === '其他收费') {
220
+ name = 'otherFeeRollback'
221
+ } else if (type === '维修收费') {
222
+ name = 'otherFeeRollback'
223
+ } else if (type === '补卡') {
224
+ name = 'replaceCardCancel'
225
+ } else if (type === '换表补气') {
226
+ name = 'iotChangeAddGasCancel'
227
+ } else if (type === '调价补费' || type === '调价退费') {
228
+ name = 'compensationCancel'
229
+ } else if (type ==='调价预存') {
230
+ name = 'compensationPreCancel'
231
+ } else if (type === '预存缴费') {
232
+ name = 'depositChargeCancel'
233
+ } else if (type === '拆表') {
234
+ name = 'cancelCB'
235
+ } else if (type === '迁表') {
236
+ name = 'cancelmovemeter'
237
+ } else if (type === '气费减免') {
238
+ name = 'machineChargeCancelPay'
239
+ } else if (type === '气损收费') {
240
+ name = 'gasLossCancel'
241
+ } else if (type === '卡表收费') {
242
+ name = 'noWriteCardCancel'
243
+ } else if (type === '其他收费欠费登记') {
244
+ name = 'otherchargenopayCancel'
245
+ } else if (type === '批量收费' || type === '团体收费') {
246
+ name = 'batchPaymentCancel'
247
+ } else if (type === '垃圾费收费') {
248
+ name = 'garbageChargesCancel'
249
+ } else if (type === '政府补贴') {
250
+ name = 'subsidiesCancel'
251
+ }else {
252
+ return
253
+ }
254
+ return name
255
+ },
256
+ getBillUrl (type) {
257
+ let name = ''
258
+ // 根据type数据 选择调用的Logic
259
+ if (type === '过户') {
260
+ name = 'rs/report/transfer_bill'
261
+ } else if (type === '换表') {
262
+ console.log('看看row..', this.row)
263
+ name = 'rs/report/change_meter'
264
+ } else if (type === '机表收费') {
265
+ name = 'rs/report/machine_bill'
266
+ } else if (type === '物联网收费') {
267
+ name = 'rs/report/pre_sell'
268
+ } else if (type === '超用收费') {
269
+ name = 'rs/report/overuse_bill'
270
+ } else if (type === '其他收费') {
271
+ name = 'rs/report/otherCharge_bill'
272
+ } else if (type === '补卡') {
273
+ name = 'rs/report/replace_sell'
274
+ }
275
+ return name
276
+ },
277
+ isNeedEticket (record, type) {
278
+ // TODO 需要其他类型再继续加
279
+ if (type === '补卡') {
280
+ // 判断卡费是否大于零
281
+ if (record.f_cardfees > 0) {
282
+ return true
283
+ }
284
+ } else if (type === '其他收费') {
285
+ if (record.f_collection > 0) {
286
+ return true
287
+ }
288
+ } else if (type === '超用收费') {
289
+ if (record.f_collection > 0) {
290
+ return true
291
+ }
292
+ } else if (type === '物联网表收费') {
293
+ if (record.f_collection > 0) {
294
+ return true
295
+ }
296
+ }
297
+ return false
298
+ },
299
+ validateBill (val) {
300
+ this.validateOk = !val.isOk
301
+ this.billData.bill = val.bill
302
+ },
303
+ printok () {
304
+ this.$dispatch('cancel-success')
305
+ },
306
+ printCancel () {
307
+ this.$dispatch('cancel')
308
+ },
309
+ cancelTypeChange () {
310
+ console.log('撤销类型。。', this.model)
311
+ if (this.model.f_cancel_type) {
312
+ this.hasValidateBill = this.model.f_cancel_type === 'newBill'
313
+ }
314
+ }
315
+ },
316
+ computed: {
317
+ cancelTypes () {
318
+ return [{label: '使用新票号', value: 'newBill'}, {label: '旧发票作废', value: 'abort'}]
319
+ }
320
+ }
321
+ }
322
+ </script>
@@ -26,6 +26,9 @@ export default function () {
26
26
  Vue.component('iot-refund', (resolve) => { require(['./IOTRefund'], resolve) })
27
27
  // 物联网赠气
28
28
  Vue.component('iotTable', (resolve) => { require(['./iotTable'], resolve) })
29
+ Vue.component('card-list', (resolve) => { require(['./CardList'], resolve) })
30
+ // 操作记录撤销
31
+ Vue.component('record-cancel', (resolve) => { require(['./RecordCancel'], resolve) })
29
32
  // 物联网赠气
30
33
  Vue.component('icTable', (resolve) => { require(['./icTable'], resolve) })
31
34
  }