FormPanel.js 9.8 KB

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