manage-client 3.3.234 → 3.3.236

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.
Files changed (206) hide show
  1. package/build/dev-server.js +190 -190
  2. package/gradle/wrapper/gradle-wrapper.properties +5 -5
  3. package/gradlew +234 -234
  4. package/gradlew.bat +89 -89
  5. package/hs_err_pid13052.log +206 -206
  6. package/package.json +111 -111
  7. package/src/components/SellReport/BusinessClassify.vue +382 -292
  8. package/src/components/SellReport/ChManageBusSummary.vue +273 -273
  9. package/src/components/SellReport/GasMoneyPublicConReport.vue +231 -231
  10. package/src/components/SellReport/ManageGasGroupSummary.vue +208 -208
  11. package/src/components/SellReport/ManageSellType.vue +267 -267
  12. package/src/components/SellReport/ReportItems.vue +312 -312
  13. package/src/components/SellReport/yangchun/YcBusSummaryes.vue +229 -229
  14. package/src/components/handReport/WebGastypeMonthReport.vue +190 -190
  15. package/src/components/sale/businessquery/AreaChargeQuery.vue +384 -384
  16. package/src/components/sale/businessquery/AreaGeneralQuery.vue +637 -637
  17. package/src/components/sale/businessquery/ArrearsQuery.vue +983 -983
  18. package/src/components/sale/businessquery/BalanceTable.vue +482 -482
  19. package/src/components/sale/businessquery/BusinessManage.vue +212 -212
  20. package/src/components/sale/businessquery/CancellationQuery.vue +428 -428
  21. package/src/components/sale/businessquery/CardHandplanQuery.vue +546 -546
  22. package/src/components/sale/businessquery/ChangeMeterQuery.vue +699 -699
  23. package/src/components/sale/businessquery/ChargeQuery.vue +1435 -1435
  24. package/src/components/sale/businessquery/CollectManage.vue +161 -161
  25. package/src/components/sale/businessquery/CommunityPaymen.vue +307 -307
  26. package/src/components/sale/businessquery/DisableQuery.vue +523 -523
  27. package/src/components/sale/businessquery/EnableQuery.vue +462 -462
  28. package/src/components/sale/businessquery/FMYGasQuery.vue +872 -872
  29. package/src/components/sale/businessquery/FillCardQuery.vue +573 -573
  30. package/src/components/sale/businessquery/FillGasQuery.vue +593 -593
  31. package/src/components/sale/businessquery/GroupChargeQuery.vue +492 -492
  32. package/src/components/sale/businessquery/HandBookQuery.vue +692 -692
  33. package/src/components/sale/businessquery/HandBookTwoQuery.vue +704 -704
  34. package/src/components/sale/businessquery/HandGasPropertiesQuery.vue +671 -671
  35. package/src/components/sale/businessquery/HandPeopleQuery.vue +719 -719
  36. package/src/components/sale/businessquery/HandRateQuery.vue +524 -524
  37. package/src/components/sale/businessquery/Handgasquery.vue +477 -477
  38. package/src/components/sale/businessquery/HandplanQuery.vue +1376 -1376
  39. package/src/components/sale/businessquery/MonthGasQuery.vue +482 -482
  40. package/src/components/sale/businessquery/NoBusinessQuery.vue +778 -778
  41. package/src/components/sale/businessquery/PlotSummaryQuery.vue +499 -499
  42. package/src/components/sale/businessquery/ProceedsOper.vue +415 -415
  43. package/src/components/sale/businessquery/ResidentialCardQuery.vue +377 -377
  44. package/src/components/sale/businessquery/ResidentialQuery.vue +415 -415
  45. package/src/components/sale/businessquery/SellOrgnameQuery.vue +680 -680
  46. package/src/components/sale/businessquery/SellPeopleQuery.vue +752 -752
  47. package/src/components/sale/businessquery/SellingHand.vue +421 -421
  48. package/src/components/sale/businessquery/TransferQuery.vue +502 -502
  49. package/src/components/sale/businessquery/UnhandBusiness.vue +328 -328
  50. package/src/components/sale/businessquery/UserSellHeadDetail.vue +579 -579
  51. package/src/components/sale/businessquery/WebHandplanQuery.vue +987 -987
  52. package/src/components/sale/businessquery/WebMeterMonthUserGasQuery.vue +471 -471
  53. package/src/components/sale/businessquery/YingShouMingXi.vue +524 -524
  54. package/src/components/sale/businessquery/YonghuJieyu.vue +358 -358
  55. package/src/components/sale/businessquery/chargeRecordMaintenanceQuery.vue +353 -353
  56. package/src/components/sale/businessquery/usergas.vue +315 -315
  57. package/src/components/sale/config/exportConfig.js +2763 -2763
  58. package/src/components/sale/config/tableConfig.js +59 -59
  59. package/src/components/sale/filesquery/FireQuery.vue +539 -539
  60. package/src/components/sale/filesquery/RecordInfoQuery.vue +1448 -1448
  61. package/src/components/sale/filesquery/UserQuery.vue +1002 -1002
  62. package/src/components/webmeter/DrillData/GetNoMetereadData.vue +423 -423
  63. package/src/components/webmeter/DrillData/LostContactAnalysisList.vue +739 -739
  64. package/src/components/webmeter/DrillData/UserLostContactAnalysis.vue +691 -691
  65. package/src/components/webmeter/WebmeterQuery.vue +77 -77
  66. package/src/components/webmeter/gasAnalysis/WebmeterSettlementAnalysis.vue +456 -456
  67. package/src/components/webmeter/gasStatistics/GasStatistics.vue +526 -526
  68. package/src/components/webmeter/gasStatistics/NewGasStatistics.vue +542 -542
  69. package/src/components/webmeter/instruction/NewQueryInstruct.vue +606 -606
  70. package/src/components/webmeter/newwebmeter/NewException/MeterExceptionList.vue +557 -557
  71. package/src/components/webmeter/newwebmeter/NewException/TotalExceptionByMeter.vue +1 -1
  72. package/src/components/webmeter/newwebmeter/WebhandMonthGas.vue +819 -819
  73. package/src/components/webmeter/recharge/RechargeList.vue +371 -371
  74. package/src/components/webmeter/report/ReportList.vue +453 -453
  75. package/src/components/webmeter/reportdata/ReportDataQuery.vue +339 -339
  76. package/src/filiale/WEINAN/InspectListGas.vue +616 -616
  77. package/src/filiale/WEINAN/ManageCompanyGasSummary.vue +555 -555
  78. package/src/filiale/WEINAN/ManageSummaryReport.vue +712 -712
  79. package/src/filiale/WEINAN/RecordInfoQuery.vue +1328 -1328
  80. package/src/filiale/WEINAN/businessquery/WallHangingFurnaceUserQuery.vue +418 -418
  81. package/src/filiale/ancheng/businessquery/FMYGasQuery.vue +853 -853
  82. package/src/filiale/ancheng/exportConfig.js +1112 -1112
  83. package/src/filiale/bayan/ChargeQuery.vue +1436 -1436
  84. package/src/filiale/bayan/PrintTableManage.vue +242 -242
  85. package/src/filiale/bayan/config/DefaultPrint.js +6 -6
  86. package/src/filiale/bayan/config/exportConfig.js +2642 -2642
  87. package/src/filiale/bayan/config/tableConfig.js +59 -59
  88. package/src/filiale/bayan/sale.js +8 -8
  89. package/src/filiale/bayan/webmeter/GetNoMetereadData.vue +425 -425
  90. package/src/filiale/bayan/webmeter/LostContactAnalysisList.vue +719 -719
  91. package/src/filiale/bayan/webmeter/MeterExceptionList.vue +591 -591
  92. package/src/filiale/bayan/webmeter/NewGasStatistics.vue +665 -665
  93. package/src/filiale/bayan/webmeter/NewQueryInstruct.vue +650 -650
  94. package/src/filiale/bayan/webmeter/NewWebmeterSettlementAnalysis.vue +464 -464
  95. package/src/filiale/bayan/webmeter/RechargeList.vue +430 -430
  96. package/src/filiale/bayan/webmeter/ReportDataQuery.vue +343 -343
  97. package/src/filiale/bayan/webmeter/ReportList.vue +555 -555
  98. package/src/filiale/bayan/webmeter/UserLostContactAnalysis.vue +674 -674
  99. package/src/filiale/bayan/webmeterManage.js +26 -26
  100. package/src/filiale/dingcheng/DefaultPrint.js +6 -6
  101. package/src/filiale/dingcheng/businessquery/ChangeMeterQuery.vue +798 -798
  102. package/src/filiale/dingcheng/exportConfig.js +2765 -2765
  103. package/src/filiale/dingcheng/sale.js +9 -9
  104. package/src/filiale/fugou/RecordInfoQuery.vue +1451 -0
  105. package/src/filiale/fugou/config/DefaultPrint.js +6 -0
  106. package/src/filiale/fugou/config/exportConfig.js +2761 -0
  107. package/src/filiale/fugou/config/tableConfig.js +59 -0
  108. package/src/filiale/fugou/sale.js +6 -0
  109. package/src/filiale/hantou/ChangeMeterQuery.vue +699 -699
  110. package/src/filiale/hantou/config/DefaultPrint.js +6 -6
  111. package/src/filiale/hantou/config/exportConfig.js +2667 -2667
  112. package/src/filiale/hantou/config/tableConfig.js +54 -54
  113. package/src/filiale/hantou/sale.js +8 -8
  114. package/src/filiale/jingwei/RecordInfoQuery.vue +1210 -1210
  115. package/src/filiale/jingwei/config/exportConfig.js +1106 -1106
  116. package/src/filiale/jingyang/ChargeQuery.vue +1464 -1464
  117. package/src/filiale/jingyang/RechargeList.vue +346 -346
  118. package/src/filiale/jingyang/config/DefaultPrint.js +6 -6
  119. package/src/filiale/jingyang/config/exportConfig.js +2776 -2776
  120. package/src/filiale/jingyang/config/tableConfig.js +58 -58
  121. package/src/filiale/jingyang/sale.js +8 -8
  122. package/src/filiale/kelai/AreaChargeQuery.vue +398 -398
  123. package/src/filiale/kelai/ChargeQuery.vue +1348 -1348
  124. package/src/filiale/kelai/GasStatistics.vue +561 -561
  125. package/src/filiale/kelai/NewAccountQuery.vue +417 -417
  126. package/src/filiale/kelai/NewGasStatistics.vue +556 -556
  127. package/src/filiale/kelai/feimin_style_kl.vue +400 -400
  128. package/src/filiale/kelai/reportManage.js +13 -13
  129. package/src/filiale/kelai/sale.js +17 -17
  130. package/src/filiale/liaoyuan/HandplanQuery.vue +1289 -1289
  131. package/src/filiale/lixianV3/RecordInfoQuery.vue +1474 -1474
  132. package/src/filiale/macheng/ArrearsQuery.vue +831 -831
  133. package/src/filiale/macheng/RecordInfoQuery.vue +1023 -1023
  134. package/src/filiale/macheng/config/exportConfig.js +79 -79
  135. package/src/filiale/meihekou/AreaGeneralQuery.vue +206 -206
  136. package/src/filiale/meihekou/CardHandplanQuery.vue +664 -664
  137. package/src/filiale/meihekou/ChargeQuery.vue +1274 -1274
  138. package/src/filiale/meihekou/CollectManage.vue +152 -152
  139. package/src/filiale/meihekou/HandplanQuery.vue +1248 -1248
  140. package/src/filiale/meihekou/OtherChargeQuery.vue +618 -618
  141. package/src/filiale/meihekou/UserSellHeadDetail.vue +516 -516
  142. package/src/filiale/meihekou/YingShouMingXi.vue +556 -556
  143. package/src/filiale/meihekou/config/exportConfig.js +829 -829
  144. package/src/filiale/meihekou/sale.js +39 -39
  145. package/src/filiale/ningjin/MeterExceptionList.vue +616 -616
  146. package/src/filiale/ningjin/UserLostContactAnalysis.vue +623 -623
  147. package/src/filiale/qianneng/RecordInfoQuery.vue +1369 -1369
  148. package/src/filiale/qianneng/WebmeterQuery.vue +70 -70
  149. package/src/filiale/qianneng/exportConfig.js +232 -232
  150. package/src/filiale/qingtongxia/ChargeQuery.vue +1209 -1209
  151. package/src/filiale/qingtongxia/config/exportConfig.js +712 -712
  152. package/src/filiale/rizhao/BusinessManage.vue +212 -212
  153. package/src/filiale/rizhao/sale.js +13 -13
  154. package/src/filiale/shangluo/HandplanQuery.vue +1376 -1376
  155. package/src/filiale/shangluo/sale.js +17 -17
  156. package/src/filiale/shangluo/webmeter/PriceInstructList.vue +303 -303
  157. package/src/filiale/shangluo/webmeter/UserInstructList.vue +304 -304
  158. package/src/filiale/shangluo/webmeter/WebmeterSettlementAnalysis.vue +432 -432
  159. package/src/filiale/shanxian/EchartsBox.vue +134 -134
  160. package/src/filiale/shaoguan/errorHandplanQuery.vue +386 -386
  161. package/src/filiale/shexian/ChangeMeterQuery.vue +797 -797
  162. package/src/filiale/taizhoukesi/ChangeMeterQuery.vue +683 -683
  163. package/src/filiale/taizhoukesi/NewGasStatistics.vue +539 -539
  164. package/src/filiale/taizhoukesi/config/exportConfig.js +2712 -2712
  165. package/src/filiale/taizhoukesi/sale.js +11 -11
  166. package/src/filiale/tongchuan/GasInspection.vue +716 -716
  167. package/src/filiale/tongchuan/InspectListGas.vue +700 -700
  168. package/src/filiale/tongchuan/MeterQuery.vue +1002 -1002
  169. package/src/filiale/tongchuan/ResSelectGroupNew.vue +188 -188
  170. package/src/filiale/tongchuan/config/exportConfig.js +858 -858
  171. package/src/filiale/wenxi/ChangeMeterQuery.vue +721 -721
  172. package/src/filiale/wenxi/ManageUserTypeSell.vue +173 -173
  173. package/src/filiale/wenxi/config/exportConfig.js +995 -995
  174. package/src/filiale/xinjiangdexin/ChargeQuery.vue +1435 -1435
  175. package/src/filiale/xinjiangdexin/config/exportConfig.js +2770 -2770
  176. package/src/filiale/xinjiangdexin/sale.js +7 -7
  177. package/src/filiale/yangchun/ChangeMeterQuery.vue +722 -722
  178. package/src/filiale/yangchun/ManageBusSummaryNew.vue +239 -239
  179. package/src/filiale/yangchun/OtherChargeDetailQuery.vue +74 -74
  180. package/src/filiale/yangchun/OtherChargeQuery.vue +755 -755
  181. package/src/filiale/yangchun/RecordInfoQuery.vue +1494 -1494
  182. package/src/filiale/yangchun/UserQuery.vue +980 -980
  183. package/src/filiale/yangchun/config/DefaultPrint.js +6 -6
  184. package/src/filiale/yangchun/config/exportConfig.js +1229 -1229
  185. package/src/filiale/yangchun/config/tableConfig.js +58 -58
  186. package/src/filiale/yangchun/reportManage.js +6 -6
  187. package/src/filiale/yangchun/sale.js +20 -20
  188. package/src/filiale/yangchun/webmeterManage.js +5 -5
  189. package/src/filiale/yuncheng/ChangeMeterQuery.vue +743 -743
  190. package/src/filiale/yuncheng/DeviceQuery.vue +611 -611
  191. package/src/filiale/yuncheng/GasInspection.vue +610 -610
  192. package/src/filiale/yuncheng/LostContactAnalysisList.vue +700 -700
  193. package/src/filiale/yuncheng/MeterQuery.vue +1017 -1017
  194. package/src/filiale/yuncheng/config/exportConfig.js +2681 -2681
  195. package/src/filiale/yuncheng/sale.js +23 -23
  196. package/src/filiale/zhongyi/ChargeQuery.vue +1454 -1454
  197. package/src/filiale/zhongyi/GasStatistics.vue +537 -537
  198. package/src/filiale/zhongyi/NewGasStatistics.vue +558 -558
  199. package/src/filiale/zhongyi/exportConfig.js +2556 -2556
  200. package/src/filiale/zhongyi/sale.js +33 -33
  201. package/src/filiale/zhongyi/webmeterManage.js +15 -15
  202. package/src/main.js +68 -68
  203. package/src/plugins/LodopFuncs.js +159 -159
  204. package/src/reportManage.js +777 -777
  205. package/src/saleManage.js +689 -689
  206. package/src/webmeterManage.js +130 -130
