FormPanelController.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. Ext.define('saas.view.sale.saleIn.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.sale-salein-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pi_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. {
  17. from:'id',to:'pi_custid'
  18. },{
  19. from:'cu_code',to:'pi_custcode'
  20. },{
  21. from:'cu_name',to:'pi_custname'
  22. },{
  23. from:'ca_address',to:'pi_address'
  24. }],
  25. dbtpls:[
  26. {
  27. field:'cu_code',width:100
  28. },{
  29. field:'cu_name',width:100
  30. }],
  31. dbSearchFields:[{
  32. emptyText:'输入客户编号或客户名称',
  33. xtype : "textfield",
  34. name : "search",
  35. getCondition: function(v) {
  36. return "(upper(cu_code) like '%"+v.toUpperCase()+"%' or upper(cu_name) like '%"+v.toUpperCase()+"%')";
  37. },
  38. allowBlank : true,
  39. columnWidth : 0.25
  40. }],
  41. dbColumns:[
  42. {
  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. 'multidbfindtrigger[name=pd_prodcode]':{
  108. beforerender:function(f){
  109. Ext.apply(f,{
  110. dataUrl:'/api/document/product/list',
  111. addXtype: 'document-product-formpanel',
  112. addTitle: '物料资料',
  113. dbfinds:[
  114. {
  115. from:'id',to:'pd_prodid'
  116. },
  117. {
  118. from:'pr_code',to:'pd_prodcode'
  119. }, {
  120. from:'pr_detail',to:'pr_detail'
  121. }, {
  122. from:'pr_spec',to:'pr_spec'
  123. }],
  124. dbtpls:[{
  125. field:'pr_code',width:100
  126. },{
  127. field:'pr_detail',width:100
  128. }],
  129. defaultCondition: "pr_statuscode='OPEN'",
  130. dbSearchFields:[{
  131. emptyText:'输入物料编号、名称或规格',
  132. xtype : "textfield",
  133. name : "search",
  134. width: 200,
  135. getCondition: function(v) {
  136. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  137. },
  138. allowBlank : true,
  139. columnWidth : 0.25
  140. }],
  141. dbColumns:[
  142. {
  143. "text": "物料ID",
  144. "hidden": true,
  145. "dataIndex": "id",
  146. },{
  147. "text": "物料编号",
  148. "flex": 1,
  149. "dataIndex": "pr_code",
  150. "width": 100,
  151. "xtype": "",
  152. "items": null
  153. }, {
  154. "text": "物料名称",
  155. "flex": 1,
  156. "dataIndex": "pr_detail",
  157. "xtype": "",
  158. "items": null
  159. }, {
  160. "text": "规格",
  161. "flex": 1,
  162. "dataIndex": "pr_spec",
  163. "width": 200,
  164. "xtype": "",
  165. "items": null
  166. }, {
  167. "text": "单位",
  168. "flex": 1,
  169. "dataIndex": "pr_unit",
  170. "width": 200,
  171. "xtype": "",
  172. "items": null
  173. }, {
  174. "text": "品牌",
  175. "flex": 1,
  176. "dataIndex": "pr_brand",
  177. "width": 200,
  178. "xtype": "",
  179. "items": null
  180. }, {
  181. "text": "供应商ID",
  182. "flex": 0,
  183. "dataIndex": "pr_vendid",
  184. "width": 0,
  185. "xtype": "",
  186. "items": null
  187. }, {
  188. "text": "供应商编号",
  189. "flex": 1,
  190. "dataIndex": "pr_vendcode",
  191. "width": 200,
  192. "xtype": "",
  193. "items": null
  194. }, {
  195. "text": "供应商名称",
  196. "flex": 1,
  197. "dataIndex": "pr_vendname",
  198. "width": 200,
  199. "xtype": "",
  200. "items": null
  201. }, {
  202. "text": "最小包装量",
  203. "flex": 1,
  204. "dataIndex": "pr_zxbzs",
  205. "width": 200,
  206. "xtype": "",
  207. "items": null
  208. }]
  209. }) ;
  210. }
  211. },
  212. 'dbfindtrigger[name=pd_whname]':{
  213. beforerender:function(f){
  214. Ext.apply(f,{
  215. dataUrl:'/api/document/warehouse/list',
  216. addXtype: 'other-storeinformation',
  217. addTitle: '仓库资料',
  218. dbfinds:[{
  219. from:'id',to:'pd_whid',
  220. }, {
  221. from:'wh_code',to:'pd_whcode'
  222. }, {
  223. from:'wh_description',to:'pd_whname'
  224. }],
  225. dbtpls:[{
  226. field:'wh_code',width:100
  227. },{
  228. field:'wh_description',width:100
  229. }],
  230. dbColumns:[{
  231. "text": "仓库ID",
  232. "flex": 0,
  233. "dataIndex": "id",
  234. "width": 0,
  235. "xtype": "",
  236. "items": null
  237. },{
  238. "text": "仓库编号",
  239. "flex": 1,
  240. "dataIndex": "wh_code",
  241. "width": 100,
  242. "xtype": "",
  243. "items": null
  244. }, {
  245. "text": "仓库名称",
  246. "flex": 1,
  247. "dataIndex": "wh_description",
  248. "xtype": "",
  249. "items": null
  250. }, {
  251. "text": "仓库类型",
  252. "flex": 0,
  253. "dataIndex": "wh_type",
  254. "width": 200,
  255. "xtype": "",
  256. "items": null
  257. }, {
  258. "text": "仓库状态",
  259. "flex": 0,
  260. "dataIndex": "wh_status",
  261. "width": 200,
  262. "xtype": "",
  263. "items": null
  264. }]
  265. }) ;
  266. }
  267. }
  268. });
  269. }
  270. });