Ext.namespace('Shipping'); Shipping.MsOpSeaeEdiEdit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsOpSeaeEdiEdit.superclass.constructor.call(this); }; var _TempType = ''; Ext.extend(Shipping.MsOpSeaeEdiEdit, Ext.Panel, { ParentWin: null, OpStatus: 'add', StoreList: null, EditRecord: null, Editdata: null, isAudit: null, accdate: null, seaeop: "", seaecustservice: "", reason: "", BillType: null, OrType: null, initUIComponents: function () { this.serialNo = 0; //this.bodyDel = []; this.itemindex = 1; this.StoreCargoid = Ext.create('Ext.data.Store', { fields: ['ID', 'NAME'] }); this.StoreCargoid.add({ "ID": "S", "NAME": "S普通货" }); this.StoreCargoid.add({ "ID": "R", "NAME": "R冻柜" }); this.StoreCargoid.add({ "ID": "D", "NAME": "D危险品" }); this.StoreCargoid.add({ "ID": "O", "NAME": "O超限箱" }); this.comboxCargoid = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreCargoid, fieldLabel: '货物标示', forceSelection: true, name: 'CARGOID', valueField: 'ID', displayField: 'NAME', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { if (combo.value == 'R') { this.panelBodyDr.setVisible(false); this.panelBodyRf.setVisible(true); } else if (combo.value == 'D') { this.panelBodyDr.setVisible(true); this.panelBodyRf.setVisible(false); } else { this.panelBodyDr.setVisible(false); this.panelBodyRf.setVisible(false); } } } } }); //键值维护表_装运方式 //件数包装 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', { store: this.storeCodePackage, forceSelection: true, name: 'KINDPKGS', valueField: 'PKGS', displayField: 'PKGS' }); //件数包装_集装箱列表中的下拉框加载 this.comboxKINDPKGS_CTN = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '件数包装', store: this.storeCodePackage, forceSelection: true, name: 'KINDPKGS', valueField: 'PKGS', displayField: 'PKGS' }); //箱型_集装箱列表中的下拉框加载 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.StoreEdiType = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StoreEdiType.add({ "TYPE": "AFR" }); this.StoreEdiType.add({ "TYPE": "AMR" }); this.StoreEdiType.add({ "TYPE": "AMS" }); this.StoreEdiType.add({ "TYPE": "ACI" }); this.StoreEdiType.add({ "TYPE": "EMANIFEST" }); this.StoreEdiType.add({ "TYPE": "ISF" }); this.StoreEdiType.add({ "TYPE": "AMS,ISF" }); this.StoreEdiType.add({ "TYPE": "AMS,ISF,ACI" }); this.StoreEdiType.add({ "TYPE": "AMS,ACI" }); this.comboxEdiType = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreEdiType, fieldLabel: 'EDI类型', forceSelection: true, name: 'EDITYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.StoreStatus = Ext.create('Ext.data.Store', { fields: ['STATUS'] }); this.StoreStatus.add({ "STATUS": "未发送" }); this.StoreStatus.add({ "STATUS": "已保存文件" }); this.StoreStatus.add({ "STATUS": "已发送" }); this.comboxStatus = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreStatus, fieldLabel: 'EDI状态', forceSelection: true, name: 'EDISTATUS', valueField: 'STATUS', displayField: 'STATUS' }); this.StoreFileType = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StoreFileType.add({ "TYPE": "Master" }); this.StoreFileType.add({ "TYPE": "House" }); this.StoreFileType.add({ "TYPE": "Regular" }); this.StoreFileType.add({ "TYPE": "Empty" }); this.StoreFileType.add({ "TYPE": "FCR" }); this.comboxFileType = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreFileType, fieldLabel: '文件类型', forceSelection: true, name: 'FILETYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.StorePKType = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StorePKType.add({ "TYPE": "FCL" }); this.StorePKType.add({ "TYPE": "LCL" }); this.StorePKType.add({ "TYPE": "MASTER" }); this.comboxPKType = Ext.create('DsExt.ux.RefTableCombox', { store: this.StorePKType, fieldLabel: '装运方式', forceSelection: true, name: 'PACKINGTYPE', valueField: 'TYPE', displayField: 'TYPE' }); //#endregion //#region 编辑formHead 基本信息 this.formHead = Ext.widget('form', { region: 'north', frame: true, bodyPadding: 5, //collapsed: false, //collapsible: true, trackResetOnLoad: true, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 70, msgTarget: 'qtip' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '业务编号', name: 'MFNO', hidden: true }, { fieldLabel: '业务编号', name: 'BSNO', hidden: true }, { fieldLabel: 'MASTERNO', name: 'MASTERNO', hidden: true }, { fieldLabel: 'CARGOID', name: 'CARGOID', hidden: true }, { fieldLabel: 'PLACERECEIPTID', name: 'PLACERECEIPTID', hidden: true }, { fieldLabel: 'PLACERECEIPT', name: 'PLACERECEIPT', hidden: true }, { fieldLabel: '委托编号', name: 'CUSTNO' }, this.comboxStatus, this.comboxEdiType, this.comboxFileType, { xtype: 'checkboxfield', boxLabel: '是否同一主票下最后一票分票', name: 'ISLASTHBL', inputValue: true, checked: true }, { fieldLabel: '录入日期', readOnly: true, name: 'INPUTDATE' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '主提单号', name: 'MBLNO' }, { fieldLabel: 'HOUSE BL', name: 'HBLNO' }, { fieldLabel: '订舱号码', readOnly: true, name: 'ORDERNO' }, this.comboxPKType, { xtype: 'fieldcontainer', fieldLabel: '传输目的', defaultType: 'radiofield', defaults: { flex: 1 }, layout: 'hbox', items: [ { boxLabel: 'A', name: 'FILEROLE', inputValue: 'A', id: 'radio1' }, { boxLabel: 'R', name: 'FILEROLE', inputValue: 'R', id: 'radio2' }, { boxLabel: 'D', name: 'FILEROLE', inputValue: 'D', id: 'radio3' }, { boxLabel: 'C', name: 'FILEROLE', inputValue: 'C', id: 'radio4' } ] }, { fieldLabel: '录入人', readOnly: true, name: 'INPUTBY' }] } ]//end items(fieldset 1) }); //end this.formEdit //#endregion //#region 集装箱-数据集 this.StoreCTNOWNER = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StoreCTNOWNER.add({ "TYPE": "Shipper" }); this.StoreCTNOWNER.add({ "TYPE": "Carrier" }); this.StoreCTNOWNER.add({ "TYPE": "Consolidator" }); this.StoreCTNOWNER.add({ "TYPE": "Deconsolidator" }); this.StoreCTNOWNER.add({ "TYPE": "ThirdParty" }); this.comboxCTNOWNER = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreCTNOWNER, forceSelection: true, name: 'CTNOWNER', valueField: 'TYPE', displayField: 'TYPE' }); this.storeBodyList = Ext.create('Ext.data.Store', { model: 'MsSeaeEdiCtn', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsOpSeaeEdi/GetBodyList', reader: { id: 'MFNO,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: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, plugins: [this.gridListCellEditing], selType: 'cellmodel', tbar: [{ text: '增加明细', tooltip: '增加明细', id: "btnaddctndetail", iconCls: "btnadddetail", handler: function (button, event) { this.onAddDetailClick(button, event); }, scope: this }, '-', { text: '删除明细', tooltip: '删除明细', id: "btndelctndetail", iconCls: "btndeletedetail", handler: function (button, event) { this.onDelDetailClick(button, event); }, scope: this }], columns: [{ sortable: true, dataIndex: 'CTN_ID', header: '编号', hidden: true, width: 0 }, { sortable: true, dataIndex: 'MFNO', header: '业务编号', hidden: true, width: 0 }, { sortable: true, dataIndex: 'CTNCODE', header: '序号', width: 30 }, { dataIndex: 'CTNALL', header: '箱型', width: 70, editor: this.comboxCTNALL }, { dataIndex: 'CTNOWNER', header: '箱所有者', width: 100, editor: this.comboxCTNOWNER }, { dataIndex: 'CNTRNO', header: '箱号', width: 120, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'SEALNO', header: '封号', width: 100, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'MARKS', header: '唛头', width: 150, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'DESCRIPTION', header: '货物描述', width: 150, editor: { xtype: 'textfield', selectOnFocus: true } }] }); this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) { this.formDescriptionEdit.getForm().findField('DESCRIPTION').setValue(record.data.DESCRIPTION); _this.formDescriptionEdit.getForm().findField('CTN_ID').setDisabled(false); this.formDescriptionEdit.getForm().findField('CTN_ID').setValue(record.data.CTN_ID); _this.formDescriptionEdit.getForm().findField('CTN_ID').setDisabled(true); }, this); _this = this; this.formDescriptionEdit = Ext.widget('form', { title: '货物描述', region: 'east', width:220, frame: true, border: false, trackResetOnLoad: true, items: [{ fieldLabel: 'GID', name: 'GID', hidden: true },{ fieldLabel: 'CTN_ID', xtype: 'textfield', name: 'CTN_ID', hidden: true }, { xtype: 'textareafield', grow: true, //字段是否自动伸展和收缩,默认为false labelSeparator: '', //标签分隔字符 name: 'DESCRIPTION', height: 170, anchor: '100%', enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'blur': function blur(combo, eOpts, obj) { _this.formDescriptionEdit.getForm().findField('CTN_ID').setDisabled(false); var CTN_ID = _this.formDescriptionEdit.getForm().findField('CTN_ID').getValue(); _this.formDescriptionEdit.getForm().findField('CTN_ID').setDisabled(true); //var selections = this.gridList.getSelectionModel().getSelection(); //if (selections.length > 0) { // selections[0].set('DESCRIPTION', combo.value); //} for (i = 0; i < _this.storeBodyList.getCount(); i += 1) { var memberyf = _this.storeBodyList.getAt(i); if (memberyf.data.CTN_ID == CTN_ID) { memberyf.data.DESCRIPTION = combo.value; } }; _this.formDescriptionEdit.getForm().findField('DESCRIPTION') .setValue(combo.value.toUpperCase()); } // } }] }); //#endregion this.panelBodyCtn = new Ext.Panel({ title: '集装箱信息', layout: "border", // anchor:'50% 100%', region: 'center', frame: true, items: [this.gridList, this.formDescriptionEdit] }); //件数包装 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', { store: this.storeCodePackage, padding: '0 0 0 10', forceSelection: true, name: 'KINDPKGS', valueField: 'PKGS', displayField: 'PKGS' }); this.comboxCTNID = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '箱型', store: this.storeBodyList, forceSelection: true, name: 'CTN_ID', valueField: 'CTN_ID', displayField: 'CNTRNO' }); this.storeCargoList = Ext.create('Ext.data.Store', { model: 'MsSeaeEdiCtnDetail', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/MsOpSeaeEdi/GetCargoList', reader: { id: 'GID', root: 'data', totalProperty: 'totalCount' } } }); //明细表表格 this.gridListCargoCellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.gridListCargo = new Ext.grid.GridPanel({ store: this.storeCargoList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, plugins: [this.gridListCargoCellEditing], selType: 'cellmodel', tbar: [{ text: '增加明细', tooltip: '增加明细', id: "btnadddetail", iconCls: "btnadddetail", handler: function (button, event) { this.addDetailCargo(); }, scope: this }, '-', { text: '删除明细', tooltip: '删除明细', id: "btndeldetail", iconCls: "btndeletedetail", handler: function (button, event) { this.deleteDetailCargo(); }, scope: this }], columns: [{ sortable: true, dataIndex: 'GID', header: '编号', hidden: true, width: 0 }, { sortable: true, dataIndex: 'MFNO', header: '业务编号', hidden: true, width: 0 }, { dataIndex: 'CTN_ID', header: '箱号', width: 120, renderer: function (value, p, record) { return record.data.CNTRNO; }, editor: this.comboxCTNID }, { sortable: true, dataIndex: 'PKGS', header: '件数', width: 60, editor: { xtype: 'numberfield', allowBlank: false, selectOnFocus: true } }, { dataIndex: 'KINDPKGS', header: '包装', width: 120, editor: this.comboxKINDPKGS }, { dataIndex: 'KGS', header: '重量', width: 60, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'CBM', header: '尺码', width: 60, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'HTS', header: "HTS", width: 60, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'DUNNO', header: '公害行UN号', width: 60, editor: { xtype: 'textfield', selectOnFocus: true } }, { dataIndex: 'GOODVALUE', header: '货值', width: 60, editor: { xtype: 'textfield', selectOnFocus: true } }] }); //#endregion this.gridListCargo.on('edit', function (editor, e, eOpts) { this.gridListCargoAfterEdit(editor, e, eOpts); }, this); this.panelBodyCtnDetail = new Ext.Panel({ title: '集装箱货物', layout: "border", region: 'east', flex: 1, frame: true, width: 320, items: [this.gridListCargo] }); // this.panelCtn = new Ext.Panel({ // region: 'center', // layout: "hbox", // items: [this.panelBodyCtnDetail] // }); this.panelCtn = new Ext.Panel({ layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.panelBodyCtn, this.panelBodyCtnDetail] }); this.panelBodyDr = new Ext.Panel({ title: '危险品信息', layout: "border", hidden: true, height: 60, frame: true, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '危险品等级', flex: 1, labelWidth: 70, name: 'DCLASS' }, { fieldLabel: '危险品编号', flex: 1, labelWidth: 70, name: 'DUNNO' }, { fieldLabel: '危险品页号', flex: 1, labelWidth: 70, name: 'DPAGE' }, { fieldLabel: '危险品标签', flex: 1, labelWidth: 70, name: 'DLABEL' }, { fieldLabel: '危险品联系人', flex: 1, labelWidth: 90, name: 'LINKMAN' }] }] }); this.StoreTemp = Ext.create('Ext.data.Store', { fields: ['ID', 'NAME'] }); this.StoreTemp.add({ "ID": "C", "NAME": "C摄氏" }); this.StoreTemp.add({ "ID": "F", "NAME": "F华氏" }); this.comboxTemp = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreTemp, fieldLabel: '温度单位', forceSelection: true, name: 'TEMPID', valueField: 'ID', displayField: 'NAME' }); this.panelBodyRf = new Ext.Panel({ title: '冻柜信息', layout: "border", hidden: true, height: 60, //margin: '5 10', frame: true, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '冷藏通风量', name: 'REEFERF' }, { fieldLabel: '设置温度', name: 'TEMPSET' }, this.comboxTemp] }] }); this.StoreTransType = Ext.create('Ext.data.Store', { fields: ["ID", 'TYPE'] }); this.StoreTransType.add({ "ID": "PortToPort", "TYPE": "Port to Port" }); this.StoreTransType.add({ "ID": "InlandTransit", "TYPE": "Inland Transit" }); this.StoreTransType.add({ "ID": "InlandNonBonded", "TYPE": "Inland Non Bonded" }); this.StoreTransType.add({ "ID": "TransitExport", "TYPE": "Transit Expor" }); this.StoreTransType.add({ "ID": "ImmediateReexport", "TYPE": "Immediate Re-Export" }); this.StoreTransType.add({ "ID": "StayOnBoard", "TYPE": "Stay OnBoard" }); this.StoreTransType.add({ "ID": "Expor", "TYPE": "Expor" }); this.comboxTransType = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreTransType, fieldLabel: '运输方式', flex: 0.5, forceSelection: true, name: 'TRANSTYPE', valueField: 'ID', displayField: 'TYPE' }); this.storeNameFa = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameFa = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel:'名称', store: this.storeNameFa, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'SHIPPERNAME', 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.formEdit.getForm().findField('SHIPPERNAME').setValue(records[0].data.NAME); _this.formEdit.getForm().findField('SHIPPERADDR1').setValue(records[0].data.ADDRESS); _this.formEdit.getForm().findField('SHIPPERADDR2').setValue(records[0].data.ADDRESS2); _this.formEdit.getForm().findField('SHIPPERADDR3').setValue(records[0].data.ADDRESS3); _this.formEdit.getForm().findField('SHIPPERCITY').setValue(records[0].data.CITY); _this.formEdit.getForm().findField('SHIPPERPOSTCODE').setValue(records[0].data.POSTCODE); _this.formEdit.getForm().findField('SHIPPERPROVINCE').setValue(records[0].data.PROVINCE); _this.formEdit.getForm().findField('SHIPPERATTN').setValue(records[0].data.ATTN); _this.formEdit.getForm().findField('SHIPPERTEL').setValue(records[0].data.TEL); _this.formEdit.getForm().findField('SHIPPERCOUNTRY').setValue(records[0].data.COUNTRY); } } } }); this.panelShipper = new Ext.Panel({ title: '发货人信息', layout: "anchor", height: 219, 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: "保存为模板", handler: function () { _TempType = 'F'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'SHIPPERADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 1, name: 'SHIPPERADDR2' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '地址3', flex: 1, name: 'SHIPPERADDR3' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 1, name: 'SHIPPERCITY' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '州/省', flex: 0.4, name: 'SHIPPERPROVINCE' }, { fieldLabel: '国家', flex: 0.30, labelWidth: 50, name: 'SHIPPERCOUNTRY' }, { fieldLabel: '邮编', labelWidth: 50, flex: 0.4, name: 'SHIPPERPOSTCODE' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '联系人', flex: 0.5, name: 'SHIPPERATTN' }, { fieldLabel: '电话', labelWidth: 50, flex: 0.5, name: 'SHIPPERTEL' }] } ] }); //#region 名称(收货人) this.storeNameShou = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameShou.load({ params: { condition: "TYPE = 'S'" } }); this.comboxNameShou = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameShou, queryParam: 'DisplayName', 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.formEdit.getForm().findField('CONSIGNEENAME').setValue(records[0].data.NAME); _this.formEdit.getForm().findField('CONSIGNEEADDR1').setValue(records[0].data.ADDRESS); _this.formEdit.getForm().findField('CONSIGNEEADDR2').setValue(records[0].data.ADDRESS2); _this.formEdit.getForm().findField('CONSIGNEEADDR3').setValue(records[0].data.ADDRESS3); _this.formEdit.getForm().findField('CONSIGNEECITY').setValue(records[0].data.CITY); _this.formEdit.getForm().findField('CONSIGNEEPOSTCODE').setValue(records[0].data.POSTCODE); _this.formEdit.getForm().findField('CONSIGNEEPROVINCE').setValue(records[0].data.PROVINCE); _this.formEdit.getForm().findField('CONSIGNEEATTN').setValue(records[0].data.ATTN); _this.formEdit.getForm().findField('CONSIGNEETEL').setValue(records[0].data.TEL); _this.formEdit.getForm().findField('CONSIGNEECOUNTRY').setValue(records[0].data.COUNTRY); } } } }); this.panelConsignee = new Ext.Panel({ title: '收货人信息', layout: "anchor", height: 219, 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: "保存为模板", handler: function () { _TempType = 'S'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '地址1', flex: 1, name: 'CONSIGNEEADDR1' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '地址2', flex: 1, name: 'CONSIGNEEADDR2' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '地址3', flex: 1, name: 'CONSIGNEEADDR3' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 1, name: 'CONSIGNEECITY' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '州/省', flex: 0.4, name: 'CONSIGNEEPROVINCE' }, { fieldLabel: '国家', labelWidth: 50, flex: 0.3, name: 'CONSIGNEECOUNTRY' }, { fieldLabel: '邮编', labelWidth: 50, flex: 0.4, name: 'CONSIGNEEPOSTCODE' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '联系人', flex: 0.5, name: 'CONSIGNEEATTN' }, { fieldLabel: '电话', labelWidth: 50, flex: 0.5, name: 'CONSIGNEETEL' }] } ] }); //#region 名称(通知人) this.storeNameTong = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameTong.load({ params: { condition: "TYPE = 'T'" } }); this.comboxNameTong = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel:'名称', store: this.storeNameTong, queryParam: 'DisplayName', queryMode: 'remote', flex: 1, 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.formEdit.getForm().findField('NOTIFYPARTYNAME').setValue(records[0].data.NAME); _this.formEdit.getForm().findField('NOTIFYPARTYADDR1').setValue(records[0].data.ADDRESS); _this.formEdit.getForm().findField('NOTIFYPARTYADDR2').setValue(records[0].data.ADDRESS2); _this.formEdit.getForm().findField('NOTIFYPARTYADDR3').setValue(records[0].data.ADDRESS3); _this.formEdit.getForm().findField('NOTIFYPARTYCITY').setValue(records[0].data.CITY); _this.formEdit.getForm().findField('NOTIFYPARTYPOSTCODE').setValue(records[0].data.POSTCODE); _this.formEdit.getForm().findField('NOTIFYPARTYPROVINCE').setValue(records[0].data.PROVINCE); _this.formEdit.getForm().findField('NOTIFYPARTYATTN').setValue(records[0].data.ATTN); _this.formEdit.getForm().findField('NOTIFYPARTYTEL').setValue(records[0].data.TEL); _this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRY').setValue(records[0].data.COUNTRY); } } } }); this.panelNotifyParty = new Ext.Panel({ title: '通知人信息', layout: "anchor", height: 219, flex: 1, frame: true, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ xtype: 'checkboxfield', boxLabel: '同收货人', flex: 0.2, name: 'ISSAMECONSIGNEE', inputValue: true, boxLabelAlign: 'before', checked: false },this.comboxNameTong, { xtype: "button", // flex: 1, text: "保存为模板", handler: function () { _TempType = 'T'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '地址1', flex: 1, name: 'NOTIFYPARTYADDR1' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '地址2', flex: 1, name: 'NOTIFYPARTYADDR2' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '地址3', flex: 1, name: 'NOTIFYPARTYADDR3' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '城市', flex: 1, name: 'NOTIFYPARTYCITY' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '州/省', flex: 0.4, name: 'NOTIFYPARTYPROVINCE' }, { fieldLabel: '国家', flex: 0.3, labelWidth: 50, name: 'NOTIFYPARTYCOUNTRY' }, { fieldLabel: '邮编', flex: 0.4, labelWidth: 50, name: 'NOTIFYPARTYPOSTCODE' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '联系人', flex: 0.5, name: 'NOTIFYPARTYATTN' }, { fieldLabel: '电话', flex: 0.5, labelWidth: 50, name: 'NOTIFYPARTYTEL' }] } ] }); /* this.panelNotifyParty2 = new Ext.Panel({ title: '第二通知人信息', layout: "anchor", height: 239, flex: 1, frame: true, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ xtype: 'hiddenfield'}] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '名称', flex: 1, name: 'NOTIFYPARTY2NAME' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '地址1', flex: 1, name: 'NOTIFYPARTY2ADDR1' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '地址2', flex: 1, name: 'NOTIFYPARTY2ADDR2' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '地址3', flex: 1, name: 'NOTIFYPARTY2ADDR3' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '城市', flex: 1, name: 'NOTIFYPARTY2CITY' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '州/省', flex: 0.4, name: 'NOTIFYPARTY2PROVINCE' }, { fieldLabel: '国家', flex: 0.3, labelWidth: 50, name: 'NOTIFYPARTY2COUNTRY' }, { fieldLabel: '邮编', flex: 0.4, labelWidth: 50, name: 'NOTIFYPARTY2POSTCODE' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', defaults: { anchor: '96%' }, items: [{ fieldLabel: '联系人', flex: 0.5, name: 'NOTIFYPARTY2ATTN' }, { fieldLabel: '电话', flex: 0.5, labelWidth: 50, name: 'NOTIFYPARTY2TEL' }] } ] }); */ this.panelscn = new Ext.Panel({ layout: "hbox", height: 220, items: [this.panelShipper, this.panelConsignee, this.panelNotifyParty] }); this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', autoLoad: true, proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport.load(); this.storeCodeDisport2 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', autoLoad: true, proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport2.load(); this.storeCodeDisport3 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', autoLoad: true, proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport3.load(); this.storeCodeDisport4 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', autoLoad: true, proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport4.load(); this.storeCodeDisport5 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', autoLoad: true, proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); this.storeCodeDisport6 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeDisportModel', autoLoad: true, proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' } }); //this.storeCodeDisport5.load(); this.comboxDESTINATION = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '目的地', store: this.storeCodeDisport, name: 'DESTINATION', valueField: 'PORT', displayField: 'PORT', queryMode: 'remote', minChars: 2, queryParam: 'PORT', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('DESTINATIONID').setValue(records[0].data.EDICODE); } } } }); this.comboxPLACERECEIPT = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '收货地', store: this.storeCodeDisport2, name: 'PLACERECEIPT', valueField: 'PORT', displayField: 'PORT', queryMode: 'remote', minChars: 2, queryParam: 'PORT', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('PLACERECEIPTID').setValue(records[0].data.EDICODE); } } } }); this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '装货港', store: this.storeCodeDisport, name: 'PORTLOAD', valueField: 'PORT', displayField: 'PORT', queryMode: 'remote', minChars: 2, queryParam: 'PORT', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('PORTLOADID').setValue(records[0].data.EDICODE); } } } }); this.comboxPLACEDELIVERY = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '交货地', store: this.storeCodeDisport2, name: 'PLACEDELIVERY', valueField: 'PORT', displayField: 'PORT', queryMode: 'remote', minChars: 2, queryParam: 'PORT', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('PLACEDELIVERYID').setValue(records[0].data.EDICODE); } } } }); this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '卸货港', store: this.storeCodeDisport3, name: 'PORTDISCHARGE', valueField: 'PORT', displayField: 'PORT', queryMode: 'remote', minChars: 2, queryParam: 'PORT', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('PORTDISCHARGEID').setValue(records[0].data.EDICODE); } } } }); this.comboxLASTPORTOFCALL = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '最后境外港', //'卸货港', store: this.storeCodeDisport4, name: 'LASTPORTOFCALLID', queryMode: 'remote', minChars: 2, queryParam: 'PORT', forceSelection: true, valueField: 'EDICODE', // queryMode: 'local', displayField: 'CodeAndName' }); this.comboxFIRSTPORTOFCALL = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '第一个停靠港港口', //'卸货港', store: this.storeCodeDisport5, name: 'FIRSTPORTOFCALLID', queryMode: 'remote', minChars: 2, queryParam: 'PORT', forceSelection: true, valueField: 'EDICODE', // queryMode: 'local', displayField: 'CodeAndName' }); this.panelPort = new Ext.Panel({ // title: '港口信息', 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: [{ fieldLabel: 'CY状态', flex: 0.5, name: 'SERVICE' }, this.comboxTransType, this.comboxPLACERECEIPT, { fieldLabel: '', flex: 0.5, labelWidth: 0, name: 'PLACERECEIPTID' }, this.comboxPORTLOAD, { fieldLabel: '', flex: 0.5, labelWidth: 0, name: 'PORTLOADID' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxPORTDISCHARGE, { fieldLabel: '', flex: 0.5, labelWidth: 0, name: 'PORTDISCHARGEID' }, this.comboxDESTINATION, { fieldLabel: '', flex: 0.5, labelWidth: 0, name: 'DESTINATIONID' }, this.comboxPLACEDELIVERY, { fieldLabel: '', flex: 0.5, labelWidth: 0, name: 'PLACEDELIVERYID' }, { fieldLabel: '签单地点', flex: 1, name: 'ISSUEPLACE' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '付费方式', flex: 1, name: 'BLFRT' },{ fieldLabel: '最后境外港代码', flex: 1, labelWidth: 130, name: 'LASTPORTOFCALLID' }, { fieldLabel: '离港日期', format: 'Y-m-d', flex: 1, xtype: 'datefield', labelWidth: 120, name: 'LASTPORTOFCALLDATE' }, { fieldLabel: '第一个停靠港港口代码', flex: 1, labelWidth: 130, name: 'FIRSTPORTOFCALLID' }, { fieldLabel: '离港日期', format: 'Y-m-d', flex: 1, xtype: 'datefield', labelWidth: 120, name: 'FIRSTPORTOFCALLDATE' }] } ] }); //客户加载_船公司 this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} }); //船公司 this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '船公司', store: this.storeCARRIER, forceSelection: true, labelWidth: 50, flex: 0.5, name: 'CARRIER', valueField: 'CustName', displayField: 'CodeAndName' }); this.StoreISFIMPORTER_CODE_TYPE = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "EIN" }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "CBP" }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "SSN" }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "Passport" }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "SCAC" }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "ExporterImporter" }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "FIRMS" }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "DUNS" }); this.StoreISFIMPORTER_CODE_TYPE.add({ "TYPE": "DUNS+4" }); this.comboxISFIMPORTER_CODE_TYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreISFIMPORTER_CODE_TYPE, fieldLabel: 'ISFImporter证件类型', labelWidth: 120, forceSelection: true, flex: 0.7, name: 'ISFIMPORTER_CODE_TYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.comboxIMPORTER_CODE_TYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreISFIMPORTER_CODE_TYPE, fieldLabel: 'Importer证件类型', labelWidth: 155, forceSelection: true, flex: 0.7, name: 'IMPORTER_CODE_TYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.comboxCONSIGNEE_CODE_TYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreISFIMPORTER_CODE_TYPE, fieldLabel: 'Consignee证件类型', labelWidth: 120, flex: 0.7, forceSelection: true, name: 'CONSIGNEE_CODE_TYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.comboxBONDHOLDER_CODE_TYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreISFIMPORTER_CODE_TYPE, fieldLabel: 'Bond Holder(买方)证件类型', labelWidth: 155, flex: 0.7, forceSelection: true, name: 'BONDHOLDER_CODE_TYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.StoreCARGOTYPE = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StoreCARGOTYPE.add({ "TYPE": "Standard" }); this.StoreCARGOTYPE.add({ "TYPE": "ToOrde" }); this.StoreCARGOTYPE.add({ "TYPE": "HouseholdGoods" }); this.StoreCARGOTYPE.add({ "TYPE": "GovernmentMilitary" }); this.StoreCARGOTYPE.add({ "TYPE": "Diplomatic" }); this.StoreCARGOTYPE.add({ "TYPE": "Carnets" }); this.StoreCARGOTYPE.add({ "TYPE": "GoodsReturned" }); this.StoreCARGOTYPE.add({ "TYPE": "FTZ" }); this.StoreCARGOTYPE.add({ "TYPE": "InternationalMail" }); this.StoreCARGOTYPE.add({ "TYPE": "OuterContinentalShelf" }); this.StoreCARGOTYPE.add({ "TYPE": "Informal" }); this.comboxCARGOTYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreCARGOTYPE, fieldLabel: '货物类型', flex: 0.7, forceSelection: true, name: 'CARGOTYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.StoreBONDTYPE = Ext.create('Ext.data.Store', { fields: ['TYPE','VALUE'] }); this.StoreBONDTYPE.add({ "TYPE": "Continuous(过境)", "VALUE": "Continuous" }); this.StoreBONDTYPE.add({ "TYPE": "SingleEntry(进口)", "VALUE": "SingleEntry" }); this.comboxBONDTYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreBONDTYPE, fieldLabel: 'Bond Type', flex: 0.7, forceSelection: true, name: 'BONDTYPE', valueField: 'VALUE', displayField: 'TYPE' }); this.StoreBONDACTIVECODE = Ext.create('Ext.data.Store', { fields: ['TYPE', 'VALUE'] }); this.StoreBONDACTIVECODE.add({ "TYPE": "Importer or Broker", "VALUE": "ImporterBroker" }); this.StoreBONDACTIVECODE.add({ "TYPE": "Custodian of Bonded Merchandise", "VALUE": "CustodianBondedMerchandise" }); this.StoreBONDACTIVECODE.add({ "TYPE": "International Carrier)", "VALUE": "InternationalCarrier" }); this.StoreBONDACTIVECODE.add({ "TYPE": "Foreign Trade Zone Operator", "VALUE": "FTZOperator" }); this.StoreBONDACTIVECODE.add({ "TYPE": "ISF Bond", "VALUE": "ISFBond" }); this.comboxBONDACTIVECODE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreBONDACTIVECODE, fieldLabel: 'Bond Activity Code', labelWidth: 115, forceSelection: true, name: 'BONDACTIVECODE', valueField: 'VALUE', displayField: 'TYPE' }); //#region 编辑formEdit 基本信息 this.formEdit = Ext.widget('form', { region: 'north', frame: true, bodyPadding: 5, layout: 'anchor', trackResetOnLoad: true, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 70, msgTarget: 'qtip' }, items: [{ xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '船名', flex: 1, name: 'VESSEL' }, { fieldLabel: '航次', flex: 0.5, name: 'VOYNO' }, { fieldLabel: '开船日期时间', format: 'Y-m-d', labelWidth: 90, flex: 1, xtype: 'datetimefield', name: 'ETD' }, { fieldLabel: '船舶呼号', flex: 0.5, name: 'SHIPIMO' }, { fieldLabel: '船舶(IMO)号', labelWidth: 80, flex: 0.5, name: 'SHIPSERVICENO' }, this.comboxCARRIER, { fieldLabel: '船公司代码', flex: 0.5, name: 'CARRIERID' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '抵港船名', flex: 1, name: 'ARVESSEL' }, { fieldLabel: '抵港航次', flex: 0.5, name: 'ARVOYNO' }, { fieldLabel: '预抵日期', labelWidth: 90, format: 'Y-m-d', xtype: 'datefield', flex: 1, name: 'ETA' }, { fieldLabel: '抵港呼号', flex: 0.5, name: 'ARSHIPIMO' }, { fieldLabel: '抵港(IMO)号', labelWidth: 80, flex: 0.5, name: 'ARSHIPSERVICENO' },{ fieldLabel: '代理代码', flex: 0.5, name: 'AGENTID' }, { fieldLabel: 'AMS SCAC', flex: 0.5, name: 'AMSSCACCODE' }] },this.panelscn, this.panelPort ] }); //end this.formEdit //#endregion //#region 按钮Toolbar this.panelBtn = new Ext.Panel({ region: "north", tbar: [{ id: 'btnEPrev', text: "上一票", // iconCls: "btnsave", handler: function (button, event) { this.PrevRecord(); }, scope: this }, { id: 'btnENext', text: "下一票", // iconCls: "btnsave", handler: function (button, event) { this.NextRecord(); }, scope: this }, { id: 'btnECopyNew', text: "复制新建", handler: function (button, event) { var basicForm = this.formHead.getForm(); this.opStatus = 'add'; basicForm.findField('BSNO').setDisabled(false); var field = basicForm.findField('BSNO'); var BSNO = NewGuid(); field.setValue(BSNO); basicForm.findField('BSNO').setDisabled(true); field = basicForm.findField('ORDNO'); field.setValue(''); field = basicForm.findField('INPUTBY'); field.setValue(SHOWNAME); field = basicForm.findField('ORSTATUS'); field.setValue('9'); field = basicForm.findField('ORSTATUSREF'); field.setValue('录入状态'); field = basicForm.findField('MBLNO'); field.setValue(''); this.panelFee.strBSNO = BSNO; for (var j = 0; j < this.storeBodyList.getCount(); j += 1) { var memberbody = this.storeBodyList.getAt(j); memberbody.set("ORDNO", '*'); memberbody.commit(); }; for (var j = 0; j < this.panelFee.storeDrChFee.getCount(); j += 1) { var memberbody = this.panelFee.storeDrChFee.getAt(j); memberbody.set("GId", NewGuid()); memberbody.set("BsNo", '*'); memberbody.commit(); }; for (var j = 0; j < this.panelFee.storeCrChFee.getCount(); j += 1) { var memberbody = this.panelFee.storeCrChFee.getAt(j); memberbody.set("GId", NewGuid()); memberbody.set("BsNo", '*'); memberbody.commit(); }; this.GetEditStatus(); var children = this.tabSeaepanel.items; if (children) { for (var i = children.length - 1, len = 0; i >= len; i--) { if (children.items[i].id) { if (children.items[i].id == 'pnlmodSeaeOrderInfo') { this.tabSeaepanel.setActiveTab(i); } } } } this.tabSeaepanel.doLayout(); this.panelOcr.hide(); }, scope: this }, { id: 'btnESave', text: "保存", iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, { id: 'btnESaveAndClose', text: "保存并关闭", handler: function (button, event) { this.Save('1'); }, scope: this }, '-', { text: "关闭", handler: function (button, event) { window.close(); }, scope: this }, '-', { text: 'FTP上传', tooltip: 'FTP上传', handler: function (button, event) { this.onFtpUpClick(); }, scope: this }] }); //end 按钮Toolbar //#endregion //#region 框架结构 this.panelpage1 = new Ext.Panel({ layout: "border", title: '基本信息', region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.formEdit, this.panelCtn] }); this.storeNameSELLER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameSELLER = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameSELLER, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'SELLERNAME', 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('SELLERNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('SELLERADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('SELLERADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('SELLERCITY').setValue(records[0].data.CITY); _this.formcd.getForm().findField('SELLERPROVINCE').setValue(records[0].data.PROVINCE); _this.formcd.getForm().findField('SELLERCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('SELLEREMAIL').setValue(records[0].data.POSTCODE); } } } }); this.panelSELLER = new Ext.Panel({ title: '卖方信息', layout: "anchor", height: 145, 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.comboxNameSELLER, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'SE'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'SELLERADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 2, name: 'SELLERADDR2' }, { fieldLabel: '邮编', flex: 1, name: 'SELLEREMAIL' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 0.30, //labelWidth: 50, name: 'SELLERCITY' }, { fieldLabel: '省份代码', flex: 0.30, //labelWidth: 50, name: 'SELLERPROVINCE' },{ fieldLabel: '国家代码', flex: 0.30, //labelWidth: 50, name: 'SELLERCOUNTRY' }] } ] }); this.storeNameBUYER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameBUYER = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameBUYER, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'BUYERNAME', 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('BUYERNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('BUYERADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('BUYERADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('BUYERCITY').setValue(records[0].data.CITY); _this.formcd.getForm().findField('BUYERPROVINCE').setValue(records[0].data.PROVINCE); _this.formcd.getForm().findField('BUYERCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('BUYEREMAIL').setValue(records[0].data.POSTCODE); } } } }); this.panelBUYER = new Ext.Panel({ title: '买方信息', layout: "anchor", height: 145, 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.comboxNameBUYER, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'BY'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'BUYERADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 2, name: 'BUYERADDR2' }, { fieldLabel: '邮编', flex: 1, name: 'BUYEREMAIL' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 0.30, //labelWidth: 50, name: 'BUYERCITY' }, { fieldLabel: '省份代码', flex: 0.30, //labelWidth: 50, name: 'BUYERPROVINCE' },{ fieldLabel: '国家代码', flex: 0.30, //labelWidth: 50, name: 'BUYERCOUNTRY' }] } ] }); this.storeNameSHIPTOPARTY = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameSHIPTOPARTY = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameSHIPTOPARTY, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'SHIPTOPARTYNAME', 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('SHIPTOPARTYNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('SHIPTOPARTYADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('SHIPTOPARTYADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('SHIPTOPARTYCITY').setValue(records[0].data.CITY); _this.formcd.getForm().findField('SHIPTOPARTYPROVINCE').setValue(records[0].data.PROVINCE); _this.formcd.getForm().findField('SHIPTOPARTYCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('SHIPTOPARTYEMAIL').setValue(records[0].data.POSTCODE); } } } }); this.panelSHIPTOPARTY = new Ext.Panel({ title: '货物送达的公司', layout: "anchor", height: 145, 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.comboxNameSHIPTOPARTY, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'ST'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'SHIPTOPARTYADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 2, name: 'SHIPTOPARTYADDR2' }, { fieldLabel: '邮编', flex: 1, name: 'SHIPTOPARTYEMAIL' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 0.30, //labelWidth: 50, name: 'SHIPTOPARTYCITY' }, { fieldLabel: '省份代码', flex: 0.30, //labelWidth: 50, name: 'SHIPTOPARTYPROVINCE' },{ fieldLabel: '国家代码', flex: 0.30, //labelWidth: 50, name: 'SHIPTOPARTYCOUNTRY' }] } ] }); this.storeNameCONTAINERLOCATION = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameCONTAINERLOCATION = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameCONTAINERLOCATION, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'CONTAINERLOCATIONNAME', 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('CONTAINERLOCATIONNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('CONTAINERLOCATIONADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('CONTAINERLOCATIONADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('CONTAINERLOCATIONCITY').setValue(records[0].data.CITY); _this.formcd.getForm().findField('CONTAINERLOCATIONPROVINCE').setValue(records[0].data.PROVINCE); _this.formcd.getForm().findField('CONTAINERLOCATIONCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('CONTAINERLOCATIONEMAIL').setValue(records[0].data.POSTCODE); } } } }); this.panelCONTAINERLOCATION = new Ext.Panel({ title: '装柜信息', layout: "anchor", height: 145, 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.comboxNameCONTAINERLOCATION, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'LG'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'CONTAINERLOCATIONADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 2, name: 'CONTAINERLOCATIONADDR2' }, { fieldLabel: '邮编', flex: 1, name: 'CONTAINERLOCATIONEMAIL' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 0.30, //labelWidth: 50, name: 'CONTAINERLOCATIONCITY' }, { fieldLabel: '省份代码', flex: 0.30, //labelWidth: 50, name: 'CONTAINERLOCATIONPROVINCE' },{ fieldLabel: '国家代码', flex: 0.30, //labelWidth: 50, name: 'CONTAINERLOCATIONCOUNTRY' }] } ] }); this.storeNameMANUFACTURER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameMANUFACTURER = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameMANUFACTURER, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'MANUFACTURERNAME', 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('MANUFACTURERNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('MANUFACTURERADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('MANUFACTURERADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('MANUFACTURERCITY').setValue(records[0].data.CITY); _this.formcd.getForm().findField('MANUFACTURERPROVINCE').setValue(records[0].data.PROVINCE); _this.formcd.getForm().findField('MANUFACTURERCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('MANUFACTUREREMAIL').setValue(records[0].data.POSTCODE); } } } }); this.panelMANUFACTURER = new Ext.Panel({ title: '工厂信息', layout: "anchor", height: 145, 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.comboxNameMANUFACTURER, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'MF'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'MANUFACTURERADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 2, name: 'MANUFACTURERADDR2' }, { fieldLabel: '邮编', flex: 1, name: 'MANUFACTUREREMAIL' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 0.30, //labelWidth: 50, name: 'MANUFACTURERCITY' }, { fieldLabel: '省份代码', flex: 0.30, //labelWidth: 50, name: 'MANUFACTURERPROVINCE' },{ fieldLabel: '国家代码', flex: 0.30, //labelWidth: 50, name: 'MANUFACTURERCOUNTRY' }] } ] }); this.storeNameCONSOLIDATOR = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameCONSOLIDATOR = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameCONSOLIDATOR, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'CONSOLIDATORNAME', 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('CONSOLIDATORNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('CONSOLIDATORADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('CONSOLIDATORADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('CONSOLIDATORCITY').setValue(records[0].data.CITY); _this.formcd.getForm().findField('CONSOLIDATORPROVINCE').setValue(records[0].data.PROVINCE); _this.formcd.getForm().findField('CONSOLIDATORCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('CONSOLIDATOREMAIL').setValue(records[0].data.POSTCODE); } } } }); this.panelCONSOLIDATOR = new Ext.Panel({ title: '拼箱公司', layout: "anchor", height: 145, 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.comboxNameCONSOLIDATOR, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'CS'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'CONSOLIDATORADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 2, name: 'CONSOLIDATORADDR2' }, { fieldLabel: '邮编', flex: 1, name: 'CONSOLIDATOREMAIL' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 0.30, //labelWidth: 50, name: 'CONSOLIDATORCITY' }, { fieldLabel: '省份代码', flex: 0.30, //labelWidth: 50, name: 'CONSOLIDATORPROVINCE' },{ fieldLabel: '国家代码', flex: 0.30, //labelWidth: 50, name: 'CONSOLIDATORCOUNTRY' }] } ] }); this.storeNameIMPORTER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameIMPORTER = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameIMPORTER, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'IMPORTERNAME', 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('IMPORTERNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('IMPORTERADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('IMPORTERADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('IMPORTERCITY').setValue(records[0].data.CITY); _this.formcd.getForm().findField('IMPORTERPROVINCE').setValue(records[0].data.PROVINCE); _this.formcd.getForm().findField('IMPORTERCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('IMPORTEREMAIL').setValue(records[0].data.POSTCODE); } } } }); this.panelIMPORTER = new Ext.Panel({ title: '进口商', layout: "anchor", height: 145, 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.comboxNameIMPORTER, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'IM'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'IMPORTERADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 2, name: 'IMPORTERADDR2' }, { fieldLabel: '邮编', flex: 1, name: 'IMPORTEREMAIL' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 0.30, //labelWidth: 50, name: 'IMPORTERCITY' }, { fieldLabel: '省份代码', flex: 0.30, //labelWidth: 50, name: 'IMPORTERPROVINCE' },{ fieldLabel: '国家代码', flex: 0.30, //labelWidth: 50, name: 'IMPORTERCOUNTRY' }] } ] }); this.storeNameBOOKINGPARTY = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.MsOpSeaeEdiTemplate', proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' } }); // this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } }); this.comboxNameBOOKINGPARTY = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '名称', store: this.storeNameBOOKINGPARTY, queryParam: 'DisplayName', queryMode: 'remote', flex: 0.5, name: 'BOOKINGPARTYNAME', 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('BOOKINGPARTYNAME').setValue(records[0].data.NAME); _this.formcd.getForm().findField('BOOKINGPARTYADDR1').setValue(records[0].data.ADDRESS); _this.formcd.getForm().findField('BOOKINGPARTYADDR2').setValue(records[0].data.ADDRESS2); _this.formcd.getForm().findField('BOOKINGPARTYCITY').setValue(records[0].data.CITY); _this.formcd.getForm().findField('BOOKINGPARTYPROVINCE').setValue(records[0].data.PROVINCE); _this.formcd.getForm().findField('BOOKINGPARTYCOUNTRY').setValue(records[0].data.COUNTRY); _this.formcd.getForm().findField('BOOKINGPARTYEMAIL').setValue(records[0].data.POSTCODE); } } } }); this.panelBOOKINGPARTY = new Ext.Panel({ title: '订舱方', layout: "anchor", height: 145, 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.comboxNameBOOKINGPARTY, { xtype: "button", text: "保存为模板", handler: function () { _TempType = 'BKP'; _this.winTempSaveShow.show(); } }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址1', flex: 1, name: 'BOOKINGPARTYADDR1' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [{ fieldLabel: '地址2', flex: 2, name: 'BOOKINGPARTYADDR2' }, { fieldLabel: '邮编', flex: 1, name: 'BOOKINGPARTYEMAIL' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '城市', flex: 0.30, //labelWidth: 50, name: 'BOOKINGPARTYCITY' }, { fieldLabel: '省份代码', flex: 0.30, //labelWidth: 50, name: 'BOOKINGPARTYPROVINCE' },{ fieldLabel: '国家代码', flex: 0.30, //labelWidth: 50, name: 'BOOKINGPARTYCOUNTRY' }] } ] }); this.formcd = Ext.widget('form', { region: 'north', title: 'ISF信息', frame: true, bodyPadding: 5, layout: 'anchor', trackResetOnLoad: true, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 70, msgTarget: 'qtip' }, items: [ { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxCARGOTYPE, this.comboxISFIMPORTER_CODE_TYPE, { fieldLabel: 'ISFImporter证件号', labelWidth: 120, name: 'ISFIMPORTER_CODE' }, this.comboxIMPORTER_CODE_TYPE, { fieldLabel: 'Importer证件号', labelWidth: 145, name: 'IMPORTER_CODE' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxBONDTYPE, this.comboxBONDACTIVECODE,this.comboxCONSIGNEE_CODE_TYPE, { fieldLabel: 'Consignee证件号', labelWidth: 120, name: 'CONSIGNEE_CODE' }, this.comboxBONDHOLDER_CODE_TYPE, { fieldLabel: 'Bond Holder((买方)证件号', labelWidth: 145, name: 'BONDHOLDER_CODE' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.panelSELLER,this.panelBUYER,this.panelSHIPTOPARTY] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.panelMANUFACTURER, this.panelCONTAINERLOCATION, this.panelCONSOLIDATOR] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.panelIMPORTER, this.panelBOOKINGPARTY, { xtype: 'hiddenfield' }] } ] }); //end this.formEdit this.StoreHBLTYPE = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StoreHBLTYPE.add({ "TYPE": "Master" }); this.StoreHBLTYPE.add({ "TYPE": "Coloader" }); this.StoreHBLTYPE.add({ "TYPE": "Regular" }); this.StoreHBLTYPE.add({ "TYPE": "MasterAndColoader" }); this.comboxHBLTYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreHBLTYPE, fieldLabel: 'House Bill Type', forceSelection: true, name: 'HBLTYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.StorePORTTERMINALCODETYPE = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StorePORTTERMINALCODETYPE.add({ "TYPE": "NACCSUserCode" }); this.StorePORTTERMINALCODETYPE.add({ "TYPE": "MutuallyDefined" }); this.StorePORTTERMINALCODETYPE.add({ "TYPE": "CbsaSubLocation" }); this.StorePORTTERMINALCODETYPE.add({ "TYPE": "SarsFacilityCode" }); this.comboxPORTTERMINALCODETYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StorePORTTERMINALCODETYPE, fieldLabel: 'PortOfDischarge Terminal Code Type', labelWidth: 220, forceSelection: true, name: 'PORTTERMINALCODETYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.StoreDELIVERYPORTTERMINALCODETYPE = Ext.create('Ext.data.Store', { fields: ['TYPE'] }); this.StoreDELIVERYPORTTERMINALCODETYPE.add({ "TYPE": "NACCSUserCode" }); this.StoreDELIVERYPORTTERMINALCODETYPE.add({ "TYPE": "MutuallyDefined" }); this.StoreDELIVERYPORTTERMINALCODETYPE.add({ "TYPE": "CbsaSubLocation" }); this.StoreDELIVERYPORTTERMINALCODETYPE.add({ "TYPE": "SarsFacilityCode" }); this.comboxDELIVERYPORTTERMINALCODETYPE = Ext.create('DsExt.ux.RefTableCombox', { store: this.StoreDELIVERYPORTTERMINALCODETYPE, fieldLabel: 'PlaceOfDelivery Terminal Code Type', labelWidth: 220, forceSelection: true, name: 'DELIVERYPORTTERMINALCODETYPE', valueField: 'TYPE', displayField: 'TYPE' }); this.formEMANIFEST = Ext.widget('form', { region: 'north', title: 'EMANIFEST信息', frame: true, bodyPadding: 5, layout: 'anchor', trackResetOnLoad: true, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 130, msgTarget: 'qtip' }, items: [{ xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxHBLTYPE, { fieldLabel: "Master Loader's Hbl Number", labelWidth: 220, name: 'MASTERHBLNUMBER' }, { fieldLabel: "Master Hbl Prefix", name: 'MASTERHBLPREFIX' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [this.comboxPORTTERMINALCODETYPE, { fieldLabel: "PortOfDischarge Terminal Code", labelWidth: 180, name: 'PORTTERMINALCODE' }, this.comboxDELIVERYPORTTERMINALCODETYPE, { fieldLabel: "PlaceOfDelivery Terminal Code", labelWidth: 180, name: 'DELIVERYPORTTERMINALCODE' }] }, { xtype: 'container', defaultType: 'textfield', layout: 'hbox', items: [ { fieldLabel: "联系人", name: 'CONTACTNAME' }, { fieldLabel: "联系电话", name: 'CONTACTPHONE' }, { fieldLabel: "备注", // flex: 2, name: 'COMMENTS' }] } ] }); //end this.formEdit this.panelpage = new Ext.TabPanel({ layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.panelpage1, this.formcd, this.formEMANIFEST] }); this.panelSeae = new Ext.Panel({ id: 'pnlmodSeaeEdiInfo', layout: "border", region: 'center', animate: true, autoScroll: true, frame: false, //closable:true, items: [this.panelBtn, this.formHead, this.panelpage] }); Ext.apply(this, { items: [this.panelSeae] }); //#endregion //#region 其他 parentWin = window.parent.opener; this.InitData(); 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(); } }] }); //#endregion }, //end initUIComponents //#region 加载事件 InitData: function () { this.opStatus = 'add'; var condition = ''; _this = this; if (parentWin) { var ret = parentWin.OprationSwap(); this.opStatus = ret[0]; this.StoreList = ret[1]; this.editRecord = ret[2]; this.isAudit = ret[3]; this.BillType = ret[4]; this.OrType = ret[5]; } this.setBtnStatus(this.BillType); if (this.opStatus == 'edit') { condition = "MFNO='" + this.editRecord.get('MFNO') + "'"; } this.LoadData(this.opStatus, condition); }, //end InitData LoadData: function (opstatus, condition) { this.serialNo = 0; //this.bodyDel = []; this.opStatus = opstatus; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/MsOpSeaeEdi/GetData', 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.formHead.getForm().reset(); this.formHead.getForm().setValues(data); this.formEdit.getForm().reset(); this.formEdit.getForm().setValues(data); this.formcd.getForm().reset(); this.formcd.getForm().setValues(data); this.formEMANIFEST.getForm().reset(); this.formEMANIFEST.getForm().setValues(data); this.LoadInit(); this.GetEditStatus(); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); if (this.opStatus == 'edit') { this.storeBodyList.load({ params: { condition: condition} }); this.storeCargoList.load({ params: { condition: condition} }); } else { condition = "MFNO='XX'"; this.storeBodyList.load({ params: { condition: condition} }); this.storeCargoList.load({ params: { condition: condition} }); } }, // end LoadDate //#endregion //#region 保存 Save: function (type) { var basicForm = this.formEdit.getForm(); var basicForm2 = this.formHead.getForm(); if (!basicForm.isValid()) { return; } if (!basicForm2.isValid()) { return; } // 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); var cargodatas = []; for (var i = 0; i < this.storeCargoList.getCount(); i += 1) { var member = this.storeCargoList.getAt(i); cargodatas.push(member); } // var jsonCargo = ConvertRecordsToJsonAll(cargodatas); this.formHead.getForm().findField('MFNO').setDisabled(false); var data = this.formHead.getForm().getValues(false, false, false); var data2 = this.formEdit.getForm().getValues(false, false, false); var data3 = this.formcd.getForm().getValues(false, false, false); var data4 = this.formEMANIFEST.getForm().getValues(false, false, false); Object.assign(data2, data3); Object.assign(data2, data4); this.formHead.getForm().findField('MFNO').setDisabled(true); // Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/MsOpSeaeEdi/Save', scope: this, params: { opstatus: this.opStatus, data: Ext.JSON.encode(data), data2: Ext.JSON.encode(data2), body: jsonBody, cargobody: jsonCargo }, 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); this.formHead.getForm().reset(); this.formHead.getForm().setValues(returnData); this.formEMANIFEST.getForm().reset(); this.formEMANIFEST.getForm().setValues(returnData); // if (this.opStatus == 'add') { var arrNewRecords = this.StoreList.add(returnData); this.editRecord = arrNewRecords[0]; } else if (this.opStatus == 'edit') { var editp = Ext.create('MsSeaeEdiModel', 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(); } if (type == '0') { this.opStatus = 'edit'; basicForm2.findField('MFNO').setDisabled(true); for (var j = 0; j < this.storeBodyList.getCount(); j += 1) { var memberbody = this.storeBodyList.getAt(j); memberbody.set("MFNO", this.editRecord.get('MFNO')); memberbody.commit(); }; for (var j = 0; j < this.storeCargoList.getCount(); j += 1) { var memberbody = this.storeCargoList.getAt(j); memberbody.set("MFNO", this.editRecord.get('MFNO')); memberbody.commit(); }; } else if (type == '1') { window.close(); } else if (type == '2') { this.LoadData('add', ''); } } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', 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 addDetail: function () { var ORSTATUS = this.formHead.getForm().findField('EDISTATUS').getValue(); if (ORSTATUS == '已发送') { Ext.Msg.show({ title: '警告', msg: '业务已发送,不允许操作!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } var newSerialno = this.DsGetNewNo(this.storeBodyList); this.serialNo = newSerialno; var record = Ext.create('MsSeaeEdiCtn', { CTN_ID: NewGuid(), MFNO: '*', CTNCODE: newSerialno, CTNALL: '', CNTRNO: '', SEALNO: '', PKGS: 0, KGS: 0, CBM: 0, MARKS: '', DESCRIPTION: '' }); this.storeBodyList.add(record); var n = this.storeBodyList.getCount(); this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 2 }); }, addDetailCargo: function () { var ORSTATUS = this.formHead.getForm().findField('EDISTATUS').getValue(); if (ORSTATUS == '已发送') { Ext.Msg.show({ title: '警告', msg: '业务已发送,不允许操作!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } var newSerialno = this.DsGetNewNo(this.storeCargoList); this.serialNo = newSerialno; var record = Ext.create('MsSeaeEdiCtnDetail', { GID: NewGuid(), CTN_ID: '', MFNO: '*', KINDPKGS: '', DUNNO: '', HTS: '', PKGS: 0, KGS: 0, CBM: 0, CNTRNO: '', GOODVALUE: 0 }); this.storeCargoList.add(record); var n = this.storeCargoList.getCount(); this.gridListCargoCellEditing.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 = parseInt(record) + 1; return result; }, gridListCargoAfterEdit: function (editor, e, eOpts) { if (e.value == e.originalValue) return; if (e.field == 'CTN_ID') { var records = DsStoreQueryBy(this.storeBodyList, 'CTN_ID', e.value); if (records.getCount() > 0) { var data = records.getAt(0).data; var CNTRNO = data.CNTRNO; e.record.set('CNTRNO', CNTRNO); } else { e.record.set('CNTRNO', ''); } } }, onNextKeyClick: function (type, col) { var rows = this.gridDrChFee.getSelectionModel().getSelection(); var row = rows[rows.length - 1]; var s = this.gridDrChFee.getStore(); var number = s.indexOf(row) + 1; if (number == this.gridDrChFee.getStore().getCount()) { } else { this.cellEditingDrChFee.startEditByPosition({ row: number, column: col }); } }, cellEditingChFeeBeforeEdit: function (editor, e) { var canedit = true; var ORSTATUS = this.formHead.getForm().findField('EDISTATUS').getValue(); if (ORSTATUS == '已发送') { Ext.Msg.show({ title: '警告', msg: '业务已发送,不允许操作!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); canedit = false; } return canedit; }, deleteDetail: function () { var ORSTATUS = this.formHead.getForm().findField('EDISTATUS').getValue(); if (ORSTATUS == '已发送') { Ext.Msg.show({ title: '警告', msg: '业务已发送,不允许操作!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } //this.serialNo = DsGetCurSerialNo(this.storeBodyList, this.serialNo); var selectedRecords = this.gridList.selModel.getSelection(); for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (rec.data.MFNO == "" || rec.data.MFNO == "*")//如果是新增但没有保存的数据,没有必要提交到后台 { this.storeBodyList.remove(selectedRecords[i]); } else { Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) { if (btn == 'yes') { Ext.Msg.wait('正在删除数据...'); Ext.Ajax.request({ waitMsg: '正在删除数据...', url: '/MvcShipping/MsOpSeaeEdi/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); Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }, failure: function (response, options) { Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, scope: this }); //end Ext.Ajax.request } }, this); } //this.storeBodyList.remove(selectedRecords[i]); } }, deleteDetailCargo: function () { var ORSTATUS = this.formHead.getForm().findField('EDISTATUS').getValue(); if (ORSTATUS == '已发送') { Ext.Msg.show({ title: '警告', msg: '业务已发送,不允许操作!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } //this.serialNo = DsGetCurSerialNo(this.storeBodyList, this.serialNo); var selectedRecords = this.gridList.selModel.getSelection(); for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (rec.data.MFNO == "" || rec.data.MFNO == "*")//如果是新增但没有保存的数据,没有必要提交到后台 { this.storeCargoList.remove(selectedRecords[i]); } else { Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) { if (btn == 'yes') { Ext.Msg.wait('正在删除数据...'); Ext.Ajax.request({ waitMsg: '正在删除数据...', url: '/MvcShipping/MsOpSeaeEdi/DeleteDetailCargo', 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.storeCargoList.remove(rec); Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }, failure: function (response, options) { Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, scope: this }); //end Ext.Ajax.request } }, this); } //this.storeBodyList.remove(selectedRecords[i]); } }, //#endregion onFtpUpClick: function () { var GidStr = ''; this.formHead.getForm().findField('MFNO').setDisabled(false); var data = this.formHead.getForm().getValues(false, false, false); var data2 = this.formEdit.getForm().getValues(false, false, false); this.formHead.getForm().findField('MFNO').setDisabled(true); var data3 = this.formcd.getForm().getValues(false, false, false); var data4 = this.formEMANIFEST.getForm().getValues(false, false, false); Object.assign(data2, data3); Object.assign(data2, data4); var msg = ''; var ORSTATUS = this.formHead.getForm().findField('EDISTATUS').getValue(); if (ORSTATUS == '已发送') { msg = '此票业务已发送,确实要重新发送吗?'; } else { msg = '确实要发送吗?'; } var Mblno = this.formHead.getForm().findField('MBLNO').getValue(); _this = this; Ext.MessageBox.confirm('提示', msg, function (btn) { if (btn == 'yes') { Ext.Ajax.request({ waitMsg: 'Changing...', url: '/MvcShipping/MsOpSeaeEdi/AFRSendData', params: { data: Ext.JSON.encode(data), data2: Ext.JSON.encode(data2), mblno: Mblno }, 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: '提示', msg: result.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK }); } } else { Ext.MessageBox.alert('服务器响应出错,请重试', response.responseText); } }, scope: this }); } }, this); }, //#region SaveSFTTemp: function () { var tempname = this.formTempNameShow.getForm().findField('TempName').getValue(); if (tempname == null || tempname == '') { Ext.Msg.show({ title: '提示', 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.formEdit.getForm().findField('CONSIGNEENAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '收货人不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formEdit.getForm().findField('CONSIGNEENAME').getValue(); dataObj.ADDRESS = this.formEdit.getForm().findField('CONSIGNEEADDR1').getValue(); dataObj.ADDRESS2 = this.formEdit.getForm().findField('CONSIGNEEADDR2').getValue(); dataObj.ADDRESS3 = this.formEdit.getForm().findField('CONSIGNEEADDR3').getValue(); dataObj.CITY = this.formEdit.getForm().findField('CONSIGNEECITY').getValue(); dataObj.POSTCODE = this.formEdit.getForm().findField('CONSIGNEEPOSTCODE').getValue(); dataObj.PROVINCE = this.formEdit.getForm().findField('CONSIGNEEPROVINCE').getValue(); dataObj.ATTN = this.formEdit.getForm().findField('CONSIGNEEATTN').getValue(); dataObj.COUNTRY = this.formEdit.getForm().findField('CONSIGNEECOUNTRY').getValue(); dataObj.TEL = this.formEdit.getForm().findField('CONSIGNEETEL').getValue(); } else if (_TempType == 'F') { var name = this.formEdit.getForm().findField('SHIPPERNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '发货人不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formEdit.getForm().findField('SHIPPERNAME').getValue(); dataObj.ADDRESS = this.formEdit.getForm().findField('SHIPPERADDR1').getValue(); dataObj.ADDRESS2 = this.formEdit.getForm().findField('SHIPPERADDR2').getValue(); dataObj.ADDRESS3 = this.formEdit.getForm().findField('SHIPPERADDR3').getValue(); dataObj.CITY = this.formEdit.getForm().findField('SHIPPERCITY').getValue(); dataObj.POSTCODE = this.formEdit.getForm().findField('SHIPPERPOSTCODE').getValue(); dataObj.PROVINCE = this.formEdit.getForm().findField('SHIPPERPROVINCE').getValue(); dataObj.ATTN = this.formEdit.getForm().findField('SHIPPERATTN').getValue(); dataObj.COUNTRY = this.formEdit.getForm().findField('SHIPPERCOUNTRY').getValue(); dataObj.TEL = this.formEdit.getForm().findField('SHIPPERTEL').getValue(); } else if (_TempType == 'T') { var name = this.formEdit.getForm().findField('NOTIFYPARTYNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '通知人不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formEdit.getForm().findField('NOTIFYPARTYNAME').getValue(); dataObj.ADDRESS = this.formEdit.getForm().findField('NOTIFYPARTYADDR1').getValue(); dataObj.ADDRESS2 = this.formEdit.getForm().findField('NOTIFYPARTYADDR2').getValue(); dataObj.ADDRESS3 = this.formEdit.getForm().findField('NOTIFYPARTYADDR3').getValue(); dataObj.CITY = this.formEdit.getForm().findField('NOTIFYPARTYCITY').getValue(); dataObj.POSTCODE = this.formEdit.getForm().findField('NOTIFYPARTYPOSTCODE').getValue(); dataObj.PROVINCE = this.formEdit.getForm().findField('NOTIFYPARTYPROVINCE').getValue(); dataObj.ATTN = this.formEdit.getForm().findField('NOTIFYPARTYATTN').getValue(); dataObj.COUNTRY = this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRY').getValue(); dataObj.TEL = this.formEdit.getForm().findField('NOTIFYPARTYTEL').getValue(); } else if (_TempType == 'SE') { var name = this.formcd.getForm().findField('SELLERNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '卖方名称不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('SELLERNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('SELLERADDR1').getValue(); dataObj.ADDRESS2 = this.formcd.getForm().findField('SELLERADDR2').getValue(); dataObj.ADDRESS3 =''; dataObj.CITY = this.formcd.getForm().findField('SELLERCITY').getValue(); dataObj.POSTCODE = this.formcd.getForm().findField('SELLEREMAIL').getValue(); dataObj.PROVINCE = this.formcd.getForm().findField('SELLERPROVINCE').getValue(); dataObj.ATTN =''; dataObj.COUNTRY = this.formcd.getForm().findField('SELLERCOUNTRY').getValue(); dataObj.TEL =''; } else if (_TempType == 'BY') { var name = this.formcd.getForm().findField('BUYERNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '买方名称不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('BUYERNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('BUYERADDR1').getValue(); dataObj.ADDRESS2 = this.formcd.getForm().findField('BUYERADDR2').getValue(); dataObj.ADDRESS3 = ''; dataObj.CITY = this.formcd.getForm().findField('BUYERCITY').getValue(); dataObj.POSTCODE = this.formcd.getForm().findField('BUYEREMAIL').getValue(); dataObj.PROVINCE = this.formcd.getForm().findField('BUYERPROVINCE').getValue(); dataObj.ATTN = ''; dataObj.COUNTRY = this.formcd.getForm().findField('BUYERCOUNTRY').getValue(); dataObj.TEL = ''; } else if (_TempType == 'ST') { var name = this.formcd.getForm().findField('SHIPTOPARTYNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '货物送达公司名称不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('SHIPTOPARTYNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('SHIPTOPARTYADDR1').getValue(); dataObj.ADDRESS2 = this.formcd.getForm().findField('SHIPTOPARTYADDR2').getValue(); dataObj.ADDRESS3 = ''; dataObj.CITY = this.formcd.getForm().findField('SHIPTOPARTYCITY').getValue(); dataObj.POSTCODE = this.formcd.getForm().findField('SHIPTOPARTYEMAIL').getValue(); dataObj.PROVINCE = this.formcd.getForm().findField('SHIPTOPARTYPROVINCE').getValue(); dataObj.ATTN = ''; dataObj.COUNTRY = this.formcd.getForm().findField('SHIPTOPARTYCOUNTRY').getValue(); dataObj.TEL = ''; } else if (_TempType == 'LG') { var name = this.formcd.getForm().findField('CONTAINERLOCATIONNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '装柜公司不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('CONTAINERLOCATIONNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('CONTAINERLOCATIONADDR1').getValue(); dataObj.ADDRESS2 = this.formcd.getForm().findField('CONTAINERLOCATIONADDR2').getValue(); dataObj.ADDRESS3 = ''; dataObj.CITY = this.formcd.getForm().findField('CONTAINERLOCATIONCITY').getValue(); dataObj.POSTCODE = this.formcd.getForm().findField('CONTAINERLOCATIONEMAIL').getValue(); dataObj.PROVINCE = this.formcd.getForm().findField('CONTAINERLOCATIONPROVINCE').getValue(); dataObj.ATTN = ''; dataObj.COUNTRY = this.formcd.getForm().findField('CONTAINERLOCATIONCOUNTRY').getValue(); dataObj.TEL = ''; } else if (_TempType == 'MF') { var name = this.formcd.getForm().findField('MANUFACTURERNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '工厂名称不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('MANUFACTURERNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('MANUFACTURERADDR1').getValue(); dataObj.ADDRESS2 = this.formcd.getForm().findField('MANUFACTURERADDR2').getValue(); dataObj.ADDRESS3 = ''; dataObj.CITY = this.formcd.getForm().findField('MANUFACTURERCITY').getValue(); dataObj.POSTCODE = this.formcd.getForm().findField('MANUFACTUREREMAIL').getValue(); dataObj.PROVINCE = this.formcd.getForm().findField('MANUFACTURERPROVINCE').getValue(); dataObj.ATTN = ''; dataObj.COUNTRY = this.formcd.getForm().findField('MANUFACTURERCOUNTRY').getValue(); dataObj.TEL = ''; } else if (_TempType == 'CS') { var name = this.formcd.getForm().findField('CONSOLIDATORNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '拼柜方名称不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('CONSOLIDATORNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('CONSOLIDATORADDR1').getValue(); dataObj.ADDRESS2 = this.formcd.getForm().findField('CONSOLIDATORADDR2').getValue(); dataObj.ADDRESS3 = ''; dataObj.CITY = this.formcd.getForm().findField('CONSOLIDATORCITY').getValue(); dataObj.POSTCODE = this.formcd.getForm().findField('CONSOLIDATOREMAIL').getValue(); dataObj.PROVINCE = this.formcd.getForm().findField('CONSOLIDATORPROVINCE').getValue(); dataObj.ATTN = ''; dataObj.COUNTRY = this.formcd.getForm().findField('CONSOLIDATORCOUNTRY').getValue(); dataObj.TEL = ''; } else if (_TempType == 'IM') { var name = this.formcd.getForm().findField('IMPORTERNAME').getValue(); if (name == null || name == '') { Ext.Msg.show({ title: '提示', msg: '进口商名称不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } dataObj.NAME = this.formcd.getForm().findField('IMPORTERNAME').getValue(); dataObj.ADDRESS = this.formcd.getForm().findField('IMPORTERADDR1').getValue(); dataObj.ADDRESS2 = this.formcd.getForm().findField('IMPORTERADDR2').getValue(); dataObj.ADDRESS3 = ''; dataObj.CITY = this.formcd.getForm().findField('IMPORTERCITY').getValue(); dataObj.POSTCODE = this.formcd.getForm().findField('IMPORTEREMAIL').getValue(); dataObj.PROVINCE = this.formcd.getForm().findField('IMPORTERPROVINCE').getValue(); dataObj.ATTN = ''; dataObj.COUNTRY = this.formcd.getForm().findField('IMPORTERCOUNTRY').getValue(); dataObj.TEL = ''; } 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('提示', '模板保存成功!'); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); }, LoadInit: function () { var CARGOID = this.formHead.getForm().findField('CARGOID').getValue(); if (CARGOID == 'R') { this.panelBodyDr.setVisible(false); this.panelBodyRf.setVisible(true); } else if (CARGOID == 'D') { this.panelBodyDr.setVisible(true); this.panelBodyRf.setVisible(false); } else { this.panelBodyDr.setVisible(false); this.panelBodyRf.setVisible(false); } }, //#endregion getToMonth: function () { var now = new Date(); var year = now.getFullYear(); //年 var month = now.getMonth() + 1; //月 var clock = year + "-"; if (month < 10) clock = clock + "0" + month; else clock = clock + month; return (clock); }, //#region 编辑时按钮等的状态 GetEditStatus: function () { var canedit = false; // var BSSTATUS = this.formHead.getForm().findField('ORSTATUS').getValue(); // var inputby = this.formHead.getForm().findField('INPUTBY').getValue(); // _this = this; // if (BSSTATUS == "0" || BSSTATUS == "1") { // canedit = false; // this.setSaveBtnStatus(canedit); // } else { // this.setSaveBtnStatus(true); // } }, 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; }, setBtnStatus: function (enable) { var btnESave = Ext.getCmp('btnESave'); var btnESaveAndClose = Ext.getCmp('btnESaveAndClose'); var btnEAddDetail = Ext.getCmp('btnadddetail'); if (enable == 2) { btnESave.setVisible(false); ; btnESaveAndClose.setVisible(false); btnEAddDetail.setVisible(false); } else { btnESave.setVisible(true); ; btnESaveAndClose.setVisible(true); btnEAddDetail.setVisible(true); } }, setSaveBtnStatus: function (enable) { var btnESave = Ext.getCmp('btnESave'); var btnESaveAndClose = Ext.getCmp('btnESaveAndClose'); var btnEAddDetail = Ext.getCmp('btnadddetail'); if (enable) { btnESave.enable(); btnESaveAndClose.enable(); btnEAddDetail.enable(); } else { btnESave.disable(); btnESaveAndClose.disable(); btnEAddDetail.disable(); } }, //#endregion PrevRecord: function () { var j = this.StoreList.indexOf(this.editRecord); if (j == 0) { Ext.Msg.show({ title: '警告', msg: '已是最前一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } if (j == this.StoreList.count) { Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } j = j - 1; this.editRecord = this.StoreList.getAt(j); if (this.opStatus == 'edit') { condition = "MFNO='" + this.editRecord.get('MFNO') + "'"; //this.storeBodyList.load({ params: { condition: condition} }); } this.LoadData(this.opStatus, condition); }, NextRecord: function () { var j = this.StoreList.indexOf(this.editRecord); if (j == (this.StoreList.data.length - 1)) { Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } j = j + 1; this.editRecord = this.StoreList.getAt(j); if (this.opStatus == 'edit') { condition = "MFNO='" + this.editRecord.get('MFNO') + "'"; //this.storeBodyList.load({ params: { condition: condition} }); } this.LoadData(this.opStatus, condition); }, //#region 打印 Print: function () { /* var basicForm = this.formEdit.getForm(); var billNo = basicForm.findField('BillNo').value; if (billNo == '*' || billNo == '') { Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var printType = 'MSWLBULKBS'; var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM tMsWlBulkHead WHERE BillNo = '" + billNo + "'"; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); */ } //#endregion });