Ext.define('saas.view.document.vendor.FormPanel', { extend: 'saas.view.core.form.FormPanel', xtype: 'document-vendor-formpanel', controller: 'document-vendor-formpanel', viewModel: 'document-vendor-formpanel', caller:'Vendor', //字段属性 _title:'供应商资料', _idField: 'id', _codeField: 've_code', _statusField: 've_status', _statusCodeField: 've_statuscode', _readUrl:'/api/document/vendor/read', _saveUrl:'/api/document/vendor/save', _openUrl:'/api/document/vendor/open', _closeUrl:'/api/document/vendor/close', _deleteUrl:'/api/document/vendor/delete', initId:0, codeInHeader: false, defaultItems: [{ xtype: 'hidden', name: 'id', fieldLabel: 'id', allowBlank: true, columnWidth: 0.25, group: '基础信息', },{ xtype: 'textfield', name: 've_code', fieldLabel: '供应商编号', allowBlank: false, columnWidth: 0.25, group: '基础信息', },{ xtype: 'textfield', name: 've_name', fieldLabel: '供应商名称', allowBlank: false, columnWidth: 0.25, group: '基础信息', },{ xtype: 'textfield', name: 've_shortname', fieldLabel: '供应商简称', columnWidth: 0.25, hidden: true, group: '基础信息', },{ xtype: 'hidden', name: 've_status', fieldLabel: '状态', allowBlank: true, columnWidth: 0.25 },{ xtype: 'hidden', name: 've_statuscode', fieldLabel: '状态码', allowBlank: true, columnWidth: 0.25 },{ editable:false, xtype : "remotecombo", storeUrl:'/api/document/vendorkind/getCombo', name : "ve_type", fieldLabel : "供应商类型", columnWidth : 0.25, group: '基础信息', 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:'vendorkind', belong:document.etc['vendorkind'], _parent:form, _combo:this.ownerCmp, record:null, session: true }); this.dialog.show(); } },{ xtype : "datefield", name : "createTime", fieldLabel : "创建时间", allowBlank : true, hidden:true, columnWidth : 0 },{ xtype : "datefield", name : "ve_begindate", format:'Y-m-d', fieldLabel : "期初日期", allowBlank : true, columnWidth : 0.25, group: '交易信息', },{ xtype : "numberfield", hideTrigger:true, name : "ve_beginapamount", fieldLabel : "期初应付", allowBlank : true, columnWidth : 0.25, decimalPrecision: 2, minValue:0, group: '交易信息', renderer : function(v) { return saas.util.BaseUtil.numberFormat(v, 2, true); }, },{ xtype : "numberfield", hideTrigger:true, name : "ve_beginprepayamount", fieldLabel : "期初预付", allowBlank : true, columnWidth : 0.25, decimalPrecision: 2, minValue:0, group: '交易信息', renderer : function(v) { return saas.util.BaseUtil.numberFormat(v, 2, true); }, },{ xtype : "numberfield", name : "ve_leftamount", fieldLabel : "应付款余额", allowBlank : true, readOnly:true, ignore:true, columnWidth : 0.25, decimalPrecision: 2, group: '交易信息', renderer : function(v) { return saas.util.BaseUtil.numberFormat(v, 2, true); }, },{ xtype : "numberfield", name : "ve_taxrate", hideTrigger:true, fieldLabel : "税率", allowBlank : false, columnWidth : 0.25, minValue:0, maxValue:100, group: '交易信息', },{ xtype : "numberfield", hideTrigger:true, name : "ve_promisedays", fieldLabel : "结算天数", allowBlank : true, columnWidth : 0.25, minValue:0, maxLength: 8, enforceMaxLength: true, decimalPrecision: 0, group: '交易信息', },{ xtype : "textfield", name : "ve_nsrzh", fieldLabel : "纳税人识别号", allowBlank : true, columnWidth : 0.25, group: '基础信息', },{ xtype : "textfield", name : "ve_bankcode", fieldLabel : "开户银行", allowBlank : true, columnWidth : 0.25 },{ xtype : "textfield", name : "ve_bankaccount", fieldLabel : "银行账户", allowBlank : true, columnWidth : 0.25 },{ xtype:'hidden', name : "ve_uu", fieldLabel : "供应商UU", allowBlank : true, editable:false, readOnly:true, columnWidth : 0.25 },{ xtype : "datefield", name : "updateTime", fieldLabel : "更新时间", allowBlank : true, hidden:true, columnWidth : 0.25 }, { xtype : "hidden", name : "ve_buyercode", fieldLabel : "采购员编号" },{ xtype : "employeeDbfindTrigger", name : "ve_buyername", fieldLabel : "采购员", columnWidth : 0.25, defaultValue:saas.util.BaseUtil.getCurrentUser().realname },{ xtype : "hidden", name : "ve_buyerid", fieldLabel : "采购员ID", defaultValue:saas.util.BaseUtil.getCurrentUser().id },{ xtype : "textfield", name : "ve_address", fieldLabel : "地址", allowBlank : true, columnWidth : 0.75 },{ fieldLabel : "备注", xtype:'textfield', name : "ve_remark", columnWidth : 1 }, { xtype : "detailGridField", storeModel:'saas.model.document.vendorcontact', detnoColumn: 'vc_detno', showCount: false, deleteDetailUrl:'/api/document/vendor/deleteContact', columns : [ { text : "ID", dataIndex : "id", hidden : true, xtype : "numbercolumn" }, { text : "关联ID", dataIndex : "vc_veid", hidden : true, xtype : "numbercolumn" }, { allowBlank:false, text : "联系人", editor : { xtype : "textfield" }, dataIndex : "vc_name", width:110 }, { allowBlank:false, text : "电话", editor : { // regex:/^[\d | -]*$/, // regexText:'请输入正确的手机号码', hideTrigger:true, xtype : "textfield" }, dataIndex : "vc_tel", width:200 }, { allowBlank:true, text : "微信/QQ", editor : { xtype : "textfield" }, dataIndex : "vc_qq", width:110 }, { text : "邮箱", editor : { xtype : "textfield" }, dataIndex : "vc_email", width:180 }, { text : "默认联系人", dataIndex : "vc_default", xtype : "yncolumn", }] } ], defaultButtons:[{ cls: 'x-formpanel-btn-blue', 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: 'BANNED', auditText: '已禁用', unAuditCode: 'ENABLE', unAuditText: '已启用', auditBtnText: '禁用', unAuditBtnText: '启用', } });