FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'purchase-purchasein-formpanel',
  4. controller: 'purchase-purchasein-formpanel',
  5. viewModel: 'purchase-purchasein-formpanel',
  6. viewName: 'purchase-purchasein-formpanel',
  7. caller:'PurchaseIn',
  8. //字段属性
  9. _title:'采购验收单',
  10. _idField: 'id',
  11. _codeField: 'pi_inoutno',
  12. _statusField: 'pi_status',
  13. _statusCodeField: 'pi_statuscode',
  14. _relationColumn: 'pd_piid',
  15. _readUrl:'/api/purchase/prodinout/read/',
  16. _saveUrl:'/api/purchase/prodinout/save',
  17. _auditUrl:'/api/purchase/prodinout/audit',
  18. _unAuditUrl:'/api/purchase/prodinout/unAudit/',
  19. _deleteUrl:'/api/purchase/prodinout/delete/',
  20. _turnOutUrl:'/api/purchase/prodinout/turnProdOut/',
  21. // _relationColumn: 'pd_piid',
  22. // _readUrl:'http://localhost:8800/prodinout/read/',
  23. // _saveUrl:'http://localhost:8800/prodinout/save',
  24. // _auditUrl:'http://localhost:8800/prodinout/audit',
  25. // _unAuditUrl:'http://localhost:8800/prodinout/unAudit/',
  26. // _deleteUrl:'http://localhost:8800/prodinout/delete/',
  27. // _turnOutUrl:'http://localhost:8800/prodinout/turnProdOut/',
  28. initId:0,
  29. toolBtns: [{
  30. xtype: 'button',
  31. text: '转采购验退单',
  32. bind: {
  33. hidden: '{turnHidden}'
  34. },
  35. handler: 'turnOut'
  36. }],
  37. defaultItems: [{
  38. xtype: 'hidden',
  39. name: 'id',
  40. bind: '{id}',
  41. fieldLabel: 'id',
  42. allowBlank: true,
  43. columnWidth: 0
  44. },{
  45. xtype : "textfield",
  46. name : "pi_class",
  47. bind : "{pi_class}",
  48. fieldLabel : "单据类型",
  49. readOnly:true,
  50. allowBlank : true,
  51. columnWidth : 0.25
  52. }, {
  53. xtype : "hidden",
  54. name : "pi_vendid",
  55. bind : "{pi_vendid}",
  56. fieldLabel : "供应商ID",
  57. allowBlank : true,
  58. columnWidth : 0.0
  59. },{
  60. xtype: 'hidden',
  61. name: 'pi_vendcode',
  62. bind: '{pi_vendcode}',
  63. fieldLabel: '供应商编号'
  64. }, {
  65. xtype: 'dbfindtrigger',
  66. name: 'pi_vendname',
  67. bind: '{pi_vendname}',
  68. fieldLabel: '供应商名称',
  69. allowBlank : false,
  70. },{
  71. xtype : "datefield",
  72. name : "pi_date",
  73. bind : "{pi_date}",
  74. fieldLabel : "单据日期",
  75. allowBlank : false,
  76. columnWidth : 0.25,
  77. defaultValue: new Date()
  78. },{
  79. xtype : "textfield",
  80. name : "pi_total",
  81. bind : "{pi_total}",
  82. fieldLabel : "总额",
  83. allowBlank : true,
  84. readOnly: true,
  85. columnWidth : 0.25
  86. }, {
  87. xtype : "hidden",
  88. name : "pi_puid",
  89. bind : "{pi_puid}",
  90. fieldLabel : "采购单id",
  91. allowBlank : true,
  92. columnWidth : 0.25
  93. },{
  94. xtype : "hidden",
  95. name : "pi_pucode",
  96. bind : "{pi_pucode}",
  97. fieldLabel : "采购单号",
  98. allowBlank : true,
  99. columnWidth : 0.25
  100. }, {
  101. name : "detailGridField",
  102. xtype : "detailGridField",
  103. storeModel:'saas.model.purchase.ProdIODetail',
  104. // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
  105. deleteDetailUrl:'/api/purchase/prodinout/deleteDetail/',
  106. detnoColumn: 'pd_pdno',
  107. columns : [
  108. {
  109. text : "id",
  110. dataIndex : "id",
  111. xtype : "numbercolumn",
  112. hidden:true
  113. },{
  114. text : "物料id",
  115. dataIndex : "pd_prodid",
  116. xtype : "numbercolumn",
  117. hidden:true
  118. },
  119. {
  120. text : "物料编号",
  121. width : 200.0,
  122. dataIndex : "pd_prodcode",
  123. xtype : "",
  124. items : null,
  125. allowBlank : false,
  126. editor : {
  127. displayField : "display",
  128. editable : true,
  129. format : "",
  130. hideTrigger : false,
  131. maxLength : 100.0,
  132. minValue : null,
  133. positiveNum : false,
  134. queryMode : "local",
  135. store : null,
  136. valueField : "value",
  137. xtype : "multidbfindtrigger"
  138. }
  139. },
  140. {
  141. text : "名称",
  142. dataIndex : "pr_detail",
  143. ignore:true,
  144. renderer: function (v, m, r) {
  145. if(!v){
  146. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  147. }
  148. return v;
  149. }
  150. },
  151. {
  152. text : "规格",
  153. dataIndex : "pr_spec",
  154. ignore:true,
  155. renderer: function (v, m, r) {
  156. if(!v){
  157. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  158. }
  159. return v;
  160. }
  161. },
  162. {
  163. text : "数量",
  164. dataIndex : "pd_inqty",
  165. width : 120.0,
  166. allowBlank : false,
  167. editor : {
  168. xtype : "numberfield",
  169. decimalPrecision: 8,
  170. minValue:0
  171. },
  172. renderer : function(v) {
  173. var arr = (v + '.').split('.');
  174. var xr = (new Array(arr[1].length)).fill('0');
  175. var format = '0.' + xr.join();
  176. return Ext.util.Format.number(v, format);
  177. },
  178. summaryType: 'sum',
  179. summaryRenderer: function(v) {
  180. var arr = (v + '.').split('.');
  181. var xr = (new Array(arr[1].length)).fill('0');
  182. var format = '0.' + xr.join();
  183. return Ext.util.Format.number(v, format);
  184. }
  185. }, {
  186. text : "已转数",
  187. dataIndex : "pd_yqty",
  188. hidden:true,
  189. width : 120.0,
  190. editor : {
  191. xtype : "numberfield",
  192. decimalPrecision: 8,
  193. editable : false
  194. },
  195. renderer : function(v) {
  196. var arr = (v + '.').split('.');
  197. var xr = (new Array(arr[1].length)).fill('0');
  198. var format = '0.' + xr.join();
  199. return Ext.util.Format.number(v, format);
  200. },
  201. summaryType: 'sum',
  202. summaryRenderer: function(v) {
  203. var arr = (v + '.').split('.');
  204. var xr = (new Array(arr[1].length)).fill('0');
  205. var format = '0.' + xr.join();
  206. return Ext.util.Format.number(v, format);
  207. }
  208. },{
  209. text : "仓库id",
  210. dataIndex : "pd_whid",
  211. xtype : "numbercolumn",
  212. hidden:true
  213. },
  214. {
  215. text : "仓库编号",
  216. dataIndex : "pd_whcode",
  217. hidden:true
  218. },
  219. {
  220. text : "仓库",
  221. dataIndex : "pd_whname",
  222. width : 120.0,
  223. allowBlank : false,
  224. editor : {
  225. displayField : "display",
  226. editable : true,
  227. format : "",
  228. hideTrigger : false,
  229. maxLength : 100.0,
  230. minValue : null,
  231. positiveNum : false,
  232. queryMode : "local",
  233. store : null,
  234. valueField : "value",
  235. xtype : "dbfindtrigger"
  236. }
  237. },
  238. {
  239. text : "单价",
  240. editor : {
  241. xtype : "numberfield",
  242. decimalPrecision: 8,
  243. minValue:0
  244. },
  245. dataIndex : "pd_orderprice",
  246. width : 120.0,
  247. renderer : function(v) {
  248. var arr = (v + '.').split('.');
  249. var xr = (new Array(arr[1].length)).fill('0');
  250. var format = '0,000.' + xr.join();
  251. return Ext.util.Format.number(v, format);
  252. },
  253. }, {
  254. text : "税率",
  255. dataIndex : "pd_taxrate",
  256. width : 120.0,
  257. editor : {
  258. xtype : "numberfield",
  259. decimalPrecision: 0,
  260. minValue: 0,
  261. maxValue: 100
  262. }
  263. },{
  264. text : "含税金额",
  265. dataIndex : "pd_total",
  266. width : 120.0,
  267. editor : {
  268. xtype : "numberfield",
  269. decimalPrecision: 2,
  270. editable : false
  271. },
  272. renderer : function(v) {
  273. var arr = (v + '.').split('.');
  274. var xr = (new Array(arr[1].length)).fill('0');
  275. var format = '0,000.' + xr.join();
  276. return Ext.util.Format.number(v, format);
  277. },
  278. summaryType: 'sum',
  279. summaryRenderer: function(v) {
  280. var arr = (v + '.').split('.');
  281. var xr = (new Array(arr[1].length)).fill('0');
  282. var format = '0,000.' + xr.join();
  283. return Ext.util.Format.number(v, format);
  284. }
  285. },
  286. {
  287. text : "未税金额",
  288. dataIndex : "pd_nettotal",
  289. editor : {
  290. xtype : "numberfield",
  291. decimalPrecision: 2,
  292. editable : false
  293. },
  294. renderer : function(v) {
  295. var arr = (v + '.').split('.');
  296. var xr = (new Array(arr[1].length)).fill('0');
  297. var format = '0,000.' + xr.join();
  298. return Ext.util.Format.number(v, format);
  299. },
  300. summaryType: 'sum',
  301. summaryRenderer: function(v) {
  302. var arr = (v + '.').split('.');
  303. var xr = (new Array(arr[1].length)).fill('0');
  304. var format = '0,000.' + xr.join();
  305. return Ext.util.Format.number(v, format);
  306. }
  307. },
  308. {
  309. text : "采购单明细id",
  310. dataIndex : "pd_orderid",
  311. width : 120.0,
  312. hidden:true
  313. },
  314. {
  315. text : "采购单号",
  316. dataIndex : "pd_ordercode",
  317. width : 120.0
  318. },{
  319. text : "采购序号",
  320. dataIndex : "pd_orderdetno",
  321. xtype : "numbercolumn",
  322. width : 120.0,
  323. format: '0',
  324. renderer: function(v) {
  325. return v ? v : null;
  326. }
  327. }
  328. ]
  329. },{
  330. xtype : "textfield",
  331. name : "pi_recordman",
  332. fieldLabel : "录入人",
  333. readOnly:true
  334. }, {
  335. xtype : "datefield",
  336. name : "createTime",
  337. fieldLabel : "录入日期",
  338. readOnly:true
  339. }, {
  340. xtype : "textfield",
  341. name : "pi_auditman",
  342. fieldLabel : "审核人",
  343. readOnly:true
  344. }, {
  345. xtype : "datefield",
  346. name : "pi_auditdate",
  347. fieldLabel : "审核日期",
  348. readOnly:true
  349. }]
  350. });