FormPanelController.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  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. "hidden": true
  243. },{
  244. "text": "总库存数",
  245. "dataIndex": "po_onhand",
  246. "width": 100,
  247. xtype: 'numbercolumn',
  248. renderer : function(v) {
  249. var arr = (v + '.').split('.');
  250. var xr = (new Array(arr[1].length)).fill('0');
  251. var format = '0,000.' + xr.join();
  252. return Ext.util.Format.number(v, format);
  253. },
  254. align:'end'
  255. },{
  256. "text": "类型",
  257. "dataIndex": "pr_kind",
  258. "width": 100,
  259. },{
  260. "text": "型号",
  261. "dataIndex": "pr_orispeccode",
  262. "width": 100,
  263. },{
  264. "text": "品牌",
  265. "dataIndex": "pr_brand",
  266. "width": 100,
  267. },{
  268. "text": "供应商",
  269. "dataIndex": "pr_vendname",
  270. "width": 100,
  271. },{
  272. "text": "最小包装",
  273. "dataIndex": "pr_zxbzs",
  274. "width": 100,
  275. xtype: 'numbercolumn',
  276. align:'end'
  277. },{
  278. "text": "L/T",
  279. "dataIndex": "pr_leadtime",
  280. "width": 100,
  281. }]
  282. }) ;
  283. }
  284. },
  285. //放大镜赋值关系 以及 tpl模板
  286. 'dbfindtrigger[name=pd_whname]':{
  287. beforerender:function(f){
  288. Ext.apply(f,{
  289. dataUrl:'/api/document/warehouse/list',
  290. // dataUrl:'http://localhost:9480/warehouse/list',
  291. addXtype: 'other-warehouse',
  292. addTitle: '仓库资料',
  293. defaultCondition:"wh_statuscode='OPEN'",
  294. dbfinds:[{
  295. from:'id',to:'pd_whid',ignore:true
  296. },{
  297. from:'wh_code',to:'pd_whcode'
  298. },{
  299. from:'wh_description',to:'pd_whname'
  300. }],
  301. dbtpls:[{
  302. field:'pd_whcode',width:100
  303. },{
  304. field:'pd_whname',width:100
  305. }],
  306. dbSearchFields:[{
  307. emptyText:'输入仓库编号或名称',
  308. xtype : "textfield",
  309. name : "wh_code",
  310. allowBlank : true,
  311. columnWidth : 0.25,
  312. getCondition:function(v){
  313. return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  314. }
  315. }],
  316. dbColumns:[{
  317. "text": "仓库ID",
  318. "flex": 0,
  319. "dataIndex": "id",
  320. "width": 0,
  321. "xtype": "",
  322. "items": null
  323. },{
  324. "text": "仓库编号",
  325. "flex": 1,
  326. "dataIndex": "wh_code",
  327. "width": 100,
  328. "xtype": "",
  329. "items": null
  330. }, {
  331. "text": "仓库名称",
  332. "flex": 1,
  333. "dataIndex": "wh_description",
  334. "xtype": "",
  335. "items": null
  336. },{
  337. "text": "仓库类型",
  338. "flex": 1,
  339. "dataIndex": "wh_type",
  340. "xtype": "",
  341. "items": null
  342. }]
  343. }) ;
  344. }
  345. }
  346. });
  347. },
  348. addCombo: function () {
  349. var combo = this.ownerCmp;
  350. Ext.create('Ext.window.Window', {
  351. layout: 'vbox',
  352. bodyPadding: 15,
  353. width: 500,
  354. items: [{
  355. fieldLabel: '实际值',
  356. xtype: 'textfield'
  357. }, {
  358. fieldLabel: '显示值',
  359. xtype: 'textfield'
  360. }],
  361. buttons: [{
  362. text: '确认',
  363. handler: function (b) {
  364. combo.setValue('ok');
  365. b.up('window').close();
  366. }
  367. }],
  368. renderTo: this.ownerCmp.ownerCt.getEl()
  369. }).show();
  370. }
  371. });