FormPanel.js 12 KB

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