FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. bind : "{pi_total}",
  68. fieldLabel : "总额",
  69. allowBlank : true,
  70. readOnly: true,
  71. columnWidth : 0.25
  72. }, {
  73. xtype : "hidden",
  74. name : "pi_puid",
  75. bind : "{pi_puid}",
  76. fieldLabel : "采购单id",
  77. allowBlank : true,
  78. columnWidth : 0.25
  79. },{
  80. xtype : "hidden",
  81. name : "pi_pucode",
  82. bind : "{pi_pucode}",
  83. fieldLabel : "采购单号",
  84. allowBlank : true,
  85. columnWidth : 0.25
  86. }, {
  87. name : "detailGridField",
  88. xtype : "detailGridField",
  89. storeModel:'saas.model.purchase.ProdIODetail',
  90. deleteDetailUrl:'/api/purchase/prodinout/deleteDetail',
  91. detnoColumn: 'pd_pdno',
  92. columns : [
  93. {
  94. text : "id",
  95. dataIndex : "id",
  96. xtype : "numbercolumn",
  97. hidden:true
  98. },{
  99. text : "物料id",
  100. dataIndex : "pd_prodid",
  101. xtype : "numbercolumn",
  102. hidden:true
  103. },
  104. {
  105. text : "物料编号",
  106. width : 150.0,
  107. dataIndex : "pd_prodcode",
  108. xtype : "",
  109. items : null,
  110. allowBlank : false,
  111. editor : {
  112. displayField : "display",
  113. editable : true,
  114. format : "",
  115. hideTrigger : false,
  116. maxLength : 100.0,
  117. minValue : null,
  118. positiveNum : false,
  119. queryMode : "local",
  120. store : null,
  121. valueField : "value",
  122. xtype : "productMultiDbfindTrigger"
  123. }
  124. },{
  125. text: 'model映射需要',
  126. dataIndex: 'productDTO',
  127. hidden: true,
  128. },
  129. {
  130. text : "名称",
  131. dataIndex : "pr_detail",
  132. width : 200.0,
  133. ignore:true,
  134. renderer: function (v, m, r) {
  135. if(!v){
  136. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  137. }
  138. return v;
  139. }
  140. },
  141. {
  142. text : "规格",
  143. dataIndex : "pr_spec",
  144. width : 150.0,
  145. ignore:true,
  146. renderer: function (v, m, r) {
  147. if(!v){
  148. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  149. }
  150. return v;
  151. }
  152. },
  153. {
  154. text : "数量",
  155. dataIndex : "pd_outqty",
  156. width : 110.0,
  157. xtype: 'numbercolumn',
  158. allowBlank : false,
  159. editor : {
  160. xtype : "numberfield",
  161. decimalPrecision: 3,
  162. minValue:0
  163. },
  164. renderer : function(v) {
  165. var arr = (v + '.').split('.');
  166. var xr = (new Array(arr[1].length > 3 ? 3 : 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 > 3 ? 3 : arr[1].length)).fill('0');
  174. var format = '0.' + xr.join();
  175. return Ext.util.Format.number(v, format);
  176. }
  177. },
  178. // {
  179. // text : "已转数",
  180. // dataIndex : "pd_yqty",
  181. // width : 120.0,
  182. // xtype : "numbercolumn",
  183. // format:'0',
  184. // items : null,
  185. // summaryType: 'sum'
  186. // },
  187. {
  188. text : "仓库id",
  189. dataIndex : "pd_whid",
  190. xtype : "numbercolumn",
  191. hidden:true
  192. },
  193. {
  194. text : "仓库编号",
  195. dataIndex : "pd_whcode",
  196. hidden:true
  197. },
  198. {
  199. text : "仓库",
  200. dataIndex : "pd_whname",
  201. width : 150.0,
  202. allowBlank : false,
  203. editor : {
  204. displayField : "display",
  205. editable : true,
  206. format : "",
  207. hideTrigger : false,
  208. maxLength : 100.0,
  209. minValue : null,
  210. positiveNum : false,
  211. queryMode : "local",
  212. store : null,
  213. valueField : "value",
  214. xtype : "warehouseDbfindTrigger"
  215. }
  216. },
  217. {
  218. text : "单价",
  219. xtype: 'numbercolumn',
  220. width : 110.0,
  221. editor : {
  222. xtype : "numberfield",
  223. decimalPrecision: 8,
  224. minValue:0
  225. },
  226. dataIndex : "pd_orderprice",
  227. width : 120.0,
  228. renderer : function(v) {
  229. var arr = (v + '.').split('.');
  230. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  231. var format = '0,000.' + xr.join();
  232. return Ext.util.Format.number(v, format);
  233. },
  234. },{
  235. text : "税率",
  236. xtype: 'numbercolumn',
  237. dataIndex : "pd_taxrate",
  238. width : 80.0,
  239. editor : {
  240. xtype : "numberfield",
  241. decimalPrecision: 0,
  242. minValue: 0,
  243. maxValue: 100
  244. },
  245. renderer : function(v) {
  246. return Ext.util.Format.number(v, '0');
  247. },
  248. },
  249. {
  250. text : "含税金额",
  251. xtype: 'numbercolumn',
  252. dataIndex : "pd_ordertotal",
  253. width : 110.0,
  254. // editor : {
  255. // xtype : "numberfield",
  256. // decimalPrecision: 2,
  257. // editable : false
  258. // },
  259. renderer : function(v) {
  260. var arr = (v + '.').split('.');
  261. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  262. var format = '0,000.' + xr.join();
  263. return Ext.util.Format.number(v, format);
  264. },
  265. summaryType: 'sum',
  266. summaryRenderer: function(v) {
  267. var arr = (v + '.').split('.');
  268. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  269. var format = '0,000.' + xr.join();
  270. return Ext.util.Format.number(v, format);
  271. }
  272. },
  273. {
  274. text : "未税金额",
  275. xtype: 'numbercolumn',
  276. dataIndex : "pd_nettotal",
  277. width : 110.0,
  278. // editor : {
  279. // xtype : "numberfield",
  280. // decimalPrecision: 2,
  281. // editable : false
  282. // },
  283. renderer : function(v) {
  284. var arr = (v + '.').split('.');
  285. var xr = (new Array(arr[1].length > 2 ? 2 : 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 > 2 ? 2 : 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. hidden:true
  301. },
  302. {
  303. text : "采购单号",
  304. dataIndex : "pd_ordercode",
  305. width : 150.0
  306. },{
  307. text : "采购序号",
  308. dataIndex : "pd_orderdetno",
  309. xtype : "numbercolumn",
  310. width : 110.0,
  311. renderer: function(v) {
  312. if(v) {
  313. return Ext.util.Format.number(v, '0');
  314. }else {
  315. return null;
  316. }
  317. }
  318. },{
  319. text : "备注",
  320. dataIndex : "pd_remark",
  321. width : 250,
  322. items : null,
  323. editor : {
  324. xtype : "textfield"
  325. },
  326. }
  327. ]
  328. },{
  329. xtype : "textfield",
  330. name : "pi_remark",
  331. fieldLabel : "备注",
  332. columnWidth : 1
  333. },
  334. {
  335. xtype : "hidden",
  336. name : "creatorId",
  337. fieldLabel : "录入人ID",
  338. readOnly:true
  339. },
  340. {
  341. xtype : "textfield",
  342. name : "creatorName",
  343. fieldLabel : "录入人",
  344. readOnly:true
  345. }, {
  346. xtype : "datefield",
  347. name : "createTime",
  348. fieldLabel : "录入日期",
  349. readOnly:true,
  350. defaultValue: new Date()
  351. },{
  352. xtype : "hidden",
  353. name : "updaterId",
  354. fieldLabel : "更新人ID",
  355. readOnly:true
  356. },{
  357. xtype : "hidden",
  358. name : "updaterName",
  359. fieldLabel : "更新人",
  360. readOnly:true
  361. }, {
  362. xtype : "hidden",
  363. name : "updateTime",
  364. fieldLabel : "更新日期",
  365. readOnly:true,
  366. defaultValue: new Date()
  367. }, {
  368. xtype : "textfield",
  369. name : "pi_auditman",
  370. fieldLabel : "审核人",
  371. readOnly:true
  372. }, {
  373. xtype : "datefield",
  374. name : "pi_auditdate",
  375. fieldLabel : "审核日期",
  376. readOnly:true
  377. }]
  378. });