FormPanel.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. Ext.define('saas.view.document.customer.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'document-customer-formpanel',
  4. controller: 'document-customer-formpanel',
  5. viewModel: 'document-customer-formpanel',
  6. caller:'Customer',
  7. //字段属性
  8. _title:'客户资料',
  9. _idField: 'id',
  10. _codeField: 'cu_code',
  11. _statusField: 'cu_status',
  12. _statusCodeField: 'cu_statuscode',
  13. _readUrl:'/api/document/customer/read/',
  14. _saveUrl:'/api/document/customer/save',
  15. _openUrl:'/api/document/customer/open',
  16. _closeUrl:'/api/document/customer/close',
  17. _deleteUrl:'/api/document/customer/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: 'cu_name',
  28. fieldLabel: '客户名称',
  29. allowBlank: false,
  30. columnWidth: 0.25
  31. },{
  32. xtype: 'textfield',
  33. name: 'cu_code',
  34. fieldLabel: '客户编号',
  35. allowBlank: true,
  36. columnWidth: 0.25
  37. },{
  38. xtype: 'textfield',
  39. name: 'cu_status',
  40. fieldLabel: '状态',
  41. allowBlank: true,
  42. columnWidth: 0.25
  43. },{
  44. xtype: 'hidden',
  45. name: 'cu_statuscode',
  46. fieldLabel: '状态码',
  47. allowBlank: true,
  48. columnWidth: 0.25
  49. },{
  50. editable:false,
  51. xtype : "remotecombo",
  52. storeUrl:'/api/document/customerkind/getCombo',
  53. name : "cu_type",
  54. fieldLabel : "客户类型",
  55. allowBlank : false,
  56. columnWidth : 0.25,
  57. hiddenBtn:false,//true 则会关闭新增按钮功能
  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:'customerkind',
  67. belong:document.etc['customerkind'],
  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 : "cu_begindate",
  84. fieldLabel : "期初日期",
  85. allowBlank : true,
  86. columnWidth : 0.25
  87. },{
  88. xtype : "numberfield",
  89. hideTrigger:true,
  90. name : "cu_beginaramount",
  91. fieldLabel : "期初应收",
  92. allowBlank : true,
  93. columnWidth : 0.25
  94. },{
  95. xtype : "numberfield",
  96. hideTrigger:true,
  97. name : "cu_beginprerecamount",
  98. fieldLabel : "期初预收",
  99. allowBlank : true,
  100. columnWidth : 0.25
  101. },{
  102. xtype : "numberfield",
  103. hideTrigger:true,
  104. name : "cu_promisedays",
  105. fieldLabel : "承付天数",
  106. allowBlank : true,
  107. columnWidth : 0.25
  108. },{
  109. xtype : "numberfield",
  110. name : "cu_taxrate",
  111. fieldLabel : "税率",
  112. allowBlank : true,
  113. columnWidth : 0.25
  114. },{
  115. // xtype : "numberfield",
  116. // name : "cu_ta",
  117. // fieldLabel : "应收款余额",
  118. // allowBlank : true,
  119. // readOnly:true,
  120. // editable:false,
  121. // columnWidth : 0.25
  122. },{
  123. xtype:'textfield',
  124. name : "cu_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. height: 169,
  136. xtype : "detailGridField",
  137. storeModel:'saas.model.document.customercontact',
  138. deleteDetailUrl:'/api/document/customer/deletecontact/',
  139. columns : [
  140. {
  141. text : "ID",
  142. dataIndex : "id",
  143. hidden : true,
  144. xtype : "numbercolumn"
  145. },
  146. {
  147. text : "关联ID",
  148. dataIndex : "cc_cuid",
  149. hidden : true,
  150. xtype : "numbercolumn"
  151. },
  152. {
  153. text : "联系人",
  154. editor : {
  155. xtype : "textfield"
  156. },
  157. dataIndex : "cc_name",
  158. xtype : "",
  159. items : null
  160. },
  161. {
  162. text : "电话",
  163. editor : {
  164. hideTrigger:true,
  165. xtype : "numberfield"
  166. },
  167. dataIndex : "cc_tel",
  168. xtype : "",
  169. items : null
  170. },
  171. {
  172. text : "微信/QQ",
  173. editor : {
  174. xtype : "textfield"
  175. },
  176. dataIndex : "cc_qq",
  177. xtype : "",
  178. items : null
  179. },
  180. {
  181. text : "邮箱",
  182. editor : {
  183. xtype : "textfield"
  184. },
  185. dataIndex : "cc_email",
  186. xtype : "",
  187. items : null
  188. },
  189. {
  190. editor : {
  191. displayField : "display",
  192. editable:false,
  193. format : "",
  194. hideTrigger : false,
  195. maxLength : 100.0,
  196. minValue : null,
  197. positiveNum : false,
  198. queryMode : "local",
  199. valueField : "value",
  200. xtype : "combo",
  201. store:{
  202. fields: ['display', 'value'],
  203. data : [
  204. {"display":"是", "value":'1'},
  205. {"display":"否", "value":'0'}
  206. ]
  207. }
  208. },
  209. text : "是否默认联系人",
  210. width : 200.0,
  211. dataIndex : "cc_default",
  212. xtype : "",
  213. renderer: function (v, m, r) {
  214. if(v=='0'){
  215. return '';
  216. }else if(v=='1'){
  217. return '是';
  218. }
  219. return v;
  220. }
  221. }]
  222. } ,{
  223. height: 169,
  224. xtype : "detailGridField",
  225. storeModel:'saas.model.document.customeraddress',
  226. deleteDetailUrl:'/api/document/customer/deleteaddress/',
  227. columns : [
  228. {
  229. text : "ID",
  230. dataIndex : "id",
  231. hidden : true,
  232. xtype : "numbercolumn"
  233. },
  234. {
  235. text : "关联ID",
  236. dataIndex : "ca_cuid",
  237. hidden : true,
  238. xtype : "numbercolumn"
  239. },
  240. {
  241. text : "送货地址",
  242. editor : {
  243. xtype : "textfield"
  244. },
  245. dataIndex : "ca_address",
  246. xtype : "",
  247. items : null
  248. },
  249. {
  250. text : "联系人",
  251. editor : {
  252. xtype : "textfield"
  253. },
  254. dataIndex : "ca_person",
  255. xtype : "",
  256. items : null
  257. },
  258. {
  259. text : "联系电话",
  260. editor : {
  261. xtype : "textfield"
  262. },
  263. dataIndex : "ca_phone",
  264. xtype : "",
  265. items : null
  266. },
  267. {
  268. editor : {
  269. editable:false,
  270. displayField : "display",
  271. format : "",
  272. hideTrigger : false,
  273. maxLength : 100.0,
  274. minValue : null,
  275. positiveNum : false,
  276. queryMode : "local",
  277. valueField : "value",
  278. xtype : "combo",
  279. store:{
  280. fields: ['display', 'value'],
  281. data : [
  282. {"display":"是", "value":'1'},
  283. {"display":"否", "value":'0'}
  284. ]
  285. },
  286. listeners:{
  287. 'change':function(c,newVal,oldVal){
  288. var grid = c.ownerCt.column.ownerCt.ownerCt;
  289. var nowId = grid.selModel.lastSelected.id;
  290. var items = grid.store.data.items
  291. }
  292. }
  293. },
  294. text : "是否默认地址",
  295. dataIndex : "ca_default",
  296. xtype : "",
  297. renderer: function (v, m, r) {
  298. if(v=='0'){
  299. return '';
  300. }else if(v=='1'){
  301. return '是';
  302. }
  303. return v;
  304. }
  305. }]
  306. }],
  307. auditTexts: {
  308. auditCode: 'OPEN',
  309. auditText: '已开启',
  310. unAuditCode: 'CLOSE',
  311. unAuditText: '已关闭',
  312. auditBtnText: '启用',
  313. unAuditBtnText: '禁用',
  314. },
  315. });