FormPanel.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. Ext.define('saas.view.sys.guide.FormPanel', {
  2. extend: 'Ext.panel.Panel',
  3. xtype: 'sys-guide-formpanel',
  4. layout:'fit',
  5. bodyCls:'x-guide-background',
  6. //工具类
  7. FormUtil: Ext.create('saas.util.FormUtil'),
  8. BaseUtil: Ext.create('saas.util.BaseUtil'),
  9. dataUrl:'/api/commons/init/check',
  10. initComponent: function () {
  11. var me = this;
  12. showInformation = function(type,value) {
  13. me.showInformation(type,value)
  14. }
  15. var view = new Ext.DataView({
  16. style:"margin:7% 0 7% 0;",
  17. store : Ext.create('Ext.data.Store', {
  18. fields: [{
  19. name:'baseSet',type:'boolean'
  20. },{
  21. name:'warehouse',type:'boolean'
  22. },{
  23. name:'product',type:'boolean'
  24. },{
  25. name:'customer',type:'boolean'
  26. },{
  27. name:'vendor',type:'boolean'
  28. },{
  29. name:'begin',type:'boolean'
  30. }],
  31. autoLoad: false,
  32. pageSize: 10,
  33. data: [{
  34. baseSet:false,
  35. warehouse:false,
  36. product:false,
  37. customer:false,
  38. vendor:false,
  39. begin:false,
  40. }],
  41. proxy: {
  42. timeout:8000,
  43. type: 'ajax',
  44. url: me.dataUrl,
  45. actionMethods: {
  46. read: 'GET'
  47. },
  48. reader: {
  49. type: 'json',
  50. rootProperty: 'data',
  51. totalProperty: 'data',
  52. }
  53. },
  54. }),
  55. tpl : new Ext.XTemplate(
  56. '<tpl for=".">',
  57. '<div class="x-guide-panel" align ="center">',
  58. '<div class="x-guide-item" align ="center" >',
  59. '<img class="',
  60. '<tpl if="!baseSet">x-guide-mask </tpl>',
  61. '" src="resources/images/guide/baseSet.png" style="margin:0 185px 0 0;" align ="center" width="135" height="90" alt="基础设置" onClick="showInformation(\'baseSet\')" >',
  62. '<img class="',
  63. '<tpl if="!warehouse">x-guide-mask </tpl>',
  64. '"src="resources/images/guide/warehouse.png" style="margin:0 185px 0 0;" align ="center" width="135" height="90" alt="仓库资料" onClick="showInformation(\'warehouse\')" >',
  65. '<img class="',
  66. '<tpl if="!product">x-guide-mask </tpl>',
  67. '"src="resources/images/guide/product.png" align ="center" width="135" height="90" alt="物料资料" onClick="showInformation(\'product\')" >',
  68. '</div>',
  69. '<div class="x-guide-item" align ="center">',
  70. '<img class="',
  71. '<tpl if="!baseSet">x-guide-mask </tpl>',
  72. '"src="resources/images/guide/1.png" style="margin: -20px 290px 0 0;" align ="center" width="32" height="32" onClick="showInformation(\'baseSet\')" >',
  73. '<img class="',
  74. '<tpl if="!warehouse">x-guide-mask </tpl>',
  75. '"src="resources/images/guide/2.png" style="margin: -20px 290px 0 0;" align ="center" width="32" height="32" onClick="showInformation(\'warehouse\')" >',
  76. '<img class="',
  77. '<tpl if="!product">x-guide-mask </tpl>',
  78. '"src="resources/images/guide/3.png" style="margin: -20px 0px 0 0;" align ="center" width="32" height="32" onClick="showInformation(\'product\')" >',
  79. '</div>',
  80. '<div class="x-guide-item" align ="center">',
  81. '<span style="margin:0 270px 0px 0;" align ="center" onClick="showInformation(\'baseSet\')" >基础设置</span>',
  82. '<span style="margin:0 270px 0px 0;" align ="center" onClick="showInformation(\'warehouse\')" >仓库资料</span>',
  83. '<span style="margin:0 0px 0px 0;" align ="center" onClick="showInformation(\'product\')" >物料资料</span>',
  84. '</div>',
  85. '<div class="x-guide-item" align ="center">',
  86. '<img class="',
  87. '<tpl if="!baseSet">x-guide-mask </tpl>',
  88. '"src="resources/images/guide/point.png" style="margin: 2px 306px 0 0;" align ="center" width="16" height="16" >',
  89. '<img class="',
  90. '<tpl if="!warehouse">x-guide-mask </tpl>',
  91. '"src="resources/images/guide/point.png" style="margin: 2px 306px 0 0;" align ="center" width="16" height="16" >',
  92. '<img class="',
  93. '<tpl if="!product">x-guide-mask </tpl>',
  94. '"src="resources/images/guide/point.png" style="margin: 2px 0px 0 0;" align ="center" width="16" height="16" >',
  95. "<br>",
  96. '<div class="x-guide-line" height="1" style="border:1px solid #E4F7FF;margin: -9px 0 0 0;width: 654px !important;" align ="center"></div>',
  97. '</div>',
  98. '<div class="x-guide-item" align ="center">',
  99. '<img class="',
  100. '<tpl if="!customer">x-guide-mask </tpl>',
  101. '"src="resources/images/guide/customer.png" style="margin:50px 185px 0 0;" align ="center" width="135" height="90" alt="客户资料" onClick="showInformation(\'customer\')" >',
  102. '<img class="',
  103. '<tpl if="!vendor">x-guide-mask </tpl>',
  104. '"src="resources/images/guide/vendor.png" style="margin:50px 185px 0 0;" align ="center" width="135" height="90" alt="供应商资料" onClick="showInformation(\'vendor\')" >',
  105. '<img class="',
  106. '<tpl if="!begin">x-guide-mask </tpl>',
  107. '" src="resources/images/guide/begin.png" style="margin:50px 0 0 0;" align ="center" width="135" height="90" alt="开始使用" onClick="showInformation(\'begin\',\'{begin}\')" >',
  108. '</div>',
  109. '<div class="x-guide-item" align ="center">',
  110. '<img class="',
  111. '<tpl if="!customer">x-guide-mask </tpl>',
  112. '" src="resources/images/guide/4.png" style="margin: -20px 290px 0 0;" align ="center" width="32" height="32" onClick="showInformation(\'customer\')" >',
  113. '<img class="',
  114. '<tpl if="!vendor">x-guide-mask </tpl>',
  115. '" src="resources/images/guide/5.png" style="margin: -20px 290px 0 0;" align ="center" width="32" height="32" onClick="showInformation(\'vendor\')">',
  116. '<img class="',
  117. '<tpl if="!begin">x-guide-mask </tpl>',
  118. '" src="resources/images/guide/6.png" style="margin: -20px 0px 0 0;" align ="center" width="32" height="32" onClick="showInformation(\'begin\',\'{begin}\')" >',
  119. '</div>',
  120. '<div class="x-guide-item" align ="center">',
  121. '<span style="margin:0 265px 100px 0;" align ="center" onClick="showInformation(\'customer\')" >客户资料</span>',
  122. '<span style="margin:0 265px 100px 0;" align ="center" onClick="showInformation(\'vendor\')" >供应商资料</span>',
  123. '<span style="margin:0 0px 100px 0;" align ="center" onClick="showInformation(\'begin\',\'{begin}\')" >开始使用</span>',
  124. '</div>',
  125. '<div class="x-guide-item" align ="center">',
  126. '<img class="',
  127. '<tpl if="!customer">x-guide-mask </tpl>',
  128. '" src="resources/images/guide/point.png" style="margin: 2px 306px 0 0;" align ="center" width="16" height="16" >',
  129. '<img class="',
  130. '<tpl if="!vendor">x-guide-mask </tpl>',
  131. '" src="resources/images/guide/point.png" style="margin: 2px 306px 0 0;" align ="center" width="16" height="16" >',
  132. '<img class="',
  133. '<tpl if="!begin">x-guide-mask </tpl>',
  134. '" src="resources/images/guide/point.png" style="margin: 2px 0px 0 0;" align ="center" width="16" height="16" >',
  135. "<br>",
  136. '<div class="x-guide-line" height="1" style="border:1px solid #E4F7FF;margin: -9px 0 0 0;width: 654px !important;" align ="center"></div>',
  137. '</div>',
  138. '</div>',
  139. '</tpl>'
  140. ),
  141. trackOver: true,
  142. overItemCls : 'x-module-over',
  143. selectedClass : 'selected',
  144. singleSelect : true,
  145. itemSelector : '.x-module-item'
  146. });
  147. Ext.apply(me,{
  148. items:[view]
  149. });
  150. me.view = view;
  151. me.callParent(arguments);
  152. },
  153. refresh:function(){
  154. debugger
  155. this.ownerCt.setTitle('新手指引');
  156. this.view.store.load();
  157. //刷新store数据
  158. },
  159. showInformation:function(type,value){
  160. var message = '';
  161. var xtype = '';
  162. var icon = 'x-gudie-information';
  163. var title = '';
  164. if(type=='baseSet'){
  165. message = '<h4>您可以在参数设置中编辑公司的信息。</br>'+
  166. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  167. xtype = 'sys-config-formpanel';
  168. }
  169. if(type=='warehouse'){
  170. message = '<h4>因为新增物料时需要告知该物料所属仓库是哪里,所以需要首先进行仓库管理。</br>'+
  171. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  172. xtype = 'other-warehouse';
  173. title = '仓库资料'
  174. }
  175. if(type=='product'){
  176. message = '<h4>录入物料及其期初数量;开账后也可通过录采购单对物料库存进行增加,</br>录销售单物料库存相应减少。</br>'+
  177. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  178. xtype = 'document-product-basepanel';
  179. title = '物料资料'
  180. }
  181. if(type=='customer'){
  182. message = '<h4>对客户资料进行录入及管理。</br>'+
  183. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  184. xtype = 'document-customer-basepanel';
  185. title = '客户资料'
  186. }
  187. if(type=='vendor'){
  188. message = '<h4>录采购单时需选择供应商,在单据页面选择供应商时</br>也提供供应商新增功能,您也可以跳过此步。</br>'+
  189. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  190. xtype = 'document-vendor-basepanel';
  191. title = '供应商资料'
  192. }
  193. if(type=='begin'){
  194. message = '<h4>欢迎您使用优企云进销存!</br>'+
  195. '温馨提示:开账后您还是可以通过左侧菜单栏对基础资料进行维护。</h4>';
  196. xtype = "begin";
  197. icon = 'x-gudie-end';
  198. if(value=='false'){
  199. icon = 'x-gudie-information';
  200. message = '<h4>请激活所有模块后再使用系统!</h4>';
  201. }
  202. }
  203. var me = this;
  204. var form = this.view.ownerCt;
  205. var panelEl = form.getEl()
  206. var box = panelEl.getBox();
  207. var height = box.height;
  208. var width = box.width;
  209. var win = form.add(Ext.create('Ext.window.MessageBox', {
  210. msg:message,
  211. buttonAlign : 'right',
  212. height:0.5*height,
  213. width:0.5*width,
  214. buttons: [{
  215. text: '我知道了',
  216. cls:'x-formpanel-btn-orange',
  217. handler: function(b) {
  218. var scope = b.ownerCt.ownerCt;
  219. if(xtype=='begin'&&value=='false'){
  220. scope.close();
  221. return true;
  222. }else if(xtype=='begin'&&value=='true'){
  223. me.ownerCt.close();
  224. return true;
  225. }
  226. openTab(xtype, title, xtype+'_add');
  227. scope.close();
  228. }
  229. },{
  230. text: '取消',
  231. cls:'x-formpanel-btn-blue',
  232. handler: function(b) {
  233. var scope = b.ownerCt.ownerCt;
  234. scope.close();
  235. }
  236. }]
  237. }));
  238. win.show({
  239. title : '模块介绍',
  240. msg : message,
  241. icon : icon
  242. });
  243. }
  244. });