FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. Ext.define('saas.view.document.customer.panel.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'customer-panel-formpanel',
  4. controller: 'customer-panel-formpanel',
  5. viewModel: 'customer-panel-formpanel',
  6. caller:'Customer',
  7. //字段属性
  8. _title:'客户资料',
  9. _idField: 'id',
  10. _codeField: 'cu_code',
  11. _statusField: 'cu_status',
  12. _statusCodeField: 'cu_statuscode',
  13. _readUrl:'http://192.168.253.228:9480/customer/read/',
  14. _saveUrl:'http://192.168.253.228:9480/customer/save',
  15. _auditUrl:'http://192.168.253.228:8800/purchase/audit',
  16. _deleteUrl:'http://192.168.253.228:8800/purchase/delete/',
  17. initId:0,
  18. defaultItems: [{
  19. xtype: 'hidden',
  20. name: 'id',
  21. fieldLabel: 'id',
  22. allowBlank: true,
  23. columnWidth: 0.25
  24. },{
  25. xtype: 'textfield',
  26. name: 'cu_name',
  27. fieldLabel: '客户名称',
  28. allowBlank: false,
  29. columnWidth: 0.25
  30. },{
  31. xtype: 'textfield',
  32. name: 'cu_code',
  33. fieldLabel: '客户编号',
  34. allowBlank: true,
  35. columnWidth: 0.25
  36. },{
  37. xtype: 'textfield',
  38. name: 'cu_status',
  39. fieldLabel: '状态',
  40. allowBlank: true,
  41. columnWidth: 0.25
  42. },{
  43. xtype: 'hidden',
  44. name: 'cu_statuscode',
  45. fieldLabel: '状态码',
  46. allowBlank: true,
  47. columnWidth: 0.25
  48. },{
  49. xtype : "remotecombo",
  50. storeUrl:"http://192.168.253.31:9480/customerkind/getCombo",
  51. name : "cu_type",
  52. fieldLabel : "客户类型",
  53. allowBlank : true,
  54. queryMode: 'local',
  55. displayField: 'display',
  56. valueField: 'value',
  57. columnWidth : 0.25,
  58. etc:{
  59. vendorkind:{
  60. keyField:'id',
  61. dataField:'ck_name',
  62. reqUrl:'http://192.168.253.31:9480/customerkind/save',
  63. delUrl:'http://192.168.253.31:9480/customerkind/delete'
  64. }
  65. },
  66. addHandler:function(b){
  67. var form = this.ownerCmp.ownerCt;
  68. this.dialog = form.getController().getView().add({
  69. xtype: 'document-kind-childwin',
  70. bind: {
  71. title: '新增客户类型'
  72. },
  73. dataKind:'vendorkind',
  74. belong:this.ownerCmp.etc['customerkind'],
  75. _parent:form,
  76. record:null,
  77. session: true
  78. });
  79. this.dialog.show();
  80. }
  81. },{
  82. format : "Y-m-d",
  83. xtype : "datefield",
  84. name : "createTime",
  85. fieldLabel : "创建时间",
  86. allowBlank : true,
  87. columnWidth : 0.25
  88. },{
  89. format : "Y-m-d",
  90. xtype : "datefield",
  91. name : "cu_begindate",
  92. fieldLabel : "期初日期",
  93. allowBlank : true,
  94. columnWidth : 0.25
  95. },{
  96. xtype : "numberfield",
  97. hideTrigger:true,
  98. name : "cu_beginaramount",
  99. fieldLabel : "期初应收",
  100. allowBlank : true,
  101. columnWidth : 0.25
  102. },{
  103. xtype : "numberfield",
  104. hideTrigger:true,
  105. name : "cu_beginprerecamount",
  106. fieldLabel : "期初预收",
  107. allowBlank : true,
  108. columnWidth : 0.25
  109. },{
  110. xtype : "numberfield",
  111. hideTrigger:true,
  112. name : "cu_promisedays",
  113. fieldLabel : "承付天数",
  114. allowBlank : true,
  115. columnWidth : 0.25
  116. },{
  117. xtype : "numberfield",
  118. name : "cu_taxrate",
  119. fieldLabel : "税率",
  120. allowBlank : true,
  121. columnWidth : 0.25
  122. },{
  123. xtype : "numberfield",
  124. name : "cu_ta",
  125. fieldLabel : "应收款余额",
  126. allowBlank : true,
  127. readOnly:true,
  128. editable:false,
  129. columnWidth : 0.25
  130. },{
  131. xtype:'textfield',
  132. name : "cu_uu",
  133. fieldLabel : "客户UU",
  134. allowBlank : true,
  135. columnWidth : 0.25
  136. },{
  137. format : "Y-m-d",
  138. xtype : "datefield",
  139. name : "updateTime",
  140. fieldLabel : "更新时间",
  141. allowBlank : true,
  142. columnWidth : 0.25
  143. }, {
  144. xtype : "detailGridField",
  145. _detnoColumn: 'cc_detno',
  146. storeModel:'saas.model.document.customercontact',
  147. _deleteDetailUrl:'http://192.168.253.228:8800/purchase/deleteItem/',
  148. columns : [
  149. {
  150. text : "序号",
  151. dataIndex : "cc_detno",
  152. width : 100,
  153. xtype : "numbercolumn",
  154. align : 'center',
  155. format:'0',
  156. summaryType: 'count',
  157. summaryRenderer: function(value, summaryData, dataIndex) {
  158. return Ext.String.format('合计: {0}条', value);
  159. },
  160. },
  161. {
  162. text : "ID",
  163. dataIndex : "id",
  164. width : 0,
  165. xtype : "numbercolumn"
  166. },
  167. {
  168. text : "关联ID",
  169. dataIndex : "cc_cuid",
  170. width : 0,
  171. xtype : "numbercolumn"
  172. },
  173. {
  174. text : "联系人",
  175. editor : {
  176. xtype : "textfield"
  177. },
  178. dataIndex : "cc_name",
  179. width : 120.0,
  180. xtype : "",
  181. items : null
  182. },
  183. {
  184. text : "电话",
  185. editor : {
  186. xtype : "textfield"
  187. },
  188. dataIndex : "cc_tel",
  189. width : 120.0,
  190. xtype : "",
  191. items : null
  192. },
  193. {
  194. text : "微信/QQ",
  195. editor : {
  196. xtype : "textfield"
  197. },
  198. dataIndex : "cc_qq",
  199. width : 120.0,
  200. xtype : "",
  201. items : null
  202. },
  203. {
  204. text : "邮箱",
  205. editor : {
  206. xtype : "textfield"
  207. },
  208. dataIndex : "cc_email",
  209. width : 120.0,
  210. xtype : "",
  211. items : null
  212. },
  213. {
  214. editor : {
  215. displayField : "display",
  216. editable : true,
  217. format : "",
  218. hideTrigger : false,
  219. maxLength : 100.0,
  220. minValue : null,
  221. positiveNum : false,
  222. queryMode : "local",
  223. valueField : "value",
  224. xtype : "combo",
  225. store:{
  226. fields: ['display', 'value'],
  227. data : [
  228. {"display":"是", "value":'1'},
  229. {"display":"否", "value":'0'}
  230. ]
  231. }
  232. },
  233. text : "是否默认联系人",
  234. width : 200.0,
  235. dataIndex : "cc_default",
  236. xtype : "",
  237. renderer: function (v, m, r) {
  238. if(v=='0'){
  239. return '';
  240. }else if(v=='1'){
  241. return '是';
  242. }
  243. return v;
  244. }
  245. }]
  246. } ,{
  247. xtype : "detailGridField",
  248. _detnoColumn: 'ca_detno',
  249. storeModel:'saas.model.document.customeraddress',
  250. _deleteDetailUrl:'http://192.168.253.228:8800/purchase/deleteItem/',
  251. columns : [
  252. {
  253. text : "序号",
  254. dataIndex : "ca_detno",
  255. width : 100,
  256. xtype : "numbercolumn",
  257. align : 'center',
  258. format:'0',
  259. summaryType: 'count',
  260. summaryRenderer: function(value, summaryData, dataIndex) {
  261. return Ext.String.format('合计: {0}条', value);
  262. },
  263. },
  264. {
  265. text : "ID",
  266. dataIndex : "id",
  267. width : 0,
  268. xtype : "numbercolumn"
  269. },
  270. {
  271. text : "关联ID",
  272. dataIndex : "ca_cuid",
  273. width : 0,
  274. xtype : "numbercolumn"
  275. },
  276. {
  277. text : "送货地址",
  278. editor : {
  279. xtype : "textfield"
  280. },
  281. dataIndex : "ca_address",
  282. width : 120.0,
  283. xtype : "",
  284. items : null
  285. },
  286. {
  287. text : "联系人",
  288. editor : {
  289. xtype : "textfield"
  290. },
  291. dataIndex : "ca_person",
  292. width : 120.0,
  293. xtype : "",
  294. items : null
  295. },
  296. {
  297. text : "联系电话",
  298. editor : {
  299. xtype : "textfield"
  300. },
  301. dataIndex : "ca_phone",
  302. width : 120.0,
  303. xtype : "",
  304. items : null
  305. },
  306. {
  307. editor : {
  308. displayField : "display",
  309. editable : true,
  310. format : "",
  311. hideTrigger : false,
  312. maxLength : 100.0,
  313. minValue : null,
  314. positiveNum : false,
  315. queryMode : "local",
  316. valueField : "value",
  317. xtype : "combo",
  318. store:{
  319. fields: ['display', 'value'],
  320. data : [
  321. {"display":"是", "value":'1'},
  322. {"display":"否", "value":'0'}
  323. ]
  324. },
  325. listeners:{
  326. 'change':function(c,newVal,oldVal){
  327. var grid = c.ownerCt.column.ownerCt.ownerCt;
  328. var nowId = grid.selModel.lastSelected.id;
  329. var items = grid.store.data.items
  330. }
  331. }
  332. },
  333. text : "是否默认地址",
  334. width : 200.0,
  335. dataIndex : "ca_default",
  336. xtype : "",
  337. renderer: function (v, m, r) {
  338. if(v=='0'){
  339. return '';
  340. }else if(v=='1'){
  341. return '是';
  342. }
  343. return v;
  344. }
  345. }]
  346. }]
  347. });