FormPanel.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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_name',
  29. fieldLabel: '供应商名称',
  30. allowBlank: false,
  31. columnWidth: 0.5
  32. },{
  33. xtype: 'textfield',
  34. name: 've_code',
  35. fieldLabel: '供应商编号',
  36. allowBlank: true,
  37. columnWidth: 0.25
  38. },{
  39. xtype: 'hidden',
  40. name: 've_status',
  41. fieldLabel: '状态',
  42. allowBlank: true,
  43. columnWidth: 0.25
  44. },{
  45. xtype: 'hidden',
  46. name: 've_statuscode',
  47. fieldLabel: '状态码',
  48. allowBlank: true,
  49. columnWidth: 0.25
  50. },{
  51. editable:false,
  52. xtype : "remotecombo",
  53. storeUrl:'/api/document/vendorkind/getCombo',
  54. name : "ve_type",
  55. fieldLabel : "供应商类型",
  56. allowBlank : false,
  57. columnWidth : 0.25,
  58. addHandler:function(b){
  59. var document = Ext.create('saas.view.document.kind.Kind',{});
  60. var form = this.ownerCmp.ownerCt;
  61. this.dialog = form.getController().getView().add({
  62. xtype: 'document-kind-childwin',
  63. bind: {
  64. title: '新增供应商类型'
  65. },
  66. dataKind:'vendorkind',
  67. belong:document.etc['vendorkind'],
  68. _parent:form,
  69. _combo:this.ownerCmp,
  70. record:null,
  71. session: true
  72. });
  73. this.dialog.show();
  74. }
  75. },{
  76. xtype : "datefield",
  77. name : "createTime",
  78. fieldLabel : "创建时间",
  79. allowBlank : true,
  80. hidden:true,
  81. columnWidth : 0
  82. },{
  83. xtype : "datefield",
  84. name : "ve_begindate",
  85. format:'Y-m-d',
  86. fieldLabel : "期初日期",
  87. allowBlank : true,
  88. columnWidth : 0.25
  89. },{
  90. xtype : "numberfield",
  91. hideTrigger:true,
  92. name : "ve_beginapamount",
  93. fieldLabel : "期初应收",
  94. allowBlank : true,
  95. columnWidth : 0.25
  96. },{
  97. xtype : "numberfield",
  98. hideTrigger:true,
  99. name : "ve_beginprepayamount",
  100. fieldLabel : "期初预收",
  101. allowBlank : true,
  102. columnWidth : 0.25
  103. },{
  104. xtype : "numberfield",
  105. name : "ve_taxrate",
  106. hideTrigger:true,
  107. fieldLabel : "税率",
  108. allowBlank : false,
  109. columnWidth : 0.25
  110. },{
  111. xtype : "numberfield",
  112. hideTrigger:true,
  113. name : "ve_promisedays",
  114. fieldLabel : "承付天数",
  115. allowBlank : true,
  116. columnWidth : 0.25
  117. },{
  118. xtype : "textfield",
  119. name : "ve_1",
  120. fieldLabel : "纳税人识别号",
  121. ignore:true,
  122. editable:false,
  123. readOnly:true,
  124. allowBlank : true,
  125. columnWidth : 0.25
  126. },{
  127. xtype : "textfield",
  128. name : "ve_2",
  129. fieldLabel : "开户银行",
  130. ignore:true,
  131. editable:false,
  132. readOnly:true,
  133. allowBlank : true,
  134. columnWidth : 0.25
  135. },{
  136. xtype : "textfield",
  137. name : "ve_3",
  138. fieldLabel : "银行账户",
  139. ignore:true,
  140. editable:false,
  141. readOnly:true,
  142. allowBlank : true,
  143. columnWidth : 0.25
  144. },{
  145. xtype:'textfield',
  146. name : "ve_uu",
  147. fieldLabel : "供应商UU",
  148. allowBlank : true,
  149. columnWidth : 0.25
  150. },{
  151. xtype : "datefield",
  152. name : "updateTime",
  153. fieldLabel : "更新时间",
  154. allowBlank : true,
  155. hidden:true,
  156. columnWidth : 0.25
  157. },{
  158. xtype : "numberfield",
  159. name : "ve_leftamount",
  160. fieldLabel : "应付款金额",
  161. allowBlank : true,
  162. readOnly:true,
  163. ignore:true,
  164. columnWidth : 0.25
  165. }, {
  166. xtype : "detailGridField",
  167. storeModel:'saas.model.document.vendorcontact',
  168. detnoColumn: 'vc_detno',
  169. showCount: false,
  170. deleteDetailUrl:'/api/document/vendor/deleteContact/',
  171. columns : [
  172. {
  173. text : "ID",
  174. dataIndex : "id",
  175. hidden : true,
  176. xtype : "numbercolumn"
  177. },
  178. {
  179. text : "关联ID",
  180. dataIndex : "vc_veid",
  181. hidden : true,
  182. xtype : "numbercolumn"
  183. },
  184. {
  185. allowBlank:false,
  186. text : "联系人",
  187. editor : {
  188. xtype : "textfield"
  189. },
  190. dataIndex : "vc_name",
  191. xtype : "",
  192. },
  193. {
  194. allowBlank:false,
  195. text : "电话",
  196. editor : {
  197. hideTrigger:true,
  198. xtype : "numberfield"
  199. },
  200. dataIndex : "vc_tel",
  201. xtype : "",
  202. },
  203. {
  204. allowBlank:false,
  205. text : "微信/QQ",
  206. editor : {
  207. xtype : "textfield"
  208. },
  209. dataIndex : "vc_qq",
  210. xtype : "",
  211. },
  212. {
  213. text : "邮箱",
  214. editor : {
  215. xtype : "textfield"
  216. },
  217. dataIndex : "vc_email",
  218. xtype : "",
  219. },
  220. {
  221. editor : {
  222. displayField : "display",
  223. editable:false,
  224. format : "",
  225. hideTrigger : false,
  226. maxLength : 100.0,
  227. minValue : null,
  228. positiveNum : false,
  229. queryMode : "local",
  230. valueField : "value",
  231. xtype : "combo",
  232. store:{
  233. fields: ['display', 'value'],
  234. data : [
  235. {"display":"是", "value":'1'},
  236. {"display":"否", "value":'0'}
  237. ]
  238. },
  239. listeners:{
  240. 'change':function(c,newVal,oldVal){
  241. if(newVal=='1'){
  242. var grid = c.ownerCt.column.ownerCt.ownerCt;
  243. var nowId = grid.selModel.lastSelected.id;
  244. var items = grid.store.data.items
  245. for (let index = 0; index < items.length; index++) {
  246. if(items[index].id!=nowId){
  247. items[index].set('vc_default',"")
  248. }
  249. }
  250. }
  251. }
  252. }
  253. },
  254. text : "是否默认联系人",
  255. dataIndex : "vc_default",
  256. xtype : "",
  257. renderer: function (v, m, r) {
  258. if(v=='0'){
  259. return '';
  260. }else if(v=='1'){
  261. return '是';
  262. }
  263. return v;
  264. }
  265. }]
  266. }
  267. ],
  268. defaultButtons:[{
  269. cls: 'x-formpanel-btn-orange',
  270. xtype: 'button',
  271. text: '新增',
  272. bind: {
  273. hidden: '{!id}'
  274. },
  275. handler: 'add'
  276. }, {
  277. xtype: 'button',
  278. text: '保存',
  279. handler: 'onSave',
  280. }, {
  281. xtype: 'button',
  282. text: '删除',
  283. handler: 'delete'
  284. }, {
  285. xtype: 'button',
  286. bind: {
  287. text: '{auditBtnText}'
  288. },
  289. handler: "auditBtnClick",
  290. }],
  291. auditTexts: {
  292. auditCode: 'CLOSE',
  293. auditText: '已关闭',
  294. unAuditCode: 'OPEN',
  295. unAuditText: '已开启',
  296. auditBtnText: '禁用',
  297. unAuditBtnText: '启用',
  298. }
  299. });