/// Ext.namespace('Shipping'); //#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 Shipping.WMSNewINEdit = function (config) { Ext.applyIf(this, config); this.initUIComponents(); window.Shipping.WMSNewINEdit.superclass.constructor.call(this); }; var LOCK1 = ''; var BLNO = ''; var CTNALL = ''; var CNTRNO = ''; var SEALNO = ''; var BAOGUANJIANSHU = 0; var PKGS = 0; var WMSNO = ''; var TIMESTAMP = ''; var AUTHUNLOCK = 0; var AUTHUNLOCKV = 0; var FEECONFIG = '0'; var MBLNO = ''; var BSNO = ''; var WMSNOManual = '0'; var ZhuangXieGongFee = 0; Ext.extend(Shipping.WMSNewINEdit, Ext.Panel, { parentWin: null, OpStatus: 'add', StoreList: null, EditRecord: null, parentRecord: null, BXSTATUS: 1, _First: true, VISIBLERANGE: 0, OPERATERANGE: 0, WorkFlowName: "", WorkFlowID: "", PageSize: 1000, OPLBNAME: "", modWmsFeeLock: null, modWmsFeeRejected: null, initUIComponents: function () { this.formname = 'WMSNewINEdit'; this.formnamerate = 'WMSNewINEditRate'; this.feeSerialNo = 0; this.WMSINBodyDel = []; this.WMSRATEBodyDel = []; //枚举参照相关(编辑form) WorkFlowName = 'WMSINmod'; //#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 }); //委托单位 this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '客户名称', store: this.storeCustCode, forceSelection: true, id: 'CUSTOMERNAME', name: 'CUSTOMERNAME', valueField: 'CustName', displayField: 'CodeAndName', allowBlank: false, listeners: { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { var data = combo.value; Ext.getCmp('ARCLIENT').setValue(combo.value); } } } }); this.storeGainCust = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storeGainCust.load({ params: { condition: ""} }); this.comboxGainCust = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '应收客户', hidden: true, store: this.storeGainCust, forceSelection: true, id: 'ARCLIENT', name: 'ARCLIENT', valueField: 'CustName', displayField: 'CodeAndName' }); this.storePayCust = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.CustomRefModel', proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' } }); this.storePayCust.load({ params: { condition: ""} }); this.comboxPayCust = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '应付客户', hidden: true, store: this.storePayCust, forceSelection: true, id: 'TRUCKNAME', name: 'TRUCKNAME', valueField: 'CustName', displayField: 'CodeAndName' }); var CHARGEUNITData = [ { "CHARGEUNIT": "CBM" }, { "CHARGEUNIT": "吨" }, { "CHARGEUNIT": "千克" }, { "CHARGEUNIT": "箱"}]; this.storeCHARGEUNIT = Ext.create('Ext.data.Store', { model: 'CHARGEUNITmb', data: CHARGEUNITData }); this.comboxCHARGEUNIT = Ext.create('DsExt.ux.RefEnumCombox', { fieldLabel: '计费单位', forceSelection: true, store: this.storeCHARGEUNIT, name: 'CHARGEUNIT', allowBlank: false, valueField: 'CHARGEUNIT', displayField: 'CHARGEUNIT', values: '箱', listeners: { change: function (field, newValue, oldValue) { this.setCBM(newValue, oldValue); }, scope: this } }); this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.DICModel', proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' } }); this.storeCodeGoodsList.load({ params: { tablename: "wms_in", columnname: "goodsname", condition: ""} }); this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeCodeGoodsList, id: 'GOODSNAME', name: 'GOODSNAME', forceSelection: false, valueField: 'KEYFIELD', displayField: 'KEYFIELD' }); //品名下的规格 Ext.regModel('GOODSDETAILS', { fields: [{ name: 'GID' }, { name: 'NAME'}] }) this.storeGoodsDetailsList = Ext.create('DsExt.ux.RefTableStore', { model: 'GOODSDETAILS', proxy: { url: '/MvcShipping/WMSNew/GetDetailsForGoodsName' } }); this.comboxGOODSDETAILS = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeGoodsDetailsList, id: 'GOODSDETAILSNAME', name: 'GOODSDETAILSNAME', forceSelection: true, valueField: 'NAME', displayField: 'NAME' }); this.storeUser = Ext.create('DsExt.ux.RefTableStore', { model: 'DsTruckMng.ux.UserRefModel', proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' } }); this.storeUser.load({ params: { condition: " 1=1 "} }); this.comboxCreator = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '制单人', forceSelection: true, store: this.storeUser, name: 'CREATEUSER', id: "CREATEUSER", valueField: 'UserName', displayField: 'CodeAndName', allowBlank: false }); //箱号封号/件数重量 this.storeCTN = Ext.create('DsExt.ux.RefTableStore', { model: 'MsOpSeaiDetail', proxy: { type: 'ajax', url: '/MvcShipping/MsOpSeai/GetBodyList', reader: { id: 'BsNo,CTNCODE,CTN_ID', root: 'data', totalProperty: 'totalCount' } } }); //备案清单号下拉框 this.storeCustomsNo = Ext.create('DsExt.ux.RefTableStore', { model: 'CustomsNo', proxy: { url: '/MvcShipping/WMSNew/GetCustomsNoListWithBLNOAndCustomNo' } }); this.comboxCustomsNo = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '备案清单号', flex: 1, store: this.storeCustomsNo, id: 'CUSTOMNO', name: 'CUSTOMNO', forceSelection: true, valueField: 'CUSTOMNO', displayField: 'CUSTOMNO', hidden: true, labelWidth: 75 }); //装卸工下拉框 Ext.regModel('ZHUANGXIEGONGMODEL', { fields: [{ name: 'GID' }, { name: 'NAME' }, { name: 'CODE' }, { name: 'CODENAME'}] }) this.storeZhuangXieGong = Ext.create('DsExt.ux.RefTableStore', { model: 'ZHUANGXIEGONGMODEL', proxy: { url: '/MvcShipping/WMSNew/GetZhuangXieGongList' } }); this.comboxZhuangXieGong = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeZhuangXieGong, id: 'ZHUANGXIEGONGID', name: 'ZHUANGXIEGONGID', forceSelection: true, valueField: 'GID', displayField: 'CODENAME', labelWidth: 100 }); this.storeZhuangXieGong.load(); //车队下拉框 Ext.regModel('CHEDUIMODEL', { fields: [{ name: 'GID' }, { name: 'NAME' }, { name: 'CODE' }, { name: 'CODENAME'}] }) this.storeCheDui = Ext.create('DsExt.ux.RefTableStore', { model: 'CHEDUIMODEL', proxy: { url: '/MvcShipping/WMSNew/GetCheDuiList' } }); this.comboxCheDui = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeCheDui, id: 'CHEDUIID', name: 'CHEDUIID', forceSelection: true, valueField: 'GID', displayField: 'CODENAME', labelWidth: 100 }); this.storeCheDui.load(); //装卸费计费标准 var ZhuangXieFeiData = [ { "type": "件数" }, { "type": "入库量(吨)"}]; this.storeZhuangXieFeiType = Ext.create('Ext.data.Store', { model: 'ZhuangXieFeiTypemb', data: ZhuangXieFeiData }); this.comboxZhuangXieFeiType = Ext.create('DsExt.ux.RefEnumCombox', { forceSelection: true, store: this.storeZhuangXieFeiType, name: 'ZhuangXieFeeType', //allowBlank: false, valueField: 'type', displayField: 'type' }); //#endregion //#region form定义 //检索form:formSearch this.formSearch = Ext.widget('form', { region: 'north', frame: true, bodyPadding: 1, trackResetOnLoad: true, fieldDefaults: { margins: '1 1 1 1', labelAlign: 'right', flex: 1, labelWidth: 64 }, items: [{ xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [ { fieldLabel: '提单号/委托单号', flex: 1, name: 'BLNO' }, { fieldLabel: '报关单号', flex: 1, hidden: true, name: 'WMSNO' }, { xtype: 'button', text: "查询", flex: 0.35, handler: function () { _this.onSearchClick(); } }, { xtype: 'label', name: 'holdp1', flex: 1 }, { xtype: 'label', name: 'holdp2', flex: 1 }, { xtype: 'label', name: 'holdp3', flex: 1 } ] }] }); //编辑form:formEdit this.formEdit = Ext.widget('form', { // layout: "border", region: 'north', height: 145, 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: '入库单号', flex: 1, name: 'WMSNO', id: 'WMSNO', readOnly: true }, this.comboxCustCode, { fieldLabel: '提单号', flex: 1, hidden: true, name: 'BLNO' }, { fieldLabel: '合同号', flex: 1, hidden: true, //labelWidth: 100, name: 'CONTRACTNO', id: "CONTRACTNO" }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' } //, { // fieldLabel: '批次号', flex: 1, // labelWidth: 100, // name: 'PICIHAO', id: "PICIHAO" // } ] }//container_1 end , { xtype: 'container', layout: 'hbox', defaultType: 'textfield', items: [this.comboxCustWmsCode, { name: 'WMSDATE', id: "WMSDATE", fieldLabel: '入库时间', format: 'Y-m-d', xtype: 'datefield', listeners: { scope: this, 'blur': function (field) { var FREESTORAGEPERIOD = parseInt(Ext.getCmp("FREESTORAGEPERIOD").getValue()); Ext.getCmp("STARTBILLINGDATE").setRawValue(getAfterDATE(field.value, FREESTORAGEPERIOD + 1)); var FREESTORAGEPERIODAP = parseInt(Ext.getCmp("FREESTORAGEPERIODAP").getValue()); Ext.getCmp("STARTBILLINGDATEAP").setRawValue(getAfterDATE(field.value, FREESTORAGEPERIOD + 1)); } } } , this.comboxGainCust, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' } , { fieldLabel: '应收免仓储期', hidden: true, labelWidth: 100, name: 'FREESTORAGEPERIOD', id: "FREESTORAGEPERIOD", xtype: 'numberfield', allowBlank: true, regex: /^(0|[1-9][0-9]*)$/, regexText: '请输入正确的数值!', listeners: { scope: this, 'blur': function (field) { var wmsdate = Ext.getCmp("WMSDATE").getValue(); //alert(getAfterDATE(wmsdate, field.value)); Ext.getCmp("STARTBILLINGDATE").setRawValue(getAfterDATE(wmsdate, field.value + 1)); } } } , { 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: [{ fieldLabel: '储位', hidden: true, name: 'AREANAME', id: "AREANAME" } , { fieldLabel: '牌号', hidden: true, name: 'GOODSMODEL', id: "GOODSMODEL" }, this.comboxCHARGEUNIT, { fieldLabel: '包装规格', name: 'GOODSSTANDARD', id: "GOODSSTANDARD" }, this.comboxPayCust, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' } , { 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') } ] }, { 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: 'WHS_CODE', id: "WHS_CODE" }, this.comboxCustomsNo, { 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', value: Ext.util.Format.date(currdate, 'Y-m'), editable: false, allowBlank: true }, { fieldLabel: '是否保税', hidden: true, readOnly: true, disabled: true, name: 'ISBONDED' }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' } ] }, { xtype: 'container', layout: 'hbox', defaultType: 'textfield', anchor: '16.67%', items: [{ fieldLabel: '件数', hidden: true, readOnly: true, name: 'PKGS', id: "PKGS" }, { 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.DICModel', proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' } }); this.storeCodeGoodsList.load({ params: { tablename: "wms_in", columnname: "goodsname", condition: ""} }); this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', { store: this.storeCodeGoodsList, id: 'GOODSNAME', name: 'GOODSNAME', forceSelection: false, valueField: 'KEYFIELD', displayField: 'KEYFIELD' }); //#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: 'GOODSNAME', 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, renderer: Ext.util.Format.dateRenderer('Y-m-d') }, { 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 }, { sortable: true, dataIndex: 'LinShiZhuangXieFeiDanJiaDun', header: '临时装卸费单价吨', hidden: true, width: 80, editor: { xtype: 'numberfield' } }, { sortable: true, dataIndex: 'LinShiZhuangXieFeiDanJiaJian', header: '临时装卸费单价件', hidden: true, width: 80, editor: { xtype: 'numberfield' } } ]; 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: 50, 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: '指定箱号', width: 50, xtype: 'label' }, { id: 'zdxh', width: 80, xtype: 'textfield', //style: 'direction:rtl', align: 'left', value: '', listeners: { specialkey: function (field, e) { if (e.getKey() == e.ENTER) { _this.onAddBOXClick(); } } } }, { id: 'zkxs2', width: 40, xtype: 'numberfield', style: 'direction:rtl', align: 'right', value: 1 }, { text: '按箱号增加', id: "updetail2", tooltip: '增加一条记录,箱号为指定箱号,其他信息为列表中选定的内容', //iconCls: "btndeletedetail", handler: function (button, event) { if (Ext.getCmp('ISLOCK').getValue() == '1' || Ext.getCmp('ISLOCK').getValue() == 'True') { Ext.MessageBox.alert('提示', '已入账不允许修改!'); return; } this.onAddBOXClick(button, event); }, 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 }, { text: "打印", id: "PrintBtn", handler: function (button, event) { //alert(DsTruck.GetDirty1(panelWMSNewINEdit.storeWMSIN, null)); this.Print(); }, 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 //#region 编辑wms_rate this.storeWMSRATE = Ext.create('Ext.data.Store', { model: 'WMSRATEmb', pageSize: this.PageSize, remoteSort: false, pruneModifiedRecords: true, proxy: { type: 'ajax', url: '/MvcShipping/WMSNew/GetWMSRATE', reader: { id: 'GID', root: 'data', totalProperty: 'totalCount' } } }); Ext.define('FeeTypeMd', { extend: 'Ext.data.Model', fields: [ { name: 'FeeTypeID', type: 'string' }, { name: 'FeeTypeName', type: 'string' } ] }); var FeeTypeData = [{ "FeeTypeID": "1", "FeeTypeName": "收" }, { "FeeTypeID": "2", "FeeTypeName": "付"}]; this.storeFeeType = Ext.create('Ext.data.Store', { model: 'FeeTypeMd', data: FeeTypeData }); this.comboxFeeTypeRef = Ext.create('DsExt.ux.RefEnumCombox', { //fieldLabel: '收付类型', store: this.storeFeeType, name: 'FEETYPE', valueField: 'FeeTypeID', displayField: 'FeeTypeName' }); this.WMSRATEcolumn = [ { sortable: true, hidden: true, dataIndex: 'GID', header: '惟一编号', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CUSTOMERNAME', header: '客户名称', width: 80 }, { sortable: true, dataIndex: 'FEEGRADE', header: '计费等级', width: 80, editor: { xtype: 'numberfield' } }, { sortable: true, dataIndex: 'FEETYPE', header: '收付方向', width: 80, renderer: function (value, p, record) { if (value == null || value == '') return ''; else return record.data.FEETYPE == '1' ? '收' : '付'; }, editor: this.comboxFeeTypeRef }, { sortable: true, dataIndex: 'FEESCALE', header: '计费区间(天数)', width: 80, editor: { xtype: 'numberfield' } }, { sortable: true, dataIndex: 'FEEPRICE', header: '计费单价', width: 80, editor: { xtype: 'numberfield' }, renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; } }, { sortable: true, hidden: true, dataIndex: 'FEEUNIT', header: '计费单位', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CREATEUSER', header: '创建人ID', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CREATEUSER2', header: '创建人', width: 80 }, { sortable: true, hidden: true, dataIndex: 'CREATETIME', header: '创建时间', width: 80, renderer: Ext.util.Format.dateRenderer('Y-m-d') }, { sortable: true, dataIndex: 'MODIFIEDUSER', header: '最后一次操作人', width: 80 }, { sortable: true, hidden: true, dataIndex: 'MODIFIEDTIME', header: '最后一次操作时间', width: 80, renderer: Ext.util.Format.dateRenderer('Y-m-d') }, { sortable: true, dataIndex: 'REMARK', header: '备注', width: 80 }, { sortable: true, hidden: true, dataIndex: 'BSNO', header: '关联的WMS的GID', width: 80 }, { sortable: true, dataIndex: 'ADDPRICE', header: '增值价', width: 80, editor: { xtype: 'numberfield' } }, { sortable: true, dataIndex: 'CAPPRICE', header: '封顶价', width: 80, editor: { xtype: 'numberfield' } }, { sortable: true, dataIndex: 'ENDBILLINGDATE', 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: 'RATETYPE', header: '费率类型', width: 80 }, { sortable: true, hidden: true, dataIndex: 'FEENAME', header: '费用中文名称', width: 80 }, { sortable: true, hidden: true, dataIndex: 'ISCHANGE', header: '是否是货权转移', width: 80 } ]; this.rategirdcolums = this.WMSRATEcolumn; this.rategirdcolums = DsTruck.GetGridPanel(GID, this.formnamerate, this.rategirdcolums, 0); //使用者id,表名,中间column数组,跳过一开始的几列 this.CE_RATE = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }); this.CB_RATE = Ext.create('Ext.selection.CheckboxModel'); this.formWMSRATE = new Ext.grid.GridPanel({ store: this.storeWMSRATE, enableHdMenu: false, //layout: 'border', region: 'center', //title: '仓储费费率区间', loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, plugins: [this.CE_RATE], selModel: this.CB_RATE, selType: 'cellmodel', features: [{ ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性 }], tbar: [{ xtype: 'label', text: '仓储费费率区间', style: 'font-size:18px', labelColor: '#0f0', //style:'background-color: #4b9bf5', x: '5%', y: '5%' }, { text: '新建', id: "addrate", tooltip: '增加仓储费费率区间', iconCls: "btnadddetail", handler: function (button, event) { this.onAddWMSRATEClick(button, event); }, scope: this }, { text: '删除', id: "delrate", tooltip: '删除仓储费费率区间', iconCls: "btndeletedetail", handler: function (button, event) { this.onDelWMSRATEClick(button, event); }, scope: this }, '-', { id: "btnSave", text: '保存', tooltip: '保存', iconCls: "btnsave", handler: function (button, event) { this.SaveRate(); //alert(USERID); }, scope: this }, '-', { text: "保存列表样式", menu: [{ text: "保存", handler: function (button, event) { _this.rategirdcolums = DsTruck.SaveGridPanel(GID, _this.formnamerate, _this.formWMSRATE.columns, _this.rategirdcolums, 0, true); //使用者id,表名,中间column数组,跳过一开始的几列 } }, { text: "初始化", handler: function (menu, event) { _this.formWMSRATE.reconfigure(_this.formWMSRATE, _this.WMSRATEcolumn); _this.rategirdcolums = DsTruck.SaveGridPanel(GID, _this.formnamerate, _this.formWMSRATE.columns, _this.WMSRATEcolumn, 0, true); //使用者id,表名,中间column数组,跳过一开始的几列 } }], scope: this }, '-', { id: "btnFeeModel", text: '导入仓储费模板', tooltip: '导入仓储费模板', handler: function (button, event) { this.ImportFeeModel(); //alert(USERID); }, scope: this }], columns: this.rategirdcolums }); //#endregion Ext.define('FeeTypeMd', { extend: 'Ext.data.Model', fields: [ { name: 'FeeTypeID', type: 'string' }, { name: 'FeeTypeName', type: 'string' } ] }); var FeeTypeData = [{ "FeeTypeID": "1", "FeeTypeName": "收" }, { "FeeTypeID": "2", "FeeTypeName": "付"}]; this.storeFeeType = Ext.create('Ext.data.Store', { model: 'FeeTypeMd', data: FeeTypeData }); this.comboxFeeTypeRef = Ext.create('DsExt.ux.RefEnumCombox', { //fieldLabel: '收付类型', store: this.storeFeeType, name: 'FEETYPE', valueField: 'FeeTypeID', displayField: 'FeeTypeName' }); //公共按钮Toolbar:panelBtn this.panelBtn = new Ext.Panel({ region: "north", tbar: [ { // id: "saveandclose", text: "保存", iconCls: "btnsave", handler: function (button, event) { this.Save('0'); }, scope: this }, { // id: "saveandclose", text: "保存并关闭", handler: function (button, event) { this.Save('1'); }, scope: this }, '-', { // id: "saveandclose", text: "关闭", handler: function (button, event) { window.close(); }, scope: this }, '-', { text: "打印", id: "btnprint", iconCls: 'btnprint', handler: function (button, event) { this.onPrintClick(button, event); }, scope: this }, '-', { text: "入账", id: "btnLock", iconCls: 'new_lock', handler: function (button, event) { if (button.text == "入账") { this.LockWMS("1"); } else { this.LockWMS("0"); } }, scope: this }, '-', { text: "锁定", id: "btnLock2", iconCls: 'new_lock', handler: function (button, event) { if (button.text == "锁定") { this.LockWMS2("1"); } else { this.LockWMS2("0"); } }, scope: this } ] }); //end 按钮Toolbar this.panelTop; //#region 布局 parentWin = window.parent.opener; if (parentWin) { var ret = parentWin.OprationSwap(); this.OpStatus = ret[0]; //edit this.StoreList = ret[1]; this.EditRecord = ret[2]; //SelectedRecord this.parentRecord = ret[3]; this.OPLBNAME = ret[4]; } if (this.OpStatus == "add") { this.panelTop = new Ext.Panel({ //layout: "border", region: "north", height: 165, //split: true, items: [this.panelBtn //, this.formSearch , this.formEdit] }); } else { this.panelTop = new Ext.Panel({ region: "north", height: 150, items: [this.panelBtn, this.formEdit] }); } //#endregion //#region 其他 /* this.panelFee = new Shipping.FeeEditGrid({ region: 'center', layout: 'border' }); if (FEECONFIG == '1') { this.panelFee.stroplb = 'op_Seai'; } else { this.panelFee.stroplb = 'op_other'; } this.panelFee.StoreCustType.add({ "SCUSTTYPE": "WTDW-委托单位", "CUSTTYPE": "委托单位", "CUSTNAME": "CUSTOMERNAME" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CGS-船公司", "CUSTTYPE": "船公司", "CUSTNAME": "CARRIER" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "DCDL-订舱代理", "CUSTTYPE": "订舱代理", "CUSTNAME": "FORWARDER" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "BGH-报关行", "CUSTTYPE": "报关行", "CUSTNAME": "CUSTOMSER" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CD-车队", "CUSTTYPE": "车队", "CUSTNAME": "TRUCKER" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "FHR-发货人", "CUSTTYPE": "发货人", "CUSTNAME": "SHIPPERID" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "SHR-收货人", "CUSTTYPE": "收货人", "CUSTNAME": "CONSIGNEEID" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "TZR-通知人", "CUSTTYPE": "通知人", "CUSTNAME": "NOTIFYPARTYID" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "DL-代理", "CUSTTYPE": "代理", "CUSTNAME": "AGENTID" }); this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CZ-场站", "CUSTTYPE": "场站", "CUSTNAME": "YARD" }); if (FEECONFIG == '1') { this.panelFee.StoreDrOpRange.load({ params: { optype: "modSeaiRecvFeeManagement"} }); this.panelFee.StoreCrOpRange.load({ params: { optype: "modSeaiPayFeeManagement"} }); } else { this.panelFee.StoreDrOpRange.load({ params: { optype: "modOtherRecvFeeManagement"} }); this.panelFee.StoreCrOpRange.load({ params: { optype: "modOtherPayFeeManagement"} }); } this.panelFee.storeFeeNameRef.load({ params: { condition: ""} }); */ this.panelChFee = new Ext.Panel({ region: 'center', layout: 'border', margin: '0 0', height: 580, //width: 450, items: [//this.panelChFee_YS //, this.panelChFee_YF //this.panelFee ] }); //#endregion this.panelWMSINBody = new Ext.Panel({ layout: "border", region: 'center', frame: true, split: true, items: [this.formWMSINBody] }); this.panelWMSRATE = new Ext.Panel({ layout: "border", hidden: true, region: 'south', height: 190, frame: true, items: [this.formWMSRATE] }); this.panelWMSIN = new Ext.Panel({ layout: "anchor", region: 'center', items: [this.panelWMSINBody] }); this.page_1 = new Ext.Panel({ id: "page_1", title: "入库信息", layout: "border", region: 'center', items: [this.panelWMSINBody, this.panelWMSRATE ] }); this.page_2 = new Ext.Panel({ id: "page_2", autoScroll: true, title: "入库相关应收应付费用", layout: "border", region: 'center', items: [this.panelChFee ] }); this.MainTab = new Ext.tab.Panel({ layout: "border", region: "center", split: true, items: [this.page_1 //, this.page_2 ] }); Ext.apply(this, { items: [this.panelTop, this.MainTab] }); this.InitData(); //#endregion //集中绑定事件 this.formWMSINBody.on('edit', function (editor, e, eOpts) { this.WMSINAfterEdit(editor, e, eOpts); }, this); this.formWMSRATE.on('edit', function (editor, e, eOpts) { this.WMSRATEAfterEdit(editor, e, eOpts); }, this); this.cellEditing.on('beforeedit', function (editor, e) { return this.WMSINBeforeEdit(editor, e); }, this); }, //end initUIComponents parentfunction: function (button, event) { var ret1 = window.parent.opener.OprationSwap(); ret1[3](); OPLBNAME = ret1[4]; }, onAddWMSINClick: function (button, event, type) { var store = null; var data = this.formEdit.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 = this.EditRecord.get('WMSNO'); CLIENTNAME = this.EditRecord.get('CUSTOMERNAME'); STORAGENAME = this.EditRecord.get('STORAGENAME'); GOODSNAME = this.EditRecord.get('GOODSNAME'); //GOODSMODEL = this.EditRecord.get('GOODSMODEL'); GOODSMODEL = data.GOODSMODEL; GOODSSTANDARD = this.EditRecord.get('GOODSSTANDARD'); CHARGEUNIT = this.EditRecord.get('CHARGEUNIT'); } var newid = NewGuid(); record = Ext.create('WMSINmb', { //GOODSNAMEDISPLAY: pinming, GID: newid, ASSOCIATEDNO: "", BLNO: "", CONTRACTNO: "", CTNALL: CTNALL, CNTRNO: '', SEALNO: SEALNO, BSNO: BSNO, CLIENTCODE: "", CLIENTNAME: CLIENTNAME, DODATE: "", STORAGECODE: "", STORAGENAME: STORAGENAME, AREACODE: "", AREANAME: areaname, GOODSCODE: "", GOODSNAME: GOODSNAME, GOODSTYPE: "", GOODSMODEL: GOODSMODEL, GOODSSTANDARD: guigejianshu, GOODSPACK: zongjianshu, GOODSPACKSTOCK: "0", 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: jianshu2, JIANSHU1: jianshu1, 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 (this.OpStatus != "add") { if (this.EditRecord.get('ISLOCK') == "True") { alert("不能删除已入账的入库记录。"); return; } if (this.EditRecord.get('ISLOCK2') == "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 == 'CTNALL') { var ctnall = Ext.getCmp('CTNALL').rawValue; this.storeCNTRNO.load({ params: { mblno: BLNO, ctnall: ctnall} }); } //选择箱号带出封号,集装箱件数,CBM(尺码)(入库件数) if (e.field == 'CNTRNO') { /* var cntrno = Ext.getCmp('CNTRNO').rawValue; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/WMSNew/GetSEALNOWithBLNOAndCNTRNO', params: { bsno: BLNO, cntrno: cntrno }, callback: function (options, success, response) { if (success) { var jsonresult = Ext.JSON.decode(response.responseText); e.record.set('SEALNO', jsonresult.data); e.record.set('GOODSSLICE', jsonresult.pkgs); e.record.set('SHIJICHIMA', jsonresult.cbm); e.record.set('GOODSRKSL', jsonresult.cbm); } }, scope: this }); //request over */ } //选择品名带出规格/件数列表 /* 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; } }, InitData: function () { this.OpStatus = 'add'; var condition = ''; if (parentWin) { var ret = parentWin.OprationSwap(); this.OpStatus = ret[0]; //edit this.StoreList = ret[1]; this.EditRecord = ret[2]; //SelectedRecord this.parentRecord = ret[3]; this.OPLBNAME = ret[4]; } if (this.OpStatus == 'edit') { condition = " WMSNO='" + this.EditRecord.get('WMSNO') + "'"; this.LoadData(this.OpStatus, condition); WMSNO = this.EditRecord.get('WMSNO'); } else { this.LoadData(this.OpStatus, condition); } }, //end InitData //载入数据 LoadData: function (OpStatus, condition) { if (COMPANYID == "" || DEPTGID == "") { alert("登录信息不全,请退出重新登录"); return; } //#region 权限相关 Ext.Ajax.request({ waitMsg: '正在查询用户权限...', url: '/CommMng/BasicDataRef/GetAuthorityRange', params: { modName: "modWmsFeeRejected", USERID: USERID }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); rec = result.data; AUTHUNLOCKV = rec.VISIBLERANGE; AUTHUNLOCK = rec.OPERATERANGE; } else { Ext.MessageBox.alert('获取权限失败', response.responseText); return; } }, scope: this }); //#endregion //#region 获取系统参数(用于判断费用关联到海运进口还是入库单) Ext.Ajax.request({ waitMsg: '正在查询用户权限...', url: '/MvcShipping/WMSNew/GetSysFeeConfig', params: { userid: USERID }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); FEECONFIG = result.data; } else { Ext.MessageBox.alert('获取费用配置信息失败', response.responseText); return; } }, scope: this }); //#endregion this.OpStatus = OpStatus; var _this = this; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/WMSNew/GetData_LTJY', 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; } 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; this.storeCodeCtn.load({ params: { mblno: BLNO} }); if (blno != "" && blno != null) { this.storeCustomsNo.load({ params: { BLNO: blno, CUSTOMNO: ""} }); } 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.getForm(); this.formEdit.getForm().setValues(data); if (data.GID == "") { data.GID = "0" } /* this.panelFee.WMSOUTBSNO = data.ASSOCIATEDNO; this.panelFee.EditRecord = this.EditRecord; if (FEECONFIG == '1') { this.panelFee.strBSNO = data.ASSOCIATEDNO; } else { this.panelFee.strBSNO = data.GID; } this.panelFee.StoreDateCurr.load({ params: { optype: "op_Seai", bsno: data.GID} }); this.panelFee.StoreUnit.load({ params: { bsno: data.GID} }); this.panelFee.storeBodySum.load({ params: { bsno: data.GID} }); if (FEECONFIG == '1') { this.panelFee.storeDrChFee.load({ params: { billno: data.ASSOCIATEDNO, type: 1, optype: "op_Seai"} }); this.panelFee.storeCrChFee.load({ params: { billno: data.ASSOCIATEDNO, type: 2, optype: "op_Seai"} }); } else { this.panelFee.LoadDrChFee2("(bsno='" + data.GID + "' or WMSOUTBSNO='" + data.GID + "') and feetype=1 "); this.panelFee.LoadCrChFee2("(bsno='" + data.GID + "' or WMSOUTBSNO='" + data.GID + "') and feetype=2 "); } */ if (data.ISLOCK == '1' || data.ISLOCK == 'True') { LOCK1 = '1'; Ext.getCmp('btnLock').setText('取消入账'); Ext.getCmp('btnLock').setIconCls('new_lock'); var arr = this.formEdit.form._fields.items; for (var i = 0; i < arr.length; i++) { var obj = arr[i]; obj.setReadOnly(true); obj.fieldStyle = 'background:#E6E6E6'; } } else { LOCK1 = '0'; Ext.getCmp('btnLock').setText('入账'); Ext.getCmp('btnLock').setIconCls('new_lock'); } if (data.ISLOCK2 == '1' || data.ISLOCK2 == 'True') { Ext.getCmp('btnLock2').setText('解锁'); Ext.getCmp('btnLock2').setIconCls('new_lock'); var arr = this.formEdit.form._fields.items; for (var i = 0; i < arr.length; i++) { var obj = arr[i]; obj.setReadOnly(true); obj.fieldStyle = 'background:#E6E6E6'; } } else { Ext.getCmp('btnLock2').setText('锁定'); Ext.getCmp('btnLock2').setIconCls('new_lock'); } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } if (AUTHUNLOCK == '4') { if (Ext.getCmp('btnLock').text == "取消入账") { Ext.getCmp("btnLock").setDisabled(true); } } }, scope: this }); //request over if (this.OpStatus == 'edit') { var GID = this.EditRecord.get('GID'); this.storeWMSIN.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: " ASSOCIATEDNO='" + GID + "'" }, waitMsg: "正在查询数据...", scope: this }); this.storeWMSRATE.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: " BSNO='" + GID + "'" }, waitMsg: "正在查询数据...", scope: this }); } ///仓储费用入账 Ext.Ajax.request({ waitMsg: '正在查询用户权限...', url: '/CommMng/BasicDataRef/GetAuthorityRange', params: { modName: "modWmsFeeLock", USERID: USERID }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); rec = result.data; this.VISIBLERANGE = rec.VISIBLERANGE; this.OPERATERANGE = rec.OPERATERANGE; this.modWmsFeeLock = rec.OPERATERANGE; } else Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); }, scope: this }); //request over ///仓储费用取消入账 Ext.Ajax.request({ waitMsg: '正在查询用户权限...', url: '/CommMng/BasicDataRef/GetAuthorityRange', params: { modName: "modWmsFeeRejected", USERID: USERID }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); rec = result.data; this.VISIBLERANGE = rec.VISIBLERANGE; this.OPERATERANGE = rec.OPERATERANGE; this.modWmsFeeRejected = rec.OPERATERANGE; } else Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); }, scope: this }); //request over }, // end LoadDate checkedit: function (status) { if (status != 1 && status != 2 && status != 6 && status != 0) { alert("注意 录入状态/提交审核/驳回提交 的费用可以全部保存,审核通过的业务只保存支付信息 "); return false; } else if (status == 0) { alert("注意审核通过的业务只保存支付信息 "); return true; } }, Save: function (type) { var basicForm = this.formEdit.getForm(); var wmsgid = basicForm.findField('GID').value; if (!basicForm.isValid()) { return; } /* if (this.panelFee.storeDrChFee.getUpdatedRecords().length > 0 && wmsgid != "") { Ext.MessageBox.alert("提示", "有未保存的费用信息!请先在费用录入列表上方保存费用!"); return; }*/ var data = this.formEdit.getForm().getValues(); if (data.ISLOCK == "True" || data.ISLOCK == "1") { Ext.MessageBox.alert("提示", "已入账的入库信息不能进行修改") return; } if (data.ISLOCK2 == "True" || data.ISLOCK2 == "1") { Ext.MessageBox.alert("提示", "已锁定的入库信息不能进行修改") return; } var data = this.formEdit.getForm().getValues(); if (data.ISCHANGE == "True") { 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); } this.formEdit.getForm().findField('MARKETVALUE').setValue(MARKETVALUE); this.formEdit.getForm().findField('BANKVALUE').setValue(BANKVALUE); var WMSRATEdatas = []; var WMSINBody = ConvertRecordsToJson(WMSINdatas); var WMSINBodyDel = ConvertRecordsToJsonAll(this.WMSINBodyDel); var WMSRATEBody = ConvertRecordsToJson(WMSRATEdatas); var WMSRATEBodyDel = ConvertRecordsToJsonAll(this.WMSRATEBodyDel); 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; var _this = this; Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/WMSNew/Save_LTJY', scope: this, async: false, params: { OpStatus: this.OpStatus, data: Ext.JSON.encode(data), WMSINBody: WMSINBody, WMSINBodyDel: WMSINBodyDel, WMSRATEBody: WMSRATEBody, WMSRATEBodyDel: WMSRATEBodyDel }, 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; //费用关联海运进口 /* if (FEECONFIG == "1") { this.panelFee.stroplb = 'op_Seai'; this.panelFee.strBSNO = data.ASSOCIATEDNO; this.panelFee.strMBLNO = MBLNO; this.panelFee.StoreDrOpRange.load({ params: { optype: "modSeaiRecvFeeManagement"} }); this.panelFee.StoreCrOpRange.load({ params: { optype: "modSeaiPayFeeManagement"} }); this.panelFee.StoreUnit.load({ params: { bsno: BSNO, bstype: "op_Seai"} }); this.panelFee.storeFeeNameRef.load({ params: { condition: ""} }); this.panelFee.StoreDateCurr.load({ params: { optype: "op_Seai", bsno: BSNO} }); this.panelFee.storeDrChFee.load({ params: { billno: BSNO, type: 1, optype: "op_Seai"} }); this.panelFee.storeCrChFee.load({ params: { billno: BSNO, type: 2, optype: "op_Seai"} }); this.formEdit.getForm().setValues(returnData); this.panelFee.onPostDetailClick(null, null, 1); this.panelFee.onPostDetailClick(null, null, 2); } else { //费用关联入库单 this.panelFee.strBSNO = data.GID; this.panelFee.StoreDateCurr.load({ params: { optype: "op_other", bsno: data.GID} }); this.panelFee.StoreUnit.load({ params: { bsno: data.GID} }); this.panelFee.storeBodySum.load({ params: { bsno: data.GID} }); this.panelFee.LoadDrChFee2("bsno='" + data.GID + "' and feetype=1 "); this.panelFee.LoadCrChFee2("bsno='" + data.GID + "' and feetype=2 "); this.formEdit.getForm().setValues(returnData); this.panelFee.onPostDetailClick(null, null, 1); this.panelFee.onPostDetailClick(null, null, 2); } */ //保存费用end 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(); //this.storePayBody.commitChanges(); this.SaveRate(); if (type == '0') { this.OpStatus = 'edit'; var GID = _this.EditRecord.get('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'); } }); } //end save , getCondition: function (VISIBLERANGE) { var sql = ""; if (VISIBLERANGE == '0') { sql = " wi.CORPID='" + COMPANYID + "'"; } else if (VISIBLERANGE == '1') { sql = " wi.CORPID='" + COMPANYID + "'"; } else if (VISIBLERANGE == '2') { sql = " wi.CORPID='" + COMPANYID + "'"; } if (VISIBLERANGE == '3') { sql = " wi.CORPID='" + COMPANYID + "'"; } else {//4 sql = " 1=2 "; } } , getStartDate: function (Level, FEETYPE) { if (Level == 1) { return this.formEdit.getForm().findField('STARTBILLINGDATE').getValue(); } else { var lastlevel = ""; for (var i = 0; i < this.storeWMSRATE.getCount() - 1; i++) { lastlevel = this.storeWMSRATE.getAt(i).get("FEEGRADE"); lastFEETYPE = this.storeWMSRATE.getAt(i).get("FEETYPE"); if (lastlevel == Level - 1 && FEETYPE == lastFEETYPE) { return (this.storeWMSRATE.getAt(i).get("ENDBILLINGDATE")); } } } } , setCBM: function (newValue, oldValue) { if (newValue == oldValue) { return; } else { //将store当中的所有CHARGEUNIT改为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 + ")"); ; } } , LockWMS: function (Value) { if (Value == "0") { if (AUTHUNLOCK == '4') { Ext.MessageBox.alert('提示', '没有取消入账的权限!'); } } if (this.EditRecord == null) { alert("请先保存记录"); return; } if (this.EditRecord.data.WMSNO == '') { alert("请先进行保存!"); return; } var LockWMS = []; var info = "入账"; if (Value == "0") { info = "取消入账"; } else { info = "入账"; } Ext.MessageBox.confirm('提示', '确定要' + info + '吗?', function (btn) { if (btn == 'yes') { LockWMS.push(this.EditRecord); var LockWMSJSNO = ConvertRecordsToJsonAll(LockWMS); var _this = this; var wmsno = "'" + this.EditRecord.data.WMSNO + "'"; Ext.Ajax.request({// waitMsg: '正在处理数据...', url: '/MvcShipping/WMSNew/LockWMS', params: { wmsno: wmsno, EIP:false, type: parseInt(Value) }, callback: function (options, success, response) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { alert(jsonresult.Message); if (Value == "1") { _this.EditRecord.set("ISLOCK", "True"); var data = this.formEdit.getForm().getValues(); data.ISLOCK = "True"; this.formEdit.getForm().setValues(data); Ext.getCmp('btnLock').setText('取消入账'); Ext.getCmp('btnLock').setIconCls('new_lock'); LOCK1 = 1; var arr = this.formEdit.form._fields.items; for (var i = 0; i < arr.length; i++) { var obj = arr[i]; obj.setReadOnly(true); // obj.setDisabled(true); } } else { _this.EditRecord.set("ISLOCK", "False"); var data = this.formEdit.getForm().getValues(); data.ISLOCK = "False"; this.formEdit.getForm().setValues(data); Ext.getCmp('btnLock').setText('入账'); Ext.getCmp('btnLock').setIconCls('new_lock'); LOCK1 = 0; var arr = this.formEdit.form._fields.items; for (var i = 0; i < arr.length; i++) { var obj = arr[i]; obj.setReadOnly(false); //obj.setDisabled(false); } } _this.EditRecord.commit(); } else { alert(jsonresult.Message); } var condition = " WMSNO='" + WMSNO + "'"; this.LoadData('edit', condition); }, scope: this }); //request over } }, this); } , LockWMS2: function (Value) { if (this.EditRecord == null) { alert("请先保存记录"); return; } if (this.EditRecord.data.WMSNO == '') { alert("请先进行保存!"); return; } var LockWMS = []; var info = "锁定"; if (Value == "0") { info = "解锁"; } else { info = "锁定"; } Ext.MessageBox.confirm('提示', '确定要' + info + '吗?', function (btn) { if (btn == 'yes') { LockWMS.push(this.EditRecord); var LockWMSJSNO = ConvertRecordsToJsonAll(LockWMS); var _this = this; var wmsno = "'" + this.EditRecord.data.WMSNO + "'"; Ext.Ajax.request({// waitMsg: '正在处理数据...', url: '/MvcShipping/WMSNew/LockWMS2', params: { wmsno: wmsno, type: parseInt(Value) }, callback: function (options, success, response) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { alert(jsonresult.Message); if (Value == "1") { _this.EditRecord.set("ISLOCK2", "True"); var data = this.formEdit.getForm().getValues(); data.ISLOCK2 = "True"; this.formEdit.getForm().setValues(data); Ext.getCmp('btnLock2').setText('解锁'); Ext.getCmp('btnLock2').setIconCls('new_lock'); var arr = this.formEdit.form._fields.items; for (var i = 0; i < arr.length; i++) { var obj = arr[i]; obj.setReadOnly(true); // obj.setDisabled(true); } } else { _this.EditRecord.set("ISLOCK2", "False"); var data = this.formEdit.getForm().getValues(); data.ISLOCK2 = "False"; this.formEdit.getForm().setValues(data); Ext.getCmp('btnLock2').setText('锁定'); Ext.getCmp('btnLock2').setIconCls('new_lock'); var arr = this.formEdit.form._fields.items; for (var i = 0; i < arr.length; i++) { var obj = arr[i]; obj.setReadOnly(false); //obj.setDisabled(false); } } _this.EditRecord.commit(); } else { alert("操作失败" + jsonresult.Message); } }, scope: this }); //request over } }, this); }, onPrintClick: function (button, event) { // var printType = 'WmsInfoReport_opseai'; //海运进口 入库明细 var printType = 'WmsInfoReportNew'; var strBSNO = this.EditRecord.get('GID'); var wmsno = this.EditRecord.get('WMSNO'); var uid = USERID; var sql1 = "select "; sql1 = sql1 + "(select goodname from code_goods where gid= wi.goodsnameid) '品名',"; sql1 = sql1 + " wi.GOODSMODEL '规格',"; sql1 = sql1 + " wi.GOODSSTANDARD '规格/件数',"; sql1 = sql1 + "* from wms w "; sql1 = sql1 + " left join wms_in wi on w.gid= wi.ASSOCIATEDNO "; sql1 = sql1 + " where w.WMSNO = '" + wmsno + "'"; PrintComm(printType, sql1); }, onNextKeyClick: function (type, col) { if (type == 1) { var rows = this.formWMSINBody.getSelectionModel().getSelection(); var row = rows[rows.length - 1]; var s = this.formWMSINBody.getStore(); var number = s.indexOf(row) + 1; if (number == this.formWMSINBody.getStore().getCount()) { this.onAddWMSINClick(s, event, type); } else { this.cellEditing.startEditByPosition({ row: number, column: col }); } } else if (type == 2) { var rows = this.gridCrChFee.getSelectionModel().getSelection(); var row = rows[rows.length - 1]; var s = this.gridCrChFee.getStore(); var number = s.indexOf(row) + 1; if (number == this.gridCrChFee.getStore().getCount()) { this.onAddDetailClick(s, event, type); } else { this.cellEditingCrChFee.startEditByPosition({ row: number, column: col }); } } }, onSearchClick: function () { //查询数据 var data = this.formSearch.getForm().getValues(); var sBLNO = ""; //提单号 var sCUSTOMNO = ""; //报关单号、备案清单号 var sCONTRACTNO = ""; //合同号 var sCUSTNO = ""; //委托编号 var sCUSTOMERNAME = ""; //客户名称 var sBSNO = ""; //海运进口业务gid var sCTNALL = ""; //箱型 var sCNTRNO = ""; //箱号 var sSEALNO = ""; //封号 var sBAOGUANJIANSHU = 0; //报关件数 var sISBONDED = ""; BLNO = data.BLNO; var CUSTOMNO = data.CUSTOMNO; Ext.Ajax.request({ waitMsg: '正在查询主表数据...', //参数BLNO为提单号或委托单号 url: '/MvcShipping/WMSNew/GetDataWithBLNOAndWMSNO', params: { BLNO: BLNO, CUSTOMNO: CUSTOMNO }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success == true) { //更新备案清单号列表 this.storeCustomsNo.load({ params: { BLNO: BLNO, CUSTOMNO: CUSTOMNO} }); var data = this.formEdit.getForm().getValues(); sBLNO = result.MBLNO; sCUSTOMNO = result.CUSTOMNO; sCONTRACTNO = result.CONTRACTNO; sCUSTNO = result.CUSTNO; sCUSTOMERNAME = result.CUSTOMERNAME; sBSNO = result.BSNO; sCTNALL = result.CTNALL; sCNTRNO = result.CNTRNO; sSEALNO = result.SEALNO; sBAOGUANJIANSHU = result.BAOGUANJIANSHU; sISBONDED = result.ISBONDED; var timeStamp = result.timeStamp; TIMESTAMP = timeStamp; CNTRNO = sCNTRNO; CTNALL = sCTNALL; SEALNO = sSEALNO; PKGS = result.PKGS; BAOGUANJIANSHU = sBAOGUANJIANSHU; MBLNO = sBLNO; BSNO = sBSNO; if (true) { data.ISBONDED = sISBONDED; data.BAOGUANJIANSHU = BAOGUANJIANSHU; data.ASSOCIATEDNO = sBSNO; data.CORPID = COMPANYID; data.DEPTNAME = DEPTGID; data.CUSTOMERNAME = sCUSTOMERNAME; data.BLNO = sBLNO; data.CUSTNO = sCUSTNO; data.CUSTOMNO = sCUSTOMNO; data.CONTRACTNO = sCONTRACTNO; 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 = ""; data.CTNALL = sCTNALL; data.CNTRNO = sCNTRNO; data.SEALNO = sSEALNO; data.PKGS = PKGS; } var basicForm = this.formEdit.getForm(); this.storeCodeCtn.load({ params: { mblno: BLNO} }); this.formEdit.getForm().setValues(data); if (data.GID == "") { data.GID = "0" } } else { Ext.MessageBox.alert('提示', result.Message); return; } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } , onCreateCostClick: function () { if (LOCK1 != 1) { Ext.MessageBox.alert('提示', '未入账不允许生成费用'); return; } Ext.Ajax.request({ waitMsg: '正在查询主表数据...', url: '/MvcShipping/WMSNew/CreateCost', params: { wmsno: WMSNO }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); if (result.Success == true) { Ext.MessageBox.alert('提示', result.Message); var condition = " WMSNO='" + WMSNO + "'"; this.LoadData('edit', condition); } else { Ext.MessageBox.alert('提示', result.Message); return; } } else { Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); } }, scope: this }); } //#region 仓储费率相关 , onAddWMSRATEClick: function (button, event, type) { var store = null; store = this.storeWMSRATE; var record = null; var newid = NewGuid(); record = Ext.create('WMSRATEmb', { GID: newid, CUSTOMERNAME: "", FEETYPE: "0", FEETYPEREF: "", FEEGRADE: this.getLinenum2("1", newid), FEESCALE: 0, FEEPRICE: 0, FEEUNIT: "", CREATEUSER: USERID, CREATETIME: TIMESTAMP, MODIFIEDUSER: SHOWNAME, MODIFIEDTIME: TIMESTAMP, REMARK: "", BSNO: "", ADDPRICE: "0", ENDBILLINGDATE: TIMESTAMP, RATETYPE: 1, FEENAME: "仓储费", ISCHANGE: "0", CAPPRICE: "0" }); store.add(record); cellediting = this.CE_RATE; var n = store.getCount(); cellediting.startEditByPosition({ row: n - 1, column: 2 }); this.storeWMSRATE.each(function (record) { if (record.get('GID') == newid) { record.set('FEETYPE', "1"); record.set('FEETYPEREF', "收"); } }); } , SaveRate: function (type) { if (COMPANYID == "" || DEPTGID == "") { alert("登录信息不全,请退出重新登录"); return; } var WMSRATEdatas = []; var data = this.formEdit.getForm().getValues(); var dt0 = new Date(data.STARTBILLINGDATE); var dttemp; for (var i = 0; i < this.storeWMSRATE.getCount(); i++) { //判断结束计费日期 STARTBILLINGDATE var member = this.storeWMSRATE.getAt(i); var dt1 = new Date(member.data.ENDBILLINGDATE); if (i == 0) { if (dt1 < dt0) { Ext.Msg.show({ title: '错误', msg: '结束计费日期录入错误!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } } else { var member = this.storeWMSRATE.getAt(i); var dt2 = new Date(member.data.ENDBILLINGDATE); if (dt2 < dt0) { Ext.Msg.show({ title: '错误', msg: '结束计费日期录入错误!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } } dttemp = dt1; } for (var i = 0; i < this.storeWMSRATE.getCount(); i += 1) { var member = this.storeWMSRATE.getAt(i); WMSRATEdatas.push(member); } var WMSRATEBody = ConvertRecordsToJson(WMSRATEdatas); var WMSRATEBodyDel = ConvertRecordsToJsonAll(this.WMSRATEBodyDel); var data = this.formEdit.getForm().getValues(); var _this = this; if ((WMSRATEBody + WMSRATEBodyDel) == "") { return; } Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/WMSNew/SaveRate', scope: this, params: { BSNONAME: "BSNO", BSNO: data.GID, WMSRATEBody: WMSRATEBody, WMSRATEBodyDel: WMSRATEBodyDel }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var GID = _this.EditRecord.get('GID'); _this.storeWMSRATE.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: " BSNO='" + GID + "'" }, waitMsg: "正在查询数据...", scope: this }); } 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 }); } } }); } , onDelWMSRATEClick: function (button, event, type) { var selectedRecords = []; selectedRecords = this.CB_RATE.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 (COMPANYID == "" || DEPTGID == "") { alert("登录信息不全,请退出重新登录"); return; } if (selectedRecords.length > 0) { for (var i = 0; i < selectedRecords.length; i++) { var rec = selectedRecords[i]; if (rec.data.BSNO != "") //如果是新增但没有保存的数据,没有必要提交到后台 { this.WMSRATEBodyDel.push(rec); } else { this.storeWMSRATE.remove(selectedRecords[i]); } } } var WMSRATEBodyDel = ConvertRecordsToJsonAll(this.WMSRATEBodyDel); if (WMSRATEBodyDel == "") { return; } else { var data = this.formEdit.getForm().getValues(); var _this = this; Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Ajax.request({ waitMsg: '正在保存数据...', url: '/MvcShipping/WMSNew/DelRate', scope: this, params: { BSNONAME: "BSNO", BSNO: data.GID, WMSRATEBodyDel: WMSRATEBodyDel }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { for (var i = 0; i < selectedRecords.length; i++) { this.storeWMSRATE.remove(selectedRecords[i]); } //this.storeWMSRATE.remove(selectedRecords[i]); } 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'); } }); } } }, this); } , WMSRATEAfterEdit: function (editor, e, eOpts) { //需要自己实现里面的事件 if (COMPANYID == "" || DEPTGID == "") { alert("登录信息不全,请退出重新登录"); returen; } if (e.field == 'FEESCALE') { var startdate = this.getStartDate(parseInt(e.record.get('FEEGRADE')), e.record.get('FEETYPE')); var days = 0; if (parseInt(e.record.get('FEEGRADE')) == "1") { days = parseInt(e.value) } else { days = parseInt(e.value) + 1; } var enddate = getAfterDATE(startdate, days); e.record.set('ENDBILLINGDATE', enddate); } if (e.field == 'FEETYPE') { var staterecords = DsStoreQueryBy(this.storeFeeType, 'FeeTypeID', e.value); if (staterecords.getCount() > 0) { var statedata = staterecords.getAt(0).data; e.record.set('FEETYPEREF', statedata.FeeTypeName); e.record.set('FEEGRADE', this.getLinenum2(e.value, e.record.get('GID'))); } else { e.record.set('FEETYPEREF', ''); } } }, 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; } , ImportFeeModel: function () { Ext.MessageBox.confirm('提示', '点击确定系统将自动导入入库明细【第一行】的【品名】相关仓储费率模板', function (btn) { if (btn == 'yes') { var _this = this; var ARCLIENT = "'" + this.EditRecord.data.ARCLIENT + "'"; //应收客户 var pinmingid = ''; if (this.storeWMSIN.data.items.length > 0) { pinmingid = this.storeWMSIN.data.items[0].data.GOODSNAMEID; } if (ARCLIENT == 'undefine' || ARCLIENT == '') { Ext.Msg.show({ title: '错误', msg: '未获取到应收客户信息!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } if (pinmingid == '') { Ext.Msg.show({ title: '错误', msg: '未获取到品名信息!', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } Ext.Ajax.request({// waitMsg: '正在处理数据...', url: '/MvcShipping/WMSNew/GetImportFeeModel', params: { custname: ARCLIENT, goodnameid: pinmingid }, callback: function (options, success, response) { var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { for (var i = 0; i < jsonresult.data.length; i++) { var feedata = jsonresult.data[i]; var store = null; store = this.storeWMSRATE; var record = null; var newid = NewGuid(); var JiFeiTime = this.formEdit.getForm().findField('STARTBILLINGDATE').getValue(); record = Ext.create('WMSRATEmb', { GID: newid, CUSTOMERNAME: feedata, FEETYPE: feedata.ShouFuFangXiang, FEETYPEREF: "", FEEGRADE: feedata.JiFeiDengJi, FEESCALE: feedata.JiFeiQuJian, FEEPRICE: feedata.JiFeiDanJia, FEEUNIT: "", CREATEUSER: USERID, CREATETIME: TIMESTAMP, MODIFIEDUSER: SHOWNAME, MODIFIEDTIME: TIMESTAMP, REMARK: "", BSNO: "", ADDPRICE: feedata.ZengZhiJia, ENDBILLINGDATE: TIMESTAMP, RATETYPE: 1, FEENAME: "仓储费", ISCHANGE: "0", CAPPRICE: feedata.FengDingJia }); store.add(record); this.storeWMSRATE.each(function (record) { if (record.get('FEETYPE') == '1') { record.set('FEETYPEREF', "收"); } else { record.set('FEETYPEREF', "付"); } }); var value = feedata.JiFeiQuJian; var startdate = this.getStartDate(parseInt(record.get('FEEGRADE')), record.get('FEETYPE')); var days = 0; if (parseInt(record.get('FEEGRADE')) == "1") { days = parseInt(value) } else { days = parseInt(value) + 1; } var enddate = getAfterDATE(startdate, days); record.set('ENDBILLINGDATE', enddate); } } else { alert(jsonresult.Message); } }, scope: this }); //request over } }, this); } //#endregion //#region 计算装卸队对应的 //#endregion //#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,true); } } //end onUpDetailClick , onAddBOXClick: function (button, event) { //zdxh 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 = Ext.getCmp("zdxh").getValue(); var XIANGSHU = Ext.getCmp("zkxs2").getValue(); var getstartno = new RegExp(/\d+$/); var NumberCount = getstartno.exec(XIANGSHU); for (var i = 0; i < NumberCount; i++) { this.MakeWMSIN(CNTRNO, data, false); } } //end onUpDetailClick , MakeWMSIN: function (NEWCNTRNO, firstdata, getfocus) { var store = null; var data = this.formEdit.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.AREANAME, 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); if (getfocus == true) { 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 打印 , Print: function () { //费用通知_无过程 var basicForm = this.formEdit.getForm(); var wmsgid = basicForm.findField('GID').value; if (DsTruck.GetDirty1(panelWMSNewINEdit.storeWMSIN, null) == true || wmsgid == "") { alert("请先保存修改"); return; } var printType = 'WMSIN_LTJY'; // // var sql1 = " SELECT wi.* , "; sql1 = sql1 + " IsNull((SELECT (GOODNAME) as CodeAndName from code_goods where GID = wi.goodsnameid),'') as GOODSNAMEDISPLAY , "; sql1 = sql1 + " IsNull((SELECT CODE+'-'+NAME as CODENAME from wms_stevedores where GID = wi.ZHUANGXIEGONGID),'') as ZHUANGXIEGONG , "; sql1 = sql1 + " IsNull((SELECT PriceJian from wms_stevedores where GID = wi.ZHUANGXIEGONGID),'0') as ZhuangXieFeiDanJiaJian , "; sql1 = sql1 + " IsNull((SELECT PriceLiangTon from wms_stevedores where GID = wi.ZHUANGXIEGONGID),'0') as ZhuangXieFeiDanJiaTon , "; sql1 = sql1 + " IsNull((SELECT CODENAME+'-'+SHORTNAME as CODENAME from info_client where GID = wi.CHEDUIID),'') as CHEDUI, "; sql1 = sql1 + " IsNull((select substring(country,0,(charindex('(',country)) ) as country from code_country where COUNTRYID=wi.countryid),'') as COUNTRY "; sql1 = sql1 + " FROM [wms_in] wi "; sql1 = sql1 + " where wi.ASSOCIATEDNO ='" + wmsgid + "'"; var sql2 = ""; var sql3 = ""; var sql4 = ""; var sql5 = ""; var sql6 = ""; PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); } //#endregion });