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/TruckMng/Viewsjs/MsWl_Haier/MsWl_HaierPCEdit.js

196 lines
6.9 KiB
JavaScript

2 years ago
///<reference path="../../../../Views/../TruckMng/Scripts/vswd-ext_2.0.2.js" />
Ext.namespace('DsTruck');
var APPUsing=0;
DsTruck.MsWl_HaierPCEdit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.MsWl_HaierPCEdit.superclass.constructor.call(this);
};
Date.prototype.format = function (format) {
var o = {
"M+": this.getMonth() + 1, //month
"d+": this.getDate(), //day
"h+": this.getHours(), //hour
"m+": this.getMinutes(), //minute
"s+": this.getSeconds(), //second
"q+": Math.floor((this.getMonth() + 3) / 3), //quarter
"S": this.getMilliseconds() //millisecond
}
if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o) if (new RegExp("(" + k + ")").test(format))
format = format.replace(RegExp.$1,
RegExp.$1.length == 1 ? o[k] :
("00" + o[k]).substr(("" + o[k]).length));
return format;
}
var xhr = new XMLHttpRequest();
var currdate = new Date();
if (!xhr) {
//...其他生成xmlhttprequest方法
}
xhr.open("HEAD", location.href, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var datestr = xhr.getResponseHeader("Date");
currdate = new Date(datestr);
// alert(currdate.format('yyyy-MM-dd'));
}
}
xhr.send(null);
function getSaved(){
var ChfeeDirty=DsTruck.GetDirty(panelEdit.storeBodyChFee,panelEdit.feeBodyDel);
var Chfee_YFDirty=DsTruck.GetDirty(panelEdit.storeBodyChFee_YF,panelEdit.feeBodyDel);
if (panelEdit.formEdit.getForm().isDirty()== true || CargoDirty==true|| ReceiptDirty==true|| KCDirty==true|| ChfeeDirty==true)
{
return true;
}
else return false;
}
Ext.extend(DsTruck.MsWl_HaierPCEdit, Ext.Panel, {
parentWin: null,
OpStatus: 'edit',
StoreList: null,
editRecord: null,
// parentfunction: null,
_First: true,
initUIComponents: function () {
this.BillNo = "";
this.StoreDrOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeOP',
proxy: { url: '/MvcShipping/MsChFee/GetFeeOpRang' }
});
this.StoreCrOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeOP',
proxy: { url: '/MvcShipping/MsChFee/GetFeeOpRang' }
});
this.StoreDrOpRange.load({ params: { optype: "modImport_Fee"} });
this.StoreCrOpRange.load({ params: { optype: "modImport_Fee"} });
this.storebill = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'PCmb',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/TruckMng/MsWl_Haier/GetDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.panelFee = new Shipping.FeeEditGrid({
region: 'center',
layout: 'border'
});
this.panelFee.stroplb = 'MsWl_PC';
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "WTDW-委托单位", "CUSTTYPE": "委托单位", "CUSTNAME": "CUSTOMERNAME" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CGS-船公司", "CUSTTYPE": "船公司", "CUSTNAME": "CARRIER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "DCDL-订舱代理", "CUSTTYPE": "订舱代理", "CUSTNAME": "FORWARDER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "BGH-报关行", "CUSTTYPE": "报关行", "CUSTNAME": "CUSTOMSER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CD-车队", "CUSTTYPE": "车队", "CUSTNAME": "TRUCKER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "FHR-发货人", "CUSTTYPE": "发货人", "CUSTNAME": "SHIPPERID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "SHR-收货人", "CUSTTYPE": "收货人", "CUSTNAME": "CONSIGNEEID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "TZR-通知人", "CUSTTYPE": "通知人", "CUSTNAME": "NOTIFYPARTYID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "DL-代理", "CUSTTYPE": "代理", "CUSTNAME": "AGENTID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CZ-场站", "CUSTTYPE": "场站", "CUSTNAME": "YARD" });
this.panelFee.StoreDrOpRange.load({ params: { optype: "modSeaiRecvFeeManagement"} });
this.panelFee.StoreCrOpRange.load({ params: { optype: "modSeaiPayFeeManagement"} });
this.panelFee.storeFeeNameRef.load({ params: { condition: " ISTRUCKING='1' "} });
this.panelChFee = new Ext.Panel({
//
layout: "border",
region: 'center',
margin: '0 0',
//height: 450, //width: 450,
split: true,
items: [/*this.panelChFee_YS, this.panelChFee_YF*/
this.panelFee
]
});
Ext.apply(this, {
items: [this.panelChFee]
});
parentWin = window.parent.opener;
this.InitData();
//集中绑定 事件
}, //end initUIComponents
InitData: function () {
this.opStatus = 'edit';
var condition = '';
if (parentWin) {
var ret = parentWin.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.editRecord = ret[2];
this.BillNo = ret[3];
}
this.LoadData(this.opStatus, this.BillNo);
}, //end InitData
//载入数据
LoadData: function (opstatus, condition) {
/////通用费用模块载入数据
this.storebill.load({ params: { condition: " BillNo='" + this.BillNo + "' " },
callback: function (r, options, success) {
if (success) {
if (r.length == 1) {
//this.formEdit.getForm().loadRecord(this.storebill.getAt(0));
this.panelFee.EditRecord = this.storebill.getAt(0);
this.panelFee.strBSNO = this.BillNo;
this.panelFee.StoreDateCurr.load({ params: { optype: "op_Seai", bsno: this.BillNo} });
this.panelFee.StoreUnit.load({ params: { bsno: this.BillNo} });
this.panelFee.storeBodySum.load({ params: { bsno: this.BillNo} });
this.panelFee.storeDrChFee.load({ params: { billno: this.BillNo, type: 1, optype: "op_Seai"} });
this.panelFee.storeCrChFee.load({ params: { billno: this.BillNo, type: 2, optype: "op_Seai"} });
}
}
},
scope: this
});
}, // end LoadDate
DoPrint: function () {
var _p = this.MainTab.getActiveTab().id;
if (_p == "page_2") {
//打印仓储费对账单
this.PrintKCFee();
}
if (_p == "page_4") {
//打印应收应付
this.Print();
}
}
});