FormPanelController.js 15 KB

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