FormPanel.js 13 KB

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