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/公司自己的往来单位页面 MsInfoClientInd...

1208 lines
43 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
Shipping.MsInfoClientIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsInfoClientIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsInfoClientIndex, Ext.Panel, {
PageSize: 100,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isShowAdvancedQuery: 0, //是否显示高级查询面板
sqlcontext: '',
editype: '',
selectbsno: '',
sortfield: '',
sortdire: '',
initUIComponents: function () {
this.formname = "formInfoClientIndex"; //页面名称
//定义数据集
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
});
_this = this;
/*
this.initgirdcolums = [{
sortable: true,
id: '',
dataIndex: '',
header: '',
width: 0
}, {
sortable: true,
id: '',
dataIndex: 'GID',
header: '编号',
hidden:true,
width: 0
}, {
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: 'ENFULLNAME',
header: '英文全称',
width: 200
},
{
sortable: true,
id: '',
dataIndex: 'FARCODE',
header: '应收代码',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'FAPCODE',
header: '应付代码',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'ORDERNO',
header: '财务序号',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'TEL',
header: '电话',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'FAX',
header: '传真',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'SALE',
header: '揽货人',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'OPNAME',
header: '录入人',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OPTIME',
header: '录入日期',
width: 80
}];
*/
//本公司 往来单位列表
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: 'STLNAME',
header: '结费方式',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'STLFIRSTHALFDATE',
header: '安装时间',
width: 100
},
{
sortable: true,
id: '',
dataIndex: 'STLMIDDLEDATE',
header: '维护截止时间',
width: 100
},
{
sortable: true,
id: '',
dataIndex: 'CHIEF',
header: '主要负责人',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'TEL',
header: '电话',
width: 100
},
{
sortable: true,
id: '',
dataIndex: 'FAX',
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=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/Edit";
window.open(openUrl, openType, openSet);
}, 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 查询面板
_this = 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) {
_this.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) {
_this.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) {
_this.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) {
_this.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) {
_this.onRefreshClick();
}
}
}
}, this.comboxCustCode, {
xtype: 'button',
width: 90,
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 = 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/Edit";
window.open(openUrl, openType, openSet);
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-', {
text: "提交审核",
iconCls: "btnupload",
handler: function (button, event) {
this.onStartClick(button, event);
},
scope: this
}, {
text: "撤回提交",
iconCls: "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, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, { text: "初始化",
handler: function (menu, event) {
_this.InitGrid(_this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
menu: [
{ text: "全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: "选择打印",
handler: function (menu, event) {
_this.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
}, '-', {
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 100,
items: [this.panelBtn, this.formSearch]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
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: _this.sqlcontext });
}, 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
});
},
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 = '';
//#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 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 () {
_this = 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: _this.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 () {
_this = 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
}
});