//集运管理-路单查询 Ext.namespace('Shipping'); Shipping.WMSDetailIndex = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.WMSDetailIndex.superclass.constructor.call(this); }; Ext.extend(Shipping.WMSDetailIndex, Ext.Panel, { PageSize: 2000, OprationStatus: null, //仅当弹出界面时使用 SelectedRecord: null, initUIComponents: function () { this.formname = "WMSDetailForm"; Ext.define('WMSDetailmb', { extend: 'Ext.data.Model', idProperty: '', fields: [ { name: 'NID', type: 'string' }, { name: 'BLNO', type: 'string' }, { name: 'CUSTOMNO', type: 'string' }, { name: 'CUSTOMERNAME', type: 'string' }, { name: 'STORAGENAME', type: 'string' }, { name: 'GOODSNAME', type: 'string' }, { name: 'GOODSSTANDARD', type: 'string' }, { name: 'GOODSMODEL', type: 'string' }, { name: 'WMSNO', type: 'string' }, { name: 'OUTBSNO_OUT', type: 'string' }, { name: 'BSNO_OUT', type: 'string' }, { name: 'WMSDATE', type: 'string' }, { name: 'DODATE_OUT', type: 'string' }, { name: 'GOODSRKSL', type: 'float' }, { name: 'GOODSRKSLACTUAL', type: 'float' }, { name: 'GOODSPFSL_OUT', type: 'float' }, { name: 'GOODSSTOCK', type: 'float' }, { name: 'CHARGEUNIT', type: 'string' }, { name: 'GOODSOUTFEE_OUT', type: 'float' }, { name: 'GOODSOUTFEEAP_OUT', type: 'float' }, { name: 'ARFEE', type: 'float' }, { name: 'APFEE', type: 'float' }, { name: 'ARFEE_OUT', type: 'float' }, { name: 'APFEE_OUT', type: 'float' }, { name: 'FREESTORAGEPERIOD', type: 'string' }, { name: 'CONTRACTNO', type: 'string' }, { name: 'GOODSPACK', type: 'float' }, { name: 'GOODSPACKSTOCK', type: 'float' }, { name: 'GOODSPACKPFSL_OUT', type: 'float' }, { name: 'TRUCKNO_OUT', type: 'string' }, { name: 'REMARK_OUT', type: 'string' }, { name: 'MODIFIEDUSER', type: 'string' }, { name: 'MODIFIEDTIME', type: 'string' }, { name: 'CREATEUSER_OUT', type: 'string' }, { name: 'CREATETIME_OUT', type: 'string' }, { name: 'CNTRNO', type: 'string' }, { name: 'PICIHAO', type: 'string' }, { name: 'AREACODE', type: 'string' },//20180916 库位编码 { name: 'AREACODE_OUT', type: 'string' }, { name: 'PRODDATE', type: 'string' }, { name: 'FACTORYNO', type: 'string' }, { name: 'WMSINREMARK', type: 'string' }, { name: 'BUZTYPEREF', type: 'string' }, { name: 'PORTREF', type: 'string' }, { name: 'IMPORTCOUNTRY', type: 'string' }, { name: 'COMPANYNAME', type: 'string' }, { name: 'AREANAME', type: 'string' }, { name: 'TRAYNO', type: 'string' }, { name: 'GOODSRKSL_INDETAIL', type: 'float' }, { name: 'GOODSPACK_INDETAIL', type: 'float' }, { name: 'GOODSKGS', type: 'float' } ] }); Ext.define('Tradermb', { extend: 'Ext.data.Model', idProperty: 'gid', fields: [ { name: 'gid', type: 'string' }, { name: 'name', type: 'string' }, { name: 'codename', type: 'string' } ] }); //#region 定义数据集 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' }); Ext.define('ISCHANGEmb', { extend: 'Ext.data.Model', fields: [ { name: 'Name', type: 'string' } ] }); var ISCHANGEData = [{ "Name": "全部" }, { "Name": "不含货转" }, { "Name": "只包括货转"}]; var storeISCHANGE = Ext.create('Ext.data.Store', { model: 'ISCHANGEmb', data: ISCHANGEData }); this.comboxISCHANGE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '是否包括货转', forceSelection: true, store: storeISCHANGE, name: 'ISCHANGE', valueField: 'Name', displayField: 'Name', values: '全部', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); this.storeCustWmsCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustWmsCode.load({ params: { condition: "ISWAREHOUSE='1'" } }); this.comboxCustWmsCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '仓库名称', store: this.storeCustWmsCode, forceSelection: true, id: 'STORAGENAME', name: 'STORAGENAME', valueField: 'CustName', displayField: 'CodeAndName', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //用证公司,暂时还没用,鑫鹏威需要添加此选项 this.storeCompany = Ext.create('DsExt.ux.RefTableStore', { model: 'companymb', proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' } }); this.storeCompany.load({ params: { condition: "" } }); this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '用证公司', store: this.storeCompany, name: 'company', valueField: 'gid', displayField: 'name', //flex:3, listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }); //#endregion ///////////////////////////////////////// //#region 列表数据 this.storeList = Ext.create('Ext.data.Store', { pageSize: this.PageSize, model: 'WMSDetailmb', remoteSort: true, groupField: 'CUSTOMERNAME', proxy: { type: 'ajax', //url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL', url: '/MvcShipping/WMSDetail/GetDataList', //this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL'; reader: { id: '', root: 'data', totalProperty: 'totalCount' } } }); var _this = this; this.column = [ { sortable: true, hidden: true, dataIndex: 'NID', header: 'NID', width: 80 }, { sortable: true, dataIndex: 'BLNO', header: '提单号', width: 80 }, { sortable: true, dataIndex: 'CNTRNO', header: '箱号', width: 80 }, { sortable: true, dataIndex: 'CUSTOMNO', header: '备案清单号', width: 80 }, { sortable: true, dataIndex: 'CONTRACTNO', header: '合同号', width: 80 }, { sortable: true, dataIndex: 'CUSTOMERNAME', header: '货主', width: 80 }, { sortable: true, dataIndex: 'STORAGENAME', header: '仓库名称', width: 80 }, { sortable: true, dataIndex: 'GOODSNAME', header: '品名', width: 80 }, { sortable: true, dataIndex: 'GOODSSTANDARD', header: '型号/牌号', width: 80 }, { sortable: true, dataIndex: 'GOODSMODEL', header: '规格/牌号', width: 80 }, { sortable: true, dataIndex: 'WMSNO', header: '入库单号', width: 80 }, { sortable: true, dataIndex: 'OUTBSNO_OUT', header: '出库单号', width: 80 }, { sortable: true, dataIndex: 'BSNO_OUT', header: '出库明细单号', width: 80 }, { sortable: true, dataIndex: 'WMSDATE', header: '入库日期', width: 80 }, { sortable: true, dataIndex: 'DODATE_OUT', header: '出库日期', width: 80 }, { sortable: true, dataIndex: 'GOODSRKSL', header: '入库量', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.00; var existBlno = ''; for (var i = 0; i < dataArr.length; i++) { if (existBlno.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existBlno += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSRKSL); } } return temp; } }, { sortable: true, dataIndex: 'GOODSRKSL_INDETAIL', header: '入库量_明细', width: 80, summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; } }, { sortable: true, dataIndex: 'GOODSPACK_INDETAIL', header: '总件数_明细', width: 80, summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; } }, { sortable: true, dataIndex: 'GOODSKGS', header: '重量_明细', width: 80, summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; } }, { sortable: true, dataIndex: 'GOODSRKSLACTUAL', header: '实际入库量', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.00; var existBlno = ''; for (var i = 0; i < dataArr.length; i++) { if (existBlno.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existBlno += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL); } } return temp; } }, { sortable: true, dataIndex: 'GOODSPFSL_OUT', header: '出库量', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.00; var existBlno = ''; for (var i = 0; i < dataArr.length; i++) { if ((existBlno.indexOf(dataArr[i].data.OUTBSNO_OUT)) >= 0 && ((dataArr[i].data.CHARGEUNIT != 'CBM') || (dataArr[i].data.ISDETAIL == '0' ))) { continue; } else { existBlno += dataArr[i].data.OUTBSNO_OUT + ','; temp += parseFloat(dataArr[i].data.GOODSPFSL_OUT); } } return temp; } }, { sortable: true, dataIndex: 'GOODSSTOCK', header: '库存量', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.00; var existBlno = ''; for (var i = 0; i < dataArr.length; i++) { if (existBlno.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existBlno += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSSTOCK); } } return temp; } }, { sortable: true, dataIndex: 'CHARGEUNIT', header: '计费单位', width: 80 }, { sortable: true, dataIndex: 'GOODSOUTFEE_OUT', header: '应收仓储费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'GOODSOUTFEEAP_OUT', header: '应付仓储费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'ARFEE', header: '入库应收装卸费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'APFEE', header: '入库应付装卸费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'ARFEE_OUT', header: '出库应收装卸费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'APFEE_OUT', header: '出库应付装卸费', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { return value; } }, { sortable: true, dataIndex: 'FREESTORAGEPERIOD', header: '免仓储期', width: 80 }, { sortable: true, dataIndex: 'GOODSPACK', header: '入库件数', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.00; var existBlno = ''; for (var i = 0; i < dataArr.length; i++) { if (existBlno.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existBlno += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSPACK); } } return temp; } }, { sortable: true, dataIndex: 'GOODSPACKSTOCK', header: '剩余件数', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.00; var existBlno = ''; for (var i = 0; i < dataArr.length; i++) { if (existBlno.indexOf(dataArr[i].data.WMSNO) >= 0 && dataArr[i].data.CHARGEUNIT != "箱") { continue; } else { existBlno += dataArr[i].data.WMSNO + ','; temp += parseFloat(dataArr[i].data.GOODSPACKSTOCK); } } return temp; } }, { sortable: true, dataIndex: 'GOODSPACKPFSL_OUT', header: '出库件数', width: 80, summaryType: 'sum', summaryRenderer: function (value, summaryData, dataIndex) { var dataArr = _this.storeList.data.items; var temp = 0.00; var existBlno = ''; for (var i = 0; i < dataArr.length; i++) { if ((existBlno.indexOf(dataArr[i].data.OUTBSNO_OUT)) >= 0 && ((dataArr[i].data.CHARGEUNIT != 'CBM') || (dataArr[i].data.ISDETAIL == '0'))) { continue; } else { existBlno += dataArr[i].data.OUTBSNO_OUT + ','; temp += parseFloat(dataArr[i].data.GOODSPACKPFSL_OUT); } } return temp; } }, { sortable: true, dataIndex: 'TRUCKNO_OUT', header: '车号', width: 80 }, { sortable: true, dataIndex: 'REMARK_OUT', header: '出库备注', width: 80 }, { sortable: true, dataIndex: 'MODIFIEDUSER', header: '入库操作人', width: 80 }, { sortable: true, dataIndex: 'MODIFIEDTIME', header: '入库操作时间', width: 80 }, { sortable: true, dataIndex: 'CREATEUSER_OUT', header: '出库操作人', width: 80 }, { sortable: true, dataIndex: 'CREATETIME_OUT', header: '出库操作时间', width: 80 } , { sortable: true, dataIndex: 'PICIHAO', header: '批次号', width: 80 }, { sortable: true, dataIndex: 'AREACODE', header: '库位编码', width: 80 }, { sortable: true, dataIndex: 'AREACODE_OUT', header: '库位编码(出库)', width: 80 }, { sortable: true, dataIndex: 'AREANAME', header: '储位', width: 80 }, { sortable: true, dataIndex: 'TRAYNO', header: '托号', width: 120 }, { sortable: true, dataIndex: 'PRODDATE', header: '生产日期', width: 120 }, { sortable: true, dataIndex: 'FACTORYNO', header: '厂号', width: 120 }, { sortable: true, dataIndex: 'WMSINREMARK', header: '入库备注', width: 120 }, { sortable: true, dataIndex: 'COMPANYNAME', header: '用证公司', width: 120 }, { sortable: true, dataIndex: 'IMPORTCOUNTRY', header: '进口国', width: 120 }, { sortable: true, dataIndex: 'PORTREF', header: '目的港', width: 120 }, { sortable: true, dataIndex: 'BUZTYPEREF', header: '业务类型', width: 120 } ]; 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, plugins: [this.cellEditing], features: [{ ftype: 'summary' }], // features: [{ // id: 'group', // ftype: 'grouping', // groupHeaderTpl: '{name}', // hideGroupedHeader: false, // enableGroupingMenu: true // }], bbar: Ext.create('Ext.PagingToolbar', { store: this.storeList, displayInfo: true, displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', emptyMsg: "没有数据" }) }); /////////////以下部分为获取存储的gridpanel显示样式 this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column, 0, true); //使用者id,表名 ,中间column数组 this.column.unshift(new Ext.grid.RowNumberer()); this.gridList.reconfigure(this.storeList, this.column); //////////////////////////// //#endregion ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// //#region formSearch //#region formSearch枚举参照相关 this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsTruckMng.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustCode.load({ params: { condition: ""} }); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '客户名称', typeAhead: true, store: this.storeCustCode, name: 'CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName' }); //品名 this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeGoodsModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' } }); this.storeCodeGoodsList.load(); this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '品名', store: this.storeCodeGoodsList, forceSelection: true, name: 'GOODSNAME', valueField: 'GOODNAME', displayField: 'CodeAndName', listeners: { specialkey: 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: 110, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ this.comboxCustCode , { fieldLabel: '箱号', name: 'CNTRNO', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, this.comboxGOODSNAME, { fieldLabel: '规格/牌号', name: 'GOODSMODEL', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '合同号', name: 'CONTRACTNO', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ this.comboxISCHANGE, { fieldLabel: '从..入库日期', format: 'Y-m-d', xtype: 'datefield', name: 'WMSDATE_min', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '到..入库日期', format: 'Y-m-d', xtype: 'datefield', name: 'WMSDATE_max', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '从..出库日期', format: 'Y-m-d', xtype: 'datefield', name: 'DODATEOUT_min', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '到..出库日期', format: 'Y-m-d', xtype: 'datefield', name: 'DODATEOUT_max', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } } //, { xtype: 'hiddenfield', flex: 1 } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', anchor: '100%', items: [ this.comboxCustWmsCode, { fieldLabel: '库位编码', name: 'AREACODE', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '出库单号/明细单号', name: 'OUTBSNO', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { fieldLabel: '提单号', name: 'MBLNO', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } },this.comboxCompany //{ // xtype: 'hiddenfield' //} ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', anchor: '100%', items: [ { fieldLabel: '储位', name: 'AREANAME', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(); } } } }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }, { 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.OprationStatus = 'add'; //DsOpenEditWin("/TruckMng/MsWlPc/Edit_ADL", "", "700", "1000"); this.onAddPCClick(); }, scope: this }, { text: "删除", id: "btndelete", hidden: true, iconCls: "btndelete", handler: function (button, event) { this.onDeleteClick(button, event); }, scope: this }, '-', { text: "执行查询", iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); }, scope: this }, { text: "重置条件", iconCls: "btnreset", handler: function (button, event) { this.onClearSql(button, event); }, 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: "保存修改", id: "SaveBtn", hidden: true, iconCls: "btnsave", handler: function (button, event) { this.onSaveClick(button, event); }, scope: this }, '-', { id: "btnLock", text: '费用入账', tooltip: '锁定入库信息', iconCls: "btnconfirm", handler: function (button, event) { this.LockWMS("1"); }, scope: this }, '-', { id: "btnUnLock", text: '取消费用入账', tooltip: '入库信息解除锁定', iconCls: "btnrefuse", handler: function (button, event) { this.LockWMS("0"); }, scope: this }, { text: "打印", id: "btnprint", iconCls: 'btnprint', handler: function (button, event) { this.onPrintClick(button, event); }, scope: this } //,this.CB_EditMode ] }); this.panelTop = new Ext.Panel({ layout: "border", region: "north", height: 150, items: [this.formSearch, this.panelBtn] }); Ext.apply(this, { items: [this.panelTop, this.gridList, this.gridList_edit] }); ///以下集中绑定事件 this.storeList.on('beforeload', function (store) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); Ext.apply(store.proxy.extraParams, { condition: sql }); }, this); this.gridList.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(); }, //end initUIComponents LoadInitData: function () { //this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} }); }, onRefreshClick: function (button, event) { if (!this.checkSearchCondition()) return; var sql = this.getCondition(); this.storeList.load({ params: { start: 0, limit: this.PageSize, condition: sql }, waitMsg: "正在查询数据...", scope: this }); //} }, onClearSql: function () { var form = this.formSearch.getForm(); form.reset(); //this.InitData(); }, getCondition: function () { var form = this.formSearch.getForm(); var sql = ''; //客户名称 var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue(); sql = sql + getAndConSql(sql, CUSTOMERNAME, " V.CUSTOMERNAME='" + CUSTOMERNAME + "'"); //CNTRNO var CNTRNO = form.findField('CNTRNO').getValue(); sql = sql + getAndConSql(sql, CNTRNO, " CNTRNO like '%" + CNTRNO + "%' "); //GOODSNAME var GOODSNAME = form.findField('GOODSNAME').getValue(); sql = sql + getAndConSql(sql, GOODSNAME, " V.GOODSNAME like '%" + GOODSNAME + "%' "); //GOODSMODEL var GOODSMODEL = form.findField('GOODSMODEL').getValue(); sql = sql + getAndConSql(sql, GOODSMODEL, " V.GOODSMODEL like '%" + GOODSMODEL + "%' "); //CONTRACTNO var CONTRACTNO = form.findField('CONTRACTNO').getValue(); sql = sql + getAndConSql(sql, CONTRACTNO, " V.CONTRACTNO like '%" + CONTRACTNO + "%' "); var WMSDATE_min = form.findField('WMSDATE_min').getRawValue(); sql = sql + getAndConSql(sql, WMSDATE_min, " v.WMSDATE>='" + WMSDATE_min + "'"); var WMSDATE_max = form.findField('WMSDATE_max').getRawValue(); sql = sql + getAndConSql(sql, WMSDATE_max, " v.WMSDATE<='" + WMSDATE_max + " 23:59:59'"); var DODATEOUT_min = form.findField('DODATEOUT_min').getRawValue(); sql = sql + getAndConSql(sql, DODATEOUT_min, " v.DODATE_OUT>='" + DODATEOUT_min + "'"); var DODATEOUT_max = form.findField('DODATEOUT_max').getRawValue(); sql = sql + getAndConSql(sql, DODATEOUT_max, " v.DODATE_OUT<='" + DODATEOUT_max + " 23:59:59'"); var ISCHANGE = form.findField('ISCHANGE').getValue(); if (ISCHANGE == '全部') { } if (ISCHANGE == '不含货转') { sql = sql + getAndConSql(sql, ISCHANGE, "v.ISCHANGE = " + 0 + ""); } if (ISCHANGE == '只包括货转') { sql = sql + getAndConSql(sql, ISCHANGE, "v.ISCHANGE = " + 1 + ""); } //仓库名称 var StorageName = form.findField('STORAGENAME').getValue(); sql = sql + getAndConSql(sql, StorageName, " V.StorageName like '%" + StorageName + "%' "); //库位编码 var AREACODE = form.findField('AREACODE').getValue(); sql = sql + getAndConSql(sql, AREACODE, " V.AREACODE like '%" + AREACODE + "%' "); //出库单号/出库明细单号 var OUTBSNO = form.findField('OUTBSNO').getValue(); sql = sql + getAndConSql(sql, OUTBSNO, " V.OUTBSNO_OUT like '%" + OUTBSNO + "%' OR V.BSNO_OUT like '%" + OUTBSNO + "%' "); //提单号 var MBLNO = form.findField('MBLNO').getValue(); sql = sql + getAndConSql(sql, MBLNO, " V.BLNO like '%" + MBLNO + "%' "); //用证公司 var company = form.findField('company').getValue(); sql = sql + getAndConSql(sql, company, "'" + company + "' in (select company from import_main where ContractNo = V.BSNO)"); if (sql != '') { sql += ' and ISLOCK=1 and ISLOCK2=0'; //需求编号:SR2017061400006-1 } else { sql += 'ISLOCK=1 and ISLOCK2=0'; } //储位 var AREANAME = form.findField('AREANAME').getValue(); sql = sql + getAndConSql(sql, AREANAME, " V.AREANAME like '%" + AREANAME + "%' "); 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.storeList; ret[2] = this.SelectedRecord; if (this.OprationStatus == "add") { ret[3] = ""; } else { ret[3] = this.SelectedRecord.data.REFBILLNO; } ret[4] = "MsRptPcHeadQryIndex"; ret[5] = formtype; return ret; }, onExportClick: function (button, event) { GridExportExcelPage(this.gridList); }, SetBtnState: function () { var me = this; //此处用于北京二商项目的财务部门 在此处入账、解除入账出入库信息 Ext.Ajax.request({ waitMsg: '正在查询用户权限...', url: '/CommMng/BasicDataRef/GetAuthorityRange', params: { modName: "modImportSales", USERID: USERID }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); rec = result.data; //alert(rec.VISIBLERANGE); //alert(rec.OPERATERANGE); //可视范围无限制。 //可操作为0则全都可见 //,4为所有按钮均不可见,只能查询 //,3为特殊账户,可以编辑不可添加预收,可以加销售单,审销售单 //,2为业务只能新增删除销售单,不能操作预收 //,1为财务,可以新建删除预收,审批销售出库,不可操作销售单 this.VISIBLERANGE = rec.VISIBLERANGE; this.OPERATERANGE = rec.OPERATERANGE; if (this.OPERATERANGE == '1' || this.OPERATERANGE == '0') { Ext.getCmp("btnLock").enable(); Ext.getCmp("btnUnLock").enable(); } else { Ext.getCmp("btnLock").disable(); Ext.getCmp("btnUnLock").disable(); } } else Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); }, scope: this }); //request over } , LockWMS: function (Value) { if (this.editRecord == null) { alert("请先保存记录"); return; } if (this.editRecord.get('ISLOCK') == "True" && Value == "1") { alert("已经入账,不能重复操作"); return; } if (this.editRecord.get('ISLOCK') == "False" && Value == "0") { alert("目前没有入账,不能重复操作"); return; } var LockWMS = []; Ext.MessageBox.confirm('提示', '确定要操作该入库信息吗?', function (btn) { if (btn == 'yes') { LockWMS.push(this.editRecord); var LockWMSJSNO = ConvertRecordsToJsonAll(LockWMS); var _this = this; Ext.Ajax.request({// waitMsg: '正在处理数据...', url: '/MvcShipping/WMS/Lock', params: { data: LockWMSJSNO, LOCK: Value }, callback: function (options, success, response) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { alert(jsonresult.Message); if (Value == "1") { _this.editRecord.set("ISLOCK", "True"); var data = this.formEdit.getForm().getValues(); data.ISLOCK = "True"; this.formEdit.getForm().setValues(data); } else { _this.editRecord.set("ISLOCK", "False"); var data = this.formEdit.getForm().getValues(); data.ISLOCK = "False"; this.formEdit.getForm().setValues(data); } _this.editRecord.commit(); } else { alert("操作失败" + jsonresult.Message); } }, scope: this }); //request over } }, this); } //onDeleteClick , onPrintClick: function (button, event) { // var printType = 'WmsInfoReport_opseai'; //海运进口 入库明细 var printType = 'WmsDetailIndexList'; var sql1 = " select DISTINCT dbo.F_WMS_CNTRNO(v.gid) CNTRNO, v.* from VW_WMS_DETAIL V "; var wherestr = this.getCondition(); if (wherestr != '') { sql1 += " where 1 = 1 and " + wherestr; } sql1 += "order by CUSTOMERNAME ASC,WMSDATE ASC "; PrintComm(printType, sql1); } });