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: '',
//需求编号:SR2017061200005-1
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'
}
}
});
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#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: Zi.LAN.GID, //'编号',
hidden: true,
width: 0
}, {
sortable: true,
id: '',
dataIndex: 'CODENAME',
header: Zi.LAN.CODENAME, //'客户代码',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'SHORTNAME',
header: Zi.LAN.SHORTNAME, //'客户简称',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'DESCRIPTION',
header: Zi.LAN.DESCRIPTION, //'客户全称',
width: 200
},
{
sortable: true,
id: '',
dataIndex: 'ENFULLNAME',
header: Zi.LAN.ENFULLNAME, //'英文全称',
width: 200
},
{
sortable: true,
id: '',
dataIndex: 'FARCODE',
header: Zi.LAN.FARCODE, //'应收代码',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'FAPCODE',
header: Zi.LAN.FAPCODE, //'应付代码',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'ORDERNO',
header: Zi.LAN.ORDERNO, //'财务序号',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'TEL',
header: Zi.LAN.TEL, //'电话',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'FAX',
header: Zi.LAN.FAX, //'传真',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'SALE',
header: Zi.LAN.SALE, //'揽货人',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'DOC',
header: Zi.LAN.DOC, //'揽货人',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'BSSOURCE',
header: Zi.LAN.BSSOURCE, //'业务来源',
width: 120
},
{
sortable: true,
id: '',
dataIndex: 'OPNAME',
header: Zi.LAN.OPNAME, //'录入人',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OPTIME',
header: Zi.LAN.OPTIME, //'录入日期',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OP',
header: Zi.LAN.OP, //'录入日期',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'BLSTATUSREF',
header: Zi.LAN.BLSTATUSREF, //'审核状态',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'ACCREMARK',
header: Zi.LAN.ACCREMARK, //'审核状态',
width: 80
},
{
sortable: true,
dataIndex: 'ACCTYPE',
header: "可结算方式",
width: 80
},
{
sortable: true,
dataIndex: 'ACCMONTH',
header: "间隔月份",
width: 80
},
{
sortable: true,
dataIndex: 'ACCDAYS',
header: "结算时间",
width: 80
},
{
sortable: true,
dataIndex: 'ALLOWAMOUNT',
header: Zi.LAN.ALLOWAMOUNT,
width: 80
}
,
{
sortable: true,
id: '',
dataIndex: 'CONTRACTSTATUS',
header: Zi.LAN.CONTRACTSTATUS, //'业务锁定',
align: 'center',
width: 60,
renderer: function (value, cellmeta, record) {
if (value != '' && value != null) {
if (value.substr(2, 1) == "1") {
return "";
}
if (value.substr(1, 1) == "1") {
return "";
}
if (value.substr(0, 1) == "1") {
return "";
}
}
}
},
{
sortable: true,
id: '',
dataIndex: 'CONTRACTDATE',
header: Zi.LAN.CONTRACTDATE, //'业务锁定',
align: 'center',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'ADDR',
header: Zi.LAN.ADDR, //'业务锁定',
align: 'center',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'REGISTRATIONNO',
header: Zi.LAN.REGISTRATIONNO, //'业务锁定',
align: 'center',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'ORGANIZATIONCODE',
header: Zi.LAN.ORGANIZATIONCODE, //'业务锁定',
align: 'center',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'TICHENG',
header: Zi.LAN.TICHENG, //'业务锁定',
align: 'center',
width: 80
},
{
sortable: true,
dataIndex: 'MODIFIEDUSERREF',
header: Zi.LAN.MODIFIEDUSERREF, //'录入人',
width: 120
},
{
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: Zi.LAN.MODIFIEDTIME, //'录入日期',
width: 120
}
];
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: Zi.LAN.ShuJuJiaZaiZhong }, //"数据加载中,请稍等..."
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,
displayMsg: Zi.LAN.displayMsg, //'当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: Zi.LAN.emptyMsg, //"没有数据"
displayInfo: true
}), this.Pagenum]
});
/////////////以下部分为获取存储的gridpanel显示样式
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列
this.gridList.columns[0] = new Ext.grid.RowNumberer();
this.gridList.reconfigure(this.storeList, this.girdcolums);
////////////////////////////////////////////////
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
var openSet = "height=700, width=1200, 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.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: Zi.LAN.BLSTATUS, //'审核状态',
store: this.storeBLSTATUS,
forceSelection: true,
flex: 0.8,
labelWidth: 70,
name: 'BLSTATUS',
valueField: 'BLSTATUS',
displayField: 'BLSTATUSREF'
});
//#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: 90,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.MblNo, //'代码或简称',
labelWidth: 80, name: 'MblNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.CODENO, //'财务代码/序号',
name: 'CODENO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.QUANCHENG, //'联系人',
name: 'CUSTFULLNAME',
labelWidth: 50,
flex: 0.8,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.ATTN, //'联系人',
name: 'ATTN',
labelWidth: 50,
flex: 0.8,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.ETDbgn, //'录入日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDbgn',
flex: 0.9,
labelWidth: 70,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.ETDend, //'到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDend',
labelWidth: 20,
flex: 0.6,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxBLSTATUS
,{
fieldLabel: Zi.LAN.NeedAudit, //'只显示待审核',
xtype: 'checkbox',
name: 'NeedAudit',
flex: 0.8
}
, {
xtype: 'button',
width: 90,
text: Zi.LAN.btnRefresh, //"执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
xtype: 'button',
width: 45,
// text: Zi.LAN.btnMore, //"高级查询",
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: Zi.LAN.btnAdd, //"新建",
iconCls: "btnadd",
id:"btncustadd",
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: Zi.LAN.btnDelete, //"删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-', {
text: Zi.LAN.onStartClick, //"提交审核",
iconCls: "btnupload",
handler: function (button, event) {
this.onStartClick(button, event);
},
scope: this
}, {
text: Zi.LAN.onBackClick, //"撤回提交",
iconCls: "btncomm",
handler: function (button, event) {
this.onBackClick(button, event);
},
scope: this
}, {
text: Zi.LAN.onAuditClick, //"审核通过",
id: "btnAudit",
iconCls: "btnconfirm",
handler: function (button, event) {
this.onAuditClick(button, event);
},
scope: this
}, {
text: Zi.LAN.onAuditBackClick, //"驳回提交",
id: "btnAuditBack",
iconCls: "btnrefuse",
handler: function (button, event) {
this.onAuditBackClick(button, event);
},
scope: this
}, {
text: "显示工作流",
id: "btnShowMap",
iconCls: 'btnexportexcel',
handler: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
var record = selections[0];
var bsno = record.data.GID;
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 = "../../Account/Chfee_payapplication/Map?bsno=" + bsno;
window.open(openUrl, openType, openSet);
},
scope: this
}, '-',
{
text: Zi.LAN.btnReset, //"重置条件",
iconCls: "btnreset",
handler: function (button, event) {
var form = this.formSearch.getForm();
form.reset();
},
scope: this
}, '-', {
text: Zi.LAN.Excel,
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', {
text: Zi.LAN.btnTest, //"保存列表样式",
id: "btntest",
menu: [
{ text: Zi.LAN.btnESave, //"保存",
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, { text: Zi.LAN.SaveGridPanel, //"初始化",
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: Zi.LAN.btnPrint, //"打印",
iconCls: 'btnprint',
menu: [
{ text: Zi.LAN.PrintAll, //"全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: Zi.LAN.PrintSelect, //"选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}, {
text: Zi.LAN.UpdateCustomersWith, //"客户名称更改",
iconCls: "btndelete",
handler: function (button, event) {
this.UpdateCustomersWith(button, event);
},
scope: this
}, {
text: Zi.LAN.RepeatCustomersWith, //"重复客户合并",
iconCls: "btndelete",
handler: function (button, event) {
this.RepeatCustomersWith(button, event);
},
scope: this
}, '-',
{
text: Zi.LAN.ImportHangXin, //"打印",
iconCls: 'btnexportexcel',
menu: [
{
text: Zi.LAN.Import, //"全部",
handler: function (menu, event) {
_this.onImportHangXinClick(menu, event);
}
}, {
text: Zi.LAN.view, //"选择打印",
handler: function (menu, event) {
DsOpenEditWin('../../MvcShipping/MsInfoClient/HangXinCustIndex', '');
}
}],
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
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: Zi.LAN.ZhengZaiChaXunShuJu,
scope: this
});
this.storeList.on('beforeload', function (store) {
// var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
}, this);
var btnAudit = Ext.getCmp('btnAudit');
var btnAuditBack = Ext.getCmp('btnAuditBack');
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: 'modInfoClientAudit'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
btnAudit.show();
btnAuditBack.show();
} else {
btnAudit.hide();
btnAuditBack.hide();
}
}
},
scope: this
});
var btncustadd = Ext.getCmp('btncustadd');
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: 'modInfoClientCustNotAdd'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
btncustadd.hide();
} else {
btncustadd.show();
}
}
},
scope: this
});
}, //end initUIComponents
onRefreshClick: function (button, event) {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.getCondition();
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu,
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: Zi.LAN.ZhengZaiChaXunShuJu,
scope: this
});
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeXinXi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'请先选择要删除的客户!'
return;
}
for (var i = 0; i < selections.length; i++) {
if (selections[i].data.BLSTATUSREF == '审核通过') {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '无法删除已审核通过的信息!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'请先选择要删除的客户!'
return;
}
}
var record = selections[0];
if (this.StoreOpRange.getCount() == 0) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, 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: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); //'权限不足,不允许删除!'
return;
}
}
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
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: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, 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(Zi.LAN.TiShi, Zi.LAN.ChaXunTiaoJianFuZhiCuoWu); //'查询条件赋值错误,请检查。'
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 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 + "%')");
var CUSTFULLNAME = form.findField('CUSTFULLNAME').getValue();
sql = sql + getAndConSql(sql, CUSTFULLNAME, "[DESCRIPTION] like '%" + CUSTFULLNAME + "%' ");
var BLSTATUS = form.findField('BLSTATUS').getValue();
sql = sql + getAndConSql(sql, BLSTATUS, " BLSTATUS=" + BLSTATUS + " ");
//var StrAudit = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0) ";
var NeedAudit = form.findField("NeedAudit").getValue();
if (NeedAudit)
{ sql = sql + getAndConSql(sql, NeedAudit, " EXISTS (select 1 from workflow_using wu where wu.BSNO=info_client.GID and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + USERID + "',wu.stepno)>0 ) "); }
//#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(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
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: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.FuWuQiXiangYingChuCuo, //'服务器响应出错,请重试...',
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: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeXinXi, 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);
},
//onExportClick: function (button, event) {
// GridExportExcelPage(this.gridList);
//},
onExportClick: 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(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
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 sql1 = returnstr;
sql1 = sql1.replace(/\+/g, "@@@")
if (sql1 != '') {
GridExportBySql(sql1, this.formname, '客户列表.xls');
}
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: Zi.LAN.FuWuQiXiangYingChuCuo, //'服务器响应出错,请重试...',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
//#region EDI导入
onImportHangXinClick: function (button, event) {
if (this.winAccess) { this.winAccess.close(); }
this.winAccess = new Shipping.FileImport({
});
this.winAccess.StoreList = this.storeList;
this.winAccess.show();
return;
},
//#endregion
//客户名称更改
UpdateCustomersWith: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeXinXi, 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, Zi.LAN.UpdateCustomersWith, "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: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuCaoZuo, 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: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeXinXi, 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, Zi.LAN.RepeatCustomersWith, "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: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuCaoZuo, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); //'请联系系统管理员,其他人员无操作权限!'
return;
}
}
, 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(Zi.LAN.ZhiNengTiJiaoLuRuZhuangTaiHuoBoHuiTiJiaoDeWangLaiDanWei); //"只能提交 录入状态 或 驳回提交 的往来单位"
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
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: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, 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(Zi.LAN.ZhiNengCheHuiTiJiaoShenHeDeWangLaiDanWei); //"只能撤回 提交审核 的往来单位"
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
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: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, 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(Zi.LAN.ZhiNengBoHuiTiJiaoShenHeHuoShenHeTongGuoDeWangLaiDanWei); //"只能驳回 提交审核 或 审核通过 的往来单位"
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
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: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, 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(Zi.LAN.ZhiNengShenHeTiJiaoShenHeDeWangLaiDanWei); //"只能审核 提交审核 的往来单位"
} else {
bodyList.push(member);
}
};
var jsonBody = ConvertRecordsToJsonAll(bodyList);
if (jsonBody == '') {
return;
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
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: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
});