QueryPanelController.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. Ext.define('saas.view.money.othreceipts.QueryPanelController', {
  2. extend: 'saas.view.core.query.QueryPanelController',
  3. alias: 'controller.money-othreceipts-querypanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=or_custname]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/customer/dbfind',
  12. addXtype: 'document-customer-formpanel',
  13. addTitle: '客户资料',
  14. dbfinds:[{
  15. from:'id',to:'or_custid'
  16. },{
  17. from:'cu_code',to:'or_custcode'
  18. },{
  19. from:'cu_name',to:'or_custname'
  20. }],
  21. dbtpls:[{
  22. field:'cu_code',width:100
  23. },{
  24. field:'cu_name',width:100
  25. }],
  26. dbColumns:[
  27. {
  28. conditionCode:'id',
  29. "text": "客户ID",
  30. "flex": 0,
  31. "dataIndex": "id",
  32. "width": 0,
  33. "xtype": "",
  34. "items": null
  35. },{
  36. conditionCode:'cu_code',
  37. "text": "客户编号",
  38. "flex": 1,
  39. "dataIndex": "cu_code",
  40. "width": 100,
  41. "xtype": "",
  42. "items": null
  43. }, {
  44. conditionCode:'cu_name',
  45. "text": "客户名称",
  46. "flex": 1,
  47. "dataIndex": "cu_name",
  48. "xtype": "",
  49. "items": null
  50. }, {
  51. conditionCode:'cu_type',
  52. "text": "客户类型",
  53. "flex": 1,
  54. "dataIndex": "cu_type",
  55. "width": 200,
  56. "xtype": "",
  57. "items": null
  58. }, {
  59. "text": "业务员编号",
  60. "flex": 1,
  61. "dataIndex": "cu_sellercode",
  62. "width": 100
  63. }, {
  64. "text": "业务员",
  65. "flex": 1,
  66. "dataIndex": "cu_sellername",
  67. "width": 100
  68. }, {
  69. "text": "税率",
  70. "flex": 1,
  71. "dataIndex": "cu_taxrate",
  72. "width": 100,
  73. xtype: 'numbercolumn',
  74. }, {
  75. "text": "承付天数",
  76. "flex": 1,
  77. "dataIndex": "cu_promisedays",
  78. align: 'end',
  79. xtype: 'numbercolumn',
  80. "width": 100,
  81. renderer : function(v) {
  82. return Ext.util.Format.number(v, '0');
  83. }
  84. }, {
  85. "text": "额度",
  86. "flex": 1,
  87. "dataIndex": "cu_credit",
  88. "width": 100,
  89. xtype: 'numbercolumn',
  90. renderer : function(v) {
  91. var arr = (v + '.').split('.');
  92. var xr = (new Array(arr[1].length)).fill('0');
  93. var format = '0,000.' + xr.join();
  94. return Ext.util.Format.number(v, format);
  95. }
  96. }, {
  97. "text": "客户地址",
  98. "flex": 1,
  99. "dataIndex": "ca_address",
  100. "width": 250
  101. }]
  102. }) ;
  103. }
  104. },
  105. //放大镜赋值关系 以及 tpl模板
  106. 'dbfindtrigger[name=or_bankname]':{
  107. beforerender:function(f){
  108. Ext.apply(f,{
  109. dataUrl:'/api/document/bankinformation/list',
  110. addXtype: 'other-bankinformation',
  111. addTitle: '资金账户',
  112. dbfinds:[{
  113. from:'bk_bankcode',to:'or_bankcode'
  114. },{
  115. from:'bk_bankname',to:'or_bankname'
  116. },{
  117. from:'id',to:'or_bankid'
  118. }],
  119. dbtpls:[{
  120. field:'bk_bankcode',width:100
  121. },{
  122. field:'bk_bankname',width:100
  123. }],
  124. dbSearchFields: [{
  125. emptyText: '查找资金账户',
  126. xtype: "textfield",
  127. name: "search",
  128. getCondition: function (v) {
  129. return "(upper(bk_bankcode) like '%"+v.toUpperCase()+"%' or upper(bk_bankname) like '%"+v.toUpperCase()+"%')";
  130. },
  131. allowBlank: true,
  132. columnWidth: 0.25
  133. }],
  134. dbColumns: [{
  135. "text": "账户ID",
  136. "flex": 0,
  137. "dataIndex": "id",
  138. "width": 0,
  139. "xtype": ""
  140. }, {
  141. "text": "资金账户",
  142. "flex": 1,
  143. "dataIndex": "bk_bankcode",
  144. "width": 120,
  145. "xtype": ""
  146. }, {
  147. "text": "账户名称",
  148. "flex": 1,
  149. "dataIndex": "bk_bankname",
  150. "width": 150,
  151. "xtype": ""
  152. }, {
  153. "text": "账户类别",
  154. "flex": 1,
  155. "dataIndex": "bk_type",
  156. "width": 120,
  157. "xtype": ""
  158. }, {
  159. "text": "账户余额",
  160. "flex": 1,
  161. "dataIndex": "bk_thisamount",
  162. "width": 120,
  163. xtype: 'numbercolumn',
  164. }, {
  165. "text": "建帐日期",
  166. "flex": 1,
  167. "dataIndex": "bk_date",
  168. "width": 120,
  169. "xtype": "datecolumn"
  170. }]
  171. });
  172. }
  173. }
  174. });
  175. }
  176. });