FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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: true,
  72. },
  73. supFieldConfig: {
  74. xtype: 'numberfield',
  75. readOnly: false,
  76. defaultReadOnly: false,
  77. defaultValue: 1,
  78. decimalPrecision: 6,
  79. vtype: 'positiveNumber',
  80. listeners: {
  81. change: function(f, v) {
  82. var defaultCurrency = Ext.getCmp('mainView').getViewModel().get('defaultCurrency');
  83. f.setReadOnly(f.ownerCt.items.items[0].value == defaultCurrency);
  84. }
  85. }
  86. }
  87. // },{
  88. // xtype: "currencyDbfindTrigger",
  89. // name: "os_currency",
  90. // fieldLabel: "币别",
  91. // defaultValue: 'RMB'
  92. // }, {
  93. // xtype: "numberfield",
  94. // name: "os_rate",
  95. // fieldLabel: "汇率",
  96. // defaultValue: 1,
  97. // decimalPrecision: 6,
  98. // vtype: 'positiveNumber'
  99. }, {
  100. xtype: 'datefield',
  101. name: 'os_date',
  102. fieldLabel: '单据日期',
  103. defaultValue: new Date(),
  104. allowBlank: false
  105. }, {
  106. name: "detailGridField",
  107. xtype: "detailGridField",
  108. storeModel: 'saas.model.money.Othspendings',
  109. detnoColumn: 'osd_detno',
  110. deleteDetailUrl: '/api/money/othspendings/deleteDetail',
  111. columns: [{
  112. text: "id",
  113. dataIndex: "id",
  114. xtype: "numbercolumn",
  115. hidden: true
  116. }, {
  117. text: "期间",
  118. dataIndex: "osd_ym",
  119. editor: {
  120. xtype: "numberfield",
  121. readOnly: true
  122. },
  123. // defaultValue: Ext.Date.format(new Date(), 'Ym'),
  124. width: 110.0,
  125. hidden: true,
  126. items: null
  127. }, {
  128. text: "支出类别",
  129. width: 150.0,
  130. dataIndex: "osd_type",
  131. items: null,
  132. allowBlank: false,
  133. hiddenBtn: false, //true 则会关闭新增按钮功能
  134. editor: {
  135. xtype: "remotecombo",
  136. storeUrl: '/api/document/fundinouttype/getCombo?condition=支出',
  137. addHandler: function (b) {
  138. var document = Ext.create('saas.view.document.kind.Kind', {});
  139. var form = this.ownerCmp.ownerCt.ownerCmp.ownerCt;
  140. this.dialog = form.getController().getView().add({
  141. xtype: 'document-kind-childwin',
  142. bind: {
  143. title: '新增支出类别'
  144. },
  145. dataKind: 'inoutkind',
  146. belong: document.etc['inoutkind'],
  147. _parent: form,
  148. _combo: this.ownerCmp,
  149. record: null,
  150. session: true
  151. });
  152. this.dialog.show();
  153. }
  154. }
  155. }, {
  156. text: "金额(元)",
  157. xtype: 'numbercolumn',
  158. dataIndex: "osd_nowbalance",
  159. width: 110.0,
  160. allowBlank: false,
  161. editor: {
  162. xtype: "numberfield",
  163. decimalPrecision: 2
  164. },
  165. renderer: function(v, m, r) {
  166. return saas.util.BaseUtil.numberFormat(v, 2, true);
  167. },
  168. summaryType: 'sum',
  169. summaryRenderer: function(v, d, f, m) {
  170. return saas.util.BaseUtil.numberFormat(v, 2, true);
  171. }
  172. }, {
  173. text: "备注",
  174. dataIndex: "osd_remark",
  175. width: 250,
  176. editor: {
  177. xtype: "textfield"
  178. },
  179. }, {
  180. dataIndex: "osd_text1",
  181. text: "自定义字段1",
  182. width: 100,
  183. hidden: true,
  184. initHidden: false,
  185. editor: {
  186. xtype: "textfield"
  187. },
  188. }, {
  189. dataIndex: "osd_text2",
  190. text: "自定义字段2",
  191. width: 100,
  192. hidden: true,
  193. initHidden: false,
  194. editor: {
  195. xtype: "textfield"
  196. },
  197. }, {
  198. dataIndex: "osd_text3",
  199. text: "自定义字段3",
  200. width: 100,
  201. hidden: true,
  202. initHidden: false,
  203. editor: {
  204. xtype: "textfield"
  205. },
  206. }, {
  207. dataIndex: "osd_text4",
  208. text: "自定义字段4",
  209. width: 100,
  210. hidden: true,
  211. initHidden: false,
  212. editor: {
  213. xtype: "textfield"
  214. },
  215. }, {
  216. dataIndex: "osd_text5",
  217. text: "自定义字段5",
  218. width: 100,
  219. hidden: true,
  220. initHidden: false,
  221. editor: {
  222. xtype: "textfield"
  223. },
  224. }]
  225. }, {
  226. xtype: 'numberfield',
  227. name: 'os_amount',
  228. fieldLabel: '付款金额(元)',
  229. readOnly: true
  230. }, {
  231. xtype: "textfield",
  232. name: "os_remark",
  233. fieldLabel: "备注",
  234. allowBlank: true,
  235. columnWidth: 0.75
  236. }, {
  237. xtype: "hidden",
  238. name: "creatorId",
  239. fieldLabel: "录入人ID",
  240. readOnly: true
  241. }, {
  242. xtype: "textfield",
  243. name: "creatorName",
  244. fieldLabel: "录入人",
  245. readOnly: true
  246. }, {
  247. xtype: "datefield",
  248. name: "createTime",
  249. fieldLabel: "录入日期",
  250. readOnly: true,
  251. defaultValue: new Date()
  252. }, {
  253. xtype: "hidden",
  254. name: "updaterId",
  255. fieldLabel: "更新人ID",
  256. readOnly: true
  257. }, {
  258. xtype: "hidden",
  259. name: "updaterName",
  260. fieldLabel: "更新人",
  261. readOnly: true
  262. }, {
  263. xtype: "hidden",
  264. name: "updateTime",
  265. fieldLabel: "更新日期",
  266. readOnly: true,
  267. defaultValue: new Date()
  268. }, {
  269. xtype: 'textfield',
  270. name: 'os_auditman',
  271. fieldLabel: '审核人',
  272. readOnly: true
  273. }, {
  274. xtype: "datefield",
  275. name: "os_auditdate",
  276. fieldLabel: "审核日期",
  277. readOnly: true
  278. }, {
  279. xtype: "textfield",
  280. name: "os_text1",
  281. fieldLabel: "自定义字段1",
  282. hidden: true,
  283. initHidden: false
  284. }, {
  285. xtype: "textfield",
  286. name: "os_text2",
  287. fieldLabel: "自定义字段2",
  288. hidden: true,
  289. initHidden: false
  290. }, {
  291. xtype: "textfield",
  292. name: "os_text3",
  293. fieldLabel: "自定义字段3",
  294. hidden: true,
  295. initHidden: false
  296. }, {
  297. xtype: "textfield",
  298. name: "os_text4",
  299. fieldLabel: "自定义字段4",
  300. hidden: true,
  301. initHidden: false
  302. }, {
  303. xtype: "textfield",
  304. name: "os_text5",
  305. fieldLabel: "自定义字段5",
  306. hidden: true,
  307. initHidden: false
  308. }]
  309. });
  310. this.callParent(arguments);
  311. },
  312. });