FormPanelController.js 16 KB

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