ocpview-plus 1.3.15 → 1.3.16

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 (213) hide show
  1. package/README.md +55 -43
  2. package/dist/ocpviewplus.min.esm.js +574 -482
  3. package/dist/ocpviewplus.min.js +9 -9
  4. package/dist/style.css +1 -1
  5. package/dist/styles/efviewplus.css +1 -1
  6. package/package.json +146 -146
  7. package/src/components/base/ContractPrintMixins.js +30 -30
  8. package/src/components/base/controlbase.vue +190 -190
  9. package/src/components/base/controlbox.vue +102 -102
  10. package/src/components/base/index.js +2 -2
  11. package/src/components/base/load.js +19 -19
  12. package/src/components/base/probase.js +220 -220
  13. package/src/components/base/size.js +78 -78
  14. package/src/components/billbox/billbox.vue +67 -67
  15. package/src/components/billbox/index.js +1 -1
  16. package/src/components/cascaderbox/cascaderbox.vue +184 -184
  17. package/src/components/cascaderbox/index.js +2 -2
  18. package/src/components/checkbox/checkbox.vue +75 -75
  19. package/src/components/checkbox/checkgroupbox.vue +103 -103
  20. package/src/components/checkbox/index.js +2 -2
  21. package/src/components/colorbox/colorbox.vue +43 -43
  22. package/src/components/colorbox/index.js +1 -1
  23. package/src/components/combobox/combobox.vue +219 -219
  24. package/src/components/combobox/index.js +1 -1
  25. package/src/components/conditionbox/conditionbase.vue +194 -194
  26. package/src/components/conditionbox/conditionbox.vue +62 -62
  27. package/src/components/conditionbox/conditionfilterbox.vue +479 -479
  28. package/src/components/conditionbox/conditionselectorbox.vue +237 -237
  29. package/src/components/conditionbox/index.js +4 -4
  30. package/src/components/conditionbox/queryconditionbox.vue +25 -25
  31. package/src/components/conditionbox/queryconditionboxbase.vue +123 -123
  32. package/src/components/conditionbox/searchconditionbox.vue +113 -113
  33. package/src/components/conditionbox/searchgrid.vue +391 -391
  34. package/src/components/datebox/DateBoxV1.vue +22 -22
  35. package/src/components/datebox/datebox.vue +129 -129
  36. package/src/components/datebox/daterangebox.vue +154 -154
  37. package/src/components/datebox/index.js +5 -5
  38. package/src/components/form/baseform.vue +676 -676
  39. package/src/components/form/detailsbox.vue +487 -487
  40. package/src/components/form/formbox.vue +28 -28
  41. package/src/components/form/formcardbox.vue +267 -267
  42. package/src/components/form/formcardbox2.vue +228 -228
  43. package/src/components/form/formcardgroupbox.vue +251 -251
  44. package/src/components/form/formcompro.js +18 -18
  45. package/src/components/form/formdetail.vue +128 -128
  46. package/src/components/form/formdetailtwo.vue +302 -302
  47. package/src/components/form/index.js +9 -9
  48. package/src/components/form/toolanchor.js +45 -45
  49. package/src/components/form/workform.vue +167 -167
  50. package/src/components/grid/basegrid.vue +1062 -1062
  51. package/src/components/grid/editgrid.vue +51 -51
  52. package/src/components/grid/editgridbase.vue +1062 -1062
  53. package/src/components/grid/editgridcard.vue +193 -193
  54. package/src/components/grid/expandrow.vue +137 -137
  55. package/src/components/grid/index.js +5 -5
  56. package/src/components/grid/viewgrid.vue +121 -121
  57. package/src/components/grid/viewgridbase.vue +1286 -1286
  58. package/src/components/icon/common-icon.vue +53 -53
  59. package/src/components/icon/eicon.vue +28 -28
  60. package/src/components/icon/icons.vue +42 -42
  61. package/src/components/icon/index.js +1 -1
  62. package/src/components/label/index.js +2 -2
  63. package/src/components/label/showtext.vue +94 -94
  64. package/src/components/load/loadcartoon.vue +227 -227
  65. package/src/components/map/index.js +1 -1
  66. package/src/components/map/mapbox.vue +348 -348
  67. package/src/components/masterplate/RewriteBillListDetails/BillInfoPanel.vue +184 -184
  68. package/src/components/masterplate/RewriteBillListDetails/BillInfoPanelEditTable.vue +838 -838
  69. package/src/components/masterplate/RewriteBillListDetails/BillInfoPanelEditTableControlbox.vue +126 -126
  70. package/src/components/masterplate/RewriteBillListDetails/BillInfoPanelEditTableControlboxNumberbox.vue +27 -27
  71. package/src/components/masterplate/RewriteBillListDetails/BillListPanel.vue +126 -126
  72. package/src/components/masterplate/RewriteBillListDetails/BillListPanelQueryBar.vue +280 -280
  73. package/src/components/masterplate/RewriteBillListDetails/BillListPanelTable.vue +346 -346
  74. package/src/components/masterplate/RewriteBillListDetails/index.vue +325 -325
  75. package/src/components/masterplate/RewriteBillListDetails/mixins/useVxeGridEditTypeKeydownEventHook.js +251 -251
  76. package/src/components/masterplate/RewriteListdetails/BillListPanelV2.vue +115 -115
  77. package/src/components/masterplate/RewriteListdetails/BillListPanelV2QueryBar.vue +24 -24
  78. package/src/components/masterplate/RewriteListdetails/BillListPanelV3.vue +121 -121
  79. package/src/components/masterplate/RewriteListdetails/BillListPanelV3QueryBar.vue +275 -275
  80. package/src/components/masterplate/RewriteListdetails/indexV2.vue +320 -320
  81. package/src/components/masterplate/RewriteListdetails/indexV3.vue +331 -331
  82. package/src/components/masterplate/appendix.vue +586 -586
  83. package/src/components/masterplate/approval.vue +863 -863
  84. package/src/components/masterplate/base.vue +1028 -1028
  85. package/src/components/masterplate/billasyncimport.vue +614 -614
  86. package/src/components/masterplate/billconditionbox.vue +223 -223
  87. package/src/components/masterplate/billconditionsbox.vue +427 -427
  88. package/src/components/masterplate/billdetailform.vue +1028 -1028
  89. package/src/components/masterplate/billimport.vue +301 -301
  90. package/src/components/masterplate/billquerygrid.vue +391 -391
  91. package/src/components/masterplate/billsinglegrid.vue +234 -234
  92. package/src/components/masterplate/birtreport.vue +185 -185
  93. package/src/components/masterplate/contractappendix.vue +688 -688
  94. package/src/components/masterplate/detailbtntoolbar.vue +311 -311
  95. package/src/components/masterplate/detailsbox.vue +386 -386
  96. package/src/components/masterplate/editgridcard.vue +292 -292
  97. package/src/components/masterplate/editgridcard2.vue +127 -127
  98. package/src/components/masterplate/formcard.vue +105 -105
  99. package/src/components/masterplate/formcardgroupbox.vue +167 -167
  100. package/src/components/masterplate/formdetailtwo.vue +366 -366
  101. package/src/components/masterplate/gridcolset.vue +226 -226
  102. package/src/components/masterplate/index.js +54 -54
  103. package/src/components/masterplate/layouttemplate.vue +51 -51
  104. package/src/components/masterplate/leftlistrightdetails.vue +581 -581
  105. package/src/components/masterplate/leftlistrightlist.vue +464 -464
  106. package/src/components/masterplate/lefttreerightdetails.vue +636 -636
  107. package/src/components/masterplate/levelreport.vue +510 -510
  108. package/src/components/masterplate/listbtntoolbar.vue +276 -276
  109. package/src/components/masterplate/listdetails.vue +768 -768
  110. package/src/components/masterplate/operlog.vue +272 -272
  111. package/src/components/masterplate/options.vue +110 -110
  112. package/src/components/masterplate/page.vue +102 -102
  113. package/src/components/masterplate/promptmessage.vue +73 -73
  114. package/src/components/masterplate/querybar.vue +490 -490
  115. package/src/components/masterplate/report.vue +357 -357
  116. package/src/components/masterplate/rowbtntoolbar.vue +126 -126
  117. package/src/components/masterplate/simpletree.vue +137 -137
  118. package/src/components/masterplate/simpleviewgrid.vue +144 -144
  119. package/src/components/mychart/bar/bar.vue +201 -201
  120. package/src/components/mychart/basechart.vue +190 -190
  121. package/src/components/mychart/complexmychart/barline.vue +153 -153
  122. package/src/components/mychart/gauge/gauge.vue +82 -82
  123. package/src/components/mychart/index.js +8 -8
  124. package/src/components/mychart/line/line.vue +201 -201
  125. package/src/components/mychart/liquidfill/liquidfill.vue +108 -108
  126. package/src/components/mychart/pie/pie.vue +95 -95
  127. package/src/components/mychart/radar/radar.vue +121 -121
  128. package/src/components/mychart/scatter/scatter.vue +75 -75
  129. package/src/components/numberbox/NumberBoxV1.vue +39 -39
  130. package/src/components/numberbox/append.js +11 -11
  131. package/src/components/numberbox/index.js +4 -4
  132. package/src/components/numberbox/numberbox.vue +302 -302
  133. package/src/components/numberbox/numberrangebox.vue +422 -422
  134. package/src/components/picturebox/filebox.vue +369 -369
  135. package/src/components/picturebox/index.js +2 -2
  136. package/src/components/picturebox/picturebox.vue +541 -541
  137. package/src/components/picturebox/uploadbox.vue +164 -164
  138. package/src/components/poptagbox/index.js +1 -1
  139. package/src/components/poptagbox/poptagbox.vue +388 -388
  140. package/src/components/poptextbox/index.js +1 -1
  141. package/src/components/poptextbox/poptextbox.vue +624 -624
  142. package/src/components/radiobox/index.js +1 -1
  143. package/src/components/radiobox/radiogroupbox.vue +75 -75
  144. package/src/components/richtextbox/editor.vue +150 -150
  145. package/src/components/richtextbox/index.js +1 -1
  146. package/src/components/richtextbox/richtextbox.vue +448 -448
  147. package/src/components/textbox/index.js +1 -1
  148. package/src/components/textbox/textbox.vue +97 -97
  149. package/src/components/timebox/index.js +1 -1
  150. package/src/components/timebox/timebox.vue +75 -75
  151. package/src/components/toolbar/ebutton.vue +169 -169
  152. package/src/components/toolbar/index.js +3 -3
  153. package/src/components/toolbar/toolbar.vue +445 -445
  154. package/src/components/tree/CompatTree.vue +297 -297
  155. package/src/components/tree/basetree.vue +1098 -1098
  156. package/src/components/tree/index.js +2 -2
  157. package/src/components/tree/treedata.vue +53 -53
  158. package/src/components/tree/treedatabase.vue +189 -189
  159. package/src/components/upload/billimport.vue +233 -233
  160. package/src/components/upload/index.js +1 -1
  161. package/src/components/videobox/index.js +1 -1
  162. package/src/components/videobox/uploadbox.vue +148 -148
  163. package/src/components/videobox/videobox.vue +503 -503
  164. package/src/components/wrichtextbox/editor.vue +219 -219
  165. package/src/components/wrichtextbox/index.js +1 -1
  166. package/src/components/wrichtextbox/wrichtextbox.vue +62 -62
  167. package/src/index.js +231 -231
  168. package/src/locale/format.js +51 -51
  169. package/src/locale/index.js +63 -63
  170. package/src/locale/lang/zh-CN.js +123 -123
  171. package/src/locale/lang/zh-TW.js +114 -114
  172. package/src/locale/lang/zh-UG.js +115 -115
  173. package/src/locale/lang.js +15 -15
  174. package/src/method/case/case.js +1274 -1274
  175. package/src/method/config/queryconfig.js +24 -24
  176. package/src/method/const/const.js +815 -815
  177. package/src/method/index.js +7 -7
  178. package/src/plugins/theme/theme-variable.css +114 -114
  179. package/src/plugins/vxeTable/index.js +241 -241
  180. package/src/plugins/vxeTable/renderer/components/TableFilterInput.vue +51 -51
  181. package/src/plugins/vxeTable/renderer/filter.js +32 -32
  182. package/src/static/excel/exportexcel.js +626 -626
  183. package/src/static/iview/coustom.js +462 -462
  184. package/src/store/index.js +18 -18
  185. package/src/store/modules/app.js +53 -53
  186. package/src/styles/README.md +3 -3
  187. package/src/styles/common.less +80 -80
  188. package/src/styles/components/anchor.less +74 -74
  189. package/src/styles/components/approval.less +135 -135
  190. package/src/styles/components/button.less +208 -208
  191. package/src/styles/components/card.less +51 -51
  192. package/src/styles/components/content.less +38 -38
  193. package/src/styles/components/font.less +313 -313
  194. package/src/styles/components/form.less +71 -71
  195. package/src/styles/components/iconfont/fonts/iconfont.less +1384 -1384
  196. package/src/styles/components/iconfont/fonts/iconfont.svg +703 -703
  197. package/src/styles/components/index.less +16 -16
  198. package/src/styles/components/input.less +290 -290
  199. package/src/styles/components/modal.less +203 -203
  200. package/src/styles/components/page.less +340 -340
  201. package/src/styles/components/select.less +361 -361
  202. package/src/styles/components/steps.less +367 -367
  203. package/src/styles/components/table.less +544 -544
  204. package/src/styles/components/tabs.less +249 -249
  205. package/src/styles/components/upload.less +82 -82
  206. package/src/styles/custom.less +67 -67
  207. package/src/styles/index.less +6 -6
  208. package/src/styles/pack.less +6 -6
  209. package/src/utils/EfuMessenger.js +155 -155
  210. package/src/utils/assist.js +353 -353
  211. package/src/utils/index.js +1 -1
  212. package/src/utils/random_str.js +10 -10
  213. package/src/components/masterplate/detailgridbox.vue +0 -386
