FormPanelController.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. dbfinds:[
  15. {
  16. from:'id',to:'pi_custid'
  17. },{
  18. from:'cu_code',to:'pi_custcode'
  19. },{
  20. from:'cu_name',to:'pi_custname'
  21. },{
  22. from:'ca_address',to:'pi_address'
  23. }],
  24. dbtpls:[
  25. {
  26. field:'cu_code',width:100
  27. },{
  28. field:'cu_name',width:100
  29. }],
  30. dbColumns:[
  31. {
  32. conditionCode:'id',
  33. "text": "客户ID",
  34. "flex": 0,
  35. "dataIndex": "id",
  36. "width": 0,
  37. "xtype": "",
  38. "items": null
  39. },{
  40. conditionCode:'cu_code',
  41. "text": "客户编号",
  42. "flex": 1,
  43. "dataIndex": "cu_code",
  44. "width": 100,
  45. "xtype": "",
  46. "items": null
  47. }, {
  48. conditionCode:'cu_name',
  49. "text": "客户名称",
  50. "flex": 1,
  51. "dataIndex": "cu_name",
  52. "xtype": "",
  53. "items": null
  54. }, {
  55. conditionCode:'cu_type',
  56. "text": "客户类型",
  57. "flex": 1,
  58. "dataIndex": "cu_type",
  59. "width": 200,
  60. "xtype": "",
  61. "items": null
  62. }, {
  63. "text": "业务员编号",
  64. "flex": 1,
  65. "dataIndex": "cu_sellercode",
  66. "width": 100
  67. }, {
  68. "text": "业务员",
  69. "flex": 1,
  70. "dataIndex": "cu_sellername",
  71. "width": 100
  72. }, {
  73. "text": "税率",
  74. "flex": 1,
  75. "dataIndex": "cu_taxrate",
  76. "width": 100
  77. }, {
  78. "text": "承付天数",
  79. "flex": 1,
  80. "dataIndex": "cu_promisedays",
  81. "width": 100
  82. }, {
  83. "text": "额度",
  84. "flex": 1,
  85. "dataIndex": "cu_credit",
  86. "width": 100
  87. }, {
  88. "text": "客户地址",
  89. "flex": 1,
  90. "dataIndex": "ca_address",
  91. "width": 250
  92. }]
  93. }) ;
  94. }
  95. },
  96. 'dbfindtrigger[name=pd_prodcode]':{
  97. beforerender:function(f){
  98. Ext.apply(f,{
  99. dataUrl:'/api/document/product/list',
  100. addXtype: 'document-product-formpanel',
  101. addTitle: '物料资料',
  102. dbfinds:[
  103. {
  104. from:'id',to:'pd_prodid'
  105. },
  106. {
  107. from:'pr_code',to:'pd_prodcode'
  108. }, {
  109. from:'pr_detail',to:'pr_detail'
  110. }, {
  111. from:'pr_spec',to:'pr_spec'
  112. }],
  113. dbtpls:[{
  114. field:'pr_code',width:100
  115. },{
  116. field:'pr_detail',width:100
  117. }],
  118. dbColumns:[
  119. {
  120. "text": "物料ID",
  121. "flex": 0,
  122. "dataIndex": "id",
  123. "width": 0,
  124. "xtype": "",
  125. "items": null
  126. },{
  127. "text": "物料编号",
  128. "flex": 1,
  129. "dataIndex": "pr_code",
  130. "width": 100,
  131. "xtype": "",
  132. "items": null
  133. }, {
  134. "text": "物料名称",
  135. "flex": 1,
  136. "dataIndex": "pr_detail",
  137. "xtype": "",
  138. "items": null
  139. }, {
  140. "text": "规格",
  141. "flex": 1,
  142. "dataIndex": "pr_spec",
  143. "width": 200,
  144. "xtype": "",
  145. "items": null
  146. }, {
  147. "text": "单位",
  148. "flex": 1,
  149. "dataIndex": "pr_unit",
  150. "width": 200,
  151. "xtype": "",
  152. "items": null
  153. }, {
  154. "text": "品牌",
  155. "flex": 1,
  156. "dataIndex": "pr_brand",
  157. "width": 200,
  158. "xtype": "",
  159. "items": null
  160. }, {
  161. "text": "供应商ID",
  162. "flex": 0,
  163. "dataIndex": "pr_vendid",
  164. "width": 0,
  165. "xtype": "",
  166. "items": null
  167. }, {
  168. "text": "供应商编号",
  169. "flex": 1,
  170. "dataIndex": "pr_vendcode",
  171. "width": 200,
  172. "xtype": "",
  173. "items": null
  174. }, {
  175. "text": "供应商名称",
  176. "flex": 1,
  177. "dataIndex": "pr_vendname",
  178. "width": 200,
  179. "xtype": "",
  180. "items": null
  181. }, {
  182. "text": "最小包装量",
  183. "flex": 1,
  184. "dataIndex": "pr_zxbzs",
  185. "width": 200,
  186. "xtype": "",
  187. "items": null
  188. }]
  189. }) ;
  190. }
  191. },
  192. 'dbfindtrigger[name=pd_whname]':{
  193. beforerender:function(f){
  194. Ext.apply(f,{
  195. dataUrl:'/api/document/warehouse/list',
  196. addXtype: 'other-storeinformation',
  197. addTitle: '仓库资料',
  198. dbfinds:[{
  199. from:'id',to:'pd_whid',
  200. }, {
  201. from:'wh_code',to:'pd_whcode'
  202. }, {
  203. from:'wh_description',to:'pd_whname'
  204. }],
  205. dbtpls:[{
  206. field:'wh_code',width:100
  207. },{
  208. field:'wh_description',width:100
  209. }],
  210. dbColumns:[{
  211. "text": "仓库ID",
  212. "flex": 0,
  213. "dataIndex": "id",
  214. "width": 0,
  215. "xtype": "",
  216. "items": null
  217. },{
  218. "text": "仓库编号",
  219. "flex": 1,
  220. "dataIndex": "wh_code",
  221. "width": 100,
  222. "xtype": "",
  223. "items": null
  224. }, {
  225. "text": "仓库名称",
  226. "flex": 1,
  227. "dataIndex": "wh_description",
  228. "xtype": "",
  229. "items": null
  230. }, {
  231. "text": "仓库类型",
  232. "flex": 0,
  233. "dataIndex": "wh_type",
  234. "width": 200,
  235. "xtype": "",
  236. "items": null
  237. }, {
  238. "text": "仓库状态",
  239. "flex": 0,
  240. "dataIndex": "wh_status",
  241. "width": 200,
  242. "xtype": "",
  243. "items": null
  244. }]
  245. }) ;
  246. }
  247. }
  248. });
  249. }
  250. });