FormPanel.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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.25
  32. },{
  33. xtype: 'textfield',
  34. name: 've_code',
  35. fieldLabel: '供应商编号',
  36. allowBlank: true,
  37. columnWidth: 0.25
  38. },{
  39. xtype: 'textfield',
  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. columnWidth : 0.25
  81. },{
  82. xtype : "datefield",
  83. name : "ve_begindate",
  84. fieldLabel : "期初日期",
  85. allowBlank : true,
  86. columnWidth : 0.25
  87. },{
  88. xtype : "numberfield",
  89. hideTrigger:true,
  90. name : "ve_beginapamount",
  91. fieldLabel : "期初应收",
  92. allowBlank : true,
  93. columnWidth : 0.25
  94. },{
  95. xtype : "numberfield",
  96. hideTrigger:true,
  97. name : "ve_beginprepayamount",
  98. fieldLabel : "期初预收",
  99. allowBlank : true,
  100. columnWidth : 0.25
  101. },{
  102. xtype : "numberfield",
  103. hideTrigger:true,
  104. name : "ve_promisedays",
  105. fieldLabel : "承付天数",
  106. allowBlank : true,
  107. columnWidth : 0.25
  108. },{
  109. xtype : "numberfield",
  110. name : "ve_taxrate",
  111. fieldLabel : "税率",
  112. allowBlank : false,
  113. columnWidth : 0.25
  114. },{
  115. // xtype : "numberfield",
  116. // name : "ve_ta",
  117. // fieldLabel : "应收款余额",
  118. // allowBlank : true,
  119. // readOnly:true,
  120. // editable:false,
  121. // columnWidth : 0.25
  122. },{
  123. xtype:'textfield',
  124. name : "ve_uu",
  125. fieldLabel : "供应商UU",
  126. allowBlank : true,
  127. columnWidth : 0.25
  128. },{
  129. xtype : "datefield",
  130. name : "updateTime",
  131. fieldLabel : "更新时间",
  132. allowBlank : true,
  133. columnWidth : 0.25
  134. }, {
  135. xtype : "detailGridField",
  136. storeModel:'saas.model.document.vendorcontact',
  137. detnoColumn: 'vc_detno',
  138. showCount: false,
  139. deleteDetailUrl:'/api/document/vendor/deleteContact/',
  140. columns : [
  141. {
  142. text : "ID",
  143. dataIndex : "id",
  144. hidden : true,
  145. xtype : "numbercolumn"
  146. },
  147. {
  148. text : "关联ID",
  149. dataIndex : "vc_veid",
  150. hidden : true,
  151. xtype : "numbercolumn"
  152. },
  153. {
  154. text : "联系人",
  155. editor : {
  156. xtype : "textfield"
  157. },
  158. dataIndex : "vc_name",
  159. xtype : "",
  160. },
  161. {
  162. text : "电话",
  163. editor : {
  164. xtype : "textfield"
  165. },
  166. dataIndex : "vc_tel",
  167. xtype : "",
  168. },
  169. {
  170. text : "微信/QQ",
  171. editor : {
  172. xtype : "textfield"
  173. },
  174. dataIndex : "vc_qq",
  175. xtype : "",
  176. },
  177. {
  178. text : "邮箱",
  179. editor : {
  180. xtype : "textfield"
  181. },
  182. dataIndex : "vc_email",
  183. xtype : "",
  184. },
  185. {
  186. editor : {
  187. displayField : "display",
  188. editable:false,
  189. format : "",
  190. hideTrigger : false,
  191. maxLength : 100.0,
  192. minValue : null,
  193. positiveNum : false,
  194. queryMode : "local",
  195. valueField : "value",
  196. xtype : "combo",
  197. store:{
  198. fields: ['display', 'value'],
  199. data : [
  200. {"display":"是", "value":'1'},
  201. {"display":"否", "value":'0'}
  202. ]
  203. }
  204. },
  205. text : "是否默认联系人",
  206. dataIndex : "vc_default",
  207. xtype : "",
  208. renderer: function (v, m, r) {
  209. if(v=='0'){
  210. return '';
  211. }else if(v=='1'){
  212. return '是';
  213. }
  214. return v;
  215. }
  216. }]
  217. }
  218. ],
  219. auditTexts: {
  220. auditCode: 'OPEN',
  221. auditText: '已开启',
  222. unAuditCode: 'CLOSE',
  223. unAuditText: '已关闭',
  224. auditBtnText: '启用',
  225. unAuditBtnText: '关闭',
  226. },
  227. });