FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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 : "textfield",
  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. editor : {
  126. displayField : "display",
  127. editable : true,
  128. format : "",
  129. hideTrigger : false,
  130. maxLength : 100.0,
  131. minValue : null,
  132. positiveNum : false,
  133. queryMode : "local",
  134. store : null,
  135. valueField : "value",
  136. xtype : "multidbfindtrigger"
  137. }
  138. },
  139. {
  140. text : "名称",
  141. dataIndex : "pr_detail",
  142. ignore:true,
  143. renderer: function (v, m, r) {
  144. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  145. }
  146. },
  147. {
  148. text : "规格",
  149. dataIndex : "pr_spec",
  150. ignore:true,
  151. renderer: function (v, m, r) {
  152. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  153. }
  154. },
  155. {
  156. text : "数量",
  157. dataIndex : "pd_inqty",
  158. width : 120.0,
  159. editor : {
  160. xtype : "numberfield",
  161. decimalPrecision: 8,
  162. minValue:0
  163. },
  164. renderer : function(v) {
  165. var arr = (v + '.').split('.');
  166. var xr = (new Array(arr[1].length)).fill('0');
  167. var format = '0.' + xr.join();
  168. return Ext.util.Format.number(v, format);
  169. },
  170. summaryType: 'sum',
  171. summaryRenderer: function(v) {
  172. var arr = (v + '.').split('.');
  173. var xr = (new Array(arr[1].length)).fill('0');
  174. var format = '0.' + xr.join();
  175. return Ext.util.Format.number(v, format);
  176. }
  177. }, {
  178. text : "已转数",
  179. dataIndex : "pd_yqty",
  180. width : 120.0,
  181. editor : {
  182. xtype : "numberfield",
  183. decimalPrecision: 8
  184. },
  185. renderer : function(v) {
  186. var arr = (v + '.').split('.');
  187. var xr = (new Array(arr[1].length)).fill('0');
  188. var format = '0.' + xr.join();
  189. return Ext.util.Format.number(v, format);
  190. },
  191. summaryType: 'sum',
  192. summaryRenderer: function(v) {
  193. var arr = (v + '.').split('.');
  194. var xr = (new Array(arr[1].length)).fill('0');
  195. var format = '0.' + xr.join();
  196. return Ext.util.Format.number(v, format);
  197. }
  198. },{
  199. text : "仓库id",
  200. dataIndex : "pd_whid",
  201. xtype : "numbercolumn",
  202. hidden:true
  203. },
  204. {
  205. text : "仓库编号",
  206. dataIndex : "pd_whcode",
  207. hidden:true
  208. },
  209. {
  210. text : "仓库",
  211. dataIndex : "pd_whname",
  212. width : 120.0,
  213. allowBlank : false,
  214. editor : {
  215. displayField : "display",
  216. editable : true,
  217. format : "",
  218. hideTrigger : false,
  219. maxLength : 100.0,
  220. minValue : null,
  221. positiveNum : false,
  222. queryMode : "local",
  223. store : null,
  224. valueField : "value",
  225. xtype : "dbfindtrigger"
  226. }
  227. },
  228. {
  229. text : "单价",
  230. editor : {
  231. xtype : "numberfield",
  232. decimalPrecision: 8,
  233. minValue:0
  234. },
  235. dataIndex : "pd_orderprice",
  236. width : 120.0,
  237. renderer : function(v) {
  238. var arr = (v + '.').split('.');
  239. var xr = (new Array(arr[1].length)).fill('0');
  240. var format = '0,000.' + xr.join();
  241. return Ext.util.Format.number(v, format);
  242. },
  243. },
  244. {
  245. text : "含税金额",
  246. dataIndex : "pd_total",
  247. width : 120.0,
  248. editor : {
  249. xtype : "numberfield",
  250. decimalPrecision: 2
  251. },
  252. renderer : function(v) {
  253. var arr = (v + '.').split('.');
  254. var xr = (new Array(arr[1].length)).fill('0');
  255. var format = '0,000.' + xr.join();
  256. return Ext.util.Format.number(v, format);
  257. },
  258. summaryType: 'sum',
  259. summaryRenderer: function(v) {
  260. var arr = (v + '.').split('.');
  261. var xr = (new Array(arr[1].length)).fill('0');
  262. var format = '0,000.' + xr.join();
  263. return Ext.util.Format.number(v, format);
  264. }
  265. }, {
  266. text : "税率",
  267. dataIndex : "pd_taxrate",
  268. width : 120.0,
  269. editor : {
  270. xtype : "numberfield",
  271. decimalPrecision: 0,
  272. minValue: 0,
  273. maxValue: 100
  274. }
  275. },
  276. {
  277. text : "未税金额",
  278. dataIndex : "pd_nettotal",
  279. editor : {
  280. xtype : "numberfield",
  281. decimalPrecision: 2
  282. },
  283. renderer : function(v) {
  284. var arr = (v + '.').split('.');
  285. var xr = (new Array(arr[1].length)).fill('0');
  286. var format = '0,000.' + xr.join();
  287. return Ext.util.Format.number(v, format);
  288. },
  289. summaryType: 'sum',
  290. summaryRenderer: function(v) {
  291. var arr = (v + '.').split('.');
  292. var xr = (new Array(arr[1].length)).fill('0');
  293. var format = '0,000.' + xr.join();
  294. return Ext.util.Format.number(v, format);
  295. }
  296. },
  297. {
  298. text : "采购单明细id",
  299. dataIndex : "pd_orderid",
  300. width : 120.0,
  301. hidden:true
  302. },
  303. {
  304. text : "采购单号",
  305. dataIndex : "pd_ordercode",
  306. width : 120.0
  307. },{
  308. text : "采购序号",
  309. dataIndex : "pd_orderdetno",
  310. xtype : "numbercolumn",
  311. width : 120.0,
  312. format: '0',
  313. renderer: function(v) {
  314. return v ? v : null;
  315. }
  316. }
  317. ]
  318. }, {
  319. xtype : "datefield",
  320. name : "createTime",
  321. bind : "{createTime}",
  322. fieldLabel : "创建时间",
  323. allowBlank : true,
  324. columnWidth : 0.25
  325. }, {
  326. xtype : "datefield",
  327. name : "updateTime",
  328. bind : "{updateTime}",
  329. fieldLabel : "更新时间",
  330. allowBlank : true,
  331. columnWidth : 0.25
  332. }, {
  333. xtype : "textfield",
  334. readOnly : true,
  335. editable : false,
  336. name : "pi_status",
  337. bind : "{pi_status}",
  338. fieldLabel : "单据状态",
  339. allowBlank : true,
  340. columnWidth : 0.25
  341. }, {
  342. xtype : "hidden",
  343. readOnly : true,
  344. editable : false,
  345. name : "pi_statuscode",
  346. bind : "{pi_statuscode}",
  347. fieldLabel : "单据状态码",
  348. allowBlank : true,
  349. columnWidth : 0.0
  350. }]
  351. });