| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- Ext.define('erp.view.b2c.BrandInApply',{
- extend: 'Ext.Viewport',
- layout: 'fit',
- hideBorders: true,
- initComponent : function(){
- var me = this;
- formCondition = getUrlParam('formCondition');
- Ext.apply(me, {
- items: [{
- id:'BrandInApplyViewport',
- layout: 'anchor',
- bodyStyle: 'background: #f1f1f1;',
- items: [{
- xtype: 'form',
- id:'form',
- autoScroll:true,
- anchor: '100% 100%',
- codeField:'br_code',
- keyField:'br_id',
- statusField:'br_status',
- statuscodeField:'br_statuscode',
- getIdUrl: 'common/getId.action?seq=BRANDINAPPLY_SEQ',
- submitUrl: 'b2c/product/submitBrandInApply.action',
- resSubmitUrl: 'b2c/product/resSubmitBrandInApply.action',
- auditUrl: 'b2c/product/auditBrandInApply.action',
- resAuditUrl: 'b2c/product/resAuditBrandInApply.action',
- tablename:'BrandInApply',
- title:'品牌入库申请',
- bodyPadding:'5 0 0 30',
- bodyStyle: 'background: #f1f1f1;',
- defaults:{
- xtype:'textfield',
- beforeLabelTextTpl: [
- '<span style="color:red;font-weight:bold" data-qtip="必填选项">*</span>'
- ],
- labelStyle:"color:red;"
- },
- items:[{
- xtype:"container",
- html:'<div class="x-form-group-label" id="group1" style="background-color: #bfbfbe;height:22px!important;" title="收拢"><h6>品牌基本信息</h6></div>',
- style:"padding-bottom: 4px;"
- //onclick="javascript:collapse(1);"
- },{
- name:'br_name',
- id:'br_name',
- fieldLabel:'名称',
- width:400,
- allowBlank : false,
- beforeLabelTextTpl: [
- '<span style="color:red;font-weight:bold" data-qtip="必填选项">*</span>'
- ],
- group:1,
- groupName:"品牌基本信息"
- },{
- name:'br_vendor',
- id:'br_vendor',
- fieldLabel:'厂商',
- width:1000,
- allowBlank : false,
- group:1,
- groupName:"品牌基本信息"
- },{
- name:'br_logourl',
- id:'br_logourl',
- hidden:true,
- allowBlank:false
- },{
- id:'fileform',
- xtype:'form',
- bodyStyle: 'background: transparent no-repeat 0 0;border: none;',
- items:[{
- name:'br_logo',
- id:'br_logo',
- xtype: 'filefield',
- labelStyle:"color:red;",
- columnWidth:1,
- name: 'file',
- fieldLabel:'Logo',
- //fieldLabel:'<div style="color:blue;padding-left:10px;">品牌Logo,建议图片尺寸在150*90像素左右</div>',
- //allowBlank: false,
- buttonOnly:true,
- group:1,
- groupName:"品牌基本信息",
- buttonConfig:{
- text:'选择图片',
- iconCls:'x-button-icon-pic'
- },
- listeners: {
- change: function(field){
- field.ownerCt.upload(field);
- }
- }
- },{
- xtype: 'image',
- width: 155,
- height: 96,
- id:'logo',
- hidden:true,
- margin:'5 0 10 110'
- }],
- upload: function(field){
- if(field.ownerCt.down('image').hidden){
- field.ownerCt.getForm().submit({
- url: basePath + 'b2c/product/saveBrandLogo.action',
- waitMsg:'正在上传',
- success: function(fp, o){
- if(o.result.success){
- Ext.Msg.alert('提示','上传成功');
- var logo=Ext.getCmp('logo');
- logo.show();
- logo.setSrc(o.result.filepath);
- Ext.getCmp('br_logourl').setValue(o.result.filepath);
- }else Ext.Msg.alert('提示','上传失败,请检查文件大小及格式!');
- },
- failure:function(fp,o){
- Ext.Msg.alert('提示','上传失败,请检查文件大小及格式!');
- }
- });
- }
- }
- },{
- xtype:'htmleditor',
- fieldLabel:'简介',
- id:'br_brief',
- name:'br_brief',
- width:1000,
- allowBlank: false,
- group:1,
- groupName:"品牌基本信息"
- },{
- xtype : 'fieldcontainer',
- fieldLabel : '区域',
- defaultType: 'radiofield',
- allowBlank: false,
- group:1,
- groupName:"品牌基本信息",
- defaults: {
- flex: 1
- },
- layout: 'hbox',
- items: [
- {
- boxLabel : '大陆',
- name : 'br_area',
- inputValue: '大陆',
- id : 'radio1'
- }, {
- boxLabel : '港澳台',
- name : 'br_area',
- inputValue: '港澳台',
- id : 'radio2'
- }, {
- boxLabel : '日韩',
- name : 'br_area',
- inputValue: '日韩',
- id : 'radio3'
- }, {
- boxLabel : '欧美',
- name : 'br_area',
- inputValue: '欧美',
- id : 'radio4'
- }, {
- boxLabel : '其它',
- name : 'br_area',
- inputValue: '其它',
- id : 'radio5'
- }
- ]
- },{
- xtype:"container",
- html:'<div class="x-form-group-label" id="group2" style="background-color: #bfbfbe;height:22px!important;" title="收拢"><h6>品牌应用</h6></div>',
- style:"padding-bottom: 4px;"
- //onclick="javascript:collapse(2);"
- },{
- name:'br_series',
- id:'br_series',
- fieldLabel:'主打产品',
- xtype:'textareafield',
- grow : true,
- width:1000,
- heigth:100,
- allowBlank: false,
- group:2,
- groupName:"品牌应用"
- },{
- xtype: 'checkboxgroup',
- fieldLabel: '应用领域',
- //defaultType: 'checkboxfield',
- //allowBlank: false,
- group:2,
- groupName:"品牌应用",
- id:'br_application',
- defaults: {
- flex: 1
- },
- layout: 'hbox',
- items: [
- {
- boxLabel : '移动手持',
- name : 'br_application',
- inputValue: '移动手持',
- id : 'checkbox1'
- }, {
- boxLabel : '医疗电子',
- name : 'br_application',
- inputValue: '医疗电子',
- id : 'checkbox2'
- }, {
- boxLabel : '消费电子',
- name : 'br_application',
- inputValue: '消费电子',
- id : 'checkbox3'
- }, {
- boxLabel : '通信网络',
- name : 'br_application',
- inputValue: '通信网络',
- id : 'checkbox4'
- }, {
- boxLabel : '汽车电子',
- name : 'br_application',
- inputValue: '汽车电子',
- id : 'checkbox5'
- }, {
- boxLabel : '能源控制',
- name : 'br_application',
- inputValue: '能源控制',
- id : 'checkbox6'
- }, {
- boxLabel : '家用电器',
- name : 'br_application',
- inputValue: '家用电器',
- id : 'checkbox7'
- }, {
- boxLabel : '工业控制',
- name : 'br_application',
- inputValue: '工业控制',
- id : 'checkbox8'
- }, {
- boxLabel : '安防监控',
- name : 'br_application',
- inputValue: '安防监控',
- id : 'checkbox9'
- }
- ]
- },{
- xtype: 'fieldcontainer',
- margin:'5 0 10 110',
- padding:'5 5 5 5',
- combineErrors: true,
- group:2,
- groupName:"品牌应用",
- msgTarget: 'under',
- defaults: {
- hideLabel: true
- },
- items: [{
- layout:'column',
- bodyStyle: 'background: #f1f1f1;border:none',
- items:[{
- xtype:'button',
- text: '其他领域',
- cls: 'x-dd-drop-ok-add',
- iconCls: 'x-dd-drop-icon',
- columnWidth:0.1,
- handler:function(btn){
- var f = btn.ownerCt;
- f.insert(f.items.length, {
- xtype:'triggerfield',
- name: 'otherApplication',
- columnWidth:.40,
- style:'margin-left:5px;',
- triggerCls : Ext.baseCSSPrefix + "form-clear-trigger",
- onTriggerClick:function(){
- this.ownerCt.remove(this);
- }
- });
- }
- },{
- xtype: 'displayfield',
- columnWidth:0.9,
- value: '如果您的品牌应用领域不在上述范围,您可以手动添加其他领域'
- }]
- }]
- },{
- xtype:'htmleditor',
- name:'br_achievement',
- id:'br_achievement',
- fieldLabel:'主要成就',
- width:1000,
- allowBlank: false,
- group:2,
- groupName:"品牌应用"
- },{
- id:'br_id',
- name:'br_id',
- hidden:true
- },{
- id:'br_code',
- name:'br_code',
- hidden:true
- },{
- id:'br_date',
- name:'br_date',
- xytpe:'datefield',
- defaultvalue:new Date(),
- hidden:true
- },{
- id:'br_indate',
- name:'br_indate',
- xytpe:'datefield',
- value:new Date(),
- hidden:true
- },{
- id:'br_recorder',
- name:'br_recorder',
- hidden:true
- },{
- id:'br_status',
- name:'br_status',
- value:'在录入',
- hidden:true
- },{
- id:'br_statuscode',
- name:'br_statuscode',
- value:'',
- hidden:true
- },{
- id:'br_auditman',
- name:'br_auditman',
- hidden:true
- },{
- id:'br_auditdate',
- name:'br_auditdate',
- hidden:true
- }] ,
- buttonAlign:'center',
- buttons:[{
- xtype:'erpSaveButton',
- hidden:_nobutton==1 || !Ext.isEmpty(formCondition)
- },{
- xtype:'erpUpdateButton',
- hidden:_nobutton==1 || Ext.isEmpty(formCondition)
- },{
- xtype:'erpSubmitButton',
- hidden:_nobutton==1 || Ext.isEmpty(formCondition)
- },{
- xtype:'erpResSubmitButton',
- hidden:_nobutton==1 || Ext.isEmpty(formCondition)
- },{
- xtype:'erpAuditButton',
- hidden:_nobutton==1 || Ext.isEmpty(formCondition)
- },{
- xtype:'erpResAuditButton',
- hidden:_nobutton==1 || Ext.isEmpty(formCondition)
- }]
- }]
- }]
- });
- me.getData();
- me.callParent(arguments);
- },
- getData:function(){
- //从url解析参数
- if(formCondition != null && formCondition != ''){
- formCondition = (formCondition == null) ? "" : formCondition.replace(/IS/g,"=");
- var me = this;
- this.setLoading(true);
- Ext.Ajax.request({
- url : basePath + 'b2c/product/getBrandData.action',
- params: {
- caller: caller,
- id: formCondition.split("=")[1],
- _noc: (getUrlParam('_noc') || me._noc)
- },
- method : 'post',
- callback : function(options,success,response){
- me.setLoading(false);
- var res = new Ext.decode(response.responseText);
- if(res.exceptionInfo != null){
- showError(res.exceptionInfo);return;
- }else{
- var form = Ext.getCmp('form');
- var o = {};
- o.br_application = res.data.br_application.split(",");
- res.data.br_application = o;
- form.getForm().setValues(res.data);
- if(res.data.br_logourl){
- var logo=Ext.getCmp('logo');
- logo.show();
- logo.setSrc(res.data.br_logourl);
- }
- if(res.data.br_statuscode = 'AUDITED'){
- form.readOnly = true;
- }
- }
- }
- });
- }
- }
- });
|