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/MsOpSeae/MsOpCtnDetailEdit.js

899 lines
32 KiB
JavaScript

3 years ago
Ext.namespace('Shipping');
Shipping.MsOpCtnDetailEdit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpCtnDetailEdit.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpCtnDetailEdit, Ext.Panel, {
parentWin: null,
editRecord: null,
initUIComponents: function () {
this.serialNo = 0;
this.itemindex = 1;
//#region 加载父类值
parentWin = window.parent.opener;
if (parentWin) {
var ret = parentWin.OprationSwapOpCtnDetail();
this.editRecord = ret[0];
}
//#endregion
//#region 下拉框信息加载
//箱型_集装箱列表中的下拉框加载
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.storeCodePackage = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodePackageModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodePackageList' }
});
this.storeCodePackage.load();
this.comboxKINDPKGS_CTN = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '件数包装',
store: this.storeCodePackage,
forceSelection: true,
name: 'KINDPKGS',
valueField: 'PKGS',
displayField: 'PKGS'
});
//#endregion
//#region 集装箱-主列表
this.storeList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaeDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeae/GetBodyList',
reader: {
id: 'BsNo,CTNCODE,CTN_ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.girdcolums = [{
sortable: true,
dataIndex: 'CTN_ID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'CTNCODE',
2 years ago
header: Zi.LAN.CTNCODE,
3 years ago
width: 35
}, {
dataIndex: 'CTNALL',
2 years ago
header: Zi.LAN.CTNALL,
3 years ago
width: 70
}, {
dataIndex: 'CTNNUM',
2 years ago
header: Zi.LAN.CTNNUM ,
3 years ago
width: 50
}, {
dataIndex: 'CNTRNO',
2 years ago
header: Zi.LAN.CNTRNO,
3 years ago
width: 100
}, {
dataIndex: 'SEALNO',
2 years ago
header: Zi.LAN.SEALNO,
3 years ago
width: 80
}, {
sortable: true,
dataIndex: 'PKGS',
2 years ago
header: Zi.LAN.PKGS,
3 years ago
width: 80,
align: 'right',
summaryType: 'sum',
summaryRenderer: Ext.util.Format.numberRenderer()
}, {
dataIndex: 'KINDPKGS',
2 years ago
header: Zi.LAN.KINDPKGS,
3 years ago
width: 120
}, {
dataIndex: 'KGS',
2 years ago
header: Zi.LAN.KGS2,
3 years ago
width: 100,
align: 'right',
summaryType: 'sum',
summaryRenderer: Ext.util.Format.numberRenderer('00.0000'),
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 4, '', true);
return value;
}
}, {
dataIndex: 'CBM',
2 years ago
header: Zi.LAN.CBM2,
3 years ago
width: 100,
align: 'right',
summaryType: 'sum',
summaryRenderer: Ext.util.Format.numberRenderer('00.0000'),
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 4, '', true);
return value;
}
}, {
dataIndex: 'TAREWEIGHT',
2 years ago
header: Zi.LAN.TAREWEIGHT,
3 years ago
width: 100,
align: 'right',
summaryType: 'sum',
summaryRenderer: Ext.util.Format.numberRenderer('00.0000'),
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 4, '', true);
return value;
}
2 years ago
}, {
dataIndex: 'CNTRSOURCE',
2 years ago
header: Zi.LAN.CNTRSOURCE,
2 years ago
width: 70
}, {
3 years ago
dataIndex: 'REMARK',
2 years ago
header: Zi.LAN.REMARK,
3 years ago
width: 150
}];
2 years ago
this.AddGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
3 years ago
//定义Grid
this.gridListMain = new Ext.grid.GridPanel({
2 years ago
title: Zi.LAN.MBLNO + '' + this.editRecord.data.MBLNO.toString() + Zi.LAN.panelBodyCtn,
3 years ago
store: this.storeList,
enableHdMenu: false,
//region: 'west',
region: 'north',
height: 400,
frame: true,
2 years ago
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhongQingShaoDeng},
3 years ago
trackMouseOver: true,
2 years ago
viewConfig: {
enableTextSelection: true
},
3 years ago
disableSelection: false,
2 years ago
selModel: this.AddGridCheckBoxModel,
3 years ago
columns: this.girdcolums,
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
tbar: [{
2 years ago
text: Zi.LAN.btnprintctn,
tooltip: Zi.LAN.btnprintctn,
3 years ago
id: "btnprint",
iconCls: "btnprint",
handler: function (button, event) {
this.Print(button, event);
},
scope: this
}]
});
_this = this;
this.gridListMain.addListener('itemclick', function (dataview, record, item, index, e, b) {
this.storeBodyList.load({ params: { condition: "CTN_ID='" + record.data.CTN_ID + "'" }, scope: this });
}, this);
//#endregion
//#region 集装箱-明细表
this.storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpCtnDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeae/GetOpCtnDetailList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
2 years ago
this.StoreDPKGTYPE2 = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoreDPKGTYPE2.add({ "ID": "", "NAME": "没有要求" });
this.StoreDPKGTYPE2.add({ "ID": "1", "NAME": "高度危险" });
this.StoreDPKGTYPE2.add({ "ID": "2", "NAME": "中度危险" });
this.StoreDPKGTYPE2.add({ "ID": "3", "NAME": "低度危险" });
//this.storeDPKGTYPE2 = Ext.create('DsExt.ux.RefEnumStore', {});
//this.storeDPKGTYPE2.load({ params: { enumTypeId: 97305 } });
this.comboxDPKGTYPE2 = Ext.create('DsExt.ux.RefEnumCombox', {
store: this.storeDPKGTYPE2,
name: 'PKGTYPE',
valueField: 'ID',
displayField: 'NAME'
});
this.StoreISMP2 = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
this.StoreISMP2.add({ "ID": "1", "NAME": "是" });
this.StoreISMP2.add({ "ID": "", "NAME": "否" });
this.comboxISMP2 = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreISMP2,
forceSelection: true,
flex: 1,
name: 'ISMP',
valueField: 'ID',
displayField: 'NAME'
});
3 years ago
this.girdcolums2 = [{
sortable: true,
dataIndex: 'GID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'CTN_ID',
header: 'CTN编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'PKGS',
2 years ago
header: Zi.LAN.PKGS,
3 years ago
width: 80,
align: 'right',
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true, //得到焦点时自动选择文本
allowDecimals: false, //允许输入小数
nanText: '请输入有效整数',
value: 0
},
summaryType: 'sum',
summaryRenderer: Ext.util.Format.numberRenderer()
}, {
dataIndex: 'KINDPKGS',
2 years ago
header: Zi.LAN.KINDPKGS,
3 years ago
width: 120,
editor: this.comboxKINDPKGS_CTN
}, {
dataIndex: 'KGS',
2 years ago
header: Zi.LAN.KGS2,
3 years ago
width: 100,
align: 'right',
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true, //得到焦点时自动选择文本
allowDecimals: true, //允许输入小数
decimalPrecision: 4, //允许保留的小数位数,并四舍五入
nanText: '请输入有效小数',
value: 0.00000
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 4, '', true);
return value;
}
}, {
dataIndex: 'CBM',
2 years ago
header: Zi.LAN.CBM2,
3 years ago
width: 100,
align: 'right',
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true, //得到焦点时自动选择文本
allowDecimals: true, //允许输入小数
decimalPrecision: 4, //允许保留的小数位数,并四舍五入
nanText: '请输入有效小数',
value: 0.00000
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 4, '', true);
return value;
}
}, {
dataIndex: 'HSCODE',
2 years ago
header: Zi.LAN.HSCODE,
3 years ago
width: 100,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false
}
2 years ago
}, {
dataIndex: 'NCM',
header: 'NCM',
width: 100,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false
}
}, {
dataIndex: 'DCLASS',
2 years ago
header: Zi.LAN.DCLASS,
2 years ago
width: 60,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false
}
}, {
dataIndex: 'DUNNO',
2 years ago
header: Zi.LAN.DUNNO,
2 years ago
width: 60,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false
}
}, {
dataIndex: 'DFLASH',
2 years ago
header: Zi.LAN.DFLASH,
2 years ago
width: 60,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false
}
}, {
dataIndex: 'DPAGE',
2 years ago
header: Zi.LAN.DPAGE,
2 years ago
width: 60,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false
}
}, {
dataIndex: 'PKGTYPE',
2 years ago
header: Zi.LAN.PKGTYPE,
2 years ago
width: 120,
editor: this.comboxDPKGTYPE2
}, {
dataIndex: 'ISMP',
2 years ago
header: Zi.LAN.ISMP,
2 years ago
width: 120,
editor: this.comboxISMP2
}, {
dataIndex: 'LINKMAN',
2 years ago
header: Zi.LAN.LINKMAN,
2 years ago
width: 60,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false
}
}, {
dataIndex: 'DTEL',
2 years ago
header: Zi.LAN.ATTN,
2 years ago
width: 60,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false
}
}, {
3 years ago
dataIndex: 'DESCRIPTION',
2 years ago
header: Zi.LAN.DESCRIPTION,
3 years ago
width: 200,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false,
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'blur': function blur(combo, eOpts, obj) {
this.formEdit.getForm().findField('DESCRIPTION').setValue(combo.value);
}
}
}
}, {
dataIndex: 'MARKS',
2 years ago
header: Zi.LAN.MARK,
3 years ago
width: 200,
editor: {
xtype: 'textareafield',
selectOnFocus: true,
allowBlank: false,
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'blur': function blur(combo, eOpts, obj) {
this.formEdit.getForm().findField('MARKS').setValue(combo.value);
}
}
}
}];
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
2 years ago
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
3 years ago
this.gridList = new Ext.grid.GridPanel({
2 years ago
title: Zi.LAN.DUOPINMINGXINXI,
3 years ago
store: this.storeBodyList,
enableHdMenu: false,
//region: 'north',
region: 'west',
width: 900,
frame: true,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListCellEditing],
2 years ago
selModel: this.GridCheckBoxModel,
3 years ago
selType: 'cellmodel',
columns: this.girdcolums2,
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
tbar: [{
2 years ago
text: Zi.LAN.btnadddetail,
tooltip: Zi.LAN.btnadddetail,
3 years ago
id: "btnadddetail",
iconCls: "btnadddetail",
handler: function (button, event) {
this.onAddDetailClick(button, event);
},
scope: this
}, {
id: 'btnESave',
2 years ago
text: Zi.LAN.btnsavemanifestDelivery,
3 years ago
iconCls: "btnsave",
handler: function (button, event) {
this.Save('0');
},
scope: this
}, '-', {
2 years ago
text: Zi.LAN.btndeldetail,
tooltip: Zi.LAN.btndeldetail,
3 years ago
id: "btndeldetail",
iconCls: "btndeletedetail",
handler: function (button, event) {
this.onDelDetailClick(button, event);
},
scope: this
}, '-', {
2 years ago
text: Zi.LAN.YinRuEXCELShuJu,
3 years ago
handler: function (button, event) {
this.onImportCtnDetailClick(button, event);
},
scope: this
}]
});
this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) {
this.formEdit.getForm().findField('DESCRIPTION').setValue(record.data.DESCRIPTION);
this.formEdit.getForm().findField('MARKS').setValue(record.data.MARKS);
}, this);
//#endregion
//#region 编辑formEdit 基本信息
this.formEdit = Ext.widget('form', {
2 years ago
title: Zi.LAN.DESCRIPTION + '&' + Zi.LAN.MARK,
3 years ago
region: 'center',
frame: true,
border: false,
trackResetOnLoad: true,
items: [{
fieldLabel: 'GID',
name: 'GID', hidden: true
}, {
xtype: 'label',
flex: 1, id: 'DESCRIPTIONSTR',
html: "<font color='green'></font>"
}, {
xtype: 'textareafield',
grow: true, //字段是否自动伸展和收缩,默认为false
labelSeparator: '', //标签分隔字符
name: 'DESCRIPTION',
height: 170,
anchor: '100%',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'blur': function blur(combo, eOpts, obj) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length > 0) {
this.SetShipperLable('DESCRIPTION', 35);
selections[0].set('DESCRIPTION', combo.value);
}
this.formEdit.getForm().findField('DESCRIPTION')
.setValue(combo.value.toUpperCase());
}
//
}
}, {
xtype: 'label',
flex: 1, id: 'MARKSSTR',
html: "<font color='green'></font>"
}, {
xtype: 'textareafield',
grow: true, //字段是否自动伸展和收缩,默认为false
labelSeparator: '', //标签分隔字符
name: 'MARKS',
height: 170,
anchor: '100%',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'blur': function blur(combo, eOpts, obj) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length > 0) {
this.SetShipperLable('MARKS', 24);
selections[0].set('MARKS', combo.value);
}
this.formEdit.getForm().findField('MARKS')
.setValue(combo.value.toUpperCase());
}
//
}
}]
});
//#endregion
//#region 框架结构
Ext.apply(this, {
border: false,
items: [this.gridListMain, this.gridList, this.formEdit]
});
//#endregion
//#region 加载列表
this.storeList.load({ params: { condition: "BSNO='" + this.editRecord.data.BSNO.toString() + "'" }, scope: this });
2 years ago
this.storeList.on('load', function (store, records) {
if (store.getCount() > 0) {
this.gridListMain.getSelectionModel().select(0);
}
}, this);
this.gridListMain.getSelectionModel().on('select', function (model, record, index) {
this.storeBodyList.load({ params: { condition: "CTN_ID='" + record.data.CTN_ID + "'" }, scope: this });
}, this);
3 years ago
//#endregion
},
//#region 保存明细
Save: function (type) {
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
return;
}
//
var selections = this.gridListMain.getSelectionModel().getSelection();
var sCTN_ID = selections[0].data.CTN_ID;
var iPKGS = selections[0].data.PKGS;
var dKGS = selections[0].data.KGS;
var dCBM = selections[0].data.CBM;
//
var data = this.formEdit.getForm().getValues(false, false, false);
var bodydatas = [];
var iPKGS2 = 0;
var dKGS2 = 0;
var dCBM2 = 0;
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
iPKGS2 += this.storeBodyList.getAt(i).get("PKGS");
dKGS2 = Add(dKGS2, this.storeBodyList.getAt(i).get("KGS"));
var ctncbm=this.storeBodyList.getAt(i).get("CBM");
dCBM2 = Add(dCBM2, parseFloat(ctncbm).toFixed(4));
var member = this.storeBodyList.getAt(i);
bodydatas.push(member);
}
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
2 years ago
//
//if (iPKGS2 > iPKGS) {
// Ext.Msg.show({ title: '错误', msg: "多品名中 件数总和 超出 集装箱件数!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
// return;
//}
//if (dKGS2 > dKGS) {
// Ext.Msg.show({ title: '错误', msg: "多品名中 重量总和 超出 集装箱重量!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
// return;
//}
//if (dCBM2 > dCBM) {
// Ext.Msg.show({ title: '错误', msg: "多品名中 立方数总 超出 集装箱立方数!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
// return;
//}
//
2 years ago
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
3 years ago
Ext.Ajax.request({
2 years ago
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
3 years ago
url: '/MvcShipping/MsOpSeae/SaveOpCtnDetail',
scope: this,
params: {
body: jsonBody,
pkgs: iPKGS,
kgs: dKGS,
cbm: dCBM
},
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.storeBodyList.load({ params: { condition: "CTN_ID='" + sCTN_ID + "'" }, scope: this });
} else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
3 years ago
}
} else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
3 years ago
}
}
});
}, //end save
//#endregion
//#region 添加明细
onAddDetailClick: function (button, event) {
var descrip = this.editRecord.get('DESCRIPTION');
var sMARKS = this.editRecord.get('MARKS');
if (sMARKS.toString().trim() == "N/M") {
sMARKS = "";
}
var iPKGS2 = 0;
var dKGS2 = 0;
var dCBM2 = 0;
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
iPKGS2 += this.storeBodyList.getAt(i).get("PKGS");
dKGS2 = Add(dKGS2, this.storeBodyList.getAt(i).get("KGS"), 4);
dCBM2 = Add(dCBM2, this.storeBodyList.getAt(i).get("CBM"), 4);
}
var selections = this.gridListMain.getSelectionModel().getSelection();
if (selections.length > 0) {
var sCTN_ID = selections[0].data.CTN_ID;
var iPKGS = selections[0].data.PKGS;
var sKINDPKGS = selections[0].data.KINDPKGS;
var dKGS = selections[0].data.KGS;
var dCBM = selections[0].data.CBM;
iPKGS = iPKGS - iPKGS2;
dKGS = Add(dKGS, -dKGS2, 4);
dCBM = Add(dCBM, -dCBM2, 4);
var record = Ext.create('MsOpCtnDetail', {
GID: '*',
CTN_ID: sCTN_ID,
PKGS: iPKGS,
KINDPKGS: sKINDPKGS,
KGS: dKGS,
CBM: dCBM,
HSCODE: '',
DESCRIPTION: descrip,
MARKS: sMARKS
});
this.storeBodyList.add(record);
var n = this.storeBodyList.getCount();
this.gridListCellEditing.startEditByPosition({ row: n - 1, column: 2 });
}
else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QINGXUANZEJIZHUANGXIANG, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
}
},
onImportCtnDetailClick: function (button, event) {
var selections = this.gridListMain.getSelectionModel().getSelection();
if (selections.length > 0) {
var sCTN_ID = selections[0].data.CTN_ID;
}
else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QINGXUANZEJIZHUANGXIANG, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
}
var condition = " CTN_ID='" + sCTN_ID + "'";
me = this;
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 20,
frame: true,
autoScroll: false,
border: false,
fileUpload: true,
items: [{
xtype: 'fileuploadfield',
id: 'LoadExcel',
name: 'LoadExcel',
2 years ago
emptyText: Zi.LAN.LoadExcel,
3 years ago
fieldLabel: 'EXCEL',
2 years ago
buttonText: Zi.LAN.LoadExcel2,
3 years ago
allowBlank: false,
width: 200,
buttonCfg:
{
iconCls: 'uploaddialog'
},
anchor: '98%'
}],
buttons: [{
2 years ago
text: Zi.LAN.submit,
3 years ago
type: 'submit',
handler: function () {
var UserFilePath = Ext.getCmp('LoadExcel').getValue();
if (!CheckFileExt(UserFilePath, /.xls|.xlsx/i)) {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: Zi.LAN.QingQueRenNiShangChuanDeWenJianWeiEXCELWenJian, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
return;
}
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/MvcShipping/MsOpSeae/ImportCtnDetail',
waitMsg: '正在上传',
method: 'POST',
params: {
CTN_ID: sCTN_ID
},
success: function (form, action) {
win.close(this);
2 years ago
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.ShangChuanChengGong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
me.storeBodyList.load({ params: { condition: condition} });
},
failure: function (form, action) {
form.reset();
if (action.failureType == Ext.form.Action.SERVER_INVALID)
2 years ago
Ext.MessageBox.alert(Zi.LAN.JingGao, action.result.errors.msg);
3 years ago
}
});
}
}, {
2 years ago
text: Zi.LAN.GuanBi,
3 years ago
type: 'submit',
handler: function () {
win.close(this);
}
}]
});
var win = new Ext.Window({
2 years ago
title: Zi.LAN.ShangChuanEXCEL ,
3 years ago
width: 380,
height: 120,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
return;
},
//#endregion
//#region 删除明细
onDelDetailClick: function (button, event) {
var selections = this.gridListMain.getSelectionModel().getSelection();
var sCTN_ID = selections[0].data.CTN_ID;
var selectedRecords = this.gridList.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.GID == "" || rec.data.GID == "*")//如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeBodyList.remove(selectedRecords[i]);
}
else {
2 years ago
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
3 years ago
if (btn == 'yes') {
2 years ago
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
3 years ago
Ext.Ajax.request({
2 years ago
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
3 years ago
url: '/MvcShipping/MsOpSeae/DeleteOpCtnDetail',
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);
this.storeBodyList.load({ params: { condition: "CTN_ID='" + sCTN_ID + "'" }, scope: this });
2 years ago
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
}
else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
3 years ago
}
}
},
failure: function (response, options) {
2 years ago
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
},
scope: this
});
}
}, this);
}
}
},
//#endregion
//#region 打印
Print: function () {
var billNo = this.editRecord.data.BSNO.toString();
var selectedRecords = this.gridListMain.getSelectionModel().getSelection();
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('CTN_ID') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
if (feeGidSql == '') feeGidSql = 'aaaaa'
var printType = 'MSOPSEAECTNDETAIL';
var sql1 = "SET LANGUAGE 'us_english' SELECT d.CTN_ID,d.PKGS,d.KINDPKGS,d.KGS,d.CBM,d.HSCODE,d.DESCRIPTION,d.MARKS,c.CNTRNO,c.SEALNO,b.MBLNO,c.BSNO FROM op_ctn_detail d left join op_ctn c on (c.CTN_ID=d.CTN_ID) left join op_seae b on (b.BSNO=c.BSNO) WHERE c.BSNO = '" + billNo + "' order by d.CTN_ID,d.ID ";
var sql2 = "SET LANGUAGE 'us_english' SELECT d.CTN_ID,d.PKGS,d.KINDPKGS,d.KGS,d.CBM,d.HSCODE,d.DESCRIPTION,d.MARKS,c.CNTRNO,c.SEALNO,b.MBLNO,c.BSNO FROM op_ctn_detail d left join op_ctn c on (c.CTN_ID=d.CTN_ID) left join op_seae b on (b.BSNO=c.BSNO) WHERE c.BSNO = '" + billNo + "' AND c.CTN_ID IN (" + feeGidSql + ") order by d.CTN_ID,d.ID ";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, '');
},
//#endregion
//#region 判断一行字符数是否超标
SetShipperLable: function (fieldname, len) {
var basicForm = this.formEdit.getForm();
var field = basicForm.findField(fieldname);
var SHIPPERSTR = Ext.getCmp(fieldname + 'STR');
var str = Billstrnum(field.getValue(), len);
SHIPPERSTR.setText(str, false);
}
//#endregion
});