manage-client 3.1.29 → 3.1.33

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.
@@ -1,233 +1,233 @@
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
- <res-select-group :mul="false" :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes" v-ref:res_select></res-select-group>
10
- <div class="col-sm-2 form-group" >
11
- <label class="font_normal_body" for="startDate">开始日期:</label>
12
- <datepicker id="startDate" placeholder="开始日期" style="width: 60%"
13
- v-model="model.startDate"
14
- :value.sync="model.startDate"
15
- :disabled-days-of-Week="[]"
16
- :format="'yyyy-MM-dd HH:mm:ss'"
17
- :show-reset-button="reset">
18
- </datepicker>
19
- </div>
20
- <div class="col-sm-2 form-group" >
21
- <label class="font_normal_body" for="endDate">结束日期:</label>
22
- <datepicker id="endDate" placeholder="结束日期" style="width: 60%"
23
- v-model="model.endDate"
24
- :value.sync="model.endDate"
25
- :disabled-days-of-Week="[]"
26
- :format="'yyyy-MM-dd HH:mm:ss'"
27
- :show-reset-button="reset">
28
- </datepicker>
29
- </div>
30
- <div class="col-sm-2 form-group">
31
- <label class="font_normal_body">收费状态</label>
32
- <v-select :value.sync="$parent.$parent.f_state" multiple
33
- v-model="$parent.$parent.f_state"
34
- :options='$parent.$parent.charge_state' placeholder='请选择'
35
- condition="f_state in {}"
36
- close-on-select></v-select>
37
- </div>
38
- </div>
39
- <div class="span" style = "float:right;">
40
- <button class="button_search" @click="$parent.$parent.searchData()">查询</button>
41
- <report-print id='gasprice' top='3cm' left='0' width='100%' height='100%' :preview="true"></report-print>
42
- <report-excel id='gasprice'></report-excel>
43
- </div>
44
- </div>
45
- </criteria>
46
- <div partial='list' v-el:handcollect id='gasprice' style="overflow-y: scroll">
47
- <table class='tableprint' style="margin: 0px auto" v-if="!$parent.data.f_files_path">
48
- <thead>
49
- <tr>
50
- <th colspan='9' style="font-weight: normal; text-align: left;">
51
- <h3 style="text-align: center">{{$parent.orgname==null||$parent.orgname==''?$parent.orgname}}收费结账报表</h3>
52
- </th>
53
- </tr>
54
- <tr>
55
- <th colspan='9' style="font-weight: normal; text-align: center;">
56
- 开始时间:{{model.model.startDate}}&nbsp;&nbsp;&nbsp;
57
- 结束时间:{{ model.model.endDate }}&nbsp;&nbsp;<br/>
58
- <!--打印时间:{{{$parent.printTime}}}-->
59
- 打印时间:{{$parent.printTime}}
60
- <!--收费员:{{// $parent.operatorname}}-->
61
- </th>
62
- </tr>
63
- <tr>
64
- <th colspan='9' style="font-weight: normal; text-align: center;">
65
- <div>
66
- <span style="font-weight: normal;text-align: center;margin:5px 15px" v-show="$parent.orgname.trim()!=''">公司:{{$parent.orgname}}</span>
67
- <span v-show="$parent.depname.trim()!=''"> 部门:{{$parent.depname}}</span>
68
- <span style="font-weight: normal;text-align: center;margin:5px 15px" v-show="$parent.operatorname.trim()!=''">人员:{{$parent.operatorname}}</span>
69
- </div>
70
- </th>
71
- </tr>
72
- </thead>
73
- <tr>
74
- <td colspan='9'>
75
- {{{ model.data.substring(26,model.data.length-8) }}}
76
- </td>
77
- </tr>
78
- <tfoot>
79
- <tr style="text-align: left">
80
- <th colspan='3'>财务审核:</th>
81
- <th colspan='3'>收款审核:</th>
82
- <th colspan='3'>收款员:</th>
83
- </tr>
84
- </tfoot>
85
- </table>
86
- {{{ $parent.reportStr}}}
87
- </div>
88
- </criteria-paged>
89
- <modal :show.sync="show" v-ref:modal small backdrop="false">
90
- <header slot="modal-header" class="modal-header">
91
- <h4 class="modal-title">输入文件名称</h4>
92
- </header>
93
- <article slot="modal-body" class="modal-body">
94
- <div class="form-group">
95
- <input type="text" class="form-control" v-model="filename" placeholder='保存的文件名'>
96
- </div>
97
- </article>
98
- <footer slot="modal-footer" class="modal-footer">
99
- <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
100
- <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button>
101
- </footer>
102
- </modal>
103
- </div>
104
- </template>
105
-
106
- <script>
107
- import { DataModel } from 'vue-client'
108
- import co from 'co'
109
- let saveFile = function * (self) {
110
- // 线验证文件是否重名
111
- let count = yield self.$resetpost('rs/sql/manageSingleTable',
112
- {data: {tablename: 't_report_record', condition: `f_files_name = '${self.filename}'`}},
113
- {resolveMsg: null, rejectMsg: null})
114
- if (count.data.length > 0) {
115
- self.$showAlert('无法保存,文件名重名', 'warning', 3000)
116
- return
117
- }
118
- let saveBack = yield self.$resetpost('rs/logic/saveReport', {f_files_content: self.$refs.paged.$els.handcollect.innerHTML,
119
- f_files_name: self.filename, f_files_type: self.data.f_report_type, f_component_name: 'manage-bus-summary',
120
- f_operator: this.$login.f.name, f_query_month: `${self.model.model.startDate}-${self.model.model.endDate}`,
121
- f_outlets: this.$login.f.depname})
122
- if (saveBack.data.status === 'succeed') {
123
- self.show = false
124
- self.filename = ''
125
- // 后台保存完成,通知刷新
126
- self.$dispatch('save-success', self.filename)
127
- }
128
- }
129
- export default {
130
- title: '收费结账报表',
131
- props: ['data'],
132
- data () {
133
- return {
134
- printTime: this.$login.toStandardTimeString(),
135
- depresid: [],
136
- userresid: [],
137
- f_orgid: this.$login.f.orgid,
138
- f_depid: this.$login.f.depids,
139
- f_operatorid: this.$login.f.id,
140
- operatorid: [],
141
- depid: [],
142
- orgname: '',
143
- depname: '',
144
- operatorname: '',
145
- orgCondtionStr: '1=1',
146
- f_state:['有效'],
147
- model: new DataModel('rs/report/getmoneyall', {startDate: 'this.model.startDate', endDate: 'this.model.endDate',
148
- f_orgid: 'this.model.f_orgid'}),
149
- reportStr: null,
150
- show: false,
151
- initres: {
152
- org: [this.$login.f.orgid],
153
- dep: [],
154
- user: []
155
- }
156
- }
157
- },
158
- ready () {
159
- this.$refs.paged.$refs.criteria.$refs.res_select.sliceareashow = false
160
- this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStandardDateString() + ' 00:00:00'
161
- this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStandardDateString() + ' 23:59:59'
162
- // this.$refs.paged.$refs.criteria.search()
163
- console.log(this.$login.f)
164
- },
165
- methods: {
166
- searchData () {
167
- this.$refs.paged.$refs.criteria.search()
168
- },
169
- selfSearch (args) {
170
- this.printTime = this.$login.toStandardTimeString()
171
- console.log('xxxxxxxxxxx',this.orgCondtionStr)
172
- let orgstr = this.f_state && this.f_state!='' ? "f_state='"+this.f_state+"' "+ this.orgCondtionStr:this.orgCondtionStr.replace('and', '')
173
- this.$refs.paged.$refs.criteria.model.f_orgid = orgstr
174
- this.$refs.paged.search(args)
175
- },
176
- // 根据文件路径获取储存的报表内容
177
- getFileContent (path) {
178
- this.$resetpost('rs/logic/getReportFileContent', {f_files_path: path}, {resolveMsg: null, rejectMsg: null}).then((res) => {
179
- this.reportStr = res.data.filecontent
180
- this.model.state = '正确'
181
- })
182
- },
183
- confirm () {
184
- if (!this.filename || this.filename === '') {
185
- this.$showAlert('无法保存,文件名不能为空', 'warning', 3000)
186
- }
187
- let saveGen = saveFile(this)
188
- co(saveGen)
189
- },
190
- close () {
191
- this.show = false
192
- },
193
- // 将报表保存成文件
194
- confirmReport () {
195
- this.show = true
196
- this.filename = this.data.f_report_name + this.$login.toStandardDateString()
197
- },
198
- async getRes (condition, obj) {
199
- this.orgCondtionStr = condition
200
- if(obj.orgnames.length>0){
201
- this.orgname = obj.orgnames[0];
202
- }
203
- if(obj.operatornames.length>0){
204
- let users = await this.$resetpost('rs/sql/manageSingleTable',
205
- {data: {tablename: 't_user', condition: ` id = '${obj.operatornames[0]}'`}},
206
- {resolveMsg: null, rejectMsg: null});
207
- if(users.data){
208
- this.operatorname = users.data[0].name;
209
- }
210
- }
211
- }
212
- },
213
- watch: {
214
- 'data' (val) {
215
- if (val.f_files_path) {
216
- this.getFileContent(val.f_files_path)
217
- } else {
218
- this.reportStr = null
219
- }
220
- }
221
- },
222
- computed: {
223
- charge_state() {
224
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('收费状态')]
225
- }
226
- }
227
- }
228
- </script>
229
- <style scoped>
230
- .noborder{
231
- border: none;
232
- }
233
- </style>
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
+ <res-select-group :mul="false" :initres="$parent.$parent.initres" @re-res="$parent.$parent.getRes" v-ref:res></res-select-group>
10
+ <div class="col-sm-2 form-group" >
11
+ <label class="font_normal_body" for="startDate">开始日期:</label>
12
+ <datepicker id="startDate" placeholder="开始日期" style="width: 60%"
13
+ v-model="model.startDate"
14
+ :value.sync="model.startDate"
15
+ :disabled-days-of-Week="[]"
16
+ :format="'yyyy-MM-dd HH:mm:ss'"
17
+ :show-reset-button="reset">
18
+ </datepicker>
19
+ </div>
20
+ <div class="col-sm-2 form-group" >
21
+ <label class="font_normal_body" for="endDate">结束日期:</label>
22
+ <datepicker id="endDate" placeholder="结束日期" style="width: 60%"
23
+ v-model="model.endDate"
24
+ :value.sync="model.endDate"
25
+ :disabled-days-of-Week="[]"
26
+ :format="'yyyy-MM-dd HH:mm:ss'"
27
+ :show-reset-button="reset">
28
+ </datepicker>
29
+ </div>
30
+ <div class="col-sm-2 form-group">
31
+ <label class="font_normal_body">收费状态</label>
32
+ <v-select :value.sync="$parent.$parent.f_state" multiple
33
+ v-model="$parent.$parent.f_state"
34
+ :options='$parent.$parent.charge_state' placeholder='请选择'
35
+ condition="f_state in {}"
36
+ close-on-select></v-select>
37
+ </div>
38
+ </div>
39
+ <div class="span" style = "float:right;">
40
+ <button class="button_search" @click="$parent.$parent.searchData()">查询</button>
41
+ <report-print id='gasprice' top='3cm' left='0' width='100%' height='100%' :preview="true"></report-print>
42
+ <report-excel id='gasprice'></report-excel>
43
+ </div>
44
+ </div>
45
+ </criteria>
46
+ <div partial='list' v-el:handcollect id='gasprice' style="overflow-y: scroll">
47
+ <table class='tableprint' style="margin: 0px auto" v-if="!$parent.data.f_files_path">
48
+ <thead>
49
+ <tr>
50
+ <th colspan='9' style="font-weight: normal; text-align: left;">
51
+ <h3 style="text-align: center">收费结账报表</h3>
52
+ </th>
53
+ </tr>
54
+ <tr>
55
+ <th colspan='9' style="font-weight: normal; text-align: center;">
56
+ 开始时间:{{model.model.startDate}}&nbsp;&nbsp;&nbsp;
57
+ 结束时间:{{ model.model.endDate }}&nbsp;&nbsp;<br/>
58
+ <!--打印时间:{{{$parent.printTime}}}-->
59
+ 打印时间:{{$parent.printTime}}
60
+ <!--收费员:{{// $parent.operatorname}}-->
61
+ </th>
62
+ </tr>
63
+ <tr>
64
+ <th colspan='9' style="font-weight: normal; text-align: center;">
65
+ <div>
66
+ <span style="font-weight: normal;text-align: center;margin:5px 15px" v-show="$parent.orgname">公司:{{$parent.orgname}}</span>
67
+ <span v-show="$parent.depname"> 部门:{{$parent.depname}}</span>
68
+ <span style="font-weight: normal;text-align: center;margin:5px 15px" v-show="$refs.criteria.$refs.res.obj.operatornames[0]">人员:{{$parent.operatorname}}</span>
69
+ </div>
70
+ </th>
71
+ </tr>
72
+ </thead>
73
+ <tr>
74
+ <td colspan='9'>
75
+ {{{ model.data.substring(26,model.data.length-8) }}}
76
+ </td>
77
+ </tr>
78
+ <tfoot>
79
+ <tr style="text-align: left">
80
+ <th colspan='3'>财务审核:</th>
81
+ <th colspan='3'>收款审核:</th>
82
+ <th colspan='3'>收款员:</th>
83
+ </tr>
84
+ </tfoot>
85
+ </table>
86
+ {{{ $parent.reportStr}}}
87
+ </div>
88
+ </criteria-paged>
89
+ <modal :show.sync="show" v-ref:modal small backdrop="false">
90
+ <header slot="modal-header" class="modal-header">
91
+ <h4 class="modal-title">输入文件名称</h4>
92
+ </header>
93
+ <article slot="modal-body" class="modal-body">
94
+ <div class="form-group">
95
+ <input type="text" class="form-control" v-model="filename" placeholder='保存的文件名'>
96
+ </div>
97
+ </article>
98
+ <footer slot="modal-footer" class="modal-footer">
99
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
100
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button>
101
+ </footer>
102
+ </modal>
103
+ </div>
104
+ </template>
105
+
106
+ <script>
107
+ import { DataModel } from 'vue-client'
108
+ import co from 'co'
109
+ let saveFile = function * (self) {
110
+ // 线验证文件是否重名
111
+ let count = yield self.$resetpost('rs/sql/manageSingleTable',
112
+ {data: {tablename: 't_report_record', condition: `f_files_name = '${self.filename}'`}},
113
+ {resolveMsg: null, rejectMsg: null})
114
+ if (count.data.length > 0) {
115
+ self.$showAlert('无法保存,文件名重名', 'warning', 3000)
116
+ return
117
+ }
118
+ let saveBack = yield self.$resetpost('rs/logic/saveReport', {f_files_content: self.$refs.paged.$els.handcollect.innerHTML,
119
+ f_files_name: self.filename, f_files_type: self.data.f_report_type, f_component_name: 'manage-bus-summary',
120
+ f_operator: this.$login.f.name, f_query_month: `${self.model.model.startDate}-${self.model.model.endDate}`,
121
+ f_outlets: this.$login.f.depname})
122
+ if (saveBack.data.status === 'succeed') {
123
+ self.show = false
124
+ self.filename = ''
125
+ // 后台保存完成,通知刷新
126
+ self.$dispatch('save-success', self.filename)
127
+ }
128
+ }
129
+ export default {
130
+ title: '收费结账报表',
131
+ props: ['data'],
132
+ data () {
133
+ return {
134
+ printTime: this.$login.toStandardTimeString(),
135
+ depresid: [],
136
+ userresid: [],
137
+ f_orgid: this.$login.f.orgid,
138
+ f_depid: this.$login.f.depids,
139
+ f_operatorid: this.$login.f.id,
140
+ operatorid: [],
141
+ depid: [],
142
+ orgname: '',
143
+ depname: '',
144
+ operatorname: '',
145
+ orgCondtionStr: '1=1',
146
+ f_state:['有效'],
147
+ model: new DataModel('rs/report/getmoneyall', {startDate: 'this.model.startDate', endDate: 'this.model.endDate',
148
+ f_orgid: 'this.model.f_orgid'}),
149
+ reportStr: null,
150
+ show: false,
151
+ initres: {
152
+ org: [this.$login.f.orgid],
153
+ dep: [],
154
+ user: []
155
+ }
156
+ }
157
+ },
158
+ ready () {
159
+ this.$refs.paged.$refs.criteria.$refs.res_select.sliceareashow = false
160
+ this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStandardDateString() + ' 00:00:00'
161
+ this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStandardDateString() + ' 23:59:59'
162
+ // this.$refs.paged.$refs.criteria.search()
163
+ console.log(this.$login.f)
164
+ },
165
+ methods: {
166
+ searchData () {
167
+ this.$refs.paged.$refs.criteria.search()
168
+ },
169
+ selfSearch (args) {
170
+ this.printTime = this.$login.toStandardTimeString()
171
+ console.log('xxxxxxxxxxx',this.orgCondtionStr)
172
+ let orgstr = this.f_state[0] ? "f_state in('" + this.f_state.toString().replace(new RegExp(',','g'), "','") +"') "+ this.orgCondtionStr:this.orgCondtionStr.replace('and', '')
173
+ this.$refs.paged.$refs.criteria.model.f_orgid = orgstr
174
+ this.$refs.paged.search(args)
175
+ },
176
+ // 根据文件路径获取储存的报表内容
177
+ getFileContent (path) {
178
+ this.$resetpost('rs/logic/getReportFileContent', {f_files_path: path}, {resolveMsg: null, rejectMsg: null}).then((res) => {
179
+ this.reportStr = res.data.filecontent
180
+ this.model.state = '正确'
181
+ })
182
+ },
183
+ confirm () {
184
+ if (!this.filename || this.filename === '') {
185
+ this.$showAlert('无法保存,文件名不能为空', 'warning', 3000)
186
+ }
187
+ let saveGen = saveFile(this)
188
+ co(saveGen)
189
+ },
190
+ close () {
191
+ this.show = false
192
+ },
193
+ // 将报表保存成文件
194
+ confirmReport () {
195
+ this.show = true
196
+ this.filename = this.data.f_report_name + this.$login.toStandardDateString()
197
+ },
198
+ async getRes (condition, obj) {
199
+ this.orgCondtionStr = condition
200
+ if(obj.orgnames.length>0){
201
+ this.orgname = obj.orgnames[0];
202
+ }
203
+ if(obj.operatornames.length>0){
204
+ let users = await this.$resetpost('rs/sql/manageSingleTable',
205
+ {data: {tablename: 't_user', condition: ` id = '${obj.operatornames[0]}'`}},
206
+ {resolveMsg: null, rejectMsg: null});
207
+ if(users.data){
208
+ this.operatorname = users.data[0].name;
209
+ }
210
+ }
211
+ }
212
+ },
213
+ watch: {
214
+ 'data' (val) {
215
+ if (val.f_files_path) {
216
+ this.getFileContent(val.f_files_path)
217
+ } else {
218
+ this.reportStr = null
219
+ }
220
+ }
221
+ },
222
+ computed: {
223
+ charge_state() {
224
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('收费状态')]
225
+ }
226
+ }
227
+ }
228
+ </script>
229
+ <style scoped>
230
+ .noborder{
231
+ border: none;
232
+ }
233
+ </style>
@@ -0,0 +1,183 @@
1
+ <template>
2
+ <div id='app' >
3
+ <criteria-paged :model="model" :pager='false' v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
+ <div novalidate class="form-inline auto " partial >
6
+ <p class="bg-info text-center" style="padding: 8px;">用户统计报表</p>
7
+ <div class="flex-row auto" style="justify-content: space-between">
8
+ <div class="form-group" v-if="!$parent.$parent.data.f_files_path">
9
+ <label for="startDate">开始日期:</label>
10
+ <datepicker id="startDate" placeholder="开始日期"
11
+ v-model="model.startDate"
12
+ :value.sync="model.startDate"
13
+ :disabled-days-of-Week="[]"
14
+ :format="'yyyy-MM-dd'"
15
+ :show-reset-button="reset">
16
+ </datepicker>
17
+ <label for="endDate">结束日期:</label>
18
+ <datepicker id="endDate" placeholder="结束日期"
19
+ v-model="model.endDate"
20
+ :value.sync="model.endDate"
21
+ :disabled-days-of-Week="[]"
22
+ :format="'yyyy-MM-dd'"
23
+ :show-reset-button="reset">
24
+ </datepicker>
25
+ <label for="endDate" class="control-label">组织机构</label>
26
+ <right-tree :userid.sync='$parent.$parent.userid' :source.sync='$parent.$parent.source' @re-res="$parent.$parent.getRes"></right-tree>
27
+ <button class="btn btn-primary width-100" @click="search()">查询</button>
28
+ <!--<button class="btn btn-success width-100" @click="$parent.$parent.confirmReport()">保存报表</button>-->
29
+ </div>
30
+ <span></span>
31
+ <div class="form-group">
32
+ <report-print id='gasprice' top='1cm' left='2cm' width='100%' height='100%' :preview="true"></report-print>
33
+ <report-excel id='gasprice' ></report-excel>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </criteria>
38
+ <div partial='list' v-el:handcollect id='gasprice'>
39
+ <table class='tableprint' style="margin: 0px auto" v-if="!$parent.data.f_files_path">
40
+ <thead>
41
+ <tr>
42
+ <th colspan='6' style="font-weight: normal; text-align: left;">
43
+ <h3 style="text-align: center">用户统计报表</h3>
44
+ </th>
45
+ </tr>
46
+ <tr>
47
+ <th colspan='6' style="font-weight: normal; text-align: center;">
48
+ 开始时间:{{model.model.startDate}}&nbsp;&nbsp;&nbsp;
49
+ 结束时间:{{ model.model.endDate }}&nbsp;&nbsp;&nbsp;
50
+ </th>
51
+ </tr>
52
+ <tr>
53
+ <th colspan='6' style="font-weight: normal; text-align: center;">
54
+ 打印时间:{{{$parent.printTime}}}
55
+ </th>
56
+ </tr>
57
+ <tr>
58
+ <th colspan='6' style="font-weight: normal; text-align: center;">
59
+ 组织机构:{{$parent.filialeNameStr}}
60
+ </th>
61
+ </tr>
62
+ </thead>
63
+ <tr>
64
+ <td colspan='6'>
65
+ {{{ model.data.substring(26,model.data.length-8) }}}
66
+ </td>
67
+ </tr>
68
+
69
+ </table>
70
+ {{{ $parent.reportStr }}}
71
+ </div>
72
+ </criteria-paged>
73
+ <modal :show.sync="show" v-ref:modal small backdrop="false">
74
+ <header slot="modal-header" class="modal-header">
75
+ <h4 class="modal-title">输入文件名称</h4>
76
+ </header>
77
+ <article slot="modal-body" class="modal-body">
78
+ <div class="form-group">
79
+ <input type="text" class="form-control" v-model="filename" placeholder='保存的文件名'>
80
+ </div>
81
+ </article>
82
+ <footer slot="modal-footer" class="modal-footer">
83
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
84
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button>
85
+ </footer>
86
+ </modal>
87
+
88
+ </div>
89
+ </template>
90
+ <script>
91
+ import { DataModel } from 'vue-client'
92
+ import co from 'co'
93
+ let saveFile = function * (self) {
94
+ // 线验证文件是否重名
95
+ let count = yield self.$resetpost('rs/sql/manageSingleTable',
96
+ {data: {tablename: 't_report_record', condition: `f_files_name = '${self.filename}'`}},
97
+ {resolveMsg: null, rejectMsg: null})
98
+ if (count.data.length > 0) {
99
+ self.$showAlert('无法保存,文件名重名', 'warning', 3000)
100
+ return
101
+ }
102
+ let saveBack = yield self.$resetpost('rs/logic/saveReport', {f_files_content: self.$refs.paged.$els.handcollect.innerHTML,
103
+ f_files_name: self.filename, f_files_type: self.data.f_report_type, f_component_name: 'manage-user-collect',
104
+ f_operator: this.$login.f.name, f_query_month: `${self.model.model.startDate}-${self.model.model.endDate}`,
105
+ f_outlets: this.$login.f.f_parentname})
106
+ if (saveBack.data.status === 'succeed') {
107
+ self.show = false
108
+ self.filename = ''
109
+ // 后台保存完成,通知刷新
110
+ self.$dispatch('save-success', self.filename)
111
+ }
112
+ }
113
+ export default {
114
+ title: '用户统计报表',
115
+ props: ['data'],
116
+ data () {
117
+ return {
118
+ model: new DataModel('rs/report/manger_user_report', {startDate: 'this.model.startDate', endDate: 'this.model.endDate',
119
+ filialeCodeStr: 'this.model.filialeCodeStr', filiale: 'this.model.filiale'}),
120
+ reportStr: null,
121
+ show: false,
122
+ printTime: this.$login.toStandardTimeString(),
123
+ filename: '',
124
+ filialeNameStr: this.$login.f.orgpathnames,
125
+ filialeCodeStr: this.$login.f.orgpathstr,
126
+ userid: this.$login.f.id,
127
+ source: `tool.getFullTree(this.getRights().where(row.getType() != $zone$).where(row.getType() != $role$))`
128
+ }
129
+ },
130
+ ready () {
131
+ if (this.data) {
132
+ this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStandardDateString()
133
+ this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStandardDateString()
134
+ this.$refs.paged.$refs.criteria.model.filiale = this.$login.f.f_fengongsi
135
+ }
136
+ this.$refs.paged.$refs.criteria.search()
137
+ },
138
+ methods: {
139
+ selfSearch (args) {
140
+ this.$refs.paged.$refs.criteria.model.filialeCodeStr = this.filialeCodeStr
141
+ this.$refs.paged.search(args)
142
+ },
143
+ getRes(obj) {
144
+ console.log(obj, '组织')
145
+ this.filialeNameStr = obj.res
146
+ this.filialeCodeStr = obj.resids
147
+ },
148
+ // 根据文件路径获取储存的报表内容
149
+ getFileContent (path) {
150
+ this.$resetpost('rs/logic/getReportFileContent', {f_files_path: path}, {resolveMsg: null, rejectMsg: null}).then((res) => {
151
+ this.reportStr = res.data.filecontent
152
+ this.model.state = '正确'
153
+ })
154
+ },
155
+ confirm () {
156
+ if (!this.filename || this.filename === '') {
157
+ this.$showAlert('无法保存,文件名不能为空', 'warning', 3000)
158
+ }
159
+ let saveGen = saveFile(this)
160
+ co(saveGen)
161
+ },
162
+ close () {
163
+ this.show = false
164
+ },
165
+ // 将报表保存成文件
166
+ confirmReport () {
167
+ this.show = true
168
+ this.filename = this.data.f_report_name + this.$login.toStandardDateString()
169
+ }
170
+ },
171
+ watch: {
172
+ 'data' (val) {
173
+ if (val.f_files_path) {
174
+ this.getFileContent(val.f_files_path)
175
+ } else {
176
+ this.reportStr = null
177
+ }
178
+ }
179
+ },
180
+ computed: {
181
+ }
182
+ }
183
+ </script>