FormPanel.js 12 KB

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