sale-client 3.5.235 → 3.5.236

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.5.235",
3
+ "version": "3.5.236",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -778,8 +778,8 @@
778
778
  'f_operator': '操作员',
779
779
  'f_depname': '部门',
780
780
  'f_orgname': '公司',
781
- 'f_surplus_gas': '剩余气量',
782
- 'f_haircut_gas': '扣减气量',
781
+ // 'f_surplus_gas': '剩余气量',
782
+ // 'f_haircut_gas': '扣减气量',
783
783
  'f_stair1amount': '一阶气量',
784
784
  'f_stair1price': '一阶单价',
785
785
  'f_stair1fee': '一阶气费',
@@ -0,0 +1,385 @@
1
+ <template>
2
+ <div class="auto">
3
+ <validator name='v'>
4
+ <form novalidate class="form-horizontal">
5
+ <div class="row">
6
+ <div class="col-sm-4 form-group" :class="[$v.payment.required ? 'select-error' : '']">
7
+ <label class="font_normal_body" title="参数名称:付款方式">收款方式</label>
8
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
9
+ <v-select v-model="f_payment"
10
+ placeholder='请选择'
11
+ style="width:60%"
12
+ :value.sync="model.f_payment"
13
+ :options='paytype'
14
+ v-ref:payment
15
+ close-on-select clear-button></v-select>
16
+
17
+ </div>
18
+ <div class="col-sm-4 form-group">
19
+ <label for="f_print" class="font_normal_body">打印格式</label>
20
+
21
+ <v-select id="print"
22
+ v-model="f_print"
23
+ style="width:60%"
24
+ placeholder='请选择'
25
+ :value.sync="model.f_print"
26
+ :options='printstyle'
27
+ close-on-select clear-button>
28
+ </v-select>
29
+ </div>
30
+ <div class="col-sm-4 form-group" v-if="data.f_collection_type === '按气量'">
31
+ <label class="font_normal_body">剩余气量</label>
32
+ <input class="input_search" style="width:60%" type="number" v-model="data.f_balance_gas" readonly>
33
+ </div>
34
+ <div class="col-sm-4 form-group" v-if="data.f_collection_type === '按气量'">
35
+ <label class="font_normal_body">核算单价</label>
36
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_price" >
37
+ </div>
38
+ <div class="col-sm-4 form-group" v-if="data.f_collection_type === '按金额'">
39
+ <label class="font_normal_body">剩余金额</label>
40
+ <input class="input_search" style="width:60%" type="number" v-model="data.f_balance_amount" readonly>
41
+ </div>
42
+ <div class="col-sm-4 form-group" v-if="config.overBalance && data.f_collection_type === '按气量'"
43
+ :class="[$v.f_refund_gas.required || $v.f_refund_gas.dctest ? 'has-error' : 'has-success']">
44
+ <label class="font_normal_body">冲减气量</label>
45
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_refund_gas"
46
+ v-validate:f_refund_gas='{required: true, dctest: [0, ">=" ]}' placeholder="冲减气量" >
47
+ </div>
48
+ <div class="col-sm-4 form-group" v-if="!config.overBalance && data.f_collection_type === '按气量'"
49
+ :class="[$v.f_refund_gas.required || $v.f_refund_gas.dctest ? 'has-error' : 'has-success']">
50
+ <label class="font_normal_body">冲减气量</label>
51
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_refund_gas"
52
+ v-validate:f_refund_gas='{required: true, dctest: [data.f_balance_gas, "<=" ]}' placeholder="冲减气量" >
53
+ </div>
54
+ </div>
55
+
56
+ <div class="row">
57
+
58
+ <div class="col-sm-8">
59
+ <label for="f_paper_account" class="font_normal_body ">&nbsp;&nbsp;&nbsp;备注&nbsp;&nbsp;&nbsp;</label>
60
+ <input class="input_search" style="width:80%" v-model="model.f_comments">
61
+ </div>
62
+ <div class="col-sm-4 form-group" v-if="data.f_collection_type === '按气量'">
63
+ <label class="font_normal_body">退费金额</label>
64
+ <input class="input_search" style="width:60%"
65
+ type="number" v-model="model.f_refund_fee"
66
+ placeholder="退费金额">
67
+ </div>
68
+ <div class="col-sm-4 form-group" v-if="!config.overBalance && data.f_collection_type === '按金额'"
69
+ :class="[$v.f_refund_fee.required || $v.f_refund_fee.dctest ? 'has-error' : 'has-success']">
70
+ <label class="font_normal_body">退费金额</label>
71
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_refund_fee"
72
+ v-validate:f_refund_fee='{required: true, dctest: [data.f_balance_amount, "<=" ]}' placeholder="退费金额">
73
+ </div>
74
+ <div class="col-sm-4 form-group" v-if="config.overBalance && data.f_collection_type === '按金额'"
75
+ :class="[$v.f_refund_fee.required || $v.f_refund_fee.dctest ? 'has-error' : 'has-success']">
76
+ <label class="font_normal_body">退费金额</label>
77
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_refund_fee"
78
+ v-validate:f_refund_fee='{required: true, dctest: [0, ">=" ]}' placeholder="退费金额">
79
+ </div>
80
+ </div>
81
+ </form>
82
+ <div style="text-align:right;">
83
+ <button class="button_search btn-gn" v-show="applyButtonShow" @click="apply()" :disabled='!$v.valid'>申请审批退款</button>
84
+ <button class="button_search btn-gn" v-show="confirmButtonShow" @click="confirm()" :disabled='!$v.valid'>确认</button>
85
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
86
+ </div>
87
+ </validator>
88
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
89
+ <!--<print-bill :show="print" :bill-manager='config.hasBillManage' v-ref:printbill :bill-url='billUrl' v-on:toggle="clean" @printok="printok" :data='printModel'></print-bill>-->
90
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="clean" @printok="printok" :data='printModel' v-ref:printbill></print-bill>
91
+ <modal :show.sync="addModalShow" backdrop="false" width="40%" title="创建任务" small="true" @modal-close="addModalClose()">
92
+ <article slot="modal-body" class="row" style="padding: 10px">
93
+ <div class="form-group col-sm-10" :class="[ !addModel.f_task_name? 'has-error' : '']">
94
+ <label class="font_normal_body">任务名称</label>
95
+ <input type="text" class="input_search" style="width:80%"
96
+ v-model="addModel.f_task_name"
97
+ placeholder='请输入任务名称'>
98
+ </div>
99
+ <div class="form-group col-sm-10" :class="[ !addModel.f_work_flow_name? 'has-error' : '']">
100
+ <label class="font_normal_body">流程名称</label>
101
+ <v-select :options='workFlowDefineList' :search='true'
102
+ :value.sync="addModel.f_work_flow_name"
103
+ close-on-select value-single placeholder='请选择流程名称'
104
+ v-model='addModel.f_work_flow_name' style="width:100%"></v-select>
105
+ </div>
106
+ <div class="form-group col-sm-10" :class="[ !addModel.f_userinfo_code? 'has-error' : '']">
107
+ <label class="font_normal_body">用户编号</label>
108
+ <input type="text" class="input_search" style="width:80%"
109
+ v-model="addModel.f_userinfo_code"
110
+ placeholder='请输入用户编号'>
111
+ </div>
112
+ <div class="form-group col-sm-10" :class="[ !addModel.approval? 'has-error' : '']">
113
+ <label class="font_normal_body">审批人&emsp;</label>
114
+ <v-select :options='allUserList' :search='true'
115
+ :value.sync="addModel.approval"
116
+ close-on-select value-single
117
+ placeholder='请选择审批人'
118
+ v-model='addModel.approval' style="width:100%"></v-select>
119
+ </div>
120
+ <div class="form-group col-sm-10" :class="[ !addModel.memorandum? 'has-error' : '']">
121
+ <label class="font_normal_body">申请原由</label>
122
+ <textarea class="input_textarea" style="width: 93%;height: 40px"
123
+ v-model="addModel.memorandum"></textarea>
124
+ </div>
125
+ </article>
126
+ <footer slot="modal-footer" class="modal-footer" style="text-align: right;border: 0">
127
+ <button class="btn button_search" @click="addTask()"
128
+ :disabled="!(addModel.f_work_flow_name && addModel.f_task_name
129
+ && addModel.f_userinfo_code && addModel.approval && addModel.memorandum)">{{ '新增' }}
130
+ </button>
131
+ </footer>
132
+ </modal>
133
+ </div>
134
+
135
+ <upload :blodid="data.f_userinfo_id" isremark="true" fusetype="退费管理"></upload>
136
+
137
+ </template>
138
+
139
+
140
+ <script>
141
+ let readyGen = async function (self) {
142
+ await self.$getConfig(self, 'IOTRefund')
143
+ // 默认打印格式
144
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
145
+ self.model.f_payment = [self.config.payment]
146
+
147
+ self.model.f_use_type = self.config.billType
148
+ self.model.f_bill_type = self.model.f_print
149
+ self.hasValidateBill = self.config.hasBillManage
150
+ }
151
+
152
+ export default {
153
+ title: '物联网表退费',
154
+ data () {
155
+ return {
156
+ config: {
157
+ showupload: false, // 默认不上传附件
158
+ hasPrint: false, // 默认打票
159
+ hasBillManage: false, // 默认不启用发票管理
160
+ overBalance: false, //为true时退费金额可以大于余额
161
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
162
+ payment: '现金缴费',
163
+ billType: '燃气费'
164
+ },
165
+ model: {
166
+ f_refund_fee: '',
167
+ f_refund_gas: '',
168
+ f_comments: '',
169
+ f_payment: '',
170
+ f_print: '',
171
+ f_price: 0
172
+ },
173
+
174
+ blodid: '',
175
+ hasValidateBill: false,
176
+ validateOk: false,
177
+
178
+ printModel: {},
179
+ print: false,
180
+ billUrl: '',
181
+ billData: {
182
+ url: 'rs/report/refund_sell',
183
+ bill: ''
184
+ },
185
+
186
+ // 下拉框值
187
+ paytype: this.$appdata.getParam('付款方式'),
188
+ printstyle: this.$appdata.getParam('打印格式'),
189
+ addModalShow: false,
190
+ workFlowDefineList: [],
191
+ addModel: {
192
+ f_task_name: '',
193
+ f_userinfo_code: undefined,
194
+ f_work_flow_name: '',
195
+ approval: '',
196
+ memorandum: ''
197
+ },
198
+ allUserList: []
199
+ }
200
+ },
201
+ props: {
202
+ data: {
203
+ type: Object,
204
+ default: undefined
205
+ },
206
+ applyButtonShow: {
207
+ type: Boolean,
208
+ default: true
209
+ },
210
+ confirmButtonShow: {
211
+ type: Boolean,
212
+ default: false
213
+ },
214
+ cleanButtonShow: {
215
+ type: Boolean,
216
+ default: true
217
+ }
218
+ },
219
+ ready () {
220
+ readyGen(this)
221
+ if (this.data.f_collection_type === '按气量') {
222
+ // this.$showAlert('按气量缴费的物联网表退费功能尚未开放!!', 'warning', 3000)
223
+ this.model.f_price = this.data.f_price
224
+
225
+ // this.$dispatch('refresh')
226
+ }
227
+ this.getAllWorkFlowDefine()
228
+ this.getAllUsers()
229
+ },
230
+ methods: {
231
+ getAllUsers () {
232
+ let data = {
233
+ items: 'name',
234
+ condition: 'state = \'在职\' ',
235
+ tablename: '"t_user"',
236
+ orderitem: '"id"'
237
+ }
238
+ this.$resetpost('rs/sql/singleTable_OrderBy', {'data': data}
239
+ , {resolveMsg: null, rejectMsg: '获取所有员工失败!!', newly: true}).then(
240
+ (res) => {
241
+ console.log('所有员工' + JSON.stringify(res))
242
+ res.data.forEach(row => {
243
+ let obj = {'label': row.name, 'value': row.name}
244
+ this.allUserList.push(obj)
245
+ })
246
+ }
247
+ )
248
+ },
249
+ getAllWorkFlowDefine () {
250
+ let data = {
251
+ items: 'f_workflow_name',
252
+ condition: 'f_is_hidden = 0',
253
+ tablename: '"t_workflow_define"',
254
+ orderitem: '"id"'
255
+ }
256
+ this.$resetpost('rs/sql/future_singleTableOrderBy', {'data': data}
257
+ , {resolveMsg: null, rejectMsg: '获取流程项目失败!!'}).then(
258
+ (res) => {
259
+ console.log(1)
260
+ res.data.forEach(row => {
261
+ let obj = {'label': row.f_workflow_name, 'value': row.f_workflow_name}
262
+ this.workFlowDefineList.push(obj)
263
+ })
264
+ }
265
+ )
266
+ },
267
+ addModalClose () {
268
+ this.addModel.f_work_flow_name = ''
269
+ this.addModel.f_task_name = ''
270
+ this.addModel.f_userinfo_code = ''
271
+ this.addModel.approval = ''
272
+ this.addModel.memorandum = ''
273
+ },
274
+ addTask () {
275
+ if (this.addModel.f_userinfo_code != this.data.f_userinfo_code) {
276
+ this.$showAlert('请填写正确的用户编号!!!', 'warning', 3000)
277
+ return
278
+ }
279
+ let memorandum = {
280
+ memorandum: this.addModel.memorandum
281
+ }
282
+ let data = {
283
+ f_created_by: this.$login.f.name,
284
+ f_orgid: this.$login.f.orgid,
285
+ f_orgname: this.$login.f.orgs,
286
+ f_depid: this.$login.f.depids,
287
+ f_depname: this.$login.f.deps,
288
+ addModel: this.addModel,
289
+ memorandum: JSON.stringify(memorandum)
290
+ }
291
+ this.$resetpost('rs/logic/future_createWorkFlowTask', {'data': data}
292
+ , {resolveMsg: null, rejectMsg: '新增任务失败!!'}).then(
293
+ (res) => {
294
+ this.$showAlert(res.data.msg + '请等待审批完成后去流程页面进行操作!!!', 'info', 3000)
295
+ this.addModalClose()
296
+ this.addModalShow = false
297
+ }
298
+ )
299
+ },
300
+ async apply () {
301
+ await this.$copyText(this.data.f_userinfo_code)
302
+ this.$showAlert(`用户编号已复制到剪切板!`, 'success', 2000)
303
+ this.addModel.f_task_name = `用户:${this.data.f_user_name},编号:${this.data.f_userinfo_code} 申请退款`
304
+ this.addModalShow = true
305
+ },
306
+ async confirm () {
307
+ let param = {
308
+ f_user_id: this.data.f_user_id,
309
+ f_userfiles_id: this.data.f_userfiles_id,
310
+ version: this.data.version,
311
+ f_price: this.model.f_price,
312
+ f_refund_gas: this.model.f_refund_gas,
313
+ f_refund_fee: this.model.f_refund_fee,
314
+ f_comments: this.model.f_comments,
315
+ f_collection_type: this.data.f_collection_type,
316
+ f_payment: this.model.f_payment[0],
317
+ f_print: this.model.f_print[0],
318
+ f_price_id: this.data.f_price_id,
319
+ f_total_gas: parseFloat(this.data.f_total_gas) - parseFloat(this.model.f_refund_gas),
320
+ f_total_fee: parseFloat(this.data.f_total_fee) - parseFloat(this.model.f_refund_fee),
321
+ f_stairprice_id: this.data.f_stairprice_id,
322
+ operInfo: {
323
+ f_operator: this.$login.f.name,
324
+ f_operatorid: this.$login.f.id,
325
+ f_orgid: this.$login.f.orgid,
326
+ f_orgname: this.$login.f.orgs,
327
+ f_depid: this.$login.f.depids,
328
+ f_depname: this.$login.f.deps
329
+ }
330
+ }
331
+ console.log('退费传参', param)
332
+ let res = await this.$resetpost('rs/logic/iotRefund', {data: param}, {warnMsg: `确定要对用户${this.data.f_user_name}进行退费吗?`, resolveMsg: '退费成功!!', rejectMsg: '退费失败!!请重试!!'})
333
+ console.log('退费', res)
334
+ console.log('退费this.config', this.config)
335
+ console.log('退费this.model', this.model)
336
+ if (this.config.hasPrint) {
337
+ if (this.model.f_print.indexOf('电子发票') == -1) {
338
+ console.log('this.config.hasBillManage', this.config.hasBillManage)
339
+ if (this.config.hasBillManage) {
340
+ // 启用发票管理,获取票据管理中的票号并存储记录
341
+ this.printModel.id = res.data.id
342
+ this.printModel.f_bill_type = '退费'
343
+ this.printModel.f_bill_style = this.model.f_print[0]
344
+ // this.billUrl = 'rs/report/refund_sell'
345
+ this.print = true
346
+ } else {
347
+ this.printModel.id = res.data.id
348
+ // this.billUrl = 'rs/report/refund_sell'
349
+ this.print = true
350
+ }
351
+ } else if (this.config.printType === '国税发票') {
352
+ // TODO
353
+ this.$dispatch('success')
354
+ } else if (this.config.printType === '电子发票') {
355
+ // TODO
356
+ this.$dispatch('success')
357
+ }
358
+ }else{
359
+ this.$dispatch('success')
360
+ }
361
+ },
362
+ refundChange () {
363
+ this.model.f_refund_fee = (this.model.f_refund_gas - 0) * (this.model.f_price - 0)
364
+ },
365
+ clean () {
366
+ this.$dispatch('refresh')
367
+ },
368
+ printok () {
369
+ this.$dispatch('success')
370
+ },
371
+ validateBill (val) {
372
+ this.validateOk = !val.isOk
373
+ this.billData.bill = val.bill
374
+ }
375
+ },
376
+ watch:{
377
+ 'model.f_price'(){
378
+ this.model.f_refund_fee = (this.model.f_refund_gas - 0) * (this.model.f_price - 0)
379
+ },
380
+ 'model.f_refund_gas'(){
381
+ this.model.f_refund_fee = (this.model.f_refund_gas - 0) * (this.model.f_price - 0)
382
+ }
383
+ }
384
+ }
385
+ </script>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div class="auto">
3
+ <iot-refund v-if="row.f_meter_type === '物联网表'" :data="row" :apply-button-show="applyButtonShow"
4
+ :confirm-button-show="confirmButtonShow"></iot-refund>
5
+ <machine-Refund v-if="row.f_meter_type !== '物联网表'" :data="row" :apply-button-show="applyButtonShow"
6
+ :confirm-button-show="confirmButtonShow"></machine-Refund>
7
+ </div>
8
+
9
+ </template>
10
+ <script>
11
+ import IotRefund from './IOTRefund'
12
+ import machineRefund from './machineRefund'
13
+
14
+ export default {
15
+ title: '退费管理',
16
+ components: {
17
+ IotRefund,
18
+ machineRefund
19
+ },
20
+ data () {
21
+ return {
22
+
23
+ }
24
+ },
25
+ ready () {
26
+
27
+ },
28
+ props: {
29
+ row: {
30
+ type: Object,
31
+ default: undefined
32
+ },
33
+ applyButtonShow: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ confirmButtonShow: {
38
+ type: Boolean,
39
+ default: false
40
+ }
41
+ }
42
+ }
43
+ </script>