FormPanelController.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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. renderer : function(v) {
  71. return Ext.util.Format.number(v, '0');
  72. }
  73. }, {
  74. "text": "纳税人识别号",
  75. "dataIndex": "ve_bankaccount",
  76. "width": 150
  77. }, {
  78. "text": "开户银行",
  79. "dataIndex": "ve_bankaccount",
  80. "width": 100
  81. }, {
  82. "text": "银行账户",
  83. "dataIndex": "ve_bankcode",
  84. "width": 100
  85. }]
  86. }) ;
  87. }
  88. },
  89. //放大镜赋值关系 以及 tpl模板
  90. 'dbfindtrigger[name=pi_custname]': {
  91. beforerender: function (f) {
  92. Ext.apply(f, {
  93. addXtype: 'document-customer-formpanel',
  94. addTitle: '客户资料',
  95. dataUrl: '/api/document/customer/list',
  96. // dataUrl:'http://localhost:9480/customer/list',
  97. dbfinds: [{
  98. from: 'id',to: 'pi_custid',ignore:true
  99. }, {
  100. from: 'cu_code',to: 'pi_custcode'
  101. }, {
  102. from: 'cu_name',to: 'pi_custname'
  103. }],
  104. dbtpls: [{
  105. field: 'cu_code',
  106. width: 100
  107. }, {
  108. field: 'cu_name',
  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. renderer : function(v) {
  156. return Ext.util.Format.number(v, '0');
  157. }
  158. },{
  159. "text": "额度",
  160. "dataIndex": "cu_credit",
  161. "width": 100,
  162. xtype: 'numbercolumn',
  163. align:'end'
  164. }]
  165. });
  166. }
  167. },
  168. //放大镜赋值关系 以及 tpl模板
  169. 'multidbfindtrigger[name=pd_prodcode]': {
  170. beforerender: function (f) {
  171. Ext.apply(f, {
  172. dataUrl: '/api/document/product/list',
  173. // dataUrl:'http://localhost:9480/product/list',
  174. addXtype: 'document-product-formpanel',
  175. addTitle: '物料资料',
  176. dbfinds: [{
  177. from: 'id',
  178. to: 'pd_prodid',ignore:true
  179. }, {
  180. from: 'pr_code',
  181. to: 'pd_prodcode'
  182. }, {
  183. from: 'pr_detail',
  184. to: 'pr_detail'
  185. }, {
  186. from: 'pr_spec',
  187. to: 'pr_spec'
  188. },{
  189. from:'pr_whid',to:'pd_whid'
  190. },{
  191. from:'pr_whcode',to:'pd_whcode'
  192. },{
  193. from:'pr_whname',to:'pd_whname'
  194. },{
  195. from:'pr_purcprice',to:'pd_orderprice'
  196. }],
  197. dbtpls: [{
  198. field: 'pr_code',
  199. width: 100
  200. }, {
  201. field: 'pr_detail',
  202. width: 100
  203. }, {
  204. field: 'pr_spec',
  205. width: 100
  206. }],
  207. defaultCondition: "pr_statuscode='OPEN'",
  208. dbSearchFields:[{
  209. emptyText:'输入物料编号、名称或规格',
  210. xtype : "textfield",
  211. name : "search",
  212. width: 200,
  213. getCondition: function(v) {
  214. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  215. },
  216. allowBlank : true,
  217. columnWidth : 0.25
  218. }],
  219. dbColumns:[{
  220. "text": "物料ID",
  221. "hidden": true,
  222. "dataIndex": "id",
  223. }, {
  224. "text": "物料编号",
  225. "dataIndex": "pr_code",
  226. "width": 200,
  227. }, {
  228. "text": "物料名称",
  229. "width": 200,
  230. "dataIndex": "pr_detail",
  231. }, {
  232. "text": "规格",
  233. "dataIndex": "pr_spec",
  234. "width": 100,
  235. }, {
  236. "text": "单位",
  237. "dataIndex": "pr_unit",
  238. "width": 100,
  239. },{
  240. "text": "仓库id",
  241. "dataIndex": "pr_whid",
  242. "hidden": true,
  243. },{
  244. "text": "仓库编号",
  245. "dataIndex": "pr_whcode",
  246. "hidden": true,
  247. },{
  248. "text": "仓库",
  249. "dataIndex": "pr_whname",
  250. "width": 200,
  251. "hidden": true
  252. },{
  253. "text": "总库存数",
  254. "dataIndex": "po_onhand",
  255. "width": 100,
  256. xtype: 'numbercolumn',
  257. renderer : function(v) {
  258. var arr = (v + '.').split('.');
  259. var xr = (new Array(arr[1].length)).fill('0');
  260. var format = '0,000.' + xr.join();
  261. return Ext.util.Format.number(v, format);
  262. },
  263. align:'end'
  264. },{
  265. "text": "类型",
  266. "dataIndex": "pr_kind",
  267. "width": 100,
  268. },{
  269. "text": "型号",
  270. "dataIndex": "pr_orispeccode",
  271. "width": 100,
  272. },{
  273. "text": "品牌",
  274. "dataIndex": "pr_brand",
  275. "width": 100,
  276. },{
  277. "text": "供应商",
  278. "dataIndex": "pr_vendname",
  279. "width": 100,
  280. },{
  281. "text": "最小包装",
  282. "dataIndex": "pr_zxbzs",
  283. "width": 100,
  284. xtype: 'numbercolumn',
  285. align: 'end'
  286. },{
  287. "text": "L/T",
  288. "dataIndex": "pr_leadtime",
  289. "width": 100,
  290. }]
  291. });
  292. }
  293. },
  294. //放大镜赋值关系 以及 tpl模板
  295. 'dbfindtrigger[name=pd_whname]': {
  296. beforerender: function (f) {
  297. Ext.apply(f, {
  298. dataUrl: '/api/document/warehouse/list',
  299. // dataUrl:'http://localhost:9480/warehouse/list',
  300. addXtype: 'other-warehouse',
  301. addTitle: '仓库资料',
  302. defaultCondition:"wh_statuscode='OPEN'",
  303. dbfinds: [{
  304. from: 'id',
  305. to: 'pd_whid',ignore:true
  306. }, {
  307. from: 'wh_code',
  308. to: 'pd_whcode'
  309. }, {
  310. from: 'wh_description',
  311. to: 'pd_whname'
  312. }],
  313. dbtpls: [{
  314. field: 'pd_whcode',
  315. width: 100
  316. }, {
  317. field: 'pd_whname',
  318. width: 100
  319. }],
  320. dbSearchFields:[{
  321. emptyText:'输入仓库编号或名称',
  322. xtype : "textfield",
  323. name : "wh_code",
  324. allowBlank : true,
  325. columnWidth : 0.25,
  326. getCondition:function(v){
  327. return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  328. }
  329. }],
  330. dbColumns: [{
  331. "text": "仓库ID",
  332. "flex": 0,
  333. "dataIndex": "id",
  334. "width": 0,
  335. "xtype": "",
  336. "items": null
  337. }, {
  338. "text": "仓库编号",
  339. "flex": 1,
  340. "dataIndex": "wh_code",
  341. "width": 100,
  342. "xtype": "",
  343. "items": null
  344. }, {
  345. "text": "仓库名称",
  346. "flex": 1,
  347. "dataIndex": "wh_description",
  348. "xtype": "",
  349. "items": null
  350. },{
  351. "text": "仓库类型",
  352. "flex": 1,
  353. "dataIndex": "wh_type",
  354. "xtype": "",
  355. "items": null
  356. }]
  357. });
  358. },
  359. },
  360. });
  361. }
  362. });