FormPanelController.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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=pu_vendcode]': {
  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: 've_id',
  17. to: 'pi_vendid'
  18. }, {
  19. from: 've_code',
  20. to: 'pu_vendcode'
  21. }, {
  22. from: 've_name',
  23. to: 'pu_vendname'
  24. }],
  25. dbtpls: [{
  26. field: 've_code',
  27. width: 100
  28. }, {
  29. field: 've_name',
  30. width: 100
  31. }],
  32. dbColumns: [{
  33. conditionCode: 've_id',
  34. "text": "供应商ID",
  35. "flex": 0,
  36. "dataIndex": "ve_id",
  37. "width": 0,
  38. "xtype": "",
  39. "items": null
  40. }, {
  41. conditionCode: 've_code',
  42. "text": "供应商编号",
  43. "flex": 1,
  44. "dataIndex": "ve_code",
  45. "width": 100,
  46. "xtype": "",
  47. "items": null
  48. }, {
  49. conditionCode: 've_name',
  50. "text": "供应商名称",
  51. "flex": 1,
  52. "dataIndex": "ve_name",
  53. "xtype": "",
  54. "items": null
  55. }, {
  56. conditionCode: 've_type',
  57. "text": "供应商类型",
  58. "flex": 0,
  59. "dataIndex": "ve_type",
  60. "width": 200,
  61. "xtype": "",
  62. "items": null
  63. }]
  64. });
  65. }
  66. },
  67. //放大镜赋值关系 以及 tpl模板
  68. 'dbfindtrigger[name=pi_vendname]':{
  69. beforerender:function(f){
  70. Ext.apply(f,{
  71. dataUrl:'/api/document/vendor/list',
  72. // dataUrl:'http://localhost:9480/vendor/list',
  73. addXtype: 'document-vendor-formpanel',
  74. addTitle: '供应商资料',
  75. dbfinds:[{
  76. from:'id',to:'pi_vendid'
  77. },{
  78. from:'ve_code',to:'pi_vendcode'
  79. },{
  80. from:'ve_name',to:'pi_vendname'
  81. }],
  82. dbtpls:[{
  83. field:'ve_code',width:100
  84. },{
  85. field:'ve_name',width:100
  86. }],
  87. dbColumns:[{
  88. conditionCode:'id',
  89. "text": "供应商ID",
  90. "flex": 0,
  91. "dataIndex": "id",
  92. "width": 0,
  93. "xtype": "",
  94. "items": null
  95. },{
  96. conditionCode:'ve_code',
  97. "text": "供应商编号",
  98. "flex": 1,
  99. "dataIndex": "ve_code",
  100. "width": 100,
  101. "xtype": "",
  102. "items": null
  103. }, {
  104. conditionCode:'ve_name',
  105. "text": "供应商名称",
  106. "flex": 1,
  107. "dataIndex": "ve_name",
  108. "xtype": "",
  109. "items": null
  110. }, {
  111. conditionCode:'ve_type',
  112. "text": "供应商类型",
  113. "flex": 0,
  114. "dataIndex": "ve_type",
  115. "width": 200,
  116. "xtype": "",
  117. "items": null
  118. }]
  119. }) ;
  120. }
  121. },
  122. //放大镜赋值关系 以及 tpl模板
  123. 'dbfindtrigger[name=pi_custname]':{
  124. beforerender:function(f){
  125. Ext.apply(f,{
  126. dataUrl:'/api/document/customer/list',
  127. // dataUrl:'http://localhost:9480/customer/list',
  128. addXtype: 'document-customer-formpanel',
  129. addTitle: '客户资料',
  130. dbfinds:[{
  131. from:'id',to:'pi_custid'
  132. },{
  133. from:'cu_code',to:'pi_custcode'
  134. },{
  135. from:'cu_name',to:'pi_custname'
  136. }],
  137. dbtpls:[{
  138. field:'pi_custcode',width:100
  139. },{
  140. field:'pi_custname',width:100
  141. }],
  142. dbColumns:[{
  143. conditionCode:'id',
  144. "text": "客户ID",
  145. "flex": 0,
  146. "dataIndex": "id",
  147. "width": 0,
  148. "xtype": "",
  149. "items": null
  150. },{
  151. conditionCode:'cu_code',
  152. "text": "客户编号",
  153. "flex": 1,
  154. "dataIndex": "cu_code",
  155. "width": 100,
  156. "xtype": "",
  157. "items": null
  158. }, {
  159. conditionCode:'cu_name',
  160. "text": "客户名称",
  161. "flex": 1,
  162. "dataIndex": "cu_name",
  163. "xtype": "",
  164. "items": null
  165. }]
  166. }) ;
  167. }
  168. },
  169. //放大镜赋值关系 以及 tpl模板
  170. 'dbfindtrigger[name=pd_prodcode]':{
  171. beforerender:function(f){
  172. Ext.apply(f,{
  173. dataUrl:'/api/document/product/list',
  174. // dataUrl:'http://localhost:9480/product/list',
  175. addXtype: 'document-product-formpanel',
  176. addTitle: '物料资料',
  177. dbfinds:[{
  178. from:'id',to:'pd_prodid'
  179. },{
  180. from:'pr_code',to:'pd_prodcode'
  181. },{
  182. from:'pr_detail',to:'pr_detail'
  183. },{
  184. from:'pr_spec',to:'pr_spec'
  185. }],
  186. dbtpls:[{
  187. field:'pr_code',width:100
  188. },{
  189. field:'pr_detail',width:100
  190. },{
  191. field:'pr_spec',width:100
  192. }],
  193. dbColumns:[{
  194. "text": "物料ID",
  195. "flex": 0,
  196. "dataIndex": "pr_id",
  197. "width": 0,
  198. "xtype": "",
  199. "items": null
  200. },{
  201. "text": "物料编号",
  202. "flex": 1,
  203. "dataIndex": "pr_code",
  204. "width": 100,
  205. "xtype": "",
  206. "items": null
  207. }, {
  208. "text": "物料名称",
  209. "flex": 1,
  210. "dataIndex": "pr_detail",
  211. "xtype": "",
  212. "items": null
  213. }, {
  214. "text": "物料规格",
  215. "flex": 0,
  216. "dataIndex": "pr_spec",
  217. "width": 200,
  218. "xtype": "",
  219. "items": null
  220. }, {
  221. "text": "物料单位",
  222. "flex": 0,
  223. "dataIndex": "pr_unit",
  224. "width": 200,
  225. "xtype": "",
  226. "items": null
  227. }]
  228. }) ;
  229. }
  230. },
  231. //放大镜赋值关系 以及 tpl模板
  232. 'dbfindtrigger[name=pd_whname]':{
  233. beforerender:function(f){
  234. Ext.apply(f,{
  235. dataUrl:'/api/document/warehouse/list',
  236. // dataUrl:'http://localhost:9480/warehouse/list',
  237. dbfinds:[{
  238. from:'id',to:'pd_whid'
  239. },{
  240. from:'wh_code',to:'pd_whcode'
  241. },{
  242. from:'wh_description',to:'pd_whname'
  243. }],
  244. dbtpls:[{
  245. field:'pd_whcode',width:100
  246. },{
  247. field:'pd_whname',width:100
  248. }],
  249. dbColumns:[{
  250. "text": "仓库ID",
  251. "flex": 0,
  252. "dataIndex": "id",
  253. "width": 0,
  254. "xtype": "",
  255. "items": null
  256. },{
  257. "text": "仓库编号",
  258. "flex": 1,
  259. "dataIndex": "wh_code",
  260. "width": 100,
  261. "xtype": "",
  262. "items": null
  263. }, {
  264. "text": "仓库名称",
  265. "flex": 1,
  266. "dataIndex": "wh_description",
  267. "xtype": "",
  268. "items": null
  269. }, ]
  270. }) ;
  271. }
  272. }
  273. });
  274. },
  275. addCombo: function () {
  276. var combo = this.ownerCmp;
  277. Ext.create('Ext.window.Window', {
  278. layout: 'vbox',
  279. bodyPadding: 15,
  280. width: 500,
  281. items: [{
  282. fieldLabel: '实际值',
  283. xtype: 'textfield'
  284. }, {
  285. fieldLabel: '显示值',
  286. xtype: 'textfield'
  287. }],
  288. buttons: [{
  289. text: '确认',
  290. handler: function (b) {
  291. combo.setValue('ok');
  292. b.up('window').close();
  293. }
  294. }],
  295. renderTo: this.ownerCmp.ownerCt.getEl()
  296. }).show();
  297. }
  298. });