FormPanelController.js 15 KB

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