FormPanelController.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. Ext.define('saas.view.stock.otherOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-otherout-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pi_vendname]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/vendor/list',
  12. // dataUrl:'http://localhost:9480/vendor/list',
  13. addXtype: 'document-vendor-formpanel',
  14. addTitle: '供应商资料',
  15. defaultCondition:"ve_statuscode='OPEN'",
  16. dbfinds:[{
  17. from:'id',to:'pi_vendid'
  18. },{
  19. from:'ve_code',to:'pi_vendcode'
  20. },{
  21. from:'ve_name',to:'pi_vendname'
  22. }],
  23. dbtpls:[{
  24. field:'ve_code',width:100
  25. },{
  26. field:'ve_name',width:100
  27. }],
  28. //联想查询条件
  29. dbtplfield:"ve_name",
  30. //放大镜窗口字段
  31. dbSearchFields:[{
  32. emptyText:'输入供应商编号或名称',
  33. xtype : "textfield",
  34. name : "ve_name",
  35. allowBlank : true,
  36. columnWidth : 0.25,
  37. getCondition:function(v){
  38. return "ve_name like '%" + v + "%' or ve_code like '%"+ v +"%'";
  39. }
  40. }],
  41. dbColumns:[{
  42. conditionCode:'id',
  43. "text": "供应商ID",
  44. "flex": 0,
  45. "dataIndex": "id",
  46. "width": 0,
  47. "xtype": "",
  48. "items": null
  49. },{
  50. conditionCode:'ve_code',
  51. "text": "供应商编号",
  52. "flex": 1,
  53. "dataIndex": "ve_code",
  54. "width": 100,
  55. "xtype": "",
  56. "items": null
  57. }, {
  58. conditionCode:'ve_name',
  59. "text": "供应商名称",
  60. "flex": 1,
  61. "dataIndex": "ve_name",
  62. "xtype": "",
  63. "items": null
  64. }, {
  65. conditionCode:'ve_type',
  66. "text": "供应商类型",
  67. "flex": 0,
  68. "dataIndex": "ve_type",
  69. "width": 200,
  70. "xtype": "",
  71. "items": null
  72. }]
  73. }) ;
  74. }
  75. },
  76. //放大镜赋值关系 以及 tpl模板
  77. 'dbfindtrigger[name=pi_custname]':{
  78. beforerender:function(f){
  79. Ext.apply(f,{
  80. addXtype: 'document-customer-formpanel',
  81. addTitle: '客户资料',
  82. dataUrl:'/api/document/customer/list',
  83. // dataUrl:'http://localhost:9480/customer/list',
  84. dbfinds:[{
  85. from:'id',to:'pi_custid'
  86. },{
  87. from:'cu_code',to:'pi_custcode'
  88. },{
  89. from:'cu_name',to:'pi_custname'
  90. }],
  91. dbtpls:[{
  92. field:'pi_custcode',width:100
  93. },{
  94. field:'pi_custname',width:100
  95. }],
  96. //联想查询条件
  97. dbtplfield:"cu_name",
  98. //放大镜窗口字段
  99. dbSearchFields:[{
  100. emptyText:'输入客户编号或名称',
  101. xtype : "textfield",
  102. name : "cu_name",
  103. allowBlank : true,
  104. columnWidth : 0.25,
  105. getCondition:function(v){
  106. return "cu_name like '%" + v + "%' or cu_code like '%"+ v +"%'";
  107. }
  108. }],
  109. dbColumns:[{
  110. "text": "客户ID",
  111. "flex": 0,
  112. "dataIndex": "id",
  113. "width": 0,
  114. "xtype": "",
  115. "items": null
  116. },{
  117. "text": "客户编号",
  118. "flex": 1,
  119. "dataIndex": "cu_code",
  120. "width": 100,
  121. "xtype": "",
  122. "items": null
  123. }, {
  124. "text": "客户名称",
  125. "flex": 1,
  126. "dataIndex": "cu_name",
  127. "xtype": "",
  128. "items": null
  129. },{
  130. "text": "客户类型",
  131. "flex": 1,
  132. "dataIndex": "cu_name",
  133. "xtype": "",
  134. "items": null
  135. },{
  136. "text": "业务员",
  137. "flex": 1,
  138. "dataIndex": "cu_sellername",
  139. "xtype": "",
  140. "items": null
  141. },{
  142. "text": "税率",
  143. "flex": 1,
  144. "dataIndex": "cu_taxrate",
  145. "xtype": "",
  146. "items": null
  147. },{
  148. "text": "承付天数",
  149. "flex": 1,
  150. "dataIndex": "cu_promisedays",
  151. "xtype": "",
  152. "items": null
  153. },{
  154. "text": "额度",
  155. "flex": 1,
  156. "dataIndex": "cu_credit",
  157. "xtype": "",
  158. "items": null
  159. }]
  160. }) ;
  161. }
  162. },
  163. //放大镜赋值关系 以及 tpl模板
  164. 'multidbfindtrigger[name=pd_prodcode]':{
  165. beforerender:function(f){
  166. Ext.apply(f,{
  167. dataUrl:'/api/document/product/list',
  168. // dataUrl:'http://localhost:9480/product/list',
  169. addXtype: 'document-product-formpanel',
  170. addTitle: '物料资料',
  171. dbfinds:[{
  172. from:'id',to:'pd_prodid'
  173. },{
  174. from:'pr_code',to:'pd_prodcode'
  175. },{
  176. from:'pr_detail',to:'pr_detail'
  177. },{
  178. from:'pr_spec',to:'pr_spec'
  179. },{
  180. from:'pr_whid',to:'pd_whid'
  181. },{
  182. from:'pr_whcode',to:'pd_whcode'
  183. },{
  184. from:'pr_whname',to:'pd_whname'
  185. }],
  186. dbtpls:[{
  187. field:'pr_code',width:100
  188. },{
  189. field:'pr_detail',width:100
  190. },{
  191. field:'pr_spec',width:100
  192. }],
  193. //窗口字段设置
  194. dbSearchFields:[{
  195. emptyText:'输入物料编号或物料名称',
  196. xtype : "textfield",
  197. name : "search",
  198. allowBlank : true,
  199. columnWidth : 0.25,
  200. getCondition:function(v){
  201. return "pr_code like '%" + v + "%' or pr_detail like '%"+ v +"%'";
  202. }
  203. }],
  204. dbColumns:[{
  205. "text": "物料ID",
  206. "dataIndex": "id",
  207. "width": 0,
  208. "xtype": "",
  209. "items": null
  210. },{
  211. "text": "物料编号",
  212. "dataIndex": "pr_code",
  213. "width": 100,
  214. "xtype": "",
  215. "items": null
  216. }, {
  217. "text": "物料名称",
  218. "width": 100,
  219. "dataIndex": "pr_detail",
  220. "xtype": "",
  221. "items": null
  222. }, {
  223. "text": "规格",
  224. "flex": 0,
  225. "dataIndex": "pr_spec",
  226. "width": 100,
  227. "xtype": "",
  228. "items": null
  229. }, {
  230. "text": "单位",
  231. "flex": 0,
  232. "dataIndex": "pr_spec",
  233. "width": 100,
  234. "xtype": "",
  235. "items": null
  236. },{
  237. "text": "仓库id",
  238. "flex": 0,
  239. "dataIndex": "pr_whid",
  240. "width": 0,
  241. "xtype": "",
  242. "items": null
  243. },{
  244. "text": "仓库编号",
  245. "flex": 0,
  246. "dataIndex": "pr_whcode",
  247. "width": 0,
  248. "xtype": "",
  249. "items": null
  250. },{
  251. "text": "仓库",
  252. "flex": 0,
  253. "dataIndex": "pr_whname",
  254. "width": 100,
  255. "xtype": "",
  256. "items": null
  257. },{
  258. "text": "总库存数",
  259. "flex": 0,
  260. "dataIndex": "po_onhand",
  261. "width": 100,
  262. "xtype": "",
  263. "items": null
  264. },{
  265. "text": "类型",
  266. "flex": 0,
  267. "dataIndex": "pr_kind",
  268. "width": 100,
  269. "xtype": "",
  270. "items": null
  271. },{
  272. "text": "型号",
  273. "flex": 0,
  274. "dataIndex": "pr_orispeccode",
  275. "width": 100,
  276. "xtype": "",
  277. "items": null
  278. },{
  279. "text": "品牌",
  280. "flex": 0,
  281. "dataIndex": "pr_brand",
  282. "width": 100,
  283. "xtype": "",
  284. "items": null
  285. },{
  286. "text": "供应商",
  287. "flex": 0,
  288. "dataIndex": "pr_vendname",
  289. "width": 100,
  290. "xtype": "",
  291. "items": null
  292. },{
  293. "text": "最小包装",
  294. "flex": 0,
  295. "dataIndex": "pr_zxbzs",
  296. "width": 100,
  297. "xtype": "",
  298. "items": null
  299. },{
  300. "text": "L/T",
  301. "flex": 0,
  302. "dataIndex": "pr_leadtime",
  303. "width": 100,
  304. "xtype": "",
  305. "items": null
  306. }]
  307. }) ;
  308. }
  309. },
  310. //放大镜赋值关系 以及 tpl模板
  311. 'dbfindtrigger[name=pd_whname]':{
  312. beforerender:function(f){
  313. Ext.apply(f,{
  314. dataUrl:'/api/document/warehouse/list',
  315. // dataUrl:'http://localhost:9480/warehouse/list',
  316. addXtype: 'other-warehouse',
  317. addTitle: '仓库资料',
  318. defaultCondition:"wh_statuscode='OPEN'",
  319. dbfinds:[{
  320. from:'id',to:'pd_whid'
  321. },{
  322. from:'wh_code',to:'pd_whcode'
  323. },{
  324. from:'wh_description',to:'pd_whname'
  325. }],
  326. dbtpls:[{
  327. field:'pd_whcode',width:100
  328. },{
  329. field:'pd_whname',width:100
  330. }],
  331. dbSearchFields:[{
  332. emptyText:'输入仓库编号或名称',
  333. xtype : "textfield",
  334. name : "wh_code",
  335. allowBlank : true,
  336. columnWidth : 0.25,
  337. getCondition:function(v){
  338. return "wh_code like '%" + v + "%' or wh_description like '%"+ v +"%'";
  339. }
  340. }],
  341. dbColumns:[{
  342. "text": "仓库ID",
  343. "flex": 0,
  344. "dataIndex": "id",
  345. "width": 0,
  346. "xtype": "",
  347. "items": null
  348. },{
  349. "text": "仓库编号",
  350. "flex": 1,
  351. "dataIndex": "wh_code",
  352. "width": 100,
  353. "xtype": "",
  354. "items": null
  355. }, {
  356. "text": "仓库名称",
  357. "flex": 1,
  358. "dataIndex": "wh_description",
  359. "xtype": "",
  360. "items": null
  361. },{
  362. "text": "仓库类型",
  363. "flex": 1,
  364. "dataIndex": "wh_type",
  365. "xtype": "",
  366. "items": null
  367. }]
  368. }) ;
  369. }
  370. }
  371. });
  372. },
  373. addCombo: function () {
  374. var combo = this.ownerCmp;
  375. Ext.create('Ext.window.Window', {
  376. layout: 'vbox',
  377. bodyPadding: 15,
  378. width: 500,
  379. items: [{
  380. fieldLabel: '实际值',
  381. xtype: 'textfield'
  382. }, {
  383. fieldLabel: '显示值',
  384. xtype: 'textfield'
  385. }],
  386. buttons: [{
  387. text: '确认',
  388. handler: function (b) {
  389. combo.setValue('ok');
  390. b.up('window').close();
  391. }
  392. }],
  393. renderTo: this.ownerCmp.ownerCt.getEl()
  394. }).show();
  395. }
  396. });