FormPanel.js 9.8 KB

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