QueryPanelController.js 8.1 KB

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