QueryPanelController.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. Ext.define('saas.view.stock.appropriationInOut.QueryPanelController', {
  2. extend: 'saas.view.core.query.QueryPanelController',
  3. alias: 'controller.stock-appropriationinout-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. align: 'end'
  60. }, {
  61. "text": "承付天数",
  62. "dataIndex": "ve_promisedays",
  63. "width": 100,
  64. xtype: 'numbercolumn',
  65. align: 'end',
  66. renderer : function(v) {
  67. return Ext.util.Format.number(v, '0');
  68. }
  69. }, {
  70. "text": "纳税人识别号",
  71. "dataIndex": "ve_bankaccount",
  72. "width": 150
  73. }, {
  74. "text": "开户银行",
  75. "dataIndex": "ve_bankaccount",
  76. "width": 100
  77. }, {
  78. "text": "银行账户",
  79. "dataIndex": "ve_bankcode",
  80. "width": 100
  81. }]
  82. }) ;
  83. }
  84. },
  85. //放大镜赋值关系 以及 tpl模板
  86. 'dbfindtrigger[name=pr_detail]':{
  87. beforerender:function(f){
  88. Ext.apply(f,{
  89. conditionCode:'pr_code',
  90. dataUrl:'/api/document/product/list',
  91. addXtype: 'document-product-formpanel',
  92. addTitle: '物料资料',
  93. dbfinds:[{
  94. from:'pr_detail',to:'pr_detail',
  95. },{
  96. from:'pr_code',to:'pd_prodcode',
  97. }, {
  98. from:'pr_detail',to:'pr_detail'
  99. }],
  100. dbtpls:[{
  101. field:'pr_code',width:100
  102. },{
  103. field:'pr_detail',width:100
  104. }],
  105. defaultCondition: "pr_statuscode='OPEN'",
  106. dbSearchFields:[{
  107. emptyText:'输入物料编号或名称',
  108. xtype : "textfield",
  109. name : "search",
  110. width: 200,
  111. getCondition: function(v) {
  112. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  113. },
  114. allowBlank : true,
  115. columnWidth : 0.25
  116. }],
  117. dbColumns:[{
  118. "text": "物料ID",
  119. "hidden": true,
  120. "dataIndex": "id",
  121. }, {
  122. "text": "物料编号",
  123. "dataIndex": "pr_code",
  124. "width": 200,
  125. }, {
  126. "text": "物料名称",
  127. "width": 200,
  128. "dataIndex": "pr_detail",
  129. }, {
  130. "text": "规格",
  131. "dataIndex": "pr_spec",
  132. "width": 100,
  133. }, {
  134. "text": "单位",
  135. "dataIndex": "pr_spec",
  136. "width": 100,
  137. },{
  138. "text": "仓库id",
  139. "dataIndex": "pr_whid",
  140. "hidden": true,
  141. },{
  142. "text": "仓库编号",
  143. "dataIndex": "pr_whcode",
  144. "hidden": true,
  145. },{
  146. "text": "仓库",
  147. "dataIndex": "pr_whname",
  148. "width": 200,
  149. },{
  150. "text": "总库存数",
  151. "dataIndex": "po_onhand",
  152. "width": 100,
  153. xtype: 'numbercolumn',
  154. align: 'end'
  155. },{
  156. "text": "类型",
  157. "dataIndex": "pr_kind",
  158. "width": 100,
  159. },{
  160. "text": "型号",
  161. "dataIndex": "pr_orispeccode",
  162. "width": 100,
  163. },{
  164. "text": "品牌",
  165. "dataIndex": "pr_brand",
  166. "width": 100,
  167. },{
  168. "text": "供应商",
  169. "dataIndex": "pr_vendname",
  170. "width": 100,
  171. },{
  172. "text": "最小包装",
  173. "dataIndex": "pr_zxbzs",
  174. "width": 100,
  175. xtype: 'numbercolumn',
  176. align: 'end'
  177. },{
  178. "text": "L/T",
  179. "dataIndex": "pr_leadtime",
  180. "width": 100,
  181. }]
  182. }) ;
  183. }
  184. },
  185. 'dbfindtrigger[name=pi_custname]': {
  186. beforerender: function (f) {
  187. Ext.apply(f, {
  188. addXtype: 'document-customer-formpanel',
  189. addTitle: '客户资料',
  190. dataUrl: '/api/document/customer/list',
  191. // dataUrl:'http://localhost:9480/customer/list',
  192. dbfinds: [{
  193. from: 'id',to: 'pi_custid',ignore:true
  194. }, {
  195. from: 'cu_code',to: 'pi_custcode'
  196. }, {
  197. from: 'cu_name',to: 'pi_custname'
  198. }],
  199. dbtpls: [{
  200. field: 'cu_code',
  201. width: 100
  202. }, {
  203. field: 'cu_name',
  204. width: 100
  205. }],
  206. defaultCondition:"cu_statuscode='OPEN'",
  207. //放大镜窗口字段
  208. dbSearchFields:[{
  209. emptyText:'输入客户编号或名称',
  210. xtype : "textfield",
  211. name : "cu_name",
  212. allowBlank : true,
  213. columnWidth : 0.25,
  214. getCondition:function(v){
  215. return "(upper(cu_name) like '%"+v.toUpperCase()+"%' or upper(cu_code) like '%"+v.toUpperCase()+"%')";
  216. }
  217. }],
  218. dbColumns:[{
  219. "text": "客户ID",
  220. "hidden": true,
  221. "dataIndex": "id",
  222. },{
  223. "text": "客户编号",
  224. "dataIndex": "cu_code",
  225. "width": 200,
  226. }, {
  227. "text": "客户名称",
  228. "dataIndex": "cu_name",
  229. "width": 200
  230. },{
  231. "text": "客户类型",
  232. "dataIndex": "cu_name",
  233. "width": 100
  234. },{
  235. "text": "业务员",
  236. "dataIndex": "cu_sellername",
  237. "width": 100
  238. },{
  239. "text": "税率",
  240. "dataIndex": "cu_taxrate",
  241. "width": 100,
  242. xtype: 'numbercolumn',
  243. align:'end'
  244. },{
  245. "text": "承付天数",
  246. "dataIndex": "cu_promisedays",
  247. "width": 100,
  248. xtype: 'numbercolumn',
  249. align:'end'
  250. },{
  251. "text": "额度",
  252. "dataIndex": "cu_credit",
  253. "width": 100,
  254. xtype: 'numbercolumn',
  255. align:'end'
  256. }]
  257. });
  258. }
  259. },
  260. });
  261. }
  262. });