FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. Ext.define('saas.view.document.vendor.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'document-vendor-formpanel',
  4. controller: 'document-vendor-formpanel',
  5. viewModel: 'document-vendor-formpanel',
  6. caller:'Vendor',
  7. //字段属性
  8. _title:'供应商资料',
  9. _idField: 'id',
  10. _codeField: 've_code',
  11. _statusField: 've_status',
  12. _statusCodeField: 've_statuscode',
  13. _readUrl:'/api/document/vendor/read',
  14. _saveUrl:'/api/document/vendor/save',
  15. _openUrl:'/api/document/vendor/open',
  16. _closeUrl:'/api/document/vendor/close',
  17. _deleteUrl:'/api/document/vendor/delete',
  18. initId:0,
  19. codeInHeader: false,
  20. defaultButtons:[{
  21. cls: 'x-formpanel-btn-blue',
  22. xtype: 'button',
  23. text: '新增',
  24. bind: {
  25. hidden: '{!id}'
  26. },
  27. handler: 'add'
  28. }, {
  29. xtype: 'button',
  30. text: '保存',
  31. handler: 'onSave',
  32. }, {
  33. xtype: 'button',
  34. text: '删除',
  35. handler: 'delete'
  36. }, {
  37. xtype: 'button',
  38. bind: {
  39. text: '{auditBtnText}'
  40. },
  41. handler: "auditBtnClick",
  42. }],
  43. auditTexts: {
  44. auditCode: 'BANNED',
  45. auditText: '已禁用',
  46. unAuditCode: 'ENABLE',
  47. unAuditText: '已启用',
  48. auditBtnText: '禁用',
  49. unAuditBtnText: '启用',
  50. },
  51. initComponent: function() {
  52. Ext.apply(this, {
  53. defaultItems: [{
  54. xtype: 'hidden',
  55. name: 'id',
  56. fieldLabel: 'id',
  57. allowBlank: true,
  58. columnWidth: 0.25,
  59. group: '基础信息',
  60. },{
  61. xtype: 'textfield',
  62. name: 've_code',
  63. fieldLabel: '供应商编号',
  64. allowBlank: false,
  65. columnWidth: 0.25,
  66. group: '基础信息',
  67. },{
  68. xtype: 'textfield',
  69. name: 've_name',
  70. fieldLabel: '供应商名称',
  71. allowBlank: false,
  72. columnWidth: 0.25,
  73. group: '基础信息',
  74. },{
  75. xtype: 'textfield',
  76. name: 've_shortname',
  77. fieldLabel: '供应商简称',
  78. columnWidth: 0.25,
  79. hidden: true,
  80. group: '基础信息',
  81. },{
  82. xtype: 'hidden',
  83. name: 've_status',
  84. fieldLabel: '状态',
  85. allowBlank: true,
  86. columnWidth: 0.25
  87. },{
  88. xtype: 'hidden',
  89. name: 've_statuscode',
  90. fieldLabel: '状态码',
  91. allowBlank: true,
  92. columnWidth: 0.25
  93. },{
  94. editable:false,
  95. xtype : "remotecombo",
  96. storeUrl:'/api/document/vendorkind/getCombo',
  97. name : "ve_type",
  98. fieldLabel : "供应商类型",
  99. columnWidth : 0.25,
  100. group: '基础信息',
  101. addHandler:function(b){
  102. var document = Ext.create('saas.view.document.kind.Kind',{});
  103. var form = this.ownerCmp.ownerCt;
  104. this.dialog = form.getController().getView().add({
  105. xtype: 'document-kind-childwin',
  106. bind: {
  107. title: '新增供应商类型'
  108. },
  109. dataKind:'vendorkind',
  110. belong:document.etc['vendorkind'],
  111. _parent:form,
  112. _combo:this.ownerCmp,
  113. record:null,
  114. session: true
  115. });
  116. this.dialog.show();
  117. }
  118. },{
  119. xtype : "datefield",
  120. name : "createTime",
  121. fieldLabel : "创建时间",
  122. allowBlank : true,
  123. hidden:true,
  124. columnWidth : 0
  125. },{
  126. xtype : "datefield",
  127. name : "ve_begindate",
  128. format:'Y-m-d',
  129. fieldLabel : "期初日期",
  130. allowBlank : true,
  131. columnWidth : 0.25,
  132. group: '交易信息',
  133. },{
  134. xtype : "numberfield",
  135. hideTrigger:true,
  136. name : "ve_beginapamount",
  137. fieldLabel : "期初应付(元)",
  138. allowBlank : true,
  139. columnWidth : 0.25,
  140. decimalPrecision: 2,
  141. thousandSeparator: ',',
  142. minValue:0,
  143. group: '交易信息',
  144. renderer : function(v) {
  145. return saas.util.BaseUtil.numberFormat(v, 2, true);
  146. },
  147. },{
  148. xtype : "numberfield",
  149. hideTrigger:true,
  150. name : "ve_beginprepayamount",
  151. fieldLabel : "期初预付(元)",
  152. allowBlank : true,
  153. columnWidth : 0.25,
  154. decimalPrecision: 2,
  155. thousandSeparator: ',',
  156. minValue:0,
  157. group: '交易信息',
  158. renderer : function(v) {
  159. return saas.util.BaseUtil.numberFormat(v, 2, true);
  160. },
  161. },{
  162. xtype : "numberfield",
  163. name : "ve_leftamount",
  164. fieldLabel : "应付余额(元)",
  165. allowBlank : true,
  166. readOnly:true,
  167. ignore:true,
  168. columnWidth : 0.25,
  169. decimalPrecision: 2,
  170. thousandSeparator: ',',
  171. group: '交易信息',
  172. renderer : function(v) {
  173. return saas.util.BaseUtil.numberFormat(v, 2, true);
  174. },
  175. },{
  176. xtype : "numberfield",
  177. name : "ve_taxrate",
  178. hideTrigger:true,
  179. fieldLabel : "税率(%)",
  180. allowBlank : false,
  181. columnWidth : 0.25,
  182. minValue:0,
  183. maxValue:100,
  184. group: '交易信息',
  185. },{
  186. xtype : "numberfield",
  187. hideTrigger:true,
  188. name : "ve_promisedays",
  189. fieldLabel : "结算天数",
  190. allowBlank : true,
  191. columnWidth : 0.25,
  192. minValue:0,
  193. maxLength: 8,
  194. enforceMaxLength: true,
  195. decimalPrecision: 0,
  196. group: '交易信息',
  197. },{
  198. xtype : "textfield",
  199. name : "ve_nsrzh",
  200. fieldLabel : "纳税人识别号",
  201. allowBlank : true,
  202. columnWidth : 0.25,
  203. group: '基础信息',
  204. },{
  205. xtype : "textfield",
  206. name : "ve_bankcode",
  207. fieldLabel : "开户银行",
  208. allowBlank : true,
  209. columnWidth : 0.25
  210. },{
  211. xtype : "textfield",
  212. name : "ve_bankaccount",
  213. fieldLabel : "银行账户",
  214. allowBlank : true,
  215. columnWidth : 0.25
  216. },{
  217. xtype:'hidden',
  218. name : "ve_uu",
  219. fieldLabel : "供应商UU",
  220. allowBlank : true,
  221. editable:false,
  222. readOnly:true,
  223. columnWidth : 0.25
  224. },{
  225. xtype : "datefield",
  226. name : "updateTime",
  227. fieldLabel : "更新时间",
  228. allowBlank : true,
  229. hidden:true,
  230. columnWidth : 0.25
  231. }, {
  232. xtype : "hidden",
  233. name : "ve_buyercode",
  234. fieldLabel : "采购员编号"
  235. },{
  236. xtype : "employeeDbfindTrigger",
  237. name : "ve_buyername",
  238. fieldLabel : "采购员",
  239. columnWidth : 0.25,
  240. defaultValue:saas.util.BaseUtil.getCurrentUser().realname
  241. },{
  242. xtype : "hidden",
  243. name : "ve_buyerid",
  244. fieldLabel : "采购员ID",
  245. defaultValue:saas.util.BaseUtil.getCurrentUser().id
  246. },{
  247. xtype : "textfield",
  248. name : "ve_address",
  249. fieldLabel : "地址",
  250. allowBlank : true,
  251. columnWidth : 0.75
  252. },{
  253. fieldLabel : "备注",
  254. xtype:'textfield',
  255. name : "ve_remark",
  256. columnWidth : 1
  257. }, {
  258. xtype : "detailGridField",
  259. storeModel:'saas.model.document.vendorcontact',
  260. detnoColumn: 'vc_detno',
  261. showCount: false,
  262. deleteDetailUrl:'/api/document/vendor/deleteContact',
  263. columns : [
  264. {
  265. text : "ID",
  266. dataIndex : "id",
  267. hidden : true,
  268. xtype : "numbercolumn"
  269. },
  270. {
  271. text : "关联ID",
  272. dataIndex : "vc_veid",
  273. hidden : true,
  274. xtype : "numbercolumn"
  275. },
  276. {
  277. allowBlank:false,
  278. text : "联系人",
  279. editor : {
  280. xtype : "textfield"
  281. },
  282. dataIndex : "vc_name",
  283. width:110
  284. },
  285. {
  286. allowBlank:false,
  287. text : "电话",
  288. editor : {
  289. // regex:/^[\d | -]*$/,
  290. // regexText:'请输入正确的手机号码',
  291. hideTrigger:true,
  292. xtype : "textfield"
  293. },
  294. dataIndex : "vc_tel",
  295. width:200
  296. },
  297. {
  298. allowBlank:true,
  299. text : "微信/QQ",
  300. editor : {
  301. xtype : "textfield"
  302. },
  303. dataIndex : "vc_qq",
  304. width:110
  305. },
  306. {
  307. text : "邮箱",
  308. editor : {
  309. xtype : "textfield"
  310. },
  311. dataIndex : "vc_email",
  312. width:180
  313. },
  314. {
  315. text : "默认联系人",
  316. dataIndex : "vc_default",
  317. xtype : "yncolumn",
  318. }]
  319. }
  320. ],
  321. });
  322. this.callParent(arguments);
  323. },
  324. });