FormPanelController.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. Ext.define('saas.view.stock.otherOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-otherout-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pi_vendname]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/vendor/list',
  12. // dataUrl:'http://localhost:9480/vendor/list',
  13. addXtype: 'document-vendor-formpanel',
  14. addTitle: '供应商资料',
  15. dbfinds:[{
  16. from:'id',to:'pi_vendid'
  17. },{
  18. from:'ve_code',to:'pi_vendcode'
  19. },{
  20. from:'ve_name',to:'pi_vendname'
  21. }],
  22. dbtpls:[{
  23. field:'ve_code',width:100
  24. },{
  25. field:'ve_name',width:100
  26. }],
  27. dbColumns:[{
  28. conditionCode:'id',
  29. "text": "供应商ID",
  30. "flex": 0,
  31. "dataIndex": "id",
  32. "width": 0,
  33. "xtype": "",
  34. "items": null
  35. },{
  36. conditionCode:'ve_code',
  37. "text": "供应商编号",
  38. "flex": 1,
  39. "dataIndex": "ve_code",
  40. "width": 100,
  41. "xtype": "",
  42. "items": null
  43. }, {
  44. conditionCode:'ve_name',
  45. "text": "供应商名称",
  46. "flex": 1,
  47. "dataIndex": "ve_name",
  48. "xtype": "",
  49. "items": null
  50. }, {
  51. conditionCode:'ve_type',
  52. "text": "供应商类型",
  53. "flex": 0,
  54. "dataIndex": "ve_type",
  55. "width": 200,
  56. "xtype": "",
  57. "items": null
  58. }]
  59. }) ;
  60. }
  61. },
  62. //放大镜赋值关系 以及 tpl模板
  63. 'dbfindtrigger[name=pi_custname]':{
  64. beforerender:function(f){
  65. Ext.apply(f,{
  66. dataUrl:'/api/document/customer/list',
  67. // dataUrl:'http://localhost:9480/customer/list',
  68. addXtype: 'document-customer-formpanel',
  69. addTitle: '客户资料',
  70. dbfinds:[{
  71. from:'id',to:'pi_custid'
  72. },{
  73. from:'cu_code',to:'pi_custcode'
  74. },{
  75. from:'cu_name',to:'pi_custname'
  76. }],
  77. dbtpls:[{
  78. field:'pi_custcode',width:100
  79. },{
  80. field:'pi_custname',width:100
  81. }],
  82. dbColumns:[{
  83. conditionCode:'id',
  84. "text": "客户ID",
  85. "flex": 0,
  86. "dataIndex": "id",
  87. "width": 0,
  88. "xtype": "",
  89. "items": null
  90. },{
  91. conditionCode:'cu_code',
  92. "text": "客户编号",
  93. "flex": 1,
  94. "dataIndex": "cu_code",
  95. "width": 100,
  96. "xtype": "",
  97. "items": null
  98. }, {
  99. conditionCode:'cu_name',
  100. "text": "客户名称",
  101. "flex": 1,
  102. "dataIndex": "cu_name",
  103. "xtype": "",
  104. "items": null
  105. }]
  106. }) ;
  107. }
  108. },
  109. //放大镜赋值关系 以及 tpl模板
  110. 'multidbfindtrigger[name=pd_prodcode]':{
  111. beforerender:function(f){
  112. Ext.apply(f,{
  113. dataUrl:'/api/document/product/list',
  114. // dataUrl:'http://localhost:9480/product/list',
  115. addXtype: 'document-product-formpanel',
  116. addTitle: '物料资料',
  117. dbfinds:[{
  118. from:'id',to:'pd_prodid'
  119. },{
  120. from:'pr_code',to:'pd_prodcode'
  121. },{
  122. from:'pr_detail',to:'pr_detail'
  123. },{
  124. from:'pr_spec',to:'pr_spec'
  125. }],
  126. dbtpls:[{
  127. field:'pr_code',width:100
  128. },{
  129. field:'pr_detail',width:100
  130. },{
  131. field:'pr_spec',width:100
  132. }],
  133. dbColumns:[{
  134. "text": "物料ID",
  135. "flex": 0,
  136. "dataIndex": "pr_id",
  137. "width": 0,
  138. "xtype": "",
  139. "items": null
  140. },{
  141. "text": "物料编号",
  142. "flex": 1,
  143. "dataIndex": "pr_code",
  144. "width": 100,
  145. "xtype": "",
  146. "items": null
  147. }, {
  148. "text": "物料名称",
  149. "flex": 1,
  150. "dataIndex": "pr_detail",
  151. "xtype": "",
  152. "items": null
  153. }, {
  154. "text": "物料规格",
  155. "flex": 0,
  156. "dataIndex": "pr_spec",
  157. "width": 200,
  158. "xtype": "",
  159. "items": null
  160. }, {
  161. "text": "物料单位",
  162. "flex": 0,
  163. "dataIndex": "pr_unit",
  164. "width": 200,
  165. "xtype": "",
  166. "items": null
  167. }]
  168. }) ;
  169. }
  170. },
  171. //放大镜赋值关系 以及 tpl模板
  172. 'dbfindtrigger[name=pd_whname]':{
  173. beforerender:function(f){
  174. Ext.apply(f,{
  175. dataUrl:'/api/document/warehouse/list',
  176. // dataUrl:'http://localhost:9480/warehouse/list',
  177. dbfinds:[{
  178. from:'id',to:'pd_whid'
  179. },{
  180. from:'wh_code',to:'pd_whcode'
  181. },{
  182. from:'wh_description',to:'pd_whname'
  183. }],
  184. dbtpls:[{
  185. field:'pd_whcode',width:100
  186. },{
  187. field:'pd_whname',width:100
  188. }],
  189. dbColumns:[{
  190. "text": "仓库ID",
  191. "flex": 0,
  192. "dataIndex": "id",
  193. "width": 0,
  194. "xtype": "",
  195. "items": null
  196. },{
  197. "text": "仓库编号",
  198. "flex": 1,
  199. "dataIndex": "wh_code",
  200. "width": 100,
  201. "xtype": "",
  202. "items": null
  203. }, {
  204. "text": "仓库名称",
  205. "flex": 1,
  206. "dataIndex": "wh_description",
  207. "xtype": "",
  208. "items": null
  209. }, ]
  210. }) ;
  211. }
  212. }
  213. });
  214. },
  215. addCombo: function () {
  216. var combo = this.ownerCmp;
  217. Ext.create('Ext.window.Window', {
  218. layout: 'vbox',
  219. bodyPadding: 15,
  220. width: 500,
  221. items: [{
  222. fieldLabel: '实际值',
  223. xtype: 'textfield'
  224. }, {
  225. fieldLabel: '显示值',
  226. xtype: 'textfield'
  227. }],
  228. buttons: [{
  229. text: '确认',
  230. handler: function (b) {
  231. combo.setValue('ok');
  232. b.up('window').close();
  233. }
  234. }],
  235. renderTo: this.ownerCmp.ownerCt.getEl()
  236. }).show();
  237. }
  238. });