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_payapplication/ChPayapplicationAudit.js

2347 lines
88 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.ChPayapplicationAudit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.ChPayapplicationAudit.superclass.constructor.call(this);
};
var BillNo;
Ext.extend(Shipping.ChPayapplicationAudit, Ext.Panel, {
PageSize: 15,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isAudit: '',
BodyPageSize: 50,
initUIComponents: function () {
this.formname = "formChPayapplicationAudit"
//定义数据集
this.worksql = getUrlParam('worksql');
this.BillSql = '';
this.billno = '11';
this.Parentsql = '1=2';
this.isuseexrate = 0;
this.YJFEENAME = '';
this.YJFEENAMEUSD = '';
_this = this;
parentWin = window.parent;
mainWin = getMainForm(parentWin);
Ext.define('MsOPGain', {
extend: 'Ext.data.Model',
idProperty: 'GId',
fields: [
{ name: 'CURR', type: 'string' },
{ name: 'NORATEDR', type: 'number' },
{ name: 'DR', type: 'number' },
{ name: 'BALDR', type: 'number' },
{ name: 'NORATECR', type: 'number' },
{ name: 'CR', type: 'number' },
{ name: 'NORATEPR', type: 'number' },
{ name: 'PR', type: 'number' },
{ name: 'PROFITRATE', type: 'number' },
{ name: 'USDPROFIT', type: 'number' }
]
});
this.storeReplacePaymentStatus = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.GeneralValue',
proxy: { url: '/CommMng/BasicDataRef/GeneralSelect' }
});
this.storeReplacePaymentStatus.add({ GID: '', GVALUE: '' });
this.storeReplacePaymentStatus.add({ GID: '未代付', GVALUE: '未代付' });
this.storeReplacePaymentStatus.add({ GID: '已代付', GVALUE: '已代付' });
this.comboxReplacePaymentStatus = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '代付状态',
labelWidth: 70,
flex: 0.7,
store: this.storeReplacePaymentStatus,
queryMode: 'local',
name: 'ReplacePaymentStatus',
valueField: 'GID',
displayField: 'GVALUE',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeReplacePaymentCORPID = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCompanysEntity',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
//this.storeReplacePaymentCORPID.load({ params: { condition: "" } });
this.storeReplacePaymentCORPID.loadData(mainWin.GetPubStore("Company").data.items);
this.storeReplacePaymentCORPID.add({ GID: '', NAME: '' });
this.comboxReplacePaymentCORPID = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '代付公司', //'委托分公司',
labelWidth: 70,
flex: 1,
store: this.storeReplacePaymentCORPID,
forceSelection: true,
readOnly: false,
name: 'ReplacePaymentCORPID',
valueField: 'GID',
displayField: 'NAME'
});
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsChPayapplication',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_payapplication/GetAuditDataList',
reader: {
id: 'BILLNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BILLNO',
header: Zi.LAN.RequisitionNumber, //申请单号
width: 120
}, {
sortable: true,
dataIndex: 'BILLSTATUSREF',
header: Zi.LAN.status, //状态
width: 80,
renderer: function (value, meta, record) {
value = record.data.BILLSTATUSREF;
if (value == '审核通过') {
meta.tdCls = 'feestatus_pass';
} else if (value == '录入状态') {
} else if (value == '已提交') {
meta.tdCls = 'feestatus_refer';
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_refer';
} else if (value == '已结算') {
meta.tdCls = 'feestatus_settle';
}
return record.data.BILLSTATUSREF;
}
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.SettlementUnit, //结算单位
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMERFULLNAME',
header: Zi.LAN.SettlementUnitFull, //结算单位全称
width: 120
}, {
sortable: true,
dataIndex: 'CURR',
header: Zi.LAN.Currency, //币别
width: 50
}, {
sortable: true,
dataIndex: 'AMOUNTRMB',
header: 'RMB',
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: 'AMOUNTUSD',
header: 'USD',
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: 'AMOUNTOT',
header: '其他',
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: 'STLAMOUNT',
header: '实付金额',
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: 'APPLYTIME',
header: Zi.LAN.DateApplication, //申请日期
width: 100
}, {
sortable: true,
dataIndex: 'APPLICANTNAME',
header: Zi.LAN.Applicant, //申请人
width: 100
}, {
sortable: true,
dataIndex: 'AUDITTIME',
header: Zi.LAN.FinalReviewDate, //最后审核日期
width: 100
}, {
sortable: true,
dataIndex: 'AUDITUSER',
header: Zi.LAN.lastReviewer, //最后审核人
width: 100
}, {
sortable: true,
dataIndex: 'PAYABLETIME',
header: Zi.LAN.ApplyPaymentDate, //申请支付日期
width: 100
}, {
sortable: true,
dataIndex: 'ISINVOICE',
header: Zi.LAN.Invoiced, //已开发票
width: 160
}, {
sortable: true,
dataIndex: 'INVNO',
header: Zi.LAN.InvoiceNumber, //发票号
width: 160
}, {
sortable: true,
dataIndex: 'SETTLETYPEREF',
header: Zi.LAN.jstype, //委托单位
width: 160
}, {
sortable: true,
dataIndex: 'BS_CUSTOMERNAME',
header: Zi.LAN.Requester, //委托单位
width: 160
}, {
sortable: true,
dataIndex: 'REMARK',
header: Zi.LAN.Remarks, //备注
width: 160
}, {
sortable: true,
dataIndex: 'REASON',
header: Zi.LAN.REASON, //备注
width: 160
}, {
sortable: true,
dataIndex: 'SALECORP',
header: Zi.LAN.DepartmentName, //备注
width: 160
},
{
sortable: true,
id: '',
dataIndex: 'ISPRINT',
header: Zi.LAN.printy, //'应收费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
if (value == '1')
return '是'; //是
else
return '';
}
}, {
sortable: true,
dataIndex: 'APPLICANTDEPT',
header: Zi.LAN.APPLICANTDEPT, //驳回原因
width: 80
}, {
sortable: true,
dataIndex: 'PRINTCOUNT',
header: Zi.LAN.PRINTCOUNT, //驳回原因
width: 80
}, {
sortable: true,
dataIndex: 'CUSTBANKNAME',
header: Zi.LAN.jsuanBank, //驳回原因
width: 80
}, {
sortable: true,
dataIndex: 'CUSTACCOUNT',
header: Zi.LAN.jsuanzh, //驳回原因
width: 80
}, {
sortable: true,
dataIndex: 'IsReplacePayment',
header: '是否需代付',
renderer: function (value, cellmeta) {
if (value == 'True' || value == 'true' || value == '1') {
return "√";
} else return "";
}
}, {
sortable: true,
dataIndex: 'ReplacePaymentStatus',
header: '代付状态'
}, {
sortable: true,
dataIndex: 'ReplacePaymentCORPID',
header: '代付分公司',
renderer: function (value, cellmeta) {
if (value) {
var corpname = _this.storeReplacePaymentCORPID.find('GID', value);
if (corpname>=0) {
corp = _this.storeReplacePaymentCORPID.getAt(corpname);
return corp.data.NAME;
}
}
}
}, {
sortable: true,
dataIndex: 'ReplacePaymentOPNAME',
header: '代付操作人'
}, {
sortable: true,
dataIndex: 'ReplacePaymentOPTIME',
header: '代付时间'
}
];
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.girdcolums = this.initgirdcolums;
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
//定义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,
viewConfig: {
enableTextSelection: true
},
selModel: this.GridCheckBoxModel,
tbar: [{
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
}],
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.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": "全部" });
this.storeAddDCType.add({ "DC": "1", "NAME": "未审核" });
this.storeAddDCType.add({ "DC": "2", "NAME": "已审核" });
this.storeAddDCType.add({ "DC": "3", "NAME": "仅需自己审核" });
this.storeAddDCType.add({ "DC": "5", "NAME": "部分结算" });
this.storeAddDCType.add({ "DC": "4", "NAME": "已结算" });
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.ApprovalStatus,
labelWidth: 60,
store: this.storeAddDCType,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'DC',
value: '3',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRmAll' }
});
//this.storeCustCode.load({ params: { condition: ""} });
this.storeCustCode.loadData(mainWin.GetPubStore("PubStore_CustomerAll").data.items);
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.SettlementUnit, //结算单位
labelWidth: 60,
store: this.storeCustCode,
forceSelection: true,
//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.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.Applicant,
store: this.storeOpCode,
forceSelection: true,
matchFieldWidth: false,
name: 'APPLICANT',
labelWidth: 50,
flex: 0.5,
valueField: 'GID',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
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.RequisitionNumber, //申请单号
name: 'BsNo',
labelWidth: 60,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.RelatedBusinessNumber, //相关业务号
name: 'sBsNo',
labelWidth: 70,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCustCode, {
fieldLabel: Zi.LAN.FromDateApplication, //从付费申请日期
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.ToDateApplication,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateEnd',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxAPPLICANT, this.comboxaddDCType
]
},
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.NeedReplace, //需代付
name: 'ISREPLACE',
labelWidth: 60,
flex: 0.3,
enableKeyEvents: true,
xtype: 'checkbox'
},
this.comboxReplacePaymentStatus
,
this.comboxReplacePaymentCORPID
,
{
xtype: 'hiddenfield',
flex: 4.6
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion
//#region 明细
this.storeBodyListdetail = Ext.create('Ext.data.Store', {
model: 'Chfee_do_detail',
remoteSort: true,
pageSize: this.BodyPageSize,
proxy: {
type: 'ajax',
url: '/Account/Chfee_payapplication/GetBillAuditList',
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.DelegateNumber, //委托编号
width: 120
}, {
sortable: true,
dataIndex: 'MBLNO',
header: Zi.LAN.ZhuTDH,
width: 120
}, {
sortable: true,
dataIndex: 'HBLNO',
header: Zi.LAN.HBLNO,
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.Requester,
width: 100
}, {
sortable: true,
dataIndex: 'FEEOBJNAME',
header: Zi.LAN.SettlementUnit,
width: 100
}, {
sortable: true,
dataIndex: 'ETD',
header: Zi.LAN.SailingDate,
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'BSSOURCE',
header: Zi.LAN.BusinessSource, //业务来源
width: 80
}, {
sortable: true,
dataIndex: 'FEENAME',
header: Zi.LAN.CostName, //费用名称
width: 80
}, {
sortable: true,
dataIndex: 'FEETYPEREF',
header: Zi.LAN.PayReceive, //收付
width: 40
}, {
sortable: true,
dataIndex: 'AMOUNT',
header: Zi.LAN.WriteOffAmount, //核销金额
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.OriginalCurrency, //原始币别
width: 80
}, {
sortable: true,
dataIndex: 'ORIGEXCHANGERATE',
header: Zi.LAN.OriginalExchangeRate, //原始汇率
width: 80
}, {
sortable: true,
dataIndex: 'EXCHANGERATE',
header: Zi.LAN.ExchangeRate,
width: 80
}, {
sortable: true,
dataIndex: 'ORIGAMOUNT',
header: Zi.LAN.OriginalAmount,
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: 'TTLNODR',
header: Zi.LAN.TTLNODR,
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: 'INVOICENO',
header: Zi.LAN.InvoiceNumber, //发票号
width: 80
}, {
sortable: true,
dataIndex: 'OPTYPE',
header: Zi.LAN.ChangeSingle, //更改单
width: 80
}, {
sortable: true,
dataIndex: 'ACCDATE',
header: Zi.LAN.AccountingPeriod,
width: 80
}, {
sortable: true,
dataIndex: 'BLISSUESTATUS',
header: Zi.LAN.SignatureStatus, //签单状态
width: 80
}, {
sortable: true,
dataIndex: 'SALE',
header: Zi.LAN.LanhuoPeople, //揽货人
width: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: Zi.LAN.Remarks, //备注
width: 160
}, {
sortable: true,
dataIndex: 'INPUTMODE',
header: Zi.LAN.EntryMethod,
width: 160
}, {
sortable: true,
dataIndex: 'BSSTATUSREF',
header: Zi.LAN.BSSTATUSREF, //揽货人
width: 80
}, {
sortable: true,
dataIndex: 'FEESTATUSREF',
header: Zi.LAN.FEESTATUSREF, //揽货人
width: 80
}
];
this.girdbillcolums = this.initgirdbillcolums;
this.BodyPagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: Zi.LAN.NumberOfpage, //每页记录数
labelAlign: 'right',
value: this.BodyPageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.storeBodyListdetail.reload();
}
}
}
});
this.gridListdetail = new Ext.grid.GridPanel({
store: this.storeBodyListdetail,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
viewConfig: {
enableTextSelection: 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,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeBodyListdetail,
displayInfo: true,
displayMsg: Zi.LAN.FenYe, //当前显示条数据
emptyMsg: Zi.LAN.Nodata//没有数据
}), this.BodyPagenum]
});
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.storeBodySum = Ext.create('Ext.data.Store', {
model: 'Chfee_do_sum',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_payapplication/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.TotalAmount// '申请金额合计'
}],
columns: [{
sortable: true,
dataIndex: 'FEETYPEREF',
header: Zi.LAN.PayReceive, //收付
width: 40
}, {
sortable: true,
dataIndex: 'CURRENCY',
header: Zi.LAN.Currency,
width: 80
}, {
sortable: true,
dataIndex: 'AMOUNT',
header: Zi.LAN.AmountOfMoney, //金额
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.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);
this.gridListdetail.getSelectionModel().on('select', function (model, record, index) {
var pbsno = record.data.PARENTID;
var sql = "";
sql = " BSNO IN (select BSNO FROM V_OP_BILL WHERE PARENTID='" + pbsno + "')";
this.Parentsql = sql;
_this.storeBodyBillSum.load({ params: { condition: sql} });
}, this);
this.storeBodyBillSum = Ext.create('Ext.data.Store', {
model: 'MsOPGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetMBLGainList',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridBillSum = new Ext.grid.GridPanel({
store: this.storeBodyBillSum,
enableHdMenu: false,
region: 'center',
// height: 150,
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
// tbar: [{
// xtype: 'label',
// id:'lblbillsum',
// width: 120,
// height: 22,
// text: Zi.LAN.SumMoney// '当前此票费用合计'
// }, {
// xtype: 'label',
// id: 'lblbillsum2',
// width: 320,
// height: 22,
// html: "<font color='red'></font>"// '当前此票费用合计'
// }],
columns: [{
header: Zi.LAN.Currency,//币别 //"<a href='#'><font color='#FF0000'>总 计</font></a>",
sortable: false,
align: 'center',
dataIndex: 'CURR',
width: 40
}, {
header: Zi.LAN.YingShou, //'应收',
dataIndex: 'DR',
align: 'right',
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; },
width: 75
}, {
header: Zi.LAN.YingFu, //'应付',
dataIndex: 'CR',
align: 'right',
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; },
width: 75
}, {
header: Zi.LAN.Profit, //'利润',
dataIndex: 'PR',
align: 'right',
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; },
width: 70
}, {
header: Zi.LAN.BalDr, //'未收',
dataIndex: 'BALDR',
align: 'right',
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; },
width: 70
}, {
header: Zi.LAN.USDPROFIT, //'利润(USD)',
dataIndex: 'USDPROFIT',
align: 'right',
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; },
width: 70
}
]
});
this.panelBillSum = new Ext.Panel({
layout: "border",
region: 'south',
height: 150,
title: Zi.LAN.SumMoney,
items: [this.gridBillSum]
});
//#endregion formSearch
//查询工具条
_this = this;
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.ExaminationPassed, //审核通过
iconCls: "btnadd",
handler: function (button, event) {
this.onAuditPassClick();
},
scope: this
}
, '-', {
text: Zi.LAN.ExaminationPassedAll, //全部审核通过
iconCls: "btnadd",
handler: function (button, event) {
this.onAllAuditClick();
},
scope: this
}
,
'-',
{
text: Zi.LAN.DismissedSubmission, //驳回提交
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;
}
}, '-', {
text: Zi.LAN.print, //打印
tooltip: Zi.LAN.printbb, //打印报表
menu:
[
{
text: Zi.LAN.printlb, //打印列表
handler: function (menu, event) {
_this.Print();
}
}, {
text: Zi.LAN.printxz, //打印选中
handler: function (menu, event) {
_this.PrintSelect(menu, event, 1);
}
}],
scope: this
}, '-',
{
text: Zi.LAN.SetNoprint, //打印
handler: function (button, event) {
this.SetNoPrint();
},
scope: this
}, '-', {
text: Zi.LAN.ExportExcel, //导出EXcel
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', {
id: 'btnDoReplacePayment',
text: Zi.LAN.DoReplacePayment,
tooltip: Zi.LAN.DoReplacePayment, //执行代付
handler: function (button, event) {
this.onReplacePayment(1);
},
scope: this
}, {
id: 'btnUnDoReplacePayment',
text: Zi.LAN.UnDoReplacePayment,
tooltip: Zi.LAN.UnDoReplacePayment, //取消代付
handler: function (button, event) {
this.onReplacePayment(2);
},
scope: this
}
]
});
//#region 附件信息
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,
width: 240
}, {
sortable: true, hidden: false,
dataIndex: 'UpdateTime', readOnly: true,
header: Zi.LAN.FileDate,
width: 140
}, {
sortable: true, hidden: false,
dataIndex: 'Operator', readOnly: true,
header: Zi.LAN.FilePerson,
width: 120
}, {
sortable: true, hidden: true,
dataIndex: 'File_Name', readOnly: true,
header: Zi.LAN.FileWName,
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'File_Path',
header: 'File_Path',
width: 80
},
{
sortable: true,
dataIndex: 'File_DocType',
header: '文件类型',
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 filePath = rec.get('File_Path');
//var imgView = new Shipping.FileView({ filePath: filePath });
//imgView.show();
DsOpenEditWin(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',
tbar: [{
text: '上传文件', //上传图片
tooltip: '上传文件',
iconCls: "btnadddetail",
handler: function (button, event) {
this.onAddFileClick(button, event);
},
scope: this
}, '-', {
text: '删除文件', //删除
tooltip: '删除文件', //删除图片
iconCls: "btndeletedetail",
handler: function (button, event) {
this.onDelFileClick(button, event);
},
scope: this
}],
columns: this.FeeFileColumns
});
//#endregion
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 97,
items: [this.formSearch, this.panelBtn]
});
this.panelSum = new Ext.Panel({
layout: "border",
region: 'east',
width: 330,
split: true,
margin: '2 2',
items: [this.gridSum, this.panelBillSum]
});
this.paneldetail = new Ext.Panel({
layout: "border",
region: 'center',
items: [
this.gridListdetail, this.panelSum
]
});
//#region 增加附件tab
this.page_1 = new Ext.Panel({
id: "page_1",
title: Zi.LAN.PaymentApplicationDetails, //付费申请明细
// autoScroll: true,
layout: "border",
region: 'center',
//closable:true,
items: [this.paneldetail]
});
this.page_2 = new Ext.Panel({
id: "page_2",
title: Zi.LAN.AttachmentInformation,
// autoScroll: true,
layout: "border",
region: 'center',
//closable:true,
items: [this.fileGrid]
});
this.MainTab = new Ext.tab.Panel({
layout: "border",
// height: 250,
region: "center", split: true,
items: [
this.page_1
, this.page_2
]
});
//#endregion
Ext.apply(this, {
items: [this.panelTop, this.gridList, this.MainTab]
});
_this = this;
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql, isaudit: this.isAudit });
}, this);
this.storeBodyListdetail.on('beforeload', function (store) {
var sql = " BILLNO='" + _this.billno + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.storeBodyBillSum.on('beforeload', function (store) {
var sql = this.Parentsql;
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
if (this.worksql != undefined && this.worksql != '') {
this.worksql = this.worksql.replace(/@@/g, '=')
this.sqlcontext = this.worksql;
this.onDsQuery();
} else {
}
this.storeList.on('load', function (store, records) {
//if (store.getCount() > 0) {
// this.gridList.getSelectionModel().select(0);
//}
}, this);
var ListForm = this;
this.gridList.getSelectionModel().on('select', function (model, record, index) {
ListForm.billno = record.data.BILLNO;
var sql = "";
sql = " BILLNO='" + ListForm.billno + "'";
ListForm.storeBodyListdetail.load({ params: { start: 0, limit: ListForm.BodyPageSize, condition: sql} });
ListForm.storeBodySum.load({ params: { condition: sql} });
ListForm.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: ListForm.billno} });
ListForm.storeBodyBillSum.removeAll();
var CUSTOMERNAME = record.data.CUSTOMERNAME;
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsChFee/GetFeeBalAmount',
params: {
condition: " FEETYPE=1 AND CUSTOMERNAME='" + CUSTOMERNAME + "'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Data == 0) {
ListForm.panelBillSum.setTitle(Zi.LAN.SumMoney, false);
} else {
ListForm.panelBillSum.setTitle(Zi.LAN.SumMoney + "<font color='red'>(此付费客户存在应收费用" + result.Data + ")</font>", false);
}
} else {
ListForm.panelBillSum.setTitle(Zi.LAN.SumMoney, false);
}
},
scope: this
});
}, this);
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='PAYAUDITEXRATE'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.isuseexrate = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='YJFEENAME'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
this.YJFEENAME = data.PARAMVALUE;
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='YJFEENAME(USD)'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
this.YJFEENAMEUSD = data.PARAMVALUE;
}
} else {
}
},
scope: this
});
//#region 结算汇率和金额
Ext.define('MsFeeCurr', {
extend: 'Ext.data.Model',
idProperty: 'CURR',
fields: [
{ name: 'CURR', type: 'string' },
{ name: 'DEFRATE', type: 'number' },
{ name: 'CRDEFRATE', type: 'number' }
]
});
this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurr.load({ params: { condition: ""} });
this.comboxStlCurr = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '结算币别',
store: this.StoreCurr,
forceSelection: true,
name: 'STLCURR',
value: 'RMB',
valueField: 'CURR',
displayField: 'CURR'
});
this.formAuditStlShow = 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: [this.comboxStlCurr, {
fieldLabel: '汇率',
name: 'STLRATE'
}
]//end items(fieldset 1)
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '实付金额',
name: 'STLAMOUNT'
}
]//end items(fieldset 1)
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.winAuditStlShow = Ext.create('Ext.window.Window', {
title: "付费审核", //"发送预配舱单",
width: 450,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formAuditStlShow],
buttons: [{
text: "审核通过", //"确定发送",
minWidth: 70,
handler: function () {
var stlcurr = _this.formAuditStlShow.getForm().findField('STLCURR').getValue();
var stlrate = _this.formAuditStlShow.getForm().findField('STLRATE').getValue();
var stlamount = _this.formAuditStlShow.getForm().findField('STLAMOUNT').getValue();
_this.onAuditExratePassClick(stlcurr, stlrate, stlamount);
}
}, {
text: "关闭", //"关闭",
minWidth: 70,
handler: function () {
_this.winAuditStlShow.close();
}
}]
});
// #endregion
this.RoleTaskQueryGid = getUrlParam('RoleTaskQueryGid');
this._condition = getUrlParam('CONDITION');
/////如果是从首页【待办工作】模块双击跳转则在URL中增加RoleTaskGid参数值为Sys_Role_Task_Query.GID
//this.RoleTaskQueryGid = getUrlParam('RoleTaskQueryGid');
//LoadRoleTaskQuery(this.RoleTaskQueryGid, this.formSearch, this.onRefreshClick);
if (this.RoleTaskQueryGid && this._condition) {
LoadRoleTaskQuery(this.RoleTaskQueryGid, this.formSearch);
this.formSearch.getForm().findField('DC').setValue("");
var _isaudit = this.isAudit;
this.isAudit = "";
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: this._condition, load: 'true' },
waitMsg: "正在查询数据...",
scope: this
});
this.isAudit = _isaudit;
} else {
this.onRefreshClick();
}
}, //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 isAuditExrate = false;
var bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.BILLSTATUS;
var IsAudit = rec.data.IsAudit;
if ((BILLSTATUS == '6' || BILLSTATUS == '2') && (IsAudit != 0)) {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.NoShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (this.isuseexrate == 1) {
for (var i = 0; i < this.storeBodyListdetail.getCount(); i += 1) {
var member = this.storeBodyListdetail.getAt(i);
if ((member.data.FEENAME == this.YJFEENAME) || (member.data.FEENAME == this.YJFEENAMEUSD))
isAuditExrate = true;
}
}
if (isAuditExrate && selections.length == 1) {
_this.formAuditStlShow.getForm().findField('STLAMOUNT').setValue(0)
_this.winAuditStlShow.show();
return;
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.SureShenHe, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.NowShenHe);
Ext.Ajax.request({
waitMsg: Zi.LAN.NowShenHe,
url: '/Account/Chfee_payapplication/AuditList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.storeList.reload();
if (jsonresult.Message != '审核通过') {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
} else Ext.Msg.hide();
}
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);
},
onAuditExratePassClick: function (stlcurr, stlrate, stlamount) {
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 isAuditExrate = false;
var bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.BILLSTATUS;
var IsAudit = rec.data.IsAudit;
if ((BILLSTATUS == '6' || BILLSTATUS == '2') && (IsAudit != 0)) {
rec.data.STLCURR = stlcurr;
rec.data.STLRATE = stlrate;
rec.data.STLAMOUNT = stlamount;
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.NoShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.SureShenHe, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.NowShenHe);
Ext.Ajax.request({
waitMsg: Zi.LAN.NowShenHe,
url: '/Account/Chfee_payapplication/AuditList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.storeList.reload();
_this.winAuditStlShow.close();
if (jsonresult.Message != '审核通过') {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
} else
Ext.Msg.hide();
// Ext.Msg.show({ title: Zi.LAN.Prompt, msg: jsonresult.Message, 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.DismissDocuments, 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;
var IsAudit = rec.data.IsAudit;
if ((BILLSTATUS == '0' || BILLSTATUS == '2') && (IsAudit != -1)) {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.DismissDocumentsNo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.show({
title: Zi.LAN.Tishi7,
msg: Zi.LAN.Tishi8,
width: 300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: function (btn, text) {
if (btn == "ok") {
Ext.Ajax.request({
waitMsg: Zi.LAN.DismissDocumentsNow,
url: '/Account/Chfee_payapplication/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.hide();
}
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(Zi.LAN.Prompt, Zi.LAN.DismissDocumentsSure, function (btn) {
// if (btn == 'yes') {
// Ext.Msg.wait(Zi.LAN.DismissDocumentsNow);
// Ext.Ajax.request({
// waitMsg: Zi.LAN.DismissDocumentsNow,
// url: '/Account/Chfee_payapplication/AuditBackList',
// params: {
// data: jsonbodyAddDatas
// },
// 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.DismissSuccess, 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);
},
onAllAuditClick: function (menu, event) {
if (this.storeList.length == 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.NoAudit, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
Ext.MessageBox.confirm(Zi.LAN.Prompt, Zi.LAN.SureShenHeAll, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.NowAudit);
Ext.Ajax.request({
waitMsg: Zi.LAN.Zhengzaisuoding,
url: '/Account/Chfee_payapplication/AllAudit',
params: {
condition: _this.BillSql
},
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);
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.BillSql = sql;
_this.panelBillSum.setTitle(Zi.LAN.SumMoney, false);
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: { start: 0, limit: _this.BodyPageSize,condition: sql} });
this.storeBodySum.load({ params: { condition: sql} });
}
}
},
scope: this
});
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
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 },
waitMsg: Zi.LAN.NowSelect,
scope: this
});
},
onExportClick: function (button, event) {
_this = this;
GridExportExcelPage(this.gridList);
},
Print: 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 record = selections[0];
var billNo = record.data.BILLNO;
var sortstr = ' b.VESSEL,b.VOYNO,b.MBLNO ';
var printType = 'MSCHFEEPAYAPPLICATION';
var sql1 = "SELECT p.*,(select ShowName from [user] where GID=p.APPLICANT) as APPLICANTNAME,(select bankname from info_client_bank where gid=p.CUSTACCOUNTGID) CUSTBANKNAME,";
sql1 = sql1 + "(select ACCOUNT from info_client_bank where gid=p.CUSTACCOUNTGID) CUSTACCOUNT,(select DESCRIPTION from info_client where SHORTNAME=p.CUSTOMERNAME) CUSTFULLNAME FROM ch_fee_payapplication p WHERE BILLNO='" + billNo + "'";
var sql2 = "SELECT c.GID,c.BSNO,c.FEEID,c.FEENAME,c.CURRENCY,c.AMOUNT,c.DOAMOUNT,c.ORIGCURRENCY,c.ORIGAMOUNT,c.EXCHANGERATE,FEETYPE ";
sql2 = sql2 + ",b.CUSTOMERNAME,b.VESSEL,b.VOYNO,b.ETD,b.PORTLOAD";
sql2 = sql2 + " ,b.PORTDISCHARGE,b.INPUTBY,b.OP,b.CUSTSERVICE,b.DOC,b.SALE,b.MBLNO,b.CUSTNO"
sql2 = sql2 + " FROM ch_fee_do c left join v_op_bill b on (b.bsno=c.bsno)";
sql2 = sql2 + " WHERE C.BILLNO='" + billNo + "' ORDER BY " + sortstr;
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
SetNoPrint: 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;
}
}
Ext.Ajax.request({
waitMsg: '',
url: '/Account/Chfee_payapplication/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: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.storeList.reload();
}
} else {//请求出现错误,请重试
Ext.MessageBox.alert(Zi.LAN.FuWuQiError, response.responseText);
}
},
scope: this
});
},
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 isaudit = 1;
var isprint = 0;
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;
}
if (record.data.BILLSTATUSREF != '审核通过' && record.data.BILLSTATUSREF != '已结算' && record.data.BILLSTATUSREF != '部分结算') {
isaudit = 0;
}
if (record.data.ISPRINT == '1') {
isprint = 1;
}
};
var record = selections[0];
var billNo = record.data.BILLNO;
var printType = 'MSCHFEEPAYAPPLICATIONSEL';
var sql1 = "SELECT p.*,(select ShowName from [user] where GID=p.APPLICANT) as APPLICANTNAME,(select bankname from info_client_bank where gid=p.CUSTACCOUNTGID) CUSTBANKNAME,";
sql1 = sql1 + "(select ACCOUNT from info_client_bank where gid=p.CUSTACCOUNTGID) CUSTACCOUNT,dbo.GetStlByPayNo(p.BILLNO) as BALBILLNO FROM ch_fee_payapplication p WHERE BILLNO IN (" + feeGidSql + ") ";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
if (isaudit == 1 && isprint == 0) {
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
Ext.Ajax.request({
waitMsg: '',
url: '/Account/Chfee_payapplication/UpdatePrint',
params: {
billnos: feeGidSql
},
callback: function (options, success, response) {
if (success) {
_this.storeList.reload();
} else {
}
},
scope: this
});
} else {
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='PAYAPPPRINTAFTERAUDIT'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1' && isaudit == 0) {
Ext.Msg.show({ title: Zi.LAN.Error, msg: Zi.LAN.shtgprint, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='PAYAPPONLYPRINTONE'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1' && isprint == 1) {
Ext.Msg.show({ title: Zi.LAN.Error, msg: Zi.LAN.notcfprint, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Ajax.request({
waitMsg: '',
url: '/Account/Chfee_payapplication/UpdatePrint',
params: {
billnos: feeGidSql
},
callback: function (options, success, response) {
if (success) {
_this.storeList.reload();
} else {
}
},
scope: this
});
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
}
} else {
}
},
scope: this
});
// PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
}
} else {
}
},
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 sBsNo = form.findField('sBsNo').getValue();
sql = sql + getAndConSql(sql, sBsNo, " EXISTS (select 1 from ch_fee_do d where d.BILLNO=i.BILLNO AND d.BSNO IN (SELECT BSNO FROM V_OP_BILL WHERE CUSTNO like '%" + sBsNo + "%' or MBLNO like '%" + sBsNo + "%' or HBLNO like '%" + sBsNo + "%' or CUSTOMNO like '%" + sBsNo + "%' or ORDERNO like '%" + sBsNo + "%'))");
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();
var ISREPLACE = form.findField('ISREPLACE').getValue();
if (ISREPLACE) {
sql = sql + getAndConSql(sql, ISREPLACE, "IsReplacePayment ='" + ISREPLACE + "' ");
}
var ReplacePaymentStatus = form.findField('ReplacePaymentStatus').getRawValue();
sql = sql + getAndConSql(sql, ReplacePaymentStatus, "ReplacePaymentStatus ='" + ReplacePaymentStatus + "' ");
var ReplacePaymentCORPID = form.findField('ReplacePaymentCORPID').getValue();
sql = sql + getAndConSql(sql, ReplacePaymentCORPID, "ReplacePaymentCORPID ='" + ReplacePaymentCORPID + "' ");
return sql;
}
,
onReplacePayment: function (type) {
//1执行垫付 //2取消执行垫付
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 Duino = this.formEdit.getForm().findField('BILLNO').getValue();
//var billstatus = this.formEdit.getForm().findField('BILLSTATUS').getValue();
//if (Duino == '*') {//提示', msg: '请先保存付费申请,然后才能提交审核!
// Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.baocunshenq, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//};
dianfuRecord = selections[0];
if (dianfuRecord.data.BILLSTATUS != '0') {
// 提示 当前状态无法删除此单据
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '只有【审核通过】状态的申请单可以执行代付操作', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
//var basicForm = this.formEdit.getForm();
var data = dianfuRecord.data;
var dotype = "";
if (type == 1) {
dotype = "do";
}
if (type == 2) {
dotype = "undo";
}
Ext.Msg.wait(Zi.LAN.nowsave);
Ext.Ajax.request({
waitMsg: Zi.LAN.nowsave,
url: '/Account/Chfee_payapplication/DoReplacePayment',
params: {
data: Ext.JSON.encode(data),
dotype: dotype
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (this.opStatus == 'edit')
condition = " BILLNO='" + this.editRecord.get('BILLNO') + "'";
this.LoadData(this.opStatus, condition);
}
else {
Ext.Msg.show({ title: Zi.LAN.Error, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {//警告', msg: '服务器响应出错,请重试'
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
}
//#region 文件上传
,
onAddFileClick: 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;
}
dianfuRecord = selections[0];
if (dianfuRecord.data.BILLSTATUS != '0' || dianfuRecord.data.IsReplacePayment != "True") {
// 提示 当前状态无法删除此单据
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '只有【审核通过】且需代付的申请单可以执行附件操作', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
BillNo = dianfuRecord.data.BILLNO;
var winAccess = new Shipping.FileUpload({});
winAccess.BillNo = BillNo;
winAccess.show();
}, onDelFileClick: 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;
}
dianfuRecord = selections[0];
if (dianfuRecord.data.BILLSTATUS != '0' || dianfuRecord.data.IsReplacePayment != "True") {
// 提示 当前状态无法删除此单据
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '只有【审核通过】且需代付的申请单可以执行附件操作', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var selections = this.fileGrid.getSelectionModel().getSelection();
if (selections.length == 0) {//提示', msg: '请先选择要删除的数据!
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.selectdelete, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = new Array();
for (var i = 0; i < selections.length; i++) {
record.push(selections[i].data);
} //提示', '确定删除该记录吗?'
var _this = this;
BillNo = dianfuRecord.data.BILLNO;
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...'); //正在删除数据
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/Account/Chfee_payapplication/CertDel',
params: {
data: Ext.JSON.encode(record)
},
callback: function (options, success, response) {
Ext.Msg.hide();
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: BillNo } });
} //提示
else {
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {//'警告', msg: '服务器响应出错,请重试'
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}
//#endregion
});