FormPanelController.js 15 KB

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