manage-client-xy 3.2.1 → 3.2.3

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,232 +1,232 @@
1
- <template>
2
- <button class="button_export button_spacing" @click="stamp()">打印</button>
3
- </template>
4
-
5
- <script>
6
- import getLodop from '../../../../../plugins/LodopFuncs'
7
- import {PagedList} from "vue-client";
8
-
9
- export default {
10
- name: "MonthByUserPrint",
11
- title: '月报(客户类型)打印',
12
- props: {
13
- countmodel:{
14
- type:Object,
15
- default:{}
16
- }
17
- },
18
- data() {
19
- return {
20
- modelval: [],
21
- fields: {},
22
- thead: '',
23
- tfoot: '',
24
- model:{},
25
- sumsmodel:{},
26
- orgname: '',
27
- depname: '0'
28
- }
29
- },
30
- methods: {
31
- stamp() {
32
- this.model = this.countmodel.model,
33
- this.sumsmodel = this.countmodel.sumsmodel,
34
- this.orgname = this.countmodel.orgname,
35
- this.depname = this.countmodel.depname
36
-
37
- //默认选择要打印的列
38
- this.modelval = [
39
- "f_operate_date","f_open_my","f_count_my","f_pregas_my","f_collection_my",
40
- "f_open_sy","f_count_sy","f_pregas_sy",
41
- "f_collection_sy","f_open_gy","f_count_gy","f_pregas_gy",
42
- "f_collection_gy","f_open","f_count","f_pregas","f_collection"
43
- ];
44
- this.fields = {
45
- "f_operate_date":"时间",
46
- "f_open_my":"民用开户","f_count_my":"民用人次","f_pregas_my":"民用气量","f_collection_my":"民用金额",
47
- "f_open_sy":"商业开户","f_count_sy":"商业人次","f_pregas_sy":"商业气量", "f_collection_sy":"商业金额",
48
- "f_open_gy":"工业开户","f_count_gy":"工业人次","f_pregas_gy":"工业气量","f_collection_gy":"工业金额",
49
- "f_open":"合计开户","f_count":"合计人次","f_pregas":"合计气量", "f_collection":"合计金额"
50
- }
51
- this.put();
52
- this.print();
53
- },
54
- put() {
55
-
56
- let statisticalMonth = ''
57
-
58
- if (this.model.model.f_begin_operate_date && this.model.model.f_end_operate_date) {
59
- statisticalMonth = this.model.model.f_end_operate_date.substring(0, 7)
60
- } else {
61
- statisticalMonth = this.model.model.YeanMouthDate
62
- }
63
- this.thead = `
64
- <tr>
65
- <th class="biaoti" colspan=${this.modelval.length} style="font-size: 6mm">
66
- ${this.orgname}${this.depname ? this.depname : ''}统计报表 ${this.model.model.f_gasproperties ? this.model.model.f_gasproperties : ''}
67
- </th>
68
- </tr>
69
- <tr>
70
- <th class="biaoti" colspan=${this.modelval.length}>统计月份:${statisticalMonth}</th></tr>
71
- <tr>
72
- <tr>
73
- <th class="biaoti" colspan=${this.modelval.length}>制单人:${this.$login.f.name} 打印时间: ${this.$login.toStandardTimeString()}</th></tr>
74
- `
75
-
76
- this.thead += '<tr>';
77
- for (let key of this.modelval) {
78
- if (this.fields[key] == '客户姓名') {
79
- this.thead += '<th class="khxm">' + this.fields[key] + '</th>'
80
- } else if (this.fields[key] == '备注') {
81
- this.thead += '<th class="bz">' + this.fields[key] + '</th>'
82
- } else {
83
- this.thead += '<th class="other">' + this.fields[key] + '</th>'
84
- }
85
- }
86
- this.thead += '</tr>'
87
- },
88
- async print() {
89
- // 开始打印
90
- let lodop = getLodop()
91
- lodop.PRINT_INIT('打印')
92
-
93
- // 是否横向打印(是)
94
-
95
- let isHeng = 2
96
- lodop.SET_PRINT_PAGESIZE(isHeng, 0, 0, "A4");
97
-
98
- // 定义样式
99
- let style;
100
- if (isHeng == 2) {//横向打印
101
- style = '' +
102
- '<style>table {border-collapse: collapse;font-size:2.8mm} ' +
103
- 'table th {border-collapse: collapse;width: 264mm;border: 0.2mm solid black} ' +
104
- 'table td {border-collapse: collapse;text-align: center;border: 0.2mm solid black} ' +
105
- '.biaoti {border-color: transparent} ' +
106
- 'table span {width: 36mm;text-align: left;display:inline-block}' +
107
- '.comments {text-overflow: ellipsis;overflow: hidden} ' +
108
- '.khxm {border-top: 0;width: 44.88mm} ' +
109
- '.bz {border-top: 0;width: 34.32mm} ' +
110
- '.other {border-top: 0;width: 18.48mm}</style>'
111
- } else {
112
- // 定义样式
113
- style = '<style>table {border-collapse: collapse;font-size:2.2mm}' +
114
- 'table th {border-collapse: collapse;width: 180mm;border: 0.2mm solid black;}' +
115
- 'table td {border-collapse: collapse;text-align: center;border: 0.2mm solid black} ' +
116
- '.biaoti {border-color: transparent} ' +
117
- 'table span {width: 25mm;text-align:left;display:inline-block;}' +
118
- '.comments {text-overflow: ellipsis;overflow: hidden} ' +
119
- '.khxm {border-top: 0;width: 14.4mm} ' +
120
- '.bz {border-top: 0;width: 21.6mm} ' +
121
- '.other {border-top: 0;width: 14.4mm}</style>'
122
- }
123
-
124
-
125
- let tHtml = style + '<table><thead>' + this.thead + '</thead><tbody>'
126
- for (var i = 1; i <= this.model.totalPage; i++) {
127
- await this.model.loadPage(i)
128
- for (let j = 0; j < this.model.rows.length; j++) {
129
- tHtml += '<tr>'
130
- for (let field of this.modelval) {
131
- if (field && this.model.rows[j]) {
132
- if (field === 'f_comments' && this.model.rows[j][field]) {
133
- tHtml += '<td class="comments">' +
134
- this.model.rows[j][field].substring(0, 10)
135
- + '</td>'
136
- } else {
137
- tHtml += '<td>' + this.model.rows[j][field] + '</td>'
138
- }
139
- }
140
- }
141
- tHtml += '</tr>'
142
- }
143
- }
144
- this.tfoot = `
145
- <tr>
146
- <td class="defaulttd" colspan='1' >
147
- 合计
148
- </td>
149
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
150
- <font color="#0000FF" tindex="2">###户</font>
151
- </td>
152
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
153
- <font color="#0000FF" tindex="3">###人</font>
154
- </td>
155
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
156
- <font color="#0000FF" tindex="4">###方</font>
157
- </td>
158
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
159
- <font color="#0000FF" tindex="5">###元</font>
160
- </td>
161
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
162
- <font color="#0000FF" tindex="6">###户</font>
163
- </td>
164
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
165
- <font color="#0000FF" tindex="7">###人</font>
166
- </td>
167
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
168
- <font color="#0000FF" tindex="8">###方</font>
169
- </td>
170
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
171
- <font color="#0000FF" tindex="9">###元</font>
172
- </td>
173
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
174
- <font color="#0000FF" tindex="10">###户</font>
175
- </td>
176
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
177
- <font color="#0000FF" tindex="11">###人</font>
178
- </td>
179
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
180
- <font color="#0000FF" tindex="12">###方</font>
181
- </td>
182
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
183
- <font color="#0000FF" tindex="13">###元</font>
184
- </td>
185
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
186
- <font color="#0000FF" tindex="14">###户</font>
187
- </td>
188
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
189
- <font color="#0000FF" tindex="15">###人</font>
190
- </td>
191
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
192
- <font color="#0000FF" tindex="16">###方</font>
193
- </td>
194
- <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
195
- <font color="#0000FF" tindex="17">###元</font>
196
- </td>
197
- </tr>`
198
-
199
- // 如果有表尾,则添加表尾,如果内容翻页的话,表尾每一页都要打印
200
- tHtml += `</tbody><tfoot>${this.tfoot}</tfoot></table>`
201
- //ADD_PRINT_TABLE(intTop,intLeft,intWidth,intHeight,strHtml)增加表格项
202
- if (isHeng == 2) {//横向打印
203
- lodop.ADD_PRINT_TABLE(0, 0, "264mm", 'BottomMargin:' + 30, tHtml);//增加表格项
204
- } else {
205
- lodop.ADD_PRINT_TABLE(0, 0, "200mm", 'BottomMargin:' + 30, tHtml);//增加表格项
206
- }
207
- lodop.SET_PRINT_STYLEA(0, "Horient", 2);//打印项在纸张中水平居中
208
- // lodop.SET_PRINT_STYLEA(0,"Vorient",2);//打印项在纸张中垂直居中
209
- // lodop.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-width')
210
-
211
- // 设置页脚
212
- lodop.ADD_PRINT_HTM("96%", "45%", 100, 50, `<font color='#0000ff' format='##'><span tdata='pageNO'>第##页</span>/<span tdata='pageCount'>共##页</span></font>`);//增加超文本项
213
- lodop.SET_PRINT_STYLEA(0, "ItemType", 1);
214
- lodop.SET_PRINT_STYLEA(0, "Horient", 2);
215
-
216
- // lodop.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-width')
217
- // 设置打印方式 (横向|纵向)
218
- lodop.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1);
219
- // 打印维护
220
- // lodop.PRINT_SETUP()
221
- // 使用打印预览是为了方便调整打印格式。例如:横向打印
222
- lodop.PREVIEW()
223
- },
224
- }
225
-
226
-
227
- }
228
- </script>
229
-
230
- <style scoped>
231
-
232
- </style>
1
+ <template>
2
+ <button class="button_export button_spacing" @click="stamp()">打印</button>
3
+ </template>
4
+
5
+ <script>
6
+ import getLodop from '../../../../../plugins/LodopFuncs'
7
+ import {PagedList} from "vue-client";
8
+
9
+ export default {
10
+ name: "MonthByUserPrint",
11
+ title: '月报(客户类型)打印',
12
+ props: {
13
+ countmodel:{
14
+ type:Object,
15
+ default:{}
16
+ }
17
+ },
18
+ data() {
19
+ return {
20
+ modelval: [],
21
+ fields: {},
22
+ thead: '',
23
+ tfoot: '',
24
+ model:{},
25
+ sumsmodel:{},
26
+ orgname: '',
27
+ depname: '0'
28
+ }
29
+ },
30
+ methods: {
31
+ stamp() {
32
+ this.model = this.countmodel.model,
33
+ this.sumsmodel = this.countmodel.sumsmodel,
34
+ this.orgname = this.countmodel.orgname,
35
+ this.depname = this.countmodel.depname
36
+
37
+ //默认选择要打印的列
38
+ this.modelval = [
39
+ "f_operate_date","f_open_my","f_count_my","f_pregas_my","f_collection_my",
40
+ "f_open_sy","f_count_sy","f_pregas_sy",
41
+ "f_collection_sy","f_open_gy","f_count_gy","f_pregas_gy",
42
+ "f_collection_gy","f_open","f_count","f_pregas","f_collection"
43
+ ];
44
+ this.fields = {
45
+ "f_operate_date":"时间",
46
+ "f_open_my":"民用开户","f_count_my":"民用人次","f_pregas_my":"民用气量","f_collection_my":"民用金额",
47
+ "f_open_sy":"商业开户","f_count_sy":"商业人次","f_pregas_sy":"商业气量", "f_collection_sy":"商业金额",
48
+ "f_open_gy":"工业开户","f_count_gy":"工业人次","f_pregas_gy":"工业气量","f_collection_gy":"工业金额",
49
+ "f_open":"合计开户","f_count":"合计人次","f_pregas":"合计气量", "f_collection":"合计金额"
50
+ }
51
+ this.put();
52
+ this.print();
53
+ },
54
+ put() {
55
+
56
+ let statisticalMonth = ''
57
+
58
+ if (this.model.model.f_begin_operate_date && this.model.model.f_end_operate_date) {
59
+ statisticalMonth = this.model.model.f_end_operate_date.substring(0, 7)
60
+ } else {
61
+ statisticalMonth = this.model.model.YeanMouthDate
62
+ }
63
+ this.thead = `
64
+ <tr>
65
+ <th class="biaoti" colspan=${this.modelval.length} style="font-size: 6mm">
66
+ ${this.orgname}${this.depname ? this.depname : ''}统计报表 ${this.model.model.f_gasproperties ? this.model.model.f_gasproperties : ''}
67
+ </th>
68
+ </tr>
69
+ <tr>
70
+ <th class="biaoti" colspan=${this.modelval.length}>统计月份:${statisticalMonth}</th></tr>
71
+ <tr>
72
+ <tr>
73
+ <th class="biaoti" colspan=${this.modelval.length}>制单人:${this.$login.f.name} 打印时间: ${this.$login.toStandardTimeString()}</th></tr>
74
+ `
75
+
76
+ this.thead += '<tr>';
77
+ for (let key of this.modelval) {
78
+ if (this.fields[key] == '客户姓名') {
79
+ this.thead += '<th class="khxm">' + this.fields[key] + '</th>'
80
+ } else if (this.fields[key] == '备注') {
81
+ this.thead += '<th class="bz">' + this.fields[key] + '</th>'
82
+ } else {
83
+ this.thead += '<th class="other">' + this.fields[key] + '</th>'
84
+ }
85
+ }
86
+ this.thead += '</tr>'
87
+ },
88
+ async print() {
89
+ // 开始打印
90
+ let lodop = getLodop()
91
+ lodop.PRINT_INIT('打印')
92
+
93
+ // 是否横向打印(是)
94
+
95
+ let isHeng = 2
96
+ lodop.SET_PRINT_PAGESIZE(isHeng, 0, 0, "A4");
97
+
98
+ // 定义样式
99
+ let style;
100
+ if (isHeng == 2) {//横向打印
101
+ style = '' +
102
+ '<style>table {border-collapse: collapse;font-size:2.8mm} ' +
103
+ 'table th {border-collapse: collapse;width: 264mm;border: 0.2mm solid black} ' +
104
+ 'table td {border-collapse: collapse;text-align: center;border: 0.2mm solid black} ' +
105
+ '.biaoti {border-color: transparent} ' +
106
+ 'table span {width: 36mm;text-align: left;display:inline-block}' +
107
+ '.comments {text-overflow: ellipsis;overflow: hidden} ' +
108
+ '.khxm {border-top: 0;width: 44.88mm} ' +
109
+ '.bz {border-top: 0;width: 34.32mm} ' +
110
+ '.other {border-top: 0;width: 18.48mm}</style>'
111
+ } else {
112
+ // 定义样式
113
+ style = '<style>table {border-collapse: collapse;font-size:2.2mm}' +
114
+ 'table th {border-collapse: collapse;width: 180mm;border: 0.2mm solid black;}' +
115
+ 'table td {border-collapse: collapse;text-align: center;border: 0.2mm solid black} ' +
116
+ '.biaoti {border-color: transparent} ' +
117
+ 'table span {width: 25mm;text-align:left;display:inline-block;}' +
118
+ '.comments {text-overflow: ellipsis;overflow: hidden} ' +
119
+ '.khxm {border-top: 0;width: 14.4mm} ' +
120
+ '.bz {border-top: 0;width: 21.6mm} ' +
121
+ '.other {border-top: 0;width: 14.4mm}</style>'
122
+ }
123
+
124
+
125
+ let tHtml = style + '<table><thead>' + this.thead + '</thead><tbody>'
126
+ for (var i = 1; i <= this.model.totalPage; i++) {
127
+ await this.model.loadPage(i)
128
+ for (let j = 0; j < this.model.rows.length; j++) {
129
+ tHtml += '<tr>'
130
+ for (let field of this.modelval) {
131
+ if (field && this.model.rows[j]) {
132
+ if (field === 'f_comments' && this.model.rows[j][field]) {
133
+ tHtml += '<td class="comments">' +
134
+ this.model.rows[j][field].substring(0, 10)
135
+ + '</td>'
136
+ } else {
137
+ tHtml += '<td>' + this.model.rows[j][field] + '</td>'
138
+ }
139
+ }
140
+ }
141
+ tHtml += '</tr>'
142
+ }
143
+ }
144
+ this.tfoot = `
145
+ <tr>
146
+ <td class="defaulttd" colspan='1' >
147
+ 合计
148
+ </td>
149
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
150
+ <font color="#0000FF" tindex="2">###户</font>
151
+ </td>
152
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
153
+ <font color="#0000FF" tindex="3">###人</font>
154
+ </td>
155
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
156
+ <font color="#0000FF" tindex="4">###方</font>
157
+ </td>
158
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
159
+ <font color="#0000FF" tindex="5">###元</font>
160
+ </td>
161
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
162
+ <font color="#0000FF" tindex="6">###户</font>
163
+ </td>
164
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
165
+ <font color="#0000FF" tindex="7">###人</font>
166
+ </td>
167
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
168
+ <font color="#0000FF" tindex="8">###方</font>
169
+ </td>
170
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
171
+ <font color="#0000FF" tindex="9">###元</font>
172
+ </td>
173
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
174
+ <font color="#0000FF" tindex="10">###户</font>
175
+ </td>
176
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
177
+ <font color="#0000FF" tindex="11">###人</font>
178
+ </td>
179
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
180
+ <font color="#0000FF" tindex="12">###方</font>
181
+ </td>
182
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
183
+ <font color="#0000FF" tindex="13">###元</font>
184
+ </td>
185
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
186
+ <font color="#0000FF" tindex="14">###户</font>
187
+ </td>
188
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="right">
189
+ <font color="#0000FF" tindex="15">###人</font>
190
+ </td>
191
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
192
+ <font color="#0000FF" tindex="16">###方</font>
193
+ </td>
194
+ <td class="defaulttd" colspan='1' tdata="allSum" format="#,##0.00" align="left">
195
+ <font color="#0000FF" tindex="17">###元</font>
196
+ </td>
197
+ </tr>`
198
+
199
+ // 如果有表尾,则添加表尾,如果内容翻页的话,表尾每一页都要打印
200
+ tHtml += `</tbody><tfoot>${this.tfoot}</tfoot></table>`
201
+ //ADD_PRINT_TABLE(intTop,intLeft,intWidth,intHeight,strHtml)增加表格项
202
+ if (isHeng == 2) {//横向打印
203
+ lodop.ADD_PRINT_TABLE(0, 0, "264mm", 'BottomMargin:' + 30, tHtml);//增加表格项
204
+ } else {
205
+ lodop.ADD_PRINT_TABLE(0, 0, "200mm", 'BottomMargin:' + 30, tHtml);//增加表格项
206
+ }
207
+ lodop.SET_PRINT_STYLEA(0, "Horient", 2);//打印项在纸张中水平居中
208
+ // lodop.SET_PRINT_STYLEA(0,"Vorient",2);//打印项在纸张中垂直居中
209
+ // lodop.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-width')
210
+
211
+ // 设置页脚
212
+ lodop.ADD_PRINT_HTM("96%", "45%", 100, 50, `<font color='#0000ff' format='##'><span tdata='pageNO'>第##页</span>/<span tdata='pageCount'>共##页</span></font>`);//增加超文本项
213
+ lodop.SET_PRINT_STYLEA(0, "ItemType", 1);
214
+ lodop.SET_PRINT_STYLEA(0, "Horient", 2);
215
+
216
+ // lodop.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-width')
217
+ // 设置打印方式 (横向|纵向)
218
+ lodop.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1);
219
+ // 打印维护
220
+ // lodop.PRINT_SETUP()
221
+ // 使用打印预览是为了方便调整打印格式。例如:横向打印
222
+ lodop.PREVIEW()
223
+ },
224
+ }
225
+
226
+
227
+ }
228
+ </script>
229
+
230
+ <style scoped>
231
+
232
+ </style>