sale-client 3.6.510 → 3.6.512

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.510",
3
+ "version": "3.6.512",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -33,4 +33,6 @@ export default function () {
33
33
  Vue.component('iot-refund', (resolve) => { require(['./IOTRefund'], resolve) })
34
34
  // 收费页面的流水查询
35
35
  Vue.component('meter-charge-record-query', (resolve) => { require(['./ChargeRecordQuery'], resolve) })
36
+ // pos对账界面
37
+ Vue.component('wechat-validate-manage', (resolve) => { require(['./wechatValidateManage.vue'], resolve) })
36
38
  }
@@ -0,0 +1,351 @@
1
+ <template>
2
+ <div class="basic-main" style="height: 98%">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row">
7
+
8
+ <!-- <res-select-group :initres="$parent.$parent.initres" :show-component="['company']" @re-res="$parent.$parent.getRes" v-ref:sel></res-select-group>-->
9
+
10
+ <div class="col-sm-2 form-group">
11
+ <label for="startDate" class="font_normal_body">开始日期</label>
12
+ <datepicker id="startDate" placeholder="开始日期"
13
+ v-model="model.startDate" style="width: 60%"
14
+ :value.sync="model.startDate"
15
+ condition="f_delivery_date >= '{} 00:00:00'"
16
+ :disabled-days-of-Week="[]"
17
+ :format="'yyyy-MM-dd'"
18
+ :show-reset-button="reset">
19
+ </datepicker>
20
+ </div>
21
+ <div class="col-sm-2 form-group">
22
+ <label for="endDate" class="font_normal_body"> 结束日期</label>
23
+ <datepicker id="endDate" placeholder="结束日期"
24
+ v-model="model.endDate" style="width: 60%"
25
+ :value.sync="model.endDate"
26
+ condition="f_delivery_date <= '{} 23:59:59'"
27
+ :disabled-days-of-Week="[]"
28
+ :format="'yyyy-MM-dd'"
29
+ :show-reset-button="reset">
30
+ </datepicker>
31
+ </div>
32
+ <div class="col-sm-2 form-group" >
33
+ <label class="font_normal_body">客户编号</label>
34
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code" placeholder='客户编号'
35
+ condition="f_userinfo_code = '{}'">
36
+ </div>
37
+ <div class="col-sm-2 form-group">
38
+ <label class="font_normal_body" title="订单状态">订单状态</label>
39
+ <v-select
40
+ v-model="model.msg"
41
+ placeholder='订单状态'
42
+ condition="f_states like '%{}%'"
43
+ :value.sync="model.msg"
44
+ :options='$parent.$parent.letter'
45
+ close-on-select ></v-select>
46
+ </div>
47
+
48
+ <div class="span" style="float:right;">
49
+ <button class="button_search button_spacing width-60" @click="search()" v-el:cx>查询</button>
50
+ <div
51
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
52
+ @click="$parent.$parent.hidden()"
53
+ class="button_spacing"
54
+ style="float: right">
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <div class="row" v-show="$parent.$parent.criteriaShow">
59
+ <div class="col-sm-2 form-group">
60
+ <label class="font_normal_body" title="操作标识">操作标识</label>
61
+ <v-select
62
+ v-model="model.pay_state"
63
+ placeholder='操作标识'
64
+ condition="pay_state like '%{}%'"
65
+ :value.sync="model.pay_state"
66
+ :options='$parent.$parent.paystate'
67
+ close-on-select ></v-select>
68
+ </div>
69
+ <div class="form-group col-sm-2">
70
+ <label class="font_normal_body">终端编号</label>
71
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_terminal_num" placeholder='终端编号'
72
+ condition="f_terminal_num like '%{}%'">
73
+ </div>
74
+ <div class="form-group col-sm-2">
75
+ <label class="font_normal_body">客户名称</label>
76
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_user_name" placeholder='客户名称'
77
+ condition="f_user_name = '{}'">
78
+ </div>
79
+ <div class="form-group col-sm-2">
80
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;电话&nbsp;&nbsp;&nbsp;</label>
81
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_user_phone" placeholder='电话'
82
+ condition="f_user_phone like '{}%'">
83
+ </div>
84
+ <div class="form-group col-sm-2">
85
+ <label class="font_normal_body">客户地址</label>
86
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_address" placeholder='客户地址'
87
+ condition="f_address like '%{}%'">
88
+ </div>
89
+ <!--<div class="col-sm-2 form-group">-->
90
+ <!--<label class="font_normal_body">订单状态</label>-->
91
+ <!--<v-select-->
92
+ <!--v-model="model.msg"-->
93
+ <!--placeholder='订单状态'-->
94
+ <!--condition="f_states like '%{}%'"-->
95
+ <!--:value.sync="model.msg"-->
96
+ <!--:options='$parent.$parent.letter'-->
97
+ <!--close-on-select ></v-select>-->
98
+ <!--</div>-->
99
+ </div>
100
+ </div>
101
+ </criteria>
102
+ <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid>
103
+ <template partial='head'>
104
+ <tr>
105
+ <th>序号</th>
106
+ <th>客户编号</th>
107
+ <th>客户姓名</th>
108
+ <th>客户电话</th>
109
+ <th>客户地址</th>
110
+ <th>终端编号</th>
111
+ <th>订单号</th>
112
+ <th>订单金额</th>
113
+ <th>订单发生日期</th>
114
+ <th>订单状态</th>
115
+ <th>付款方式</th>
116
+ <th>购气量</th>
117
+ <th>购气金额</th>
118
+ <th>系统收费时间</th>
119
+ <th>系统收费状态</th>
120
+ <th>系统写卡状态</th>
121
+ <th>操作人</th>
122
+ <th>操作标识</th>
123
+ </tr>
124
+ </template>
125
+ <template partial='body'>
126
+ <td style="text-align: center;"><nobr>{{$index+1}}</nobr></td>
127
+ <td style="text-align: center;"><nobr>{{row.f_userinfo_code}}</nobr></td>
128
+ <td style="text-align: center;"><nobr>{{row.f_user_name}}</nobr></td>
129
+ <td style="text-align: center;"><nobr>{{row.f_user_phone}}</nobr></td>
130
+ <td style="text-align: center;"><nobr>{{row.f_address}}</nobr></td>
131
+ <td style="text-align: center;"><nobr>{{row.f_terminal_num}}</nobr></td>
132
+ <td style="text-align: center;"><nobr>{{row.f_transaction_id}}</nobr></td>
133
+ <td style="text-align: center;"><nobr>{{row.f_total_fee}}</nobr></td>
134
+ <td style="text-align: center;"><nobr>{{row.f_time_out}}</nobr></td>
135
+ <td style="text-align: center;"><nobr>{{row.f_states}}</nobr></td>
136
+ <td style="text-align: center;"><nobr>{{row.f_payment}}</nobr></td>
137
+ <td style="text-align: center;"><nobr>{{row.f_pregas}}</nobr></td>
138
+ <td style="text-align: center;"><nobr>{{row.f_collection}}</nobr></td>
139
+ <td style="text-align: center;"><nobr>{{row.f_delivery_date}}</nobr></td>
140
+ <td style="text-align: center;"><nobr>{{row.f_charge_state}}</nobr></td>
141
+ <td style="text-align: center;"><nobr>{{row.f_write_card}}</nobr></td>
142
+ <td style="text-align: center;"><nobr>{{row.f_operator}}</nobr></td>
143
+ <td v-if="row.pay_state==='对账成功'" style="text-align: center;">
144
+ <div v-if="!$parent.$parent.$parent.authArr.includes('无卡退费')">
145
+ <span>正常</span>
146
+ <button type="button" name="button" class="btn btn-link" @click="$parent.$parent.$parent.updateState(row)">退款</button>
147
+ </div>
148
+ <div v-else>
149
+ <button type="button" name="button" class="btn btn-link" @click="$parent.$parent.$parent.chargecal(row)">无卡退款</button>
150
+ </div>
151
+ </td>
152
+ <td v-if="row.pay_state==='无效'" style="text-align: center;">
153
+ 无效
154
+ </td>
155
+ <td v-if="row.pay_state==='燃气单方面账单'" style="text-align: center;">
156
+ <button type="button" name="button" class="btn btn-link" @click="$parent.$parent.$parent.chargecal(row)">冲正</button>
157
+ </td>
158
+ <td v-if="row.pay_state==='自助机单方面账单'" style="text-align: center;">
159
+ <button type="button" name="button" class="btn btn-link" @click="$parent.$parent.$parent.updateState(row)">退款</button>
160
+ <button type="button" name="button" class="btn btn-link" @click="$parent.$parent.$parent.charge(row)">缴费</button>
161
+ </td>
162
+ </template>
163
+ </data-grid>
164
+ </criteria-paged>
165
+ <table class="table-hover">
166
+ <tr style="position: relative" class="table-bordered">
167
+ <td
168
+ style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
169
+ 汇总信息
170
+ </td>
171
+ <td
172
+ style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
173
+ 订单金额汇总:&emsp;{{sumsmodel.f_total_fee}}
174
+ </td>
175
+ <td
176
+ style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
177
+ 购气金额汇总:&emsp;{{sumsmodel.f_collection}}
178
+ </td>
179
+ </tr>
180
+ </table>
181
+ </div>
182
+ <modal v-if="show" :show.sync="show" >
183
+ <header slot="modal-header" class="modal-header">
184
+ <h4 class="modal-title">退费</h4>
185
+ </header>
186
+ <article slot="modal-body" class="modal-body">
187
+ <validator name='v'>
188
+ <form class="form-horizontal select-overspread">
189
+ <div class="form-group">
190
+ <label class=" col-sm-3 control-label">退费原因:</label>
191
+ <div class="col-sm-8">
192
+ <textarea class="form-control" v-model="watchComment" placeholder="退费原因" ></textarea>
193
+ </div>
194
+ </div>
195
+ </form>
196
+ </validator>
197
+ </article>
198
+ <footer slot="modal-footer" class="modal-footer">
199
+ <button type="button" class="btn btn-success" @click='confirm()'>确认</button>
200
+ <button type="button" class="btn btn-default" @click='close'>取消</button>
201
+ </footer>
202
+ </modal>
203
+ </template>
204
+ <script>
205
+ import { PagedList } from 'vue-client'
206
+ import Vue from 'vue'
207
+
208
+ let readyGen = async function (self) {
209
+ // self.$refs.paged.$refs.cri.model.startDate = self.$login.toStandardDateString()
210
+ // self.$refs.paged.$refs.cri.model.endDate = self.$login.toStandardDateString()
211
+ self.sumsmodel = self.$refs.paged.$refs.grid.model.sums
212
+ }
213
+
214
+ export default {
215
+ title: '自助机对账',
216
+ data () {
217
+ return {
218
+ model: new PagedList('rs/sql/wechatSelling', 20, {}, {f_total_fee: '', f_collection: ''}),
219
+ letter: this.$appdata.getParam('订单状态') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('订单状态')] : [],
220
+ paystate: this.$appdata.getParam('操作标识') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('操作标识')] : [],
221
+ criteriaShow: false,
222
+ show: false,
223
+ watchComment: '',
224
+ orgCondtionStr: '',
225
+ getfield: {},
226
+ // 合计数据
227
+ sumsmodel: {},
228
+ initres: {
229
+ org: [this.$login.f.orgid]
230
+ },
231
+ msgData: []
232
+ }
233
+ },
234
+ props: [],
235
+ ready () {
236
+ readyGen(this)
237
+ },
238
+ methods: {
239
+ async chargecal (row) {
240
+ let param = {
241
+ f_sell_id: row.f_sell_id,
242
+ f_cancel_reason: '',
243
+ f_orgid: Vue.$login.f.orgid,
244
+ f_orgname: Vue.$login.f.orgs,
245
+ f_depid: Vue.$login.f.depids,
246
+ f_depname: Vue.$login.f.deps,
247
+ f_zoneid: Vue.$login.f.zoneid,
248
+ f_zones: Vue.$login.f.zones
249
+ }
250
+ await Vue.resetpost('rs/logic/commonCancel', {data: param}, {resolveMsg: '撤销成功', rejectMsg: '撤销失败'})
251
+ this.$refs.paged.$refs.cri.search()
252
+ },
253
+ async getRes(condition,obj) {
254
+ this.orgCondtionStr = condition
255
+ },
256
+ // 微信单方账单,系统可缴费
257
+ async charge (row) {
258
+ row.f_operator=Vue.$login.f.name,
259
+ row.f_operatorid= Vue.$login.f.id,
260
+ row.f_orgid= Vue.$login.f.orgid,
261
+ row.f_orgname= Vue.$login.f.orgs,
262
+ row.f_depid= Vue.$login.f.depids,
263
+ row. f_depname= Vue.$login.f.deps,
264
+ row. f_zoneid= Vue.$login.f.zoneid,
265
+ row. f_zones= Vue.$login.f.zones
266
+ let res = await this.$resetpost('rs/logic/cardOneBank',row,{resolveMsg:'缴费成功',rejectMsg:'缴费失败'})
267
+ let param = []
268
+ for (let row of this.resid) {
269
+ param.push({id: row.id})
270
+ }
271
+ let data = {
272
+ param: param,
273
+ f_blobid: res.data
274
+ }
275
+
276
+ await this.$resetpost('rs/logic/updatefiles', data)
277
+ this.$refs.paged.$refs.cri.search()
278
+ },
279
+ hidden () {
280
+ this.criteriaShow = !this.criteriaShow
281
+ },
282
+ updateState (val) {
283
+ this.show = true
284
+ this.msgData = val
285
+ },
286
+ async confirm () {
287
+ this.msgData.f_operator = this.$login.f.name
288
+ let updateWechatData = {
289
+ watchComment: this.watchComment,
290
+ msgData: this.msgData
291
+ }
292
+ await Vue.resetpost('rs/logic/updateWechatState', {data: updateWechatData}, {resolveMsg: '退款请求已发送成功,稍后到账!', rejectMsg: '退款失败'})
293
+ this.close()
294
+ this.search()
295
+ },
296
+ close () {
297
+ this.show = false
298
+ this.watchComment = ''
299
+ this.msgData = []
300
+ },
301
+ search () {
302
+ this.$refs.paged.$refs.cri.search()
303
+ },
304
+ // getotherfooter () {
305
+ // // this.$refs.paged.$refs.cri.$refs.exports.otherData=[];
306
+ // // this.$refs.paged.$refs.cri.$refs.exports.footerData=[];
307
+ // this.other = []
308
+ // this.footer = []
309
+ // // let exportdata = this.getCondition;
310
+ // let otherInData = []
311
+ // otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`)
312
+ // let footerData = [], exportfield = this.getfield
313
+ // footerData.push('合计')
314
+ // let self = this
315
+ // for (var field in self.sumsmodel) {
316
+ // footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`)
317
+ // }
318
+ // this.footer.push(footerData)
319
+ // this.other.push(otherInData)
320
+ // },
321
+ selfSearch (args) {
322
+ this.model.params.startDate = this.$refs.paged.$refs.cri.model.startDate
323
+ this.model.params.endDate = this.$refs.paged.$refs.cri.model.endDate
324
+ // if (!this.orgCondtionStr) {
325
+ // args.condition = `${args.condition}` + ' and f_orgid = ' + this.$login.f.orgid
326
+ // } else {
327
+ // args.condition = `${args.condition}` + this.orgCondtionStr
328
+ // }
329
+ args.condition = `${args.condition}` + `and f_orgid = '${this.$login.f.orgid}'`
330
+ this.model.search(args.condition, args.model)
331
+ }
332
+
333
+ },
334
+ events: {
335
+
336
+ },
337
+ computed: {
338
+ authArr () {
339
+ return this.$login.r ? this.$login.r : []
340
+ }
341
+ }
342
+ // watch: {
343
+ // sumsmodel: {
344
+ // handler: function (val) {
345
+ // this.getotherfooter()
346
+ // },
347
+ // deep: true
348
+ // }
349
+ // }
350
+ }
351
+ </script>
@@ -0,0 +1,428 @@
1
+ <template>
2
+ <div class="auto">
3
+ <validator name='v' style="overflow-y: auto">
4
+ <form class="form-horizontal">
5
+ <div class="row">
6
+ <div class="col-sm-6 form-group">
7
+ <label class="font_normal_body">上期保费截止日期</label>
8
+ <input type="text" v-model="model.f_ins_stop_date" disabled=disabled style="width: 60%"
9
+ class="input_search">
10
+ </div>
11
+ <div class="col-sm-6 form-group">
12
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;费用类型</label>
13
+ <input type="text" v-model="model.f_fee_type" placeholder="保险收费" disabled=disabled style="width: 60%"
14
+ class="input_search">
15
+ </div>
16
+ <div class="col-sm-6 form-group">
17
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;&emsp;投保人</label>
18
+ <input type="text" v-model="model.f_user_name" style="width: 60%"
19
+ class="input_search">
20
+ </div>
21
+ <div class="col-sm-6 form-group">
22
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;&emsp;身份证</label>
23
+ <input type="text" v-model="model.f_idnumber" style="width: 60%"
24
+ class="input_search">
25
+ </div>
26
+ <div class="col-sm-6 form-group">
27
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;电话</label>
28
+ <input type="text" v-model="model.f_user_phone" style="width: 60%"
29
+ class="input_search">
30
+ </div>
31
+ <div class="col-sm-6 form-group">
32
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;购买日期</label>
33
+ <datepicker id="f_buy_date" placeholder="本次保费开始日期" style="width:60%"
34
+ v-model="model.f_buy_date"
35
+ :value.sync="model.f_buy_date"
36
+ :format="'yyyy-MM-dd HH:mm:ss'"
37
+ :show-reset-button="true">
38
+ </datepicker>
39
+ </div>
40
+ <div class="col-sm-6 form-group" :class="[$v.f_ins_start_date.required ? 'has-error' : '']"
41
+ v-if="model.f_state === '待执行'">
42
+ <label class="font_normal_body">本次保费开始日期</label>
43
+ <input type="text" v-show="false" v-model="model.f_ins_start_date">
44
+ <datepicker id="f_ins_start_date" placeholder="本次保费开始日期" style="width:60%"
45
+ v-model="model.f_ins_start_date"
46
+ :value.sync="model.f_ins_start_date"
47
+ :format="'yyyy-MM-dd'"
48
+ :show-reset-button="true">
49
+ </datepicker>
50
+ </div>
51
+ <div class="col-sm-6 form-group" :class="[$v.f_ins_start_date.required ? 'has-error' : '']"
52
+ v-else="model.f_state !== '待执行'">
53
+ <label class="font_normal_body">本次保费开始日期</label>
54
+ <input type="text" v-show="false" v-model="model.f_ins_start_date"
55
+ v-validate:f_ins_start_date='{required: true }'>
56
+ <datepicker id="f_ins_start_date" placeholder="本次保费开始日期" style="width:60%"
57
+ v-model="model.f_ins_start_date"
58
+ :value.sync="model.f_ins_start_date"
59
+ :format="'yyyy-MM-dd'"
60
+ :show-reset-button="true">
61
+ </datepicker>
62
+ </div>
63
+ <div class="col-sm-6 form-group" v-if="model.f_state ==='待执行'"
64
+ :class="[$v.f_salecount.required? 'has-error' : '']">
65
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;购买年限</label>
66
+ <input type="number" v-model="model.f_salecount" placeholder="购买年限" style="width: 60%"
67
+ class="input_search" v-validate:f_salecount='{required: true }' v-el:style v-next-el="inpipe">
68
+ </div>
69
+ <div class="col-sm-6 form-group" v-if="model.f_state !=='待执行'">
70
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;购买年限</label>
71
+ <input type="number" v-model="model.f_salecount" placeholder="购买年限" style="width: 60%"
72
+ class="input_search" v v-el:style v-next-el="inpipe">
73
+ </div>
74
+ <div class="col-sm-6 form-group" :class="[$v.f_expiration_date2.required ? 'has-error' : '']"
75
+ v-if="model.f_state === '待执行'">
76
+ <input type="text" v-show="false" v-model="tmp" :value.sync='model.f_expiration_date'
77
+ v-el:f_expiration_date2>
78
+ <label class="font_normal_body">&emsp;&emsp;保费结束日期</label>
79
+ <datepicker id="f_expiration_date" placeholder="保费结束日期" style="width:60%"
80
+ @con-bulr="isShowSaleCount"
81
+ v-ref:f_expiration_date
82
+ v-model="model.f_expiration_date"
83
+ :value.sync="model.f_expiration_date"
84
+ :format="'yyyy-MM-dd HH:mm:ss'"
85
+ :show-reset-button="true">
86
+ </datepicker>
87
+ </div>
88
+ <div class="col-sm-6 form-group" :class="[$v.f_expiration_date2.required ? 'has-error' : '']"
89
+ v-else="model.f_state !== '待执行'">
90
+ <input type="text" v-show="false" v-model="tmp" :value.sync='model.f_expiration_date'
91
+ v-validate:f_expiration_date2='{required: true }' v-el:f_expiration_date2>
92
+ <label class="font_normal_body">&emsp;&emsp;保费结束日期</label>
93
+ <datepicker id="f_expiration_date" placeholder="保费结束日期" style="width:60%"
94
+ @con-bulr="isShowSaleCount"
95
+ v-ref:f_expiration_date
96
+ v-model="model.f_expiration_date"
97
+ :value.sync="model.f_expiration_date"
98
+ :format="'yyyy-MM-dd HH:mm:ss'"
99
+ :show-reset-button="true">
100
+ </datepicker>
101
+ </div>
102
+ <div class="col-sm-6 form-group" :class="[$v.f_insurance_type.required ? 'has-error' : '']">
103
+ <label class="font_normal_body" title="参数:险种">&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;险种</label>
104
+ <input type="text" v-show="false" v-model="$refs.f_insurance_type.selectedItems"
105
+ v-validate:f_insurance_type='{required: true }'>
106
+ <v-select
107
+ placeholder='险种'
108
+ :value.sync="model.f_insurance_type"
109
+ style="width:60%"
110
+ :value-single="true"
111
+ v-model="model.f_insurance_type"
112
+ :options='insurancetype'
113
+ @change="getmoney()"
114
+ close-on-select
115
+ v-ref:f_insurance_type>
116
+ </v-select>
117
+ </div>
118
+ <div class="col-sm-6 form-group" :class="[$v.f_state.required ? 'has-error' : '']">
119
+ <label class="font_normal_body" title="参数:保险状态">&emsp;&emsp;&emsp;&emsp;保险状态</label>
120
+ <input type="text" v-show="false" v-model="$refs.f_state.selectedItems"
121
+ v-validate:f_state='{required: true }'>
122
+ <v-select
123
+ placeholder='保险状态'
124
+ :value.sync="model.f_state"
125
+ style="width:60%"
126
+ :value-single="true"
127
+ v-model="model.f_state"
128
+ :options='insurancestate'
129
+ close-on-select
130
+ v-ref:f_state>
131
+ </v-select>
132
+ </div>
133
+ <div class="col-sm-6 form-group" :class="[$v.f_money.required ? 'has-error' : '']">
134
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;保费金额</label>
135
+ <input type="number" v-model="model.f_money" class="input_search" style="width:60%"
136
+ v-validate:f_money='{required: true, dctest: [0, ">=" ] }' placeholder="保费金额">
137
+ </div>
138
+ <div class="col-sm-6 form-group" :class="[$v.payment.required ? 'has-error select-error' : '']">
139
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;收款方式</label>
140
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems"
141
+ v-validate:payment='{required: true }'>
142
+ <v-select v-model="model.f_payment"
143
+ style="width:60%"
144
+ placeholder='请选择'
145
+ :value.sync="model.f_payment"
146
+ :options='paytype'
147
+ v-ref:payment value-single
148
+ close-on-select clear-button>
149
+ </v-select>
150
+ </div>
151
+ <div class="col-sm-6 form-group">
152
+ <label class="font_normal_body">&emsp;&emsp;&emsp;确认书编号</label>
153
+ <input type="text" v-model="model.f_ok_number" style="width: 60%"
154
+ class="input_search">
155
+ </div>
156
+ <div class="col-sm-6 form-group">
157
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;保险单号</label>
158
+ <input type="text" v-model="model.f_ins_number" style="width: 60%"
159
+ class="input_search">
160
+ </div>
161
+ <div class="col-sm-6 form-group" v-show="false">
162
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;公司 </label>
163
+ <right-tree @re-res="getRes"></right-tree>
164
+ </div>
165
+ <div class="col-sm-6 form-group">
166
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;部门</label>
167
+ <res-select restype='department'
168
+ :is-mul="mul"
169
+ @res-select="getdep"
170
+ :parentresid="depresid"
171
+ :initresid='depid'>
172
+ </res-select>
173
+ </div>
174
+ <div class="col-sm-6 form-group">
175
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;人员</label>
176
+ <res-select restype='user'
177
+ @res-select="getuser"
178
+ :is-mul="mul"
179
+ :parentresid="userresid"
180
+ :initresid='operatorid'>
181
+ </res-select>
182
+ </div>
183
+ <div class="col-sm-12 form-group">
184
+ <label class="font_normal_body">&emsp;&emsp;&emsp;&emsp;备注信息</label>
185
+ <input type="textarea" v-model="model.f_comments" style="width: 80%;height: 50px" class="input_search">
186
+ </div>
187
+ </div>
188
+ </form>
189
+ <div style="float: right;padding-top:20px">
190
+ <button class="button_search" @click="save" :disabled="!$v.valid">保存</button>
191
+ <button class="button_clear" @click="cancel">取消</button>
192
+ </div>
193
+ </validator>
194
+ </div>
195
+ </template>
196
+ <script>
197
+ import { HttpResetClass } from 'vue-client'
198
+ import * as Util from '../../Util'
199
+
200
+ export default {
201
+ title: '新增保险',
202
+ data () {
203
+ return {
204
+ config: {
205
+ payment: '现金缴费',
206
+ insuranceType: '燃气险',
207
+ insurancestate: '有效'
208
+ },
209
+ model: {
210
+ f_ins_start_date: ''
211
+ },
212
+ paytype: [],
213
+ insurancetype: this.$appdata.getParam('险种'),
214
+ insurancestate: this.$appdata.getParam('保险状态'),
215
+ f_salecount: {
216
+ dctest: true
217
+ },
218
+ mul: false,
219
+ tmp: '',
220
+ depresid: [this.$login.f.depids],
221
+ userresid: [this.$login.f.id],
222
+ f_orgid: this.$login.f.orgid,
223
+ f_depid: this.$login.f.depids,
224
+ f_operatorid: this.$login.f.id,
225
+ operatorid: [this.$login.f.id],
226
+ depid: [this.$login.f.depids],
227
+ orgname: '',
228
+ depname: '',
229
+ operatorname: ''
230
+ }
231
+ },
232
+ props: {
233
+ model: {
234
+ type: Object,
235
+ default: {
236
+ f_insurance_type: '',
237
+ f_state: ''
238
+ }
239
+
240
+ },
241
+ row: Object
242
+ },
243
+ ready () {
244
+ console.log('=====================================================================================', this.model)
245
+ this.paytype = this.$appdata.getParam('付款方式') ? this.$appdata.getParam('付款方式') : []
246
+ if (!this.$login.r.includes('免交充值付款')) {
247
+ this.paytype = this.paytype.filter((item) => {
248
+ return item.label != '免交'
249
+ })
250
+ }
251
+ console.log('----------------row', this.row)
252
+ if (this.row) {
253
+ if (JSON.stringify(this.row) != '{}') {
254
+ this.model = {
255
+ f_userinfo_id: this.row.f_userinfo_id,
256
+ f_ins_stop_date: this.row.f_ins_stop_date,
257
+ f_user_name: this.row.f_user_name,
258
+ f_idnumber: this.row.f_idnumber,
259
+ f_user_phone: this.row.f_user_phone,
260
+ f_salecount: this.row.f_saleCount,
261
+ f_userinfo_code: this.row.f_userinfo_code,
262
+ f_last_insexpiration_date: this.row.f_ins_stop_date
263
+ }
264
+ }
265
+ }
266
+ // this.model.f_buy_date = this.$login.toStandardTimeString()
267
+ this.$set('model.f_ins_start_date', Util.toStandardDateString())
268
+ // this.model.f_ins_start_date = Util.toStandardDateString()
269
+ // this.model.f_salecount = 1
270
+ // this.model.f_money = 0
271
+ this.configMerge()
272
+ },
273
+ watch: {
274
+ 'model.f_ins_start_date' (val) {
275
+ if (val && this.model.f_salecount) {
276
+ let tx = new Date(val)
277
+ let tmp = {
278
+ year: tx.getFullYear(),
279
+ month: tx.getMonth() + 1,
280
+ day: tx.getDate()
281
+ }
282
+ let tmpdate = new Date((tmp.year + (this.model.f_salecount - 0)) + '-' + (tmp.month < 10 ? '0' + tmp.month : tmp.month) + '-' + (tmp.day < 10 ? '0' + tmp.day : tmp.day))
283
+ let date
284
+ if (tmp.month < (tmpdate.getMonth() + 1)) {
285
+ date = new Date(tmpdate.getTime() - 24 * 60 * 60 * 1000 * 2)
286
+ } else {
287
+ date = new Date(tmpdate.getTime() - 24 * 60 * 60 * 1000)
288
+ }
289
+ let jt = {
290
+ year: date.getFullYear(),
291
+ month: date.getMonth() + 1,
292
+ day: date.getDate()
293
+ }
294
+ this.$refs.f_expiration_date.value = jt.year + '-' + (jt.month < 10 ? '0' + jt.month : jt.month) + '-' + (jt.day < 10 ? '0' + jt.day : jt.day)
295
+ }
296
+ },
297
+ 'model.f_money' (val) {
298
+ if (val && (val < 0 || Math.floor(val - 0) !== (val - 0))) {
299
+ this.model.f_money = 0
300
+ }
301
+ },
302
+ 'model.f_salecount' (val) {
303
+ if (val && (val < 0 || Math.floor(val - 0) !== (val - 0))) {
304
+ this.model.f_salecount = 0
305
+ this.f_salecount.dctest = false
306
+ } else if (val && this.model.f_ins_start_date) {
307
+ let tx = new Date(this.model.f_ins_start_date)
308
+ let tmp = {
309
+ year: tx.getFullYear(),
310
+ month: tx.getMonth() + 1,
311
+ day: tx.getDate()
312
+ }
313
+ let tmpdate = new Date((tmp.year + (val - 0)) + '-' + (tmp.month < 10 ? '0' + tmp.month : tmp.month) + '-' + (tmp.day < 10 ? '0' + tmp.day : tmp.day))
314
+ let date
315
+ if (tmp.month < (tmpdate.getMonth() + 1)) {
316
+ date = new Date(tmpdate.getTime() - 24 * 60 * 60 * 1000 * 2)
317
+ } else {
318
+ date = new Date(tmpdate.getTime() - 24 * 60 * 60 * 1000)
319
+ }
320
+ let jt = {
321
+ year: date.getFullYear(),
322
+ month: date.getMonth() + 1,
323
+ day: date.getDate()
324
+ }
325
+ this.$refs.f_expiration_date.value = jt.year + '-' + (jt.month < 10 ? '0' + jt.month : jt.month) + '-' + (jt.day < 10 ? '0' + jt.day : jt.day)
326
+ this.f_salecount.dctest = true
327
+ } else {
328
+ this.f_salecount.dctest = true
329
+ }
330
+ },
331
+ 'model.f_userinfo_id' (val) {
332
+ if (val && this.model.f_userinfo_id) {
333
+ // this.model.f_insurance_type = this.model.f_insurance_type == null ? this.config.insuranceType : this.model.f_insurance_type
334
+ this.model.f_state = this.model.f_state == null ? this.config.insurancestate : this.model.f_state
335
+ this.model.f_ins_start_date = Util.toStandardDateString()
336
+ console.log('cs===================cs', this.model.f_userinfo_id, this.model.f_ins_start_date)
337
+ }
338
+ }
339
+ },
340
+ methods: {
341
+ async configMerge () {
342
+ try {
343
+ let http = new HttpResetClass()
344
+ let result = await http.load('GET', `rs/vue/InsuranceAdd.json`, {}, {resolveMsg: null, rejectMsg: null})
345
+ Object.assign(this.config, result.data)
346
+ } catch (error) {
347
+ // 忽略704,文件找不到异常
348
+ if (error.status !== 704) {
349
+ throw error
350
+ }
351
+ }
352
+ this.model.f_insurance_type = this.config.insuranceType
353
+ this.model.f_payment = this.config.payment
354
+ this.model.f_state = this.config.insurancestate
355
+ },
356
+ getRes (obj) {
357
+ this.orgname = obj.res[0]
358
+ this.depresid = obj.resids
359
+ this.f_orgid = obj.resids
360
+ this.userresid = obj.resids
361
+ },
362
+ getdep (obj, val) {
363
+ this.depname = val
364
+ // this.userresid = obj
365
+ this.f_depid = obj
366
+ },
367
+ getuser (obj, val) {
368
+ this.operatorname = val
369
+ this.f_operatorid = obj
370
+ },
371
+ valids (val1, val2) {
372
+ console.log(val1, val2)
373
+
374
+ if (!(val1.valid && val2)) {
375
+ return true
376
+ } else {
377
+ return false
378
+ }
379
+ },
380
+ isShowSaleCount (oldVal) {
381
+ console.log(oldVal)
382
+ if (this.model.f_expiration_date) {
383
+ this.model.f_salecount = ''
384
+ }
385
+ },
386
+ getmoney () {
387
+ let val = this.$appdata.getSingleValue(this.model.f_insurance_type)
388
+ this.money = val || 0
389
+ },
390
+ cancel () {
391
+ this.$info('取消操作')
392
+ this.$dispatch('refresh', this.row)
393
+ this.model = {}
394
+ this.$dispatch('close')
395
+ },
396
+ async save () {
397
+ let saveState = true
398
+ if (this.model.f_state !== '待执行') {
399
+ if (Date.parse(this.model.f_ins_start_date) > Date.parse(this.model.f_expiration_date)) {
400
+ this.$showAlert('结束日期不能早于开始日期', 'warning', 2000)
401
+ saveState = false
402
+ } else if (this.model.f_ins_start_date !== null && this.model.f_ins_start_date !== '' && Date.parse(this.model.f_ins_stop_date) > Date.parse(this.model.f_ins_start_date)) {
403
+ this.$showAlert('开始日期不能早于上期保费截止日期', 'warning', 2000)
404
+ saveState = false
405
+ }
406
+ }
407
+ if (saveState) {
408
+ this.model.f_total_ins_charge = this.model.f_total_ins_charge == null ? 0 : this.model.f_total_ins_charge
409
+ this.model.f_operat_type = '保险'
410
+ this.model.f_operator = this.operatorname[0]
411
+ this.model.f_operatorid = this.f_operatorid[0]
412
+ this.model.f_orgid = this.$login.f.orgid
413
+ this.model.f_orgname = this.$login.f.orgs
414
+ this.model.f_depid = this.f_depid[0]
415
+ this.model.f_depname = this.depname[0]
416
+ this.model.f_fee_type = '保险收费'
417
+ this.model.f_last_insexpiration_date = this.model.f_ins_stop_date
418
+ await
419
+ this.$resetpost('rs/logic/saveInsInfo', {data: this.model}).then((res) => {
420
+ this.$showAlert('新增保险成功', 'success', 2000)
421
+ })
422
+ this.$dispatch('close')
423
+ this.$dispatch('success')
424
+ }
425
+ }
426
+ }
427
+ }
428
+ </script>
@@ -27,4 +27,6 @@ export default function () {
27
27
  Vue.component('machine-charge', (resolve) => { require(['./MachineCharge'], resolve) })
28
28
  // 欠费查询
29
29
  Vue.component('sale-arrears-query', (resolve) => { require(['./ArrearsQuery'], resolve) })
30
+ // 保险收费填写
31
+ Vue.component('insurance-add', (resolve) => { require(['./InsuranceAdd'], resolve) })
30
32
  }
