manage-client 4.0.13 → 4.0.15

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.
@@ -0,0 +1,292 @@
1
+ <template>
2
+ <div class="basic-main" style="height: 100%">
3
+ <criteria-paged :model="model" :pager='false' v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
+ <p class="bg-info text-center" style="padding: 8px;">营业厅收款结账单</p>
6
+ <div class="form-group" v-if="!$parent.$parent.data.f_files_path"></div>
7
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial >
8
+ <div class="row">
9
+ <div class="col-sm-3" >
10
+ <label class="font_normal_body" for="startDate">开始日期:</label>
11
+ <datepicker id="startDate" placeholder="开始日期" style="width: 60%"
12
+ v-model="model.startDate"
13
+ :value.sync="model.startDate"
14
+ :disabled-days-of-Week="[]"
15
+ :format="'yyyy-MM-dd HH:mm:ss'"
16
+ :show-reset-button="reset">
17
+ </datepicker>
18
+ </div>
19
+ <div class="col-sm-3" >
20
+ <label class="font_normal_body" for="endDate">结束日期:</label>
21
+ <datepicker id="endDate" placeholder="结束日期" style="width: 60%"
22
+ v-model="model.endDate"
23
+ :value.sync="model.endDate"
24
+ :disabled-days-of-Week="[]"
25
+ :format="'yyyy-MM-dd HH:mm:ss'"
26
+ :show-reset-button="reset">
27
+ </datepicker>
28
+ </div>
29
+ <res-select-group :show-component="['company']" :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes" v-ref:sel></res-select-group>
30
+ <div class="col-sm-3 form-group">
31
+ <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
32
+ <v-select id="dep" style="width: 60%"
33
+ :multiple="true"
34
+ @change="$parent.$parent.getDep"
35
+ :value.sync="model.f_depid"
36
+ v-model="model.f_depid"
37
+ :options='$parent.$parent.depresid' placeholder='请选择'
38
+ condition="f_depid in {}">
39
+ </v-select>
40
+
41
+ </div>
42
+ <div class="col-sm-3 form-group">
43
+ <label class="font_normal_body" for="oper">人&emsp;&emsp;员:</label>
44
+ <v-select id="oper" style="width: 60%"
45
+ :multiple="true"
46
+ @change="$parent.$parent.getOpe"
47
+ :value.sync="model.f_operatorid"
48
+ v-model="model.f_operatorid"
49
+ :options='$parent.$parent.userresid' placeholder='请选择'
50
+ condition="f_operatorid in {}">
51
+ </v-select>
52
+ </div>
53
+ <div class="col-sm-3 form-group">
54
+ <label class="font_normal_body" title="参数:付款方式查询">付款方式</label>
55
+ <v-select :value.sync="model.f_payment" multiple
56
+ v-model="model.f_payment"
57
+ :options='$parent.$parent.payment' placeholder='请选择'
58
+ condition="f_payment in {}"
59
+ close-on-select></v-select>
60
+ </div>
61
+ </div>
62
+ <div class="span" style = "float:right;">
63
+ <button class="button_search" @click="$parent.$parent.searchData()">查询</button>
64
+ <report-print id='gasprice' top='3cm' left='0' width='100%' height='100%' :preview="true"></report-print>
65
+ <report-excel id='gasprice'></report-excel>
66
+ </div>
67
+ </div>
68
+ </criteria>
69
+ <div partial='list' v-el:handcollect id='gasprice' style="overflow-y: scroll">
70
+ <table class='tableprint' style="margin: 0px auto">
71
+ <thead>
72
+ <tr>
73
+ <th :colspan='$parent.tablen' style="font-weight: normal; text-align: left;">
74
+ <h3 style="text-align: center">营业厅收款结账单</h3>
75
+ </th>
76
+ </tr>
77
+ <tr>
78
+ <th :colspan='$parent.tablen' style="font-weight: normal; text-align: center;">
79
+ 时间区间:{{$refs.criteria.model.startDate}} - {{ $refs.criteria.model.endDate }}<br/>
80
+ 打印时间:{{$parent.printTime}}
81
+ </th>
82
+ </tr>
83
+ <tr>
84
+ <th :colspan='$parent.tablen' style="font-weight: normal; text-align: center;">
85
+ <div>
86
+ <span v-show="$parent.orgname[0]">公司:{{$parent.orgname}}</span>
87
+ <span v-show="$parent.depname[0]"> 部门:{{$parent.depname}}</span>
88
+ <span v-show="$parent.operatorname[0]">人员:{{$parent.operatorname}}</span>
89
+ </div>
90
+ </th>
91
+ </tr>
92
+ </thead>
93
+ <tr>
94
+ <td :colspan='$parent.tablen' class="noborder">
95
+ {{{ model.data.substring(26,model.data.length-8) }}}
96
+ </td>
97
+ </tr>
98
+ <tfoot>
99
+ <tr style="text-align: left">
100
+ <th :colspan='Math.floor($parent.tablen/3)'>财务审核:</th>
101
+ <th :colspan='Math.round($parent.tablen/3)'>收款审核:</th>
102
+ <th :colspan='Math.round($parent.tablen/3)'>收款员:</th>
103
+ </tr>
104
+ </tfoot>
105
+ </table>
106
+ {{{ $parent.reportStr}}}
107
+ </div>
108
+ </criteria-paged>
109
+ <modal :show.sync="show" v-ref:modal small backdrop="false">
110
+ <header slot="modal-header" class="modal-header">
111
+ <h4 class="modal-title">输入文件名称</h4>
112
+ </header>
113
+ <article slot="modal-body" class="modal-body">
114
+ <div class="form-group">
115
+ <input type="text" class="form-control" v-model="filename" placeholder='保存的文件名'>
116
+ </div>
117
+ </article>
118
+ <footer slot="modal-footer" class="modal-footer">
119
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
120
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button>
121
+ </footer>
122
+ </modal>
123
+ </div>
124
+ </template>
125
+
126
+ <script>
127
+ import {DataModel, HttpResetClass} from 'vue-client'
128
+ import co from 'co'
129
+ let saveFile = function * (self) {
130
+ // 线验证文件是否重名
131
+ let count = yield self.$resetpost('api/af-revenue/sql/manageSingleTable',
132
+ {data: {tablename: 't_report_record', condition: `f_files_name = '${self.filename}'`}},
133
+ {resolveMsg: null, rejectMsg: null})
134
+ if (count.data.length > 0) {
135
+ self.$showAlert('无法保存,文件名重名', 'warning', 3000)
136
+ return
137
+ }
138
+ let saveBack = yield self.$resetpost('api/af-revenue/logic/saveReport', {f_files_content: self.$refs.paged.$els.handcollect.innerHTML,
139
+ f_files_name: self.filename, f_files_type: self.data.f_report_type, f_component_name: 'manage-bus-summary',
140
+ f_operator: this.$login.f.name, f_query_month: `${self.model.model.startDate}-${self.model.model.endDate}`,
141
+ f_outlets: this.$login.f.depname})
142
+ if (saveBack.data.status === 'succeed') {
143
+ self.show = false
144
+ self.filename = ''
145
+ // 后台保存完成,通知刷新
146
+ self.$dispatch('save-success', self.filename)
147
+ }
148
+ }
149
+ let getorg = async function (self) {
150
+ new HttpResetClass().load("POST",'api/af-revenue/sql/singleTableParam',
151
+ {
152
+ data: {
153
+ items: 'name label,id value',
154
+ tablename: 't_department',
155
+ condition: `1=1`
156
+ }
157
+ },
158
+ {resolveMsg: null, rejectMsg: null})
159
+ .then((res) => {
160
+ self.depresid = res.data
161
+ })
162
+ new HttpResetClass().load("POST",'api/af-revenue/sql/singleTableParam',
163
+ {
164
+ data: {
165
+ items: 'name label,id value',
166
+ tablename: 't_user',
167
+ condition: `state = '在职' and f_department_name is not null`
168
+ }
169
+ },
170
+ {resolveMsg: null, rejectMsg: null})
171
+ .then((res) => {
172
+ self.userresid = res.data
173
+ })
174
+ }
175
+ export default {
176
+ title: '营业厅收款结账单',
177
+ props: ['data'],
178
+ data () {
179
+ return {
180
+ initres: {
181
+ org: [this.$login.f.orgid],
182
+ dep: [],
183
+ user: []
184
+ },
185
+ printTime: this.$login.toStandardTimeString(),
186
+ depresid: [],
187
+ userresid: [],
188
+ f_orgid: this.$login.f.orgid,
189
+ f_depid: this.$login.f.depids,
190
+ f_operatorid: this.$login.f.id,
191
+ operatorid: [],
192
+ depid: [],
193
+ tablen:0,
194
+ orgname: '',
195
+ depname: '',
196
+ operatorname: '',
197
+ orgCondtionStr: '1=1',
198
+ model: new DataModel('api/af-revenue/report/DepPrick', {startDate: 'this.model.startDate', endDate: 'this.model.endDate',
199
+ f_orgid: 'this.model.f_orgid'}),
200
+ reportStr: null,
201
+ show: false,
202
+ }
203
+ },
204
+ ready () {
205
+ getorg(this)
206
+ this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStandardDateString() + ' 00:00:00'
207
+ this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStandardDateString() + ' 23:59:59'
208
+ console.log(this.$login.f)
209
+ },
210
+ methods: {
211
+ searchData () {
212
+ this.$refs.paged.$refs.criteria.search()
213
+ },
214
+ getDep(val){
215
+ this.depname = this.depresid.filter(x => x.value ==val).map(x=>x.label).toString()
216
+ console.log('dep',this.depname )
217
+ },
218
+ getOpe(val){
219
+ this.operatorname = this.userresid.filter(x => x.value ==val).map(x=>x.label).toString()
220
+ console.log('dep',this.operatorname )
221
+ },
222
+ selfSearch (args) {
223
+ this.printTime = this.$login.toStandardTimeString()
224
+ let orgcondition = '1=1'
225
+ let orgstr = this.orgCondtionStr
226
+ if (this.f_orgid[0]) {
227
+ orgcondition += orgstr
228
+ }
229
+
230
+ this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
231
+ this.$refs.paged.search(args)
232
+ },
233
+ // 根据文件路径获取储存的报表内容
234
+ getFileContent (path) {
235
+ this.$resetpost('api/af-revenue/logic/getReportFileContent', {f_files_path: path}, {resolveMsg: null, rejectMsg: null}).then((res) => {
236
+ this.reportStr = res.data.filecontent
237
+ this.model.state = '正确'
238
+ })
239
+ },
240
+ confirm () {
241
+ if (!this.filename || this.filename === '') {
242
+ this.$showAlert('无法保存,文件名不能为空', 'warning', 3000)
243
+ }
244
+ let saveGen = saveFile(this)
245
+ co(saveGen)
246
+ },
247
+ close () {
248
+ this.show = false
249
+ },
250
+ getRes (condition, obj) {
251
+ this.orgCondtionStr = condition
252
+ this.orgname = obj.orgnames[0]
253
+ this.depname = obj.depnames[0]
254
+ },
255
+ // 将报表保存成文件
256
+ confirmReport () {
257
+ this.show = true
258
+ this.filename = this.data.f_report_name + this.$login.toStandardDateString()
259
+ }
260
+ },
261
+ watch: {
262
+ 'data' (val) {
263
+ if (val.f_files_path) {
264
+ this.getFileContent(val.f_files_path)
265
+ } else {
266
+ this.reportStr = null
267
+ }
268
+ },
269
+ 'model.data' (val) {
270
+ let len=0
271
+ let a=val.split('</tr>')
272
+ for(let i=0;i<a.length;i++){
273
+ if(a[i].split('</td>').length-1>len){
274
+ len=a[i].split('</td>').length-1
275
+ }
276
+ }
277
+ this.tablen=len
278
+ }
279
+ },
280
+ computed: {
281
+
282
+ payment() {
283
+ return [...this.$appdata.getParam('付款方式查询')]
284
+ }
285
+ }
286
+ }
287
+ </script>
288
+ <style scoped>
289
+ .noborder{
290
+ border: none;
291
+ }
292
+ </style>
@@ -24,29 +24,7 @@
24
24
  :show-reset-button="reset">
