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_LKPC/MsWl_LKPCIndex.js

1079 lines
36 KiB
JavaScript

2 years ago
Ext.namespace('DsTruck');
DsTruck.MsWl_LKPCIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.MsWl_LKPCIndex.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);
Ext.extend(DsTruck.MsWl_LKPCIndex, Ext.Panel, {
PageSize: 200,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
SheetCode: "",
initUIComponents: function () {
this.formname = "LK_PC";
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsWlPcHead',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsWl_LKPC/GetDataList',
reader: {
id: 'BillNo',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.column=[{
sortable: true,
dataIndex: 'PcBillType_Ref',
header: '路单类型',
width: 100
}, {
sortable: true,
dataIndex: 'BillNo',
header: '单据号',
width: 150
}, {
sortable: true,
dataIndex: 'UserCode',
header: '用户编码',
width: 60
}, {
sortable: true,
dataIndex: 'UserName',
header: '用户姓名',
width: 80
}, {
sortable: true,
dataIndex: 'TruckNo',
header: '车牌号',
width: 160
}, {
sortable: true,
dataIndex: 'DrvName',
header: '司机姓名',
width: 160
}, {
sortable: true,
dataIndex: 'ExpDate',
header: '派车日期',
width: 80
}, {
sortable: true,
dataIndex: 'RatedFuel',
header: '额定油耗',
width: 160
}, {
sortable: true,
dataIndex: 'FuelQty',
header: '本次加油量',
width: 160
}, {
sortable: true,
dataIndex: 'RealFuel',
header: '实际油耗',
width: 160
}, {
sortable: true,
dataIndex: 'NoLoadMil',
header: '空驶里程',
width: 160
}, {
sortable: true,
dataIndex: 'OverLoadMil',
header: '重驶里程',
width: 160
}, {
sortable: true,
dataIndex: 'Ton',
header: '运量',
width: 160
}, {
sortable: true,
dataIndex: 'TotalMil',
header: '总里程',
width: 160
}
];
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 40
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
//layout: "border",
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: [new Ext.grid.RowNumberer()],
// paging bar on the bottom
viewConfig: {
enableTextSelection: true,
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
//ISPC, ISBACK
var ISPC = record.get('ISPC');
var ISBACK = record.get('ISBACK');
return DsTruck.LKPCRowClass(ISPC, ISBACK);
}
},
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);
//使用者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';
DsOpenEditWin('/TruckMng/MsWl_LKPC/Edit');
}, this);
//#region formSearch
//#region combox
var _this = this;
this.storePcBillType = Ext.create('DsExt.ux.RefEnumStore', {});
var _this = this;
this.storePcBillType.load({ params: { enumTypeId: 99046} });
this.comboxPcBillType = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '路单类型',
store: this.storePcBillType,
name: 'PcBillType', //id: "PcBillType",
//allowBlank: false,
listeners: {
focus: function (field, eOpts) {
for (var i = _this.storePcBillType.getCount() - 1; i >= 0; i--) {
var rec = _this.storePcBillType.getAt(i);
if (rec.data.EnumValueId != "4" && rec.data.EnumValueId != "5") {
_this.storePcBillType.remove(_this.storePcBillType.getAt(i));
}
}
},
scope: this
}
});
this.storeDdCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeDdCode.load({ params: { condition: " GID in(select userid from vw_user where companyid='Comd683f6f53c5e42f690c2a9051feb1408') "} });
this.comboxDdCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '调度员编码',
store: this.storeDdCode,
name: 'DdCode',
valueField: 'UserCode',
displayField: 'CodeAndName'
});
this.storeDrvName = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsWlBsHeadRefMsWlDriver',
proxy: { url: '/TruckMng/MsWl_LKPC/GetDrvNameList' }
});
this.storeDrvName.load({ params: { condition: ""} });
this.comboxDrvName = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '司机',
store: this.storeDrvName,
name: 'DrvCode',
valueField: 'DrvCode',
displayField: 'CodeAndName'
});
//#endregion
this.formSearch = Ext.widget('form', {
frame: true,
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: [
this.comboxPcBillType,
this.comboxDdCode,
{
fieldLabel: '从派车日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateBgn'
}, {
fieldLabel: '到派车日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateEnd'
}, {
fieldLabel: '交运路单号',
name: 'BillNo'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: '车牌号',
name: 'TruckNo'
},this.comboxDrvName,
{
fieldLabel: '站点名称',
name: 'POINTNAME'
}, {
labelWidth: 120,
fieldLabel: '刺猬网单号/需求单号',
name: 'MCBillNo',flex:2
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//#region 刺猬网派车信息
//#region formSearch_MC
var _this = this;
this.storeGX = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeGX.load({
params: { enumTypeId: 99047 },
callback: function (options, success, response) {
var member = _this.storeGX.getAt(0);
var firstValue = member.data.EnumValueId; //这种方法也可以获得第一项的值
_this.comboxGX.setValue(firstValue); //选中
}
});
this.comboxGX = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '干线调拨单状态',
forceSelection: true,
store: this.storeGX,
name: 'GXSTATE', id: "GXSTATE",
value: "所有状态",
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
//_this.onRefreshClick();
}
}
}
});
this.storeFB = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeFB.load({ params: { enumTypeId: 99048 },
callback: function (options, success, response) {
var member = _this.storeFB.getAt(0);
var firstValue = member.data.EnumValueId; //这种方法也可以获得第一项的值
_this.comboxFB.setValue(firstValue); //选中
}
});
this.comboxFB = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '分拨装运单状态',
forceSelection: true,
store: this.storeFB,
name: 'FBSTATE', id: "FBSTATE",
value: "0",
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
//_this.onRefreshClick();
}
}
}
});
this.formSearch_MC = Ext.widget('form', {
frame: true,
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: '从制单日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'BeginDate',
id: "BeginDate"
}, {
fieldLabel: '到制单日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'EndDate',
id: "EndDate"
}, {
xtype: 'hiddenfield',
flex: 2
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxGX
, this.comboxFB,
{
fieldLabel: '单号',
name: 'SheetCode'
}, {
xtype: 'hiddenfield',
flex: 1
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//#region 主列表
//定义数据集
this.storeMCHeadList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsWl_LK_MCHeadmb',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsWl_LKPC/GetMCHeadList',
reader: {
id: 'ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.gridMCHeadList = new Ext.grid.GridPanel({
store: this.storeMCHeadList,
enableHdMenu: false,
region: 'north',
split: true,
height: 260,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: [{
sortable: true, hidden: true,
dataIndex: 'ID',
header: 'ID',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'PcBillType',
header: 'PcBillType',
width: 80
},
{
sortable: true,
dataIndex: 'PcBillType_Ref',
header: '派车类型',
width: 100
},
{
sortable: true,
dataIndex: 'SheetCode',
header: '刺猬网单号',
width: 140
},
{
sortable: true, hidden: true,
dataIndex: 'SupplierWareHouse',
header: 'SupplierWareHouse',
width: 80
},
{
sortable: true,
dataIndex: 'SupplierWareHouseName',
header: '水厂/库房',
width: 140
},
{
sortable: true, hidden: true,
dataIndex: 'State',
header: 'State',
width: 80
},
{
sortable: true,
dataIndex: 'StateName',
header: '工作单状态',
width: 70
},
{
sortable: true,
dataIndex: 'PreArrivalDate',
header: '预计到达日期',
width: 110
},
{
sortable: true,
dataIndex: 'PreDepartDate',
header: '预计出发时间',
width: 110
},
{
sortable: true,
dataIndex: 'Remark',
header: '备注',
width: 160
}
],
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeMCHeadList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
//#endregion
//#region 从列表
//定义数据集
this.storeMCCargoList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsWl_LK_MCCargomb',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsWl_LKPC/GetMCCargoList',
reader: {
id: 'ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.gridMCCargoList = new Ext.grid.GridPanel({
store: this.storeMCCargoList,
enableHdMenu: false,
region: 'center',
split: true,
//height: 450,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: [{
sortable: true, hidden: true,
dataIndex: 'ID',
header: 'ID',
width: 80
},
{
sortable: true,
dataIndex: 'SheetCode',
header: '需求单号',
width: 155
},
{
sortable: true, hidden: true,
dataIndex: 'SheetCode_Parent',
header: 'SheetCode_Parent',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'SEQUENCE',
header: '顺序号',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'PC_BILLNO',
header: '派车单号',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'POINT_GID',
header: 'POINT_GID',
width: 80
},
{
sortable: true,
dataIndex: 'POINT_NAME',
header: '站点名称',
width: 120
},
{
sortable: true, hidden: true,
dataIndex: 'CARGOINFO_GID',
header: 'CARGOINFO_GID',
width: 80
},
{
sortable: true,
dataIndex: 'CARGO_NAME',
header: '货物名称',
width: 100
},
{
sortable: true,
dataIndex: 'PalletCount',
header: '托盘数',
width: 80
},
{
sortable: true,
dataIndex: 'CargoCount',
header: '货物数量',
width: 80
},
{
sortable: true,
dataIndex: 'CargoCount_Do',
header: '已经安排数量',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'WEIGHT',
header: 'WEIGHT',
width: 80
},
{
sortable: true,
dataIndex: 'Remark',
header: '备注',
width: 80
},
{
sortable: true,
dataIndex: 'StateName',
header: '刺猬网单状态',
width: 80
},
{
sortable: true,
dataIndex: 'SignInQuantity',
header: '签收数量',
width: 80
}
],
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeMCCargoList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
//#endregion
//#region 选择load
this.gridMCHeadList.getSelectionModel().on('select', function (model, record, index) {
this.SheetCode = record.data.SheetCode;
//this.storeBodyChFee.load({ params: { billno: ContractNo} });
this.storeMCCargoList.load({ params: { condition: " SheetCode_Parent='" + this.SheetCode + "' "} });
}, this);
//#endregion
//#endregion
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
DsOpenEditWin('/TruckMng/MsWl_LKPC/Edit');
},
scope: this
},
{
text: "删除",
iconCls: "btndelete",
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.onResetClick(button, event);
},
scope: this
},
'-', {
text: "保存列表样式",
id: "btntest",
handler: function (button, event) {
this.column = DsTruck.SaveGridPanel(USERID, this.formname, this.gridList.columns, this.column, 1, true);
//alert(this.column[0].id);
},
scope: this
}
/*,
{
text: "测试_读取刺猬网分拨单",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onGetCWPCListClick(button, event);
},
scope: this
}*/
]
});
this.panelBtn_MC = new Ext.Panel({
region: "north",
tbar: [
{
text: "查询干线调拨单",
iconCls: "btnrefresh",
handler: function (button, event) {
this.SearchGX(button, event);
},
scope: this
}, {
text: "查询分拨装运单",
iconCls: "btnrefresh",
handler: function (button, event) {
this.SearchFB(button, event);
},
scope: this
},
/*{
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
},
scope: this
},*/
'-',
{
text: "获取并查询干线调拨单",
iconCls: "btnrefresh",
handler: function (button, event) {
this.GetGXPCList(button, event);
},
scope: this
},
{
text: "获取并查询分拨装运单",
iconCls: "btnrefresh",
handler: function (button, event) {
this.GetFBPCList(button, event);
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 105,
items: [this.formSearch, this.panelBtn]
});
this.panelTop_MC = new Ext.Panel({
layout: "border",
region: "north",
height: 105,
items: [this.formSearch_MC, this.panelBtn_MC]
});
this.panel_MC = new Ext.Panel({
layout: "border",
region: "center",
items: [this.gridMCHeadList
, this.gridMCCargoList
]
});
this.page_1 = new Ext.Panel({
id: "page_1",
title: "派车信息",
//autoScroll: true,
region: 'center',
layout: "border",
items: [this.panelTop, this.gridList]
});
this.page_2 = new Ext.Panel({
id: "page_2",
title: "崂矿刺猬网派车单",
region: 'center',
layout: "border",
split: true,
items: [this.panelTop_MC, this.panel_MC]
});
this.MainTab = new Ext.tab.Panel({
layout: "border",
region: "center", split: true,
items: [this.page_1, this.page_2
]
});
Ext.apply(this, {
items: [this.MainTab//this.panelTop, this.gridList
]
});
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
Ext.getCmp("BeginDate").setValue(currdate.format('yyyy-MM-dd'));
Ext.getCmp("EndDate").setValue(currdate.format('yyyy-MM-dd'));
Ext.getCmp("GXSTATE").setRawValue("所有状态");
Ext.getCmp("FBSTATE").setValue("所有状态");
}, //end initUIComponents
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
SearchGX: function (button, event) {
var sql = this.getCondition_GX();
this.storeMCHeadList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
SearchFB: function (button, event) {
var sql = this.getCondition_FB();
this.storeMCHeadList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
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 record = selections[0];
/*
if (record.data.JzDate != '') {
Ext.Msg.show({ title: '警告', msg: '单据已记账,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}*/
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/TruckMng/MsWlDjPc/Delete',
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);
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);
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var billNo = form.findField('BillNo').getValue();
sql = sql + getAndConSql(sql, billNo, "BillNo like '%" + billNo + "%'");
var expDateBgn = form.findField('ExpDateBgn').getRawValue();
sql = sql + getAndConSql(sql, expDateBgn, "ExpDate >='" + expDateBgn + "'");
var expDateEnd = form.findField('ExpDateEnd').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "ExpDate <='" + expDateEnd + "'");
var truckNo = form.findField('TruckNo').getValue();
sql = sql + getAndConSql(sql, truckNo, "TruckNo like '%" + truckNo + "%' ");
var PcBillType = form.findField('PcBillType').getValue();
sql = sql + getAndConSql(sql, PcBillType, " PcBillType=" + PcBillType + "");
var DdCode = form.findField('DdCode').getValue();
sql = sql + getAndConSql(sql, DdCode, " DdCode='" + DdCode + "'");
var DrvCode = form.findField('DrvCode').getValue();
sql = sql + getAndConSql(sql, DrvCode, " DrvCode='" + DrvCode + "'");
var POINTNAME = form.findField('POINTNAME').getValue();
sql = sql + getAndConSql(sql, POINTNAME, " Billno in(select PC_BILLNO from tmswl_lk_cargo where POINT_GID in(select GID from tmswl_lk_point where name like '%" + POINTNAME + "%')) ");
var MCBillNo = form.findField('MCBillNo').getValue();
sql = sql + getAndConSql(sql, MCBillNo, " Billno in(select PC_BILLNO from tmswl_lk_cargo where ID in(select ID from tMsWl_LK_MCCargo where sheetCode like '%" + MCBillNo + "%' or sheetCode_parent like '%" + MCBillNo + "%' )) ");
/*
var custName = form.findField('CustName').getValue();
sql = sql + getAndConSql(sql, custName, " BillNo in (select BillNo from tMsWlDjPound where CustName = '" + custName + "')");
*/
return sql;
},
getCondition_GX: function () {
var form = this.formSearch_MC.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = " PcBillType=4 ";
var BeginDate = form.findField('BeginDate').getRawValue();
sql = sql + getAndConSql(sql, BeginDate, "PreArrivalDate >='" + BeginDate + "'");
var EndDate = form.findField('EndDate').getRawValue();
sql = sql + getAndConSql(sql, EndDate, "PreArrivalDate <'" + EndDate + " 23:59:59'");
var GXSTATE = form.findField('GXSTATE').getValue();
if (GXSTATE != "0") {
sql = sql + getAndConSql(sql, GXSTATE, "state = '" + GXSTATE + "'");
}
return sql;
},
getCondition_FB: function () {
var form = this.formSearch_MC.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = " PcBillType=5 ";
var BeginDate = form.findField('BeginDate').getRawValue();
sql = sql + getAndConSql(sql, BeginDate, "PreDepartDate >='" + BeginDate + "'");
var EndDate = form.findField('EndDate').getRawValue();
sql = sql + getAndConSql(sql, EndDate, "PreDepartDate <'" + EndDate + " 23:59:59'");
var FBSTATE = form.findField('FBSTATE').getValue();
if (FBSTATE != "0") {
sql = sql + getAndConSql(sql, FBSTATE, "state = '" + FBSTATE + "'");
}
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = "";
return ret;
},
GetGXPCList: function () {
var SFDate = this.formSearch_MC.getForm().getValues();
Ext.Msg.wait('正在读取数据...');
Ext.Ajax.request({
waitMsg: '正在读取数据...',
url: '/TruckMng/MsWl_LKPC/GetGXPCList',
params: {
BeginDate: SFDate.BeginDate,
EndDate: SFDate.EndDate,
State: SFDate.GXSTATE
},
callback: function (options, success, response) {
//查询
Ext.MessageBox.hide();
this.SearchGX();
},
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.storeCW_GXYS.load({
params: {},
waitMsg: "正在查询数据...",
scope: this
});*/
},
GetFBPCList: function () {
var SFDate = this.formSearch_MC.getForm().getValues();
Ext.Msg.wait('正在读取数据...');
Ext.Ajax.request({
waitMsg: '正在读取数据...',
url: '/TruckMng/MsWl_LKPC/GetFBPCList',
params: {
BeginDate: SFDate.BeginDate,
EndDate: SFDate.EndDate,
State: SFDate.GXSTATE
},
callback: function (options, success, response) {
//查询
Ext.MessageBox.hide();
this.SearchFB();
},
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.storeCW_GXYS.load({
params: {},
waitMsg: "正在查询数据...",
scope: this
});*/
}, onResetClick: function (button, event) {
this.formSearch.getForm().reset();
}
});