FormPanelController.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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',ignore:true
  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. "text": "客户ID",
  44. "flex": 0,
  45. "dataIndex": "id",
  46. "width": 0,
  47. "xtype": "",
  48. "items": null
  49. },{
  50. "text": "客户编号",
  51. "flex": 1,
  52. "dataIndex": "cu_code",
  53. "width": 100,
  54. "xtype": "",
  55. "items": null
  56. }, {
  57. "text": "客户名称",
  58. "flex": 1,
  59. "dataIndex": "cu_name",
  60. "xtype": "",
  61. "items": null
  62. }, {
  63. "text": "客户类型",
  64. "flex": 1,
  65. "dataIndex": "cu_type",
  66. "width": 200,
  67. "xtype": "",
  68. "items": null
  69. }, {
  70. "text": "业务员编号",
  71. "flex": 1,
  72. "dataIndex": "cu_sellercode",
  73. "width": 100
  74. }, {
  75. "text": "业务员",
  76. "flex": 1,
  77. "dataIndex": "cu_sellername",
  78. "width": 100
  79. }, {
  80. "text": "税率",
  81. "flex": 1,
  82. "dataIndex": "cu_taxrate",
  83. "width": 100,
  84. xtype: 'numbercolumn',
  85. align:'end'
  86. }, {
  87. "text": "承付天数",
  88. "flex": 1,
  89. "dataIndex": "cu_promisedays",
  90. "width": 100,
  91. xtype: 'numbercolumn',
  92. align:'end',
  93. renderer : function(v) {
  94. return Ext.util.Format.number(v, '0');
  95. }
  96. }, {
  97. "text": "额度",
  98. "flex": 1,
  99. "dataIndex": "cu_credit",
  100. "width": 100,
  101. xtype: 'numbercolumn',
  102. align:'end'
  103. }, {
  104. "text": "客户地址",
  105. "flex": 1,
  106. "dataIndex": "ca_address",
  107. "width": 250
  108. }]
  109. }) ;
  110. }
  111. },
  112. 'multidbfindtrigger[name=pd_prodcode]':{
  113. beforerender:function(f){
  114. Ext.apply(f,{
  115. dataUrl:'/api/document/product/list',
  116. addXtype: 'document-product-formpanel',
  117. addTitle: '物料资料',
  118. dbfinds:[
  119. {
  120. from:'id',to:'pd_prodid',ignore:true
  121. },
  122. {
  123. from:'pr_code',to:'pd_prodcode'
  124. }, {
  125. from:'pr_detail',to:'pr_detail'
  126. }, {
  127. from:'pr_spec',to:'pr_spec'
  128. }],
  129. dbtpls:[{
  130. field:'pr_code',width:100
  131. },{
  132. field:'pr_detail',width:100
  133. }],
  134. defaultCondition: "pr_statuscode='OPEN'",
  135. dbSearchFields:[{
  136. emptyText:'输入物料编号、名称或规格',
  137. xtype : "textfield",
  138. name : "search",
  139. width: 200,
  140. getCondition: function(v) {
  141. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  142. },
  143. allowBlank : true,
  144. columnWidth : 0.25
  145. }],
  146. dbColumns:[{
  147. "text": "物料ID",
  148. "hidden": true,
  149. "dataIndex": "id",
  150. }, {
  151. "text": "物料编号",
  152. "dataIndex": "pr_code",
  153. "width": 200,
  154. }, {
  155. "text": "物料名称",
  156. "width": 200,
  157. "dataIndex": "pr_detail",
  158. }, {
  159. "text": "规格",
  160. "dataIndex": "pr_spec",
  161. "width": 100,
  162. }, {
  163. "text": "单位",
  164. "dataIndex": "pr_unit",
  165. "width": 100,
  166. },{
  167. "text": "仓库id",
  168. "dataIndex": "pr_whid",
  169. "hidden": true,
  170. },{
  171. "text": "仓库编号",
  172. "dataIndex": "pr_whcode",
  173. "hidden": true,
  174. },{
  175. "text": "仓库",
  176. "dataIndex": "pr_whname",
  177. "width": 200,
  178. },{
  179. "text": "总库存数",
  180. "dataIndex": "po_onhand",
  181. "width": 100,
  182. xtype: 'numbercolumn',
  183. align:'end'
  184. },{
  185. "text": "类型",
  186. "dataIndex": "pr_kind",
  187. "width": 100,
  188. },{
  189. "text": "型号",
  190. "dataIndex": "pr_orispeccode",
  191. "width": 100,
  192. },{
  193. "text": "品牌",
  194. "dataIndex": "pr_brand",
  195. "width": 100,
  196. },{
  197. "text": "供应商",
  198. "dataIndex": "pr_vendname",
  199. "width": 100,
  200. },{
  201. "text": "最小包装",
  202. "dataIndex": "pr_zxbzs",
  203. "width": 100,
  204. xtype: 'numbercolumn',
  205. align:'end'
  206. },{
  207. "text": "L/T",
  208. "dataIndex": "pr_leadtime",
  209. "width": 100,
  210. }]
  211. }) ;
  212. }
  213. },
  214. 'dbfindtrigger[name=pd_whname]':{
  215. beforerender:function(f){
  216. Ext.apply(f,{
  217. dataUrl:'/api/document/warehouse/list',
  218. addXtype: 'other-storeinformation',
  219. addTitle: '仓库资料',
  220. dbfinds:[{
  221. from:'id',to:'pd_whid',ignore:true
  222. }, {
  223. from:'wh_code',to:'pd_whcode'
  224. }, {
  225. from:'wh_description',to:'pd_whname'
  226. }],
  227. dbtpls:[{
  228. field:'wh_code',width:100
  229. },{
  230. field:'wh_description',width:100
  231. }],
  232. defaultCondition: "wh_statuscode='OPEN'",
  233. dbSearchFields:[{
  234. emptyText:'输入物料编号、名称或规格',
  235. xtype : "textfield",
  236. name : "search",
  237. width: 200,
  238. getCondition: function(v) {
  239. return "(upper(wh_code) like '%" + v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  240. },
  241. allowBlank : true,
  242. columnWidth : 0.25
  243. }],
  244. dbColumns:[{
  245. "text": "仓库ID",
  246. "flex": 0,
  247. "dataIndex": "id",
  248. "width": 0,
  249. "xtype": "",
  250. "items": null
  251. },{
  252. "text": "仓库编号",
  253. "flex": 1,
  254. "dataIndex": "wh_code",
  255. "width": 100,
  256. "xtype": "",
  257. "items": null
  258. }, {
  259. "text": "仓库名称",
  260. "flex": 1,
  261. "dataIndex": "wh_description",
  262. "xtype": "",
  263. "items": null
  264. }, {
  265. "text": "仓库类型",
  266. "flex": 0,
  267. "dataIndex": "wh_type",
  268. "width": 200,
  269. "xtype": "",
  270. "items": null
  271. }, {
  272. "text": "仓库状态",
  273. "flex": 0,
  274. "dataIndex": "wh_status",
  275. "width": 200,
  276. "xtype": "",
  277. "items": null
  278. }]
  279. }) ;
  280. }
  281. }
  282. });
  283. }
  284. });