FormPanelController.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. Ext.define('saas.view.stock.make.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-make-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //主表单选放大镜模板
  8. 'dbfindtrigger[name=pu_vendcode]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. //数据接口
  12. dataUrl:basePath+'document/vendor/list',
  13. //赋值
  14. dbfinds:[{
  15. from:'ve_code',to:'pu_vendcode'
  16. },{
  17. from:'ve_name',to:'pu_vendname'
  18. }],
  19. //联想设置
  20. dbtpls:[{
  21. field:'ve_code',width:100
  22. },{
  23. field:'ve_name',width:100
  24. }],
  25. //联想查询条件
  26. dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
  27. //放大镜窗口字段
  28. dbSearchFields:[{
  29. xtype : "textfield",
  30. name : "ve_name",
  31. conditionExpression:"ve_name like '{0}%'",//传入后台条件 替换占位符
  32. fieldLabel : "供应商名称",
  33. columnWidth : 0.25
  34. }],
  35. //放大镜窗口列表
  36. dbColumns:[{
  37. "text": "供应商ID",
  38. "flex": 0,
  39. "dataIndex": "ve_id",
  40. "width": 0,
  41. "xtype": "",
  42. "items": null
  43. },{
  44. "text": "供应商编号",
  45. "flex": 1,
  46. "dataIndex": "ve_code",
  47. "width": 100,
  48. "xtype": "",
  49. "items": null
  50. }, {
  51. "text": "供应商名称",
  52. "flex": 1,
  53. "dataIndex": "ve_name",
  54. "xtype": "",
  55. "items": null
  56. }, {
  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=pd_prodcode]':{
  69. beforerender:function(f){
  70. Ext.apply(f,{
  71. //数据接口
  72. dataUrl:basePath+'document/product/getProductsByCondition',
  73. //放大镜赋值设置
  74. dbfinds:[{
  75. from:'pr_code',to:'pd_prodcode'
  76. },{
  77. from:'pr_unit',to:'pd_unit'
  78. }],
  79. //联想查询条件
  80. dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
  81. //联想设置
  82. dbtpls:[{
  83. field:'pr_code',width:100
  84. },{
  85. field:'pr_detail',width:100
  86. }],
  87. //窗口字段设置
  88. dbSearchFields:[{
  89. emptyText:'输入物料编号或物料名称',
  90. xtype : "textfield",
  91. name : "search",
  92. conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
  93. allowBlank : true,
  94. columnWidth : 0.25
  95. }],
  96. //窗口列设置
  97. dbColumns:[{
  98. "text": "物料ID",
  99. "flex": 0,
  100. "dataIndex": "pr_id",
  101. "width": 0,
  102. "xtype": "",
  103. "items": null
  104. },{
  105. "text": "物料编号",
  106. "flex": 1,
  107. "dataIndex": "pr_code",
  108. "width": 100,
  109. "xtype": "",
  110. "items": null
  111. }, {
  112. "text": "物料名称",
  113. "flex": 1,
  114. "dataIndex": "pr_detail",
  115. "xtype": "",
  116. "items": null
  117. }, {
  118. "text": "物料规格",
  119. "flex": 0,
  120. "dataIndex": "pr_spec",
  121. "width": 200,
  122. "xtype": "",
  123. "items": null
  124. }]
  125. }) ;
  126. }
  127. },
  128. //从表多选放大镜赋值关系 以及 tpl模板
  129. 'multidbfindtrigger[name=pd_prodcode]':{
  130. beforerender:function(f){
  131. Ext.apply(f,{
  132. //数据接口
  133. dataUrl:'http://192.168.253.31:9480/product/getProductsByCondition',
  134. //放大镜赋值设置
  135. dbfinds:[{
  136. from:'pr_code',to:'pd_prodcode'
  137. },{
  138. from:'pr_unit',to:'pd_unit'
  139. }],
  140. //联想查询条件
  141. dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
  142. //联想设置
  143. dbtpls:[{
  144. field:'pr_code',width:100
  145. },{
  146. field:'pr_detail',width:100
  147. }],
  148. //窗口字段设置
  149. dbSearchFields:[{
  150. emptyText:'输入物料编号或物料名称',
  151. xtype : "textfield",
  152. name : "search",
  153. conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
  154. allowBlank : true,
  155. columnWidth : 0.25
  156. }],
  157. //窗口列设置
  158. dbColumns:[{
  159. "text": "物料ID",
  160. "flex": 0,
  161. "dataIndex": "pr_id",
  162. "width": 0,
  163. "xtype": "",
  164. "items": null
  165. },{
  166. "text": "物料编号",
  167. "flex": 1,
  168. "dataIndex": "pr_code",
  169. "width": 100,
  170. "xtype": "",
  171. "items": null
  172. }, {
  173. "text": "物料名称",
  174. "flex": 1,
  175. "dataIndex": "pr_detail",
  176. "xtype": "",
  177. "items": null
  178. }, {
  179. "text": "物料规格",
  180. "flex": 0,
  181. "dataIndex": "pr_spec",
  182. "width": 200,
  183. "xtype": "",
  184. "items": null
  185. }]
  186. }) ;
  187. }
  188. }
  189. });
  190. },
  191. turnIn: function() {
  192. var me = this,
  193. form = me.getView(),
  194. id = form.getForm().findField(form._idField);
  195. form.BaseUtil.request({
  196. url: form._turnInUrl+id.value,
  197. method: 'GET',
  198. })
  199. .then(function(localJson) {
  200. if(localJson.success){
  201. Ext.Msg.alert('提示','转单成功');
  202. }
  203. })
  204. .catch(function() {
  205. Ext.Msg.alert('提示','转单失败');
  206. });
  207. }
  208. });