FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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. _auditmanField: 'os_auditman',
  15. _auditdateField: 'os_auditdate',
  16. _relationColumn: 'osd_osid',
  17. _readUrl: '/api/money/othspendings/read',
  18. _saveUrl: '/api/money/othspendings/save',
  19. _auditUrl: '/api/money/othspendings/audit',
  20. _unAuditUrl: '/api/money/othspendings/unAudit',
  21. _deleteUrl: '/api/money/othspendings/delete',
  22. initId: 0,
  23. initComponent: function () {
  24. Ext.apply(this, {
  25. defaultItems: [{
  26. xtype: 'hidden',
  27. name: 'id',
  28. fieldLabel: 'id'
  29. }, {
  30. xtype: 'hidden',
  31. name: 'os_vendid',
  32. fieldLabel: '供应商ID'
  33. }, {
  34. xtype: 'hidden',
  35. name: 'os_vendcode',
  36. fieldLabel: '供应商编号'
  37. }, {
  38. xtype: "vendorDbfindTrigger",
  39. name: "os_vendname",
  40. fieldLabel: "供应商名称",
  41. // allowBlank : false
  42. }, {
  43. xtype: 'hidden',
  44. name: 'os_bankid',
  45. fieldLabel: '结算账户ID'
  46. }, {
  47. xtype: 'hidden',
  48. name: 'os_bankcode',
  49. fieldLabel: '结算账户编号'
  50. }, {
  51. xtype: "bandinfoDbfindTrigger",
  52. name: "os_bankname",
  53. fieldLabel: "账户名称",
  54. allowBlank: false
  55. }, {
  56. xtype: 'condbfindtrigger',
  57. fieldLabel: '币别汇率',
  58. allowBlank: false,
  59. dbType: 'currencyDbfindTrigger',
  60. dbfinds: [{
  61. from: 'cr_name', to: 'os_currency'
  62. }, {
  63. from: 'cr_rate', to: 'os_rate'
  64. }],
  65. // defaultValue: {
  66. // os_currency: 'RMB',
  67. // os_rate: 1
  68. // },
  69. mainFieldConfig: {
  70. readOnly: true,
  71. defaultReadOnly: false,
  72. },
  73. supFieldConfig: {
  74. xtype: 'numberfield',
  75. readOnly: false,
  76. defaultReadOnly: false,
  77. defaultValue: 1,
  78. decimalPrecision: 6,
  79. vtype: 'positiveNumber'
  80. }
  81. // },{
  82. // xtype: "currencyDbfindTrigger",
  83. // name: "os_currency",
  84. // fieldLabel: "币别",
  85. // defaultValue: 'RMB'
  86. // }, {
  87. // xtype: "numberfield",
  88. // name: "os_rate",
  89. // fieldLabel: "汇率",
  90. // defaultValue: 1,
  91. // decimalPrecision: 6,
  92. // vtype: 'positiveNumber'
  93. }, {
  94. xtype: 'datefield',
  95. name: 'os_date',
  96. fieldLabel: '单据日期',
  97. defaultValue: new Date(),
  98. allowBlank: false
  99. }, {
  100. name: "detailGridField",
  101. xtype: "detailGridField",
  102. storeModel: 'saas.model.money.Othspendings',
  103. detnoColumn: 'osd_detno',
  104. deleteDetailUrl: '/api/money/othspendings/deleteDetail',
  105. columns: [{
  106. text: "id",
  107. dataIndex: "id",
  108. xtype: "numbercolumn",
  109. hidden: true
  110. }, {
  111. text: "期间",
  112. dataIndex: "osd_ym",
  113. editor: {
  114. xtype: "numberfield",
  115. readOnly: true
  116. },
  117. // defaultValue: Ext.Date.format(new Date(), 'Ym'),
  118. width: 110.0,
  119. hidden: true,
  120. items: null
  121. }, {
  122. text: "支出类别",
  123. width: 150.0,
  124. dataIndex: "osd_type",
  125. items: null,
  126. allowBlank: false,
  127. hiddenBtn: false, //true 则会关闭新增按钮功能
  128. editor: {
  129. xtype: "remotecombo",
  130. storeUrl: '/api/document/fundinouttype/getCombo?condition=支出',
  131. addHandler: function (b) {
  132. var document = Ext.create('saas.view.document.kind.Kind', {});
  133. var form = this.ownerCmp.ownerCt.ownerCmp.ownerCt;
  134. this.dialog = form.getController().getView().add({
  135. xtype: 'document-kind-childwin',
  136. bind: {
  137. title: '新增支出类别'
  138. },
  139. dataKind: 'inoutkind',
  140. belong: document.etc['inoutkind'],
  141. _parent: form,
  142. _combo: this.ownerCmp,
  143. record: null,
  144. session: true
  145. });
  146. this.dialog.show();
  147. }
  148. }
  149. }, {
  150. text: "金额(元)",
  151. xtype: 'numbercolumn',
  152. dataIndex: "osd_nowbalance",
  153. width: 110.0,
  154. allowBlank: false,
  155. editor: {
  156. xtype: "numberfield",
  157. decimalPrecision: 2
  158. },
  159. renderer: function(v, m, r) {
  160. return saas.util.BaseUtil.numberFormat(v, 2, true);
  161. },
  162. summaryType: 'sum',
  163. summaryRenderer: function(v, d, f, m) {
  164. return saas.util.BaseUtil.numberFormat(v, 2, true);
  165. }
  166. }, {
  167. text: "备注",
  168. dataIndex: "osd_remark",
  169. width: 250,
  170. editor: {
  171. xtype: "textfield"
  172. },
  173. }, {
  174. dataIndex: "osd_text1",
  175. text: "自定义字段1",
  176. width: 100,
  177. hidden: true,
  178. initHidden: false,
  179. editor: {
  180. xtype: "textfield"
  181. },
  182. }, {
  183. dataIndex: "osd_text2",
  184. text: "自定义字段2",
  185. width: 100,
  186. hidden: true,
  187. initHidden: false,
  188. editor: {
  189. xtype: "textfield"
  190. },
  191. }, {
  192. dataIndex: "osd_text3",
  193. text: "自定义字段3",
  194. width: 100,
  195. hidden: true,
  196. initHidden: false,
  197. editor: {
  198. xtype: "textfield"
  199. },
  200. }, {
  201. dataIndex: "osd_text4",
  202. text: "自定义字段4",
  203. width: 100,
  204. hidden: true,
  205. initHidden: false,
  206. editor: {
  207. xtype: "textfield"
  208. },
  209. }, {
  210. dataIndex: "osd_text5",
  211. text: "自定义字段5",
  212. width: 100,
  213. hidden: true,
  214. initHidden: false,
  215. editor: {
  216. xtype: "textfield"
  217. },
  218. }]
  219. }, {
  220. xtype: 'numberfield',
  221. name: 'os_amount',
  222. fieldLabel: '付款金额(元)',
  223. readOnly: true
  224. }, {
  225. xtype: "textfield",
  226. name: "os_remark",
  227. fieldLabel: "备注",
  228. allowBlank: true,
  229. columnWidth: 0.75
  230. }, {
  231. xtype: "hidden",
  232. name: "creatorId",
  233. fieldLabel: "录入人ID",
  234. readOnly: true
  235. }, {
  236. xtype: "textfield",
  237. name: "creatorName",
  238. fieldLabel: "录入人",
  239. readOnly: true
  240. }, {
  241. xtype: "datefield",
  242. name: "createTime",
  243. fieldLabel: "录入日期",
  244. readOnly: true,
  245. defaultValue: new Date()
  246. }, {
  247. xtype: "hidden",
  248. name: "updaterId",
  249. fieldLabel: "更新人ID",
  250. readOnly: true
  251. }, {
  252. xtype: "hidden",
  253. name: "updaterName",
  254. fieldLabel: "更新人",
  255. readOnly: true
  256. }, {
  257. xtype: "hidden",
  258. name: "updateTime",
  259. fieldLabel: "更新日期",
  260. readOnly: true,
  261. defaultValue: new Date()
  262. }, {
  263. xtype: 'textfield',
  264. name: 'os_auditman',
  265. fieldLabel: '审核人',
  266. readOnly: true
  267. }, {
  268. xtype: "datefield",
  269. name: "os_auditdate",
  270. fieldLabel: "审核日期",
  271. readOnly: true
  272. }, {
  273. xtype: "textfield",
  274. name: "os_text1",
  275. fieldLabel: "自定义字段1",
  276. hidden: true,
  277. initHidden: false
  278. }, {
  279. xtype: "textfield",
  280. name: "os_text2",
  281. fieldLabel: "自定义字段2",
  282. hidden: true,
  283. initHidden: false
  284. }, {
  285. xtype: "textfield",
  286. name: "os_text3",
  287. fieldLabel: "自定义字段3",
  288. hidden: true,
  289. initHidden: false
  290. }, {
  291. xtype: "textfield",
  292. name: "os_text4",
  293. fieldLabel: "自定义字段4",
  294. hidden: true,
  295. initHidden: false
  296. }, {
  297. xtype: "textfield",
  298. name: "os_text5",
  299. fieldLabel: "自定义字段5",
  300. hidden: true,
  301. initHidden: false
  302. }]
  303. });
  304. this.callParent(arguments);
  305. },
  306. });