FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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:'http://localhost:8800/prodinout/deleteDetail/',
  89. deleteDetailUrl:'/api/purchase/prodinout/deleteDetail/',
  90. detnoColumn: 'pd_pdno',
  91. columns : [
  92. {
  93. text : "id",
  94. dataIndex : "id",
  95. xtype : "numbercolumn",
  96. hidden:true
  97. },{
  98. text : "物料id",
  99. dataIndex : "pd_prodid",
  100. xtype : "numbercolumn",
  101. hidden:true
  102. },
  103. {
  104. text : "物料编号",
  105. width : 200.0,
  106. dataIndex : "pd_prodcode",
  107. xtype : "",
  108. items : null,
  109. allowBlank : false,
  110. editor : {
  111. displayField : "display",
  112. editable : true,
  113. format : "",
  114. hideTrigger : false,
  115. maxLength : 100.0,
  116. minValue : null,
  117. positiveNum : false,
  118. queryMode : "local",
  119. store : null,
  120. valueField : "value",
  121. xtype : "productMultiDbfindTrigger"
  122. }
  123. },{
  124. text: 'model映射需要',
  125. dataIndex: 'productDTO',
  126. hidden: true,
  127. },
  128. {
  129. text : "名称",
  130. dataIndex : "pr_detail",
  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. 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. dataIndex : "pd_outqty",
  153. xtype: 'numbercolumn',
  154. allowBlank : false,
  155. editor : {
  156. xtype : "numberfield",
  157. decimalPrecision: 3,
  158. minValue:0
  159. },
  160. renderer : function(v) {
  161. var arr = (v + '.').split('.');
  162. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  163. var format = '0.' + xr.join();
  164. return Ext.util.Format.number(v, format);
  165. },
  166. summaryType: 'sum',
  167. summaryRenderer: function(v) {
  168. var arr = (v + '.').split('.');
  169. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  170. var format = '0.' + xr.join();
  171. return Ext.util.Format.number(v, format);
  172. }
  173. },
  174. // {
  175. // text : "已转数",
  176. // dataIndex : "pd_yqty",
  177. // width : 120.0,
  178. // xtype : "numbercolumn",
  179. // format:'0',
  180. // items : null,
  181. // summaryType: 'sum'
  182. // },
  183. {
  184. text : "仓库id",
  185. dataIndex : "pd_whid",
  186. xtype : "numbercolumn",
  187. hidden:true
  188. },
  189. {
  190. text : "仓库编号",
  191. dataIndex : "pd_whcode",
  192. hidden:true
  193. },
  194. {
  195. text : "仓库",
  196. dataIndex : "pd_whname",
  197. width : 120.0,
  198. allowBlank : false,
  199. editor : {
  200. displayField : "display",
  201. editable : true,
  202. format : "",
  203. hideTrigger : false,
  204. maxLength : 100.0,
  205. minValue : null,
  206. positiveNum : false,
  207. queryMode : "local",
  208. store : null,
  209. valueField : "value",
  210. xtype : "warehouseDbfindTrigger"
  211. }
  212. },
  213. {
  214. text : "单价",
  215. xtype: 'numbercolumn',
  216. editor : {
  217. xtype : "numberfield",
  218. decimalPrecision: 8,
  219. minValue:0
  220. },
  221. dataIndex : "pd_orderprice",
  222. width : 120.0,
  223. renderer : function(v) {
  224. var arr = (v + '.').split('.');
  225. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  226. var format = '0,000.' + xr.join();
  227. return Ext.util.Format.number(v, format);
  228. },
  229. },{
  230. text : "税率",
  231. xtype: 'numbercolumn',
  232. dataIndex : "pd_taxrate",
  233. width : 120.0,
  234. editor : {
  235. xtype : "numberfield",
  236. decimalPrecision: 0,
  237. minValue: 0,
  238. maxValue: 100
  239. },
  240. renderer : function(v) {
  241. return Ext.util.Format.number(v, '0');
  242. },
  243. },
  244. {
  245. text : "含税金额",
  246. xtype: 'numbercolumn',
  247. dataIndex : "pd_total",
  248. width : 120.0,
  249. editor : {
  250. xtype : "numberfield",
  251. decimalPrecision: 2,
  252. editable : false
  253. },
  254. renderer : function(v) {
  255. var arr = (v + '.').split('.');
  256. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  257. var format = '0,000.' + xr.join();
  258. return Ext.util.Format.number(v, format);
  259. },
  260. summaryType: 'sum',
  261. summaryRenderer: 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. },
  268. {
  269. text : "未税金额",
  270. xtype: 'numbercolumn',
  271. dataIndex : "pd_nettotal",
  272. editor : {
  273. xtype : "numberfield",
  274. decimalPrecision: 2,
  275. editable : false
  276. },
  277. renderer : function(v) {
  278. var arr = (v + '.').split('.');
  279. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  280. var format = '0,000.' + xr.join();
  281. return Ext.util.Format.number(v, format);
  282. },
  283. summaryType: 'sum',
  284. summaryRenderer: function(v) {
  285. var arr = (v + '.').split('.');
  286. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  287. var format = '0,000.' + xr.join();
  288. return Ext.util.Format.number(v, format);
  289. }
  290. },
  291. {
  292. text : "采购单明细id",
  293. dataIndex : "pd_orderid",
  294. width : 120.0,
  295. hidden:true
  296. },
  297. {
  298. text : "采购单号",
  299. dataIndex : "pd_ordercode",
  300. width : 120.0
  301. },{
  302. text : "采购序号",
  303. dataIndex : "pd_orderdetno",
  304. xtype : "numbercolumn",
  305. format: '0000',
  306. renderer: function(v) {
  307. return v ? v : null;
  308. }
  309. },{
  310. text : "备注",
  311. dataIndex : "pd_remark",
  312. width : 250,
  313. items : null,
  314. editor : {
  315. xtype : "textfield"
  316. },
  317. }
  318. ]
  319. },{
  320. xtype : "textfield",
  321. name : "pi_remark",
  322. fieldLabel : "备注",
  323. columnWidth : 1
  324. },
  325. {
  326. xtype : "hidden",
  327. name : "creatorId",
  328. fieldLabel : "录入人ID",
  329. readOnly:true
  330. },
  331. {
  332. xtype : "textfield",
  333. name : "creatorName",
  334. fieldLabel : "录入人",
  335. readOnly:true
  336. }, {
  337. xtype : "datefield",
  338. name : "createTime",
  339. fieldLabel : "录入日期",
  340. readOnly:true,
  341. defaultValue: new Date()
  342. },{
  343. xtype : "hidden",
  344. name : "updaterId",
  345. fieldLabel : "更新人ID",
  346. readOnly:true
  347. },{
  348. xtype : "hidden",
  349. name : "updaterName",
  350. fieldLabel : "更新人",
  351. readOnly:true
  352. }, {
  353. xtype : "hidden",
  354. name : "updateTime",
  355. fieldLabel : "更新日期",
  356. readOnly:true,
  357. defaultValue: new Date()
  358. }, {
  359. xtype : "textfield",
  360. name : "pi_auditman",
  361. fieldLabel : "审核人",
  362. readOnly:true
  363. }, {
  364. xtype : "datefield",
  365. name : "pi_auditdate",
  366. fieldLabel : "审核日期",
  367. readOnly:true
  368. }]
  369. });