FormPanelController.js 15 KB

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