Ext.namespace('Shipping');
Shipping.MsChInvoiceapplicationIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsChInvoiceapplicationIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsChInvoiceapplicationIndex, Ext.Panel, {
PageSize: 30,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
initUIComponents: function () {
this.formname = "formMsChInvoiceappIndex"; //页面名称
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsChInvoiceapplication',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_invoiceapplication/GetDataList',
reader: {
id: 'BILLNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
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();
}
}
}
});
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BILLNO',
header: Zi.LAN.BILLNO,
width: 120,
filter: true,
renderer: function (value, meta) {
meta.tdCls = 'mblno';
btnurl = getGridCopyButton(value);
return btnurl + value;
}
}, {
sortable: true,
dataIndex: 'BILLSTATUSREF',
header: Zi.LAN.status,
width: 60,
renderer: function (value, meta, record) {
if (value == '审核通过') {
meta.tdCls = 'feestatus_pass';
value = Zi.LAN.SHENHETONGGUO;
} else if (value == '录入状态') {
value = Zi.LAN.LURUZHUAGNTAI;
} else if (value == '已提交') {
meta.tdCls = 'feestatus_refer';
value = Zi.LAN.TIJIAOSHENHE;
} else if (value == '部分开出') {
meta.tdCls = 'feestatus_refer';
value = Zi.LAN.BUFENKAICHU;
} else if (value == '已开出') {
meta.tdCls = 'feestatus_settle';
value = Zi.LAN.YIKAICHU;
} else if (value == '驳回') {
meta.tdCls = 'feestatus_nopass';
value =Zi.LAN.BUHUITIJIAO;
}
return value;
}
}, {
sortable: true,hidden:true,
dataIndex: 'PAYCOMPANYID',
header: 'PAYCOMPANYID',
width: 80
}, {
sortable: true,
dataIndex: 'PAYCOMPANYREF',
header: Zi.LAN.PAYCOMPANYREF ,
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.INVCUSTOMERNAME,
width: 120
}, {
sortable: true,
dataIndex: 'INVOICECUSTNAME',
header: Zi.LAN.INVOICECUSTNAME,
width: 160
}, {
sortable: true,
dataIndex: 'CURRENCY',
header: Zi.LAN.Currency,
width: 60
}, {
sortable: true,
dataIndex: 'APPLYAMOUNT',
header: Zi.LAN.APPLYAMOUNT,
align: 'right',
width: 100,
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'INVAMOUNT',
header: Zi.LAN.INVAMOUNT,
align: 'right',
width: 100,
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'RECVCURR',
header: Zi.LAN.RECVCURR,
width: 60
}, {
sortable: true,
dataIndex: 'FEEAMOUNT',
header: Zi.LAN.FEEAMOUNT ,
width: 120,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'APPLYTIME',
header: Zi.LAN.APPLYTIME,
width: 100
}, {
sortable: true,
dataIndex: 'APPLICANTNAME',
header: Zi.LAN.APPLICANTNAME,
width: 100
}, {
sortable: true,
dataIndex: 'INVOICENO',
header: Zi.LAN.INVOICENO,
width: 120
}, {
sortable: true,
dataIndex: 'NOSTL',
header: Zi.LAN.NOSTL,
width: 120
}, {
sortable: true,
dataIndex: 'INVOICENOREF',
header: Zi.LAN.INVOICENOREF,
width: 120
}, {
sortable: true,
dataIndex: 'INVDATE',
header: Zi.LAN.INVDATE,
width: 120
}, {
sortable: true,
dataIndex: 'REMARK',
header: Zi.LAN.REMARK,
width: 160
}, {
sortable: true,
dataIndex: 'SHENREMARK',
header: Zi.LAN.SHENREMARK,
width: 160
}, {
sortable: true,
dataIndex: 'ENTERTIME',
header: Zi.LAN.ENTERTIME,
width: 100
}, {
sortable: true,
dataIndex: 'INVOICECATEGORYREF',
header: Zi.LAN.INVOICECATEGORYREF,
width: 100
}, {
sortable: true,
dataIndex: 'RATE',
header: Zi.LAN.RATE,
width: 100
}, {
sortable: true,
dataIndex: 'OPERATETIME',
header: Zi.LAN.OPERATETIME,
width: 100
}, {
sortable: true,
dataIndex: 'REASON',
header: Zi.LAN.REASON, //驳回原因
width: 80
},
{
sortable: true, tooltip: '',
dataIndex: 'PUSHMODEREF',
header: Zi.LAN.PUSHMODEREF,
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'PUSHMODE',
header: 'PUSHMODE',
width: 80
},
{
sortable: true,
dataIndex: 'PUSHMOBILE',
header: Zi.LAN.PUSHMOBILE,
width: 80
},
{
sortable: true,
dataIndex: 'PUSHEMAIL',
header: Zi.LAN.PUSHEMAIL,
width: 80
}
];
this.girdcolums = this.initgirdcolums;
this.TtlSel = Ext.create('Ext.form.Label', {
name: 'bottleslbl',
labelAlign: 'right',
width: 800
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
selModel: this.GridCheckBoxModel,
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
disableSelection: false,
columns: this.girdcolums,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum, this.TtlSel]
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
if (bltype == 'TruckIndex')
DsOpenEditWin('/Account/Chfee_invoiceapplication/TruckBLEdit');
else
DsOpenEditWin('/Account/Chfee_invoiceapplication/BLEdit');
}, this);
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列
this.girdcolums.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.girdcolums);
//#region formSearch
//#region formSearch枚举参照相关
this.storeBillStatus = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBillStatus.load({ params: { enumTypeId: 97010} });
this.comboxBillStatus = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: Zi.LAN.status,
valueField: 'EnumValueId',
displayField: 'EnumValueName',
forceSelection: false,
store: this.storeBillStatus,
name: 'BillStatus'
});
this.storeCust = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
// this.storeCust.load({ params: { condition: ""} });
this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CUSTOMERNAME,
store: this.storeCust,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'CustName',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeAPPLICANT = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.storeAPPLICANT.load();
this.comboxAPPLICANT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.APPLICANTNAME,
store: this.storeAPPLICANT,
forceSelection: true,
name: 'APPLICANT',
valueField: 'GID',
displayField: 'CodeAndName'
});
//#endregion
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
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.BILLNO,
name: 'ShenNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCust, {
fieldLabel: Zi.LAN.APPLYTIMEFM ,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateBgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.APPLYTIMETO,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateEnd',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxBillStatus, {
xtype: 'button',
width: 90,
text: Zi.LAN.ExecuteQuery,
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}
]
},
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: Zi.LAN.BIANHAO,
name: 'BsNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},{
fieldLabel: Zi.LAN.INVDATE, //从付费申请日期
format: 'Y-m-d',
xtype: 'datefield',
name: 'InvDateBgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.INVDATE,
format: 'Y-m-d',
xtype: 'datefield',
name: 'InvDateEnd',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxAPPLICANT, {
xtype: 'hiddenfield',
flex: 1
}, {
xtype: 'button',
width: 90,
text: Zi.LAN.AdvancedSearch,
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 fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: Zi.LAN.xnew,
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
if (bltype == 'TruckIndex')
DsOpenEditWin('/Account/Chfee_invoiceapplication/TruckBLEdit');
else
DsOpenEditWin('/Account/Chfee_invoiceapplication/BLEdit');
},
scope: this
},
'-',
{
text: Zi.LAN.ResetCondition,
iconCls: "btnreset",
handler: function (button, event) {
var form = this.formSearch.getForm();
form.reset();
},
scope: this
}, '-', {
text: Zi.LAN.tjshe,
tooltip: Zi.LAN.tjshe,
handler: function (button, event) {
this.onSubmitAuditClick();
},
scope: this
}, '-', {
text: Zi.LAN.cxtijiao,
tooltip: Zi.LAN.cxtijiao,
handler: function (button, event) {
this.onSubmitAuditBackClick();
},
scope: this
}, '-',
{
text: Zi.LAN.delete1,
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-',
{
text: Zi.LAN.print,
handler: function (button, event) {
this.PrintSelect();
},
scope: this
}, '-', {
text: Zi.LAN.ExportExcel,
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', {
text: Zi.LAN.Saveliststyle,
id: "btntest",
menu: [
{
text: Zi.LAN.Save,
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, {
text: Zi.LAN.Initialization,
handler: function (menu, event) {
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-', {
text: Zi.LAN.xswork,
id: "btnShowMap",
iconCls: 'btnexportexcel',
handler: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
var record = selections[0];
var bsno = record.data.BILLNO;
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
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 100,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
this.storeList.on('beforeload', function (store) {
// var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
}, this);
this.gridList.on({
selectionchange: function (sm, selections) {
_this.TtlSel.setText('');
if (selections.length == 0) {
return;
}
var rmbdr = 0;
var usddr = 0;
var rmblb = '';
var usdlb = '';
var j = selections.length;
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
if (rec.data.RECVCURR == 'RMB') {
rmbdr = Add(rmbdr, rec.data.INVAMOUNT, 2);
} else {
usddr = Add(usddr, rec.data.INVAMOUNT, 2);
}
}
if (rmbdr != 0) {
rmblb = "RMB开票金额:" + returnfloat(rmbdr) + "|";
}
if (usddr != 0) {
usdlb = "USD开票金额:" + returnfloat(usddr);
}
_this.TtlSel.setText('所选合计 :' + rmblb + usdlb );
}
});
this.onInitRefreshClick();
}, //end initUIComponents
onInitRefreshClick: function (button, event) {
var sql = ' cm.BILLSTATUS<>3 ';
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: Zi.LAN.NowSelect,
scope: this
});
},
onRefreshClick: function (button, event) {
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.NowSelect,
scope: this,
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(success.response.responseText);
if (jsonresult.Success) {
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
}
});
},
onDsQuery: function () {
var sql = this.sqlcontext;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, billtype: 2 },
waitMsg: Zi.LAN.NowSelect,
scope: this,
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(success.response.responseText);
if (jsonresult.Success) {
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
}
});
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.SelectDanju, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
var billstatus = record.data.BILLSTATUS;
if (billstatus != '1' && billstatus != '4') {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.nodelete, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.suredelete, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.nowdelete);
Ext.Ajax.request({
waitMsg: Zi.LAN.nowdelete,
url: '/Account/Chfee_invoiceapplication/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.Prompt, msg: Zi.LAN.truedelete, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.Error, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.Caveat, msg: Zi.LAN.FuWuQiError, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}, //onDeleteClick
onSubmitAuditClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.SelectDanju, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var BILLNOStr = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLNO = rec.data.BILLNO;
if ((rec.data.BILLSTATUS == '1') || (rec.data.BILLSTATUS == '4')) {
if (BILLNOStr == '')
BILLNOStr = BILLNO;
else {
BILLNOStr = BILLNOStr + ',' + BILLNO;
}
}
}
_this = this;
if (BILLNOStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.addnumnow,
url: '/Account/Chfee_invoiceapplication/SubmitAuditList',
params: {
bills: BILLNOStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.Prompt,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_this.onRefreshClick();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FuWuQiError, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditBackClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.SelectDanju, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var BILLNOStr = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLNO = rec.data.BILLNO;
if (rec.data.BILLSTATUS == '2') {
if (BILLNOStr == '')
BILLNOStr = BILLNO;
else {
BILLNOStr = BILLNOStr + ',' + BILLNO;
}
}
}
_this = this;
if (BILLNOStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.addnumnow,
url: '/Account/Chfee_invoiceapplication/SubmitAuditBackList',
params: {
bills: BILLNOStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.Prompt ,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_this.onRefreshClick();
}
} else {
Ext.MessageBox.alert(Zi.LAN.qqerror, response.responseText);
}
},
scope: this
});
};
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert(Zi.LAN.Prompt, Zi.LAN.SelectError);
return '';
}
var sql = '';
var customNo = form.findField('ShenNo').getValue();
sql = sql + getAndConSql(sql, customNo, "BILLNO like '%" + customNo + "%'");
var BsNo = form.findField('BsNo').getValue();
sql = sql + getAndConSql(sql, BsNo, "BILLNO IN (SELECT BILLNO FROM CH_FEE_DO WHERE BSNO IN (SELECT BSNO FROM V_OP_BILL b WHERE b.CUSTNO like '%" + BsNo + "%' or b.MBLNO like '%" + BsNo + "%' or b.HBLNO like '%" + BsNo + "%' or b.CUSTOMNO like '%" + BsNo + "%' or b.ORDERNO like '%" + BsNo + "%'))");
var custName = form.findField('CustName').getValue();
sql = sql + getAndConSql(sql, custName, "CUSTOMERNAME like '%" + custName + "%'");
var expDateBgn = form.findField('ExpDateBgn').getRawValue();
sql = sql + getAndConSql(sql, expDateBgn, "APPLYTIME >='" + expDateBgn + "'");
var expDateEnd = form.findField('ExpDateEnd').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "APPLYTIME <='" + expDateEnd + "'");
var BillStatus = form.findField('BillStatus').getValue();
if (BillStatus == '6') {
sql = sql + getAndConSql(sql, BillStatus, "BILLSTATUS<>'3'");
} else {
sql = sql + getAndConSql(sql, BillStatus, "BILLSTATUS='" + BillStatus + "'");
}
var APPLICANT = form.findField('APPLICANT').getValue();
sql = sql + getAndConSql(sql, APPLICANT, "APPLICANT='" + APPLICANT + "'");
var InvDateBgn = form.findField('InvDateBgn').getRawValue();
var InvDateEnd = form.findField('InvDateEnd').getRawValue();
if ((InvDateBgn != '' && InvDateBgn != null && InvDateBgn != undefined) || (InvDateEnd != '' && InvDateEnd != null && InvDateEnd != undefined)) {
sql = sql + getAndConSql(sql, "1", ' EXISTS (SELECT 1 FROM ch_fee_invoice I WHERE I.BILLNO=cm.INVBILLNO ');
sql = sql + getAndConSql(sql, InvDateBgn, "INVOICEMAKETIME>='" + InvDateBgn + "'");
sql = sql + getAndConSql(sql, InvDateEnd, "INVOICEMAKETIME <='" + InvDateEnd + "'");
sql = sql + ') ';
}
return sql;
},
PrintSelect: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.SelectDanju, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var feeGidSql = '';
for (var i = 0; i < selections.length; i++) {
var record = selections[i];
var feeGId = "'" + record.get('BILLNO') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var record = selections[0];
var billNo = record.data.BILLNO;
var printType = 'MSCHFEEINVOICEAPPLICATIONSEL';
var sql1 = "SELECT p.*,(select ShowName from [user] where GID=p.APPLICANT) as APPLICANTNAME FROM ch_fee_invoiceapplication p WHERE p.BILLNO IN (" + feeGidSql + ") ";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
onExportClick: function (button, event) {
_this = this;
GridExportExcelPage(this.gridList);
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = INVOICEPORT;
return ret;
}
});