FormPanelController.js 17 KB

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