FormPanel.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. this.ownerCt.setTitle('新手指引');
  155. this.view.store.load();
  156. //刷新store数据
  157. },
  158. showInformation:function(type,value){
  159. var message = '';
  160. var xtype = '';
  161. var icon = 'x-gudie-information';
  162. var title = '';
  163. if(type=='baseSet'){
  164. message = '<h4>您可以在参数设置中编辑公司的信息。</br>'+
  165. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  166. xtype = 'sys-config-formpanel';
  167. }
  168. if(type=='warehouse'){
  169. message = '<h4>因为新增物料时需要告知该物料所属仓库是哪里,所以需要首先进行仓库管理。</br>'+
  170. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  171. xtype = 'other-warehouse';
  172. title = '仓库资料'
  173. }
  174. if(type=='product'){
  175. message = '<h4>录入物料及其期初数量;开账后也可通过录采购单对物料库存进行增加,</br>录销售单物料库存相应减少。</br>'+
  176. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  177. xtype = 'document-product-basepanel';
  178. title = '物料资料'
  179. }
  180. if(type=='customer'){
  181. message = '<h4>对客户资料进行录入及管理。</br>'+
  182. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  183. xtype = 'document-customer-basepanel';
  184. title = '客户资料'
  185. }
  186. if(type=='vendor'){
  187. message = '<h4>录采购单时需选择供应商,在单据页面选择供应商时</br>也提供供应商新增功能,您也可以跳过此步。</br>'+
  188. '录入完成后切换到“新手导航”页签继续下一步。</h4>';
  189. xtype = 'document-vendor-basepanel';
  190. title = '供应商资料'
  191. }
  192. if(type=='begin'){
  193. message = '<h4>欢迎您使用优企云进销存!</br>'+
  194. '温馨提示:开账后您还是可以通过左侧菜单栏对基础资料进行维护。</h4>';
  195. xtype = "begin";
  196. icon = 'x-gudie-end';
  197. if(value=='false'){
  198. icon = 'x-gudie-information';
  199. message = '<h4>请激活所有模块后再使用系统!</h4>';
  200. }
  201. }
  202. var me = this;
  203. var form = this.view.ownerCt;
  204. var panelEl = form.getEl()
  205. var box = panelEl.getBox();
  206. var height = box.height;
  207. var width = box.width;
  208. var win = form.add(Ext.create('Ext.window.MessageBox', {
  209. msg:message,
  210. buttonAlign : 'right',
  211. height:0.5*height,
  212. width:0.5*width,
  213. buttons: [{
  214. text: '我知道了',
  215. cls:'x-formpanel-btn-orange',
  216. handler: function(b) {
  217. var scope = b.ownerCt.ownerCt;
  218. if(xtype=='begin'&&value=='false'){
  219. scope.close();
  220. return true;
  221. }else if(xtype=='begin'&&value=='true'){
  222. me.ownerCt.close();
  223. return true;
  224. }
  225. openTab(xtype, title, xtype+'_add');
  226. scope.close();
  227. }
  228. },{
  229. text: '取消',
  230. cls:'x-formpanel-btn-blue',
  231. handler: function(b) {
  232. var scope = b.ownerCt.ownerCt;
  233. scope.close();
  234. }
  235. }]
  236. }));
  237. win.show({
  238. title : '模块介绍',
  239. msg : message,
  240. icon : icon
  241. });
  242. }
  243. });