FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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. width : 150.0,
  129. dataIndex : "pr_brand",
  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. width : 200.0,
  141. dataIndex : "pr_detail",
  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. width : 200.0,
  153. dataIndex : "pr_orispeccode",
  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_outqty",
  165. width : 110.0,
  166. xtype: 'numbercolumn',
  167. allowBlank : false,
  168. editor : {
  169. xtype : "numberfield",
  170. decimalPrecision: 3,
  171. minValue:0
  172. },
  173. renderer : function(v) {
  174. var arr = (v + '.').split('.');
  175. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  176. var format = '0.' + xr.join('');
  177. return Ext.util.Format.number(v, format);
  178. },
  179. summaryType: 'sum',
  180. summaryRenderer: function(v) {
  181. var arr = (v + '.').split('.');
  182. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  183. var format = '0.' + xr.join('');
  184. return Ext.util.Format.number(v, format);
  185. }
  186. },{
  187. text : "单位",
  188. width : 80.0,
  189. dataIndex : "pr_unit",
  190. ignore:true,
  191. renderer: function (v, m, r) {
  192. if(!v){
  193. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  194. }
  195. return v;
  196. }
  197. },{
  198. text : "单价(元)",
  199. xtype: 'numbercolumn',
  200. width : 110.0,
  201. editor : {
  202. xtype : "numberfield",
  203. decimalPrecision: 8,
  204. minValue:0
  205. },
  206. dataIndex : "pd_orderprice",
  207. width : 120.0,
  208. renderer : function(v) {
  209. var arr = (v + '.').split('.');
  210. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  211. var format = '0,000.' + xr.join('');
  212. return Ext.util.Format.number(v, format);
  213. },
  214. }, {
  215. text : "仓库id",
  216. dataIndex : "pd_whid",
  217. xtype : "numbercolumn",
  218. hidden:true
  219. }, {
  220. text : "仓库编号",
  221. dataIndex : "pd_whcode",
  222. hidden:true
  223. }, {
  224. text : "仓库",
  225. dataIndex : "pd_whname",
  226. width : 150.0,
  227. allowBlank : false,
  228. editor : {
  229. displayField : "display",
  230. editable : true,
  231. format : "",
  232. hideTrigger : false,
  233. maxLength : 100.0,
  234. minValue : null,
  235. positiveNum : false,
  236. queryMode : "local",
  237. store : null,
  238. valueField : "value",
  239. xtype : "warehouseDbfindTrigger"
  240. }
  241. }, {
  242. text : "税率",
  243. xtype: 'numbercolumn',
  244. dataIndex : "pd_taxrate",
  245. width : 80.0,
  246. editor : {
  247. xtype : "numberfield",
  248. decimalPrecision: 0,
  249. minValue: 0,
  250. maxValue: 100
  251. },
  252. renderer : function(v) {
  253. return Ext.util.Format.number(v, '0');
  254. },
  255. },
  256. {
  257. text : "含税金额",
  258. xtype: 'numbercolumn',
  259. dataIndex : "pd_ordertotal",
  260. width : 110.0,
  261. renderer : function(v) {
  262. var arr = (v + '.').split('.');
  263. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  264. var format = '0,000.' + xr.join('');
  265. return Ext.util.Format.number(v, format);
  266. },
  267. summaryType: 'sum',
  268. summaryRenderer: function(v) {
  269. var arr = (v + '.').split('.');
  270. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  271. var format = '0,000.' + xr.join('');
  272. return Ext.util.Format.number(v, format);
  273. }
  274. },
  275. {
  276. text : "未税金额",
  277. xtype: 'numbercolumn',
  278. dataIndex : "pd_nettotal",
  279. width : 110.0,
  280. renderer : function(v) {
  281. var arr = (v + '.').split('.');
  282. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  283. var format = '0,000.' + xr.join('');
  284. return Ext.util.Format.number(v, format);
  285. },
  286. summaryType: 'sum',
  287. summaryRenderer: function(v) {
  288. var arr = (v + '.').split('.');
  289. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  290. var format = '0,000.' + xr.join('');
  291. return Ext.util.Format.number(v, format);
  292. }
  293. }, {
  294. text : "验收明细id",
  295. dataIndex : "pd_ioid",
  296. hidden:true
  297. }, {
  298. text : "验收单号",
  299. dataIndex : "iocode",
  300. width : 150.0,
  301. ignore:true
  302. }, {
  303. text : "验收序号",
  304. dataIndex : "iodetno",
  305. xtype : "numbercolumn",
  306. width : 110.0,
  307. ignore:true,
  308. renderer: function(v) {
  309. if(v) {
  310. return Ext.util.Format.number(v, '0');
  311. }else {
  312. return null;
  313. }
  314. }
  315. },{
  316. text : "备注",
  317. dataIndex : "pd_remark",
  318. width : 250,
  319. items : null,
  320. editor : {
  321. xtype : "textfield"
  322. },
  323. }
  324. ]
  325. },{
  326. xtype : "textfield",
  327. name : "pi_remark",
  328. fieldLabel : "备注",
  329. columnWidth : 1
  330. },
  331. {
  332. xtype : "hidden",
  333. name : "creatorId",
  334. fieldLabel : "录入人ID",
  335. readOnly:true
  336. },
  337. {
  338. xtype : "textfield",
  339. name : "creatorName",
  340. fieldLabel : "录入人",
  341. readOnly:true
  342. }, {
  343. xtype : "datefield",
  344. name : "createTime",
  345. fieldLabel : "录入日期",
  346. readOnly:true,
  347. defaultValue: new Date()
  348. },{
  349. xtype : "hidden",
  350. name : "updaterId",
  351. fieldLabel : "更新人ID",
  352. readOnly:true
  353. },{
  354. xtype : "hidden",
  355. name : "updaterName",
  356. fieldLabel : "更新人",
  357. readOnly:true
  358. }, {
  359. xtype : "hidden",
  360. name : "updateTime",
  361. fieldLabel : "更新日期",
  362. readOnly:true,
  363. defaultValue: new Date()
  364. }, {
  365. xtype : "textfield",
  366. name : "pi_auditman",
  367. fieldLabel : "审核人",
  368. readOnly:true
  369. }, {
  370. xtype : "datefield",
  371. name : "pi_auditdate",
  372. fieldLabel : "审核日期",
  373. readOnly:true
  374. }]
  375. });