FormPanel.js 11 KB

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