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/MsOpLetter/MsOpPcLSEdit.js

1804 lines
69 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
Shipping.MsOpPcLSEdit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpPcLSEdit.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpPcLSEdit, Ext.Panel, {
ParentWin: null,
OpStatus: 'add',
StoreList: null,
editRecord: null,
Editdata: null,
MainEditRecord: null,
oplb: '',
initUIComponents: function () {
this.serialNo = 0;
//this.bodyDel = [];
this.itemindex = 1;
var mainform = window.parent.panelEdit;
this.MainEditRecord = mainform.editRecord;
this.BsNo = this.MainEditRecord.get('BSNO');
this.oplb = mainform.stroplb;
Ext.define('PCmb', {
extend: 'Ext.data.Model',
idProperty: '',
fields: [
{ name: 'ywType', type: 'string' },
{ name: 'PcBillType', type: 'string' },
{ name: 'PcBillTypeREF', type: 'string' },
{ name: 'timeMark', type: 'string' },
{ name: 'gId', type: 'string' },
{ name: 'PGid', type: 'string' },
{ name: 'BLTYPE', type: 'string' },
{ name: 'RowNumber', type: 'string' },
{ name: 'BillNo', type: 'string' },
{ name: 'ExpDate', type: 'date', dateFormat: 'Y-m-d H:i:s' },
{ name: 'GroupDate', type: 'string' },
{ name: 'ArriveDate', type: 'string' },
{ name: 'ReturnDate', type: 'string' },
{ name: 'CustomerName', type: 'string' },
{ name: 'F_CustomerName', type: 'string' },
{ name: 'DrvName', type: 'string' },
{ name: 'TruckNo', type: 'string' },
{ name: 'MblNo', type: 'string' },
{ name: 'LinkMan', type: 'string' },
{ name: 'DstArea', type: 'string' },
{ name: 'DetiNation', type: 'string' },
{ name: 'ContainerQty', type: 'string' },
{ name: 'ContainerNo', type: 'string' },
{ name: 'SealNo', type: 'string' },
{ name: 'GOODSCOUNT', type: 'string' },
{ name: 'Ton', type: 'string' },
{ name: 'CBM', type: 'string' },
{ name: 'LoadCount', type: 'string' },
{ name: 'LoadPlace', type: 'string' },
{ name: 'TruckSpec', type: 'string' },
{ name: 'IsDouble', type: 'string' },
{ name: 'Property', type: 'string' },
{ name: 'YUNFEI', type: 'string' },
{ name: 'HCHJ', type: 'string' },
{ name: 'ZXF', type: 'string' },
{ name: 'DDF', type: 'string' },
{ name: 'QTFee', type: 'string' },
{ name: 'TotalFee', type: 'string' },
{ name: 'Remark', type: 'string' },
{ name: 'FEESTATUS', type: 'string' },
{ name: 'UserCode', type: 'string' },
{ name: 'UserName', type: 'string' },
{ name: 'OrgName', type: 'string' },
{ name: 'LrDate', type: 'string' },
{ name: 'PCSTATUSREF', type: 'string' },
{ name: 'RefBillNo', type: 'string' },
{ name: 'RefBillNose', type: 'string' },
{ name: 'MblNoSe', type: 'string' },
{ name: 'ContainerType', type: 'string' },
{ name: 'LinkTel', type: 'string' },
{ name: 'YardName', type: 'string' },
{ name: 'LinkManSe', type: 'string' },
{ name: 'LinkTelSe', type: 'string' },
{ name: 'RtnYardName', type: 'string' },
{ name: 'BsType', type: 'string' },
{ name: 'CustName', type: 'string' },
{ name: 'CustLikeManName', type: 'string' },
{ name: 'CustTel', type: 'string' },
{ name: 'ChangedReson', type: 'string' },
{ name: 'RoadFee', type: 'number' },
{ name: 'INVOICENO', type: 'string' },
{ name: 'KINDPKGS', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'GoodsName', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'DESTINATION', type: 'string' },
{ name: 'FactoryAddr', type: 'string' }
]
});
Ext.define('Tradermb', {
extend: 'Ext.data.Model',
idProperty: 'gid',
fields: [
{ name: 'gid', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'codename', type: 'string' }
]
});
//权限范围
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modOrderManagement"} });
this.storeFM = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserLinkRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
//客户加载_车队
this.storeTRUCKER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeTRUCKER.load({ params: { condition: "ISTRUCK='1'"} });
//车队
this.comboxTRUCKER = Ext.create('DsExt.ux.RefTableCombox', {
2 years ago
fieldLabel: Zi.LAN.TRUCKER,
2 years ago
store: this.storeTRUCKER,
name: 'HEAD_TO',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
this.formEdit.getForm().findField('F_CustomerName').setValue(combo.value);
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
this.storeInfoClientContact.load({ params: { condition: s },
callback: function (r, options, success) {
if (success) {
if (this.storeInfoClientContact.getCount() > 0) {
var member = this.storeInfoClientContact.getAt(0);
this.comboxInfoClientContact.setValue(member.data.SHOWNAME);
this.formHead.getForm().findField('HEAD_ATTNTEL').setValue(member.data.TEL);
this.formHead.getForm().findField('HEAD_ATTNFAX').setValue(member.data.FAX);
} else {
this.comboxInfoClientContact.setValue('');
this.formHead.getForm().findField('HEAD_ATTNTEL').setValue('');
this.formHead.getForm().findField('HEAD_ATTNFAX').setValue('');
}
}
},
scope: this
});
}
}
}
});
//委托单位_联系人
this.storeInfoClientContact = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.InfoClientContactModel',
proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' }
});
this.comboxInfoClientContact = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: 'ATTN',
store: this.storeInfoClientContact,
name: 'HEAD_ATTN',
valueField: 'SHOWNAME',
displayField: 'SHOWNAME',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var Cargoinforecords = DsStoreQueryBy(this.storeInfoClientContact, 'GID', records[0].data.GID);
if (Cargoinforecords.getCount() > 0) {
var Cargoinfodata = Cargoinforecords.getAt(0).data;
this.formHead.getForm().findField('HEAD_ATTNTEL').setValue(Cargoinfodata.TEL);
this.formHead.getForm().findField('HEAD_ATTNFAX').setValue(Cargoinfodata.FAX);
} else {
// this.formHead.getForm().findField('HEAD_ATTNTEL').setValue('');
// this.formHead.getForm().findField('HEAD_ATTNFAX').setValue('');
}
}
}
}
});
this.StoreTRUCKSTATUS = Ext.create('Ext.data.Store', {
2 years ago
fields: ['BLTYPE', 'DISPLAYNAME']
2 years ago
});
2 years ago
this.StoreTRUCKSTATUS.add({ "BLTYPE": "待派车", "DISPLAYNAME": Zi.LAN.DPCHE });
this.StoreTRUCKSTATUS.add({ "BLTYPE": "接单", "DISPLAYNAME": Zi.LAN.JIEDAN});
this.StoreTRUCKSTATUS.add({ "BLTYPE": "派车", "DISPLAYNAME": Zi.LAN.PAICHE});
this.StoreTRUCKSTATUS.add({ "BLTYPE": "完成", "DISPLAYNAME": Zi.LAN.WANCHENG});
2 years ago
this.comboxTRUCKSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
2 years ago
fieldLabel: Zi.LAN.TRUCKSTATUS,
2 years ago
store: this.StoreTRUCKSTATUS,
forceSelection: true,
name: 'PCSTATUSREF',
valueField: 'BLTYPE',
2 years ago
displayField: 'DISPLAYNAME',
2 years ago
value: '待派车'
});
this.storePcBillType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storePcBillType.load({ params: { enumTypeId: 99046} });
this.comboxPcBillType = Ext.create('DsExt.ux.RefEnumCombox', {
2 years ago
fieldLabel: Zi.LAN.PcBillType,
2 years ago
store: this.storePcBillType,
forceSelection: true,
name: 'PcBillType'
});
this.StoreBLTYPE = Ext.create('Ext.data.Store', {
2 years ago
fields: ['BLTYPE', 'DISPLAYNAME']
2 years ago
});
2 years ago
this.StoreBLTYPE.add({ "BLTYPE": "派车主票", "DISPLAYNAME": Zi.LAN.PCZD});
this.StoreBLTYPE.add({ "BLTYPE": "派车分票", "DISPLAYNAME": Zi.LAN.PCFD });
this.StoreBLTYPE.add({ "BLTYPE": "派车单票", "DISPLAYNAME": Zi.LAN.PCDP});
2 years ago
this.comboxBLTYPE = Ext.create('DsExt.ux.RefTableCombox', {
2 years ago
fieldLabel: Zi.LAN.PCBLTYPE,
2 years ago
store: this.StoreBLTYPE,
forceSelection: true,
name: 'BLTYPE',
valueField: 'BLTYPE',
2 years ago
displayField: 'DISPLAYNAME',
2 years ago
value: '派车单票'
});
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'PCmb',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/PcHeadEdit_WFSD/GetDataList',
reader: {
id: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.girdcolums = [{
sortable: true, hidden: true,
dataIndex: 'PcBillType',
header: 'PcBillType',
width: 80
},
{
sortable: true,
dataIndex: 'LrDate',
2 years ago
header: Zi.LAN.INPUTTIME ,
2 years ago
width: 110
},
{
sortable: true,
dataIndex: 'FactoryAddr',
2 years ago
header: Zi.LAN.companyname2,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'PcBillTypeREF',
2 years ago
header: Zi.LAN.PcBillType,
2 years ago
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'UserCode',
header: 'UserCode',
width: 80
},
{
sortable: true,
dataIndex: 'UserName',
2 years ago
header: Zi.LAN.UserName,
2 years ago
width: 80
}, {
sortable: true,
dataIndex: 'PCSTATUSREF',
2 years ago
header: Zi.LAN.TRUCKSTATUS ,
2 years ago
width: 50,
renderer: function (value) {
if (value == "接单") {
2 years ago
value = Zi.LAN.JIEDAN;
2 years ago
return "<a><font color='#333333'>" + value + "</font></a>";
} else if (value == "派车") {
2 years ago
value = Zi.LAN.PAICHE;
2 years ago
return "<a><font color='#0000FF'>" + value + "</font></a>";
} else if (value == "完成") {
2 years ago
value = Zi.LAN.WANCHENG;
2 years ago
return "<a><font color='#00FF00'>" + value + "</font></a>";
}
}
},
{
sortable: true, hidden: true,
dataIndex: 'timeMark',
header: 'timeMark',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'gId',
header: 'gId',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'FEESTATUS',
header: '费用锁定',
width: 80
},
{
sortable: true,
dataIndex: 'RowNumber',
2 years ago
header: Zi.LAN.RowNumber,
2 years ago
width: 60,
align: 'center'
},
{
sortable: true,
dataIndex: 'BillNo',
2 years ago
header: Zi.LAN.BillNo,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'ExpDate',
2 years ago
header: Zi.LAN.TRUCKDATE,
2 years ago
width: 160,
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s')
},
{
sortable: true,
dataIndex: 'GroupDate',
2 years ago
header: Zi.LAN.GroupDate,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'ArriveDate',
2 years ago
header: Zi.LAN.ArriveDate,
2 years ago
width: 80,
renderer: Ext.util.Format.dateRenderer('Y-m-d')
},
{
sortable: true,
dataIndex: 'ReturnDate',
2 years ago
header: Zi.LAN.ReturnDate,
2 years ago
width: 80,
renderer: Ext.util.Format.dateRenderer('Y-m-d')
},
{
sortable: true,
dataIndex: 'CustomerName',
2 years ago
header: Zi.LAN.CUSTOMERNAME,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'CustName',
2 years ago
header: Zi.LAN.CustName,
2 years ago
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'F_CustomerName',
2 years ago
header: Zi.LAN.TRUCKER,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'TruckNo',
2 years ago
header: Zi.LAN.TruckNo,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'MblNo',
2 years ago
header: Zi.LAN.MBLNO,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'BsType',
2 years ago
header: Zi.LAN.BsType,
2 years ago
width: 110
},
{
sortable: true,
dataIndex: 'DstArea',
2 years ago
header: Zi.LAN.DstArea,
2 years ago
width: 120
},
{
sortable: true,
dataIndex: 'DetiNation',
2 years ago
header: Zi.LAN.FACTRYADDR,
2 years ago
width: 120
},
{
sortable: true,
dataIndex: 'ContainerQty',
2 years ago
header: Zi.LAN.CTNS,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'GOODSCOUNT',
2 years ago
header: Zi.LAN.GOODSCOUNT,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'Ton',
2 years ago
header: Zi.LAN.Ton,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'CBM',
2 years ago
header: Zi.LAN.CBM,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'LoadPlace',
2 years ago
header: Zi.LAN.LoadPlace ,
2 years ago
width: 80
},
{
sortable: true,
dataIndex: 'TruckSpec',
2 years ago
header: Zi.LAN.TruckSpec,
2 years ago
width: 80
}
];
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'west',
width: 300,
2 years ago
loadMask: { msg: Zi.LAN.ZhengZaiChaXunShuJu },
2 years ago
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolums,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
2 years ago
displayMsg: Zi.LAN.displayMsg,
emptyMsg: Zi.LAN.emptyMsg
2 years ago
})
});
_this = this;
this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) {
_this.editRecord = record;
_this.OpStatus = 'edit';
_this.LoadData("edit", "BillNo='" + record.data.BillNo + "'", record.data.RefBillNose);
}, this);
this.storeList.on('beforeload', function (store) {
var sql = " RefBillNo='" + this.BsNo + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
//#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: '业务编号',
name: 'BSNO', hidden: true
}, {
fieldLabel: 'LE_ID',
hidden: true,
name: 'LE_ID'
}, {
fieldLabel: 'INPUTTIME',
hidden: true,
name: 'INPUTTIME'
}, {
fieldLabel: 'LETTERNAME',
hidden: true,
name: 'LETTERNAME',
value: '派车通知'
}, this.comboxTRUCKER]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxInfoClientContact, {
2 years ago
fieldLabel: Zi.LAN.HEAD_ATTNTEL,
2 years ago
name: 'HEAD_ATTNTEL'
}, {
2 years ago
fieldLabel: Zi.LAN.HEAD_ATTNFAX,
2 years ago
name: 'HEAD_ATTNFAX'
}, { xtype: 'hiddenfield'}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: 'FROM',
name: 'INPUTBY'
}, {
2 years ago
fieldLabel: Zi.LAN.HEAD_FMTEL,
2 years ago
name: 'HEAD_FMTEL'
}, {
2 years ago
fieldLabel: Zi.LAN.HEAD_FMFAX,
2 years ago
name: 'HEAD_FMFAX'
}, {
fieldLabel: 'EMAIL',
name: 'HEAD_FMEMAIL'
}]
}
]//end items(fieldset 1)
}); //end this.formEdit
//#endregion
//客户加载_场站
this.storeYARD = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomYardRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomYardRefList' }
});
this.storeYARD.load({ params: { condition: "ISYARD='1'"} });
//船公司
2 years ago
var yardname = Zi.LAN.YARD;
2 years ago
if (this.oplb == "海运进口" || this.oplb == "空运进口") {
2 years ago
yardname = Zi.LAN.TXMT
2 years ago
}
this.comboxYARD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: yardname,
store: this.storeYARD,
forceSelection: true,
name: 'YardName',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var data = combo.value;
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
this.storeInfoClientContactYard.load({ params: { condition: s },
callback: function (r, options, success) {
if (success) {
if (this.storeInfoClientContactYard.getCount() > 0) {
var member = this.storeInfoClientContactYard.getAt(0);
this.comboxInfoClientContactYard.setValue(member.data.SHOWNAME);
this.formEdit.getForm().findField('LinkTel').setValue(member.data.TEL);
} else {
this.comboxInfoClientContactYard.setValue('');
this.formEdit.getForm().findField('LinkTel').setValue('');
}
}
},
scope: this
});
}
}
}
});
//委托单位_联系人
this.storeInfoClientContactYard = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.InfoClientContactModel',
proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' }
});
this.comboxInfoClientContactYard = Ext.create('DsExt.ux.RefTableCombox', {
2 years ago
fieldLabel: Zi.LAN.YARDATTN,
2 years ago
store: this.storeInfoClientContactYard,
name: 'LinkMan',
valueField: 'SHOWNAME',
displayField: 'SHOWNAME',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
this.formEdit.getForm().findField('LinkTelSe').setValue(records[0].data.TEL);
}
}
}
});
//客户加载_场站
this.storeYARD2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomYardRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomYardRefList' }
});
this.storeYARD2.load({ params: { condition: "ISYARD='1'"} });
//船公司
this.comboxYARD2 = Ext.create('DsExt.ux.RefTableCombox', {
2 years ago
fieldLabel: Zi.LAN.RETURNYARD,
2 years ago
store: this.storeYARD,
forceSelection: true,
name: 'RtnYardName',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var data = combo.value;
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + combo.value + "')";
this.storeInfoClientContactYard2.load({ params: { condition: s },
callback: function (r, options, success) {
if (success) {
if (this.storeInfoClientContactYard2.getCount() > 0) {
var member = this.storeInfoClientContactYard2.getAt(0);
this.comboxInfoClientContactYard2.setValue(member.data.SHOWNAME);
this.formEdit.getForm().findField('LinkTelSe').setValue(member.data.TEL);
} else {
this.comboxInfoClientContactYard2.setValue('');
this.formEdit.getForm().findField('LinkTelSe').setValue('');
}
}
},
scope: this
});
}
}
}
});
//委托单位_联系人
this.storeInfoClientContactYard2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.InfoClientContactModel',
proxy: { url: '/CommMng/BasicDataRef/GetInfoClientContactList' }
});
this.comboxInfoClientContactYard2 = Ext.create('DsExt.ux.RefTableCombox', {
2 years ago
fieldLabel: Zi.LAN.YARDATTN,
2 years ago
store: this.storeInfoClientContactYard2,
name: 'LinkManSe',
valueField: 'SHOWNAME',
displayField: 'SHOWNAME',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
this.formEdit.getForm().findField('LinkTelSe').setValue(records[0].data.TEL);
}
}
}
});
2 years ago
var companyname = Zi.LAN.companyname ;
2 years ago
if (this.oplb == "海运进口" || this.oplb == "空运进口") {
2 years ago
companyname = Zi.LAN.companyname2
2 years ago
}
//客户加载_工厂
this.storeFactry = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCodeFactry',
proxy: { url: '/MvcShipping/MsCodeFactry/GetDataList' }
});
this.storeFactry.load();
//工厂
this.comboxFactry = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel:companyname,
store: this.storeFactry,
name: 'FactoryAddr',
valueField: 'FACTRYNAME',
displayField: 'CodeAndName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var DetiNation = this.formEdit.getForm().findField('DetiNation');
DetiNation.setValue(records[0].data.FACTRYADDR);
var CustLikeManName = this.formEdit.getForm().findField('CustLikeManName');
CustLikeManName.setValue(records[0].data.FACTRYATTN);
var CustTel = this.formEdit.getForm().findField('CustTel');
CustTel.setValue(records[0].data.FACTRYTEL);
}
}
}
});
this.storeContainerType = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CtnRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCtnRefList' }
});
this.storeContainerType.load({ params: { condition: "" } });
this.comboxContainerType = Ext.create('DsExt.ux.RefTableCombox', {
2 years ago
fieldLabel: Zi.LAN.CTNALL,
2 years ago
store: this.storeContainerType,
name: 'ContainerType',
valueField: 'CtnCode',
displayField: 'CtnName', flex: 0.6//CtnName
, labelWidth: 30
});
//#region 编辑formEdit 派车通知
this.formEdit = Ext.widget('form', {
region: 'north',
height: 460,
frame: true,
bodyPadding: 5,
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: 'UserCode',
name: 'UserCode', hidden: true
}, {
fieldLabel: 'UserName',
name: 'UserName', hidden: true
}, {
fieldLabel: 'OrgCode',
name: 'OrgCode', hidden: true
}, {
fieldLabel: 'OrgName',
name: 'OrgName', hidden: true
}, {
fieldLabel: 'RefBillNose',
hidden: true,
name: 'RefBillNose'
}, {
fieldLabel: 'RefBillNo',
hidden: true,
name: 'RefBillNo'
}, {
fieldLabel: 'BsType',
hidden: true,
name: 'BsType'
}, {
fieldLabel: 'gId',
hidden: true,
name: 'gId'
}, {
fieldLabel: 'PGid',
hidden: true,
name: 'PGid'
}, {
fieldLabel: 'LrDate',
hidden: true,
name: 'LrDate'
}, {
fieldLabel: 'MblNo',
hidden: true,
name: 'MblNo'
}, {
fieldLabel: 'MblNoSe',
hidden: true,
name: 'MblNoSe'
}, {
fieldLabel: 'EtDate',
hidden: true,
name: 'EtDate'
}, {
fieldLabel: 'VoyVeg',
hidden: true,
name: 'VoyVeg'
}, {
fieldLabel: 'CustomerName',
hidden: true,
name: 'CustomerName'
}, {
fieldLabel: 'FEESTATUS',
hidden: true,
name: 'FEESTATUS'
}
, {
2 years ago
fieldLabel: Zi.LAN.BillNo,
2 years ago
readOnly: true,
name: 'BillNo'
}
, this.comboxPcBillType
, this.comboxContainerType, {
2 years ago
fieldLabel: Zi.LAN.CTNNUM ,
2 years ago
flex: 0.4,
labelWidth: 30,
name: 'ContainerQty'
}
, {
2 years ago
fieldLabel: Zi.LAN.ContainerTypeSe,
2 years ago
//hidden: true,
//flex: 0.6,
labelWidth:55,
name: 'ContainerTypeSe'
}, {
2 years ago
fieldLabel: Zi.LAN.TRUCKFEE,
2 years ago
xtype: 'numberfield',
name: 'RoadFee',
value: 0
}
]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxYARD, this.comboxInfoClientContactYard, {
2 years ago
fieldLabel: Zi.LAN.TEL ,
2 years ago
name: 'LinkTel'
}, this.comboxBLTYPE]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxFactry, {
2 years ago
fieldLabel: Zi.LAN.TRUCKDATE,
2 years ago
format: 'Y-m-d',
flex: 1,
xtype: 'datetimefield',
name: 'ExpDate'
}, {
2 years ago
fieldLabel: Zi.LAN.TruckNo,
2 years ago
name: 'TruckNo'
}, this.comboxTRUCKSTATUS]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
2 years ago
fieldLabel: Zi.LAN.FACTRYADDR,
2 years ago
name: 'DetiNation'
}, {
2 years ago
fieldLabel: Zi.LAN.ArriveDate,
2 years ago
//labelWidth: 80,
format: 'Y-m-d',
flex: 1,
xtype: 'datetimefield',
name: 'ArriveDate'
}]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
2 years ago
fieldLabel: Zi.LAN.FACTRYATTN ,
2 years ago
name: 'CustLikeManName'
}, {
2 years ago
fieldLabel: Zi.LAN.FACTRYTEL,
2 years ago
name: 'CustTel'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
2 years ago
fieldLabel: Zi.LAN.GoodsName ,
2 years ago
name: 'GoodsName'
}, {
2 years ago
fieldLabel: Zi.LAN.TRUCKER ,
2 years ago
readOnly:true,
name: 'F_CustomerName'
}, {
2 years ago
fieldLabel: Zi.LAN.PORTLOAD,
2 years ago
name: 'PORTLOAD'
}, {
2 years ago
fieldLabel: Zi.LAN.PORTDISCHARGE,
2 years ago
name: 'DESTINATION'
}]
}
, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxYARD2, this.comboxInfoClientContactYard2, {
2 years ago
fieldLabel: Zi.LAN.TEL,
2 years ago
name: 'LinkTelSe'
}, {
2 years ago
fieldLabel: Zi.LAN.ReturnDate, labelWidth: 80,
2 years ago
format: 'Y-m-d',
flex: 1,
xtype: 'datetimefield',
name: 'ReturnDate'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
2 years ago
fieldLabel: Zi.LAN.ContainerNo,
2 years ago
name: 'ContainerNo'
}, {
2 years ago
fieldLabel: Zi.LAN.SealNo ,
2 years ago
name: 'SealNo'
}, {
2 years ago
fieldLabel: Zi.LAN.GOODSCOUNT,
2 years ago
name: 'GOODSCOUNT',
anchor: '100%'
}, {
2 years ago
fieldLabel: Zi.LAN.Ton,
2 years ago
name: 'Ton',
anchor: '100%'
}, {
2 years ago
fieldLabel: Zi.LAN.CBM ,
2 years ago
name: 'CBM',
anchor: '100%'
}]
}
, {
xtype: 'textareafield',
grow: true,
2 years ago
fieldLabel: Zi.LAN.TRUCKDETAIL ,
2 years ago
height: 60,
name: 'ChangedReson',
anchor: '100%'
}, {
xtype: 'textareafield',
grow: true,
2 years ago
fieldLabel: Zi.LAN.REMARK,
2 years ago
height: 40,
name: 'Remark',
anchor: '100%'
}, {
xtype: 'textfield', hidden: true,
fieldLabel: '发票号',
name: 'INVOICENO',
anchor: '100%'
}, {
xtype: 'textfield', hidden: true,
fieldLabel: '运单号',
name: 'CUSTNO',
anchor: '100%'
}, {
xtype: 'textfield', hidden: true,
fieldLabel: '包装',
name: 'KINDPKGS',
anchor: '100%'
}, {
xtype: 'textfield', hidden: true,
fieldLabel: '截港日期',
name: 'EndPortDate',
anchor: '100%'
}
]//end items(fieldset 1)
}); //end this.formEdit
//#endregion
//#region 按钮Toolbar
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
2 years ago
text: Zi.LAN.btnNew ,
2 years ago
handler: function (button, event) {
this.LoadData('add', '');
},
scope: this
}, '-', {
id: 'btnESave',
2 years ago
text: Zi.LAN.btnESave,
2 years ago
iconCls: "btnsave",
handler: function (button, event) {
this.Save('0');
},
scope: this
}, {
id: 'btnESaveAndNew',
2 years ago
text: Zi.LAN.btnESaveAndNew,
2 years ago
handler: function (button, event) {
this.Save('2');
},
scope: this
}, '-', {
id: 'btnCtnFen',
2 years ago
text: Zi.LAN.CtnFen,
2 years ago
handler: function (button, event) {
this.CtnFen();
},
scope: this
}, '-', {
2 years ago
text: Zi.LAN.LoadInt ,
tooltip: Zi.LAN.LoadInt ,
2 years ago
iconCls: "btnrefresh",
handler: function (button, event) {
var billno=this.formEdit.getForm().findField('BillNo').getValue();
var LE_ID=this.formHead.getForm().findField('LE_ID').getValue();
this.LoadData("edit", "BillNo='" +billno+ "'",LE_ID);
},
scope: this
}, '-',
{
2 years ago
text: Zi.LAN.btnDelete,
2 years ago
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-', {
2 years ago
text: Zi.LAN.Print,
2 years ago
iconCls: "btnprint",
handler: function (button, event) {
this.Print();
},
scope: this
}]
}); //end 按钮Toolbar
//#endregion
//#region 框架结构
this.panelpage = new Ext.Panel({
2 years ago
title: Zi.LAN.PCDETAIL,
2 years ago
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formEdit]
});
this.paneltruckdetail = new Ext.Panel({
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formHead, this.panelpage]
});
Ext.apply(this, {
items: [this.panelBtn, this.gridList, this.paneltruckdetail]
});
//#endregion
//#region 其他
parentWin = window.parent.opener;
this.InitData();
//#endregion
}, //end initUIComponents
//#region 加载事件
InitData: function () {
this.opStatus = 'add';
var condition = '';
_this = this;
this.storeList.load({ params: { condition: "RefBillNo='" + this.BsNo + "'" },
callback: function (r, options, success) {
if (success) {
if (this.storeList.getCount() > 0) {
var member = this.storeList.getAt(0);
_this.LoadData("edit", "BillNo='" + member.data.BillNo + "'", member.data.RefBillNose);
} else {
_this.LoadData('add', '', '');
}
}
},
scope: this
});
}, //end InitData
LoadData: function (opstatus, condition, le_id) {
this.serialNo = 0;
//this.bodyDel = [];
this.opStatus = opstatus;
if (this.opStatus == 'add') {
this.formHead.getForm().reset();
this.formHead.getForm().findField('HEAD_TO').setValue(this.MainEditRecord.get('TRUCKER'));
this.formHead.getForm().findField('BSNO').setValue(this.MainEditRecord.get('BSNO'));
var trucker = this.MainEditRecord.get('TRUCKER');
if (trucker != '') {
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + trucker + "')";
this.storeInfoClientContact.load({ params: { condition: s },
callback: function (r, options, success) {
if (success) {
if (this.storeInfoClientContact.getCount() > 0) {
var member = this.storeInfoClientContact.getAt(0);
this.comboxInfoClientContact.setValue(member.data.SHOWNAME);
this.formHead.getForm().findField('HEAD_ATTNTEL').setValue(member.data.TEL);
this.formHead.getForm().findField('HEAD_ATTNFAX').setValue(member.data.FAX);
}
}
},
scope: this
});
}
this.formHead.getForm().findField('INPUTBY').setValue(SHOWNAME);
this.storeFM.load({ params: { condition: '' },
callback: function (r, options, success) {
if (success) {
if (this.storeFM.getCount() > 0) {
var Cargoinforecords = DsStoreQueryBy(this.storeFM, 'UserName', SHOWNAME);
if (Cargoinforecords.getCount() > 0) {
var Cargoinfodata = Cargoinforecords.getAt(0).data;
this.formHead.getForm().findField('HEAD_FMTEL').setValue(Cargoinfodata.Tel);
this.formHead.getForm().findField('HEAD_FMFAX').setValue(Cargoinfodata.Fax);
this.formHead.getForm().findField('HEAD_FMEMAIL').setValue(Cargoinfodata.Email);
} else {
}
}
}
},
scope: this
});
this.formEdit.getForm().reset();
var yard = this.MainEditRecord.get('YARD');
this.formEdit.getForm().findField('YardName').setValue(yard);
this.formEdit.getForm().findField('RtnYardName').setValue(yard);
if (yard != '') {
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + yard + "')";
this.storeInfoClientContactYard2.load({ params: { condition: s },
callback: function (r, options, success) {
if (success) {
if (this.storeInfoClientContactYard2.getCount() > 0) {
var member = this.storeInfoClientContactYard2.getAt(0);
this.formEdit.getForm().findField('LinkManSe').setValue(member.data.SHOWNAME);
this.formEdit.getForm().findField('LinkTelSe').setValue(member.data.TEL);
this.formEdit.getForm().findField('LinkMan').setValue(member.data.SHOWNAME);
this.formEdit.getForm().findField('LinkTel').setValue(member.data.TEL);
} else {
this.formEdit.getForm().findField('LinkManSe').setValue('');
this.formEdit.getForm().findField('LinkTelSe').setValue('');
this.formEdit.getForm().findField('LinkMan').setValue('');
this.formEdit.getForm().findField('LinkTel').setValue('');
}
}
},
scope: this
});
this.storeInfoClientContactYard.load({ params: { condition: s} });
}
this.formEdit.getForm().findField('Remark').setValue('');
if (this.oplb == '海运出口' || this.oplb == '海运进口') {
this.formEdit.getForm().findField('VoyVeg').setValue(this.MainEditRecord.get('VESSEL') + ' ' + this.MainEditRecord.get('VOYNO'));
this.formEdit.getForm().findField('ContainerType').setValue(this.MainEditRecord.get('CNTRTOTAL'));
this.formEdit.getForm().findField('ContainerTypeSe').setValue(this.MainEditRecord.get('CNTRTOTAL'));
} else if (this.oplb == '空运出口' || this.oplb == '空运进口') {
this.formEdit.getForm().findField('VoyVeg').setValue(this.MainEditRecord.get('VESSEL'));
}
//SR2020031700001_1 将CUSTNO和MBLNO的存放位置颠倒了一下
this.formEdit.getForm().findField('MblNo').setValue(this.MainEditRecord.get('MBLNO'));
this.formEdit.getForm().findField('MblNoSe').setValue(this.MainEditRecord.get('CUSTNO'));
this.formEdit.getForm().findField('CustomerName').setValue(this.MainEditRecord.get('CUSTOMERNAME'));
_PKGS = this.MainEditRecord.get('PKGS');
if (isNullorEmpty(_PKGS)) _PKGS = 0;
this.formEdit.getForm().findField('GOODSCOUNT').setValue(_PKGS);
_KGS = this.MainEditRecord.get('KGS');
if (isNullorEmpty(_KGS)) _KGS = 0;
this.formEdit.getForm().findField('Ton').setValue(_KGS);
_CBM = this.MainEditRecord.get('CBM');
if (isNullorEmpty(_CBM)) _CBM = 0;
this.formEdit.getForm().findField('CBM').setValue(_CBM);
this.formEdit.getForm().findField('RoadFee').setValue(0);
this.formEdit.getForm().findField('BsType').setValue(this.oplb);
this.formEdit.getForm().findField('PcBillType').setValue('0');
this.formEdit.getForm().findField('EtDate').setValue(this.MainEditRecord.get('ETD'));
this.formEdit.getForm().findField('EndPortDate').setValue(this.MainEditRecord.get('CLOSINGDATE'));
this.formEdit.getForm().findField('PORTLOAD').setValue(this.MainEditRecord.get('PORTLOAD'));
this.formEdit.getForm().findField('DESTINATION').setValue(this.MainEditRecord.get('DESTINATION'));
this.formEdit.getForm().findField('FEESTATUS').setValue('0');
// this.formEdit.getForm().findField('EndPortDate').setValue(this.MainEditRecord.get('CLOSINGDATE'));
this.formEdit.getForm().findField('BillNo').setValue('');
} else {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpLetter/GetData',
params: {
handle: opstatus,
condition: "LE_ID='" + le_id + "'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
2 years ago
title: Zi.LAN.TiShi,
2 years ago
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().findField('CUSTOMERNAME').setValue(this.MainEditRecord.get('CUSTOMERNAME'));
// this.GetEditStatus();
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/TruckMng/PcHeadEdit_WFSD/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({
2 years ago
title: Zi.LAN.TiShi,
2 years ago
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
data = result.data;
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(data);
// this.formEdit.getForm().findField('PcBillType').setValue('1');
this.LoadInit();
// this.GetEditStatus();
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
//20160219 获取业务主表内的件数重量尺码,用于在生成散货派车单时传递
//this.formEdit.getForm().findField('PKGS').setValue(this.MainEditRecord.get('PKGS'));
//this.formEdit.getForm().findField('KGS').setValue(this.MainEditRecord.get('KGS'));
//this.formEdit.getForm().findField('CBM').setValue(this.MainEditRecord.get('CBM'));
}, // end LoadDate
//#endregion
//#region 保存
Save: function (type) {
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
return;
}
var data = this.formHead.getForm().getValues(false, false, false);
var body = this.formEdit.getForm().getValues(false, false, false);
//
2 years ago
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
2 years ago
Ext.Ajax.request({
2 years ago
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
2 years ago
url: '/MvcShipping/MsOpLetter/SaveLSTruck',
scope: this,
params: {
opstatus: this.opStatus,
data: Ext.JSON.encode(data),
body: Ext.JSON.encode(body),
oplb:this.oplb
},
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);
//
if (this.opStatus == 'add') {
var arrNewRecords = this.storeList.add(returnData);
this.editRecord = arrNewRecords[0];
var editp = Ext.create('PCmb', returnData);
this.formHead.getForm().findField('LE_ID').setValue(editp.get('RefBillNose'));
}
else if (this.opStatus == 'edit') {
var editp = Ext.create('PCmb', returnData);
this.editRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editRecord.set(name, editp.get(name));
}
}, this);
this.editRecord.commit();
}
if (type == '0') {
this.opStatus = 'edit';
} else if (type == '1') {
window.close();
} else if (type == '2') {
this.LoadData('add', '');
}
} else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
}
} else {
Ext.Msg.show({ title: '请重试',
2 years ago
msg: Zi.LAN.FuWuQiXiangYingChuCuo,
2 years ago
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
//#endregion
//#region 保存
CtnFen: function () {
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
return;
}
var data = this.formHead.getForm().getValues(false, false, false);
var body = this.formEdit.getForm().getValues(false, false, false);
//
2 years ago
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
2 years ago
Ext.Ajax.request({
2 years ago
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
2 years ago
url: '/MvcShipping/MsOpLetter/SaveLSCtnTruck',
scope: this,
params: {
data: Ext.JSON.encode(data),
body: Ext.JSON.encode(body),
oplb: this.oplb
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.InitData();
} else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
}
} else {
Ext.Msg.show({
title: '请重试',
2 years ago
msg: Zi.LAN.FuWuQiXiangYingChuCuo,
2 years ago
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
//#endregion
SavePC: function () {
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
return;
}
var url = '/MvcShipping/MsOpLetter/SavePC';
if (this.oplb == '空运出口' || this.oplb == '空运出口') {
url = '/MvcShipping/MsOpLetter/SaveAirPC';
}
var TRUCKSTATUS = this.formEdit.getForm().findField('TRUCKSTATUS').getValue();
if (TRUCKSTATUS != "待派车") {
2 years ago
Ext.Msg.show({ title: '警告', msg: Zi.LAN.ZYDTCZTCYXSCPCD, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
return;
}
var data = this.formHead.getForm().getValues(false, false, false);
var body = this.formEdit.getForm().getValues(false, false, false);
var bs = this.MainEditRecord.data;
_this = this;
//
2 years ago
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
2 years ago
Ext.Ajax.request({
2 years ago
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
2 years ago
url: url,
scope: this,
params: {
opstatus: this.opStatus,
data: Ext.JSON.encode(data),
body: Ext.JSON.encode(body),
bs: Ext.JSON.encode(bs),
oplb: _this.oplb
},
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);
if (this.opStatus == 'add') {
// var arrNewRecords = this.StoreList.add(returnData);
this.editRecord = arrNewRecords[0];
var editp = Ext.create('MsOpLetter', returnData);
this.formHead.getForm().findField('LE_ID').setValue(editp.get('LE_ID'));
}
else if (this.opStatus == 'edit') {
var editp = Ext.create('MsOpLetter', 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.opStatus = 'edit';
2 years ago
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
2 years ago
} else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
}
} else {
Ext.Msg.show({ title: '请重试',
2 years ago
msg: Zi.LAN.FuWuQiXiangYingChuCuo,
2 years ago
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
SavePC_SH: function () {
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
return;
}
var url = '/MvcShipping/MsOpLetter/SavePC_SH';
if (this.oplb == '空运出口' || this.oplb == '空运出口') {
url = '/MvcShipping/MsOpLetter/SaveAirPC_SH';
}
var TRUCKSTATUS = this.formEdit.getForm().findField('TRUCKSTATUS').getValue();
if (TRUCKSTATUS != "待派车") {
2 years ago
Ext.Msg.show({ title: '警告', msg: Zi.LAN.ZYDTCZTCYXSCPCD , icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
return;
}
var data = this.formHead.getForm().getValues(false, false, false);
var body = this.formEdit.getForm().getValues(false, false, false);
_this = this;
var bs = this.MainEditRecord.data;
//
2 years ago
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
2 years ago
Ext.Ajax.request({
2 years ago
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
2 years ago
url: url,
scope: this,
params: {
opstatus: this.opStatus,
data: Ext.JSON.encode(data),
body: Ext.JSON.encode(body),
bs: Ext.JSON.encode(bs),
oplb: _this.oplb
},
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.formHead.getForm().reset();
this.formHead.getForm().setValues(returnData);
if (this.opStatus == 'add') {
var arrNewRecords = this.StoreList.add(returnData);
this.editRecord = arrNewRecords[0];
var editp = Ext.create('MsOpLetter', returnData);
this.formEdit.getForm().findField('LE_ID').setValue(editp.get('LE_ID'));
}
else if (this.opStatus == 'edit') {
var editp = Ext.create('MsOpLetter', 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.opStatus = 'edit';
2 years ago
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
2 years ago
} else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
}
} else {
Ext.Msg.show({ title: '请重试',
2 years ago
msg: Zi.LAN.FuWuQiXiangYingChuCuo,
2 years ago
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
2 years ago
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
2 years ago
return;
}
var record = selections[0];
var TRUCKSTATUS = record.data.PCSTATUSREF;
if (TRUCKSTATUS == "派车" || TRUCKSTATUS == "完成") {
2 years ago
Ext.Msg.show({ title: '警告', msg: Zi.LAN.DQZTBYXSC, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
return;
}
2 years ago
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
2 years ago
if (btn == 'yes') {
2 years ago
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
2 years ago
Ext.Ajax.request({
2 years ago
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
2 years ago
url: '/MvcShipping/MsOpLetter/DeleteLS',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.remove(record);
if (this.storeList.getCount() > 0) {
var member = this.storeList.getAt(0);
this.editRecord = member;
this.LoadData("edit", "BillNo='" + member.data.BillNo + "'", member.data.RefBillNose);
} else {
this.LoadData('add', '');
}
2 years ago
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
2 years ago
}
else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
}
}
},
failure: function (response, options) {
2 years ago
Ext.Msg.show({ title: '警告', msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
2 years ago
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}, //onDeleteClick
//#region
LoadInit: function () {
var CUSTOMERNAME = this.MainEditRecord.get('CUSTOMERNAME');
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + CUSTOMERNAME + "')";
this.storeInfoClientContact.load({ params: { condition: s} });
var YARD = this.formEdit.getForm().findField('YardName').getValue();
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + YARD + "')";
this.storeInfoClientContactYard.load({ params: { condition: s} });
var YARD2 = this.formEdit.getForm().findField('RtnYardName').getValue();
var s = " ISOPERATOR=1 and LINKID in (select gid from [info_client] where SHORTNAME='" + YARD2 + "')";
this.storeInfoClientContactYard2.load({ params: { condition: s} });
},
//#endregion
//#region 编辑时按钮等的状态
GetEditStatus: function () {
var canedit = false;
//var bsStatus = this.formHead.getForm().findField('BSSTATUS').getValue();
var BSSTATUS = this.formHead.getForm().findField('BSSTATUSREF').getValue();
var inputby = this.formHead.getForm().findField('INPUTBY').getValue();
var op = this.formHead.getForm().findField('OP').getValue();
_this = this;
if (BSSTATUS == '锁定') {
canedit = false;
this.setSaveBtnStatus(canedit);
} else {
this.StoreOpRange.load({ params: { optype: "modOrderManagement" },
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);
}
}
});
}
},
setSaveBtnStatus: function (enable) {
var btnESave = Ext.getCmp('btnESave');
var btnESaveAndClose = Ext.getCmp('btnESaveAndClose');
var btnESaveAndNew = Ext.getCmp('btnESaveAndNew');
var btnEAddDetail = Ext.getCmp('btnadddetail');
var btnEDeleteDetail = Ext.getCmp('btndeldetail');
var btnCtnFen = Ext.getCmp('btnCtnFen');
if (enable) {
btnESave.enable();
btnESaveAndClose.enable();
btnESaveAndNew.enable();
btnCtnFen.enable();
btnEAddDetail.enable();
btnEDeleteDetail.enable();
} else {
btnESave.disable();
btnESaveAndClose.disable();
btnESaveAndNew.disable();
btnEAddDetail.disable();
btnEDeleteDetail.disable();
btnCtnFen.disable();
}
},
//#endregion
//#region 打印
Print: function () {
var basicForm = this.formHead.getForm();
var le_id = basicForm.findField('LE_ID').value;
var bsNo = basicForm.findField('BSNO').value;
var billNo = this.formEdit.getForm().findField('BillNo').getValue();
if (billNo == '*' || billNo == '' || billNo == NaN) {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: Zi.LAN.pCdmybc , icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
2 years ago
return;
}
var MBLNO = this.MainEditRecord.get('MBLNO') + '派车通知';
var printType = 'MSOPLETTERTRUCKLS';
if (this.oplb == "海运进口") {
printType = 'MSOPLETTERTRUCKSEAILS'
} else if (this.oplb == "空运进口") {
printType = 'MSOPLETTERTRUCKAIRILS'
} else if (this.oplb == "空运出口") {
printType = 'MSOPLETTERTRUCKAIRELS'
}
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_letter WHERE LE_ID = '" + le_id + "'";
var sql2 = "SET LANGUAGE 'us_english' SELECT * FROM tMsWlPcHead WHERE billNo = '" + billNo + "'";
var sql3 = "";
if (this.oplb == "海运进口")
sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_seai WHERE BSNO = '" + bsNo + "'";
else if (this.oplb == "空运进口")
sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_airi WHERE BSNO = '" + bsNo + "'";
else if (this.oplb == "空运出口")
sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_aire WHERE BSNO = '" + bsNo + "'";
else
sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae WHERE BSNO = '" + bsNo + "'";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO, '', '', '', bsNo);
}
// #endregion
});