FormPanel.js 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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 : false,
  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. width : 0,
  144. xtype : "numbercolumn"
  145. },
  146. {
  147. text : "关联ID",
  148. dataIndex : "cc_cuid",
  149. width : 0,
  150. xtype : "numbercolumn"
  151. },
  152. {
  153. text : "联系人",
  154. editor : {
  155. xtype : "textfield"
  156. },
  157. dataIndex : "cc_name",
  158. width : 120.0,
  159. xtype : "",
  160. items : null
  161. },
  162. {
  163. text : "电话",
  164. editor : {
  165. xtype : "textfield"
  166. },
  167. dataIndex : "cc_tel",
  168. width : 120.0,
  169. xtype : "",
  170. items : null
  171. },
  172. {
  173. text : "微信/QQ",
  174. editor : {
  175. xtype : "textfield"
  176. },
  177. dataIndex : "cc_qq",
  178. width : 120.0,
  179. xtype : "",
  180. items : null
  181. },
  182. {
  183. text : "邮箱",
  184. editor : {
  185. xtype : "textfield"
  186. },
  187. dataIndex : "cc_email",
  188. width : 120.0,
  189. xtype : "",
  190. items : null
  191. },
  192. {
  193. editor : {
  194. displayField : "display",
  195. editable:false,
  196. format : "",
  197. hideTrigger : false,
  198. maxLength : 100.0,
  199. minValue : null,
  200. positiveNum : false,
  201. queryMode : "local",
  202. valueField : "value",
  203. xtype : "combo",
  204. store:{
  205. fields: ['display', 'value'],
  206. data : [
  207. {"display":"是", "value":'1'},
  208. {"display":"否", "value":'0'}
  209. ]
  210. }
  211. },
  212. text : "是否默认联系人",
  213. width : 200.0,
  214. dataIndex : "cc_default",
  215. xtype : "",
  216. renderer: function (v, m, r) {
  217. if(v=='0'){
  218. return '';
  219. }else if(v=='1'){
  220. return '是';
  221. }
  222. return v;
  223. }
  224. }]
  225. } ,{
  226. height: 169,
  227. xtype : "detailGridField",
  228. storeModel:'saas.model.document.customeraddress',
  229. deleteDetailUrl:'/api/document/customer/deleteaddress/',
  230. columns : [
  231. {
  232. text : "ID",
  233. dataIndex : "id",
  234. width : 0,
  235. xtype : "numbercolumn"
  236. },
  237. {
  238. text : "关联ID",
  239. dataIndex : "ca_cuid",
  240. width : 0,
  241. xtype : "numbercolumn"
  242. },
  243. {
  244. text : "送货地址",
  245. editor : {
  246. xtype : "textfield"
  247. },
  248. dataIndex : "ca_address",
  249. width : 120.0,
  250. xtype : "",
  251. items : null
  252. },
  253. {
  254. text : "联系人",
  255. editor : {
  256. xtype : "textfield"
  257. },
  258. dataIndex : "ca_person",
  259. width : 120.0,
  260. xtype : "",
  261. items : null
  262. },
  263. {
  264. text : "联系电话",
  265. editor : {
  266. xtype : "textfield"
  267. },
  268. dataIndex : "ca_phone",
  269. width : 120.0,
  270. xtype : "",
  271. items : null
  272. },
  273. {
  274. editor : {
  275. editable:false,
  276. displayField : "display",
  277. format : "",
  278. hideTrigger : false,
  279. maxLength : 100.0,
  280. minValue : null,
  281. positiveNum : false,
  282. queryMode : "local",
  283. valueField : "value",
  284. xtype : "combo",
  285. store:{
  286. fields: ['display', 'value'],
  287. data : [
  288. {"display":"是", "value":'1'},
  289. {"display":"否", "value":'0'}
  290. ]
  291. },
  292. listeners:{
  293. 'change':function(c,newVal,oldVal){
  294. var grid = c.ownerCt.column.ownerCt.ownerCt;
  295. var nowId = grid.selModel.lastSelected.id;
  296. var items = grid.store.data.items
  297. }
  298. }
  299. },
  300. text : "是否默认地址",
  301. width : 200.0,
  302. dataIndex : "ca_default",
  303. xtype : "",
  304. renderer: function (v, m, r) {
  305. if(v=='0'){
  306. return '';
  307. }else if(v=='1'){
  308. return '是';
  309. }
  310. return v;
  311. }
  312. }]
  313. }],
  314. auditTexts: {
  315. auditCode: 'OPEN',
  316. auditText: '已开启',
  317. unAuditCode: 'CLOSE',
  318. unAuditText: '已关闭',
  319. auditBtnText: '启用',
  320. unAuditBtnText: '禁用',
  321. },
  322. });