Ext.namespace('Shipping'); Shipping.MsOpBillLSEdit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsOpBillLSEdit.superclass.constructor.call(this); }; Ext.extend(Shipping.MsOpBillLSEdit, Ext.Panel, { ParentWin: null, MParentWin: null, OpStatus: 'add', StoreList: null, EditRecord: null, Editdata: null, MainEditRecord: {}, BsNo: '', initUIComponents: function () { this.serialNo = 0; //this.bodyDel = []; this.itemindex = 1; this.billeditype =''; var mainform = window.parent.panelEdit; if (mainform) { //this.MainEditRecord = new Object(); this.MainEditRecord = mainform.editRecord; this.BsNo = this.MainEditRecord.get("BSNO"); //this.MainEditRecord=mainform.Editdata; //this.BsNo = this.MainEditRecord.BSNO; } //#region 信息加载 //权限范围 this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', { model: 'MsOP', proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' } }); this.StoreOpRange.load({ params: { optype: "modOrderManagement"} }); //品名 this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeGoodsModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' } }); this.storeCodeGoodsList.load(); this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.DESCRIPTIONSTR, store: this.storeCodeGoodsList, flex: 1.5, labelWidth: 250, forceSelection: true, name: 'GOODSNAME', valueField: 'GOODNAME', displayField: 'CodeAndName' }); //客户加载_发货人 this.storeShipper = Ext.create('DsExt.ux.RefTableStore', { model: 'OpSeaeShipper', proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' } }); // this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} }); //发货人 this.comboxShipper = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.SHIPPERID, store: this.storeShipper, // forceSelection: true, queryMode: 'remote', minChars: 0, queryParam: 'CODENAME', labelWidth: 150, labelAlign: 'left', name: 'SHIPPERID', valueField: 'SHORTNAME', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var selectrecords = DsStoreQueryBy(this.storeShipper, 'SHORTNAME', combo.value); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; this.formEdit.getForm().findField('SHIPPER').setValue(selectdata.SHIPPERDETAIL); if (selectdata.ATTN != '') this.formEdit.getForm().findField('SHIPPEREMAIL').setValue(selectdata.EMAIL); if (selectdata.COUNTRY != '') this.formEdit.getForm().findField('SHIPPERCOUNTRY').setValue(selectdata.COUNTRY); if (selectdata.TEL != '') this.formEdit.getForm().findField('SHIPPERTEL').setValue(selectdata.TEL); if (selectdata.CORPID != '') this.formEdit.getForm().findField('SHIPPERCODE').setValue(selectdata.CORPID); } else { this.formEdit.getForm().findField('SHIPPER').setValue(''); } } } } }); //客户加载_收货人 this.storeConsignee = Ext.create('DsExt.ux.RefTableStore', { model: 'OpSeaeShipper', proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' } }); // this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} }); //收货人 this.comboxConsignee = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.CONSIGNEEID, labelWidth: 150, labelAlign: 'left', store: this.storeConsignee, // forceSelection: true, queryMode: 'remote', minChars: 0, queryParam: 'CODENAME', name: 'CONSIGNEEID', valueField: 'SHORTNAME', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var selectrecords = DsStoreQueryBy(this.storeConsignee, 'SHORTNAME', combo.value); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; this.formEdit.getForm().findField('CONSIGNEE').setValue(selectdata.SHIPPERDETAIL); if (selectdata.ATTN != '') this.formEdit.getForm().findField('CONSIGNEEEMAIL').setValue(selectdata.EMAIL); if (selectdata.COUNTRY != '') this.formEdit.getForm().findField('CONSIGNEECOUNTRY').setValue(selectdata.COUNTRY); if (selectdata.TEL != '') this.formEdit.getForm().findField('CONSIGNEETEL').setValue(selectdata.TEL); if (selectdata.CORPID != '') this.formEdit.getForm().findField('CONSIGNEECODE').setValue(selectdata.CORPID); } else { this.formEdit.getForm().findField('CONSIGNEE').setValue(''); } } } } }); //客户加载_通知人 this.storenotifyparty = Ext.create('DsExt.ux.RefTableStore', { model: 'OpSeaeShipper', proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' } }); // this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} }); //通知人 this.comboxNotifyParty = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.NOTIFYPARTYID, store: this.storenotifyparty, labelWidth: 150, labelAlign: 'left', // forceSelection: true, queryMode: 'remote', minChars: 0, queryParam: 'CODENAME', name: 'NOTIFYPARTYID', valueField: 'SHORTNAME', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var selectrecords = DsStoreQueryBy(this.storenotifyparty, 'SHORTNAME', combo.value); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; this.formEdit.getForm().findField('NOTIFYPARTY').setValue(selectdata.SHIPPERDETAIL); if (selectdata.ATTN != '') this.formEdit.getForm().findField('NOTIFYPARTYEMAIL').setValue(selectdata.EMAIL); if (selectdata.COUNTRY != '') this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRY').setValue(selectdata.COUNTRY); if (selectdata.TEL != '') this.formEdit.getForm().findField('NOTIFYPARTYTEL').setValue(selectdata.TEL); if (selectdata.CORPID != '') this.formEdit.getForm().findField('NOTIFYPARTYCODE').setValue(selectdata.CORPID); } else { this.formEdit.getForm().findField('NOTIFYPARTY').setValue(''); } } } } }); //客户加载_第二通知人 this.storenotifypartySecond = Ext.create('DsExt.ux.RefTableStore', { model: 'OpSeaeShipper', proxy: { url: '/MvcShipping/MsOpSeae/GetShipperListRm' } }); // this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} }); //通知人 this.comboxNotifyPartySecond = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.NOTIFYPARTYID2, store: this.storenotifypartySecond, labelWidth: 200, labelAlign: 'left', // forceSelection: true, queryMode: 'remote', minChars: 0, queryParam: 'CODENAME', name: 'NOTIFYPARTYIDSECOND', valueField: 'SHORTNAME', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var selectrecords = DsStoreQueryBy(this.storenotifypartysecond, 'SHORTNAME', combo.value); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; this.formEdit.getForm().findField('NOTIFYPARTYSECOND').setValue(selectdata.SHIPPERDETAIL); if (selectdata.ATTN != '') this.formEdit.getForm().findField('NOTIFYPARTYEMAILSECOND').setValue(selectdata.EMAIL); if (selectdata.COUNTRY != '') this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRYSECOND').setValue(selectdata.COUNTRY); if (selectdata.TEL != '') this.formEdit.getForm().findField('NOTIFYPARTYTELSECOND').setValue(selectdata.TEL); if (selectdata.CORPID != '') this.formEdit.getForm().findField('NOTIFYPARTYCODESECOND').setValue(selectdata.CORPID); } else { this.formEdit.getForm().findField('NOTIFYPARTYSECOND').setValue(''); } } } } }); //客户加载_代理 this.storeagent = Ext.create('DsExt.ux.RefTableStore', { model: 'OpSeaeShipper', proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' } }); // this.storeShipper.load({ params: { condition: "ISCONTROLLER='1'"} }); //收货人 this.comboxAgent = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.AGENTID, store: this.storeagent, forceSelection: true, name: 'AGENTID', valueField: 'SHORTNAME', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var selectrecords = DsStoreQueryBy(this.storeagent, 'SHORTNAME', combo.value); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; this.formEdit.getForm().findField('AGENT').setValue(selectdata.SHIPPERDETAIL); } else { this.formEdit.getForm().findField('AGENT').setValue(''); } } } } }); //#endregion //提单模板 this.storeTemplate = Ext.create('DsExt.ux.RefTableStore', { model: 'CODETEMPLATE', proxy: { url: '/CommMng/BasicDataRef/GetCodeTemplateList' } }); this.storeTemplate.load({ params: { condition: ""} }); this.comboxTemplate = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.TEMPLATE, store: this.storeTemplate, forceSelection: true, name: 'TEMPLATE', valueField: 'TEMPLATEID', displayField: 'TEMPLATE' }); this.StoreBILLTYPE = Ext.create('Ext.data.Store', { fields: ['BLTYPE', 'DISPLAYNAME'] }); this.StoreBILLTYPE.add({ "BLTYPE": "分单", "DISPLAYNAME": Zi.LAN.FENDAN }); this.StoreBILLTYPE.add({ "BLTYPE": "主单", "DISPLAYNAME": Zi.LAN.ZHUDAN }); this.comboxBILLTYPE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.BILLTYPE, store: this.StoreBILLTYPE, forceSelection: true, name: 'BILLTYPE', valueField: 'BLTYPE', displayField: 'DISPLAYNAME' }); this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.VesselModel', proxy: { url: '/CommMng/BasicDataRef/GetVesselList' } }); this.storeVoyVeg.load({ params: { condition: ""} }); this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.VESSEL, store: this.storeVoyVeg, name: 'VESSEL', valueField: 'VESSEL', flex: 2, displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var selectrecords = DsStoreQueryBy(this.storeVoyVeg, 'VoyName', combo.value); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; this.formEdit.getForm().findField('VESSELID').setValue(selectdata.EDICODE); } else { this.formEdit.getForm().findField('VESSELID').setValue(''); } } }, change: function (field, newValue, oldValue, eOpts) { if (newValue != oldValue) { if (checkzimu(newValue)) _this.formEdit.getForm().findField('VESSEL').setValue(newValue.toUpperCase()); } } } }); //国际港口(进口装货港、出口卸货港) this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport.load(); this.storeCodeDisport2 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport2.load(); this.storeCodeDisport3 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport3.load(); this.storeCodeDisport4 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport4.load(); //国内港口(出口装货港、进口卸货港) this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeLoadportModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList' } }); this.storeCodeLoadport.load(); this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.PORTLOAD, store: this.storeCodeLoadport, queryMode: 'remote', minChars: 1, name: 'PORTLOADID', valueField: 'EDICODE', displayField: 'CodeAndName', forceSelection: true, matchFieldWidth: false, //下拉款自适应宽度 listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('PORTLOAD').setValue(records[0].data.PORT); } } } }); this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.PORTDISCHARGE, matchFieldWidth: false, store: this.storeCodeDisport, queryMode: 'remote', minChars: 1, queryParam: 'PORT', name: 'PORTDISCHARGEID', // forceSelection: true, valueField: 'EDICODE', displayField: 'CodeAndName', listeners: { scope: this, blur: function (field, The, eOpts) { field.setRawValue(field.value); }, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('PORTDISCHARGE').setValue(records[0].data.PORT); var DESTINATION = this.formEdit.getForm().findField('DESTINATION').getValue(); if (DESTINATION == null || DESTINATION == '') { this.formEdit.getForm().findField('DESTINATIONID').setValue(records[0].data.EDICODE); this.formEdit.getForm().findField('DESTINATION').setValue(records[0].data.PORT); } this.formEdit.getForm().findField('PLACEDELIVERYID').setValue(records[0].data.EDICODE); this.formEdit.getForm().findField('PLACEDELIVERY').setValue(records[0].data.PORT); } } } }); this.comboxDESTINATION = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.DESTINATION, matchFieldWidth: false, store: this.storeCodeDisport2, queryMode: 'remote', minChars: 1, queryParam: 'PORT', name: 'DESTINATIONID', // forceSelection: true, valueField: 'EDICODE', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('DESTINATION').setValue(records[0].data.PORT); this.formEdit.getForm().findField('PLACEDELIVERYID').setValue(records[0].data.EDICODE); this.formEdit.getForm().findField('PLACEDELIVERY').setValue(records[0].data.PORT); var BLFRT = this.formEdit.getForm().findField('BLFRT').getValue(); if (BLFRT == "FREIGHT COLLECT") { this.formEdit.getForm().findField('PREPARDAT').setValue(''); this.formEdit.getForm().findField('PAYABLEAT').setValue(records[0].data.PORT); this.formEdit.getForm().findField('PREPARDATID').setValue(records[0].data.EDICODE); } } } } }); this.comboxPLACEDELIVERY = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.PLACEDELIVERY, matchFieldWidth: false, store: this.storeCodeDisport3, queryMode: 'remote', minChars: 1, queryParam: 'PORT', name: 'PLACEDELIVERYID', valueField: 'EDICODE', // forceSelection: true, displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('PLACEDELIVERY').setValue(records[0].data.PORT); } } } }); this.comboxPLACERECEIPT = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.PLACERECEIPTID, matchFieldWidth: false, store: this.storeCodeDisport4, name: 'PLACERECEIPTID', queryMode: 'remote', minChars: 1, queryParam: 'PORT', // forceSelection: true, valueField: 'EDICODE', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('PLACERECEIPT').setValue(records[0].data.PORT); } } } }); //付费方式 this.storeFrt = Ext.create('DsExt.ux.RefTableStore', { model: 'CODE_FRT', proxy: { url: '/CommMng/BasicDataRef/GetCodeFrtList' } }); this.storeFrt.load({ params: { condition: ""} }); this.comboxBLFRT = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.BLFRT, store: this.storeFrt, forceSelection: true, name: 'BLFRT', valueField: 'FRT', displayField: 'FRT' }); //运输条款 this.storeSERVICE = Ext.create('DsExt.ux.RefTableStore', { model: 'CODE_SERVICE', proxy: { url: '/CommMng/BasicDataRef/GetCodeServiceList' } }); this.storeSERVICE.load({ params: { condition: ""} }); this.comboxSERVICE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.SERVICE, store: this.storeSERVICE, forceSelection: true, name: 'SERVICE', valueField: 'SERVICE', displayField: 'SERVICE' }); //签单方式 this.storeISSUETYPE = Ext.create('DsExt.ux.RefTableStore', { model: 'CODE_BLTYPE', proxy: { url: '/CommMng/BasicDataRef/GetCodeBLTYPEList' } }); this.storeISSUETYPE.load({ params: { condition: ""} }); var ISSUETYPEDFIELDNAME = 'BLTYPE'; //if (strLANGUAGES == "en-us") { // ISSUETYPEDFIELDNAME = 'ENAME'; //} this.comboxISSUETYPE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.ISSUETYPE, store: this.storeISSUETYPE, forceSelection: true, name: 'ISSUETYPE', valueField: 'BLTYPE', displayField: ISSUETYPEDFIELDNAME, listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { if (combo.value == "正本") { this.formEdit.getForm().findField('NOBILL').setValue('THREE'); // this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); } else if (combo.value == "电放") { this.formEdit.getForm().findField('NOBILL').setValue('ONE'); } } } } }); this.StoreBLNUM = Ext.create('Ext.data.Store', { fields: ['NUM'] }); this.StoreBLNUM.add({ "NUM": "ZERO" }); this.StoreBLNUM.add({ "NUM": "ONE" }); this.StoreBLNUM.add({ "NUM": "TWO" }); this.StoreBLNUM.add({ "NUM": "THREE" }); this.StoreBLNUM.add({ "NUM": "FOUR" }); this.StoreBLNUM.add({ "NUM": "FIVE" }); this.StoreBLNUM.add({ "NUM": "SIX" }); this.StoreBLNUM.add({ "NUM": "SEVEN" }); this.StoreBLNUM.add({ "NUM": "EIGHT" }); this.StoreBLNUM.add({ "NUM": "NINE" }); this.StoreBLNUM.add({ "NUM": "TEN" }); this.comboxBLNUM = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.NOBILL, store: this.StoreBLNUM, forceSelection: true, name: 'NOBILL', valueField: 'NUM', displayField: 'NUM' }); this.comboxCOPYBLNUM = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.COPYNOBILL, //'副本份数', store: this.StoreBLNUM, forceSelection: true, flex: 0.7, name: 'COPYNOBILL', valueField: 'NUM', displayField: 'NUM' }); //件数包装 this.storeCodePackage = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodePackageModel', proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' } }); this.storeCodePackage.load(); this.comboxKINDPKGS = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.KINDPKGS, labelWidth: 70, store: this.storeCodePackage, // padding: '0 0 0 10', forceSelection: true, name: 'KINDPKGS', valueField: 'PKGS', displayField: 'PKGS', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var str_num = this.formEdit.getForm().findField('PKGS').getValue(); this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(str_num).toUpperCase() + ' ' + combo.value + ' ONLY.'); } } } }); //箱型_集装箱列表中的下拉框加载 this.storeCodeCtn = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeCtnModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' } }); this.storeCodeCtn.load(); this.comboxCTNALL = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '箱型', store: this.storeCodeCtn, forceSelection: true, name: 'CTNALL', valueField: 'CTN', displayField: 'CTN' }); //件数包装_集装箱列表中的下拉框加载 this.comboxKINDPKGS_CTN = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '件数包装', store: this.storeCodePackage, forceSelection: true, name: 'KINDPKGS', valueField: 'PKGS', displayField: 'PKGS' }); //#region 集装箱-数据集 this.storeBodyList = Ext.create('Ext.data.Store', { model: 'MsOpSeaeDetail', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsOpSeae/GetBodyList', reader: { id: 'BsNo,CTNCODE,CTN_ID', root: 'data', totalProperty: 'totalCount' } } }); //明细表表格 this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.gridList = new Ext.grid.GridPanel({ store: this.storeBodyList, enableHdMenu: false, region: 'center', loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhongQingShaoDeng}, trackMouseOver: true, disableSelection: false, plugins: [this.gridListCellEditing], selType: 'cellmodel', tbar: [{ text: Zi.LAN.btnadddetail, tooltip: Zi.LAN.btnadddetail, id: "btnBadddetail", iconCls: "btnadddetail", handler: function (button, event) { this.onAddDetailClick(button, event); }, scope: this }, '-', { text: Zi.LAN.btndeldetail, tooltip: Zi.LAN.btndeldetail, id: "btnBdeldetail", iconCls: "btndeletedetail", handler: function (button, event) { this.onDelDetailClick(button, event); }, scope: this }, '-', { text: Zi.LAN.UpdateDetail, tooltip: Zi.LAN.UpdateDetail, handler: function (button, event) { this.onUpdateDetailClick(button, event); }, scope: this }, '-', { text: Zi.LAN.upMasterCtn, tooltip: Zi.LAN.upMasterCtn, handler: function (button, event) { this.upMasterCtn(); }, scope: this }], columns: [{ sortable: true, dataIndex: 'CTN_ID', header: '编号', hidden: true, width: 0 }, { sortable: true, dataIndex: 'BSNO', header: '业务编号', hidden: true, width: 0 }, { sortable: true, dataIndex: 'CTNCODE', header: Zi.LAN.CTNCODE, width: 30 }, { dataIndex: 'CTNALL', header: Zi.LAN.CTNALL, width: 70, editor: this.comboxCTNALL }, { dataIndex: 'CTNNUM', header: Zi.LAN.CTNNUM, width: 50, editor: { xtype: 'numberfield', allowBlank: false, selectOnFocus: true } }, { dataIndex: 'CNTRNO', header: Zi.LAN.CNTRNO, width: 100, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'SEALNO', header: Zi.LAN.SEALNO, width: 80, editor: { xtype: 'textfield', selectOnFocus: true } }, { sortable: true, dataIndex: 'PKGS', header: Zi.LAN.PKGS, width: 60, editor: { xtype: 'numberfield', allowBlank: false, selectOnFocus: true } }, { dataIndex: 'KINDPKGS', header: Zi.LAN.KINDPKGS, width: 100, editor: this.comboxKINDPKGS_CTN }, { dataIndex: 'KGS', header: Zi.LAN.KGS3, width: 60, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'CBM', header: Zi.LAN.CBM2, width: 60, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'TAREWEIGHT', header: Zi.LAN.TAREWEIGHT, width: 60, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'REMARK', header: Zi.LAN.REMARK, width: 150, editor: { xtype: 'textfield', selectOnFocus: true } }] }); //#endregion this.panelBodyCtn = new Ext.Panel({ title: Zi.LAN.panelBodyCtn, layout: "border", height: 185, //margin: '5 10', frame: true, items: [this.gridList] }); //#region 编辑formEdit 基本信息 this.formEdit = Ext.widget('form', { region: 'north', // title: '提单信息', frame: true, bodyPadding: 5, layout: 'anchor', trackResetOnLoad: true, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 70, msgTarget: 'qtip' }, items: [{ xtype: 'fieldset', defaultType: 'textfield', layout: 'hbox', defaults: { anchor: '96%' }, items: [ // { // name: 'SHIPPERNAME', hidden: true //}, { // name: 'SHIPPERADDR1', hidden: true // }, { // name: 'CONSIGNEENAME', hidden: true // }, { // name: 'CONSIGNEEADDR1', hidden: true // }, { // name: 'NOTIFYPARTYNAME', hidden: true // }, { // name: 'NOTIFYPARTYADDR1', hidden: true // }, { // name: 'SCACCODE', hidden: true // }, { xtype: 'container', layout: 'anchor', flex: 1, defaultType: 'textfield', items: [this.comboxShipper, { xtype: 'fieldset', defaultType: 'textfield', layout: 'hbox', defaults: { anchor: '100%' }, items: [{ xtype: 'textareafield', grow: true, labelWidth: 0, height: 100, name: 'SHIPPER', anchor: '100%', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('SHIPPER').setValue(field.value.toUpperCase()); } } }, {xtype: 'container', layout: 'anchor', flex: 0.6, defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.CODE, name: 'SHIPPERCODE' }, { fieldLabel: Zi.LAN.COUNTRY, name: 'SHIPPERCOUNTRY' },{ fieldLabel: Zi.LAN.TEL, name: 'SHIPPERTEL' },{ fieldLabel: Zi.LAN.EMAIL, name: 'SHIPPEREMAIL' }] }]}, this.comboxConsignee, { xtype: 'fieldset', defaultType: 'textfield', layout: 'hbox', defaults: { anchor: '100%' }, items: [{ xtype: 'textareafield', grow: true, labelWidth: 0, height: 100, name: 'CONSIGNEE', anchor: '100%', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('CONSIGNEE').setValue(field.value.toUpperCase()); } } }, { xtype: 'container', layout: 'anchor', flex: 0.6, defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.CODE, name: 'CONSIGNEECODE' }, { fieldLabel: Zi.LAN.COUNTRY, name: 'CONSIGNEECOUNTRY' }, { fieldLabel: Zi.LAN.TEL, name: 'CONSIGNEETEL' }, { fieldLabel: Zi.LAN.EMAIL, name: 'CONSIGNEEEMAIL' }] }] }, this.comboxNotifyParty, { xtype: 'fieldset', defaultType: 'textfield', layout: 'hbox', defaults: { anchor: '100%' }, items: [{ xtype: 'textareafield', grow: true, labelWidth: 0, height: 100, name: 'NOTIFYPARTY', anchor: '100%', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('NOTIFYPARTY').setValue(field.value.toUpperCase()); } } }, { xtype: 'container', layout: 'anchor', flex: 0.6, defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.CODE, name: 'NOTIFYPARTYCODE' }, { fieldLabel: Zi.LAN.COUNTRY, name: 'NOTIFYPARTYCOUNTRY' }, { fieldLabel: Zi.LAN.TEL, name: 'NOTIFYPARTYTEL' }, { fieldLabel: Zi.LAN.EMAIL, name: 'NOTIFYPARTYEMAIL' }] }] } ] }, { xtype: 'container', layout: 'anchor', flex: 1, defaultType: 'textfield', items: [{ xtype: 'container', layout: 'hbox', flex: 1, defaultType: 'textfield', items: [{ fieldLabel: '业务编号', name: 'BSNO', hidden: true }, { fieldLabel: 'INPUTBY', name: 'INPUTBY', hidden: true }, { fieldLabel: 'AS_ID', name: 'AS_ID', hidden: true }, { fieldLabel: Zi.LAN.MBLNO, name: 'MBLNO', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('MBLNO').setValue(field.value.toUpperCase()); } } }, { xtype: 'container', layout: 'hbox', flex: 1, defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.HBLNO, //'分提单号', name: 'HBLNO', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('HBLNO').setValue(field.value.toUpperCase()); } } }, { xtype: 'button', id: 'btnHBLNO', iconCls: "btncancel", handler: function (button, event) { this.GetHBLNo(); }, scope: this }] }] }, { xtype: 'container', layout: 'hbox', flex: 1, defaultType: 'textfield', items: [this.comboxTemplate, this.comboxBILLTYPE] }, this.panelBodyCtn, { xtype: 'container', layout: 'hbox', flex: 1, defaultType: 'textfield', items: [{ xtype: 'hiddenfield'}] }, this.comboxAgent, { xtype: 'textareafield', grow: true, fieldLabel: 'AGENT', height: 48, name: 'AGENT', anchor: '100%', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('AGENT').setValue(field.value.toUpperCase()); } } }, this.comboxNotifyPartySecond, { xtype: 'fieldset', defaultType: 'textfield', layout: 'hbox', defaults: { anchor: '100%' }, items: [{ xtype: 'textareafield', grow: true, labelWidth: 0, height: 100, name: 'NOTIFYPARTYSECOND', anchor: '100%', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('NOTIFYPARTYSECOND').setValue(field.value.toUpperCase()); } } }, { xtype: 'container', layout: 'anchor', flex: 0.6, defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.CODE, name: 'NOTIFYPARTYCODESECOND' }, { fieldLabel: Zi.LAN.COUNTRY, name: 'NOTIFYPARTYCOUNTRYSECOND' }, { fieldLabel: Zi.LAN.TEL, name: 'NOTIFYPARTYTELSECOND' }, { fieldLabel: Zi.LAN.EMAIL, name: 'NOTIFYPARTYEMAILSECOND' }] }] } ] } ] }, { xtype: 'container', layout: 'anchor', flex: 1, defaultType: 'textfield', defaults: { anchor: '99%' }, items: [{ xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: Zi.LAN.ETD, format: 'Y-m-d', flex: 1, xtype: 'datefield', name: 'ETD', listeners: { select: function () { var basicForm = _this.formEdit.getForm(); var ETD = basicForm.findField('ETD').getRawValue(); var ISSUEDATE = basicForm.findField('ISSUEDATE').getRawValue(); //if (ISSUEDATE == '') { basicForm.findField('ISSUEDATE').setValue(ETD); } } }, { fieldLabel: Zi.LAN.ETA, format: 'Y-m-d', flex: 1, xtype: 'datefield', name: 'ETA' }, this.comboxVoyVeg, { fieldLabel: Zi.LAN.VOYNO, flex: 1, name: 'VOYNO', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('VOYNO').setValue(field.value.toUpperCase()); } } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxPORTLOAD, { name: 'PORTLOAD' }, this.comboxPORTDISCHARGE, { name: 'PORTDISCHARGE' }, this.comboxDESTINATION, { name: 'DESTINATION' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxPLACEDELIVERY, { name: 'PLACEDELIVERY' }, this.comboxPLACERECEIPT, { name: 'PLACERECEIPT' }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield'}] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ xtype: 'container', layout: 'anchor', flex: 1, defaultType: 'textfield', items: [{ xtype: 'label', html: 'Seal No.' }, { xtype: 'textareafield', grow: true, height: 135, name: 'CNTRSEALNO', anchor: '100%' }, { xtype: 'label', html: Zi.LAN.MARKSSTR }, { xtype: 'textareafield', grow: true, height: 135, name: 'MARKS', anchor: '100%', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('MARKS').setValue(field.value.toUpperCase()); } } } ] }, { xtype: 'container', layout: 'anchor', flex: 3, defaultType: 'textfield', items: [{ xtype: 'container', defaultType: 'textfield', layout: 'hbox', defaults: { anchor: '100%' }, items: [{ xtype: 'label', html: Zi.LAN.DESCRIPTIONSTR }] }, { xtype: 'textareafield', grow: true, fieldLabel: '  ', labelSeparator: '', labelWidth: 20, height: 290, name: 'DESCRIPTION', anchor: '100%', listeners: { scope: this, blur: function (field, The, eOpts) { _this.formEdit.getForm().findField('DESCRIPTION').setValue(field.value.toUpperCase()); } } }] }, { xtype: 'container', layout: 'anchor', flex: 1, defaultType: 'textfield', items: [{ xtype: 'label', html: Zi.LAN.NOPKGS }, { xtype: 'textareafield', grow: true, fieldLabel: '  ', labelWidth: 20, labelSeparator: '', height: 60, name: 'NOPKGS', anchor: '100%', listeners: { scope: this, change: function (field, newValue, oldValue, eOpts) { if (newValue == null || newValue == '') return; if (newValue != oldValue) { var SS = newValue; var i = SS.indexOf("\n"); var num = 0; if (i > 0) { var slist = SS.split("\n"); for (var i = 0; i < slist.length; i += 1) { var member = slist[i]; var str_num = this.GetStringNum(member); if (i == 0) { var str_kind = member.substring(str_num.length); } num = parseFloat(num).add(parseFloat(str_num)); } this.formEdit.getForm().findField('PKGS').setValue(str_num); this.formEdit.getForm().findField('KINDPKGS').setValue(str_kind); this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(num).toUpperCase() + ' ' + str_kind + ' ONLY.'); } else { var str_num = this.GetStringNum(SS); var str_kind = SS.substring(str_num.length); this.formEdit.getForm().findField('PKGS').setValue(str_num); this.formEdit.getForm().findField('KINDPKGS').setValue(str_kind); this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(str_num).toUpperCase() + ' ' + str_kind + ' ONLY.'); } } } } }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: Zi.LAN.zPKGS, labelWidth: 70, readOnly: true, name: 'PKGS' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxKINDPKGS] }, { xtype: 'label', html: Zi.LAN.GROSSWEIGHT }, { xtype: 'textareafield', grow: true, height: 50, labelWidth: 20, labelSeparator: '', fieldLabel: '  ', name: 'GROSSWEIGHT', anchor: '100%', listeners: { scope: this, change: function (field, newValue, oldValue, eOpts) { if (newValue == null || newValue == '') return; if (newValue != oldValue) { var SS = newValue; var i = SS.indexOf("\n"); var num = 0; if (i > 0) { var slist = SS.split("\n"); for (var i = 0; i < slist.length; i += 1) { var member = slist[i]; var str_num = this.GetStringNum(member); num = parseFloat(num).add(parseFloat(str_num)); } this.formEdit.getForm().findField('KGS').setValue(num); } else { var str_num = this.GetStringNum(SS); this.formEdit.getForm().findField('KGS').setValue(str_num); } } } } }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', defaults: { anchor: '100%' }, items: [{ labelWidth: 70, fieldLabel: Zi.LAN.zKGS, name: 'KGS' }, { xtype: 'label', width: 50, text: 'KGS' }] }, { xtype: 'label', html: Zi.LAN.MEASUREMENT }, { xtype: 'textareafield', grow: true, height: 60, labelWidth: 20, labelSeparator: '', fieldLabel: '  ', name: 'MEASUREMENT', anchor: '100%', listeners: { scope: this, change: function (field, newValue, oldValue, eOpts) { if (newValue == null || newValue == '') return; if (newValue != oldValue) { var SS = newValue; var i = SS.indexOf("\n"); var num = 0; if (i > 0) { var slist = SS.split("\n"); for (var i = 0; i < slist.length; i += 1) { var member = slist[i]; var str_num = this.GetStringNum(member); num = parseFloat(num).add(parseFloat(str_num)); } this.formEdit.getForm().findField('CBM').setValue(num); } else { var str_num = this.GetStringNum(SS); this.formEdit.getForm().findField('CBM').setValue(str_num); } } } } }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ labelWidth: 70, fieldLabel: Zi.LAN.zCBM, name: 'CBM' }, { xtype: 'label', width: 50, text: 'CBM' }] } ] } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.TOTALNO, name: 'TOTALNO' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxISSUETYPE, { fieldLabel: Zi.LAN.ISSUEDATE, format: 'Y-m-d', xtype: 'datefield', name: 'ISSUEDATE' }, { fieldLabel: Zi.LAN.ISSUEPLACEID, name: 'ISSUEPLACE' }, this.comboxBLNUM] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxBLFRT, { fieldLabel: Zi.LAN.PREPARDAT, name: 'PREPARDAT' }, { fieldLabel: Zi.LAN.PAYABLEAT, name: 'PAYABLEAT' }, this.comboxSERVICE] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ xtype: 'textareafield', grow: true, fieldLabel: Zi.LAN.OTREMARK, height: 60, name: 'ORDERCONTENT', anchor: '100%' }, { xtype: 'textareafield', grow: true, fieldLabel: Zi.LAN.REMARK, height: 60, name: 'REMARKS', anchor: '100%' }] }] } ] }); //end this.formEdit //#endregion this.storeList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'MsOpBillModel', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsOpSeae/GetBillList', reader: { id: 'AS_ID', root: 'data', totalProperty: 'totalCount' } } }); //#region List列表显示信息 Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, { width: 20 }); this.girdcolums = [{ sortable: true, dataIndex: 'AS_ID', header: 'AS_ID', hidden: true, width: 0 }, { sortable: true, dataIndex: 'BSNO', hidden: true, header: '业务编号', width: 0 }, { sortable: true, dataIndex: 'HBLNO', header: Zi.LAN.HBLNO, width: 140 }, { sortable: true, dataIndex: 'TEMPLATE', header: Zi.LAN.TEMPLATE, width: 120 }, { sortable: true, dataIndex: 'BILLTYPE', header: Zi.LAN.BILLTYPE, width: 120 }, { sortable: true, dataIndex: 'BLISSUESTATUS', header: Zi.LAN.BLISSUESTATUS, width: 120 }, { sortable: true, id: '', dataIndex: 'PKGS', header: Zi.LAN.PKGS, //'件数', width: 80 }, { sortable: true, id: '', dataIndex: 'KGS', header: Zi.LAN.KGS2, //'毛重', width: 80 }, { sortable: true, id: '', dataIndex: 'CBM', header: Zi.LAN.CBM2, //'尺码', width: 80 }, { sortable: true, dataIndex: 'INPUTBY', header: Zi.LAN.INPUTBY2, width: 80 }, { sortable: true, dataIndex: 'INPUTDATE', header: Zi.LAN.INPUTDATE, width: 80 }, { sortable: true, dataIndex: 'MODIFYTIME', header: Zi.LAN.BSDATE, width: 80 }]; this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); //定义Grid this.gridListLS = new Ext.grid.GridPanel({ store: this.storeList, enableHdMenu: false, region: 'center', width: 190, loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhongQingShaoDeng }, trackMouseOver: true, disableSelection: false, columns: this.girdcolums, selModel: this.GridCheckBoxModel, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeList, displayInfo: true, displayMsg: Zi.LAN.displayMsg, emptyMsg: Zi.LAN.emptyMsg }) }); // /////////////以下部分为获取存储的gridpanel显示样式 // this.column = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列 this.gridListLS.reconfigure(this.storeList, this.girdcolums); this.gridListLS.columns[0] = new Ext.grid.RowNumberer(); //////////////////////////////////////////////// _this = this; this.gridListLS.addListener('itemclick', function (dataview, record, item, index, e, b) { _this.editRecord = record; _this.OpStatus = 'edit'; _this.LoadData("edit", "AS_ID='" + record.data.AS_ID + "'"); }, this); this.storeList.on('beforeload', function (store) { var sql = "BSNO='" + this.BsNo + "'"; Ext.apply(store.proxy.extraParams, { condition: sql }); }, this); //#region 按钮Toolbar this.panelBtn = new Ext.Panel({ region: "north", tbar: [{ id: 'btnBESave', text: Zi.LAN.SaveGridPanel, iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, { id: 'btnBESaveAndNew', text: Zi.LAN.btnESaveAndNew, handler: function (button, event) { this.Save('2'); }, scope: this }, { id: 'btnBECopyNew', text: Zi.LAN.copyadd, handler: function (button, event) { var basicForm = this.formEdit.getForm(); this.opStatus = 'add'; //basicForm.findField('AS_ID').setDisabled(false); var field = basicForm.findField('AS_ID'); field.setValue('*'); //basicForm.findField('AS_ID').setDisabled(true); field = basicForm.findField('INPUTBY'); field.setValue(SHOWNAME); for (var j = 0; j < this.storeBodyList.getCount(); j += 1) { var memberbody = this.storeBodyList.getAt(j); memberbody.set("CTN_ID", NewGuid()); memberbody.set("BSNO", '*'); memberbody.commit(); }; Ext.MessageBox.alert(Zi.LAN.TiShi, Zi.LAN.FUZHICHENGGONG); // this.GetEditStatus(); }, scope: this }, { id: 'btnBELoadNew', text: Zi.LAN.btnadd, handler: function (button, event) { this.LoadData('add', ''); }, scope: this }, '-', { id: 'btnBELoadMaster', text: Zi.LAN.upMasterCtn, handler: function (button, event) { this.formEdit.getForm().findField('VESSEL').setValue(this.MainEditRecord.data.VESSEL); this.formEdit.getForm().findField('VOYNO').setValue(this.MainEditRecord.data.VOYNO); this.formEdit.getForm().findField('ETD').setValue(this.MainEditRecord.data.ETD); this.formEdit.getForm().findField('PORTLOADID').setValue(this.MainEditRecord.data.PORTLOADID); this.formEdit.getForm().findField('PORTLOAD').setValue(this.MainEditRecord.data.PORTLOAD); this.formEdit.getForm().findField('PORTDISCHARGEID').setValue(this.MainEditRecord.data.PORTDISCHARGEID); this.formEdit.getForm().findField('PORTDISCHARGE').setValue(this.MainEditRecord.data.PORTDISCHARGE); this.formEdit.getForm().findField('PLACERECEIPT').setValue(this.MainEditRecord.data.PLACERECEIPT); this.formEdit.getForm().findField('PLACEDELIVERYID').setValue(this.MainEditRecord.data.PLACEDELIVERYID); this.formEdit.getForm().findField('PLACEDELIVERY').setValue(this.MainEditRecord.data.PLACEDELIVERY); this.formEdit.getForm().findField('DESTINATIONID').setValue(this.MainEditRecord.data.DESTINATIONID); this.formEdit.getForm().findField('DESTINATION').setValue(this.MainEditRecord.data.DESTINATION); this.formEdit.getForm().findField('MARKS').setValue(this.MainEditRecord.data.MARKS); this.formEdit.getForm().findField('DESCRIPTION').setValue(this.MainEditRecord.data.DESCRIPTION); this.formEdit.getForm().findField('PLACERECEIPTID').setValue(this.MainEditRecord.data.PLACERECEIPTID); Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.YAODIAORUZHUDANDESHOUFATONGXINXIMA, function (btn) { if (btn == 'yes') { this.formEdit.getForm().findField('SHIPPERID').setValue(this.MainEditRecord.data.SHIPPERID); this.formEdit.getForm().findField('SHIPPER').setValue(this.MainEditRecord.data.SHIPPER); this.formEdit.getForm().findField('CONSIGNEEID').setValue(this.MainEditRecord.data.CONSIGNEEID); this.formEdit.getForm().findField('CONSIGNEE').setValue(this.MainEditRecord.data.CONSIGNEE); this.formEdit.getForm().findField('NOTIFYPARTYID').setValue(this.MainEditRecord.data.NOTIFYPARTYID); this.formEdit.getForm().findField('NOTIFYPARTY').setValue(this.MainEditRecord.data.NOTIFYPARTY); } }); if (this.formEdit.getForm().findField('MBLNO').getValue() == '') this.formEdit.getForm().findField('MBLNO').setValue(this.MainEditRecord.data.MBLNO); this.formEdit.getForm().findField('ISSUEPLACE').setValue(this.MainEditRecord.data.ISSUEPLACE); }, scope: this }, '-', { id: 'btnBEHistryCopy', text: Zi.LAN.btnSeaeHistryCopy, handler: function (button, event) { DsOpenEditWin('/MvcShipping/MsOpSeae/HistryBillIndex', "提单历史引入", "600", "940", "10", "10"); }, scope: this }, '-', { id: 'btnBDelete', text: Zi.LAN.btndelete, iconCls: "btndelete", handler: function (button, event) { this.onDeleteClick(button, event); }, scope: this }, '-', { text: Zi.LAN.Print, iconCls: "btnprint", handler: function (button, event) { this.Print(); }, scope: this }, '-', { text: Zi.LAN.HpBill, handler: function (button, event) { this.HpBill(); }, scope: this }, '-', { text: Zi.LAN.EdiExport, //"EDI报文导出", menu: [{ text: "Cargo Smart", //"Cargo Smart", handler: function (menu, event) { _this.onCreateCargoSmartEDIClick(menu, event); } }, { text: Zi.LAN.IFTMBFEDI, //"交通部EDI", handler: function (menu, event) { _this.onCreateIFTMBFClick(menu, event); } }, { text: Zi.LAN.ShenYuanEDI, //"神原 EDI", handler: function (menu, event) { _this.onCreateShenYuanEDIClick(menu, event); } }, { text: Zi.LAN.winEFEDIShow, id: 'EDI-EFEDI', handler: function (menu, event) { _this.onCreateEFEDIClick(menu, event); } }, { text: Zi.LAN.BBEDI, //"外代EDI", id: 'EDI-BBEDI', handler: function (menu, event) { _this.onCreateEDIClick(menu, event, 'BBEDI'); } } ], scope: this }, '-', { text: Zi.LAN.GuoWaiCangDan, menu: [ { text: Zi.LAN.JapanAFR , handler: function (menu, event) { me.onCreateAfrfenClick(menu, event, 1); } }, { text: Zi.LAN.JapanAMR, handler: function (menu, event) { me.onCreateAfrfenClick(menu, event, 2); } }, { text: Zi.LAN.AMS, //"AMS", // id: 'EDI-AMS', // hidden: true, handler: function (menu, event) { _this.onCreateAfrfenClick(menu, event,'AMS'); } }, { text: 'EMANIFEST', //"AMS", // id: 'EDI-AMS', // hidden: true, handler: function (menu, event) { _this.onCreateAfrfenClick(menu, event, 'EMANIFEST'); } }, { text: 'ISF', //"AMS", // id: 'EDI-AMS', // hidden: true, handler: function (menu, event) { _this.onCreateAfrfenClick(menu, event, 'ISF'); } }], scope: this }, '-', { text: Zi.LAN.ChuanDaiCangDan, menu: [ { text: Zi.LAN.SHENBAOFENDAN, handler: function (menu, event) { me.onCreateCustomfenClick(menu, event, 'CUSTOM'); } }, { text: Zi.LAN.DSManifest, handler: function (menu, event) { _this.winDSMANIFESTShow.show(); } }], scope: this }, '-', { text: Zi.LAN.OtherCaoZuo, menu: [{ text: Zi.LAN.UpCase, handler: function (menu, event) { _this.onUpCaseClick(menu, event); } }, { text: Zi.LAN.DIAORUCANGDANSHOUFATONG, handler: function (menu, event) { _this.onImportAmsClick(menu, event); } }, { text: Zi.LAN.DIAORUMASTER, handler: function (menu, event) { _this.onImportMasterClick(menu, event); } }, { text: Zi.LAN.FDTZ, //"放单通知", handler: function (menu, event) { _this.onFDTZClick(menu, event); } },{ text: Zi.LAN.ImportBill, //"EXCEL导入", iconCls: "btnexportexcel", handler: function (button, event) { this.onImportBillClick(button, event); }, scope: this }, { text: Zi.LAN.SHENGCHENGBAODAN, iconCls: "btnexportexcel", handler: function (button, event) { this.ShengChengBaoDan(button, event); }, scope: this } ], scope: this }, '-', { text: 'OCR', //快速录入, handler: function (button, event) { if (this.panelOcr.isHidden()) { mainform.tabtree.hide(); if (this.panelOcr.width < 2) { var wSeaePanel = this.panelpage.getWidth(); this.panelOcr.setWidth(wSeaePanel * 0.6); } this.panelOcr.body.dom.children[0].src = "/MvcShipping/Ocr/UpOcrAuto"; this.panelOcr.show(); } else { mainform.tabtree.show(); this.panelOcr.hide(); } }, scope: this }] }); //end 按钮Toolbar //#endregion //#region 框架结构 this.storeNameFa = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataListRm' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameFa = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.NAME, store: this.storeNameFa, queryParam: 'DisplayName', minChars: 0, queryMode: 'remote', flex: 0.5, name: 'SHIPPERNAME', valueField: 'NAME', displayField: 'NAME', listeners: { beforequery: function (e) { }, select: function (combo, records, eOpts) { if (records.length > 0) { _this.formcd.getForm().findField('SHIPPERNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('SHIPPERADDR1').setValue(records[0].data.ADDRESS); _this.formEdit.getForm().findField('SHIPPERTEL').setValue(records[0].data.TEL); _this.formEdit.getForm().findField('SHIPPERCODE').setValue(records[0].data.CODE); _this.formEdit.getForm().findField('SHIPPERCOUNTRY').setValue(records[0].data.COUNTRY); } } } }); this.panelShipper = new Ext.Panel({ title: Zi.LAN.SHIPPER, layout: "anchor", height: 100, flex: 1, frame: true, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', labelWidth: 60, msgTarget: 'qtip' }, items: [{ xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ xtype: 'hiddenfield' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxNameFa, { xtype: "button", text: Zi.LAN.BAOCUNWEIMOBAN, handler: function () { _TempType = 'F'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: Zi.LAN.ADDR1, flex: 1, name: 'SHIPPERADDR1' }] } ] }); //#region 名称(收货人) this.storeNameShou = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataListRm' } }); // this.storeNameShou.load({ params: { condition: "TYPE = 'S'" } }); this.comboxNameShou = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.NAME, store: this.storeNameShou, queryParam: 'DisplayName', minChars: 0, queryMode: 'remote', flex: 0.5, name: 'CONSIGNEENAME', valueField: 'NAME', displayField: 'NAME', listeners: { beforequery: function (e) { //var combo = e.combo; //if (!e.forceAll) { // var value = e.query; // value = value.toUpperCase(); // combo.store.filterBy(function (record, id) { // var text = record.get(combo.displayField); // text = text.toUpperCase(); // return (text.indexOf(value) != -1); // }); // combo.expand(); // return false; //} }, select: function (combo, records, eOpts) { if (records.length > 0) { _this.formcd.getForm().findField('CONSIGNEENAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('CONSIGNEEADDR1').setValue(records[0].data.ADDRESS); _this.formEdit.getForm().findField('CONSIGNEETEL').setValue(records[0].data.TEL); _this.formEdit.getForm().findField('CONSIGNEECODE').setValue(records[0].data.CODE); _this.formEdit.getForm().findField('CONSIGNEECOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('NOTIFYPARTYNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('NOTIFYPARTYADDR1').setValue(records[0].data.ADDRESS); _this.formEdit.getForm().findField('NOTIFYPARTYTEL').setValue(records[0].data.TEL); _this.formEdit.getForm().findField('NOTIFYPARTYCODE').setValue(records[0].data.CODE); _this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRY').setValue(records[0].data.COUNTRY); } } } }); this.panelConsignee = new Ext.Panel({ title: Zi.LAN.CONSIGNEE, layout: "anchor", height:100, flex: 1, frame: true, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'hiddenfield' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxNameShou, { xtype: "button", text: Zi.LAN.BAOCUNWEIMOBAN, handler: function () { _TempType = 'S'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: Zi.LAN.ADDR1, flex: 1, name: 'CONSIGNEEADDR1' }] }] }); //#region 名称(通知人) this.storeNameTong = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataListRm' } }); // this.storeNameTong.load({ params: { condition: "TYPE = 'T'" } }); this.comboxNameTong = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.NAME, store: this.storeNameTong, queryParam: 'DisplayName', minChars: 0, queryMode: 'remote', flex: 0.5, name: 'NOTIFYPARTYNAME', valueField: 'NAME', displayField: 'NAME', listeners: { beforequery: function (e) { //var combo = e.combo; //if (!e.forceAll) { // var value = e.query; // value = value.toUpperCase(); // combo.store.filterBy(function (record, id) { // var text = record.get(combo.displayField); // text = text.toUpperCase(); // return (text.indexOf(value) != -1); // }); // combo.expand(); // return false; //} }, select: function (combo, records, eOpts) { if (records.length > 0) { _this.formcd.getForm().findField('NOTIFYPARTYNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('NOTIFYPARTYADDR1').setValue(records[0].data.ADDRESS); _this.formEdit.getForm().findField('NOTIFYPARTYTEL').setValue(records[0].data.TEL); _this.formEdit.getForm().findField('NOTIFYPARTYCODE').setValue(records[0].data.CODE); _this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRY').setValue(records[0].data.COUNTRY); } } } }); //#endregion this.panelNotifyParty = new Ext.Panel({ title: Zi.LAN.NOTIFYPARTY, layout: "anchor", height: 100, flex: 1, frame: true, items: [ { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '100%' }, items: [ { xtype: 'hiddenfield' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [ this.comboxNameTong, { xtype: "button", text: Zi.LAN.BAOCUNWEIMOBAN, handler: function () { _TempType = 'T'; _this.winTempSaveShow.show(); } } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [ { fieldLabel: Zi.LAN.ADDR1, flex: 1, name: 'NOTIFYPARTYADDR1' } ] } ] }); this.panelotto= new Ext.Panel({ layout: "anchor", height: 100, flex: 1, frame: true, items: [ { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '100%' }, items: [ { xtype: 'hiddenfield' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [ { fieldLabel:'SCAC', flex: 1, name: 'SCACCODE' } ] } ] }); //#region 名称(通知人) this.storeNameDeliveryTo = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataListRm' } }); // this.storeNameTong.load({ params: { condition: "TYPE = 'T'" } }); this.comboxNameDeliveryTo = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.NAME, store: this.storeNameDeliveryTo, queryParam: 'DisplayName', minChars: 0, queryMode: 'remote', flex: 0.5, name: 'DELIVERYTONAME', valueField: 'NAME', displayField: 'NAME', listeners: { beforequery: function (e) { //var combo = e.combo; //if (!e.forceAll) { // var value = e.query; // value = value.toUpperCase(); // combo.store.filterBy(function (record, id) { // var text = record.get(combo.displayField); // text = text.toUpperCase(); // return (text.indexOf(value) != -1); // }); // combo.expand(); // return false; //} }, select: function (combo, records, eOpts) { if (records.length > 0) { _this.formcd.getForm().findField('DELIVERYTONAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('DELIVERYTOADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('DELIVERYTOADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('DELIVERYTOPOSTCODE').setValue(records[0].data.POSTCODE); _this.formcd.getForm().findField('DELIVERYTOCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('DELIVERYTOCITY').setValue(records[0].data.CITY); } } } }); //#endregion this.panelDeliveryTo = new Ext.Panel({ title:'Delivery To', layout: "anchor", height: 180, flex: 1, frame: true, items: [ { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '100%' }, items: [ { xtype: 'hiddenfield' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [ this.comboxNameDeliveryTo, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'CU'; _this.winTempSaveShow.show(); } } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [ { fieldLabel: Zi.LAN.ADDR1, flex: 1, name: 'DELIVERYTOADDR1' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [ { fieldLabel: Zi.LAN.ADDR2, flex: 1, name: 'DELIVERYTOADDR2' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [ { fieldLabel: Zi.LAN.CITY, flex: 1, name: 'DELIVERYTOCITY' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [ { fieldLabel: Zi.LAN.COUNTRY, flex: 1, labelWidth: 55, name: 'DELIVERYTOCOUNTRY' }, { fieldLabel: Zi.LAN.POSTCODE, flex: 1, name: 'DELIVERYTOPOSTCODE' } ] } ] }); this.formcd = Ext.widget('form', { title: Zi.LAN.formEDI, layout: "anchor", region: 'center', flex: 1, frame: true, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', labelWidth: 40, msgTarget: 'qtip' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [this.panelShipper, this.panelConsignee, this.panelNotifyParty, this.panelotto] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [this.panelDeliveryTo, { xtype: 'hiddenfield', flex: 1 }, { xtype: 'hiddenfield', flex: 1 }, { xtype: 'hiddenfield', flex: 1 }] } ] }); this.formTempNameShow = Ext.widget('form', { frame: true, region: 'center', height: 60, autoScroll: true, bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [ { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '模板名称', name: 'TempName', height: 30 } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); me = this; this.winTempSaveShow = Ext.create('Ext.window.Window', { title: "保存模板", width: 300, height: 120, //plain : true, iconCls: "addicon", resizable: false, // draggable:false,// 是否可以拖动 collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formTempNameShow], buttons: [{ text: "关闭", minWidth: 70, handler: function () { me.winTempSaveShow.close(); } }, { text: "保存", minWidth: 70, handler: function () { me.SaveSFTTemp(); me.winTempSaveShow.close(); } }] }); this.panelOcr = new Ext.Panel({ title: 'OCR', id: 'panelbillOcr', width: 0, visible: false, region: 'east', animate: true, autoScroll: true, split: true, closeAction: 'hide', closable: true, html: '' }); this.panelOcr.on({ hide: function () { mainform.tabtree.show(); }, scope: this }); this.panelbill = new Ext.Panel({ layout: "border", region: 'center', animate: true, autoScroll: true, title: Zi.LAN.BillEdit, // region: 'west', // width: 192, // containerScroll: true, frame: false, items: [this.formEdit] }); this.panelpage = new Ext.TabPanel({ layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.panelbill, this.formcd] }); this.panellist = new Ext.Panel({ // title: '提单信息', layout: "border", region: 'center', animate: true, autoScroll: true, region: 'west', width: 192, // containerScroll: true, frame: false, items: [this.gridListLS] }); Ext.apply(this, { items: [this.panelBtn, this.panellist, this.panelpage, this.panelOcr] }); //#endregion //#region 其他 if (mainform) { this.InitData(); } //绑定事件 this.gridList.on('edit', function (editor, e, eOpts) { this.gridAfterEdit(editor, e, eOpts); }, this); //#endregion //#region 直发舱单 this.CheckVessel = new Ext.form.Checkbox({ fieldLabel: '换船或更改提单号', checked: false }); this.formDsManifestShow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'radiogroup', fieldLabel: '船公司', columns: 2, vertical: true, id: 'dCARRIER', items: [ { boxLabel: '外代', name: 'CARRIER', inputValue: '外代', checked: true }, { boxLabel: '外运', name: 'CARRIER', inputValue: '外运', checked: false }, { boxLabel: '联代', name: 'CARRIER', inputValue: '联代', checked: false }, { boxLabel: '港湾', //'中海', name: 'CARRIER', inputValue: '港湾', //'中海', checked: false }, { boxLabel: '中创', name: 'CARRIER', inputValue: '中创', checked: false }, { boxLabel: '中远', name: 'CARRIER', inputValue: '中远', checked: false }, { boxLabel: '海丰', name: 'CARRIER', inputValue: '海丰', checked: false }, { boxLabel: '振华', name: 'CARRIER', inputValue: '振华', checked: false }, { boxLabel: '中通', name: 'CARRIER', inputValue: '中通', checked: false }, { boxLabel: '中海(青港)', name: 'CARRIER', inputValue: '中海', checked: false } ] }, this.CheckVessel, { xtype: 'textareafield', grow: true, fieldLabel: 'EDI备注', height: 60, id: 'dREMARK', name: 'EDIREMARK', anchor: '100%' } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); me = this; this.winDSMANIFESTShow = Ext.create('Ext.window.Window', { title: "发送预配舱单", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formDsManifestShow], buttons: [{ text: "确定发送", minWidth: 70, handler: function () { var cgCARRIER = Ext.getCmp('dCARRIER'); var CARRIER = cgCARRIER.getValue(); var IsCgVessel = 0; if (me.CheckVessel.checked) IsCgVessel = 1; var dREMARK = Ext.getCmp('dREMARK'); var REMARK = dREMARK.getValue(); me.onSendDS(CARRIER.CARRIER, IsCgVessel, REMARK); } }, { text: "关闭", minWidth: 70, handler: function () { me.winDSMANIFESTShow.close(); } }] }); //#endregion //#region Cargo Smart 中远(客户乾景) this.formCargoSmartEDIShow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [{ xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: '报文类型', //'报文类型', id: 'CargoSmartFILETYPE', defaults: { flex: 1 }, layout: 'hbox', items: [{ boxLabel: '确认', //'确认', name: 'FILETYPE', checked: true, inputValue: 'E' } ] }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '销售代码', //'发票号', id: 'CargoSmartSALEID', name: 'SALEID' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: '文件功能', //'文件功能', id: 'CargoSmartFILEROLE', defaults: { flex: 1 }, layout: 'hbox', items: [{ boxLabel: '原始', //'原始', name: 'FILEROLE', inputValue: 'NEW', checked: true }, { boxLabel: '更新', //'更新', name: 'FILEROLE', inputValue: 'UPD' }, { boxLabel: '删除', //'删除', name: 'FILEROLE', inputValue: 'CAN' }] }] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: '船公司', //'船公司', columns: 2, vertical: true, id: 'CargoSmartCARRIER', items: [{ boxLabel: '中远COSCO', //'中远COSCO', name: 'CARRIER', inputValue: 'COSU', checked: true }] }] } ]//end items(fieldset 1) }]//end root items }); me = this; this.winCargoSmartEDIShow = Ext.create('Ext.window.Window', { title: "生成Cargo Smart报文", //"生成Cargo Smart报文", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formCargoSmartEDIShow], buttons: [{ text: "上传EDI", //"上传EDI", minWidth: 70, handler: function () { var cgFILETYPE = Ext.getCmp('CargoSmartFILETYPE'); var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('CargoSmartFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); var CARRIER = Ext.getCmp('CargoSmartCARRIER').getValue(); var SALEID = Ext.getCmp('CargoSmartSALEID').getValue(); var IsBill = 0; me.onSendCargoSmartEDI(FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, CARRIER.CARRIER, SALEID); saveQuerySetting(me.formname + 'CargoSmartEDI', me.formCargoSmartEDIShow, false, true); } }, { text: "保存EDI文件", //"保存EDI文件", minWidth: 70, handler: function () { var cgFILETYPE = Ext.getCmp('CargoSmartFILETYPE'); var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('CargoSmartFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); var CARRIER = Ext.getCmp('CargoSmartCARRIER').getValue(); var SALEID = Ext.getCmp('CargoSmartSALEID').getValue(); var IsBill = 0; me.onSaveCargoSmartEDI(FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, CARRIER.CARRIER, SALEID); saveQuerySetting(me.formname + 'CargoSmartEDI', me.formCargoSmartEDIShow, false, true); } }, { text: "关闭", //"关闭", minWidth: 70, handler: function () { me.winCargoSmartEDIShow.close(); } }] }); //#endregion this.storeShipper.on('beforeload', function (store) { var CUSTOMERNAME = this.MainEditRecord.get('CUSTOMERNAME'); var condition = "shippertype=2 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )"; Ext.apply(store.proxy.extraParams, { condition: condition }); }, this); this.storeConsignee.on('beforeload', function (store) { var CUSTOMERNAME = this.MainEditRecord.get('CUSTOMERNAME'); var condition = "shippertype=1 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )"; Ext.apply(store.proxy.extraParams, { condition: condition }); }, this); this.storenotifyparty.on('beforeload', function (store) { var CUSTOMERNAME = this.MainEditRecord.get('CUSTOMERNAME'); var condition = "shippertype=3 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )"; Ext.apply(store.proxy.extraParams, { condition: condition }); }, this); this.storenotifypartySecond.on('beforeload', function (store) { var CUSTOMERNAME = this.MainEditRecord.get('CUSTOMERNAME'); var condition = "shippertype=3 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )"; Ext.apply(store.proxy.extraParams, { condition: condition }); }, this); //#region 放单申请 //this.gridList.addListener('itemcontextmenu', this.itemcontextmenu); this.formReason = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, bodyStyle: "padding:0 0 0 0;background:#FFF;", fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 45, msgTarget: 'qtip' }, items: [ { xtype: 'label', name: 'FDINFO', id: "FDINFO", padding: '0 0 0 0', html: "", height: 130, width: 400 }, { fieldLabel: '备注', //'备注', id: "REASON", xtype: 'textareafield', id: 'REASON', name: 'REASON', width: 450, height: 50, listeners: { change: function (field, eOpts) { if (field.lastValue != "") { //this.formHead.getForm().findField('STOCKDATE_1').setValue(field.rawValue); } }, scope: this } }] }); var _this2 = this; this.winFDTZShow = Ext.create('Ext.window.Window', { id: "winFDTZShow", title: "放单通知", //"放单通知", width: 450, height: 260, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0;background:#FFF;", items: [this.formReason], buttons: [ { text: "确定", //"确定", minWidth: 70, handler: function () { _this2.DoFDTZ(Ext.getCmp("REASON").getRawValue()); } }, { text: "取消", //"取消", minWidth: 70, handler: function () { _this2.winFDTZShow.close(); } }, { text: "打印", //"打印", minWidth: 70, handler: function () { _this2.Print_FDTZ(); } }] }); //#endregion //#region 交通部EDI窗体 this.CheckBillIFTMBF = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.isHuoDaiTiDan, //'货代提单', checked: false }); this.formIFTMBFShow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: Zi.LAN.rFILETYPE, //'报文类型', id: 'jtbFILETYPE', defaults: { flex: 1 }, layout: 'hbox', items: [ { boxLabel: Zi.LAN.FILETYPE_B, //'订舱', name: 'FILETYPE', checked: true, inputValue: 'B' }, { boxLabel: Zi.LAN.FILETYPE_E, //'确认', name: 'FILETYPE', inputValue: 'E' } ] } ] }, // { // xtype: 'container', // layout: 'hbox', // defaultType: 'textfield', // items: [this.CheckBillIFTMBF] // }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: Zi.LAN.rFILEROLE, //'文件功能', id: 'jtbFILEROLE', defaults: { flex: 1 }, layout: 'hbox', items: [{ boxLabel: Zi.LAN.FILEROLE_YS, //'原始', name: 'FILEROLE', inputValue: '9', checked: true }, { boxLabel: Zi.LAN.FILEROLE_GX, //'更新', name: 'FILEROLE', inputValue: '5' }, { boxLabel: Zi.LAN.FILEROLE_SC, //'删除', name: 'FILEROLE', inputValue: '4' }] } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: Zi.LAN.CARRIER, //'船公司', columns: 2, vertical: true, id: 'jtbCARRIER', items: [ // { // boxLabel: Zi.LAN.NBCD, //'宁波船代(NBCD)', // name: 'CARRIER', // inputValue: 'NBCD', // checked: true // }, { boxLabel: Zi.LAN.SITC, //'海丰(SITC)', name: 'CARRIER', inputValue: 'SITC', checked: true }] } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); me = this; this.winIFTMBFShow = Ext.create('Ext.window.Window', { title: Zi.LAN.winIFTMBFShow, //"生成交通部报文", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formIFTMBFShow], buttons: [{ text: Zi.LAN.ShangChuanEdi, //"上传EDI", minWidth: 70, handler: function () { var cgFILETYPE = Ext.getCmp('jtbFILETYPE'); var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('jtbFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); var cgCARRIER = Ext.getCmp('jtbCARRIER'); var CARRIER = cgCARRIER.getValue(); // var IsBill = 0; // if (me.CheckBillIFTMBF.checked) // IsBill = 1; me.onSendIFTMBF(FILETYPE.FILETYPE, FILEROLE.FILEROLE, CARRIER.CARRIER); } }, { text: Zi.LAN.BaoCunEdiWenJian, //"保存EDI文件", minWidth: 70, handler: function () { var cgFILETYPE = Ext.getCmp('jtbFILETYPE'); var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('jtbFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); var cgCARRIER = Ext.getCmp('jtbCARRIER'); var CARRIER = cgCARRIER.getValue(); // var IsBill = 0; // if (me.CheckBillIFTMBF.checked) // IsBill = 1; me.onSaveIFTMBF(FILETYPE.FILETYPE, FILEROLE.FILEROLE,CARRIER.CARRIER); } }, { text: Zi.LAN.GuanBi, //"关闭", minWidth: 70, handler: function () { me.winIFTMBFShow.close(); } }] }); //#endregion //#region 神原EDI this.CheckIsFenShenYuanEDI = new Ext.form.Checkbox({ fieldLabel: '是否有分单', //'货代提单', checked: false }); this.formShenYuanEDIShow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [{ xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: Zi.LAN.rFILETYPE, //'报文类型', id: 'ShenYuanFILETYPE', defaults: { flex: 1 }, layout: 'hbox', items: [{ boxLabel: Zi.LAN.FILETYPE_B, //'订舱', name: 'FILETYPE', checked: true, inputValue: 'B' } , { boxLabel: Zi.LAN.FILETYPE_E, //'确认', name: 'FILETYPE', inputValue: 'E' } ] }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.CheckIsFenShenYuanEDI] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: Zi.LAN.rFILEROLE, //'文件功能', id: 'ShenYuanFILEROLE', defaults: { flex: 1 }, layout: 'hbox', items: [{ boxLabel: Zi.LAN.FILEROLE_YS, //'原始', name: 'FILEROLE', inputValue: '9', checked: true }, { boxLabel: Zi.LAN.FILEROLE_GX, //'更新', name: 'FILEROLE', inputValue: '4' }, { boxLabel: Zi.LAN.FILEROLE_SC, //'删除', name: 'FILEROLE', inputValue: '3' }] }] }]//end items(fieldset 1) }]//end root items }); me = this; this.winShenYuanEDIShow = Ext.create('Ext.window.Window', { title: Zi.LAN.winShenYuanEDIShow, //"生成神原报文", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formShenYuanEDIShow], buttons: [{ text: Zi.LAN.ShangChuanEdi, //"上传EDI", minWidth: 70, handler: function () { var cgFILETYPE = Ext.getCmp('ShenYuanFILETYPE'); var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('ShenYuanFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); var CARRIER = ""; // Ext.getCmp('ShenYuanCARRIER').getValue(); var IsBill = 1; var IsFen = 0; if (me.CheckIsFenShenYuanEDI.checked) IsFen = 1; me.onSendShenYuanEDI(FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, CARRIER.CARRIER, IsFen); } }, { text: Zi.LAN.BaoCunEdiWenJian, //"保存EDI文件", minWidth: 70, handler: function () { var cgFILETYPE = Ext.getCmp('ShenYuanFILETYPE'); var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('ShenYuanFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); var CARRIER = ""; // Ext.getCmp('ShenYuanCARRIER').getValue(); var IsBill = 1; var IsFen = 0; if (me.CheckIsFenShenYuanEDI.checked) IsFen = 1; me.onSaveShenYuanEDI(FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, CARRIER.CARRIER, IsFen); } }, { text: Zi.LAN.GuanBi, //"关闭", minWidth: 70, handler: function () { me.winShenYuanEDIShow.close(); } }] }); //#endregion //#region E-FREIGHT this.formEFEDIhow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: Zi.LAN.rFILEROLE, //'文件功能', id: 'efFILEROLE', defaults: { flex: 1 }, layout: 'hbox', items: [{ boxLabel: Zi.LAN.FILEROLE_YS, //'原始', name: 'FILEROLE', inputValue: 'A', checked: true }, { boxLabel: Zi.LAN.FILEROLE_GX, //'更新', name: 'FILEROLE', inputValue: 'R' }, { boxLabel: Zi.LAN.FILEROLE_SC, //'删除', name: 'FILEROLE', inputValue: 'D' }] }] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); me = this; this.winEFEDIShow = Ext.create('Ext.window.Window', { title: Zi.LAN.winEFEDIShow, //"生成E-FREIGHT报文", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formEFEDIhow], buttons: [{ text: Zi.LAN.ShangChuanEdi, //"上传EDI", minWidth: 70, handler: function () { //var cgFILETYPE = Ext.getCmp('jtbcdFILETYPE'); //var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('efFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); me.onSendEFEDI(FILEROLE.FILEROLE); } }, { text: Zi.LAN.BaoCunEdiWenJian, //"保存EDI文件", minWidth: 70, handler: function () { //var cgFILETYPE = Ext.getCmp('jtbcdFILETYPE'); //var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('efFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); me.onSaveEFEDI(FILEROLE.FILEROLE); } }, { text: Zi.LAN.GuanBi, //"关闭", minWidth: 70, handler: function () { me.winEFEDIShow.close(); } }] }); //#endregion //#region 生成EDI this.CheckNoCtn = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.CheckNoCtn, //'不输出箱号封号', checked: false }); this.CheckBill = new Ext.form.Checkbox({ fieldLabel: Zi.LAN.isHuoDaiTiDan, //'货代提单', checked: false }); this.formEdiShow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: Zi.LAN.rFILETYPE, //'报文类型', id: 'rFILETYPE', defaults: { flex: 1 }, layout: 'hbox', items: [ { boxLabel: Zi.LAN.FILETYPE_B, //'订舱', name: 'FILETYPE', checked: true, inputValue: 'B' //,id: 'radio1' }, { boxLabel: Zi.LAN.FILETYPE_E, //'确认', name: 'FILETYPE', inputValue: 'E' //,id: 'radio2' } ] } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'radiogroup', fieldLabel: Zi.LAN.rFILEROLE, //'文件功能', id: 'rFILEROLE', defaults: { flex: 1 }, layout: 'hbox', items: [ { boxLabel: Zi.LAN.FILEROLE_YS, //'原始', name: 'FILEROLE', inputValue: '9', checked: true //,id: 'radio3' }, { boxLabel: Zi.LAN.FILEROLE_ZJ, //'增加', name: 'FILEROLE', inputValue: '2' //,id: 'radio4' }, { boxLabel: Zi.LAN.FILEROLE_SC, //'删除', name: 'FILEROLE', inputValue: '3' //,id: 'radio5' }, { boxLabel: Zi.LAN.FILEROLE_GX, //'更新', name: 'FILEROLE', inputValue: '4' //,id: 'radio6' } ] } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ this.CheckNoCtn, this.CheckBill ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: Zi.LAN.PORTLOADID, //'装港代码', labelWidth: 70, id: 'rPORTLOAD', name: 'PORTLOAD' }, { id: 'rPORTDISCHARGE', fieldLabel: Zi.LAN.rPORTDISCHARGE, //'卸港代码', labelWidth: 70, name: 'PORTDISCHARGE' }, { fieldLabel: Zi.LAN.rRECEIVEROP, //'接收销售', id: 'rRECEIVEROP', labelWidth: 70, name: 'RECEIVEROP' } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); me = this; this.winEDIShow = Ext.create('Ext.window.Window', { title: Zi.LAN.winEDIShow, //"生成EDI", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formEdiShow], listeners: { scope: this, 'beforeshow': function (thewin, eOpts) { LoadQueryData(_this.formname + 'EDI', _this.formEdiShow, NaN); } }, buttons: [{ text: Zi.LAN.ShangChuanEdi, //"上传EDI", minWidth: 70, handler: function () { var cgFILETYPE = Ext.getCmp('rFILETYPE'); var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('rFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); var IsNoCtn = 0; if (me.CheckNoCtn.checked) IsNoCtn = 1; var IsBill = 0; if (me.CheckBill.checked) IsBill = 1; var cgPORTLOAD = Ext.getCmp('rPORTLOAD'); var PORTLOAD = cgPORTLOAD.getValue(); var cgPORTDISCHARGE = Ext.getCmp('rPORTDISCHARGE'); var PORTDISCHARGE = cgPORTDISCHARGE.getValue(); var cgRECEIVEROP = Ext.getCmp('rRECEIVEROP'); var RECEIVEROP = cgRECEIVEROP.getValue(); saveQuerySetting(_this.formname + 'EDI', _this.formEdiShow, true, true); me.onSendEDI(me.editype, FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, IsNoCtn, PORTLOAD, PORTDISCHARGE, RECEIVEROP); } }, { text: Zi.LAN.BaoCunEdiWenJian, //"保存EDI文件", minWidth: 70, handler: function () { var cgFILETYPE = Ext.getCmp('rFILETYPE'); var FILETYPE = cgFILETYPE.getValue(); var cgFILEROLE = Ext.getCmp('rFILEROLE'); var FILEROLE = cgFILEROLE.getValue(); var IsNoCtn = 0; if (me.CheckNoCtn.checked) IsNoCtn = 1; var IsBill = 0; if (me.CheckBill.checked) IsBill = 1; var cgPORTLOAD = Ext.getCmp('rPORTLOAD'); var PORTLOAD = cgPORTLOAD.getValue(); var cgPORTDISCHARGE = Ext.getCmp('rPORTDISCHARGE'); var PORTDISCHARGE = cgPORTDISCHARGE.getValue(); var cgRECEIVEROP = Ext.getCmp('rRECEIVEROP'); var RECEIVEROP = cgRECEIVEROP.getValue(); saveQuerySetting(_this.formname + 'EDI', _this.formEdiShow, true, true); me.onSaveEDI(me.editype, FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, IsNoCtn, PORTLOAD, PORTDISCHARGE, RECEIVEROP); } }, { text: Zi.LAN.GuanBi, //"关闭", minWidth: 70, handler: function () { me.winEDIShow.close(); } }] }); //#endregion //#region 下载窗体 this.formDownloadShow = Ext.widget('form', { frame: true, region: 'center', height: 100, bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', id: 'downloadfile', defaults: { anchor: '100%' }, items: [{ xtype: 'label', html: '', width: 120, text: '' } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); me = this; this.winDownloadShow = Ext.create('Ext.window.Window', { title: Zi.LAN.XiaZaiWenJian, //"下载文件", width: 450, height: 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formDownloadShow], buttons: [{ text: Zi.LAN.GuanBi, //"关闭", minWidth: 70, handler: function () { me.winDownloadShow.close(); } }] }); //#endregion }, //end initUIComponents //#region 加载事件 InitData: function () { var condition = ''; _this = this; this.storeList.load({ params: { condition: "BSNO='" + this.BsNo + "'" }, callback: function (r, options, success) { if (success) { if (this.storeList.getCount() > 0) { var member = this.storeList.getAt(0); _this.editRecord = member; _this.LoadData("edit", "AS_ID='" + member.data.AS_ID + "'"); } else { _this.LoadData('add', ''); } } }, scope: this }); }, //end InitData LoadData: function (opstatus, condition) { this.serialNo = 0; //this.bodyDel = []; this.opStatus = opstatus; _this = this; if (this.opStatus == 'add') { this.formEdit.getForm().reset(); this.formEdit.getForm().setValues(this.MainEditRecord.data); this.formcd.getForm().reset(); this.formcd.getForm().setValues(this.MainEditRecord.data); this.GetEditStatus(); this.LoadInit(this.MainEditRecord.data); this.storeBodyList.load({ params: { condition: "BSNO='" + this.MainEditRecord.get('BSNO') + "'" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { for (var j = 0; j < _this.storeBodyList.getCount(); j += 1) { var memberbody = _this.storeBodyList.getAt(j); memberbody.set("CTN_ID", NewGuid()); memberbody.set("BSNO", "*"); memberbody.commit(); }; } } } }); Ext.Ajax.request({ waitMsg: '正在查询主表数据...', //'正在查询主表数据...', url: '/MvcShipping/MsOpSeae/GetAmsData', params: { condition: "BSNO='" + this.MainEditRecord.data.BSNO + "'" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { return; } data = result.data; if (data.SHIPPERCODE.indexOf('+') < 0) data.SHIPPERCODE = data.ENTERPRISECODETYPE + '+' + data.SHIPPERCODE; if (data.CONSIGNEECODE.indexOf('+') < 0) data.CONSIGNEECODE = data.ENTERPRISECODETYPE1 + '+' + data.CONSIGNEECODE; if (data.NOTIFYPARTYCODE.indexOf('+') < 0) data.NOTIFYPARTYCODE = data.ENTERPRISECODETYPE2 + '+' + data.NOTIFYPARTYCODE; this.formEdit.getForm().setValues(data); this.formcd.getForm().setValues(data); } else { Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText); } }, scope: this }); } else { Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/MsOpSeae/GetBillData', params: { handle: opstatus, condition: condition }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } data = result.data; this.formEdit.getForm().reset(); this.formEdit.getForm().setValues(data); this.formcd.getForm().reset(); this.formcd.getForm().setValues(data); this.storeBodyList.load({ params: { condition: "BSNO='" + data.AS_ID + "'"} }); this.LoadInit(data); this.GetEditStatus(); } else { Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText); } }, scope: this }); } }, // end LoadDate //#endregion //#region 保存 Save: function (type) { var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } //this.formEdit.getForm().findField('SHIPPERNAME').setValue(this.formcd.getForm().findField('SHIPPERNAME').getValue()); //this.formEdit.getForm().findField('SHIPPERADDR1').setValue(this.formcd.getForm().findField('SHIPPERADDR1').getValue()); //this.formEdit.getForm().findField('CONSIGNEENAME').setValue(this.formcd.getForm().findField('CONSIGNEENAME').getValue()); //this.formEdit.getForm().findField('CONSIGNEEADDR1').setValue(this.formcd.getForm().findField('CONSIGNEEADDR1').getValue()); //this.formEdit.getForm().findField('NOTIFYPARTYNAME').setValue(this.formcd.getForm().findField('NOTIFYPARTYNAME').getValue()); //this.formEdit.getForm().findField('NOTIFYPARTYADDR1').setValue(this.formcd.getForm().findField('NOTIFYPARTYADDR1').getValue()); //this.formEdit.getForm().findField('SCACCODE').setValue(this.formcd.getForm().findField('SCACCODE').getValue()); //this.formEdit.getForm().findField('AS_ID').setDisabled(false); var data = this.formEdit.getForm().getValues(false, false, false); //this.formEdit.getForm().findField('AS_ID').setDisabled(true); var data2 = this.formcd.getForm().getValues(false, false, false); data.BSNO = this.MainEditRecord.data.BSNO; Object.assign(data, data2); var datajs = Ext.JSON.encode(data); var reg = new RegExp("<", "g"); //创建正则RegExp对象 var stringObj = ""; stringObj = datajs.toString(); var datajs = stringObj.replace(reg, "❥"); var bodydatas = []; for (var i = 0; i < this.storeBodyList.getCount(); i += 1) { var member = this.storeBodyList.getAt(i); bodydatas.push(member); } // var jsonBody = ConvertRecordsToJsonAll(bodydatas); // Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsOpSeae/BillSave', scope: this, params: { opstatus: this.opStatus, data: datajs, body: jsonBody }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var returnData = jsonresult.Data; this.formEdit.getForm().reset(); this.formEdit.getForm().setValues(returnData); // if (this.opStatus == 'add') { var arrNewRecords = this.storeList.insert(0, returnData); this.editRecord = this.storeList.getAt(0); //此时应根据returnData.data.AS_ID来决定选中哪行 for (i = 0; i < this.storeList.getCount(); i += 1) { var rec = this.storeList.getAt(i).data; if (rec.AS_ID == returnData.AS_ID) { this.gridListLS.getSelectionModel().select(i); } } } else if (this.opStatus == 'edit') { var editp = Ext.create('MsOpBillModel', returnData); this.editRecord.fields.each(function (field) { if (field.persist) { name = field.name; if (name != 'id') this.editRecord.set(name, editp.get(name)); } }, this); this.editRecord.commit(); this.LoadInit(returnData); //此时应根据returnData.data.AS_ID来决定选中哪行 for (i = 0; i < this.storeList.getCount(); i += 1) { var rec = this.storeList.getAt(i).data; if (rec.AS_ID == returnData.AS_ID) { this.gridListLS.getSelectionModel().select(i); } } } if (type == '0') { this.opStatus = 'edit'; for (var j = 0; j < this.storeBodyList.getCount(); j += 1) { var memberbody = this.storeBodyList.getAt(j); memberbody.set("BSNO", this.editRecord.get('AS_ID')); memberbody.commit(); }; } else if (type == '1') { window.close(); } else if (type == '2') { this.LoadData('add', ''); } } else { Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { Ext.Msg.show({ title: '请重试', msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); }, //end save //#endregion //#region 集装箱按钮事件 onAddDetailClick: function (button, event) { this.addDetail(); }, //end onAddDetailClick onDelDetailClick: function (button, event) { this.deleteDetail(); }, //onDelDetailClick onUpdateDetailClick: function (button, event) { this.UpdateDetail(); }, //onDelDetailClick gridAfterEdit: function (editor, e, eOpts) { if (e.field == 'PKGS' || e.field == 'KGS' || e.field == 'CBM') { this.setAllTotal(); if (e.field == 'KGS') { var KGS = this.formEdit.getForm().findField('KGS').getValue(); this.formEdit.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS'); } if (e.field == 'CBM') { var CBM = this.formEdit.getForm().findField('CBM').getValue(); this.formEdit.getForm().findField('MEASUREMENT').setValue(CBM + 'CBM'); } if (e.field == 'PKGS') { var PKGS = this.formEdit.getForm().findField('PKGS').getValue(); var KINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue(); this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS); this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.'); } } else if (e.field == 'KINDPKGS') { var KINDPKGS = e.record.data['KINDPKGS']; this.setHeadFieldValue('KINDPKGS', KINDPKGS); var PKGS = this.formEdit.getForm().findField('PKGS').getValue(); this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS); this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.'); } else if (e.field == 'CTNALL' || e.field == 'CNTRNO' || e.field == 'SEALNO') { this.calcDetailCntrTotal(); } }, addDetail: function () { //var newSerialno = DsGetNewSerialNo(this.storeBodyList, this.serialNo); var newSerialno = this.DsGetNewNo(this.storeBodyList); this.serialNo = newSerialno; var KINDPKGS = ''; if (this.storeBodyList.getCount() > 0) { var memberbody = this.storeBodyList.getAt(0); KINDPKGS = memberbody.data.KINDPKGS; } var record = Ext.create('MsOpSeaeDetail', { CTN_ID: NewGuid(), BSNO: '*', CTNCODE: newSerialno, CTNALL: '', CTNNUM: 1, CNTRNO: '', SEALNO: '', PKGS: 0, KINDPKGS: KINDPKGS, KGS: 0, TAREWEIGHT: 0, CBM: 0, FENPKGS: 0, FENKGS: 0, FENCBM: 0, WEIGHTYPE: '', WEIGHKGS: 0, WEIGHATTN: '', WEIGHTEL: '', WEIGHSIGN: '', CTNSTATUS: 'F', MASTERNO: '', REMARK: '' }); this.storeBodyList.add(record); var n = this.storeBodyList.getCount(); this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 2 }); }, DsGetNewNo: function (store) { var result = store.getCount(); if (result == 0) { return 1; } // var record = store.getAt(result - 1).data.CTNCODE; result = result + 1; return result; }, deleteDetail: function () { var selectedRecords = this.gridList.selModel.getSelection(); for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (rec.data.BSNO == "" || rec.data.BSNO == "*")//如果是新增但没有保存的数据,没有必要提交到后台 { //this.bodyDel.push(rec); this.storeBodyList.remove(selectedRecords[i]); this.calcDetailCntrTotal(); this.setAllTotal(); var KGS = this.formEdit.getForm().findField('KGS').getValue(); this.formEdit.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS'); var CBM = this.formEdit.getForm().findField('CBM').getValue(); this.formEdit.getForm().findField('MEASUREMENT').setValue(CBM + 'CBM'); var PKGS = this.formEdit.getForm().findField('PKGS').getValue(); var KINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue(); this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS); this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.'); } else { Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) { if (btn == 'yes') { Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsOpSeae/DeleteDetail', params: { data: Ext.JSON.encode(rec.data) }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { this.storeBodyList.remove(rec); this.calcDetailCntrTotal(); this.setAllTotal(); var KGS = this.formEdit.getForm().findField('KGS').getValue(); this.formEdit.getForm().findField('GROSSWEIGHT').setValue(KGS + 'KGS'); var CBM = this.formEdit.getForm().findField('CBM').getValue(); this.formEdit.getForm().findField('MEASUREMENT').setValue(CBM + 'CBM'); var PKGS = this.formEdit.getForm().findField('PKGS').getValue(); var KINDPKGS = this.formEdit.getForm().findField('KINDPKGS').getValue(); this.formEdit.getForm().findField('NOPKGS').setValue(PKGS + KINDPKGS); this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(PKGS).toUpperCase() + ' ' + KINDPKGS + ' ONLY.'); Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } else { Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }, failure: function (response, options) { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, scope: this }); //end Ext.Ajax.request } }, this); } //this.storeBodyList.remove(selectedRecords[i]); } }, upMasterCtn: function () { var bodyAddDatas = []; for (var i = 0; i < this.storeBodyList.getCount(); i += 1) { var memberbody = this.storeBodyList.getAt(i); bodyAddDatas.push(memberbody); this.storeBodyList.remove(memberbody); } var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: '正在删除数据...', url: '/MvcShipping/MsOpSeae/DeleteDetailList', params: { data: jsonbodyAddDatas }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { this.calcDetailCntrTotal(); this.storeBodyList.load({ params: { condition: "BSNO='" + this.MainEditRecord.get('BSNO') + "'" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { for (var j = 0; j < _this.storeBodyList.getCount(); j += 1) { var memberbody = _this.storeBodyList.getAt(j); memberbody.set("CTN_ID", NewGuid()); memberbody.set("BSNO", "*"); memberbody.commit(); }; _this.UpdateDetail(); } } } }); } else { } } }, failure: function (response, options) { Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, scope: this }); //end Ext.Ajax.request }, setAllTotal: function () { this.setPKGSTotal(); this.setKGSTotal(); this.setCBMTotal(); }, setPKGSTotal: function () { var total = this.calcDetailTotal('PKGS'); this.setHeadFieldValue('PKGS', total); }, setKGSTotal: function () { var total = this.calcDetailTotal('KGS'); this.setHeadFieldValue('KGS', total); }, setCBMTotal: function () { var total = this.calcDetailTotal('CBM'); this.setHeadFieldValue('CBM', total); }, calcDetailTotal: function (fieldName) { var total = 0; for (var i = 0; i < this.storeBodyList.getCount(); i += 1) { var member = this.storeBodyList.getAt(i); var value = member.get(fieldName); total = Add(total, value, 4); } return total; }, calcDetailCntrTotal: function () { var cntrstr = ''; for (var i = 0; i < this.storeBodyList.getCount(); i += 1) { var member = this.storeBodyList.getAt(i); var cntr = member.get('CNTRNO') + '/' + member.get('SEALNO') + '/' + member.get('CTNALL'); cntrstr = cntrstr + cntr + "\n"; } this.setHeadFieldValue('CNTRSEALNO', cntrstr); }, setHeadFieldValue: function (fieldName, value) { var field = this.formEdit.getForm().findField(fieldName); field.setValue(value); }, UpdateDetail: function () { var pkgs = 0; var kgs = 0; var cbm = 0; var str_kind = ''; for (var i = 0; i < this.storeBodyList.getCount(); i += 1) { var member = this.storeBodyList.getAt(i); var Bpkgs = member.get('PKGS'); var Bkgs = member.get('KGS'); var Bcbm = member.get('CBM'); str_kind = member.get('KINDPKGS'); pkgs = parseFloat(pkgs).add( parseFloat(Bpkgs)); kgs = parseFloat(kgs).add( parseFloat(Bkgs)); cbm = parseFloat(cbm).add( parseFloat(Bcbm)); } this.formEdit.getForm().findField('PKGS').setValue(pkgs); this.formEdit.getForm().findField('KINDPKGS').setValue(str_kind); this.formEdit.getForm().findField('NOPKGS').setValue(pkgs + str_kind); var pkgsstr = ToEn(pkgs.toString()).toUpperCase(); this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + pkgsstr + ' ' + str_kind + ' ONLY.'); this.formEdit.getForm().findField('KGS').setValue(kgs); this.formEdit.getForm().findField('GROSSWEIGHT').setValue(kgs + 'KGS'); this.formEdit.getForm().findField('CBM').setValue(cbm); this.formEdit.getForm().findField('MEASUREMENT').setValue(cbm + 'CBM'); }, onImportAmsClick: function () { Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...', url: '/MvcShipping/MsOpSeae/GetAmsData', params: { condition: "BSNO='" + this.MainEditRecord.get('BSNO') + "'" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } data = result.data; this.formEdit.getForm().findField('SHIPPERCODE').setValue(data.SHIPPERCODE) this.formEdit.getForm().findField('SHIPPERCOUNTRY').setValue(data.SHIPPERCOUNTRY) this.formEdit.getForm().findField('SHIPPERTEL').setValue(data.SHIPPERTEL) this.formEdit.getForm().findField('SHIPPEREMAIL').setValue(data.SHIPPEREMAIL) this.formEdit.getForm().findField('CONSIGNEECODE').setValue(data.CONSIGNEECODE) this.formEdit.getForm().findField('CONSIGNEECOUNTRY').setValue(data.CONSIGNEECOUNTRY) this.formEdit.getForm().findField('CONSIGNEETEL').setValue(data.CONSIGNEETEL) this.formEdit.getForm().findField('CONSIGNEEEMAIL').setValue(data.CONSIGNEEEMAIL) this.formEdit.getForm().findField('NOTIFYPARTYCODE').setValue(data.NOTIFYPARTYCODE) this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRY').setValue(data.NOTIFYPARTYCOUNTRY) this.formEdit.getForm().findField('NOTIFYPARTYTEL').setValue(data.NOTIFYPARTYTEL) this.formEdit.getForm().findField('NOTIFYPARTYEMAIL').setValue(data.NOTIFYPARTYEMAIL) this.formcd.getForm().findField('SHIPPERNAME').setValue(data.SHIPPERNAME) this.formcd.getForm().findField('SHIPPERADDR1').setValue(data.SHIPPERADDR1) this.formcd.getForm().findField('CONSIGNEENAME').setValue(data.CONSIGNEENAME) this.formcd.getForm().findField('CONSIGNEEADDR1').setValue(data.CONSIGNEEADDR1) this.formcd.getForm().findField('NOTIFYPARTYNAME').setValue(data.NOTIFYPARTYNAME) this.formcd.getForm().findField('NOTIFYPARTYADDR1').setValue(data.NOTIFYPARTYADDR1) this.formEdit.getForm().findField('DESCRIPTION').setValue(data.CDESCRIPTION) } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); }, onImportMasterClick: function () { this.formEdit.getForm().findField('SHIPPERID').setValue(this.MainEditRecord.data.MSHIPPERID); this.formEdit.getForm().findField('SHIPPER').setValue(this.MainEditRecord.data.MSHIPPER); this.formEdit.getForm().findField('CONSIGNEEID').setValue(this.MainEditRecord.data.MCONSIGNEEID); this.formEdit.getForm().findField('CONSIGNEE').setValue(this.MainEditRecord.data.MCONSIGNEE); this.formEdit.getForm().findField('NOTIFYPARTYID').setValue(this.MainEditRecord.data.MNOTIFYPARTYID); this.formEdit.getForm().findField('NOTIFYPARTY').setValue(this.MainEditRecord.data.MNOTIFYPARTY); this.formEdit.getForm().findField('BLFRT').setValue(this.MainEditRecord.data.MBLFRT); this.formEdit.getForm().findField('DESCRIPTION').setValue(this.MainEditRecord.data.MDESCRIPTION); }, //#endregion //#region 直发舱单EDI onSendDS: function (carrier, iscgvessel, remarks) { var BSNO = this.formEdit.getForm().findField('AS_ID').getValue(); Ext.Ajax.request({ waitMsg: '正在生成...', url: '/MvcShipping/MsOpSeaeEdi/CustomBillEdiMail', params: { bsnos: BSNO, dcarrier: carrier, iscvessel: iscgvessel, remarks: remarks }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); }, //#endregion onDeleteClick: function (button, event) { var selections = this.gridListLS.getSelectionModel().getSelection(); if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var record = selections[0]; if (this.StoreOpRange.getCount() == 0) { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } else { var inputby = record.data.INPUTBY; var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', inputby); if (records.getCount() > 0) { } else { canedit = false; Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } } Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) { if (btn == 'yes') { Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu ); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu , url: '/MvcShipping/MsOpSeae/BillDelete', params: { data: Ext.JSON.encode(record.data) }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { this.storeList.remove(record); if (this.storeList.getCount() > 0) { var member = this.storeList.getAt(0); this.LoadData("edit", "AS_ID='" + member.data.AS_ID + "'"); this.editRecord = member; } else { this.LoadData('add', ''); } Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message.replace("删除数据成功", Zi.LAN.DeleteSuccess), icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } else { Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message.replace("删除错误", Zi.LAN.DeleteErro), icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }, failure: function (response, options) { Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, success: function (response, options) { }, scope: this }); //end Ext.Ajax.request } }, this); }, HpBill: function () { var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '请先选择要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var bodyAddDatas = []; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; bodyAddDatas.push(rec); } Ext.MessageBox.confirm(Zi.LAN.TiShi, '确定要生成合票出单吗?', function (btn) { if (btn == 'yes') { var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Ajax.request({ waitMsg: '正在生成...', url: '/MvcShipping/MsOpSeae/CreateHp', params: { data: jsonbodyAddDatas }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, this); }, SaveSFTTemp: function () { var tempname = this.formTempNameShow.getForm().findField('TempName').getValue(); if (tempname == null || tempname == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '模板名称不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var dataObj = new Object(); dataObj.gid = NewGuid(); dataObj.TEMPLATENAME = tempname; dataObj.TYPE = _TempType; if (_TempType == 'S') { var name = this.formcd.getForm().findField('CONSIGNEENAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '收货人不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('CONSIGNEENAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('CONSIGNEEADDR1').getValue(); dataObj.COUNTRY = this.formEdit.getForm().findField('CONSIGNEECOUNTRY').getValue(); dataObj.CODE = this.formEdit.getForm().findField('CONSIGNEECODE').getValue(); dataObj.TEL = this.formEdit.getForm().findField('CONSIGNEETEL').getValue(); } else if (_TempType == 'F') { var name = this.formcd.getForm().findField('SHIPPERNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '发货人不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('SHIPPERNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('SHIPPERADDR1').getValue(); dataObj.COUNTRY = this.formEdit.getForm().findField('SHIPPERCOUNTRY').getValue(); dataObj.CODE = this.formEdit.getForm().findField('SHIPPERCODE').getValue(); dataObj.TEL = this.formEdit.getForm().findField('SHIPPERTEL').getValue(); } else if (_TempType == 'T') { var name = this.formcd.getForm().findField('NOTIFYPARTYNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '通知人不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('NOTIFYPARTYNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('NOTIFYPARTYADDR1').getValue(); dataObj.COUNTRY = this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRY').getValue(); dataObj.CODE = this.formEdit.getForm().findField('NOTIFYPARTYCODE').getValue(); dataObj.TEL = this.formEdit.getForm().findField('NOTIFYPARTYTEL').getValue(); } else if (_TempType == 'CU') { var name = this.formcd.getForm().findField('DELIVERYTONAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: 'DeliveryTo不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('DELIVERYTONAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('DELIVERYTOADDR1').getValue(); dataObj.ADDRESS2 = this.formcd.getForm().findField('DELIVERYTOADDR2').getValue(); dataObj.COUNTRY = this.formcd.getForm().findField('DELIVERYTOCOUNTRY').getValue(); dataObj.POSTCODE = this.formcd.getForm().findField('DELIVERYTOPOSTCODE').getValue(); //dataObj.TEL = this.formcd.getForm().findField('DELIVERYTOTEL').getValue(); dataObj.CITY = this.formcd.getForm().findField('DELIVERYTOCITY').getValue(); } else { return; } var datastr = Ext.JSON.encode(dataObj); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/MsOpSeaeEdiTemplate/Submit?OpStatus=add', scope: this, params: { data: datastr, }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.success) { Ext.Msg.alert(Zi.LAN.TiShi, '模板保存成功!'); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); }, onCreateAfrfenClick: function (menu, event, type) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '请先选择要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '没有要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Ajax.request({ waitMsg: '正在生成...', url: '/MvcShipping/MsOpSeae/CreateAfrListFen', params: { BSNOS: BSNOStr, type: type, bsno: this.BsNo }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onCreateCustomfenClick: function (menu, event, type) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '请先选择要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '没有要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Ajax.request({ waitMsg: '正在生成...', url: '/MvcShipping/MsOpSeae/CreateCustomListFen', params: { BSNOS: BSNOStr, type: type, bsno: this.BsNo }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, //#region //#region Cargo Smart 中远(客户乾景) onCreateCargoSmartEDIClick: function (menu, event) { this.winCargoSmartEDIShow.show(); }, onSendCargoSmartEDI: function (filetype, filerole, isbill, carrier, saleid) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; var bsno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; bsno = rec.data.BSNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoCaoZuoDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsOpSeae/CreateCargoSmartBillEDIList', params: { bsnos: BSNOStr, mblno: Mblno, bsno: bsno, filetype: filetype, filerole: filerole, isbill: isbill, carrier: carrier, saleid: saleid }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onSaveCargoSmartEDI: function (filetype, filerole, isbill, carrier, saleid) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; var bsno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; bsno = rec.data.BSNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoCaoZuoDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Ajax.request({ waitMsg: Zi.LAN.Changing, url: '/MvcShipping/MsOpSeae/SaveCargoSmartBillEDIList', params: { bsnos: BSNOStr, mblno: Mblno, bsno: bsno, filetype: filetype, filerole: filerole, isbill: isbill, carrier: carrier, saleid: saleid }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { var downloadfile = Ext.getCmp('downloadfile'); var children = downloadfile.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { downloadfile.remove(children.items[i], true); } } var downloadfiles = '' + result.Message + ''; var htmla = Ext.widget('label', { html: downloadfiles, width: 120, text: '' }); downloadfile.items.add(htmla); this.winDownloadShow.show(); } } else { Ext.MessageBox.alert('The Server Response Error, Please Try Again', response.responseText); } }, scope: this }); } }, //#endregion //#region 交通部 onCreateIFTMBFClick: function (menu, event) { this.winIFTMBFShow.show(); }, onSendIFTMBF: function (filetype, filerole, carrier) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoCaoZuoDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsOpSeae/CreateBillIFTMBFList', params: { bsnos: BSNOStr, mblno: Mblno, filetype: filetype, filerole: filerole, carrier: carrier }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.winIFTMBFShow.close(); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onSaveIFTMBF: function (filetype, filerole, carrier) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoCaoZuoDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Ajax.request({ waitMsg: Zi.LAN.Changing, url: '/MvcShipping/MsOpSeae/SaveBillIFTMBFList', params: { bsnos: BSNOStr, mblno: Mblno, filetype: filetype, filerole: filerole, carrier: carrier }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { var downloadfile = Ext.getCmp('downloadfile'); var children = downloadfile.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { downloadfile.remove(children.items[i], true); } } var downloadfiles = '' + result.Message + ''; var htmla = Ext.widget('label', { html: downloadfiles, width: 120, text: '' }); downloadfile.items.add(htmla); this.winDownloadShow.show(); } } else { Ext.MessageBox.alert('The Server Response Error, Please Try Again', response.responseText); } }, scope: this }); } }, //#endregion //#region EDI onCreateEDIClick: function (menu, event, type) { this.editype = type; this.winEDIShow.show(); }, onSendEDI: function (type, filetype, filerole, isbill, isnoctn, portload, portdischarge, receiverop) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoShengChengDeShuJu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在生成...', url: '/MvcShipping/MsOpSeae/CreateBillEDIList', params: { bsnos: BSNOStr, mblno: Mblno, type: type, filetype: filetype, filerole: filerole, isbill: isbill, isnoctn: isnoctn, portload: portload, portdischarge: portdischarge, receiverop: receiverop }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.winEDIShow.close(); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onSaveEDI: function (type, filetype, filerole, isbill, isnoctn, portload, portdischarge, receiverop) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoShengChengDeShuJu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Ajax.request({ waitMsg: Zi.LAN.Changing, //'Changing...', url: '/MvcShipping/MsOpSeae/SaveBillEDIList', params: { bsnos: BSNOStr, mblno: Mblno, type: type, filetype: filetype, filerole: filerole, isbill: isbill, isnoctn: isnoctn, portload: portload, portdischarge: portdischarge, receiverop: receiverop }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { // var openSet = "height=100, width=100, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top=" + (screen.height - 200) / 2 + ",Left=" + (screen.width - 200) / 2; // var openType = "_blank"; // var openUrl = "../../Reports/FileExport.aspx?filename=" + result.Data; // window.open(openUrl, openType, openSet); // this.formDownloadShow.items.removeAll(true); var downloadfile = Ext.getCmp('downloadfile'); var children = downloadfile.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { downloadfile.remove(children.items[i], true); } } // downloadfile.doLayout(); // // var downloadfile = Ext.getCmp('downloadfile'); // var filehtml = '' + result.Message + '' // downloadfile.html = filehtml; var downloadfiles = '' + result.Message + ''; var htmla = Ext.widget('label', { html: downloadfiles, width: 120, text: '' }); downloadfile.items.add(htmla); this.winDownloadShow.show(); } } else { Ext.MessageBox.alert('The Server Response Error, Please Try Again', response.responseText); } }, scope: this }); } }, //#endregion //#region 神原EDI onCreateShenYuanEDIClick: function (menu, event) { this.winShenYuanEDIShow.show(); }, onSendShenYuanEDI: function (filetype, filerole, isbill, carrier, IsFen) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoCaoZuoDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsOpSeae/CreateShenYuanBillEDIList', params: { bsnos: BSNOStr, mblno: Mblno, filetype: filetype, filerole: filerole, isbill:1, carrier: carrier, isfen: IsFen }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); _this.winShenYuanEDIShow.close(); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onSaveShenYuanEDI: function (filetype, filerole, isbill, carrier, IsFen) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoCaoZuoDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Ajax.request({ waitMsg: Zi.LAN.Changing, url: '/MvcShipping/MsOpSeae/SaveShenYuanBillEDIList', params: { bsnos: BSNOStr, mblno: Mblno, filetype: filetype, isbill: 1, filerole: filerole, carrier: carrier, isfen: IsFen }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { var downloadfile = Ext.getCmp('downloadfile'); var children = downloadfile.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { downloadfile.remove(children.items[i], true); } } var downloadfiles = '' + result.Message + ''; var htmla = Ext.widget('label', { html: downloadfiles, width: 120, text: '' }); downloadfile.items.add(htmla); this.winDownloadShow.show(); } } else { Ext.MessageBox.alert('The Server Response Error, Please Try Again', response.responseText); } }, scope: this }); } }, //#endregion //#region E-FREIGHT EDI onCreateEFEDIClick: function (menu, event) { this.winEFEDIShow.show(); }, onSendEFEDI: function (FILEROLE) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoCaoZuoDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, url: '/MvcShipping/MsOpSeae/CreateEFEDIBLList', params: { bsnos: BSNOStr, mblno: Mblno, filetype: 'EDI', filerole: FILEROLE }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } }, onSaveEFEDI: function (FILEROLE) { var GidStr = ''; var selections = this.GridCheckBoxModel.selected.items; if (selections.length == 0) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var BSNOStr = ''; var j = 0; var Mblno = ''; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; Mblno = rec.data.MBLNO; var BSNO = rec.data.AS_ID; if (BSNOStr == '') BSNOStr = BSNO; else { BSNOStr = BSNOStr + ',' + BSNO; } } if (BSNOStr == '') { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoCaoZuoDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { Ext.Ajax.request({ waitMsg: Zi.LAN.Changing, url: '/MvcShipping/MsOpSeae/SaveEFEDIBLList', params: { bsnos: BSNOStr, mblno: Mblno, filetype: 'EDI', filerole: FILEROLE }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { var downloadfile = Ext.getCmp('downloadfile'); var children = downloadfile.items; if (children) { for (var i = 0, len = children.length; i < len; i++) { downloadfile.remove(children.items[i], true); } } var downloadfiles = '' + result.Message + ''; var htmla = Ext.widget('label', { html: downloadfiles, width: 120, text: '' }); downloadfile.items.add(htmla); this.winDownloadShow.show(); } } else { Ext.MessageBox.alert('The Server Response Error, Please Try Again', response.responseText); } }, scope: this }); } }, //#endregion LoadInit: function (data) { var CUSTOMERNAME = this.MainEditRecord.CUSTOMERNAME; this.storeShipper.load({ params: { condition: "shippertype=2 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" }, callback: function (r, options, success) { if (success) { this.formEdit.getForm().findField('SHIPPERID').setValue(data.SHIPPERID); } }, scope: this }); this.storeConsignee.load({ params: { condition: "shippertype=1 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" }, callback: function (r, options, success) { if (success) { this.formEdit.getForm().findField('CONSIGNEEID').setValue(data.CONSIGNEEID); } }, scope: this }); this.storenotifyparty.load({ params: { condition: "shippertype=3 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" }, callback: function (r, options, success) { if (success) { this.formEdit.getForm().findField('NOTIFYPARTYID').setValue(data.NOTIFYPARTYID); } }, scope: this }); this.storeagent.load({ params: { condition: "shippertype=4 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" }, callback: function (r, options, success) { if (success) { this.formEdit.getForm().findField('AGENTID').setValue(data.AGENTID); } }, scope: this }); }, //#endregion GetHBLNo: function () { var HBLNO = this.formEdit.getForm().findField('HBLNO').getValue(); var ETD = this.formEdit.getForm().findField('ETD').getValue(); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询委托编号状态...', url: '/MvcShipping/MsSysBillNoSet/GetNewNo', params: { bltype: '海运出口', ruleblno: '分提单号', etd: ETD, accdate: ETD }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success != true) { } else { this.formEdit.getForm().findField('HBLNO').setValue(result.Message); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); }, onUpCaseClick: function (menu, event) { this.formEdit.getForm().findField('SHIPPER').setValue(this.formEdit.getForm().findField('SHIPPER').getValue().toUpperCase()); this.formEdit.getForm().findField('CONSIGNEE').setValue(this.formEdit.getForm().findField('CONSIGNEE').getValue().toUpperCase()); this.formEdit.getForm().findField('NOTIFYPARTY').setValue(this.formEdit.getForm().findField('NOTIFYPARTY').getValue().toUpperCase()); this.formEdit.getForm().findField('AGENT').setValue(this.formEdit.getForm().findField('AGENT').getValue().toUpperCase()); this.formEdit.getForm().findField('MARKS').setValue(this.formEdit.getForm().findField('MARKS').getValue().toUpperCase()); this.formEdit.getForm().findField('DESCRIPTION').setValue(this.formEdit.getForm().findField('DESCRIPTION').getValue().toUpperCase()); this.formEdit.getForm().findField('CNTRSEALNO').setValue(this.formEdit.getForm().findField('CNTRSEALNO').getValue().toUpperCase()); }, onImportBillClick: function (button, event) { var BSNO =this.BsNo; me = this; var imgform = new Ext.FormPanel({ region: 'center', labelWidth: 20, frame: true, autoScroll: false, border: false, fileUpload: true, items: [{ xtype: 'fileuploadfield', id: 'LoadExcel', name: 'LoadExcel', emptyText: Zi.LAN.LoadExcel, //'请选择EXCEL文件', fieldLabel: Zi.LAN.EXCEL, //'EXCEL', buttonText: Zi.LAN.LoadExcel2, //'选择文件', allowBlank: false, width: 200, buttonCfg: { iconCls: 'uploaddialog' }, anchor: '98%' }], buttons: [{ text: Zi.LAN.submit, //'上传', type: 'submit', handler: function () { var UserFilePath = Ext.getCmp('LoadExcel').getValue(); if (!CheckFileExt(UserFilePath, /.xls|.xlsx/i)) { Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: Zi.LAN.QingQueRenNiShangChuanDeWenJianWeiEXCELWenJian, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'请确认你上传的文件为EXCEL文件!' return; } if (!imgform.form.isValid()) { return; } imgform.form.submit({ url: '/MvcShipping/MsOpSeae/ImportBillData', waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, method: 'POST', params: { bsno: BSNO }, success: function (form, action) { win.close(this); _this.InitData(); }, failure: function (form, action) { form.reset(); if (action.failureType == Ext.form.Action.SERVER_INVALID) Ext.MessageBox.alert(Zi.LAN.JingGao, action.result.Message); } }); } }, { text: Zi.LAN.GuanBi, //'关闭', type: 'submit', handler: function () { win.close(this); } }] }); var win = new Ext.Window({ title: Zi.LAN.ShangChuanEXCEL, //"上传EXCEL", width: 380, height: 120, modal: true, resizable: false, border: false, items: imgform }); win.show(); return; }, onFDTZClick: function (his, record, item, index, e) { Ext.getCmp("FDINFO").update(""); var selections = this.gridListLS.getSelectionModel().getSelection(); if (selections.length == 0) { Ext.Msg.show({ title: '提示', msg: '请选择业务', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var rec = selections[0]; var BSNO = rec.data.BSNO; _this = this; Ext.Ajax.request({ waitMsg: '正在操作数据', url: '/MvcShipping/MsOp_BLISSUE/GetBLINFO', async: false, params: { BSNO: "'" + BSNO + "'" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success) { var _html = ""; _this.结费类型 = result.data[0].结费类型.replace("", " ").replace("", " "); _this.欠费超期 = result.data[0].欠费超期; _this.累计欠费 = result.data[0].累计欠费; _this.信用额度 = result.data[0].信用额度; _html = _html + "

    " + result.data[0].结费类型 + "

"; _html = _html + "

    " + result.data[0].欠费超期 + "

"; _html = _html + "

    " + result.data[0].累计欠费 + "

"; _html = _html + "

    " + result.data[0].信用额度 + "

"; _html = _html + "

"; if (result.data[0].IS欠费超期 == "yes") { _html = _html + "    欠费超期"; } if (result.data[0].IS累计欠费 == "yes") { _html = _html + "    总欠费超额度"; } _html = _html + "


"; Ext.getCmp("FDINFO").update(_html); } else { //return; } } else { return; } }, scope: this }); this.SelectedRecord = rec; Ext.getCmp("winFDTZShow").show(); }, DoFDTZ: function (REASON) { Ext.define('MsOp_BLISSUEmb', { extend: 'Ext.data.Model', idProperty: 'GID', fields: [ { name: 'GID', type: 'string' }, { name: 'BSNO', type: 'string' }, { name: 'BLNO', type: 'string' }, { name: 'HBLNO', type: 'string' }, { name: 'ZDFD', type: 'string' }, { name: 'BLNAME', type: 'string' }, { name: 'BLSTATUS', type: 'string' }, { name: 'BLORDERNO', type: 'string' }, { name: 'ISSUETYPE', type: 'string' }, { name: 'OPNAME', type: 'string' }, { name: 'OPTIME', type: 'string' }, { name: 'BSINKNO', type: 'string' }, { name: 'REMARK', type: 'string' }, { name: 'DELFLAG', type: 'string' }, { name: 'EXPRESSCORP', type: 'string' }, { name: 'EXPRESSNO', type: 'string' }, { name: 'ISADD', type: 'string' }, { name: 'PUTSINGLETIME', type: 'string' }, { name: 'PUTSINGLE', type: 'string' }, { name: 'PAYTIME', type: 'string' }, { name: 'PAYRMB', type: 'string' }, { name: 'PAYUSD', type: 'string' }, { name: 'BLTYPE', type: 'string' }, { name: 'CUSTNO', type: 'string' }, { name: 'CUSTOMERNAME', type: 'string' }, { name: 'SALE', type: 'string' }, { name: 'ACCTYPE', type: 'string' }, { name: 'ETD', type: 'string' }, { name: 'STLDATE', type: 'string' }, { name: 'CARRIER', type: 'string' }, { name: 'VESSEL', type: 'string' }, { name: 'VOYNO', type: 'string' }, { name: 'OP', type: 'string' }, { name: 'BLISSUESTATUS', type: 'string' }, { name: 'TSFD', type: 'string' }, { name: 'XYTS', type: 'string' }, { name: 'CQTS', type: 'string' }, { name: 'SJTS', type: 'string' }, { name: 'RMBNODR', type: 'string' }, { name: 'USDNODR', type: 'string' }, { name: 'TTLNODR', type: 'string' }, { name: 'TTLDR', type: 'string' }, { name: 'OPLBNAME', type: 'string' }, { name: 'SPREMARK', type: 'string' } ] }); var _op_blissue = Ext.create('MsOp_BLISSUEmb', { 'GID': '', 'BSNO': this.SelectedRecord.data.AS_ID, 'BLNO': this.SelectedRecord.data.MBLNO, 'BLNAME': '提单', 'BLSTATUS': '', 'BLORDERNO': '', 'ISSUETYPE': this.SelectedRecord.data.ISSUETYPE, 'OPNAME': '', 'OPTIME': '', 'BSINKNO': '', 'REMARK': '', 'DELFLAG': '0', 'EXPRESSCORP': '', 'EXPRESSNO': '', 'ISADD': '0', 'PUTSINGLETIME': '', 'PUTSINGLE': '', 'PAYTIME': '', 'PAYRMB': '0', 'PAYUSD': '0' }); var bodyList = []; bodyList.push(_op_blissue); var jsonBody = ConvertRecordsToJsonAll(bodyList); if (jsonBody == '') { return; } Ext.Ajax.request({ waitMsg: '正在操作数据', url: '/MvcShipping/MsOp_BLISSUE/FDTZ', params: { USERID: USERID, data: jsonBody, REASON: REASON }, callback: function (options, success, response) { if (success) { this.winFDTZShow.close(); Ext.getCmp("REASON").setValue(""); this.storeList.reload(); //this.onRefreshClick(); } }, failure: function (response, options) { Ext.Msg.show({ title: '警告', msg: '服务器响应出错!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, success: function (response, options) { }, scope: this }); //end Ext.Ajax.request }, getFDINFO: function (result) { var _html = ""; _this = this; _this.结费类型 = result.data[0].result.data[0].结费类型.replace("", " ").replace("", " "); _this.欠费超期 = result.data[0].欠费超期; _this.累计欠费 = result.data[0].累计欠费; _this.信用额度 = result.data[0].信用额度; _html = _html + "

    " + result.data[0].结费类型 + "

"; _html = _html + "

    " + result.data[0].欠费超期 + "

"; _html = _html + "

    " + result.data[0].累计欠费 + "

"; _html = _html + "

    " + result.data[0].信用额度 + "

"; _html = _html + "

"; if (result.data[0].IS欠费超期 == "yes") { _html = _html + "    欠费超期"; } if (result.data[0].IS累计欠费 == "yes") { _html = _html + "    总欠费超额度"; } _html = _html + "

"; return _html; }, //#region 编辑时按钮等的状态 GetEditStatus: function () { var canedit = false; var bsStatus = this.MainEditRecord.get("BSSTATUS"); var inputby = this.MainEditRecord.get("INPUTBY"); var op = this.MainEditRecord.get("OP"); var doc = this.MainEditRecord.get("DOC"); _this = this; if (bsStatus == '1') { _this.setSaveBtnStatus(false); //Ext.Ajax.request({ // waitMsg: '', // url: '/MvcShipping/MsSysParamSet/GetData', // params: { // condition: "PARAMNAME='BSSTATUSBILLCANEDIT'" // }, // callback: function (options, success, response) { // if (success) { // var result = Ext.JSON.decode(response.responseText); // if (result.Success != true) { // } else { // var data = result.data; // if (data.PARAMVALUE == '1') { // canedit = false; // _this.setSaveBtnStatus(canedit); // } else { // } // } // } else { // } // }, // scope: this //}); } else { this.StoreOpRange.load({ params: { optype: "modOrderManagement" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { var records = DsStoreQueryBy(_this.StoreOpRange, 'OPID', op); if (records.getCount() > 0) { canedit = true; } else { var recordins = DsStoreQueryBy(_this.StoreOpRange, 'OPID', inputby); if (recordins.getCount() > 0) { canedit = true; } else { var recorddoc = DsStoreQueryBy(_this.StoreOpRange, 'OPID', doc); if (recorddoc.getCount() > 0) { canedit = true; } else { canedit = false; } } } } else { canedit = false; } _this.setSaveBtnStatus(canedit); } } }); } //Ext.Ajax.request({ // waitMsg: '正在查询委托编号状态...', // url: '/MvcShipping/MsBaseInfo/GetRuleEdit', // params: { // rulename: '委托编号', // ruletype: '1' // }, // callback: function (options, success, response) { // if (success) { // var custno = _this.formHead.getForm().findField('CUSTNO'); // custno.setReadOnly(true); // } else { // Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); // } // }, // scope: this //}); //Ext.Ajax.request({ // waitMsg: '正在查询委托编号状态...', // url: '/MvcShipping/MsBaseInfo/GetRuleEdit', // params: { // rulename: '分提单号', // ruletype: '1' // }, // callback: function (options, success, response) { // if (success) { // var hblno = _this.formHead.getForm().findField('HBLNO'); // hblno.setReadOnly(true); // } else { // Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); // } // }, // scope: this //}); }, GetStringNum: function (str) { var num = 0; if (str == null || str == '') return num; if (str.length == 0) return num; var if_find = false; var str_num = ''; for (var i = 0; i < str.length; i += 1) { var member = str.substr(i, 1); if ((member == '0') || (member == '1') || (member == '2') || (member == '3') || (member == '4') || (member == '5') || (member == '6') || (member == '7') || (member == '8') || (member == '9') || (member == '.') || (member == '-')) { if (!if_find) { str_num = str_num + member; } } else { if_find = true; } } return str_num; }, setSaveBtnStatus: function (enable) { var btnBESave = Ext.getCmp('btnBESave'); var btnBESaveAndNew = Ext.getCmp('btnBESaveAndNew'); var btnBECopyNew = Ext.getCmp('btnBECopyNew'); var btnBELoadNew = Ext.getCmp('btnBELoadNew'); var btnBELoadMaster = Ext.getCmp('btnBELoadMaster'); var btnBEHistryCopy = Ext.getCmp('btnBEHistryCopy'); var btnBDelete = Ext.getCmp('btnBDelete'); var btnBadddetail = Ext.getCmp('btnBadddetail'); var btnBdeldetail = Ext.getCmp('btnBdeldetail'); if (enable) { btnBESave.enable(); btnBESaveAndNew.enable(); btnBECopyNew.enable(); btnBELoadNew.enable(); btnBELoadMaster.enable(); btnBEHistryCopy.enable(); btnBDelete.enable(); btnBadddetail.enable(); btnBdeldetail.enable(); } else { btnBESave.disable(); btnBESaveAndNew.disable(); btnBECopyNew.disable(); btnBELoadNew.disable(); btnBELoadMaster.disable(); btnBEHistryCopy.disable(); btnBDelete.disable(); btnBadddetail.disable(); btnBdeldetail.disable(); } }, //#endregion //#region 打印 Print: function () { var basicForm = this.formEdit.getForm(); var billNo = basicForm.findField('AS_ID').value; var bsNo = basicForm.findField('BSNO').value; var MBLNO = basicForm.findField('MBLNO').value; if (MBLNO == '') { MBLNO = this.MainEditRecord.data.CUSTNO; } if (billNo == '*' || billNo == '' || billNo == NaN) { Ext.Msg.show({ title: '错误', msg: '提单还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var op = this.MainEditRecord.data.OP; var mailproject = this.MainEditRecord.get('MAILPROJECT'); if (mailproject != '' && mailproject != undefined && mailproject != null) { Ext.Msg.wait('正在整理数据...'); Ext.Ajax.request({ waitMsg: '正在生成...', //'正在生成...', url: '/MvcShipping/MsOpSeae/CreateSendMail', params: { bsno: bsNo, mailproject: mailproject, bltype: '提单及下货纸' }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success) { var printType = 'MSOPBILL'; var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae_billmanage WHERE AS_ID = '" + billNo + "'"; var sql2 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae WHERE BSNO = '" + bsNo + "'"; var sql3 = "SELECT [user].USERNAME,[user].CODENAME,[user].PASSWORD,[user].SHOWNAME,[user].ENROLLTIME,[user].CREATEUSER,[user].MODIFIEDUSER, [user].MODIFIEDTIME, [user].ISDELETED, [user].ISDISABLE, user_baseinfo.GID,user_baseinfo.USERID,user_baseinfo.COMPANYNAME, user_baseinfo.DEPTNAME, user_baseinfo.OFFICEPHONE, user_baseinfo.HOMEPHONE, user_baseinfo.MOBILE, user_baseinfo.FAX, user_baseinfo.EMAIL1, user_baseinfo.EMAIL2, user_baseinfo.HOMEADDRESS, user_baseinfo.REMARK, user_baseinfo.EMERGUSER, user_baseinfo.EMERGPHONE,user_baseinfo.EMERGEMAIL, user_baseinfo.POSTCODE, user_baseinfo.QQ, user_baseinfo.MSN, user_baseinfo.FINANCESOFTCODE FROM [user] INNER JOIN user_baseinfo ON [user].GID = user_baseinfo.USERID where [user].SHOWNAME='" + op + "' "; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO, '', '', result.Data, bsNo); } else { var printType = 'MSOPBILL'; var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae_billmanage WHERE AS_ID = '" + billNo + "'"; var sql2 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae WHERE BSNO = '" + bsNo + "'"; var sql3 = "SELECT [user].USERNAME,[user].CODENAME,[user].PASSWORD,[user].SHOWNAME,[user].ENROLLTIME,[user].CREATEUSER,[user].MODIFIEDUSER, [user].MODIFIEDTIME, [user].ISDELETED, [user].ISDISABLE, user_baseinfo.GID,user_baseinfo.USERID,user_baseinfo.COMPANYNAME, user_baseinfo.DEPTNAME, user_baseinfo.OFFICEPHONE, user_baseinfo.HOMEPHONE, user_baseinfo.MOBILE, user_baseinfo.FAX, user_baseinfo.EMAIL1, user_baseinfo.EMAIL2, user_baseinfo.HOMEADDRESS, user_baseinfo.REMARK, user_baseinfo.EMERGUSER, user_baseinfo.EMERGPHONE,user_baseinfo.EMERGEMAIL, user_baseinfo.POSTCODE, user_baseinfo.QQ, user_baseinfo.MSN, user_baseinfo.FINANCESOFTCODE FROM [user] INNER JOIN user_baseinfo ON [user].GID = user_baseinfo.USERID where [user].SHOWNAME='" + op + "' "; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO, '', '', '', bsNo); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } else { var printType = 'MSOPBILL'; var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae_billmanage WHERE AS_ID = '" + billNo + "'"; var sql2 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae WHERE BSNO = '" + bsNo + "'"; var sql3 = "SELECT [user].USERNAME,[user].CODENAME,[user].PASSWORD,[user].SHOWNAME,[user].ENROLLTIME,[user].CREATEUSER,[user].MODIFIEDUSER, [user].MODIFIEDTIME, [user].ISDELETED, [user].ISDISABLE, user_baseinfo.GID,user_baseinfo.USERID,user_baseinfo.COMPANYNAME, user_baseinfo.DEPTNAME, user_baseinfo.OFFICEPHONE, user_baseinfo.HOMEPHONE, user_baseinfo.MOBILE, user_baseinfo.FAX, user_baseinfo.EMAIL1, user_baseinfo.EMAIL2, user_baseinfo.HOMEADDRESS, user_baseinfo.REMARK, user_baseinfo.EMERGUSER, user_baseinfo.EMERGPHONE,user_baseinfo.EMERGEMAIL, user_baseinfo.POSTCODE, user_baseinfo.QQ, user_baseinfo.MSN, user_baseinfo.FINANCESOFTCODE FROM [user] INNER JOIN user_baseinfo ON [user].GID = user_baseinfo.USERID where [user].SHOWNAME='" + op + "' "; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO, '', '', '', bsNo); } }, // #endregion ShengChengBaoDan: function () { var condition = condition = "AS_ID='" + this.editRecord.get('AS_ID') + "'"; Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...', url: '/MvcShipping/MsOpSeaeBaoXian/ApplyFenDan', params: { condition: condition }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); var msg = result.Message; if (result.Success == 'true') { data = result.Data; window.open(data); } else { Ext.MessageBox.alert('请求出现错误,请重试', result.Message); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } });