FormPanelController.js 12 KB

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