manage-client 4.0.32 → 4.0.34

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": "manage-client",
3
- "version": "4.0.32",
3
+ "version": "4.0.34",
4
4
  "description": "经营管控模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -0,0 +1,305 @@
1
+ <template>
2
+ <div class="basic-main" style="height: 98%">
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="$parent.$parent.startdate"
13
+ :value.sync="$parent.$parent.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="$parent.$parent.enddate"
23
+ :value.sync="$parent.$parent.enddate"
24
+ :disabled-days-of-Week="[]"
25
+ :format="'yyyy-MM-dd HH:mm:ss'"
26
+ :show-reset-button="reset">
27
+ </datepicker>
28
+ </div>
29
+ <div class="col-sm-4">
30
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;公司&nbsp;&nbsp;&nbsp; </label>
31
+ <right-tree @re-res="$parent.$parent.getRes"></right-tree>
32
+ </div>
33
+ <div class="col-sm-4">
34
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;部门&nbsp;&nbsp;&nbsp; </label>
35
+ <res-select restype='department'
36
+ @res-select="$parent.$parent.getdep"
37
+ :parentresid="$parent.$parent.depresid"
38
+ :initresid='$parent.$parent.depid'>
39
+ </res-select>
40
+
41
+ </div>
42
+ <div class="col-sm-4">
43
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;人员&nbsp;&nbsp;&nbsp; </label>
44
+ <res-select restype='user'
45
+ @res-select="$parent.$parent.getuser"
46
+ :parentresid="$parent.$parent.userresid"
47
+ :initresid='$parent.$parent.operatorid'>
48
+ </res-select>
49
+ </div>
50
+ </div>
51
+ <div class="span" style = "float:right;">
52
+ <button class="button_search" @click="$parent.$parent.searchData()">查询</button>
53
+ <report-print id='gasprice' top='1cm' left='2' width='100%' height='100%' :preview="true"></report-print>
54
+ <report-excel id='gasprice'></report-excel>
55
+ </div>
56
+ </div>
57
+ </criteria>
58
+ <div partial='list' v-el:handcollect id='gasprice' style="overflow-y: scroll">
59
+ <table class='tableprint' style="margin: 0px auto;border-spacing: 0px 0px;font-size:13px;" v-if="!$parent.data.f_files_path">
60
+ <thead>
61
+ <tr>
62
+ <th colspan='12' style="font-weight: normal; text-align: left;">
63
+ <h3 style="text-align: center">预售收入日报汇总表</h3>
64
+ </th>
65
+ </tr>
66
+ <tr>
67
+ <th colspan='12' style="font-weight: normal; text-align: left;">
68
+ <b style="text-align: left; font-size:15px;margin-left: 20px;" v-if="$parent.startDate==$parent.endDate">
69
+ {{$parent.startDate}}
70
+ </b>
71
+ <b style="text-align: left;font-size:15px;margin-left: 20px;" v-else>
72
+ {{$parent.startDate+" 至 "+$parent.endDate}}
73
+ </b>
74
+ </th>
75
+ </tr>
76
+ <tr>
77
+ <th colspan='12' style="font-weight: normal; text-align: center;">
78
+ <div style="text-align: left;font-size:15px;margin-left: 20px;">
79
+ <span v-show="$parent.orgFlag">{{$parent.orgname}}</span>
80
+ <span v-show="$parent.depFlag">{{$parent.depname}}</span>
81
+ <span v-show="$parent.operFlag">{{$parent.operatorname}}</span><br>
82
+ </div>
83
+ </th>
84
+ </tr>
85
+ </thead>
86
+ <tr>
87
+ <td colspan='12'>
88
+ {{{ model.data.substring(26,model.data.length-8) }}}
89
+ </td>
90
+ </tr>
91
+ <tfoot>
92
+ <tr style="text-align: left">
93
+ <th colspan='4'>部门主管:</th>
94
+ <th colspan='2'>出纳:</th>
95
+ <th colspan='2'>审核:</th>
96
+ <th colspan='4'>制表:</th>
97
+ </tr>
98
+ </tfoot>
99
+ </table>
100
+ {{{ $parent.reportStr}}}
101
+ </div>
102
+ </criteria-paged>
103
+ <modal :show.sync="show" v-ref:modal small backdrop="false">
104
+ <header slot="modal-header" class="modal-header">
105
+ <h4 class="modal-title">输入文件名称</h4>
106
+ </header>
107
+ <article slot="modal-body" class="modal-body">
108
+ <div class="form-group">
109
+ <input type="text" class="form-control" v-model="filename" placeholder='保存的文件名'>
110
+ </div>
111
+ </article>
112
+ <footer slot="modal-footer" class="modal-footer">
113
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
114
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button>
115
+ </footer>
116
+ </modal>
117
+ </div>
118
+ </template>
119
+
120
+ <script>
121
+ import { DataModel } from 'vue-client'
122
+ import co from 'co'
123
+ let saveFile = function * (self) {
124
+ // 线验证文件是否重名
125
+ let count = yield self.$resetpost('api/af-revenue/sql/manageSingleTable',
126
+ {data: {tablename: 't_report_record', condition: `f_files_name = '${self.filename}'`}},
127
+ {resolveMsg: null, rejectMsg: null})
128
+ if (count.data.length > 0) {
129
+ self.$showAlert('无法保存,文件名重名', 'warning', 3000)
130
+ return
131
+ }
132
+ let saveBack = yield self.$resetpost('api/af-revenue/logic/saveReport', {f_files_content: self.$refs.paged.$els.handcollect.innerHTML,
133
+ f_files_name: self.filename, f_files_type: self.data.f_report_type, f_component_name: 'manage-bus-summary',
134
+ f_operator: this.$login.f.name, f_query_month: `${self.model.model.startDate}-${self.model.model.endDate}`,
135
+ f_outlets: this.$login.f.depname})
136
+ if (saveBack.data.status === 'succeed') {
137
+ self.show = false
138
+ self.filename = ''
139
+ // 后台保存完成,通知刷新
140
+ self.$dispatch('save-success', self.filename)
141
+ }
142
+ }
143
+ export default {
144
+ title: '预售收入日报汇总表',
145
+ props: ['data'],
146
+ data () {
147
+ return {
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
+ orgCondtionStr: '1=1',
159
+ model: new DataModel('api/af-revenue/report/weinanbill', {startDate: 'this.model.startDate', endDate: 'this.model.endDate',
160
+ f_orgid: 'this.model.f_orgid'}),
161
+ reportStr: null,
162
+ show: false,
163
+ startDate: '',
164
+ endDate: '',
165
+ startdate: '',
166
+ enddate: '',
167
+ orgFlag: false,
168
+ depFlag: false,
169
+ operFlag: false,
170
+ }
171
+ },
172
+ ready () {
173
+ this.startdate = this.$login.toStandardDateString() + ' 00:00:00'
174
+ this.enddate = this.$login.toStandardDateString() + ' 23:59:59'
175
+ this.startDate = this.startdate.substring(0, 10)
176
+ this.endDate = this.startDate.substring(0, 10)
177
+ console.log(this.$login.f)
178
+ },
179
+ methods: {
180
+ appendCondition (data) {
181
+ console.log('data=====>', data)
182
+ let stringValue = ''
183
+ for (var i = 0; i < data.length; i++) {
184
+ if (data[i]) {
185
+ if (i === data.length - 1) {
186
+ stringValue = stringValue + "'" + data[i] + "'"
187
+ } else {
188
+ stringValue = stringValue + "'" + data[i] + "',"
189
+ }
190
+ }
191
+ }
192
+ return stringValue
193
+ },
194
+ searchData () {
195
+ this.$refs.paged.$refs.criteria.search()
196
+ },
197
+ selfSearch (args) {
198
+ let f_dep = this.f_depid
199
+ let orgcondition = ` ts.f_orgid in ('${this.f_orgid}')`
200
+ if (f_dep[0]) {
201
+ orgcondition += " and ts.f_depid in('" + f_dep[0] + "'"
202
+ for (let i = 1; i < f_dep.length; i++) {
203
+ orgcondition += ",'" + f_dep[i] + "'"
204
+ }
205
+ orgcondition += ')'
206
+ }
207
+ if (this.f_operatorid[0]) {
208
+ const operatorIds = this.f_operatorid.map(id => `'${id}'`).join(',')
209
+ orgcondition += ` and ts.f_operatorid in (${operatorIds})`
210
+ }
211
+ // console.log(this.orgname,this.depname.toString(),this.operatorname)
212
+ this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
213
+ this.$refs.paged.search(args)
214
+ },
215
+ getRes (obj) {
216
+ this.orgname = obj.res[0]
217
+ this.depresid = obj.resids
218
+ this.f_orgid = obj.resids
219
+ },
220
+ getdep (obj, val) {
221
+ this.depname = val
222
+ this.userresid = obj
223
+ this.f_depid = obj
224
+ },
225
+ getuser (obj, val) {
226
+ this.operatorname = val
227
+ this.f_operatorid = obj
228
+ },
229
+
230
+ // 根据文件路径获取储存的报表内容
231
+ getFileContent (path) {
232
+ this.$resetpost('api/af-revenue/logic/getReportFileContent', {f_files_path: path}, {resolveMsg: null, rejectMsg: null}).then((res) => {
233
+ this.reportStr = res.data.filecontent
234
+ this.model.state = '正确'
235
+ })
236
+ },
237
+ confirm () {
238
+ if (!this.filename || this.filename === '') {
239
+ this.$showAlert('无法保存,文件名不能为空', 'warning', 3000)
240
+ }
241
+ let saveGen = saveFile(this)
242
+ co(saveGen)
243
+ },
244
+ close () {
245
+ this.show = false
246
+ },
247
+ // 将报表保存成文件
248
+ confirmReport () {
249
+ this.show = true
250
+ this.filename = this.data.f_report_name + this.$login.toStandardDateString()
251
+ },
252
+ flag() {
253
+ const hasOrg = !!this.orgname;
254
+ const hasDep = Array.isArray(this.depname) && this.depname.length > 0
255
+ const hasOperator = Array.isArray(this.operatorname) && this.operatorname.length > 0
256
+
257
+ this.orgFlag = hasOrg && !hasDep && !hasOperator
258
+ this.depFlag = hasOrg && hasDep && !hasOperator
259
+ this.operFlag = hasOrg && hasDep && hasOperator
260
+ }
261
+
262
+ },
263
+ watch: {
264
+ 'data' (val) {
265
+ if (val.f_files_path) {
266
+ this.getFileContent(val.f_files_path)
267
+ } else {
268
+ this.reportStr = null
269
+ }
270
+ },
271
+ 'orgname'(){
272
+ this.flag()
273
+ },
274
+ 'depname'(){
275
+ this.flag()
276
+ },
277
+ 'operatorname'(){
278
+ this.flag()
279
+ },
280
+ 'startdate'(val){
281
+ this.$refs.paged.$refs.criteria.model.startDate=this.startdate
282
+ this.startDate=this.startdate.substring(0,10)
283
+ console.log('startdate',val)
284
+ },
285
+ 'enddate'(val){
286
+ this.$refs.paged.$refs.criteria.model.endDate=this.enddate
287
+ this.endDate=this.enddate.substring(0,10)
288
+ console.log('enddate',val)
289
+ }
290
+ },
291
+ computed: {
292
+ operator () {
293
+ return this.$getParams('操作员查询用', [{label: '全部', value: ''}])
294
+ },
295
+ network () {
296
+ return this.$getParams('网点查询用', [{label: '全部', value: ''}])
297
+ }
298
+ }
299
+ }
300
+ </script>
301
+ <style scoped>
302
+ .noborder{
303
+ border: none;
304
+ }
305
+ </style>
@@ -15,5 +15,9 @@ export default function () {
15
15
  Vue.component('manage-company-gas-detail', (resolve) => { require(['./ManageCompanyGasDetail'], resolve) })
16
16
  // 报表展示组件(用户新增销户统计报表)
17
17
  Vue.component('manage-user-count', (resolve) => { require(['./ManageUserCount'], resolve) })
18
+ // 预售收入日报
19
+ Vue.component('yu-shou-table', (resolve) => {
20
+ require(['./YuShouTable'], resolve)
21
+ })
18
22
  }
19
23