FormPanel.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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_nsrzh",
  120. fieldLabel : "纳税人识别号",
  121. allowBlank : true,
  122. columnWidth : 0.25
  123. },{
  124. xtype : "textfield",
  125. name : "ve_bankcode",
  126. fieldLabel : "开户银行",
  127. allowBlank : true,
  128. columnWidth : 0.25
  129. },{
  130. xtype : "textfield",
  131. name : "ve_bankaccount",
  132. fieldLabel : "银行账户",
  133. allowBlank : true,
  134. columnWidth : 0.25
  135. },{
  136. xtype:'textfield',
  137. name : "ve_uu",
  138. fieldLabel : "供应商UU",
  139. allowBlank : true,
  140. editable:false,
  141. readOnly:true,
  142. columnWidth : 0.25
  143. },{
  144. xtype : "datefield",
  145. name : "updateTime",
  146. fieldLabel : "更新时间",
  147. allowBlank : true,
  148. hidden:true,
  149. columnWidth : 0.25
  150. },{
  151. xtype : "numberfield",
  152. name : "ve_leftamount",
  153. fieldLabel : "应付款金额",
  154. allowBlank : true,
  155. readOnly:true,
  156. ignore:true,
  157. columnWidth : 0.25
  158. }, {
  159. xtype : "detailGridField",
  160. storeModel:'saas.model.document.vendorcontact',
  161. detnoColumn: 'vc_detno',
  162. showCount: false,
  163. deleteDetailUrl:'/api/document/vendor/deleteContact/',
  164. columns : [
  165. {
  166. text : "ID",
  167. dataIndex : "id",
  168. hidden : true,
  169. xtype : "numbercolumn"
  170. },
  171. {
  172. text : "关联ID",
  173. dataIndex : "vc_veid",
  174. hidden : true,
  175. xtype : "numbercolumn"
  176. },
  177. {
  178. allowBlank:false,
  179. text : "联系人",
  180. editor : {
  181. xtype : "textfield"
  182. },
  183. dataIndex : "vc_name",
  184. xtype : "",
  185. },
  186. {
  187. allowBlank:false,
  188. text : "电话",
  189. editor : {
  190. hideTrigger:true,
  191. xtype : "numberfield"
  192. },
  193. dataIndex : "vc_tel",
  194. xtype : "",
  195. },
  196. {
  197. allowBlank:true,
  198. text : "微信/QQ",
  199. editor : {
  200. xtype : "textfield"
  201. },
  202. dataIndex : "vc_qq",
  203. xtype : "",
  204. },
  205. {
  206. text : "邮箱",
  207. editor : {
  208. xtype : "textfield"
  209. },
  210. dataIndex : "vc_email",
  211. xtype : "",
  212. },
  213. {
  214. editor : {
  215. displayField : "display",
  216. editable:true,
  217. format : "",
  218. hideTrigger : false,
  219. maxLength : 100.0,
  220. minValue : null,
  221. positiveNum : false,
  222. queryMode : "local",
  223. valueField : "value",
  224. xtype : "combo",
  225. store:{
  226. fields: ['display', 'value'],
  227. data : [
  228. {"display":"是", "value":'1'},
  229. {"display":"否", "value":'0'}
  230. ]
  231. },
  232. listeners:{
  233. 'change':function(c,newVal,oldVal){
  234. if(newVal=='1'){
  235. var grid = c.ownerCt.column.ownerCt.ownerCt;
  236. var nowId = grid.selModel.lastSelected.id;
  237. var items = grid.store.data.items
  238. for (let index = 0; index < items.length; index++) {
  239. if(items[index].id!=nowId){
  240. items[index].set('vc_default',"")
  241. }
  242. }
  243. }
  244. }
  245. }
  246. },
  247. text : "是否默认联系人",
  248. dataIndex : "vc_default",
  249. xtype : "",
  250. renderer: function (v, m, r) {
  251. if(v=='0'){
  252. return '';
  253. }else if(v=='1'){
  254. return '是';
  255. }
  256. return v;
  257. }
  258. }]
  259. }
  260. ],
  261. defaultButtons:[{
  262. cls: 'x-formpanel-btn-orange',
  263. xtype: 'button',
  264. text: '新增',
  265. bind: {
  266. hidden: '{!id}'
  267. },
  268. handler: 'add'
  269. }, {
  270. xtype: 'button',
  271. text: '保存',
  272. handler: 'onSave',
  273. }, {
  274. xtype: 'button',
  275. text: '删除',
  276. handler: 'delete'
  277. }, {
  278. xtype: 'button',
  279. bind: {
  280. text: '{auditBtnText}'
  281. },
  282. handler: "auditBtnClick",
  283. }],
  284. auditTexts: {
  285. auditCode: 'CLOSE',
  286. auditText: '已关闭',
  287. unAuditCode: 'OPEN',
  288. unAuditText: '已开启',
  289. auditBtnText: '禁用',
  290. unAuditBtnText: '启用',
  291. }
  292. });