QueryPanelController.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
  2. extend: 'saas.view.core.query.QueryPanelController',
  3. alias: 'controller.purchase-purchaseout-querypanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pi_vendname]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/vendor/list',
  12. addXtype: 'document-vendor-formpanel',
  13. addTitle: '供应商资料',
  14. dbfinds:[{
  15. from:'ve_code',to:'pi_vendcode'
  16. },{
  17. from:'ve_name',to:'pi_vendname'
  18. }],
  19. dbtpls:[{
  20. field:'ve_code',width:100
  21. },{
  22. field:'ve_name',width:100
  23. }],
  24. defaultCondition: "ve_statuscode='OPEN'",
  25. dbSearchFields:[{
  26. emptyText:'输入供应商编号或名称',
  27. xtype : "textfield",
  28. name : "search",
  29. getCondition: function(v) {
  30. return "(upper(ve_code) like '%"+v.toUpperCase()+"%' or upper(ve_name) like '%"+v.toUpperCase()+"%')";
  31. },
  32. allowBlank : true,
  33. columnWidth : 0.25
  34. }],
  35. dbColumns:[{
  36. "text": "供应商ID",
  37. "hidden": true,
  38. "dataIndex": "id",
  39. "width": 100,
  40. "xtype": "numbercolumn"
  41. },{
  42. "text": "供应商编号",
  43. "dataIndex": "ve_code",
  44. "width": 200
  45. }, {
  46. "text": "供应商名称",
  47. "dataIndex": "ve_name",
  48. "width": 200
  49. }, {
  50. "text": "供应商类型",
  51. "dataIndex": "ve_type",
  52. "width": 180,
  53. "items": null
  54. }, {
  55. "text": "税率",
  56. "dataIndex": "ve_taxrate",
  57. "width": 100,
  58. xtype: 'numbercolumn',
  59. }, {
  60. "text": "承付天数",
  61. "dataIndex": "ve_promisedays",
  62. "width": 100,
  63. xtype: 'numbercolumn',
  64. align: 'end',
  65. renderer : function(v) {
  66. return Ext.util.Format.number(v, '0');
  67. }
  68. }, {
  69. "text": "纳税人识别号",
  70. "dataIndex": "ve_bankaccount",
  71. "width": 150
  72. }, {
  73. "text": "开户银行",
  74. "dataIndex": "ve_bankaccount",
  75. "width": 100
  76. }, {
  77. "text": "银行账户",
  78. "dataIndex": "ve_bankcode",
  79. "width": 100
  80. }]
  81. }) ;
  82. }
  83. },
  84. //放大镜赋值关系 以及 tpl模板
  85. 'dbfindtrigger[name=pr_detail]':{
  86. beforerender:function(f){
  87. Ext.apply(f,{
  88. dataUrl:'/api/document/product/list',
  89. addXtype: 'document-product-formpanel',
  90. addTitle: '物料资料',
  91. dbfinds:[{
  92. from:'pr_code',to:'pd_prodcode',
  93. }, {
  94. from:'pr_detail',to:'pr_detail'
  95. }],
  96. dbtpls:[{
  97. field:'pr_code',width:100
  98. },{
  99. field:'pr_detail',width:100
  100. }],
  101. defaultCondition: "pr_statuscode='OPEN'",
  102. dbSearchFields:[{
  103. emptyText:'输入物料编号或名称',
  104. xtype : "textfield",
  105. name : "search",
  106. width: 200,
  107. getCondition: function(v) {
  108. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  109. },
  110. allowBlank : true,
  111. columnWidth : 0.25
  112. }],
  113. dbColumns:[{
  114. "text": "物料ID",
  115. "hidden": true,
  116. "dataIndex": "id",
  117. }, {
  118. "text": "物料编号",
  119. "dataIndex": "pr_code",
  120. "width": 200,
  121. }, {
  122. "text": "物料名称",
  123. "width": 200,
  124. "dataIndex": "pr_detail",
  125. }, {
  126. "text": "规格",
  127. "dataIndex": "pr_spec",
  128. "width": 100,
  129. }, {
  130. "text": "单位",
  131. "dataIndex": "pr_spec",
  132. "width": 100,
  133. },{
  134. "text": "仓库id",
  135. "dataIndex": "pr_whid",
  136. "hidden": true,
  137. },{
  138. "text": "仓库编号",
  139. "dataIndex": "pr_whcode",
  140. "hidden": true,
  141. },{
  142. "text": "仓库",
  143. "dataIndex": "pr_whname",
  144. "width": 200,
  145. "hidden": true
  146. },{
  147. "text": "总库存数",
  148. "dataIndex": "po_onhand",
  149. "width": 100,
  150. xtype: 'numbercolumn',
  151. renderer : function(v) {
  152. var arr = (v + '.').split('.');
  153. var xr = (new Array(arr[1].length)).fill('0');
  154. var format = '0,000.' + xr.join();
  155. return Ext.util.Format.number(v, format);
  156. },
  157. align:'end'
  158. },{
  159. "text": "类型",
  160. "dataIndex": "pr_kind",
  161. "width": 100,
  162. },{
  163. "text": "型号",
  164. "dataIndex": "pr_orispeccode",
  165. "width": 100,
  166. },{
  167. "text": "品牌",
  168. "dataIndex": "pr_brand",
  169. "width": 100,
  170. },{
  171. "text": "供应商",
  172. "dataIndex": "pr_vendname",
  173. "width": 100,
  174. },{
  175. "text": "最小包装",
  176. "dataIndex": "pr_zxbzs",
  177. "width": 100,
  178. xtype: 'numbercolumn',
  179. align: 'end'
  180. },{
  181. "text": "L/T",
  182. "dataIndex": "pr_leadtime",
  183. "width": 100,
  184. }]
  185. }) ;
  186. }
  187. }
  188. });
  189. }
  190. });