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/WMS/WMSOUTIndex.js

1259 lines
51 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Ext.namespace('Shipping');
Shipping.WMSOUTIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.WMSOUTIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.WMSOUTIndex, Ext.Panel, {
PageSize: 500,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
modWmsList: null,
modWmsFeeLock: null,
modWmsFeeRejected: null,
EditRecord: null, //用于从主界面获取
YWType: "PT",
BsNo: '',
initUIComponents: function () {
var mainform = window.parent._this; // Ext.getCmp('OpSeaiEdit');
if (typeof (mainform.editRecord) == "undefined") {
//this.BsNo = getUrlParam('id');
this.OPLBNAME = "WMSMAIN";
}
else {
this.EditRecord = mainform.editRecord;
//this.BSNO = EditRecord.get('BSNO');
this.BsNo = this.EditRecord.data.BSNO;
this.OPLBNAME = this.EditRecord.data.OPLBNAME;
if (this.OPLBNAME == "" || this.OPLBNAME == 'undefined') {
this.OPLBNAME = "海运进口";
}
}
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'WMSOUTmb',
remoteSort: false,
pageSize: this.PageSize,
proxy: {
type: 'ajax',
url: '/MvcShipping/WMS/GetWMSOUTList',
reader: {
idProperty: 'Feeid',
root: 'data',
totalProperty: 'totalCount'
}
}
});
if (this.BsNo == 'undefined') {
this.formname = "WMS_ALL";
} else {
this.formname = "WMS";
}
//this.InWorkFlow=false;
this.column = [
{
sortable: true, hidden: true,
dataIndex: 'GID',
header: '惟一编号',
width: 80
}, {
dataIndex: 'ISLOCK',
header: '是否入账',
width: 60,
renderer: function (value, cellmeta) {
if (value == 'True') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
}, {
dataIndex: 'ISCHANGE',
header: '是否是货权转移',
width: 92,
renderer: function (value, cellmeta) {
if (value == 'True') {
return "<img src='../../../../TruckMng/Content/Images/submit.png' />";
}
}
},
{
sortable: true, hidden: true,
dataIndex: 'ASSOCIATEDNO',
header: '关联号',
width: 80
},
{
sortable: true,
dataIndex: 'BSNO',
header: '仓单明细号',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CLIENTGID',
header: '客户GID',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CLIENTCODE',
header: '客户编码',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '客户名称',
width: 80
},
{
sortable: true,
dataIndex: 'DODATE',
header: '出库时间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'STORAGECODE',
header: '仓库编码',
width: 80
},
{
sortable: true,
dataIndex: 'STORAGENAME',
header: '仓库名称',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'AREACODE',
header: '库位编码',
width: 80
},
{
sortable: true,
dataIndex: 'AREANAME',
header: '库位名称',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'GOODSCODE',
header: '货物编号',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '货物名称/品名',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSTYPE',
header: '货物类型',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSMODEL',
header: '型号',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSSTANDARD',
header: '规格',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSPACK',
header: '包装',
width: 80
},
{
sortable: true,
dataIndex: 'CHARGEUNIT',
header: '计费单位',
width: 80
},
// {
// sortable: true,
// dataIndex: 'GOODSPACKSTOCK',
// header: '剩余件数',
// width: 80
// },
{
sortable: true,
dataIndex: 'GOODSPFSL',
header: '出库量',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSOUTFEE',
header: '应收仓储费',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSOUTFEEAP',
header: '应付仓储费',
width: 80
},
{
sortable: true,
dataIndex: 'TRUCKNO',
header: '车号',
width: 80
},
{
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'ISDELETE',
header: '是否废除',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'DELETETIME',
header: '废除时间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'DELETEUSER',
header: '废除操作人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CREATEUSER',
header: '创建人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CREATETIME',
header: '创建时间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MODIFIEDUSER',
header: '最后一次更新操作人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MODIFIEDTIME',
header: '最后一次更新操作时间',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSPACKPFSL',
header: '出库件数',
width: 80
},
{
sortable: true,
dataIndex: 'TRUCKNAME',
header: '装卸队名称',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'WMSOP',
header: '制表人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'STOREMAN',
header: '保管人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'LOCKTIME',
header: '锁定时间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'LOCKUSER',
header: '锁定操作人',
width: 80
},
{
sortable: true,
dataIndex: 'ARFEE',
header: '出库费应收',
width: 80
},
{
sortable: true,
dataIndex: 'APFEE',
header: '出库费应付',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'INSPECTIONNO',
header: '审批单号',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMNO',
header: '报关单号/备案清单号',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CORPID',
header: '分公司代码',
width: 80
},
{
sortable: true,
dataIndex: 'CLIENTNAMEOLD',
header: '转移对象',
width: 80
},
{
sortable: true,
dataIndex: 'OLDCUSTFEEDATE',
header: '上家承担仓储期',
width: 80
},
{
sortable: true,
dataIndex: 'CLIENTBSNO',
header: '不同客户的重复的出库单/客户出库仓单号',
width: 80
},
{
sortable: true,
dataIndex: 'ARCLIENT',
header: '应收账款客户',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'INGIDNEW',
header: '货权入库wmsgid',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'VALIDDATE',
header: '有效期',
width: 80
},
{
sortable: true,
dataIndex: 'TOTALNO',
header: '件数大写',
width: 80
},
{
sortable: true,
dataIndex: 'REMARK2',
header: '备注2/发货须知',
width: 80
},
{
sortable: true,
dataIndex: 'MBLNONEW',
header: '货权转移的分单',
width: 80
},
{
sortable: true,
dataIndex: 'ARCLIENTWMSOUT',
header: '仓储费应收客户',
width: 80
},
{
sortable: true,
dataIndex: 'BZTCHNO',
header: '批次号',
width: 80
},
{
sortable: true,
dataIndex: 'ISCOLLECTING',
header: '是否代收费',
width: 80
}
];
//定义Grid
this.WMSCB = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 45
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
viewConfig: {
enableTextSelection: true
},
stateful: true,
selModel: this.WMSCB,
columns: [new Ext.grid.RowNumberer()],
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
/////////////以下部分为获取存储的gridpanel显示样式
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column, 1, true);
//使用者id表名 中间column数组跳过一开始的几列
this.column.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.column);
////////////////////////////
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
//alert(record.data.ISCHANGE);
if (record.data.ISCHANGE == "False") {
this.YWType = "PT"; //普通
} else this.YWType = "HZ"; //货转
DsOpenEditWin("/MvcShipping/MsOpSeai/WMSOUTEdit", "", "650", "1250");
//alert(this.SelectedRecord.get('BSNO'));
}, this);
//#region formSearch
//#region 枚举类型
this.storeDEPT = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DeptModel',
proxy: { url: '/CommMng/BasicDataRef/GetDeptList' }
});
this.storeDEPT.load({ params: { condition: ""} });
this.comboxDEPT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务部门',
store: this.storeDEPT,
name: 'DeptName',
valueField: 'DeptName',
displayField: 'DeptName'
});
this.storeUser = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeUser.load({ params: { condition: ""} });
this.comboxUser = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '库存操作人',
store: this.storeUser,
name: 'WMSOP',
valueField: 'GID',
displayField: 'CodeAndName'
//,value: SHOWNAME
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load();
//委托单位
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '货主',
store: this.storeCustCode,
forceSelection: true,
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeSTORAGENAME = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeSTORAGENAME.load({ params: { condition: " ISWAREHOUSE=1 "} });
this.comboxSTORAGENAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '仓库名称',
store: this.storeSTORAGENAME,
//allowBlank: false,
forceSelection: true,
name: 'STORAGENAME', //id: "STORAGENAME",
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#endregion
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
//height: 100,
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: '入库单号',
name: 'WMSNO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '提单号',
name: 'MBLNO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxUser, this.comboxDEPT
, {
fieldLabel: '不包含货转入库',
xtype: 'checkbox',
name: 'ISCHANGE',
value: 1,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}]
}]
}
, {//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCustCode
, {
fieldLabel: '货物名称',
name: 'GOODSNAME',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
, this.comboxSTORAGENAME
, {
labelWidth: 100,
fieldLabel: '从..出库日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'DODATEbgn', flex: 1,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
, {
fieldLabel: '到..出库日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'DODATEend', flex: 1,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}]
}]
}
,
{//fieldset 3
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '20%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{ fieldLabel: '出库单号',
name: 'BSNO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
]
}]
}
, {//fieldset 5
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: []
} //end items(fieldset 5)
]//end root items
});
//#endregion formSearch
//_this = this;
// this.CBMWorkFlow = new Ext.form.Checkbox({
// fieldLabel: '只显示待处理业务',
// labelwidth:200,
// });
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "新建出库单",
iconCls: "btnadd", id: "NEW",
handler: function (button, event) {
this.OprationStatus = 'add';
this.YWType = "PT";
DsOpenEditWin("/MvcShipping/MsOpSeai/WMSOUTEdit", "", "650", "1250");
},
scope: this
},
{
text: "新建货转",
iconCls: "btncompany", id: "HZ",
handler: function (button, event) {
this.OprationStatus = 'add';
this.YWType = "HZ";
DsOpenEditWin("/MvcShipping/MsOpSeai/WMSOUTEdit", "", "650", "1250");
},
scope: this
},
{
text: "删除出库单",
iconCls: "btndelete", id: "DEL",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
},
'-',
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
},
{
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
this.formSearch.getForm().reset();
},
scope: this
}, '-', {
text: "打印选中",
id: "btnprint",
iconCls: 'btnprint',
handler: function (button, event) {
this.onPrintClick(button, event);
},
scope: this
}, '-'
, {
text: "保存列表样式",
id: "btntest",
handler: function (button, event) {
DsTruck.SaveGridPanel(USERID, this.formname, this.gridList.columns, this.column, 1, true);
},
scope: this
}, '-',
{
text: "费用入账",
id: "btnLock",
handler: function (button, event) {
this.LockWMSOUT("1");
},
scope: this
}, {
text: "取消入账",
id: "btnUnLock",
handler: function (button, event) {
this.LockWMSOUT("0");
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 160,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
this.InitData();
//集中绑定事件
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
}, //end initUIComponents
checkHandler: function () {
alert('Checked a menu item');
},
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
//alert(this.storeList.getCount());
},
InitData: function () {
Ext.Ajax.request({
waitMsg: '正在查询用户权限...',
url: '/CommMng/BasicDataRef/GetAuthorityRange',
params: {
modName: "modWmsList",
USERID: USERID
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
rec = result.data;
this.VISIBLERANGE = rec.VISIBLERANGE;
this.OPERATERANGE = rec.OPERATERANGE;
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
//request over
//var STEPNO=this.storeWorkFlowStep.getAt(index).get("STEPNO");
this.onRefreshClick();
if (this.BsNo != undefined && this.BsNo != "") {
//this.formSearch.hidden = true;
this.formSearch.hide();
this.panelTop.height = 30;
} else {
this.formSearch.show();
this.panelTop.height = 130;
}
///仓储费用入账
Ext.Ajax.request({
waitMsg: '正在查询用户权限...',
url: '/CommMng/BasicDataRef/GetAuthorityRange',
params: {
modName: "modWmsFeeLock",
USERID: USERID
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
rec = result.data;
this.VISIBLERANGE = rec.VISIBLERANGE;
this.OPERATERANGE = rec.OPERATERANGE;
this.modWmsFeeLock = rec.OPERATERANGE;
}
else
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
},
scope: this
}); //request over
///仓储费用取消入账
Ext.Ajax.request({
waitMsg: '正在查询用户权限...',
url: '/CommMng/BasicDataRef/GetAuthorityRange',
params: {
modName: "modWmsFeeRejected",
USERID: USERID
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
rec = result.data;
this.VISIBLERANGE = rec.VISIBLERANGE;
this.OPERATERANGE = rec.OPERATERANGE;
this.modWmsFeeRejected = rec.OPERATERANGE;
}
else
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
},
scope: this
}); //request over
}, //end InitData
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择记录!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var selectedRecords = [];
selectedRecords = this.gridList.selModel.getSelection();
var record = selections[0];
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/WMS/DeleteOUT',
params: {
data: Ext.JSON.encode(record.data),
USERID: USERID
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.remove(record);
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 });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
InitData();
}, //onDeleteClick
onOpenClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (selections.length > 1) {
Ext.Msg.show({ title: '提示', msg: '请注意,将打开所选内容的第一条!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
var selectedRecords = [];
selectedRecords = this.gridList.selModel.getSelection();
this.SelectedRecord = selectedRecords[0];
this.OprationStatus = 'edit';
//DsOpenEditWin("/OA/Baoxiao/Edit", "", "620", "1000");
}, //onDeleteClick
getToday: function () {
var now = new Date();
var year = now.getFullYear(); //年
var month = now.getMonth() + 1; //月
var day = now.getDate(); //日
var clock = year + "-";
if (month < 10)
clock += "0";
clock += month + "-";
if (day < 10)
clock += "0";
clock += day + " ";
return (clock);
},
onResetClick: function (button, event) {
this.formSearch.getForm().reset();
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
/*
if (this.VISIBLERANGE == "0")//查看权限 全部
{
var sql = '';
} else
if (this.VISIBLERANGE == "1")//分公司
{
var sql = " BX.company='" + COMPANYID + "'";
} else
if (this.VISIBLERANGE == "2")//部门
{
var sql = " BX.DEPTNAME ='" + DEPTGID + "'";
} else
if (this.VISIBLERANGE == "3")//个人
{
var sql = " BX.createuser='" + SHOWNAME + "'";
}
else {
sql = " 1<0";
}*/
//OPERATERANGE
if (this.BsNo != undefined && this.BsNo != "") {
sql = " ASSOCIATEDNO='" + this.BsNo + "' ";
} else {
sql = " ASSOCIATEDNO=GID ";
}
var WMSNO = form.findField("WMSNO").getValue();
sql = sql + getAndConSql(sql, WMSNO, " EXISTS (select 1 from wms_out_detail where OUTBSNO=wms_out.BSNO and INBSNO in(select gid from wms where wmsno like '%" + WMSNO + "%')) ");
var MBLNO = form.findField("MBLNO").getValue();
sql = sql + getAndConSql(sql, MBLNO, " bsno in( select outbsno from wms_out_detail t1 join wms t2 on t1.inbsno=t2.gid where t2.BLNO like '%" + MBLNO + "%' ) ");
var DeptName = form.findField("DeptName").getValue();
sql = sql + getAndConSql(sql, DeptName, " CreateUser in( select GID from vw_user where deptname='" + DeptName + "')");
var WMSOP = form.findField("WMSOP").getValue();
sql = sql + getAndConSql(sql, WMSOP, "CreateUser = '" + WMSOP + "'");
var ISCHANGE = form.findField("ISCHANGE").getValue() ? 1 : 0;
if (ISCHANGE == 1) {
sql = sql + getAndConSql(sql, ISCHANGE, " ISCHANGE = 0 ");
}
var CUSTOMERNAME = form.findField("CUSTOMERNAME").getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, " CUSTOMERNAME = '" + CUSTOMERNAME + "' ");
var GOODSNAME = form.findField("GOODSNAME").getValue();
sql = sql + getAndConSql(sql, GOODSNAME, " GOODSNAME like '%" + GOODSNAME + "%' ");
var STORAGENAME = form.findField("STORAGENAME").getValue();
sql = sql + getAndConSql(sql, STORAGENAME, " STORAGENAME like '%" + STORAGENAME + "%' ");
var DODATEbgn = form.findField('DODATEbgn').getRawValue();
sql = sql + getAndConSql(sql, DODATEbgn, " DODATE >= '" + DODATEbgn + "'");
var DODATEend = form.findField('DODATEend').getRawValue();
sql = sql + getAndConSql(sql, DODATEend, " DODATE <= '" + DODATEend + " 23:59:59'");
var BSNO = form.findField("BSNO").getValue();
sql = sql + getAndConSql(sql, BSNO, " BSNO like '%" + BSNO + "%' ");
return sql;
},
onGetremind: function (field, newValue, oldValue) {
if (newValue != null) {
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: newValue },
waitMsg: "正在查询数据...",
scope: this
});
}
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
if (this.OPLBNAME == "WMSMAIN") {
ret[3] = this.SelectedRecord;
} else {
ret[3] = this.EditRecord;
}
ret[4] = this.YWType;
ret[5] = OPLBNAME;
return ret;
},
LockWMSOUT: function (Value) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择记录!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var LockWMS = [];
if (Value == "1") {
if (modWmsFeeLock == "4") {
alert("没有 仓储费用入账 的权限");
return;
}
} else if (Value == "0") {
if (modWmsFeeRejected == "4") {
alert("没有 仓储费用入账取消 的权限");
return;
}
}
Ext.MessageBox.confirm('提示', '确定要操作选中的入库信息吗?', function (btn) {
if (btn == 'yes') {
var selectedRecords = this.WMSCB.selected.items;
if (selectedRecords.length > 0) {
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.ISLOCK == "True" && Value == "1") {
alert("已经入账,请勿重复操作");
return;
}
if (rec.ISLOCK == "False" && Value == "0") {
alert("已经是未入账状态,请勿重复操作");
return;
}
if (rec.data.ASSOCIATEDNO != "") //没有保存的数据无法锁定
{
LockWMS.push(rec);
}
}
}
var LockWMSJSNO = ConvertRecordsToJsonAll(LockWMS);
_this = this;
Ext.Ajax.request({//
waitMsg: '正在处理数据...',
url: '/MvcShipping/WMS/LockOut',
params: {
data: LockWMSJSNO,
LOCK: Value
},
callback: function (options, success, response) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
alert(jsonresult.Message);
} else {
alert("操作失败" + jsonresult.Message);
}
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
scope: this
}); //request over
}
}, this);
} //onDeleteClick
,
onPrintClick: function (button, event) {
var printType = 'WmsOutList_opseai'; //海运进口 出库仓储费明细
var BSNOList = "";
var selectedRecords = this.gridList.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (BSNOList == "") { BSNOList = "'" + rec.get('GID') + "'"; }
else {
BSNOList = BSNOList + ",'" + rec.get('GID') + "'";
}
}
var sql1 = " SELECT BLNO as 提单号,convert(char(10),WMSDATE,20) as 入库日期, WMSNO as 入库单号, OUTBSNO as 出库单号 ";
sql1 = sql1 + " , BSNO as 出库单明细号, CUSTOMERNAME as 货主,ARCLIENTWMSOUT as 仓储费应收客户名称, convert(char(10),DODATE,20) as 出库日期 ";
sql1 = sql1 + " , STORAGENAME as 仓库,STORAGENAME_FULL as 仓库全称, AREANAME as 库位名称, GOODSNAME as 货物名称, GOODSTYPE as 货物类型 ";
sql1 = sql1 + " , GOODSMODEL as 型号, GOODSSTANDARD as 规格, GOODSPACK as 包装, GOODSPFSL as 出库量, GOODSOUTFEE as 应收仓储费, TRUCKNO as 车号 ";
sql1 = sql1 + " , REMARK as 出库明细备注, CREATEUSER as 出库创建人, CREATETIME as 出库创建时间, GOODSPACKPFSL as 出库件数 ";
sql1 = sql1 + " , (case when ISLOCK=1 then '是' else '否' end) as 是否锁定, LOCKUSER as 锁定操作人, LOCKTIME as 锁定时间, GOODSOUTFEEAP as 应付仓储费 ";
sql1 = sql1 + " , ARFEE as 应收账款, APFEE as 应付账款, INSPECTIONNO as 审批单号, CUSTOMNO as 备案清单号, CLIENTNAMEOLD as 货权转移的客户名称 ";
sql1 = sql1 + " , OLDCUSTFEEDATE as 上家承担仓储期限,STARTBILLINGDATE as 应收开始计费日期,ENDBILLINGDATE as 应收结束计费日期, wmsdays as 应收仓储天数 ";
sql1 = sql1 + " , FEEDAYS as 应收计费天数, FREESTORAGEPERIOD as 应收免仓储期, DESCRIPTION as 仓储费应收客户全称, EnFullName as 仓储费应收客户英文全称 ";
sql1 = sql1 + " , NAME as 仓储费应收客户英文简称, ADDR as 仓储费应收客户地址, EMAIL as 仓储费应收客户邮箱, WEB as 仓储费应收客户网址 ";
sql1 = sql1 + " , TEL AS 仓储费应收客户电话, FAX AS 仓储费应收客户传真, CHIEF as 仓储费应收客户负责人, TOTALNO as 件数大写 ";
sql1 = sql1 + " , REMARK2_OUT AS [出库备注2/发货须知第一条], VALIDDATE as 有效期, REMARK AS [出库备注1], GOODSGRADE as 品名的等级 ";
sql1 = sql1 + " , GOODSSLICE as [片数/件], MBLNONEW as [货权转移的分单的提单号], CONTRACTNO as 合同号 , CORPID, GID AS OUTGID, GID ";
sql1 = sql1 + " , ASSOCIATEDNO,BZTCHNO as 批次号 FROM VW_WmsOutList_Print as a WHERE OUTGid in(" + BSNOList + ") order by OUTBSNO,WMSNO,DODATE ";
var sql2 = " SELECT GID as 惟一值,CODENAME as 客户代码,SHORTNAME as 客户简称,DESCRIPTION as 客户中文名称或描述信息,NAME as 客户英文简称 ";
sql2 = sql2 + " ,EnFullName as 客户英文全称,STATUS as 客户状态,ADDR as 通讯地址,EMAIL as 电子邮箱,WEB as 网页 ";
sql2 = sql2 + " ,(CASE TEL WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE TEL END) as 电话 ";
sql2 = sql2 + " ,(CASE FAX WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE FAX END) as 传真,CHIEF as 负责人,SALE as 所属揽货人,OP as 所属操作 ";
sql2 = sql2 + " ,DOC as 所属单证,ISCARRIER as 是否船公司,ISBOOKING as 是否订舱公司,ISYARD as 是否场站,ISTRUCK as 是否车队,ISCONTROLLER as 是否委托单位 ";
sql2 = sql2 + " ,ISCUSTOM as 是否报关行,ISAGENT as 是否国外代理,ISAGENTCN as 是否国内代理,ISEXPRESS as 是否快递公司,ISAIRLINES as 是否航空公司 ";
sql2 = sql2 + " ,ISSHIPPER as 是否发货人,ISCONSIGNEE as 是否收货人,ISNOTIFYPARTY as 是否通知人,ISWAREHOUSE as 是否仓库,ISINSURE as 是保险公司 ";
sql2 = sql2 + " ,ISLEASING as 是租箱公司,ISTRADINGAGENCY as 是否贸易代理,ISOTHER as 其他_,OTHERS as 其他说明,COUNTRY as 国家,PROVINCE as 省或州 ";
sql2 = sql2 + " ,CITY as 城市,CORPID as 所属分公司代码,BLCONTENT as 详细信息,ISSTOP as 是否停用该客户信息,BillRises1 as 发票抬头1,BillRises2 as 发票抬头2 ";
sql2 = sql2 + " ,RMBBillRises as 人民币支票抬头,RMBBank as 人民币开户银行,RMBAccount as 人民币账号,RMBOnlineNO as 人民币联机行号,USDBillRises as 美元支票抬头 ";
sql2 = sql2 + " ,USDBank as 美元开户银行,USDAccount as 美元账号,USDOnlineNO as 美元联机行号,CustomAttributes1 as 自定义属性1,CustomAttributes2 as 自定义属性2 ";
sql2 = sql2 + " ,USDMaxAmountCredit as 美元信用最大金额,RMBMaxAmountCredit as 人民币信用最大金额,MaxAmountCredit as 信用最大金额,STLNAME as 结算方式 ";
sql2 = sql2 + " ,OPNAME as 处理人,OPTIME as 处理时间,REMARK as 备注,USDExchangeRate as 美金汇率,STLDATE as 月结时间,STLFIRSTHALFDATE as 上半月结时间 ";
sql2 = sql2 + " ,STLMIDDLEDATE as 下半月结时间,STLDATEPJ as 票结时间,LEVEL as 运价级别,LOGINNAME as 客户代码名,LOGINPASSWORD as 登录密码,QQ as QQ,MSN as MSN ";
sql2 = sql2 + " ,(SELECT TOP (1) SHOWNAME FROM [user] WHERE GID = MODIFIEDUSER) as 最后一次更新操作人,MODIFIEDTIME as 最后一次更新操作时间 ";
sql2 = sql2 + " ,FARCODE as 财务应收帐款代码,FAPCODE as 财务应付帐款代码 FROM info_client ";
sql2 = sql2 + " where SHORTNAME in (select a.CUSTOMERNAME from VW_WmsOutList_Print as a WHERE OUTGid in(" + BSNOList + ") ) and ISSTOP=0 ";
var sql3 = " SELECT GID as 惟一值,CODENAME as 客户代码,SHORTNAME as 客户简称,DESCRIPTION as 客户中文名称或描述信息,NAME as 客户英文简称 ";
sql3 = sql3 + " ,EnFullName as 客户英文全称,STATUS as 客户状态,ADDR as 通讯地址,EMAIL as 电子邮箱,WEB as 网页 ";
sql3 = sql3 + " ,(CASE TEL WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE TEL END) as 电话 ";
sql3 = sql3 + " ,(CASE FAX WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE FAX END) as 传真,CHIEF as 负责人,SALE as 所属揽货人 ";
sql3 = sql3 + " ,OP as 所属操作,DOC as 所属单证,ISCARRIER as 是否船公司,ISBOOKING as 是否订舱公司,ISYARD as 是否场站,ISTRUCK as 是否车队 ";
sql3 = sql3 + " ,ISCONTROLLER as 是否委托单位,ISCUSTOM as 是否报关行,ISAGENT as 是否国外代理,ISAGENTCN as 是否国内代理,ISEXPRESS as 是否快递公司 ";
sql3 = sql3 + " ,ISAIRLINES as 是否航空公司,ISSHIPPER as 是否发货人,ISCONSIGNEE as 是否收货人,ISNOTIFYPARTY as 是否通知人,ISWAREHOUSE as 是否仓库 ";
sql3 = sql3 + " ,ISINSURE as 是保险公司,ISLEASING as 是租箱公司,ISTRADINGAGENCY as 是否贸易代理,ISOTHER as 其他_,OTHERS as 其他说明,COUNTRY as 国家 ";
sql3 = sql3 + " ,PROVINCE as 省或州,CITY as 城市,CORPID as 所属分公司代码,BLCONTENT as 详细信息,ISSTOP as 是否停用该客户信息,BillRises1 as 发票抬头1 ";
sql3 = sql3 + " ,BillRises2 as 发票抬头2,RMBBillRises as 人民币支票抬头,RMBBank as 人民币开户银行,RMBAccount as 人民币账号,RMBOnlineNO as 人民币联机行号 ";
sql3 = sql3 + " ,USDBillRises as 美元支票抬头,USDBank as 美元开户银行,USDAccount as 美元账号,USDOnlineNO as 美元联机行号,CustomAttributes1 as 自定义属性1 ";
sql3 = sql3 + " ,CustomAttributes2 as 自定义属性2,USDMaxAmountCredit as 美元信用最大金额,RMBMaxAmountCredit as 人民币信用最大金额 ";
sql3 = sql3 + " ,MaxAmountCredit as 信用最大金额,STLNAME as 结算方式,OPNAME as 处理人,OPTIME as 处理时间,REMARK as 备注,USDExchangeRate as 美金汇率 ";
sql3 = sql3 + " ,STLDATE as 月结时间,STLFIRSTHALFDATE as 上半月结时间,STLMIDDLEDATE as 下半月结时间,STLDATEPJ as 票结时间,LEVEL as 运价级别 ";
sql3 = sql3 + " ,LOGINNAME as 客户代码名,LOGINPASSWORD as 登录密码,QQ as QQ,MSN as MSN ";
sql3 = sql3 + " ,(SELECT TOP (1) SHOWNAME FROM [user] WHERE GID = MODIFIEDUSER) as 最后一次更新操作人,MODIFIEDTIME as 最后一次更新操作时间 ";
sql3 = sql3 + " ,FARCODE as 财务应收帐款代码,FAPCODE as 财务应付帐款代码 FROM info_client ";
sql3 = sql3 + " where SHORTNAME in (select a.STORAGENAME from VW_WmsOutList_Print as a WHERE OUTGid in(" + BSNOList + ") ) and ISSTOP=0 ";
var sql4 = " SELECT u.GID as 惟一编号,u.USERNAME as 英文名,u.PASSWORD as 登录密码,u.CODENAME as 用户代码名,u.SHOWNAME as 显示用户名 ";
sql4 = sql4 + " ,u.ENROLLTIME as 注册时间,(SELECT TOP (1) SHOWNAME FROM [user] WHERE GID = u.CREATEUSER) as 操作人 ";
sql4 = sql4 + " ,(SELECT TOP (1) SHOWNAME FROM [user] WHERE GID = u.MODIFIEDUSER) as 更改操作人,u.MODIFIEDTIME as 更改操作时间 ";
sql4 = sql4 + " ,u.ISDELETED as 账户删除状态标志,u.ISDISABLE as 账户禁用状态标志,b.COMPANYNAME as 公司简称,b.DEPTNAME as 部门名称,b.QQ as QQ,b.MSN as MSN ";
sql4 = sql4 + " ,(CASE b.OFFICEPHONE WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE b.OFFICEPHONE END) as 办公电话号码 ";
sql4 = sql4 + " ,(CASE b.HOMEPHONE WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE b.HOMEPHONE END) as 家庭电话号码,b.MOBILE as 手机号码 ";
sql4 = sql4 + " ,(CASE b.FAX WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE b.FAX END) as 传真号码,b.EMAIL1 as 主电子邮件地址 ";
sql4 = sql4 + " ,b.EMAIL2 as 次电子邮件地址,b.HOMEADDRESS as 家庭地址,b.REMARK as 备注信息 ";
sql4 = sql4 + " ,(SELECT TOP (1) SHOWNAME FROM [user] WHERE GID = b.CREATEUSER) as 创建人,b.CREATETIME as 创建时间 ";
sql4 = sql4 + " ,(SELECT TOP (1) SHOWNAME FROM [user] WHERE GID = b.MODIFIEDUSER) as 最后一次操作人,b.MODIFIEDTIME as 最后一次操作时间,b.EMERGUSER as 紧急联系人 ";
sql4 = sql4 + " ,(CASE b.EMERGPHONE WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE b.EMERGPHONE END) as 紧急联系人联系电话 ";
sql4 = sql4 + " ,b.EMERGEMAIL as 紧急联系人邮箱,b.POSTCODE as 邮政编码,b.SIGNATURE as 签名图片,b.FINANCESOFTCODE as 财务软件代码,b.IMAGEURL as 头像url ";
sql4 = sql4 + " ,b.SIGNATUREURL as 签名Url FROM [user] as u INNER JOIN user_baseinfo as b ON u.GID = b.USERID where u.GID='" + USERID + "'";
var sql5 = " SELECT GID as 惟一编号,CODENAME as 公司代码名,NAME as 公司简称,FULLNAME as 公司全称,ENNAME as 公司英文名称,ADDRESS as 公司联络地址 ";
sql5 = sql5 + " ,ENADDRESS as 公司英文地址,POSTCODE as 邮政编码 ";
sql5 = sql5 + " ,(CASE OFFICEPHONE WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE OFFICEPHONE END) AS 公司办公电话 ";
sql5 = sql5 + " ,(CASE FAX WHEN '86-0-0' THEN '' when '86--' then '' when '86' then '' ELSE FAX END) AS 传真号码,EMAIL as 电子邮箱 ";
sql5 = sql5 + " ,WEBSITEURL as 公司网址,LICENSECODE as 工商登记号,TAXCODE as 税务登记号,LOGO as 徽标,BillRises as 发票抬头,ChequePayable as 支票抬头 ";
sql5 = sql5 + " ,PRTHEADXML1 as 打印抬头1,PRTHEADXML2 as 打印抬头2,PRTHEADXML3 as 打印抬头3,PRTHEADXML4 as 打印抬头4,PRTHEADXML5 as 打印抬头5 ";
sql5 = sql5 + " ,CREATEUSER as 创建人gid,CREATETIME as 创建时间,MODIFIEDUSER as 更新人gid,MODIFIEDTIME as 更新时间,ISDELETED as 是否删除 ";
sql5 = sql5 + " ,ISDISABLE as 是否被禁用,PARENTID as 父公司GID,BANKSHEAD as 票号头字符 FROM [company] WHERE GID = '" + COMPANYID + "'";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
});