FormPanelController.js 16 KB

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