//2013-03-15 删除固定费用 Ext.namespace('DsTruck'); //#region 当前日期格式 Date.prototype.format = function (format) { var o = { "M+": this.getMonth() + 1, //month "d+": this.getDate(), //day "h+": this.getHours(), //hour "m+": this.getMinutes(), //minute "s+": this.getSeconds(), //cond "q+": Math.floor((this.getMonth() + 3) / 3), //quarter "S": this.getMilliseconds() //millisecond } if (/(y+)/.test(format)) format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)); return format; } //#endregion //#region 获取 YYYY-mm-dd 格式的日期 var xhr = new XMLHttpRequest(); var currdate = new Date(); xhr.open("HEAD", location.href, true); xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status == 200) { var datestr = xhr.getResponseHeader("Date"); currdate = new Date(datestr); } } xhr.send(null); //#endregion DsTruck.MsPcLTJYEdit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.DsTruck.MsPcLTJYEdit.superclass.constructor.call(this); }; var CTNALL = ''; var SEALNO = ''; Ext.extend(DsTruck.MsPcLTJYEdit, Ext.Panel, { ParentWin: null, OpStatus: 'add', StoreList: null, editRecord: null, selectPGID: '', initUIComponents: function () { this.formname = 'MsPcLTJYEdit'; this.formname_out = 'LTJYWMSOUTDetail'; this.WMSINBodyDel = []; this.pcnostr = ""; //用于记录多个批次信息 this.boxnostr = ""; //用于记录多个箱号信息 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: 'EndPortDate', type: 'date' }, { name: 'EtDate', type: 'date' }, { name: 'VoyVeg', type: 'string' }, { name: 'ArriveDate', type: 'date' }, { name: 'ReturnDate', type: 'date' }, { 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: 'OverLoadMil', 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: 'ChangedReson', type: 'string' }, { name: 'GoodsName', 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' } ] }); //#region 编辑Form //#region 数据集 this.storeCustomerName = Ext.create('DsExt.ux.RefTableStore', { model: 'Tradermb', proxy: { url: '/CommMng/BasicDataRef/GetTrader' } }); this.storeCustomerName.load({ params: { condition: " ISCONTROLLER=1 "} }); this.comboxCustomerName = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '客户', id: "CustomerName", //hidden: true, forceSelection: true, store: this.storeCustomerName, name: 'CustomerName', valueField: 'name', displayField: 'codename', allowBlank: false, listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var s = " LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')"; //this.storeInfoClientContact.load({ params: { condition: s} }); Ext.getCmp('BLTYPE').setValue(""); this.LoadPrice(); Ext.getCmp('WMSCUSTOMERNAME').setValue(combo.value); } } } }); this.storeCustName = Ext.create('DsExt.ux.RefTableStore', { model: 'Tradermb', proxy: { url: '/CommMng/BasicDataRef/GetTrader' } }); this.storeCustName.load({ params: { condition: " ISTRUCK=1 "} }); this.comboxCustName = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '货站', id: "CustName", //hidden: true, forceSelection: true, store: this.storeCustName, name: 'CustName', valueField: 'name', displayField: 'codename', allowBlank: false, listeners: { } }); //客户加载_车队 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: 'F_CustomerName', valueField: 'CustName', displayField: 'CodeAndName', hidden: true }); 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: '派车单票' , hidden: true, margins: '0' }); var _this = this; 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, id: 'PcBillType', name: 'PcBillType', readOnly: true, allowBlank: false, listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var data = combo.lastSelection[0].data; _this.SetTabShow(data.EnumValueName); this.LoadPrice(); } } } }); this.StoreTruckTypeProp = Ext.create('DsExt.ux.RefEnumStore', {}); this.StoreTruckTypeProp.load({ params: { enumTypeId: 97043} }); this.comboxTruckTypeProp = Ext.create('DsExt.ux.RefEnumCombox', { fieldLabel: '车辆类别', store: this.StoreTruckTypeProp, flex: 0.5, // forceSelection: true, name: 'Property' }); this.StoreTruckType = Ext.create('DsExt.ux.RefEnumStore', {}); this.StoreTruckType.load({ params: { enumTypeId: 99019} }); this.comboxTruckType = Ext.create('DsExt.ux.RefEnumCombox', { fieldLabel: '车型', store: this.StoreTruckType, flex: 0.5, labelWidth: 60, // forceSelection: true, name: 'TruckSpec' }); this.StoreBsType = Ext.create('Ext.data.Store', { fields: ['BLTYPE'] }); this.StoreBsType.removeAll(); //this.StoreBsType.add({ "BLTYPE": "吨公里" }); this.StoreBsType.add({ "BLTYPE": "吨" }); //this.StoreBsType.add({ "BLTYPE": "公斤公里" }); this.StoreBsType.add({ "BLTYPE": "公斤" }); this.StoreBsType.add({ "BLTYPE": "趟" }); this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '重量单位', store: this.StoreBsType, forceSelection: true, name: 'BsType', valueField: 'BLTYPE', displayField: 'BLTYPE' //, hidden: true , id: 'BLTYPE' , margins: '0' , listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var data = combo.lastSelection[0].data; //Ext.getCmp('RealMil').setValue(data.VALUEFIELD); this.LoadPrice(); } }, 'change': function (field, newValue, oldValue) { //this.setCBM(newValue, oldValue); } } }); Ext.define('DsShipping.ux.CodePackageModel', { extend: 'Ext.data.Model', fields: [ { name: 'PKGS', type: 'string' } ] }); //件数包装 this.storeCodePackage = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodePackageModel', proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' } }); //this.storeCodePackage.load(); this.comboxKINDPKGS = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '包 装', store: this.storeCodePackage, name: 'KINDPKGS', valueField: 'PKGS', displayField: 'PKGS', hidden: true }); Ext.define('MsWlBsHeadRefMsWlTruck', { extend: 'Ext.data.Model', fields: [ { name: 'TruckNo', type: 'string' }, { name: 'DrvCode', type: 'string' }, { name: 'DrvName', type: 'string' }, { name: 'Mobile', type: 'string' } ] }); /* this.storeTruckNo = Ext.create('DsExt.ux.RefTableStore', { model: 'MsWlBsHeadRefMsWlTruck', proxy: { url: '/TruckMng/MsWlPc/GetTruckNoList' } }); this.storeTruckNo.load({ params: { condition: ""} }); this.comboxTruckNo = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '车牌号', store: this.storeTruckNo, name: 'TruckNo', valueField: 'TruckNo', displayField: 'TruckNo', matchFieldWidth: true, hidden:true, listeners: { change: function (field, newValue, oldValue) { // this.tonAndTruckNoChange(field, newValue, oldValue); }, scope: this } });*/ //委托单位_联系人 this.storeInfoClientContact = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.InfoClientContactModel', proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' } }); this.comboxInfoClientContactYard = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '客户联系人', store: this.storeInfoClientContact, name: 'LinkMan', valueField: 'SHOWNAME', displayField: 'SHOWNAME', hidden: true, listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { // this.formEdit.getForm().findField('Tel').setValue(records[0].data.TEL); } } } }); this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserRefModel', proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' } }); this.storeOpCode.load({ params: { condition: ""} }); this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '揽货人', //'揽货人', store: this.storeOpCode, forceSelection: true, name: 'SalesName', valueField: 'UserName', displayField: 'CodeAndName', value: SHOWNAME }); //GetDetiNation_LTJY this.storeDetiNation = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.DICModel', proxy: { url: '/CommMng/TruckBasicDataRef/GetDetiNation_LTJY' } }); //tablename columnname condition this.storeDetiNation.load({ params: { condition: ""} }); this.comboxDetiNation = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '目的地', //'揽货人', store: this.storeDetiNation, forceSelection: true, name: 'DetiNation', valueField: 'KEYFIELD', displayField: 'KEYFIELD' , listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var data = combo.lastSelection[0].data; Ext.getCmp('RealMil').setValue(data.VALUEFIELD); this.LoadPrice(); } } } }); //GetCommaWord this.storeGoodsname = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.DICModel', proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' } }); this.storeGoodsname.load({ params: { tablename: "tMsWlPcHead", columnname: "GoodsName", condition: ""} }); this.comboxGoodsname = Ext.create('Ext.ux.form.field.BoxSelect_Input', { fieldLabel: '品名', //renderTo: 'basicBoxselect', //autoHeight:true, autosize: true, bodyPadding: 1, flex: 2, //height:60, //width: 80, //labelWidth: 90, store: this.storeGoodsname, queryMode: 'local', forceSelection: false, //stacked: true, //pinList: false, name: 'GoodsName', triggerOnClick: false, valueField: 'KEYFIELD', displayField: 'KEYFIELD', listeners: { // specialkey: function (field, e) { // if (e.getKey() == e.ENTER) { // _this.onRefreshClick(); // } // } } //,value: ['TX', 'CA'] }); this.storePrice = Ext.create('Ext.data.Store', { pageSize: 1000, idProperty: 'GID', model: 'LTJYDistancemb', remoteSort: true, proxy: { type: 'ajax', url: '/TruckMng/LTJYDistance/GetPriceList', reader: { id: 'id', root: 'data', totalProperty: 'totalCount' } } }); //#endregion //编辑form _this = this; this.formEdit = Ext.widget('form', { region: 'center', frame: true, bodyPadding: 5, autoScroll: true, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [ {//fieldset 1 xtype: 'fieldset', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '录入日期', name: 'LrDate', flex: 0, hidden: true, margins: '0' }, { fieldLabel: '记账日期', name: 'JzDate', flex: 0, hidden: true, margins: '0' }, { fieldLabel: '用户编码', name: 'UserCode', flex: 0, hidden: true, margins: '0' }, { fieldLabel: '组织编码', name: 'OrgCode', flex: 0, hidden: true, margins: '0' }, { fieldLabel: '组织名称', name: 'OrgName', flex: 0, hidden: true, margins: '0' }, { fieldLabel: 'RoadFee', name: 'RoadFee', flex: 0, hidden: true, margins: '0' }, { fieldLabel: 'gId', name: 'gId', flex: 0, hidden: true, margins: '0' }, { fieldLabel: 'PGid', name: 'PGid', flex: 0, hidden: true, margins: '0' }, { fieldLabel: 'RefBillNo', name: 'RefBillNo', flex: 0, hidden: true, margins: '0' }, { fieldLabel: 'RefBillNose', name: 'RefBillNose', flex: 0, hidden: true, margins: '0' }, { fieldLabel: 'FEESTATUS', name: 'FEESTATUS', flex: 0, hidden: true, margins: '0' }, { fieldLabel: '时间戳', name: 'timeMark', flex: 0, hidden: true, margins: '0' }, { fieldLabel: '委托编号', allowBlank: false, disabled: true, name: 'BillNo', id: 'BillNo' }, this.comboxBLTYPE, { fieldLabel: 'Marstar业务号', name: 'MblNo', hidden: true, margins: '0' } , this.comboxCustomerName , this.comboxInfoClientContactYard, // { // fieldLabel: '货站', // name: 'CustName' // } this.comboxCustName , { fieldLabel: '收货人', name: 'DispatchName', hidden: true }, { fieldLabel: '状态', readOnly: true, name: 'PCSTATUSREF', hidden: true, margins: '0' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '派车时间', xtype: 'datefield', format: 'Y-m-d', name: 'ExpDate' }, this.comboxPcBillType, { fieldLabel: '派车申请人', name: 'UserName', hidden: true }, this.comboxTRUCKER //, this.comboxTruckNo , { fieldLabel: '车牌号', name: 'TruckNo' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '发货日期', format: 'Y-m-d', xtype: 'datefield', name: 'ArriveDate', hidden: true }, { xtype: 'hiddenfield' }, { fieldLabel: '卸货日期', format: 'Y-m-d', xtype: 'datefield', name: 'ReturnDate' }, { fieldLabel: '到达地', name: 'DstArea', hidden: true } // , { // fieldLabel: '目的地', // name: 'DetiNation'//,hidden:true // } , this.comboxDetiNation , { fieldLabel: '装货地址', name: 'LoadPlace', hidden: true }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '件数', name: 'ContainerQty' }, this.comboxKINDPKGS, { fieldLabel: '重量', name: 'Ton', xtype: 'numberfield', decimalPrecision: 3, listeners: { scope: this, 'blur': function (field) { //大于35设为公斤 小于等于35设为吨 var basicForm = this.formEdit.getForm(); var data = basicForm.getValues(); var Ton = data.Ton; if (Ton >= 0) { if (Ton > 35) { Ext.getCmp("BLTYPE").setValue("公斤"); _this.LoadPrice("公斤"); } else { Ext.getCmp("BLTYPE").setValue("吨"); _this.LoadPrice("吨"); } } this.MakeFeeJS(); } } }, { fieldLabel: '体积', name: 'LoadCount', xtype: 'numberfield', allowDecimals: true, hidden: true, //这里允许保留3位小数,所以你输入11.996就不会进位了 decimalPrecision: 4, listeners: { scope: this, 'blur': function (field) { this.MakeFeeJS(); } } }, { fieldLabel: '里程', id: 'RealMil', name: 'RealMil', xtype: 'numberfield' }//, {xtype:'hiddenfield'} ] }, { xtype: 'container', layout: 'hbox', defaultType: 'numberfield', items: [{ fieldLabel: '应收运费', name: 'OverLoadMil', id: "OverLoadMil", allowDecimals: true, decimalPrecision: 4, value: 0.0 }, { fieldLabel: '应收提送费', name: 'LinkManSe', allowDecimals: true, decimalPrecision: 4, value: 0.0 }, { fieldLabel: '应付运费', name: 'LinkTelSe', allowDecimals: true, decimalPrecision: 4, value: 0.0 }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '单据日期', xtype: 'datefield', format: 'Y-m-d', name: 'BillDate' }, this.comboxBsType , { fieldLabel: '发票号', hidden: true, name: 'INVOICENO' }, { fieldLabel: '提箱场站', name: 'YardName', hidden: true } //, this.comboxTruckTypeProp //, this.comboxTruckType //, this.comboxSALE , { xtype: 'hiddenfield'}//20180527 隐藏揽货人 //, { xtype: 'hiddenfield' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '工厂联系人', name: 'CustLikeManName', hidden: true }, { fieldLabel: '船名航次', name: 'VoyVeg', hidden: true }, { fieldLabel: '开船日期', xtype: 'datefield', format: 'Y-m-d', name: 'EtDate', hidden: true }, { fieldLabel: '截港日期', xtype: 'datetimefield', format: 'Y-m-d', name: 'EndPortDate', hidden: true }, { fieldLabel: '注意事项', flex: 1, name: 'ChangedReson' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: 'MblNoSe', name: 'MblNoSe',flex: 1,hidden: true }, { fieldLabel: '运单号', flex: 1, name: 'CUSTNO' }, this.comboxGoodsname ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textarea', items: [ { fieldLabel: '备注', height: 40, name: 'Remark' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textarea', items: [ { xtype: "button", id: "button_makefee", //iconCls: "btnadd", text: "生成运费", hidden: true, handler: function (button, event) { _this.onMakeFeeClick(button, event); } }, { xtype: "label", id: "PriceList", text: "" } ] } ]//end items(fieldset 1) }//end fieldset 1 ]//end root items }); //end this.formEdit //#endregion //#region 按钮Toolbar this.panelBtn = new Ext.Panel({ region: "north", tbar: [{ id: 'btnEPrev', text: "上一票", // iconCls: "btnsave", handler: function (button, event) { this.PrevRecord(); }, scope: this }, { id: 'btnENext', text: "下一票", // iconCls: "btnsave", handler: function (button, event) { this.NextRecord(); }, scope: this }, { id: 'bsbtnSave', text: "保存", iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, { id: 'bsbtnSaveAndClose', text: "保存并关闭", handler: function (button, event) { this.Save('1'); }, scope: this }, '-', { id: 'bsbtnSaveAndNew', text: "保存并新建", handler: function (button, event) { this.Save('2'); Ext.getCmp('PcBillType').readOnly = false; }, scope: this }, '-', { text: "关闭", handler: function (button, event) { window.close(); }, scope: this }, { id: 'bsbtnNew', text: "新建", handler: function (button, event) { this.LoadData('add', ''); var basicForm = this.formEdit.getForm(); basicForm.findField('BillNo').setDisabled(false); Ext.getCmp('PcBillType').readOnly = false; }, scope: this }, '-', { id: 'bsbtnCopyAndNew', text: "复制新建", handler: function (button, event) { var basicForm = this.formEdit.getForm(); this.OpStatus = 'add'; basicForm.findField('gId').setDisabled(false); var field = basicForm.findField('gId'); var BSNO = 'PC' + NewGuid(); var oldbsno = field.getValue(); var oldmasterno = basicForm.findField('PGid').getValue(); field.setValue(BSNO); if (oldbsno == "" || oldbsno == oldmasterno) { field = basicForm.findField('PGid'); field.setValue(BSNO); } field = basicForm.findField('BillNo'); field.setValue(''); //清空费用 var data = basicForm.getValues(); editp = Ext.create('PCmb', data); this.LoadFeeData(editp); }, scope: this }, '-', { text: '上传附件', tooltip: '上传附件', iconCls: "btnadddetail", handler: function (button, event) { this.onUpLoadFileClick(button, event); }, scope: this } ] }); //end 按钮Toolbar //#endregion //#region 入库信息 //#region 数据集定义 //客户加载_委托单位 //仓储出库货主 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' //, allowBlank: false }); //#endregion //#region formEdit_WMSIN this.formEdit_WMSIN = Ext.widget('form', { // layout: "border", region: 'north', height: 110, frame: true, bodyPadding: 1, trackResetOnLoad: true, fieldDefaults: { margins: '1 1 1 1', labelAlign: 'right', flex: 1, labelWidth: 64, msgTarget: 'qtip' //,split:true }, items: [ {//fieldset 1 xtype: 'fieldset', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [ {//container_1 xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: 'GID', hidden: true, name: 'GID' }, { fieldLabel: '入库单号', //hidden: true, name: 'WMSNO', id: 'WMSNO', readOnly: true }, { fieldLabel: '客户名称', readOnly: true, //hidden: true, name: 'CUSTOMERNAME', id: 'WMSCUSTOMERNAME' } , { fieldLabel: '提单号', name: 'BLNO', hidden: true }, { fieldLabel: '合同号', hidden: true, //labelWidth: 100, name: 'CONTRACTNO', id: "CONTRACTNO" } //, { // fieldLabel: '批次号', flex: 1, // labelWidth: 100, // name: 'PICIHAO', id: "PICIHAO" // } , { name: 'WMSDATE', id: "WMSDATE", fieldLabel: '入库时间', format: 'Y-m-d', xtype: 'datefield' } , { fieldLabel: '计费单位', name: 'CHARGEUNIT', value: '箱', readOnly: true } ] }//container_1 end , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: '', name: 'ARCLIENT', hidden: true } , { fieldLabel: '应收免仓储期', hidden: true, labelWidth: 100, name: 'FREESTORAGEPERIOD', id: "FREESTORAGEPERIOD", xtype: 'numberfield', //allowBlank: false, regex: /^(0|[1-9][0-9]*)$/, regexText: '请输入正确的数值!' } , { name: 'STARTBILLINGDATE', id: "STARTBILLINGDATE", hidden: true, fieldLabel: '应收计费日期', labelWidth: 100, format: 'Y-m-d', xtype: 'datefield', renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s') } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ this.comboxCustWmsCode , { fieldLabel: '储位', name: 'AREANAME', id: "AREANAME" } , this.comboxPayCust , { fieldLabel: '应付免仓储期', hidden: true, labelWidth: 100, name: 'FREESTORAGEPERIODAP', id: "FREESTORAGEPERIODAP", xtype: 'numberfield', regex: /^(0|[1-9][0-9]*)$/, regexText: '请输入正确的数值!', listeners: { scope: this, 'blur': function (field) { //var wmsdate = Ext.getCmp("WMSDATE").getValue(); //Ext.getCmp("STARTBILLINGDATEAP").setRawValue(getAfterDATE(wmsdate, field.value + 1)); } } } , { name: 'STARTBILLINGDATEAP', id: "STARTBILLINGDATEAP", hidden: true, fieldLabel: '应付计费日期', labelWidth: 100, format: 'Y-m-d', xtype: 'datefield', renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s') }, { fieldLabel: '库别', flex: 1, name: 'WHS_CODE', id: "WHS_CODE" }, { fieldLabel: '件数', readOnly: true, name: 'PKGS', id: "PKGS" } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: '市场货值', hidden: true, name: 'MARKETVALUE', id: "MARKETVALUE", xtype: 'numberfield' }, { fieldLabel: '银行货值', hidden: true, name: 'BANKVALUE', id: "BANKVALUE", xtype: 'numberfield' }, { fieldLabel: '备案清单号', hidden: true, flex: 1, name: 'CUSTOMNO', id: "CUSTOMNO" }, { fieldLabel: '委托编号', hidden: true, flex: 1, name: 'CUSTNO', id: "CUSTNO" }, { fieldLabel: '电子账册号', hidden: true, labelWidth: 75, flex: 1, name: 'BZTCHNO', id: "BZTCHNO" }, { fieldLabel: '会计期间', hidden: true, flex: 1, name: 'ACCDATE', xtype: 'monthfield', format: 'Y-m', editable: false//, //allowBlank: false }, { fieldLabel: '是否保税', hidden: true, readOnly: true, disabled: true, name: 'ISBONDED' }] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', anchor: '50%', items: [ { fieldLabel: '牌号', name: 'GOODSMODEL', id: "GOODSMODEL" }, { fieldLabel: '包装规格', name: 'GOODSSTANDARD', id: "GOODSSTANDARD" }, { fieldLabel: '报关件数', hidden: true, readOnly: true, name: 'BAOGUANJIANSHU', id: "BAOGUANJIANSHU" }] } , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: 'WMSOP', hidden: true, name: 'WMSOP', id: "WMSOP" }, { fieldLabel: 'STOREMAN', hidden: true, name: 'STOREMAN', id: "STOREMAN" }, { fieldLabel: 'CREATEUSER', hidden: true, name: 'CREATEUSER', id: "CREATEUSER" }, { fieldLabel: 'CREATETIME', hidden: true, name: 'CREATETIME', id: "CREATETIME" }, { fieldLabel: 'MODIFIEDUSER', hidden: true, name: 'MODIFIEDUSER', id: "MODIFIEDUSER" }, { fieldLabel: 'MODIFIEDTIME', hidden: true, name: 'MODIFIEDTIME', id: "MODIFIEDTIME" }, { fieldLabel: 'ISDELETE', hidden: true, name: 'ISDELETE', id: "ISDELETE" }, { fieldLabel: 'DELETEUSER', hidden: true, name: 'DELETEUSER', id: "DELETEUSER" }, { fieldLabel: 'DELETETIM', hidden: true, name: 'DELETETIM', id: "DELETETIM" }, { fieldLabel: 'ISLOCK', hidden: true, name: 'ISLOCK', id: "ISLOCK" }, { fieldLabel: 'ISLOCK2', hidden: true, name: 'ISLOCK2', id: "ISLOCK2" }, { fieldLabel: 'LOCKTIME', hidden: true, name: 'LOCKTIME', id: "LOCKTIME" }, { fieldLabel: 'LOCKUSER', hidden: true, name: 'LOCKUSER', id: "LOCKUSER" }, { fieldLabel: 'GOODSPACK', hidden: true, name: 'GOODSPACK', id: "GOODSPACK" }, { fieldLabel: 'GOODSPACKSTOCK', hidden: true, name: 'GOODSPACKSTOCK', id: "GOODSPACKSTOCK" }, { fieldLabel: 'ARFEE', hidden: true, name: 'ARFEE', id: "ARFEE" }, { fieldLabel: 'APFEE', hidden: true, name: 'APFEE', id: "APFEE" }, { fieldLabel: 'ASSOCIATEDNO', hidden: true, name: 'ASSOCIATEDNO', id: "ASSOCIATEDNO" }, { fieldLabel: 'CLIENTCODEOLD', hidden: true, name: 'CLIENTCODEOLD', id: "CLIENTCODEOLD" }, { fieldLabel: 'CLIENTNAMEOLD', hidden: true, name: 'CLIENTNAMEOLD', id: "CLIENTNAMEOLD" }, { fieldLabel: 'CORPID', hidden: true, name: 'CORPID', id: "CORPID" }, { fieldLabel: 'GOODSPACKACTUAL', hidden: true, name: 'GOODSPACKACTUAL', id: "GOODSPACKACTUAL" }, { fieldLabel: 'GOODSRKSLACTUAL', hidden: true, name: 'GOODSRKSLACTUAL', id: "GOODSRKSLACTUAL" }, { fieldLabel: 'ISCHANGE', hidden: true, name: 'ISCHANGE', id: "ISCHANGE" }, { fieldLabel: 'CLIENTBSNO', hidden: true, name: 'CLIENTBSNO', id: "CLIENTBSNO" }, { fieldLabel: 'GOODSRKSL', hidden: true, name: 'GOODSRKSL', id: "GOODSRKSL" }, { fieldLabel: 'GOODSSTOCK', hidden: true, name: 'GOODSSTOCK', id: "GOODSSTOCK" } ] } ] } ] }); //#endregion //#region 编辑wms_IN //数据集 this.storeWMSIN = Ext.create('Ext.data.Store', { model: 'WMSINmb', pageSize: this.PageSize, remoteSort: false, pruneModifiedRecords: true, proxy: { type: 'ajax', url: '/MvcShipping/WMSNew/GetWMSINList', reader: { id: 'gid', root: 'data', totalProperty: 'totalCount' } } }); //#region 下拉框数据集加载 //箱型_集装箱列表中的下拉框加载 Ext.regModel('CTNALLMODEL', { fields: [{ name: 'CTN'}] }) this.storeCodeCtn = Ext.create('DsExt.ux.RefTableStore', { model: 'CTNALLMODEL', proxy: { url: '/MvcShipping/WMSNew/GetCodeCtnList' } }); //this.storeCodeCtn.load({ params: { mblno: BLNO} }); this.comboxCTNALL = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeCodeCtn, id: 'CTNALL', name: 'CTNALL', valueField: 'CTN', displayField: 'CTN' }); //箱号,跟箱型与提单号关联 Ext.regModel('CNTRNOMODEL', { fields: [{ name: 'DATA'}] }) this.storeCNTRNO = Ext.create('DsExt.ux.RefTableStore', { model: 'CNTRNOMODEL', proxy: { url: '/MvcShipping/WMSNew/GetCNTRNOList' } }); this.comboxCNTRNO = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeCNTRNO, id: 'CNTRNO', name: 'CNTRNO', valueField: 'DATA', displayField: 'DATA' }); //#region 进口国 Ext.define('ConutryRef', { extend: 'Ext.data.Model', fields: [ { name: 'countryid', type: 'string' }, { name: 'country', type: 'string' }, { name: 'country_idandname', type: 'string' } ] }); this.storeCountry = Ext.create('DsExt.ux.RefTableStore', { model: 'ConutryRef', proxy: { url: '/CommMng/BasicDataRef/GetCountryRefList' } }); this.storeCountry.load({ params: { condition: ""} }); this.comboxCountry = Ext.create('DsExt.ux.RefTableCombox', { //fieldLabel: '进口国', forceSelection: true, store: this.storeCountry, name: 'COUNTRYID', valueField: 'countryid', displayField: 'country_idandname' }); //#endregion 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', { store: this.storeCodeGoodsList, id: 'GOODSNAME', name: 'GOODSNAME', forceSelection: true, valueField: 'GID', displayField: 'CodeAndName' }); //#endregion var _this = this; this.columns = [ { sortable: true, //1 dataIndex: 'GID', header: '惟一编号', width: 80, hidden: true }, { sortable: true, //1 dataIndex: 'PICIHAO', header: '批次号', width: 80, hidden: false, editor: { xtype: 'textfield' } }, { sortable: true, dataIndex: 'ASSOCIATEDNO', header: '关联号', width: 80, hidden: true }, { sortable: true, dataIndex: 'BLNO', id: 'BLNO', header: '提单号', //使用该字段与运单相关联 width: 80, hidden: true }, { sortable: true, dataIndex: 'CONTRACTNO', header: '合同号', width: 80, hidden: true }, { sortable: true, hidden: true, //5 dataIndex: 'LINENUM', header: '序号', width: 35 }, { sortable: true, hidden: true, dataIndex: 'CTNALL', header: '箱型', width: 80, editor: this.comboxCTNALL }, { sortable: true, //hidden: true, dataIndex: 'CNTRNO', header: '箱号', width: 80, editor: this.comboxCNTRNO }, { hidden: false, dataIndex: 'XIANGHAO2', header: '箱号2', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'TRUCKNO', header: '车牌号', width: 80, editor: { xtype: 'textfield' } }, { hidden: false, hidden: true, dataIndex: 'CHEDUIID', header: '车队', width: 80, editor: this.comboxCheDui }, { hidden: false, hidden: true, dataIndex: 'ZHUANGXIEGONGID', header: '装卸工', width: 80 , editor: this.comboxZhuangXieGong }, { hidden: true, dataIndex: 'ZhuangXieFeeType', header: '装卸计费标准', width: 80, editor: this.comboxZhuangXieFeiType }, { hidden: true, dataIndex: 'ZhuangXieFeiDanJiaTon', header: '装卸费单价(吨)', width: 80 }, { hidden: true, dataIndex: 'ZhuangXieFeiDanJiaJian', header: '装卸费单价(件)', width: 80 }, { hidden: false, dataIndex: 'JIANSHU1', header: '件数1', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'JIANSHU2', header: '件数2', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'CHIMA1', header: '尺码1', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'CHIMA2', header: '尺码2', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'ZHONGLIANG2', header: '重量2', width: 80, editor: { xtype: 'numberfield', decimalPrecision: 4, enableKeyEvents: true, listeners: { keydown: function (textfield, e) { if (e.getKey() == 40) { _this.onNextKeyClick(1, 24) } } } } }, { hidden: true, dataIndex: 'SHIJIZHONGLIANG', header: '实际重量', width: 80, editor: { xtype: 'textfield' }, summaryType: 'sum', summaryRenderer: function (value) { return Ext.util.Format.number(value, '0.00'); } }, { hidden: true, dataIndex: 'SHIJICHIMA', header: '实际尺码', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'LUYUNFEI', header: '陆运费', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'DIAOTOUFEI', header: '掉头费', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'XIUXIXIANGFEI', header: '修洗箱费', width: 80, editor: { xtype: 'textfield' } }, { hidden: true, dataIndex: 'DIAOZHUANGFEI', header: '吊装费', width: 80, editor: { xtype: 'textfield' } }, { sortable: true, dataIndex: 'ZhuangXieFei', header: '装卸费', hidden: true, width: 80, editor: { xtype: 'numberfield' } }, { sortable: true, hidden: true, dataIndex: 'SEALNO', header: '封号', width: 80, editor: { xtype: 'textfield' } }, { sortable: true, hidden: true, dataIndex: 'BSNO', header: '入库单号', width: 80 }, { sortable: true, hidden: true, //10 dataIndex: 'CLIENTCODE', header: '客户编码', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CLIENTNAME', header: '客户名称', width: 80 }, { sortable: true, hidden: true, dataIndex: 'DODATE', header: '入库日期', width: 80, editor: { xtype: 'datefield', format: 'Y-m-d', selectOnFocus: true }, renderer: Ext.util.Format.dateRenderer('Y-m-d') }, { sortable: true, hidden: true, dataIndex: 'STORAGECODE', header: '仓库编码', width: 80 }, { sortable: true, hidden: true, dataIndex: 'STORAGENAME', header: '仓库名称', width: 80 }, { sortable: true, //hidden: true, //15 dataIndex: 'AREACODE', header: '库位编码', width: 80, editor: { xtype: 'textfield' } }, { sortable: true, hidden: true, dataIndex: 'AREANAME', header: '储位', width: 80, editor: { xtype: 'textfield' } }, { sortable: true, //17 dataIndex: 'GOODSCODE', hidden: true, header: '货物编号', width: 80, editor: { xtype: 'textfield', enableKeyEvents: true, listeners: { keydown: function (textfield, e) { if (e.getKey() == 40) { _this.onNextKeyClick(1, 17) } } } } }, { sortable: true, //18 dataIndex: 'GOODSNAMEID', header: '品名', width: 150, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { if (_this.comboxGOODSNAME.rawValue == null || _this.comboxGOODSNAME.rawValue == '') { return record.data['GOODSNAMEDISPLAY']; } else { } }, editor: this.comboxGOODSNAME }, { sortable: true, //19 hidden: true, dataIndex: 'GOODSTYPE', header: '货物类型', width: 80, editor: { xtype: 'textfield', enableKeyEvents: true, listeners: { keydown: function (textfield, e) { if (e.getKey() == 40) { _this.onNextKeyClick(1, 19) } } } } }, { sortable: true, //20 dataIndex: 'GOODSMODEL', header: '规格', hidden: true, width: 80, editor: this.comboxGOODSDETAILS }, { sortable: true, dataIndex: 'GOODSSTANDARD', readOnly: true, header: '规格/件数', hidden: true, width: 80 }, { sortable: true, dataIndex: 'CHARGEUNIT', header: '计费单位', hidden: true, width: 80 }, { sortable: true, //23 dataIndex: 'GOODSPACK', header: '总件数', hidden: true, width: 80, summaryType: 'sum', summaryRenderer: function (value) { return Ext.util.Format.number(value, '0.00'); } }, { sortable: true, dataIndex: 'GOODSPACKACTUAL', header: '实际件数', hidden: true, width: 80, editor: { xtype: 'numberfield', enableKeyEvents: true, listeners: { keydown: function (textfield, e) { if (e.getKey() == 40) { _this.onNextKeyClick(1, 53) } } } } }, { sortable: true, dataIndex: 'GOODSPACKSTOCK', header: '剩余件数', hidden: true, width: 80 }, { sortable: true, id: "GOODSKGS", //24 dataIndex: 'GOODSKGS', hidden: true, header: '重量', width: 80, editor: { xtype: 'numberfield', decimalPrecision: 4, enableKeyEvents: true, listeners: { keydown: function (textfield, e) { if (e.getKey() == 40) { _this.onNextKeyClick(1, 24) } } } } }, { sortable: true, id: "GOODSTHICKNESS", //25 dataIndex: 'GOODSTHICKNESS', header: '厚度', hidden: true, width: 80 }, { sortable: true, id: "GOODSWIDTH", dataIndex: 'GOODSWIDTH', header: '宽度', hidden: true, width: 80 }, { sortable: true, id: "GOODSLENGTH", dataIndex: 'GOODSLENGTH', header: '长度', hidden: true, width: 80 }, { sortable: true, dataIndex: 'GOODSRKSL', header: '入库量', width: 80, editor: { xtype: 'numberfield', decimalPrecision: 5, enableKeyEvents: true } }, { sortable: true, id: "GOODSSTOCK_IN", dataIndex: 'GOODSSTOCK', header: '*库存量', readOnly: true, width: 80, summaryType: 'sum', summaryRenderer: function (value) { return Ext.util.Format.number(value, '0.00'); } }, { sortable: true, hidden: true, dataIndex: 'FREESTORAGEPERIOD', header: '免仓储期', width: 80, editor: { xtype: 'numberfield', enableKeyEvents: true, listeners: { keydown: function (textfield, e) { if (e.getKey() == 40) { _this.onNextKeyClick(1, 31) } } } } }, { sortable: true, hidden: true, dataIndex: 'ISLOCK', header: '是否入账', width: 80 }, { sortable: true, hidden: true, dataIndex: 'ISLOCK2', header: '是否锁定', width: 80 }, { sortable: true, hidden: true, dataIndex: 'LOCKTIME', header: '锁定时间', width: 80 }, { sortable: true, hidden: true, dataIndex: 'LOCKUSER', header: '锁定操作人', width: 80 }, { sortable: true, hidden: true, //35 dataIndex: 'ISDELETE', header: '是否废除', width: 80 }, { sortable: true, hidden: true, dataIndex: 'DELETETIME', header: '废除时间', width: 80 }, { sortable: true, hidden: true, dataIndex: 'DELETEUSER', header: '废除操作人', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CREATEUSER', header: '创建人', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CREATETIME', header: '创建时间', width: 80 }, { sortable: true, hidden: true, //40 dataIndex: 'MODIFIEDUSER', header: '最后一次更新操作人', width: 80 }, { sortable: true, hidden: true, dataIndex: 'MODIFIEDTIME', header: '最后一次更新操作时间', width: 80 }, { sortable: true, dataIndex: 'REMARK', header: '备注', width: 80, editor: { xtype: 'textfield', enableKeyEvents: true, listeners: { keydown: function (textfield, e) { if (e.getKey() == 40) { _this.onNextKeyClick(1, 42) } } } } }, { sortable: true, hidden: true, dataIndex: 'CLIENTCODEOLD', header: '原客户编码', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CLIENTNAMEOLD', header: '原客户名称', width: 80 }, { sortable: true, //45 dataIndex: 'KINDPKGS', header: '包装', hidden: true, width: 80, editor: { xtype: 'textfield' } }, { sortable: true, hidden: true, dataIndex: 'ARFEE', header: '应收账款', width: 80 }, { sortable: true, hidden: true, dataIndex: 'APFEE', header: '应付账款', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CORPID', header: '分公司代码', width: 80 }, { sortable: true, dataIndex: 'GOODSSLICE', header: '包装件数', hidden: true, hidden: true, width: 80, maxValue: 10, editor: { xtype: 'numberfield', enableKeyEvents: true } }, { sortable: true, hidden: true, //50 dataIndex: 'GOODSGRADE', header: '品名的等级', width: 80 }, { sortable: true, hidden: true, dataIndex: 'STACKLOCATION', header: '码放位置', width: 80 }, { sortable: true, dataIndex: 'GOODSRKSLACTUAL', header: '实际数量(备注类)', hidden: true, width: 80, editor: { xtype: 'numberfield', decimalPrecision: 5, enableKeyEvents: true, listeners: { keydown: function (textfield, e) { if (e.getKey() == 40) { _this.onNextKeyClick(1, 54) } } } } }, { sortable: true, hidden: true, dataIndex: 'ISCHANGE', header: '是否是货权转移', width: 80 }, { sortable: true, dataIndex: 'MARKETVALUE', header: '市场货值', hidden: true, width: 80, editor: { xtype: 'numberfield' } }, { sortable: true, dataIndex: 'BANKVALUE', hidden: true, header: '银行货值', width: 80, editor: { xtype: 'numberfield' } } , { dataIndex: 'COUNTRYID', header: '进口国', hidden: true, renderer: function (value, p, record) { if (value == null || value == '') return ''; else return record.data.COUNTRY; }, editor: this.comboxCountry, width: 120 } ]; this.girdcolums = this.columns; this.girdcolums = DsTruck.GetGridPanel(GID, this.formname, this.girdcolums, 0); //使用者id,表名,中间column数组,跳过一开始的几列 if (true) { } this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.CheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); this.formWMSINBody = new Ext.grid.GridPanel({ store: this.storeWMSIN, enableHdMenu: false, region: 'center', //layout: "border", //title: '费用明细', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, plugins: [this.cellEditing], selModel: this.CheckBoxModel, selType: 'cellmodel', features: [{ ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性 }], tbar: [{ xtype: 'label', text: '入库信息', style: 'font-size:18px', labelColor: '#099', //style:'background-color: #4b9bf5', x: '5%', y: '5%' }, { text: '增加入库信息', id: "add1", tooltip: '增加入库信息', iconCls: "btnadddetail", handler: function (button, event) { if (Ext.getCmp('ISLOCK').getValue() == '1' || Ext.getCmp('ISLOCK').getValue() == 'True') { Ext.MessageBox.alert('提示', '已入账不允许修改!'); return; } this.onAddWMSINClick(button, event); }, scope: this }, { text: '删除入库信息', id: "del1", tooltip: '删除入库信息', iconCls: "btndeletedetail", handler: function (button, event) { if (Ext.getCmp('ISLOCK').getValue() == '1' || Ext.getCmp('ISLOCK').getValue() == 'True') { Ext.MessageBox.alert('提示', '已入账不允许修改!'); return; } this.onDelWMSINClick(button, event); }, scope: this }, '-', { text: '展开箱数', width: 46, xtype: 'label' }, { id: 'zkxs', width: 80, xtype: 'numberfield', style: 'direction:rtl', align: 'right', value: 0 }, { text: '展开箱号信息', id: "updetail", tooltip: '取选中的箱号的最后一段数字位(例如12-30ab456中的456),和展开箱数,将其展开成单个记录', //iconCls: "btndeletedetail", handler: function (button, event) { if (Ext.getCmp('ISLOCK').getValue() == '1' || Ext.getCmp('ISLOCK').getValue() == 'True') { Ext.MessageBox.alert('提示', '已入账不允许修改!'); return; } this.onUpDetailClick(button, event); }, scope: this }, '-', { text: '生成费用', id: "createcost", hidden: true, tooltip: '生成费用', handler: function (button, event) { this.onCreateCostClick(button, event); }, scope: this }, { // id: "saveandclose", text: "保存", hidden: true, iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, '-', { text: "保存列表样式", menu: [{ text: "保存", handler: function (button, event) { _this.girdcolums = DsTruck.SaveGridPanel(GID, _this.formname, _this.formWMSINBody.columns, _this.girdcolums, 0, true); //使用者id,表名,中间column数组,跳过一开始的几列 } }, { text: "初始化", handler: function (menu, event) { _this.formWMSINBody.reconfigure(_this.storeWMSIN, _this.columns); _this.girdcolums = DsTruck.SaveGridPanel(GID, _this.formname, _this.formWMSINBody.columns, _this.columns, 0, true); //使用者id,表名,中间column数组,跳过一开始的几列 } }], scope: this }], columns: this.girdcolums, listeners: { 'beforeedit': function (o) { if (Ext.getCmp('ISLOCK').getValue() == '1' || Ext.getCmp('ISLOCK').getValue() == 'True') { return false; } } } }); //////////////////////////////////////////////明细<<<< WMS_In列表 >>>>结束 //#endregion //#endregion //#region 出库信息 //#region formSearch 下拉框信息加载 this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustCode.load(); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '客户名称', //需求编号:SR2017071300002-2 store: this.storeCustCode, forceSelection: true, name: 'CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(""); } } } }); //所属仓库 this.storeSTORAGENAME = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeSTORAGENAME.load({ params: { condition: " ISWAREHOUSE=1 "} }); this.comboxSTORAGENAME = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '仓库名称', store: this.storeSTORAGENAME, forceSelection: true, name: 'STORAGENAME', valueField: 'CustName', displayField: 'CodeAndName', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(""); } } } }); //品名 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(""); } } } }); //品名明细表_规格 this.storeCodeGoodsDetailList = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CodeGoodsDetailModel', proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsDetailList' } }); this.storeCodeGoodsDetailList.load(); this.comboxCodeGoodsDetail = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '单位', //品牌 store: this.storeCodeGoodsDetailList, //forceSelection: true, name: 'GOODSDETAILNAME', valueField: 'GOODSDETAILNAME', displayField: 'GOODSDETAILNAME', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onRefreshClick(""); } } } }); //#endregion //#region formSearch 查询面板 this.formSearch = Ext.widget('form', { title: '查询信息', frame: true, //collapsible: true, //将激活折叠功能 region: 'north', border: false, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 60, msgTarget: 'qtip' }, items: [{//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '入库单号', name: 'WMSNO', editable: false, enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'keyup': { fn: function (_field, e) { if (e.getKey() == 13) { this.onRefreshClick(""); } }, scope: this } // ,specialkey: function (field, e) { // if (e.getKey() == e.ENTER) { // _this.onRefreshClick(""); // } // } } }, { fieldLabel: '批次号', name: 'PICIHAO', editable: false, enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'keyup': { fn: function (_field, e) { if (e.getKey() == 13) { if (this.pcnostr == "") this.pcnostr = "'" + _field.value + "'"; else this.pcnostr = this.pcnostr + ",'" + _field.value + "'"; this.formSearch.getForm().findField('PICIHAO').setValue(''); // this.formSearch.getForm().findField('PICIHAO').emptyText = this.pcnostr; } }, scope: this } } }, { fieldLabel: '箱号', name: 'CNTRNO', editable: false, enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'keyup': { fn: function (_field, e) { if (e.getKey() == 13) { if (this.boxnostr == "") this.boxnostr = "'" + _field.value + "'"; else this.boxnostr = this.boxnostr + ",'" + _field.value + "'"; this.formSearch.getForm().findField('CNTRNO').setValue(''); // this.formSearch.getForm().findField('PICIHAO').emptyText = this.pcnostr; } }, scope: this } } }, this.comboxCustCode, this.comboxSTORAGENAME, this.comboxGOODSNAME, this.comboxCodeGoodsDetail , { xtype: 'button', width: 80, text: "执行查询", iconCls: "btnrefresh", handler: function (button, event) { this.onRefreshClick(button, event); }, scope: this }, { xtype: 'button', width: 80, text: "重置条件", iconCls: "btnreset", handler: function (button, event) { this.onClearSql(button, event); this.pcnostr = ""; this.boxnostr = ""; }, scope: this }] }]//end items(fieldset 1) }]//end root items }); //#endregion formSearch //#region 编辑formWMSOUT 基本信息 this.formWMSOUT = Ext.widget('form', { title: this.outType, //'出库信息', frame: true, region: 'north', border: false, fieldDefaults: { margins: '2 2 2 2', labelAlign: 'right', flex: 1, labelWidth: 90, msgTarget: 'qtip' }, items: [{//fieldset 1 xtype: 'container', defaultType: 'textfield', layout: 'anchor', defaults: { anchor: '100%' }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '出库主表GID', name: 'OUTGID', hidden: true }, { fieldLabel: '出库单号', name: 'OUTBSNO_OUT', editable: true, readOnly: false, disabled: false }, { fieldLabel: '出库日期', name: 'DODATE_OUT', xtype: 'datefield', format: 'Y-m-d', value: currdate.format('yyyy-MM-dd'), editable: false, allowBlank: false, listeners: { select: function (dfield, records, eOpts) { var sDODATE_OUT = dfield.rawValue; Ext.getCmp('OLDCUSTFEEDATE').setValue(sDODATE_OUT); } } }, { fieldLabel: '结束计费日期', //需求编号:SR2017073000001 id: 'OLDCUSTFEEDATE', hidden: true, name: 'OLDCUSTFEEDATE', xtype: 'datefield', format: 'Y-m-d', value: currdate.format('yyyy-MM-dd'), editable: false, allowBlank: false }, this.comboxCLIENTNAMEOLD, this.comboxARCLIENTWMSOUT, this.comboxARCLIENT //需求编号:SR2017073000001 , { fieldLabel: '会计期间', name: 'ACCDATE_OUT', xtype: 'monthfield', format: 'Y-m', value: currdate.format('yyyy-MM'), editable: false, allowBlank: false }, { fieldLabel: '备注', flex: 2, //需求编号:SR2017073000001 name: 'OUTREMARK' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [{ fieldLabel: '费用状态', hidden: true, readOnly: true, disabled: true, name: 'FEESTATUSREF_OUT' }, this.comboxTRUCKNAME //需求编号:SR2017073000001 , { xtype: "checkbox", //checkbox控件 id: "cbCCF", name: "cbCCF", boxLabel: "", fieldLabel: "是否生成仓储费", hidden: true, inputValue: "true", //选中的值 uncheckedValue: "false", //未选中的值 checked: false //绘制时的选中状态 }] }]//end items(fieldset 1) }]//end root items }); //#endregion //#region 出库明细列表 //#region 定义数据集 this.storeDetailList = Ext.create('Ext.data.Store', { model: 'VwWmsDetailModel', remoteSort: true, proxy: { type: 'ajax', url: '/MvcShipping/WMSOUT_GuiGe/GetDetailList_Box', reader: { id: 'NID', root: 'data', totalProperty: 'totalCount' } } }); //#endregion //#region 列定义 this.initgirdDrcolums = [{ sortable: false, dataIndex: 'NID', header: '', //唯一编码 hidden: true, width: 0 }, { sortable: false, dataIndex: 'OUTBSNO_OUT', header: '出库单号', align: 'center', width: 80 }, { sortable: false, dataIndex: 'CNTRNO', header: '箱号', align: 'center', width: 80 }, { //需求编号:SR2017062600003 sortable: false, hidden: true, dataIndex: 'ISBONDEDNAME', header: '是否保税业务', align: 'center', width: 80 }, { sortable: false, dataIndex: 'CUSTOMERNAME', header: '客户名称', //需求编号:SR2017071300002-2 width: 120 }, { sortable: false, dataIndex: 'STORAGENAME', header: '所属仓库', width: 120 }, { sortable: false, hidden: true, dataIndex: 'BLNO', header: '提单号', width: 120 }, { sortable: false, dataIndex: 'PICIHAO', header: '批次号', width: 120 }, { sortable: false, dataIndex: 'WMSNO', header: '入库单号', width: 120 }, { sortable: false, dataIndex: 'WMSDATE', header: '入库时间', width: 80 }, { sortable: false, dataIndex: 'GOODSNAME', header: '品名', width: 120 }, { sortable: false, hidden: true, dataIndex: 'GOODSMODEL', header: '单位', //品牌,需求编号:SR2017061800001-12 width: 60 }, { sortable: false, hidden: true, dataIndex: 'GOODSSTANDARD', header: '规格', align: 'right', width: 60 }, { sortable: false, hidden: true, dataIndex: 'GOODSPACKSTOCK', header: '剩余件数', align: 'right', width: 80 }, { //需求编号:SR2017062200002 sortable: false, hidden: true, dataIndex: 'WeiWanShui', header: '未完税件数', align: 'right', width: 80 }, { sortable: false, hidden: true, dataIndex: 'GOODSNUM', header: '完税库存件数', //需求编号:SR2017062200002 align: 'right', width: 80 }, { sortable: false, hidden: true, dataIndex: 'GOODSPACKPFSL_OUT', header: '出库件数', align: 'right', width: 80, editor: { xtype: 'numberfield', allowBlank: false, selectOnFocus: true, //得到焦点时自动选择文本 allowDecimals: true, //允许输入小数 nanText: '请输入有效数值', value: 0, minValue: 0, //maxValue: 100000, keyNavEnabled: false, //键盘导航是否可用,启用后可以通过键盘的上下箭头调整数值 hideTrigger: true, //是否隐藏上下调节按钮 mouseWheelEnabled: false, //鼠标滚轮是否可用,启用后可以通过滚动鼠标滚轮调整数值 //step: 2,//通过调节按钮、键盘、鼠标滚轮调节数值时的大小 enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'keyup': { fn: function (_field, e) { if (e.getKey() == 13) { this.onNextKeyClick(13); } }, scope: this } } } }, { //需求编号:SR2017061800001-7,SR2017071100001 sortable: false, hidden: true, dataIndex: 'GOODSSLICE_OUT', header: '出库包装件数', align: 'right', width: 80 } , { sortable: false, dataIndex: 'GOODSSTOCK', header: '剩余库存', width: 80 } , { sortable: false, dataIndex: 'GOODSPFSL_OUT', header: '出库量', align: 'right', width: 80, editor: { xtype: 'numberfield', allowBlank: false, selectOnFocus: true, //得到焦点时自动选择文本 allowDecimals: true, //允许输入小数 nanText: '请输入有效数值', value: 0, minValue: 0, //maxValue: 100000, keyNavEnabled: false, //键盘导航是否可用,启用后可以通过键盘的上下箭头调整数值 hideTrigger: true, //是否隐藏上下调节按钮 mouseWheelEnabled: false, //鼠标滚轮是否可用,启用后可以通过滚动鼠标滚轮调整数值 //step: 2,//通过调节按钮、键盘、鼠标滚轮调节数值时的大小 enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'keyup': { fn: function (_field, e) { if (e.getKey() == 13) { this.onNextKeyClick(14); } }, scope: this } } } }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'QianFengNO', header: '铅封号', width: 100, editor: { xtype: 'textfield', selectOnFocus: true, enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'keyup': { fn: function (_field, e) { if (e.getKey() == 13) { this.onNextKeyClick(15); } }, scope: this } } } }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'TRUCKNO_OUT', header: '车号', width: 100, editor: { xtype: 'textfield', selectOnFocus: true, enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'keyup': { fn: function (_field, e) { if (e.getKey() == 13) { this.onNextKeyClick(15); } }, scope: this } } } }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'TRUCKTYPE_OUT', header: '车辆类型', width: 100, editor: this.comboxTRUCKTYPE }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'ZHUANGXIEGONGID_OUT', header: '装卸工', width: 100, editor: this.comboxZhuangXieGong }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'TRUCKKGS_OUT', header: '平均重量', value: '0', width: 80 }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'ARFEE_OUT', header: '铅封费', align: 'right', width: 100, summaryType: 'sum', editor: { xtype: 'numberfield', allowBlank: false, selectOnFocus: true, //得到焦点时自动选择文本 allowDecimals: true, //允许输入小数 nanText: '请输入有效小数', minValue: -999999999.99, maxValue: 999999999.99, value: 0.00, keyNavEnabled: false, //键盘导航是否可用,启用后可以通过键盘的上下箭头调整数值 hideTrigger: true, //是否隐藏上下调节按钮 mouseWheelEnabled: false //鼠标滚轮是否可用,启用后可以通过滚动鼠标滚轮调整数值 //step: 2,//通过调节按钮、键盘、鼠标滚轮调节数值时的大小 }, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; } }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'ARFEE_2_OUT', header: '过磅费', align: 'right', width: 100, summaryType: 'sum', editor: { xtype: 'numberfield', allowBlank: false, selectOnFocus: true, //得到焦点时自动选择文本 allowDecimals: true, //允许输入小数 nanText: '请输入有效小数', minValue: -999999999.99, maxValue: 999999999.99, value: 0.00, keyNavEnabled: false, //键盘导航是否可用,启用后可以通过键盘的上下箭头调整数值 hideTrigger: true, //是否隐藏上下调节按钮 mouseWheelEnabled: false //鼠标滚轮是否可用,启用后可以通过滚动鼠标滚轮调整数值 //step: 2,//通过调节按钮、键盘、鼠标滚轮调节数值时的大小 }, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; } }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'GOODSOUTFEE_OUT', header: '应收仓储费', align: 'right', width: 100, summaryType: 'sum', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; } }, { //需求编号:SR2017073000001 sortable: false, hidden: true, dataIndex: 'GOODSOUTFEEAP_OUT', header: '应付仓储费', align: 'right', width: 100, summaryType: 'sum', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; }, summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { value = usMoney(value, 2, '', true); return value; } }, { sortable: false, hidden: true, dataIndex: 'REMARK_OUT', header: '备注', width: 300, editor: { xtype: 'textfield', selectOnFocus: true, enableKeyEvents: true, //激活键盘事件 listeners: { scope: this, 'keyup': { fn: function (_field, e) { if (e.getKey() == 13) { this.onNextKeyClick(15); } }, scope: this } } } }, { sortable: false, hidden: true, dataIndex: 'CHIMA1', header: '尺码1', width: 120 }, { sortable: false, hidden: true, dataIndex: 'CHIMA2', header: '尺码2', width: 120 }, { sortable: false, hidden: true, dataIndex: 'GOODSKGS', header: '重量', width: 120 }, { sortable: false, hidden: true, dataIndex: 'ZHONGLIANG2', header: '重量2', width: 120 }, { sortable: false, hidden: true, dataIndex: 'WMSGID', header: '入库GID', hidden: true, width: 0 }, { sortable: false, hidden: true, dataIndex: 'GID', header: '入库明细GID', hidden: true, width: 0 }, { sortable: false, hidden: true, dataIndex: 'OUTGID', header: '出库GID', hidden: true, width: 0 }, { sortable: false, hidden: true, dataIndex: 'GID_OUT', header: '出库明细GID', hidden: true, width: 0 }, { sortable: false, hidden: true, dataIndex: 'BSNO_OUT', header: '出库明细单号', hidden: true, width: 0 }, { sortable: false, hidden: true, dataIndex: 'ASSOCIATEDNO', header: '业务GID', hidden: true, width: 0 }, { sortable: false, hidden: true, dataIndex: 'GOODSNAMEID', header: '品名gid', hidden: true, width: 0 }, { sortable: false, dataIndex: 'WHS_CODE', header: '库别', hidden: true, width: 0 }, { sortable: false, dataIndex: 'AREANAME', header: '储位', hidden: true, width: 0 }, { sortable: false, dataIndex: 'BZTCHNO', header: '电子账册号', hidden: true, width: 0 }, { sortable: false, dataIndex: 'CUSTOMNO', header: '报关单号', hidden: true, width: 0 }, { //需求编号:SR2017061900001-1 sortable: false, dataIndex: 'ISBONDED', header: '是否报税业务', hidden: true, width: 0 }, { sortable: false, dataIndex: 'GOODSPACKPFSL_OUT_2', header: '出库件数_用于判断', align: 'right', width: 0 }, { //需求编号:SR2017073000001 sortable: false, dataIndex: 'CHARGEUNIT', header: '入库计费单位', hidden: true, width: 0 }, { sortable: false, dataIndex: 'COUNTRY', header: '进口国', align: 'left', width: 120 }]; this.girdcolums = this.initgirdDrcolums; this.girdcolums = DsTruck.GetGridPanel(GID, this.formname_out, this.girdcolums, 0); //使用者id,表名,中间column数组,跳过一开始的几列 //#endregion //#region gridList列表显示信息 this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 //1单击,2双击 }); this.gridList = new Ext.grid.GridPanel({ region: 'center', store: this.storeDetailList, enableHdMenu: false, //是否显示表格列的菜单 hideHeaders: false, //是否隐藏表头 enableColumnHide: true, ///隐藏表头列 sortableColumns: false, ///隐藏表头排序 //disableSelection: false, //是否禁止选择表格行或列,默认为false //trackMouseOver: true, //高亮显示鼠标所在的行,默认为true, //stripeRows: true, //斑马线效果 rowLines: true, columnLines: true, loadMask: { msg: "数据加载中,请稍等..." }, plugins: [this.gridListCellEditing], selType: 'cellmodel', columns: this.girdcolums, features: [{ ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性 }], tbar: [{ text: "保存列表样式", menu: [{ text: "保存", handler: function (button, event) { //_thisfee.girdDrcolums = DsTruck.SaveGridPanel(GID, 'FEEDRGRID', _thisfee.gridDrChFee.columns, _thisfee.girdDrcolums, 0, true); _this.girdcolums = DsTruck.SaveGridPanel(GID, _this.formname_out, _this.gridList.columns, _this.girdcolums, 0, true); //使用者id,表名,中间column数组,跳过一开始的几列 } }, { text: "初始化", handler: function (menu, event) { //_thisfee.gridDrChFee.reconfigure(this.storeList, _thisfee.initgirdDrcolums); //_thisfee.girdDrcolums = DsTruck.SaveGridPanel(GID, 'FEEDRGRID', _thisfee.gridDrChFee.columns, _thisfee.initgirdDrcolums, 0, true); _this.gridList.reconfigure(_this.storeDetailList, _this.initgirdDrcolums); _this.girdcolums = DsTruck.SaveGridPanel(GID, _this.formname_out, _this.gridList.columns, _this.initgirdDrcolums, 0, true); //使用者id,表名,中间column数组,跳过一开始的几列 } }], scope: this }], listeners: { scope: this, 'edit': function (editor, e, eOpts) { if (e.value == e.originalValue) { return; } if (e.field == "GOODSPACKPFSL_OUT") { //需求编号:SR2017073000001 var dlOriginalValue = e.originalValue; if (this.OpStatus == 'edit') { dlOriginalValue = e.record.data['GOODSPACKPFSL_OUT_2']; //需求编号:SR2017073000001 } // var dlGOODSPACKPFSL_OUT = e.value; //出库件数 var blISBONDED = e.record.data['ISBONDED'].toString(); //是否报税业务//需求编号:SR2017061900001-1 if (blISBONDED == "true") { //需求编号:SR2017073000001 var dlGOODSNUM = e.record.data['GOODSNUM'].toString(); //完税件数 if (this.OpStatus == 'edit') { dlGOODSNUM = e.record.data['GOODSNUM'] + dlOriginalValue; //完税件数 } if (dlGOODSPACKPFSL_OUT > dlGOODSNUM) { e.record.set('GOODSPACKPFSL_OUT', dlOriginalValue); Ext.Msg.show({ title: '警告', msg: '注意:出库件数不能大于完税件数!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); } } //需求编号:SR2017073000001 var dlGOODSPACKSTOCK = e.record.data['GOODSPACKSTOCK'].toString(); //剩余件数 if (this.OpStatus == 'edit') { dlGOODSPACKSTOCK = e.record.data['GOODSPACKSTOCK'] + dlOriginalValue; //剩余件数 } if (dlGOODSPACKPFSL_OUT > dlGOODSPACKSTOCK) { e.record.set('GOODSPACKPFSL_OUT', dlOriginalValue); Ext.Msg.show({ title: '警告', msg: '注意:出库件数不能大于剩余件数!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); } //需求编号:SR2017073000001 var rqWMSDATE = e.record.data['WMSDATE']; //入库日期 var rqDODATE_OUT = this.formHead.getForm().findField('DODATE_OUT').getRawValue(); //出库日期 if (rqWMSDATE > rqDODATE_OUT) { e.record.set('GOODSPACKPFSL_OUT', dlOriginalValue); Ext.Msg.show({ title: '警告', msg: '注意:出库日期不能小于入库日期!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); } // if (this.formHead.getForm().findField('CLIENTNAMEOLD').getValue() == undefined || this.formHead.getForm().findField('CLIENTNAMEOLD').getValue().toString().trim() == "") { this.formHead.getForm().findField('CLIENTNAMEOLD').setValue(e.record.data['CUSTOMERNAME'].toString()); //转移对象 } if (this.formHead.getForm().findField('ARCLIENTWMSOUT').getValue() == undefined || this.formHead.getForm().findField('ARCLIENTWMSOUT').getValue().toString().trim() == "") { this.formHead.getForm().findField('ARCLIENTWMSOUT').setValue(e.record.data['CUSTOMERNAME'].toString()); //应收仓储客户 } if (this.formHead.getForm().findField('ARCLIENT').getValue() == undefined || this.formHead.getForm().findField('ARCLIENT').getValue().toString().trim() == "") { this.formHead.getForm().findField('ARCLIENT').setValue(e.record.data['CUSTOMERNAME'].toString()); //应收出库客户 } } else if (e.field == "GOODSPFSL_OUT") {//需求编号:SR2017073000001 var dlGOODSPFSL_OUT = e.value; //出库量 var dlGOODSPACKPFSL_OUT = e.record.data['GOODSPACKPFSL_OUT'].toString(); //出库件数 if (dlGOODSPACKPFSL_OUT == 0) { e.record.set('TRUCKKGS_OUT', 0); } else { var dlTRUCKKGS_OUT = parseFloat(dlGOODSPFSL_OUT / dlGOODSPACKPFSL_OUT).toFixed(4); e.record.set('TRUCKKGS_OUT', dlTRUCKKGS_OUT); } // if (this.formHead.getForm().findField('CLIENTNAMEOLD').getValue() == undefined || this.formHead.getForm().findField('CLIENTNAMEOLD').getValue().toString().trim() == "") { this.formHead.getForm().findField('CLIENTNAMEOLD').setValue(e.record.data['CUSTOMERNAME'].toString()); //转移对象 } if (this.formHead.getForm().findField('ARCLIENTWMSOUT').getValue() == undefined || this.formHead.getForm().findField('ARCLIENTWMSOUT').getValue().toString().trim() == "") { this.formHead.getForm().findField('ARCLIENTWMSOUT').setValue(e.record.data['CUSTOMERNAME'].toString()); //应收仓储客户 } if (this.formHead.getForm().findField('ARCLIENT').getValue() == undefined || this.formHead.getForm().findField('ARCLIENT').getValue().toString().trim() == "") { this.formHead.getForm().findField('ARCLIENT').setValue(e.record.data['CUSTOMERNAME'].toString()); //应收出库客户 } } } } }); this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) { var condition2 = "WMSOUTGID='" + record.data.OUTGID + "' and ASSOCIATEDNO='" + record.data.GID_OUT + "'"; this.storeWmsRateDetailList.load({ params: { condition: condition2 }, waitMsg: "正在刷新数据...", timeout: 6000000, //60秒 scope: this }); }, this); //#endregion //#endregion //#endregion //#region 布局 this.panelTop = new Ext.Panel({ layout: "border", region: "north", height: 340, items: [this.panelBtn, this.formEdit] }); this.panelFee = new Shipping.FeeEditGrid({ region: 'center', layout: 'border' }); this.panelFee.stroplb = 'tMsWlPcHead'; this.panelFee.StoreCustType.add({ "SCUSTTYPE": "WTDW-委托单位", "CUSTTYPE": "委托单位", "CUSTNAME": "CUSTOMERNAME" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CD-车队", "CUSTTYPE": "车队", "CUSTNAME": "F_CustomerName" }); this.panelFee.StoreDrOpRange.load({ params: { optype: "modOtherRecvFeeManagement"} }); this.panelFee.StoreCrOpRange.load({ params: { optype: "modOtherRecvFeeManagement"} }); this.panelFee.storeFeeNameRef.load({ params: { condition: "ISTRUCKING='1' "} }); this.page_1 = new Ext.Panel({ id: "page_1", title: "费用信息", layout: "border", region: 'center', items: [this.panelFee] }); this.page_2 = new Ext.Panel({ id: "page_2", autoScroll: true, title: "入库信息", layout: "border", region: 'center', items: [this.formEdit_WMSIN, this.formWMSINBody ] }); this.page_3 = new Ext.Panel({ id: "page_3", autoScroll: true, title: "出库信息", layout: "border", region: 'center', items: [this.formSearch, this.formWMSOUT, this.gridList ] }); this.MainTab = new Ext.tab.Panel({ //id: "MainTab", layout: "border", region: "center", split: true, items: [this.page_1//, this.page_2, this.page_3 ] }); Ext.apply(this, { items: [this.panelTop, this.MainTab] }); var _this = this; var el = Ext.getBody(); function fn1() { _this.Save('2'); Ext.getCmp('PcBillType').readOnly = false; } function fn2() { var basicForm = _this.formEdit.getForm(); _this.OpStatus = 'add'; basicForm.findField('gId').setDisabled(false); var field = basicForm.findField('gId'); var BSNO = 'PC' + NewGuid(); var oldbsno = field.getValue(); var oldmasterno = basicForm.findField('PGid').getValue(); field.setValue(BSNO); if (oldbsno == "" || oldbsno == oldmasterno) { field = basicForm.findField('PGid'); field.setValue(BSNO); } field = basicForm.findField('BillNo'); field.setValue(''); //清空费用 var data = basicForm.getValues(); editp = Ext.create('PCmb', data); this.LoadFeeData(editp); } function fn3() { _this.onMakeFeeClick(); } el.addKeyMap({ key: "1", ctrl: true, fn: fn1, scope: el }); el.addKeyMap({ key: "2", ctrl: true, fn: fn2, scope: el }); el.addKeyMap({ key: "3", ctrl: true, fn: fn3, scope: el }); //#endregion parentWin = window.parent.opener; this.InitData(); this.formWMSINBody.on('edit', function (editor, e, eOpts) { this.WMSINAfterEdit(editor, e, eOpts); }, this); }, //end initUIComponents //#region 加载数据 InitData: function () { this.OpStatus = 'add'; var condition = ''; var wmscondition = ''; var wmsoutcondition = ' 1=0'; if (parentWin) { var ret = parentWin.OprationSwap(); this.OpStatus = ret[0]; this.StoreList = ret[1]; this.editRecord = ret[2]; this.selectPGID = ret[3]; } if (this.OpStatus == 'edit') { condition = " BillNo='" + this.editRecord.get('BillNo') + "'"; wmscondition = " BLNO='" + this.editRecord.get('BillNo') + "'"; wmsoutcondition = " OUTBSNO_OUT='" + this.editRecord.get('BillNo') + "'"; Ext.getCmp('PcBillType').readOnly = true; } else { //如果不是编辑 则将派车类型设为可写 //id: 'PcBillType' Ext.getCmp('PcBillType').readOnly = false; } this.LoadData(this.OpStatus, condition, wmscondition, wmsoutcondition); }, //end InitData LoadData: function (OpStatus, condition, wmscondition, wmsoutcondition) { this.OpStatus = OpStatus; //获取派车信息 Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/TruckMng/PcHeadEdit_LTJY/GetData', //async:false, 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; } var data = result.data; this.formEdit.getForm().reset(); this.formEdit.getForm().setValues(data); this.formEdit.getForm().findField('GoodsName').setValue(this.getGoodsname(data.GoodsName)); if (this.selectPGID != '') { var PGid = this.formEdit.getForm().findField('PGid'); PGid.setValue(this.selectPGID); if (this.editRecord != NaN && this.editRecord != null) { this.formEdit.getForm().findField('CustomerName').setValue(this.editRecord.get('CustomerName')); this.formEdit.getForm().findField('F_CustomerName').setValue(this.editRecord.get('F_CustomerName')); this.formEdit.getForm().findField('LinkMan').setValue(this.editRecord.get('LinkMan')); this.formEdit.getForm().findField('CustName').setValue(this.editRecord.get('CustName')); this.formEdit.getForm().findField('DispatchName').setValue(this.editRecord.get('DispatchName')); this.formEdit.getForm().findField('BLTYPE').setValue('派车分票'); this.formEdit.getForm().findField('DstArea').setValue(this.editRecord.get('DstArea')); this.formEdit.getForm().findField('DetiNation').setValue(this.editRecord.get('DetiNation')); this.formEdit.getForm().findField('LoadPlace').setValue(this.editRecord.get('LoadPlace')); this.formEdit.getForm().findField('PcBillType').setValue(this.editRecord.get('PcBillType')); this.formEdit.getForm().findField('ExpDate').setValue(this.editRecord.get('ExpDate')); this.formEdit.getForm().findField('ArriveDate').setValue(this.editRecord.get('ArriveDate')); this.formEdit.getForm().findField('ReturnDate').setValue(this.editRecord.get('ReturnDate')); this.formEdit.getForm().findField('TruckNo').setValue(this.editRecord.get('TruckNo')); } } if (data.PCSTATUSREF != '完成') { this.setSaveBtnStatus(true); } else { this.setSaveBtnStatus(false); } var editp = Ext.create('PCmb', data); // if (this.OpStatus == 'add') { // var arrNewRecords = this.StoreList.insert(0, data); // this.editRecord = arrNewRecords[0]; // } // else if (this.OpStatus == 'edit') { // var editp = Ext.create('PCmb', data); // 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.LoadFeeData(editp); this.LoadPrice(); if (data.CustomerName != '') { var s = " LINKID in (select gid from [info_client] where SHORTNAME='" + data.CustomerName + "')"; //this.storeInfoClientContact.load({ params: { condition: s} }); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); var _this = this; if (this.OpStatus == 'add') { this.SetTabShow(''); } if (this.OpStatus == 'edit') { this.SetTabShow(this.editRecord.get('PcBillTypeREF')); } //if ((this.OpStatus == 'edit') && (this.editRecord.get('PcBillType') == "入库")) { //获取BLNO为派车单billno的wms(入库信息) if (this.GetTabShow("入库") == "入库") { Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/WMSNew/GetData', params: { handle: OpStatus, condition: wmscondition }, 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; } WMSNOManual = result.WMSNOManual; if (WMSNOManual == '1') { document.getElementById("WMSNO-inputEl").removeAttribute("readonly"); } else { Ext.getCmp('WMSNO').readOnly = true; } var timeStamp = result.timeStamp; timeStamp = timeStamp.replace(/\//g, '-'); //格式化时分秒 var y = ''; var m = ''; var d = ''; var timetemp = timeStamp.split('-'); y = timetemp[0]; if (timetemp[1].length < 2) { m = '0' + timetemp[1]; } else { m = timetemp[1]; } if (timetemp[2].length < 2) { d = '0' + timetemp[2]; } else { d = timetemp[2]; } var timeStampFin = y + '-' + m + '-' + d; TIMESTAMP = timeStampFin; timeStamp = timeStampFin; var data = result.data; var blno = data.BLNO; BLNO = data.BLNO; CNTRNO = data.CNTRNO; CTNALL = data.CTNALL; SEALNO = data.SEALNO; PKGS = data.PKGS; if (this.OpStatus == 'add') { data.ASSOCIATEDNO = ""; data.CORPID = COMPANYID; data.DEPTNAME = DEPTGID; data.CUSTOMERNAME = ""; data.BLNO = ""; data.CUSTOMNO = ""; data.CONTRACTNO = ""; data.ARCLIENT = ""; data.GOODSNAME = ""; data.CREATEUSER = USERID; data.CREATETIME = timeStamp; data.WMSDATE = timeStamp; data.FREESTORAGEPERIOD = "0"; data.STARTBILLINGDATE = timeStamp; data.FREESTORAGEPERIODAP = "0"; data.STARTBILLINGDATEAP = timeStamp; data.MARKETVALUE = "0"; data.BANKVALUE = "0"; data.GOODSPACK = "0"; data.GOODSPACKSTOCK = "0"; data.GOODSRKSL = "0"; data.GOODSSTOCK = "0"; data.ARFEE = "0"; data.APFEE = "0"; data.GOODSPACKACTUAL = "0"; data.GOODSRKSLACTUAL = "0"; data.CHARGEUNIT = "箱"; } var basicForm = this.formEdit_WMSIN.getForm(); this.formEdit_WMSIN.getForm().setValues(data); if (data.GID == "") { data.GID = "0" } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); //request over if (this.OpStatus == 'edit') { var BillNo = this.editRecord.get('BillNo'); this.storeWMSIN.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: " ASSOCIATEDNO=(select gid from wms where blno='" + BillNo + "')" }, waitMsg: "正在查询数据...", scope: this }); } } //出库信息 if (this.GetTabShow("出库") == "出库") { Ext.Ajax.request({ waitMsg: '正在查询数据...', url: '/MvcShipping/WMSOUT_GuiGe/GetData_Box', params: { condition: wmsoutcondition }, 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.INFO, buttons: Ext.Msg.OK }); return; } // data = result.data; this.formWMSOUT.getForm().findField('OUTGID').setDisabled(false); this.formWMSOUT.getForm().reset(); this.formWMSOUT.getForm().setValues(data); this.formWMSOUT.getForm().findField('OLDCUSTFEEDATE').setValue(data.OLDCUSTFEEDATE.toString().substring(0, 10)); this.formWMSOUT.getForm().findField('OUTGID').setDisabled(true); // var detailcondition = "OUTBSNO_OUT='" + data.OUTBSNO_OUT + "'"; this.storeDetailList.load({ params: { start: 0, limit: this.PageSize, sort: '', opStatus: this.OpStatus, condition: detailcondition }, waitMsg: "正在刷新数据...", timeout: 6000000, //60秒 scope: this }); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } //} }, // end LoadDate LoadFeeData: function (EditRecord) { this.panelFee.EditRecord = EditRecord; var bsno = EditRecord.get('gId'); this.panelFee.strBSNO = bsno; this.panelFee.StoreDateCurr.load({ params: { optype: "tMsWlPcHead", bsno: bsno} }); this.panelFee.StoreUnit.load({ params: { bsno: bsno, bstype: "tMsWlPcHead"} }); this.panelFee.storeDrChFee.load({ params: { billno: bsno, type: 1, optype: "tMsWlPcHead"} }); this.panelFee.storeCrChFee.load({ params: { billno: bsno, type: 2, optype: "tMsWlPcHead"} }); this.panelFee.storeBodySum.load({ params: { bsno: bsno, optype: "tMsWlPcHead" }, callback: function (r, options, success) { if (success) { _thisfee.setTotalHead(); } } }); this.panelFee.storeChFeeGain.load({ params: { bsno: bsno, optype: "tMsWlPcHead"} }); }, // end LoadDate LoadPrice: function () { var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } var sql = ''; var data = basicForm.getValues(); BsType = data.BsType; DetiNation = data.DetiNation; CustomerName = data.CustomerName; Ton = data.Ton; this.storePrice.removeAll(); Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/TruckMng/LTJYDistance/GetPriceList', params: { BsType: BsType, DetiNation: DetiNation, CUSTOMERNAME: CustomerName }, 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 data = result.data; if (parseFloat(data.PRICE) > 0) { Ext.getCmp("PriceList").setText("当前计费方式:客户:" + data.CUSTOMERNAME + " 目的地:" + data.NAME + " 收费方式:" + data.PRICETYPE + " 单价:" + data.PRICE + " 里程:" + data.DISTANCE + " "); this.storePrice.add(data); Ext.getCmp('button_makefee').show(); Ext.getCmp('BLTYPE').setValue(data.PRICETYPE); } else { Ext.getCmp("PriceList").setText(""); Ext.getCmp('button_makefee').hide(); Ext.getCmp('BLTYPE').setValue(data.PRICETYPE); } this.MakeFeeJS(); } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); }, MakeFeeJS: function () { var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } basicForm.findField('BillNo').setDisabled(false); var data = basicForm.getValues(); basicForm.findField('BillNo').setDisabled(true); if (this.storePrice.getCount() > 0) { var pricedate = this.storePrice.getAt(0).data; var price = pricedate.PRICE; var wright = data.Ton; var QUANTITY = 0.0; var OverLoadMil = 0.0; //用于应收运费 //var remark = '重量单位:' + pricedate.PRICETYPE; if (pricedate.NAME == '') { if (pricedate.PRICETYPE == '吨') { QUANTITY = parseFloat(data.Ton) * parseFloat(data.RealMil); OverLoadMil = parseFloat(pricedate.PRICE) * parseFloat(data.Ton) * parseFloat(data.RealMil); } if (pricedate.PRICETYPE == '趟') { QUANTITY = 1; OverLoadMil = parseFloat(pricedate.PRICE); } } else { if (pricedate.PRICETYPE == '吨') { QUANTITY = parseFloat(data.Ton) * parseFloat(data.RealMil); OverLoadMil = parseFloat(pricedate.PRICE) * parseFloat(data.Ton) * parseFloat(data.RealMil); } if (pricedate.PRICETYPE == '公斤') { QUANTITY = parseFloat(data.Ton); OverLoadMil = parseFloat(pricedate.PRICE) * parseFloat(data.Ton); } if (pricedate.PRICETYPE == '趟') { QUANTITY = 1; OverLoadMil = parseFloat(pricedate.PRICE); } } Ext.getCmp("OverLoadMil").setValue(OverLoadMil); } }, //#endregion Save: function (type, needmakefee) { //this.MakeFeeJS(); var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } basicForm.findField('BillNo').setDisabled(false); var data = basicForm.getValues(); var GoodsName = this.comboxGoodsname.getValue() + ''; data.GoodsName = GoodsName; basicForm.findField('BillNo').setDisabled(true); Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/TruckMng/PcHeadEdit_LTJY/SaveLTJY', scope: this, async: false, params: { OpStatus: this.OpStatus, data: Ext.JSON.encode(data) }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { //保存费用 this.panelFee.onPostDetailClick('', '', 1); this.panelFee.onPostDetailClick('', '', 2); var returnData = jsonresult.Data; this.formEdit.getForm().setValues(returnData); this.formEdit.getForm().findField('GoodsName').setValue(this.getGoodsname(data.GoodsName)); if (returnData.PCSTATUSREF != '完成') { this.setSaveBtnStatus(true); } else { this.setSaveBtnStatus(false); } if (this.OpStatus == 'add') { var arrNewRecords = this.StoreList.insert(0, returnData); this.editRecord = this.StoreList.getAt(0); } 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(); } //此时执行保存入库信息 //20180526 改为不对出入库做任何操作。 /* var t_PcBillType = this.comboxPcBillType.getRawValue(); if (this.GetTabShow(t_PcBillType) == "入库") { this.Save_WMSIN('0'); } if (this.GetTabShow(t_PcBillType) == "出库") { this.Save_WMSOUT('0'); } */ if (type == '0') { this.OpStatus = 'edit'; basicForm.findField('BillNo').setDisabled(true); Ext.getCmp('PcBillType').readOnly = true; } else if (type == '1') { window.close(); } else { 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 //入库保存 Save_WMSIN: function (type) { var upForm = this.formEdit.getForm(); var basicForm = this.formEdit_WMSIN.getForm(); var wmsgid = basicForm.findField('GID').value; if (!basicForm.isValid()) { return; } var data = basicForm.getValues(); if (data.ISLOCK == "True" || data.ISLOCK == "1") { Ext.MessageBox.alert("提示", "已入账的入库信息不能进行修改") return; } if (data.ISLOCK2 == "True" || data.ISLOCK2 == "1") { Ext.MessageBox.alert("提示", "已锁定的入库信息不能进行修改") return; } if (COMPANYID == "" || DEPTGID == "") { Ext.MessageBox.alert("提示", "登录信息不全,请退出重新登录"); return; } // if (data.BLNO == '') { // Ext.MessageBox.alert('提示', '未关联提单号!请先执行查询操作进行关联!'); // return; // } var MARKETVALUE = 0; var BANKVALUE = 0; var WMSINdatas = []; for (var i = 0; i < this.storeWMSIN.getCount(); i += 1) { var member = this.storeWMSIN.getAt(i); WMSINdatas.push(member); MARKETVALUE = MARKETVALUE + parseFloat(member.data.MARKETVALUE); BANKVALUE = BANKVALUE + parseFloat(member.data.BANKVALUE); } basicForm.findField('MARKETVALUE').setValue(MARKETVALUE); basicForm.findField('BANKVALUE').setValue(BANKVALUE); var WMSINBody = ConvertRecordsToJson(WMSINdatas); var WMSINBodyDel = ConvertRecordsToJsonAll(this.WMSINBodyDel); var GOODSPACKSTOCK = 0; var GOODSSTOCK = 0; var GOODSPACK = 0; var GOODSRKSL = 0; var GOODSPACKACTUAL = 0; var GOODSRKSLACTUAL = 0; var MARKETVALUE = 0; var BANKVALUE = 0; var GOODSSLICE = 0; this.storeWMSIN.each(function (record) { GOODSPACKSTOCK = GOODSPACKSTOCK + parseFloat(record.get('GOODSPACKSTOCK')); GOODSSTOCK = GOODSSTOCK + parseFloat(record.get('GOODSSTOCK')); GOODSPACK = GOODSPACK + parseFloat(record.get('GOODSPACK')); GOODSRKSL = GOODSRKSL + parseFloat(record.get('GOODSRKSL')); GOODSSLICE = GOODSSLICE + parseFloat(record.get('GOODSSLICE')); GOODSPACKACTUAL = GOODSPACKACTUAL + parseFloat(record.get('GOODSPACKACTUAL')); GOODSRKSLACTUAL = GOODSRKSLACTUAL + parseFloat(record.get('GOODSRKSLACTUAL')); MARKETVALUE = MARKETVALUE + parseFloat(record.get('MARKETVALUE')); BANKVALUE = BANKVALUE + parseFloat(record.get('BANKVALUE')); }); // if (GOODSSLICE > PKGS) { // Ext.MessageBox.alert('提示', '入库件数已超出!'); // return; // } data.GOODSPACKSTOCK = GOODSPACKSTOCK; data.GOODSSTOCK = GOODSSTOCK; data.GOODSPACK = GOODSPACK; data.GOODSRKSL = GOODSRKSL; data.GOODSPACKACTUAL = GOODSPACKACTUAL; data.GOODSRKSLACTUAL = GOODSRKSLACTUAL; data.MARKETVALUE = MARKETVALUE; data.BANKVALUE = BANKVALUE; data.BLNO = Ext.getCmp('BillNo').getValue(); data.ARFEE = "0"; data.APFEE = "0"; var _this = this; //Ext.Msg.wait('正在保存数据, 请稍侯..'); WMSIN_OpStatus = this.OpStatus; if (data.WMSNO == "") { WMSIN_OpStatus = 'add'; } Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/WMSNew/Save', scope: this, async: false, params: { OpStatus: WMSIN_OpStatus, data: Ext.JSON.encode(data), WMSINBody: WMSINBody, WMSINBodyDel: WMSINBodyDel }, callback: function (options, success, response) { if (success) { //_this.comboxZhuangXieGong.setValue(''); //_this.comboxCheDui.setValue(''); Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { //保存费用 var data = jsonresult.Data; var returnData = jsonresult.Data; this.formEdit_WMSIN.getForm().setValues(returnData); /* if (this.OpStatus == 'add') { //var arrNewRecords = this.StoreList.add(returnData); //this.EditRecord = arrNewRecords[0]; } else if (this.OpStatus == 'edit') { var editp = Ext.create('WMSmb', returnData); this.EditRecord.fields.each(function (field) { if (field.persist) { name = field.name; //alert(name + ' -- ' + editp.get(name)); if (name != 'GID') this.EditRecord.set(name, editp.get(name)); } }, this); this.EditRecord.commit(); //this.onRefreshClick(button, event); }*/ this.storeWMSIN.commitChanges(); if (type == '0') { this.OpStatus = 'edit'; var GID = data.GID; //_this.panelFee.EditRecord = this.EditRecord; this.storeWMSIN.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: " ASSOCIATEDNO='" + GID + "'" }, waitMsg: "正在查询数据...", scope: this }); //var condition = " WMSNO='" + returnData.WMSNO + "'"; //WMSNO = returnData.WMSNO; //_this.LoadData(_this.OpStatus, condition); } else if (type == '1') {//保存并关闭 window.close(); } } 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'); } }); }, //#region 出库保存 Save_WMSOUT: function (type) { this.formWMSOUT.getForm().findField('OUTGID').setDisabled(false); var data = this.formWMSOUT.getForm().getValues(false, false, false); this.formWMSOUT.getForm().findField('OUTGID').setDisabled(true); outStatus = 'add'; if (data.OUTGID != "") { outStatus = 'edit'; } else { data.OUTBSNO_OUT = Ext.getCmp('BillNo').getValue(); //直接用派车单号作为出库单号 } var bodydatas = []; for (var i = 0; i < this.storeDetailList.getCount(); i += 1) { var dlGOODSPACKPFSL_OUT = this.storeDetailList.getAt(i).get("GOODSPACKPFSL_OUT"); //出库件数 var dlGOODSPFSL_OUT = this.storeDetailList.getAt(i).get("GOODSPFSL_OUT"); //出库立方 var dlGOODSNUM = this.storeDetailList.getAt(i).get("GOODSNUM"); //完税件数 var dlGOODSPACKSTOCK = this.storeDetailList.getAt(i).get("GOODSPACKSTOCK"); //剩余件数 if (this.OpStatus == 'edit') { dlGOODSNUM = this.storeDetailList.getAt(i).get("GOODSNUM") + dlGOODSPACKPFSL_OUT; //完税件数 dlGOODSPACKSTOCK = this.storeDetailList.getAt(i).get("GOODSPACKSTOCK") + dlGOODSPACKPFSL_OUT; //剩余件数 } //if (dlGOODSPACKPFSL_OUT != 0 || dlGOODSPFSL_OUT != 0) // && dlGOODSPFSL_OUT != 0 { var member = this.storeDetailList.getAt(i); member.data.ISLOCK = member.data.ISLOCK == true ? 1 : 0; member.data.ISLOCK2 = member.data.ISLOCK2 == true ? 1 : 0; member.data.ISBONDED = member.data.ISBONDED == true ? 1 : 0; member.data.ISDELETE = member.data.ISDELETE == true ? 1 : 0; bodydatas.push(member); } } if (bodydatas.length > 0) { var jsonBody = ConvertRecordsToJsonAll(bodydatas); Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/WMSOUT_GuiGe/SaveEdit_Box', params: { opStatus: outStatus, data: Ext.JSON.encode(data), body: jsonBody, outType: this.outType }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { if (this.OpStatus == 'add') { this.OpStatus = 'edit'; } var returnData = jsonresult.Data; var editp = Ext.create('VwWmsDetailModel', returnData); //this.InitData(); this.formWMSOUT.getForm().findField('OUTGID').setDisabled(false); this.formWMSOUT.getForm().findField('OUTGID').setValue(returnData.OUTGID); this.formWMSOUT.getForm().findField('OUTBSNO_OUT').setValue(returnData.OUTBSNO_OUT); this.formWMSOUT.getForm().findField('OLDCUSTFEEDATE').setValue(returnData.OLDCUSTFEEDATE.toString().substring(0, 10)); this.formWMSOUT.getForm().findField('OUTGID').setDisabled(true); // var condition = "OUTBSNO_OUT='" + returnData.OUTBSNO_OUT + "'"; this.storeDetailList.load({ params: { start: 0, limit: this.PageSize, sort: '', opStatus: this.OpStatus, condition: condition }, waitMsg: "正在刷新数据...", timeout: 6000000, //60秒 scope: this }); // //this.panelFee.show(); //显示按钮 // if (this.btnRefresh == null) { } else { var btn = opener.document.getElementById(this.btnRefresh.id); btn.click(); } } 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.WARNING, buttons: Ext.Msg.OK }); } }, scope: this }); } else { Ext.Msg.show({ title: '错误', msg: '请先确定出库数据是否正确,再重试!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } }, //end save //#endregion getCustName: function () { var custName = this.formEdit.getForm().findField('CustName'); return custName.getValue(); }, onSubmitAuditClick: function (button, event) { var records = this.feeGridCheckBoxModel.selected.items; DsTruck.MsChFeeAudit(records, 2, '正在提交审核数据, 请稍侯..'); }, PrevRecord: function () { var j = this.StoreList.indexOf(this.editRecord); if (j == 0) { Ext.Msg.show({ title: '警告', msg: '已是最前一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } if (j == this.StoreList.count) { Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } j = j - 1; this.editRecord = this.StoreList.getAt(j); // this.BsNo = this.editRecord.get('BSNO'); this.OpStatus = 'edit'; var condition = " BillNo='" + this.editRecord.get('BillNo') + "'"; this.LoadData(this.OpStatus, condition); }, NextRecord: function () { var j = this.StoreList.indexOf(this.editRecord); if (j == (this.StoreList.count - 1)) { Ext.Msg.show({ title: '警告', msg: '已是最后一票', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } j = j + 1; this.editRecord = this.StoreList.getAt(j); // this.BsNo = this.editRecord.get('BSNO'); this.OpStatus = 'edit'; var condition = " BillNo='" + this.editRecord.get('BillNo') + "'"; this.LoadData(this.OpStatus, condition); }, setSaveBtnStatus: function (enable) { var bsbtnSave = Ext.getCmp('bsbtnSave'); var bsbtnSaveAndClose = Ext.getCmp('bsbtnSaveAndClose'); var bsbtnSaveAndNew = Ext.getCmp('bsbtnSaveAndNew'); if (enable) { bsbtnSave.enable(); bsbtnSaveAndClose.enable(); bsbtnSaveAndNew.enable(); } else { bsbtnSave.disable(); bsbtnSaveAndClose.disable(); bsbtnSaveAndNew.disable(); } }, getFeeStatus: function () { var basicForm = this.formEdit.getForm(); var feeStatus = basicForm.findField('FeeStatus').value; return feeStatus; }, getBillStatus: function () { var basicForm = this.formEdit.getForm(); var billStatus = basicForm.findField('BillStatus').value; return billStatus; }, Print: function () { var basicForm = this.formEdit.getForm(); var billNo = basicForm.findField('BillNo').value; if (billNo == '*' || billNo == '') { Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } var gid = basicForm.findField('GId').value; Ext.Ajax.request({ waitMsg: '正在查询数据...', url: '/TruckMng/MsWlBs/GetIsPrint', async: false, params: { billno: billNo, Gid: gid }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (!result.Success) { Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); return; } else { var printType = 'MSWLBS'; var sql1 = "SET LANGUAGE 'us_english ' " + " select * from vMsWlBsHeadPrint WHERE BillNo = '" + billNo + "' order by BillNo"; var sql2 = "SET LANGUAGE 'us_english' SELECT * from ch_fee where BsNo='" + gid + "'"; //var sql3 = "SET LANGUAGE 'us_english' " // + " select * from vMsWlPcHeadPrint where RefBillNo='" + billNo + "' order by RefBillNo"; //var sql4 = "SET LANGUAGE 'us_english' select * from ch_fee where BSNO in (select Gid from tMswlpcHead where RefBillNo='" + billNo + "') order by BsNo"; var sql3 = "SET LANGUAGE 'us_english' select A.*,B.* from vMsWlPcHeadPrint A, ch_fee B where A.Gid=B.BsNo and A.RefBillNo='" + billNo + "' order by A.RefBillNo"; //var sql4 = "SET LANGUAGE 'us_english' select * from tMsWlPcFixed where BillNo in (select Gid from tMswlpcHead where RefBillNo='" + billNo + "') order by BillNo"; var sql4 = "SET LANGUAGE 'us_english' select A.*,B.* from vMsWlPcHeadPrint A,tMsWlPcFixed B where A.Gid=B.BillNo and A.RefBillNo='" + billNo + "' order by A.RefBillNo"; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); aft }, DispatchTruck: function () { }, setBtnOnlyQuery: function () { var bsbtnSave = Ext.getCmp('bsbtnSave'); var bsbtnSaveAndClose = Ext.getCmp('bsbtnSaveAndClose'); var bsbtnSaveAndNew = Ext.getCmp('bsbtnSaveAndNew'); var bsbtnNew = Ext.getCmp('bsbtnNew'); bsbtnSave.setVisible(false); bsbtnSaveAndClose.setVisible(false); bsbtnSaveAndNew.setVisible(false); bsbtnNew.setVisible(false); }, onMakeFeeClick: function (button, event) { if (this.storePrice.getCount() == 0) { return; } this.Save('0'); var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } basicForm.findField('BillNo').setDisabled(false); var data = basicForm.getValues(); basicForm.findField('BillNo').setDisabled(true); var pricedate = this.storePrice.getAt(0).data; var price = pricedate.PRICE; var wright = data.Ton; var QUANTITY = 0.0; var OverLoadMil = data.OverLoadMil; var LinkManSe = data.LinkManSe; if (LinkManSe == "") { LinkManSe = 0.0; } var LinkTelSe = data.LinkTelSe; if (LinkTelSe == "") { LinkTelSe = 0.0; } //if() var remark = '重量单位:' + pricedate.PRICETYPE; if (pricedate.NAME == '') { if (pricedate.PRICETYPE == '吨') { QUANTITY = parseFloat(data.Ton) * parseFloat(data.RealMil); remark = remark + ' , 计费重' + parseFloat(data.Ton) + '吨'; } if (pricedate.PRICETYPE == '趟') { QUANTITY = 1; remark = '按趟计费'; } } else { if (pricedate.PRICETYPE == '吨') { QUANTITY = parseFloat(data.Ton) * parseFloat(data.RealMil); remark = remark + ' , 计费重' + parseFloat(data.Ton) + '吨'; } if (pricedate.PRICETYPE == '公斤') { QUANTITY = parseFloat(data.Ton); remark = remark + ' ,' + Math.round(parseFloat(data.Ton)) + '公斤'; } if (pricedate.PRICETYPE == '趟') { QUANTITY = 1; remark = '按趟计费'; } } //(string BSNO, string FEENAME, string CUSTOMERNAME, string PRICETYPE, string QUANTITY, string PRICE) if (QUANTITY * price == OverLoadMil) { } else { QUANTITY = OverLoadMil/price; } Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ async: false, waitMsg: '正在保存数据...', url: '/TruckMng/PcHeadEdit_LTJY/MAKEFEE', scope: this, params: { BSNO: data.gId, FEENAME: '运费', CUSTOMERNAME: data.CustomerName, PRICETYPE: data.BsType, FEETYPE: "1", QUANTITY: QUANTITY, PRICE: price, REMARK: remark }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); //刷新费用列表 var editp = Ext.create('PCmb', data); this.LoadFeeData(editp); //this.storeBodyChFee.load({ params: { DELIVERYNO: DELIVERYNO} }); } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } //alert('03'); } }); if (parseFloat(LinkManSe) != 0.0) { Ext.Ajax.request({ async: false, waitMsg: '正在保存数据...', url: '/TruckMng/PcHeadEdit_LTJY/MAKEFEE', scope: this, params: { BSNO: data.gId, FEENAME: '应收提送费', CUSTOMERNAME: data.CustomerName, PRICETYPE: "单票", FEETYPE: "1", QUANTITY: "1", PRICE: LinkManSe, REMARK: "" }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); //刷新费用列表 var editp = Ext.create('PCmb', data); this.LoadFeeData(editp); //this.storeBodyChFee.load({ params: { DELIVERYNO: DELIVERYNO} }); } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } //alert('03'); } }); } if (parseFloat(LinkTelSe) != 0.0) { Ext.Ajax.request({ async: false, waitMsg: '正在保存数据...', url: '/TruckMng/PcHeadEdit_LTJY/MAKEFEE', scope: this, params: { BSNO: data.gId, FEENAME: '应付运费', CUSTOMERNAME: data.CustName, PRICETYPE: "单票", FEETYPE: "2", QUANTITY: "1", PRICE: LinkTelSe, REMARK: "" }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); //刷新费用列表 var editp = Ext.create('PCmb', data); this.LoadFeeData(editp); //this.storeBodyChFee.load({ params: { DELIVERYNO: DELIVERYNO} }); } else { Ext.Msg.show({ title: '请重试', msg: '服务器响应出错', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } //alert('03'); } }); } } //#region 上传附件, 需求编号:SR2017062800004 , onUpLoadFileClick: function (button, event) { if (this.OpStatus == 'add') { this.Save('0'); } var basicForm = this.formEdit.getForm(); if (!basicForm.isValid()) { return; } basicForm.findField('BillNo').setDisabled(false); var data = basicForm.getValues(); basicForm.findField('BillNo').setDisabled(true); var billno = data.BillNo; me = this; var imgform = new Ext.FormPanel({ region: 'center', labelWidth: 40, frame: true, bodyStyle: 'padding:5px 5px 0', autoScroll: true, border: false, fileUpload: true, items: [{ xtype: 'fileuploadfield', id: 'LoadFile', name: 'LoadFile', emptyText: '请选择文件', fieldLabel: '文件', buttonText: '选择文件', allowBlank: false, buttonCfg: { iconCls: 'uploaddialog' }, anchor: '98%' }], buttons: [{ text: '上传', type: 'submit', handler: function () { var UserFilePath = Ext.getCmp('LoadFile').getValue(); if (!imgform.form.isValid()) { return; } imgform.form.submit({ url: '/TruckMng/PcHeadEdit_LTJY/UploadFile', waitMsg: '正在上传', method: 'POST', submitEmptyText: false, async: false, params: { BillNo: billno }, success: function (form, action) { win.close(this); Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); }, failure: function (form, action) { form.reset(); if (action.failureType == Ext.form.Action.SERVER_INVALID) Ext.MessageBox.alert('警告', action.result.errors.msg); } }); } }, { text: '关闭', type: 'submit', handler: function () { win.close(this); } }] }); var win = new Ext.Window({ title: "上传文件", width: 360, height: 120, modal: true, resizable: false, border: false, items: imgform }); win.show(); } //#endregion , onAddWMSINClick: function (button, event, type) { var store = null; var data = this.formEdit_WMSIN.getForm().getValues(); store = this.storeWMSIN; //var jianshu1 = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSPACK : 0; var jianshu1 = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.JIANSHU1 : 0; var jianshu2 = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.JIANSHU2 : 0; var zongjianshu = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSPACK : 0; var pinming = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSNAMEDISPLAY : ''; var guigejianshu = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSSTANDARD : ''; var baozhuangjianshu = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSSLICE : ''; var record = null; var areaname = data.AREANAME; var BSNO = ""; var CLIENTNAME = ""; var STORAGENAME = ""; var GOODSNAME = ""; var GOODSMODEL = ""; var GOODSSTANDARD = ""; var CHARGEUNIT = "箱"; if (this.OpStatus == "add") { BSNO = ""; CLIENTNAME = data.CUSTOMERNAME; STORAGENAME = ""; GOODSNAME = data.GOODSNAME; //GOODSMODEL = ""; GOODSMODEL = data.GOODSMODEL; GOODSSTANDARD = ""; //根据情况修改 CHARGEUNIT = data.CHARGEUNIT; } else { BSNO = data.WMSNO; CLIENTNAME = data.CUSTOMERNAME; STORAGENAME = data.STORAGENAME; GOODSNAME = data.GOODSNAME; //GOODSMODEL = this.EditRecord.get('GOODSMODEL'); GOODSMODEL = data.GOODSMODEL; GOODSSTANDARD = data.GOODSSTANDARD; CHARGEUNIT = data.CHARGEUNIT; } var newid = NewGuid(); record = Ext.create('WMSINmb', { //GOODSNAMEDISPLAY: pinming, GID: newid, ASSOCIATEDNO: "", BLNO: "", CONTRACTNO: "", CTNALL: "", CNTRNO: '', SEALNO: '', BSNO: '', CLIENTCODE: "", CLIENTNAME: '', DODATE: "", STORAGECODE: "", STORAGENAME: '', AREACODE: "", AREANAME: '', GOODSCODE: "", GOODSNAME: '', GOODSTYPE: "", GOODSMODEL: '', GOODSSTANDARD: '', GOODSPACK: '1', GOODSPACKSTOCK: "1", GOODSKGS: "0", CHARGEUNIT: CHARGEUNIT, GOODSRKSL: "1", GOODSSTOCK: "1", FREESTORAGEPERIOD: "0", ISLOCK: "0", LOCKTIME: "1900-01-01", LOCKUSER: "", ISDELETE: "0", DELETETIME: "1900-01-01", DELETEUSER: "", CREATEUSER: "", CREATETIME: '2017-05-22', MODIFIEDUSER: "", MODIFIEDTIME: '2017-05-22', REMARK: "", CLIENTCODEOLD: "", CLIENTNAMEOLD: "", KINDPKGS: "", ARFEE: "0", APFEE: "0", CORPID: COMPANYID, GOODSTHICKNESS: "0", GOODSWIDTH: "0", GOODSLENGTH: "0", GOODSSLICE: baozhuangjianshu, GOODSGRADE: "", STACKLOCATION: "", GOODSPACKACTUAL: "0", GOODSRKSLACTUAL: "0", ISCHANGE: "0", MARKETVALUE: "0", BANKVALUE: "0", JIANSHU2: "0", JIANSHU1: "1", LINENUM: this.getLinenum(), CHIMA1: "0", CHIMA2: "0", ZHONGLIANG2: "0", SHIJIZHONGLIANG: "0", SHIJICHIMA: "0" }); store.add(record); cellediting = this.cellEditing; var n = store.getCount(); cellediting.startEditByPosition({ row: n - 1, column: 2 }); this.storeWMSIN.each(function (record) { if (record.get('GID') == newid) { record.set('DODATE', Ext.util.Format.date(currdate, 'Y-m')); } }); }, onDelWMSINClick: function (button, event, type) { var feeGidSql = ''; var selectedRecords = []; selectedRecords = this.CheckBoxModel.selected.items; if (selectedRecords.length == 0) { Ext.Msg.show({ title: '提示', msg: '请先选择要删除的入库信息!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } Ext.MessageBox.confirm('提示', '确定要删除选中的入库信息吗?', function (btn) { if (btn == 'yes') { if (Ext.getCmp('ISLOCK').getValue() == '1' || Ext.getCmp('ISLOCK').getValue() == 'True') { alert("不能删除已入账的入库记录。"); return; } if (Ext.getCmp('ISLOCK2').getValue() == '1' || Ext.getCmp('ISLOCK2').getValue() == 'True') { alert("不能删除已锁定的入库记录。"); return; } if (selectedRecords.length > 0) { for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (rec.data.ASSOCIATEDNO != "") //如果是新增但没有保存的数据,没有必要提交到后台 { this.WMSINBodyDel.push(rec); } this.storeWMSIN.remove(selectedRecords[i]); } } } }, this); }, getLinenum: function (button, event) { var _L = 0; for (var i = 0; i < this.storeWMSIN.getCount(); i++) { var _t = parseInt(this.storeWMSIN.getAt(i).get("LINENUM")); if (_t > _L) { _L = _t; } } _L++; return _L; }, getLinenum2: function (FEETYPE, GID) { var _L = 0; for (var i = 0; i < this.storeWMSRATE.getCount(); i++) { if (FEETYPE != this.storeWMSRATE.getAt(i).get("FEETYPE") || this.storeWMSRATE.getAt(i).get("GID") == GID) { continue; } var _t = parseInt(this.storeWMSRATE.getAt(i).get("FEEGRADE")); if (_t > _L) { _L = _t; } } _L++; return _L; }, onDelClick: function (button, event) { var selectedRecords = this.formFeeBody.selModel.getSelection(); Ext.MessageBox.confirm('提示', '确定删除记录吗?', function (btn) { if (btn == 'yes') { for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (rec.BXGID != "" || rec.BXGID != "*") //如果是新增但没有保存的数据,没有必要提交到后台 { this.feeBodyDel.push(rec); } } } }, this); //aftereditform(); var Amount_ALL = 0; }, WMSINAfterEdit: function (editor, e, eOpts) { if (COMPANYID == "" || DEPTGID == "") { alert("登录信息不全,请退出重新登录"); returen; } //选择品名带出规格/件数列表 if (e.field == 'GOODSNAMEID') { var display = Ext.getCmp('GOODSNAME').rawValue; var coodgoodsid = e.record.data.GOODSNAMEID; e.record.set('GOODSNAMEDISPLAY', display); var temp = ""; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/WMSNew/GetGoodsNameWithGID', params: { gid: coodgoodsid }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); e.record.set('GOODSNAMEDISPLAY', jsonresult.data); e.record.set('GOODSNAME', jsonresult.data); Ext.getCmp('GOODSNAME').setValue(jsonresult.data); } }, scope: this }); //request over e.record.set('GOODSNAMEDISPLAY', temp); e.record.set('GOODSNAME', temp); Ext.getCmp('GOODSNAME').setValue(temp); //规格/件数列表 // this.storeGoodsDetailsList.load({ params: { codegoodsid: coodgoodsid }, // callback: function (r, options, success) { // if (success) { // } // } // }); } //选择装卸工,带出装卸费 if (e.field == 'ZHUANGXIEGONGID') { var zxgcodename = this.comboxZhuangXieGong.rawValue; e.record.set('ZHUANGXIEGONG', zxgcodename); var feeType = e.record.data.ZhuangXieFeeType; var ton = e.record.data.SHIJIZHONGLIANG; var jian = e.record.data.GOODSPACK; var jianOrTon = 0; if (feeType == '件数') { jianOrTon = jian; } else { jianOrTon = ton; } var zhuangxiegongid = e.record.data.ZHUANGXIEGONGID; e.record.set('GOODSNAMEDISPLAY', display); var temp = ""; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/WMSNew/GetZhuangXieFeiWithZhuangXieGongID', params: { gid: zhuangxiegongid }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); var feeJian = jsonresult.data1; var feeTon = jsonresult.data2; e.record.set('ZhuangXieFeiDanJiaTon', feeTon); e.record.set('ZhuangXieFeiDanJiaJian', feeJian); if (feeType == '件数') { e.record.set('ZhuangXieFei', feeJian * jianOrTon); } else if (feeType == '') { e.record.set('ZhuangXieFei', 0); } else { e.record.set('ZhuangXieFei', feeTon * jianOrTon); } } }, scope: this }); //request over } //选择装卸计费标准计算装卸费ZhuangXieFeeType if (e.field == 'ZhuangXieFeeType' || e.field == 'SHIJIZHONGLIANG' || e.field == 'GOODSPACK') { var feeType = e.record.data.ZhuangXieFeeType; var ton = e.record.data.SHIJIZHONGLIANG; var jian = e.record.data.GOODSPACK; var feeJian = e.record.data.ZhuangXieFeiDanJiaJian; var feeTon = e.record.data.ZhuangXieFeiDanJiaTon; var jianOrTon = 0; if (feeType == '件数') { jianOrTon = jian; } else { jianOrTon = ton; } if (feeType == '件数') { e.record.set('ZhuangXieFei', feeJian * jianOrTon); } else if (feeType == '入库量(吨)') { e.record.set('ZhuangXieFei', feeTon * jianOrTon); } } //Ext.getCmp('GOODSDETAILSNAME').setValue(''); if (e.field == 'GOODSMODEL') { var goodsDetailsName = e.record.data.GOODSMODEL; var codeGoodsId = e.record.data.GOODSNAMEID; var temp = ''; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/WMSNew/GetPKGWithGoodsDetailsNameAndCodeGoodsId', params: { goodsDetailsName: goodsDetailsName, codeGoodsId: codeGoodsId }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); e.record.set('GOODSSTANDARD', jsonresult.data); var val = parseInt(e.record.get('GOODSSLICE')); var val2 = parseInt(e.record.get('GOODSSTANDARD')); if (isNaN(val)) { val = 0; } if (isNaN(val2)) { val2 = 0; } e.record.set('GOODSPACK', val * val2); e.record.set('GOODSPACKSTOCK', val * val2); } }, scope: this }); //request over } //计算入库件数与剩余件数 if (e.field == 'GOODSSLICE') { var val = parseInt(e.record.get('GOODSSLICE')); var val2 = parseInt(e.record.get('GOODSSTANDARD')); if (isNaN(val)) { val = 0; } if (isNaN(val2)) { val2 = 0; } e.record.set('GOODSPACK', val * val2); e.record.set('GOODSPACKSTOCK', val * val2); } //实际件数=剩余件数=总件数=件数1+件数2 //if (e.field == 'GOODSPACK' || e.field == 'JIANSHU2') { if (e.field == 'JIANSHU1' || e.field == 'JIANSHU2') { var JIANSHU1 = parseFloat(e.record.get('JIANSHU1')); var JIANSHU2 = parseFloat(e.record.get('JIANSHU2')); e.record.set('GOODSPACK', JIANSHU1 + JIANSHU2); e.record.set('GOODSPACKACTUAL', JIANSHU1 + JIANSHU2); e.record.set('GOODSPACKSTOCK', JIANSHU1 + JIANSHU2); } //实际尺码=尺码1+尺码2 if (e.field == 'CHIMA1' || e.field == 'CHIMA2') { var CHIMA1 = parseFloat(e.record.get('CHIMA1')); var CHIMA2 = parseFloat(e.record.get('CHIMA2')); e.record.set('SHIJICHIMA', CHIMA1 + CHIMA2); } //实际重量=重量1+重量2 if (e.field == 'GOODSKGS' || e.field == 'ZHONGLIANG2') { var ZHONGLINAG1 = parseFloat(e.record.get('GOODSKGS')); var ZHONGLIANG2 = parseFloat(e.record.get('ZHONGLIANG2')); e.record.set('SHIJIZHONGLIANG', ZHONGLINAG1 + ZHONGLIANG2); } //库存量 var JIFEIDANWEI = e.record.get('CHARGEUNIT'); if (JIFEIDANWEI == "吨") { var SHIJIZHONGLIANG = parseFloat(e.record.get('SHIJIZHONGLIANG')); e.record.set('GOODSRKSL', SHIJIZHONGLIANG); } else if (JIFEIDANWEI == "千克") { var SHIJIZHONGLIANG = e.record.get('SHIJIZHONGLIANG'); e.record.set('GOODSRKSL', SHIJIZHONGLIANG); } else if (JIFEIDANWEI == "CBM") { var SHIJICHIMA = e.record.get('SHIJICHIMA'); e.record.set('GOODSRKSL', SHIJICHIMA); } //库存量 var KUCUNLIANG = e.record.get('GOODSRKSL'); e.record.set('GOODSSTOCK', KUCUNLIANG); if (e.field == 'COUNTRYID') { var COUNTRY = DsStoreQueryBy(this.storeCountry, 'countryid', e.value); if (COUNTRY.getCount() > 0) { var COUNTRYdata = COUNTRY.getAt(0).data; e.record.set('COUNTRY', COUNTRYdata.country); } else { e.record.set('COUNTRY', ''); } } }, WMSINBeforeEdit: function (editor, e, eOpts) { //需要自己实现里面的事件 if (COMPANYID == "" || DEPTGID == "") { alert("登录信息不全,请退出重新登录"); returen; } }, SetTabShow: function (worktype) { /*20180526 改为不对出入库做任何操作 if (worktype == "入库") { this.MainTab.tabBar.items.items[1].show(); } else { this.MainTab.tabBar.items.items[1].hide(); } if (worktype == "出库") { this.MainTab.tabBar.items.items[2].show(); } else { this.MainTab.tabBar.items.items[2].hide(); } */ //alert(this.MainTab.tabBar.items.items[1].hidden); } , GetTabShow: function (worktype) { /* if (worktype == "入库") { if (this.MainTab.tabBar.items.items[1].hidden == false) { return "入库"; } else return ""; } if (worktype == "出库") { if (this.MainTab.tabBar.items.items[2].hidden == false) { return "出库"; } else return ""; } */ //alert(this.MainTab.tabBar.items.items[1].hidden); } , setCBM: function (newValue, oldValue) { if (newValue == oldValue) { return; } else { //将store当中的所有CHARGEUNIT改为newvalue; if (newValue == "公斤") { newValue = "千克"; } this.storeWMSIN.each(function (record) { record.set('CHARGEUNIT', newValue); //库存量 if (newValue == "吨") { var SHIJIZHONGLIANG = parseFloat(record.get('SHIJIZHONGLIANG')); record.set('GOODSRKSL', SHIJIZHONGLIANG); } else if (newValue == "千克") { var SHIJIZHONGLIANG = record.get('SHIJIZHONGLIANG'); record.set('GOODSRKSL', SHIJIZHONGLIANG); } else if (newValue == "CBM") { var SHIJICHIMA = record.get('SHIJICHIMA'); record.set('GOODSRKSL', SHIJICHIMA); } }); //var rec = Ext.getCmp("GOODSSTOCK_IN").setText("*库存量(" + newValue + ")"); ; } } //#region 展开箱号 , onUpDetailClick: function (button, event) { //CNTRNO XIANGHAO2 var selectedRecords = []; selectedRecords = this.CheckBoxModel.selected.items; if (selectedRecords.length == 0) { //Ext.Msg.show({ title: '提示', msg: '请先选择要删除的入库信息!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; } var data = selectedRecords[0].data; var CNTRNO = data.CNTRNO; var XIANGHAO2 = Ext.getCmp("zkxs").getValue(); var getstartno = new RegExp(/\d+$/); var startno = getstartno.exec(CNTRNO); var CNTRNOString = CNTRNO.replace(startno, ""); var NoLength = CNTRNO.length - CNTRNOString.length; var NumberCount = getstartno.exec(XIANGHAO2); //var rec = selectedRecords[0]; //rec.set('XIANGHAO2', ''); for (var i = 1; i < NumberCount; i++) { var thisno = "" + (parseInt(startno) + i); if (thisno.length < NoLength) { do { thisno = "0" + thisno; } while (thisno.length < NoLength); } thisno = CNTRNOString + thisno; //data.XIANGHAO2 = ''; //data.CNTRNO = thisno; data.currdate = ''; this.MakeWMSIN(thisno, data); } } //end onUpDetailClick , MakeWMSIN: function (NEWCNTRNO, firstdata) { var store = null; var data = this.formEdit_WMSIN.getForm().getValues(); store = this.storeWMSIN; var newid = NewGuid(); record = Ext.create('WMSINmb', { //GOODSNAMEDISPLAY: pinming, GID: newid, ASSOCIATEDNO: "", BLNO: "", CONTRACTNO: "", CTNALL: firstdata.CTNALL, CNTRNO: NEWCNTRNO, XIANGHAO2: firstdata.XIANGHAO2, SEALNO: firstdata.SEALNO, BSNO: firstdata.BSNO, GOODSNAMEID: firstdata.GOODSNAMEID, GOODSNAMEDISPLAY: firstdata.GOODSNAMEDISPLAY, PICIHAO: firstdata.PICIHAO, CLIENTCODE: firstdata.CLIENTCODE, CLIENTNAME: firstdata.CLIENTNAME, DODATE: "", STORAGECODE: firstdata.STORAGECODE, STORAGENAME: firstdata.STORAGENAME, AREACODE: firstdata.AREACODE, AREANAME: firstdata.areanAREANAMEame, GOODSCODE: firstdata.GOODSCODE, GOODSNAME: firstdata.GOODSNAME, GOODSTYPE: "", GOODSMODEL: firstdata.GOODSMODEL, GOODSSTANDARD: firstdata.GOODSSTANDARD, GOODSPACK: firstdata.GOODSPACK, GOODSPACKSTOCK: firstdata.GOODSPACKSTOCK, GOODSKGS: firstdata.GOODSKGS, CHARGEUNIT: firstdata.CHARGEUNIT, GOODSRKSL: firstdata.GOODSRKSL, GOODSSTOCK: firstdata.GOODSSTOCK, FREESTORAGEPERIOD: firstdata.FREESTORAGEPERIOD, ISLOCK: firstdata.ISLOCK, LOCKTIME: "1900-01-01", LOCKUSER: "", ISDELETE: "0", DELETETIME: "1900-01-01", DELETEUSER: "", CREATEUSER: "", CREATETIME: '2017-05-22', MODIFIEDUSER: "", MODIFIEDTIME: '2017-05-22', REMARK: firstdata.REMARK, CLIENTCODEOLD: "", CLIENTNAMEOLD: "", KINDPKGS: firstdata.KINDPKGS, ARFEE: "0", APFEE: "0", CORPID: COMPANYID, GOODSTHICKNESS: firstdata.GOODSTHICKNESS, GOODSWIDTH: firstdata.GOODSWIDTH, GOODSLENGTH: firstdata.GOODSLENGTH, GOODSSLICE: firstdata.GOODSSLICE, GOODSGRADE: firstdata.GOODSGRADE, STACKLOCATION: "", GOODSPACKACTUAL: firstdata.GOODSPACKACTUAL, GOODSRKSLACTUAL: firstdata.GOODSRKSLACTUAL, ISCHANGE: "0", MARKETVALUE: firstdata.MARKETVALUE, BANKVALUE: firstdata.BANKVALUE, JIANSHU2: firstdata.JIANSHU2, JIANSHU1: firstdata.JIANSHU1, LINENUM: this.getLinenum(), CHIMA1: firstdata.CHIMA1, CHIMA2: firstdata.CHIMA2, ZHONGLIANG2: firstdata.ZHONGLIANG2, SHIJIZHONGLIANG: firstdata.SHIJIZHONGLIANG, SHIJICHIMA: firstdata.SHIJICHIMA }); store.add(record); cellediting = this.cellEditing; var n = store.getCount(); cellediting.startEditByPosition({ row: n - 1, column: 2 }); this.storeWMSIN.each(function (record) { if (record.get('GID') == newid) { record.set('DODATE', Ext.util.Format.date(currdate, 'Y-m')); } }); } //#endregion //#region 出库用查询 , onRefreshClick: function (sCondition) { var sql = this.getCondition(); if (sCondition.toString().trim() != "" && sCondition.toString().trim() != "[object Object]") { sql += sCondition; } this.sqlcontext = sql; this.storeDetailList.load({ params: { start: 0, limit: this.PageSize, sort: '', OpStatus: this.opStatus, condition: sql }, waitMsg: "正在刷新数据...", timeout: 6000000, //30秒 scope: this }); //this.panelFee.hide(); //隐藏按钮 // if (this.OpStatus == 'edit') { // //this.panelFee.show(); //显示按钮 // //var sBSNO = this.EditRecord.data.BSNO; // //this.LoadData(" OUTBSNO_OUT='" + sBSNO + "' "); // } }, getCondition: function () { var sql = ''; if (this.OpStatus == 'edit') { var sBSNO = Ext.getCmp('BillNo').getValue(); sql = sql + getAndConSql(sql, sBSNO, " (OUTBSNO_OUT='" + sBSNO + "' or GOODSSTOCK>0 )"); } else { var dl = 0; sql += "(GOODSSTOCK>" + dl + ")"; // or GOODSSTOCK<>" + dl + " } //入库单号 var sWMSNO = this.formSearch.getForm().findField('WMSNO').getValue(); if (sWMSNO != null) { if (sWMSNO != "") { sql = sql + getAndConSql(sql, sWMSNO, "WMSNO like '%" + sWMSNO.toString().trim() + "%'"); } } //委托单位 var sCUSTOMERNAME = this.formSearch.getForm().findField('CUSTOMERNAME').getValue(); if (sCUSTOMERNAME != null) { if (sCUSTOMERNAME != "") { sql = sql + getAndConSql(sql, sCUSTOMERNAME, "CUSTOMERNAME='" + sCUSTOMERNAME.toString().trim() + "'"); } } //所属仓库 var sSTORAGENAME = this.formSearch.getForm().findField('STORAGENAME').getValue(); if (sSTORAGENAME != null) { if (sSTORAGENAME != "") { sql = sql + getAndConSql(sql, sSTORAGENAME, "STORAGENAME='" + sSTORAGENAME.toString().trim() + "'"); } } //品名 var sGOODSNAME = this.formSearch.getForm().findField('GOODSNAME').getValue(); if (sGOODSNAME != null) { if (sGOODSNAME != "") { sql = sql + getAndConSql(sql, sGOODSNAME, "GOODSNAME like '%" + sGOODSNAME.toString().trim() + "%'"); } } //品名明细表_规格 var sGOODSDETAILNAME = this.formSearch.getForm().findField('GOODSDETAILNAME').getValue(); if (sGOODSDETAILNAME != null) { if (sGOODSDETAILNAME != "") { sql = sql + getAndConSql(sql, sGOODSDETAILNAME, "GOODSMODEL like '%" + sGOODSDETAILNAME.toString().trim() + "%' "); } } //批次号 var PICIHAO = this.formSearch.getForm().findField('PICIHAO').getValue(); if (PICIHAO != null) { if (PICIHAO != "") { sql = sql + getAndConSql(sql, PICIHAO, "PICIHAO like '%" + PICIHAO.toString().trim() + "%' "); } } if (this.pcnostr != "") { sql = sql + getAndConSql(sql, this.pcnostr, "PICIHAO IN (" + this.pcnostr + ") "); } if (sql != '') { sql += ' and ISLOCK=1 and ISLOCK2=0'; //需求编号:SR2017061400006-1 } else { sql += 'ISLOCK=1 and ISLOCK2=0'; } return sql; }, onClearSql: function () { var form = this.formSearch.getForm(); form.reset(); } //#endregion , getGoodsname: function (_GoodsName) { if (_GoodsName != "") { if (_GoodsName.slice(-1) == ",") { _GoodsName = _GoodsName.substring(0, _GoodsName.length - 1) } return _GoodsName.split(','); } else { return ""; } } });