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/OA/Viewsjs/RptWms/Wms_IOView.js

371 lines
10 KiB
JavaScript

2 years ago
///<reference path="../../../../Views/../TruckMng/Scripts/vswd-ext_2.0.2.js" />
Ext.namespace('DsTruck');
var C_cargoinfo_id="";
var HTHCount=0;
DsTruck.Wms_IOView = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.Wms_IOView.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 feedirty = DsTruck.GetDirty(panelEdit.storeBodyChfee, panelEdit.storeBodyChfeeDel);
if (panelEdit.formEdit.getForm().isDirty()== true )
{
return true;
}
else return false;
}
Ext.extend(DsTruck.Wms_IOView, Ext.Panel, {
parentWin: null,
OpStatus: 'add',
StoreList: null,
editRecord: null,
// parentfunction: null,
_First: true,
initUIComponents: function () {
this.feeSerialNo = 0;
this.feeBodyDel = [];
//枚举参照相关(编辑form)
//////////////////////////////////
//明细 <<<< 出入库信息明细 >>>>
//
//数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'WMSDetailmb',
remoteSort: false,
//pruneModifiedRecords: true,
proxy: {
type: 'ajax',
url: '/OA/RptWms/GetVwWmsDetailDataList',
reader: {
id: 'NID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//表格
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
title:"出入库明细",
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
//plugins: [this.cellEditingReceipt],
selType: 'cellmodel',
tbar: [],
columns: [
{
sortable: true, hidden:true,
dataIndex: 'NID',
header: 'NID',
width: 80
},
{
sortable: true,
dataIndex: 'BLNO',
header: '提单号',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMNO',
header: '备案清单号',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '货主',
width: 80
},
{
sortable: true,
dataIndex: 'STORAGENAME',
header: '仓库名称',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSSTANDARD',
header: '规格',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSMODEL',
header: '型号/牌号',
width: 80
},
{
sortable: true,
dataIndex: 'WMSNO',
header: '入库单号',
width: 80
},
{
sortable: true,
dataIndex: 'OUTBSNO_OUT',
header: '出库单号',
width: 80
},
{
sortable: true,
dataIndex: 'BSNO_OUT',
header: '出库明细单号',
width: 80
},
{
sortable: true,
dataIndex: 'WMSDATE',
header: '入库日期',
width: 80
},
{
sortable: true,
dataIndex: 'DODATE_OUT',
header: '出库日期',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSRKSL',
header: '入库量',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSRKSLACTUAL',
header: '实际入库量',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSPFSL_OUT',
header: '出库量',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSSTOCK',
header: '库存量',
width: 80
},
{
sortable: true,
dataIndex: 'CHARGEUNIT',
header: '计费单位',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSOUTFEE_OUT',
header: '应收仓储费',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSOUTFEEAP_OUT',
header: '应付仓储费',
width: 80
},
{
sortable: true,
dataIndex: 'ARFEE',
header: '入库应收装卸费',
width: 80
},
{
sortable: true,
dataIndex: 'APFEE',
header: '入库应付装卸费',
width: 80
},
{
sortable: true,
dataIndex: 'ARFEE_OUT',
header: '出库应收装卸费',
width: 80
},
{
sortable: true,
dataIndex: 'APFEE_OUT',
header: '库应付装卸费',
width: 80
},
{
sortable: true,
dataIndex: 'FREESTORAGEPERIOD',
header: '免仓储期',
width: 80
},
{
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合同号',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSPACK',
header: '件数',
width: 80
},
{
sortable: true,
dataIndex: 'TRUCKNO_OUT',
header: '车号',
width: 80
},
{
sortable: true,
dataIndex: 'REMARK_OUT',
header: '出库备注',
width: 80
},
{
sortable: true,
dataIndex: 'MODIFIEDUSER',
header: '入库操作人',
width: 80
},
{
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: '入库操作时间',
width: 80
},
{
sortable: true,
dataIndex: 'CREATEUSER_OUT',
header: '出库操作人',
width: 80
},
{
sortable: true,
dataIndex: 'CREATETIME_OUT',
header: '出库操作时间',
width: 80
}
]
});
//////////////////////////////////////////////明细<<<< 出入库明细 >>>>结束
//布局
/* 3 */
/*
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 32, bodyStyle: 'background:#FFF',
items: [this.panelBtn]//, this.formEdit]
});*/
Ext.apply(this, {
items: [this.gridList]
});
parentWin = window.parent.opener;
this.InitData();
//集中绑定编辑后事件
}, //end initUIComponents
parentfunction: function (button, event) {
var ret1 = window.parent.opener.OprationSwap();
// alert(this.First);
ret1[3]();
},
InitData: function () {
this.opStatus = 'add';
var condition = '';
if (parentWin) {
var ret = parentWin.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.editRecord = ret[2];
// this.parentfunction = ret[3];
}
if (this.opStatus == 'edit')
condition = " BLNO='" + this.editRecord.get('BLNO') + "'";
this.LoadData(this.opStatus, condition);
}, //end InitData
//载入数据
LoadData: function (opstatus, condition) {
//this.formEdit.getForm().findField('BXGID').setDisabled(false);
//var bsno = this.editRecord.get('BXGID');
this.storeList.load({ params: { condition: condition} });
//this.formEdit.getForm().findField('BXGID').setDisabled(true);
} // end LoadDate
});