FormPanelController.js 15 KB

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