25
25
  </datepicker>
26
26
  </div>
27
- <div class="col-sm-4">
28
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;公司&nbsp;&nbsp;&nbsp; </label>
29
- <manage-right-tree @re-res="$parent.$parent.getRes"></manage-right-tree>
30
- </div>
31
- <div class="col-sm-4">
32
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;部门&nbsp;&nbsp;&nbsp; </label>
33
- <manage-res-select restype='department'
34
- is-mul="false"
35
- @res-select="$parent.$parent.getdep"
36
- :parentresid="$parent.$parent.depresid"
37
- :initresid='$parent.$parent.depid'>
38
- </manage-res-select>
39
-
40
- </div>
41
- <div class="col-sm-4">
42
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;人员&nbsp;&nbsp;&nbsp; </label>
43
- <manage-res-select restype='user'
44
- is-mul="false"
45
- @res-select="$parent.$parent.getuser"
46
- :parentresid="$parent.$parent.userresid"
47
- :initresid='$parent.$parent.operatorid'>
48
- </manage-res-select>
49
- </div>
27
+ <res-select-group :show-component="['company','department','operator']" :initres="$parent.$parent.initres" :selectin="true" :cascade =true @re-res="$parent.$parent.getRes" v-ref:sel></res-select-group>
50
28
  <div class="col-sm-3 form-group">
