Ext.js给form加背景图片

{
                iconCls: 'zyl_icons_showdetail',
                tooltip: '查看',
                handler: function(gridView, rowIndex, colIndex) {
                    var rowInfo = gridView.up('grid').getStore().getAt(rowIndex);
                    if (Ext.isEmpty(rowInfo.get('adFlag'))) {
                        rowInfo.set('adFlag', 0);
                    }
                    var viewWindow = me.getOpBillLineInfoViewWindow(new Array());
                    var viewForm = viewWindow.getOpBillLineInfoViewTab().getOpBillLineInfoViewForm();
                    viewForm.setOperatorType(rowInfo.data);
                    viewWindow.showData = rowInfo.data;
                    viewWindow.show();

                    var imgSign='url(../../images/seal/unsign.png) 0px 0 no-repeat';
                    var imgReceipt='';
                    var imgSettle='';
                    var imgRefund='';
                    if(rowInfo.data.billState==4){
                        imgSign='url(../../images/seal/sign.png) 0px 0 no-repeat';
                    }
//----------------------------------------------回单信息-----------------------------------------------
//----------------------------------------------------------------------------------------------------
                    if(rowInfo.data.receiptMethodCode!=1){

                    //回单状态 0.未收回、1.已收回 、2.已寄出、3、已接收、4.已返客户
                    //回单图片 receiptCol已收集1 receiptMail 2已寄出 receiptRec 3已返发站 receiptRt 4已返客户
                    Ext.Ajax.request({
                        url: opHostName + '/op/receiptBillCollect.do' + urlToken,
                        params: {
                            'uniteBillCode': rowInfo.data.uniteBillCode
                        },
                        success: function (response) {
                            var respText = Ext.JSON.decode(response.responseText);
                            if (respText.data == null) {
                                return;
                            }
                            var receiptForm = Ext.getCmp('Op_OpBillLineInfo_ReceiptBillCollectForm_ID').getForm();
                            var receiptModel = Ext.create('Op.OpBillLineInfo.RecBillCollectModel', respText.data);
                            receiptForm.loadRecord(receiptModel);

                            if(respText.data.status==1){
                                imgReceipt=',url(../../images/seal/receiptCol.png) 840px 0px no-repeat';
                            }else if(respText.data.status==2){
                                imgReceipt=',url(../../images/seal/receiptMail.png) 840px 0px no-repeat';
                            }else if(respText.data.status==3){
                                imgReceipt=',url(../../images/seal/receiptRec.png) 840px 0px no-repeat';
                            }else if(respText.data.status==4){
                                imgReceipt=',url(../../images/seal/receiptRt.png) 840px 0px no-repeat';
                            }
                                viewForm.setBodyStyle('background: '+imgSign+imgReceipt+imgRefund+imgSettle);
                            if (respText.data.openBillTime != null) {
                                receiptForm.findField('openBillTime').setValue(Ext.Date.format(new Date(respText.data.openBillTime), 'Y-m-d H:i:s'))
                            }
                            if (respText.data.signTime != null) {
                                receiptForm.findField('signTime').setValue(Ext.Date.format(new Date(respText.data.signTime), 'Y-m-d H:i:s'))
                            }
                            if (respText.data.inventoryEnterTime != null) {
                                receiptForm.findField('inventoryEnterTime').setValue(Ext.Date.format(new Date(respText.data.inventoryEnterTime), 'Y-m-d H:i:s'))
                            }
                            if (respText.data.modifyTime != null) {
                                receiptForm.findField('modifyTime').setValue(Ext.Date.format(new Date(respText.data.modifyTime), 'Y-m-d H:i:s'))
                            }
                            if (respText.data.backTime != null) {
                                receiptForm.findField('backTime').setValue(Ext.Date.format(new Date(respText.data.backTime), 'Y-m-d H:i:s'))
                            }
                        },
                        failure: function (response) {
                            Ext.ux.Toast.msg('提示', response.responseText, 'error');
                        }
                    });

                    }
//----------------------------------------------记账信息-----------------------------------------------
//----------------------------------------------------------------------------------------------------
                   if(rowInfo.data.collectGoodsPrice!=0){
                    Ext.Ajax.request({
                        url: foHostName + '/fo/queryCashAccountList.do' + urlToken,
                        params: {
                            'uniteBillCode': rowInfo.data.uniteBillCode
                        },
                        success: function (response) {
                            var result = Ext.JSON.decode(response.responseText);
                            var grid = Ext.getCmp('Op_OpBillLineInfo_AccountGridPanel_ID').getStore();
                            if (!Ext.isEmpty(result.data)) {
                                grid.removeAll();
                                grid.add(result.data);

                                for(var j = 0,len = result.data.length; j < len; j++){

                                    if(result.data[j].status==1&&result.data[j].priceType==40){
                                       imgRefund=',url(../../images/seal/refund.png) 560px 0 no-repeat';
                                       break;
                                    }else{
                                       imgRefund=',url(../../images/seal/unrefund.png) 560px 0 no-repeat';
                                    }

                                    if(result.data[j].status==1&&(result.data[j].priceType==31||result.data[j].priceType==33||result.data[j].priceType==34||result.data[j].priceType==35||result.data[j].priceType==36)){
                                       imgSettle=',url(../../images/seal/tranceFeeSettle.png) 280px 0 no-repeat';
                                       break;
                                    }else if(result.data[j].priceType==31||result.data[j].priceType==33||result.data[j].priceType==34||result.data[j].priceType==35||result.data[j].priceType==36){
                                       imgSettle=',url(../../images/seal/tranceFeeUnSettle.png) 280px 0 no-repeat';
                                    }
                                }
                               viewForm.setBodyStyle('background: '+imgSign+imgReceipt+imgRefund+imgSettle);
                            }
                        },
                        failure: function (response) {
                            Ext.ux.Toast.msg('提示', response.responseText, 'error');
                        }
                    });
                        }

                        viewForm.setBodyStyle('background: '+imgSign+imgReceipt+imgRefund+imgSettle);

                }
            }

 

posted on 2019-03-29 14:13  o_0的园子  阅读(599)  评论(0编辑  收藏  举报