FormPanel.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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. defaultItems: [{
  20. xtype: 'hidden',
  21. name: 'id',
  22. fieldLabel: 'id',
  23. allowBlank: true,
  24. columnWidth: 0.25
  25. },{
  26. xtype: 'textfield',
  27. name: 've_name',
  28. fieldLabel: '供应商名称',
  29. allowBlank: false,
  30. columnWidth: 0.25
  31. },{
  32. xtype: 'textfield',
  33. name: 've_code',
  34. fieldLabel: '供应商编号',
  35. allowBlank: true,
  36. columnWidth: 0.25
  37. },{
  38. xtype: 'textfield',
  39. name: 've_status',
  40. fieldLabel: '状态',
  41. allowBlank: true,
  42. columnWidth: 0.25
  43. },{
  44. xtype: 'hidden',
  45. name: 've_statuscode',
  46. fieldLabel: '状态码',
  47. allowBlank: true,
  48. columnWidth: 0.25
  49. },{
  50. editable:false,
  51. xtype : "remotecombo",
  52. storeUrl:'/api/document/vendorkind/getCombo',
  53. name : "ve_type",
  54. fieldLabel : "供应商类型",
  55. allowBlank : false,
  56. columnWidth : 0.25,
  57. addHandler:function(b){
  58. var document = Ext.create('saas.view.document.kind.Kind',{});
  59. var form = this.ownerCmp.ownerCt;
  60. this.dialog = form.getController().getView().add({
  61. xtype: 'document-kind-childwin',
  62. bind: {
  63. title: '新增供应商类型'
  64. },
  65. dataKind:'vendorkind',
  66. belong:document.etc['vendorkind'],
  67. _parent:form,
  68. _combo:this.ownerCmp,
  69. record:null,
  70. session: true
  71. });
  72. this.dialog.show();
  73. }
  74. },{
  75. xtype : "datefield",
  76. name : "createTime",
  77. fieldLabel : "创建时间",
  78. allowBlank : true,
  79. columnWidth : 0.25
  80. },{
  81. xtype : "datefield",
  82. name : "ve_begindate",
  83. fieldLabel : "期初日期",
  84. allowBlank : true,
  85. columnWidth : 0.25
  86. },{
  87. xtype : "numberfield",
  88. hideTrigger:true,
  89. name : "ve_beginapamount",
  90. fieldLabel : "期初应收",
  91. allowBlank : true,
  92. columnWidth : 0.25
  93. },{
  94. xtype : "numberfield",
  95. hideTrigger:true,
  96. name : "ve_beginprepayamount",
  97. fieldLabel : "期初预收",
  98. allowBlank : true,
  99. columnWidth : 0.25
  100. },{
  101. xtype : "numberfield",
  102. hideTrigger:true,
  103. name : "ve_promisedays",
  104. fieldLabel : "承付天数",
  105. allowBlank : true,
  106. columnWidth : 0.25
  107. },{
  108. xtype : "numberfield",
  109. name : "ve_taxrate",
  110. fieldLabel : "税率",
  111. allowBlank : false,
  112. columnWidth : 0.25
  113. },{
  114. // xtype : "numberfield",
  115. // name : "ve_ta",
  116. // fieldLabel : "应收款余额",
  117. // allowBlank : true,
  118. // readOnly:true,
  119. // editable:false,
  120. // columnWidth : 0.25
  121. },{
  122. xtype:'textfield',
  123. name : "ve_uu",
  124. fieldLabel : "供应商UU",
  125. allowBlank : true,
  126. columnWidth : 0.25
  127. },{
  128. xtype : "datefield",
  129. name : "updateTime",
  130. fieldLabel : "更新时间",
  131. allowBlank : true,
  132. columnWidth : 0.25
  133. }, {
  134. xtype : "detailGridField",
  135. storeModel:'saas.model.document.vendorcontact',
  136. deleteDetailUrl:'/api/document/vendor/deleteContact/',
  137. columns : [
  138. {
  139. text : "ID",
  140. dataIndex : "id",
  141. width : 0,
  142. xtype : "numbercolumn"
  143. },
  144. {
  145. text : "关联ID",
  146. dataIndex : "vc_veid",
  147. width : 0,
  148. xtype : "numbercolumn"
  149. },
  150. {
  151. text : "联系人",
  152. editor : {
  153. xtype : "textfield"
  154. },
  155. dataIndex : "vc_name",
  156. width : 120.0,
  157. xtype : "",
  158. },
  159. {
  160. text : "电话",
  161. editor : {
  162. xtype : "textfield"
  163. },
  164. dataIndex : "vc_tel",
  165. width : 120.0,
  166. xtype : "",
  167. },
  168. {
  169. text : "微信/QQ",
  170. editor : {
  171. xtype : "textfield"
  172. },
  173. dataIndex : "vc_qq",
  174. width : 120.0,
  175. xtype : "",
  176. },
  177. {
  178. text : "邮箱",
  179. editor : {
  180. xtype : "textfield"
  181. },
  182. dataIndex : "vc_email",
  183. width : 120.0,
  184. xtype : "",
  185. },
  186. {
  187. editor : {
  188. displayField : "display",
  189. editable:false,
  190. format : "",
  191. hideTrigger : false,
  192. maxLength : 100.0,
  193. minValue : null,
  194. positiveNum : false,
  195. queryMode : "local",
  196. valueField : "value",
  197. xtype : "combo",
  198. store:{
  199. fields: ['display', 'value'],
  200. data : [
  201. {"display":"是", "value":'1'},
  202. {"display":"否", "value":'0'}
  203. ]
  204. }
  205. },
  206. text : "是否默认联系人",
  207. width : 200.0,
  208. dataIndex : "vc_default",
  209. xtype : "",
  210. renderer: function (v, m, r) {
  211. if(v=='0'){
  212. return '';
  213. }else if(v=='1'){
  214. return '是';
  215. }
  216. return v;
  217. }
  218. }]
  219. }
  220. ],
  221. auditTexts: {
  222. auditCode: 'OPEN',
  223. auditText: '已开启',
  224. unAuditCode: 'CLOSE',
  225. unAuditText: '已关闭',
  226. auditBtnText: '启用',
  227. unAuditBtnText: '禁用',
  228. },
  229. });