FormPanel.js 8.8 KB

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