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.

1651 lines
63 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.MsRptRepairIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsRptRepairIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsRptRepairIndex, Ext.Panel, {
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
sqlcontextc: '',
PageSize: 100,
sortfield: '',
sortdire: '',
bslistdrsortfield: '',
bslistdrsortdire: '',
bslistcrsortfield: '',
bslistcrsortdire: '',
initUIComponents: function () {
this.formname = "formMsRptRepairIndex"; //页面名称
this.sqlcontext = '';
this.sqlcontextc = '';
this.sqlcontextr = '';
this.SelectedPic = '';
this.sqltype = '1';
Ext.Ajax.timeout = 120000;
Ext.define('ActionTextColumn', {
extend: 'Ext.grid.column.Action',
alias: ['widget.actiontextcolumn'],
constructor: function (config) {
var me = this,
cfg = Ext.apply({}, config),
items = cfg.items || [me],
l = items.length,
i,
item;
delete cfg.items;
me.callParent([cfg]);
me.items = items;
me.renderer = function (v, meta) {
v = Ext.isFunction(cfg.renderer) ? cfg.renderer.apply(this, arguments) || '' : '';
meta.tdCls += ' ' + Ext.baseCSSPrefix + 'action-col-cell';
for (i = 0; i < l; i++) {
item = items[i];
item.disable = Ext.Function.bind(me.disableAction, me, [i]);
item.enable = Ext.Function.bind(me.enableAction, me, [i]);
/*v += '<img alt="' + (item.altText || me.altText) + '" src="' + (item.icon || Ext.BLANK_IMAGE_URL) +
'" class="' + Ext.baseCSSPrefix + 'action-col-icon ' + Ext.baseCSSPrefix + 'action-col-' + String(i) + ' ' + (item.disabled ? Ext.baseCSSPrefix + 'item-disabled' : ' ') + (item.iconCls || '') +
' ' + (Ext.isFunction(item.getClass) ? item.getClass.apply(item.scope||me.scope||me, arguments) : (me.iconCls || '')) + '"' +
((item.tooltip) ? ' data-qtip="' + item.tooltip + '"' : '') + ' />';*/
v += '<a href="javascript:void(0);"' +
' class="' + Ext.baseCSSPrefix + 'action-col-icon ' + Ext.baseCSSPrefix + 'action-col-' + String(i) + ' ' + (item.disabled ? Ext.baseCSSPrefix + 'item-disabled' : ' ') + (item.cls || '') +
' ' + (Ext.isFunction(item.getClass) ? item.getClass.apply(item.scope || me.scope || me, arguments) : (me.iconCls || '')) + '"' +
((item.tooltip) ? ' data-qtip="' + item.tooltip + '"' : '') + '>' + (item.text || me.text) + '</a>';
}
return v;
};
}
});
//#region 维修
this.storeListRepair = Ext.create('Ext.data.Store', {
model: 'MsOpCtnRepair',
pageSize: this.PageSize,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpCtnBsCard/GetOpCtnRepairList',
timeout: 120000,
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.initgirdcolums1 = [{
sortable: true, hidden: true,
dataIndex: 'GID',
header: 'GID',
width: 80
}, {
sortable: true, hidden: true,
dataIndex: 'LINKID',
header: 'LINKID',
width: 80
}, {
sortable: true,
dataIndex: 'CTNNO',
header: '箱号',
width: 200
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
width: 200
},
{
sortable: true,
dataIndex: 'AUDITSTATUS',
header: '状态',
width: 150
},
{
sortable: true,
dataIndex: 'REPAIRITEMS',
header: '维修改装项目',
width: 150
},
{
sortable: true,
dataIndex: 'REPAIRTIME',
header: '维修改装日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 150
},
{
sortable: true,
dataIndex: 'CURSTATOIN',
header: '场站',
width: 150
},
{
sortable: true,
dataIndex: 'FEENAME',
header: '费用名称',
width: 150
},
{
sortable: true,
dataIndex: 'CURRENCY',
header: '币别',
width: 150
},
{
sortable: true,
dataIndex: 'AMOUNT',
header: '金额',
width: 150
},
{ sortable: true,
dataIndex: 'IMAGE1',
header: '改装前照片',
width: 140,
renderer: function (value, p, record) {
return '<a href="' + record.data.IMAGE_LINDADDR + '" style=' + '"text-decoration:none"' + '>' + value + '</a>';
}
},
{
xtype: 'actioncolumn',
width: 150,
text: '改装前照片', //操作
items: [{
icon: '/images/icons/L5.gif', // Use a URL in the icon config
tooltip: '预览',
getClass: function (v, meta, rec) {
var filePath = rec.get('IMAGE_LINDADDR');
if (filePath == '' || filePath == null) {
return '';
} else {
return 'button_view';
}
},
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = rec.get('IMAGE_LINDADDR');
if (filePath == '') {
Ext.Msg.show({ title: '提示', msg: '没有文件无法预览!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcContainer/MsOpCtnBsCard/ZipView?handle=check&filePath=" + filePath;
window.open(openUrl, openType, openSet);
//DsOpenEditWin(filePath, "", "650", "1250");
}
}]
},
{
sortable: true,
dataIndex: 'IMAGE2',
header: '改装后照片',
width: 140,
renderer: function (value, p, record) {
return '<a href="' + record.data.IMAGE_LINDADDR2 + '" style=' + '"text-decoration:none"' + '>' + value + '</a>';
}
},
{
xtype: 'actioncolumn',
width: 150,
text: '改装后照片', //操作
items: [{
icon: '/images/icons/L5.gif', // Use a URL in the icon config
tooltip: '预览',
getClass: function (v, meta, rec) {
var filePath = rec.get('IMAGE_LINDADDR2');
if (filePath == '' || filePath == null) {
return '';
} else {
return 'button_view';
}
},
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = rec.get('IMAGE_LINDADDR2');
if (filePath == '') {
Ext.Msg.show({ title: '提示', msg: '没有文件无法预览!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcContainer/MsOpCtnBsCard/ZipView?handle=check&filePath=" + filePath;
window.open(openUrl, openType, openSet);
//DsOpenEditWin(filePath, "", "650", "1250");
}
}]
},
{
sortable: true,
dataIndex: 'REMARKS',
header: '备注',
width: 150
}];
this.girdcolums1 = this.initgirdcolums1;
//明细表表格
this.gridListRepairCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.RepairGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridListRepair = new Ext.grid.GridPanel({
store: this.storeListRepair,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListRepairCellEditing],
selModel: this.RepairGridCheckBoxModel,
selType: 'cellmodel',
columns: this.girdcolums1,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeListRepair,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.girdcolums1 = DsTruck.GetGridPanel(USERID, this.formname+'1', this.girdcolums1, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridListRepair.reconfigure(this.storeListRepair, this.girdcolums1);
this.gridListRepair.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin('/MvcContainer/MsOpCtnBsCard/CtnStatusEdit?bsno=' + record.data.LINKGID, record.data.GID);
}, this);
this.gridListRepair.addListener('sortchange', function (ct, column, direction, eOpts) {
this.bslistdrsortfield = column.dataIndex;
this.bslistdrsortdire = direction;
}, this);
//#endregion
//#region 清洗
this.storeListClearing = Ext.create('Ext.data.Store', {
model: 'MsOpCtnClearing',
pageSize: this.PageSize,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpCtnBsCard/GetOpCtnClearingList',
timeout: 120000,
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.initgirdcolums2=[{
sortable: true, hidden: true,
dataIndex: 'GID',
header: 'GID',
width: 80
}, {
sortable: true, hidden: true,
dataIndex: 'LINKID',
header: 'LINKID',
width: 80
}, {
sortable: true,
dataIndex: 'CTNNO',
header: '箱号',
width: 200
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
width: 200
},
{
sortable: true,
dataIndex: 'AUDITSTATUS',
header: '状态',
width: 150
},
{
sortable: true,
dataIndex: 'CURSTATOIN',
header: '场站',
width: 150
},
{
sortable: true,
dataIndex: 'INSTATOINTIME',
header: '进场时间',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 120
},
{ sortable: true,
dataIndex: 'IMAGE1',
header: '进场照片',
width: 140,
renderer: function (value, p, record) {
return '<a href="' + record.data.IMAGE_LINDADDR + '" style=' + '"text-decoration:none"' + '>' + value + '</a>';
}
},
{
xtype: 'actioncolumn',
width: 50,
text: '进场照片', //操作
items: [{
icon: '/images/icons/L5.gif', // Use a URL in the icon config
tooltip: '预览',
getClass: function (v, meta, rec) {
var filePath = rec.get('IMAGE_LINDADDR');
if (filePath == '' || filePath == null) {
return '';
} else {
return 'button_view';
}
},
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = rec.get('IMAGE_LINDADDR');
if (filePath == '') {
Ext.Msg.show({ title: '提示', msg: '没有文件无法预览!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcContainer/MsOpCtnBsCard/ZipView?handle=check&filePath=" + filePath;
window.open(openUrl, openType, openSet);
//DsOpenEditWin(filePath, "", "650", "1250");
}
}]
}, {
xtype: 'actioncolumn',
width: 50,
text: 'EIR照片', //操作
items: [{
icon: '/images/icons/L5.gif', // Use a URL in the icon config
tooltip: '预览',
getClass: function (v, meta, rec) {
var filePath = rec.get('EIRPATH');
if (filePath == '' || filePath == null) {
return '';
} else {
return 'button_view';
}
},
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = rec.get('EIRPATH');
if (filePath == '') {
Ext.Msg.show({ title: '提示', msg: '没有文件无法预览!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcContainer/MsOpCtnBsCard/ZipView?handle=check&filePath=" + filePath;
window.open(openUrl, openType, openSet);
//DsOpenEditWin(filePath, "", "650", "1250");
}
}]
},
{ sortable: true,
dataIndex: 'EIR',
header: 'EIR照片',
width: 140,
renderer: function (value, p, record) {
return '<a href="' + record.data.EIRPATH + '" style=' + '"text-decoration:none"' + '>' + value + '</a>';
}
},
{
sortable: true,
dataIndex: 'CLEARINGMODE',
header: '清洗方式',
width: 120
}, {
sortable: true,
dataIndex: 'PREGOODSNAME',
header: '前装货',
width: 150
}, {
sortable: true,
dataIndex: 'ISCLEAR_CERT',
header: '是否有清洁证',
hidden: true,
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
},
{
sortable: true,
dataIndex: 'CHECKGOV',
header: '检测机构',
width: 120
}, {
sortable: true,
dataIndex: 'ISCLEAR_PLAN',
header: '发送清洗计划',
hidden: true,
renderer: function (value, cellmeta) {
if (value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
},
{
sortable: true,
dataIndex: 'CLEARTIME',
header: '清洗时间',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 120
},
{ sortable: true,
dataIndex: 'IMAGE_CLEAR',
header: '清洗照片',
width: 140,
renderer: function (value, p, record) {
return '<a href="' + record.data.IMAGE_CLEARPATH + '" style=' + '"text-decoration:none"' + '>' + value + '</a>';
}
},
{
xtype: 'actioncolumn',
width: 50,
text: '清洗照片', //操作
items: [{
icon: '/images/icons/L5.gif', // Use a URL in the icon config
tooltip: '预览',
getClass: function (v, meta, rec) {
var filePath = rec.get('IMAGE_CLEARPATH');
if (filePath == '' || filePath == null) {
return '';
} else {
return 'button_view';
}
},
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = rec.get('IMAGE_CLEARPATH');
if (filePath == '') {
Ext.Msg.show({ title: '提示', msg: '没有文件无法预览!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcContainer/MsOpCtnBsCard/ZipView?handle=check&filePath=" + filePath;
window.open(openUrl, openType, openSet);
//DsOpenEditWin(filePath, "", "650", "1250");
}
}]
},
{ sortable: true,
dataIndex: 'IMAGE_CHECKGOV',
header: '清洁证照片',
width: 140,
renderer: function (value, p, record) {
return '<a href="' + record.data.IMAGE_CHECKGOVPATH + '" style=' + '"text-decoration:none"' + '>' + value + '</a>';
}
},
{
xtype: 'actioncolumn',
width: 50,
text: '清洁证照片', //操作
items: [{
icon: '/images/icons/L5.gif', // Use a URL in the icon config
tooltip: '预览',
getClass: function (v, meta, rec) {
var filePath = rec.get('IMAGE_CHECKGOVPATH');
if (filePath == '' || filePath == null) {
return '';
} else {
return 'button_view';
}
},
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = rec.get('IMAGE_CHECKGOVPATH');
if (filePath == '') {
Ext.Msg.show({ title: '提示', msg: '没有文件无法预览!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcContainer/MsOpCtnBsCard/ZipView?handle=check&filePath=" + filePath;
window.open(openUrl, openType, openSet);
//DsOpenEditWin(filePath, "", "650", "1250");
}
}]
}, {
sortable: true,
dataIndex: 'ISCOMPLETE',
header: '是否完成',
hidden: true,
renderer: function (value, cellmeta) {
if (value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
},
{
sortable: true,
dataIndex: 'FEENAME',
header: '费用名称',
width: 150
},
{
sortable: true,
dataIndex: 'CURRENCY',
header: '币别',
width: 150
},
{
sortable: true,
dataIndex: 'AMOUNT',
header: '金额',
width: 150
}, {
sortable: true,
dataIndex: 'REMARKS',
header: '备注',
width: 150
}];
this.girdcolums2 = this.initgirdcolums2;
//明细表表格
this.gridListClearing = new Ext.grid.GridPanel({
store: this.storeListClearing,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selType: 'cellmodel',
columns: this.girdcolums2,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeListClearing,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridListClearing.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin('/MvcContainer/MsOpCtnBsCard/CtnStatusEdit?bsno=' + record.data.LINKGID, record.data.GID);
}, this);
this.girdcolums2 = DsTruck.GetGridPanel(USERID, this.formname+'2', this.girdcolums2, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridListClearing.reconfigure(this.storeListClearing, this.girdcolums2);
this.gridListClearing.addListener('sortchange', function (ct, column, direction, eOpts) {
this.bslistcrsortfield = column.dataIndex;
this.bslistcrsortdire = direction;
}, this);
//#region formSearch 查询面板
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
region: 'north',
height: 50,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '箱号',
name: 'CTNNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '0';
_this.onRefreshClick();
}
}
}
}, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.sqltype = '0';
this.onRefreshClick(button, event);
},
scope: this
}, {
xtype: 'button',
width: 90,
text: "高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
this.sqltype = '0';
winAccess.StoreList = this.storeListClearing;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }]
}
]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
this.formSearchRepaire = Ext.widget('form', {
frame: true,
region: 'north',
height: 50,
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: 'CTNNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '1';
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '维修日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDbgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '1';
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDend',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '1';
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '录入日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'INPUTbgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '1';
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'INPUTend',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '1';
_this.onRefreshClick();
}
}
}
}, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.sqltype = '1';
this.onRefreshClick(button, event);
},
scope: this
}, {
xtype: 'button',
width: 90,
text: "高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getConditionr();
var winAccess = new Shipping.DsQuery({
});
this.sqltype = '1';
winAccess.StoreList = this.storeListClearing;
winAccess.formname = this.formname+"1";
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}]
}
]//end items(fieldset 1)
}]//end root items
});
this.formSearchClear = Ext.widget('form', {
frame: true,
region: 'north',
height: 50,
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: 'CTNNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '2';
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '清洗日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDbgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '2';
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDend',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '2';
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '录入日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'INPUTbgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '2';
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'INPUTend',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
this.sqltype = '2';
_this.onRefreshClick();
}
}
}
}, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.sqltype = '2';
this.onRefreshClick(button, event);
},
scope: this
}, {
xtype: 'button',
width: 90,
text: "高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getConditionc();
var winAccess = new Shipping.DsQuery({
});
this.sqltype = '2';
winAccess.StoreList = this.storeListClearing;
winAccess.formname = this.formname+'2';
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}]
}
]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
this.panelRepair = new Ext.Panel({
title: '维修改装信息',
layout: "border",
region: 'center',
animate: true,
split: true,
// autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formSearchRepaire ,this.gridListRepair]
});
this.panelClearing = new Ext.Panel({
title: '清洗信息',
layout: "border",
region: 'center',
animate: true,
// autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.formSearchClear,this.gridListClearing]
});
//#endregion
this.tabpanel = new Ext.TabPanel
({
activeTab: 0,
autoWidth: true,
border: false,
frame: false,
region: 'center',
id: "TabPanelID",
enableTabScroll: true,
items:
[
this.panelRepair,
this.panelClearing
]
});
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
},
{
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
},
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
handler: function (button, event) {
this.Print();
},
scope: this
}, '-', {
text: "保存列表样式",
id: "btntest",
menu: [
{ text: "保存列表",
handler: function (button, event) {
_this.onSaveGridClick(button, event);
}
}, { text: "刷新列表",
handler: function (button, event) {
_this.oninitGridClick(button, event);
}
}],
scope: this
}, {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}
]
});
// this.panelTop = new Ext.Panel({
// layout: "border",
// region: "north",
// height: 75,
// items: [this.formSearch, this.panelBtn]
// });
Ext.apply(this, {
items: [this.panelBtn, this.formSearch,this.tabpanel]
});
this.sqlcontext = '';
this.storeListRepair.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontextr });
}, this);
this.storeListClearing.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontextc });
}, this);
// this.onRefreshClick();
}, //end initUIComponents
InitGrid: function (grid) {
var agirdcolums = grid;
this.gridList.reconfigure(this.storeList, agirdcolums);
},
onRefreshClick: function (button, event) {
this.sqlcontext = this.getCondition();
if (this.sqltype == '0') {
var sql = this.getConditionr();
this.sqlcontextr = sql;
this.storeListRepair.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
var sql2 = this.getConditionc();
this.sqlcontextc = sql2;
this.storeListClearing.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql2 },
waitMsg: "正在查询数据...",
scope: this
});
} else {
if (this.sqltype == '1') {
var sql = this.getConditionr();
this.sqlcontextr = sql;
this.storeListRepair.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
} else if (this.sqltype == '2') {
var sql2 = this.getConditionc();
this.sqlcontextc = sql2;
this.storeListClearing.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql2 },
waitMsg: "正在查询数据...",
scope: this
});
}
}
},
onDsQuery: function () {
if (this.sqltype == '0') {
var sql = this.sqlcontext;
this.sqlcontextr = sql;
this.storeListRepair.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
var sql2 = this.sqlcontext;
this.sqlcontextc = sql2;
this.storeListClearing.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql2 },
waitMsg: "正在查询数据...",
scope: this
});
} else {
if (this.sqltype == '1') {
var sql = this.sqlcontext;
this.sqlcontextr = sql;
this.storeListRepair.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
} else if (this.sqltype == '2') {
var sql2 = this.sqlcontext;
this.sqlcontextc = sql2;
this.storeListClearing.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql2 },
waitMsg: "正在查询数据...",
scope: this
});
}
}
},
onAuditPassClick: function () {
var selections = this.gridListRepair.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择需审核的改装信息!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.AUDITSTATUS;
if (BILLSTATUS == '提交审核' || BILLSTATUS == '申请修改') {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: '提示', msg: '当前状态不允许审核!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.confirm('提示', '确定审核通过选中的业务吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在审核数据...');
Ext.Ajax.request({
waitMsg: '正在审核数据...',
url: '/MvcContainer/MsOpCtnBsCard/AuditOpCtnRepair',
params: {
data: jsonbodyAddDatas,
type: '0'
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.onRefreshClick();
Ext.Msg.show({ title: '提示', msg: '审核成功!', 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);
},
onAuditBackClick: function () {
var selections = this.gridListBody.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择需驳回的单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.AUDITSTATUS;
if ((BILLSTATUS == '审核通过' || BILLSTATUS == '提交审核')) {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: '提示', msg: '当前状态不允许驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.confirm('提示', '确定驳回选中的业务吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在驳回数据...');
Ext.Ajax.request({
waitMsg: '正在驳回数据...',
url: '/MvcContainer/MsOpCtnBsCard/AuditOpCtnRepair',
params: {
data: jsonbodyAddDatas,
type: '4'
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.onRefreshClick();
Ext.Msg.show({ title: '提示', msg: '驳回成功!', 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);
},
getGridPicButton: function (txt) {
return "<button class=\"button_grid tip tip-right\" data-tip=\"\" onclick=\" this.SelectedPic='" + txt + "'\"></button>";
},
getCondition: function () {
var sql = '';
var formAll = this.formSearch.getForm();
var CTNNO = formAll.findField('CTNNO').getValue();
sql = sql + getAndConSql(sql, CTNNO, " LINKGID in (select GID from op_ctnbscard where CTNGID in (select GID from code_ctntk where CTNNO like '%" + CTNNO + "%' or PCTNNO like '%" + CTNNO + "%') OR (GID IN (SELECT LINKGID FROM Code_CtnTkBefore WHERE CTNNO like '%" + CTNNO + "%')) )");
return sql;
},
getConditionr: function () {
var form = this.formSearchRepaire.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var formAll = this.formSearch.getForm();
var CTNNO = formAll.findField('CTNNO').getValue();
sql = sql + getAndConSql(sql, CTNNO, " LINKGID in (select GID from op_ctnbscard where CTNGID in (select GID from code_ctntk where CTNNO like '%" + CTNNO + "%' or PCTNNO like '%" + CTNNO + "%') OR (GID IN (SELECT LINKGID FROM Code_CtnTkBefore WHERE CTNNO like '%" + CTNNO + "%')) )");
var CTNNO = form.findField('CTNNO').getValue();
sql = sql + getAndConSql(sql, CTNNO, " LINKGID in (select GID from op_ctnbscard where CTNGID in (select GID from code_ctntk where CTNNO like '%" + CTNNO + "%' or PCTNNO like '%" + CTNNO + "%') OR (GID IN (SELECT LINKGID FROM Code_CtnTkBefore WHERE CTNNO like '%" + CTNNO + "%')) )");
var expDateBgn = form.findField('ETDbgn').getRawValue();
sql = sql + getAndConSql(sql, expDateBgn, "REPAIRTIME>='" + expDateBgn + "'");
var expDateEnd = form.findField('ETDend').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "REPAIRTIME<='" + expDateEnd + " 23:59:59'");
var expINPUTBgn = form.findField('INPUTbgn').getRawValue();
sql = sql + getAndConSql(sql, expINPUTBgn, "INPUTTIME>='" + expINPUTBgn + "'");
var expINPUTEnd = form.findField('INPUTend').getRawValue();
sql = sql + getAndConSql(sql, expINPUTEnd, "INPUTTIME<='" + expINPUTEnd + " 23:59:59'");
return sql;
},
getConditionc: function () {
var form = this.formSearchClear.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var formAll = this.formSearch.getForm();
var CTNNO = formAll.findField('CTNNO').getValue();
sql = sql + getAndConSql(sql, CTNNO, " LINKGID in (select GID from op_ctnbscard where CTNGID in (select GID from code_ctntk where CTNNO like '%" + CTNNO + "%' or PCTNNO like '%" + CTNNO + "%') OR (GID IN (SELECT LINKGID FROM Code_CtnTkBefore WHERE CTNNO like '%" + CTNNO + "%')) )");
var CTNNO = form.findField('CTNNO').getValue();
sql = sql + getAndConSql(sql, CTNNO, " LINKGID in (select GID from op_ctnbscard where CTNGID in (select GID from code_ctntk where CTNNO like '%" + CTNNO + "%' or PCTNNO like '%" + CTNNO + "%') OR (GID IN (SELECT LINKGID FROM Code_CtnTkBefore WHERE CTNNO like '%" + CTNNO + "%')) )");
var expDateBgn = form.findField('ETDbgn').getRawValue();
sql = sql + getAndConSql(sql, expDateBgn, "CLEARTIME>='" + expDateBgn + "'");
var expDateEnd = form.findField('ETDend').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "CLEARTIME<='" + expDateEnd + " 23:59:59'");
var expINPUTBgn = form.findField('INPUTbgn').getRawValue();
sql = sql + getAndConSql(sql, expINPUTBgn, "INPUTTIME>='" + expINPUTBgn + "'");
var expINPUTEnd = form.findField('INPUTend').getRawValue();
sql = sql + getAndConSql(sql, expINPUTEnd, "INPUTTIME<='" + expINPUTEnd + " 23:59:59'");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.SelectedPic;
return ret;
},
onSaveGridClick: function (button, event) {
if (this.tabpanel.getActiveTab() == this.panelRepair) {
this.girdcolums1 = DsTruck.SaveGridPanel(USERID, this.formname + '1', this.gridListRepair.columns, this.girdcolums1, 1, true);
} else if (this.tabpanel.getActiveTab() == this.panelClearing) {
this.girdcolums2 = DsTruck.SaveGridPanel(USERID, this.formname + '2', this.gridListClearing.columns, this.girdcolums2, 1, true);
}
},
oninitGridClick: function (button, event) {
if (this.tabpanel.getActiveTab() == this.panelRepair) {
this.gridListRepair.reconfigure(this.storeListRepair, this.initgirdcolums1);
this.girdcolums1 = DsTruck.SaveGridPanel(USERID, this.formname + '1', this.gridListRepair.columns, this.initgirdcolums1, 1, true);
} else if (this.tabpanel.getActiveTab() == this.panelClearing) {
this.gridListClearing.reconfigure(this.storeListClearing, this.initgirdcolums2);
this.girdcolums2 = DsTruck.SaveGridPanel(USERID, this.formname + '2', this.gridListClearing.columns, this.initgirdcolums2, 1, true);
}
},
onExportClick: function (button, event) {
_this = this;
if (this.tabpanel.getActiveTab() == this.panelRepair) {
if (this.storeListRepair.getCount() == 0) {
return;
}
var sortstr = ' LINKGID,REPAIRTIME';
if (this.bslistdrsortfield != '' && this.bslistdrsortdire != '') {
sortstr = this.bslistdrsortfield + ' ' + this.bslistdrsortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcContainer/MsOpCtnBsCard/GetOpCtnRepairListStr',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: this.sqlcontextr,
sortstr: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSRPTREPAIR';
var sql1 = returnstr;
sql1 = sql1.replace(/\+/g, "@@@")
if (sql1 != '') {
GridExportBySql(sql1, this.formname+'1', '维修报表.xls');
}
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
} else if (this.tabpanel.getActiveTab() == this.panelClearing) {
if (this.storeListClearing.getCount() == 0) {
return;
}
var sortstr = ' LINKGID,CLEARTIME';
if (this.bslistcrsortfield != '' && this.bslistcrsortdire != '') {
sortstr = this.bslistcrsortfield + ' ' + this.bslistcrsortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcContainer/MsOpCtnBsCard/GetOpCtnClearingListStr',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: this.sqlcontextc,
sortstr: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSRPTREPAIR2';
var sql1 = returnstr;
sql1 = sql1.replace(/\+/g, "@@@")
if (sql1 != '') {
GridExportBySql(sql1, this.formname + '2', '清洗报表.xls');
}
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
},
Print: function () {
_this = this;
if (this.tabpanel.getActiveTab() == this.panelRepair) {
if (this.storeListRepair.getCount() == 0) {
return;
}
var sortstr = ' LINKGID,REPAIRTIME';
if (this.bslistdrsortfield != '' && this.bslistdrsortdire != '') {
sortstr = this.bslistdrsortfield + ' ' + this.bslistdrsortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcContainer/MsOpCtnBsCard/GetOpCtnRepairListStr',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: this.sqlcontext,
sortstr: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSRPTREPAIR';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
} else if (this.tabpanel.getActiveTab() == this.panelClearing) {
if (this.storeListClearing.getCount() == 0) {
return;
}
var sortstr = ' LINKGID,CLEARTIME';
if (this.bslistcrsortfield != '' && this.bslistcrsortdire != '') {
sortstr = this.bslistcrsortfield + ' ' + this.bslistcrsortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcContainer/MsOpCtnBsCard/GetOpCtnClearingListStr',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: this.sqlcontextc,
sortstr: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSRPTREPAIR2';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
}
});