FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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: '{!id}'
  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. },{
  70. xtype : "datefield",
  71. name : "pi_date",
  72. bind : "{pi_date}",
  73. fieldLabel : "单据日期",
  74. allowBlank : false,
  75. columnWidth : 0.25,
  76. defaultValue: new Date()
  77. },{
  78. xtype : "textfield",
  79. name : "pi_total",
  80. bind : "{pi_total}",
  81. fieldLabel : "总额",
  82. allowBlank : true,
  83. readOnly: true,
  84. columnWidth : 0.25
  85. }, {
  86. xtype : "hidden",
  87. name : "pi_puid",
  88. bind : "{pi_puid}",
  89. fieldLabel : "采购单id",
  90. allowBlank : true,
  91. columnWidth : 0.25
  92. },{
  93. xtype : "textfield",
  94. name : "pi_pucode",
  95. bind : "{pi_pucode}",
  96. fieldLabel : "采购单号",
  97. allowBlank : true,
  98. columnWidth : 0.25
  99. }, {
  100. name : "detailGridField",
  101. xtype : "detailGridField",
  102. storeModel:'saas.model.purchase.ProdIODetail',
  103. // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
  104. deleteDetailUrl:'api/purchase/prodinout/deleteDetail/',
  105. detnoColumn: 'pd_pdno',
  106. columns : [
  107. {
  108. text : "id",
  109. dataIndex : "id",
  110. xtype : "numbercolumn",
  111. hidden:true
  112. },{
  113. text : "物料id",
  114. dataIndex : "pd_prodid",
  115. xtype : "numbercolumn",
  116. hidden:true
  117. },
  118. {
  119. text : "物料编号",
  120. width : 200.0,
  121. dataIndex : "pd_prodcode",
  122. xtype : "",
  123. items : null,
  124. editor : {
  125. displayField : "display",
  126. editable : true,
  127. format : "",
  128. hideTrigger : false,
  129. maxLength : 100.0,
  130. minValue : null,
  131. positiveNum : false,
  132. queryMode : "local",
  133. store : null,
  134. valueField : "value",
  135. xtype : "multidbfindtrigger"
  136. }
  137. },
  138. {
  139. text : "名称",
  140. dataIndex : "pr_detail",
  141. ignore:true,
  142. renderer: function (v, m, r) {
  143. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  144. }
  145. },
  146. {
  147. text : "规格",
  148. dataIndex : "pr_spec",
  149. ignore:true,
  150. renderer: function (v, m, r) {
  151. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  152. }
  153. },
  154. {
  155. text : "数量",
  156. dataIndex : "pd_inqty",
  157. width : 120.0,
  158. editor : {
  159. xtype : "numberfield",
  160. decimalPrecision: 8,
  161. minValue:0
  162. },
  163. renderer : function(v) {
  164. var arr = (v + '.').split('.');
  165. var xr = (new Array(arr[1].length)).fill('0');
  166. var format = '0.' + xr.join();
  167. return Ext.util.Format.number(v, format);
  168. },
  169. summaryType: 'sum',
  170. summaryRenderer: function(v) {
  171. var arr = (v + '.').split('.');
  172. var xr = (new Array(arr[1].length)).fill('0');
  173. var format = '0.' + xr.join();
  174. return Ext.util.Format.number(v, format);
  175. }
  176. }, {
  177. text : "已转数",
  178. dataIndex : "pd_yqty",
  179. width : 120.0,
  180. editor : {
  181. xtype : "numberfield",
  182. decimalPrecision: 8
  183. },
  184. renderer : function(v) {
  185. var arr = (v + '.').split('.');
  186. var xr = (new Array(arr[1].length)).fill('0');
  187. var format = '0.' + xr.join();
  188. return Ext.util.Format.number(v, format);
  189. },
  190. summaryType: 'sum',
  191. summaryRenderer: function(v) {
  192. var arr = (v + '.').split('.');
  193. var xr = (new Array(arr[1].length)).fill('0');
  194. var format = '0.' + xr.join();
  195. return Ext.util.Format.number(v, format);
  196. }
  197. },{
  198. text : "仓库id",
  199. dataIndex : "pd_whid",
  200. xtype : "numbercolumn",
  201. hidden:true
  202. },
  203. {
  204. text : "仓库编号",
  205. dataIndex : "pd_whcode",
  206. hidden:true
  207. },
  208. {
  209. text : "仓库",
  210. dataIndex : "pd_whname",
  211. width : 120.0,
  212. items : null,
  213. editor : {
  214. displayField : "display",
  215. editable : true,
  216. format : "",
  217. hideTrigger : false,
  218. maxLength : 100.0,
  219. minValue : null,
  220. positiveNum : false,
  221. queryMode : "local",
  222. store : null,
  223. valueField : "value",
  224. xtype : "dbfindtrigger"
  225. }
  226. },
  227. {
  228. text : "单价",
  229. editor : {
  230. xtype : "numberfield",
  231. decimalPrecision: 8,
  232. minValue:0
  233. },
  234. dataIndex : "pd_orderprice",
  235. width : 120.0,
  236. xtype : "numbercolumn"
  237. },
  238. {
  239. text : "含税金额",
  240. dataIndex : "pd_total",
  241. width : 120.0,
  242. editor : {
  243. xtype : "numberfield",
  244. decimalPrecision: 2
  245. },
  246. renderer : function(v) {
  247. var arr = (v + '.').split('.');
  248. var xr = (new Array(arr[1].length)).fill('0');
  249. var format = '0,000.' + xr.join();
  250. return Ext.util.Format.number(v, format);
  251. },
  252. summaryType: 'sum',
  253. summaryRenderer: function(v) {
  254. var arr = (v + '.').split('.');
  255. var xr = (new Array(arr[1].length)).fill('0');
  256. var format = '0,000.' + xr.join();
  257. return Ext.util.Format.number(v, format);
  258. }
  259. }, {
  260. text : "税率",
  261. dataIndex : "pd_taxrate",
  262. width : 120.0,
  263. editor : {
  264. decimalPrecision: 0,
  265. minValue: 0,
  266. maxValue: 100
  267. }
  268. },
  269. {
  270. text : "未税金额",
  271. dataIndex : "pd_nettotal",
  272. editor : {
  273. xtype : "numberfield",
  274. decimalPrecision: 2
  275. },
  276. renderer : function(v) {
  277. var arr = (v + '.').split('.');
  278. var xr = (new Array(arr[1].length)).fill('0');
  279. var format = '0,000.' + xr.join();
  280. return Ext.util.Format.number(v, format);
  281. },
  282. summaryType: 'sum',
  283. summaryRenderer: 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. },
  290. {
  291. text : "采购单明细id",
  292. dataIndex : "pd_orderid",
  293. width : 120.0,
  294. hidden:true
  295. },
  296. {
  297. text : "采购单号",
  298. dataIndex : "pd_ordercode",
  299. width : 120.0
  300. },{
  301. text : "采购序号",
  302. dataIndex : "pd_orderdetno",
  303. xtype : "numbercolumn",
  304. width : 120.0,
  305. format: '0',
  306. renderer: function(v) {
  307. return v ? v : null;
  308. }
  309. }
  310. ]
  311. }, {
  312. xtype : "datefield",
  313. name : "createTime",
  314. bind : "{createTime}",
  315. fieldLabel : "创建时间",
  316. allowBlank : true,
  317. columnWidth : 0.25
  318. }, {
  319. xtype : "datefield",
  320. name : "updateTime",
  321. bind : "{updateTime}",
  322. fieldLabel : "更新时间",
  323. allowBlank : true,
  324. columnWidth : 0.25
  325. }, {
  326. xtype : "textfield",
  327. readOnly : true,
  328. editable : false,
  329. name : "pi_status",
  330. bind : "{pi_status}",
  331. fieldLabel : "单据状态",
  332. allowBlank : true,
  333. columnWidth : 0.25
  334. }, {
  335. xtype : "hidden",
  336. readOnly : true,
  337. editable : false,
  338. name : "pi_statuscode",
  339. bind : "{pi_statuscode}",
  340. fieldLabel : "单据状态码",
  341. allowBlank : true,
  342. columnWidth : 0.0
  343. }]
  344. });