FormPanelController.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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. "text": "物料ID",
  143. "hidden": true,
  144. "dataIndex": "id",
  145. }, {
  146. "text": "物料编号",
  147. "dataIndex": "pr_code",
  148. "width": 200,
  149. }, {
  150. "text": "物料名称",
  151. "width": 200,
  152. "dataIndex": "pr_detail",
  153. }, {
  154. "text": "规格",
  155. "dataIndex": "pr_spec",
  156. "width": 100,
  157. }, {
  158. "text": "单位",
  159. "dataIndex": "pr_spec",
  160. "width": 100,
  161. },{
  162. "text": "仓库id",
  163. "dataIndex": "pr_whid",
  164. "hidden": true,
  165. },{
  166. "text": "仓库编号",
  167. "dataIndex": "pr_whcode",
  168. "hidden": true,
  169. },{
  170. "text": "仓库",
  171. "dataIndex": "pr_whname",
  172. "width": 200,
  173. },{
  174. "text": "总库存数",
  175. "dataIndex": "po_onhand",
  176. "width": 100,
  177. },{
  178. "text": "类型",
  179. "dataIndex": "pr_kind",
  180. "width": 100,
  181. },{
  182. "text": "型号",
  183. "dataIndex": "pr_orispeccode",
  184. "width": 100,
  185. },{
  186. "text": "品牌",
  187. "dataIndex": "pr_brand",
  188. "width": 100,
  189. },{
  190. "text": "供应商",
  191. "dataIndex": "pr_vendname",
  192. "width": 100,
  193. },{
  194. "text": "最小包装",
  195. "dataIndex": "pr_zxbzs",
  196. "width": 100,
  197. },{
  198. "text": "L/T",
  199. "dataIndex": "pr_leadtime",
  200. "width": 100,
  201. }]
  202. }) ;
  203. }
  204. },
  205. 'dbfindtrigger[name=pd_whname]':{
  206. beforerender:function(f){
  207. Ext.apply(f,{
  208. dataUrl:'/api/document/warehouse/list',
  209. addXtype: 'other-storeinformation',
  210. addTitle: '仓库资料',
  211. dbfinds:[{
  212. from:'id',to:'pd_whid',
  213. }, {
  214. from:'wh_code',to:'pd_whcode'
  215. }, {
  216. from:'wh_description',to:'pd_whname'
  217. }],
  218. dbtpls:[{
  219. field:'wh_code',width:100
  220. },{
  221. field:'wh_description',width:100
  222. }],
  223. dbColumns:[{
  224. "text": "仓库ID",
  225. "flex": 0,
  226. "dataIndex": "id",
  227. "width": 0,
  228. "xtype": "",
  229. "items": null
  230. },{
  231. "text": "仓库编号",
  232. "flex": 1,
  233. "dataIndex": "wh_code",
  234. "width": 100,
  235. "xtype": "",
  236. "items": null
  237. }, {
  238. "text": "仓库名称",
  239. "flex": 1,
  240. "dataIndex": "wh_description",
  241. "xtype": "",
  242. "items": null
  243. }, {
  244. "text": "仓库类型",
  245. "flex": 0,
  246. "dataIndex": "wh_type",
  247. "width": 200,
  248. "xtype": "",
  249. "items": null
  250. }, {
  251. "text": "仓库状态",
  252. "flex": 0,
  253. "dataIndex": "wh_status",
  254. "width": 200,
  255. "xtype": "",
  256. "items": null
  257. }]
  258. }) ;
  259. }
  260. }
  261. });
  262. }
  263. });