BasePanelController.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. Ext.define('saas.view.document.product.BasePanelController', {
  2. extend: 'saas.view.core.base.BasePanelController',
  3. alias: 'controller.document-product-basepanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pr_code]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/product/list',
  12. addXtype: 'document-product-formpanel',
  13. addTitle: '物料资料',
  14. dbfinds:[
  15. {
  16. from:'pr_code',to:'pr_code'
  17. },{
  18. from:'pr_detail',to:'pr_detail'
  19. }, {
  20. from:'pr_spec',to:'pr_spec'
  21. }, {
  22. from:'pr_brand',to:'pr_brand'
  23. }, {
  24. from:'pr_orispeccode',to:'pr_orispeccode'
  25. }, {
  26. from:'pr_orispeccode',to:'pr_orispeccode'
  27. }, {
  28. from:'id',to:'id',ignore:true
  29. }],
  30. dbtpls:[{
  31. field:'pr_code',width:100
  32. },{
  33. field:'pr_detail',width:100
  34. }],
  35. defaultCondition: "pr_statuscode='OPEN'",
  36. dbSearchFields:[{
  37. emptyText:'输入物料编号、名称或规格',
  38. xtype : "textfield",
  39. name : "search",
  40. width: 200,
  41. getCondition: function(v) {
  42. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  43. },
  44. allowBlank : true,
  45. columnWidth : 0.25
  46. }],
  47. dbColumns:[{
  48. "text": "物料ID",
  49. "hidden": true,
  50. "dataIndex": "id",
  51. }, {
  52. "text": "物料编号",
  53. "dataIndex": "pr_code",
  54. "width": 200,
  55. }, {
  56. "text": "物料名称",
  57. "width": 200,
  58. "dataIndex": "pr_detail",
  59. }, {
  60. "text": "规格",
  61. "dataIndex": "pr_spec",
  62. "width": 100,
  63. }, {
  64. "text": "单位",
  65. "dataIndex": "pr_unit",
  66. "width": 100,
  67. },{
  68. "text": "仓库id",
  69. "dataIndex": "pr_whid",
  70. "hidden": true,
  71. },{
  72. "text": "仓库编号",
  73. "dataIndex": "pr_whcode",
  74. "hidden": true,
  75. },{
  76. "text": "仓库",
  77. "dataIndex": "pr_whname",
  78. "width": 200,
  79. },{
  80. "text": "总库存数",
  81. "dataIndex": "po_onhand",
  82. "width": 100,
  83. xtype: 'numbercolumn',
  84. align:'end'
  85. },{
  86. "text": "类型",
  87. "dataIndex": "pr_kind",
  88. "width": 100,
  89. },{
  90. "text": "型号",
  91. "dataIndex": "pr_orispeccode",
  92. "width": 100,
  93. },{
  94. "text": "品牌",
  95. "dataIndex": "pr_brand",
  96. "width": 100,
  97. },{
  98. "text": "供应商",
  99. "dataIndex": "pr_vendname",
  100. "width": 100,
  101. },{
  102. "text": "最小包装",
  103. "dataIndex": "pr_zxbzs",
  104. "width": 100,
  105. xtype: 'numbercolumn',
  106. align:'end'
  107. },{
  108. "text": "L/T",
  109. "dataIndex": "pr_leadtime",
  110. "width": 100,
  111. }]
  112. }) ;
  113. }
  114. }
  115. });
  116. }
  117. });