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/MsInfoClient/MsInfoClientDsIndex.js

1619 lines
63 KiB
JavaScript

3 years ago
Ext.namespace('Shipping');
Shipping.MsInfoClientDsIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsInfoClientDsIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsInfoClientDsIndex, Ext.Panel, {
PageSize: 100,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isShowAdvancedQuery: 0, //是否显示高级查询面板
sqlcontext: '',
editype: '',
selectbsno: '',
sortfield: '',
sortdire: '',
initUIComponents: function () {
this.formname = "formInfoClientIndex"; //页面名称
this.CUSTID = '';
//定义数据集
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CtnDispModel',
proxy: { url: '/CommMng/BasicDataRef/GetCtnDisp' }
});
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsInfoClientModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsInfoClient/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#region List列表显示信息
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
_thisclient = this;
//本公司 往来单位列表
this.initgirdcolums = [{
sortable: true,
id: '',
dataIndex: '',
header: '',
width: 0
}, {
sortable: true,
id: '',
dataIndex: 'GID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
id: '',
dataIndex: 'PCORPNAME',
header: '客户级别',
width: 70
}, {
sortable: true,
id: '',
dataIndex: 'CODENAME',
header: '客户代码',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'SHORTNAME',
header: '客户简称',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'DESCRIPTION',
header: '客户全称',
width: 200
}, {
sortable: true,
id: '',
dataIndex: 'ADDR',
header: '地址',
width: 200
},
{
sortable: true,
id: '',
dataIndex: 'CHIEF',
header: '联系人',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'TEL',
header: '电话',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'CUSTTYPE',
header: '客户类型',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'CUSTCLASS',
header: '客户来源',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'CUSTGUIMO',
header: '客户规模',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'STLNAME',
header: '结费方式',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'STLFIRSTHALFDATE',
header: '安装时间',
width: 100
},
{
sortable: true,
id: '',
dataIndex: 'STLMIDDLEDATE',
header: '维护截止时间',
width: 100
},
{
sortable: true,
id: '',
dataIndex: 'FAX',
header: '手机',
width: 100
},
{
sortable: true,
id: '',
dataIndex: 'EMAIL',
header: '邮箱',
width: 100
},
{
sortable: true,
id: '',
dataIndex: 'SALE',
header: '揽货人',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OP',
header: '客户经理',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'DOC',
header: '客服',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OPNAME',
header: '录入人',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OPTIME',
header: '录入日期',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'BLSTATUSREF',
header: '审核状态',
width: 80
}];
this.girdcolums = this.initgirdcolums;
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
},
listeners: {
cellclick: function (thisTab, record, item, index, e, eOpts) {
if (index == 10) {//设置按钮列
// alert('用户编号=' + this.getStore().getAt(rowIndex).data.usercode);
}
}
},
columns: this.girdcolums,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
/////////////以下部分为获取存储的gridpanel显示样式
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.columns[0] = new Ext.grid.RowNumberer();
////////////////////////////////////////////////
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
var openSet = "height=700, width=1224, 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 = "/MvcShipping/MsInfoClient/DsEdit";
window.open(openUrl, openType, openSet);
}, this);
this.gridList.getSelectionModel().on('select', function (model, record, index) {
var GID = record.data.GID;
this.CUSTID = record.data.GID;
this.RefreshCover(GID);
}, this);
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
//#region formSearch 下拉框信息加载
//权限范围
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modExchangesUnit"} });
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeOpCode.load();
//揽货人
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeOpCode,
forceSelection: true,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户经理', //操 作
store: this.storeOpCode,
forceSelection: true,
name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//单证
this.comboxDOC = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客服', //单 证
store: this.storeOpCode,
forceSelection: true,
name: 'DOC',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//#region formSearch 权限范围
//
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modExchangesUnit"} });
this.storeBLSTATUS = Ext.create('Ext.data.Store', {
fields: ['BLSTATUS', 'BLSTATUSREF']
});
this.storeBLSTATUS.add({ "BLSTATUS": "1", "BLSTATUSREF": "录入状态" });
this.storeBLSTATUS.add({ "BLSTATUS": "2", "BLSTATUSREF": "提交审核" });
this.storeBLSTATUS.add({ "BLSTATUS": "0", "BLSTATUSREF": "审核通过" });
this.storeBLSTATUS.add({ "BLSTATUS": "6", "BLSTATUSREF": "驳回提交" });
this.comboxBLSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '审核状态',
store: this.storeBLSTATUS,
forceSelection: true,
name: 'BLSTATUS',
valueField: 'BLSTATUS',
displayField: 'BLSTATUSREF'
});
//#endregion
//键值维护表_客户级别
this.storeCrmKeyCodeCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CrmKeyCodeModel',
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
});
this.storeCrmKeyCodeCode.load({ params: { condition: " and KEYTYPE='客户级别'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户级别',
//labelWidth: 50,
store: this.storeCrmKeyCodeCode,
forceSelection: true,
name: 'PCORPNAME',
//width: 100,
valueField: 'KEYVALUE',
displayField: 'KEYVALUE',
value: ''
});
//#endregion
//#region formSearch 查询面板
_thisclient = this;
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 65,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '代码或简称',
name: 'MblNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisclient.onRefreshClick();
}
}
}
}, this.comboxSALE, this.comboxOP, this.comboxDOC
// , {
// fieldLabel: '财务代码/序号',
// name: 'CODENO',
// enableKeyEvents: true,
// listeners: {
// specialkey: function (field, e) {
// if (e.getKey() == e.ENTER) {
// _this.onRefreshClick();
// }
// }
// }
// }
// , {
// fieldLabel: '联系人',
// name: 'ATTN',
// enableKeyEvents: true,
// listeners: {
// specialkey: function (field, e) {
// if (e.getKey() == e.ENTER) {
// _this.onRefreshClick();
// }
// }
// }
// }, {
// fieldLabel: '录入日期',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'ETDbgn',
// enableKeyEvents: true,
// listeners: {
// specialkey: function (field, e) {
// if (e.getKey() == e.ENTER) {
// _this.onRefreshClick();
// }
// }
// }
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'ETDend',
// enableKeyEvents: true,
// listeners: {
// specialkey: function (field, e) {
// if (e.getKey() == e.ENTER) {
// _this.onRefreshClick();
// }
// }
// }
// }
, this.comboxBLSTATUS, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '安装时间',
name: 'STLFIRSTHALFDATEbgn',
format: 'Y-m-d',
xtype: 'datefield',
tooltip: '日期格式XXXX-XX-XX',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisclient.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
name: 'STLFIRSTHALFDATEend',
format: 'Y-m-d',
xtype: 'datefield',
tooltip: '日期格式XXXX-XX-XX',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisclient.onRefreshClick();
}
}
}
}, {
fieldLabel: '维护截止',
name: 'STLMIDDLEDATEbgn',
format: 'Y-m-d',
xtype: 'datefield',
tooltip: '日期格式XXXX-XX-XX',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisclient.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
name: 'STLMIDDLEDATEend',
format: 'Y-m-d',
xtype: 'datefield',
tooltip: '日期格式XXXX-XX-XX',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisclient.onRefreshClick();
}
}
}
}, this.comboxCustCode, {
// text: "重置条件",
xtype: 'button',
width: 45,
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, {
xtype: 'button',
width: 45,
// text: "高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}]
}]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
this.storeCUSTPROP = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeCUSTPROP.add({ "DC": "", "NAME": "全部" });
this.storeCUSTPROP.add({ "DC": "1", "NAME": "潜在客户" });
this.storeCUSTPROP.add({ "DC": "0", "NAME": "合作客户" });
this.comboxCUSTPROP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户属性',
store: this.storeCUSTPROP,
valueField: 'DC',
displayField: 'NAME',
labelWidth: 60,
width: 160,
forceSelection: true,
name: 'CUSTPROP',
value: '',
enableKeyEvents: true,
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
_thisclient.onRefreshClick();
}
}
});
this.StoreQueryCompare = Ext.create('Ext.data.Store', {
fields: ['BL']
});
this.StoreQueryCompare.add({ "BL": "全部" });
this.StoreQueryCompare.add({ "BL": "本日" });
this.StoreQueryCompare.add({ "BL": "明日" });
this.StoreQueryCompare.add({ "BL": "昨日" });
this.StoreQueryCompare.add({ "BL": "本周" });
this.StoreQueryCompare.add({ "BL": "上周" });
this.StoreQueryCompare.add({ "BL": "下周" });
this.StoreQueryCompare.add({ "BL": "本月" });
this.StoreQueryCompare.add({ "BL": "上月" });
this.StoreQueryCompare.add({ "BL": "下月" });
this.comboxCOMPARE = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreQueryCompare,
fieldLabel: '拜访记录', //'揽货人',
forceSelection: true,
labelWidth: 60,
width: 120,
valueField: 'BL',
displayField: 'BL',
value: '全部',
name: 'COMPARE',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
_thisclient.onRefreshClick();
}
}
});
this.StoreQueryCompare2 = Ext.create('Ext.data.Store', {
fields: ['BL']
});
this.StoreQueryCompare2.add({ "BL": "全部" });
this.StoreQueryCompare2.add({ "BL": "本日" });
this.StoreQueryCompare2.add({ "BL": "明日" });
this.StoreQueryCompare2.add({ "BL": "昨日" });
this.StoreQueryCompare2.add({ "BL": "本周" });
this.StoreQueryCompare2.add({ "BL": "上周" });
this.StoreQueryCompare2.add({ "BL": "下周" });
this.StoreQueryCompare2.add({ "BL": "本月" });
this.StoreQueryCompare2.add({ "BL": "上月" });
this.StoreQueryCompare2.add({ "BL": "下月" });
this.comboxCOMPARE2 = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreQueryCompare2,
fieldLabel: '计划', //'揽货人',
forceSelection: true,
valueField: 'BL',
displayField: 'BL',
labelWidth: 40,
width: 100,
value: '全部',
name: 'COMPARE2',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
_thisclient.onRefreshClick();
}
}
});
_thisclient = this;
//按钮工具条_
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
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 = "/MvcShipping/MsInfoClient/DsEdit";
window.open(openUrl, openType, openSet);
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-', {
text: "转 正",
iconCls: "btnupload",
id: 'btnupload2',
handler: function (button, event) {
this.onStartClick(button, event);
},
scope: this
}, '-', {
text: "提交审核",
iconCls: "btnupload",
id:'btnupload',
handler: function (button, event) {
this.onStartClick(button, event);
},
scope: this
}, {
text: "撤回提交",
iconCls: "btncomm",
id: 'btncomm',
handler: function (button, event) {
this.onBackClick(button, event);
},
scope: this
}
, {
text: "审核通过", id: "btnAudit",
iconCls: "btnconfirm",
handler: function (button, event) {
this.onAuditClick(button, event);
},
scope: this
}, {
text: "驳回提交", id: "btnAuditBack",
iconCls: "btnrefuse",
handler: function (button, event) {
this.onAuditBackClick(button, event);
},
scope: this
}, '-', {
text: "保存列表样式",
id: "btntest",
menu: [
{ text: "保存",
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _thisclient.formname, _thisclient.gridList.columns, _thisclient.girdcolums, 1, true);
}
}, { text: "初始化",
handler: function (menu, event) {
_thisclient.InitGrid(_thisclient.initgirdcolums);
_thisclient.girdcolums = DsTruck.SaveGridPanel(USERID, _thisclient.formname, _thisclient.gridList.columns, _thisclient.initgirdcolums, 1, true);
}
}],
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
menu: [
{ text: "全部",
handler: function (menu, event) {
_thisclient.Print();
}
}, { text: "选择打印",
handler: function (menu, event) {
_thisclient.PrintSelect();
}
}],
scope: this
}, {
text: "名称更改",
iconCls: "btndelete",
handler: function (button, event) {
this.UpdateCustomersWith(button, event);
},
scope: this
}, {
text: "客户合并",
iconCls: "btndelete",
handler: function (button, event) {
this.RepeatCustomersWith(button, event);
},
scope: this
}, '-', this.comboxCUSTPROP, {
fieldLabel: '模糊检索',
xtype: 'textfield',
name: 'DESC',
id:'DESC',
labelWidth: 60,
width: 160,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisclient.onRefreshClick();
}
}
}
}, '-', {
text: '显示拜访信息',
id: 'btnYZ',
handler: function (button, event) {
this.readingPaneChange(button, 2);
},
scope: this
}, this.comboxCOMPARE, this.comboxCOMPARE2]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 100,
items: [this.panelBtn, this.formSearch]
});
this.panelVisitIndex = new Shipping.MsCrmClientVisitIndex({
title: '拜访记录',
layout: "border",
// region: 'north',
height: 300,
anchor: '100% 50%',
frame: true,
split: true
});
this.panelVisitPlanIndex = new Shipping.MsCrmClientVisitPlanIndex({
title: '拜访计划',
layout: "border",
//region: 'north',
height: 300,
anchor: '100% 50%',
frame: true,
});
this.panelVisitIndex.formSearch.getForm().findField('CLIENTGID').setVisible(false);
this.panelVisitIndex.formSearch.getForm().findField('SALE').setVisible(false);
this.panelVisitIndex.formSearch.getForm().findField('COMPARE').setValue('全部');
this.panelVisitIndex.formSearch.getForm().findField('ETDbgn').setValue('');
this.panelVisitIndex.formSearch.getForm().findField('ETDend').setValue('');
this.panelVisitPlanIndex.formSearch.getForm().findField('CLIENTGID').setVisible(false);
this.panelVisitPlanIndex.formSearch.getForm().findField('SALE').setVisible(false);
this.PluginYZ = new Ext.Panel({
//layout: "border",
layout: "anchor",
split: true,
width: 600,
hidden: true,
region: 'east',
items: [
this.panelVisitIndex, this.panelVisitPlanIndex
]
});
//this.PluginYZ = Ext.Panel({
// region: 'east',
// layout: "fit",
// width: 600,
// items: [this.panelVisitIndexPlan]
//});
Ext.apply(this, {
items: [this.panelTop, this.gridList, this.PluginYZ]
});
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: '', load: 'true' },
waitMsg: "正在查询数据...",
scope: this
});
this.storeList.on('beforeload', function (store) {
// var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: _thisclient.sqlcontext });
}, this);
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modCrmClientVisible"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
var btnAuditBack = Ext.getCmp('btnAuditBack');
btnAuditBack.setVisible(false);
var btnAudit = Ext.getCmp('btnAudit');
btnAudit.setVisible(false);
var btnupload = Ext.getCmp('btnupload');
btnupload.setVisible(false);
var btncomm = Ext.getCmp('btncomm');
btncomm.setVisible(false);
} else {
var btnupload2 = Ext.getCmp('btnupload2');
btnupload2.setVisible(false);
var btnYZ = Ext.getCmp('btnYZ');
btnYZ.setVisible(false);
}
} else {
var btnupload2 = Ext.getCmp('btnupload2');
btnupload2.setVisible(false);
var btnYZ = Ext.getCmp('btnYZ');
btnYZ.setVisible(false);
}
},
scope: this
});
}, //end initUIComponents
onRefreshClick: function (button, event) {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
readingPaneChange: function (btn, type) {
// this.east.removeAll();
// this.eastYZ.add(this.PluginYZ);
// this.east.doLayout()
switch (btn.text) {
case '显示拜访信息':
this.PluginYZ.show();
Ext.getCmp('btnYZ').setText('隐藏拜访信息');
this.RefreshCover(this.CUSTID);
break;
default:
this.PluginYZ.hide();
Ext.getCmp('btnYZ').setText('显示拜访信息');
break;
}
},
createEastYZ: function () {
this.eastYZ = Ext.create('Ext.panel.Panel', {
layout: 'fit',
region: 'east',
//title: '运踪',
flex: 1,
split: true,
hidden: true,
width: 620,
minWidth: 620,
border: false
});
return this.eastYZ;
},
RefreshCover: function (custid) {
if (this.PluginYZ.isHidden() != true) {
this.panelVisitIndex.LoadData(custid);
this.panelVisitPlanIndex.LoadData(custid);
}
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.sqlcontext;
this.storeList.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 (this.StoreOpRange.getCount() == 0) {
Ext.Msg.show({ title: '警告', msg: '权限不足,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
} else {
var op = record.data.OPNAME;
var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', op);
if (records.getCount() > 0) {
} else {
canedit = false;
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: '/MvcShipping/MsInfoClient/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);
},
//end initUIComponents
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
// var form2 = this.formSearch2.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
this.isShowAdvancedQuery = 0;
//
var sql = ' 1=1 ';
//#region formSearch 查询面板
var MblNo = form.findField('MblNo').getValue();
sql = sql + getAndConSql(sql, MblNo, "(CODENAME like '%" + MblNo + "%' or SHORTNAME like '%" + MblNo + "%')");
var sSALE = form.findField('SALE').getValue();
sql = sql + getAndConSql(sql, sSALE, "SALE='" + sSALE + "'");
var sOP = form.findField('OP').getValue();
sql = sql + getAndConSql(sql, sOP, "OP='" + sOP + "'");
var sDOC = form.findField('DOC').getValue();
sql = sql + getAndConSql(sql, sDOC, "DOC='" + sDOC + "'");
var STLFIRSTHALFDATEbgn = form.findField('STLFIRSTHALFDATEbgn').getRawValue();
sql = sql + getAndConSql(sql, STLFIRSTHALFDATEbgn, "STLFIRSTHALFDATE >='" + STLFIRSTHALFDATEbgn + "'");
var STLFIRSTHALFDATEend = form.findField('STLFIRSTHALFDATEend').getRawValue();
sql = sql + getAndConSql(sql, STLFIRSTHALFDATEend, "STLFIRSTHALFDATE <='" + STLFIRSTHALFDATEend + "'");
var STLMIDDLEDATEbgn = form.findField('STLMIDDLEDATEbgn').getRawValue();
sql = sql + getAndConSql(sql, STLMIDDLEDATEbgn, "STLMIDDLEDATE >='" + STLMIDDLEDATEbgn + "'");
var STLMIDDLEDATEend = form.findField('STLMIDDLEDATEend').getRawValue();
sql = sql + getAndConSql(sql, STLMIDDLEDATEend, "STLMIDDLEDATE <='" + STLMIDDLEDATEend + "'");
var BLSTATUS = form.findField('BLSTATUS').getValue();
sql = sql + getAndConSql(sql, BLSTATUS, " BLSTATUS=" + BLSTATUS);
var PCORPNAME = form.findField('PCORPNAME').getValue();
sql = sql + getAndConSql(sql, PCORPNAME, " PCORPNAME='" + PCORPNAME + "'");
var CUSTPROP = this.comboxCUSTPROP.getValue();
if (CUSTPROP == '') {
} else if (CUSTPROP == '0') {
sql = sql + getAndConSql(sql, CUSTPROP, " blstatus=0 ");
} else if (CUSTPROP == '1') {
sql = sql + getAndConSql(sql, CUSTPROP, " isnull(blstatus,0)<>0 ");
}
var COMPARE2 = this.comboxCOMPARE2.getRawValue();
if (COMPARE2 != "全部") {
var plansql2 = ' EXISTS (select 1 from crm_info_client_visit c where c.CLIENTGID=info_client.GID ';
if (COMPARE2 == '本日') {
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d');
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydatestr.format("yyyy-MM-dd")+" 23:59:59') ";
} else if (COMPARE2 == '明日') {
var myDate = new Date();
myDate.setTime(myDate.getTime() + 24 * 60 * 60 * 1000);
var mydatestr = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydatestr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE2 == '昨日') {
var myDate = new Date();
myDate.setTime(myDate.getTime() - 24 * 60 * 60 * 1000);
var mydatestr = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydatestr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE2 == '本周') {
var now = new Date(); //当前日期
var nowDayOfWeek = now.getDay(); //今天本周的第几天
var nowDay = now.getDate(); //当前日
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var mydatestr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
var mydateendstr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 7);
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE2 == '下周') {
var now = new Date(); //当前日期
now.setTime(now.getTime() + 7 * 24 * 60 * 60 * 1000);
var nowDayOfWeek = now.getDay(); //今天本周的第几天
var nowDay = now.getDate(); //当前日
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var mydatestr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
var mydateendstr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 7);
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE2 == '上周') {
var now = new Date(); //当前日期
now.setTime(now.getTime() - 7 * 24 * 60 * 60 * 1000);
var nowDayOfWeek = now.getDay(); //今天本周的第几天
var nowDay = now.getDate(); //当前日
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var mydatestr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
var mydateendstr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 7);
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE2 == '本月') {
var now = new Date(); //当前日期
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var mydatestr = new Date(nowYear, nowMonth, 1);
var mydateendstr = new Date(nowYear, nowMonth, getMonthDays(nowMonth));
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE2== '下月') {
var lastMonthDate = new Date(); //上月日期
lastMonthDate.setDate(1);
lastMonthDate.setMonth(lastMonthDate.getMonth() + 1);
var lastYear = lastMonthDate.getFullYear();
var lastMonth = lastMonthDate.getMonth();
var mydatestr = new Date(lastYear, lastMonth, 1);
var mydateendstr = new Date(lastYear, lastMonth, getMonthDays(lastMonth));
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE2== '上月') {
var lastMonthDate = new Date(); //上月日期
lastMonthDate.setDate(1);
lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
var lastYear = lastMonthDate.getFullYear();
var lastMonth = lastMonthDate.getMonth();
var mydatestr = new Date(lastYear, lastMonth, 1);
var mydateendstr = new Date(lastYear, lastMonth, getMonthDays(lastMonth));
plansql2 = plansql2 + " AND C.NEXTDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.NEXTDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
}
sql = sql + getAndConSql(sql, plansql2, plansql2);
}
var COMPARE = this.comboxCOMPARE.getRawValue();
if (COMPARE != "全部") {
var plansql = ' EXISTS (select 1 from crm_info_client_visit c where c.CLIENTGID=info_client.GID ';
if (COMPARE == '本日') {
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d');
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydatestr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE == '明日') {
var myDate = new Date();
myDate.setTime(myDate.getTime() + 24 * 60 * 60 * 1000);
var mydatestr = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydatestr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE == '昨日') {
var myDate = new Date();
myDate.setTime(myDate.getTime() - 24 * 60 * 60 * 1000);
var mydatestr = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydatestr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE == '本周') {
var now = new Date(); //当前日期
var nowDayOfWeek = now.getDay(); //今天本周的第几天
var nowDay = now.getDate(); //当前日
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var mydatestr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
var mydateendstr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 7);
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE == '下周') {
var now = new Date(); //当前日期
now.setTime(now.getTime() + 7 * 24 * 60 * 60 * 1000);
var nowDayOfWeek = now.getDay(); //今天本周的第几天
var nowDay = now.getDate(); //当前日
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var mydatestr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
var mydateendstr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 7);
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE == '上周') {
var now = new Date(); //当前日期
now.setTime(now.getTime() - 7 * 24 * 60 * 60 * 1000);
var nowDayOfWeek = now.getDay(); //今天本周的第几天
var nowDay = now.getDate(); //当前日
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var mydatestr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
var mydateendstr = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 7);
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE == '本月') {
var now = new Date(); //当前日期
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var mydatestr = new Date(nowYear, nowMonth, 1);
var mydateendstr = new Date(nowYear, nowMonth, getMonthDays(nowMonth));
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE == '下月') {
var lastMonthDate = new Date(); //上月日期
lastMonthDate.setDate(1);
lastMonthDate.setMonth(lastMonthDate.getMonth() + 1);
var lastYear = lastMonthDate.getFullYear();
var lastMonth = lastMonthDate.getMonth();
var mydatestr = new Date(lastYear, lastMonth, 1);
var mydateendstr = new Date(lastYear, lastMonth, getMonthDays(lastMonth));
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
} else if (COMPARE == '上月') {
var lastMonthDate = new Date(); //上月日期
lastMonthDate.setDate(1);
lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
var lastYear = lastMonthDate.getFullYear();
var lastMonth = lastMonthDate.getMonth();
var mydatestr = new Date(lastYear, lastMonth, 1);
var mydateendstr = new Date(lastYear, lastMonth, getMonthDays(lastMonth));
plansql = plansql + " AND C.VISITDATE>='" + mydatestr.format("yyyy-MM-dd") + "' and C.VISITDATE<='" + mydateendstr.format("yyyy-MM-dd") + " 23:59:59') ";
}
sql = sql + getAndConSql(sql, plansql, plansql);
}
var DESC = Ext.getCmp('DESC').getValue();
sql = sql + getAndConSql(sql, DESC, " (CODENAME like '%" + DESC + "%' or SHORTNAME like '%" + DESC + "%' or DESCRIPTION like '%" + DESC + "%' or NAME like '%" + DESC + "%') ");
//var ATTN = form.findField('ATTN').getValue();
//sql = sql + getAndConSql(sql, ATTN, "GID IN (SELECT LINKID FROM info_client_contact where SHOWNAME like '%" + ATTN + "%')");
//var ETDbgn = form.findField('ETDbgn').getRawValue();
//sql = sql + getAndConSql(sql, ETDbgn, "OPTIME >='" + ETDbgn + "'");
//var ETDend = form.findField('ETDend').getRawValue();
//sql = sql + getAndConSql(sql, ETDend, "OPTIME <='" + ETDend + "'");
//var CODENO = form.findField('CODENO').getValue();
//sql = sql + getAndConSql(sql, CODENO, "(FARCODE like '%" + CODENO + "%' or FAPCODE like '%" + CODENO + "%' or ORDERNO like '%" + CODENO + "%')");
//#endregion formSearch
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.selectbsno;
ret[4] = 'info_client';
return ret;
},
Print: function () {
_thisclient = this;
if (this.storeList.getCount() == 0) {
return;
}
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.CODENAME;
}
var sortstr = '[{\"property\":\"CODENAME\",\"direction\":\"ASC\"}]';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsInfoClient/GetDataListStr',
scope: this,
params: {
condition: _thisclient.sqlcontext,
printstr: 'true',
sort: 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 = 'MSINFOCLIENTLIST';
var sql1 = returnstr;
var sql2 = "select * from info_client where CODENAME='" + bsno + "'";
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
});
}
}
});
},
PrintSelect: function () {
_thisclient = this;
if (this.storeList.getCount() == 0) {
return;
}
var selectedRecords = [];
var storeadd = null;
selectedRecords = this.GridCheckBoxModel.selected.items;
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var sortstr = 'CODENAME';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('GID') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.GID;
}
var printType = 'MSOPCLIENTLISTSELECT';
var sql1 = "select * from info_client WHERE GID IN (" + feeGidSql + ") order by " + sortstr;
var sql2 = "select * from info_client where GID='" + bsno + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
//客户名称更改
UpdateCustomersWith: 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 ((USERID == "1BEC90E1-9780-472F-90C2-0C6390C044A4") || (usercode == "ADMIN") || (SHOWNAME == "系统管理员") || (SHOWNAME == "Admin")) {
var record = selections[0];
var selectedId = record.data.GID;
var URLs = "../../shipping/ExchangesUnitUpdate.aspx?id=" + selectedId;
ret = window.open(URLs, "客户名称更改", "height=300, width=700, toolbar=no, menubar=no,scrollbars=no, resizable=0,location=no, status=no,Top= " + (screen.height - 300) / 2 + ",Left= " + (screen.width - 700) / 2);
}
else {
Ext.Msg.show({ title: '警告', msg: '请联系系统管理员,其他人员无操作权限!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
},
//重复客户合并
RepeatCustomersWith: 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 ((USERID == "1BEC90E1-9780-472F-90C2-0C6390C044A4") || (usercode == "ADMIN") || (SHOWNAME == "系统管理员") || (SHOWNAME == "Admin")) {
var record = selections[0];
var selectedId = record.data.GID;
var URLs = "../../shipping/ExchangesUnitRepeat.aspx?id=" + selectedId;
ret = window.open(URLs, "重复客户合并", "height=300, width=700, toolbar=no, menubar=no,scrollbars=no, resizable=0,location=no, status=no,Top= " + (screen.height - 300) / 2 + ",Left= " + (screen.width - 700) / 2);
}
else {
Ext.Msg.show({ title: '警告', msg: '请联系系统管理员,其他人员无操作权限!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
},
//#region 重置条件
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
//this.onRefreshClick();
} //onDeleteClick
//#endregion
, onStartClick: function () {
//this.onSaveClick();
var selections = this.gridList.getSelectionModel().getSelection();
var bodyList = [];
for (i = 0; i < selections.length; i += 1) {
var member = selections[i];
if (member.data.BLSTATUSREF != "录入状态" && member.data.BLSTATUSREF != "驳回提交") {
alert("只能提交 录入状态 或 驳回提交 的往来单位");
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: '正在提交数据...',
url: '/MvcShipping/MsInfoClient/IC_Start',
params: {
USERID: USERID,
data: jsonBody
},
callback: function (options, success, response) {
if (success) {
this.onRefreshClick();
}
},
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
}
, onBackClick: function (REASON) {
var selections = this.gridList.getSelectionModel().getSelection();
var bodyList = [];
for (i = 0; i < selections.length; i += 1) {
var member = selections[i];
if (member.data.BLSTATUSREF != "提交审核") {
alert("只能撤回 提交审核 的往来单位");
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: '正在提交数据...',
url: '/MvcShipping/MsInfoClient/IC_Back',
params: {
USERID: USERID,
data: jsonBody,
REASON: REASON
},
callback: function (options, success, response) {
if (success) {
this.onRefreshClick();
}
},
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
}
, onAuditBackClick: function (REASON) {
//this.onSaveClick();
var selections = this.gridList.getSelectionModel().getSelection();
var bodyList = [];
for (i = 0; i < selections.length; i += 1) {
var member = selections[i];
if (member.data.BLSTATUSREF != "提交审核" && member.data.BLSTATUSREF != "审核通过") {
alert("只能驳回 提交审核 或 审核通过 的往来单位");
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: '正在提交数据...',
url: '/MvcShipping/MsInfoClient/IC_AuditBack',
params: {
USERID: USERID,
data: jsonBody
},
callback: function (options, success, response) {
if (success) {
this.onRefreshClick();
}
},
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
}
, onAuditClick: function () {
//this.onSaveClick();
var selections = this.gridList.getSelectionModel().getSelection();
var bodyList = [];
for (i = 0; i < selections.length; i += 1) {
var member = selections[i];
if (member.data.BLSTATUSREF != "提交审核") {
alert("只能审核 提交审核 的往来单位");
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: '正在提交数据...',
url: '/MvcShipping/MsInfoClient/IC_Audit',
params: {
USERID: USERID,
data: jsonBody
},
callback: function (options, success, response) {
if (success) {
//this.winQCShow.close();
//Ext.getCmp("REASON").setValue("");
this.onRefreshClick();
}
},
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
}
});