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_Audit/Chfee_AuditTruck.js

5556 lines
210 KiB
JavaScript

3 years ago
Ext.namespace('Shipping');
Shipping.MsChfeeAudit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsChfeeAudit.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsChfeeAudit, Ext.Panel, {
ParentWin: null, //弹出式
ParentPanel: null, //Tab页编辑模式
OpStatus: 'add',
EditRecord: null,
RefBillNo: '*',
DataLoading: true,
stroplb: '',
strOPTYPE: '普通货', //普通货
strBSNO: '',
strMBSNO: '',
FeeStatus: '',
feeType: 0,
PageSize: 50,
sqlcontext: '',
isAmend: '0',
initUIComponents: function () {
Ext.Ajax.timeout = 120000;
this.formname = 'FormMsChfeeAudit';
this.strMBSNO = '';
this.isAmend = '0';
this.AMENDSELFWORKFLOW = 0;
this.AUDITNOBACK = 0;
this.strOPTYPE = '普通货'; //普通货
this.onlyfeedr = 0;
this.onlyfeecr = 0;
//明细表-数据集
this.storeDrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/Account/Chfee_Audit/GetDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeCrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/Account/Chfee_Audit/GetDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeChFeeGain = Ext.create('Ext.data.Store', {
model: 'MsChFeeGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetOPGainList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeChFeeModify = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetModifyData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.CheckAll = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.OnlyAuditBusiness, //仅需审核业务
checked: true,
width: 120
});
this.CheckFeeAll = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.ChargeDetailsAuditBusiness, //费用明细仅显示待审核
labelWidth: 130,
checked: true,
width: 150
});
this.initgirdDrcolums = [{
sortable: true,
dataIndex: 'GId',
header: '惟一编号', //唯一编号
hidden: true,
width: 160
}, {
sortable: true,
dataIndex: 'BsNo',
header: '业务编号', //业务编号
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: Zi.LAN.CostStatus, //费用状态
renderer: function (value, p, record) {
return record.data.FeeStatus_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeName',
header: Zi.LAN.NameFeePayable, //应收费用名称
width: 100
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: Zi.LAN.CostEnglishName, //费用英文名称
width: 120
}, {
sortable: true,
dataIndex: 'CustomerType',
header: Zi.LAN.CustomerCategory, //客户类别
width: 80
}, {
sortable: true,
dataIndex: 'CustomerName',
header: Zi.LAN.SettlementObject, //结算对象
width: 120
}, {
sortable: true,
dataIndex: 'Unit',
header: Zi.LAN.UnitStandard, //单位标准
width: 60
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: Zi.LAN.price, //单价
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: 80
}, {
sortable: true,
dataIndex: 'TaxUnitPrice',
header: Zi.LAN.TaxPrice, //含税单价
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: 80
}, {
sortable: true,
dataIndex: 'Quantity',
header: Zi.LAN.Num, //数量
width: 60
}, {
sortable: true,
dataIndex: 'TaxRate',
header: Zi.LAN.taxRate, //税率
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: 60
}, {
sortable: true,
dataIndex: 'NoTaxAmount',
header: Zi.LAN.NotaxRate, //不含税金额
align: 'right',
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: 'Amount',
header: Zi.LAN.Money, //金额
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: 80
}, {
sortable: true,
dataIndex: 'Currency',
header: Zi.LAN.Currency, //币别
width: 40
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: Zi.LAN.exchangeRate, //汇率
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'AccTaxRate',
header: Zi.LAN.InputTaxRate, //进项税率
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: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: Zi.LAN.Remarks, //备注
width: 150
}, {
sortable: true,
dataIndex: 'IsAdvancedpay',
header: Zi.LAN.WhetherToAdvance, //是否垫付
width: 60
}, {
sortable: true,
dataIndex: 'IsInvoice',
header: Zi.LAN.Nnvoice, //不开发票
width: 60
}, {
sortable: true,
dataIndex: 'FeeFrt',
header: 'FRT',
width: 40
}, {
sortable: true,
dataIndex: 'Commissionrate',
header: Zi.LAN.CommissionRate, //佣金比率
width: 60
}, {
sortable: true,
dataIndex: 'OpName',
header: Zi.LAN.notIncludederson, //录入人
width: 60
}, {
sortable: true,
dataIndex: 'EnterDate',
header: Zi.LAN.EnterDate, //录入日期
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Auditoperator',
header: Zi.LAN.Auditor, //审核人
width: 60
}, {
sortable: true,
dataIndex: 'AuditDate',
header: Zi.LAN.ReviewDate, //审核日期
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Settlement',
header: Zi.LAN.SettlementAmount, //结算金额
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: 80
}, {
sortable: true,
dataIndex: 'Invoice',
header: Zi.LAN.BillingAmount, //已开票金额
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: 80
}, {
sortable: true,
dataIndex: 'OrderAmount',
header: Zi.LAN.ShenQingJinE, //已开票金额
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: 80
}, {
sortable: true,
dataIndex: 'InvoiceNum',
header: Zi.LAN.InvoiceNumber, //发票号码
width: 80
}, {
sortable: true,
dataIndex: 'SALECORP',
header: Zi.LAN.SALECORP, //发票号码
width: 80
}, {
sortable: true,
dataIndex: 'IsOpen',
header: Zi.LAN.IsOpen, //'是否机密',
renderer: function (value, cellmeta) {
if (value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
}
];
this.girdDrcolums = this.initgirdDrcolums;
this.feeDrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
this.gridDrChFee = new Ext.grid.GridPanel({
store: this.storeDrChFee,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
selModel: this.feeDrGridCheckBoxModel,
selType: 'cellmodel',
viewConfig: {
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
var ISSEL = record.get('ISSEL');
if (ISSEL == '1')
return Shipping.FeeGetRowClassFont(feeStatus);
else
return Shipping.FeeGetRowClass(feeStatus);
}
},
tbar: [{
xtype: 'label',
labelAlign: 'right',
width: 60,
html: "<a><font color='#6B8E23'><B>" + Zi.LAN.ChargesPayable + "</B></font></a>"
}, {
text: Zi.LAN.ExaminationPassed, //审核通过
tooltip: '审核通过',
iconCls: "btnsubmit",
handler: function (button, event) {
this.onAuditNewClick(button, event, 1);
},
scope: this
}, {
text: Zi.LAN.DismissedSubmission, //驳回提交
tooltip: '驳回提交',
iconCls: "btncancel",
handler: function (button, event) {
this.onAuditBackNewClick(button, event, 1);
},
scope: this
}, {
text: Zi.LAN.DismissedSubmission2,
tooltip: '禁开发票',
handler: function (button, event) {
this.onNoIvoiceClick(button, event, 1);
},
scope: this
}, {
text: Zi.LAN.UnlockInvoice,
tooltip: '解禁发票',
handler: function (button, event) {
this.onCancelNoInvoiceClick(button, event, 1);
},
scope: this
}, {
text: Zi.LAN.ApproveApplication,
tooltip: '批准申请',
iconCls: "btnsubmit",
handler: function (button, event) {
this.onAuditShenClick(button, event, 1);
},
scope: this
}, {
text: Zi.LAN.DismissApplication,
tooltip: '驳回申请',
iconCls: "btncancel",
handler: function (button, event) {
this.onAuditBackShenClick(button, event, 1);
},
scope: this
}, {
text: Zi.LAN.HistoricalApplication,
tooltip: '历史申请',
handler: function (button, event) {
this.onHistryShenClick(button, event, 1);
},
scope: this
}, '-', {
text: Zi.LAN.ViewInformation,
tooltip: '查看信息',
handler: function (button, event) {
this.onViewDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: Zi.LAN.ShowWorkflow,
tooltip: '显示工作流',
handler: function (button, event) {
this.onViewWorkFlowDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: Zi.LAN.SavelistStyle, //保存列表样式
menu: [
{ text: Zi.LAN.Save, //保存
handler: function (button, event) {
_this.girdDrcolums = DsTruck.SaveGridPanel(userid, 'FEEDRGRIDAD', _this.gridDrChFee.columns, _this.girdDrcolums, 0, true);
}
}, { text: Zi.LAN.Initialization, //初始化
handler: function (menu, event) {
_this.gridDrChFee.reconfigure(this.storeDrChFee, _this.initgirdDrcolums);
_this.girdDrcolums = DsTruck.SaveGridPanel(userid, 'FEEDRGRIDAD', _this.gridDrChFee.columns, _this.initgirdDrcolums, 0, true);
}
}],
scope: this
}],
columns: this.girdDrcolums
});
this.girdDrcolums = DsTruck.GetGridPanel(userid, 'FEEDRGRIDAD', this.girdDrcolums, 0); //使用者id表名中间column数组跳过一开始的几列
this.initgirdCrcolums = [{
sortable: true,
dataIndex: 'GId',
header: '惟一编号',
hidden: true,
width: 160
}, {
sortable: true,
dataIndex: 'BsNo',
header: '业务编号',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: Zi.LAN.CostStatus, //费用状态
renderer: function (value, p, record) {
return record.data.FeeStatus_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeName',
header: Zi.LAN.NamePayable, //应付费用名称
width: 100
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: Zi.LAN.CostEnglishName, //费用英文名称
width: 120
}, {
sortable: true,
dataIndex: 'CustomerType',
header: Zi.LAN.CustomerCategory, //客户类别
width: 80
}, {
sortable: true,
dataIndex: 'CustomerName',
header: Zi.LAN.SettlementObject, //结算对象
width: 120
}, {
sortable: true,
dataIndex: 'Unit',
header: Zi.LAN.UnitStandard, //单位标准
width: 60
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: Zi.LAN.price, //单价
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 3, '', 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: 80
}, {
sortable: true,
dataIndex: 'TaxUnitPrice',
header: Zi.LAN.TaxPrice, //含税单价
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: 80
}, {
sortable: true,
dataIndex: 'Quantity',
header: Zi.LAN.Num, //数量
width: 60
}, {
sortable: true,
dataIndex: 'TaxRate',
header: Zi.LAN.taxRate, //税率
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'NoTaxAmount',
header: Zi.LAN.NotaxRate, //不含税金额
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: 80
}, {
sortable: true,
dataIndex: 'Amount',
header: Zi.LAN.Money, //金额
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: 80
}, {
sortable: true,
dataIndex: 'Currency',
header: Zi.LAN.Currency, //币别
width: 40
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: Zi.LAN.exchangeRate, //汇率
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'AccTaxRate',
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: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: Zi.LAN.Remarks, //备注
width: 150
}, {
sortable: true,
dataIndex: 'IsAdvancedpay',
header: Zi.LAN.WhetherToAdvance, //是否垫付
width: 60
}, {
sortable: true,
dataIndex: 'IsInvoice',
header: Zi.LAN.Nnvoice,
width: 60
}, {
sortable: true,
dataIndex: 'FeeFrt',
header: 'FRT',
width: 40
}, {
sortable: true,
dataIndex: 'Commissionrate',
header: Zi.LAN.CommissionRate,
width: 60
}, {
sortable: true,
dataIndex: 'OpName',
header: Zi.LAN.notIncludederson, //录入人
width: 60
}, {
sortable: true,
dataIndex: 'EnterDate',
header: Zi.LAN.EnterDate, //录入日期
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Auditoperator',
header: Zi.LAN.Auditor, //审核人
width: 60
}, {
sortable: true,
dataIndex: 'AuditDate',
header: Zi.LAN.ReviewDate, //审核日期
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Settlement',
header: Zi.LAN.SettlementAmount, //结算金额
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: 80
}, {
sortable: true,
dataIndex: 'OrderAmount',
header: Zi.LAN.ShenQingJinE,
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: 80
}, {
sortable: true,
dataIndex: 'SALECORP',
header: Zi.LAN.SALECORP, //发票号码
width: 80
}, {
sortable: true,
dataIndex: 'IsOpen',
header: Zi.LAN.IsOpen, //'是否机密',
renderer: function (value, cellmeta) {
if (value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
}
];
this.girdCrcolums = this.initgirdCrcolums;
this.feeCrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
this.gridCrChFee = new Ext.grid.GridPanel({
store: this.storeCrChFee,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
selModel: this.feeCrGridCheckBoxModel,
selType: 'cellmodel',
viewConfig: {
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
var ISSEL = record.get('ISSEL');
if (ISSEL == '1')
return Shipping.FeeGetRowClassFont(feeStatus);
else
return Shipping.FeeGetRowClass(feeStatus);
}
},
tbar: [{
xtype: 'label',
labelAlign: 'right',
width: 60,
html: "<a><font color='#6B8E23'><B>" + Zi.LAN.Payable + "</B></font></a>"
}, {
text: Zi.LAN.ExaminationPassed, //审核通过
tooltip: '审核通过',
iconCls: "btnsubmit",
handler: function (button, event) {
this.onAuditNewClick(button, event, 2);
},
scope: this
}, {
text: Zi.LAN.DismissedSubmission, //驳回提交
tooltip: '驳回提交',
iconCls: "btncancel",
handler: function (button, event) {
this.onAuditBackNewClick(button, event, 2);
},
scope: this
}, {
text: Zi.LAN.DismissedSubmission2,
tooltip: '禁开发票',
handler: function (button, event) {
this.onNoIvoiceClick(button, event, 2);
},
scope: this
}, {
text: Zi.LAN.UnlockInvoice,
tooltip: '解禁发票',
handler: function (button, event) {
this.onCancelNoInvoiceClick(button, event, 2);
},
scope: this
}, {
text: Zi.LAN.ApproveApplication,
tooltip: '批准申请',
iconCls: "btnsubmit",
handler: function (button, event) {
this.onAuditShenClick(button, event, 2);
},
scope: this
}, {
text: Zi.LAN.DismissApplication,
tooltip: '驳回申请',
iconCls: "btncancel",
handler: function (button, event) {
this.onAuditBackShenClick(button, event, 2);
},
scope: this
}, {
text: Zi.LAN.HistoricalApplication,
tooltip: '历史申请',
handler: function (button, event) {
this.onHistryShenClick(button, event, 2);
},
scope: this
}, '-', {
text: Zi.LAN.ViewInformation,
tooltip: '查看信息',
handler: function (button, event) {
this.onViewDetailClick(button, event, 2);
},
scope: this
}, '-', {
text: Zi.LAN.ShowWorkflow,
tooltip: '显示工作流',
handler: function (button, event) {
this.onViewWorkFlowDetailClick(button, event, 2);
},
scope: this
}, '-', {
text: Zi.LAN.SavelistStyle, //保存列表样式
menu: [
{ text: Zi.LAN.Save, //保存
handler: function (button, event) {
_this.girdCrcolums = DsTruck.SaveGridPanel(userid, 'FEECRGRIDAD', _this.gridCrChFee.columns, _this.girdCrcolums, 0, true);
}
}, { text: Zi.LAN.Initialization, //初始化
handler: function (menu, event) {
_this.gridCrChFee.reconfigure(this.storeCrChFee, _this.initgirdCrcolums);
_this.girdCrcolums = DsTruck.SaveGridPanel(userid, 'FEECRGRIDAD', _this.gridCrChFee.columns, _this.initgirdCrcolums, 0, true);
}
}],
scope: this
}],
columns: this.girdCrcolums
});
this.girdCrcolums = DsTruck.GetGridPanel(userid, 'FEECRGRIDAD', this.girdCrcolums, 0); //使用者id表名中间column数组跳过一开始的几列
this.storeBodySum = Ext.create('Ext.data.Store', {
model: 'MsOPGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetOPGainList',
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,
columns: [{
header: "<a href='#'><font color='#FF0000'>" + Zi.LAN.Sum + "</font></a>",
sortable: false,
align: 'center',
dataIndex: 'CURR',
width: 160
}, {
header: Zi.LAN.TaxesNotIncluded, //应收不含税
dataIndex: 'NORATEDR',
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: 160
}, {
header: Zi.LAN.TaxIncluded, //应收含税
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: 160
}, {
header: Zi.LAN.PayableTax, //应付不含税
dataIndex: 'NORATECR',
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: 160
}, {
header: Zi.LAN.TaxIncluded, //应付含税
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: 160
}, {
header: Zi.LAN.notIncluded,
dataIndex: 'NORATEPR',
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: 160
}, {
header: Zi.LAN.notIncludedID,
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: 160
}
]
});
this.storeChFeeGain = Ext.create('Ext.data.Store', {
model: 'MsChFeeGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetGainData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListCust = new Ext.grid.GridPanel({
store: this.storeChFeeGain,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
columns: [{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.SettlementObject, //结算对象
width: 110
}, {
sortable: true,
dataIndex: 'RMBDR',
header: LOCALCURR + Zi.LAN.Receivable,
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: 80
}, {
sortable: true,
dataIndex: 'RMBCR',
header: LOCALCURR + Zi.LAN.Handle,
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: 80
}, {
sortable: true,
dataIndex: 'RMBPROFIT',
header: LOCALCURR + Zi.LAN.profit,
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: 80
}, {
sortable: true,
dataIndex: 'USDDR',
header: 'USD' + Zi.LAN.Receivable,
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: 80
}, {
sortable: true,
dataIndex: 'USDCR',
header: Zi.LAN.profitUSD,
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: 80
}, {
sortable: true,
dataIndex: 'USDPROFIT',
header: Zi.LAN.USDprofit, //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: 80
}, {
sortable: true,
dataIndex: 'OTDR',
header: Zi.LAN.ReceivableOther,
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: 80
}, {
sortable: true,
dataIndex: 'OTCR',
header: Zi.LAN.ReceivableOther,
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: 80
}, {
sortable: true,
dataIndex: 'OTPROFIT',
header: Zi.LAN.Otherprofit,
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: 80
}, {
sortable: true,
dataIndex: 'TTLDR',
header: Zi.LAN.ReceivableSum,
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: 80
}, {
sortable: true,
dataIndex: 'TTLCR',
header: Zi.LAN.profitSum,
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: 80
}, {
sortable: true,
dataIndex: 'TTLPROFIT',
header: Zi.LAN.Hejiprofit,
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: 80
}
]
});
this.panelCustSum = new Ext.Panel({
title: Zi.LAN.TotalProfitSTR, //客户合计
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.gridListCust]
});
this.panelCurrSum = new Ext.Panel({
title: Zi.LAN.BiBieSum,
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.gridSum]
});
this.storeChFeeAmendGain = Ext.create('Ext.data.Store', {
model: 'MsChFeeGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetAmendGainData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListAmendttl = new Ext.grid.GridPanel({
store: this.storeChFeeAmendGain,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
columns: [{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.AmendttlObject, //结算对象
width: 160
}, {
sortable: true,
dataIndex: 'RMBDR',
header: LOCALCURR + Zi.LAN.Receivable,
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: 80
}, {
sortable: true,
dataIndex: 'RMBCR',
header: LOCALCURR + Zi.LAN.Handle,
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: 80
}, {
sortable: true,
dataIndex: 'RMBPROFIT',
header: LOCALCURR + Zi.LAN.profit,
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: 80
}, {
sortable: true,
dataIndex: 'USDDR',
header: 'USD' + Zi.LAN.Receivable,
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: 80
}, {
sortable: true,
dataIndex: 'USDCR',
header: Zi.LAN.profitUSD,
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: 80
}, {
sortable: true,
dataIndex: 'USDPROFIT',
header: Zi.LAN.USDprofit, //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: 80
}, {
sortable: true,
dataIndex: 'OTDR',
header: Zi.LAN.ReceivableOther,
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: 80
}, {
sortable: true,
dataIndex: 'OTCR',
header: Zi.LAN.ReceivableOther,
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: 80
}, {
sortable: true,
dataIndex: 'OTPROFIT',
header: Zi.LAN.Otherprofit,
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: 80
}, {
sortable: true,
dataIndex: 'TTLDR',
header: Zi.LAN.ReceivableSum,
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: 80
}, {
sortable: true,
dataIndex: 'TTLCR',
header: Zi.LAN.profitSum,
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: 80
}, {
sortable: true,
dataIndex: 'TTLPROFIT',
header: Zi.LAN.Hejiprofit,
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: 80
}
]
});
this.panelAmendttlSum = new Ext.Panel({
title: Zi.LAN.TotalProfitAmendSTR, //客户合计
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.gridListAmendttl]
});
this.tabTotal = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
height: 180,
frame: false,
region: 'south',
enableHdMenu: false,
// region: 'center',
title: Zi.LAN.ChangeProfitBefore,
collapsed: true,
collapsible: true,
split: true,
enableTabScroll: true,
items:
[
this.panelCustSum,
this.panelCurrSum,
this.panelAmendttlSum
]
});
Ext.define('MsAddTruckBillCustFee', {
extend: 'Ext.data.Model',
fields: [
{ name: 'BSNO', type: 'string' },
{ name: 'TRANSSTATUS', type: 'string' },
{ name: 'OPTYPE', type: 'string' },
{ name: 'TRANSTYPE', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'ORDERNO', type: 'string' },
{ name: 'ORDERNO1', type: 'string' },
{ name: 'CONTRACTNO', type: 'string' },
{ name: 'MBLNO', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'FEEOBJNAME', type: 'string' },
{ name: 'CUSTATTN', type: 'string' },
{ name: 'CUSTTEL', type: 'string' },
{ name: 'CONSIGNEENAME', type: 'string' },
{ name: 'CONSIGNEEATTN', type: 'string' },
{ name: 'CONSIGNEETEL', type: 'string' },
{ name: 'CONSIGNEEADDR', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'SALE', type: 'string' },
{ name: 'OP', type: 'string' },
{ name: 'CNTRTOTAL', type: 'string' },
{ name: 'YARD', type: 'string' },
{ name: 'CLOSINGDATE', type: 'string' },
{ name: 'TRADETYPE', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'KGS', type: 'number' },
{ name: 'PKGS', type: 'number' },
{ name: 'CBM', type: 'number' },
{ name: 'NETWEIGHT', type: 'number' },
{ name: 'TRUCKER', type: 'string' },
{ name: 'TRUCKNO', type: 'string' },
{ name: 'ETD', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' }
]
});
this.storeBillList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsAddTruckBillCustFee',
remoteSort: true,
proxy: {
type: 'ajax',
timeout: 120000,
url: '/Account/Chfee_Audit/GetTruckBLListData',
reader: {
id: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//明细表表格
this.InitDrGrid(this.girdDrcolums);
this.InitCrGrid(this.girdCrcolums);
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: Zi.LAN.PageNum, //每页记录数
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.AddGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BSNO',
header: 'BSNO',
hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'TRANSTYPE',
header: Zi.LAN.ServiceCategory, //业务类别
width: 80
}, {
sortable: true,
dataIndex: 'OPTYPE',
header: Zi.LAN.ChangeSingle, //更改单
width: 80
}, {
sortable: true,
dataIndex: 'CUSTNO',
header: Zi.LAN.DelegateNumber, //委托编号
width: 120
}, {
sortable: true,
dataIndex: 'MBLNO',
header: Zi.LAN.ladingNumber, //主提单号
width: 120
}, {
sortable: true,
dataIndex: 'ORDERNO',
header: '客户订单号', //主提单号
width: 120
}, {
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合同号', //主提单号
width: 100
}, {
sortable: true,
dataIndex: 'ETD',
header: '要求派车日期', //开船日期
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 100
}, {
sortable: true,
dataIndex: 'ETA',
header: '到货日期', //业务来源
width: 80
}, {
sortable: true,
dataIndex: 'SALE',
header: '客户经理', //揽货人
width: 80
}, {
sortable: true,
dataIndex: 'OP',
header: '操作',
width: 80
}, {
sortable: true,
dataIndex: 'CUSTATTN',
header: '客户联系人',
width: 80
}, {
sortable: true,
dataIndex: 'CUSTTEL',
header: '客户联系人电话',
width: 80
}, {
sortable: true,
dataIndex: 'CONSIGNEENAME',
header: '收货方',
width: 80
}, {
sortable: true,
dataIndex: 'CONSIGNEEATTN',
header: '收货联系人',
width: 80
}, {
sortable: true,
dataIndex: 'CONSIGNEETEL',
header: '收货联系人电话',
width: 80
}, {
sortable: true,
dataIndex: 'CONSIGNEEADDR',
header: '收货地址',
width: 80
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: '起运地',
width: 80
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '目的地',
width: 80
}, {
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 80
}, {
sortable: true,
dataIndex: 'KGS',
header: '毛重',
width: 80
}, {
sortable: true,
dataIndex: 'NETWEIGHT',
header: '净重',
width: 80
}, {
sortable: true,
dataIndex: 'CBM',
header: '尺码',
width: 80
}, {
sortable: true,
dataIndex: 'PKGS',
header: '数量',
width: 80
}, {
sortable: true,
dataIndex: 'CNTRTOTAL',
header: Zi.LAN.CNTRTOTAL, //操作
width: 80
}, {
sortable: true,
dataIndex: 'RMBDRSTATUS',
header: Zi.LAN.RMBDRSTATUS, //操作
width: 80,
renderer: function (value, meta) {
if (value == '已收回') {
meta.tdCls = 'feestatus_pass';
} else if (value == '部分收回') {
meta.tdCls = 'feestatus_refer';
}
return value;
}
}, {
sortable: true,
dataIndex: 'USDDRSTATUS',
header: Zi.LAN.USDDRSTATUS, //操作
width: 80,
renderer: function (value, meta) {
if (value == '已收回') {
meta.tdCls = 'feestatus_pass';
} else if (value == '部分收回') {
meta.tdCls = 'feestatus_refer';
}
return value;
}
}];
this.girdcolums = this.initgirdcolums;
this.gridBillList = new Ext.grid.GridPanel({
store: this.storeBillList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
viewConfig: {
enableTextSelection: true
},
disableSelection: false,
selModel: this.AddGridCheckBoxModel,
columns: this.girdcolums,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeBillList,
displayInfo: true,
displayMsg: Zi.LAN.FenYe,
emptyMsg: Zi.LAN.NoAudtid
}), this.Pagenum]
});
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridBillList.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);
//#region formSearch
//#region formSearch枚举参照相关
this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreOpLb.load({ params: { enumTypeId: 96005} });
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.BusinessType, //业务类型
store: this.StoreOpLb,
name: 'PS_OPLB',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBsType.load({ params: { enumTypeId: 96004} });
this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.TypeTransport, //运输类型
store: this.storeBsType,
name: 'PS_BSTYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeSalesCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeSalesCode.load();
this.comboxSalesCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.LanhuoPeople, //揽货人
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.Caozuo,
width: 90,
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_OP',
valueField: 'UserName',
displayField: 'CodeAndName',
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/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.Requester, //委托单位
store: this.storeCustCode,
forceSelection: true,
name: 'PS_CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storePrType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storePrType.add({ "DC": "", "NAME": "无" });
this.storePrType.add({ "DC": "1", "NAME": "申请修改" });
this.storePrType.add({ "DC": "2", "NAME": "更改单" });
this.comboxPrType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '利润减少',
store: this.storePrType,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'PRTYPE'
});
this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurr.load({ params: { condition: ""} });
this.comboxCurr = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.Currency, //币别
store: this.StoreCurr,
forceSelection: true,
name: 'Currency',
valueField: 'CURR',
displayField: 'CURR',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' }
});
this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CostName, //费用名称
store: this.storeFeeNameRef,
forceSelection: true,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeFeeNameRef.load({ params: { condition: ""} });
this.storeFeeType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeFeeType.load({ params: { enumTypeId: 96009} });
this.comboxFeeType = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: Zi.LAN.FeiYongFanwei, //费用范围
store: this.storeFeeType,
forceSelection: true,
name: 'FEERANGE'
});
this.storeCust = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCust.load({ params: { condition: ""} });
this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.SettlementCustomers, //结算客户
store: this.storeCust,
forceSelection: true,
name: 'CUSTNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeListTruckLoadPort = Ext.create('Ext.data.Store', {
fields: [
{ name: 'PORTID', type: 'string' },
{ name: 'PORTCODE', type: 'string' },
{ name: 'PORT', type: 'string' },
{ name: 'CODEANDNAME', type: 'string' },
{ name: 'PROVINCE', type: 'string' }
],
pageSize: 5000,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsCodeTruckPort/GetDataListRm',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeListTruckLoadPort.load();
this.comboxLoadPort = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '起运地', //'费用类型',
store: this.storeListTruckLoadPort,
valueField: 'PORT',
displayField: 'CODEANDNAME',
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
labelWidth: 60,
forceSelection: true,
name: 'PORTLOAD',
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefresh2Click();
}
}
}
});
this.storeListTruckDistPort = Ext.create('Ext.data.Store', {
fields: [
{ name: 'PORTID', type: 'string' },
{ name: 'PORTCODE', type: 'string' },
{ name: 'PORT', type: 'string' },
{ name: 'CODEANDNAME', type: 'string' },
{ name: 'PROVINCE', type: 'string' }
],
pageSize: 5000,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsCodeTruckPort/GetDataListRm',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeListTruckDistPort.load();
this.comboxDistPort = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '目的地', //'费用类型',
store: this.storeListTruckDistPort,
valueField: 'PORT',
displayField: 'CODEANDNAME',
queryMode: 'remote',
labelWidth: 60,
minChars: 0,
queryParam: 'CODENAME',
forceSelection: true,
name: 'PORTDISCHARGE',
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefresh2Click();
}
}
}
});
//客户加载_车队
this.storeTRUCKER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListTRUCK' }
});
//车队
this.comboxTRUCKER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '承运商', //'车队',
store: this.storeTRUCKER,
forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
name: 'TRUCKER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
Ext.define('OpSeaeShipper', {
extend: 'Ext.data.Model',
idProperty: 'SHIPPERID',
fields: [
{ name: 'SHIPPERID', type: 'string' },
{ name: 'CODENAME', type: 'string' },
{ name: 'SHORTNAME', type: 'string' },
{ name: 'CodeAndName', type: 'string' },
{ name: 'SHIPPERDETAIL', type: 'string' },
{ name: 'SHIPPERTYPE', type: 'int' },
{ name: 'LOADADDRESS', type: 'string' },
{ name: 'DELIVERADDRESS', type: 'string' },
{ name: 'ISPUBLIC', type: 'bool' }
]
});
this.storeagent = Ext.create('DsExt.ux.RefTableStore', {
model: 'OpSeaeShipper',
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' }
});
this.storeagent.load({ params: { condition: "shippertype=4 "} });
this.comboxAgent = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.ForeignAgent, //国外代理
store: this.storeagent,
forceSelection: true,
name: 'PS_AGENT',
valueField: 'SHORTNAME',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//业务来源
this.storeSource = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceModel',
proxy: { url: '/CommMng/BasicDataRef/GetSource' }
});
this.storeSource.load();
this.storeSourceDetail = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceDetailModel',
proxy: { url: '/CommMng/BasicDataRef/GetSourceDetail2' }
});
this.comboxBSSOURCE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.BusinessSource, //业务来源
store: this.storeSource,
forceSelection: true,
name: 'BSSOURCE',
valueField: 'SourceName',
displayField: 'SourceName'
});
this.storeFEEUP = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeFEEUP.add({ "FSTATUS": "", "NAME": "" });
this.storeFEEUP.add({ "FSTATUS": "0", "NAME": "否" });
this.storeFEEUP.add({ "FSTATUS": "1", "NAME": "是" });
this.comboxFEEUP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.WhetherCostIsSubmitted, //是否费用提交
store: this.storeFEEUP,
valueField: 'FSTATUS',
displayField: 'NAME',
// flex: 0.7,
labelWidth: 90,
forceSelection: true,
name: 'ISFEEUP',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#endregion
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.RememberQuery, //记忆查询条件
checked: true,
width: 120
});
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 0,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxOpLb,{
fieldLabel:'客户订单号', //编号检索
name: 'ORDERNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel:'车号', //编号检索
name: 'TRUCKNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxTRUCKER, this.comboxCust, {
xtype: 'button',
width: 90,
text: Zi.LAN.Executequery, //执行查询
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
var isvisible = true;
var issavevalue = false;
if (_this.SearchBtn.text == Zi.LAN.HideQuery)
isvisible = true
else
isvisible = false;
if (this.CheckSaveQuery.checked)
issavevalue = true
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
},
scope: this
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{ xtype: 'hiddenfield' }, this.comboxCustCode, {
fieldLabel:'要求派车日期', //从业务日期
format: 'Y-m-d',
xtype: 'datefield',
labelWidth: 90,
name: 'ExpDateBgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到要求派车日期', //到业务日期
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateEnd',
labelWidth: 90,
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxFeeNameRef, {
xtype: 'button',
width: 90,
text: Zi.LAN.ResetCondition, //充值条件
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxLoadPort, this.comboxDistPort, this.comboxOp, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }, {
xtype: 'button',
width: 90,
text: Zi.LAN.AdvancedSearch, //高级查询
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//查询工具条
_this = this;
this.SearchBtn = new Ext.Button({
text: Zi.LAN.ShowQuery, //显示查询
handler: function () {
if (_this.SearchBtn.text == Zi.LAN.HideQuery) {//隐藏查询
_this.panelSearch.hide();
_this.SearchBtn.setText(Zi.LAN.ShowQuery); //显示查询
} else {
_this.panelSearch.show();
_this.SearchBtn.setText(Zi.LAN.HideQuery); //隐藏查询
}
}
});
this.storeAddDCType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeAddDCType.add({ "DC": "0", "NAME": "全部" });
this.storeAddDCType.add({ "DC": "1", "NAME": "待审核" });
this.storeAddDCType.add({ "DC": "2", "NAME": "已审核" });
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.FYchakan,
store: this.storeAddDCType,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'DC',
value: '0'
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
this.SearchBtn, '-', {
xtype: 'button',
text: Zi.LAN.ReLoad, //刷新
iconCls: "btnrefresh",
handler: function (button, event) {
_this.LoadData(this.opStatus, "", this.RefBillNo);
// this.onRefreshClick(button, event);
// var isvisible = true;
// var issavevalue = false;
// if (_this.SearchBtn.text == Zi.LAN.HideQuery)
// isvisible = true
// else
// isvisible = false;
// if (this.CheckSaveQuery.checked)
// issavevalue = true
// saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
},
scope: this
}, '-', {
text: Zi.LAN.BatchReview, //批量审核
id: "btnBsLock",
menu: [
{ text: Zi.LAN.SelectedBusinessReview, //所选业务审核
handler: function (menu, event) {
_this.onSelAuditClick(menu, event);
}
}, { text: Zi.LAN.AllBusinessReview, //全部业务审核
handler: function (menu, event) {
_this.onAllAuditClick(menu, event);
}
}],
scope: this
}, '-', {
text: Zi.LAN.Costlock, //费用锁定
id:Zi.LAN.Costlock,
menu:
[
{ text: Zi.LAN.SelectedBusinesslock, //所选业务锁定
handler: function (menu, event) {
_this.winFeeCloseShow.show();
}
}, { text: Zi.LAN.SelectedBusinessUnlock, //所选业务解锁
handler: function (menu, event) {
_this.onSelUnLockClick(menu, event, 1);
}
}
],
scope: this
}
, '-', this.CheckAll, '-', this.CheckFeeAll, '-', this.CheckSaveQuery, '-', {
text: Zi.LAN.SavelistStyle, //保存列表样式
id: "btntest",
menu: [
{ text: Zi.LAN.Save, //保存
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridBillList.columns, _this.girdcolums, 1, true);
}
}, { text: Zi.LAN.Initialization, //初始化
handler: function (menu, event) {
_this.gridBillList.reconfigure(this.storeBillList, _this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridBillList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, {
text: Zi.LAN.LooKYUanPiao, //查看原票费用
id: 'ViewFee',
handler: function (button, event) {
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=" + this.strMBSNO;
window.open(openUrl, openType, openSet);
},
scope: this
}, '-',
{
text: Zi.LAN.btnprintview, //"打印",
iconCls: 'btnprint',
handler: function (button, event) {
_this.PrintSelect(1);
},
scope: this
}, '-',
{
text: Zi.LAN.btnprint, //"打印",
iconCls: 'btnprint',
handler: function (button, event) {
_this.PrintSelect();
},
scope: this
}
]
});
//#region 申请修改
this.NewFeeShowDr = Ext.widget('form', {
frame: true,
region: 'east',
hidden: true,
title: Zi.LAN.FYUpdate,
width: 470,
trackResetOnLoad: true,
autoScroll: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 55,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: 'GId',
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.CostName, //费用名称
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.Fyduixiang,
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.danweibiaozhun,
readOnly: true,
name: 'Unit'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.NotShuijia,
readOnly: true,
name: 'UnitPrice',
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;
}
}, {
fieldLabel: Zi.LAN.taxRate, //税率
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.TaxPrice, //含税单价
readOnly: true,
name: 'TaxUnitPrice',
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;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.jiFeishuliang,
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.buhanshuie,
readOnly: true,
name: 'NoTaxAmount',
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;
}
}, {
fieldLabel: Zi.LAN.hsjine,
readOnly: true,
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;
},
name: 'Amount'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Currency, //币别
labelWidth: 40,
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.exchangeRate, //汇率
labelWidth: 40,
readOnly: true,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.caiwushui,
labelWidth: 60,
readOnly: true,
name: 'AccTaxRate'
}, {
fieldLabel: Zi.LAN.WhetherToAdvance, //是否垫付
labelWidth: 60,
readOnly: true,
name: 'IsAdvancedpay'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Updateyuanyin,
flex: 2,
readOnly: true,
name: 'Reason'
}, {
fieldLabel: Zi.LAN.zeperson, //'费用对象',
flex: 1,
readOnly: true,
name: 'MANAGERREF'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Remarks, //备注
flex: 2,
labelWidth: 40,
readOnly: true,
name: 'Remark'
}, {
fieldLabel: Zi.LAN.sqperson,
readOnly: true,
labelWidth: 50,
name: 'MODIFIEDUSER'
}, {
fieldLabel: Zi.LAN.sqtime,
readOnly: true,
name: 'MODIFIEDTIME'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ChangeProBefore,
labelWidth: 70,
readOnly: true,
name: 'BPROFIT',
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;
}
}, {
fieldLabel: Zi.LAN.ChangeProfit, //更改后利润
labelWidth: 70,
readOnly: true,
name: 'APROFIT',
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;
}
}, {
fieldLabel: Zi.LAN.ProfitMargin, //利润差额
labelWidth: 70,
readOnly: true,
name: 'DIFPROFIT',
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;
}
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.NewFeeShowCr = Ext.widget('form', {
frame: true,
region: 'east',
hidden: true,
title: Zi.LAN.FYUpdate,
width: 470,
autoScroll: true,
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 55,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: 'GId',
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.CostName, //费用名称
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.Fyduixiang,
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.danweibiaozhun,
readOnly: true,
name: 'Unit'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.NotShuijia,
readOnly: true,
name: 'UnitPrice'
}, {
fieldLabel: Zi.LAN.taxRate, //税率
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.TaxPrice, //含税单价
readOnly: true,
name: 'TaxUnitPrice'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.jiFeishuliang,
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.buhanshuie,
readOnly: true,
name: 'NoTaxAmount'
}, {
fieldLabel: Zi.LAN.hsjine,
readOnly: true,
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;
},
name: 'Amount'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Currency, //币别
labelWidth: 40,
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.exchangeRate, //汇率
labelWidth: 40,
readOnly: true,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.caiwushui,
labelWidth: 60,
readOnly: true,
name: 'AccTaxRate'
}, {
fieldLabel: Zi.LAN.WhetherToAdvance, //是否垫付
labelWidth: 60,
readOnly: true,
name: 'IsAdvancedpay'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Updateyuanyin,
flex: 1,
readOnly: true,
name: 'Reason'
}, {
fieldLabel: Zi.LAN.zeperson, //'费用对象',
flex: 1,
readOnly: true,
name: 'MANAGERREF'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Remarks, //备注
flex: 2,
labelWidth: 40,
readOnly: true,
name: 'Remark'
}, {
fieldLabel: Zi.LAN.sqperson,
readOnly: true,
labelWidth: 50,
name: 'MODIFIEDUSER'
}, {
fieldLabel: Zi.LAN.sqtime,
readOnly: true,
name: 'MODIFIEDTIME'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ChangeProBefore,
labelWidth: 70,
readOnly: true,
name: 'BPROFIT',
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;
}
}, {
fieldLabel: Zi.LAN.ChangeProfit,
labelWidth: 70,
readOnly: true,
name: 'APROFIT',
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;
}
}, {
fieldLabel: Zi.LAN.ProfitMargin,
labelWidth: 70,
readOnly: true,
name: 'DIFPROFIT',
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;
}
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 29,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 90,
items: [this.formSearch]
});
this.panelBill = new Ext.Panel({
// title: '业务信息',
layout: "border",
region: 'north',
height: 200,
frame: true,
split: true,
items: [this.gridBillList]
});
this.panelDrChFee = new Ext.Panel({
// title: '应收费用',
layout: "border",
anchor: '100% 50%',
frame: true,
split: true,
items: [this.gridDrChFee, this.NewFeeShowDr]
});
this.panelCrChFee = new Ext.Panel({
// title: '应付费用',
layout: "border",
anchor: '100% 50%',
// region: 'center',
frame: true,
items: [this.gridCrChFee, this.NewFeeShowCr]
});
this.panelFee = new Ext.Panel({
// title: '费用信息',
// layout: "border",
layout: "anchor",
// region: 'north',
// height: 560,
region: 'center',
items: [
this.panelDrChFee, this.panelCrChFee
]
});
//#region 布局
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.panelBill, this.panelFee, this.tabTotal]
});
//#endregion
// this.opStatus = 'add';
_this = this;
this.storeBillList.on('beforeload', function (store) {
// var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: _this.BillSql });
}, this);
this.CheckAll.addListener('change', function (field, newValue, oldValue, eOpts) {
this.CheckChange(field, newValue, oldValue, eOpts);
}, this);
this.CheckFeeAll.addListener('change', function (field, newValue, oldValue, eOpts) {
this.CheckChange(field, newValue, oldValue, eOpts);
}, this);
_this = this;
this.gridDrChFee.getSelectionModel().on('select', function (model, record, index) {
var FeeStatus = record.data.FeeStatus;
var GId = record.data.GId;
var oldAmount = record.data.Amount;
var oldExChangerate = record.data.ExChangerate;
if (FeeStatus == 3) {
this.NewFeeShowDr.setVisible(true);
this.storeChFeeModify.load({ params: { FeeID: GId, ApplyType: 2 },
callback: function (r, options, success) {
if (success) {
_this.NewFeeShowDr.getForm().loadRecord(_this.storeChFeeModify.getAt(0));
for (i = 0; i < _this.storeBodySum.getCount(); i += 1) {
var memberyf = _this.storeBodySum.getAt(i);
if (memberyf.data.CURR == '合计') {
var ttlprofit = memberyf.data.PR;
_this.NewFeeShowDr.getForm().findField('BPROFIT').setValue(ttlprofit);
var Amount = _this.NewFeeShowDr.getForm().findField('Amount').getValue();
var ExChangerate = _this.NewFeeShowDr.getForm().findField('ExChangerate').getValue();
var aprofit = ttlprofit - Mul(oldAmount, oldExChangerate) + Mul(Amount, ExChangerate);
_this.NewFeeShowDr.getForm().findField('APROFIT').setValue(aprofit);
var difprofit = Add(aprofit, -ttlprofit);
_this.NewFeeShowDr.getForm().findField('DIFPROFIT').setValue(difprofit);
if (difprofit < 0) _this.NewFeeShowDr.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
}
}
var modifydata = _this.storeChFeeModify.getAt(0).data;
if (record.data.FeeName != modifydata.FeeName)
_this.NewFeeShowDr.getForm().findField('FeeName').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('FeeName').setFieldStyle({ color: '#000000' });
if (record.data.CustomerName != modifydata.CustomerName)
_this.NewFeeShowDr.getForm().findField('CustomerName').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('CustomerName').setFieldStyle({ color: '#000000' });
if (record.data.Unit != modifydata.Unit)
_this.NewFeeShowDr.getForm().findField('Unit').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('Unit').setFieldStyle({ color: '#000000' });
if (record.data.UnitPrice != modifydata.UnitPrice)
_this.NewFeeShowDr.getForm().findField('UnitPrice').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('UnitPrice').setFieldStyle({ color: '#000000' });
if (record.data.TaxRate != modifydata.TaxRate)
_this.NewFeeShowDr.getForm().findField('TaxRate').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('TaxRate').setFieldStyle({ color: '#000000' });
if (record.data.TaxUnitPrice != modifydata.TaxUnitPrice)
_this.NewFeeShowDr.getForm().findField('TaxUnitPrice').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('TaxUnitPrice').setFieldStyle({ color: '#000000' });
if (record.data.Quantity != modifydata.Quantity)
_this.NewFeeShowDr.getForm().findField('Quantity').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('Quantity').setFieldStyle({ color: '#000000' });
if (record.data.NoTaxAmount != modifydata.NoTaxAmount)
_this.NewFeeShowDr.getForm().findField('NoTaxAmount').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('NoTaxAmount').setFieldStyle({ color: '#000000' });
if (record.data.Amount != modifydata.Amount)
_this.NewFeeShowDr.getForm().findField('Amount').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('Amount').setFieldStyle({ color: '#000000' });
if (record.data.Currency != modifydata.Currency)
_this.NewFeeShowDr.getForm().findField('Currency').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('Currency').setFieldStyle({ color: '#000000' });
if (record.data.ExChangerate != modifydata.ExChangerate)
_this.NewFeeShowDr.getForm().findField('ExChangerate').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('ExChangerate').setFieldStyle({ color: '#000000' });
if (record.data.AccTaxRate != modifydata.AccTaxRate)
_this.NewFeeShowDr.getForm().findField('AccTaxRate').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowDr.getForm().findField('AccTaxRate').setFieldStyle({ color: '#000000' });
}
},
scope: this
});
} else {
this.NewFeeShowDr.setVisible(false);
}
var FeeName = record.data.FeeName;
for (i = 0; i < this.storeCrChFee.getCount(); i += 1) {
var memberyf = this.storeCrChFee.getAt(i);
if (memberyf.data.FeeName == FeeName) {
memberyf.set("ISSEL", '1');
} else {
memberyf.set("ISSEL", '0');
}
};
}, this);
this.gridCrChFee.getSelectionModel().on('select', function (model, record, index) {
var FeeStatus = record.data.FeeStatus;
var GId = record.data.GId;
var oldAmount = record.data.Amount;
var oldExChangerate = record.data.ExChangerate;
if (FeeStatus == 3) {
this.NewFeeShowCr.setVisible(true);
this.storeChFeeModify.load({ params: { FeeID: GId, ApplyType: 2 },
callback: function (r, options, success) {
if (success) {
_this.NewFeeShowCr.getForm().loadRecord(_this.storeChFeeModify.getAt(0));
for (i = 0; i < _this.storeBodySum.getCount(); i += 1) {
var memberyf = _this.storeBodySum.getAt(i);
if (memberyf.data.CURR == '合计') {
var ttlprofit = memberyf.data.PR;
_this.NewFeeShowCr.getForm().findField('BPROFIT').setValue(ttlprofit);
var Amount = _this.NewFeeShowCr.getForm().findField('Amount').getValue();
var ExChangerate = _this.NewFeeShowCr.getForm().findField('ExChangerate').getValue();
var aprofit = ttlprofit + Mul(oldAmount, oldExChangerate) - Mul(Amount, ExChangerate);
_this.NewFeeShowCr.getForm().findField('APROFIT').setValue(aprofit);
var difprofit = Add(aprofit, -ttlprofit);
_this.NewFeeShowCr.getForm().findField('DIFPROFIT').setValue(difprofit);
if (difprofit < 0) _this.NewFeeShowCr.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
}
}
var modifydata = _this.storeChFeeModify.getAt(0).data;
if (record.data.FeeName != modifydata.FeeName)
_this.NewFeeShowCr.getForm().findField('FeeName').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('FeeName').setFieldStyle({ color: '#000000' });
if (record.data.CustomerName != modifydata.CustomerName)
_this.NewFeeShowCr.getForm().findField('CustomerName').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('CustomerName').setFieldStyle({ color: '#000000' });
if (record.data.Unit != modifydata.Unit)
_this.NewFeeShowCr.getForm().findField('Unit').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('Unit').setFieldStyle({ color: '#000000' });
if (record.data.UnitPrice != modifydata.UnitPrice)
_this.NewFeeShowCr.getForm().findField('UnitPrice').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('UnitPrice').setFieldStyle({ color: '#000000' });
if (record.data.TaxRate != modifydata.TaxRate)
_this.NewFeeShowCr.getForm().findField('TaxRate').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('TaxRate').setFieldStyle({ color: '#000000' });
if (record.data.TaxUnitPrice != modifydata.TaxUnitPrice)
_this.NewFeeShowCr.getForm().findField('TaxUnitPrice').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('TaxUnitPrice').setFieldStyle({ color: '#000000' });
if (record.data.Quantity != modifydata.Quantity)
_this.NewFeeShowCr.getForm().findField('Quantity').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('Quantity').setFieldStyle({ color: '#000000' });
if (record.data.NoTaxAmount != modifydata.NoTaxAmount)
_this.NewFeeShowCr.getForm().findField('NoTaxAmount').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('NoTaxAmount').setFieldStyle({ color: '#000000' });
if (record.data.Amount != modifydata.Amount)
_this.NewFeeShowCr.getForm().findField('Amount').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('Amount').setFieldStyle({ color: '#000000' });
if (record.data.Currency != modifydata.Currency)
_this.NewFeeShowCr.getForm().findField('Currency').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('Currency').setFieldStyle({ color: '#000000' });
if (record.data.ExChangerate != modifydata.ExChangerate)
_this.NewFeeShowCr.getForm().findField('ExChangerate').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('ExChangerate').setFieldStyle({ color: '#000000' });
if (record.data.AccTaxRate != modifydata.AccTaxRate)
_this.NewFeeShowCr.getForm().findField('AccTaxRate').setFieldStyle({ color: '#FF4500' });
else
_this.NewFeeShowCr.getForm().findField('AccTaxRate').setFieldStyle({ color: '#000000' });
}
},
scope: this
});
} else {
this.NewFeeShowCr.setVisible(false);
}
var FeeName = record.data.FeeName;
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i);
if (memberyf.data.FeeName == FeeName) {
memberyf.set("ISSEL", '1');
} else {
memberyf.set("ISSEL", '0');
}
};
}, this);
this.gridDrChFee.on({
selectionchange: function (sm, selections) {
if (selections.length == 0) {
for (i = 0; i < _this.storeCrChFee.getCount(); i += 1) {
var memberyf = _this.storeCrChFee.getAt(i);
memberyf.set("ISSEL", '0');
};
}
}
});
this.gridCrChFee.on({
selectionchange: function (sm, selections) {
if (selections.length == 0) {
for (i = 0; i < _this.storeDrChFee.getCount(); i += 1) {
var memberyf = _this.storeDrChFee.getAt(i);
memberyf.set("ISSEL", '0');
};
}
}
});
// this.storeBillList.load({ params: { condition: this.BillSql },
// callback: function (r, options, success) {
// if (success) {
// if (r.length > 0) {
// this.gridBillList.getSelectionModel().select(0);
// } else {
// var bsno = '1';
// var optype = '1';
// var isAll = '0';
// isAll = this.comboxaddDCType.getValue();
// this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll} });
// this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll} });
// this.storeChFeeGain.load({ params: { bsno: bsno },
// callback: function (r, options, success) {
// if (success) {
// _this.formtotal.getForm().loadRecord(_this.storeChFeeGain.getAt(0));
// }
// },
// scope: this
// });
// }
// }
// },
// scope: this
// });
_this = this;
this.gridBillList.getSelectionModel().on('select', function (model, record, index) {
var bsno = record.data.BSNO;
var optype = record.data.OPLBNAME;
var OPTYPE = record.data.OPTYPE;
if (OPTYPE == '更改单') {
var ViewFee = Ext.getCmp('ViewFee');
ViewFee.enable();
this.isAmend = '1';
} else {
var ViewFee = Ext.getCmp('ViewFee');
ViewFee.disable();
this.isAmend = '0';
}
this.strOPTYPE = OPTYPE;
this.stroplb = record.data.OPLB;
this.strBSNO = record.data.BSNO;
this.strMBSNO = record.data.PARENTID;
this.FeeStatus = record.data.FEESTATUS;
var isAll = '0';
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
this.NewFeeShowCr.setVisible(false);
this.NewFeeShowDr.setVisible(false);
var condition = this.getFeeCondition();
this.storeDrChFee.removeAll();
this.storeCrChFee.removeAll();
// isAll = this.comboxaddDCType.getValue();
this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: this.stroplb, isAll: isAll, condition: condition} });
this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: this.stroplb, isAll: isAll, condition: condition} });
// this.storeChFeeGain.load({ params: { bsno: bsno },
// callback: function (r, options, success) {
// if (success) {
// _this.formtotal.getForm().loadRecord(_this.storeChFeeGain.getAt(0));
// }
// },
// scope: this
// });
this.storeBodySum.load({ params: { bsno: bsno },
callback: function (r, options, success) {
if (success) {
_this.setTotalHead();
}
}
});
this.storeChFeeGain.load({ params: { bsno: bsno} });
this.storeChFeeAmendGain.load({ params: { bsno: this.strMBSNO} });
}, this);
this.InitData();
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
this.gridBillList.reconfigure(this.storeBillList, this.girdcolums);
//#region 费用锁定
this.CheckAccMonth = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.XiuGaiKuaiji,
checked: false,
width: 120
});
this.formAccMonthShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.CheckAccMonth, {
fieldLabel: Zi.LAN.kuaiJiQJ, //会计区间
xtype: 'monthfield',
name: 'AccDate'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winFeeCloseShow = Ext.create('Ext.window.Window', {
title: Zi.LAN.FYfengzhang,
width: 420,
//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.formAccMonthShow],
buttons: [{
text: Zi.LAN.surefengzhang,
minWidth: 70,
handler: function () {
var form = me.formAccMonthShow.getForm();
if (me.CheckAccMonth.checked) {
me.AccDate = form.findField('AccDate').getRawValue();
if (me.AccDate == '' || me.AccDate == null || me.AccDate == undefined) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Bixukuaiji, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
me.IsAccDate = '1';
} else me.IsAccDate = '0';
_this.onSelFeeLockClick()
}
}, {
text: Zi.LAN.close,
minWidth: 70,
handler: function () {
me.winFeeCloseShow.close();
}
}]
});
//#endregion
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='AMENDSELFWORKFLOW'"
},
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.AMENDSELFWORKFLOW = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='AUDITNOBACK'"
},
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.AUDITNOBACK = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modAuditOnlyFeeDr"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
this.panelDrChFee.anchor = '100% 100%';
this.panelCrChFee.setVisible(false);
this.tabTotal.setHeight(0);
this.tabTotal.setTitle('');
this.tabTotal.collapsed = false;
this.tabTotal.collapsible = false;
this.tabTotal.removeAll();
this.onlyfeedr = 1;
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modAuditOnlyFeeCr"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
this.panelCrChFee.anchor = '100% 100%';
this.panelDrChFee.setVisible(false);
this.tabTotal.setHeight(0);
this.tabTotal.setTitle('');
this.tabTotal.collapsed = false;
this.tabTotal.collapsible = false;
this.tabTotal.removeAll();
this.onlyfeecr = 1;
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modFeeAuditNoFEEClock"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var btnFeeLock = Ext.getCmp(Zi.LAN.Costlock);
btnFeeLock.setVisible(false);
}
} else {
}
},
scope: this
});
}, //end initUIComponents
//#region 加载数据
InitData: function () {
var condition = '';
/*
if (this.ParentPanel) {
var ret = this.ParentPanel.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.editRecord = ret[2];
this.RefBillNo = ret[3];
}
*/
this.panelSearch.hide();
this.LoadData(this.opStatus, condition, this.RefBillNo);
}, //end InitData
LoadData: function (opstatus, condition, refbillno) {
this.feeCrSerialNo = 0;
this.feeCrBodyDel = [];
this.feeCrSerialNo = 0;
this.feeCrBodyDel = [];
this.opStatus = opstatus;
this.PageSize = this.Pagenum.getValue();
this.storeBillList.pageSize = this.PageSize;
// this.BillSql = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0 and (wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeRecvPayAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeModifyAudit',ch_fee.GID) "
// + " or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeSeaiRecvPayAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeSeaiModifyAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('ApplyFeeAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('ApplyFeeModify',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('BulkFeeAudit',ch_fee.GID) or "
// + " wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('BulkFeeModify',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeOpOpOtherRecvPayAudit',ch_fee.GID) or wu.WORKFLOWID=dbo.[GetBSNOWorkFlowID]('FeeOpOtherModifyAudit',ch_fee.GID) ) ) ";
this.BillSql = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID left join workflow_step st "
+ " on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) where v_op_truck_bulk.BSNO=ch_fee.BSNO "
+ " and isnull((power(2,(ST.STEPNO)) & wu.stepno),0)>0 and st.AUDITOR='" + userid + "' and (ch_fee.FEESTATUS=2 or ch_fee.FEESTATUS=3 or ch_fee.FEESTATUS=4)) ";
// this.BillSql = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0) ";
//+" and wu.WORKFLOWID IN (SELECT GID FROM v_workflow WHERE TYPENAME='FeeRecvPayAudit' or TYPENAME='FeeModifyAudit' "
// + " or TYPENAME='FeeSeaiRecvPayAudit' or TYPENAME='FeeSeaiModifyAudit' or TYPENAME='ApplyFeeAudit' "
// + " or TYPENAME='ApplyFeeModify' or TYPENAME='BulkFeeAudit' or TYPENAME='BulkFeeModify' or TYPENAME='FeeOpOpOtherRecvPayAudit' "
// + " or TYPENAME='FeeOpOtherModifyAudit' or TYPENAME='AireFeeAudit' or TYPENAME='AireFeeModify' "
// + " or TYPENAME='AiriFeeAudit' or TYPENAME='AiriFeeModify' or TYPENAME='RailwayFeeAudit' or TYPENAME='RailwayFeeModify')) ";
_this = this;
this.sqlcontext = this.BillSql;
this.storeBillList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql },
waitMsg: Zi.LAN.NowSelect,
callback: function (r, options, success) {
if (success) {
this.DataLoading = false;
if (r.length > 0) {
// this.gridBillList.getSelectionModel().select(0);
} else {
var bsno = '1';
var optype = '1';
var isAll = '0';
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue();
_this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll} });
_this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll} });
_this.storeBodySum.load({ params: { bsno: bsno },
callback: function (r, options, success) {
if (success) {
_this.setTotalHead();
}
}
});
_this.storeChFeeGain.load({ params: { bsno: bsno} });
_this.storeChFeeAmendGain.load({ params: { bsno: bsno} });
// _this.storeChFeeGain.load({ params: { bsno: bsno },
// callback: function (r, options, success) {
// if (success) {
// _this.formtotal.getForm().loadRecord(_this.storeChFeeGain.getAt(0));
// }
// },
// scope: this
// });
}
}
},
scope: this
});
// var el = Ext.get("gridDrChFee");
/*
this.storeDrChFee.load({ params: { billno: this.gid, type: 1} });
this.storeCrChFee.load({ params: { billno: this.gid, type: 2} });
this.storeChFeeGain.load({ params: { bsno: this.gid },
callback: function (r, options, success) {
if (success) {
this.formtotal.getForm().loadRecord(this.storeChFeeGain.getAt(0));
}
},
scope: this
});
*/
}, // end LoadDate
InitDrGrid: function (grid) {
var agirdcolums = grid;
this.gridDrChFee.reconfigure(this.storeDrChFee, agirdcolums);
},
InitCrGrid: function (grid) {
var agirdcolums = grid;
this.gridCrChFee.reconfigure(this.storeCrChFee, agirdcolums);
},
setTotalHead: function () {
var rmbdr = 0;
var rmbcr = 0;
var usddr = 0;
var usdcr = 0;
var otdr = 0;
var otcr = 0;
var ttldr = 0;
var ttlcr = 0;
var rmbprofit = 0;
var usdprofit = 0;
var otprofit = 0;
var ttlprofit = 0;
var profitrate = 0;
for (i = 0; i < this.storeBodySum.getCount(); i += 1) {
var memberyf = this.storeBodySum.getAt(i);
if (memberyf.data.CURR == LOCALCURR) {
rmbdr = memberyf.data.DR;
rmbcr = memberyf.data.CR;
rmbprofit = memberyf.data.PR;
} else if (memberyf.data.CURR == 'USD') {
usddr = memberyf.data.DR;
usdcr = memberyf.data.CR;
usdprofit = memberyf.data.PR;
} if (memberyf.data.CURR == '其他币别') {
otdr = memberyf.data.DR;
otcr = memberyf.data.CR;
otprofit = memberyf.data.PR;
} if (memberyf.data.CURR == '合计') {
ttldr = memberyf.data.DR;
ttlcr = memberyf.data.CR;
ttlprofit = memberyf.data.PR;
profitrate = memberyf.data.PROFITRATE;
}
}
var rmblb = "";
var usdlb = "";
var otlb = "";
var ttllb = "";
if (this.onlyfeedr == 1) {
rmbcr = '***'; rmbprofit = '***'; usdcr = '***'; usdprofit = '***'; otcr = '***'; otprofit = '***'; ttlcr = '***'; ttlprofit = '***';
}
if (this.onlyfeecr == 1) {
rmbdr = '***'; rmbprofit = '***'; usddr = '***'; usdprofit = '***'; otdr = '***'; otprofit = '***'; ttldr = '***'; ttlprofit = '***';
}
if (rmbdr != 0 || rmbcr != 0 || rmbprofit != 0) {
rmblb = "&nbsp&nbsp&nbsp" + LOCALCURR + "" + Zi.LAN.Receivable + ":<font color='green'>" + returnfloat(rmbdr) + "</font> &nbsp&nbsp " + LOCALCURR + "" + Zi.LAN.Handle + ": <font color='green'>" + returnfloat(rmbcr) + "</font> &nbsp&nbsp" + LOCALCURR + "" + Zi.LAN.profit + ":<font color='green'>" + returnfloat(rmbprofit) + "</font>&nbsp&nbsp&nbsp|";
}
if (usddr != 0 || usdcr != 0 || usdprofit != 0) {
usdlb = "&nbsp&nbsp&nbspUSD" + Zi.LAN.Receivable + ": <font color='green'>" + returnfloat(usddr) + "</font> &nbsp&nbsp" + Zi.LAN.profitUSD + ":<font color='green'>" + returnfloat(usdcr) + "</font> &nbsp&nbsp" + Zi.LAN.USDprofit + "<font color='green'>" + returnfloat(usdprofit) + "</font>&nbsp&nbsp&nbsp|";
}
if (otdr != 0 || otcr != 0 || otprofit != 0) {
otlb = "&nbsp&nbsp&nbsp" + Zi.LAN.ReceivableOther + ": <font color='green'>" + returnfloat(otdr) + "</font> &nbsp&nbsp " + Zi.LAN.HandleOther + ":<font color='green'>" + returnfloat(otcr) + "</font> &nbsp&nbsp" + Zi.LAN.Otherprofit + "<font color='green'>" + returnfloat(otprofit) + "</font>&nbsp&nbsp&nbsp|";
}
if (ttldr != 0 || ttlcr != 0 || ttlprofit != 0) {
ttllb = "&nbsp&nbsp&nbsp" + Zi.LAN.ReceivableSum + ": <font color='green'>" + returnfloat(ttldr) + "</font> &nbsp&nbsp" + Zi.LAN.profitSum + ":<font color='green'>" + returnfloat(ttlcr) + "</font> &nbsp&nbsp" + Zi.LAN.Hejiprofit + "<font color='green'>" + returnfloat(ttlprofit) + "</font>&nbsp&nbsp" + Zi.LAN.ProfitMargins + "<font color='green'>" + returnfloat(profitrate) + "</font>";
}
this.tabTotal.setTitle(Zi.LAN.TotalProfit + rmblb + usdlb + otlb + ttllb);
},
//#endregion
//#region 明细操作
onRefreshClick: function (button, event) {
// var girdcolums = this.gridList.getColumnMode();
this.BillSql = this.getCondition();
_this = this;
this.PageSize = this.Pagenum.getValue();
this.storeBillList.pageSize = this.PageSize;
this.sqlcontext = this.BillSql;
this.storeBillList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql },
waitMsg: Zi.LAN.NowSelect,
callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
this.gridBillList.getSelectionModel().select(0);
} else {
var bsno = '1';
var optype = '1';
var isAll = '0';
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue();
_this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll} });
_this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll} });
_this.storeBodySum.load({ params: { bsno: bsno },
callback: function (r, options, success) {
if (success) {
_this.setTotalHead();
}
}
});
_this.storeChFeeGain.load({ params: { bsno: bsno} });
_this.storeChFeeAmendGain.load({ params: { bsno: bsno} });
}
}
},
scope: this
});
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
this.PageSize = this.Pagenum.getValue();
this.storeBillList.pageSize = this.PageSize;
this.BillSql = this.sqlcontext;
this.storeBillList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql },
waitMsg: Zi.LAN.NowSelect,
callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
this.gridBillList.getSelectionModel().select(0);
} else {
var bsno = '1';
var optype = '1';
var isAll = '0';
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue();
_this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll} });
_this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll} });
_this.storeBodySum.load({ params: { bsno: bsno },
callback: function (r, options, success) {
if (success) {
_this.setTotalHead();
}
}
});
_this.storeChFeeGain.load({ params: { bsno: bsno} });
_this.storeChFeeAmendGain.load({ params: { bsno: bsno} });
}
}
},
scope: this
});
},
CheckChange: function (field, newValue, oldValue, eOpts) {
this.onRefreshClick();
},
onAuditNewClick: function (button, event, type) {
var GidStr = '';
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.FirstShenH, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue();
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var IsAudit = rec.data.IsAudit;
var canAudit = feeStatus == 2;
if (canAudit == false) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.OnlyShenHe,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (IsAudit == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.RoleShenHe,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
bodyAddDatas.push(rec);
}
}
}
_this = this;
if (GidStr == '') {
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZZShenHe,
url: '/Account/Chfee_Audit/AuditList',
params: {
optype: _this.stroplb,
bill: jsonbodyAddDatas,
bsno: this.strBSNO,
mblno:this.strMBSNO,
isamend: _this.isAmend
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.ZZShenHe,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
_this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll} });
} else {
_this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} });
}
Ext.Ajax.request({
waitMsg: Zi.LAN.ZZTiJiao,
url: '/Account/Chfee_Audit/UpLock',
params: {
bsno: _this.strBSNO,
optype: _this.stroplb
},
callback: function (options, success, response) {
if (success) {
_this.UpListStatus(_this.strBSNO);
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
} else {
return;
}
} else {
return;
}
},
scope: this
});
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
onAuditBackNewClick: function (button, event, type) {
if (this.FeeStatus == true) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LocalBoHui, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var GidStr = '';
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue();
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var IsAudit = rec.data.IsAudit;
var canAudit = feeStatus == 2 || feeStatus == 0;
if (canAudit == false) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.Tishi1,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
if (rec.data.Settlement != 0) {
canAudit = false;
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi2, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
if (rec.data.Invoice != 0) {
canAudit = false;
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi3, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
if (rec.data.OrderAmount != 0) {
canAudit = false;
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi4, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
if (rec.data.OrderInvoice != 0) {
canAudit = false;
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.Tishi5, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
if (this.AUDITNOBACK == 1) {
if (feeStatus == 0) {
canAudit = false;
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '费用已审核通过,不允许驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
}
if (canAudit == false) {
} else {
if (IsAudit == -1) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.Tishi6,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
bodyAddDatas.push(rec);
}
}
}
_this = this;
if (GidStr == '') {
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
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.ZhengZaiBh,
url: '/Account/Chfee_Audit/AuditBack',
params: {
optype: _this.stroplb,
bill: jsonbodyAddDatas,
reasean: text,
isamend: _this.isAmend
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
_this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll} });
} else {
_this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} });
}
_this.UpListStatus(_this.strBSNO);
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
}
});
}
},
onNoIvoiceClick: function (button, event, type) {
var GidStr = '';
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.StopFaPiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue();
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var Settlement = rec.data.Settlement;
var Invoice = rec.data.Invoice;
var OrderInvoice = rec.data.OrderInvoice;
if (Settlement != 0 || Invoice != 0 || Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.NOtUpdate,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
}
_this = this;
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.ZZTiJiao,
url: '/Account/Chfee_Audit/NoIvoice',
params: {
bill: GidStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
_this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll} });
} else {
_this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} });
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
onCancelNoInvoiceClick: function (button, event, type) {
var GidStr = '';
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.JinJinFP, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue();
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var Settlement = rec.data.Settlement;
var Invoice = rec.data.Invoice;
var OrderInvoice = rec.data.OrderInvoice;
if (Settlement != 0 || Invoice != 0 || Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.NOtUpdate,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
}
_this = this;
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.ZZTiJiao,
url: '/Account/Chfee_Audit/CancelNoIvoice',
params: {
bill: GidStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
_this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll} });
} else {
_this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} });
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
onAuditShenClick: function (button, event, type) {
if (this.FeeStatus == true) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LocalBoHui, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var GidStr = '';
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectPiZhun, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var IsAudit = rec.data.IsAudit;
var canAudit = feeStatus == 3 || feeStatus == 4;
if (canAudit == false) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.SelectFYZT,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (IsAudit == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.RoleShenHe,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
bodyAddDatas.push(rec);
}
}
}
_this = this;
if (GidStr == '') {
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZZShenHe,
url: '/Account/Chfee_Audit/AuditShenNew',
params: {
optype: _this.stroplb,
bill: jsonbodyAddDatas,
isamend: _this.isAmend
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.FYPizhun, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
if (type == 1) {
_this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll} });
this.NewFeeShowDr.setVisible(false);
} else {
_this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} });
this.NewFeeShowCr.setVisible(false);
}
this.UpListStatus(_this.strBSNO);
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
onAuditBackShenClick: function (button, event, type) {
if (this.FeeStatus == true) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LocalBoHui, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
var GidStr = '';
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectPiZhun, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.CheckFeeAll.checked)
isAll = '1'
else
isAll = '0'
// isAll = this.comboxaddDCType.getValue();
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var IsAudit = rec.data.IsAudit;
var canAudit = feeStatus == 3 || feeStatus == 4;
if (canAudit == false) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.FYZTBH,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
if (canAudit == false) {
} else {
if (IsAudit == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.BHRole,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
bodyAddDatas.push(rec);
}
}
}
_this = this;
if (GidStr == '') {
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
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.ZhengZaiBh,
url: '/Account/Chfee_Audit/AuditBackShen',
params: {
optype: _this.stroplb,
bill: jsonbodyAddDatas,
reasean: text,
isamend: _this.isAmend
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.BHSuccess, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
if (type == 1) {
_this.storeDrChFee.load({ params: { bsno: _this.strBSNO, type: 1, optype: _this.stroplb, isAll: isAll} });
this.NewFeeShowDr.setVisible(false);
} else {
_this.storeCrChFee.load({ params: { bsno: _this.strBSNO, type: 2, optype: _this.stroplb, isAll: isAll} });
this.NewFeeShowCr.setVisible(false);
}
this.UpListStatus(_this.strBSNO);
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
}
});
}
},
UpListStatus: function (bsno) {
Ext.Ajax.request({
waitMsg: Zi.LAN.OnSelect,
url: '/Account/Chfee_Audit/GetBLData',
params: {
handle: 'edit',
condition: " BSNO='" + bsno + "'",
isapp: false
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
var data = result.data;
for (i = 0; i < this.storeBillList.getCount(); i += 1) {
var memberyf = this.storeBillList.getAt(i);
if (memberyf.data.BSNO == bsno) {
memberyf.data.DRFEESTATUS = data.DRFEESTATUS;
memberyf.data.CRFEESTATUS = data.CRFEESTATUS;
memberyf.data.FEESTATUS = data.FEESTATUS;
memberyf.data.FEESTATUSREF = data.FEESTATUSREF;
memberyf.commit();
this.gridBillList.getSelectionModel().select(memberyf)
}
};
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
},
onViewWorkFlowDetailClick: function (button, event, type) {
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectFY, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = records[0];
var feeStatus = record.data.FeeStatus;
var Gid = record.data.GId;
var IsOpen = record.data.IsOpen;
var WorkFlowName = "FeeOpOpOtherRecvPayAudit";
if (IsOpen == '1' || IsOpen == 'True') {
WorkFlowName = "YjFeefyAudit";
} else if ((this.strOPTYPE == '更改单') && (this.AMENDSELFWORKFLOW == 1)) {
WorkFlowName = "AmendFeefyAudit";
} else {
if (feeStatus == 3 || feeStatus == 4) {
WorkFlowName = "FeeOpOtherModifyAudit";
if (this.stroplb == "op_seae") {
WorkFlowName = "FeeModifyAudit";
} if (this.stroplb == "op_seai") {
WorkFlowName = "FeeSeaiModifyAudit";
} if (this.stroplb == "op_aire") {
WorkFlowName = "AireFeeModify";
} if (this.stroplb == "op_airi") {
WorkFlowName = "AiriFeeModify";
} if (this.stroplb == "op_apply") {
WorkFlowName = "ApplyFeeModify";
} if (this.stroplb == "op_bulk") {
WorkFlowName = "BulkFeeModify";
} if (this.stroplb == "op_other" || this.stroplb == "tMsWlPcHead" || this.stroplb == "OpCtnBsCard") {
WorkFlowName = "FeeOpOtherModifyAudit";
} if (this.stroplb == "op_railway") {
WorkFlowName = "RailwayFeeModify";
}
} else {
if (this.stroplb == "op_seae") {
WorkFlowName = "FeeRecvPayAudit";
} if (this.stroplb == "op_seai") {
WorkFlowName = "FeeSeaiRecvPayAudit";
} if (this.stroplb == "op_aire") {
WorkFlowName = "AireFeeAudit";
} if (this.stroplb == "op_airi") {
WorkFlowName = "AiriFeeAudit";
} if (this.stroplb == "op_apply") {
WorkFlowName = "ApplyFeeAudit";
} if (this.stroplb == "op_bulk") {
WorkFlowName = "BulkFeeAudit";
} if (this.stroplb == "op_other" || this.stroplb == "tMsWlPcHead" || this.stroplb == "OpCtnBsCard") {
WorkFlowName = "FeeOpOpOtherRecvPayAudit";
} if (this.stroplb == "op_railway") {
WorkFlowName = "RailwayFeeAudit";
}
}
}
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 = "";
var openUrl = "../../Account/Chfee_payapplication/Map?bsno=" + Gid + "&name=" + WorkFlowName;
window.open(openUrl, openType, openSet);
},
onViewDetailClick: function (button, event, type) {
var openSet = "height=540, width=890, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 540) / 2 + ",Left= " + (screen.width - 890) / 2
var openType = "_blank";
//打开费用“历史信息查询”页面
var openUrl = "../../Shipping/FeeHistory.aspx?bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type;
window.open(openUrl, openType, openSet);
},
getAllowOperationDetail: function () {
var feeStatus = 0;
if (feeStatus == '0' || feeStatus == false || feeStatus == 'false')
return true;
else {
Ext.Msg.show({ title: Zi.LAN.E, msg: Zi.LAN.LocalWTFY, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return false;
}
},
//#endregion
onSelAuditClick: function (menu, event) {
var GidStr = '';
var records = this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
bodyAddDatas.push(rec);
}
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LoaclYeWuNo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
//提示', '确定删除该记录吗?
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait(Zi.LAN.ZZShenHe);
Ext.Ajax.request({
waitMsg: Zi.LAN.zzaiLoacal,
url: '/Account/Chfee_Audit/SelAudit',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// _this.onRefreshClick();
_this.storeBillList.reload();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
onAllAuditClick: function (menu, event) {
if (this.storeBillList.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.NoYWShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.sureAllAudit, function (btn) {
if (btn == 'yes') {//正在删除数据...
Ext.Msg.wait(Zi.LAN.ZZShenHe);
Ext.Ajax.request({
waitMsg: Zi.LAN.zzaiLoacal,
url: '/Account/Chfee_Audit/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.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// _this.onRefreshClick();
_this.storeBillList.reload();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
}, this);
},
//#region 费用锁定
onSelFeeLockClick: function (menu, event, type) {
var GidStr = '';
var records = this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.selectLocalYW, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.CheckAccMonth.checked) {
this.IsAccDate = '1'
} else this.IsAccDate = '0'
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var Gid = rec.data.BSNO;
var status = rec.data.FEESTATUS
if (status != true) {
bodyAddDatas.push(rec);
}
}
_this = this;
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LoaclYeWuNo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.zzaiLoacal,
url: '/Account/Chfee_lock/SelFeeLock',
params: {
data: jsonbodyAddDatas,
isAccDate: _this.IsAccDate,
AccDate: _this.AccDate
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onRefreshClick();
_this.winFeeCloseShow.close();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
onSelUnLockClick: function (menu, event, type) {
var records = this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.HUMIDITY, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
//
var strGids = "";
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var Gid = rec.data.BSNO;
var status = rec.data.FEESTATUS
if (status = true) {
bodyAddDatas.push(rec);
strGids += "," + Gid;
}
}
//
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYuou, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
if (strGids != "") {
strGids = strGids.toString().substr(1);
}
Ext.Ajax.request({
waitMsg: Zi.LAN.NowPanduansuoding,
url: '/Account/Chfee_lock/isSelUnLock',
params: {
strGids: strGids
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.JieChuSuoDingNow,
url: '/Account/Chfee_lock/SelUnLock',
params: {
data: jsonbodyAddDatas,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.JiechuSuodingSuccess, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onRefreshClick();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
//#endregion
getFeeStatus: function () {
var feeStatus = this.EditRecord.get('FEESTATUS');
return feeStatus;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onClearClick
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
/*
var sqldata = form.getValues();
sql = Ext.JSON.encode(sqldata);
*/
var feestr = this.getFeeCondition();
if (feestr != '') feestr = " and " + feestr;
var StrAudit = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID left join workflow_step st "
+ " on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) where v_op_truck_bulk.BSNO=ch_fee.BSNO "
+ " and isnull((power(2,(ST.STEPNO)) & wu.stepno),0)>0 and st.AUDITOR='" + userid + "' and (ch_fee.FEESTATUS=2 or ch_fee.FEESTATUS=3 or ch_fee.FEESTATUS=4)"
+ feestr + " ) ";
if (this.DataLoading) {
return StrAudit
}
var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
var TRUCKNO = form.findField('TRUCKNO').getValue();
sql = sql + getAndConSql(sql, TRUCKNO, "TRUCKNO like '%" + TRUCKNO + "%'");
var ORDERNO = form.findField('ORDERNO').getValue();
sql = sql + getAndConSql(sql, ORDERNO, "ORDERNO like '%" + ORDERNO + "%'");
var TRUCKER = form.findField('TRUCKER').getValue();
sql = sql + getAndConSql(sql, TRUCKER, "TRUCKER='" + TRUCKER + "'");
var OPLB = form.findField('PS_OPLB').getValue();
sql = sql + getAndConSql(sql, OPLB, "TRANSTYPE='" + OPLB + "'");
//var SALE = form.findField('PS_SALE').getValue();
//sql = sql + getAndConSql(sql, SALE, "SALE='" + SALE + "'");
var OP = form.findField('PS_OP').getValue();
sql = sql + getAndConSql(sql, OP, "OP='" + OP + "'");
var PORTLOAD = form.findField('PORTLOAD').getValue();
sql = sql + getAndConSql(sql, PORTLOAD, "PORTLOAD= '" + PORTLOAD + "'");
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
sql = sql + getAndConSql(sql, PORTDISCHARGE, "PORTDISCHARGE= '" + PORTDISCHARGE + "'");
var expDateBgn = form.findField('ExpDateBgn').getRawValue();
sql = sql + getAndConSql(sql, expDateBgn, "b.ETD >='" + expDateBgn + "'");
var expDateEnd = form.findField('ExpDateEnd').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "b.ETD <='" + expDateEnd + "'");
//var ISFEEUP = form.findField('ISFEEUP').getValue();
//if (ISFEEUP == '0') {
// sql = sql + getAndConSql(sql, ISFEEUP, " NOT EXISTS (select 1 from OP_STATUS WHERE v_op_truck_bulk.BSNO=OP_STATUS.BSNO AND OP_STATUS.STTYPE='2') ");
//} else if (ISFEEUP == '1') {
// sql = sql + getAndConSql(sql, ISFEEUP, " EXISTS (select 1 from OP_STATUS WHERE v_op_truck_bulk.BSNO=OP_STATUS.BSNO AND OP_STATUS.STTYPE='2') ");
//}
if (this.CheckAll.checked) {
sql = sql + getAndConSql(sql, StrAudit, StrAudit);
} else {
var feestr = this.getFeeCondition();
2 years ago
if (feestr != '') {
sql = sql + getAndConSql(sql, feestr, " EXISTS (select 1 from ch_fee WHERE v_op_bill.BSNO=ch_fee.BSNO AND " + feestr + " and isnull(v_op_bill.iscancel,0)=0 ) ");
}
else {
sql = sql + getAndConSql(sql, true, " EXISTS (select 1 from ch_fee WHERE v_op_bill.BSNO=ch_fee.BSNO AND isnull(v_op_bill.iscancel,0)=0 ) ");
}
3 years ago
};
//var PRTYPE = form.findField('PRTYPE').getValue();
//if (PRTYPE == '1') {
// var prtypestr = " EXISTS (select 1 from (select m.BSNO,SUM(case when f.FEETYPE=1 then case when APPLYTYPE=2 then m.AMOUNT*m.EXCHANGERATE else -m.AMOUNT*m.EXCHANGERATE end else case when APPLYTYPE=2 then -m.AMOUNT*m.EXCHANGERATE else m.AMOUNT*m.EXCHANGERATE end end) as pramount "
// + "from ch_fee_modify m left join ch_fee f on (f.GID=m.FEEID) where APPLYSTATUS=1 AND (APPLYTYPE=1 OR APPLYTYPE=2) and f.GID is not null GROUP BY m.BSNO) as PR "
// + " WHERE v_op_truck_bulk.BSNO=PR.BSNO AND PR.pramount<0 ) ";
// sql = sql + getAndConSql(sql, prtypestr, prtypestr);
//} else if (PRTYPE == '2') {
// sql = sql + getAndConSql(sql, PRTYPE, " OPTYPE='更改单' AND EXISTS (select 1 from v_op_gain_sum WHERE v_op_truck_bulk.BSNO=v_op_gain_sum.BSNO AND (v_op_gain_sum.TTLDR-v_op_gain_sum.TTLCR)<0 ) ");
//} else if (PRTYPE == '4') {
//}
return sql;
},
getFeeCondition: function () {
var form = this.formSearch.getForm();
var feesql = '';
var CUSTNAME = form.findField('CUSTNAME').getValue();
feesql = feesql + getAndConSql(feesql, CUSTNAME, "ch_fee.CUSTOMERNAME='" + CUSTNAME + "'");
var FeeName = form.findField('FeeName').getValue();
feesql = feesql + getAndConSql(feesql, FeeName, "ch_fee.FEENAME='" + FeeName + "'");
return feesql;
},
setSaveBtnStatus: function (enable) {
var bsbtnSave = Ext.getCmp('pcbtnSave');
var bsbtnSaveAndClose = Ext.getCmp('pcbtnSaveAndClose');
var bsbtnSaveAndNew = Ext.getCmp('pcbtnSaveAndNew');
var pcbtnNew = Ext.getCmp('pcbtnNew');
if (enable) {
bsbtnSave.enable();
bsbtnSaveAndClose.enable();
bsbtnSaveAndNew.enable();
pcbtnNew.enable();
} else {
//bsbtnSave.disable();
//bsbtnSaveAndClose.disable();
bsbtnSaveAndNew.disable();
pcbtnNew.disable();
}
},
PrintSelect: function (rptmode) {
var selections = this.gridBillList.getSelectionModel().getSelection();
if (selections.length == 0) {
//Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
var BSNO = record.data.BSNO;
var printType = 'MSCHFEAUDITTRUCKSEL';
var sql1 = "SELECT * FROM v_op_truck_bulk WHERE BSNO='"+BSNO+"'";
var sql2 = "SELECT F.*,dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno) as IsAudit FROM CH_FEE F left join workflow_using wu on wu.bsno=F.GID ";
sql2 = sql2 + " where F.bsno='" + BSNO + "' and F.FeeType=1 and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0 ";
var sql3 = "SELECT F.*,dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno) as IsAudit FROM CH_FEE F left join workflow_using wu on wu.bsno=F.GID ";
sql3 = sql3 + " where F.bsno='" + BSNO + "' and F.FeeType=2 and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0 ";
var sql4 = "";
var sql5 = "";
var sql6 = "";
if (rptmode == 1) {
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, '', 'MSCHFEAUDITSEL',1);
} else PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
});