FormPanelController.js 15 KB

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