51
29
  <label class="font_normal_body" for="oper1">格式一</label>
52
30
  <input type="radio" name="reportStyle" id="oper1" v-model="$parent.$parent.reportStyle" value="1">
@@ -116,7 +94,11 @@ import {DataModel, HttpResetClass} from 'vue-client'
116
94
  return {
117
95
  printTime: this.$login.toStandardTimeString(),
118
96
  depresid: [],
119
-
97
+ initres: {
98
+ org:[this.$login.f.orgid],
99
+ dep:[],
100
+ user:[]
101
+ },
120
102
  userresid: [],
121
103
  f_orgid: this.$login.f.orgid,
122
104
  f_depid: this.$login.f.depids,
@@ -166,16 +148,9 @@ import {DataModel, HttpResetClass} from 'vue-client'
166
148
  selfSearch (args) {
167
149
  this.printTime = this.$login.toStandardTimeString()
168
150
  let orgcondition = '1=1'
169
- if (this.f_orgid && this.f_orgid[0]) {
170
- orgcondition += ` and f_orgid in (${this.f_orgid})`
171
- }
172
- if (this.f_depid && this.f_depid[0]) {
173
- orgcondition += ` and f_depid in (${this.f_depid})`
174
- }
175
- if (this.f_operatorid && this.f_operatorid[0]) {
176
- orgcondition += ` and f_operatorid in (${this.f_operatorid})`
177
- }
178
- this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
151
+ let orgstr = this.orgCondtionStr
152
+ orgcondition = orgcondition + orgstr
153
+ this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition.replace('1=1','') + ' and ' + args.condition
179
154
  if (this.reportStyle == '1') {
180
155
  let load = new HttpResetClass()
181
156
  load.load("POST", 'api/af-revenue/sql/getGasPriceDetail',
@@ -216,12 +191,11 @@ import {DataModel, HttpResetClass} from 'vue-client'
216
191
  this.model.url = 'api/af-revenue/report/gaspricetwo'
217
192
  this.$refs.paged.search(args)
218
193
  }
219
-
220
194
  },
221
- getRes (obj) {
222
- this.orgname = obj.res[0]
223
- this.depresid = obj.resids
224
- this.f_orgid = obj.resids
195
+ getRes (condition, obj) {
196
+ this.orgCondtionStr = condition
197
+ this.orgname = obj.orgnames[0]
198
+ this.depname = obj.depnames[0]
225
199
  },
226
200
  getdep (obj, val) {
227
201
  // this.depname = val[0]
@@ -24,10 +24,7 @@
24
24
  :show-reset-button="reset">
25
25
  </datepicker>
26
26
  </div>
27
- <div class="col-sm-2 form-group">
28
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;公司&nbsp;&nbsp;&nbsp; </label>
29
- <manage-right-tree @re-res="$parent.$parent.getRes" style="width: 60%"></manage-right-tree>
30
- </div>
27
+ <res-select-group :show-component="['company']" :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes" v-ref:sel></res-select-group>
31
28
  <div class="col-sm-3 form-group">
32
29
  <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
33
30
  <v-select id="dep" style="width: 60%"
@@ -43,7 +40,7 @@
43
40
  <div class="col-sm-3 form-group">
44
41
  <label class="font_normal_body" for="oper">人&emsp;&emsp;员:</label>
45
42
  <v-select id="oper" style="width: 60%"
46
- :multiple="false"
43
+ :multiple="true"
47
44
  @change="$parent.$parent.getOpe"
48
45
  :value.sync="model.f_operatorid"
49
46
  v-model="model.f_operatorid"
@@ -188,8 +185,9 @@ export default {
188
185
  selfSearch (args) {
189
186
  this.printTime = this.$login.toStandardTimeString()
190
187
  let orgcondition = ''
188
+ let orgstr = this.orgCondtionStr
191
189
  if (this.f_orgid[0]) {
192
- orgcondition += ` and f_orgid in (${this.f_orgid})`
190
+ orgcondition += orgstr
193
191
  }
194
192
  if(this.f_state && this.f_state[0]) {
195
193
  orgcondition += ` and f_state in('${this.f_state.toString().replace(/,/g,"','")}')`
@@ -201,9 +199,10 @@ export default {
201
199
  hidden() {
202
200
  this.criteriaShow = !this.criteriaShow
203
201
  },
204
- getRes (obj) {
205
- this.orgname = obj.res[0]
206
- this.f_orgid = obj.resids
202
+ getRes (condition, obj) {
203
+ this.orgCondtionStr = condition
204
+ this.orgname = obj.orgnames[0]
205
+ this.depname = obj.depnames[0]
207
206
  },
208
207
  getDep(val){
209
208
  this.depname = this.depresid.filter(x => val.includes(x.value)).map(x=>x.label).toString()
@@ -0,0 +1,261 @@
1
+ <template>
2
+ <div class="basic-main" style="height: 100%">
3
+ <criteria-paged :model="model" :pager='false' v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
+ <p class="bg-info text-center" style="padding: 8px;">抄表情况汇总表</p>
6
+ <div class="form-group" v-if="!$parent.$parent.data.f_files_path"></div>
7
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial >
8
+ <div class="row">
9
+ <div class="col-sm-4" >
10
+ <label class="font_normal_body" for="startDate">开始日期:</label>
11
+ <datepicker id="startDate" placeholder="开始日期" style="width: 60%"
12
+ v-model="model.startDate"
13
+ :value.sync="model.startDate"
14
+ :disabled-days-of-Week="[]"
15
+ :format="'yyyy-MM-dd HH:mm:ss'"
16
+ :show-reset-button="reset">
17
+ </datepicker>
18
+ </div>
19
+ <div class="col-sm-4" >
20
+ <label class="font_normal_body" for="endDate">结束日期:</label>
21
+ <datepicker id="endDate" placeholder="结束日期" style="width: 60%"
22
+ v-model="model.endDate"
23
+ :value.sync="model.endDate"
24
+ :disabled-days-of-Week="[]"
25
+ :format="'yyyy-MM-dd HH:mm:ss'"
26
+ :show-reset-button="reset">
27
+ </datepicker>
28
+ </div>
29
+ <res-select-group :show-component="['company','department','operator']" :initres="$parent.$parent.initres" :selectin="true" :cascade =true @re-res="$parent.$parent.getRes" v-ref:sel></res-select-group>
30
+ <div class="col-sm-4 form-group">
31
+ <label class="font_normal_body">抄&ensp;表&ensp;员</label>
32
+ <v-select :value.sync="model.f_inputtor"
33
+ v-model="model.f_inputtor"
34
+ :options='$parent.$parent.inputtor' placeholder='请选择'
35
+ :multiple="true"
36
+ close-on-select></v-select>
37
+ </div>
38
+ <div class="col-sm-4 form-group">
39
+ <label class="font_normal_body">用户类型</label>
40
+ <v-select :value.sync="model.f_user_type" :multiple="true"
41
+ :options='$parent.$parent.usertypes' placeholder='请选择' v-model="model.f_user_type"
42
+ close-on-select></v-select>
43
+ </div>
44
+ </div>
45
+ <div class="span" style = "float:right;">
46
+ <button class="button_search" @click="$parent.$parent.searchData()">查询</button>
47
+ <report-print id='gasprice' top='3cm' left='0' width='100%' height='100%' :preview="true"></report-print>
48
+ <report-excel id='gasprice'></report-excel>
49
+ </div>
50
+ </div>
51
+ </criteria>
52
+ <div partial='list' v-el:handcollect id='gasprice' style="overflow-y: scroll">
53
+ <table class='tableprint' style="margin: 0px auto">
54
+ <thead>
55
+ <tr>
56
+ <th colspan='8' style="font-weight: normal; text-align: left;">
57
+ <h3 style="text-align: center">抄表情况汇总表</h3>
58
+ </th>
59
+ </tr>
60
+ <tr>
61
+ <th colspan='8' style="font-weight: normal; text-align: center;">
62
+ 开始时间:{{model.model.startDate}}&nbsp;&nbsp;&nbsp;
63
+ 结束时间:{{ model.model.endDate }}
64
+ </th>
65
+ </tr>
66
+ <tr>
67
+ <th colspan='8' style="font-weight: normal; text-align: center;">
68
+ 打印时间:{{{$parent.printTime}}}
69
+ </th>
70
+ </tr>
71
+ <tr>
72
+ <th colspan='8' style="font-weight: normal; text-align: center;">
73
+ <div>
74
+ <span v-show="$parent.orgname.trim()!=''">公司:{{$parent.orgname}}</span>
75
+ <span v-show="$parent.depname.trim()!=''"> 部门:{{$parent.depname}}</span>
76
+ <span v-show="$parent.operatorname.trim()!=''">人员:{{$parent.operatorname}}</span>
77
+ </div>
78
+ </th>
79
+ </tr>
80
+ </thead>
81
+ <tr>
82
+ <td colspan='12'>
83
+ {{{ model.data.substring(26,model.data.length-8) }}}
84
+ </td>
85
+ </tr>
86
+ <tfoot>
87
+ <tr style="text-align: left">
88
+ <th colspan='3'>财务审核:</th>
89
+ <th colspan='3'>收款审核:</th>
90
+ <th colspan='2'>收款员:</th>
91
+ </tr>
92
+ </tfoot>
93
+ </table>
94
+ {{{ $parent.reportStr}}}
95
+ </div>
96
+ </criteria-paged>
97
+ <modal :show.sync="show" v-ref:modal small backdrop="false">
98
+ <header slot="modal-header" class="modal-header">
99
+ <h4 class="modal-title">输入文件名称</h4>
100
+ </header>
101
+ <article slot="modal-body" class="modal-body">
102
+ <div class="form-group">
103
+ <input type="text" class="form-control" v-model="filename" placeholder='保存的文件名'>
104
+ </div>
105
+ </article>
106
+ <footer slot="modal-footer" class="modal-footer">
107
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
108
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button>
109
+ </footer>
110
+ </modal>
111
+ </div>
112
+ </template>
113
+
114
+ <script>
115
+ import { DataModel } from 'vue-client'
116
+ import co from 'co'
117
+ let saveFile = function * (self) {
118
+ // 线验证文件是否重名
119
+ let count = yield self.$resetpost('api/af-revenue/sql/manageSingleTable',
120
+ {data: {tablename: 't_report_record', condition: `f_files_name = '${self.filename}'`}},
121
+ {resolveMsg: null, rejectMsg: null})
122
+ if (count.data.length > 0) {
123
+ self.$showAlert('无法保存,文件名重名', 'warning', 3000)
124
+ return
125
+ }
126
+ let saveBack = yield self.$resetpost('api/af-revenue/logic/saveReport', {f_files_content: self.$refs.paged.$els.handcollect.innerHTML,
127
+ f_files_name: self.filename, f_files_type: self.data.f_report_type, f_component_name: 'manage-bus-summary',
128
+ f_operator: this.$login.f.name, f_query_month: `${self.model.model.startDate}-${self.model.model.endDate}`,
129
+ f_outlets: this.$login.f.depname})
130
+ if (saveBack.data.status === 'succeed') {
131
+ self.show = false
132
+ self.filename = ''
133
+ // 后台保存完成,通知刷新
134
+ self.$dispatch('save-success', self.filename)
135
+ }
136
+ }
137
+ export default {
138
+ title: '抄表情况汇总表',
139
+ props: ['data'],
140
+ data () {
141
+ return {
142
+ initres: {
143
+ org:[this.$login.f.orgid],
144
+ dep:[],
145
+ user:[]
146
+ },
147
+ printTime: this.$login.toStandardTimeString(),
148
+ depresid: [],
149
+ userresid: [],
150
+ f_orgid: this.$login.f.orgid,
151
+ f_depid: this.$login.f.depids,
152
+ f_operatorid: this.$login.f.id,
153
+ operatorid: [],
154
+ depid: [],
155
+ orgname: '',
156
+ depname: '',
157
+ operatorname: '',
158
+ f_inputtor:[],
159
+ f_user_type:'',
160
+ orgCondtionStr: '1=1',
161
+ model: new DataModel('api/af-revenue/report/gethandinputtor', {startDate: 'this.model.startDate', endDate: 'this.model.endDate',
162
+ f_orgid: 'this.model.f_orgid'}),
163
+ reportStr: null,
164
+ show: false
165
+ }
166
+ },
167
+ ready () {
168
+ this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStandardDateString() + ' 00:00:00'
169
+ this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStandardDateString() + ' 23:59:59'
170
+ this.$refs.paged.$refs.criteria.search()
171
+ console.log(this.$login.f)
172
+ },
173
+ methods: {
174
+ searchData () {
175
+ this.$refs.paged.$refs.criteria.search()
176
+ },
177
+ selfSearch (args) {
178
+ console.log('f_inputtor='+this.f_inputtor)
179
+ this.printTime = this.$login.toStandardTimeString()
180
+ let orgcondition = args.condition + this.orgCondtionStr
181
+ .replace(/\bf_orgid\b/g, 'h.f_orgid')
182
+ .replace(/\bf_depid\b/g, 'h.f_depid')
183
+ .replace(/\bf_operatorid\b/g, 'h.f_operatorid');
184
+ if(this.$refs.paged.$refs.criteria.model.f_user_type!=''){
185
+ orgcondition += ' and h.f_user_type = ' + `'${this.$refs.paged.$refs.criteria.model.f_user_type}'`
186
+ }
187
+ if(this.$refs.paged.$refs.criteria.model.f_inputtor!='') {
188
+ orgcondition += ' and h.f_inputtor in ('
189
+ this.$refs.paged.$refs.criteria.model.f_inputtor.forEach(function (item,index) {
190
+ if(index==0 &&item!=''){
191
+ orgcondition +="'"+item+"'"
192
+ }else if(index>0&&item!='')
193
+ orgcondition +=",'"+item+"'"
194
+ })
195
+ orgcondition += ")"
196
+ }
197
+
198
+ this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
199
+ this.$refs.paged.search(args)
200
+ },
201
+ getRes (condition, obj) {
202
+ this.orgCondtionStr = condition
203
+ this.orgname = obj.orgnames[0]
204
+ this.depname = obj.depnames[0]
205
+ },
206
+ getdep (obj, val) {
207
+ // this.depname = val[0]
208
+ this.userresid = obj
209
+ this.f_depid = obj
210
+ },
211
+ getuser ( obj, val) {
212
+ this.operatorname = val[0]
213
+ this.f_operatorid = obj
214
+ },
215
+ // 根据文件路径获取储存的报表内容
216
+ getFileContent (path) {
217
+ this.$resetpost('api/af-revenue/logic/getReportFileContent', {f_files_path: path}, {resolveMsg: null, rejectMsg: null}).then((res) => {
218
+ this.reportStr = res.data.filecontent
219
+ this.model.state = '正确'
220
+ })
221
+ },
222
+ confirm () {
223
+ if (!this.filename || this.filename === '') {
224
+ this.$showAlert('无法保存,文件名不能为空', 'warning', 3000)
225
+ }
226
+ let saveGen = saveFile(this)
227
+ co(saveGen)
228
+ },
229
+ close () {
230
+ this.show = false
231
+ },
232
+ // 将报表保存成文件
233
+ confirmReport () {
234
+ this.show = true
235
+ this.filename = this.data.f_report_name + this.$login.toStandardDateString()
236
+ },
237
+ },
238
+ watch: {
239
+ 'data' (val) {
240
+ if (val.f_files_path) {
241
+ this.getFileContent(val.f_files_path)
242
+ } else {
243
+ this.reportStr = null
244
+ }
245
+ }
246
+ },
247
+ computed: {
248
+ usertypes() {
249
+ return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('用户类型')]
250
+ },
251
+ inputtor() {
252
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('抄表员')]
253
+ },
254
+ }
255
+ }
256
+ </script>
257
+ <style scoped>
258
+ .noborder{
259
+ border: none;
260
+ }
261
+ </style>