| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451 |
- Ext.define('saas.view.document.customer.FormPanel', {
- extend: 'saas.view.core.form.FormPanel',
- xtype: 'document-customer-formpanel',
- controller: 'document-customer-formpanel',
- viewModel: 'document-customer-formpanel',
-
- caller:'Customer',
- //字段属性
- _title:'客户资料',
- _idField: 'id',
- _codeField: 'cu_code',
- _statusField: 'cu_status',
- _statusCodeField: 'cu_statuscode',
- _readUrl:'/api/document/customer/read/',
- _saveUrl:'/api/document/customer/save',
- _openUrl:'/api/document/customer/open',
- _closeUrl:'/api/document/customer/close',
- _deleteUrl:'/api/document/customer/delete/',
- initId:0,
- codeInHeader: false,
- defaultItems: [{
- xtype: 'hidden',
- name: 'id',
- fieldLabel: 'id',
- allowBlank: true,
- columnWidth: 0.25
- },{
- xtype: 'textfield',
- name: 'cu_name',
- fieldLabel: '客户名称',
- allowBlank: false,
- columnWidth: 0.5
- },{
- xtype: 'textfield',
- name: 'cu_code',
- fieldLabel: '客户编号',
- allowBlank: true,
- columnWidth: 0.25
- },{
- xtype : "remotecombo",
- storeUrl:'/api/document/customerkind/getCombo',
- name : "cu_type",
- fieldLabel : "客户类型",
- allowBlank : false,
- columnWidth : 0.25,
- hiddenBtn:false,//true 则会关闭新增按钮功能
- addHandler:function(b){
- var document = Ext.create('saas.view.document.kind.Kind',{});
- var form = this.ownerCmp.ownerCt;
- this.dialog = form.getController().getView().add({
- xtype: 'document-kind-childwin',
- bind: {
- title: '新增客户类型'
- },
- dataKind:'customerkind',
- belong:document.etc['customerkind'],
- _parent:form,
- _combo:this.ownerCmp,
- record:null,
- session: true
- });
- this.dialog.show();
- }
- },{
- xtype: 'hidden',
- name: 'cu_status',
- fieldLabel: '状态',
- allowBlank: true,
- columnWidth: 0
- },{
- xtype: 'hidden',
- name: 'cu_statuscode',
- fieldLabel: '状态码',
- allowBlank: true,
- columnWidth: 0.25
- },{
- xtype : "datefield",
- name : "cu_begindate",
- fieldLabel : "期初日期",
- allowBlank : true,
- columnWidth : 0.25
- },{
- xtype : "numberfield",
- hideTrigger:true,
- name : "cu_beginaramount",
- fieldLabel : "期初应收",
- allowBlank : true,
- columnWidth : 0.25,
- decimalPrecision: 8,
- minValue:0,
- renderer : function(v) {
- var arr = (v + '.').split('.');
- var xr = (new Array(arr[1].length)).fill('0');
- var format = '0.' + xr.join();
- return Ext.util.Format.number(v, format);
- },
- },{
- xtype : "numberfield",
- hideTrigger:true,
- name : "cu_beginprerecamount",
- fieldLabel : "期初预收",
- allowBlank : true,
- columnWidth : 0.25,
- decimalPrecision: 8,
- minValue:0,
- renderer : function(v) {
- var arr = (v + '.').split('.');
- var xr = (new Array(arr[1].length)).fill('0');
- var format = '0.' + xr.join();
- return Ext.util.Format.number(v, format);
- },
- },{
- xtype : "numberfield",
- name : "cu_taxrate",
- fieldLabel : "税率",
- allowBlank : false,
- columnWidth : 0.25,
- minValue:0,
- maxValue:100,
- },{
- xtype : "numberfield",
- hideTrigger:true,
- name : "cu_promisedays",
- fieldLabel : "承付天数",
- allowBlank : true,
- columnWidth : 0.25,
- decimalPrecision:0,
- minValue:0
- },{
- xtype : "numberfield",
- hideTrigger:true,
- name : "cu_credit",
- fieldLabel : "额度",
- allowBlank : true,
- columnWidth : 0.25,
- decimalPrecision: 8,
- minValue:0,
- renderer : function(v) {
- var arr = (v + '.').split('.');
- var xr = (new Array(arr[1].length)).fill('0');
- var format = '0.' + xr.join();
- return Ext.util.Format.number(v, format);
- },
- },{
- xtype : "textfield",
- name : "cu_sellername",
- fieldLabel : "业务员",
- ignore:true,
- editable:false,
- readOnly:true,
- allowBlank : true,
- columnWidth : 0.25
- },{
- ignore:true,
- xtype : "hidden",
- name : "cu_nsrzh",
- fieldLabel : "纳税人识别号",
- allowBlank : true,
- columnWidth : 0.25
- },{
- ignore:true,
- xtype : "hidden",
- name : "cu_bankaccount",
- fieldLabel : "开户银行",
- allowBlank : true,
- columnWidth : 0.25
- },{
- ignore:true,
- xtype : "hidden",
- name : "cu_bankcode",
- fieldLabel : "银行账户",
- allowBlank : true,
- columnWidth : 0.25
- },{
- xtype:'textfield',
- name : "cu_uu",
- fieldLabel : "客户UU",
- allowBlank : true,
- readOnly:true,
- editable:false,
- columnWidth : 0.25
- },{
- xtype:'textfield',
- name : "cu_leftamount",
- fieldLabel : "应收款余额",
- allowBlank : true,
- readOnly:true,
- ignore:true,
- columnWidth : 0.25,
- decimalPrecision: 8,
- minValue:0,
- renderer : function(v) {
- var arr = (v + '.').split('.');
- var xr = (new Array(arr[1].length)).fill('0');
- var format = '0.' + xr.join();
- return Ext.util.Format.number(v, format);
- },
- },{
- xtype : "datefield",
- name : "createTime",
- fieldLabel : "创建时间",
- allowBlank : true,
- hidden:true,
- columnWidth : 0
- },{
- xtype : "datefield",
- name : "updateTime",
- fieldLabel : "更新时间",
- allowBlank : true,
- hidden:true,
- columnWidth : 0
- }, {
- height: 169,
- xtype : "detailGridField",
- storeModel:'saas.model.document.customercontact',
- detnoColumn: 'cc_detno',
- showCount: false,
- deleteDetailUrl:'/api/document/customer/deletecontact/',
- columns : [
- {
- text : "ID",
- dataIndex : "id",
- hidden : true,
- xtype : "numbercolumn"
- },
- {
- text : "关联ID",
- dataIndex : "cc_cuid",
- hidden : true,
- xtype : "numbercolumn"
- },
- {
- allowBlank:false,
- text : "联系人",
- editor : {
- xtype : "textfield"
- },
- dataIndex : "cc_name",
- xtype : "",
- items : null
- },
- {
- allowBlank:false,
- text : "电话",
- editor : {
- hideTrigger:true,
- xtype : "textfield"
- },
- dataIndex : "cc_tel",
- xtype : "",
- items : null
- },
- {
- allowBlank:true,
- text : "微信/QQ",
- editor : {
- xtype : "textfield"
- },
- dataIndex : "cc_qq",
- xtype : "",
- items : null
- },
- {
- text : "邮箱",
- editor : {
- xtype : "textfield"
- },
- dataIndex : "cc_email",
- xtype : "",
- items : null
- },
- {
- editor : {
- displayField : "display",
- format : "",
- hideTrigger : false,
- maxLength : 100.0,
- minValue : null,
- positiveNum : false,
- queryMode : "local",
- valueField : "value",
- xtype : "combo",
- store:{
- fields: ['display', 'value'],
- data : [
- {"display":"是", "value":'1'},
- {"display":"否", "value":'0'}
- ]
- },
- listeners:{
- 'change':function(c,newVal,oldVal){
- if(newVal=='1'){
- var grid = c.ownerCt.column.ownerCt.ownerCt;
- var nowId = grid.selModel.lastSelected.id;
- var items = grid.store.data.items
- for (let index = 0; index < items.length; index++) {
- if(items[index].id!=nowId){
- items[index].set('cc_default',"")
- }
- }
- }
- }
- }
- },
- text : "是否默认联系人",
- width : 200.0,
- dataIndex : "cc_default",
- xtype : "",
- renderer: function (v, m, r) {
- if(v=='0'){
- return '';
- }else if(v=='1'){
- return '是';
- }
- return v;
- }
- }]
- } ,{
- height: 169,
- xtype : "detailGridField",
- storeModel:'saas.model.document.customeraddress',
- detnoColumn: 'ca_detno',
- showCount: false,
- deleteDetailUrl:'/api/document/customer/deleteaddress/',
- columns : [
- {
- text : "ID",
- dataIndex : "id",
- hidden : true,
- xtype : "numbercolumn"
- },
- {
- text : "关联ID",
- dataIndex : "ca_cuid",
- hidden : true,
- xtype : "numbercolumn"
- },
- {
- allowBlank:false,
- text : "送货地址",
- editor : {
- xtype : "textfield"
- },
- dataIndex : "ca_address",
- xtype : "",
- items : null
- },
- {
- allowBlank:true,
- text : "联系人",
- editor : {
- xtype : "textfield"
- },
- dataIndex : "ca_person",
- xtype : "",
- items : null
- },
- {
- allowBlank:true,
- text : "联系电话",
- editor : {
- xtype : "textfield",
- hideTrigger:true,
- },
- dataIndex : "ca_phone",
- xtype : "",
- items : null
- },
- {
- allowBlank:false,
- editor : {
- displayField : "display",
- format : "",
- hideTrigger : false,
- maxLength : 100.0,
- minValue : null,
- positiveNum : false,
- queryMode : "local",
- valueField : "value",
- xtype : "combo",
- store:{
- fields: ['display', 'value'],
- data : [
- {"display":"是", "value":'1'},
- {"display":"否", "value":'0'}
- ]
- },
- listeners:{
- 'change':function(c,newVal,oldVal){
- if(newVal=='1'){
- var grid = c.ownerCt.column.ownerCt.ownerCt;
- var nowId = grid.selModel.lastSelected.id;
- var items = grid.store.data.items
- for (let index = 0; index < items.length; index++) {
- if(items[index].id!=nowId){
- items[index].set('ca_default',"")
- }
- }
- }
- }
- }
- },
- text : "是否默认地址",
- dataIndex : "ca_default",
- xtype : "",
- renderer: function (v, m, r) {
- if(v=='0'){
- return '';
- }else if(v=='1'){
- return '是';
- }
- return v;
- }
- }]
- }],
- defaultButtons:[{
- cls: 'x-formpanel-btn-orange',
- xtype: 'button',
- text: '新增',
- bind: {
- hidden: '{!id}'
- },
- handler: 'add'
- }, {
- xtype: 'button',
- text: '保存',
- handler: 'onSave',
- }, {
- xtype: 'button',
- text: '删除',
- handler: 'delete'
- }, {
- xtype: 'button',
- bind: {
- text: '{auditBtnText}'
- },
- handler: "auditBtnClick",
- }],
- auditTexts: {
- auditCode: 'CLOSE',
- auditText: '已关闭',
- unAuditCode: 'OPEN',
- unAuditText: '已开启',
- auditBtnText: '禁用',
- unAuditBtnText: '启用',
- }
- });
|