FormPanelController.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.purchase-purchaseout-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=pi_vendname]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. dataUrl:'/api/document/vendor/list',
  18. // dataUrl:'http://localhost:9480/vendor/list',
  19. addXtype: 'document-vendor-formpanel',
  20. addTitle: '供应商资料',
  21. defaultCondition:"ve_statuscode='OPEN'",
  22. dbfinds:[{
  23. from:'id',to:'pi_vendid',ignore:true
  24. },{
  25. from:'ve_code',to:'pi_vendcode'
  26. },{
  27. from:'ve_name',to:'pi_vendname'
  28. }],
  29. dbtpls:[{
  30. field:'ve_code',width:100
  31. },{
  32. field:'ve_name',width:100
  33. }],
  34. defaultCondition: "ve_statuscode='OPEN'",
  35. dbSearchFields:[{
  36. emptyText:'输入供应商编号或名称',
  37. xtype : "textfield",
  38. name : "search",
  39. getCondition: function(v) {
  40. return "(upper(ve_code) like '%"+v.toUpperCase()+"%' or upper(ve_name) like '%"+v.toUpperCase()+"%')";
  41. },
  42. allowBlank : true,
  43. columnWidth : 0.25
  44. }],
  45. dbColumns:[{
  46. "text": "供应商ID",
  47. "hidden": true,
  48. "dataIndex": "id",
  49. "width": 100,
  50. "xtype": "numbercolumn"
  51. },{
  52. "text": "供应商编号",
  53. "dataIndex": "ve_code",
  54. "width": 200
  55. }, {
  56. "text": "供应商名称",
  57. "dataIndex": "ve_name",
  58. "width": 200
  59. }, {
  60. "text": "供应商类型",
  61. "dataIndex": "ve_type",
  62. "width": 180,
  63. "items": null
  64. }, {
  65. "text": "税率",
  66. "dataIndex": "ve_taxrate",
  67. "width": 100,
  68. xtype: 'numbercolumn',
  69. align:'end'
  70. }, {
  71. "text": "承付天数",
  72. "dataIndex": "ve_promisedays",
  73. "width": 100,
  74. xtype: 'numbercolumn',
  75. align:'end'
  76. }, {
  77. "text": "纳税人识别号",
  78. "dataIndex": "ve_bankaccount",
  79. "width": 150
  80. }, {
  81. "text": "开户银行",
  82. "dataIndex": "ve_bankaccount",
  83. "width": 100
  84. }, {
  85. "text": "银行账户",
  86. "dataIndex": "ve_bankcode",
  87. "width": 100
  88. }]
  89. }) ;
  90. }
  91. },
  92. //放大镜赋值关系 以及 tpl模板
  93. 'multidbfindtrigger[name=pd_prodcode]':{
  94. beforerender:function(f){
  95. Ext.apply(f,{
  96. dataUrl:'/api/document/product/list',
  97. // dataUrl:'http://localhost:9480/product/list',
  98. addXtype: 'document-product-formpanel',
  99. addTitle: '物料资料',
  100. dbfinds:[{
  101. from:'id',to:'pd_prodid',ignore:true
  102. },{
  103. from:'pr_code',to:'pd_prodcode'
  104. },{
  105. from:'pr_detail',to:'pr_detail'
  106. },{
  107. from:'pr_unit',to:'pd_unit'
  108. },{
  109. from:'pr_whid',to:'pd_whid'
  110. },{
  111. from:'pr_whcode',to:'pd_whcode'
  112. },{
  113. from:'pr_whname',to:'pd_whname'
  114. },,{
  115. from:'pr_purcprice',to:'pd_orderprice'
  116. }],
  117. dbtpls:[{
  118. field:'pr_code',width:100
  119. },{
  120. field:'pr_detail',width:100
  121. },{
  122. field:'pr_unit',width:100
  123. }],
  124. defaultCondition: "pr_statuscode='OPEN'",
  125. dbSearchFields:[{
  126. emptyText:'输入物料编号、名称或规格',
  127. xtype : "textfield",
  128. name : "search",
  129. width: 200,
  130. getCondition: function(v) {
  131. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  132. },
  133. allowBlank : true,
  134. columnWidth : 0.25
  135. }],
  136. //窗口列设置
  137. dbColumns:[{
  138. "text": "物料ID",
  139. "hidden": true,
  140. "dataIndex": "id",
  141. }, {
  142. "text": "物料编号",
  143. "dataIndex": "pr_code",
  144. "width": 200,
  145. }, {
  146. "text": "物料名称",
  147. "width": 200,
  148. "dataIndex": "pr_detail",
  149. }, {
  150. "text": "规格",
  151. "dataIndex": "pr_spec",
  152. "width": 100,
  153. }, {
  154. "text": "单位",
  155. "dataIndex": "pr_unit",
  156. "width": 100,
  157. },{
  158. "text": "仓库id",
  159. "dataIndex": "pr_whid",
  160. "hidden": true,
  161. },{
  162. "text": "仓库编号",
  163. "dataIndex": "pr_whcode",
  164. "hidden": true,
  165. },{
  166. "text": "仓库",
  167. "dataIndex": "pr_whname",
  168. "width": 200,
  169. },{
  170. "text": "总库存数",
  171. "dataIndex": "po_onhand",
  172. "width": 100,
  173. xtype: 'numbercolumn',
  174. align:'end'
  175. },{
  176. "text": "类型",
  177. "dataIndex": "pr_kind",
  178. "width": 100,
  179. },{
  180. "text": "型号",
  181. "dataIndex": "pr_orispeccode",
  182. "width": 100,
  183. },{
  184. "text": "品牌",
  185. "dataIndex": "pr_brand",
  186. "width": 100,
  187. },{
  188. "text": "供应商",
  189. "dataIndex": "pr_vendname",
  190. "width": 100,
  191. },{
  192. "text": "最小包装",
  193. "dataIndex": "pr_zxbzs",
  194. "width": 100,
  195. xtype: 'numbercolumn',
  196. align:'end'
  197. },{
  198. "text": "L/T",
  199. "dataIndex": "pr_leadtime",
  200. "width": 100,
  201. }]
  202. }) ;
  203. }
  204. },
  205. //放大镜赋值关系 以及 tpl模板
  206. 'dbfindtrigger[name=pd_whname]':{
  207. beforerender:function(f){
  208. Ext.apply(f,{
  209. dataUrl:'/api/document/warehouse/list',
  210. // dataUrl:'http://localhost:9480/warehouse/list',
  211. addXtype: 'other-warehouse',
  212. addTitle: '仓库资料',
  213. defaultCondition:"wh_statuscode='OPEN'",
  214. dbfinds:[{
  215. from:'id',to:'pd_whid',ignore:true
  216. },{
  217. from:'wh_code',to:'pd_whcode'
  218. },{
  219. from:'wh_description',to:'pd_whname'
  220. }],
  221. dbtpls:[{
  222. field:'pd_whcode',width:100
  223. },{
  224. field:'pd_whname',width:100
  225. }],
  226. dbSearchFields:[{
  227. emptyText:'输入仓库编号或名称',
  228. xtype : "textfield",
  229. name : "wh_code",
  230. allowBlank : true,
  231. columnWidth : 0.25,
  232. getCondition:function(v){
  233. return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  234. }
  235. }],
  236. dbColumns:[{
  237. "text": "仓库ID",
  238. "flex": 0,
  239. "dataIndex": "id",
  240. "width": 0,
  241. "xtype": "",
  242. "items": null
  243. },{
  244. "text": "仓库编号",
  245. "flex": 1,
  246. "dataIndex": "wh_code",
  247. "width": 100,
  248. "xtype": "",
  249. "items": null
  250. },{
  251. "text": "仓库名称",
  252. "flex": 1,
  253. "dataIndex": "wh_description",
  254. "xtype": "",
  255. "items": null
  256. },{
  257. "text": "仓库类型",
  258. "flex": 1,
  259. "dataIndex": "wh_type",
  260. "xtype": "",
  261. "items": null
  262. }]
  263. }) ;
  264. }
  265. }
  266. });
  267. },
  268. addCombo:function(){
  269. var combo=this.ownerCmp;
  270. Ext.create('Ext.window.Window',{
  271. layout:'vbox',
  272. bodyPadding: 15,
  273. width:500,
  274. items:[{
  275. fieldLabel:'实际值',
  276. xtype:'textfield'
  277. },{
  278. fieldLabel:'显示值',
  279. xtype:'textfield'
  280. }],
  281. buttons:[{
  282. text:'确认',
  283. handler:function(b){
  284. combo.setValue('ok');
  285. b.up('window').close();
  286. }
  287. }],
  288. renderTo:this.ownerCmp.ownerCt.getEl()
  289. }).show();
  290. }
  291. });