@@ -684,7 +684,7 @@
684
684
  return {
685
685
  initres: {
686
686
  org: [this.$login.f.orgid],
687
- dep: [],
687
+ dep: this.$login.f.depids ? this.$login.f.depids.split(',').filter(id => id.trim() !== '') : [],
688
688
  user: []
689
689
  },
690
690
  orgCondtionStr: '',
@@ -813,7 +813,14 @@
813
813
  })
814
814
  },
815
815
  getRes (obj) {
816
- this.orgCondtionStr = obj
816
+ if (typeof obj === 'string' && obj) {
817
+ if (obj.includes('f_depid in') && !obj.includes('f_depid in (')) {
818
+ obj = obj.replace(/and\s+f_depid\s+in\s*(?!\()/g, '')
819
+ }
820
+ this.orgCondtionStr = obj
821
+ } else {
822
+ this.orgCondtionStr = ''
823
+ }
817
824
  },
818
825
  async getaddress () {
819
826
  console.log('开始获取小区')
@@ -1001,7 +1008,9 @@
1001
1008
  selfSearch (args) {
1002
1009
  this.meter_state = args.condition.includes('未下发')
1003
1010
  this.inputtor_change = args.condition.includes('未抄表')
1004
-
1011
+ if (args.condition.includes('f_depid in') && !args.condition.includes('f_depid in (')) {
1012
+ args.condition = args.condition.replace(/and\s+f_depid\s+in\s*(?!\()/g, '')
1013
+ }
1005
1014
  if (!this.orgCondtionStr) {
1006
1015
  args.condition = `${args.condition}` + ' and f_orgid = ' + this.$login.f.orgid
1007
1016
  } else {
@@ -1047,6 +1056,9 @@
1047
1056
  this.$refs.paged.$refs.criteria.model.f_orgid = `${Vue.$login.f.orgid}`
1048
1057
  this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStartAndEndDateString()[0]
1049
1058
  this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStartAndEndDateString()[1]
1059
+ if (this.$refs.paged.$refs.criteria.$refs.sel) {
1060
+ this.$refs.paged.$refs.criteria.$refs.sel.depids = this.$login.f.depids ? this.$login.f.depids.split(',').filter(id => id.trim() !== '') : [];
1061
+ }
1050
1062
  this.search()
1051
1063
  },
1052
1064
  beforenter (index, row) {
@@ -1353,8 +1365,6 @@
1353
1365
  this.initModal()
1354
1366
  this.search()
1355
1367
  this.$showAlert(`全部下发,总计下发${res.data}户`, 'success', 2000)
1356
- }).catch((error) => {
1357
- this.$showAlert(`下发失败,请注意查看,失败原因:${error}`, 'danger', 0)
1358
1368
  })
1359
1369
  },
1360
1370
  async examineconfirm () {
@@ -39,7 +39,8 @@
39
39
  <datepicker placeholder="安装日期" style="width: 60%"
40
40
  v-model="row.f_input_date"
41
41
  :value.sync="row.f_input_date"
42
- :format="'yyyy-MM-dd HH:mm:ss'">
42
+ :format="'yyyy-MM-dd HH:mm:ss'"
43
+ @change="updateExpireDate(row)">
43
44
  </datepicker>
44
45
  </div>
45
46
  </div>
@@ -161,8 +162,56 @@
161
162
  },
162
163
  addDevice () {
163
164
  console.log('设备信息', this.devicesinfo)
164
- this.devicesinfo.push({f_devices_type: '家用灶具',
165
- f_input_date: this.$login.toStandardTimeString()})
165
+ const inputDate = this.$login.toStandardTimeString()
166
+ this.devicesinfo.push({
167
+ f_devices_type: '家用灶具',
168
+ f_input_date: inputDate,
169
+ f_expire_date: ''
170
+ })
171
+ },
172
+ updateExpireDate (device) {
173
+ if (device.f_input_date) {
174
+ if (device.f_devices_type === '自闭阀') {
175
+ const inputDate = new Date(device.f_input_date)
176
+ const expireDate = new Date(inputDate)
177
+ expireDate.setFullYear(expireDate.getFullYear() + 10)
178
+ const now = new Date()
179
+ expireDate.setHours(now.getHours())
180
+ expireDate.setMinutes(now.getMinutes())
181
+ expireDate.setSeconds(now.getSeconds())
182
+ const formatDate = (date) => {
183
+ const year = date.getFullYear()
184
+ const month = String(date.getMonth() + 1).padStart(2, '0')
185
+ const day = String(date.getDate()).padStart(2, '0')
186
+ const hours = String(date.getHours()).padStart(2, '0')
187
+ const minutes = String(date.getMinutes()).padStart(2, '0')
188
+ const seconds = String(date.getSeconds()).padStart(2, '0')
189
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
190
+ }
191
+ device.f_expire_date = formatDate(expireDate)
192
+ }
193
+ }
194
+ }
195
+ },
196
+ watch: {
197
+ 'devicesinfo': {
198
+ deep: true,
199
+ handler (newVal) {
200
+ newVal.forEach(device => {
201
+ this.$watch(() => device.f_input_date, (newDate) => {
202
+ if (newDate) {
203
+ this.updateExpireDate(device)
204
+ }
205
+ })
206
+ this.$watch(() => device.f_devices_type, (newType) => {
207
+ if (newType === '自闭阀' && device.f_input_date) {
208
+ this.updateExpireDate(device)
209
+ } else {
210
+ device.f_expire_date = ''
211
+ }
212
+ })
213
+ })
214
+ }
166
215
  }
167
216
  }
168
217
  }