//集运管理-路单查询 Ext.namespace('DsTruck'); DsTruck.MsPcEditIndex = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.DsTruck.MsPcEditIndex.superclass.constructor.call(this); }; Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, { PageSize: 30, OprationStatus: null, //仅当弹出界面时使用 SelectedRecord: null, SelectedstoreList: null, SelectPGID: '', fensql: '', sqlcontext: '', selections:null, initUIComponents: function () { this.formname = "PcHeadEdit_WFSD"; this.fensql = ' 1=2 '; this.selectstorelist = null; this.sqlcontext = ''; this.storePLList = Ext.create('Ext.data.Store', { model: 'MsOpBill' }); _this = this; Ext.define('PCmb', { extend: 'Ext.data.Model', idProperty: '', fields: [ { name: 'ywType', type: 'string' }, { name: 'PcBillType', type: 'string' }, { name: 'PcBillTypeREF', type: 'string' }, { name: 'timeMark', type: 'number' }, { name: 'gId', type: 'string' }, { name: 'PGid', type: 'string' }, { name: 'BLTYPE', type: 'string' }, { name: 'RowNumber', type: 'string' }, { name: 'BillNo', type: 'string' }, { name: 'ExpDate', type: 'string',}, { name: 'GroupDate', type: 'string' }, { name: 'EndPortDate', type: 'string'}, { name: 'EtDate', type: 'string' }, { name: 'VoyVeg', type: 'string' }, { name: 'ArriveDate', type: 'date', dateFormat: 'Y-m-d H:i:s' }, { name: 'ReturnDate', type: 'date', dateFormat: 'Y-m-d H:i:s' }, { 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: 'Ton', 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: 'DispatchName', type: 'string' }, { name: 'INVOICENO', type: 'string' }, { name: 'KINDPKGS', type: 'string' }, { name: 'CUSTNO', type: 'string' }, { name: 'SalesName', type: 'string' }, { name: 'RoadFee', type: 'number' }, { name: 'GoodsName', type: 'string' }, { name: 'RtnDocStatus', type: 'string' }, { name: 'RtnDocTime', type: 'string' }, { name: 'PORTLOAD', type: 'string' }, { name: 'DESTINATION', type: 'string' }, { name: 'SALECORPID', type: 'string' }, { name: 'SALECORP', type: 'string' }, { name: 'DRFEESTATUS', type: 'string' }, { name: 'CRFEESTATUS', type: 'string' }, { name: 'ChangedReson', type: 'string' }, { name: 'CargoID', type: 'string' } ] }); Ext.define('Tradermb', { extend: 'Ext.data.Model', idProperty: 'gid', fields: [ { name: 'gid', type: 'string' }, { name: 'name', type: 'string' }, { name: 'codename', type: 'string' } ] }); Ext.define('DsShipping.ux.CustomRefModel', { extend: 'Ext.data.Model', fields: [ { name: 'GId', type: 'string' }, { name: 'CustCode', type: 'string' }, { name: 'CustName', type: 'string' }, { name: 'CodeAndName', type: 'string' }, { name: 'SALE', type: 'string' } ] }); //定义数据集 this.storeCustomerName = Ext.create('DsExt.ux.RefTableStore', { model: 'Tradermb', proxy: { url: '/CommMng/BasicDataRef/GetTrader' } }); this.storeCustomerName.load({ params: { condition: ""} }); this.comboxCustomerName = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '客户', id: "CustomerName", //hidden: true, forceSelection: true, store: this.storeCustomerName, name: 'CustomerName', valueField: 'name', displayField: 'codename' }); this.storeTruckNo = Ext.create('DsExt.ux.RefTableStore', { model: 'MsWlBsHeadRefMsWlTruck', proxy: { url: '/TruckMng/MsWlPc/GetTruckNoCanUse' }, //params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 )"}, autoLoad: false }); //this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 )"} }); var _this = this; this.comboxTruckNo = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '车牌号', //multiSelect:true, store: this.storeTruckNo, //readOnly:true, queryMode: 'remote', name: 'TruckNo', id: "TruckNo", valueField: 'TruckNo', displayField: 'TruckNo' }); // this.storeDrvName = Ext.create('DsExt.ux.RefTableStore', { // model: 'MsWlBsHeadRefMsWlDriver', // proxy: { url: '/TruckMng/MsWlPc/GetDrvNameList' } // }); // this.storeDrvName.load({ params: { condition: ""} }); // this.comboxDrvName = Ext.create('DsExt.ux.RefTableCombox', { // //fieldLabel: '司机', // store: this.storeDrvName, // name: 'DrvName', // valueField: 'DrvName', // displayField: 'CodeAndName', // listeners: { // scope: this, // 'select': function (combo, records, eOpts) { // if (records.length > 0) { // this.setDrvName(records[0].data.DrvCode); // } // } // } // }); //客户加载_车队 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', { store: this.storeTRUCKER, name: 'F_CustomerName', valueField: 'CustName', displayField: 'CodeAndName' }); 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', { store: this.StoreBLTYPE, forceSelection: true, name: 'BLTYPE', valueField: 'BLTYPE', displayField: 'BLTYPE', value: '派车单票' }); _this = this; ///////////////////////////////////////// this.storeList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'PCmb', remoteSort: true, groupField: 'GroupDate', proxy: { type: 'ajax', //url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL', url: '/TruckMng/PcHeadEdit_WFSD/GetDataList', //this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL'; reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); this.column = [ { sortable: true, hidden: true, dataIndex: 'PcBillType', header: 'PcBillType', width: 80 }, { sortable: true, dataIndex: 'ExpDate', header: '派车时间', width: 160, renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s') // , // editor: { // //format: 'Y-m-d H:i:s', // xtype: 'datetimefield' // /*, // labelWidth: 60, // width: 220, // name: 'STARTDATETIME'*/ // } }, { 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, dataIndex: 'BLTYPE', header: '派车单类型', width: 80, // editor: this.comboxBLTYPE, renderer: function (value) { if (value == "") { return "派车单票"; } else 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: 'PGid', header: 'PGid', width: 80 }, { sortable: true, hidden: true, dataIndex: 'FEESTATUS', header: '费用锁定', width: 80 }, { sortable: true, id: '', dataIndex: 'DRFEESTATUS', header: '应收费用', //'应收费用', align: 'center', width: 60, renderer: function (value, meta) { if (value == '审核通过') { meta.tdCls = 'feestatus_pass'; } else if (value == '录入状态') { } else if (value == '提交审核') { meta.tdCls = 'feestatus_refer'; } else if (value == '部分结算') { meta.tdCls = 'feestatus_refer'; } else if (value == '结算完毕') { meta.tdCls = 'feestatus_settle'; } else if (value == '未录入') { } else if (value == '部分结算') { meta.tdCls = 'feestatus_settle'; } else if (value == '部分审核') { meta.tdCls = 'feestatus_pass'; } else if (value == '部分提交') { meta.tdCls = 'feestatus_refer'; } return value; } }, { sortable: true, id: '', dataIndex: 'CRFEESTATUS', header: '应付费用', //'应付费用', align: 'center', width: 60, renderer: function (value, meta) { if (value == '审核通过') { meta.tdCls = 'feestatus_pass'; } else if (value == '录入状态') { } else if (value == '提交审核') { meta.tdCls = 'feestatus_refer'; } else if (value == '部分结算') { meta.tdCls = 'feestatus_refer'; } else if (value == '结算完毕') { meta.tdCls = 'feestatus_settle'; } else if (value == '未录入') { } else if (value == '部分结算') { meta.tdCls = 'feestatus_settle'; } else if (value == '部分审核') { meta.tdCls = 'feestatus_pass'; } else if (value == '部分提交') { meta.tdCls = 'feestatus_refer'; } return value; } }, { sortable: true, dataIndex: 'RowNumber', header: '日序号', width: 60, align: 'center' }, { sortable: true, dataIndex: 'BillNo', header: '委托编号', width: 160 }, { sortable: true, dataIndex: 'MblNoSe', header: '提单号', width: 160 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'CargoID', header: '货物标识', width: 80 }, { sortable: true, dataIndex: 'GroupDate', header: '派车日期', width: 80 }, { sortable: true, dataIndex: 'ArriveDate', header: '装货日期', width: 80, renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s') // , // editor: { // xtype: 'datefield' // } }, { sortable: true, dataIndex: 'ReturnDate', header: '卸货日期', width: 80, renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s') // , // editor: { // xtype: 'datefield' // } }, { sortable: true, dataIndex: 'CustomerName', header: '客户名称(公司)', width: 80 // , // editor: this.comboxCustomerName }, { sortable: true, dataIndex: 'LinkMan', header: '客户联系人', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'CustName', header: '发货人', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'DispatchName', header: '收货人', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'F_CustomerName', header: '车队', width: 80 // , // editor: this.comboxTRUCKER }, { sortable: true, dataIndex: 'TruckNo', header: '车牌号', width: 80 // , // editor: this.comboxTruckNo }, { sortable: true, dataIndex: 'MblNo', header: 'Marstar业务号', width: 120 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'BsType', header: '业务类型', width: 110 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'DstArea', header: '到达地', width: 120 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'FactoryAddr', header: '卸货工厂', width: 120 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'DetiNation', header: '目的地址', width: 120 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'RtnDocStatus', header: '回单状态', width: 120, // editor: this.comboxBLTYPE, renderer: function (value) { if (value == "1") { return "已回单"; } else if (value == "0") { return "部分回单"; } else { return "未回单"; }; } }, { sortable: true, dataIndex: 'RtnDocTime', header: '回单时间', width: 120 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'ContainerQty', header: '件数', width: 80 // , // editor: { // xtype: 'numberfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'Ton', header: '重量', width: 80 // , // editor: { // xtype: 'numberfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'LoadCount', header: '体积', width: 80 // , // editor: { // xtype: 'numberfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'LoadPlace', header: '装货地址', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'TruckSpec', header: '车型', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'ContainerType', header: '箱型箱量', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'YardName', header: '提箱场站', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'CustLikeManName', header: '工厂联系人', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'INVOICENO', header: '发票号', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'KINDPKGS', header: '包装', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'CUSTNO', header: '运单号', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { sortable: true, dataIndex: 'IsDouble', header: '是否包车', width: 60, renderer: function (value) { if (value == "0") { return ""; } else if (value == "1") { return ""; } } }, { sortable: true, dataIndex: 'Property', header: '车辆类别', width: 80 // , // editor: { // xtype: 'textfield', // selectOnFocus: true // } }, { 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, dataIndex: 'ChangedReson', header: '注意事项', width: 160 , editor: { xtype: 'textfield', selectOnFocus: true } }, { sortable: true, dataIndex: 'PORTLOAD', header: '起运港', width: 160 , editor: { xtype: 'textfield', selectOnFocus: true } }, { sortable: true, dataIndex: 'GoodsName', header: '品名', width: 160 , editor: { xtype: 'textfield', selectOnFocus: true } }, { sortable: true, hidden: true, dataIndex: 'OrgName', header: '分公司', width: 80 }, { sortable: true, dataIndex: 'LrDate', header: '录入日期', width: 110 }, { sortable: true, dataIndex: 'VoyVeg', header: '船名航次', width: 110 }, { sortable: true, dataIndex: 'EtDate', header: '开船日期', width: 110 }, { sortable: true, dataIndex: 'EndPortDate', header: '截港日期', width: 110 }, { sortable: true, dataIndex: 'DESTINATION', header: '目的港', width: 110 }, { sortable: true, hidden: true, dataIndex: 'RefBillNo', header: 'RefBillNo', width: 110 }, { sortable: true, hidden: true, dataIndex: 'RefBillNose', header: 'RefBillNose', width: 110 } ]; this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.MainCB = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true }); Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, { width: 40 }); this.gridList = new Ext.grid.GridPanel({ store: this.storeList, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, selModel: this.MainCB, columns: this.column, viewConfig: { enableTextSelection: true, autoFill: true }, // plugins: [this.cellEditing], features: [{ id: 'group', ftype: 'grouping', groupHeaderTpl: '{name}', hideGroupedHeader: true, enableGroupingMenu: true }], bbar: Ext.create('Ext.PagingToolbar', { store: this.storeList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.SelectedRecord = record; this.OprationStatus = 'edit'; this.SelectedstoreList = this.storeList; this.SelectPGID = ''; DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/Edit'); }, this); this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) { if (record.data.BLTYPE == '派车主票') { this.SelectedRecord = record; var SelectGridtext = Ext.getCmp('SelectCustNo'); SelectGridtext.setText('所选主票:' + record.data.BillNo); var Selectid = Ext.getCmp('Selectid'); Selectid.setText(record.data.gId); this.fensql = " t.PGID='" + record.data.gId + "' AND t.GID<>'" + record.data.gId + "' "; this.storeListfen.load({ params: { start: 0, limit: this.PageSize, condition: this.fensql }, waitMsg: "正在查询数据...", scope: this }); this.storeListNofen.load({ params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) " }, waitMsg: "正在查询数据...", scope: this }); this.paneldetail.setVisible(true); } else { this.paneldetail.setVisible(false); } }, this); /////////////以下部分为获取存储的gridpanel显示样式 this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column); //使用者id,表名 ,中间column数组 this.column.unshift(new Ext.grid.RowNumberer()); this.gridList.reconfigure(this.storeList, this.column); //////////////////////////// ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// //#region formSearch //#region formSearch枚举参照相关 this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', { model: 'DsTruckMng.ux.FeeTypeRefModel', proxy: { url: '/CommMng/BasicDataRef/GetFeeTypeRefList' } }); this.storeFeeNameRef.load({ params: { condition: " ISTRUCKING='1' "} }); this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '不含此费用', store: this.storeFeeNameRef, name: 'FeeName', valueField: 'Name', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsTruckMng.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '客户', typeAhead: true, store: this.storeCustCode, name: 'CustName', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); // this.storeF_CustCode = Ext.create('DsExt.ux.RefTableStore', { // model: 'DsTruckMng.ux.CustomRefModel', // proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } // }); // this.storeF_CustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); // this.comboxF_CustCode = Ext.create('DsExt.ux.RefTableCombox', { // fieldLabel: '最终客户', // typeAhead: true, // store: this.storeF_CustCode, // name: 'F_CustName', // valueField: 'CustName', // displayField: 'CodeAndName' // }); Ext.define('PCSTATUSmd', { extend: 'Ext.data.Model', fields: [ { name: 'ID', type: 'string' }, { name: 'STATUSNAME', type: 'string' } ] }); var PCSTATUSData = [{ "ID": "0", "STATUSNAME": "接单" }, { "ID": "1", "STATUSNAME": "派车" }, { "ID": "2", "STATUSNAME": "完成"}]; this.storePCSTATUS = Ext.create('Ext.data.Store', { model: 'PCSTATUSmd', data: PCSTATUSData }); this.comboxPCSTATUS = Ext.create('Ext.ux.form.field.BoxSelect', { fieldLabel: '状态', autosize: true, bodyPadding: 5, // flex: 2, //width: 500, labelWidth: 85, store: this.storePCSTATUS, queryMode: 'local', triggerOnClick: false, valueField: 'ID', displayField: 'STATUSNAME', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.comboxTRUCKERQ = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeTRUCKER, fieldLabel: '车队', name: 'F_CustomerName', valueField: 'CustName', displayField: 'CodeAndName', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.StorePcBillType = Ext.create('DsExt.ux.RefEnumStore', {}); this.StorePcBillType.load({ params: { enumTypeId: 99046} }); this.comboxPcBillType = Ext.create('DsExt.ux.RefEnumCombox', { fieldLabel: '派车类型', store: this.StorePcBillType, name: 'PcBillType', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //#endregion this.formSearch = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 85, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: 'Marstar业务号', name: 'PS_MBLNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '运单号', name: 'CUSTNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '司机姓名', name: 'PS_DRVNAME', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '车牌', name: 'TruckNo', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '目的地/工厂', name: 'DstArea', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: '单据(路单)号', name: 'PS_BILLNO', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } } , this.comboxCustCode, { fieldLabel: '发/收货人', name: 'F_CustName', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } } , this.comboxPCSTATUS, { xtype: 'hiddenfield' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '从派车日期', format: 'Y-m-d', xtype: 'datefield', name: 'PS_EXPDATEBGN', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '到派车日期', format: 'Y-m-d', xtype: 'datefield', name: 'PS_EXPDATEEND', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxTRUCKERQ //, this.comboxFeeNameRef , this.comboxPcBillType, { xtype: 'hiddenfield' } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); //#endregion formSearch var menu1 = new Ext.menu.Menu({ id: 'basicMenu', items: [{ text: '批量设为完成', handler: clickEnd }, { text: '批量设为未完成', handler: clickNotEnd }] }); function clickEnd() { panelTest.SetEnd("1"); }; function clickNotEnd() { panelTest.SetEnd("0"); }; this.panelBtn = new Ext.Panel({ region: "north", tbar: [ { text: "新建", id: "btnadd", //hidden: true, iconCls: "btnadd", handler: function (button, event) { this.SelectedstoreList = this.storeList; this.OprationStatus = 'add'; this.SelectPGID = ''; DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/Edit'); // this.onAddPCClick(); }, scope: this }, { text: "删除", id: "btndelete", //hidden: true, iconCls: "btndelete", handler: function (button, event) { this.onDeleteClick(button, event); }, scope: this }, '-', { text: "回单", handler: function (button, event) { this.onHuiDanClick(button, event); }, scope: this }, { text: "执行查询", iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); }, scope: this }, { //xtype: 'button', //width: 90, text: "高级查询", iconCls: "btnmore", handler: function (button, event) { var sql = this.getCondition(); var winAccess = new Shipping.DsQuery({ }); winAccess.StoreList = this.storeList; winAccess.formname = this.formname; winAccess.condition = sql; winAccess.show(); return; }, scope: this }, { text: "导出Excel", id: "btnExportExcel", iconCls: 'btnexportexcel', handler: function (button, event) { this.onExportClick(button, event); }, scope: this }, '-', /*{ id: "btnFeeAuditReject", text: '驳回提交费用业务', tooltip: '驳回提交费用业务', iconCls: "btnrefuse", handler: function (button, event) { this.onAuditRefuseClick(button, event); }, scope: this },*/ {text: "批量设置完成", menu: menu1, scope: this }, { text: "保存列表样式", id: "btntest", handler: function (button, event) { var formname = this.formname; var tempcolumns = this.gridList.columns; DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column, 0, false); }, scope: this }, { text: '复制数据', tooltip: '复制', iconCls: "btnadd", handler: function (button, event) { this.onCopyClipClick(); }, scope: this }, // { // text: "保存修改", id: "SaveBtn", // iconCls: "btnsave", // handler: function (button, event) { // this.onSaveClick(button, event); // }, // scope: this // }, '-', { text: "业务信息", iconCls: "btnrefresh", handler: function (button, event) { this.onBsViewClick(button, event); }, scope: this }, '-', { text: "打印派车单", iconCls: "btnprint", handler: function (button, event) { this.Print(); }, scope: this }, '-', { text: '其他操作', //"拼箱操作", menu: [ { text: "批量费用提交", //"批量费用提交", handler: function (menu, event) { _this.onPiLiangSubmitClick(menu, event, 1); } }], scope: this } // , '-', // { // text: "派车通知", // iconCls: "btnrefresh", // handler: function (button, event) { // this.onBsTruckViewClick(button, event); // }, // scope: this // } //,this.CB_EditMode ] }); //#region 分票列表 this.storeListfen = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'PCmb', remoteSort: true, proxy: { type: 'ajax', url: '/TruckMng/PcHeadEdit_WFSD/GetDataFenList', reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); this.MainCBFen = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true }); this.cellEditingfen = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.gridListFen = new Ext.grid.GridPanel({ store: this.storeListfen, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, selModel: this.MainCBFen, // plugins: [this.cellEditingfen], columns: this.column, tbar: [{ text: '添加分票', tooltip: '添加分票', iconCls: "btnadd", handler: function (button, event) { this.SelectedstoreList = this.storeListfen; this.OprationStatus = 'add'; var Selectid = Ext.getCmp('Selectid'); this.SelectPGID = Selectid.text; DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/Edit'); // this.onAddPCClick(button, event, 1); }, scope: this }, // '-', { // text: '保存分票', // tooltip: '保存分票', // iconCls: "btnsave", // handler: function (button, event) { // this.onSaveClick(button, event, 1); // }, // scope: this // }, '-', { text: '删除分票', tooltip: '删除分票', iconCls: "btndelete", handler: function (button, event) { this.onDeleteClick(button, event, 1); }, scope: this }, '-', { text: "回单", handler: function (button, event) { this.onHuiDanClick(button, event,1); }, scope: this }, { text: '取消分配', tooltip: '取消分配', iconCls: "btncancel", handler: function (button, event) { this.SetPGID(button, event, 1); }, scope: this }, '-', { text: "打印派车单", iconCls: "btnprint", handler: function (button, event) { this.PrintFen(); }, scope: this }, '-', { xtype: 'label', id: 'SelectCustNo', text: '所选主票' }, { xtype: 'label', width: 220, id: 'Selectid', hidden: true, text: '' }], plugins: [this.cellEditingfen], bbar: Ext.create('Ext.PagingToolbar', { store: this.storeListfen, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.gridListFen.addListener('itemdblclick', function (dataview, record, item, index, e, b) { this.SelectedRecord = record; this.OprationStatus = 'edit'; this.SelectedstoreList = this.storeListfen; var Selectid = Ext.getCmp('Selectid'); this.SelectPGID = Selectid.text; DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/Edit'); // DsOpenEditWin('/TruckMng/PcHeadEdit_WFSD/FeeEdit'); }, this); this.storeListNofen = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'PCmb', remoteSort: true, proxy: { type: 'ajax', url: '/TruckMng/PcHeadEdit_WFSD/GetDataList', reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); this.MainCBNoFen = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true }); this.cellEditingnofen = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.gridListNoFen = new Ext.grid.GridPanel({ store: this.storeListNofen, enableHdMenu: false, region: 'center', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, selModel: this.MainCBNoFen, columns: this.column, tbar: [ { xtype: 'textfield', fieldLabel: '委托编号', name: 'BillNo', enableKeyEvents: true, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.storeListNofen.load({ params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) and t.BillNo like '%" + field.value+ "%'" }, waitMsg: "正在查询数据...", scope: this }); } } } } , { text: '添加至主票', tooltip: '添加至主票', iconCls: "btnadd", handler: function (button, event) { this.SetPGID(button, event, 2); }, scope: this }], bbar: Ext.create('Ext.PagingToolbar', { store: this.storeListNofen, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); this.panelfen = new Ext.Panel({ title: '派车分票', layout: "border", region: 'north', height: 280, items: [ this.gridListFen ] }); // this.formSearchnofen = Ext.widget('form', { // region: 'north', // bodyPadding: 5, // height:20, // fieldDefaults: { // margins: '2 2 2 2', // labelAlign: 'right', // flex: 1, // labelWidth: 85, // msgTarget: 'qtip' // }, // items: [ // {//fieldset 1 // xtype: 'container', // defaultType: 'textfield', // layout: 'anchor', // defaults: { // anchor: '100%' // }, // items: [{ // xtype: 'container', // layout: 'hbox', // defaultType: 'textfield', // items: [ {xtype: 'textfield', // fieldLabel: '委托编号', // name: 'PS_CUSTNO', // enableKeyEvents: true, // listeners: { // specialkey: function (field, e) { // if (e.getKey() == e.ENTER) { // _this.storeListNofen.load({ // params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) and t.BillNo like '%"++"%'" }, // waitMsg: "正在查询数据...", // scope: this // }); // } // } // } //] // } // ]//end items(fieldset 1) // }//end fieldset 1 // ]//end root items // }); this.panelnofen = new Ext.Panel({ title: '未分配派车分票', layout: "border", region: "center", items: [ this.gridListNoFen ] }); this.paneldetail = new Ext.Panel({ layout: "border", region: 'east', hidden: true, split: true, width: 600, items: [this.panelfen, this.panelnofen] }); this.panelgrid = new Ext.Panel({ layout: "border", region: "center", items: [ this.gridList ] }); // this.panelcenter = new Ext.Panel({ // layout: "border", // region: 'center', // items: [this.gridList, this.paneldetail] // }); // //#endregion this.panelTop = new Ext.Panel({ layout: "border", region: "north", height: 125, items: [this.formSearch, this.panelBtn] }); Ext.apply(this, { items: [this.panelTop, this.panelgrid, this.paneldetail] }); ///以下集中绑定事件 this.storeList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql }); }, this); this.storeListfen.on('beforeload', function (store) { Ext.apply(store.proxy.extraParams, { condition: this.fensql }); }, this); this.storeListNofen.on('beforeload', function (store) { Ext.apply(store.proxy.extraParams, { condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) " }); }, this); this.gridList.on('edit', function (editor, e, eOpts) { this.PCAfterEdit(editor, e, eOpts); }, this); this.gridListFen.on('edit', function (editor, e, eOpts) { this.PCAfterEdit(editor, e, eOpts); }, this); this.gridListNoFen.on('edit', function (editor, e, eOpts) { this.PCAfterEdit(editor, e, eOpts); }, this); this.cellEditing.on('beforeedit', function (editor, e) { return this.PCBeforeEdit(editor, e); }, this); this.LoadInitData(); this.formCopyStrShow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 80, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ xtype: 'textareafield', grow: true, height: 180, id: 'COPYSTR', name: 'COPYSTR', anchor: '100%' } ]//end items(fieldset 1) } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); this.winCopyStrShow = Ext.create('Ext.window.Window', { title: "复制", //"发送预配舱单", width: 450, //height : 120, //plain : true, iconCls: "addicon", resizable: false, // 是否可以拖动 // draggable:false, collapsible: true, // 允许缩放条 closeAction: 'close', closable: true, modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", items: [this.formCopyStrShow], buttons: [{ text: "关闭", //"关闭", minWidth: 70, handler: function () { _this.winCopyStrShow.close(); } }] }); this.storeRtnDocStatus = Ext.create('Ext.data.Store', { fields: ['FSTATUS', 'NAME'] }); this.storeRtnDocStatus.add({ "FSTATUS": "", "NAME": "未回单" }); this.storeRtnDocStatus.add({ "FSTATUS": "0", "NAME": "部分回单" }); this.storeRtnDocStatus.add({ "FSTATUS": "1", "NAME": "已回单" }); this.comboxRtnDocStatus = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '回单状态', //是否开垫付 store: this.storeRtnDocStatus, valueField: 'FSTATUS', displayField: 'NAME', forceSelection: true, name: 'RtnDocStatus', value: '1', enableKeyEvents: true, listeners: { keyup: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.formCreateRtnDocStatusShow = Ext.widget('form', { frame: true, region: 'center', bodyPadding: 5, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 85, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxRtnDocStatus ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '回单时间', format: 'Y-m-d', xtype: 'datetimefield', name: 'RtnDocTime' } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); me = this; this.winRtnDocStatusShow = Ext.create('Ext.window.Window', { title: "回单/取消回单", width: 320, //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.formCreateRtnDocStatusShow], buttons: [{ text: "确认", minWidth: 70, handler: function () { var form = me.formCreateRtnDocStatusShow.getForm(); var data = form.getValues(); if (data.RtnDocStatus == '1') { if (data.RtnDocTime == '') { Ext.Msg.show({ title: '提示', msg: '回单日期不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } } else { data.RtnDocTime = ''; } me.onHuiDanfn(data) } }, { text: "关闭", minWidth: 70, handler: function () { me.winRtnDocStatusShow.close(); } }] }); }, //end initUIComponents LoadInitData: function () { //this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} }); var sql = " (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) and (datediff(month,ExpDate,getdate())=0 or ExpDate is null or ExpDate='1900-01-01 00:00:00.000' ) "; this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); }, onAuditRefuseClick: function (button, event) { var sql = " A.GID in (select bsno from ch_fee where FEESTATUS=6)"; this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); }, onRefreshClick: function (button, event) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); this.sqlcontext = sql; this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); this.storeListNofen.load({ params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) " }, waitMsg: "正在查询数据...", scope: this }); //} }, onDsQuery: function (button, event) { var sql=this.sqlcontext; this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); this.storeListNofen.load({ params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) " }, waitMsg: "正在查询数据...", scope: this }); //} }, onDeleteClick: function (button, event, type) { if (type == 1) { var selections = this.gridListFen.getSelectionModel().getSelection(); } else 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]; Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) { if (btn == 'yes') { Ext.Msg.wait('正在删除数据...'); Ext.Ajax.request({ waitMsg: '正在删除数据...', url: '/TruckMng/MsWlPc/Delete', params: { data: Ext.JSON.encode(record.data) }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { if (type == 1) this.storeListfen.remove(record); else this.storeList.remove(record); 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 onBsViewClick: 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]; if (record.data.RefBillNo == '') { Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } var oplb = record.data.MblNoSe; var bsno = record.data.RefBillNo; var openSet = "height=1000, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; if (oplb == '海运出口') { openUrl = "../MvcShipping/MsOpSeae/EditView?handle=check&bsno=" + bsno; window.open(openUrl, openType, openSet); } else if (oplb == '海运进口') { openUrl = "../MvcShipping/MsOpSeai/EditView?handle=check&bsno=" + bsno; window.open(openUrl, openType, openSet); } else if (oplb == '空运出口') { openUrl = "../MvcShipping/MsOpAire/EditView?handle=check&bsno=" + bsno; window.open(openUrl, openType, openSet); } else if (oplb == '空运进口') { openUrl = "../MvcShipping/MsOpAiri/EditView?handle=check&bsno=" + bsno; window.open(openUrl, openType, openSet); } }, onBsTruckViewClick: 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]; if (record.data.RefBillNo == '') { Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } var oplb = record.data.MblNoSe; var bsno = record.data.RefBillNo; var le_id = record.data.RefBillNose; var openSet = "height=600, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; openUrl = "../MvcShipping/MsOpLetter/TruckView?handle=check&bsno=" + bsno + "&oplb=" + oplb + "&le_id=" + le_id; window.open(openUrl, openType, openSet); }, onHuiDanClick: function (button, event, type) { if (type == 1) { var selections = this.gridListFen.getSelectionModel().getSelection(); this.selectstorelist = this.storeListfen; } else { var selections = this.gridList.getSelectionModel().getSelection(); this.selectstorelist = this.storeList; } if (selections.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } this.selections = selections; var myDate = new Date(); var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d H:i:s'); this.formCreateRtnDocStatusShow.getForm().findField('RtnDocTime').setRawValue(); this.winRtnDocStatusShow.show(); }, //onDeleteClick onHuiDanfn: function (data) { var bodyAddDatas = []; var selections =this.selections; for (var i = 0; i < selections.length; i++) { var rec = selections[i]; bodyAddDatas.push(rec); } var jsonBody = ConvertRecordsToJsonAll(bodyAddDatas); Ext.Msg.wait('正在更新数据...'); Ext.Ajax.request({ waitMsg: '正在更新数据...', url: '/TruckMng/PcHeadEdit_WFSD/HuiDan', params: { data: Ext.JSON.encode(data), jsonBody: jsonBody }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { this.selectstorelist.reload(); Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); this.winRtnDocStatusShow.close(); } 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 }); }, getCondition: function () { var form = this.formSearch.getForm(); // var sql = " t.PcBillType=1 "; // var sql = " (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) "; // var sql = " (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) "; var sql = ""; /* var sqldata = form.getValues(); sql = Ext.JSON.encode(sqldata); */ var mblNo = form.findField('PS_MBLNO').getValue(); sql = sql + getAndConSql(sql, mblNo, " (MblNo like '%" + mblNo + "%' or MBLNOse like '%" + mblNo + "%') "); var drvName = form.findField('PS_DRVNAME').getValue(); sql = sql + getAndConSql(sql, drvName, " (DrvName like '%" + drvName + "%' or TruckNo='" + drvName + "') "); var DstArea = form.findField('DstArea').getValue(); sql = sql + getAndConSql(sql, DstArea, " (DstArea like '%" + DstArea + "%' or DetiNation like '%" + DstArea + "%') "); // var VoyVeg = form.findField('VoyVeg').getValue(); // sql = sql + getAndConSql(sql, VoyVeg, " (VoyVeg like '%" + VoyVeg + "%' ) "); var pcBillNo = form.findField('PS_BILLNO').getValue(); sql = sql + getAndConSql(sql, pcBillNo, " BillNo like '%" + pcBillNo + "%'"); var CUSTNO = form.findField('CUSTNO').getValue(); sql = sql + getAndConSql(sql, CUSTNO, " CUSTNO like '%" + CUSTNO + "%'"); // var billNo = form.findField('PS_REFBILLNO').getValue(); // sql = sql + getAndConSql(sql, billNo, " (RefBillNo like '%" + billNo + "%' or RefBillNose like '%" + billNo + "%')"); var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue(); sql = sql + getAndConSql(sql, expDate_Min, " ExpDate>='" + expDate_Min + "'"); var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue(); sql = sql + getAndConSql(sql, expDate_Max, " ExpDate<='" + expDate_Max + " 23:59:59'"); // var orgCode = form.findField('OrgCode').getValue(); // sql = sql + getAndConSql(sql, orgCode, "OrgCode like '%" + orgCode + "%'"); var CustName = form.findField('CustName').getValue(); sql = sql + getAndConSql(sql, CustName, " customername like '%" + CustName + "%' "); var F_CustName = form.findField('F_CustName').getValue(); sql = sql + getAndConSql(sql, F_CustName, " (CustName like '%" + F_CustName + "%' or DispatchName like '%" + F_CustName + "%')"); var F_CustomerName = form.findField('F_CustomerName').getValue(); sql = sql + getAndConSql(sql, F_CustomerName, " F_CustomerName like '%" + F_CustomerName + "%' "); var PcBillType = form.findField('PcBillType').getValue(); sql = sql + getAndConSql(sql, PcBillType, " PcBillType='" + PcBillType + "' "); /* var FEENAME = form.findField('FeeName').getValue(); sql = sql + getAndConSql(sql, FEENAME, " GID not in( select distinct BSNO from ch_fee where feename='" + FEENAME + "')"); */ var PCSTATUS = this.comboxPCSTATUS.getValue(); if (PCSTATUS != "") { //sql = sql + getAndConSql(sql, Mainstate, "m.Mainstate in (" + Mainstate + ")"); //alert(PCSTATUS); if (PCSTATUS == "0") { sql = sql + getAndConSql(sql, PCSTATUS, "TruckNo=''"); } if (PCSTATUS == "1") { sql = sql + getAndConSql(sql, PCSTATUS, "(TruckNo<>'' and isend=0)"); } if (PCSTATUS == "2") { sql = sql + getAndConSql(sql, PCSTATUS, "isend=1"); } if (PCSTATUS == "0,1") { sql = sql + getAndConSql(sql, PCSTATUS, "isend=0"); } if (PCSTATUS == "1,2") { sql = sql + getAndConSql(sql, PCSTATUS, "TruckNo<>''"); } if (PCSTATUS == "0,2") { sql = sql + getAndConSql(sql, PCSTATUS, "(TruckNo='' or isend=1)"); } } return sql; }, checkSearchCondition: function () { var form = this.formSearch.getForm(); if (!form.isValid()) { Ext.Msg.alert('提示', '查询条件赋值错误,请检查。'); return false; } return true; }, OprationSwap: function () { var ret = new Array(); ret[0] = this.OprationStatus; ret[1] = this.SelectedstoreList; ret[2] = this.SelectedRecord; ret[3] = this.SelectPGID; ret[4] = 'tMsWlPcHead'; ret[5] = this.storePLList; return ret; }, onExportClick: function (button, event) { GridExportExcelPage(this.gridList); }, SetEnd: function (isEnd) { selectedRecords = this.gridList.selModel.getSelection(); var GIDList = ""; var needalert = false; for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (rec.get('TruckNo') != "") { if (GIDList == "") { GIDList = "'" + rec.get('gId') + "'"; } else { GIDList = GIDList + ",'" + rec.get('gId') + "'"; } } else { needalert = true; } } if (needalert == true) { alert("不能将接单状态的业务设置为完成"); } if (GIDList == "") { return; } Ext.Ajax.request({ waitMsg: '正在查询数据...', url: '/TruckMng/MsWlPc/SetEnd', async: false, params: { GIDList: GIDList, isEnd: isEnd }, 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; } var _count = result.data; this.onRefreshClick(); if (needalert == true) { alert("注意,未派车(未选择车号)的业务不能设置为完成。"); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); //request over }, SetPGID: function (button, event, type) { if (type == 1) { var selectedRecords = this.gridListFen.selModel.getSelection(); var pgid = ''; } else { var selectedRecords = this.gridListNoFen.selModel.getSelection(); var Selectid = Ext.getCmp('Selectid'); var pgid = Selectid.text; } var GIDList = ""; for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (GIDList == "") { GIDList = "'" + rec.get('gId') + "'"; } else { GIDList = GIDList + ",'" + rec.get('gId') + "'"; } } if (GIDList == "") { return; } Ext.Ajax.request({ waitMsg: '正在查询数据...', url: '/TruckMng/MsWlPc/SetPGID', async: false, params: { GIDList: GIDList, PGID: pgid }, 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; } var _count = result.data; this.storeListfen.load({ params: { start: 0, limit: this.PageSize, condition: this.fensql }, waitMsg: "正在查询数据...", scope: this }); this.onRefreshClick(); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); //request over }, onSaveClick: function (button, event, type) { var bodyList = []; if (type == 1) { for (i = 0; i < this.storeListfen.getCount(); i += 1) { var member = this.storeListfen.getAt(i); bodyList.push(member); }; } else { for (i = 0; i < this.storeList.getCount(); i += 1) { var member = this.storeList.getAt(i); bodyList.push(member); }; } var jsonBody = ConvertRecordsToJson(bodyList); if (jsonBody == '') { return; } Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/TruckMng/PcHeadEdit_WFSD/SaveWFSDList', scope: this, params: { data: jsonBody }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { //this.storeEditList.commitChanges(); if (type == 1) { this.storeListfen.load({ params: { start: 0, limit: this.PageSize, condition: this.fensql }, waitMsg: "正在查询数据...", scope: this }); this.onRefreshClick(); } else { this.onRefreshClick(); } } 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 }); } //alert('03'); } }); } , onAddPCClick: function (button, event, type) { if (type == 1) { var Selectid = Ext.getCmp('Selectid'); var pgid = Selectid.text; var record = Ext.create('PCmb', { 'PcBillType': '1', 'PcBillTypeREF': '散货派车单', 'gId': '', 'PGid': pgid, 'RowNumber': '', 'BillNo': '', 'ExpDate': '', 'GroupDate': '', 'ArriveDate': '', 'ReturnDate': '', 'CustomerNam': '', 'F_CustomerName': '', 'LinkMan': '', 'DrvName': '', 'TruckNo': '', 'MblNo': '', 'DstArea': '', 'DetiNation': '', 'ContainerQty': '0', 'Ton': '0', 'LoadCount': '0', 'LoadPlace': '', 'TruckSpec': '', 'IsDouble': '', 'Property': '', 'BsType': '海运出口', 'BLTYPE': '派车分票', 'YUNFEI': '', 'HCHJ': '', 'ZXF': '', 'DDF': '', 'QTFee': '', 'TotalFee': '', 'Remark': '', 'timeMark': '0', 'RoadFee': '0', 'UserCode': usercode, 'UserName': SHOWNAME, 'OrgName': '', 'LrDate': '', }); this.storeListfen.add(record); var n = this.storeListfen.getCount(); this.cellEditingfen.startEditByPosition({ row: n - 1, column: 2 }); } else { var record = Ext.create('PCmb', { 'PcBillType': '1', 'PcBillTypeREF': '散货派车单', 'gId': '', 'RowNumber': '', 'BillNo': '', 'ExpDate': '', 'GroupDate': '', 'ArriveDate': '', 'ReturnDate': '', 'CustomerNam': '', 'F_CustomerName': '', 'LinkMan': '', 'DrvName': '', 'TruckNo': '', 'MblNo': '', 'DstArea': '', 'DetiNation': '', 'ContainerQty': '0', 'Ton': '0', 'LoadCount': '0', 'LoadPlace': '', 'TruckSpec': '', 'IsDouble': '', 'Property': '', 'BsType': '海运出口', 'BLTYPE': '派车单票', 'YUNFEI': '', 'HCHJ': '', 'ZXF': '', 'DDF': '', 'QTFee': '', 'TotalFee': '', 'Remark': '', 'timeMark': '0', 'RoadFee': '0', 'UserCode': usercode, 'UserName': SHOWNAME, 'OrgName': '', 'LrDate': '' }); this.storeList.add(record); var n = this.storeList.getCount(); this.cellEditing.startEditByPosition({ row: n - 1, column: 2 }); } } , PCAfterEdit: function (editor, e, eOpts) { //if (e.value == e.originalValue) { return; } if (e.field == 'ContainerType') {//箱号 var CTNrecords = DsStoreQueryBy(this.storeContainerType, 'CtnCode', e.value); if (CTNrecords.getCount() > 0) { var CTNdata = CTNrecords.getAt(0).data; e.record.set('ContainerType_Ref', CTNdata.CtnName); } else { e.record.set('ContainerType_Ref', ''); } } if (e.field == 'YardCode') { var Yardrecords = DsStoreQueryBy(this.storeYardCode, 'CustCode', e.value); if (Yardrecords.getCount() > 0) { var Yarddata = Yardrecords.getAt(0).data; e.record.set('YardCode_Ref', Yarddata.CodeAndName); } else { e.record.set('YardCode_Ref', ''); } } if (e.field == 'RtnYardCode') { var Yardrecords = DsStoreQueryBy(this.storeRtnYardCode, 'CustCode', e.value); if (Yardrecords.getCount() > 0) { var Yarddata = Yardrecords.getAt(0).data; e.record.set('RtnYardCode_Ref', Yarddata.CodeAndName); } else { e.record.set('RtnYardCode_Ref', ''); } } if (e.field == 'DrvName') { /* var Yardrecords = DsStoreQueryBy(this.storeRtnYardCode, 'CustCode', e.value); if (Yardrecords.getCount() > 0) { var Yarddata = Yardrecords.getAt(0).data; e.record.set('RtnYardCode_Ref', Yarddata.CodeAndName); } else { e.record.set('RtnYardCode_Ref', ''); }*/ } if (e.field == 'TruckNo') { var _datas = DsStoreQueryBy(this.storeTruckNo, 'TruckNo', e.value); if (_datas.getCount() > 0) { var _t = _datas.getAt(0).data; e.record.set('DrvName', _t.DrvName); e.record.set('Mobile', _t.Mobile); } else { e.record.set('DrvName', ""); e.record.set('Mobile', ""); } } if (e.field == 'F_CustomerName') { var _datas = DsStoreQueryBy(this.storeF_CustomerName, 'name', e.value); if (_datas.getCount() > 0) { var _t = _datas.getAt(0).data; e.record.set('DetiNation', _t.ADDR); } else { e.record.set('DrvName', ""); } } } , PCBeforeEdit: function (editor, e, eOpts) { if (e.field == 'TruckNo') {//箱号 this.SetTruckNo(); } } , //#region 复制 onCopyClipClick: function (button, event) { var selections = this.gridList.getSelectionModel().getSelection(); if (selections.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); return; } var clipstr = ""; var sError = ""; for (var i = 0; i < selections.length; i++) { var record = selections[i]; clipstr = clipstr + '\r\n' + " 流水号:" + record.data.BillNo; clipstr = clipstr + '\r\n' + " 提单号:" + record.data.MblNoSe; clipstr = clipstr + '\r\n' + " 装货时间:" + record.data.ArriveDate; clipstr = clipstr + '\r\n' + " 装货地址:" + record.data.LoadPlace; clipstr = clipstr + '\r\n' + " 箱型箱量:" + record.data.ContainerType; clipstr = clipstr + '\r\n' + " 货重:" + record.data.Ton; } Ext.getCmp('COPYSTR').setValue(clipstr); this.winCopyStrShow.show(); }, //#endregion SetTruckNo: function () { var TruckNoList = ""; for (i = 0; i < this.storeList.getCount(); i += 1) { var member = this.storeList.getAt(i); if (member.data.PCSTATUSREF != "完成" && member.data.TruckNo != "") { if (TruckNoList == "") { TruckNoList = "('" + member.data.TruckNo + "'"; } else { TruckNoList = TruckNoList + ",'" + member.data.TruckNo + "'"; } } }; if (TruckNoList != "") { TruckNoList = TruckNoList + ")"; this.storeTruckNo.load({ params: { condition: " and A.truckno not in " + TruckNoList} }); } else { //this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} }); } }, onPiLiangSubmitClick: function (menu, event, type) { var selectedRecords = this.gridList.selModel.getSelection(); this.storePLList.removeAll(); for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; var record = Ext.create('MsOpBill', { 'BSNO': rec.data.gId, 'PARENTID': rec.data.gId, 'BSSTATUS': rec.data.BillStatus, 'FEESTATUS': rec.data.FEESTATUS, 'BSSTATUSREF': '未锁定', 'FEESTATUSREF': rec.data.FEESTATUS, 'BSSOURCE': '', 'BSSOURCEDETAIL': '', 'ACCDATE': rec.data.ACCDATE, 'OPLB': 'tMsWlPcHead', 'OPTYPE': '普通货', 'OPLBNAME': '陆运派车单', 'MBLNO': rec.data.MblNo, 'HBLNO': '', 'CUSTNO': rec.data.BillNo, 'CUSTOMERNAME': rec.data.CustomerName, 'ETD': rec.data.ExpDate, 'PORTLOAD': rec.data.LoadPlace, 'PORTDISCHARGE': rec.data.DetiNation }); this.storePLList.add(record); } if (this.storePLList.getCount()==0) { Ext.Msg.show({ title:'提示', msg:'没有要提交的业务', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } else { window.open('/Account/Chfee_Audit/PiLiangSubmit', "PILIANGSUBMIT", 'width=1200,height=600,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes'); } }, //#region 打印 Print: function () { 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 bsNo = record.data.RefBillNo; if (record.data.RefBillNo == '') { //Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); //return; bsNo='111' } var oplb = record.data.MblNoSe; var le_id = record.data.RefBillNose; var billNo = record.data.BillNo; var printType = 'MSOPLETTERTRUCKLS'; if (oplb == "海运进口") { printType = 'MSOPLETTERTRUCKSEAILS' } else if (oplb == "空运进口") { printType = 'MSOPLETTERTRUCKAIRILS' } else if (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); }, PrintFen: function () { var selections = this.gridListFen.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 bsNo = record.data.RefBillNo; if (record.data.RefBillNo == '') { //Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); //return; bsNo = '111' } var oplb = record.data.MblNoSe; var le_id = record.data.RefBillNose; var billNo = record.data.BillNo; var printType = 'MSOPLETTERTRUCKLS'; if (oplb == "海运进口") { printType = 'MSOPLETTERTRUCKSEAILS' } else if (oplb == "空运进口") { printType = 'MSOPLETTERTRUCKAIRILS' } else if (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); } // #endregion });