FormPanelController.js 12 KB

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