FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. Ext.define('saas.view.money.othreceipts.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'money-othreceipts-formpanel',
  4. controller: 'money-othreceipts-formpanel',
  5. viewModel: 'money-othreceipts-formpanel',
  6. viewName: 'money-othreceipts-formpanel',
  7. caller: 'OthReceipts',
  8. //字段属性
  9. _title: '其它收入单',
  10. _idField: 'id',
  11. _codeField: 'or_code',
  12. _statusField: 'or_status',
  13. _statusCodeField: 'or_statuscode',
  14. _auditmanField: 'or_auditman',
  15. _auditdateField: 'or_auditdate',
  16. _relationColumn: 'ord_orid',
  17. _readUrl: '/api/money/othreceipts/read',
  18. _saveUrl: '/api/money/othreceipts/save',
  19. _auditUrl: '/api/money/othreceipts/audit',
  20. _unAuditUrl: '/api/money/othreceipts/unAudit',
  21. _deleteUrl: '/api/money/othreceipts/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: 'or_custid',
  32. fieldLabel: '客户ID'
  33. }, {
  34. xtype: 'hidden',
  35. name: 'or_custcode',
  36. fieldLabel: '客户编号'
  37. }, {
  38. xtype: "customerDbfindTrigger",
  39. name: "or_custname",
  40. fieldLabel: "客户名称",
  41. // allowBlank : false
  42. }, {
  43. xtype: 'hidden',
  44. name: 'or_bankid',
  45. fieldLabel: '账户ID'
  46. }, {
  47. xtype: 'hidden',
  48. name: 'or_bankcode',
  49. fieldLabel: '账户编号'
  50. }, {
  51. xtype: "bandinfoDbfindTrigger",
  52. name: "or_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: 'or_currency'
  62. }, {
  63. from: 'cr_rate', to: 'or_rate'
  64. }],
  65. // defaultValue: {
  66. // or_currency: 'RMB',
  67. // or_rate: 1
  68. // },
  69. mainFieldConfig: {
  70. readOnly: true,
  71. defaultReadOnly: true,
  72. },
  73. supFieldConfig: {
  74. xtype: 'numberfield',
  75. readOnly: false,
  76. defaultReadOnly: false,
  77. decimalPrecision: 6,
  78. vtype: 'positiveNumber',
  79. listeners: {
  80. change: function(f, v) {
  81. var defaultCurrency = Ext.getCmp('mainView').getViewModel().get('defaultCurrency');
  82. f.setReadOnly(f.ownerCt.items.items[0].value == defaultCurrency);
  83. }
  84. }
  85. },
  86. // }, {
  87. // xtype: "currencyDbfindTrigger",
  88. // name: "or_currency",
  89. // fieldLabel: "币别",
  90. // defaultValue: 'RMB'
  91. // }, {
  92. // xtype: "numberfield",
  93. // name: "or_rate",
  94. // fieldLabel: "汇率",
  95. // defaultValue: 1,
  96. // decimalPrecision: 6,
  97. // vtype: 'positiveNumber'
  98. },{
  99. xtype: 'datefield',
  100. name: 'or_date',
  101. fieldLabel: '单据日期',
  102. defaultValue: new Date(),
  103. allowBlank: false
  104. }, {
  105. name: "detailGridField",
  106. xtype: "detailGridField",
  107. storeModel: 'saas.model.money.Othreceipts',
  108. detnoColumn: 'ord_detno',
  109. deleteDetailUrl: '/api/money/othreceipts/deleteDetail',
  110. columns: [{
  111. text: "id",
  112. dataIndex: "id",
  113. xtype: "numbercolumn",
  114. hidden: true,
  115. }, {
  116. text: "期间",
  117. dataIndex: "ord_ym",
  118. editor: {
  119. xtype: "numberfield",
  120. readOnly: true
  121. },
  122. // defaultValue: Ext.Date.format(new Date(), 'Ym'),
  123. width: 110.0,
  124. hidden: true,
  125. items: null
  126. }, {
  127. text: "收入类别",
  128. width: 150.0,
  129. dataIndex: "ord_type",
  130. items: null,
  131. allowBlank: false,
  132. hiddenBtn: false, //true 则会关闭新增按钮功能
  133. editor: {
  134. xtype: "remotecombo",
  135. storeUrl: '/api/document/fundinouttype/getCombo?condition=收入',
  136. addHandler: function (b) {
  137. var document = Ext.create('saas.view.document.kind.Kind', {});
  138. var form = this.ownerCmp.ownerCt.ownerCmp.ownerCt;
  139. this.dialog = form.getController().getView().add({
  140. xtype: 'document-kind-childwin',
  141. bind: {
  142. title: '新增收入类别'
  143. },
  144. dataKind: 'inoutkind',
  145. belong: document.etc['inoutkind'],
  146. _parent: form,
  147. _combo: this.ownerCmp,
  148. record: null,
  149. session: true
  150. });
  151. this.dialog.show();
  152. }
  153. }
  154. },{
  155. text: "金额(元)",
  156. xtype: 'numbercolumn',
  157. dataIndex: "ord_nowbalance",
  158. width: 110.0,
  159. allowBlank: false,
  160. editor: {
  161. xtype: "numberfield",
  162. decimalPrecision: 2
  163. },
  164. renderer: function (v, m, r) {
  165. return saas.util.BaseUtil.numberFormat(v, 2, true);
  166. },
  167. summaryType: 'sum',
  168. summaryRenderer: function(v, d, f, m) {
  169. return saas.util.BaseUtil.numberFormat(v, 2, true);
  170. }
  171. }, {
  172. text: "备注",
  173. dataIndex: "ord_remark",
  174. width: 250,
  175. editor: {
  176. xtype: "textfield"
  177. }
  178. }, {
  179. dataIndex: "ord_text1",
  180. text: "自定义字段1",
  181. width: 100,
  182. hidden: true,
  183. initHidden: false,
  184. editor: {
  185. xtype: "textfield"
  186. },
  187. }, {
  188. dataIndex: "ord_text2",
  189. text: "自定义字段2",
  190. width: 100,
  191. hidden: true,
  192. initHidden: false,
  193. editor: {
  194. xtype: "textfield"
  195. },
  196. }, {
  197. dataIndex: "ord_text3",
  198. text: "自定义字段3",
  199. width: 100,
  200. hidden: true,
  201. initHidden: false,
  202. editor: {
  203. xtype: "textfield"
  204. },
  205. }, {
  206. dataIndex: "ord_text4",
  207. text: "自定义字段4",
  208. width: 100,
  209. hidden: true,
  210. initHidden: false,
  211. editor: {
  212. xtype: "textfield"
  213. },
  214. }, {
  215. dataIndex: "ord_text5",
  216. text: "自定义字段5",
  217. width: 100,
  218. hidden: true,
  219. initHidden: false,
  220. editor: {
  221. xtype: "textfield"
  222. },
  223. }]
  224. }, {
  225. xtype: "numberfield",
  226. name: "or_amount",
  227. fieldLabel: "收款金额(元)",
  228. readOnly: true
  229. }, {
  230. xtype: "textfield",
  231. name: "or_remark",
  232. fieldLabel: "备注",
  233. allowBlank: true,
  234. columnWidth: 0.75
  235. }, {
  236. xtype: "hidden",
  237. name: "creatorId",
  238. fieldLabel: "录入人ID",
  239. readOnly: true
  240. }, {
  241. xtype: "textfield",
  242. name: "creatorName",
  243. fieldLabel: "录入人",
  244. readOnly: true
  245. }, {
  246. xtype: "datefield",
  247. name: "createTime",
  248. fieldLabel: "录入日期",
  249. readOnly: true,
  250. defaultValue: new Date()
  251. }, {
  252. xtype: "hidden",
  253. name: "updaterId",
  254. fieldLabel: "更新人ID",
  255. readOnly: true
  256. }, {
  257. xtype: "hidden",
  258. name: "updaterName",
  259. fieldLabel: "更新人",
  260. readOnly: true
  261. }, {
  262. xtype: "hidden",
  263. name: "updateTime",
  264. fieldLabel: "更新日期",
  265. readOnly: true,
  266. defaultValue: new Date()
  267. }, {
  268. xtype: 'textfield',
  269. name: 'or_auditman',
  270. fieldLabel: '审核人',
  271. readOnly: true
  272. }, {
  273. xtype: "datefield",
  274. name: "or_auditdate",
  275. fieldLabel: "审核日期",
  276. readOnly: true
  277. }, {
  278. xtype: "textfield",
  279. name: "or_text1",
  280. fieldLabel: "自定义字段1",
  281. hidden: true,
  282. initHidden: false
  283. }, {
  284. xtype: "textfield",
  285. name: "or_text2",
  286. fieldLabel: "自定义字段2",
  287. hidden: true,
  288. initHidden: false
  289. }, {
  290. xtype: "textfield",
  291. name: "or_text3",
  292. fieldLabel: "自定义字段3",
  293. hidden: true,
  294. initHidden: false
  295. }, {
  296. xtype: "textfield",
  297. name: "or_text4",
  298. fieldLabel: "自定义字段4",
  299. hidden: true,
  300. initHidden: false
  301. }, {
  302. xtype: "textfield",
  303. name: "or_text5",
  304. fieldLabel: "自定义字段5",
  305. hidden: true,
  306. initHidden: false
  307. }]
  308. });
  309. this.callParent(arguments);
  310. },
  311. });