FormPanelController.js 15 KB

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