ocpview-plus 0.0.1

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 (195) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/dist/efviewplus.min.esm.js +99954 -0
  4. package/dist/efviewplus.min.js +142 -0
  5. package/dist/locale/lang.js +1 -0
  6. package/dist/locale/zh-CN.js +1 -0
  7. package/dist/locale/zh-TW.js +1 -0
  8. package/dist/locale/zh-UG.js +1 -0
  9. package/dist/style.css +9 -0
  10. package/dist/styles/efviewplus.css +1 -0
  11. package/package.json +144 -0
  12. package/src/components/base/controlbase.vue +191 -0
  13. package/src/components/base/controlbox.vue +102 -0
  14. package/src/components/base/index.js +3 -0
  15. package/src/components/base/load.js +20 -0
  16. package/src/components/base/probase.js +220 -0
  17. package/src/components/base/size.js +78 -0
  18. package/src/components/billbox/billbox.vue +68 -0
  19. package/src/components/billbox/index.js +2 -0
  20. package/src/components/cascaderbox/cascaderbox.vue +184 -0
  21. package/src/components/cascaderbox/index.js +2 -0
  22. package/src/components/checkbox/checkbox.vue +76 -0
  23. package/src/components/checkbox/checkgroupbox.vue +104 -0
  24. package/src/components/checkbox/index.js +3 -0
  25. package/src/components/colorbox/colorbox.vue +44 -0
  26. package/src/components/colorbox/index.js +2 -0
  27. package/src/components/combobox/combobox.vue +220 -0
  28. package/src/components/combobox/index.js +2 -0
  29. package/src/components/conditionbox/conditionbase.vue +195 -0
  30. package/src/components/conditionbox/conditionbox.vue +63 -0
  31. package/src/components/conditionbox/conditionfilterbox.vue +477 -0
  32. package/src/components/conditionbox/conditionselectorbox.vue +237 -0
  33. package/src/components/conditionbox/index.js +5 -0
  34. package/src/components/conditionbox/queryconditionbox.vue +26 -0
  35. package/src/components/conditionbox/queryconditionboxbase.vue +124 -0
  36. package/src/components/conditionbox/searchconditionbox.vue +114 -0
  37. package/src/components/conditionbox/searchgrid.vue +391 -0
  38. package/src/components/datebox/datebox.vue +129 -0
  39. package/src/components/datebox/daterangebox.vue +155 -0
  40. package/src/components/datebox/index.js +3 -0
  41. package/src/components/form/baseform.vue +677 -0
  42. package/src/components/form/detailsbox.vue +487 -0
  43. package/src/components/form/formbox.vue +29 -0
  44. package/src/components/form/formcardbox.vue +268 -0
  45. package/src/components/form/formcardgroupbox.vue +252 -0
  46. package/src/components/form/formcompro.js +19 -0
  47. package/src/components/form/formdetail.vue +129 -0
  48. package/src/components/form/formdetailtwo.vue +302 -0
  49. package/src/components/form/index.js +8 -0
  50. package/src/components/form/toolanchor.js +46 -0
  51. package/src/components/form/workform.vue +168 -0
  52. package/src/components/grid/basegrid.vue +1061 -0
  53. package/src/components/grid/editgrid.vue +51 -0
  54. package/src/components/grid/editgridbase.vue +947 -0
  55. package/src/components/grid/editgridcard.vue +193 -0
  56. package/src/components/grid/expandrow.vue +137 -0
  57. package/src/components/grid/index.js +6 -0
  58. package/src/components/grid/viewgrid.vue +122 -0
  59. package/src/components/grid/viewgridbase.vue +1284 -0
  60. package/src/components/icon/common-icon.vue +53 -0
  61. package/src/components/icon/eicon.vue +29 -0
  62. package/src/components/icon/icons.vue +42 -0
  63. package/src/components/icon/index.js +2 -0
  64. package/src/components/label/index.js +3 -0
  65. package/src/components/label/showtext.vue +95 -0
  66. package/src/components/load/loadcartoon.vue +228 -0
  67. package/src/components/map/index.js +2 -0
  68. package/src/components/map/mapbox.vue +348 -0
  69. package/src/components/masterplate/appendix.vue +586 -0
  70. package/src/components/masterplate/approval.vue +803 -0
  71. package/src/components/masterplate/base.vue +985 -0
  72. package/src/components/masterplate/billasyncimport.vue +614 -0
  73. package/src/components/masterplate/billconditionbox.vue +224 -0
  74. package/src/components/masterplate/billconditionsbox.vue +427 -0
  75. package/src/components/masterplate/billdetailform.vue +990 -0
  76. package/src/components/masterplate/billimport.vue +263 -0
  77. package/src/components/masterplate/billquerygrid.vue +316 -0
  78. package/src/components/masterplate/billsinglegrid.vue +234 -0
  79. package/src/components/masterplate/birtreport.vue +185 -0
  80. package/src/components/masterplate/detailbtntoolbar.vue +311 -0
  81. package/src/components/masterplate/detailsbox.vue +386 -0
  82. package/src/components/masterplate/editgridcard.vue +222 -0
  83. package/src/components/masterplate/editgridcard2.vue +109 -0
  84. package/src/components/masterplate/formcard.vue +106 -0
  85. package/src/components/masterplate/formcardgroupbox.vue +168 -0
  86. package/src/components/masterplate/formdetailtwo.vue +356 -0
  87. package/src/components/masterplate/gridcolset.vue +227 -0
  88. package/src/components/masterplate/index.js +23 -0
  89. package/src/components/masterplate/layouttemplate.vue +33 -0
  90. package/src/components/masterplate/leftlistrightdetails.vue +474 -0
  91. package/src/components/masterplate/leftlistrightlist.vue +465 -0
  92. package/src/components/masterplate/lefttreerightdetails.vue +619 -0
  93. package/src/components/masterplate/levelreport.vue +510 -0
  94. package/src/components/masterplate/listbtntoolbar.vue +257 -0
  95. package/src/components/masterplate/listdetails.vue +769 -0
  96. package/src/components/masterplate/operlog.vue +272 -0
  97. package/src/components/masterplate/options.vue +110 -0
  98. package/src/components/masterplate/page.vue +102 -0
  99. package/src/components/masterplate/promptmessage.vue +74 -0
  100. package/src/components/masterplate/querybar.vue +490 -0
  101. package/src/components/masterplate/report.vue +357 -0
  102. package/src/components/masterplate/rowbtntoolbar.vue +126 -0
  103. package/src/components/masterplate/simpletree.vue +129 -0
  104. package/src/components/masterplate/simpleviewgrid.vue +144 -0
  105. package/src/components/mychart/bar/bar.vue +202 -0
  106. package/src/components/mychart/basechart.vue +190 -0
  107. package/src/components/mychart/complexmychart/barline.vue +154 -0
  108. package/src/components/mychart/gauge/gauge.vue +83 -0
  109. package/src/components/mychart/index.js +9 -0
  110. package/src/components/mychart/line/line.vue +202 -0
  111. package/src/components/mychart/liquidfill/liquidfill.vue +109 -0
  112. package/src/components/mychart/pie/pie.vue +96 -0
  113. package/src/components/mychart/radar/radar.vue +122 -0
  114. package/src/components/mychart/scatter/scatter.vue +76 -0
  115. package/src/components/numberbox/append.js +11 -0
  116. package/src/components/numberbox/index.js +3 -0
  117. package/src/components/numberbox/numberbox.vue +303 -0
  118. package/src/components/numberbox/numberrangebox.vue +423 -0
  119. package/src/components/picturebox/filebox.vue +365 -0
  120. package/src/components/picturebox/index.js +3 -0
  121. package/src/components/picturebox/picturebox.vue +541 -0
  122. package/src/components/picturebox/uploadbox.vue +164 -0
  123. package/src/components/poptagbox/index.js +2 -0
  124. package/src/components/poptagbox/poptagbox.vue +389 -0
  125. package/src/components/poptextbox/index.js +2 -0
  126. package/src/components/poptextbox/poptextbox.vue +601 -0
  127. package/src/components/radiobox/index.js +2 -0
  128. package/src/components/radiobox/radiogroupbox.vue +76 -0
  129. package/src/components/richtextbox/editor.vue +150 -0
  130. package/src/components/richtextbox/index.js +2 -0
  131. package/src/components/richtextbox/richtextbox.vue +448 -0
  132. package/src/components/textbox/index.js +2 -0
  133. package/src/components/textbox/textbox.vue +98 -0
  134. package/src/components/timebox/index.js +2 -0
  135. package/src/components/timebox/timebox.vue +76 -0
  136. package/src/components/toolbar/ebutton.vue +169 -0
  137. package/src/components/toolbar/index.js +3 -0
  138. package/src/components/toolbar/toolbar.vue +446 -0
  139. package/src/components/tree/basetree.vue +725 -0
  140. package/src/components/tree/index.js +3 -0
  141. package/src/components/tree/treedata.vue +51 -0
  142. package/src/components/tree/treedatabase.vue +189 -0
  143. package/src/components/upload/billimport.vue +233 -0
  144. package/src/components/upload/index.js +2 -0
  145. package/src/components/videobox/index.js +2 -0
  146. package/src/components/videobox/uploadbox.vue +148 -0
  147. package/src/components/videobox/videobox.vue +503 -0
  148. package/src/components/wrichtextbox/editor.vue +219 -0
  149. package/src/components/wrichtextbox/index.js +2 -0
  150. package/src/components/wrichtextbox/wrichtextbox.vue +63 -0
  151. package/src/index.js +215 -0
  152. package/src/locale/format.js +51 -0
  153. package/src/locale/index.js +63 -0
  154. package/src/locale/lang/zh-CN.js +123 -0
  155. package/src/locale/lang/zh-TW.js +114 -0
  156. package/src/locale/lang/zh-UG.js +115 -0
  157. package/src/locale/lang.js +15 -0
  158. package/src/method/case/case.js +1180 -0
  159. package/src/method/config/queryconfig.js +24 -0
  160. package/src/method/const/const.js +815 -0
  161. package/src/method/index.js +8 -0
  162. package/src/static/excel/exportexcel.js +627 -0
  163. package/src/static/iview/coustom.js +463 -0
  164. package/src/store/index.js +19 -0
  165. package/src/store/modules/app.js +53 -0
  166. package/src/styles/README.md +3 -0
  167. package/src/styles/common.less +75 -0
  168. package/src/styles/components/anchor.less +74 -0
  169. package/src/styles/components/approval.less +136 -0
  170. package/src/styles/components/button.less +208 -0
  171. package/src/styles/components/card.less +51 -0
  172. package/src/styles/components/content.less +38 -0
  173. package/src/styles/components/font.less +314 -0
  174. package/src/styles/components/form.less +72 -0
  175. package/src/styles/components/iconfont/fonts/iconfont.less +1376 -0
  176. package/src/styles/components/iconfont/fonts/iconfont.svg +699 -0
  177. package/src/styles/components/iconfont/fonts/iconfont.ttf +0 -0
  178. package/src/styles/components/iconfont/fonts/iconfont.woff +0 -0
  179. package/src/styles/components/iconfont/fonts/iconfont.woff2 +0 -0
  180. package/src/styles/components/index.less +16 -0
  181. package/src/styles/components/input.less +290 -0
  182. package/src/styles/components/modal.less +203 -0
  183. package/src/styles/components/page.less +340 -0
  184. package/src/styles/components/select.less +361 -0
  185. package/src/styles/components/steps.less +367 -0
  186. package/src/styles/components/table.less +544 -0
  187. package/src/styles/components/tabs.less +249 -0
  188. package/src/styles/components/upload.less +83 -0
  189. package/src/styles/custom.less +67 -0
  190. package/src/styles/index.less +6 -0
  191. package/src/styles/pack.less +6 -0
  192. package/src/utils/EfuMessenger.js +155 -0
  193. package/src/utils/assist.js +353 -0
  194. package/src/utils/index.js +1 -0
  195. package/src/utils/random_str.js +10 -0
