You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/MvcShipping/Viewsjs/WMSNew/WMSNewINEdit.js

5810 lines
235 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

///<reference path="../../../../Views/../TruckMng/Scripts/vswd-ext_2.0.2.js" />
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;
var COUNTRYNAMESTR = "";
var COUNTRYIDSTR = "";
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,
blEIP: false,
initUIComponents: function () {
this.formname = 'WMSNewINEdit';
this.formnamerate = 'WMSNewINEditRate';
this.feeSerialNo = 0;
this.WMSINBodyDel = [];
this.WMSRATEBodyDel = [];
this.MsPeriod = null;
//#region 枚举参照相关(编辑form)
//#endregion
WorkFlowName = 'WMSINmod';
this.storeDefValue = Ext.create('Ext.data.Store', {
model: 'DsShipping.ux.OpDefValue',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeOpDef/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeMustBe = Ext.create('Ext.data.Store', {
model: 'DsShipping.ux.OpDefValue',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCodeOpMustField/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#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,
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
for (var j = 0; j < _this.storeWMSIN.getCount(); j += 1) {
var memberbody = _this.storeWMSIN.getAt(j);
memberbody.set("STORAGENAME", combo.value);
};
}
}
}
});
//委托单位
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' }
});
//this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户名称',
store: this.storeCustCode,
forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
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/GetCustomRefListRm' }
});
this.comboxGainCust = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '应收客户',
store: this.storeGainCust,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
lazyRender: false,
id: 'ARCLIENT',
name: 'ARCLIENT',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.storePayCust = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
this.comboxPayCust = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '应付客户',
store: this.storePayCust,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
lazyRender: false,
id: 'TRUCKNAME',
name: 'TRUCKNAME',
valueField: 'CustName',
displayField: 'CodeAndName'
});
var CHARGEUNITData = [
{ "CHARGEUNIT": "CBM" }, { "CHARGEUNIT": "吨" }, { "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',
listeners: {
change: function (field, newValue, oldValue) {
this.setCBM(newValue, oldValue);
},
scope: this
}
});
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsListWmsRm' }
});
this.storeCodeGoodsList.load();
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCodeGoodsList,
id: 'GOODSNAME',
name: 'GOODSNAME',
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
valueField: 'GID',
displayField: 'CodeAndName'
});
this.storeGoodsnameList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsListWmsRm' }
});
this.storeGoodsnameList.load();
//品名下的规格
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: false,
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.storeOpCode2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.storeOpCode2.load();
//揽货人
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人', //'揽货人',
store: this.storeOpCode2,
forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
this.storeSaleCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCompanysEntity',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
this.storeSaleCompany.load({ params: { condition: "" } });
this.comboxSaleCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel:'所属分部', //'委托分公司',
store: this.storeSaleCompany,
forceSelection: true,
name: 'SALECORPID',
valueField: 'GID',
displayField: 'NAME'
});
//箱号封号/件数重量
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',
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,
matchFieldWidth: false,
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'
});
//货属公司
this.storeCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'companymb', proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' }
});
this.storeCompany.load({ params: { condition: "" } });
this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '货属公司',
store: this.storeCompany,
forceSelection: true,
id: 'COMPANY',
name: 'COMPANY',
valueField: 'gid',
displayField: 'name',
allowBlank: true
});
//#endregion
//#region form定义
this.storeOPLBNAME = Ext.create('Ext.data.Store', {
model: 'DsTruckMng.ux.GeneralValue',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/WMSNew/GetWMSOPTYPE',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeOPLBNAME.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: "" },
waitMsg: "正在查询数据...",
scope: this
});
this.comboxOPLBNAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务类型',
bodyPadding: 1,
flex: 1,
width: 80,
labelWidth: 60,
store: this.storeOPLBNAME,
//queryMode: 'local',
//triggerOnClick: false,
name: 'OPLBNAME',
valueField: 'GID',
displayField: 'GVALUE'
});
//检索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: 120
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxOPLBNAME,
{
fieldLabel: '提单号/委托单号',
flex: 1,
name: 'BLNO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() === e.ENTER) {
_this.onSearchClick();
}
}
}
}, {
fieldLabel: '报关单号',
flex: 1,
hidden: true,
name: 'WMSNO'
}, {
xtype: 'button',
text: "查询",
flex: 0.35,
handler: function () {
_this.onSearchClick();
},
style: {
marginTop: '1px'
}
}, {
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: 170,
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,
disabled: true
},
this.comboxCustCode,
{
fieldLabel: '提单号', flex: 2,
name: 'BLNO'
}, {
fieldLabel: '合同号', flex: 2,
labelWidth: 100,
name: 'CONTRACTNO', id: "CONTRACTNO"
}
//, {
// 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.setFeeModel('1');
this.setFeeModel('2');
}
}
}, this.comboxCHARGEUNIT
, this.comboxGainCust
, {
fieldLabel: '应收免仓储期',
labelWidth: 100,
name: 'FREESTORAGEPERIOD',
id: "FREESTORAGEPERIOD",
xtype: 'numberfield',
allowBlank: false,
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));
this.setFeeModel('1');
}
}
}
, {
name: 'STARTBILLINGDATE', id: "STARTBILLINGDATE",
fieldLabel: '应收计费日期',
labelWidth: 100,
format: 'Y-m-d',
xtype: 'datefield',
listeners: {
change: function (field, newValue, oldValue) {
this.setFeeModel('1');
},
scope: this
},
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s')
}]
},
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '储位',
name: 'AREANAME',
id: "AREANAME"
}
, {
fieldLabel: '牌号/型号',
name: 'GOODSMODEL',
id: "GOODSMODEL"
}, {
fieldLabel: '包装规格',
name: 'GOODSSTANDARD',
id: "GOODSSTANDARD"
}, this.comboxPayCust
, {
fieldLabel: '应付免仓储期',
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));
this.setFeeModel('2');
}
}
}
, {
name: 'STARTBILLINGDATEAP', id: "STARTBILLINGDATEAP",
fieldLabel: '应付计费日期',
labelWidth: 100,
format: 'Y-m-d',
xtype: 'datefield',
listeners: {
change: function (field, newValue, oldValue) {
this.setFeeModel('2');
},
scope: this
},
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: '库别',
flex: 1,
name: 'WHS_CODE',
id: "WHS_CODE"
}, this.comboxCustomsNo, {
fieldLabel: '委托编号',
flex: 1,
name: 'CUSTNO',
id: "CUSTNO"
}, {
fieldLabel: '电子账册号',
labelWidth: 75,
flex: 1,
name: 'BZTCHNO',
id: "BZTCHNO"
}, {
fieldLabel: '会计期间',
flex: 1,
name: 'ACCDATE',
xtype: 'monthfield',
format: 'Y-m',
value: Ext.util.Format.date(currdate, 'Y-m'),
editable: false,
allowBlank: false
}, {
fieldLabel: '是否保税',
readOnly: true,
disabled: true,
name: 'ISBONDED'
}, this.comboxSALE]
},
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
// anchor: '66.66%',
items: [{
fieldLabel: '重量',
readOnly: true,
disabled: true,
id: "ZGOODSKGS",
name: 'GOODSRKSL'
},
{
fieldLabel: '件数',
readOnly: true,
disabled: true,
name: 'PKGS',
id: "PKGS"
}, {
fieldLabel: '报关件数',
readOnly: false,
name: 'BAOGUANJIANSHU',
id: "BAOGUANJIANSHU"
}, {
fieldLabel: '提单件数',
//labelWidth: 100,
readOnly: false,
name: 'TiDanJianShu',
id: "TiDanJianShu",
decimalPrecision: 0,
xtype: 'numberfield'
//,
//regex: /^(0|[1-9][0-9]*)$/,
//regexText: '请输入正确的数值!'
}, {
fieldLabel: '提单重量',
//labelWidth: 100,
readOnly: false,
name: 'TiDanZhongLiang',
id: "TiDanZhongLiang",
decimalPrecision: 5,
xtype: 'numberfield'
//,
//regex: /^(0|[1-9][0-9]*)$/,
//regexText: '请输入正确的数值!'
}, this.comboxCompany, {
fieldLabel: '水分',
name: 'WET',
id: "WET"
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: '租赁面积',
name: 'RENTAREA',
id: "RENTAREA"
}, {
fieldLabel: '备注', flex: 6,
name: 'REMARKS',
id: 'REMARKS'
}]
}, {
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: 'EIP', hidden: true,
name: 'EIP',
id: "EIP"
}, {
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: 'GOODSSTOCK', hidden: true,
name: 'GOODSSTOCK',
id: "GOODSSTOCK"
}]
}
]
}
]
});
//#endregion
//#region 编辑wms_IN
//数据集
this.storeWMSIN = Ext.create('Ext.data.Store', {
model: 'WMSINmb',
pageSize: 1000,
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.storeDOCK = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DICModel',
proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' }
});
this.storeDOCK.load({ params: { tablename: "wms_in", columnname: "DOCK", condition: "" } });
this.comboxDOCK = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeDOCK,
id: 'DOCK',
name: 'DOCK',
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, //1
dataIndex: 'TRAYNO',
header: '托号',
width: 160, hidden: false, editor: {
xtype: 'textfield'
}
},
{
sortable: true,
dataIndex: 'ASSOCIATEDNO',
header: '关联号',
width: 80, hidden: true
},
{
sortable: true,
dataIndex: '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: false,
dataIndex: 'TRUCKNO',
header: '车牌号',
width: 80,
editor: {
xtype: 'textfield'
}
}, {
hidden: false,
dataIndex: 'CHEDUIID',
header: '车队',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
/**
if (_this.comboxCheDui.rawValue != null && _this.comboxCheDui.rawValue != '') {
var cdcodename = _this.comboxCheDui.rawValue;
var cdname = cdcodename.split('-')[1];
return cdname;
} else {
var cd = (record.data.CHEDUI == '' || record.data.CHEDUI == null) ? '' : record.data.CHEDUI.split('-')[1];
return cd;
}
**/
return record.data.CHEDUI;
},
editor: this.comboxCheDui
}, {
hidden: false,
dataIndex: 'ZHUANGXIEGONGID',
header: '装卸工',
width: 80
,
editor: this.comboxZhuangXieGong,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
return record.data.ZHUANGXIEGONG;
}
}, {
hidden: false,
dataIndex: 'ZhuangXieFeeType',
header: '装卸计费标准',
width: 80,
editor: this.comboxZhuangXieFeiType
}, {
hidden: false,
dataIndex: 'ZhuangXieFeiDanJiaTon',
header: '装卸费单价(吨)',
width: 80
}, {
hidden: false,
dataIndex: 'ZhuangXieFeiDanJiaJian',
header: '装卸费单价(件)',
width: 80
}, {
hidden: false,
dataIndex: 'JIANSHU1',
header: '件数1',
width: 80,
editor: {
xtype: 'textfield'
}
},
{
hidden: false,
dataIndex: 'JIANSHU2',
header: '件数2',
width: 80,
editor: {
xtype: 'textfield'
}
},
{
hidden: false,
dataIndex: 'CHIMA1',
header: '尺码1',
width: 80,
editor: {
xtype: 'textfield'
}
},
{
hidden: false,
dataIndex: 'CHIMA2',
header: '尺码2',
width: 80,
editor: {
xtype: 'textfield'
}
},
{
hidden: false,
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: false,
dataIndex: 'SHIJIZHONGLIANG',
header: '实际重量',
width: 80,
editor: {
xtype: 'textfield'
}, summaryType: 'sum',
summaryRenderer: function (value) {
value = usMoney(value, 4, '', true);
return value;
}
},
{
hidden: false,
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: false,
width: 80,
editor: {
xtype: 'numberfield'
}
}, {
sortable: true,
dataIndex: 'LOADERFEE',
header: '入库(装卸)费',
hidden: false,
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
},
{
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'];
//}
return record.data.GOODSNAMEDISPLAY;
},
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: '牌号/型号',
tooltip: '牌号、型号、规格、式样等...',
width: 80,
editor: this.comboxGOODSDETAILS
},
{
sortable: true,
dataIndex: 'GOODSSTANDARD',
readOnly: true,
header: '规格/件数',
width: 80
},
{
sortable: true,
dataIndex: 'CHARGEUNIT',
header: '计费单位',
width: 80
},
{
sortable: true, //23
dataIndex: 'GOODSPACK',
header: '总件数',
width: 80,
editor: {
xtype: 'numberfield'
},
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: '库存件数',
width: 80,
summaryType: 'sum',
summaryRenderer: function (value) {
return Ext.util.Format.number(value, '0.00');
}
},
{
sortable: true, id: "GOODSKGS", //24
dataIndex: 'GOODSKGS',
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: '入库量',
readOnly: true,
width: 80,
summaryType: 'sum',
summaryRenderer: function (value) {
value = usMoney(value, 4, '', true);
return value;
}
},
{
sortable: true,
id: "GOODSSTOCK_IN",
dataIndex: 'GOODSSTOCK',
header: '*库存量',
width: 80,
summaryType: 'sum',
summaryRenderer: function (value) {
value = usMoney(value, 4, '', true);
return value;
}
},
{
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: '包装',
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,
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: '原产国',
renderer: function (value, p, record) {
if (value == null || value == '')
return '';
else
return record.data.COUNTRY;
},
editor: this.comboxCountry,
width: 120
},
{
dataIndex: 'PRODUCTIONDATE',
header: '生产日期',
width: 150,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'FACTORYNO',
header: '厂号',
width: 150,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'INVOICENO',
header: '发票号',
width: 150
},
{
dataIndex: 'BZTCHNO',
header: '批次号',
width: 150
},
{
sortable: true,
dataIndex: 'DOCK',
hidden: true,
header: '码头',
width: 80,
editor: this.comboxDOCK
},
{
sortable: true,
dataIndex: 'LinShiZhuangXieFeiDanJiaDun',
hidden: true,
header: '临时装卸费单价(吨)',
width: 80,
editor: {
xtype: 'numberfield'
}
},
{
sortable: true,
dataIndex: 'LinShiZhuangXieFeiDanJiaJian',
hidden: true,
header: '临时装卸费单价(件)',
width: 80,
editor: {
xtype: 'numberfield'
}
}
];
this.girdcolums = this.columns;
this.girdcolums = DsTruck.GetGridPanel(GID, this.formname, this.girdcolums, 0); //使用者id表名中间column数组跳过一开始的几列
this.girdcolums.unshift(new Ext.grid.RowNumberer());
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',
columnLines: true,
//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 (LOCK1 == '1') {
Ext.MessageBox.alert('提示', '已入账不允许修改!');
return;
}
this.onAddWMSINClick(button, event);
},
scope: this
}, {
text: '删除入库信息', id: "del1",
tooltip: '删除入库信息',
iconCls: "btndeletedetail",
handler: function (button, event) {
if (LOCK1 == '1') {
Ext.MessageBox.alert('提示', '已入账不允许修改!');
return;
}
this.onDelWMSINClick(button, event);
},
scope: this
}, '-', {
text: '引入提单集装箱信息', id: "importctn",
tooltip: '引入提单集装箱信息',
handler: function (button, event) {
this.onImportCtnClick(button, event);
},
scope: this
}, '-', {
text: '生成费用', id: "createcost",
tooltip: '生成费用',
handler: function (button, event) {
this.onCreateCostClick(button, event);
},
scope: this
}, {
// id: "saveandclose",
text: "保存",
iconCls: "btnsave",
handler: function (button, event) {
if (LOCK1 == '1') {
Ext.MessageBox.alert('提示', '已入账不允许修改!');
return;
}
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
}, {
text: "Execl 导入",
menu: [{
text: "导入数据",
handler: function (button, event) {
if (Ext.get("importWin") == null) {
var upform = Ext.create('Ext.form.Panel', {
width: 500,
bodyPadding: '6 6 6 6',
id: "upform",
defaults: {
anchor: '100%',
allowBlank: false,
msgTarget: 'side',
labelWidth: 100
},
items: [{
xtype: 'filefield',
id: 'form-file',
emptyText: '请选择文件',
fieldLabel: '文件路径',
name: 'file',
buttonText: '浏览',
regex: /^.+\.(xls|xlsx)$/,
regexText: "只能选择xls|xlsx格式的文件",
buttonConfig: {
iconCls: 'upload-icon'
}
}],
buttons: [{
text: '开始导入',
handler: function () {
var form = this.up('form').getForm();
if (form.isValid()) {
form.submit({
method: 'post',
url: '/mvcshipping/WMSNew/FileUpload',
waitMsg: '正在上传您的文件,请耐心等候...',
success: function (form, action) {
var data = _this.formEdit.getForm().getValues();
//导入的数据
var data1 = eval(action.result.data);
data1.forEach(function (item, index) {
var record = Ext.create('WMSINmb', {
CTNALL: CTNALL,
SEALNO: SEALNO,
CLIENTNAME: data.CUSTOMERNAME,
AREANAME: data.AREANAME,
GOODSNAME: data.GOODSNAME,
GOODSMODEL: data.GOODSMODEL,
CHARGEUNIT: data.CHARGEUNIT,
GOODSRKSL: "0",
GOODSSTOCK: "0",
FREESTORAGEPERIOD: "0",
ISLOCK: "0",
ISDELETE: "0",
ARFEE: "0",
APFEE: "0",
GOODSKGS: "0",
CORPID: COMPANYID,
GOODSTHICKNESS: "0",
GOODSWIDTH: "0",
GOODSLENGTH: "0",
GOODSPACKACTUAL: "0",
GOODSRKSLACTUAL: "0",
ISCHANGE: "0",
MARKETVALUE: "0",
BANKVALUE: "0",
LINENUM: _this.getLinenum(),
CHIMA1: "0",
CHIMA2: "0",
ZHONGLIANG2: "0",
SHIJIZHONGLIANG: "0",
SHIJICHIMA: "0"
});
for (var o in item) {
if (item.hasOwnProperty(o)) {
record.data[o] = item[o];
}
}
_this.storeWMSIN.add(record);
});
Ext.getCmp("importWin").close();
Ext.Msg.alert("提示信息", "导入成功!");
},
failure: function (form, action) {
Ext.Msg.alert("提示信息", "导入失败,请重试!");
}
});
}
}
}, {
text: '重置',
handler: function () {
this.up('form').getForm().reset();
}
}]
});
var win = Ext.create('Ext.window.Window',
{
title: '导入文件',
layout: 'fit',
id: 'importWin',
draggable: true, //拖动
x: event.clientX,
y: event.clientY,
resizable: false,
items: {
xtype: 'panel',
border: true,
items: [upform]
}
});
win.show();
}
}
}, {
text: "下载模板",
handler: function (menu, event) {
window.open("/download/入库信息_模板.xlsx", "_blank");
}
}],
scope: this
}, {
text: '入库盘点',
tooltip: '入库盘点',
handler: function (button, event) {
var comboxCtn = Ext.create('Ext.form.field.Text',
{
id: "ctnCombo",
region: "north",
margins: '12 12 6 12',
forceSelection: true,
fieldLabel: '条码',
labelAlign: 'right',
labelWidth: 30,
listeners: {
change: function (obj, nval, oval, opt) {
//扫描枪的文本映射到文本框后数量框激活
var _code = Ext.getCmp("ctnCombo").getValue();
Ext.getCmp("ctnNUmber").focus();
if (_code !== "") {
Ext.Ajax.request({
url: '/MvcShipping/WMSNew/beforePanDian',
params: {
code: _code,
gid: _this.EditRecord.get('GID')
},
callback: function (options, success, response) {
var result = eval('(' + response.responseText + ')');
if (result.res) {
//反填品名、规格
Ext.getCmp("ctnCombo1").setValue(result.name);
Ext.getCmp("ctnCombo2").setValue(result.model);
}
},
scope: this
});
}
}
}
}); //箱型
var limitWeight = Ext.create('Ext.form.field.Number',
{
id: "ctnNUmber",
region: "north",
margins: '6 12 6 12',
name: 'LIKGS',
fieldLabel: "数量",
labelAlign: 'right',
labelWidth: 30,
//value: 18.000,
maxValue: 100000,
width: 180,
minValue: 0,
allowDecimals: true,
decimalPrecision: 0
});
var comboxCtn1 = Ext.create('Ext.form.field.Text',
{
id: "ctnCombo1",
region: "north",
margins: '12 12 6 12',
forceSelection: true,
readOnly: true,
fieldLabel: '品名',
labelAlign: 'right',
labelWidth: 30
}); //品名
var comboxCtn2 = Ext.create('Ext.form.field.Text',
{
id: "ctnCombo2",
region: "north",
margins: '12 12 6 12',
forceSelection: true,
readOnly: true,
fieldLabel: '规格',
labelAlign: 'right',
labelWidth: 30
}); //规格
var buttonCtn = Ext.create('Ext.Button',
{
text: '确定',
renderTo: Ext.getBody(),
region: "south",
margins: '6 12 6 12',
handler: function () {
var _code = Ext.getCmp("ctnCombo").getValue();
var _num = Ext.getCmp("ctnNUmber").getValue();
if (_code !== "" && _num !== "") {
//进行盘点
Ext.Ajax.request({
waitMsg: '正在盘点...',
url: '/MvcShipping/WMSNew/PanDian',
params: {
code: _code,
num: _num,
gid: _this.EditRecord.get('GID')
},
callback: function (options, success, response) {
if (eval(response.responseText)) {
var GID = _this.EditRecord.get('GID');
_this.storeWMSIN.load({
params: {
start: 0,
limit: 1000,
sort: '',
condition: "ASSOCIATEDNO='" + GID + "'"
},
waitMsg: "正在查询数据...",
scope: _this
});
} else {
Ext.Msg.show({
title: '提示',
msg: '未找到对应记录',
icon: Ext.Msg.INFO,
buttons: Ext.Msg.OK
});
}
//盘点后条码框重新获取焦点
Ext.getCmp("ctnNUmber").setValue("");
Ext.getCmp("ctnCombo").setValue("");
//盘点后条码框重新获取焦点
Ext.getCmp("ctnCombo2").setValue("");
Ext.getCmp("ctnCombo1").setValue("");
Ext.getCmp("ctnCombo").focus();
},
failure: function (response, options) {
Ext.Msg.show({
title: '警告',
msg: '服务器响应出错,请重试',
icon: Ext.Msg.INFO,
buttons: Ext.Msg.OK
});
},
success: function (response, options) {
},
scope: this
});
} else {
Ext.Msg.show({ title: '提示', msg: "条码、数量不能为空", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
Ext.getCmp("ctnCombo").focus();
}
}
}); //确认盘点
var layerPanel = new Ext.Panel({
layout: "border",
width: 200,
height: 250,
id: 'pnlctn_11',
region: "center",
items: [comboxCtn, limitWeight, comboxCtn1, comboxCtn2, {
xtype: 'label',
forId: 'myFieldId',
html: "<p style='color:red'>使用扫描枪扫描商品时,请确认【条码】框已获得焦点</p>",
margin: '15'
}, buttonCtn]
});
var win = Ext.create('Ext.window.Window',
{
title: '入库盘点',
layout: 'fit',
id: 'optionWin',
draggable: true, //拖动
x: event.clientX,
y: event.clientY,
resizable: false,
items: { // Let's put an empty grid in just to illustrate fit layout
xtype: 'panel',
border: true,
items: [layerPanel]
}, listeners: {
afterrender: function () {
setTimeout(function () {
Ext.getCmp("ctnCombo").focus();
},
500);
}
}
});
win.show();
},
scope: this
}],
columns: this.girdcolums,
listeners: {
'beforeedit': function (o) {
if (LOCK1 == '1') {
return false;
}
}
},
viewConfig: {
stripeRows: false,
getRowClass: function (record, rowIndex) {//CSS class name to add to the row.获得一行的css样式
if (record.get('JIANSHU1') === record.get('JIANSHU2') && record.get('JIANSHU1') !== 0) {
return 'x-grid-row-green';
}
}
}
});
//////////////////////////////////////////////明细<<<< 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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
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,
columnLines: true,
//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) {
if (LOCK1 == '1') {
Ext.MessageBox.alert('提示', '已入账不允许修改!');
return;
}
this.onAddWMSRATEClick(button, event);
},
scope: this
}, {
text: '删除', id: "delrate",
tooltip: '删除仓储费费率区间',
iconCls: "btndeletedetail",
handler: function (button, event) {
if (LOCK1 == '1') {
Ext.MessageBox.alert('提示', '已入账不允许修改!');
return;
}
this.onDelWMSRATEClick(button, event);
},
scope: this
}, '-', {
id: "btnSave",
text: '保存',
tooltip: '保存',
iconCls: "btnsave",
handler: function (button, event) {
if (LOCK1 == '1') {
Ext.MessageBox.alert('提示', '已入账不允许修改!');
return;
}
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];
parentWin = window.parent.opener;
if (this.OPLBNAME == "WMSIN") {
//如果是入库管理处双击打开
this.mainWin = getMainForm(parentWin);
} else {
//如果是海运进口处双击打开
this.mainWin = getMainForm_Opener(parentWin);
}
//this.storeCustCode.loadData(this.mainWin.GetPubStore("OPSEAE_CUST_ISCONTROLLER").data.items);
//this.storeGainCust.loadData(this.mainWin.GetPubStore("INFOCLIENT_ALL").data.items);
//this.storePayCust.loadData(this.mainWin.GetPubStore("INFOCLIENT_ALL").data.items);
}
if (this.OpStatus == "add" && this.OPLBNAME == '海运进口') {
this.panelTop = new Ext.Panel({
region: "north",
height: 197,
items: [this.panelBtn, this.formEdit]
});
}
else if (this.OpStatus == "add" && this.OPLBNAME != 'WMSMAIN') {
this.panelTop = new Ext.Panel({
//layout: "border",
region: "north",
height: 240,
//split: true,
items: [this.panelBtn, this.formSearch, this.formEdit]
});
} else {
this.panelTop = new Ext.Panel({
region: "north",
height: 197,
items: [this.panelBtn, this.formEdit]
});
}
//#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",
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.PageTab = new Ext.tab.Panel({
layout: "border",
region: "center", split: true,
items: [this.page_1, this.page_2]
});
this.page_main= new Ext.Panel({
id: "page_main",
autoScroll: true,
title: "入库信息",
layout: "border",
region: 'center',
items: [this.panelTop, this.PageTab
]
});
this.panelAmendFee = new Shipping.FeeAmendEditGrid({
region: 'center',
title: "更改单",
layout: 'border'
});
if (this.OPLBNAME != '海运进口' && this.OPLBNAME != 'WMSMAIN') {
this.Main = new Ext.tab.Panel({
layout: "border",
region: "center", split: true,
items: [this.page_main, this.panelAmendFee]
});
} else {
this.Main = new Ext.tab.Panel({
layout: "border",
region: "center", split: true,
items: [this.page_main]
});
}
Ext.apply(this, {
items: [this.Main]
});
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);
this.storeWMSIN.on('beforeload', function (store) {
var GID = this.EditRecord.get('GID');
Ext.apply(store.proxy.extraParams, { condition: " ASSOCIATEDNO='" + GID + "'" });
}, this);
this.storeWMSRATE.on('beforeload', function (store) {
var GID = this.EditRecord.get('GID');
Ext.apply(store.proxy.extraParams, { condition: " BSNO='" + GID + "'" });
}, this);
//定义原产国数据集
if (this.OPLBNAME == '海运进口') {
Ext.Ajax.request({
url: '/MvcShipping/MsOpSeai/GetCountryForWMSIn',
params: {
condition: " BSNO='" + _this.parentRecord.get('BSNO') + "'"
},
callback: function(options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
var a = JSON.stringify(data);
var obj = eval('(' + a + ')');
COUNTRYNAMESTR = obj.country;
COUNTRYIDSTR = obj.countryid;
}
}
});
}
}, //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.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 goodsmodel = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSMODEL : '';
var countryid = COUNTRYIDSTR;
if (countryid=='')
countryid = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.COUNTRYID : '';
var goodskgs = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSKGS : 0;
var pinming = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSNAMEDISPLAY : '';
var pinmingid = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.GOODSNAMEID : '';
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 countryid = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.COUNTRYID : '';
//var country = store.data.items.length > 0 ? store.data.items[store.data.items.length - 1].data.COUNTRY : '';
var country = COUNTRYNAMESTR;
var record = null;
var areaname = data.AREANAME;
var BSNO = "";
var CLIENTNAME = "";
var STORAGENAME = "";
var GOODSNAME = "";
var GOODSMODEL = "";
var GOODSSTANDARD = "";
var CHARGEUNIT = "";
var DODATE = "";
if (this.OpStatus == "add") {
BSNO = "";
CLIENTNAME = data.CUSTOMERNAME;
STORAGENAME = "";
GOODSNAME = data.GOODSNAME;
//GOODSMODEL = "";
GOODSMODEL = data.GOODSMODEL;
GOODSSTANDARD = "";
CHARGEUNIT = data.CHARGEUNIT;
DODATE = data.WMSDATE;
} 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');
DODATE = data.WMSDATE;
}
if (GOODSMODEL == '') GOODSMODEL=goodsmodel;
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: DODATE,
STORAGECODE: "",
STORAGENAME: STORAGENAME,
AREACODE: "",
AREANAME: areaname,
GOODSCODE: "",
GOODSNAME: GOODSNAME,
GOODSNAMEID: pinmingid,
GOODSNAMEDISPLAY: pinming,
GOODSTYPE: "",
GOODSMODEL: GOODSMODEL,
GOODSSTANDARD: guigejianshu,
GOODSPACK: zongjianshu,
GOODSPACKSTOCK: "0",
GOODSKGS: goodskgs,
CHARGEUNIT: CHARGEUNIT,
GOODSRKSL: "0",
GOODSSTOCK: "0",
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",
COUNTRY: country,
COUNTRYID: countryid
});
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 == 'edit' && this.EditRecord.get('ISLOCK') == "True") {
alert("不能删除已入账的入库记录。");
return;
}
if (this.OpStatus == 'edit' && 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;
},
//getLinenum2: function (FEETYPE, GID) {
// var _L = 0;
// var _store = this.storeWMSRATE.find('FEETYPE', FEETYPE);
// if (_store == -1) return 1;
// if (_store.getCount() == 0) return 1;
// for (var i = 0; i < _store.getCount(); i++) {
// _store.getAt(i).set('FEEGRADE', i + 1);
// if (GID == _store.getAt(i).get('GID'))
// _L = i + 1;
// }
// if (_L == 0) return _store.getCount()+1;
// 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) {
var data = this.formEdit.getForm().getValues();
if (!BLNO && data.BLNO) BLNO = data.BLNO;
if (COMPANYID == "" || DEPTGID == "") {
alert("登录信息不全,请退出重新登录");
returen;
}
//选择箱型带出箱号列表
if (e.field == 'CTNALL' ) {
var ctnall = Ext.getCmp('CTNALL').rawValue;
this.storeCNTRNO.load({ params: { mblno: BLNO, ctnall: ctnall} });
}
//选择品名带出规格/件数列表
if (e.field == 'GOODSNAMEID') {
var display = Ext.getCmp('GOODSNAME').rawValue;
var coodgoodsid = e.record.data.GOODSNAMEID;
e.record.set('GOODSNAMEDISPLAY', display);
var temp = "";
if (display == e.value) {
temp = display;
e.record.set('GOODSNAMEDISPLAY', temp);
e.record.set('GOODSNAME', temp);
Ext.getCmp('GOODSNAME').setValue(temp);
} else {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/WMSNew/GetGoodsInfoWithName',
params: {
goodsname: coodgoodsid
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
e.record.set('GOODSNAMEDISPLAY', jsonresult.CodeAndName);
e.record.set('GOODSNAMEID', jsonresult.data);
Ext.getCmp('GOODSNAME').setValue(coodgoodsid);
}
},
scope: this
}); //request over
}
//规格/件数列表
//this.storeGoodsDetailsList.load({ params: { codegoodsid: coodgoodsid }});
}
//选择车队
if (e.field == 'CHEDUIID') {
var cdName = this.comboxCheDui.rawValue;
var cdValue = this.comboxCheDui.value;
e.record.set('CHEDUI', cdName);
this.storeWMSIN.each(function (record) {
if (isNullorEmpty(record.get('CHEDUI'))){
record.set('CHEDUI', cdName);
record.set('CHEDUIID', cdValue);
}
});
}
//选择装卸工,带出装卸费
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'
|| e.field == 'LinShiZhuangXieFeiDanJiaJian' || e.field == 'LinShiZhuangXieFeiDanJiaDun') {
var feeType = e.record.data.ZhuangXieFeeType;
var ton = e.record.data.SHIJIZHONGLIANG;
var jian = e.record.data.GOODSPACK;
var feeJian = e.record.data.ZhuangXieFeiDanJiaJian;
if (e.record.data.LinShiZhuangXieFeiDanJiaJian > 0) {
feeJian = e.record.data.LinShiZhuangXieFeiDanJiaJian;
}
var feeTon = e.record.data.ZhuangXieFeiDanJiaTon;
if (e.record.data.LinShiZhuangXieFeiDanJiaJian > 0) {
feeTon = e.record.data.LinShiZhuangXieFeiDanJiaDun;
}
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;
if (!isNullorEmpty(goodsDetailsName))
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);
//GOODSSTOCK
e.record.set('GOODSSTOCK', JIANSHU1 * CHIMA1);
}
//实际尺码=尺码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);
e.record.set('GOODSSTOCK', JIANSHU1 * CHIMA1);
}
//实际重量=重量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);
//选择箱号带出封号,集装箱件数,CBM(尺码)(入库件数)
if (e.field == 'CNTRNO' /*&& e.record.get('CHARGEUNIT') == 'CBM'*/) {
var cntrno = Ext.getCmp('CNTRNO').rawValue;
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/WMSNew/GetSEALNOWithBLNOAndCNTRNO',
params: {
bsno: BLNO,
cntrno: cntrno
},
callback: function (options, success, response) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
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 == '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', '');
}
}
//装卸费模板判断导入
if ( e.field == 'CHIMA1' || e.field == 'CHIMA2'
|| e.field == 'GOODSKGS' || e.field == 'ZHONGLIANG2'
|| e.field == 'JIANSHU1' || e.field == 'JIANSHU2') {
pimingid = e.record.get('GOODSNAMEID');
ARCLIENT = Ext.getCmp("ARCLIENT").getValue();
dodate = Ext.getCmp("WMSDATE").getValue();
storagename = Ext.getCmp("STORAGENAME").getValue();
Ext.Ajax.request({//
waitMsg: '正在处理数据...',
url: '/MvcShipping/WMSNew/GetLoaderFeeModel',
params: {
custname: ARCLIENT,
goodnameid: pimingid,
wmsdate: dodate,
feetype: '1',
storagename:STORAGENAME
},
callback: function (options, success, response) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (jsonresult.data.length > 0) {
var feedata = jsonresult.data[0];
var unit = feedata.FEEUNIT;
var price = feedata.FEEPRICE;
var num = e.record.get('GOODSRKSL');
e.record.set('LOADERFEE', num * price);
//if (unit == "CBM") {
// e.record.set('LOADERFEE', feeTon * price);
//} else {
// e.record.set('LOADERFEE', feeTon * price);
//}
}
} else {
alert(jsonresult.Message);
}
},
scope: this
}); //request over
}
},
WMSINBeforeEdit: function (editor, e, eOpts, a, b, c, d) {
var data = this.formEdit.getForm().getValues();
if (!BLNO && data.BLNO) BLNO = data.BLNO;
//需要自己实现里面的事件
if (COMPANYID == "" || DEPTGID == "") {
alert("登录信息不全,请退出重新登录");
returen;
}
if (e.field === 'GOODSMODEL') {//规格
var codeGoodsId = e.record.data.GOODSNAMEID;
this.storeGoodsDetailsList.load({ params: { codegoodsid: codeGoodsId }});
}
if (e.field === 'CNTRNO') {//箱号
//如果箱号为空 且箱型不为空 载入箱号store
if (!e.record.data.CNTRNO && e.record.data.CTNALL) {
this.storeCNTRNO.load({ params: { mblno: BLNO, ctnall: e.record.data.CTNALL } });
}
}
},
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');
this.blEIP = this.EditRecord.data.EIP;
}
else if (this.OpStatus == "add" && this.OPLBNAME == '海运进口') {
FEECONFIG = '1';
//this.LoadData(this.OpStatus, condition);
this.SetOpseaiData();
}
else {
this.LoadData(this.OpStatus, condition);
}
this.LoadMustBe();
}, //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',
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') {
if (this.OPLBNAME == 'WMSMAIN') {
// this.formSearch.setVisible(false);
data.ASSOCIATEDNO = _this.parentRecord.get('BSNO');
data.CORPID = COMPANYID;
data.DEPTNAME = DEPTGID;
data.CUSTOMERNAME = _this.parentRecord.get('CUSTOMERNAME');
data.BLNO = _this.parentRecord.get('MBLNO');
data.CUSTOMNO = _this.parentRecord.get('CUSTOMNO');
data.CONTRACTNO = _this.parentRecord.get('CONTRACTNO');
data.ARCLIENT = _this.parentRecord.get('CUSTOMERNAME');
data.GOODSNAME = _this.parentRecord.get('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.GOODSKGS = "0";
data.CHARGEUNIT = _this.parentRecord.get('UNITOFWEIGHT');
data.RENTAREA = "0";
data.ACCDATE = Ext.util.Format.date(currdate, 'Y-m');
}
else {
data.ASSOCIATEDNO = "";
data.CORPID = COMPANYID;
data.DEPTNAME = DEPTGID;
data.CUSTOMERNAME = "";
data.BLNO = "";
data.CUSTOMNO = "";
// data.BLNO = _this.parentRecord.get('MBLNO');
//data.CUSTOMNO = _this.parentRecord.get('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.GOODSKGS = "0";
data.CHARGEUNIT = "";
data.RENTAREA = "0";
data.ACCDATE = Ext.util.Format.date(currdate, 'Y-m');
}
this.LoadDefValue();
}
if (data.CUSTOMERNAME != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.CUSTOMERNAME,
CustName: data.CUSTOMERNAME,
CodeAndName: data.CUSTOMERNAME
});
this.storeCustCode.add(recordCustCode);
}
if (data.ARCLIENT != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.ARCLIENT,
CustName: data.ARCLIENT,
CodeAndName: data.ARCLIENT
});
this.storeGainCust.add(recordCustCode);
}
if (data.TRUCKNAME != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.TRUCKNAME,
CustName: data.TRUCKNAME,
CodeAndName: data.TRUCKNAME
});
this.storePayCust.add(recordCustCode);
}
var basicForm = this.formEdit.getForm();
if (this.OpStatus == 'edit') {
var ischange = this.EditRecord.get('ISCHANGE');
if (ischange == '货权转移') {
//data.TRUCKNAME = "";
data.FREESTORAGEPERIODAP = "0";
data.STARTBILLINGDATEAP = timeStamp;
}
}
this.formEdit.getForm().setValues(data);
this.LoadPeriod(this.OpStatus);
if (data.GID == "") { data.GID = "0" }
//2019015,修改出入库号为入库号而不是海运进口的BSNO,BY BALINGXU
//this.panelFee.WMSOUTBSNO = data.ASSOCIATEDNO;
this.panelFee.WMSOUTBSNO = data.GID;
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 } });
if (FEECONFIG == '1') {
this.panelFee.StoreUnit.load({ params: { bsno: data.GID, bstype: "op_Seai" } });
} else {
this.panelFee.StoreUnit.load({ params: { bsno: data.GID, bstype: "WMSIN" } });
}
this.panelFee.storeBodySum.load({ params: { bsno: data.GID } });
this.panelFee.DR_condition = "(((WMSOUTBSNO = '" + data.GID + "') and feetype = 1) or ((BSNO = '" + data.GID + "') and feetype = 1)) ";
this.panelFee.CR_condition = "(((WMSOUTBSNO = '" + data.GID + "') and feetype = 2) or ((BSNO = '" + data.GID + "') and feetype = 2)) ";
if (FEECONFIG == '1') {
this.panelFee.storeDrChFee.load({ params: { billno: data.ASSOCIATEDNO, type: 1, optype: "op_Seai", condition: "((( WMSOUTBSNO='" + data.GID + "') and feetype=1) or (( BSNO='" + data.GID + "') and feetype=1) )"} });
this.panelFee.storeCrChFee.load({ params: { billno: data.ASSOCIATEDNO, type: 2, optype: "op_Seai", condition: "((( WMSOUTBSNO='" + data.GID + "') and feetype=2) or (( BSNO='" + data.GID + "') and feetype=2))"} });
} else {
this.panelFee.storeDrChFee.load({ params: { billno: data.ASSOCIATEDNO, type: 1, optype: "op_other", condition: "((( WMSOUTBSNO='" + data.GID + "') and feetype=1) or (( BSNO='" + data.GID + "') and feetype=1) ) "} });
this.panelFee.storeCrChFee.load({ params: { billno: data.ASSOCIATEDNO, type: 2, optype: "op_other", condition: "((( WMSOUTBSNO='" + data.GID + "') and feetype=2) or (( BSNO='" + data.GID + "') and feetype=2))" } });
}
this.panelFee.storeBodyList_GuDingFeeWeiHu.load();
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');
}
if (this.OpStatus != "add" && (this.OPLBNAME != '海运进口' && this.OPLBNAME != 'WMSMAIN')) {
this.panelAmendFee.EditRecord = this.EditRecord;;
this.bsno = data.GID;
this.panelAmendFee.strBSNO = this.bsno;
this.panelAmendFee.isCancel = false;
if (FEECONFIG == '1') {
this.panelAmendFee.stroplb = 'op_Seai';
} else {
this.panelAmendFee.stroplb = 'op_other';
}
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "WTDW-委托单位", "CUSTTYPE": "委托单位", "CUSTNAME": "CUSTOMERNAME" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "CGS-船公司", "CUSTTYPE": "船公司", "CUSTNAME": "CARRIER" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "DCDL-订舱代理", "CUSTTYPE": "订舱代理", "CUSTNAME": "FORWARDER" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "BGH-报关行", "CUSTTYPE": "报关行", "CUSTNAME": "CUSTOMSER" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "CD-车队", "CUSTTYPE": "车队", "CUSTNAME": "TRUCKER" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "FHR-发货人", "CUSTTYPE": "发货人", "CUSTNAME": "SHIPPERID" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "SHR-收货人", "CUSTTYPE": "收货人", "CUSTNAME": "CONSIGNEEID" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "TZR-通知人", "CUSTTYPE": "通知人", "CUSTNAME": "NOTIFYPARTYID" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "DL-代理", "CUSTTYPE": "代理", "CUSTNAME": "AGENTID" });
this.panelAmendFee.StoreCustType.add({ "SCUSTTYPE": "CZ-场站", "CUSTTYPE": "场站", "CUSTNAME": "YARD" });
if (FEECONFIG == '1') {
this.panelAmendFee.StoreDrOpRange.load({ params: { optype: "modSeaiRecvFeeManagement" } });
this.panelAmendFee.StoreCrOpRange.load({ params: { optype: "modSeaiPayFeeManagement" } });
} else {
this.panelAmendFee.StoreDrOpRange.load({ params: { optype: "modOtherRecvFeeManagement" } });
this.panelAmendFee.StoreCrOpRange.load({ params: { optype: "modOtherPayFeeManagement" } });
}
this.panelAmendFee.storeFeeNameRef.load({ params: { condition: "" } });
this.panelAmendFee.StoreDateCurr.load({ params: { optype: "op_Seai", bsno: data.GID } });
if (FEECONFIG == '1') {
this.panelAmendFee.StoreUnit.load({ params: { bsno: data.GID, bstype: "op_Seai" } });
} else {
this.panelAmendFee.StoreUnit.load({ params: { bsno: data.GID, bstype: "WMSIN" } });
}
_thisamendhead = this.panelAmendFee;
this.panelAmendFee.storeAmendBill.load({
params: { billno: this.bsno, bstype: "" },
callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
_thisamendhead.gridAmendList.getSelectionModel().select(0);
}
}
},
scope: this
});
this.panelAmendFee.storeBodyBLSum.load({
params: { bsno: this.bsno, optype: "" },
callback: function (r, options, success) {
if (success) {
_thisamendhead.setBLTotalHead();
}
}
});
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...',
url: '/Account/ChMonthClose/GetNowPeriod',
params: {
condition: ''
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
_thisamendhead.ACCDATEEDIT.setMinValue(data.PERIOD);
} else {
Ext.MessageBox.alert(Zi.LAN.FuWuQiXiangYingChuCuo, response.responseText);//'请求出现错误,请重试'
}
},
scope: this
});
}
} 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: 1000, 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;
}
},
LoadPeriod: function (opstatus) {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/Account/ChMonthClose/GetNowPeriod',
params: {
condition: ''
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
this.MsPeriod = data;
this.LoadPeriodStatus(opstatus);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
LoadPeriodStatus: function (opstatus) {
var ACCDATE = this.formEdit.getForm().findField('ACCDATE').getValue();
var oDate1 = new Date(ACCDATE + '-01');
var oDate2 = new Date(this.MsPeriod.PERIOD + '-01');
if (oDate1.getTime() >= oDate2.getTime()) {
this.formEdit.getForm().findField('ACCDATE').setMinValue(this.MsPeriod.PERIOD);
this.formEdit.getForm().findField('ACCDATE').setReadOnly(false);
} else {
if (opstatus == 'add' || opstatus == 'copyadd') {
this.formEdit.getForm().findField('ACCDATE').setMinValue(this.MsPeriod.PERIOD);
this.formEdit.getForm().findField('ACCDATE').setValue(this.MsPeriod.PERIOD);
this.formEdit.getForm().findField('ACCDATE').setReadOnly(false);
}
else {
this.formEdit.getForm().findField('ACCDATE').setMinValue('');
this.formEdit.getForm().findField('ACCDATE').setReadOnly(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;
}
this.SetFieldDisabled(false);
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 GOODSKGS = 0;
var WMSINdatas = [];
for (var i = 0; i < this.storeWMSIN.getCount(); i += 1) {
var member = this.storeWMSIN.getAt(i);
if (member.data.GOODSPACK == 0 && member.data.GOODSRKSL == 0) {
Ext.MessageBox.alert("提示", "存在空的入库明细数据,请先检查数据正确与否!");
return;
}
var comboxList = DsStoreQueryBy(this.storeGoodsnameList, 'GID', member.data.GOODSNAMEID);
if (comboxList.getCount() > 0) {
var comboxRaw = comboxList.getAt(0).data;
member.data.GOODSNAME = comboxRaw.GOODNAME.toString();
}
WMSINdatas.push(member);
MARKETVALUE = MARKETVALUE + parseFloat(member.data.MARKETVALUE);
BANKVALUE = BANKVALUE + parseFloat(member.data.BANKVALUE);
GOODSKGS = GOODSKGS + parseFloat(member.data.GOODSKGS);
}
this.formEdit.getForm().findField('MARKETVALUE').setValue(MARKETVALUE);
this.formEdit.getForm().findField('BANKVALUE').setValue(BANKVALUE);
this.formEdit.getForm().findField('GOODSRKSL').setValue(GOODSKGS);
var WMSRATEdatas = [];
var WMSINBody = ConvertWMSRecordsToJson(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;
var GOODSKGS = 0;
var GOODSNAMEID = '';
var GOODSNAME = '';
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'));
GOODSKGS = GOODSKGS + parseFloat(record.get('GOODSKGS'));
if (record.get('GOODSNAMEID') != null && record.get('GOODSNAMEID') != '' )
GOODSNAMEID = record.get('GOODSNAMEID');
if (record.get('GOODSNAME') != null && record.get('GOODSNAME') != '')
GOODSNAME = record.get('GOODSNAME');
});
// 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.GOODSKGS = GOODSKGS;
data.GOODSNAMEID = GOODSNAMEID;
data.GOODSNAME = GOODSNAME;
var _this = this;
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/WMSNew/Save',
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) {
_this.SetFieldDisabled(true);
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.DR_condition = "(((WMSOUTBSNO = '" + data.GID + "') and feetype = 1) or ((BSNO = '" + data.GID + "') and feetype = 1)) ";
this.panelFee.CR_condition = "((WMSOUTBSNO = '" + data.GID + "') and feetype = 2) or ((BSNO = '" + data.GID + "') and feetype = 2) ";
this.panelFee.StoreDrOpRange.load({ params: { optype: "modSeaiRecvFeeManagement"} });
this.panelFee.StoreCrOpRange.load({ params: { optype: "modSeaiPayFeeManagement"} });
this.panelFee.StoreUnit.load({ params: { bsno: data.GID, 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: this.panelFee.strBSNO, type: 1, optype: "op_Seai", condition: "((( WMSOUTBSNO='" + data.GID + "') and feetype=1 ) or (( BSNO='" + data.GID + "') and feetype=1 ))" } });
this.panelFee.storeCrChFee.load({ params: { billno: this.panelFee.strBSNO, type: 2, optype: "op_Seai", condition: "((( WMSOUTBSNO='" + data.GID + "') and feetype=2) or (( BSNO='" + data.GID + "') and feetype=2)) " } });
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.strBSNO = data.ASSOCIATEDNO;
this.panelFee.StoreDateCurr.load({ params: { optype: "op_other", bsno: data.GID} });
//this.panelFee.StoreUnit.load({ params: { bsno: data.GID } });
this.panelFee.StoreUnit.load({ params: { bsno: data.GID, bstype: "WMSIN" } });
this.panelFee.storeBodySum.load({ params: { bsno: data.GID} });
this.panelFee.LoadDrChFee2("(WMSOUTBSNO='" + data.GID + "' and feetype=1) or (BSNO='" + data.GID + "' and feetype=1)");
this.panelFee.LoadCrChFee2("(WMSOUTBSNO='" + data.GID + "' and feetype=2) or (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: 1000, 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) {
//计费等级level收付方向feetype
for (var i = 0; i < this.storeWMSRATE.getCount(); 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"));
}
}
if (FEETYPE == '1') {
return this.formEdit.getForm().findField('STARTBILLINGDATE').getValue();
}
if (FEETYPE == '2') {
return this.formEdit.getForm().findField('STARTBILLINGDATEAP').getValue();
}
}
, 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:_this.blEIP,
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);
},
LoadDefValue: function () {
this.storeDefValue.load({
params: { condition: "BSTYPE='仓储入库'" },
callback: function (r, options, success) {
if (success) {
if (this.storeDefValue.getCount() > 0) {
for (var j = 0; j < this.storeDefValue.getCount() ; j += 1) {
var member = this.storeDefValue.getAt(j);
var fieldname = member.data.FIELDNAME;
var headfield = this.formEdit.getForm().findField(fieldname);
if (headfield != NaN && headfield != null)
headfield.setValue(member.data.DEFVALUE);
};
} else {
}
}
},
scope: this
});
},
LoadMustBe: function () {
this.storeMustBe.load({
params: { condition: "BSTYPE='仓储入库'" },
callback: function (r, options, success) {
if (success) {
if (this.storeMustBe.getCount() > 0) {
for (var j = 0; j < this.storeMustBe.getCount() ; j += 1) {
var member = this.storeMustBe.getAt(j);
var fieldname = member.data.FIELDNAME;
var headfield = this.formEdit.getForm().findField(member.data.FIELDNAME);
if (headfield != NaN && headfield != null) {
if (member.data.ISMUST == "1")
headfield.allowBlank = false;
if (member.data.ISCOLOR == "1")
headfield.setFieldStyle({ background: '#ffc' });
if (member.data.ISREADONLY == "1")
headfield.setReadOnly(true);
}
};
} else {
}
}
},
scope: 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 + " 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 + "'";
sql1 = sql1 + " order by wi.DODATE ";
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 () {
//查询数据
_this = this;
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 = "";
var sOPLBNAME = "";
var sCompanyID = "";
BLNO = data.BLNO;
var CUSTOMNO = data.CUSTOMNO;
var OPLBNAME = data.OPLBNAME;
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
//参数BLNO为提单号或委托单号
url: '/MvcShipping/WMSNew/GetDataWithBLNOAndWMSNO',
params: {
BLNO: BLNO,
CUSTOMNO: CUSTOMNO,
OPLBNAME: OPLBNAME
},
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;
sOPLBNAME = result.OPLBNAME;
sCompanyID = result.COMPANYID;
var timeStamp = Ext.util.Format.date(result.timeStamp, 'Y-m-d');
TIMESTAMP = timeStamp;
CNTRNO = sCNTRNO;
CTNALL = sCTNALL;
SEALNO = sSEALNO;
PKGS = result.PKGS;
KGS = result.KGS;
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 = sCUSTOMERNAME;
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 = "0";
data.TiDanJianShu = PKGS;
data.COMPANY = sCompanyID;
data.TiDanZhongLiang = KGS;
}
if (data.CUSTOMERNAME != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.CUSTOMERNAME,
CustName: data.CUSTOMERNAME,
CodeAndName: data.CUSTOMERNAME
});
this.storeCustCode.add(recordCustCode);
}
if (data.ARCLIENT != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.ARCLIENT,
CustName: data.ARCLIENT,
CodeAndName: data.ARCLIENT
});
this.storeGainCust.add(recordCustCode);
}
if (data.TRUCKNAME != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.TRUCKNAME,
CustName: data.TRUCKNAME,
CodeAndName: data.TRUCKNAME
});
this.storePayCust.add(recordCustCode);
}
var basicForm = this.formEdit.getForm();
this.storeCodeCtn.load({ params: { mblno: BLNO} });
this.formEdit.getForm().setValues(data);
if (sOPLBNAME == "进口贸易") {
this.formEdit.getForm().findField('CHARGEUNIT').setValue('吨');
Ext.define('Cargomb', {
extend: 'Ext.data.Model',
idProperty: 'id',
fields: [
{ name: 'id', type: 'string' },
{ name: 'GID', type: 'string' },
{ name: 'ContractNo', type: 'string' },
{ name: 'cargoinfo_id', type: 'string' },
{ name: 'cargociq_id', type: 'string' },
{ name: 'AGENCRATE', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'Ename', type: 'string' },
{ name: 'Unit', type: 'string' },
{ name: 'UnitRate', type: 'string' },
{ name: 'U_PRICE', type: 'number' },
{ name: 'U_weight', type: 'number' },
{ name: 'weight', type: 'number' },
{ name: 'm_weight', type: 'number' },
{ name: 't_weight', type: 'number' },
{ name: 'price', type: 'number' },
{ name: 'price_agio', type: 'number' },
{ name: 'price_limit', type: 'number' },
{ name: 'Amount', type: 'number' },//合同价格
{ name: 'tax_Amount', type: 'number' }, //完税价格
{ name: 'tax_Amount_RMB', type: 'number' }, //完税价格
{ name: 'pay_Amount', type: 'number' },//购货价格
{ name: 'BoxCount', type: 'number' },
{ name: 'BoxWeight', type: 'number' },
{ name: 'Exporter', type: 'string' },
{ name: 'FactoryNo', type: 'string' },
{ name: 'PRODUCTIONDATE', type: 'string' },
{ name: 'currid', type: 'string' },
{ name: 'prepayments', type: 'number' },
{ name: 'balance', type: 'number' },
{ name: 'pay_prepayments', type: 'number' },
{ name: 'pay_balance', type: 'number' },
{ name: 'Paypart', type: 'string' },
{ name: 'cicode', type: 'string' },
{ name: 'ciname', type: 'string' },
{ name: 'cicodeandname', type: 'string' },
{ name: 'ciqcode', type: 'string' },
{ name: 'ciqname', type: 'string' },
{ name: 'ciqcodeandname', type: 'string' },
{ name: 'codename', type: 'string' },
{ name: 'defaultrate', type: 'string' },
{ name: 'UnitRef', type: 'string' },
{ name: 'paypartRef', type: 'string' },
{ name: 'baolv', type: 'string' },
{ name: 'tariff', type: 'string' },
{ name: 'tax', type: 'number' },
{ name: 'tax_zz', type: 'number' },
//20190929 增加对从量税率的存储 分/kg
{ name: 'tax_cl', type: 'number' },
{ name: 'Declarenumber', type: 'string' },
{ name: 'Exchangerate', type: 'number' },
{ name: 'Exchangerate_Customs', type: 'number' },
//20140109 增加对计算值的保存,用于向应收应付列表和费用通知单提供数据
{ name: 'tax_1', type: 'string' },
{ name: 'tax_zz_1', type: 'string' },
{ name: 'tax_2', type: 'string' },
{ name: 'tax_zz_2', type: 'string' }
//20140307 增加 预付比例,用于许可证核销的总金额
, { name: 'RecProportion', type: 'string' }
, { name: 'PreProportion', type: 'string' }
, { name: 'AMOUNT_WRITEOFFS', type: 'string' }
, { name: 'NAME_REF', type: 'string' }
, { name: 'SEQUENCE', type: 'number' }
, { name: 'Ename', type: 'string' }
, { name: 'SBYS', type: 'string' }
, { name: 'BZTCHNO', type: 'string' }
, { name: 'CargoType', type: 'string' }
, { name: 'REMARK', type: 'string' }
, { name: 'SPECIFICATIONS', type: 'string' }
, { name: 'SHIJIGUANSHUI', type: 'number' }
, { name: 'SHIJIZENGZHISHUI', type: 'number' }
, { name: 'XIANJIAJINE', type: 'number' }
, { name: 'BAOZHENGJIN', type: 'number' }
, { name: 'ZHIBAOJIN', type: 'number' }
, { name: 'ZONGJINE', type: 'number' }
]
});
this.storeCargo = Ext.create('Ext.data.Store', {
pageSize: 1000,
model: 'Cargomb',
remoteSort: false,
pruneModifiedRecords: true,
proxy: {
type: 'ajax',
url: '/Import/XXH/GetCargoList',
reader: {
id: 'id,ContractNo',
root: 'data',
totalProperty: 'totalCount'
}
}
});
var CUSTOMERNAME = this.formEdit.getForm().findField('CUSTOMERNAME').getValue();
this.storeCargo.load({
params: { condition: sBSNO },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
for (i = 0; i < _this.storeCargo.getCount() ; i += 1) {
var memberyf = _this.storeCargo.getAt(i);
var store = null;
store = _this.storeWMSIN;
var record = null;
var areaname ="";
var BSNO = "";
var CLIENTNAME = "";
var STORAGENAME = "";
var GOODSNAME = "";
var GOODSMODEL = "";
var GOODSSTANDARD = "";
var CHARGEUNIT = "";
BSNO = "";
CLIENTNAME = CUSTOMERNAME;
var newid = NewGuid();
record = Ext.create('WMSINmb', {
//GOODSNAMEDISPLAY: pinming,
GID: newid,
ASSOCIATEDNO: "",
BLNO: "",
CONTRACTNO: "",
CTNALL: CTNALL,
CNTRNO: sCNTRNO,
SEALNO: SEALNO,
BSNO: BSNO,
CLIENTCODE: "",
CLIENTNAME: CLIENTNAME,
DODATE: "",
STORAGECODE: "",
STORAGENAME: STORAGENAME,
AREACODE: "",
AREANAME:"",
GOODSCODE: "",
GOODSNAME: memberyf.data.name,
GOODSNAMEID: memberyf.data.name,
GOODSNAMEDISPLAY: memberyf.data.name,
GOODSTYPE: "",
GOODSMODEL: GOODSMODEL,
GOODSSTANDARD: "",
GOODSPACK: memberyf.data.BoxCount,
GOODSPACKSTOCK: memberyf.data.BoxCount,
GOODSKGS: memberyf.data.weight/1000,
CHARGEUNIT:'吨',
GOODSRKSL: memberyf.data.weight/1000,
GOODSSTOCK: memberyf.data.weight / 1000,
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: "",
GOODSGRADE: "",
STACKLOCATION: "",
GOODSPACKACTUAL: "0",
GOODSRKSLACTUAL: "0",
ISCHANGE: "0",
MARKETVALUE: "0",
BANKVALUE: "0",
JIANSHU2: "0",
JIANSHU1: memberyf.data.BoxCount,
LINENUM: _this.getLinenum(),
CHIMA1: "0",
CHIMA2: "0",
ZHONGLIANG2: "0",
SHIJIZHONGLIANG: "0",
SHIJICHIMA: "0",
PRODUCTIONDATE: memberyf.data.PRODUCTIONDATE,
FactoryNo: memberyf.data.FactoryNo
});
store.add(record);
}
}
}
}
});
}
if (data.GID == "") { data.GID = "0" }
} else {
Ext.MessageBox.alert('提示', result.Message);
return;
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
SetOpseaiData: function () {
var ret1 = window.parent.opener.OprationSwap();
var blno = ret1[3].data.MBLNO;
var customno = '';
var sBLNO = ""; //提单号
var sCUSTOMNO = ""; //报关单号、备案清单号
var sCONTRACTNO = ""; //合同号
var sCUSTNO = ""; //委托编号
var sCUSTOMERNAME = ""; //客户名称
var sBSNO = ""; //海运进口业务gid
var sCTNALL = ""; //箱型
var sCNTRNO = ""; //箱号
var sSEALNO = ""; //封号
var sBAOGUANJIANSHU = 0; //报关件数
var sISBONDED = "";
var sOPLBNAME = "";
var sCompanyID = "";
var sStorageName = "";
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;
sOPLBNAME = result.OPLBNAME;
sCompanyID = result.COMPANYID;
sStorageName = result.STORAGENAME;
var timeStamp = Ext.util.Format.date(result.timeStamp, 'Y-m-d');
TIMESTAMP = timeStamp;
CNTRNO = sCNTRNO;
CTNALL = sCTNALL;
SEALNO = sSEALNO;
PKGS = result.PKGS;
KGS = result.KGS;
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 = sCUSTOMERNAME;
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 = "0";
data.TiDanJianShu = PKGS;
data.COMPANY = sCompanyID;
data.TiDanZhongLiang = KGS;
data.STORAGENAME = sStorageName;
data.EIP = false;
data.RENTAREA = "0";
}
if (data.CUSTOMERNAME != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.CUSTOMERNAME,
CustName: data.CUSTOMERNAME,
CodeAndName: data.CUSTOMERNAME
});
this.storeCustCode.add(recordCustCode);
}
if (data.ARCLIENT != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.ARCLIENT,
CustName: data.ARCLIENT,
CodeAndName: data.ARCLIENT
});
this.storeGainCust.add(recordCustCode);
}
if (data.TRUCKNAME != '') {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: data.TRUCKNAME,
CustName: data.TRUCKNAME,
CodeAndName: data.TRUCKNAME
});
this.storePayCust.add(recordCustCode);
}
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
});
},
onImportCtnClick: function () {
var basicForm = this.formEdit.getForm();
var wmsgid = basicForm.findField('GID').value;
var wmsasso = basicForm.findField('ASSOCIATEDNO').value;
if ((wmsgid == wmsasso) || (wmsasso == '') || (FEECONFIG != '1')) {
Ext.MessageBox.alert('提示', '业务并没有关联海运进口或者没有在查询框输入提单号');
return;
}
var CUSTOMERNAME = this.formEdit.getForm().findField('CUSTOMERNAME').getValue();
_this = this;
this.storeCtnList = Ext.create('Ext.data.Store', {
pageSize: 1000,
params: { condition: " BSNO='" + wmsasso + "'" },
fields: [
{ name: 'CTNALL', type: 'string' },
{ name: 'CTNNUM', type: 'string' },
{ name: 'CNTRNO', type: 'string' },
{ name: 'SEALNO', type: 'string' },
{ name: 'PKGS', type: 'string' },
{ name: 'KGS', type: 'string' },
{ name: 'CBM', type: 'string' },
{ name: 'UNITOFWEIGHT', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'GOODSNAMEID', type: 'string' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeai/GetCtnDetailList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeCtnList.load({
params: { condition: " B.BSNO='" + wmsasso + "' and (c.ISWMS = '0' or c.ISWMS is null) " },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
for (i = 0; i < _this.storeCtnList.getCount(); i += 1) {
var memberyf = _this.storeCtnList.getAt(i);
_this.formEdit.getForm().findField('CHARGEUNIT').setValue(memberyf.data.UNITOFWEIGHT);
var store = null;
store = _this.storeWMSIN;
var record = null;
var areaname = "";
var BSNO = "";
var CLIENTNAME = "";
var STORAGENAME = "";
var GOODSNAME = "";
var GOODSMODEL = "";
var GOODSSTANDARD = "";
var CHARGEUNIT = "";
BSNO = "";
CLIENTNAME = CUSTOMERNAME;
var newid = NewGuid();
record = Ext.create('WMSINmb',
{
//GOODSNAMEDISPLAY: pinming,
GID: newid,
ASSOCIATEDNO: "",
BLNO: "",
CONTRACTNO: "",
CTNALL: memberyf.data.CTNALL,
CNTRNO: memberyf.data.CNTRNO,
SEALNO: "",
BSNO: BSNO,
CLIENTCODE: "",
CLIENTNAME: CLIENTNAME,
DODATE: "",
STORAGECODE: "",
STORAGENAME: STORAGENAME,
AREACODE: "",
AREANAME: "",
GOODSCODE: "",
GOODSNAME: memberyf.data.GOODSNAME,
GOODSNAMEID: memberyf.data.GOODSNAMEID,
GOODSNAMEDISPLAY: memberyf.data.GOODSNAME,
GOODSTYPE: "",
GOODSMODEL: "",
GOODSSTANDARD: "",
GOODSPACK: memberyf.data.PKGS,
GOODSPACKSTOCK: memberyf.data.PKGS,
GOODSKGS: memberyf.data.KGS,
CHARGEUNIT: memberyf.data.UNITOFWEIGHT,
GOODSRKSL: memberyf.data.KGS,
GOODSSTOCK: memberyf.data.KGS,
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: "",
GOODSGRADE: "",
STACKLOCATION: "",
GOODSPACKACTUAL: memberyf.data.PKGS,
GOODSRKSLACTUAL: "0",
ISCHANGE: "0",
MARKETVALUE: "0",
BANKVALUE: "0",
JIANSHU2: "0",
JIANSHU1: memberyf.data.PKGS,
LINENUM: _this.getLinenum(),
CHIMA1: memberyf.data.CBM,
CHIMA2: "0",
ZHONGLIANG2: "0",
SHIJIZHONGLIANG: memberyf.data.KGS,
SHIJICHIMA: memberyf.data.KGS,
PRODUCTIONDATE: "",
FactoryNo: ""
});
store.add(record);
}
} else {
Ext.MessageBox.alert('提示', '没有相关信息');
}
}
}
});
},
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();
var FEEGRADE = this.getLinenum2("1", newid);
var startdate = this.getStartDate(FEEGRADE, '1');
if (FEEGRADE == "1") {
days = 1;
} else {
days = 2;
}
var enddate = getAfterDATE(startdate, days);
record = Ext.create('WMSRATEmb', {
GID: newid,
CUSTOMERNAME: "",
FEETYPE: "0",
FEETYPEREF: "",
FEEGRADE: FEEGRADE,
FEESCALE: 1,
FEEPRICE: 0,
FEEUNIT: "",
CREATEUSER: USERID,
CREATETIME: TIMESTAMP,
MODIFIEDUSER: SHOWNAME,
MODIFIEDTIME: TIMESTAMP,
REMARK: "",
BSNO: "",
ADDPRICE: "0",
//ENDBILLINGDATE: TIMESTAMP,
ENDBILLINGDATE: enddate,
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;
}
var data = this.formEdit.getForm().getValues();
for (var i = 0; i < this.storeWMSRATE.getCount(); i += 1) {
var member = this.storeWMSRATE.getAt(i);
member.data.CUSTOMERNAME = data.CUSTOMERNAME;
WMSRATEdatas.push(member);
}
var WMSRATEBody = ConvertRecordsToJson(WMSRATEdatas);
var WMSRATEBodyDel = ConvertRecordsToJsonAll(this.WMSRATEBodyDel);
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);
},
setFeeModel: function (FeeType) {
if (this.storeWMSRATE.getCount() === 0)
return;
for (let i = 0; i < this.storeWMSRATE.getCount(); i++) {
var record = this.storeWMSRATE.getAt(i);
if ((record.get('FEETYPE')) != FeeType)
continue;
var startdate = this.getStartDate(parseInt(record.get('FEEGRADE')), FeeType);
var days = 0;
if (parseInt(record.get('FEEGRADE')) == "1") {
days = parseInt(record.get('FEESCALE'));
} else {
days = parseInt(record.get('FEESCALE')) + 1;
}
var enddate = getAfterDATE(startdate, days);
if (parseInt(record.get('FEESCALE')) === 0) {
enddate = getAfterDATE(enddate, 2);
}
record.set('ENDBILLINGDATE', enddate);
}
}
, 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);
if (parseInt(e.value) === 0) {
enddate = getAfterDATE(enddate, 2);
}
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', '');
}
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);
if (parseInt(e.value) === 0) {
enddate = getAfterDATE(enddate, 2);
}
e.record.set('ENDBILLINGDATE', enddate);
}
},
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;
},
ImportFeeModel: function () {
Ext.MessageBox.confirm('提示', '点击确定系统将自动导入入库明细【第一行】的【品名】相关仓储费率模板', function (btn) {
if (btn == 'yes') {
var _this = this;
var ARCLIENT = "'" + this.EditRecord.data.ARCLIENT + "'"; //应收客户
var STORAGENAME = "'" + this.EditRecord.data.STORAGENAME + "'"; //仓库
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 (STORAGENAME == 'undefine' || STORAGENAME == '') {
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;
}
pinmingid = "'" + pinmingid + "'";
dodate = Ext.getCmp("WMSDATE").getValue();
Ext.Ajax.request({//
waitMsg: '正在处理数据...',
url: '/MvcShipping/WMSNew/GetImportFeeModel',
params: {
custname: ARCLIENT,
goodnameid: pinmingid,
wmsdate: dodate,
storagename:STORAGENAME
},
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
, MakeWMSIN: function (CNTRNO) {
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: 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: "0",
GOODSSTOCK: "0",
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'));
}
});
},
//#endregion
//#region 设置disabled
SetFieldDisabled: function(value) {
Ext.getCmp('WMSNO').setDisabled(value);
Ext.getCmp('ZGOODSKGS').setDisabled(value);
Ext.getCmp('PKGS').setDisabled(value);
}
//#endregion
//#region 计算装卸队对应的
//#endregion
});