FormPanelController.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. Ext.define('saas.view.stock.otherIn.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-otherin-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'
  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. conditionCode:'id',
  41. "text": "供应商ID",
  42. "flex": 0,
  43. "dataIndex": "id",
  44. "width": 0,
  45. "xtype": "",
  46. "items": null
  47. },{
  48. conditionCode:'ve_code',
  49. "text": "供应商编号",
  50. "flex": 1,
  51. "dataIndex": "ve_code",
  52. "width": 100,
  53. "xtype": "",
  54. "items": null
  55. }, {
  56. conditionCode:'ve_name',
  57. "text": "供应商名称",
  58. "flex": 1,
  59. "dataIndex": "ve_name",
  60. "xtype": "",
  61. "items": null
  62. }, {
  63. conditionCode:'ve_type',
  64. "text": "供应商类型",
  65. "flex": 0,
  66. "dataIndex": "ve_type",
  67. "width": 200,
  68. "xtype": "",
  69. "items": null
  70. }]
  71. }) ;
  72. }
  73. },
  74. //放大镜赋值关系 以及 tpl模板
  75. 'dbfindtrigger[name=pi_custname]': {
  76. beforerender: function (f) {
  77. Ext.apply(f, {
  78. addXtype: 'document-customer-formpanel',
  79. addTitle: '客户资料',
  80. dataUrl: '/api/document/customer/list',
  81. // dataUrl:'http://localhost:9480/customer/list',
  82. dbfinds: [{
  83. from: 'id',
  84. to: 'pi_custid'
  85. }, {
  86. from: 'cu_code',
  87. to: 'pi_custcode'
  88. }, {
  89. from: 'cu_name',
  90. to: 'pi_custname'
  91. }],
  92. dbtpls: [{
  93. field: 'pi_custcode',
  94. width: 100
  95. }, {
  96. field: 'pi_custname',
  97. width: 100
  98. }],
  99. defaultCondition:"cu_statuscode='OPEN'",
  100. //放大镜窗口字段
  101. dbSearchFields:[{
  102. emptyText:'输入客户编号或名称',
  103. xtype : "textfield",
  104. name : "cu_name",
  105. allowBlank : true,
  106. columnWidth : 0.25,
  107. getCondition:function(v){
  108. return "(upper(cu_name) like '%"+v.toUpperCase()+"%' or upper(cu_code) like '%"+v.toUpperCase()+"%')";
  109. }
  110. }],
  111. dbColumns:[{
  112. "text": "客户ID",
  113. "flex": 0,
  114. "dataIndex": "id",
  115. "width": 0,
  116. "xtype": "",
  117. "items": null
  118. },{
  119. "text": "客户编号",
  120. "flex": 1,
  121. "dataIndex": "cu_code",
  122. "width": 100,
  123. "xtype": "",
  124. "items": null
  125. }, {
  126. "text": "客户名称",
  127. "flex": 1,
  128. "dataIndex": "cu_name",
  129. "xtype": "",
  130. "items": null
  131. },{
  132. "text": "客户类型",
  133. "flex": 1,
  134. "dataIndex": "cu_name",
  135. "xtype": "",
  136. "items": null
  137. },{
  138. "text": "业务员",
  139. "flex": 1,
  140. "dataIndex": "cu_sellername",
  141. "xtype": "",
  142. "items": null
  143. },{
  144. "text": "税率",
  145. "flex": 1,
  146. "dataIndex": "cu_taxrate",
  147. "xtype": "",
  148. "items": null
  149. },{
  150. "text": "承付天数",
  151. "flex": 1,
  152. "dataIndex": "cu_promisedays",
  153. "xtype": "",
  154. "items": null
  155. },{
  156. "text": "额度",
  157. "flex": 1,
  158. "dataIndex": "cu_credit",
  159. "xtype": "",
  160. "items": null
  161. }]
  162. });
  163. }
  164. },
  165. //放大镜赋值关系 以及 tpl模板
  166. 'multidbfindtrigger[name=pd_prodcode]': {
  167. beforerender: function (f) {
  168. Ext.apply(f, {
  169. dataUrl: '/api/document/product/list',
  170. // dataUrl:'http://localhost:9480/product/list',
  171. addXtype: 'document-product-formpanel',
  172. addTitle: '物料资料',
  173. dbfinds: [{
  174. from: 'id',
  175. to: 'pd_prodid'
  176. }, {
  177. from: 'pr_code',
  178. to: 'pd_prodcode'
  179. }, {
  180. from: 'pr_detail',
  181. to: 'pr_detail'
  182. }, {
  183. from: 'pr_spec',
  184. to: 'pr_spec'
  185. },{
  186. from:'pr_whid',to:'pd_whid'
  187. },{
  188. from:'pr_whcode',to:'pd_whcode'
  189. },{
  190. from:'pr_whname',to:'pd_whname'
  191. }],
  192. dbtpls: [{
  193. field: 'pr_code',
  194. width: 100
  195. }, {
  196. field: 'pr_detail',
  197. width: 100
  198. }, {
  199. field: 'pr_spec',
  200. width: 100
  201. }],
  202. defaultCondition: "pr_statuscode='OPEN'",
  203. dbSearchFields:[{
  204. emptyText:'输入物料编号、名称或规格',
  205. xtype : "textfield",
  206. name : "search",
  207. width: 200,
  208. getCondition: function(v) {
  209. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  210. },
  211. allowBlank : true,
  212. columnWidth : 0.25
  213. }],
  214. dbColumns:[{
  215. "text": "物料ID",
  216. "dataIndex": "id",
  217. "width": 0,
  218. "xtype": "",
  219. "hidden": true
  220. },{
  221. "text": "物料编号",
  222. "dataIndex": "pr_code",
  223. "width": 100,
  224. "xtype": "",
  225. "items": null
  226. }, {
  227. "text": "物料名称",
  228. "width": 100,
  229. "dataIndex": "pr_detail",
  230. "xtype": "",
  231. "items": null
  232. }, {
  233. "text": "规格",
  234. "flex": 0,
  235. "dataIndex": "pr_spec",
  236. "width": 100,
  237. "xtype": "",
  238. "items": null
  239. }, {
  240. "text": "单位",
  241. "flex": 0,
  242. "dataIndex": "pr_spec",
  243. "width": 100,
  244. "xtype": "",
  245. "items": null
  246. },{
  247. "text": "仓库id",
  248. "flex": 0,
  249. "dataIndex": "pr_whid",
  250. "width": 0,
  251. "xtype": "",
  252. "items": null
  253. },{
  254. "text": "仓库编号",
  255. "flex": 0,
  256. "dataIndex": "pr_whcode",
  257. "width": 0,
  258. "xtype": "",
  259. "items": null
  260. },{
  261. "text": "仓库",
  262. "flex": 0,
  263. "dataIndex": "pr_whname",
  264. "width": 100,
  265. "xtype": "",
  266. "items": null
  267. },{
  268. "text": "总库存数",
  269. "flex": 0,
  270. "dataIndex": "po_onhand",
  271. "width": 100,
  272. "xtype": "",
  273. "items": null
  274. },{
  275. "text": "类型",
  276. "flex": 0,
  277. "dataIndex": "pr_kind",
  278. "width": 100,
  279. "xtype": "",
  280. "items": null
  281. },{
  282. "text": "型号",
  283. "flex": 0,
  284. "dataIndex": "pr_orispeccode",
  285. "width": 100,
  286. "xtype": "",
  287. "items": null
  288. },{
  289. "text": "品牌",
  290. "flex": 0,
  291. "dataIndex": "pr_brand",
  292. "width": 100,
  293. "xtype": "",
  294. "items": null
  295. },{
  296. "text": "供应商",
  297. "flex": 0,
  298. "dataIndex": "pr_vendname",
  299. "width": 100,
  300. "xtype": "",
  301. "items": null
  302. },{
  303. "text": "最小包装",
  304. "flex": 0,
  305. "dataIndex": "pr_zxbzs",
  306. "width": 100,
  307. "xtype": "",
  308. "items": null
  309. },{
  310. "text": "L/T",
  311. "flex": 0,
  312. "dataIndex": "pr_leadtime",
  313. "width": 100,
  314. "xtype": "",
  315. "items": null
  316. }]
  317. });
  318. }
  319. },
  320. //放大镜赋值关系 以及 tpl模板
  321. 'dbfindtrigger[name=pd_whname]': {
  322. beforerender: function (f) {
  323. Ext.apply(f, {
  324. dataUrl: '/api/document/warehouse/list',
  325. // dataUrl:'http://localhost:9480/warehouse/list',
  326. addXtype: 'other-warehouse',
  327. addTitle: '仓库资料',
  328. defaultCondition:"wh_statuscode='OPEN'",
  329. dbfinds: [{
  330. from: 'id',
  331. to: 'pd_whid'
  332. }, {
  333. from: 'wh_code',
  334. to: 'pd_whcode'
  335. }, {
  336. from: 'wh_description',
  337. to: 'pd_whname'
  338. }],
  339. dbtpls: [{
  340. field: 'pd_whcode',
  341. width: 100
  342. }, {
  343. field: 'pd_whname',
  344. width: 100
  345. }],
  346. dbSearchFields:[{
  347. emptyText:'输入仓库编号或名称',
  348. xtype : "textfield",
  349. name : "wh_code",
  350. allowBlank : true,
  351. columnWidth : 0.25,
  352. getCondition:function(v){
  353. return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  354. }
  355. }],
  356. dbColumns: [{
  357. "text": "仓库ID",
  358. "flex": 0,
  359. "dataIndex": "id",
  360. "width": 0,
  361. "xtype": "",
  362. "items": null
  363. }, {
  364. "text": "仓库编号",
  365. "flex": 1,
  366. "dataIndex": "wh_code",
  367. "width": 100,
  368. "xtype": "",
  369. "items": null
  370. }, {
  371. "text": "仓库名称",
  372. "flex": 1,
  373. "dataIndex": "wh_description",
  374. "xtype": "",
  375. "items": null
  376. },{
  377. "text": "仓库类型",
  378. "flex": 1,
  379. "dataIndex": "wh_type",
  380. "xtype": "",
  381. "items": null
  382. }]
  383. });
  384. },
  385. },
  386. });
  387. }
  388. });