FormPanelController.js 16 KB

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