FormPanel.js 8.8 KB

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