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/Account/Viewsjs/Chfee_Invoicehexiao/ChInvoicehexiaoAudit.js

1033 lines
36 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Ext.namespace('Shipping');
Shipping.MsChInvoicehexiaoAudit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsChInvoicehexiaoAudit.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsChInvoicehexiaoAudit, Ext.Panel, {
PageSize: 8,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isAudit: '',
initUIComponents: function () {
this.sqlcontext = "";
_this = this;
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsChInvoicehexiao',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_Invoicehexiao/GetAuditDataList',
reader: {
id: 'BILLNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: Zi.LAN.NumberOfpage,//每页记录数
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
height: 180,
region: 'north',
split: true,
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
columns: [{
sortable: true,
dataIndex: 'BILLNO',
header: Zi.LAN.BILLNO,
width: 120
}, {
sortable: true,
dataIndex: 'BILLSTATUS',
header: Zi.LAN.status,
width: 160,
renderer: function (value, meta, record) {
if (value == '审核通过') {
meta.tdCls = 'feestatus_pass';
value = Zi.LAN.SHENHETONGGUO;
} else if (value == '新建') {
value = Zi.LAN.XINJIAN;
} else if (value == '驳回提交') {
value = Zi.LAN.BUHUITIJIAO;
} else if (value == '提交审核') {
value = Zi.LAN.tjshe;
}
return value;
}
}, {
sortable: true,
dataIndex: 'INVDATE',
header: Zi.LAN.INVDATE,
width: 160
}, {
sortable: true,
dataIndex: 'INVNO',
header: Zi.LAN.INVOICENO,
width: 160
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.INVCUSTOMERNAME ,
width: 160
}, {
sortable: true,
dataIndex: 'CURR',
header: Zi.LAN.Currency,
width: 160
}, {
sortable: true,
dataIndex: 'AMOUNT',
header: Zi.LAN.ORGAMOUNT,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 120
}, {
sortable: true,
dataIndex: 'INVAMOUNT',
header: Zi.LAN.INVAMOUNT,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 120
}, {
sortable: true,
dataIndex: 'TAXRATE',
header: Zi.LAN.RATE,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 120
}, {
sortable: true,
dataIndex: 'TAX',
header: Zi.LAN.TAX,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 120
}, {
sortable: true,
dataIndex: 'INVOICECUSTNAME',
header: Zi.LAN.INVOICECUSTNAME,
width: 160
}, {
sortable: true,
dataIndex: 'OP',
header: Zi.LAN.APPLICANTNAME,
width: 160
}, {
sortable: true,
dataIndex: 'INVOICECATEGORYREF',
header: Zi.LAN.INVOICECATEGORYREF,
width: 120
}, {
sortable: true,
dataIndex: 'REMARKS',
header: Zi.LAN.INVREMARK,
width: 160
}, {
sortable: true,
dataIndex: 'SALECORP',
header: Zi.LAN.SALECORP,
width: 100
}, {
sortable: true,
dataIndex: 'SUBMITOP',
header: Zi.LAN.SUBMITOP,
width: 100
}
],
// paging bar on the bottom
bbar: [ Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: Zi.LAN.FenYe,
emptyMsg: Zi.LAN.Nodata
}), this.Pagenum]
});
//#region formSearch
//#region formSearch枚举参照相关
//#endregion
this.storeAddDCType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeAddDCType.add({ "DC": "", "NAME": Zi.LAN.All });
this.storeAddDCType.add({ "DC": "1", "NAME": Zi.LAN.NOAUDIT });
this.storeAddDCType.add({ "DC": "2", "NAME": Zi.LAN.AUDIT });
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.AUDITSTATUS ,
store: this.storeAddDCType,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'DC',
value: '1'
});
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 80,
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.INVOICENO,
labelWidth: 80,
name: 'InvNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},{
fieldLabel: Zi.LAN.BILLNO,
labelWidth: 90,
name: 'BsNo'
}, {
fieldLabel: Zi.LAN.INVCUSTOMERNAME,
name: 'CustName'
}, {
fieldLabel: Zi.LAN.APPLYTIMEFM,
labelWidth: 90,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateBgn'
}, {
fieldLabel: Zi.LAN.APPLYTIMETO,
labelWidth: 90,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateEnd'
}, this.comboxaddDCType
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.storeBodyListdetail = Ext.create('Ext.data.Store', {
model: 'Chfee_do_detail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_Invoicehexiao/GetBillList',
reader: {
id: 'BSNO,FEEDOID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.initgirdbillcolums=[{
sortable: true,
dataIndex: 'BILLNO',
header: 'BILL',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'BSNO',
header: 'BSNO',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'FEEDOID',
header: 'FEEDOID',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'CUSTNO',
header: Zi.LAN.CUSTNO,
width: 120
}, {
sortable: true,
dataIndex: 'MBLNO',
header: Zi.LAN.MBLNO,
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.CUSTOMERNAME,
width: 100
}, {
sortable: true,
dataIndex: 'ETD',
header: Zi.LAN.ETD ,
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'BSSOURCE',
header: Zi.LAN.BSSOURCE,
width: 80
}, {
sortable: true,
dataIndex: 'FEENAME',
header: Zi.LAN.FEENAME,
width: 80
}, {
sortable: true,
dataIndex: 'FEETYPEREF',
header: Zi.LAN.FEETYPEREF,
width: 40,
renderer: function (value, meta) {
if (value == '收') {
return Zi.LAN.DR;
} else if (value == '付') {
return Zi.LAN.CR;
} else {
return "";
}
}
}, {
sortable: true,
dataIndex: 'AMOUNT',
header: Zi.LAN.AMOUNT,
width: 80,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'ORIGCURRENCY',
header: Zi.LAN.ORIGCURRENCY,
width: 80
}, {
sortable: true,
dataIndex: 'ORIGAMOUNT',
header: Zi.LAN.ORIGAMOUNT,
width: 80,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'SALE',
header: Zi.LAN.SALE,
width: 80
}, {
sortable: true,
dataIndex: 'ORDERNO',
header: Zi.LAN.ORDERNO,
width: 80
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: Zi.LAN.PORTLOAD,
width: 120
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: Zi.LAN.PORTDISCHARGE,
width: 120
}, {
sortable: true,
dataIndex: 'DESTINATION',
header: Zi.LAN.DESTINATION ,
width: 120
}, {
sortable: true,
dataIndex: 'GOODSNAME',
header: Zi.LAN.GOODSNAME,
width: 140
}, {
sortable: true,
dataIndex: 'TaxUnitPrice',
header: Zi.LAN.PRICE,
width: 80,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Quantity',
header: Zi.LAN.PKGS,
width: 80,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'TaxRate',
header: Zi.LAN.TAXRATE,
width: 80,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Tax',
header: Zi.LAN.TAX ,
width: 80,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
];
this.girdbillcolums = this.initgirdbillcolums;
this.gridListdetail = new Ext.grid.GridPanel({
store: this.storeBodyListdetail,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
tbar: [{
text: Zi.LAN.Saveliststyle, //保存列表样式
id: "btntestbody",
menu: [
{
text: Zi.LAN.Save, //保存
handler: function (button, event) {
_this.girdbillcolums = DsTruck.SaveGridPanel(USERID, _this.formname + 'bill', _this.gridListdetail.columns, _this.girdbillcolums, 1, true);
}
}, {
text: Zi.LAN.Initialization , //初始化
handler: function (menu, event) {
_this.girdbillcolums = DsTruck.SaveGridPanel(USERID, _this.formname + 'bill', _this.gridListdetail.columns, _this.initgirdbillcolums, 1, true);
}
}],
scope: this
}],
columns: this.girdbillcolums
});
this.girdbillcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bill', this.girdbillcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.girdbillcolums.unshift(new Ext.grid.RowNumberer());
this.gridListdetail.reconfigure(this.storeBodyListdetail, this.girdbillcolums);
//#endregion formSearch
this.storeBodySum = Ext.create('Ext.data.Store', {
model: 'Chfee_do_sum',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_Invoicehexiao/GetBillSum',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridSum = new Ext.grid.GridPanel({
store: this.storeBodySum,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
tbar: [{
xtype: 'label',
width: 120,
height: 22,
text: Zi.LAN.SHENAMOUNTTOTAL
}],
columns: [{
sortable: true,
dataIndex: 'FEETYPEREF',
header: Zi.LAN.FEETYPEREF,
width: 40,
renderer: function (value, meta) {
if (value == '收') {
return Zi.LAN.DR;
} else if (value == '付') {
return Zi.LAN.CR;
} else {
return "";
}
}
}, {
sortable: true,
dataIndex: 'CURRENCY',
header: Zi.LAN.Currency,
width: 80
}, {
sortable: true,
dataIndex: 'AMOUNT',
header: Zi.LAN.AMOUNT ,
width: 80,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
});
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: Zi.LAN.ExecuteQuery,
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
},
{
text: Zi.LAN.ResetCondition,
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, '-', {
text: Zi.LAN.SHENHETONGGUO,
iconCls: "btnadd",
handler: function (button, event) {
this.onAuditPassClick();
},
scope: this
}, '-', {
text: Zi.LAN.QBSHENHETONGGUO, //全部审核通过
iconCls: "btnadd",
handler: function (button, event) {
this.onAllAuditClick();
},
scope: this
},
'-',
{
text: Zi.LAN.BUHUITIJIAO,
iconCls: "btndelete",
handler: function (button, event) {
this.onAuditBackClick();
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 80,
items: [this.formSearch, this.panelBtn]
});
this.panelSum = new Ext.Panel({
layout: "border",
region: 'east',
width: 260,
split: true,
margin: '2 2',
items: [this.gridSum]
});
this.paneldetail = new Ext.Panel({
title: Zi.LAN.FEESHENDETAIL,
layout: "border",
region: 'center',
split: true,
height: 420,
items: [
this.gridListdetail, this.panelSum
]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList, this.paneldetail]
});
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql, isaudit: this.isAudit });
}, this);
this.onRefreshClick();
this.storeList.on('load', function (store, records) {
if (store.getCount() > 0) {
this.gridList.getSelectionModel().select(0);
}
}, this);
this.gridList.getSelectionModel().on('select', function (model, record, index) {
var billno = record.data.BILLNO;
var sql = "";
sql = " BILLNO='" + billno + "'";
_this.storeBodyListdetail.load({ params: { condition: sql} });
_this.storeBodySum.load({ params: { condition: sql} });
}, this);
this.gridListdetail.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
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 = "../../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO;
window.open(openUrl, openType, openSet);
// DsOpenEditWin("/TruckMng/MsWlPc/Edit");
}, this);
}, //end initUIComponents
onAuditPassClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.QXZSHENGHEDEDANJU, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.BILLSTATUS;
if (BILLSTATUS == '提交审核' || BILLSTATUS == '驳回提交') {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.STATUSNOAUDIT, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.QUESHIYAOSHENHEXUANZHONG, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZHENGZAISHENHE);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZHENGZAISHENHE,
url: '/Account/Chfee_Invoicehexiao/AuditList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.onRefreshClick();
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.SHENHECHENGGONG, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.Error, msg: jsonresult.Message.replace("审核出现错误,请重试或联系系统管理员", Zi.LAN.SHENHECHUXIANCUOWU), icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.Error , msg: Zi.LAN.FuWuQiError, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
onAllAuditClick: function (menu, event) {
if (this.storeList.length == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.QXZSHENGHEDEDANJU, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.QUESHIYAOSHENHEALL, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZHENGZAISHENHE);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZHENGZAISHENHE,
url: '/Account/Chfee_Invoicehexiao/AllAudit',
params: {
condition: _this.sqlcontext,
isaudit: _this.isAudit
},
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 {
Ext.Msg.hide();
_this.onRefreshClick();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FuWuQiError, response.responseText);
}
},
scope: this
});
}
}, this);
},
onAuditBackClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.QXZBOHUIDEDANJU, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.BILLSTATUS;
if ((BILLSTATUS == '提交审核' || BILLSTATUS == '审核通过')) {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.DANGQIANZHUANGTAIBUYUXUBOHUI , icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.QUESHIBOHUI, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZHENGZAIBOHUI);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZHENGZAIBOHUI,
url: '/Account/Chfee_Invoicehexiao/AuditBackList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.onRefreshClick();
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.BOHUICHENGGONG, 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.Error, msg: Zi.LAN.FuWuQiError, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, 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, isaudit: this.isAudit },
waitMsg: Zi.LAN.NowSelect,
callback: function (r, options, success) {
if (success) {
if (r.length == 0) {
var sql = " BILLNO='11111111' ";
this.storeBodyListdetail.load({ params: { condition: sql} });
this.storeBodySum.load({ params: { condition: sql} });
}
}
},
scope: this
});
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert(Zi.LAN.Prompt, Zi.LAN.SelectError);
return '';
}
var sql = '';
var InvNo = form.findField('InvNo').getValue();
sql = sql + getAndConSql(sql, InvNo, "INVNO like '%" + InvNo + "%'");
var customNo = form.findField('BsNo').getValue();
sql = sql + getAndConSql(sql, customNo, "BILLNO like '%" + customNo + "%'");
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, "INVDATE >='" + expDateBgn + "'");
var expDateEnd = form.findField('ExpDateEnd').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "INVDATE <='" + expDateEnd + "'");
this.isAudit = form.findField('DC').getValue();
return sql;
}
});