@@ -1,242 +1,242 @@
1
- <template>
2
- <button class="btn btn-default" @click='PrintAsFile()' :id="'vc-printtable-'+attach">打印表格</button>
3
- </template>
4
-
5
- <script>
6
- import co from 'co'
7
- import getLodop from '../../plugins/LodopFuncs'
8
-
9
- let printGen = function * (self, pageNo) {
10
-
11
- console.log('开始打印', self.isSelected, self.model, self.tfoot)
12
- //是否分页打印
13
- if(pageNo){
14
- self.PrintSinglePage()
15
- return
16
- }
17
- if (self.isSelected) {
18
- // 判断是否选择行数据进行打印
19
- self.PrintSelectedPage()
20
- return
21
- }
22
-
23
- let lodop = getLodop()
24
- lodop.PRINT_INIT(self.printName+'打印')
25
- var style
26
- if (!self.style) {
27
- style = `<style>table{font-size:${self.fontSize}px;border-width: 2px;border-collapse: collapse;border:solid 2px ; border-color:black;}` +
28
- 'table th {border-width: 1px;padding: 2px;border-style: solid;}table td {border-width: 1px;padding: 2px;border-style: solid;}</style>'
29
- } else {
30
- style = self.style
31
- }
32
- let tHtml = style + '<table class="table table-hover"><thead>' + self.thead + '</thead><tbody>'
33
-
34
- for (var i = 1; i <= self.model.totalPage; i++) {
35
- console.log('pageIndex = ' + i)
36
- yield self.model.loadPage(i)
37
- for (let row of self.model.rows) {
38
- tHtml += '<tr>'
39
- for (let field of self.fields) {
40
- if (field && (row[field] || row[field] === 0) ) {
41
- tHtml += '<td>' + row[field] + '</td>'
42
- } else {
43
- tHtml += '<td></td>'
44
- }
45
- // console.log(row[field])
46
- }
47
- tHtml += '</tr>'
48
- }
49
- }
50
- // 加入合计数据 (最后一页显示)
51
- if (self.sumhtml) {
52
- tHtml += self.sumhtml
53
- }
54
- // 如果有表尾,则添加表尾,如果内容翻页的话,表尾每一页都要打印
55
- if (self.tfoot) {
56
- self.tfoot += `<tr><td width="100%" colspan=${self.fields.length} style="text-align: center;border-width: 0;">第<font tdata="PageNO" format="#" color="blue">#</font>页</span>/共<font tdata="PageCount" format="#" color="blue">##</font></span>页</td></tr>`
57
- tHtml += `</tbody><tfoot>${self.tfoot}</tfoot></table>`
58
- } else {
59
- tHtml += '</tbody></table>'
60
- }
61
-
62
- lodop.ADD_PRINT_TABLE(self.top, self.left, 'RightMargin:' + self.right, 'BottomMargin:' + self.bottom, tHtml)
63
- lodop.SET_PRINT_STYLEA(0, 'HOrient', 3)
64
- lodop.SET_PRINT_STYLEA(0, 'VOrient', 3)
65
- // 指定打印方向 0--可通过打印机选择纵向或横向,1--锁定为纵向打印,2---锁定为横向打印
66
- LODOP.SET_PRINT_PAGESIZE(self.xyprint, 0, 0, "A4");
67
-
68
- if(self.printview==null){
69
- // 打印维护
70
- lodop.PRINT_SETUP()
71
- }else if(self.printview){
72
- // 使用打印预览是为了方便调整打印格式。例如:横向打印
73
- lodop.PREVIEW()
74
- }else if(!self.printview){
75
- // 直接打印
76
- lodop.PRINT()
77
- }
78
-
79
- }
80
-
81
- export default {
82
- // props: ['model', 'thead', 'fields', 'top', 'left', 'right', 'bottom', 'tfoot'],
83
- props: {
84
- model: Object,
85
- thead: String,
86
- tfoot: String,
87
- sumhtml: String,
88
- fields: Array,
89
- //null 打印维护, true 打印预览 false 直接打印
90
- printview:{},
91
- // 指定打印方向 0--可通过打印机选择纵向或横向,1--锁定为纵向打印,2---锁定为横向打印
92
- xyprint:{
93
- default : 0
94
- },
95
- top: {},
96
- left: {},
97
- right: {},
98
- bottom: {},
99
- attach: {
100
- type: String,
101
- default: 'name'
102
- },
103
- style: {
104
- type: String
105
- },
106
- isSelected: {
107
- type:Boolean,
108
- default:false
109
- },
110
- //是否分页打印
111
- printpage:{
112
- type:Boolean,
113
- default:false
114
- },
115
- // 打印名称,在同一个名称下的打印可以统一风格(打印维护界面点击应用即可)
116
- printName: {
117
- type: String
118
- }
119
- },
120
- data(){
121
- return{
122
- //打印任务的JOB代码,用于获得打印状态信息及最终结果。
123
- P_ID:"",
124
- //第几次任务
125
- loop:0,
126
- fontSize: this.$appdata.getSingleValue('打印字体大小') ? this.$appdata.getSingleValue('打印字体大小') : 15
127
- }
128
- },
129
- methods: {
130
- PrintAsFile () {
131
- console.log(this.model)
132
- let gen = printGen(this,this.printpage)
133
- co(gen)
134
- },
135
- async PrintSinglePage(){
136
- let lodop = getLodop()
137
- lodop.PRINT_INIT('打印表格'+(this.loop+1))
138
- var style
139
- if (!this.style) {
140
- style = `<style>table{font-size:${this.fontSize}px;border-width: 2px;border-collapse: collapse;border:solid 2px ; border-color:black;}` +
141
- 'table th {border-width: 1px;padding: 2px;border-style: solid;}table td {border-width: 1px;padding: 2px;border-style: solid;}</style>'
142
- } else {
143
- style = this.style
144
- }
145
- let tHtml = style + '<table class="table table-hover"><thead>' + this.thead + '</thead><tbody>'
146
-
147
- //所有数据全部打印,打印任务结束
148
- if(this.loop+1>this.model.totalPage){
149
- this.printinit()
150
- console.log('打印结束')
151
- return
152
- }
153
- console.log('获取数据pageIndex = ' + (this.loop+1))
154
- await this.model.loadPage(this.loop+1)
155
- for (let row of this.model.rows) {
156
- tHtml += '<tr>'
157
- for (let field of this.fields) {
158
- if (field && (row[field] || row[field] === 0) ) {
159
- tHtml += '<td>' + row[field] + '</td>'
160
- } else {
161
- tHtml += '<td></td>'
162
- }
163
- }
164
- tHtml += '</tr>'
165
- }
166
- //插入页码
167
- let page = `<tr><th width="100%" colspan=${this.fields.length} style="border-width: 0;">当前是第<font format="ChineseNum" color="blue">${this.loop+1}</font>页/共<font format="ChineseNum" color="blue">${this.model.totalPage}</font>页`
168
- // 如果有表尾,则添加表尾,如果内容翻页的话,表尾每一页都要打印
169
- if (this.tfoot) {
170
- tHtml += `</tbody><tfoot>${this.tfoot}${page}</tfoot></table>`
171
- } else {
172
- tHtml += '</tbody></table>'
173
- }
174
-
175
- lodop.ADD_PRINT_TABLE(this.left, this.top, 'RightMargin:' + this.right, 'BottomMargin:' + this.bottom, tHtml)
176
- lodop.SET_PRINT_STYLEA(0, 'HOrient', 3)
177
- lodop.SET_PRINT_STYLEA(0, 'VOrient', 3)
178
- //设置打印机为默认打印机
179
- lodop.SET_PRINTER_INDEX(-1)
180
-
181
- this.P_ID=lodop.PRINT()
182
- if(this.P_ID){
183
- this.loop+=1
184
- console.log("正打印第"+this.loop+"个任务(JOB代码"+this.P_ID)
185
- }
186
- //延迟循环缓解压力
187
- await this.timeout(1500)
188
- this.PrintSinglePage()
189
- },
190
-
191
- async PrintSelectedPage () {
192
- console.log('选择列打印开始', this.model)
193
-
194
- if (this.model.rows.length > 100) {
195
- this.$showAlert('您选择的数据过大,请选择少于100条数据进行打印', 'warning', 3000)
196
- return
197
- }
198
-
199
- let lodop = getLodop()
200
- lodop.PRINT_INIT('打印表格'+(this.loop+1))
201
- var style
202
- if (!this.style) {
203
- style = `<style>table{font-size:${this.fontSize}px;border-width: 2px;border-collapse: collapse;border:solid 2px ; border-color:black;}` +
204
- 'table th {border-width: 1px;padding: 2px;border-style: solid;}table td {border-width: 1px;padding: 2px;border-style: solid;}</style>'
205
- } else {
206
- style = this.style
207
- }
208
- let tHtml = style + '<table class="table table-hover"><thead>' + this.thead + '</thead><tbody>'
209
- for (let row of this.model.rows) {
210
- tHtml += '<tr>'
211
- for (let field of this.fields) {
212
- tHtml += '<td style="text-align: center;">' + row[field] + '</td>'
213
- }
214
- tHtml += '</tr>'
215
- }
216
- // // 如果有表尾,则添加表尾,如果内容翻页的话,表尾每一页都要打印
217
- if (this.tfoot) {
218
- tHtml += `</tbody><tfoot>${this.tfoot}</tfoot></table>`
219
- } else {
220
- tHtml += '</tbody></table>'
221
- }
222
- console.log('选择列打印的html', tHtml)
223
- lodop.ADD_PRINT_TABLE(this.left, this.top, 'RightMargin:' + this.right, 'BottomMargin:' + this.bottom, tHtml)
224
- lodop.SET_PRINT_STYLEA(0, 'HOrient', 3)
225
- lodop.SET_PRINT_STYLEA(0, 'VOrient', 3)
226
- //设置打印机为默认打印机
227
- lodop.SET_PRINTER_INDEX(-1)
228
- console.log('开始调用打印。。')
229
- this.P_ID=lodop.PRINT()
230
- },
231
- printinit(){
232
- this.P_ID="",
233
- this.loop=0
234
- },
235
- async timeout(ms){
236
- return new Promise((resolve, reject) => {
237
- setTimeout(resolve, ms)
238
- })
239
- }
240
- }
241
- }
242
- </script>
1
+ <template>
2
+ <button class="btn btn-default" @click='PrintAsFile()' :id="'vc-printtable-'+attach">打印表格</button>
3
+ </template>
4
+
5
+ <script>
6
+ import co from 'co'
7
+ import getLodop from '../../plugins/LodopFuncs'
8
+
9
+ let printGen = function * (self, pageNo) {
10
+
11
+ console.log('开始打印', self.isSelected, self.model, self.tfoot)
12
+ //是否分页打印
13
+ if(pageNo){
14
+ self.PrintSinglePage()
15
+ return
16
+ }
17
+ if (self.isSelected) {
18
+ // 判断是否选择行数据进行打印
19
+ self.PrintSelectedPage()
20
+ return
21
+ }
22
+
23
+ let lodop = getLodop()
24
+ lodop.PRINT_INIT(self.printName+'打印')
25
+ var style
26
+ if (!self.style) {
27
+ style = `<style>table{font-size:${self.fontSize}px;border-width: 2px;border-collapse: collapse;border:solid 2px ; border-color:black;}` +
28
+ 'table th {border-width: 1px;padding: 2px;border-style: solid;}table td {border-width: 1px;padding: 2px;border-style: solid;}</style>'
29
+ } else {
30
+ style = self.style
31
+ }
32
+ let tHtml = style + '<table class="table table-hover"><thead>' + self.thead + '</thead><tbody>'
33
+
34
+ for (var i = 1; i <= self.model.totalPage; i++) {
35
+ console.log('pageIndex = ' + i)
36
+ yield self.model.loadPage(i)
37
+ for (let row of self.model.rows) {
38
+ tHtml += '<tr>'
39
+ for (let field of self.fields) {
40
+ if (field && (row[field] || row[field] === 0) ) {
41
+ tHtml += '<td>' + row[field] + '</td>'
42
+ } else {
43
+ tHtml += '<td></td>'
44
+ }
45
+ // console.log(row[field])
46
+ }
47
+ tHtml += '</tr>'
48
+ }
49
+ }
50
+ // 加入合计数据 (最后一页显示)
51
+ if (self.sumhtml) {
52
+ tHtml += self.sumhtml
53
+ }
54
+ // 如果有表尾,则添加表尾,如果内容翻页的话,表尾每一页都要打印
55
+ if (self.tfoot) {
56
+ self.tfoot += `<tr><td width="100%" colspan=${self.fields.length} style="text-align: center;border-width: 0;">第<font tdata="PageNO" format="#" color="blue">#</font>页</span>/共<font tdata="PageCount" format="#" color="blue">##</font></span>页</td></tr>`
57
+ tHtml += `</tbody><tfoot>${self.tfoot}</tfoot></table>`
58
+ } else {
59
+ tHtml += '</tbody></table>'
60
+ }
61
+
62
+ lodop.ADD_PRINT_TABLE(self.top, self.left, 'RightMargin:' + self.right, 'BottomMargin:' + self.bottom, tHtml)
63
+ lodop.SET_PRINT_STYLEA(0, 'HOrient', 3)
64
+ lodop.SET_PRINT_STYLEA(0, 'VOrient', 3)
65
+ // 指定打印方向 0--可通过打印机选择纵向或横向,1--锁定为纵向打印,2---锁定为横向打印
66
+ LODOP.SET_PRINT_PAGESIZE(self.xyprint, 0, 0, "A4");
67
+
68
+ if(self.printview==null){
69
+ // 打印维护
70
+ lodop.PRINT_SETUP()
71
+ }else if(self.printview){
72
+ // 使用打印预览是为了方便调整打印格式。例如:横向打印
73
+ lodop.PREVIEW()
74
+ }else if(!self.printview){
75
+ // 直接打印
76
+ lodop.PRINT()
77
+ }
78
+
79
+ }
80
+
81
+ export default {
82
+ // props: ['model', 'thead', 'fields', 'top', 'left', 'right', 'bottom', 'tfoot'],
83
+ props: {
84
+ model: Object,
85
+ thead: String,
86
+ tfoot: String,
87
+ sumhtml: String,
88
+ fields: Array,
89
+ //null 打印维护, true 打印预览 false 直接打印
90
+ printview:{},
91
+ // 指定打印方向 0--可通过打印机选择纵向或横向,1--锁定为纵向打印,2---锁定为横向打印
92
+ xyprint:{
93
+ default : 0
94
+ },
95
+ top: {},
96
+ left: {},
97
+ right: {},
98
+ bottom: {},
99
+ attach: {
100
+ type: String,
101
+ default: 'name'
102
+ },
103
+ style: {
104
+ type: String
105
+ },
106
+ isSelected: {
107
+ type:Boolean,
108
+ default:false
109
+ },
110
+ //是否分页打印
111
+ printpage:{
112
+ type:Boolean,
113
+ default:false
114
+ },
115
+ // 打印名称,在同一个名称下的打印可以统一风格(打印维护界面点击应用即可)
116
+ printName: {
117
+ type: String
118
+ }
119
+ },
120
+ data(){
121
+ return{
122
+ //打印任务的JOB代码,用于获得打印状态信息及最终结果。
123
+ P_ID:"",
124
+ //第几次任务
125
+ loop:0,
126
+ fontSize: this.$appdata.getSingleValue('打印字体大小') ? this.$appdata.getSingleValue('打印字体大小') : 15
127
+ }
128
+ },
129
+ methods: {
130
+ PrintAsFile () {
131
+ console.log(this.model)
132
+ let gen = printGen(this,this.printpage)
133
+ co(gen)
134
+ },
135
+ async PrintSinglePage(){
136
+ let lodop = getLodop()
137
+ lodop.PRINT_INIT('打印表格'+(this.loop+1))
138
+ var style
139
+ if (!this.style) {
140
+ style = `<style>table{font-size:${this.fontSize}px;border-width: 2px;border-collapse: collapse;border:solid 2px ; border-color:black;}` +
141
+ 'table th {border-width: 1px;padding: 2px;border-style: solid;}table td {border-width: 1px;padding: 2px;border-style: solid;}</style>'
142
+ } else {
143
+ style = this.style
144
+ }
145
+ let tHtml = style + '<table class="table table-hover"><thead>' + this.thead + '</thead><tbody>'
146
+
147
+ //所有数据全部打印,打印任务结束
148
+ if(this.loop+1>this.model.totalPage){
149
+ this.printinit()
150
+ console.log('打印结束')
151
+ return
152
+ }
153
+ console.log('获取数据pageIndex = ' + (this.loop+1))
154
+ await this.model.loadPage(this.loop+1)
155
+ for (let row of this.model.rows) {
156
+ tHtml += '<tr>'
157
+ for (let field of this.fields) {
158
+ if (field && (row[field] || row[field] === 0) ) {
159
+ tHtml += '<td>' + row[field] + '</td>'
160
+ } else {
161
+ tHtml += '<td></td>'
162
+ }
163
+ }
164
+ tHtml += '</tr>'
165
+ }
166
+ //插入页码
167
+ let page = `<tr><th width="100%" colspan=${this.fields.length} style="border-width: 0;">当前是第<font format="ChineseNum" color="blue">${this.loop+1}</font>页/共<font format="ChineseNum" color="blue">${this.model.totalPage}</font>页`
168
+ // 如果有表尾,则添加表尾,如果内容翻页的话,表尾每一页都要打印
169
+ if (this.tfoot) {
170
+ tHtml += `</tbody><tfoot>${this.tfoot}${page}</tfoot></table>`
171
+ } else {
172
+ tHtml += '</tbody></table>'
173
+ }
174
+
175
+ lodop.ADD_PRINT_TABLE(this.left, this.top, 'RightMargin:' + this.right, 'BottomMargin:' + this.bottom, tHtml)
176
+ lodop.SET_PRINT_STYLEA(0, 'HOrient', 3)
177
+ lodop.SET_PRINT_STYLEA(0, 'VOrient', 3)
178
+ //设置打印机为默认打印机
179
+ lodop.SET_PRINTER_INDEX(-1)
180
+
181
+ this.P_ID=lodop.PRINT()
182
+ if(this.P_ID){
183
+ this.loop+=1
184
+ console.log("正打印第"+this.loop+"个任务(JOB代码"+this.P_ID)
185
+ }
186
+ //延迟循环缓解压力
187
+ await this.timeout(1500)
188
+ this.PrintSinglePage()
189
+ },
190
+
191
+ async PrintSelectedPage () {
192
+ console.log('选择列打印开始', this.model)
193
+
194
+ if (this.model.rows.length > 100) {
195
+ this.$showAlert('您选择的数据过大,请选择少于100条数据进行打印', 'warning', 3000)
196
+ return
197
+ }
198
+
199
+ let lodop = getLodop()
200
+ lodop.PRINT_INIT('打印表格'+(this.loop+1))
201
+ var style
202
+ if (!this.style) {
203
+ style = `<style>table{font-size:${this.fontSize}px;border-width: 2px;border-collapse: collapse;border:solid 2px ; border-color:black;}` +
204
+ 'table th {border-width: 1px;padding: 2px;border-style: solid;}table td {border-width: 1px;padding: 2px;border-style: solid;}</style>'
205
+ } else {
206
+ style = this.style
207
+ }
208
+ let tHtml = style + '<table class="table table-hover"><thead>' + this.thead + '</thead><tbody>'
209
+ for (let row of this.model.rows) {
210
+ tHtml += '<tr>'
211
+ for (let field of this.fields) {
212
+ tHtml += '<td style="text-align: center;">' + row[field] + '</td>'
213
+ }
214
+ tHtml += '</tr>'
215
+ }
216
+ // // 如果有表尾,则添加表尾,如果内容翻页的话,表尾每一页都要打印
217
+ if (this.tfoot) {
218
+ tHtml += `</tbody><tfoot>${this.tfoot}</tfoot></table>`
219
+ } else {
220
+ tHtml += '</tbody></table>'
221
+ }
222
+ console.log('选择列打印的html', tHtml)
223
+ lodop.ADD_PRINT_TABLE(this.left, this.top, 'RightMargin:' + this.right, 'BottomMargin:' + this.bottom, tHtml)
224
+ lodop.SET_PRINT_STYLEA(0, 'HOrient', 3)
225
+ lodop.SET_PRINT_STYLEA(0, 'VOrient', 3)
226
+ //设置打印机为默认打印机
227
+ lodop.SET_PRINTER_INDEX(-1)
228
+ console.log('开始调用打印。。')
229
+ this.P_ID=lodop.PRINT()
230
+ },
231
+ printinit(){
232
+ this.P_ID="",
233
+ this.loop=0
234
+ },
235
+ async timeout(ms){
236
+ return new Promise((resolve, reject) => {
237
+ setTimeout(resolve, ms)
238
+ })
239
+ }
240
+ }
241
+ }
242
+ </script>
@@ -1,6 +1,6 @@
1
- export default {
2
- // 把打印需要默认选中的字段名放在config数组中
3
- config: [
4
- 'f_userinfo_code', 'f_user_name', 'f_user_phone', 'f_pregas', 'f_preamount', 'f_collection', 'f_balance', 'f_curbalance', 'f_idnumber'
5
- ]
6
- }
1
+ export default {
2
+ // 把打印需要默认选中的字段名放在config数组中
3
+ config: [
4
+ 'f_userinfo_code', 'f_user_name', 'f_user_phone', 'f_pregas', 'f_preamount', 'f_collection', 'f_balance', 'f_curbalance', 'f_idnumber'
5
+ ]
6
+ }