FormPanel.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. Ext.define('saas.view.money.othspendings.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'money-othspendings-formpanel',
  4. controller: 'money-othspendings-formpanel',
  5. viewModel: 'money-othspendings-formpanel',
  6. viewName: 'money-othspendings-formpanel',
  7. caller:'OthSpendings',
  8. //字段属性
  9. _title:'其它支出单',
  10. _idField: 'id',
  11. _codeField: 'os_code',
  12. _statusField: 'os_status',
  13. _statusCodeField: 'os_statuscode',
  14. _relationColumn: 'osd_osid',
  15. _readUrl:'/api/money/othspendings/read/',
  16. _saveUrl:'/api/money/othspendings/save/',
  17. _auditUrl:'/api/money/othspendings/audit/',
  18. _unAuditUrl: '/api/money/othspendings/unAudit/',
  19. _deleteUrl:'/api/money/othspendings/delete/',
  20. initId:0,
  21. defaultItems: [{
  22. xtype: 'hidden',
  23. name: 'id',
  24. fieldLabel: 'id'
  25. }, {
  26. xtype : 'hidden',
  27. name : 'os_vendid',
  28. fieldLabel : '供应商ID'
  29. }, {
  30. xtype : 'hidden',
  31. name : 'os_vendcode',
  32. fieldLabel : '供应商编号'
  33. }, {
  34. xtype : "dbfindtrigger",
  35. name : "os_vendname",
  36. fieldLabel : "供应商名称",
  37. allowBlank : false
  38. }, {
  39. xtype : 'hidden',
  40. name : 'os_bankid',
  41. fieldLabel : '结算账户ID'
  42. }, {
  43. xtype : 'hidden',
  44. name : 'os_bankcode',
  45. fieldLabel : '结算账户编号'
  46. }, {
  47. xtype : "dbfindtrigger",
  48. name : "os_bankname",
  49. fieldLabel : "账户名称",
  50. allowBlank : false
  51. }, {
  52. xtype:'datefield',
  53. name : 'os_date',
  54. fieldLabel : '单据日期',
  55. defaultValue: new Date(),
  56. allowBlank : false
  57. },{
  58. name : "detailGridField",
  59. xtype : "detailGridField",
  60. storeModel:'saas.model.money.Othspendings',
  61. detnoColumn: 'osd_detno',
  62. deleteDetailUrl:'/api/money/othspendings/deleteDetail/',
  63. columnWidth : 1,
  64. columns : [
  65. {
  66. text : "id",
  67. dataIndex : "id",
  68. xtype : "numbercolumn",
  69. width:0
  70. }, {
  71. text : "期间",
  72. dataIndex : "osd_ym",
  73. editor : {
  74. xtype : "numberfield",
  75. readOnly:true
  76. },
  77. // defaultValue: Ext.Date.format(new Date(), 'Ym'),
  78. width : 120.0,
  79. hidden: true,
  80. items : null
  81. }, {
  82. text : "支出类别",
  83. width : 200.0,
  84. dataIndex : "osd_type",
  85. items : null,
  86. editor : {
  87. xtype : "remotecombo",
  88. storeUrl:'/api/document/fundinouttype/getCombo?condition=支出',
  89. addHandler:function(b){
  90. var document = Ext.create('saas.view.document.kind.Kind',{});
  91. var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
  92. this.dialog = form.getController().getView().add({
  93. xtype: 'document-kind-childwin',
  94. bind: {
  95. title: '新增收入类别'
  96. },
  97. dataKind:'inoutkind',
  98. belong:document.etc['inoutkind'],
  99. _parent:form,
  100. _combo:this.ownerCmp,
  101. record:null,
  102. session: true
  103. });
  104. this.dialog.show();
  105. }
  106. }
  107. }, {
  108. text : "金额",
  109. xtype: 'numbercolumn',
  110. dataIndex : "osd_nowbalance",
  111. width : 120.0,
  112. editor : {
  113. xtype : "numberfield",
  114. decimalPrecision: 2
  115. },
  116. renderer : function(v) {
  117. var arr = (v + '.').split('.');
  118. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  119. var format = '0,000.' + xr.join();
  120. return Ext.util.Format.number(v, format);
  121. },
  122. summaryType: 'sum',
  123. summaryRenderer: function(v) {
  124. var arr = (v + '.').split('.');
  125. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  126. var format = '0,000.' + xr.join();
  127. return Ext.util.Format.number(v, format);
  128. }
  129. }, {
  130. text : "备注",
  131. dataIndex : "osd_remark",
  132. width : 250,
  133. editor : {
  134. xtype : "textfield"
  135. },
  136. }
  137. ]
  138. },{
  139. xtype : 'numberfield',
  140. name : 'os_amount',
  141. fieldLabel : '付款金额',
  142. readOnly:true
  143. },{
  144. xtype : "textfield",
  145. name : "os_remark",
  146. fieldLabel : "备注",
  147. allowBlank : true,
  148. columnWidth : 0.75
  149. }, {
  150. xtype : "textfield",
  151. name : "os_recorder",
  152. fieldLabel : "录入人",
  153. readOnly:true
  154. }, {
  155. xtype : "datefield",
  156. name : "os_recorddate",
  157. fieldLabel : "录入日期",
  158. readOnly:true
  159. },{
  160. xtype: 'textfield',
  161. name: 'os_auditman',
  162. fieldLabel: '审核人',
  163. readOnly:true
  164. },{
  165. xtype: "datefield",
  166. name: "os_auditdate",
  167. fieldLabel: "审核日期",
  168. readOnly:true
  169. }]
  170. });