FormPanelController.js 15 KB

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