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/MsSeaeOrder/MsSeaeWebOrderBillEdit.js

2924 lines
111 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
Shipping.MsSeaeWebOrderBillEdit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsSeaeWebOrderBillEdit.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsSeaeWebOrderBillEdit, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
EditRecord: null,
Editdata: null,
isAudit: null,
accdate: null,
seaeop: "",
seaecustservice: "",
reason: "",
initUIComponents: function () {
this.serialNo = 0;
//this.bodyDel = [];
this.itemindex = 1;
//#region 信息加载
//权限范围
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modSeaeOrderList"} });
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOpCode.load();
//客服
this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客服',
store: this.storeOpCode,
forceSelection: true,
name: 'CUSTSERVICE',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
//揽货人
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeOpCode,
forceSelection: true,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操 作',
store: this.storeOpCode,
forceSelection: true,
name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
//单证
this.comboxDOC = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '单 证',
store: this.storeOpCode,
forceSelection: true,
name: 'DOC',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
this.storePKGTYPE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storePKGTYPE.load({ params: { enumTypeId: 97011} });
this.comboxPKGTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装箱类型',
store: this.storePKGTYPE,
forceSelection: true,
name: 'KINDPKGS', //PACKINGTYPE
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
this.StoreCargoid = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoreCargoid.add({ "ID": "S", "NAME": "S普通货" });
this.StoreCargoid.add({ "ID": "R", "NAME": "R冻柜" });
this.StoreCargoid.add({ "ID": "D", "NAME": "D危险品" });
this.StoreCargoid.add({ "ID": "O", "NAME": "O超限箱" });
this.comboxCargoid = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCargoid,
fieldLabel: '货物标示',
forceSelection: true,
name: 'CARGOID',
valueField: 'ID',
displayField: 'NAME',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (combo.value == 'R') {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(true);
} else if (combo.value == 'D') {
this.panelBodyDr.setVisible(true);
this.panelBodyRf.setVisible(false);
} else {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(false);
}
}
},
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASCARGOID', 'CARGOID', '货物标示');
});
}
}
});
//键值维护表_装运方式
//品名
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' }
});
this.storeCodeGoodsList.load();
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '品名',
store: this.storeCodeGoodsList,
forceSelection: true,
name: 'GOODSNAME',
valueField: 'GOODNAME',
displayField: 'CodeAndName'
});
this.StoreStlName = Ext.create('Ext.data.Store', {
fields: ['STLNAME']
});
this.StoreStlName.add({ "STLNAME": "票结" });
this.StoreStlName.add({ "STLNAME": "半月结" });
this.StoreStlName.add({ "STLNAME": "月结" });
this.StoreStlName.add({ "STLNAME": "周结" });
this.comboxStlName = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreStlName,
fieldLabel: '结算方式',
forceSelection: true,
name: 'STLNAME',
valueField: 'STLNAME',
displayField: 'STLNAME'
});
//件数包装
this.storeCodePackage = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodePackageModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' }
});
this.storeCodePackage.load();
this.comboxKINDPKGS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '包 装',
store: this.storeCodePackage,
forceSelection: true,
name: 'KINDPKGS',
valueField: 'PKGS',
displayField: 'PKGS',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var str_num = this.formEdit.getForm().findField('PKGS').getValue();
this.formEdit.getForm().findField('TOTALNO').setValue('SAY:' + ToEn(str_num).toUpperCase() + ' ' + combo.value + ' ONLY.');
}
},
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASKINDPKGS', 'KINDPKGS', '包装');
});
}
}
});
//件数包装_集装箱列表中的下拉框加载
this.comboxKINDPKGS_CTN = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '件数包装',
store: this.storeCodePackage,
forceSelection: true,
name: 'KINDPKGS',
valueField: 'PKGS',
displayField: 'PKGS'
});
//箱型_集装箱列表中的下拉框加载
this.storeCodeCtn = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeCtnModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' }
});
this.storeCodeCtn.load();
this.comboxCTNALL = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '箱型',
store: this.storeCodeCtn,
forceSelection: true,
name: 'CTNALL',
valueField: 'CTN',
displayField: 'CTN'
});
//付费方式
this.storeFrt = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_FRT',
proxy: { url: '/CommMng/BasicDataRef/GetCodeFrtList' }
});
this.storeFrt.load({ params: { condition: ""} });
this.comboxBLFRT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '付费方式',
store: this.storeFrt,
forceSelection: true,
name: 'BLFRT',
valueField: 'FRT',
displayField: 'FRT',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (combo.value == "FREIGHT PREPAID") {
var portload = this.formEdit.getForm().findField('PORTLOAD').getValue();
this.formEdit.getForm().findField('PREPARDAT').setValue(portload);
this.formEdit.getForm().findField('PAYABLEAT').setValue('');
} else if (combo.value == "FREIGHT COLLECT") {
var PORTDISCHARGE = this.formEdit.getForm().findField('PORTDISCHARGE').getValue();
this.formEdit.getForm().findField('PREPARDAT').setValue('');
this.formEdit.getForm().findField('PAYABLEAT').setValue(PORTDISCHARGE);
}
}
},
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASBLFRT', 'BLFRT', '付费方式');
});
}
}
});
//#endregion
//#region 编辑formHead 基本信息
this.formHead = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
collapsed: false,
collapsible: true,
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: 'ASSHIPPER',
name: 'ASSHIPPER', hidden: true
}, {
fieldLabel: 'ASCONSIGNEE',
name: 'ASCONSIGNEE', hidden: true
}, {
fieldLabel: 'ASNOTIFYPARTY',
name: 'ASNOTIFYPARTY', hidden: true
}, {
fieldLabel: 'ASVESSEL',
name: 'ASVESSEL', hidden: true
}, {
fieldLabel: 'ASVOYNO',
name: 'ASVOYNO', hidden: true
}, {
fieldLabel: 'ASPORTLOAD',
name: 'ASPORTLOAD', hidden: true
}, {
fieldLabel: 'ASPORTDISCHARGE',
name: 'ASPORTDISCHARGE', hidden: true
}, {
fieldLabel: 'ASPLACEDELIVERY',
name: 'ASPLACEDELIVERY', hidden: true
}, {
fieldLabel: 'ASDESTINATION',
name: 'ASDESTINATION', hidden: true
}, {
fieldLabel: 'ASPKGS',
name: 'ASPKGS', hidden: true
}, {
fieldLabel: 'ASKINDPKGS',
name: 'ASKINDPKGS', hidden: true
}, {
fieldLabel: 'ASKGS',
name: 'ASKGS', hidden: true
}, {
fieldLabel: 'ASCBM',
name: 'ASCBM', hidden: true
}, {
fieldLabel: 'ASTOTALNO',
name: 'ASTOTALNO', hidden: true
}, {
fieldLabel: 'ASMARKS',
name: 'ASMARKS', hidden: true
}, {
fieldLabel: 'ASDESCRIPTION',
name: 'ASDESCRIPTION', hidden: true
}, {
fieldLabel: 'ASSERVICE',
name: 'ASSERVICE', hidden: true
}, {
fieldLabel: 'ASCARGOID',
name: 'ASCARGOID', hidden: true
}, {
fieldLabel: 'ASHSCODE',
name: 'ASHSCODE', hidden: true
}, {
fieldLabel: 'ASDCLASS',
name: 'ASDCLASS', hidden: true
}, {
fieldLabel: 'ASDUNNO',
name: 'ASDUNNO', hidden: true
}, {
fieldLabel: 'ASDPAGE',
name: 'ASDPAGE', hidden: true
}, {
fieldLabel: 'ASDLABEL',
name: 'ASDLABEL', hidden: true
}, {
fieldLabel: 'ASLINKMAN',
name: 'ASLINKMAN', hidden: true
}, {
fieldLabel: 'ASREEFERF',
name: 'ASREEFERF', hidden: true
}, {
fieldLabel: 'ASTEMPID',
name: 'ASTEMPID', hidden: true
}, {
fieldLabel: 'ASTEMPSET',
name: 'ASTEMPSET', hidden: true
}, {
fieldLabel: 'ASTEMPMAX',
name: 'ASTEMPMAX', hidden: true
}, {
fieldLabel: 'ASTEMPMIN',
name: 'ASTEMPMIN', hidden: true
}, {
fieldLabel: 'ASBLFRT',
name: 'ASBLFRT', hidden: true
}, {
fieldLabel: 'ASPREPARDAT',
name: 'ASPREPARDAT', hidden: true
}, {
fieldLabel: 'ASPAYABLEAT',
name: 'ASPAYABLEAT', hidden: true
}, {
fieldLabel: 'ASISSUETYPE',
name: 'ASISSUETYPE', hidden: true
}, {
fieldLabel: 'ASISSUEDATE',
name: 'ASISSUEDATE', hidden: true
}, {
fieldLabel: 'ASISSUEPLACE',
name: 'ASISSUEPLACE', hidden: true
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '业务编号',
name: 'BSNO', hidden: true
}, {
fieldLabel: 'ORSTATUS',
name: 'ORSTATUS', hidden: true
}, {
fieldLabel: '委托编号',
readOnly: true,
name: 'CUSTNO'
}, {
fieldLabel: '订舱单号',
readOnly: true,
name: 'ORDNO'
}, {
fieldLabel: '订舱状态',
readOnly: true,
name: 'ORSTATUSREF'
}, {
fieldLabel: '委托单位',
readOnly: true,
name: 'CUSTOMERNAME'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '主提单号',
name: 'MBLNO'
}, this.comboxSALE, this.comboxOP, this.comboxCUSTSERVICE]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '订舱人',
name: 'INPUTBY'
}, {
fieldLabel: '电话',
name: 'OPERATORTEL'
}, {
fieldLabel: '邮箱',
name: 'OPERATOREMAIL'
}, { xtype: 'hiddenfield'}]
}
]//end items(fieldset 1)
}); //end this.formEdit
//#endregion
//#region 集装箱-数据集
this.storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsSeaeOrder/GetWebBodyList',
reader: {
id: 'BSNO,CTN_ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//明细表表格
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeBodyList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'CTN_ID',
header: '编号',
hidden: true,
width: 0,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 0,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
dataIndex: 'CTNALL',
header: '箱型',
width: 70,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
dataIndex: 'CTNNUM',
header: '箱量',
width: 50,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
dataIndex: 'CNTRNO',
header: '箱号',
width: 100,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
dataIndex: 'SEALNO',
header: '封号',
width: 80,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 60,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
dataIndex: 'KINDPKGS',
header: '包装',
width: 70,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
dataIndex: 'KGS',
header: '重量',
width: 60,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, {
dataIndex: 'CBM',
header: '尺码',
width: 60,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}, /*{
dataIndex: 'TAREWEIGHT',
header: '箱皮重',
width: 60,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
},*/ {
dataIndex: 'REMARK',
header: '备注',
width: 150,
renderer: function (value) {
return "<font color='#FF0000'>" + value + "</font>";
}
}]
});
//#endregion
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
var bsno = record.data.BSNO;
_this.onDiffCtnClick(bsno);
}, this);
this.panelBodyCtn = new Ext.Panel({
title: '集装箱信息',
layout: "border",
height: 150,
//margin: '5 10',
frame: true,
items: [this.gridList]
});
/*this.panelORREASON = new Ext.Panel({
title: "<a href='#'><font color='#FF0000'>驳回原因</font></a>",
layout: "border",
height: 100,
//margin: '5 10',
frame: true,
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: '',
labelSeparator: '',
labelWidth: 0,
height: 100,
name: 'ORREASON',
anchor: '100%'
}]
});*/
this.panelBodyDr = new Ext.Panel({
title: '危险品信息',
layout: "border",
hidden: true,
height: 60,
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
defaults: {
anchor: '96%'
},
items: [{
fieldLabel: '危险品等级',
flex: 1,
labelWidth: 70,
name: 'DCLASS',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASDCLASS', 'DCLASS', '危险品等级');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPDCLASS'
}, {
fieldLabel: '危险品编号',
flex: 1,
labelWidth: 70,
name: 'DUNNO',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASDUNNO', 'DUNNO', '危险品编号');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPDUNNO'
}, {
fieldLabel: '危险品页号',
flex: 1,
labelWidth: 70,
name: 'DPAGE',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASDPAGE', 'DPAGE', '危险品页号');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPDPAGE'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
defaults: {
anchor: '96%'
},
items: [{
fieldLabel: '危险品标签',
flex: 1,
labelWidth: 70,
name: 'DLABEL',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASDLABEL', 'DLABEL', '危险品标签');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPDLABEL'
}, {
fieldLabel: '危险品联系人',
flex: 1,
labelWidth: 90,
name: 'LINKMAN',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASLINKMAN', 'LINKMAN', '危险品联系人');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPLINKMAN'
}, { flex: 1.5, xtype: 'hiddenfield'}]
}]
});
this.StoreTemp = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoreTemp.add({ "ID": "C", "NAME": "C摄氏" });
this.StoreTemp.add({ "ID": "F", "NAME": "F华氏" });
this.comboxTemp = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreTemp,
fieldLabel: '温度单位',
forceSelection: true,
name: 'TEMPID',
valueField: 'ID',
displayField: 'NAME'
});
this.panelBodyRf = new Ext.Panel({
title: '冻柜信息',
layout: "border",
hidden: true,
height: 60,
//margin: '5 10',
frame: true,
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '冷藏通风量',
name: 'REEFERF',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASREEFERF', 'REEFERF', '冷藏通风量');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPREEFERF'
}, {
fieldLabel: '设置温度',
name: 'TEMPSET',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASTEMPSET', 'TEMPSET', '设置温度');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPTEMPSET'
}, this.comboxTemp]
}]
});
this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.VesselModel',
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
});
this.storeVoyVeg.load({ params: { condition: ""} });
this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船 名',
store: this.storeVoyVeg,
name: 'VESSEL',
valueField: 'VESSEL',
flex: 2,
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var selectrecords = DsStoreQueryBy(this.storeVoyVeg, 'VoyName', combo.value);
if (selectrecords.getCount() > 0) {
var selectdata = selectrecords.getAt(0).data;
this.formEdit.getForm().findField('VESSELID').setValue(selectdata.EDICODE);
} else {
this.formEdit.getForm().findField('VESSELID').setValue('');
}
}
}
}
});
//签单方式
this.storeISSUETYPE = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_BLTYPE',
proxy: { url: '/CommMng/BasicDataRef/GetCodeBLTYPEList' }
});
this.storeISSUETYPE.load({ params: { condition: ""} });
this.comboxISSUETYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '签单方式',
store: this.storeISSUETYPE,
labelWidth: 70, flex: 0.8, name: 'ISSUETYPE',
valueField: 'ISSUEWAY', //BLTYPE
displayField: 'ISSUEWAY'//BLTYPE
});
this.StoreBLNUM = Ext.create('Ext.data.Store', {
fields: ['NUM']
});
this.StoreBLNUM.add({ "NUM": "ZERO" });
this.StoreBLNUM.add({ "NUM": "ONE" });
this.StoreBLNUM.add({ "NUM": "TWO" });
this.StoreBLNUM.add({ "NUM": "THREE" });
this.StoreBLNUM.add({ "NUM": "FOUR" });
this.StoreBLNUM.add({ "NUM": "FIVE" });
this.StoreBLNUM.add({ "NUM": "SIX" });
this.StoreBLNUM.add({ "NUM": "SEVEN" });
this.StoreBLNUM.add({ "NUM": "EIGHT" });
this.StoreBLNUM.add({ "NUM": "NINE" });
this.StoreBLNUM.add({ "NUM": "TEN" });
this.comboxBLNUM = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '提单份数',
store: this.StoreBLNUM,
name: 'NOBILL',
valueField: 'BILLNUM', //NUM
displayField: 'BILLNUM'//NUM
});
_this = this;
//#region 编辑formEdit 基本信息
this.formEdit = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
layout: 'anchor',
trackResetOnLoad: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '96%'
},
items: [{
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{ flex: 0.5,
fieldLabel: 'Shipper', inputValue: true,
xtype: 'checkboxfield',
name: 'UPSHIPPER'
}, {
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 90,
name: 'SHIPPER',
anchor: '100%',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASSHIPPER', 'SHIPPER', '发货人');
});
}
}
}, { flex: 0.5,
fieldLabel: 'Consignee', inputValue: true,
xtype: 'checkboxfield',
name: 'UPCONSIGNEE'
}, {
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 90,
name: 'CONSIGNEE',
anchor: '100%',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASCONSIGNEE', 'CONSIGNEE', '收货人');
});
}
}
}, { flex: 0.5,
fieldLabel: 'Notify Party', inputValue: true,
xtype: 'checkboxfield',
name: 'UPNOTIFYPARTY'
}, {
xtype: 'textareafield',
grow: true,
labelWidth: 0,
height: 90,
name: 'NOTIFYPARTY',
anchor: '100%',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASNOTIFYPARTY', 'NOTIFYPARTY', '通知人');
});
}
}
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '开船日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETD'
}, {
fieldLabel: '装货港',
readOnly: true,
name: 'PORTLOAD',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASPORTLOAD', 'PORTLOAD', '起运港');
});
}
}
}, { flex: 0.2,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPPORTLOAD'
}, {
fieldLabel: '卸货港',
readOnly: true,
name: 'PORTDISCHARGE',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASPORTDISCHARGE', 'PORTDISCHARGE', '卸货港');
});
}
}
}, { flex: 0.3,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPPORTDISCHARGE'
}, ]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '总件数',
labelWidth: 70,
flex: 0.8,
name: 'PKGS',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASPKGS', 'PKGS', '件数');
});
}
}
}, { flex: 0.2,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPPKGS'
}, {
fieldLabel: '包装',
readOnly: true,
name: 'KINDPKGS',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASKINDPKGS', 'KINDPKGS', '包装');
});
}
}
}, { flex: 0.2,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPKINDPKGS'
}, {
labelWidth: 70,
fieldLabel: '总重量',
name: 'KGS',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASKGS', 'KGS', '重量');
});
}
}
}, { flex: 0.3,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPKGS'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
labelWidth: 70,
flex: 0.8, fieldLabel: '总尺码',
name: 'CBM',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASCBM', 'CBM', '尺码');
});
}
}
}, { flex: 0.2,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPCBM'
}, {
fieldLabel: '付费方式',
readOnly: true,
name: 'BLFRT',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASBLFRT', 'BLFRT', '付费方式');
});
}
}
}, { flex: 0.2,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPBLFRT'
}, this.comboxCargoid, { flex: 0.3,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPCARGOID'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '签单日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ISSUEDATE',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASISSUEDATE', 'ISSUEDATE', '签单日期');
});
}
}
}, { flex: 0.2,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPISSUEDATE'
}, {
fieldLabel: '签单地点',
name: 'ISSUEPLACE',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASISSUEPLACE', 'ISSUEPLACE', '签单地点');
});
}
}
}, { flex: 0.3,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPISSUEPLACE'
}]
}, { flex: 0.5,
fieldLabel: '集装箱', inputValue: true,
xtype: 'checkboxfield',
name: 'UPCTN'
}, this.panelBodyCtn, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '审核人',
readOnly: true,
name: 'AUDITOPERATOR'
}, {
fieldLabel: '审核日期',
readOnly: true,
name: 'AUDITDATE'
}]
}, this.panelORREASON, {
xtype: 'textareafield',
grow: true,
fieldLabel: '备 注',
height: 60,
name: 'REMARK',
anchor: '100%'
}
]
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
defaults: {
anchor: '99%'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '船名',
readOnly: true,
name: 'VESSEL',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASVESSEL', 'VESSEL', '船名');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPVESSEL'
}, {
fieldLabel: '航次',
flex: 1,
name: 'VOYNO',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASVOYNO', 'VOYNO', '航次');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPVOYNO'
}, {
fieldLabel: '目的地',
readOnly: true,
name: 'DESTINATION',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASDESTINATION', 'DESTINATION', '目的地');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPDESTINATION'
}, {
fieldLabel: '交货地',
readOnly: true,
name: 'PLACEDELIVERY',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASPLACEDELIVERY', 'PLACEDELIVERY', '交货地点');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPPLACEDELIVERY'
}]
}, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
inputValue: true,
fieldLabel: 'Marks & Nos.',
xtype: 'checkboxfield',
name: 'UPMARKS'
}, {
xtype: 'textareafield',
grow: true,
height: 250,
name: 'MARKS',
anchor: '100%',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASMARKS', 'MARKS', '唛头');
});
}
}
}
]
}, {
xtype: 'container',
layout: 'anchor',
flex: 3,
defaultType: 'textfield',
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '100%'
},
items: [{
inputValue: true,
fieldLabel: 'Description',
xtype: 'checkboxfield',
name: 'UPDESCRIPTION'
}, {
fieldLabel: 'HS编码',
name: 'HSCODE',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASHSCODE', 'HSCODE', 'HS编码');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPHSCODE'
}, this.comboxGOODSNAME]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '&nbsp&nbsp',
labelSeparator: '',
labelWidth: 20,
height: 250,
name: 'DESCRIPTION',
anchor: '100%',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASDESCRIPTION', 'DESCRIPTION', '货描');
});
}
}
}]
}, {
xtype: 'container',
layout: 'anchor',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'label',
html: '<html>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspNo.of containers or pkgs.<br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp箱数或件数)</html>'
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '&nbsp&nbsp',
labelWidth: 20,
labelSeparator: '',
height: 40,
name: 'NOPKGS',
anchor: '100%'
}, {
xtype: 'label',
html: '&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Gross Weight 毛重(公斤)'
}, {
xtype: 'textareafield',
grow: true,
height: 40,
labelWidth: 20,
labelSeparator: '',
fieldLabel: '&nbsp&nbsp',
name: 'GROSSWEIGHT',
anchor: '100%'
}, {
xtype: 'label',
html: '&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Measurement 尺码(立方米)'
}, {
xtype: 'textareafield',
grow: true,
height: 40,
labelWidth: 20,
labelSeparator: '',
fieldLabel: '&nbsp&nbsp',
name: 'MEASUREMENT',
anchor: '100%'
}
]
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '件数大写',
name: 'TOTALNO',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASTOTAL', 'TOTAL', '件数大写');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPTOTALNO'
}]
}, this.panelBodyDr, this.panelBodyRf, {
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
items: [{
fieldLabel: '预付地点',
name: 'PREPARDAT',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASPREPARDAT', 'PREPARDAT', '预付地点');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPPREPARDAT'
}, {
fieldLabel: '到付地点',
name: 'PAYABLEAT',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASPAYABLEAT', 'PAYABLEAT', '到付地点');
});
}
}
}, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPPAYABLEAT'
}, {
fieldLabel: '运输条款',
readOnly: true,
name: 'SERVICE',
listeners: {
scope: this,
render: function (_field, eOpts) {
_field.getEl().on('dblclick', function (e, t, eOpts) {
_this.onDiffClick('ASSERVICE', 'SERVICE', '运输条款');
});
}
}
}, { flex: 0.2,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPISSUETYPE'
}, this.comboxISSUETYPE, { flex: 0.5,
inputValue: true,
xtype: 'checkboxfield',
name: 'UPSERVICE'
}, this.comboxBLNUM]
}]
}
]
}); //end this.formEdit
//#endregion
//#region 审核或驳回界面
this.storeUser = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeUser.load({ params: { condition: ""} });
this.comboxSeaeOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操作',
store: this.storeUser,
forceSelection: true,
name: 'OP',
valueField: 'UserCode',
displayField: 'CodeAndName'
});
this.comboxSeaeCustService = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客服',
store: this.storeUser,
forceSelection: true,
name: 'CUSTSERVICE',
valueField: 'UserCode',
displayField: 'CodeAndName'
});
this.formAudit = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '会计期间',
xtype: 'monthfield',
name: 'ACCDATE'
}, this.comboxSeaeOp
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxSeaeCustService
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winAuditShow = Ext.create('Ext.window.Window', {
title: "接受订舱",
width: 450,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
// items: [this.formAudit],
buttons: [{
text: "确认接受",
minWidth: 70,
handler: function () {
// var form = me.formAudit.getForm();
// var ACCDATE = form.findField('ACCDATE').getRawValue();
// if (ACCDATE == '' || ACCDATE == null || ACCDATE == undefined) {
// Ext.Msg.show({ title: '提示', msg: '会计期间为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
// };
// me.accdate = ACCDATE;
// var User = me.comboxSeaeOp.getValue();
// if (User == '' || User == null || User == undefined) {
// Ext.Msg.show({ title: '提示', msg: '操作员为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
// };
// me.seaeop = User;
// me.seaecustservice = me.comboxSeaeCustService.getValue();
me.onAuditPassClick();
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winAuditShow.close();
}
}]
});
this.formAuditBack = Ext.widget('form', {
frame: true,
region: 'center',
title: "<a href='#'><font color='#FF0000'>驳回原因</font></a>",
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: '',
labelSeparator: '',
labelWidth: 0,
height: 100,
name: 'ORREASON',
anchor: '100%'
}
]//end root items
});
me = this;
this.winAuditBackShow = Ext.create('Ext.window.Window', {
title: "驳回订舱",
width: 450,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formAuditBack],
buttons: [{
text: "确认驳回",
minWidth: 70,
handler: function () {
var form = me.formAuditBack.getForm();
var ORREASON = form.findField('ORREASON').getRawValue();
if (ORREASON == '' || ORREASON == null || ORREASON == undefined) {
Ext.Msg.show({ title: '提示', msg: '驳回原因为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
me.reason = '提单确认驳回: ' + ORREASON;
me.onAuditBack();
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winAuditBackShow.close();
}
}]
});
//#endregion
//#region 按钮Toolbar
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
id: 'btnESave',
text: "保存",
iconCls: "btnsave",
handler: function (button, event) {
this.Save('0');
},
scope: this
}, {
id: 'btnESaveAndClose',
text: "保存并关闭",
handler: function (button, event) {
this.Save('1');
},
scope: this
}, {
id: 'btnESaveAndNew',
text: "保存并新建",
handler: function (button, event) {
this.Save('2');
},
scope: this
}, {
id: 'btnECopyNew',
text: "复制新建",
handler: function (button, event) {
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
basicForm.findField('BSNO').setDisabled(false);
var field = basicForm.findField('BSNO');
field.setValue(NewGuid());
basicForm.findField('BSNO').setDisabled(true);
field = basicForm.findField('ORDNO');
field.setValue('');
field = basicForm.findField('INPUTBY');
field.setValue(SHOWNAME);
field = basicForm.findField('OP');
field.setValue(SHOWNAME);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("ORDNO", '*');
memberbody.commit();
};
this.GetEditStatus();
var children = this.tabSeaepanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodSeaeOrderInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
}
}
}
this.tabSeaepanel.doLayout();
},
scope: this
}, '-', {
text: "关闭",
handler: function (button, event) {
window.close();
},
scope: this
}, {
id: 'btnENew',
text: "新建",
handler: function (button, event) {
this.LoadData('add', '');
var basicForm = this.formEdit.getForm();
basicForm.findField('BsNo').setDisabled(false);
},
scope: this
}, '-', {
id: 'btnSubmitAudit',
text: '提交审核',
tooltip: '提交审核',
handler: function (button, event) {
this.onSubmitAuditClick();
},
scope: this
}, {
id: 'btnSubmitAuditBack',
text: '撤销审核',
tooltip: '撤销审核',
handler: function (button, event) {
this.onSubmitAuditBackClick();
},
scope: this
}, {
text: "审核通过",
id: 'btnAudit',
iconCls: "btnadd",
handler: function (button, event) {
var billstatus = this.formHead.getForm().findField('ORSTATUS').getValue();
if (billstatus != "CI_BLC_Send") {
Ext.Msg.show({ title: '提示', msg: '当前状态无法审核通过!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var form = this.formAudit.getForm();
var VoucherDate = form.findField('ACCDATE');
var thisday = this.getToMonth();
VoucherDate.setRawValue(thisday)
this.winAuditShow.show();
},
scope: this
},
{
text: "驳回提交",
id: 'btnAuditBack',
iconCls: "btndelete",
handler: function (button, event) {
var billstatus = this.formHead.getForm().findField('ORSTATUS').getValue();
if (billstatus != "CI_BLC_Send") {
Ext.Msg.show({ title: '提示', msg: '当前状态无法驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.winAuditBackShow.show();
},
scope: this
}, {
text: "全选",
handler: function (button, event) {
this.setCheckAll(true);
},
scope: this
}, {
text: "全清",
handler: function (button, event) {
this.setCheckAll(false);
},
scope: this
}, {
id: 'btnEPrint',
text: "打印",
iconCls: "btnprint",
handler: function (button, event) {
this.Print();
},
scope: this
}]
}); //end 按钮Toolbar
//#endregion
//#region 框架结构
this.panelpage = new Ext.Panel({
title: '提单详细信息',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formEdit]
});
this.panelSeae = new Ext.Panel({
title: '提单信息',
id: 'pnlmodSeaeOrderInfo',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
frame: false,
//closable:true,
items: [this.panelBtn, this.formHead, this.panelpage]
});
this.tabSeaepanel = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'center',
id: "TabSeaePanel",
enableTabScroll: true,
items:
[
this.panelSeae
]
});
Ext.apply(this, {
items: [this.tabSeaepanel]
});
//#endregion
//#region 其他
parentWin = window.parent.opener;
this.InitData();
//#endregion
}, //end initUIComponents
//#region 加载事件
InitData: function () {
this.opStatus = 'add';
var condition = '';
_this = this;
if (parentWin) {
var ret = parentWin.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.editRecord = ret[2];
this.isAudit = ret[3];
}
this.setAuditBtnStatus(this.isAudit);
if (this.opStatus == 'edit') {
condition = "BSNO='" + this.editRecord.get('BSNO') + "'";
//this.storeBodyList.load({ params: { condition: condition} });
}
this.LoadData(this.opStatus, condition);
}, //end InitData
LoadData: function (opstatus, condition) {
this.serialNo = 0;
//this.bodyDel = [];
this.opStatus = opstatus;
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsSeaeOrder/GetWebBillData',
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;
}
data = result.data;
this.formHead.getForm().reset();
this.formHead.getForm().setValues(data);
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(data);
this.LoadInit(data);
this.GetEditStatus();
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
if (this.opStatus == 'edit') {
this.storeBodyList.load({ params: { condition: condition} });
} else {
condition = "BSNO='XX'";
this.storeBodyList.load({ params: { condition: condition} });
}
}, // end LoadDate
//#endregion
//#region 保存
Save: function (type) {
var basicForm = this.formEdit.getForm();
var basicForm2 = this.formHead.getForm();
if (!basicForm.isValid()) {
return;
}
if (!basicForm2.isValid()) {
return;
}
//
var bodydatas = [];
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
var member = this.storeBodyList.getAt(i);
bodydatas.push(member);
}
//
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
//var jsonDelBody = ConvertRecordsToJsonAll(this.bodyDel);
this.formHead.getForm().findField('ORDNO').setDisabled(false);
var data = this.formHead.getForm().getValues(false, false, false);
var data2 = this.formEdit.getForm().getValues(false, false, false);
this.formHead.getForm().findField('ORDNO').setDisabled(true);
//
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsSeaeOrder/Save',
scope: this,
params: {
opstatus: this.opStatus,
data: Ext.JSON.encode(data),
data2: Ext.JSON.encode(data2),
body: jsonBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(returnData);
this.formHead.getForm().reset();
this.formHead.getForm().setValues(returnData);
//
if (this.opStatus == 'add') {
var arrNewRecords = this.StoreList.add(returnData);
this.editRecord = arrNewRecords[0];
}
else if (this.opStatus == 'edit') {
var editp = Ext.create('MsSeaeOrderModel', returnData);
this.editRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editRecord.set(name, editp.get(name));
}
}, this);
this.editRecord.commit();
}
if (type == '0') {
this.opStatus = 'edit';
basicForm2.findField('ORDNO').setDisabled(true);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("ORDNO", this.editRecord.get('ORDNO'));
memberbody.commit();
};
} else if (type == '1') {
window.close();
} else if (type == '2') {
this.LoadData('add', '');
}
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
//#endregion
//#region 集装箱按钮事件
onAddDetailClick: function (button, event) {
this.addDetail();
}, //end onAddDetailClick
onDelDetailClick: function (button, event) {
this.deleteDetail();
}, //onDelDetailClick
addDetail: function () {
var record = Ext.create('MsSeaeOrderCtn', {
CTN_ID: NewGuid(),
ORDNO: '*',
CTNALL: '',
CTNNUM: 0,
REMARK: ''
});
this.storeBodyList.add(record);
var n = this.storeBodyList.getCount();
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 2 });
},
deleteDetail: function () {
var ORSTATUS = this.formHead.getForm().findField('ORSTATUS').getValue();
if (ORSTATUS == '0') {
Ext.Msg.show({ title: '警告', msg: '业务已提交审核,不允许操作!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
//this.serialNo = DsGetCurSerialNo(this.storeBodyList, this.serialNo);
var selectedRecords = this.gridList.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.ORDNO == "" || rec.data.ORDNO == "*")//如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeBodyList.remove(selectedRecords[i]);
}
else {
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/MsSeaeOrder/DeleteDetail',
params: {
data: Ext.JSON.encode(rec.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeBodyList.remove(rec);
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}
//this.storeBodyList.remove(selectedRecords[i]);
}
},
//#endregion
//#region
LoadInit: function (data) {
var CUSTOMERNAME = this.formHead.getForm().findField('CUSTOMERNAME').getValue();
if (data.ORSTATUS != "CI_BLC_Rec") {
/*if (data.UPCTN)
this.formEdit.getForm().findField('UPCTN').setFieldStyle({ color: '#FF0000' });*/
if (data.UPSHIPPER)
this.formEdit.getForm().findField('SHIPPER').setFieldStyle({ color: '#FF0000' });
if (data.UPCONSIGNEE)
this.formEdit.getForm().findField('CONSIGNEE').setFieldStyle({ color: '#FF0000' });
if (data.UPNOTIFYPARTY)
this.formEdit.getForm().findField('NOTIFYPARTY').setFieldStyle({ color: '#FF0000' });
if (data.UPVESSEL)
this.formEdit.getForm().findField('VESSEL').setFieldStyle({ color: '#FF0000' });
if (data.UPVOYNO)
this.formEdit.getForm().findField('VOYNO').setFieldStyle({ color: '#FF0000' });
if (data.UPPORTLOAD)
this.formEdit.getForm().findField('PORTLOAD').setFieldStyle({ color: '#FF0000' });
if (data.UPPORTDISCHARGE)
this.formEdit.getForm().findField('PORTDISCHARGE').setFieldStyle({ color: '#FF0000' });
if (data.UPPLACEDELIVERY)
this.formEdit.getForm().findField('PLACEDELIVERY').setFieldStyle({ color: '#FF0000' });
if (data.UPDESTINATION)
this.formEdit.getForm().findField('DESTINATION').setFieldStyle({ color: '#FF0000' });
if (data.UPPKGS)
this.formEdit.getForm().findField('PKGS').setFieldStyle({ color: '#FF0000' });
if (data.UPKGS)
this.formEdit.getForm().findField('KGS').setFieldStyle({ color: '#FF0000' });
if (data.UPCBM)
this.formEdit.getForm().findField('CBM').setFieldStyle({ color: '#FF0000' });
if (data.UPTOTALNO)
this.formEdit.getForm().findField('TOTALNO').setFieldStyle({ color: '#FF0000' });
if (data.UPMARKS)
this.formEdit.getForm().findField('MARKS').setFieldStyle({ color: '#FF0000' });
if (data.UPDESCRIPTION)
this.formEdit.getForm().findField('DESCRIPTION').setFieldStyle({ color: '#FF0000' });
if (data.UPSERVICE)
this.formEdit.getForm().findField('SERVICE').setFieldStyle({ color: '#FF0000' });
if (data.UPCARGOID)
this.formEdit.getForm().findField('CARGOID').setFieldStyle({ color: '#FF0000' });
if (data.UPKINDPKGS)
this.formEdit.getForm().findField('KINDPKGS').setFieldStyle({ color: '#FF0000' });
if (data.UPHSCODE)
this.formEdit.getForm().findField('HSCODE').setFieldStyle({ color: '#FF0000' });
if (data.UPDCLASS)
this.formEdit.getForm().findField('DCLASS').setFieldStyle({ color: '#FF0000' });
if (data.UPDUNNO)
this.formEdit.getForm().findField('DUNNO').setFieldStyle({ color: '#FF0000' });
if (data.UPDPAGE)
this.formEdit.getForm().findField('DPAGE').setFieldStyle({ color: '#FF0000' });
if (data.UPDLABEL)
this.formEdit.getForm().findField('DLABEL').setFieldStyle({ color: '#FF0000' });
if (data.UPLINKMAN)
this.formEdit.getForm().findField('LINKMAN').setFieldStyle({ color: '#FF0000' });
if (data.UPREEFERF)
this.formEdit.getForm().findField('REEFERF').setFieldStyle({ color: '#FF0000' });
if (data.UPTEMPSET)
this.formEdit.getForm().findField('TEMPSET').setFieldStyle({ color: '#FF0000' });
// if (data.UPTEMPMAX)
// this.formEdit.getForm().findField('TEMPMAX').setFieldStyle({ color: '#FF0000' });
// if (data.UPTEMPMIN)
// this.formEdit.getForm().findField('TEMPMIN').setFieldStyle({ color: '#FF0000' });
if (data.UPBLFRT)
this.formEdit.getForm().findField('BLFRT').setFieldStyle({ color: '#FF0000' });
if (data.UPPREPARDAT)
this.formEdit.getForm().findField('PREPARDAT').setFieldStyle({ color: '#FF0000' });
if (data.UPPAYABLEAT)
this.formEdit.getForm().findField('PAYABLEAT').setFieldStyle({ color: '#FF0000' });
if (data.UPISSUETYPE)
this.formEdit.getForm().findField('ISSUETYPE').setFieldStyle({ color: '#FF0000' });
if (data.UPISSUEDATE)
this.formEdit.getForm().findField('ISSUEDATE').setFieldStyle({ color: '#FF0000' });
if (data.UPISSUEPLACE)
this.formEdit.getForm().findField('ISSUEPLACE').setFieldStyle({ color: '#FF0000' });
}
else if (data.ORSTATUS == "CI_BLC_Rec") {
if (data.UPSHIPPER)
this.formEdit.getForm().findField('SHIPPER').setFieldStyle({ color: '#000000' });
if (data.UPCONSIGNEE)
this.formEdit.getForm().findField('CONSIGNEE').setFieldStyle({ color: '#000000' });
if (data.UPNOTIFYPARTY)
this.formEdit.getForm().findField('NOTIFYPARTY').setFieldStyle({ color: '#000000' });
if (data.UPVESSEL)
this.formEdit.getForm().findField('VESSEL').setFieldStyle({ color: '#000000' });
if (data.UPVOYNO)
this.formEdit.getForm().findField('VOYNO').setFieldStyle({ color: '#000000' });
if (data.UPPORTLOAD)
this.formEdit.getForm().findField('PORTLOAD').setFieldStyle({ color: '#000000' });
if (data.UPPORTDISCHARGE)
this.formEdit.getForm().findField('PORTDISCHARGE').setFieldStyle({ color: '#000000' });
if (data.UPPLACEDELIVERY)
this.formEdit.getForm().findField('PLACEDELIVERY').setFieldStyle({ color: '#000000' });
if (data.UPDESTINATION)
this.formEdit.getForm().findField('DESTINATION').setFieldStyle({ color: '#000000' });
if (data.UPPKGS)
this.formEdit.getForm().findField('PKGS').setFieldStyle({ color: '#000000' });
if (data.UPKGS)
this.formEdit.getForm().findField('KGS').setFieldStyle({ color: '#000000' });
if (data.UPCBM)
this.formEdit.getForm().findField('CBM').setFieldStyle({ color: '#000000' });
if (data.UPTOTALNO)
this.formEdit.getForm().findField('TOTALNO').setFieldStyle({ color: '#000000' });
if (data.UPMARKS)
this.formEdit.getForm().findField('MARKS').setFieldStyle({ color: '#000000' });
if (data.UPDESCRIPTION)
this.formEdit.getForm().findField('DESCRIPTION').setFieldStyle({ color: '#000000' });
if (data.UPSERVICE)
this.formEdit.getForm().findField('SERVICE').setFieldStyle({ color: '#000000' });
if (data.UPCARGOID)
this.formEdit.getForm().findField('CARGOID').setFieldStyle({ color: '#000000' });
if (data.UPKINDPKGS)
this.formEdit.getForm().findField('KINDPKGS').setFieldStyle({ color: '#000000' });
if (data.UPHSCODE)
this.formEdit.getForm().findField('HSCODE').setFieldStyle({ color: '#000000' });
if (data.UPDCLASS)
this.formEdit.getForm().findField('DCLASS').setFieldStyle({ color: '#000000' });
if (data.UPDUNNO)
this.formEdit.getForm().findField('DUNNO').setFieldStyle({ color: '#000000' });
if (data.UPDPAGE)
this.formEdit.getForm().findField('DPAGE').setFieldStyle({ color: '#000000' });
if (data.UPDLABEL)
this.formEdit.getForm().findField('DLABEL').setFieldStyle({ color: '#000000' });
if (data.UPLINKMAN)
this.formEdit.getForm().findField('LINKMAN').setFieldStyle({ color: '#000000' });
if (data.UPREEFERF)
this.formEdit.getForm().findField('REEFERF').setFieldStyle({ color: '#000000' });
if (data.UPTEMPSET)
this.formEdit.getForm().findField('TEMPSET').setFieldStyle({ color: '#000000' });
// if (data.UPTEMPMAX)
// this.formEdit.getForm().findField('TEMPMAX').setFieldStyle({ color: '#FF0000' });
// if (data.UPTEMPMIN)
// this.formEdit.getForm().findField('TEMPMIN').setFieldStyle({ color: '#FF0000' });
if (data.UPBLFRT)
this.formEdit.getForm().findField('BLFRT').setFieldStyle({ color: '#000000' });
if (data.UPPREPARDAT)
this.formEdit.getForm().findField('PREPARDAT').setFieldStyle({ color: '#000000' });
if (data.UPPAYABLEAT)
this.formEdit.getForm().findField('PAYABLEAT').setFieldStyle({ color: '#000000' });
if (data.UPISSUETYPE)
this.formEdit.getForm().findField('ISSUETYPE').setFieldStyle({ color: '#000000' });
if (data.UPISSUEDATE)
this.formEdit.getForm().findField('ISSUEDATE').setFieldStyle({ color: '#000000' });
if (data.UPISSUEPLACE)
this.formEdit.getForm().findField('ISSUEPLACE').setFieldStyle({ color: '#000000' });
}
this.panelBodyCtn.show();
var ORSTATUS = this.formHead.getForm().findField('ORSTATUS').getValue();
if (ORSTATUS == "2") {
this.panelORREASON.show();
}
else {
this.panelORREASON.hide();
}
var CARGOID = this.formEdit.getForm().findField('CARGOID').getValue();
if (CARGOID == 'R') {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(true);
} else if (CARGOID == 'D') {
this.panelBodyDr.setVisible(true);
this.panelBodyRf.setVisible(false);
} else {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(false);
}
},
//#endregion
//#region 差异
onDiffClick: function (localfield, webfield, fieldname) {
var localstr = this.formHead.getForm().findField(localfield).getValue();
var webstr = this.formEdit.getForm().findField(webfield).getValue();
var formCustomDataShow = Ext.widget('form', {
region: 'center',
autoScroll: true, height: 410,
frame: true,
bodyPadding: 0,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [{
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '96%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '本地数据',
xtype: 'textareafield',
grow: true,
labelSeparator: '',
height: 400,
width: 500, flex: 1, name: 'LOCALSTR',
anchor: '100%',
value: localstr
}, {
fieldLabel: '客户提交数据',
xtype: 'textareafield',
grow: true,
labelSeparator: '',
flex: 1, height: 400, width: 500,
name: 'WEBSTR',
anchor: '100%',
value: webstr
}]
}]
}]
});
me = this;
var winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
width: 1100,
height: 500,
layout: 'fit',
resizable: true,
title: fieldname + '差异数据显示',
modal: true,
closeAction: 'close',
closable: true,
items: [formCustomDataShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
},
onDiffCtnClick: function (bsno) {
condition = "BSNO='" + bsno + "'";
var webstoreBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsSeaeOrder/GetWebBodyList',
reader: {
id: 'BSNO,CTN_ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
webstoreBodyList.load({ params: { condition: condition} });
var webgridList = new Ext.grid.GridPanel({
store: webstoreBodyList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'CTN_ID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 0
}, {
dataIndex: 'CTN',
header: '箱型',
width: 70
}, {
dataIndex: 'CTNNUM',
header: '箱量',
width: 50
}, {
dataIndex: 'CNTRNO',
header: '箱号',
width: 100
}, {
dataIndex: 'SEALNO',
header: '封号',
width: 80
}, {
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 60
}, {
dataIndex: 'KINDPKGS',
header: '包装',
width: 70
}, {
dataIndex: 'KGS',
header: '重量',
width: 60
}, {
dataIndex: 'CBM',
header: '尺码',
width: 60
}, {
dataIndex: 'TAREWEIGHT',
header: '箱皮重',
width: 60
}, {
dataIndex: 'REMARK',
header: '备注',
width: 150
}]
});
var webpanelBodyCtn = new Ext.Panel({
title: '客户提交集装箱信息',
layout: "border",
region: 'center',
frame: true,
items: [webgridList]
});
var localstoreBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeae/GetBodyLis',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
localstoreBodyList.load({ params: { condition: condition} });
var localgridList = new Ext.grid.GridPanel({
store: localstoreBodyList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'CTN_ID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 0
}, {
dataIndex: 'CTN',
header: '箱型',
width: 70
}, {
dataIndex: 'CTNNUM',
header: '箱量',
width: 50
}, {
dataIndex: 'CNTRNO',
header: '箱号',
width: 100
}, {
dataIndex: 'SEALNO',
header: '封号',
width: 80
}, {
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 60
}, {
dataIndex: 'KINDPKGS',
header: '包装',
width: 70
}, {
dataIndex: 'KGS',
header: '重量',
width: 60
}, {
dataIndex: 'CBM',
header: '尺码',
width: 60
}, {
dataIndex: 'TAREWEIGHT',
header: '箱皮重',
width: 60
}, {
dataIndex: 'REMARK',
header: '备注',
width: 150
}]
});
var localpanelBodyCtn = new Ext.Panel({
title: '本地集装箱信息',
layout: "border",
region: 'north',
height: 180,
frame: true,
items: [localgridList]
});
me = this;
var winCustomDataShow = Ext.create('Ext.window.Window', {
title: "",
width: 1100,
height: 500,
layout: 'fit',
layout: "border",
resizable: true,
title: '差异数据显示',
modal: true,
closeAction: 'close',
closable: true,
items: [localpanelBodyCtn, webpanelBodyCtn],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
winCustomDataShow.close();
}
}]
});
winCustomDataShow.show();
},
//#endregion
setCheckAll: function (ck) {
this.formEdit.getForm().findField('UPSHIPPER').setValue(ck);
this.formEdit.getForm().findField('UPCONSIGNEE').setValue(ck);
this.formEdit.getForm().findField('UPNOTIFYPARTY').setValue(ck);
this.formEdit.getForm().findField('UPVESSEL').setValue(ck);
this.formEdit.getForm().findField('UPVOYNO').setValue(ck);
this.formEdit.getForm().findField('UPPORTLOAD').setValue(ck);
this.formEdit.getForm().findField('UPPORTDISCHARGE').setValue(ck);
this.formEdit.getForm().findField('UPPLACEDELIVERY').setValue(ck);
this.formEdit.getForm().findField('UPDESTINATION').setValue(ck);
this.formEdit.getForm().findField('UPPKGS').setValue(ck);
this.formEdit.getForm().findField('UPKGS').setValue(ck);
this.formEdit.getForm().findField('UPKINDPKGS').setValue(ck);
this.formEdit.getForm().findField('UPCBM').setValue(ck);
this.formEdit.getForm().findField('UPTOTALNO').setValue(ck);
this.formEdit.getForm().findField('UPMARKS').setValue(ck);
this.formEdit.getForm().findField('UPDESCRIPTION').setValue(ck);
this.formEdit.getForm().findField('UPSERVICE').setValue(ck);
this.formEdit.getForm().findField('UPCARGOID').setValue(ck);
this.formEdit.getForm().findField('UPHSCODE').setValue(ck);
this.formEdit.getForm().findField('UPDCLASS').setValue(ck);
this.formEdit.getForm().findField('UPDUNNO').setValue(ck);
this.formEdit.getForm().findField('UPDPAGE').setValue(ck);
this.formEdit.getForm().findField('UPDLABEL').setValue(ck);
this.formEdit.getForm().findField('UPLINKMAN').setValue(ck);
this.formEdit.getForm().findField('UPREEFERF').setValue(ck);
this.formEdit.getForm().findField('UPTEMPSET').setValue(ck);
// this.formEdit.getForm().findField('UPTEMPMAX').setValue(ck);
// this.formEdit.getForm().findField('UPTEMPMIN').setValue(ck);
this.formEdit.getForm().findField('UPBLFRT').setValue(ck);
this.formEdit.getForm().findField('UPPREPARDAT').setValue(ck);
this.formEdit.getForm().findField('UPPAYABLEAT').setValue(ck);
this.formEdit.getForm().findField('UPISSUETYPE').setValue(ck);
this.formEdit.getForm().findField('UPISSUEDATE').setValue(ck);
this.formEdit.getForm().findField('UPISSUEPLACE').setValue(ck);
this.formEdit.getForm().findField('UPCTN').setValue(ck);
},
onAuditPassClick: function () {
this.formHead.getForm().findField('ORDNO').setDisabled(false);
var data = this.formHead.getForm().getValues(false, false, false);
var data2 = this.formEdit.getForm().getValues(false, false, false);
this.formHead.getForm().findField('ORDNO').setDisabled(true);
var bodydatas = [];
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
var member = this.storeBodyList.getAt(i);
bodydatas.push(member);
}
//
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
_this = this;
Ext.MessageBox.confirm('提示', '确定审核通过选中的业务吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在审核数据...');
Ext.Ajax.request({
waitMsg: '正在审核数据...',
url: '/MvcShipping/MsSeaeOrder/AuditWebOrderBillForm',
params: {
data: Ext.JSON.encode(data),
data2: Ext.JSON.encode(data2),
body: jsonBody
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(returnData);
this.formHead.getForm().reset();
this.formHead.getForm().setValues(returnData);
var editp = Ext.create('MsSeaeOrderBillModel', returnData);
this.editRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editRecord.set(name, editp.get(name));
}
}, this);
this.editRecord.commit();
_this.GetEditStatus();
Ext.Msg.show({ title: '提示', msg: '审核成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
_this.winAuditShow.close()
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
onAuditBack: function () {
this.formHead.getForm().findField('ORDNO').setDisabled(false);
var data = this.formHead.getForm().getValues(false, false, false);
var data2 = this.formEdit.getForm().getValues(false, false, false);
this.formHead.getForm().findField('ORDNO').setDisabled(true);
_this = this;
Ext.MessageBox.confirm('提示', '确定驳回选中的业务吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在驳回数据...');
Ext.Ajax.request({
waitMsg: '正在驳回数据...',
url: '/MvcShipping/MsSeaeOrder/AuditBackWebOrderBill', //AuditBackWebOrderBillForm
params: {
data: Ext.JSON.encode(data),
data2: Ext.JSON.encode(data2),
orreason: _this.reason
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(returnData);
this.formHead.getForm().reset();
this.formHead.getForm().setValues(returnData);
var editp = Ext.create('MsSeaeOrderBillModel', returnData);
this.editRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editRecord.set(name, editp.get(name));
}
}, this);
this.editRecord.commit();
_this.GetEditStatus();
Ext.Msg.show({ title: '提示', msg: '驳回成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
_this.winAuditBackShow.close();
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
getToMonth: function () {
var now = new Date();
var year = now.getFullYear(); //年
var month = now.getMonth() + 1; //月
var clock = year + "-";
if (month < 10)
clock = clock + "0" + month;
else
clock = clock + month;
return (clock);
},
//#region 编辑时按钮等的状态
GetEditStatus: function () {
var canedit = false;
var BSSTATUS = this.formHead.getForm().findField('ORSTATUS').getValue();
var inputby = this.formHead.getForm().findField('INPUTBY').getValue();
var op = this.formHead.getForm().findField('OP').getValue();
_this = this;
if (BSSTATUS == "0" || BSSTATUS == "1") {
canedit = false;
this.setSaveBtnStatus(canedit);
} else {
this.StoreOpRange.load({ params: { optype: "modSeaeOrderList" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
var records = DsStoreQueryBy(_this.StoreOpRange, 'OPID', op);
if (records.getCount() > 0) {
canedit = true;
} else {
var recordins = DsStoreQueryBy(_this.StoreOpRange, 'OPID', inputby);
if (recordins.getCount() > 0) {
canedit = true;
} else {
canedit = false;
}
}
} else { canedit = false; }
_this.setSaveBtnStatus(canedit);
}
}
});
}
},
GetStringNum: function (str) {
var num = 0;
if (str == null || str == '') return num;
if (str.length == 0) return num;
var if_find = false;
var str_num = '';
for (var i = 0; i < str.length; i += 1) {
var member = str.substr(i, 1);
if ((member == '0') || (member == '1') || (member == '2') || (member == '3')
|| (member == '4') || (member == '5') || (member == '6') || (member == '7')
|| (member == '8') || (member == '9') || (member == '.') || (member == '-')) {
if (!if_find) {
str_num = str_num + member;
}
} else {
if_find = true;
}
}
return str_num;
},
setAuditBtnStatus: function (enable) {
var btnESave = Ext.getCmp('btnESave');
var btnESaveAndClose = Ext.getCmp('btnESaveAndClose');
var btnESaveAndNew = Ext.getCmp('btnESaveAndNew');
var btnENew = Ext.getCmp('btnENew');
var btnECopyNew = Ext.getCmp('btnECopyNew');
var btnSubmitAudit = Ext.getCmp('btnSubmitAudit');
var btnSubmitAuditBack = Ext.getCmp('btnSubmitAuditBack');
var btnEPrint = Ext.getCmp('btnEPrint');
var btnAudit = Ext.getCmp('btnAudit');
var btnAuditBack = Ext.getCmp('btnAuditBack');
btnESave.setVisible(!enable); ;
btnESaveAndClose.setVisible(!enable);
btnESaveAndNew.setVisible(!enable);
btnENew.setVisible(!enable); ;
btnECopyNew.setVisible(!enable);
btnSubmitAudit.setVisible(!enable);
btnSubmitAuditBack.setVisible(!enable);
btnEPrint.setVisible(!enable);
btnAudit.setVisible(enable);
btnAuditBack.setVisible(enable);
},
setSaveBtnStatus: function (enable) {
var btnESave = Ext.getCmp('btnESave');
var btnESaveAndClose = Ext.getCmp('btnESaveAndClose');
var btnESaveAndNew = Ext.getCmp('btnESaveAndNew');
if (enable) {
btnESave.enable();
btnESaveAndClose.enable();
btnESaveAndNew.enable();
} else {
btnESave.disable();
btnESaveAndClose.disable();
btnESaveAndNew.disable();
}
},
//#endregion
//#region 打印
Print: function () {
/*
var basicForm = this.formEdit.getForm();
var billNo = basicForm.findField('BillNo').value;
if (billNo == '*' || billNo == '') {
Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
}
var printType = 'MSWLBULKBS';
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM tMsWlBulkHead WHERE BillNo = '" + billNo + "'";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
*/
}
//#endregion
});