Ext.namespace('Shipping');
Shipping.ChInvoiceapplicationAudit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.ChInvoiceapplicationAudit.superclass.constructor.call(this);
};
Ext.extend(Shipping.ChInvoiceapplicationAudit, Ext.Panel, {
PageSize: 15,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isAudit: '',
billno: '',
sqlcontext: '',
initUIComponents: function () {
//定义数据集
this.formname = "ChInvoiceapplicationAudit"
this.billno = '';
this.sqlcontext = '';
_this = this;
Ext.Ajax.timeout = 1200000;
this.storeInvCategory = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeInvCategory.load({ params: { enumTypeId: 97008 } });
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsChInvoiceapplication',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_invoiceapplication/GetAuditDataList',
reader: {
id: 'BILLNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
var _this = this;
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();
}
}
}
});
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BILLNO',
header: Zi.LAN.BILLNO ,
width: 120
}, {
sortable: true,
dataIndex: 'BILLSTATUSREF',
header: Zi.LAN.status,
width: 80,
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;
} else if (value == '未提交') {
value = Zi.LAN.WEITIJIAO;
}
return value;
}
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.CUSTOMERNAME,
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,
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,
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: 'OPERATETIME',
header: Zi.LAN.OPERATETIME,
width: 100
}, {
sortable: true,
dataIndex: 'INVOICECATEGORYREF',
header: Zi.LAN.INVOICECATEGORYREF,
width: 100,
renderer: function (value, meta) {
return _this.GetCategoryName(value);
}
}, {
sortable: true,
dataIndex: 'RATE',
header: Zi.LAN.RATE,
width: 100
}, {
sortable: true,
dataIndex: 'INVOICENO',
header: Zi.LAN.INVOICENO,
width: 120
}, {
sortable: true,
dataIndex: 'REMARK',
header: Zi.LAN.REMARK,
width: 360
}, {
sortable: true,
dataIndex: 'SHENREMARK',
header: Zi.LAN.SHENREMARK ,
width: 360
}, {
sortable: true,
dataIndex: 'PAYCOMPANYREF',
header: Zi.LAN.COMPANYNAME,
width: 120
}
];
this.girdcolums = this.initgirdcolums;
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,
selModel: this.GridCheckBoxModel,
columns: this.girdcolums ,
// 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]
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
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枚举参照相关
//#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.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomInvRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomInvRefListRm' }
});
// this.storeCust.load({ params: { condition: ""} });
this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CUSTOMERNAME,
store: this.storeCustCode,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
// forceSelection: true,
name: 'CustName',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOpCode.load();
//
this.comboxAPPLICANT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.APPLICANTNAME,
store: this.storeOpCode,
forceSelection: true,
name: 'APPLICANT',
valueField: 'GID',
displayField: 'CodeAndName'
});
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.BILLNO ,
name: 'BsNo',
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',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.APPLYTIMETO,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateEnd',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxAPPLICANT, this.comboxaddDCType
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.storeDetailList = Ext.create('Ext.data.Store', {
model: 'MsChInvoiceDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_invoiceapplication/GetDetailList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridDetailList = new Ext.grid.GridPanel({
store: this.storeDetailList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
columns: [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'PID',
header: 'PID',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'SERIALNO',
header: 'SERIALNO',
hidden: true,
width: 100
}, {
sortable: false,
dataIndex: 'GOODSNAMEREF',
header: Zi.LAN.GOODSNAMEREF,
summaryType: 'count',
width: 120
}, {
sortable: false,
dataIndex: 'SPEC',
header: Zi.LAN.SPEC,
width: 120
}, {
sortable: false,
dataIndex: 'UNIT',
header: Zi.LAN.UNIT,
width: 100
}, {
sortable: false,
dataIndex: 'PKGS',
header: Zi.LAN.PKGS,
width: 80
}, {
sortable: false,
dataIndex: 'TAXPRICE',
header: Zi.LAN.TAXPRICE,
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
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 '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: false,
dataIndex: 'PRICE',
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 '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: false,
dataIndex: 'AMOUNT',
summaryType: 'sum',
header: Zi.LAN.AMOUNT,
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
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 '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: false,
dataIndex: 'TAXRATE',
header: Zi.LAN.TAXRATE,
width: 80
}, {
sortable: false,
dataIndex: 'TAX',
header: Zi.LAN.TAX,
summaryType: 'sum',
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 '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}, summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
}
]
});
this.storeBodyListdetail = Ext.create('Ext.data.Store', {
model: 'Chfee_do_detail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_invoiceapplication/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.APPLYAMOUNT,
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 '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'ORIGCURRENCY',
header: Zi.LAN.ORIGCURRENCY,
width: 80
}, {
sortable: true,
dataIndex: 'ORIGEXCHANGERATE',
header: Zi.LAN.ORIGEXCHANGERATE,
width: 80
}, {
sortable: true,
dataIndex: 'EXCHANGERATE',
header: Zi.LAN.EXCHANGERATE,
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 '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'SALE',
header: Zi.LAN.SALE,
width: 80
}, {
sortable: true,
dataIndex: 'SALECORP',
header: Zi.LAN.SALECORP,
width: 80
}, {
sortable: true,
dataIndex: 'ORDERNO',
header: Zi.LAN.ORDERNO,
width: 80
}, {
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 '' + lsValue + '';
}
}
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 '' + lsValue + '';
}
}
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 '' + lsValue + '';
}
}
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 '' + lsValue + '';
}
}
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.gridListdetail.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
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);
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);
this.storeBodyListdetail.on('beforeload', function (store) {
var sql = " BILLNO='" + this.billno + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.storeBodySum = Ext.create('Ext.data.Store', {
model: 'Chfee_do_sum',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_invoiceapplication/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 '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
});
//#endregion formSearch
//查询工具条
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.BUHUITIJIAO ,
iconCls: "btndelete",
handler: function (button, event) {
this.onAuditBackClick();
},
scope: this
}, '-', {
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
}, '-', {
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.SetNoPrint, //打印
handler: function (button, event) {
this.SetNoPrint();
},
scope: this
}
]
});
this.storeCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'companymb', proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' }
});
this.storeCompany.load({ params: { condition: ""} });
this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.PAYCOMPANYREF,
labelWidth: 78,
forceSelection: true,
store: this.storeCompany,
id: 'PAYCOMPANYID',
name: 'PAYCOMPANYID',
valueField: 'gid',
displayField: 'name'
});
this.formEdit = Ext.widget('form', {
region: 'north',
height: 120,
frame: true,
bodyPadding: 3,
trackResetOnLoad: true,
// autoScroll: true,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',//fieldset
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'anchor',
flex: 3,
defaultType: 'textfield',
items: [
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.INVOICECUSTNAME,
labelWidth: 90,
readOnly: true,
name: 'INVOICECUSTNAME'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CUSTRATENO,
labelWidth: 90,
readOnly: true,
name: 'CUSTRATENO'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CUSTADDRTEL,
labelWidth: 90,
readOnly: true,
name: 'CUSTADDRTEL'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.CUSTBANK,
labelWidth: 90,
readOnly: true,
name: 'CUSTBANK'
}]
}
]
}, {
xtype: 'fieldset',
defaultType: 'textfield',
flex: 5,
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.INVOICECATEGORYREF,
labelWidth: 60,
readOnly: true,
name: 'INVOICECATEGORYREF'
}, {
fieldLabel: Zi.LAN.RECVCURR,
labelWidth: 60,
readOnly: true,
name: 'RECVCURR'
}, {
fieldLabel: Zi.LAN.INVOICENO,
readOnly: true,
name: 'INVOICENO'
}, {
fieldLabel: Zi.LAN.CUSTOMERNAME ,
readOnly: true,
name: 'CUSTOMERNAME'
}, {
fieldLabel: Zi.LAN.ACTUALCUSTOMERNAME,
readOnly: true,
name: 'ACTUALCUSTOMERNAME'
}]
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Currency,
labelWidth: 60,
// flex: 0.5,
readOnly: true,
name: 'CURRENCY'
}, {
fieldLabel: Zi.LAN.RATE,
readOnly: true,
labelWidth: 40,
// flex: 0.5,
name: 'RATE'
}, {
fieldLabel: Zi.LAN.APPLYAMOUNT,
readOnly: true,
name: 'APPLYAMOUNT',
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;
}
}, {
fieldLabel: Zi.LAN.INVAMOUNT ,
readOnly: true,
name: '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 '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, this.comboxCompany]
}
, {
xtype: 'container',
layout: 'hbox',
flex: 2,
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
labelWidth: 60,
name: 'REMARK',
fieldLabel: Zi.LAN.REMARK ,
anchor: '100%'
}]
}
]
}
]//end items(fieldset 2)
}
]//end root items
}); //end this.formEdit
//#region 附件信息
Ext.define('FeeFileModel', {
extend: 'Ext.data.Model',
idProperty: 'GID',
fields: [
{ name: 'GID', type: 'string' },
{ name: 'BillNo', type: 'string' },
{ name: 'File_Type', type: 'number' },
{ name: 'UpdateTime', type: 'string' },
{ name: 'Operator', type: 'string' },
{ name: 'File_Path', type: 'string' },
{ name: 'File_Name', type: 'string' },
{ name: 'File_OriginalName', type: 'string' }
]
});
this.storeChfeeFile = Ext.create('Ext.data.Store', {
model: 'FeeFileModel',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/Account/Chfee_payapplication/GetFileList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//表格
this.FeeFileColumns = [
{
sortable: true, hidden: true,
dataIndex: 'GID', readOnly: true,
header: 'GID',
width: 80
}, {
sortable: true, hidden: false,
dataIndex: 'File_OriginalName', readOnly: true,
header: Zi.LAN.FileName,
renderer: function (value, p, record) {
return '' + value + '';
},
width: 180
}, {
sortable: true, hidden: false,
dataIndex: 'UpdateTime', readOnly: true,
header: Zi.LAN.FileDate,
width: 80
}, {
sortable: true, hidden: false,
dataIndex: 'Operator', readOnly: true,
header: Zi.LAN.FilePerson,
width: 80
}, {
sortable: true, hidden: true,
dataIndex: 'File_Name', readOnly: true,
header: Zi.LAN.FileName ,
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'File_Path',
header: 'File_Path',
width: 80
}, {
xtype: 'actioncolumn',
width: 50,
text: Zi.LAN.Operating ,
items: [{
icon: '/images/icons/btnSearch.gif', // Use a URL in the icon config
tooltip: '预览',
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = "/Areas/Account/Files/" + rec.get('BillNo') + '/' + rec.get('File_Name');
//var imgView = new Shipping.FileView({ filePath: filePath });
//imgView.show();
DsOpenEditWin("/Account/Chfee_payapplication/FileView?path=" + filePath, "", "650", "1250");
}
}]
}
];
var selCertModel = Ext.create('Ext.selection.CheckboxModel');
this.fileGrid = new Ext.grid.GridPanel({
store: this.storeChfeeFile,
enableHdMenu: false,
layout: 'border',
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
selModel: selCertModel,
singleSelect: true,
selType: 'rowmodel',
columns: this.FeeFileColumns
});
this.page_2 = new Ext.Panel({
id: "page_2",
title: Zi.LAN.filefujina,
// autoScroll: true,
layout: "border",
region: 'center',
//closable:true,
items: [this.fileGrid]
});
//#endregion
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.INVFEEDETAIL,
layout: "border",
region: "center",
height: 420,
items: [
this.gridListdetail, this.panelSum
]
});
this.panelInvDetail = new Ext.Panel({
title: Zi.LAN.InvDetail ,
layout: "border",
region: "center",
margin: '2 2',
items: [this.formEdit, this.gridDetailList]
});
this.tabpanel = new Ext.TabPanel
({
activeTab: 0,
autoWidth: true,
border: false,
frame: false,
region: 'center',
id: "TabPanelID",
enableTabScroll: true,
split: true,
items:
[
this.panelInvDetail,
this.paneldetail,
this.page_2
]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList, this.tabpanel]
});
this.storeList.on('beforeload', function (store) {
// var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext, isaudit: _this.isAudit });
}, this);
this.onRefreshClick();
this.storeList.on('load', function (store, records) {
if (store.getCount() > 0) {
this.gridList.getSelectionModel().select(0);
}
}, this);
_this = this;
this.gridList.getSelectionModel().on('select', function (model, record, index) {
this.billno = record.data.BILLNO;
var GID = record.data.GID;
var sql = "";
sql = " BILLNO='" + this.billno + "'";
_this.formEdit.getForm().loadRecord(record);
_this.storeBodyListdetail.load({ params: { condition: sql} });
_this.storeBodySum.load({ params: { condition: sql} });
_this.storeDetailList.load({ params: { condition: " PID='" + GID + "'"} });
_this.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: _this.billno} });
}, 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.SelectDanju , icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
var j = 0;
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.BILLSTATUS;
var IsAudit = rec.data.IsAudit;
if (BILLSTATUS == '2' || BILLSTATUS == '4') {
if (IsAudit == 0) {
Ext.Msg.show({
title: Zi.LAN.Prompt,
msg: Zi.LAN.NOSHENHEQUANXIAN,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
bodyAddDatas.push(rec);
j = j + 1;
}
} else {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.STATUSNOAUDIT, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (j == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.NODATATOAUDIT, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var PAYCOMPANYID = this.formEdit.getForm().findField('PAYCOMPANYID').getValue();
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,
timeout: 1200000,
url: '/Account/Chfee_invoiceapplication/AuditList',
params: {
data: jsonbodyAddDatas,
PAYCOMPANYID: PAYCOMPANYID
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.onRefreshClick();
Ext.Msg.hide();
// Ext.Msg.show({ title: '提示', msg: '审核成功!', 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);
},
onAuditBackClick: 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 bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.BILLSTATUS;
if (BILLSTATUS == '2' || BILLSTATUS == '0') {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.STATUSNOBOHUI, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.show({
title: Zi.LAN.BOHUIYUANYIN,
msg: Zi.LAN.BOHUIYUANYIN,
width: 300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: function (btn, text) {
if (btn == "ok") {
Ext.Ajax.request({
waitMsg: Zi.LAN.ZHENGZAIBOHUI ,
url: '/Account/Chfee_invoiceapplication/AuditBackList',
params: {
data: jsonbodyAddDatas,
reason: text
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.storeList.reload();
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.Caveat, msg: Zi.LAN.FuWuQiError, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}
});
//Ext.MessageBox.confirm('提示', '确定驳回选中的业务吗?', function (btn) {
// if (btn == 'yes') {
// Ext.Msg.wait('正在驳回数据...');
// Ext.Ajax.request({
// waitMsg: '正在驳回数据...',
// url: '/Account/Chfee_invoiceapplication/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: '提示', msg: '驳回成功!', 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);
},
SetNoPrint: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '', 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;
}
}
Ext.Ajax.request({
waitMsg: '',
url: '/Account/Chfee_invoiceapplication/UpdateNoPrint',
params: {
billnos: feeGidSql
},
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.show({ title: Zi.LAN.Prompt, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.storeList.reload();
}
} else {//请求出现错误,请重试
Ext.MessageBox.alert('服务器错误', response.responseText);
}
},
scope: this
});
},
GetCategoryName: function (oplbname) {
if (strLANGUAGES != "en-us") return oplbname;
var records = DsStoreQueryBy(this.storeInvCategory, 'EnumValueName', oplbname);
if (records.getCount() > 0) {
return records.getAt(0).data.EnumValueName_2;
} else {
return '';
}
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.PageSize = this.Pagenum.getValue();
this.sqlcontext = sql;
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.formEdit.getForm().reset();
this.storeBodyListdetail.load({ params: { condition: sql} });
this.storeBodySum.load({ params: { condition: sql} });
this.storeDetailList.load({ params: { condition: " PID='11'"} });
}
}
},
scope: this
});
},
onDsQuery: function (button, event) {
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, isaudit: this.isAudit },
waitMsg: Zi.LAN.NowSelect,
callback: function (r, options, success) {
if (success) {
if (r.length == 0) {
var sql = " BILLNO='11111111' ";
this.formEdit.getForm().reset();
this.storeBodyListdetail.load({ params: { condition: sql} });
this.storeBodySum.load({ params: { condition: sql} });
this.storeDetailList.load({ params: { condition: " PID='11'"} });
}
}
},
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('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, "APPLYTIME >='" + expDateBgn + "'");
var expDateEnd = form.findField('ExpDateEnd').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "APPLYTIME <='" + expDateEnd + "'");
var APPLICANT = form.findField('APPLICANT').getValue();
sql = sql + getAndConSql(sql, APPLICANT, "APPLICANT like '%" + APPLICANT + "%'");
this.isAudit = form.findField('DC').getValue();
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = INVOICEPORT;
return ret;
}
});