@@ -0,0 +1,769 @@
1
+ <template>
2
+ <div style="background:#fff;overflow-x: hidden;overflow-y:auto,">
3
+ <BillQueryGrid ref="billqureygrid" v-show="!showHead" :config="myConfig.billQueryConfig" :dictData="dictData" :moduleMethod="moduleMethod" @doAction="doAction" />
4
+ <BillDetailForm ref="form" v-show="showHead" :config="myConfig.detailConfig" :dictData="dictData" :moduleMethod="moduleMethod" @doAction="doAction">
5
+ <template #toolbar>
6
+ <Card v-show="showToolbar" :padding="0" style="padding:14px 16px;border-radius:0px;" dis-hover :bordered="false">
7
+ <DetailBtnToolbar ref="menutoolbar" :config="menuToolbar" :moduleMethod="moduleMethod" @doAction="doAction"/>
8
+ <Divider style="margin-top:16px;margin-bottom:0px;" />
9
+ </Card>
10
+ </template>
11
+ </BillDetailForm>
12
+ <ApprovalBox ref="approval" :config="billApprovalConfig"/>
13
+ <Modal class-name="efuture-billapprovalmainframe" v-model="showApproval" fullscreen title="报批单" footer-hide>
14
+ <iframe frameborder="0" ref="billapprovalmainframe" style="width:100%;height:100%;" border="0"></iframe>
15
+ </Modal>
16
+ <Modal title="单据日志" v-model="showBilloperlog" :width="logcurrentWidth" :footer-hide="true">
17
+ <BillOperLog ref="billoperlog" :config="billOperLogConfig"/>
18
+ </Modal>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import BillQueryGrid from './billquerygrid.vue';
24
+ import BillDetailForm from './billdetailform.vue';
25
+ import ApprovalBox from './approval.vue';
26
+ import BillOperLog from './operlog.vue';
27
+ import load from '@/components/base/load';
28
+ export default {
29
+ name:'mlistdetails',
30
+ mixins: [load],
31
+ components: {BillQueryGrid,BillDetailForm,ApprovalBox,BillOperLog},
32
+ data () {
33
+ return {
34
+ showHead:false,
35
+ myConfig:{
36
+ },
37
+ billKey:'ph_key',
38
+ ph_key:'',
39
+ billApprovalConfig: {
40
+ resources: '',
41
+ classPrefix: '',
42
+ },
43
+ billOperLogConfig:{
44
+ showOperLog:false,
45
+ operLogKey:'billno'
46
+ },
47
+ menuToolbar:{
48
+ statusKey:'billstatus'
49
+ },
50
+ billapproveurl:'',
51
+ showApproval:false,
52
+ showBilloperlog:false,
53
+ logName:[],
54
+ logData:null,
55
+ showToolbar:true,
56
+ customPrintData:null
57
+ };
58
+ },
59
+ props:{
60
+ config: {
61
+ type:Object,
62
+ default:null
63
+ },
64
+ dictData: {
65
+ type: Object,
66
+ default:null
67
+ },
68
+ moduleMethod:{
69
+ type:Array,
70
+ default: () => {
71
+ return [];
72
+ }
73
+ }
74
+ },
75
+ computed:{
76
+ logcurrentWidth () {
77
+ return this.$Store.state.app.clientWidth * 0.8;
78
+ },
79
+ },
80
+ created () {
81
+ this.myConfig = Object.assign({},this.myConfig, this.config);
82
+ // 处理列表
83
+ this.myConfig.billQueryConfig.response = this.myConfig.response;
84
+ this.myConfig.billQueryConfig.resources = this.myConfig.resources;
85
+ this.myConfig.billQueryConfig.classPrefix = this.myConfig.classPrefix;
86
+ this.myConfig.billQueryConfig.gridConfig.height = 1;
87
+ this.myConfig.billQueryConfig.gridConfig.adjustHeight = 0;
88
+ this.myConfig.billQueryConfig.btnData = [];
89
+ this.myConfig.billQueryConfig.rowBtnData = [];
90
+ if(this.myConfig.menuToolbar.enablePermissions !== undefined) {
91
+ this.myConfig.billQueryConfig.enablePermissions = this.myConfig.menuToolbar.enablePermissions;
92
+ }
93
+ if (this.myConfig.detailConfig.billapproveurl) {
94
+ this.myConfig.menuToolbar.billapproval = true;
95
+ }
96
+ if (this.myConfig.detailConfig.showToolbar !== undefined) {
97
+ this.showToolbar = this.myConfig.detailConfig.showToolbar;
98
+ }
99
+ if (this.myConfig.billKey) {
100
+ this.billKey = this.myConfig.billKey;
101
+ }
102
+ this.myConfig.billQueryConfig.gridConfig.bindSearchParam = this.billKey;
103
+ this.myConfig.menuToolbar.items.forEach(el => {
104
+ if (el.btntype === 'batch') {
105
+ this.myConfig.billQueryConfig.btnData.push(this.$Method.copy(el));
106
+ }
107
+ if (el.btntype === 'row') {
108
+ this.myConfig.billQueryConfig.rowBtnData.push(this.$Method.copy(el));
109
+ }
110
+ if (el.name === 'addData') {
111
+ this.myConfig.billQueryConfig.addDataflag = 'Y';
112
+ }
113
+ });
114
+
115
+
116
+
117
+ // 处理详情
118
+ if (this.myConfig.detailConfig.showAnchorLink === undefined) {
119
+ this.myConfig.detailConfig.showAnchorLink = false;
120
+ }
121
+ if (this.myConfig.detailConfig.showAnchorLink) {
122
+ if (this.myConfig.detailConfig.anchorCol === undefined) {
123
+ this.myConfig.detailConfig.anchorCol = 3;
124
+ }
125
+ }
126
+ this.myConfig.detailConfig.billKey = this.billKey;
127
+ this.myConfig.detailConfig.adjustHeight = 0;
128
+ this.myConfig.detailConfig.modulecode = this.myConfig.modulecode;
129
+ this.myConfig.detailConfig.resources = this.myConfig.resources;
130
+ this.myConfig.detailConfig.response = this.myConfig.response;
131
+ this.menuToolbar = Object.assign({},this.menutoolbar,this.myConfig.menuToolbar);
132
+ this.menuToolbar.billisworkflow = this.myConfig.billisworkflow;
133
+ if (this.myConfig.detailConfig.billapproveurl) {
134
+ this.menuToolbar.billapprove = true;
135
+ }
136
+ this.menuToolbar.items = [];
137
+ this.myConfig.menuToolbar.items.forEach(el => {
138
+ if (!el.btntype || (el.btntype !== 'batch' && el.btntype !== 'row')) {
139
+ this.menuToolbar.items.push(this.$Method.copy(el));
140
+ }
141
+ });
142
+
143
+ if (this.myConfig.billAppendixConfig) {
144
+ this.myConfig.detailConfig.billAppendixConfig = this.myConfig.billAppendixConfig;
145
+ }
146
+ if (this.myConfig.billOperLogConfig) {
147
+ this.billOperLogConfig = Object.assign({},this.billOperLogConfig, this.myConfig.billOperLogConfig);
148
+ if (this.billOperLogConfig.showOperLog) {
149
+ this.menuToolbar.billoperlog = true;
150
+ this.setLogName();
151
+ }
152
+ }
153
+ if (this.myConfig.billPrintConfig) {
154
+ if (this.myConfig.billPrintConfig.showPrint) {
155
+ this.menuToolbar.printmodel = this.myConfig.billPrintConfig.showPrint;
156
+ }
157
+ if (this.myConfig.billPrintConfig.showContPrint) {
158
+ this.menuToolbar.contprintmodel = this.myConfig.billPrintConfig.showContPrint;
159
+ }
160
+ }
161
+
162
+ if (this.myConfig.detailConfig.billisworkflow) {
163
+ this.menuToolbar.billisworkflow = this.myConfig.detailConfig.billisworkflow;
164
+ }
165
+
166
+ this.billApprovalConfig.resources = this.myConfig.resources;
167
+ this.billApprovalConfig.classPrefix = this.myConfig.classPrefix;
168
+ },
169
+ methods:{
170
+ setLogName() {
171
+ this.logName.push({code:this.myConfig.detailConfig.response,name:'主表'});
172
+ this.myConfig.detailConfig.formsConfig.items.forEach(el => {
173
+ this.initLogName(el.items,this.myConfig.detailConfig.response,el.title)
174
+ });
175
+ if (this.myConfig.detailConfig.billDetailConfig !== undefined && this.myConfig.detailConfig.billDetailConfig.items) {
176
+ this.myConfig.detailConfig.billDetailConfig.items.forEach(el => {
177
+ if (el.type === 'EditGridCard') {
178
+ this.logName.push({code:el.name,name:el.title,isdetail:'1'});
179
+ this.initLogName(el.items,el.name,el.title,{isdetail:'1'});
180
+ } else if (el.type === 'DetailsBox') {
181
+ this.logName.push({code:el.name,name:el.title,isdetail:'1'});
182
+ this.initLogName(el.formConfig.items,el.name,el.title,{isdetail:'1'});
183
+ this.logName.push({code:el.gridName, name:el.gridConfig.title,isdetail:'2',headtitle:el.title,uniqueKeys:el.uniqueKeys});
184
+ this.initLogName(el.gridConfig.items,el.gridName,el.gridConfig.title,{headtitle:el.title,uniqueKeys:el.uniqueKeys,isdetail:'2'});
185
+ }
186
+ });
187
+ }
188
+ this.billOperLogConfig.logName = this.$Method.copy(this.logName);
189
+ },
190
+ initLogName(list,headname,headtitle,pro) {
191
+ if (!pro) {
192
+ pro = {};
193
+ }
194
+ list.forEach(el => {
195
+ if (el.name) {
196
+ let obj = {};
197
+ obj.title = headtitle;
198
+ obj.code = headname+'.' + el.name;
199
+ obj.name = el.label;
200
+ Object.assign(obj,pro);
201
+ this.logName.push(obj);
202
+ }
203
+ if (el.textName) {
204
+ let obj = {};
205
+ obj.title = headtitle;
206
+ obj.code = headname +'.' + el.textName;
207
+ obj.name = el.label;
208
+ Object.assign(obj,pro);
209
+ this.logName.push(obj);
210
+ }
211
+ if (el.sname) {
212
+ let obj = {};
213
+ obj.title = el.headtitle;
214
+ obj.code = headname +'.' + el.sname;
215
+ obj.name = el.label;
216
+ Object.assign(obj,pro);
217
+ this.logName.push(obj);
218
+ }
219
+ if (el.ename) {
220
+ let obj = {};
221
+ obj.title = el.headtitle;
222
+ obj.code = headname + '.' + el.ename;
223
+ obj.name = el.label;
224
+ Object.assign(obj,pro);
225
+ this.logName.push(obj);
226
+ }
227
+ });
228
+ },
229
+ doAction (obj) {
230
+ if (obj.name === 'gridSelectionChange' ) {
231
+ if (this.$parent[obj.name]) {
232
+ this.$parent[obj.name](obj);
233
+ }
234
+ return true;
235
+ }
236
+ const method = obj.name;
237
+ const methodBefore = method + 'Before';
238
+ const methodAfter = method + 'After';
239
+ if (obj.name === 'skipData' || obj.name === 'gridDbClick' || obj.name === 'backData' || obj.name === 'searchData'
240
+ || obj.name === 'editData' || obj.name === 'addData' || obj.name === 'preBill' || obj.name === 'nextBill' || obj.name === 'resetData' || obj.name === 'openWorkFlow' || obj.name === 'openBillapproval' || obj.name === 'openBilloperlog') {
241
+ let flag = true;
242
+ if (this.$parent[methodBefore]) {
243
+ flag = this.$parent[methodBefore](obj);
244
+ }
245
+ if (flag) {
246
+ // '跳转'
247
+ if (obj.name === 'skipData' || obj.name === 'gridDbClick') {
248
+ this.initForm(obj.para, obj.name);
249
+ }
250
+ // '跳转'
251
+ if (obj.name === 'openWorkFlow') {
252
+ this.openWorkFlow();
253
+ }
254
+ // '跳转'
255
+ if (obj.name === 'openBillapproval') {
256
+ this.openBillapproval();
257
+ }
258
+ // '打开日志'
259
+ if (obj.name === 'openBilloperlog') {
260
+ if (this.$parent.openBilloperlog) {
261
+ this.$parent.openBilloperlog();
262
+ } else {
263
+ this.openBilloperlog();
264
+ }
265
+ }
266
+
267
+ // '打印初期化'
268
+ if (obj.name === 'initPrintConfig') {
269
+ this.initPrintConfig();
270
+ }
271
+ // 返回
272
+ if (obj.name === 'backData') {
273
+ let temp = {};
274
+ let self = this;
275
+ temp.onOk = () => {
276
+ self.$refs.billqureygrid.refurbish();
277
+ self.$nextTick(() => {
278
+ self.showHead = false;
279
+ });
280
+ };
281
+ this.checkData(temp);
282
+ }
283
+ // 查询
284
+ if (obj.name === 'searchData') {
285
+ this.$refs.billqureygrid.getQuick().filterSearch();
286
+ /*this.setPhkey('');
287
+ this.ph_key = '';
288
+ this.$refs.billqureygrid.refurbish();
289
+ */
290
+ }
291
+ // 重置
292
+ if (obj.name === 'resetData') {
293
+ this.$refs.billqureygrid.getQuick().clearData();
294
+ }
295
+
296
+ // 编辑
297
+ if (obj.name === 'editData') {
298
+ this.$refs.form.setReadOnly(false);
299
+ this.getMenuToolbar().setAllReadOnly(true);
300
+ this.getMenuToolbar().setReadOnly(['delData','saveData'])
301
+ this.showHead = true;
302
+ }
303
+ // 新增
304
+ if (obj.name === 'addData') {
305
+ if (this.showHead) {
306
+ let temp = {};
307
+ let self = this;
308
+ temp.onOk = () => {
309
+ self.$refs.form.setReadOnly(false);
310
+ self.$refs.form.clearData();
311
+ self.customPrintData = null;
312
+ self.getMenuToolbar().setAllReadOnly(true);
313
+ self.getMenuToolbar().setReadOnly('saveData', false);
314
+ self.showHead = true;
315
+ self.logData = null;
316
+ if (self.$parent[methodAfter]) {
317
+ self.$parent[methodAfter]();
318
+ }
319
+ };
320
+ this.checkData(temp);
321
+ return true;
322
+ } else {
323
+ this.$refs.form.setReadOnly(false);
324
+ this.$refs.form.clearData();
325
+ this.getMenuToolbar().setAllReadOnly(true);
326
+ this.getMenuToolbar().setReadOnly('saveData', false);
327
+ this.showHead = true;
328
+ this.logData = null;
329
+ }
330
+ }
331
+ // 上一单
332
+ if (obj.name === 'preBill') {
333
+ this.preBill();
334
+ }
335
+ // 下一单
336
+ if (obj.name === 'nextBill') {
337
+ this.nextBill();
338
+ }
339
+
340
+ if (this.$parent[methodAfter]) {
341
+ this.$parent[methodAfter]();
342
+ }
343
+ }
344
+ } else {
345
+ let data = this.$refs.form.getData();
346
+ if (obj.name === 'saveData') {
347
+ let flag = this.$refs.form.checkValidate();
348
+ if (flag) {
349
+ this.alert('必填项不允许为空');
350
+ return false;
351
+ }
352
+ flag = this.$refs.form.isEdit();
353
+ if (flag) {
354
+ this.alert('存在数据未确认');
355
+ return false;
356
+ }
357
+ obj.para = this.$refs.form.getChangeData();
358
+ }
359
+ if (obj.name === 'saveDetails') {
360
+ obj.para = this.$refs.form.getChangeData(obj.detailsname);
361
+ obj.name = 'saveData';
362
+ }
363
+ if (obj.name === 'delData') {
364
+ if (this.showHead) {
365
+ obj.para = data;
366
+ obj.para.flag = 'D';
367
+ } else {
368
+ if (obj.para instanceof Array) {
369
+ obj.para.forEach(el => {
370
+ el.flag = 'D';
371
+ });
372
+ } else {
373
+ obj.para.flag = 'D';
374
+ let temp = [obj.para];
375
+ obj.para = temp;
376
+ }
377
+ }
378
+ }
379
+ if (obj.name === 'copyData') {
380
+ if (!obj.para) {
381
+ obj.para = {};
382
+ }
383
+ obj.para[this.billKey] = data[this.billKey];
384
+ }
385
+ obj.onOk = this.onOk;
386
+ let flag = true;
387
+ if (this.$parent[methodBefore]) {
388
+ flag = this.$parent[methodBefore](obj);
389
+ }
390
+ if (!flag) {
391
+ return;
392
+ }
393
+ if (obj.name === 'delData' || obj.name === 'auditData' || obj.name === 'cancelData' || obj.name === 'revokeData') {
394
+ let text = '删除';
395
+ if (obj.name === 'auditData') {
396
+ text = '审核';
397
+ obj.para ={billno:data.billno};
398
+ }
399
+ if (obj.name === 'cancelData') {
400
+ text = '作废';
401
+ obj.para ={billno:data.billno};
402
+ }
403
+
404
+ if (obj.name === 'revokeData') {
405
+ text = '撤回';
406
+ obj.para ={billno:data.billno};
407
+ }
408
+ if (this.$parent.getActionName) {
409
+ let name = this.$parent.getActionName(obj);
410
+ if (name) {
411
+ text = name;
412
+ }
413
+ }
414
+ let info = '确定是否' + text + '数据?';
415
+ let self = this;
416
+ self.$Modal.confirm({
417
+ title:'确认',
418
+ content: info,
419
+ onOk:() => {
420
+ self.$emit('doAction', obj);
421
+ }
422
+ });
423
+ } else {
424
+ this.$emit('doAction', obj);
425
+ }
426
+ }
427
+ },
428
+ setShowHead (value) {
429
+ this.showHead = value;
430
+ if (!this.showHead) {
431
+ this.$refs.billqureygrid.refurbish();
432
+ } else {
433
+ if (this.$refs.form) {
434
+ this.$resfs.form.doAnchorClick();
435
+ }
436
+ }
437
+ },
438
+ setRowBtnVisible(value) {
439
+ this.$refs.form.setRowBtnVisible(value);
440
+ },
441
+ setPhkey(value) {
442
+ this.ph_key = value;
443
+ this.$refs.billqureygrid.setPhkey(value);
444
+ },
445
+ onOk (action, data) {
446
+ if (action.name === 'saveData') {
447
+ this.$refs.form.updateAllfile();
448
+ let key = '';
449
+ if (data instanceof Array) {
450
+ key = data[0][this.billKey];
451
+ } else {
452
+ key = data[this.billKey];
453
+ }
454
+ let tmp = {};
455
+ tmp[this.billKey] = key;
456
+ this.$refs.billqureygrid.setPhkey(key);
457
+ this.initForm(tmp, action.name);
458
+ }
459
+ if (action.name === 'delData') {
460
+ this.$refs.form.delAppenndix();
461
+ this.ph_key = '';
462
+ this.$refs.billqureygrid.setPhkey('');
463
+ this.$refs.billqureygrid.refurbish();
464
+ this.$refs.form.clearData();
465
+ this.$refs.form.setReadOnly(true);
466
+ this.getMenuToolbar().setAllReadOnly(true);
467
+ this.getMenuToolbar().setReadOnly('addData', false);
468
+ }
469
+ if (action.name === 'auditData' || action.name === 'cancelData' || action.name === 'copyData') {
470
+ let obj = {};
471
+ obj[this.billKey] = this.ph_key;
472
+ this.initForm(obj,action.name);
473
+ }
474
+ },
475
+ initForm(para,methodName) {
476
+ if (!this.showHead) {
477
+ this.loadingtext ='加载';
478
+ this.showLoading();
479
+ }
480
+ this.$nextTick(() => {
481
+ setTimeout(() => {
482
+ this.$refs.form.clearData();
483
+ let data = this.getFormData(para);
484
+ this.logData = this.$Method.copy(data);
485
+ if (data[this.billKey]) {
486
+ this.ph_key = data[this.billKey];
487
+ } else {
488
+ this.ph_key = '';
489
+ }
490
+ if (this.$parent.setBillData) {
491
+ data = this.$parent.setBillData(data);
492
+ }
493
+ this.$refs.form.setData(data);
494
+ this.customPrintData = this.$Method.copy(data);
495
+ this.$nextTick(() => {
496
+ this.$refs.form.setReadOnly(true);
497
+ });
498
+ let status = data[this.menuToolbar.statusKey];
499
+ if (status) {
500
+ this.changedStatus(status);
501
+ } else {
502
+ if (methodName === 'skipData' || methodName === 'gridDbClick') {
503
+ this.getMenuToolbar().setAllReadOnly(true);
504
+ this.getMenuToolbar().setReadOnly(['addData'], false);
505
+ }
506
+ if (methodName === 'saveData' || methodName === 'copyData' ) {
507
+ this.getMenuToolbar().setReadOnly(['addData','delData','editData','auditData'], false);
508
+ this.getMenuToolbar().setReadOnly('saveData', true);
509
+ }
510
+ if (methodName === 'auditData' || methodName === 'cancelData') {
511
+ this.getMenuToolbar().setAllReadOnly(true);
512
+ this.getMenuToolbar().setReadOnly(['addData'], false);
513
+ }
514
+ }
515
+
516
+ if (this.$parent.initFormAfter) {
517
+ this.$parent.initFormAfter(data);
518
+ }
519
+ if (!this.showHead) {
520
+ this.hideLoading();
521
+ }
522
+ this.$nextTick(() => {
523
+ this.showHead = true;
524
+ });
525
+ },20);
526
+ });
527
+
528
+ },
529
+ getMenuToolbar() {
530
+ return this.$refs.menutoolbar;
531
+ },
532
+ getFormData (para) {
533
+ let result = {};
534
+ let self = this;
535
+ let tmp = {};
536
+ if (!para[this.billKey] && this.ph_key) {
537
+ tmp[this.billKey] = this.ph_key;
538
+ } else {
539
+ if (para[this.billKey]) {
540
+ tmp[this.billKey] = para[this.billKey];
541
+ } else {
542
+ Object.assign(tmp,para);
543
+ }
544
+ }
545
+ if (this.$parent.getFormData) {
546
+ return this.$parent.getFormData(para);
547
+ }
548
+ self.synchroPost(self.myConfig.resources,self.myConfig.classPrefix+'.get', tmp, function (data) {
549
+ result = data[self.config.response];
550
+ });
551
+ return result;
552
+ },
553
+ getInitFormData() {
554
+ let result = {};
555
+ let tmp = this.$refs.form.getData();
556
+ let self = this;
557
+ let para = {};
558
+ if (this.ph_key) {
559
+ para[this.billKey] = this.ph_key;
560
+ }
561
+ if (tmp[this.billKey]) {
562
+ para[this.billKey] = tmp[this.billKey];
563
+ }
564
+ let formdata = {};
565
+ if (this.myConfig.detailConfig.customPrintDataFlag) {
566
+ formdata = this.$Method.copy(this.customPrintData);
567
+ } else {
568
+ self.synchroPost(self.myConfig.resources,self.myConfig.classPrefix+'.get', para, function (data) {
569
+ formdata = data[self.config.response];
570
+ });
571
+ }
572
+
573
+ result.billkey = para[this.billKey];
574
+ result.formdata = formdata;
575
+ return result;
576
+ },
577
+ getForm() {
578
+ return this.$refs.form;
579
+ },
580
+ getBillQureyGrid() {
581
+ return this.$refs.billqureygrid.getGrid();
582
+ },
583
+ preBill () {
584
+ let data = this.$refs.billqureygrid.getGrid().getData();
585
+ if (this.ph_key) {
586
+ let index = data.findIndex(el => el[this.billKey] === this.ph_key);
587
+ if (index > -1) {
588
+ if (index === 0) {
589
+ this.initForm(data[data.length-1]);
590
+ } else {
591
+ this.initForm(data[index-1]);
592
+ }
593
+ } else {
594
+ this.initForm(data[data.length-1]);
595
+ }
596
+ } else {
597
+ this.initForm(data[data.length-1]);
598
+ }
599
+ },
600
+ nextBill () {
601
+ let data = this.$refs.billqureygrid.getGrid().getData();
602
+ if (this.ph_key) {
603
+ let index = data.findIndex(el => el[this.billKey] === this.ph_key);
604
+ if (index > -1) {
605
+ if (index === data.length-1) {
606
+ this.initForm(data[0]);
607
+ } else {
608
+ this.initForm(data[index+1]);
609
+ }
610
+ } else {
611
+ this.initForm(data[0]);
612
+ }
613
+ } else {
614
+ this.initForm(data[0]);
615
+ }
616
+ },
617
+ approvalOk() {
618
+ this.refurbish(this.ph_key);
619
+ },
620
+ refurbish (ph_key, acitonName) {
621
+ if (ph_key) {
622
+ this.ph_key = ph_key;
623
+ }
624
+ if (this.showHead) {
625
+ if (this.ph_key) {
626
+ let obj = {};
627
+ obj[this.billKey] = this.ph_key;
628
+ this.initForm(obj,acitonName);
629
+ }
630
+ } else {
631
+ this.setPhkey(this.ph_key);
632
+ this.$refs.billqureygrid.refurbish();
633
+ }
634
+
635
+ },
636
+ checkData (obj) {
637
+ let tempflag = false;
638
+ tempflag = this.$refs.form.isEdit();
639
+ if (tempflag) {
640
+ let self = this;
641
+ self.$Modal.confirm({
642
+ title:'确认',
643
+ content:'数据存在数据未确认,是否放弃?',
644
+ onOk:() => {
645
+ this.checkChangeData(obj);
646
+ },
647
+ onCancel:() => {
648
+ if (obj.onCancel) {
649
+ obj.onCancel();
650
+ }
651
+ }
652
+ });
653
+ } else {
654
+ this.checkChangeData(obj);
655
+ }
656
+ },
657
+ checkChangeData(obj) {
658
+ let flag = false;
659
+ flag = this.$refs.form.isChange();
660
+ if (flag) {
661
+ let self = this;
662
+ self.$Modal.confirm({
663
+ title:'确认',
664
+ content:'数据有修改未保存,是否放弃修改?',
665
+ onOk:() => {
666
+ if (obj.onOk) {
667
+ obj.onOk();
668
+ }
669
+ },
670
+ onCancel:() => {
671
+ if (obj.onCancel) {
672
+ obj.onCancel();
673
+ }
674
+ }
675
+ });
676
+ } else {
677
+ if (obj.onOk) {
678
+ obj.onOk();
679
+ }
680
+ }
681
+ },
682
+ changedStatus(value) {
683
+ this.$refs.menutoolbar.changedStatus(value);
684
+ },
685
+ getChangeData() {
686
+ return this.$refs.form.getChangeData();
687
+ },
688
+ getBillImport () {
689
+ return this.$refs.billImport;
690
+ },
691
+ getData() {
692
+ return this.$refs.form.getData();
693
+ },
694
+ setDetailVisible(name,value) {
695
+ this.$refs.form.setVisible(name, value);
696
+ },
697
+ openWorkFlow() {
698
+ let data = this.$refs.form.getApprovalData();
699
+ if (this.$parent.getApprovalData) {
700
+ data = this.$parent.getApprovalData();
701
+ }
702
+ if (!data || !data.billno || !data.billmoduleid || !data.billstatus) {
703
+ this.alert('数据信息不全,无法打开工作流');
704
+ return;
705
+ }
706
+ this.$refs.approval.setData(data);
707
+ this.$refs.approval.open();
708
+ },
709
+ openBillapproval() {
710
+ let data = this.$refs.form.getData();
711
+ let obj = {};
712
+ obj.billno = data.billno;
713
+ obj.billmoduleid = data.billmoduleid;
714
+ if (!obj.billno) {
715
+ return;
716
+ }
717
+ let self = this;
718
+ let tmpUrl = '';
719
+ if (this.myConfig.detailConfig.billapproveurl) {
720
+ if (this.myConfig.detailConfig.billapproveurl.indexOf('?') == '-1') {
721
+ tmpUrl = this.myConfig.detailConfig.billapproveurl + '?billno=' + obj.billno +'&billmoduleid=' + obj.billmoduleid;
722
+ } else {
723
+ tmpUrl = this.myConfig.detailConfig.billapproveurl + '&billno=' + obj.billno +'&billmoduleid=' + obj.billmoduleid;
724
+ }
725
+ } else {
726
+ return;
727
+ }
728
+ this.$parent.initBillApprovalData();
729
+ this.$refs.billapprovalmainframe.src = this.setUrlSuffix(tmpUrl,self);
730
+ this.showApproval = true;
731
+ },
732
+ openBilloperlog() {
733
+ if (this.logData != null) {
734
+ this.$refs.billoperlog.setData(this.logData[this.billOperLogConfig.operLogKey],this.logData);
735
+ this.showBilloperlog = true;
736
+ } else {
737
+ this.alert('未产生日志');
738
+ }
739
+ },
740
+ setEffectData(data) {
741
+ this.$nextTick(() => {
742
+ setTimeout(() => {
743
+ this.$refs.form.setEffectData(data);
744
+ }, 1000);
745
+ });
746
+ },
747
+ initPrintConfig() {
748
+ if (this.$parent.initPrintConfig) {
749
+ this.$parent.initPrintConfig();
750
+ }
751
+ }
752
+ },
753
+ mounted () {
754
+ let billno = this.$Method.getUrlParam('billno');
755
+ if (billno) {
756
+ let para = {};
757
+ para.billno = billno;
758
+ if (this.$parent.initPageJumpPara) {
759
+ para = this.$parent.initPageJumpPara(para);
760
+ }
761
+ this.initForm(para,'gridDbClick');
762
+ }
763
+ }
764
+ };
765
+ </script>
766
+
767
+ <style>
768
+
769
+ </style>