FormPanelController.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. /**放大镜新增demo*/
  8. "field[name=combo]":{
  9. beforerender:function(f){
  10. f.addHandler=me.addCombo;
  11. }
  12. },
  13. //放大镜赋值关系 以及 tpl模板
  14. 'dbfindtrigger[name=pu_vendcode]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. dataUrl:basePath+'document/vendor/list',
  18. // dataUrl:'http://localhost:9480/vendor/list',
  19. dbfinds:[{
  20. from:'ve_id',to:'pi_vendid'
  21. },{
  22. from:'ve_code',to:'pu_vendcode'
  23. },{
  24. from:'ve_name',to:'pu_vendname'
  25. }],
  26. dbtpls:[{
  27. field:'ve_code',width:100
  28. },{
  29. field:'ve_name',width:100
  30. }],
  31. dbColumns:[{
  32. conditionCode:'ve_id',
  33. "text": "供应商ID",
  34. "flex": 0,
  35. "dataIndex": "ve_id",
  36. "width": 0,
  37. "xtype": "",
  38. "items": null
  39. },{
  40. conditionCode:'ve_code',
  41. "text": "供应商编号",
  42. "flex": 1,
  43. "dataIndex": "ve_code",
  44. "width": 100,
  45. "xtype": "",
  46. "items": null
  47. }, {
  48. conditionCode:'ve_name',
  49. "text": "供应商名称",
  50. "flex": 1,
  51. "dataIndex": "ve_name",
  52. "xtype": "",
  53. "items": null
  54. }, {
  55. conditionCode:'ve_type',
  56. "text": "供应商类型",
  57. "flex": 0,
  58. "dataIndex": "ve_type",
  59. "width": 200,
  60. "xtype": "",
  61. "items": null
  62. }]
  63. }) ;
  64. }
  65. },
  66. //放大镜赋值关系 以及 tpl模板
  67. 'dbfindtrigger[name=pd_prodcode]':{
  68. beforerender:function(f){
  69. Ext.apply(f,{
  70. dataUrl:basePath+'document/product/list',
  71. // dataUrl:'http://localhost:9480/product/list',
  72. dbfinds:[{
  73. from:'id',to:'pd_prodid'
  74. },{
  75. from:'pr_code',to:'pd_prodcode'
  76. },{
  77. from:'pr_detail',to:'pr_detail'
  78. },{
  79. from:'pr_unit',to:'pd_unit'
  80. }],
  81. dbtpls:[{
  82. field:'pr_code',width:100
  83. },{
  84. field:'pr_detail',width:100
  85. },{
  86. field:'pr_unit',width:100
  87. }],
  88. dbColumns:[{
  89. "text": "物料ID",
  90. "flex": 0,
  91. "dataIndex": "pr_id",
  92. "width": 0,
  93. "xtype": "",
  94. "items": null
  95. },{
  96. "text": "物料编号",
  97. "flex": 1,
  98. "dataIndex": "pr_code",
  99. "width": 100,
  100. "xtype": "",
  101. "items": null
  102. }, {
  103. "text": "物料名称",
  104. "flex": 1,
  105. "dataIndex": "pr_detail",
  106. "xtype": "",
  107. "items": null
  108. }, {
  109. "text": "物料规格",
  110. "flex": 0,
  111. "dataIndex": "pr_spec",
  112. "width": 200,
  113. "xtype": "",
  114. "items": null
  115. }, {
  116. "text": "物料单位",
  117. "flex": 0,
  118. "dataIndex": "pr_unit",
  119. "width": 200,
  120. "xtype": "",
  121. "items": null
  122. }]
  123. }) ;
  124. }
  125. }, //放大镜赋值关系 以及 tpl模板
  126. 'dbfindtrigger[name=pd_whname]':{
  127. beforerender:function(f){
  128. Ext.apply(f,{
  129. dataUrl:basePath+'document/warehouse/list',
  130. // dataUrl:'http://localhost:9480/warehouse/list',
  131. dbfinds:[{
  132. from:'id',to:'pd_whid'
  133. },{
  134. from:'wh_code',to:'pd_whcode'
  135. },{
  136. from:'wh_description',to:'pd_whname'
  137. }],
  138. dbtpls:[{
  139. field:'pd_whcode',width:100
  140. },{
  141. field:'pd_whname',width:100
  142. }],
  143. dbColumns:[{
  144. "text": "仓库ID",
  145. "flex": 0,
  146. "dataIndex": "id",
  147. "width": 0,
  148. "xtype": "",
  149. "items": null
  150. },{
  151. "text": "仓库编号",
  152. "flex": 1,
  153. "dataIndex": "wh_code",
  154. "width": 100,
  155. "xtype": "",
  156. "items": null
  157. }, {
  158. "text": "仓库名称",
  159. "flex": 1,
  160. "dataIndex": "wh_description",
  161. "xtype": "",
  162. "items": null
  163. }, ]
  164. }) ;
  165. }
  166. }
  167. });
  168. },
  169. addCombo:function(){
  170. var combo=this.ownerCmp;
  171. Ext.create('Ext.window.Window',{
  172. layout:'vbox',
  173. bodyPadding: 15,
  174. width:500,
  175. items:[{
  176. fieldLabel:'实际值',
  177. xtype:'textfield'
  178. },{
  179. fieldLabel:'显示值',
  180. xtype:'textfield'
  181. }],
  182. buttons:[{
  183. text:'确认',
  184. handler:function(b){
  185. combo.setValue('ok');
  186. b.up('window').close();
  187. }
  188. }],
  189. renderTo:this.ownerCmp.ownerCt.getEl()
  190. }).show();
  191. },
  192. turnIn: function() {
  193. var me = this,
  194. form = me.getView(),
  195. id = form.getForm().findField(form._idField);
  196. form.BaseUtil.request({
  197. url: form._turnInUrl+id.value,
  198. method: 'GET',
  199. })
  200. .then(function(localJson) {
  201. if(localJson.success){
  202. showToast('转单成功');
  203. }
  204. })
  205. .catch(function(res) {
  206. showToast('转单失败: ' + res.message);
  207. });
  208. }
  209. });