Ext.namespace('Shipping'); Shipping.MsOpPcLSEdit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.MsOpPcLSEdit.superclass.constructor.call(this); }; Ext.extend(Shipping.MsOpPcLSEdit, Ext.Panel, { ParentWin: null, OpStatus: 'add', StoreList: null, editRecord: null, Editdata: null, MainEditRecord: null, oplb: '', initUIComponents: function () { this.serialNo = 0; //this.bodyDel = []; this.itemindex = 1; var mainform = window.parent.panelEdit; this.MainEditRecord = mainform.editRecord; this.BsNo = this.MainEditRecord.get('BSNO'); this.oplb = mainform.stroplb; Ext.define('PCmb', { extend: 'Ext.data.Model', idProperty: '', fields: [ { name: 'ywType', type: 'string' }, { name: 'PcBillType', type: 'string' }, { name: 'PcBillTypeREF', type: 'string' }, { name: 'timeMark', type: 'string' }, { name: 'gId', type: 'string' }, { name: 'PGid', type: 'string' }, { name: 'BLTYPE', type: 'string' }, { name: 'RowNumber', type: 'string' }, { name: 'BillNo', type: 'string' }, { name: 'ExpDate', type: 'date', dateFormat: 'Y-m-d H:i:s' }, { name: 'GroupDate', type: 'string' }, { name: 'ArriveDate', type: 'string' }, { name: 'ReturnDate', type: 'string' }, { name: 'CustomerName', type: 'string' }, { name: 'F_CustomerName', type: 'string' }, { name: 'DrvName', type: 'string' }, { name: 'TruckNo', type: 'string' }, { name: 'MblNo', type: 'string' }, { name: 'LinkMan', type: 'string' }, { name: 'DstArea', type: 'string' }, { name: 'DetiNation', type: 'string' }, { name: 'ContainerQty', type: 'string' }, { name: 'ContainerNo', type: 'string' }, { name: 'SealNo', type: 'string' }, { name: 'GOODSCOUNT', type: 'string' }, { name: 'Ton', type: 'string' }, { name: 'CBM', type: 'string' }, { name: 'LoadCount', type: 'string' }, { name: 'LoadPlace', type: 'string' }, { name: 'TruckSpec', type: 'string' }, { name: 'IsDouble', type: 'string' }, { name: 'Property', type: 'string' }, { name: 'YUNFEI', type: 'string' }, { name: 'HCHJ', type: 'string' }, { name: 'ZXF', type: 'string' }, { name: 'DDF', type: 'string' }, { name: 'QTFee', type: 'string' }, { name: 'TotalFee', type: 'string' }, { name: 'Remark', type: 'string' }, { name: 'FEESTATUS', type: 'string' }, { name: 'UserCode', type: 'string' }, { name: 'UserName', type: 'string' }, { name: 'OrgName', type: 'string' }, { name: 'LrDate', type: 'string' }, { name: 'PCSTATUSREF', type: 'string' }, { name: 'RefBillNo', type: 'string' }, { name: 'RefBillNose', type: 'string' }, { name: 'MblNoSe', type: 'string' }, { name: 'ContainerType', type: 'string' }, { name: 'LinkTel', type: 'string' }, { name: 'YardName', type: 'string' }, { name: 'LinkManSe', type: 'string' }, { name: 'LinkTelSe', type: 'string' }, { name: 'RtnYardName', type: 'string' }, { name: 'BsType', type: 'string' }, { name: 'CustName', type: 'string' }, { name: 'CustLikeManName', type: 'string' }, { name: 'CustTel', type: 'string' }, { name: 'ChangedReson', type: 'string' }, { name: 'RoadFee', type: 'number' }, { name: 'INVOICENO', type: 'string' }, { name: 'KINDPKGS', type: 'string' }, { name: 'CUSTNO', type: 'string' }, { name: 'GoodsName', type: 'string' }, { name: 'PORTLOAD', type: 'string' }, { name: 'DESTINATION', type: 'string' }, { name: 'FactoryAddr', type: 'string' } ] }); Ext.define('Tradermb', { extend: 'Ext.data.Model', idProperty: 'gid', fields: [ { name: 'gid', type: 'string' }, { name: 'name', type: 'string' }, { name: 'codename', type: 'string' } ] }); //权限范围 this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', { model: 'MsOP', proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' } }); this.StoreOpRange.load({ params: { optype: "modOrderManagement"} }); this.storeFM = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserLinkRefModel', proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' } }); //客户加载_车队 this.storeTRUCKER = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeTRUCKER.load({ params: { condition: "ISTRUCK='1'"} }); //车队 this.comboxTRUCKER = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '车队', store: this.storeTRUCKER, name: 'HEAD_TO', valueField: 'CustName', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('F_CustomerName').setValue(combo.value); var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')"; this.storeInfoClientContact.load({ params: { condition: s }, callback: function (r, options, success) { if (success) { if (this.storeInfoClientContact.getCount() > 0) { var member = this.storeInfoClientContact.getAt(0); this.comboxInfoClientContact.setValue(member.data.SHOWNAME); this.formHead.getForm().findField('HEAD_ATTNTEL').setValue(member.data.TEL); this.formHead.getForm().findField('HEAD_ATTNFAX').setValue(member.data.FAX); } else { this.comboxInfoClientContact.setValue(''); this.formHead.getForm().findField('HEAD_ATTNTEL').setValue(''); this.formHead.getForm().findField('HEAD_ATTNFAX').setValue(''); } } }, scope: this }); } } } }); //委托单位_联系人 this.storeInfoClientContact = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.InfoClientContactModel', proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' } }); this.comboxInfoClientContact = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: 'ATTN', store: this.storeInfoClientContact, name: 'HEAD_ATTN', valueField: 'SHOWNAME', displayField: 'SHOWNAME', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var Cargoinforecords = DsStoreQueryBy(this.storeInfoClientContact, 'GID', records[0].data.GID); if (Cargoinforecords.getCount() > 0) { var Cargoinfodata = Cargoinforecords.getAt(0).data; this.formHead.getForm().findField('HEAD_ATTNTEL').setValue(Cargoinfodata.TEL); this.formHead.getForm().findField('HEAD_ATTNFAX').setValue(Cargoinfodata.FAX); } else { // this.formHead.getForm().findField('HEAD_ATTNTEL').setValue(''); // this.formHead.getForm().findField('HEAD_ATTNFAX').setValue(''); } } } } }); this.StoreTRUCKSTATUS = Ext.create('Ext.data.Store', { fields: ['BLTYPE'] }); this.StoreTRUCKSTATUS.add({ "BLTYPE": "待派车" }); this.StoreTRUCKSTATUS.add({ "BLTYPE": "接单" }); this.StoreTRUCKSTATUS.add({ "BLTYPE": "派车" }); this.StoreTRUCKSTATUS.add({ "BLTYPE": "完成" }); this.comboxTRUCKSTATUS = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '派车状态', store: this.StoreTRUCKSTATUS, forceSelection: true, name: 'PCSTATUSREF', valueField: 'BLTYPE', displayField: 'BLTYPE', value: '待派车' }); this.storePcBillType = Ext.create('DsExt.ux.RefEnumStore', {}); this.storePcBillType.load({ params: { enumTypeId: 99046} }); this.comboxPcBillType = Ext.create('DsExt.ux.RefEnumCombox', { fieldLabel: '派车类型', store: this.storePcBillType, forceSelection: true, name: 'PcBillType' }); this.StoreBLTYPE = Ext.create('Ext.data.Store', { fields: ['BLTYPE'] }); this.StoreBLTYPE.add({ "BLTYPE": "派车主票" }); this.StoreBLTYPE.add({ "BLTYPE": "派车分票" }); this.StoreBLTYPE.add({ "BLTYPE": "派车单票" }); this.comboxBLTYPE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '派车单类型', store: this.StoreBLTYPE, forceSelection: true, name: 'BLTYPE', valueField: 'BLTYPE', displayField: 'BLTYPE', value: '派车单票' }); this.storeList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'PCmb', remoteSort: true, proxy: { type: 'ajax', url: '/TruckMng/PcHeadEdit_WFSD/GetDataList', reader: { id: 'BSNO', root: 'data', totalProperty: 'totalCount' } } }); this.girdcolums = [{ sortable: true, hidden: true, dataIndex: 'PcBillType', header: 'PcBillType', width: 80 }, { sortable: true, dataIndex: 'LrDate', header: '录入日期', width: 110 }, { sortable: true, dataIndex: 'FactoryAddr', header: '卸货工厂', width: 80 }, { sortable: true, dataIndex: 'PcBillTypeREF', header: '派车类型', width: 80 }, { sortable: true, hidden: true, dataIndex: 'UserCode', header: 'UserCode', width: 80 }, { sortable: true, dataIndex: 'UserName', header: '派车申请人', width: 80 }, { sortable: true, dataIndex: 'PCSTATUSREF', header: '状态', width: 50, renderer: function (value) { if (value == "接单") { return "" + value + ""; } else if (value == "派车") { return "" + value + ""; } else if (value == "完成") { return "" + value + ""; } } }, { sortable: true, hidden: true, dataIndex: 'timeMark', header: 'timeMark', width: 80 }, { sortable: true, hidden: true, dataIndex: 'gId', header: 'gId', width: 80 }, { sortable: true, hidden: true, dataIndex: 'FEESTATUS', header: '费用锁定', width: 80 }, { sortable: true, dataIndex: 'RowNumber', header: '日序号', width: 60, align: 'center' }, { sortable: true, dataIndex: 'BillNo', header: '运单号', width: 80 }, { sortable: true, dataIndex: 'ExpDate', header: '派车时间', width: 160, renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s') }, { sortable: true, dataIndex: 'GroupDate', header: '实际派车日期', width: 80 }, { sortable: true, dataIndex: 'ArriveDate', header: '装货日期', width: 80, renderer: Ext.util.Format.dateRenderer('Y-m-d') }, { sortable: true, dataIndex: 'ReturnDate', header: '卸货日期', width: 80, renderer: Ext.util.Format.dateRenderer('Y-m-d') }, { sortable: true, dataIndex: 'CustomerName', header: '客户名称(公司)', width: 80 }, { sortable: true, dataIndex: 'LinkMan', header: '客户联系人', width: 80 }, { sortable: true, dataIndex: 'CustName', header: '发货人', width: 80, editor: { xtype: 'textfield', selectOnFocus: true } }, { sortable: true, dataIndex: 'F_CustomerName', header: '车队', width: 80 }, { sortable: true, dataIndex: 'TruckNo', header: '车牌号', width: 80 }, { sortable: true, dataIndex: 'MblNo', header: 'Marstar业务号', width: 80 }, { sortable: true, dataIndex: 'BsType', header: '业务类型', width: 110 }, { sortable: true, dataIndex: 'DstArea', header: '到达地', width: 120 }, { sortable: true, dataIndex: 'DetiNation', header: '工厂地址', width: 120 }, { sortable: true, dataIndex: 'ContainerQty', header: '箱量', width: 80 }, { sortable: true, dataIndex: 'GOODSCOUNT', header: '件数', width: 80 }, { sortable: true, dataIndex: 'Ton', header: '重量', width: 80 }, { sortable: true, dataIndex: 'CBM', header: '体积', width: 80 }, { sortable: true, dataIndex: 'LoadPlace', header: '装货地址', width: 80 }, { sortable: true, dataIndex: 'TruckSpec', header: '车型', width: 80 }, { sortable: true, dataIndex: 'IsDouble', header: '是否包车', width: 60 }, { sortable: true, dataIndex: 'Property', header: '车辆类别', width: 80 }, { sortable: true, dataIndex: 'YUNFEI', header: '运费', width: 80 }, { sortable: true, dataIndex: 'HCHJ', header: '回程合计', width: 80 }, { sortable: true, dataIndex: 'ZXF', header: '装卸费', width: 80 }, { sortable: true, dataIndex: 'DDF', header: '代垫费', width: 80 }, { sortable: true, dataIndex: 'QTFee', header: '其他', width: 80 }, { sortable: true, dataIndex: 'TotalFee', header: '合计运费', width: 80 }, { sortable: true, dataIndex: 'Remark', header: '备注', width: 160, editor: { xtype: 'textfield', selectOnFocus: true } }, { sortable: true, hidden: true, dataIndex: 'OrgName', header: '分公司', width: 80 }, { sortable: true, hidden: true, dataIndex: 'RefBillNo', header: 'RefBillNo', width: 110 }, { sortable: true, hidden: true, dataIndex: 'RefBillNose', header: 'RefBillNose', width: 110 } ]; //定义Grid this.gridList = new Ext.grid.GridPanel({ store: this.storeList, enableHdMenu: false, region: 'west', width: 300, loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, columns: this.girdcolums, bbar: Ext.create('Ext.PagingToolbar', { store: this.storeList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); _this = this; this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) { _this.editRecord = record; _this.OpStatus = 'edit'; _this.LoadData("edit", "BillNo='" + record.data.BillNo + "'", record.data.RefBillNose); }, this); this.storeList.on('beforeload', function (store) { var sql = " RefBillNo='" + this.BsNo + "'"; Ext.apply(store.proxy.extraParams, { condition: sql }); }, this); //#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: 'BSNO', hidden: true }, { fieldLabel: 'LE_ID', hidden: true, name: 'LE_ID' }, { fieldLabel: 'INPUTTIME', hidden: true, name: 'INPUTTIME' }, { fieldLabel: 'LETTERNAME', hidden: true, name: 'LETTERNAME', value: '派车通知' }, this.comboxTRUCKER] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxInfoClientContact, { fieldLabel: 'ATTN电话', name: 'HEAD_ATTNTEL' }, { fieldLabel: 'ATTN传真', name: 'HEAD_ATTNFAX' }, { xtype: 'hiddenfield'}] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: 'FROM', name: 'INPUTBY' }, { fieldLabel: 'FROM电话', name: 'HEAD_FMTEL' }, { fieldLabel: 'FROM传真', name: 'HEAD_FMFAX' }, { fieldLabel: 'EMAIL', name: 'HEAD_FMEMAIL' }] } ]//end items(fieldset 1) }); //end this.formEdit //#endregion //客户加载_场站 this.storeYARD = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomYardRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomYardRefList' } }); this.storeYARD.load({ params: { condition: "ISYARD='1'"} }); //船公司 var yardname = '提箱场站'; if (this.oplb == "海运进口" || this.oplb == "空运进口") { yardname = '提箱码头' } this.comboxYARD = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: yardname, store: this.storeYARD, forceSelection: true, name: 'YardName', valueField: 'CustName', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var data = combo.value; var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')"; this.storeInfoClientContactYard.load({ params: { condition: s }, callback: function (r, options, success) { if (success) { if (this.storeInfoClientContactYard.getCount() > 0) { var member = this.storeInfoClientContactYard.getAt(0); this.comboxInfoClientContactYard.setValue(member.data.SHOWNAME); this.formEdit.getForm().findField('LinkTel').setValue(member.data.TEL); } else { this.comboxInfoClientContactYard.setValue(''); this.formEdit.getForm().findField('LinkTel').setValue(''); } } }, scope: this }); } } } }); //委托单位_联系人 this.storeInfoClientContactYard = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.InfoClientContactModel', proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' } }); this.comboxInfoClientContactYard = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '联系人', store: this.storeInfoClientContactYard, name: 'LinkMan', valueField: 'SHOWNAME', displayField: 'SHOWNAME', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('LinkTelSe').setValue(records[0].data.TEL); } } } }); //客户加载_场站 this.storeYARD2 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomYardRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomYardRefList' } }); this.storeYARD2.load({ params: { condition: "ISYARD='1'"} }); //船公司 this.comboxYARD2 = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '入货场站', store: this.storeYARD, forceSelection: true, name: 'RtnYardName', valueField: 'CustName', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var data = combo.value; var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')"; this.storeInfoClientContactYard2.load({ params: { condition: s }, callback: function (r, options, success) { if (success) { if (this.storeInfoClientContactYard2.getCount() > 0) { var member = this.storeInfoClientContactYard2.getAt(0); this.comboxInfoClientContactYard2.setValue(member.data.SHOWNAME); this.formEdit.getForm().findField('LinkTelSe').setValue(member.data.TEL); } else { this.comboxInfoClientContactYard2.setValue(''); this.formEdit.getForm().findField('LinkTelSe').setValue(''); } } }, scope: this }); } } } }); //委托单位_联系人 this.storeInfoClientContactYard2 = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.InfoClientContactModel', proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' } }); this.comboxInfoClientContactYard2 = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '联系人', store: this.storeInfoClientContactYard2, name: 'LinkManSe', valueField: 'SHOWNAME', displayField: 'SHOWNAME', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { this.formEdit.getForm().findField('LinkTelSe').setValue(records[0].data.TEL); } } } }); var companyname = '工厂'; if (this.oplb == "海运进口" || this.oplb == "空运进口") { companyname = '卸货工厂' } //客户加载_工厂 this.storeFactry = Ext.create('DsExt.ux.RefTableStore', { model: 'MsCodeFactry', proxy: { url: '/MvcShipping/MsCodeFactry/GetDataList' } }); this.storeFactry.load(); //工厂 this.comboxFactry = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel:companyname, store: this.storeFactry, name: 'FactoryAddr', valueField: 'FACTRYNAME', displayField: 'CodeAndName', listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var DetiNation = this.formEdit.getForm().findField('DetiNation'); DetiNation.setValue(records[0].data.FACTRYADDR); var CustLikeManName = this.formEdit.getForm().findField('CustLikeManName'); CustLikeManName.setValue(records[0].data.FACTRYATTN); var CustTel = this.formEdit.getForm().findField('CustTel'); CustTel.setValue(records[0].data.FACTRYTEL); } } } }); this.storeContainerType = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CtnRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCtnRefList' } }); this.storeContainerType.load({ params: { condition: "" } }); this.comboxContainerType = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '箱型', store: this.storeContainerType, name: 'ContainerType', valueField: 'CtnCode', displayField: 'CtnName', flex: 0.6//CtnName , labelWidth: 30 }); //#region 编辑formEdit 派车通知 this.formEdit = Ext.widget('form', { region: 'north', height: 460, frame: true, bodyPadding: 5, 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: 'UserCode', name: 'UserCode', hidden: true }, { fieldLabel: 'UserName', name: 'UserName', hidden: true }, { fieldLabel: 'OrgCode', name: 'OrgCode', hidden: true }, { fieldLabel: 'OrgName', name: 'OrgName', hidden: true }, { fieldLabel: 'RefBillNose', hidden: true, name: 'RefBillNose' }, { fieldLabel: 'RefBillNo', hidden: true, name: 'RefBillNo' }, { fieldLabel: 'BsType', hidden: true, name: 'BsType' }, { fieldLabel: 'gId', hidden: true, name: 'gId' }, { fieldLabel: 'PGid', hidden: true, name: 'PGid' }, { fieldLabel: 'LrDate', hidden: true, name: 'LrDate' }, { fieldLabel: 'MblNo', hidden: true, name: 'MblNo' }, { fieldLabel: 'MblNoSe', hidden: true, name: 'MblNoSe' }, { fieldLabel: 'EtDate', hidden: true, name: 'EtDate' }, { fieldLabel: 'VoyVeg', hidden: true, name: 'VoyVeg' }, { fieldLabel: 'CustomerName', hidden: true, name: 'CustomerName' }, { fieldLabel: 'FEESTATUS', hidden: true, name: 'FEESTATUS' } , { fieldLabel: '派车单号', readOnly: true, name: 'BillNo' } , this.comboxPcBillType , this.comboxContainerType, { fieldLabel: '箱量', flex: 0.4, labelWidth: 30, name: 'ContainerQty' } , { fieldLabel: '箱型参考', //hidden: true, //flex: 0.6, labelWidth:55, name: 'ContainerTypeSe' }, { fieldLabel: '陆运费', xtype: 'numberfield', name: 'RoadFee', value: 0 } ] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxYARD, this.comboxInfoClientContactYard, { fieldLabel: '电话', name: 'LinkTel' }, this.comboxBLTYPE] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxFactry, { fieldLabel: '派车时间', format: 'Y-m-d', flex: 1, xtype: 'datetimefield', name: 'ExpDate' }, { fieldLabel: '车号', name: 'TruckNo' }, this.comboxTRUCKSTATUS] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '工厂地址', name: 'DetiNation' }, { fieldLabel: '装货时间', //labelWidth: 80, format: 'Y-m-d', flex: 1, xtype: 'datetimefield', name: 'ArriveDate' }] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '工厂联系人', name: 'CustLikeManName' }, { fieldLabel: '联系方式', name: 'CustTel' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '品名', name: 'GoodsName' }, { fieldLabel: '车队', readOnly:true, name: 'F_CustomerName' }, { fieldLabel: '起运港', name: 'PORTLOAD' }, { fieldLabel: '目的港', name: 'DESTINATION' }] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxYARD2, this.comboxInfoClientContactYard2, { fieldLabel: '电话', name: 'LinkTelSe' }, { fieldLabel: '要求返回时间', labelWidth: 80, format: 'Y-m-d', flex: 1, xtype: 'datetimefield', name: 'ReturnDate' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '箱号', name: 'ContainerNo' }, { fieldLabel: '封号', name: 'SealNo' }, { fieldLabel: '件数', name: 'GOODSCOUNT', anchor: '100%' }, { fieldLabel: '重量', name: 'Ton', anchor: '100%' }, { fieldLabel: '尺码', name: 'CBM', anchor: '100%' }] } , { xtype: 'textareafield', grow: true, fieldLabel: '注意事项', height: 60, name: 'ChangedReson', anchor: '100%' }, { xtype: 'textareafield', grow: true, fieldLabel: '备注', height: 40, name: 'Remark', anchor: '100%' }, { xtype: 'textfield', hidden: true, fieldLabel: '发票号', name: 'INVOICENO', anchor: '100%' }, { xtype: 'textfield', hidden: true, fieldLabel: '运单号', name: 'CUSTNO', anchor: '100%' }, { xtype: 'textfield', hidden: true, fieldLabel: '包装', name: 'KINDPKGS', anchor: '100%' }, { xtype: 'textfield', hidden: true, fieldLabel: '截港日期', name: 'EndPortDate', anchor: '100%' } ]//end items(fieldset 1) }); //end this.formEdit //#endregion //#region 按钮Toolbar this.panelBtn = new Ext.Panel({ region: "north", tbar: [{ text: "新建", handler: function (button, event) { this.LoadData('add', ''); }, scope: this }, '-', { id: 'btnESave', text: "保存", iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, { id: 'btnESaveAndNew', text: "保存并新建", handler: function (button, event) { this.Save('2'); }, scope: this }, '-', { id: 'btnCtnFen', text: "按集装箱拆分", handler: function (button, event) { this.CtnFen(); }, scope: this }, '-', { text: '刷新', tooltip: '刷新', iconCls: "btnrefresh", handler: function (button, event) { var billno=this.formEdit.getForm().findField('BillNo').getValue(); var LE_ID=this.formHead.getForm().findField('LE_ID').getValue(); this.LoadData("edit", "BillNo='" +billno+ "'",LE_ID); }, scope: this }, '-', { text: "删除", iconCls: "btndelete", handler: function (button, event) { this.onDeleteClick(button, event); }, scope: this }, '-', { text: "打印", iconCls: "btnprint", handler: function (button, event) { this.Print(); }, scope: this }] }); //end 按钮Toolbar //#endregion //#region 框架结构 this.panelpage = new Ext.Panel({ title: '派车通知详细信息', layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.formEdit] }); this.paneltruckdetail = new Ext.Panel({ layout: "border", region: 'center', animate: true, autoScroll: true, // containerScroll: true, frame: false, items: [this.formHead, this.panelpage] }); Ext.apply(this, { items: [this.panelBtn, this.gridList, this.paneltruckdetail] }); //#endregion //#region 其他 parentWin = window.parent.opener; this.InitData(); //#endregion }, //end initUIComponents //#region 加载事件 InitData: function () { this.opStatus = 'add'; var condition = ''; _this = this; this.storeList.load({ params: { condition: "RefBillNo='" + this.BsNo + "'" }, callback: function (r, options, success) { if (success) { if (this.storeList.getCount() > 0) { var member = this.storeList.getAt(0); _this.LoadData("edit", "BillNo='" + member.data.BillNo + "'", member.data.RefBillNose); } else { _this.LoadData('add', '', ''); } } }, scope: this }); }, //end InitData LoadData: function (opstatus, condition, le_id) { this.serialNo = 0; //this.bodyDel = []; this.opStatus = opstatus; if (this.opStatus == 'add') { this.formHead.getForm().reset(); this.formHead.getForm().findField('HEAD_TO').setValue(this.MainEditRecord.get('TRUCKER')); this.formHead.getForm().findField('BSNO').setValue(this.MainEditRecord.get('BSNO')); var trucker = this.MainEditRecord.get('TRUCKER'); if (trucker != '') { var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + trucker + "')"; this.storeInfoClientContact.load({ params: { condition: s }, callback: function (r, options, success) { if (success) { if (this.storeInfoClientContact.getCount() > 0) { var member = this.storeInfoClientContact.getAt(0); this.comboxInfoClientContact.setValue(member.data.SHOWNAME); this.formHead.getForm().findField('HEAD_ATTNTEL').setValue(member.data.TEL); this.formHead.getForm().findField('HEAD_ATTNFAX').setValue(member.data.FAX); } } }, scope: this }); } this.formHead.getForm().findField('INPUTBY').setValue(SHOWNAME); this.storeFM.load({ params: { condition: '' }, callback: function (r, options, success) { if (success) { if (this.storeFM.getCount() > 0) { var Cargoinforecords = DsStoreQueryBy(this.storeFM, 'UserName', SHOWNAME); if (Cargoinforecords.getCount() > 0) { var Cargoinfodata = Cargoinforecords.getAt(0).data; this.formHead.getForm().findField('HEAD_FMTEL').setValue(Cargoinfodata.Tel); this.formHead.getForm().findField('HEAD_FMFAX').setValue(Cargoinfodata.Fax); this.formHead.getForm().findField('HEAD_FMEMAIL').setValue(Cargoinfodata.Email); } else { } } } }, scope: this }); this.formEdit.getForm().reset(); var yard = this.MainEditRecord.get('YARD'); this.formEdit.getForm().findField('YardName').setValue(yard); this.formEdit.getForm().findField('RtnYardName').setValue(yard); if (yard != '') { var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + yard + "')"; this.storeInfoClientContactYard2.load({ params: { condition: s }, callback: function (r, options, success) { if (success) { if (this.storeInfoClientContactYard2.getCount() > 0) { var member = this.storeInfoClientContactYard2.getAt(0); this.formEdit.getForm().findField('LinkManSe').setValue(member.data.SHOWNAME); this.formEdit.getForm().findField('LinkTelSe').setValue(member.data.TEL); this.formEdit.getForm().findField('LinkMan').setValue(member.data.SHOWNAME); this.formEdit.getForm().findField('LinkTel').setValue(member.data.TEL); } else { this.formEdit.getForm().findField('LinkManSe').setValue(''); this.formEdit.getForm().findField('LinkTelSe').setValue(''); this.formEdit.getForm().findField('LinkMan').setValue(''); this.formEdit.getForm().findField('LinkTel').setValue(''); } } }, scope: this }); this.storeInfoClientContactYard.load({ params: { condition: s} }); } this.formEdit.getForm().findField('Remark').setValue(''); if (this.oplb == '海运出口' || this.oplb == '海运进口') { this.formEdit.getForm().findField('VoyVeg').setValue(this.MainEditRecord.get('VESSEL') + ' ' + this.MainEditRecord.get('VOYNO')); this.formEdit.getForm().findField('ContainerType').setValue(this.MainEditRecord.get('CNTRTOTAL')); this.formEdit.getForm().findField('ContainerTypeSe').setValue(this.MainEditRecord.get('CNTRTOTAL')); } else if (this.oplb == '空运出口' || this.oplb == '空运进口') { this.formEdit.getForm().findField('VoyVeg').setValue(this.MainEditRecord.get('VESSEL')); } //SR2020031700001_1 将CUSTNO和MBLNO的存放位置颠倒了一下 this.formEdit.getForm().findField('MblNo').setValue(this.MainEditRecord.get('MBLNO')); this.formEdit.getForm().findField('MblNoSe').setValue(this.MainEditRecord.get('CUSTNO')); this.formEdit.getForm().findField('CustomerName').setValue(this.MainEditRecord.get('CUSTOMERNAME')); _PKGS = this.MainEditRecord.get('PKGS'); if (isNullorEmpty(_PKGS)) _PKGS = 0; this.formEdit.getForm().findField('GOODSCOUNT').setValue(_PKGS); _KGS = this.MainEditRecord.get('KGS'); if (isNullorEmpty(_KGS)) _KGS = 0; this.formEdit.getForm().findField('Ton').setValue(_KGS); _CBM = this.MainEditRecord.get('CBM'); if (isNullorEmpty(_CBM)) _CBM = 0; this.formEdit.getForm().findField('CBM').setValue(_CBM); this.formEdit.getForm().findField('RoadFee').setValue(0); this.formEdit.getForm().findField('BsType').setValue(this.oplb); this.formEdit.getForm().findField('PcBillType').setValue('0'); this.formEdit.getForm().findField('EtDate').setValue(this.MainEditRecord.get('ETD')); this.formEdit.getForm().findField('EndPortDate').setValue(this.MainEditRecord.get('CLOSINGDATE')); this.formEdit.getForm().findField('PORTLOAD').setValue(this.MainEditRecord.get('PORTLOAD')); this.formEdit.getForm().findField('DESTINATION').setValue(this.MainEditRecord.get('DESTINATION')); this.formEdit.getForm().findField('FEESTATUS').setValue('0'); // this.formEdit.getForm().findField('EndPortDate').setValue(this.MainEditRecord.get('CLOSINGDATE')); this.formEdit.getForm().findField('BillNo').setValue(''); } else { Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/MsOpLetter/GetData', params: { handle: opstatus, condition: "LE_ID='" + le_id + "'" }, 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().findField('CUSTOMERNAME').setValue(this.MainEditRecord.get('CUSTOMERNAME')); // this.GetEditStatus(); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/TruckMng/PcHeadEdit_WFSD/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.formEdit.getForm().reset(); this.formEdit.getForm().setValues(data); // this.formEdit.getForm().findField('PcBillType').setValue('1'); this.LoadInit(); // this.GetEditStatus(); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } //20160219 获取业务主表内的件数重量尺码,用于在生成散货派车单时传递 //this.formEdit.getForm().findField('PKGS').setValue(this.MainEditRecord.get('PKGS')); //this.formEdit.getForm().findField('KGS').setValue(this.MainEditRecord.get('KGS')); //this.formEdit.getForm().findField('CBM').setValue(this.MainEditRecord.get('CBM')); }, // end LoadDate //#endregion //#region 保存 Save: function (type) { var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } var data = this.formHead.getForm().getValues(false, false, false); var body = this.formEdit.getForm().getValues(false, false, false); // Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/MsOpLetter/SaveLSTruck', scope: this, params: { opstatus: this.opStatus, data: Ext.JSON.encode(data), body: Ext.JSON.encode(body), oplb:this.oplb }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var returnData = jsonresult.Data; this.formEdit.getForm().reset(); this.formEdit.getForm().setValues(returnData); // if (this.opStatus == 'add') { var arrNewRecords = this.storeList.add(returnData); this.editRecord = arrNewRecords[0]; var editp = Ext.create('PCmb', returnData); this.formHead.getForm().findField('LE_ID').setValue(editp.get('RefBillNose')); } else if (this.opStatus == 'edit') { var editp = Ext.create('PCmb', 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'; } 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 保存 CtnFen: function () { var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } var data = this.formHead.getForm().getValues(false, false, false); var body = this.formEdit.getForm().getValues(false, false, false); // Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/MsOpLetter/SaveLSCtnTruck', scope: this, params: { data: Ext.JSON.encode(data), body: Ext.JSON.encode(body), oplb: this.oplb }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { this.InitData(); } 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 SavePC: function () { var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } var url = '/MvcShipping/MsOpLetter/SavePC'; if (this.oplb == '空运出口' || this.oplb == '空运出口') { url = '/MvcShipping/MsOpLetter/SaveAirPC'; } var TRUCKSTATUS = this.formEdit.getForm().findField('TRUCKSTATUS').getValue(); if (TRUCKSTATUS != "待派车") { Ext.Msg.show({ title: '警告', msg: '只有在待派车状态才允许生成派车单 !!!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var data = this.formHead.getForm().getValues(false, false, false); var body = this.formEdit.getForm().getValues(false, false, false); var bs = this.MainEditRecord.data; _this = this; // Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: url, scope: this, params: { opstatus: this.opStatus, data: Ext.JSON.encode(data), body: Ext.JSON.encode(body), bs: Ext.JSON.encode(bs), oplb: _this.oplb }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var returnData = jsonresult.Data; this.formEdit.getForm().reset(); this.formEdit.getForm().setValues(returnData); if (this.opStatus == 'add') { // var arrNewRecords = this.StoreList.add(returnData); this.editRecord = arrNewRecords[0]; var editp = Ext.create('MsOpLetter', returnData); this.formHead.getForm().findField('LE_ID').setValue(editp.get('LE_ID')); } else if (this.opStatus == 'edit') { var editp = Ext.create('MsOpLetter', returnData); this.editRecord.fields.each(function (field) { if (field.persist) { name = field.name; if (name != 'id') this.editRecord.set(name, editp.get(name)); } }, this); this.editRecord.commit(); } this.opStatus = 'edit'; 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 }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); }, //end save SavePC_SH: function () { var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } var url = '/MvcShipping/MsOpLetter/SavePC_SH'; if (this.oplb == '空运出口' || this.oplb == '空运出口') { url = '/MvcShipping/MsOpLetter/SaveAirPC_SH'; } var TRUCKSTATUS = this.formEdit.getForm().findField('TRUCKSTATUS').getValue(); if (TRUCKSTATUS != "待派车") { Ext.Msg.show({ title: '警告', msg: '只有在待派车状态才允许生成派车单 !!!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var data = this.formHead.getForm().getValues(false, false, false); var body = this.formEdit.getForm().getValues(false, false, false); _this = this; var bs = this.MainEditRecord.data; // Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: url, scope: this, params: { opstatus: this.opStatus, data: Ext.JSON.encode(data), body: Ext.JSON.encode(body), bs: Ext.JSON.encode(bs), oplb: _this.oplb }, 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.formHead.getForm().reset(); this.formHead.getForm().setValues(returnData); if (this.opStatus == 'add') { var arrNewRecords = this.StoreList.add(returnData); this.editRecord = arrNewRecords[0]; var editp = Ext.create('MsOpLetter', returnData); this.formEdit.getForm().findField('LE_ID').setValue(editp.get('LE_ID')); } else if (this.opStatus == 'edit') { var editp = Ext.create('MsOpLetter', returnData); this.editRecord.fields.each(function (field) { if (field.persist) { name = field.name; if (name != 'id') this.editRecord.set(name, editp.get(name)); } }, this); this.editRecord.commit(); } this.opStatus = 'edit'; 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 }); } } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); }, //end save onDeleteClick: function (button, event) { var selections = this.gridList.getSelectionModel().getSelection(); if (selections.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var record = selections[0]; var TRUCKSTATUS = record.data.PCSTATUSREF; if (TRUCKSTATUS == "派车" || TRUCKSTATUS == "完成") { Ext.Msg.show({ title: '警告', msg: '当前状态不允许删除 !!!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) { if (btn == 'yes') { Ext.Msg.wait('正在删除数据...'); Ext.Ajax.request({ waitMsg: '正在删除数据...', url: '/MvcShipping/MsOpLetter/DeleteLS', params: { data: Ext.JSON.encode(record.data) }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { this.storeList.remove(record); if (this.storeList.getCount() > 0) { var member = this.storeList.getAt(0); this.editRecord = member; this.LoadData("edit", "BillNo='" + member.data.BillNo + "'", member.data.RefBillNose); } else { this.LoadData('add', ''); } 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 }); }, success: function (response, options) { }, scope: this }); //end Ext.Ajax.request } }, this); }, //onDeleteClick //#region LoadInit: function () { var CUSTOMERNAME = this.MainEditRecord.get('CUSTOMERNAME'); var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + CUSTOMERNAME + "')"; this.storeInfoClientContact.load({ params: { condition: s} }); var YARD = this.formEdit.getForm().findField('YardName').getValue(); var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + YARD + "')"; this.storeInfoClientContactYard.load({ params: { condition: s} }); var YARD2 = this.formEdit.getForm().findField('RtnYardName').getValue(); var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + YARD2 + "')"; this.storeInfoClientContactYard2.load({ params: { condition: s} }); }, //#endregion //#region 编辑时按钮等的状态 GetEditStatus: function () { var canedit = false; //var bsStatus = this.formHead.getForm().findField('BSSTATUS').getValue(); var BSSTATUS = this.formHead.getForm().findField('BSSTATUSREF').getValue(); var inputby = this.formHead.getForm().findField('INPUTBY').getValue(); var op = this.formHead.getForm().findField('OP').getValue(); _this = this; if (BSSTATUS == '锁定') { canedit = false; this.setSaveBtnStatus(canedit); } else { this.StoreOpRange.load({ params: { optype: "modOrderManagement" }, callback: function (r, options, success) { if (success) { if (r.length != 0) { var records = DsStoreQueryBy(_this.StoreOpRange, 'OPID', op); if (records.getCount() > 0) { canedit = true; } else { var recordins = DsStoreQueryBy(_this.StoreOpRange, 'OPID', inputby); if (recordins.getCount() > 0) { canedit = true; } else { canedit = false; } } } else { canedit = false; } _this.setSaveBtnStatus(canedit); } } }); } }, setSaveBtnStatus: function (enable) { var btnESave = Ext.getCmp('btnESave'); var btnESaveAndClose = Ext.getCmp('btnESaveAndClose'); var btnESaveAndNew = Ext.getCmp('btnESaveAndNew'); var btnEAddDetail = Ext.getCmp('btnadddetail'); var btnEDeleteDetail = Ext.getCmp('btndeldetail'); var btnCtnFen = Ext.getCmp('btnCtnFen'); if (enable) { btnESave.enable(); btnESaveAndClose.enable(); btnESaveAndNew.enable(); btnCtnFen.enable(); btnEAddDetail.enable(); btnEDeleteDetail.enable(); } else { btnESave.disable(); btnESaveAndClose.disable(); btnESaveAndNew.disable(); btnEAddDetail.disable(); btnEDeleteDetail.disable(); btnCtnFen.disable(); } }, //#endregion //#region 打印 Print: function () { var basicForm = this.formHead.getForm(); var le_id = basicForm.findField('LE_ID').value; var bsNo = basicForm.findField('BSNO').value; var billNo = this.formEdit.getForm().findField('BillNo').getValue(); if (billNo == '*' || billNo == '' || billNo == NaN) { Ext.Msg.show({ title: '错误', msg: '派车通知还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var MBLNO = this.MainEditRecord.get('MBLNO') + '派车通知'; var printType = 'MSOPLETTERTRUCKLS'; if (this.oplb == "海运进口") { printType = 'MSOPLETTERTRUCKSEAILS' } else if (this.oplb == "空运进口") { printType = 'MSOPLETTERTRUCKAIRILS' } else if (this.oplb == "空运出口") { printType = 'MSOPLETTERTRUCKAIRELS' } var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_letter WHERE LE_ID = '" + le_id + "'"; var sql2 = "SET LANGUAGE 'us_english' SELECT * FROM tMsWlPcHead WHERE billNo = '" + billNo + "'"; var sql3 = ""; if (this.oplb == "海运进口") sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_seai WHERE BSNO = '" + bsNo + "'"; else if (this.oplb == "空运进口") sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_airi WHERE BSNO = '" + bsNo + "'"; else if (this.oplb == "空运出口") sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_aire WHERE BSNO = '" + bsNo + "'"; else sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae WHERE BSNO = '" + bsNo + "'"; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO, '', '', '', bsNo); } // #endregion });