@@ -1,1028 +1,1028 @@
1
- <script>
2
- import load from '@/components/base/load';
3
- import Cookies from 'js-cookie';
4
- export default {
5
- name:'mbase',
6
- mixins: [load],
7
- data() {
8
- return {
9
- globalConfig:{
10
- dictkey:[],
11
- dictData:{},
12
- userModuleMethod:[],
13
- modulecode:'',
14
- billmain:{},
15
- dictgroupkey:[]
16
- },
17
- billapproveurl:'',
18
- billKey:'ph_key',
19
- uiconfig:{},
20
- uiproconfig:[],
21
- usercustominfo:{},
22
- cout:0,
23
- showDetailAppendix:false,
24
- detalAppendixFlag:true,
25
- billDetailAppendixConfig:{
26
- showTitle:false,
27
- scenetype:'4'
28
- },
29
- billAsyncImportConfig:{
30
-
31
- },
32
- billImportConfig:{
33
- importKey:'billno',
34
- typeData:[]
35
- },
36
- importReset:true,
37
- printModeReset:true,
38
- showBillPrintMode:false,
39
- showAsyncImportExport:false,
40
- showBillContPrintMode:false,
41
- showPrintMode:false,
42
- billprintModeUrl:'/widgetmodelv3/#/bill-print?modulecode={modulecode}&dataid={dataid}&mktcode={mktcode}&token={token}',
43
- printModeUrl:'',
44
- eventObject:['valueChanged','setDataBefore','searchBefore','cellbeginedit','importSuccess','addRowBefore','indexMethod','delRowBefore','delRowAfter','onSelectionChange','formatValue','updateCellConfig','overrideSearchParam','overrideData','refurbishCheck','onSingleChange','onSetRowCheck','onSelect','onSelectCancel','onSelectionChange','customSummary','customImgPath','onDelTag','onSearch','onAppend','filterData','onAddTag','getDictData','setLabel','setImportUrl','onLinkTo','newSaveFormBefore','setQueryConfig','setNodeClass','setTreeNodeIcon','rowClassName','customSummaryGroup','disabledDate'],
45
- layoutTypeList:['ListDetails','ListDetailsV2','BillListDetails','ListDetailsV3']
46
- };
47
- },
48
- computed: {
49
- uiLayoutType () {
50
- return 'm' + this.uiconfig.layoutType;
51
- }
52
- },
53
- created () {
54
- if (JSON.stringify(this.config) !== '{}') {
55
- if (this.config.eventObject) {
56
- Object.assign(this,this.config.eventObject);
57
- }
58
- this.uiconfig = Object.assign({},this.uiconfig, this.config);
59
- delete this.uiconfig.eventObject;
60
- this.init();
61
- if (this.customInit) {
62
- this.customInit();
63
- }
64
- }
65
- },
66
-
67
- props:{
68
- config: {
69
- type:Object,
70
- default () {
71
- return {};
72
- }
73
- }
74
- } ,
75
- methods:{
76
- initConfig(config,obj) {
77
- this.uiconfig = config;
78
- Object.assign(this,obj);
79
- this.init();
80
- if (this.customInit) {
81
- this.customInit();
82
- }
83
- },
84
- saveGridCol (obj) {
85
- let para = {};
86
- para.aid = Cookies.get('user_id') ? Cookies.get('user_id'): 0 ;
87
- para.sid = Cookies.get('stationId') ? Cookies.get('stationId'): 0 ;
88
- para.modulecode = this.globalConfig.modulecode;
89
- para.colset = JSON.stringify(obj.para);
90
- this.asyncPost(this.OmdUrl.amp, 'usercenter.usercustominfo.saveColset', para, function (data) {
91
-
92
- });
93
- },
94
- saveScene (obj) {
95
- let para = {};
96
- para.aid = Cookies.get('user_id') ? Cookies.get('user_id'): 0 ;
97
- para.sid = Cookies.get('stationId') ? Cookies.get('stationId'): 0 ;
98
- para.modulecode = this.globalConfig.modulecode;
99
- para.filterscene = JSON.stringify(obj.para);
100
- this.asyncPost(this.OmdUrl.amp, 'usercenter.usercustominfo.saveScene', para, function (data) {
101
-
102
- });
103
- },
104
- getUserCustomInfo () {
105
- let self = this;
106
- let para = {};
107
- para.aid = Cookies.get('user_id') ? Cookies.get('user_id'): 0 ;
108
- para.sid = Cookies.get('stationId') ? Cookies.get('stationId'): 0 ;
109
- para.modulecode = this.globalConfig.modulecode;
110
- self.synchroPost(this.OmdUrl.amp, 'usercenter.usercustominfo.getUserInfo', para, function (data) {
111
- if (data.usercustominfo) {
112
- self.usercustominfo = data.usercustominfo;
113
- }
114
- });
115
- },
116
- getUiCustomInfo () {
117
- let self = this;
118
- let para = {};
119
- para.modulecode = this.globalConfig.modulecode;
120
- self.synchroPost(this.OmdUrl.amp, 'usercenter.uiproconfig.search', para, function (data) {
121
- if (data.uiproconfig && data.uiproconfig.length > 0 && data.uiproconfig[0].layoutPro) {
122
- self.uiproconfig = JSON.parse(data.uiproconfig[0].layoutPro);
123
- }
124
- });
125
- },
126
- init() {
127
- // 处理模块号提示
128
- this.globalConfig.modulecode = this.$Method.getUrlParam('modulecode');
129
- if (!this.globalConfig.modulecode) {
130
- this.globalConfig.modulecode = this.$Method.getUrlParam('billmoduleid');
131
- }
132
- if (this.billmoduleid) {
133
- this.globalConfig.modulecode = this.billmoduleid;
134
- }
135
-
136
- if ( this.uiconfig.layoutType !== 'BirtReport') {
137
- if (this.OmdUrl[this.uiconfig.resources]) {
138
- this.uiconfig.resources = this.OmdUrl[this.uiconfig.resources];
139
- }
140
- }
141
-
142
- if (this.uiconfig.billKey) {
143
- this.billKey = this.uiconfig.billKey;
144
- }
145
-
146
- this.setUserModuleMethod();
147
- this.getUiCustomInfo();
148
- let tmp = {};
149
- this.initUiConfig(this.uiconfig,tmp);
150
- this.initUiCustomConfig();
151
- // if (this.uiconfig.layoutType === 'ListDetails') {
152
- if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType)) {
153
- this.getUserCustomInfo();
154
- this.uiconfig.billQueryConfig.usercustominfo = this.$Method.copy(this.usercustominfo);
155
- if (this.billisworkflow) {
156
- this.uiconfig.detailConfig.billisworkflow = this.billisworkflow;
157
- }
158
- }
159
- if (this.billapproveurl) {
160
- this.uiconfig.detailConfig.billapproveurl = this.billapproveurl;
161
- }
162
-
163
- if (this.uiconfig.billImportConfig) {
164
- this.billImportConfig = Object.assign({}, {}, this.uiconfig.billImportConfig);
165
- }
166
-
167
- if(this.showAsyncImportExport) {
168
- if(this.uiconfig.billImportConfig) {
169
- this.billAsyncImportConfig = Object.assign({}, this.billAsyncImportConfig, this.uiconfig.billImportConfig);
170
- }
171
-
172
- if (!this.billAsyncImportConfig.resources) {
173
- this.billAsyncImportConfig.resources = this.uiconfig.resources;
174
- }
175
- }
176
-
177
- this.uiconfig.showAsyncImportExport = this.showAsyncImportExport;
178
- if (this.uiconfig.detailConfig) {
179
- this.uiconfig.detailConfig.showAsyncImportExport = this.showAsyncImportExport;
180
- }
181
- if (this.showBillPrintMode || this.showBillContPrintMode) {
182
- if (!this.uiconfig.billPrintConfig) {
183
- this.uiconfig.billPrintConfig = {};
184
- }
185
- this.uiconfig.billPrintConfig.showPrint = this.showBillPrintMode;
186
- this.uiconfig.billPrintConfig.showContPrint = this.showBillContPrintMode;
187
- }
188
- let accounType = Cookies.get('accounType');
189
- if (accounType) {
190
- if (accounType === '1' || accounType === '2') {
191
- this.uiconfig.menuToolbar.enablePermissions = false;
192
- }
193
- }
194
- this.setDictData();
195
- this.importReset = false;
196
- this.$nextTick(() => {
197
- this.importReset = true;
198
- });
199
- },
200
- initUiConfig(obj,tmp) {
201
- if (obj instanceof Array) {
202
- obj.forEach(el => {
203
- this.initUiConfig(el,tmp);
204
- })
205
- } else {
206
- if (obj instanceof Object) {
207
- for (let pro in obj) {
208
- if (obj[pro] instanceof Array || obj[pro] instanceof Object) {
209
- if (pro === 'data') {
210
- continue;
211
- }
212
- this.initUiConfig(obj[pro],tmp);
213
- } else {
214
- if (pro === 'dictkey') {
215
- if (!tmp[obj[pro]]) {
216
- tmp[obj[pro]] = 'Y';
217
- this.globalConfig.dictkey.push(obj[pro]);
218
- }
219
- }
220
- if (this._isFun(pro)) {
221
- obj[pro] = this[obj[pro]];
222
- }
223
- }
224
- }
225
- }
226
-
227
- }
228
- },
229
- initUiCustomConfig () {
230
- this.uiproconfig.forEach(el => {
231
- if (el.pro && el.pro.length > 0) {
232
- if (el.isflag === '1') {
233
- // if (this.uiconfig.layoutType === 'ListDetails') {
234
- if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType)) {
235
- el.pro.forEach(el2 => {
236
- this.commonUiCustomConfig(el2,this.uiconfig.billQueryConfig.gridConfig.items);
237
- })
238
- }
239
- if (this.uiconfig.layoutType === 'LeftListRightList' || this.uiconfig.layoutType === 'LeftListRightDetails') {
240
- el.pro.forEach(el2 => {
241
- this.commonUiCustomConfig(el2,this.uiconfig.gridConfig.items);
242
- })
243
- }
244
- }
245
- if (el.isflag === '2') {
246
- // if (this.uiconfig.layoutType === 'ListDetails' || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
247
- if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType) || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
248
- el.pro.forEach(el2 => {
249
- this.commonUiCustomConfig2(el2,this.uiconfig.detailConfig.formsConfig.items);
250
- });
251
- }
252
- }
253
- if (el.isflag === '3') {
254
- // if (this.uiconfig.layoutType === 'ListDetails' || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
255
- if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType) || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
256
- let index = this.uiconfig.detailConfig.formsConfig.items.findIndex(el3 => el3.name === el.typename);
257
- if (index > -1) {
258
- el.pro.forEach(el2 => {
259
- this.commonUiCustomConfig(el2,this.uiconfig.detailConfig.formsConfig.items[index].items);
260
- });
261
- }
262
-
263
- }
264
- }
265
- if (el.isflag === '4') {
266
- // if (this.uiconfig.layoutType === 'ListDetails' || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
267
- if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType) || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
268
- if (this.uiconfig.detailConfig.billDetailConfig && this.uiconfig.detailConfig.billDetailConfig.items) {
269
- el.pro.forEach(el2 => {
270
- this.commonUiCustomConfig2(el2,this.uiconfig.detailConfig.billDetailConfig.items);
271
- });
272
- }
273
- }
274
- if (this.uiconfig.layoutType === 'LeftListRightList') {
275
- el.pro.forEach(el2 => {
276
- this.commonUiCustomConfig2(el2,this.uiconfig.detailGridsConfig);
277
- });
278
- }
279
- }
280
- if (el.isflag === '5') {
281
- // if (this.uiconfig.layoutType === 'ListDetails' || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
282
- if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType) || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
283
- if (this.uiconfig.detailConfig.billDetailConfig && this.uiconfig.detailConfig.billDetailConfig.items) {
284
- let index = this.uiconfig.detailConfig.billDetailConfig.items.findIndex(el3 => el3.name === el.typename);
285
- if (index > -1) {
286
- el.pro.forEach(el2 => {
287
- if (this.uiconfig.detailConfig.billDetailConfig.items[index].type === 'EditGridCard') {
288
- this.commonUiCustomConfig(el2,this.uiconfig.detailConfig.billDetailConfig.items[index].items);
289
- } else {
290
- this.commonUiCustomConfig(el2,this.uiconfig.detailConfig.billDetailConfig.items[index].formCondig.items);
291
- this.commonUiCustomConfig(el2,this.uiconfig.detailConfig.billDetailConfig.items[index].gridCondig.items);
292
- }
293
- });
294
- }
295
- }
296
- }
297
- if (this.uiconfig.layoutType === 'LeftListRightList') {
298
- let index = this.uiconfig.detailGridsConfig.findIndex(el3 => el3.name === el.typename);
299
- if (index > -1) {
300
- el.pro.forEach(el2 => {
301
- this.commonUiCustomConfig(el2,this.uiconfig.detailGridsConfig.items[index].items);
302
- });
303
- }
304
- }
305
-
306
- if (this.uiconfig.layoutType === 'BillSingleGrid') {
307
- el.pro.forEach(el2 => {
308
- this.commonUiCustomConfig(el2,this.uiconfig.gridConfig.items);
309
- });
310
- }
311
- }
312
- }
313
- });
314
-
315
- },
316
- commonUiCustomConfig(obj,items) {
317
- let index = items.findIndex(el => el.name === obj.fieldname || el.sname === obj.fieldname);
318
- if (index > -1) {
319
- let tmp = {};
320
- if (obj.fieldtext) {
321
- tmp.label = obj.fieldtext
322
- }
323
- if (obj.fieldwidth) {
324
- tmp.width = Number(obj.fieldwidth);
325
- }
326
- if (obj.fieldcol) {
327
- tmp.colNum = Number(obj.fieldcol);
328
- }
329
- if (obj.fieldvisible) {
330
- tmp.visible = false;
331
- }
332
- if (obj.fieldrequired) {
333
- tmp.required = true;
334
- }
335
- if (obj.defaultValue) {
336
- tmp.defaultValue = obj.defaultValue;
337
- }
338
- Object.assign(items[index], tmp);
339
- }
340
- },
341
- commonUiCustomConfig2(obj,items) {
342
- let index = items.findIndex(el => el.name === obj.fieldname );
343
- if (index > -1) {
344
- let tmp = {};
345
- if (obj.fieldtext) {
346
- tmp.title = obj.fieldtext
347
- }
348
- if (obj.fieldvisible) {
349
- tmp.visible = false;
350
- }
351
- Object.assign(items[index], tmp);
352
- }
353
- },
354
- _isFun (pro) {
355
- let index = this.eventObject.findIndex(el => el === pro);
356
- if (index > -1) {
357
- return true;
358
- } else {
359
- return false;
360
- }
361
- },
362
- setDictData() {
363
- // 调用字典方法
364
- if (this.globalConfig.dictkey.length > 0) {
365
- const dictkey = this.globalConfig.dictkey.join(',');
366
- this.globalConfig.dictData = this.getDict(dictkey,'code,name,pcode,pro1,ddvalue');
367
- }
368
- // 自定义添加
369
- if (this.initUserDict) {
370
- Object.assign(this.globalConfig.dictData, this.initUserDict());
371
- }
372
- },
373
- setUserModuleMethod() {
374
- let data = this.getUserModuleMethod(this.globalConfig.modulecode);
375
- if (data) {
376
- if (data.modulemethod) {
377
- this.globalConfig.userModuleMethod = this.$Method.copy(data.modulemethod);
378
- }
379
- if (data.billisworkflow) {
380
- this.billisworkflow = data.billisworkflow;
381
- }
382
- if (data.billapproveurl) {
383
- this.billapproveurl = data.billapproveurl;
384
- }
385
- if (data.uipro) {
386
- let pro = JSON.parse(data.uipro);
387
- if (pro.asyncImportExport === 'Y') {
388
- this.showAsyncImportExport = true;
389
- }
390
- if (pro.printMode === 'Y') {
391
- this.showBillPrintMode = true;
392
- }
393
- if (pro.contPrintMode === 'Y') {
394
- this.showBillContPrintMode = true;
395
- }
396
- }
397
- }
398
- },
399
- openDetailAppendix(e) {
400
- this.$refs.detailappendix.setReadOnly(e.readOnly);
401
- let data = this.getData();
402
- let obj = {};
403
- obj.billno = data[this.billKey];
404
- obj.billmoduleid = this.globalConfig.modulecode
405
- obj.idkey = e.rowinfo.row.ph_key;
406
- if (this.setDetailAppendix) {
407
- obj = this.setDetailAppendix(obj,e.rowinfo);
408
- }
409
- if (!obj.idkey) {
410
- this.alert('未设定附件绑定信息');
411
- return;
412
- }
413
- this.$refs.detailappendix.setData(obj.billno,obj.billmoduleid,obj.idkey);
414
- this.$refs.detailappendix.setReadOnly(e.readOnly);
415
- this.$nextTick(() => {
416
- if (e.readOnly) {
417
- let data = this.$refs.detailappendix.getData();
418
- if (data.length === 0) {
419
- this.alert('没有附件可查看');
420
- return;
421
- }
422
- }
423
- this.showDetailAppendix = true;
424
- })
425
- },
426
- doAction (action) {
427
- if (!action.name) {
428
- return;
429
- }
430
- if (action.name === 'actionappendix') {
431
- this.openDetailAppendix(action);
432
- return;
433
- }
434
- const method = action.name;
435
- if (this[method]) {
436
- this[method](action);
437
- } else {
438
- this.doPost(action);
439
- }
440
- },
441
- getActionMethod(action) {
442
- let name = action.name;
443
- const type = action.name;
444
- if (type === 'addData') {
445
- name = 'save';
446
- }
447
- if (type === 'saveData') {
448
- name = 'save';
449
- }
450
- if (type === 'delData') {
451
- name = 'save';
452
- }
453
- if (type === 'auditData') {
454
- name = 'billaudit';
455
- }
456
- if (type === 'cancelData') {
457
- name = 'billcancel';
458
- }
459
- if (type === 'voidData') {
460
- name = 'billvoid';
461
- }
462
- if (type === 'billImport' || type === 'importExcel') {
463
- name = 'importexcel';
464
- }
465
- if (type === 'copyData') {
466
- name = 'copy';
467
- }
468
- if (type === 'submitData') {
469
- name = 'billsubmit';
470
- }
471
- if (type === 'revokeData') {
472
- name = 'billrepeal';
473
- }
474
- if (this.getCustomActionMethod) {
475
- const temp = this.getCustomActionMethod(type, name);
476
- if(temp) {
477
- name = temp;
478
- }
479
- }
480
- return name;
481
- },
482
- doPost(action) {
483
- let flag = true;
484
- let self = this;
485
- this.loadingtext = self.getActionName(action);
486
- const methodAfter = action.name + 'After';
487
- let method = this.uiconfig.classPrefix + '.' + this.getActionMethod(action);
488
- this.showLoading();
489
- let postData = action.para;
490
- if (action.name === 'saveData') {
491
- postData = this.$refs.layout.getChangeData();
492
- }
493
- if (this.setChangeData) {
494
- postData = this.setChangeData(action);
495
- }
496
- self.asyncPost(this.uiconfig.resources, method, postData, function(data){
497
- let msg = self.loadingtext +'成功!';
498
- if (data.msg) {
499
- msg = data.msg;
500
- }
501
- self.hideLoading();
502
- self.$nextTick(() =>{
503
- setTimeout(() => {
504
- self.alert(msg,null,3);
505
- }, 250);
506
- });
507
-
508
- if (self.$refs.layout.setPhkey) {
509
- if (data instanceof Array) {
510
- if (data.length > 0) {
511
- self.$refs.layout.setPhkey(data[0][self.billKey]);
512
- }
513
- } else {
514
- if (data[self.billKey]) {
515
- self.$refs.layout.setPhkey(data[self.billKey]);
516
- }
517
- }
518
-
519
- }
520
-
521
- if (self[methodAfter]) {
522
- self[methodAfter](data);
523
- }
524
- if (action.onOk) {
525
- action.onOk(action, data);
526
- }
527
- },function(data) {
528
- const msg = self.loadingtext +'失败!' + data;
529
- self.hideLoading();
530
- self.$nextTick(() =>{
531
- setTimeout(() => {
532
- self.alert(msg,null,2);
533
- }, 250);
534
- });
535
- flag = false;
536
- },function(data) {
537
- const msg = self.loadingtext +'异常!' + data;
538
- self.hideLoading();
539
- self.$nextTick(() =>{
540
- setTimeout(() => {
541
- self.alert(msg,null,2);
542
- }, 250);
543
- });
544
- flag = false;
545
- });
546
- return flag;
547
- },
548
- getActionName(action) {
549
- let btnConfig = this.globalConfig.userModuleMethod.find(el => el.name === action.name);
550
- if (!btnConfig) {
551
- btnConfig = this.uiconfig.menuToolbar.items.find(el => el.name === action.name);
552
- }
553
- let text = '';
554
- if (btnConfig && btnConfig.text) {
555
- text = btnConfig.text;
556
- }
557
- if (this.getCustomActionName) {
558
- const temp = this.getCustomActionName(action.name, text);
559
- if(temp) {
560
- text = temp;
561
- }
562
- }
563
- return text;
564
- },
565
- // 下载导入模版
566
- downTemplate() {
567
- const url = this.uiconfig.resources;
568
- let param = this.getDownTemplateParam();
569
- let billImport = this.getBillImport();
570
- billImport.setModeltype('down');
571
- billImport.setDownUrl(url,param);
572
- },
573
- asyncExport(grid) {
574
- this.$refs.billAsyncImport.setResources(this.uiconfig.resources)
575
- this.$refs.billAsyncImport.setModeltype('export');
576
- this.$nextTick(() => {
577
- this.$refs.billAsyncImport.initData(null,this.globalConfig.modulecode,grid);
578
- this.$refs.billAsyncImport.setShowUpload(true);
579
- })
580
-
581
- },
582
- getDownTemplateParam () {
583
- if (this.customGetDownTemplateParam) {
584
- return this.customGetDownTemplateParam();
585
- } else {
586
- let obj = {};
587
- obj.billmoduleid = this.globalConfig.modulecode;
588
- return obj;
589
- }
590
- },
591
-
592
- // 导入
593
- billImport(action) {
594
- const url = this.uiconfig.resources;
595
- const method = this.uiconfig.classPrefix + '.' + this.getActionMethod(action);
596
- let para = this.getImportParam();
597
- if (this.showAsyncImportExport) {
598
- this.$refs.billAsyncImport.setResources(url);
599
- this.$refs.billAsyncImport.setModeltype('upload');
600
- this.$nextTick(() => {
601
- this.$refs.billAsyncImport.setUrl(url,method,para);
602
- this.$refs.billAsyncImport.initData(para.billno,null);
603
- this.$refs.billAsyncImport.setShowUpload(true);
604
- });
605
- } else {
606
- let billImport = this.getBillImport();
607
- billImport.setModeltype('upload');
608
- billImport.setUrl(url,method,para);
609
- billImport.setShowUpload(true);
610
- }
611
- },
612
- // 导入
613
- importExcel() {
614
- const url =this.uiconfig.resources;
615
- const classPrefix = this.uiconfig.classPrefix ;
616
- let para = this.getImportParam();
617
- let billImport = this.getBillImport();
618
- billImport.setUrl(url,classPrefix,para);
619
- billImport.setShowUpload(true);
620
- },
621
- // 导出
622
- billExport(action) {
623
- let url = this.uiconfig.resources;
624
- const method = this.uiconfig.classPrefix + '.' + this.getActionMethod(action);
625
- let param = this.getExportParam();
626
- let billImport = this.getBillImport();
627
- const cfg = billImport.config || {};
628
- const typeData = cfg.typeData || [];
629
- if (typeData.length <= 1) {
630
- this.doBillExport(url, method, param, this);
631
- return;
632
- }
633
- billImport.setExportUrl(url, method, param, typeData);
634
- },
635
- getExportParam() {
636
- if (this.customGetExportParam) {
637
- return this.customGetExportParam();
638
- }
639
-
640
- let data = this.getData();
641
- let obj = {};
642
- let name = 'billno';
643
- obj.billno = data[name];
644
- obj.billmoduleid = this.globalConfig.modulecode;
645
- if(data['mktcode']) {
646
- obj.mktcode = data['mktcode'];
647
- }
648
- return obj;
649
- },
650
-
651
- getBillImport() {
652
- return this.$refs.billImport;
653
- },
654
- getImportParam () {
655
- if (this.customGetImportParam) {
656
- return this.customGetImportParam();
657
- } else {
658
- let data = this.getData();
659
- let obj = {};
660
- obj[this.billKey] = data[this.billKey];
661
- let name = 'billno';
662
- if (this.uiconfig.billImportConfig.importKey) {
663
- name = this.uiconfig.billImportConfig.importKey;
664
- }
665
- obj.billno = data[name];
666
- obj.billmoduleid = this.globalConfig.modulecode;
667
- return obj;
668
- }
669
- },
670
- getHeadForm(name){
671
- if (this.$refs.layout && this.$refs.layout.getForm && this.$refs.layout.getForm()) {
672
- return this.$refs.layout.getForm().getForm(name);
673
- } else {
674
- return null;
675
- }
676
- },
677
- getDetail(name){
678
- if (this.$refs.layout && this.$refs.layout.getForm && this.$refs.layout.getForm()) {
679
- return this.$refs.layout.getForm().getDetail(name);
680
- } else {
681
- return null;
682
- }
683
- },
684
- getForm() {
685
- if (this.$refs.layout && this.$refs.layout.getForm) {
686
- return this.$refs.layout.getForm();
687
- } else {
688
- return null;
689
- }
690
- },
691
- getData() {
692
- if (this.$refs.layout && this.$refs.layout.getData) {
693
- return this.$refs.layout.getData();
694
- } else {
695
- return null;
696
- }
697
- },
698
- getTree () {
699
- if (this.$refs.layout && this.$refs.layout.getTree) {
700
- return this.$refs.layout.getTree();
701
- } else {
702
- return null;
703
- }
704
- },
705
- getTreeCondition() {
706
- if (this.$refs.layout && this.$refs.layout.getTreeCondition) {
707
- return this.$refs.layout.getTreeCondition();
708
- } else {
709
- return null;
710
- }
711
- },
712
- getBillQureyGrid () {
713
- if (this.$refs.layout && this.$refs.layout.getBillQureyGrid) {
714
- return this.$refs.layout.getBillQureyGrid();
715
- } else {
716
- return null;
717
- }
718
- },
719
- getMenuToolbar() {
720
- if (this.$refs.layout && this.$refs.layout.getMenuToolbar) {
721
- return this.$refs.layout.getMenuToolbar();
722
- } else {
723
- return null;
724
- }
725
- },
726
- getGrid () {
727
- if (this.$refs.layout && this.$refs.layout.getGrid) {
728
- return this.$refs.layout.getGrid();
729
- } else {
730
- return null;
731
- }
732
- },
733
- changedStatus(value) {
734
- this.$refs.layout.changedStatus(value);
735
- },
736
- initForm(data) {
737
- this.$refs.layout.initForm(data);
738
- },
739
- refurbish(value) {
740
- this.$refs.layout.refurbish(value);
741
- },
742
- setDetailVisible(name, value) {
743
- this.$refs.layout.setDetailVisible(name, value);
744
- },
745
- getSelectedNode(){
746
- if (this.$refs.layout && this.$refs.layout.getSelectedNode) {
747
- return this.$refs.layout.getSelectedNode();
748
- } else {
749
- return null;
750
- }
751
- },
752
- getDetailGrids(name) {
753
- if (this.$refs.layout && this.$refs.layout.getDetailGrids) {
754
- return this.$refs.layout.getDetailGrids(name);
755
- } else {
756
- return null;
757
- }
758
- },
759
- setEffectData(data) {
760
- this.$refs.layout.setEffectData(data);
761
- },
762
- getReportConfig () {
763
- let reportfile = '';
764
- let self = this;
765
- let searchParam = {'moduleid': this.globalConfig.modulecode};
766
- self.synchroPost(this.OmdUrl.mall, 'mss.base.reportconfig.search', searchParam, function (data) {
767
- if (data.reportconfig && data.reportconfig.length > 0) {
768
- reportfile =data.reportconfig[0].reportfile;
769
- }
770
- });
771
- return reportfile;
772
- },
773
- initBillApprovalData(obj) {
774
- let self = this;
775
- self.synchroPost(this.OmdUrl.mallmaster, 'master.mdm.portal.refurbishBillApproval', obj, function (data) {
776
- });
777
- },
778
- setDetailAppendixConfig(obj) {
779
- this.billDetailAppendixConfig = Object.assign({},this.billDetailAppendixConfig,obj);
780
- this.detalAppendixFlag = false;
781
- this.$nextTick(() => {
782
- this.detalAppendixFlag = true;
783
- });
784
- },
785
- itemPrintConfig(tmpvalue,list) {
786
- let value = this.$Method.copy(tmpvalue);
787
- if (value.type !== 'selection' && value.type !== 'index' && value.type !== 'PictureBox' && value.type !== 'FileBox' && value.type !== 'VideoBox') {
788
- let printConfig = {};
789
- printConfig.printname = value.label;
790
- printConfig.printtype = '4';
791
- let pro = {};
792
- if (value.type === 'ComboBox') {
793
- if (!value.data) {
794
- if (value.dictkey) {
795
- value.data = this.globalConfig.dictData[value.dictkey];
796
- }
797
- }
798
- }
799
- for (let el in value) {
800
- if (typeof value[el] !== "function") {
801
- pro[el] = value[el];
802
- if (el === 'data') {
803
- let data = [];
804
- if (value[el]) {
805
- let textField = 'name';
806
- let valueField = 'code';
807
- if (value.textField) {
808
- textField = value.textField;
809
- }
810
- if (value.valueField) {
811
- valueField = value.valueField;
812
- }
813
- value[el].forEach(el2 => {
814
- let tmp = {};
815
- tmp[textField] = el2[textField];
816
- tmp[valueField] = el2[valueField];
817
- data.push(tmp);
818
- });
819
- }
820
- pro.data = data;
821
- }
822
- }
823
- }
824
- if ('{}' != JSON.stringify(pro)) {
825
- printConfig.printpro = JSON.stringify(pro);
826
- }
827
- if (value.textName) {
828
- printConfig.printcode = value.textName;
829
- list.push(printConfig);
830
- } else if (value.sname) {
831
- if (value.type === 'DateRangeBox') {
832
- pro.type = 'DateBox';
833
- }
834
- if (value.type === 'NumberRangeBox') {
835
- pro.type = 'NumberBox';
836
- }
837
- let sconfig = this.$Method.copy(printConfig);
838
- sconfig.printname = sconfig.printname + '(开始)';
839
- sconfig.printcode = value.sname;
840
- list.push(sconfig);
841
- let econfig = this.$Method.copy(printConfig);
842
- econfig.printname = sconfig.printname + '(结束)';
843
- econfig.printcode = value.ename;
844
- list.push(econfig);
845
- } else {
846
- printConfig.printcode = value.name;
847
- list.push(printConfig);
848
- }
849
- }
850
- },
851
- initGridPrintConfig(el,list) {
852
- if (el.children && el.children.length > 0) {
853
- el.children.forEach(el2 => {
854
- this.initGridPrintConfig(el2,list);
855
- })
856
- } else {
857
- this.itemPrintConfig(el,list);
858
- }
859
- },
860
- getBillPrintConfig() {
861
- let billprintConfig = {};
862
- billprintConfig.modulecode = this.globalConfig.modulecode;
863
- billprintConfig.printcode = billprintConfig.modulecode;
864
- billprintConfig.printname = document.title;
865
- billprintConfig.printtype = '1';
866
- billprintConfig.parentid = '0';
867
- billprintConfig.children = [];
868
- let mainConfig = {};
869
- mainConfig.printcode = this.uiconfig.response;
870
- mainConfig.printname = '单据主表';
871
- mainConfig.printtype = '2';
872
- mainConfig.children = [];
873
- // if (this.uiconfig.layoutType === 'ListDetails') {
874
- if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType)) {
875
- this.uiconfig.detailConfig.formsConfig.items.forEach(el => {
876
- if(el.items) {
877
- el.items.forEach(el2 => {
878
- if (el2.label) {
879
- this.itemPrintConfig(el2,mainConfig.children);
880
- }
881
- })
882
- }
883
- });
884
- this.uiconfig.detailConfig.billDetailConfig.items.forEach(el => {
885
- if (el.type === 'EditGridCard') {
886
- let temp = {};
887
- temp.printcode = el.name;
888
- temp.printname = el.title;
889
- temp.printtype = '3';
890
- temp.children = [];
891
- el.items.forEach(el2 => {
892
- this.initGridPrintConfig(el2,temp.children);
893
- });
894
- mainConfig.children.push(temp);
895
- } else if (el.type === 'DetailsBox') {
896
- let temp = {};
897
- temp.printcode = el.name;
898
- temp.printname = el.formConfig.title;
899
- temp.printtype = '3';
900
- temp.children = [];
901
- el.formConfig.items.forEach(el2 => {
902
- this.itemPrintConfig(el2,temp.children);
903
- });
904
- mainConfig.children.push(temp);
905
- if (el.gridName) {
906
- let temp2 = {};
907
- temp2.printcode = el.gridName;
908
- temp2.printname = el.gridConfig.title;
909
- temp2.printtype = '3';
910
- temp2.children = [];
911
- el.gridConfig.items.forEach(el2 => {
912
- this.initGridPrintConfig(el2,temp.children);
913
- });
914
- mainConfig.children.push(temp2);
915
- }
916
-
917
- }
918
- });
919
- billprintConfig.children.push(mainConfig);
920
- }
921
- return billprintConfig;
922
- },
923
- printBillData() {
924
- this.loadingtext= '打印数据准备中....';
925
- this.showLoading();
926
- this.checkPrintConfig();
927
- },
928
- setPrintModeUrl (dataid) {
929
- let curlUrl = this.$Method.copy(this.billprintModeUrl);
930
- curlUrl = curlUrl.replace('{modulecode}',this.globalConfig.modulecode);
931
- curlUrl = curlUrl.replace('{dataid}',dataid);
932
- curlUrl = curlUrl.replace('{token}',this.getToken());
933
- curlUrl = curlUrl.replace('{mktcode}',this.printMkt());
934
- if (this.showBillContPrintMode) {
935
- curlUrl = curlUrl +'&contprint=Y'
936
- }
937
- // 打开打印模板
938
- this.printModeUrl = curlUrl;
939
- this.printModeReset = false;
940
- this.$nextTick(() => {
941
- this.printModeReset = true;
942
- this.$nextTick(() => {
943
- this.hideLoading();
944
- this.$nextTick(() => {
945
- this.showPrintMode = true;
946
- });
947
- });
948
- });
949
- },
950
-
951
- printMkt() {
952
- let tmp = this.$refs.layout.getData();
953
- if (tmp.mktcode) {
954
- return tmp.mktcode;
955
- }
956
- return '';
957
- },
958
- checkPrintConfig () {
959
- let flag = false;
960
- let para = {};
961
- let self = this;
962
- para.modulecode = this.globalConfig.modulecode;
963
- self.asyncPost(this.OmdUrl.sysconfboot, 'mss.sysconf.printconfig.checkPrintConfig', para, function (data) {
964
- if(data.flag === 'Y'){
965
- let dataid = self.savePrintData();
966
- self.setPrintModeUrl(dataid);
967
- } else {
968
- self.initPrintConfig();
969
- }
970
- });
971
- return flag;
972
- },
973
- initPrintConfig() {
974
- let self = this;
975
- let para = this.getBillPrintConfig();
976
- self.asyncPost(this.OmdUrl.sysconfboot, 'mss.sysconf.printconfig.initConfig', para, function (data) {
977
- if(data.flag === '1'){
978
- let dataid = self.savePrintData()
979
- self.setPrintModeUrl(dataid);
980
- }
981
- });
982
- },
983
- savePrintData() {
984
- let tmp = this.$refs.layout.getInitFormData();
985
- let dataid = '';
986
- let self = this;
987
- let para = {};
988
- let printdata ={};
989
- printdata.modulecode = this.globalConfig.modulecode;
990
- printdata.billkey = tmp.billkey;
991
- printdata.datapro = JSON.stringify(tmp.formdata);
992
- printdata.flag = 'I';
993
- para.printdata = printdata;
994
- self.synchroPost(this.OmdUrl.sysconfboot, 'mss.sysconf.printdata.savePrintData', para, function (data) {
995
- if(data.flag === '1'){
996
- dataid = data.dataid;
997
- }
998
- });
999
- return dataid;
1000
- },
1001
- asyncImportClose(value) {
1002
- if (!value) {
1003
- this.refurbish();
1004
- }
1005
- },
1006
- doImportSuccess() {
1007
- this.refurbish();
1008
- },
1009
- setHideDividerValue(value) {
1010
- this.$refs.layout.setHideDividerValue(value);
1011
- },
1012
- handleSuccessAfter(response, file, fileList) {
1013
- this.$emit('handleSuccessAfter' , response, file, fileList);
1014
- }
1015
- },
1016
- watch: {
1017
- showDetailAppendix(value) {
1018
- if (!value) {
1019
- this.$nextTick(() => {
1020
- if (this.shutDownDetailAppendix) {
1021
- this.shutDownDetailAppendix();
1022
- }
1023
- });
1024
- }
1025
- }
1026
- },
1027
- };
1028
- </script>
1
+ <script>
2
+ import load from '@/components/base/load';
3
+ import Cookies from 'js-cookie';
4
+ export default {
5
+ name:'mbase',
6
+ mixins: [load],
7
+ data() {
8
+ return {
9
+ globalConfig:{
10
+ dictkey:[],
11
+ dictData:{},
12
+ userModuleMethod:[],
13
+ modulecode:'',
14
+ billmain:{},
15
+ dictgroupkey:[]
16
+ },
17
+ billapproveurl:'',
18
+ billKey:'ph_key',
19
+ uiconfig:{},
20
+ uiproconfig:[],
21
+ usercustominfo:{},
22
+ cout:0,
23
+ showDetailAppendix:false,
24
+ detalAppendixFlag:true,
25
+ billDetailAppendixConfig:{
26
+ showTitle:false,
27
+ scenetype:'4'
28
+ },
29
+ billAsyncImportConfig:{
30
+
31
+ },
32
+ billImportConfig:{
33
+ importKey:'billno',
34
+ typeData:[]
35
+ },
36
+ importReset:true,
37
+ printModeReset:true,
38
+ showBillPrintMode:false,
39
+ showAsyncImportExport:false,
40
+ showBillContPrintMode:false,
41
+ showPrintMode:false,
42
+ billprintModeUrl:'/widgetmodelv3/#/bill-print?modulecode={modulecode}&dataid={dataid}&mktcode={mktcode}&token={token}',
43
+ printModeUrl:'',
44
+ eventObject:['valueChanged','setDataBefore','searchBefore','cellbeginedit','importSuccess','addRowBefore','indexMethod','delRowBefore','delRowAfter','onSelectionChange','formatValue','updateCellConfig','overrideSearchParam','overrideData','refurbishCheck','onSingleChange','onSetRowCheck','onSelect','onSelectCancel','onSelectionChange','customSummary','customImgPath','onDelTag','onSearch','onAppend','filterData','onAddTag','getDictData','setLabel','setImportUrl','onLinkTo','newSaveFormBefore','setQueryConfig','setNodeClass','setTreeNodeIcon','rowClassName','customSummaryGroup','disabledDate'],
45
+ layoutTypeList:['ListDetails','ListDetailsV2','BillListDetails','ListDetailsV3']
46
+ };
47
+ },
48
+ computed: {
49
+ uiLayoutType () {
50
+ return 'm' + this.uiconfig.layoutType;
51
+ }
52
+ },
53
+ created () {
54
+ if (JSON.stringify(this.config) !== '{}') {
55
+ if (this.config.eventObject) {
56
+ Object.assign(this,this.config.eventObject);
57
+ }
58
+ this.uiconfig = Object.assign({},this.uiconfig, this.config);
59
+ delete this.uiconfig.eventObject;
60
+ this.init();
61
+ if (this.customInit) {
62
+ this.customInit();
63
+ }
64
+ }
65
+ },
66
+
67
+ props:{
68
+ config: {
69
+ type:Object,
70
+ default () {
71
+ return {};
72
+ }
73
+ }
74
+ } ,
75
+ methods:{
76
+ initConfig(config,obj) {
77
+ this.uiconfig = config;
78
+ Object.assign(this,obj);
79
+ this.init();
80
+ if (this.customInit) {
81
+ this.customInit();
82
+ }
83
+ },
84
+ saveGridCol (obj) {
85
+ let para = {};
86
+ para.aid = Cookies.get('user_id') ? Cookies.get('user_id'): 0 ;
87
+ para.sid = Cookies.get('stationId') ? Cookies.get('stationId'): 0 ;
88
+ para.modulecode = this.globalConfig.modulecode;
89
+ para.colset = JSON.stringify(obj.para);
90
+ this.asyncPost(this.OmdUrl.amp, 'usercenter.usercustominfo.saveColset', para, function (data) {
91
+
92
+ });
93
+ },
94
+ saveScene (obj) {
95
+ let para = {};
96
+ para.aid = Cookies.get('user_id') ? Cookies.get('user_id'): 0 ;
97
+ para.sid = Cookies.get('stationId') ? Cookies.get('stationId'): 0 ;
98
+ para.modulecode = this.globalConfig.modulecode;
99
+ para.filterscene = JSON.stringify(obj.para);
100
+ this.asyncPost(this.OmdUrl.amp, 'usercenter.usercustominfo.saveScene', para, function (data) {
101
+
102
+ });
103
+ },
104
+ getUserCustomInfo () {
105
+ let self = this;
106
+ let para = {};
107
+ para.aid = Cookies.get('user_id') ? Cookies.get('user_id'): 0 ;
108
+ para.sid = Cookies.get('stationId') ? Cookies.get('stationId'): 0 ;
109
+ para.modulecode = this.globalConfig.modulecode;
110
+ self.synchroPost(this.OmdUrl.amp, 'usercenter.usercustominfo.getUserInfo', para, function (data) {
111
+ if (data.usercustominfo) {
112
+ self.usercustominfo = data.usercustominfo;
113
+ }
114
+ });
115
+ },
116
+ getUiCustomInfo () {
117
+ let self = this;
118
+ let para = {};
119
+ para.modulecode = this.globalConfig.modulecode;
120
+ self.synchroPost(this.OmdUrl.amp, 'usercenter.uiproconfig.search', para, function (data) {
121
+ if (data.uiproconfig && data.uiproconfig.length > 0 && data.uiproconfig[0].layoutPro) {
122
+ self.uiproconfig = JSON.parse(data.uiproconfig[0].layoutPro);
123
+ }
124
+ });
125
+ },
126
+ init() {
127
+ // 处理模块号提示
128
+ this.globalConfig.modulecode = this.$Method.getUrlParam('modulecode');
129
+ if (!this.globalConfig.modulecode) {
130
+ this.globalConfig.modulecode = this.$Method.getUrlParam('billmoduleid');
131
+ }
132
+ if (this.billmoduleid) {
133
+ this.globalConfig.modulecode = this.billmoduleid;
134
+ }
135
+
136
+ if ( this.uiconfig.layoutType !== 'BirtReport') {
137
+ if (this.OmdUrl[this.uiconfig.resources]) {
138
+ this.uiconfig.resources = this.OmdUrl[this.uiconfig.resources];
139
+ }
140
+ }
141
+
142
+ if (this.uiconfig.billKey) {
143
+ this.billKey = this.uiconfig.billKey;
144
+ }
145
+
146
+ this.setUserModuleMethod();
147
+ this.getUiCustomInfo();
148
+ let tmp = {};
149
+ this.initUiConfig(this.uiconfig,tmp);
150
+ this.initUiCustomConfig();
151
+ // if (this.uiconfig.layoutType === 'ListDetails') {
152
+ if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType)) {
153
+ this.getUserCustomInfo();
154
+ this.uiconfig.billQueryConfig.usercustominfo = this.$Method.copy(this.usercustominfo);
155
+ if (this.billisworkflow) {
156
+ this.uiconfig.detailConfig.billisworkflow = this.billisworkflow;
157
+ }
158
+ }
159
+ if (this.billapproveurl) {
160
+ this.uiconfig.detailConfig.billapproveurl = this.billapproveurl;
161
+ }
162
+
163
+ if (this.uiconfig.billImportConfig) {
164
+ this.billImportConfig = Object.assign({}, {}, this.uiconfig.billImportConfig);
165
+ }
166
+
167
+ if(this.showAsyncImportExport) {
168
+ if(this.uiconfig.billImportConfig) {
169
+ this.billAsyncImportConfig = Object.assign({}, this.billAsyncImportConfig, this.uiconfig.billImportConfig);
170
+ }
171
+
172
+ if (!this.billAsyncImportConfig.resources) {
173
+ this.billAsyncImportConfig.resources = this.uiconfig.resources;
174
+ }
175
+ }
176
+
177
+ this.uiconfig.showAsyncImportExport = this.showAsyncImportExport;
178
+ if (this.uiconfig.detailConfig) {
179
+ this.uiconfig.detailConfig.showAsyncImportExport = this.showAsyncImportExport;
180
+ }
181
+ if (this.showBillPrintMode || this.showBillContPrintMode) {
182
+ if (!this.uiconfig.billPrintConfig) {
183
+ this.uiconfig.billPrintConfig = {};
184
+ }
185
+ this.uiconfig.billPrintConfig.showPrint = this.showBillPrintMode;
186
+ this.uiconfig.billPrintConfig.showContPrint = this.showBillContPrintMode;
187
+ }
188
+ let accounType = Cookies.get('accounType');
189
+ if (accounType) {
190
+ if (accounType === '1' || accounType === '2') {
191
+ this.uiconfig.menuToolbar.enablePermissions = false;
192
+ }
193
+ }
194
+ this.setDictData();
195
+ this.importReset = false;
196
+ this.$nextTick(() => {
197
+ this.importReset = true;
198
+ });
199
+ },
200
+ initUiConfig(obj,tmp) {
201
+ if (obj instanceof Array) {
202
+ obj.forEach(el => {
203
+ this.initUiConfig(el,tmp);
204
+ })
205
+ } else {
206
+ if (obj instanceof Object) {
207
+ for (let pro in obj) {
208
+ if (obj[pro] instanceof Array || obj[pro] instanceof Object) {
209
+ if (pro === 'data') {
210
+ continue;
211
+ }
212
+ this.initUiConfig(obj[pro],tmp);
213
+ } else {
214
+ if (pro === 'dictkey') {
215
+ if (!tmp[obj[pro]]) {
216
+ tmp[obj[pro]] = 'Y';
217
+ this.globalConfig.dictkey.push(obj[pro]);
218
+ }
219
+ }
220
+ if (this._isFun(pro)) {
221
+ obj[pro] = this[obj[pro]];
222
+ }
223
+ }
224
+ }
225
+ }
226
+
227
+ }
228
+ },
229
+ initUiCustomConfig () {
230
+ this.uiproconfig.forEach(el => {
231
+ if (el.pro && el.pro.length > 0) {
232
+ if (el.isflag === '1') {
233
+ // if (this.uiconfig.layoutType === 'ListDetails') {
234
+ if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType)) {
235
+ el.pro.forEach(el2 => {
236
+ this.commonUiCustomConfig(el2,this.uiconfig.billQueryConfig.gridConfig.items);
237
+ })
238
+ }
239
+ if (this.uiconfig.layoutType === 'LeftListRightList' || this.uiconfig.layoutType === 'LeftListRightDetails') {
240
+ el.pro.forEach(el2 => {
241
+ this.commonUiCustomConfig(el2,this.uiconfig.gridConfig.items);
242
+ })
243
+ }
244
+ }
245
+ if (el.isflag === '2') {
246
+ // if (this.uiconfig.layoutType === 'ListDetails' || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
247
+ if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType) || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
248
+ el.pro.forEach(el2 => {
249
+ this.commonUiCustomConfig2(el2,this.uiconfig.detailConfig.formsConfig.items);
250
+ });
251
+ }
252
+ }
253
+ if (el.isflag === '3') {
254
+ // if (this.uiconfig.layoutType === 'ListDetails' || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
255
+ if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType) || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
256
+ let index = this.uiconfig.detailConfig.formsConfig.items.findIndex(el3 => el3.name === el.typename);
257
+ if (index > -1) {
258
+ el.pro.forEach(el2 => {
259
+ this.commonUiCustomConfig(el2,this.uiconfig.detailConfig.formsConfig.items[index].items);
260
+ });
261
+ }
262
+
263
+ }
264
+ }
265
+ if (el.isflag === '4') {
266
+ // if (this.uiconfig.layoutType === 'ListDetails' || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
267
+ if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType) || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
268
+ if (this.uiconfig.detailConfig.billDetailConfig && this.uiconfig.detailConfig.billDetailConfig.items) {
269
+ el.pro.forEach(el2 => {
270
+ this.commonUiCustomConfig2(el2,this.uiconfig.detailConfig.billDetailConfig.items);
271
+ });
272
+ }
273
+ }
274
+ if (this.uiconfig.layoutType === 'LeftListRightList') {
275
+ el.pro.forEach(el2 => {
276
+ this.commonUiCustomConfig2(el2,this.uiconfig.detailGridsConfig);
277
+ });
278
+ }
279
+ }
280
+ if (el.isflag === '5') {
281
+ // if (this.uiconfig.layoutType === 'ListDetails' || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
282
+ if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType) || this.uiconfig.layoutType === 'LeftListRightDetails' || this.uiconfig.layoutType === 'LeftTreeRightDetails') {
283
+ if (this.uiconfig.detailConfig.billDetailConfig && this.uiconfig.detailConfig.billDetailConfig.items) {
284
+ let index = this.uiconfig.detailConfig.billDetailConfig.items.findIndex(el3 => el3.name === el.typename);
285
+ if (index > -1) {
286
+ el.pro.forEach(el2 => {
287
+ if (this.uiconfig.detailConfig.billDetailConfig.items[index].type === 'EditGridCard') {
288
+ this.commonUiCustomConfig(el2,this.uiconfig.detailConfig.billDetailConfig.items[index].items);
289
+ } else {
290
+ this.commonUiCustomConfig(el2,this.uiconfig.detailConfig.billDetailConfig.items[index].formCondig.items);
291
+ this.commonUiCustomConfig(el2,this.uiconfig.detailConfig.billDetailConfig.items[index].gridCondig.items);
292
+ }
293
+ });
294
+ }
295
+ }
296
+ }
297
+ if (this.uiconfig.layoutType === 'LeftListRightList') {
298
+ let index = this.uiconfig.detailGridsConfig.findIndex(el3 => el3.name === el.typename);
299
+ if (index > -1) {
300
+ el.pro.forEach(el2 => {
301
+ this.commonUiCustomConfig(el2,this.uiconfig.detailGridsConfig.items[index].items);
302
+ });
303
+ }
304
+ }
305
+
306
+ if (this.uiconfig.layoutType === 'BillSingleGrid') {
307
+ el.pro.forEach(el2 => {
308
+ this.commonUiCustomConfig(el2,this.uiconfig.gridConfig.items);
309
+ });
310
+ }
311
+ }
312
+ }
313
+ });
314
+
315
+ },
316
+ commonUiCustomConfig(obj,items) {
317
+ let index = items.findIndex(el => el.name === obj.fieldname || el.sname === obj.fieldname);
318
+ if (index > -1) {
319
+ let tmp = {};
320
+ if (obj.fieldtext) {
321
+ tmp.label = obj.fieldtext
322
+ }
323
+ if (obj.fieldwidth) {
324
+ tmp.width = Number(obj.fieldwidth);
325
+ }
326
+ if (obj.fieldcol) {
327
+ tmp.colNum = Number(obj.fieldcol);
328
+ }
329
+ if (obj.fieldvisible) {
330
+ tmp.visible = false;
331
+ }
332
+ if (obj.fieldrequired) {
333
+ tmp.required = true;
334
+ }
335
+ if (obj.defaultValue) {
336
+ tmp.defaultValue = obj.defaultValue;
337
+ }
338
+ Object.assign(items[index], tmp);
339
+ }
340
+ },
341
+ commonUiCustomConfig2(obj,items) {
342
+ let index = items.findIndex(el => el.name === obj.fieldname );
343
+ if (index > -1) {
344
+ let tmp = {};
345
+ if (obj.fieldtext) {
346
+ tmp.title = obj.fieldtext
347
+ }
348
+ if (obj.fieldvisible) {
349
+ tmp.visible = false;
350
+ }
351
+ Object.assign(items[index], tmp);
352
+ }
353
+ },
354
+ _isFun (pro) {
355
+ let index = this.eventObject.findIndex(el => el === pro);
356
+ if (index > -1) {
357
+ return true;
358
+ } else {
359
+ return false;
360
+ }
361
+ },
362
+ setDictData() {
363
+ // 调用字典方法
364
+ if (this.globalConfig.dictkey.length > 0) {
365
+ const dictkey = this.globalConfig.dictkey.join(',');
366
+ this.globalConfig.dictData = this.getDict(dictkey,'code,name,pcode,pro1,ddvalue');
367
+ }
368
+ // 自定义添加
369
+ if (this.initUserDict) {
370
+ Object.assign(this.globalConfig.dictData, this.initUserDict());
371
+ }
372
+ },
373
+ setUserModuleMethod() {
374
+ let data = this.getUserModuleMethod(this.globalConfig.modulecode);
375
+ if (data) {
376
+ if (data.modulemethod) {
377
+ this.globalConfig.userModuleMethod = this.$Method.copy(data.modulemethod);
378
+ }
379
+ if (data.billisworkflow) {
380
+ this.billisworkflow = data.billisworkflow;
381
+ }
382
+ if (data.billapproveurl) {
383
+ this.billapproveurl = data.billapproveurl;
384
+ }
385
+ if (data.uipro) {
386
+ let pro = JSON.parse(data.uipro);
387
+ if (pro.asyncImportExport === 'Y') {
388
+ this.showAsyncImportExport = true;
389
+ }
390
+ if (pro.printMode === 'Y') {
391
+ this.showBillPrintMode = true;
392
+ }
393
+ if (pro.contPrintMode === 'Y') {
394
+ this.showBillContPrintMode = true;
395
+ }
396
+ }
397
+ }
398
+ },
399
+ openDetailAppendix(e) {
400
+ this.$refs.detailappendix.setReadOnly(e.readOnly);
401
+ let data = this.getData();
402
+ let obj = {};
403
+ obj.billno = data[this.billKey];
404
+ obj.billmoduleid = this.globalConfig.modulecode
405
+ obj.idkey = e.rowinfo.row.ph_key;
406
+ if (this.setDetailAppendix) {
407
+ obj = this.setDetailAppendix(obj,e.rowinfo);
408
+ }
409
+ if (!obj.idkey) {
410
+ this.alert('未设定附件绑定信息');
411
+ return;
412
+ }
413
+ this.$refs.detailappendix.setData(obj.billno,obj.billmoduleid,obj.idkey);
414
+ this.$refs.detailappendix.setReadOnly(e.readOnly);
415
+ this.$nextTick(() => {
416
+ if (e.readOnly) {
417
+ let data = this.$refs.detailappendix.getData();
418
+ if (data.length === 0) {
419
+ this.alert('没有附件可查看');
420
+ return;
421
+ }
422
+ }
423
+ this.showDetailAppendix = true;
424
+ })
425
+ },
426
+ doAction (action) {
427
+ if (!action.name) {
428
+ return;
429
+ }
430
+ if (action.name === 'actionappendix') {
431
+ this.openDetailAppendix(action);
432
+ return;
433
+ }
434
+ const method = action.name;
435
+ if (this[method]) {
436
+ this[method](action);
437
+ } else {
438
+ this.doPost(action);
439
+ }
440
+ },
441
+ getActionMethod(action) {
442
+ let name = action.name;
443
+ const type = action.name;
444
+ if (type === 'addData') {
445
+ name = 'save';
446
+ }
447
+ if (type === 'saveData') {
448
+ name = 'save';
449
+ }
450
+ if (type === 'delData') {
451
+ name = 'save';
452
+ }
453
+ if (type === 'auditData') {
454
+ name = 'billaudit';
455
+ }
456
+ if (type === 'cancelData') {
457
+ name = 'billcancel';
458
+ }
459
+ if (type === 'voidData') {
460
+ name = 'billvoid';
461
+ }
462
+ if (type === 'billImport' || type === 'importExcel') {
463
+ name = 'importexcel';
464
+ }
465
+ if (type === 'copyData') {
466
+ name = 'copy';
467
+ }
468
+ if (type === 'submitData') {
469
+ name = 'billsubmit';
470
+ }
471
+ if (type === 'revokeData') {
472
+ name = 'billrepeal';
473
+ }
474
+ if (this.getCustomActionMethod) {
475
+ const temp = this.getCustomActionMethod(type, name);
476
+ if(temp) {
477
+ name = temp;
478
+ }
479
+ }
480
+ return name;
481
+ },
482
+ doPost(action) {
483
+ let flag = true;
484
+ let self = this;
485
+ this.loadingtext = self.getActionName(action);
486
+ const methodAfter = action.name + 'After';
487
+ let method = this.uiconfig.classPrefix + '.' + this.getActionMethod(action);
488
+ this.showLoading();
489
+ let postData = action.para;
490
+ if (action.name === 'saveData') {
491
+ postData = this.$refs.layout.getChangeData();
492
+ }
493
+ if (this.setChangeData) {
494
+ postData = this.setChangeData(action);
495
+ }
496
+ self.asyncPost(this.uiconfig.resources, method, postData, function(data){
497
+ let msg = self.loadingtext +'成功!';
498
+ if (data.msg) {
499
+ msg = data.msg;
500
+ }
501
+ self.hideLoading();
502
+ self.$nextTick(() =>{
503
+ setTimeout(() => {
504
+ self.alert(msg,null,3);
505
+ }, 250);
506
+ });
507
+
508
+ if (self.$refs.layout.setPhkey) {
509
+ if (data instanceof Array) {
510
+ if (data.length > 0) {
511
+ self.$refs.layout.setPhkey(data[0][self.billKey]);
512
+ }
513
+ } else {
514
+ if (data[self.billKey]) {
515
+ self.$refs.layout.setPhkey(data[self.billKey]);
516
+ }
517
+ }
518
+
519
+ }
520
+
521
+ if (self[methodAfter]) {
522
+ self[methodAfter](data);
523
+ }
524
+ if (action.onOk) {
525
+ action.onOk(action, data);
526
+ }
527
+ },function(data) {
528
+ const msg = self.loadingtext +'失败!' + data;
529
+ self.hideLoading();
530
+ self.$nextTick(() =>{
531
+ setTimeout(() => {
532
+ self.alert(msg,null,2);
533
+ }, 250);
534
+ });
535
+ flag = false;
536
+ },function(data) {
537
+ const msg = self.loadingtext +'异常!' + data;
538
+ self.hideLoading();
539
+ self.$nextTick(() =>{
540
+ setTimeout(() => {
541
+ self.alert(msg,null,2);
542
+ }, 250);
543
+ });
544
+ flag = false;
545
+ });
546
+ return flag;
547
+ },
548
+ getActionName(action) {
549
+ let btnConfig = this.globalConfig.userModuleMethod.find(el => el.name === action.name);
550
+ if (!btnConfig) {
551
+ btnConfig = this.uiconfig.menuToolbar.items.find(el => el.name === action.name);
552
+ }
553
+ let text = '';
554
+ if (btnConfig && btnConfig.text) {
555
+ text = btnConfig.text;
556
+ }
557
+ if (this.getCustomActionName) {
558
+ const temp = this.getCustomActionName(action.name, text);
559
+ if(temp) {
560
+ text = temp;
561
+ }
562
+ }
563
+ return text;
564
+ },
565
+ // 下载导入模版
566
+ downTemplate() {
567
+ const url = this.uiconfig.resources;
568
+ let param = this.getDownTemplateParam();
569
+ let billImport = this.getBillImport();
570
+ billImport.setModeltype('down');
571
+ billImport.setDownUrl(url,param);
572
+ },
573
+ asyncExport(grid) {
574
+ this.$refs.billAsyncImport.setResources(this.uiconfig.resources)
575
+ this.$refs.billAsyncImport.setModeltype('export');
576
+ this.$nextTick(() => {
577
+ this.$refs.billAsyncImport.initData(null,this.globalConfig.modulecode,grid);
578
+ this.$refs.billAsyncImport.setShowUpload(true);
579
+ })
580
+
581
+ },
582
+ getDownTemplateParam () {
583
+ if (this.customGetDownTemplateParam) {
584
+ return this.customGetDownTemplateParam();
585
+ } else {
586
+ let obj = {};
587
+ obj.billmoduleid = this.globalConfig.modulecode;
588
+ return obj;
589
+ }
590
+ },
591
+
592
+ // 导入
593
+ billImport(action) {
594
+ const url = this.uiconfig.resources;
595
+ const method = this.uiconfig.classPrefix + '.' + this.getActionMethod(action);
596
+ let para = this.getImportParam();
597
+ if (this.showAsyncImportExport) {
598
+ this.$refs.billAsyncImport.setResources(url);
599
+ this.$refs.billAsyncImport.setModeltype('upload');
600
+ this.$nextTick(() => {
601
+ this.$refs.billAsyncImport.setUrl(url,method,para);
602
+ this.$refs.billAsyncImport.initData(para.billno,null);
603
+ this.$refs.billAsyncImport.setShowUpload(true);
604
+ });
605
+ } else {
606
+ let billImport = this.getBillImport();
607
+ billImport.setModeltype('upload');
608
+ billImport.setUrl(url,method,para);
609
+ billImport.setShowUpload(true);
610
+ }
611
+ },
612
+ // 导入
613
+ importExcel() {
614
+ const url =this.uiconfig.resources;
615
+ const classPrefix = this.uiconfig.classPrefix ;
616
+ let para = this.getImportParam();
617
+ let billImport = this.getBillImport();
618
+ billImport.setUrl(url,classPrefix,para);
619
+ billImport.setShowUpload(true);
620
+ },
621
+ // 导出
622
+ billExport(action) {
623
+ let url = this.uiconfig.resources;
624
+ const method = this.uiconfig.classPrefix + '.' + this.getActionMethod(action);
625
+ let param = this.getExportParam();
626
+ let billImport = this.getBillImport();
627
+ const cfg = billImport.config || {};
628
+ const typeData = cfg.typeData || [];
629
+ if (typeData.length <= 1) {
630
+ this.doBillExport(url, method, param, this);
631
+ return;
632
+ }
633
+ billImport.setExportUrl(url, method, param, typeData);
634
+ },
635
+ getExportParam() {
636
+ if (this.customGetExportParam) {
637
+ return this.customGetExportParam();
638
+ }
639
+
640
+ let data = this.getData();
641
+ let obj = {};
642
+ let name = 'billno';
643
+ obj.billno = data[name];
644
+ obj.billmoduleid = this.globalConfig.modulecode;
645
+ if(data['mktcode']) {
646
+ obj.mktcode = data['mktcode'];
647
+ }
648
+ return obj;
649
+ },
650
+
651
+ getBillImport() {
652
+ return this.$refs.billImport;
653
+ },
654
+ getImportParam () {
655
+ if (this.customGetImportParam) {
656
+ return this.customGetImportParam();
657
+ } else {
658
+ let data = this.getData();
659
+ let obj = {};
660
+ obj[this.billKey] = data[this.billKey];
661
+ let name = 'billno';
662
+ if (this.uiconfig.billImportConfig.importKey) {
663
+ name = this.uiconfig.billImportConfig.importKey;
664
+ }
665
+ obj.billno = data[name];
666
+ obj.billmoduleid = this.globalConfig.modulecode;
667
+ return obj;
668
+ }
669
+ },
670
+ getHeadForm(name){
671
+ if (this.$refs.layout && this.$refs.layout.getForm && this.$refs.layout.getForm()) {
672
+ return this.$refs.layout.getForm().getForm(name);
673
+ } else {
674
+ return null;
675
+ }
676
+ },
677
+ getDetail(name){
678
+ if (this.$refs.layout && this.$refs.layout.getForm && this.$refs.layout.getForm()) {
679
+ return this.$refs.layout.getForm().getDetail(name);
680
+ } else {
681
+ return null;
682
+ }
683
+ },
684
+ getForm() {
685
+ if (this.$refs.layout && this.$refs.layout.getForm) {
686
+ return this.$refs.layout.getForm();
687
+ } else {
688
+ return null;
689
+ }
690
+ },
691
+ getData() {
692
+ if (this.$refs.layout && this.$refs.layout.getData) {
693
+ return this.$refs.layout.getData();
694
+ } else {
695
+ return null;
696
+ }
697
+ },
698
+ getTree () {
699
+ if (this.$refs.layout && this.$refs.layout.getTree) {
700
+ return this.$refs.layout.getTree();
701
+ } else {
702
+ return null;
703
+ }
704
+ },
705
+ getTreeCondition() {
706
+ if (this.$refs.layout && this.$refs.layout.getTreeCondition) {
707
+ return this.$refs.layout.getTreeCondition();
708
+ } else {
709
+ return null;
710
+ }
711
+ },
712
+ getBillQureyGrid () {
713
+ if (this.$refs.layout && this.$refs.layout.getBillQureyGrid) {
714
+ return this.$refs.layout.getBillQureyGrid();
715
+ } else {
716
+ return null;
717
+ }
718
+ },
719
+ getMenuToolbar() {
720
+ if (this.$refs.layout && this.$refs.layout.getMenuToolbar) {
721
+ return this.$refs.layout.getMenuToolbar();
722
+ } else {
723
+ return null;
724
+ }
725
+ },
726
+ getGrid () {
727
+ if (this.$refs.layout && this.$refs.layout.getGrid) {
728
+ return this.$refs.layout.getGrid();
729
+ } else {
730
+ return null;
731
+ }
732
+ },
733
+ changedStatus(value) {
734
+ this.$refs.layout.changedStatus(value);
735
+ },
736
+ initForm(data) {
737
+ this.$refs.layout.initForm(data);
738
+ },
739
+ refurbish(value) {
740
+ this.$refs.layout.refurbish(value);
741
+ },
742
+ setDetailVisible(name, value) {
743
+ this.$refs.layout.setDetailVisible(name, value);
744
+ },
745
+ getSelectedNode(){
746
+ if (this.$refs.layout && this.$refs.layout.getSelectedNode) {
747
+ return this.$refs.layout.getSelectedNode();
748
+ } else {
749
+ return null;
750
+ }
751
+ },
752
+ getDetailGrids(name) {
753
+ if (this.$refs.layout && this.$refs.layout.getDetailGrids) {
754
+ return this.$refs.layout.getDetailGrids(name);
755
+ } else {
756
+ return null;
757
+ }
758
+ },
759
+ setEffectData(data) {
760
+ this.$refs.layout.setEffectData(data);
761
+ },
762
+ getReportConfig () {
763
+ let reportfile = '';
764
+ let self = this;
765
+ let searchParam = {'moduleid': this.globalConfig.modulecode};
766
+ self.synchroPost(this.OmdUrl.mall, 'mss.base.reportconfig.search', searchParam, function (data) {
767
+ if (data.reportconfig && data.reportconfig.length > 0) {
768
+ reportfile =data.reportconfig[0].reportfile;
769
+ }
770
+ });
771
+ return reportfile;
772
+ },
773
+ initBillApprovalData(obj) {
774
+ let self = this;
775
+ self.synchroPost(this.OmdUrl.mallmaster, 'master.mdm.portal.refurbishBillApproval', obj, function (data) {
776
+ });
777
+ },
778
+ setDetailAppendixConfig(obj) {
779
+ this.billDetailAppendixConfig = Object.assign({},this.billDetailAppendixConfig,obj);
780
+ this.detalAppendixFlag = false;
781
+ this.$nextTick(() => {
782
+ this.detalAppendixFlag = true;
783
+ });
784
+ },
785
+ itemPrintConfig(tmpvalue,list) {
786
+ let value = this.$Method.copy(tmpvalue);
787
+ if (value.type !== 'selection' && value.type !== 'index' && value.type !== 'PictureBox' && value.type !== 'FileBox' && value.type !== 'VideoBox') {
788
+ let printConfig = {};
789
+ printConfig.printname = value.label;
790
+ printConfig.printtype = '4';
791
+ let pro = {};
792
+ if (value.type === 'ComboBox') {
793
+ if (!value.data) {
794
+ if (value.dictkey) {
795
+ value.data = this.globalConfig.dictData[value.dictkey];
796
+ }
797
+ }
798
+ }
799
+ for (let el in value) {
800
+ if (typeof value[el] !== "function") {
801
+ pro[el] = value[el];
802
+ if (el === 'data') {
803
+ let data = [];
804
+ if (value[el]) {
805
+ let textField = 'name';
806
+ let valueField = 'code';
807
+ if (value.textField) {
808
+ textField = value.textField;
809
+ }
810
+ if (value.valueField) {
811
+ valueField = value.valueField;
812
+ }
813
+ value[el].forEach(el2 => {
814
+ let tmp = {};
815
+ tmp[textField] = el2[textField];
816
+ tmp[valueField] = el2[valueField];
817
+ data.push(tmp);
818
+ });
819
+ }
820
+ pro.data = data;
821
+ }
822
+ }
823
+ }
824
+ if ('{}' != JSON.stringify(pro)) {
825
+ printConfig.printpro = JSON.stringify(pro);
826
+ }
827
+ if (value.textName) {
828
+ printConfig.printcode = value.textName;
829
+ list.push(printConfig);
830
+ } else if (value.sname) {
831
+ if (value.type === 'DateRangeBox') {
832
+ pro.type = 'DateBox';
833
+ }
834
+ if (value.type === 'NumberRangeBox') {
835
+ pro.type = 'NumberBox';
836
+ }
837
+ let sconfig = this.$Method.copy(printConfig);
838
+ sconfig.printname = sconfig.printname + '(开始)';
839
+ sconfig.printcode = value.sname;
840
+ list.push(sconfig);
841
+ let econfig = this.$Method.copy(printConfig);
842
+ econfig.printname = sconfig.printname + '(结束)';
843
+ econfig.printcode = value.ename;
844
+ list.push(econfig);
845
+ } else {
846
+ printConfig.printcode = value.name;
847
+ list.push(printConfig);
848
+ }
849
+ }
850
+ },
851
+ initGridPrintConfig(el,list) {
852
+ if (el.children && el.children.length > 0) {
853
+ el.children.forEach(el2 => {
854
+ this.initGridPrintConfig(el2,list);
855
+ })
856
+ } else {
857
+ this.itemPrintConfig(el,list);
858
+ }
859
+ },
860
+ getBillPrintConfig() {
861
+ let billprintConfig = {};
862
+ billprintConfig.modulecode = this.globalConfig.modulecode;
863
+ billprintConfig.printcode = billprintConfig.modulecode;
864
+ billprintConfig.printname = document.title;
865
+ billprintConfig.printtype = '1';
866
+ billprintConfig.parentid = '0';
867
+ billprintConfig.children = [];
868
+ let mainConfig = {};
869
+ mainConfig.printcode = this.uiconfig.response;
870
+ mainConfig.printname = '单据主表';
871
+ mainConfig.printtype = '2';
872
+ mainConfig.children = [];
873
+ // if (this.uiconfig.layoutType === 'ListDetails') {
874
+ if (this.$utils.includes(this.layoutTypeList,this.uiconfig.layoutType)) {
875
+ this.uiconfig.detailConfig.formsConfig.items.forEach(el => {
876
+ if(el.items) {
877
+ el.items.forEach(el2 => {
878
+ if (el2.label) {
879
+ this.itemPrintConfig(el2,mainConfig.children);
880
+ }
881
+ })
882
+ }
883
+ });
884
+ this.uiconfig.detailConfig.billDetailConfig.items.forEach(el => {
885
+ if (el.type === 'EditGridCard') {
886
+ let temp = {};
887
+ temp.printcode = el.name;
888
+ temp.printname = el.title;
889
+ temp.printtype = '3';
890
+ temp.children = [];
891
+ el.items.forEach(el2 => {
892
+ this.initGridPrintConfig(el2,temp.children);
893
+ });
894
+ mainConfig.children.push(temp);
895
+ } else if (el.type === 'DetailsBox') {
896
+ let temp = {};
897
+ temp.printcode = el.name;
898
+ temp.printname = el.formConfig.title;
899
+ temp.printtype = '3';
900
+ temp.children = [];
901
+ el.formConfig.items.forEach(el2 => {
902
+ this.itemPrintConfig(el2,temp.children);
903
+ });
904
+ mainConfig.children.push(temp);
905
+ if (el.gridName) {
906
+ let temp2 = {};
907
+ temp2.printcode = el.gridName;
908
+ temp2.printname = el.gridConfig.title;
909
+ temp2.printtype = '3';
910
+ temp2.children = [];
911
+ el.gridConfig.items.forEach(el2 => {
912
+ this.initGridPrintConfig(el2,temp.children);
913
+ });
914
+ mainConfig.children.push(temp2);
915
+ }
916
+
917
+ }
918
+ });
919
+ billprintConfig.children.push(mainConfig);
920
+ }
921
+ return billprintConfig;
922
+ },
923
+ printBillData() {
924
+ this.loadingtext= '打印数据准备中....';
925
+ this.showLoading();
926
+ this.checkPrintConfig();
927
+ },
928
+ setPrintModeUrl (dataid) {
929
+ let curlUrl = this.$Method.copy(this.billprintModeUrl);
930
+ curlUrl = curlUrl.replace('{modulecode}',this.globalConfig.modulecode);
931
+ curlUrl = curlUrl.replace('{dataid}',dataid);
932
+ curlUrl = curlUrl.replace('{token}',this.getToken());
933
+ curlUrl = curlUrl.replace('{mktcode}',this.printMkt());
934
+ if (this.showBillContPrintMode) {
935
+ curlUrl = curlUrl +'&contprint=Y'
936
+ }
937
+ // 打开打印模板
938
+ this.printModeUrl = curlUrl;
939
+ this.printModeReset = false;
940
+ this.$nextTick(() => {
941
+ this.printModeReset = true;
942
+ this.$nextTick(() => {
943
+ this.hideLoading();
944
+ this.$nextTick(() => {
945
+ this.showPrintMode = true;
946
+ });
947
+ });
948
+ });
949
+ },
950
+
951
+ printMkt() {
952
+ let tmp = this.$refs.layout.getData();
953
+ if (tmp.mktcode) {
954
+ return tmp.mktcode;
955
+ }
956
+ return '';
957
+ },
958
+ checkPrintConfig () {
959
+ let flag = false;
960
+ let para = {};
961
+ let self = this;
962
+ para.modulecode = this.globalConfig.modulecode;
963
+ self.asyncPost(this.OmdUrl.sysconfboot, 'mss.sysconf.printconfig.checkPrintConfig', para, function (data) {
964
+ if(data.flag === 'Y'){
965
+ let dataid = self.savePrintData();
966
+ self.setPrintModeUrl(dataid);
967
+ } else {
968
+ self.initPrintConfig();
969
+ }
970
+ });
971
+ return flag;
972
+ },
973
+ initPrintConfig() {
974
+ let self = this;
975
+ let para = this.getBillPrintConfig();
976
+ self.asyncPost(this.OmdUrl.sysconfboot, 'mss.sysconf.printconfig.initConfig', para, function (data) {
977
+ if(data.flag === '1'){
978
+ let dataid = self.savePrintData()
979
+ self.setPrintModeUrl(dataid);
980
+ }
981
+ });
982
+ },
983
+ savePrintData() {
984
+ let tmp = this.$refs.layout.getInitFormData();
985
+ let dataid = '';
986
+ let self = this;
987
+ let para = {};
988
+ let printdata ={};
989
+ printdata.modulecode = this.globalConfig.modulecode;
990
+ printdata.billkey = tmp.billkey;
991
+ printdata.datapro = JSON.stringify(tmp.formdata);
992
+ printdata.flag = 'I';
993
+ para.printdata = printdata;
994
+ self.synchroPost(this.OmdUrl.sysconfboot, 'mss.sysconf.printdata.savePrintData', para, function (data) {
995
+ if(data.flag === '1'){
996
+ dataid = data.dataid;
997
+ }
998
+ });
999
+ return dataid;
1000
+ },
1001
+ asyncImportClose(value) {
1002
+ if (!value) {
1003
+ this.refurbish();
1004
+ }
1005
+ },
1006
+ doImportSuccess() {
1007
+ this.refurbish();
1008
+ },
1009
+ setHideDividerValue(value) {
1010
+ this.$refs.layout.setHideDividerValue(value);
1011
+ },
1012
+ handleSuccessAfter(response, file, fileList) {
1013
+ this.$emit('handleSuccessAfter' , response, file, fileList);
1014
+ }
1015
+ },
1016
+ watch: {
1017
+ showDetailAppendix(value) {
1018
+ if (!value) {
1019
+ this.$nextTick(() => {
1020
+ if (this.shutDownDetailAppendix) {
1021
+ this.shutDownDetailAppendix();
1022
+ }
1023
+ });
1024
+ }
1025
+ }
1026
+ },
1027
+ };
1028
+ </script>