FormPanelController.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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. from:'pr_purcprice',to:'pd_orderprice'
  179. }],
  180. dbtpls:[{
  181. field:'pr_code',width:100
  182. },{
  183. field:'pr_detail',width:100
  184. },{
  185. field:'pr_spec',width:100
  186. }],
  187. defaultCondition:"pr_statuscode='OPEN'",
  188. dbSearchFields:[{
  189. emptyText:'输入物料编号、名称或规格',
  190. xtype : "textfield",
  191. name : "search",
  192. width: 200,
  193. getCondition: function(v) {
  194. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  195. },
  196. allowBlank : true,
  197. columnWidth : 0.25
  198. }],
  199. dbColumns:[{
  200. "text": "物料ID",
  201. "hidden": true,
  202. "dataIndex": "id",
  203. }, {
  204. "text": "物料编号",
  205. "dataIndex": "pr_code",
  206. "width": 200,
  207. }, {
  208. "text": "物料名称",
  209. "width": 200,
  210. "dataIndex": "pr_detail",
  211. }, {
  212. "text": "规格",
  213. "dataIndex": "pr_spec",
  214. "width": 100,
  215. }, {
  216. "text": "单位",
  217. "dataIndex": "pr_unit",
  218. "width": 100,
  219. },{
  220. "text": "仓库id",
  221. "dataIndex": "pr_whid",
  222. "hidden": true,
  223. },{
  224. "text": "仓库编号",
  225. "dataIndex": "pr_whcode",
  226. "hidden": true,
  227. },{
  228. "text": "仓库",
  229. "dataIndex": "pr_whname",
  230. "width": 200,
  231. },{
  232. "text": "总库存数",
  233. "dataIndex": "po_onhand",
  234. "width": 100,
  235. align:'right'
  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. align:'right'
  257. },{
  258. "text": "L/T",
  259. "dataIndex": "pr_leadtime",
  260. "width": 100,
  261. }]
  262. }) ;
  263. }
  264. },
  265. //放大镜赋值关系 以及 tpl模板
  266. 'dbfindtrigger[name=pd_whname]':{
  267. beforerender:function(f){
  268. Ext.apply(f,{
  269. dataUrl:'/api/document/warehouse/list',
  270. // dataUrl:'http://localhost:9480/warehouse/list',
  271. addXtype: 'other-warehouse',
  272. addTitle: '仓库资料',
  273. defaultCondition:"wh_statuscode='OPEN'",
  274. dbfinds:[{
  275. from:'id',to:'pd_whid',ignore:true
  276. },{
  277. from:'wh_code',to:'pd_whcode'
  278. },{
  279. from:'wh_description',to:'pd_whname'
  280. }],
  281. dbtpls:[{
  282. field:'pd_whcode',width:100
  283. },{
  284. field:'pd_whname',width:100
  285. }],
  286. dbSearchFields:[{
  287. emptyText:'输入仓库编号或名称',
  288. xtype : "textfield",
  289. name : "wh_code",
  290. allowBlank : true,
  291. columnWidth : 0.25,
  292. getCondition:function(v){
  293. return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  294. }
  295. }],
  296. dbColumns:[{
  297. "text": "仓库ID",
  298. "flex": 0,
  299. "dataIndex": "id",
  300. "width": 0,
  301. "xtype": "",
  302. "items": null
  303. },{
  304. "text": "仓库编号",
  305. "flex": 1,
  306. "dataIndex": "wh_code",
  307. "width": 100,
  308. "xtype": "",
  309. "items": null
  310. }, {
  311. "text": "仓库名称",
  312. "flex": 1,
  313. "dataIndex": "wh_description",
  314. "xtype": "",
  315. "items": null
  316. },{
  317. "text": "仓库类型",
  318. "flex": 1,
  319. "dataIndex": "wh_type",
  320. "xtype": "",
  321. "items": null
  322. }]
  323. }) ;
  324. }
  325. }
  326. });
  327. },
  328. addCombo: function () {
  329. var combo = this.ownerCmp;
  330. Ext.create('Ext.window.Window', {
  331. layout: 'vbox',
  332. bodyPadding: 15,
  333. width: 500,
  334. items: [{
  335. fieldLabel: '实际值',
  336. xtype: 'textfield'
  337. }, {
  338. fieldLabel: '显示值',
  339. xtype: 'textfield'
  340. }],
  341. buttons: [{
  342. text: '确认',
  343. handler: function (b) {
  344. combo.setValue('ok');
  345. b.up('window').close();
  346. }
  347. }],
  348. renderTo: this.ownerCmp.ownerCt.getEl()
  349. }).show();
  350. }
  351. });