FormPanelController.js 15 KB

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