manage-client 3.2.94 → 3.2.96

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,177 +1,176 @@
1
- var express = require('express')
2
- var webpack = require('webpack')
3
- var config = require('./webpack.dev.conf')
4
- var proxyMiddleware = require('http-proxy-middleware')
5
- // var httpProxy = require('http-proxy')
6
-
7
- var app = express()
8
- var compiler = webpack(config)
9
- // var proxy = httpProxy.createProxyServer()
10
-
11
- // Define HTTP proxies to your custom API backend
12
- // https://github.com/chimurai/http-proxy-middleware
13
- // var bendi = 'http://127.0.0.1:8089/manage', fuwu = 'http://36.103.224.217:6300/'
14
- var shaoguan='http://119.146.1.106:8300/'
15
- var qtx='http://36.103.222.144:6300/'
16
- //var bendi = 'http://127.0.0.1:8081'
17
- //var bendi = 'http://172.168.1.11:9001'
18
- var bendi = 'http://127.0.0.1:8081/'
19
- var fuwu = 'http://192.168.50.4:8400'
20
- // var fuwu = 'http://172.168.1.11:9001'
21
- var system = 'http://192.168.50.4:8400'
22
- //192.168.
23
- // var str = 'http://127.0.0.1:8080/manage', str2 = 'http://192.168.50.199:8300'
24
- // var str = 'http://192.168.10.233:8300', str2 = 'http://192.168.10.14:8300'
25
- var proxyTable = {
26
- '/rs/logic/exportfile': {
27
- target: fuwu
28
- },
29
- '/files': {
30
- target: fuwu
31
- },
32
- // 查找资源服务数据
33
- '/rs/search': {
34
- target: fuwu
35
- },
36
- // 查找资源服务数据
37
- '/rs/logic/getLogin': {
38
- target: fuwu
39
- },
40
- // 查找资源服务数据
41
- '/rs/logic/getInitData': {
42
- target: fuwu
43
- },
44
- '/rs/logic/getSaleInitData':{
45
- target: fuwu
46
- },
47
- // 用户登录服务地址
48
- '/rs/user': {
49
- target: fuwu
50
- },
51
- '/rs/path/getParams': {
52
- target: fuwu
53
- },
54
- '/rs/data': {
55
- target: fuwu
56
- },
57
- '/rs/license': {
58
- target: fuwu
59
- },
60
- '/rs/db': {
61
- target: fuwu
62
- },
63
- '/excel': {
64
- target: fuwu
65
- },
66
- '/rs/config': {
67
- target: fuwu
68
- },
69
- '/rs/sql/getLicenseById': {
70
- target: fuwu
71
- },
72
- '/rs/report': {
73
- target: bendi
74
- },
75
- '/rs/vue': {
76
- target: fuwu
77
- },
78
- '/rs/file': {
79
- target: bendi
80
- },
81
- '/rs/logic/SumSettleFileImport': {
82
- target: 'http://127.0.0.1:8080'
83
- },
84
- '/rs': {
85
- target: bendi
86
- }
87
- }
88
-
89
- var devMiddleware = require('webpack-dev-middleware')(compiler, {
90
- publicPath: config.output.publicPath,
91
- stats: {
92
- colors: true,
93
- chunks: false
94
- }
95
- })
96
-
97
- var hotMiddleware = require('webpack-hot-middleware')(compiler)
98
- // force page reload when html-webpack-plugin template changes
99
- compiler.plugin('compilation', function (compilation) {
100
- compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
101
- hotMiddleware.publish({action: 'reload'})
102
- cb()
103
- })
104
- })
105
-
106
- // proxy api requests
107
- Object.keys(proxyTable).forEach(function (context) {
108
- var options = proxyTable[context]
109
- if (typeof options === 'string') {
110
- options = {target: options}
111
- }
112
- app.use(proxyMiddleware(context, options))
113
- })
114
-
115
- // handle fallback for HTML5 history API
116
- app.use(require('connect-history-api-fallback')())
117
- // app.use(function (req, res, next) {
118
- // res.header('Access-Control-Allow-Origin', '*')
119
- // res.header('Access-Control-Allow-Headers', 'X-Requested-With')
120
- // res.header('Access-Control-Allow-Methods', 'PUT, POST, GET,DELETE, OPTIONS')
121
- // res.header('X-Powered-By', '3,2,1')
122
- // res.header('Access-Control-Allow-Credentials', 'true')
123
- // res.header('Content-Type', 'application/json;charset=utf-8')
124
- // next()
125
- // })
126
-
127
- // serve webpack bundle output
128
- app.use(devMiddleware)
129
-
130
- // enable hot-reload and state-preserving
131
- // compilation error display
132
- app.use(hotMiddleware)
133
-
134
- // serve pure static assets
135
- app.use('/static', express.static('./static'))
136
-
137
- // app.all('/rs/*', function (req, res) {
138
- // proxy.web(req, res, {
139
- // target: 'http://127.0.0.1:8081/reports'
140
- // })
141
- // })
142
-
143
- // app.all('/rs/*', function (req, res) {
144
- // proxy.web(req, res, {
145
- // target: 'http://127.0.0.1:8081/ldap'
146
- // })
147
- // })
148
- // app.all('/excel/*', function (req, res) {
149
- // proxy.web(req, res, {
150
- // target: 'http://127.0.0.1:8081/charge'
151
- // })
152
- // })
153
-
154
- // app.all('/rs/*', function (req, res) {
155
- // proxy.web(req, res, {
156
- // target: 'http://127.0.0.1:82/charge'
157
- // })
158
- // })
159
-
160
- // app.all('/*', function (req, res) {
161
- // proxy.web(req, res, {
162
- // target: 'http://127.0.0.1:82'
163
- // })
164
- // })
165
- // app.all('/rs/user', function (req, res) {
166
- // proxy.web(req, res, {
167
- // target: 'http://127.0.0.1:82'
168
- // })
169
- // })
170
-
171
- module.exports = app.listen(8085, function (err) {
172
- if (err) {
173
- console.log(err)
174
- return
175
- }
176
- console.log('Listening at http://localhost:8085')
177
- })
1
+ var express = require('express')
2
+ var webpack = require('webpack')
3
+ var config = require('./webpack.dev.conf')
4
+ var proxyMiddleware = require('http-proxy-middleware')
5
+ // var httpProxy = require('http-proxy')
6
+
7
+ var app = express()
8
+ var compiler = webpack(config)
9
+ // var proxy = httpProxy.createProxyServer()
10
+
11
+ // Define HTTP proxies to your custom API backend
12
+ // https://github.com/chimurai/http-proxy-middleware
13
+ // var bendi = 'http://127.0.0.1:8089/manage', fuwu = 'http://36.103.224.217:6300/'
14
+ var shaoguan='http://119.146.1.106:8300/'
15
+ var qtx='http://36.103.222.144:6300/'
16
+ var bendi = 'http://localhost:8090/'
17
+ // var bendi = 'http://172.168.1.11:9001'
18
+ var fuwu = 'http://192.168.50.4:8400'
19
+ // var fuwu = 'http://172.168.1.11:9001'
20
+ var system = 'http://192.168.50.4:8400'
21
+ //192.168.
22
+ // var str = 'http://127.0.0.1:8080/manage', str2 = 'http://192.168.50.199:8300'
23
+ // var str = 'http://192.168.10.233:8300', str2 = 'http://192.168.10.14:8300'
24
+ var proxyTable = {
25
+ '/rs/logic/exportfile': {
26
+ target: fuwu
27
+ },
28
+ '/files': {
29
+ target: fuwu
30
+ },
31
+ // 查找资源服务数据
32
+ '/rs/search': {
33
+ target: fuwu
34
+ },
35
+ // 查找资源服务数据
36
+ '/rs/logic/getLogin': {
37
+ target: fuwu
38
+ },
39
+ // 查找资源服务数据
40
+ '/rs/logic/getInitData': {
41
+ target: fuwu
42
+ },
43
+ '/rs/logic/getSaleInitData':{
44
+ target: fuwu
45
+ },
46
+ // 用户登录服务地址
47
+ '/rs/user': {
48
+ target: fuwu
49
+ },
50
+ '/rs/path/getParams': {
51
+ target: fuwu
52
+ },
53
+ '/rs/data': {
54
+ target: fuwu
55
+ },
56
+ '/rs/license': {
57
+ target: fuwu
58
+ },
59
+ '/rs/db': {
60
+ target: fuwu
61
+ },
62
+ '/excel': {
63
+ target: fuwu
64
+ },
65
+ '/rs/config': {
66
+ target: fuwu
67
+ },
68
+ '/rs/sql/getLicenseById': {
69
+ target: fuwu
70
+ },
71
+ '/rs/report': {
72
+ target: bendi
73
+ },
74
+ '/rs/vue': {
75
+ target: fuwu
76
+ },
77
+ '/rs/file': {
78
+ target: bendi
79
+ },
80
+ '/rs/logic/SumSettleFileImport': {
81
+ target: 'http://127.0.0.1:8080'
82
+ },
83
+ '/rs': {
84
+ target: bendi
85
+ }
86
+ }
87
+
88
+ var devMiddleware = require('webpack-dev-middleware')(compiler, {
89
+ publicPath: config.output.publicPath,
90
+ stats: {
91
+ colors: true,
92
+ chunks: false
93
+ }
94
+ })
95
+
96
+ var hotMiddleware = require('webpack-hot-middleware')(compiler)
97
+ // force page reload when html-webpack-plugin template changes
98
+ compiler.plugin('compilation', function (compilation) {
99
+ compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
100
+ hotMiddleware.publish({action: 'reload'})
101
+ cb()
102
+ })
103
+ })
104
+
105
+ // proxy api requests
106
+ Object.keys(proxyTable).forEach(function (context) {
107
+ var options = proxyTable[context]
108
+ if (typeof options === 'string') {
109
+ options = {target: options}
110
+ }
111
+ app.use(proxyMiddleware(context, options))
112
+ })
113
+
114
+ // handle fallback for HTML5 history API
115
+ app.use(require('connect-history-api-fallback')())
116
+ // app.use(function (req, res, next) {
117
+ // res.header('Access-Control-Allow-Origin', '*')
118
+ // res.header('Access-Control-Allow-Headers', 'X-Requested-With')
119
+ // res.header('Access-Control-Allow-Methods', 'PUT, POST, GET,DELETE, OPTIONS')
120
+ // res.header('X-Powered-By', '3,2,1')
121
+ // res.header('Access-Control-Allow-Credentials', 'true')
122
+ // res.header('Content-Type', 'application/json;charset=utf-8')
123
+ // next()
124
+ // })
125
+
126
+ // serve webpack bundle output
127
+ app.use(devMiddleware)
128
+
129
+ // enable hot-reload and state-preserving
130
+ // compilation error display
131
+ app.use(hotMiddleware)
132
+
133
+ // serve pure static assets
134
+ app.use('/static', express.static('./static'))
135
+
136
+ // app.all('/rs/*', function (req, res) {
137
+ // proxy.web(req, res, {
138
+ // target: 'http://127.0.0.1:8081/reports'
139
+ // })
140
+ // })
141
+
142
+ // app.all('/rs/*', function (req, res) {
143
+ // proxy.web(req, res, {
144
+ // target: 'http://127.0.0.1:8081/ldap'
145
+ // })
146
+ // })
147
+ // app.all('/excel/*', function (req, res) {
148
+ // proxy.web(req, res, {
149
+ // target: 'http://127.0.0.1:8081/charge'
150
+ // })
151
+ // })
152
+
153
+ // app.all('/rs/*', function (req, res) {
154
+ // proxy.web(req, res, {
155
+ // target: 'http://127.0.0.1:82/charge'
156
+ // })
157
+ // })
158
+
159
+ // app.all('/*', function (req, res) {
160
+ // proxy.web(req, res, {
161
+ // target: 'http://127.0.0.1:82'
162
+ // })
163
+ // })
164
+ // app.all('/rs/user', function (req, res) {
165
+ // proxy.web(req, res, {
166
+ // target: 'http://127.0.0.1:82'
167
+ // })
168
+ // })
169
+
170
+ module.exports = app.listen(8085, function (err) {
171
+ if (err) {
172
+ console.log(err)
173
+ return
174
+ }
175
+ console.log('Listening at http://localhost:8085')
176
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "manage-client",
3
- "version": "3.2.94",
3
+ "version": "3.2.96",
4
4
  "description": "经营管控模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -0,0 +1,268 @@
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="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
+ <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
+
51
+ </div>
52
+ <div class="span" style = "float:right;">
53
+ <button class="button_search" @click="$parent.$parent.searchData()">查询</button>
54
+ <report-print id='gasprice' top='3cm' left='0' width='100%' height='100%' :preview="true"></report-print>
55
+ <report-excel id='gasprice'></report-excel>
56
+ </div>
57
+ </div>
58
+ </criteria>
59
+ <div partial='list' v-el:handcollect id='gasprice' style="overflow-y: scroll">
60
+ <table class='tableprint' style="margin: 0px auto" v-if="!$parent.data.f_files_path">
61
+ <thead>
62
+ <tr>
63
+ <th colspan='9' style="font-weight: normal; text-align: left;">
64
+ <h3 style="text-align: center">收费类型报表</h3>
65
+ </th>
66
+ </tr>
67
+ <tr>
68
+ <th colspan='9' style="font-weight: normal; text-align: center;">
69
+ 开始时间:{{model.model.startDate}}<br>
70
+ 结束时间:{{ model.model.endDate }}<br>
71
+ 打印时间:{{{$parent.printTime}}}
72
+ </th>
73
+ </tr>
74
+ <tr>
75
+ <th colspan='9' style="font-weight: normal; text-align: center;">
76
+ <div>
77
+ <span v-show="$parent.orgname.trim()!=''">公司:{{$parent.orgname}}</span>
78
+ <span v-show="$parent.depname.trim()!=''"> 部门:{{$parent.depname}}</span>
79
+ <span v-show="$parent.operatorname.trim()!=''">人员:{{$parent.operatorname}}</span>
80
+ </div>
81
+ </th>
82
+ </tr>
83
+ </thead>
84
+ <tr>
85
+ <td colspan='9'>
86
+ {{{ model.data.substring(26,model.data.length-8) }}}
87
+ </td>
88
+ </tr>
89
+ <tfoot>
90
+ <tr style="text-align: left">
91
+ <th colspan='3'>财务审核:</th>
92
+ <th colspan='3'>收款审核:</th>
93
+ <th colspan='3'>收款员:</th>
94
+ </tr>
95
+ </tfoot>
96
+ </table>
97
+ {{{ $parent.reportStr}}}
98
+ </div>
99
+ </criteria-paged>
100
+ <modal :show.sync="show" v-ref:modal small backdrop="false">
101
+ <header slot="modal-header" class="modal-header">
102
+ <h4 class="modal-title">输入文件名称</h4>
103
+ </header>
104
+ <article slot="modal-body" class="modal-body">
105
+ <div class="form-group">
106
+ <input type="text" class="form-control" v-model="filename" placeholder='保存的文件名'>
107
+ </div>
108
+ </article>
109
+ <footer slot="modal-footer" class="modal-footer">
110
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
111
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button>
112
+ </footer>
113
+ </modal>
114
+ </div>
115
+ </template>
116
+
117
+ <script>
118
+ import { DataModel } from 'vue-client'
119
+ import co from 'co'
120
+ let saveFile = function * (self) {
121
+ // 线验证文件是否重名
122
+ let count = yield self.$resetpost('rs/sql/manageSingleTable',
123
+ {data: {tablename: 't_report_record', condition: `f_files_name = '${self.filename}'`}},
124
+ {resolveMsg: null, rejectMsg: null})
125
+ if (count.data.length > 0) {
126
+ self.$showAlert('无法保存,文件名重名', 'warning', 3000)
127
+ return
128
+ }
129
+ let saveBack = yield self.$resetpost('rs/logic/saveReport', {f_files_content: self.$refs.paged.$els.handcollect.innerHTML,
130
+ f_files_name: self.filename, f_files_type: self.data.f_report_type, f_component_name: 'manage-bus-summary',
131
+ f_operator: this.$login.f.name, f_query_month: `${self.model.model.startDate}-${self.model.model.endDate}`,
132
+ f_outlets: this.$login.f.depname})
133
+ if (saveBack.data.status === 'succeed') {
134
+ self.show = false
135
+ self.filename = ''
136
+ // 后台保存完成,通知刷新
137
+ self.$dispatch('save-success', self.filename)
138
+ }
139
+ }
140
+ export default {
141
+ title: '营业额统计',
142
+ props: ['data'],
143
+ data () {
144
+ return {
145
+ printTime: this.$login.toStandardTimeString(),
146
+ depresid: [],
147
+ userresid: [],
148
+ f_orgid: this.$login.f.orgid,
149
+ f_depid: this.$login.f.depids,
150
+ f_operatorid: this.$login.f.id,
151
+ operatorid: [],
152
+ depid: [],
153
+ orgname: '',
154
+ depname: '',
155
+ operatorname: '',
156
+ orgCondtionStr: '1=1',
157
+ model: new DataModel('rs/report/summaryes', {startDate: 'this.model.startDate', endDate: 'this.model.endDate',
158
+ f_orgid: 'this.model.f_orgid'}),
159
+ reportStr: null,
160
+ show: false,
161
+ }
162
+ },
163
+ ready () {
164
+ this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStandardDateString() + ' 00:00:00'
165
+ this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStandardDateString() + ' 23:59:59'
166
+ // this.$refs.paged.$refs.criteria.search()
167
+ console.log(this.$login.f)
168
+ },
169
+ methods: {
170
+ searchData () {
171
+ this.$refs.paged.$refs.criteria.search()
172
+ },
173
+ selfSearch (args) {
174
+ this.printTime = this.$login.toStandardTimeString()
175
+ console.log( "condition:" + args.condition)
176
+ let orgcondition = '1=1'
177
+ if (this.f_orgid[0]) {
178
+ orgcondition += ' and f_orgid in (' + this.f_orgid + ')'
179
+ }
180
+ let deps = ''
181
+ let i = 0
182
+ let depss = ''
183
+ if (this.f_depid[0]) {
184
+ for ( i; i< this.f_depid.length; i++ )
185
+ deps += `'${this.f_depid[i]}',`
186
+ depss = deps.toString().substring(1,deps.length-2)
187
+ orgcondition += " and f_depid in ( '" + depss + "' ) "
188
+ }else {
189
+ depss = ''
190
+ }
191
+ console.log("所选部门:" + depss)
192
+
193
+ let opes = ''
194
+ let j = 0
195
+ let opess = ''
196
+ if(this.f_operatorid[0]) {
197
+ for ( j; j< this.f_operatorid.length; j++ )
198
+ opes += `'${this.f_operatorid[j]}',`
199
+ opess = opes.toString().substring(1,opes.length-2)
200
+ orgcondition += "and f_operatorid in ( '" + opess + "' ) "
201
+ }else {
202
+ opess = ''
203
+ }
204
+ console.log("所选人员:" + opess)
205
+
206
+ this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition + " and " + args.condition
207
+ this.$refs.paged.search(args)
208
+ },
209
+ getRes (obj) {
210
+ this.orgname = obj.res[0]
211
+ this.depresid = obj.resids
212
+ this.f_orgid = obj.resids
213
+ this.userresid = obj.resids
214
+ },
215
+ getdep (obj, val) {
216
+ this.depname = val
217
+ // this.userresid = obj
218
+ this.f_depid = obj
219
+ },
220
+ getuser ( obj, val) {
221
+ this.operatorname = val
222
+ this.f_operatorid = obj
223
+ },
224
+
225
+ // 根据文件路径获取储存的报表内容
226
+ getFileContent (path) {
227
+ this.$resetpost('rs/logic/getReportFileContent', {f_files_path: path}, {resolveMsg: null, rejectMsg: null}).then((res) => {
228
+ this.reportStr = res.data.filecontent
229
+ this.model.state = '正确'
230
+ })
231
+ },
232
+ confirm () {
233
+ if (!this.filename || this.filename === '') {
234
+ this.$showAlert('无法保存,文件名不能为空', 'warning', 3000)
235
+ }
236
+ let saveGen = saveFile(this)
237
+ co(saveGen)
238
+ },
239
+ close () {
240
+ this.show = false
241
+ },
242
+ // 将报表保存成文件
243
+ confirmReport () {
244
+ this.show = true
245
+ this.filename = this.data.f_report_name + this.$login.toStandardDateString()
246
+ },
247
+ },
248
+ watch: {
249
+ 'data' (val) {
250
+ if (val.f_files_path) {
251
+ this.getFileContent(val.f_files_path)
252
+ } else {
253
+ this.reportStr = null
254
+ }
255
+ }
256
+ },
257
+ computed: {
258
+ metertypes() {
259
+ return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('气表类型')]
260
+ }
261
+ }
262
+ }
263
+ </script>
264
+ <style scoped>
265
+ .noborder{
266
+ border: none;
267
+ }
268
+ </style>