FormPanelController.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. Ext.define('saas.view.money.othreceipts.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.money-othreceipts-formpanel',
  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. defaultCondition: "cu_statuscode='OPEN'",
  15. dbfinds: [{
  16. from: 'id',
  17. to: 'or_custid'
  18. }, {
  19. from: 'cu_code',
  20. to: 'or_custcode'
  21. }, {
  22. from: 'cu_name',
  23. to: 'or_custname'
  24. }],
  25. dbtpls: [{
  26. field: 'cu_code',
  27. width: 100
  28. }, {
  29. field: 'cu_name',
  30. width: 100
  31. }],
  32. dbSearchFields: [{
  33. emptyText: '输入客户编号或客户名称',
  34. xtype: "textfield",
  35. name: "search",
  36. getCondition: function (v) {
  37. return "CONCAT(cu_code, cu_name) like '%" + v + "%'";
  38. },
  39. allowBlank: true,
  40. columnWidth: 0.25
  41. }],
  42. dbColumns: [{
  43. conditionCode: 'id',
  44. "text": "客户ID",
  45. "flex": 0,
  46. "dataIndex": "id",
  47. "width": 0,
  48. "xtype": "",
  49. "items": null
  50. }, {
  51. conditionCode: 'cu_code',
  52. "text": "客户编号",
  53. "flex": 1,
  54. "dataIndex": "cu_code",
  55. "width": 100,
  56. "xtype": "",
  57. "items": null
  58. }, {
  59. conditionCode: 'cu_name',
  60. "text": "客户名称",
  61. "flex": 1,
  62. "dataIndex": "cu_name",
  63. "xtype": "",
  64. "items": null
  65. }, {
  66. conditionCode: 'cu_type',
  67. "text": "客户类型",
  68. "flex": 1,
  69. "dataIndex": "cu_type",
  70. "width": 200,
  71. "xtype": "",
  72. "items": null
  73. }, {
  74. "text": "业务员编号",
  75. "flex": 1,
  76. "dataIndex": "cu_sellercode",
  77. "width": 100
  78. }, {
  79. "text": "业务员",
  80. "flex": 1,
  81. "dataIndex": "cu_sellername",
  82. "width": 100
  83. }, {
  84. "text": "税率",
  85. "flex": 1,
  86. "dataIndex": "cu_taxrate",
  87. "width": 100
  88. }, {
  89. "text": "承付天数",
  90. "flex": 1,
  91. "dataIndex": "cu_promisedays",
  92. "width": 100
  93. }, {
  94. "text": "额度",
  95. "flex": 1,
  96. "dataIndex": "cu_credit",
  97. "width": 100
  98. }, {
  99. "text": "客户地址",
  100. "flex": 1,
  101. "dataIndex": "ca_address",
  102. "width": 250
  103. }]
  104. });
  105. }
  106. },
  107. //放大镜赋值关系 以及 tpl模板
  108. 'dbfindtrigger[name=or_bankname]': {
  109. beforerender: function (f) {
  110. Ext.apply(f, {
  111. dataUrl: '/api/document/bankinformation/list',
  112. dbfinds: [{
  113. from: 'bk_bankcode',
  114. to: 'or_bankcode'
  115. }, {
  116. from: 'bk_bankname',
  117. to: 'or_bankname'
  118. }, {
  119. from: 'id',
  120. to: 'or_bankid'
  121. }],
  122. // defaultCondition: "bk_statuscode='OPEN'",
  123. dbtpls: [{
  124. field: 'bk_bankcode',
  125. width: 100
  126. }, {
  127. field: 'bk_bankname',
  128. width: 100
  129. }],
  130. dbSearchFields: [{
  131. emptyText: '输入银行账户编号或名称',
  132. xtype: "textfield",
  133. name: "search",
  134. getCondition: function (v) {
  135. return "CONCAT(bk_bankcode, bk_bankname) like '%" + v + "%'";
  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": ""
  170. }, {
  171. "text": "建帐日期",
  172. "flex": 1,
  173. "dataIndex": "bk_date",
  174. "width": 120,
  175. "xtype": "datecolumn"
  176. }]
  177. });
  178. }
  179. }
  180. });
  181. }
  182. });