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_settlement/ChRecvsettlementIndex.js

1795 lines
69 KiB
JavaScript

3 years ago
Ext.namespace('Shipping');
Shipping.MsChRecvsettlementIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsChRecvsettlementIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsChRecvsettlementIndex, Ext.Panel, {
PageSize: 50,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
strCwSTARTGID: '',
sortfield: '',
sortdire: '',
initUIComponents: function () {
this.formname = "formRecvsettlementIndex"; //页面名称
this.MsPeriod = null;
this.STLSHOWVOU = 0;
this.ISRATESET = 0;
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modRecvSettleList"} });
this.StoreLockOp = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpIDRang' }
});
this.StoreLockOp.load({ params: { optype: "modRecvFeeSettlementLock"} });
this.StoreUnLockOp = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpIDRang' }
});
this.StoreUnLockOp.load({ params: { optype: "modRecvFeeSettlementUnLock"} });
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsChSettlement',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_settlement/GetDataList',
reader: {
id: 'BILLNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BILLNO',
header: Zi.LAN.BillNo,
width: 120
}, {
sortable: true,
dataIndex: 'BILLSTATUS',
header: Zi.LAN.BillStatus,
width: 60,
renderer: function (value, meta, record) {
value = record.data.BILLSTATUSREF;
if (value == '锁定') {
meta.tdCls = 'feestatus_pass';
}
return record.data.BILLSTATUSREF;
}
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.CustomerName,
width: 120
}, {
sortable: true,
dataIndex: 'SETTLEMODEREF',
header: Zi.LAN.JieSuanLeiBie,
width: 100
}, {
sortable: true,
dataIndex: 'SETTLETYPEREF',
header: Zi.LAN.SettlementType,
width: 100
}, {
sortable: true,
dataIndex: 'CURR',
header: Zi.LAN.Currency,
width: 50
}, {
sortable: true,
dataIndex: 'AMOUNTRMB',
header: 'RMB',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
width: 120
}, {
sortable: true,
dataIndex: 'AMOUNTUSD',
header: 'USD',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
width: 120
}, {
sortable: true,
dataIndex: 'AMOUNTOT',
header: Zi.LAN.OtherCurrency,
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',
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
width: 120
}, {
sortable: true,
dataIndex: 'NOINVOICE',
header: Zi.LAN.WeiKaiPiao,
width: 120
}, {
sortable: true,
dataIndex: 'SETTLETIME',
header: Zi.LAN.SettlementTime,
width: 100
}, {
sortable: true,
dataIndex: 'SETTLEUSERREF',
header: Zi.LAN.SettlementUser,
width: 100
}, {
sortable: true,
dataIndex: 'ACCOUNTREF',
header: Zi.LAN.JieSuanAccount ,
width: 150
}, {
sortable: true,
dataIndex: 'ISEXPORT',
header: Zi.LAN.IsExportCerft,
width: 120
}, {
sortable: true,
dataIndex: 'ISNOTVOU',
header: '禁止生成凭证',
width: 120,
renderer: function (value, meta, record) {
if (value == true) {
value = '是';
} else value = '否';
return value;
}
}, {
sortable: true,
dataIndex: 'REMARK',
header: Zi.LAN.Remark,
width: 160
}, {
sortable: true,
dataIndex: 'INVNO',
header: Zi.LAN.InvoiceNumber,
width: 160
}, {
sortable: true,
dataIndex: 'SETTLENO',
header: Zi.LAN.SettlementNo,
width: 160
}, {
sortable: true,
dataIndex: 'FEEAMOUNT',
header: Zi.LAN.OriginalMoney,
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'VOUCHERNO',
header: Zi.LAN.VoucherNo,
width: 100,
renderer: function (value, meta, record) {
var openSet = "height=1000, width=950, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 250) / 2 + ",Left= " + (screen.width - 600) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcShipping/MsCwVouchersGl/Edit?handle=check&ordno=" + record.data.VOUNO;
var winstr = "window.open(this.href,'" + openType + "','" + openSet + "')";
value = '<a href="' + openUrl + '" onclick="' + winstr + ';return false">' + value+'</a>'
return value;
}
}, {
sortable: true,
dataIndex: 'SALECORP',
header: Zi.LAN.DepartmentName,
width: 100
}, {
sortable: true,
dataIndex: 'ACCOUNTS_MONEY',
header: Zi.LAN.BookKeepingData,
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'PREPAY_MONEY',
header: Zi.LAN.YuShouZhiReport,
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'AHSR_MONEY',
header: Zi.LAN.ShiShouZhiReport,
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'FINANCIAL_MONEY',
header: Zi.LAN.FinanceCose,
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'ADVANCE_MONEY',
header: Zi.LAN.YuShouZhiQuReport,
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'BILLDATE',
header: Zi.LAN.BILLDATE,
width: 100
}, {
sortable: true,
dataIndex: 'SHENNO',
header: Zi.LAN.SHENNO,
width: 100
}, {
sortable: true,
dataIndex: 'INVSHENNO',
header: Zi.LAN.INVSHENNO,
width: 100
}, {
sortable: true,
dataIndex: 'CUSTBANK',
header: Zi.LAN.JSDanWeiBank,
width: 100
}, {
sortable: true,
dataIndex: 'CUSTACCOUNT',
header: Zi.LAN.JSDanWeiAccount,
width: 100
}];
this.girdcolums = this.initgirdcolums;
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();
}
}
}
});
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 40
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
viewConfig: {
enableTextSelection: true
},
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
columns: this.girdcolums,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: Zi.LAN.FenYe,
emptyMsg: Zi.LAN.DataEmptyMsg
}), this.Pagenum]
});
_this = this;
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.girdcolums.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
if (record.data.SETTLEMODE == 1)
DsOpenEditWin('/Account/Chfee_settlement/RecvAppEdit');
else if (record.data.SETTLEMODE == 3)
DsOpenEditWin('/Account/Chfee_settlement/RecvInvEdit');
else
DsOpenEditWin('/Account/Chfee_settlement/RecvBLEdit');
}, this);
//#region formSearch
//#region formSearch枚举参照相关
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.CustomerName,
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.storeISVOU = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeISVOU.add({ "FSTATUS": "0", "NAME": Zi.LAN.No });
this.storeISVOU.add({ "FSTATUS": "1", "NAME": Zi.LAN.Yes });
this.comboxISVOU = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.AddCwVouchers ,
store: this.storeISVOU,
valueField: 'FSTATUS',
displayField: 'NAME',
flex: 0.7,
// flex: 0.7,
// labelWidth: 55,
forceSelection: true,
name: 'ISVOU',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#endregion
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.BillNo,
name: 'BsNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCust, {
fieldLabel: Zi.LAN.VoucherNo,
name: 'VOUCHERNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.FromJieSuanDate,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateBgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.ToJieSuanDate,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDateEnd',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},this.comboxISVOU, {
xtype: 'button',
width: 90,
text: Zi.LAN.Executequery,
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
xtype: 'button',
width: 90,
text: Zi.LAN.AdvancedSearch,
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//#region
var menu1 = new Ext.menu.Menu({
id: 'basicMenu',
items: [{
text: Zi.LAN.ShouFeiJSLiuShui, hidden: true,
handler: clickHandler_1
}, {
text: Zi.LAN.ShouFeiJSLiuShuiGroup, hidden: true,
handler: clickHandler_2
}
]
});
//#region 打印格式定义
function clickHandler_1() {
_this.Print();
};
function clickHandler_2() {
_this.Print_FYFZ();
};
//#endregion
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: Zi.LAN.FreeJieSuan,
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
DsOpenEditWin('/Account/Chfee_settlement/RecvBLEdit');
},
scope: this
},
'-',
{
text: Zi.LAN.ApplyJieSuan,
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
DsOpenEditWin('/Account/Chfee_settlement/RecvAppEdit');
},
scope: this
},
'-',
{
text: Zi.LAN.FaPiaoJieSuan,
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
DsOpenEditWin('/Account/Chfee_settlement/RecvInvEdit');
},
scope: this
},
'-',
{
text: Zi.LAN.InZhangDanPrint,
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectBillFirst, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
var BILLNO = record.data.BILLNO;
var openSet = "height=400, 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 = "/Account/Chfee_jinzhang/Edit?handle=check&DRNO="+BILLNO;
window.open(openUrl, openType, openSet);
},
scope: this
},
{
text: Zi.LAN.ResetCondition ,
iconCls: "btnreset",
handler: function (button, event) {
var form = this.formSearch.getForm();
form.reset();
},
scope: this
}, '-', {
text: Zi.LAN.CommitLock,
tooltip: Zi.LAN.CommitLock,
id: 'btnSubmitAudit',
handler: function (button, event) {
this.onSubmitAuditClick();
},
scope: this
}, '-', {
text: Zi.LAN.SubmitAuditBack,
tooltip: Zi.LAN.SubmitAuditBack,
id: 'btnSubmitAuditBack',
handler: function (button, event) {
this.onSubmitAuditBackClick();
},
scope: this
}, '-',
{
text: Zi.LAN.Btn_Delete,
iconCls: "btndelete",
id: 'btndelete',
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-',
{
text: Zi.LAN.PrintReport,
menu: [
{
text: Zi.LAN.ShouFeiJSList,
handler: function (button, event) {
_this.Print();
}
}, {
text: Zi.LAN.ShouFeiJSListSel,
handler: function (button, event) {
_this.PrintSelect();
}
}, {
text: Zi.LAN.ShouFeiJSLiuShuiGroup,
handler: function (menu, event) {
_this.Print_FYFZ();
}
}],
scope: this
}
, '-', {
text: Zi.LAN.SavelistStyle,
id: "btntest",
menu: [
{ text: Zi.LAN.Save ,
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, { text: Zi.LAN.Initialization,
handler: function (menu, event) {
_this.InitGrid(_this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-', {
text: Zi.LAN.ExportExcel,
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-',
{
text: Zi.LAN.AddCwVouchers,
id: "btnAddCwVouchers",
iconCls: "btnadd",
handler: function (button, event) {
this.onAddCwVouchers();
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 80,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext, billtype: 1 });
}, this);
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
this.gridList.getSelectionModel().on('select', function (model, record, index) {
var op = record.data.SETTLEUSER;
var opname = record.data.SETTLEUSERREF;
var bsstatus = record.data.BILLSTATUS;
var btnESubmitAudit = Ext.getCmp('btnSubmitAudit');
var btnESubmitAuditBack = Ext.getCmp('btnSubmitAuditBack');
var btndelete = Ext.getCmp('btndelete');
var records = DsStoreQueryBy(this.StoreLockOp, 'OPID', op);
if (records.getCount() > 0) {
if (bsstatus == 1) {
btnESubmitAudit.disable();
} else {
btnESubmitAudit.enable();
}
} else {
btnESubmitAudit.disable();
}
var records = DsStoreQueryBy(this.StoreUnLockOp, 'OPID', op);
if (records.getCount() > 0) {
if (bsstatus == 1) {
btnESubmitAuditBack.enable();
} else {
btnESubmitAuditBack.disable();
}
} else {
btnESubmitAuditBack.disable();
}
var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', opname);
if (records.getCount() > 0) {
btndelete.enable();
} else {
btndelete.disable();
}
}, this);
var sql = ' BILLTYPE =1 and BILLSTATUS<>1 ';
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, billtype: 1 },
waitMsg: Zi.LAN.NowSelect ,
scope: this
});
this.LoadPeriod();
//#region 生成凭证_汇率列表
//#region 加载数据
//权限加载
this.StoreIsCwVouchers = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.ModuleModel',
proxy: { url: '/MvcShipping/MsBaseInfo/GetSysModuleList' }
});
this.StoreIsCwVouchers.load({
params: { condition: "[name]='modChRecvSettlementIndexCwVouchers'" },
waitMsg: Zi.LAN.NowSelect,
callback: function (options, success, response) {
if (success) {
//判断是否显示凭证按钮
if (options.length > 0) {
Ext.getCmp('btnAddCwVouchers').show();
} else {
Ext.getCmp('btnAddCwVouchers').hide();
}
}
},
scope: this
});
//制单人
this.storePREPAREDCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storePREPAREDCode.load();
this.comboxPREPARED = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel:Zi.LAN.DocumentMakerUser,
store: this.storePREPAREDCode,
forceSelection: true,
id: 'PREPARED',
name: 'PREPARED',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
//键值维护表_凭证字//需求编号SR2017080200007
this.storeCrmKeyCodeCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CrmKeyCodeModel',
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
});
this.storeCrmKeyCodeCode.load({ params: { condition: " and KEYTYPE='凭证字'"} });
this.comboxVKNO = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CertificateKeyValue,
store: this.storeCrmKeyCodeCode,
forceSelection: true,
name: 'VKNO',
valueField: 'KEYVALUE',
displayField: 'KEYVALUE'
});
this.storeMerGeType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeMerGeType.add({ "DC": "", "NAME": Zi.LAN.SystemSet });
this.storeMerGeType.add({ "DC": "1", "NAME": Zi.LAN.Merge });
this.storeMerGeType.add({ "DC": "2", "NAME": Zi.LAN.UnMerge });
this.comboxMergeType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.IsConsolidatedGeneratedCertificate ,
store: this.storeMerGeType,
labelWidth: 110,
width:210,
valueField: 'DC',
value:'',
displayField: 'NAME',
forceSelection: true,
name: 'MERGE'
});
//#endregion
//#region 定义数据集
this.storeListCw = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsCodeCurrencyList',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_settlement/GetCodeCurrencyList',
reader: {
id: 'CURR',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#endregion
//#region 列定义
this.girdcolums = [{
sortable: false,
text: Zi.LAN.Currency,
dataIndex: 'CURR',
width: 100,
align: 'center'
}, {
sortable: false,
text: Zi.LAN.AdjustmentsRate,
dataIndex: 'FCYEXRATE',
width: 118,
align: 'right',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 5, '', 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; },
editor: {
xtype: 'numberfield',
selectOnFocus: true, //得到焦点时自动选择文本
allowDecimals: true, //允许输入小数
decimalPrecision: 5, //允许保留的小数位数,并四舍五入
nanText: Zi.LAN.Msg_NotNumber,
hideTrigger: true //是否隐藏上下调节按钮
}
}];
//#endregion
//#region gridList列表显示信息
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1 //1单击2双击
});
this.gridListCw = new Ext.grid.GridPanel({
region: 'center',
width: 220,
store: this.storeListCw,
enableHdMenu: false, //是否显示表格列的菜单
hideHeaders: false, //是否隐藏表头
rowLines: true,
columnLines: true,
loadMask: { msg: Zi.LAN.LoadData },
plugins: [this.gridListCellEditing],
selType: 'cellmodel',
columns: this.girdcolums
});
//#endregion
this.InitData();
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='STLSHOWVOU'"
},
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.STLSHOWVOU = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetCwISRATESET',
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 == '1') {
this.ISRATESET = 1;
} else {
}
}
} else {
}
},
scope: this
});
//#endregion
}, //end initUIComponents
LoadPeriod: function () {
Ext.Ajax.request({
waitMsg: Zi.LAN.OnSelect ,
url: '/Account/ChMonthClose/GetNowPeriod',
params: {
condition: ''
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
this.MsPeriod = data;
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
},
//#region 加载事件
InitData: function () {
Ext.Ajax.request({
waitMsg: Zi.LAN.OnSelect ,
url: '/MvcShipping/RptCwGenlegAccitems/GetData',
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
var arrtmp = data.toString().split("&");
this.strCwSTARTGID = arrtmp[0].toString();
var strCwSTARTNAME = arrtmp[1].toString();
var strCwACCDATE = arrtmp[2].toString();
var sYear = arrtmp[3].toString();
var sMonth = arrtmp[4].toString();
//
//var sZQ = "&nbsp;&nbsp;当前登录账套:“" + strCwSTARTNAME + "”&nbsp;&nbsp;当前财务账期:“" + sYear + "年第" + sMonth + "期”&nbsp;&nbsp;";
//Ext.getCmp("lbTitle2").setValue(sZQ);
//this.onRefreshClick();
} else {
//Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}, //end InitData
//#endregion
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, billtype: 1 },
waitMsg: Zi.LAN.NowSelect ,
scope: this
});
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.sqlcontext;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, billtype: 1 },
waitMsg: Zi.LAN.NowSelect ,
scope: this
});
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectBillFirst, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
var billstatus = record.data.BILLSTATUS;
var settlemode = record.data.SETTLEMODE;
if (billstatus == '1') {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.CanotDelBill4Status, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var SETTLETIME = record.data.SETTLETIME;
// var oDate1 = new Date(SETTLETIME);
// var oDate2 = new Date(this.MsPeriod.FDAY);
// if (oDate1.getTime() < oDate2.getTime()) {
// Ext.Msg.show({ title: '提示', msg: Zi.LAN.EndMothJZCanotDelBill, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
// }
Ext.MessageBox.confirm(Zi.LAN.TiShi,Zi.LAN.Sure2DelTheRecode, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.Msg_Deleting);
Ext.Ajax.request({
waitMsg:Zi.LAN.Msg_Deleting,
url: '/Account/Chfee_settlement/DeleteRecv',
params: {
data: Ext.JSON.encode(record.data),
settlemode: settlemode
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.remove(record);
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '删除成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.E, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.Warn , msg: Zi.LAN.ServerResponseErrorRetry, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}, //onDeleteClick
onSubmitAuditClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectBillFirst, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var BILLNOStr = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLNO = rec.data.BILLNO;
if (rec.data.BILLSTATUS == '2') {
if (BILLNOStr == '')
BILLNOStr = BILLNO;
else {
BILLNOStr = BILLNOStr + ',' + BILLNO;
}
}
}
_this = this;
if (BILLNOStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.Msg_Adding,
url: '/Account/Chfee_settlement/LockList',
params: {
bills: BILLNOStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_this.storeList.reload();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditBackClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectBillFirst, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var BILLNOStr = '';
var strIsVOUCHERNO = "";
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLNO = rec.data.BILLNO;
var isvou = rec.data.ISEXPORT;
var isVOUCHERNO = rec.data.VOUCHERNO;
if (isVOUCHERNO != "") {
strIsVOUCHERNO = Zi.LAN.HasZongCerfCanotCancl;
}
if ((rec.data.BILLSTATUS == '1') && (isVOUCHERNO == "")) {
if (BILLNOStr == '')
BILLNOStr = BILLNO;
else {
BILLNOStr = BILLNOStr + ',' + BILLNO;
}
}
}
if (strIsVOUCHERNO != "") {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: strIsVOUCHERNO, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
_this = this;
if (BILLNOStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.Msg_Adding,
url: '/Account/Chfee_settlement/UnLockList',
params: {
bills: BILLNOStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_this.storeList.reload();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
};
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert(Zi.LAN.TiShi, Zi.LAN.SelectConditionValError);
return '';
}
var sql = ' BILLTYPE=1 ';
var customNo = form.findField('BsNo').getValue();
sql = sql + getAndConSql(sql, customNo, "BILLNO like '%" + customNo + "%'");
var VOUCHERNO = form.findField('VOUCHERNO').getValue();
//sql = sql + getAndConSql(sql, VOUCHERNO, "VOUCHERNO like '%" + VOUCHERNO + "%'");
sql = sql + getAndConSql(sql, VOUCHERNO, "gid in (select BSGID from [cw_vouno_bs_gl] where [BSTABLENAME]='ch_fee_settlement' and [STARTGID]='" + this.strCwSTARTGID + "' and VOUALLNO like '%" + VOUCHERNO + "%')");
var custName = form.findField('CustName').getValue();
sql = sql + getAndConSql(sql, custName, "CUSTOMERNAME like '%" + custName + "%'");
var expDateBgn = form.findField('ExpDateBgn').getRawValue();
sql = sql + getAndConSql(sql, expDateBgn, "SETTLETIME >='" + expDateBgn + "'");
var expDateEnd = form.findField('ExpDateEnd').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "SETTLETIME <='" + expDateEnd + " 23:59:59'");
var ISVOU = form.findField('ISVOU').getValue();
if (ISVOU == '1')
sql = sql + " AND EXISTS (select 1 from [cw_vouno_bs_gl] where [BSTABLENAME]='ch_fee_settlement' and BSGID=cm.GID) ";
else if (ISVOU == '0')
sql = sql + " AND (NOT EXISTS (select 1 from [cw_vouno_bs_gl] where [BSTABLENAME]='ch_fee_settlement' and BSGID=cm.GID) OR (AMOUNTRMB<>0 and AMOUNTUSD<>0)) ";
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
return ret;
},
onExportClick: function (button, event) {
_this = this;
GridExportExcelPage(this.gridList);
},
PrintSelect: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var storeadd = null;
var selectedRecords = this.gridList.getSelectionModel().getSelection();
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectBillFirst, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var sortstr = 'SETTLETIME DESC';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('GID') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var bsno = '11111';
var mblno = '';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
GID = record.data.GID;
}
var printType = 'MSRECVETTLLISTSELECT';
var sql1 = "select * from ch_fee_settlement WHERE GID IN (" + feeGidSql + ") order by " + sortstr;
var sql2 = "select * from ch_fee_settlement where GID='" + GID + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, mblno);
},
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var sortstr = ' SETTLETIME DESC,BILLNO DESC ';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
Ext.Msg.wait(Zi.LAN.HandlingDataAndWait);
Ext.Ajax.request({
waitMsg: Zi.LAN.HandlingData,
url: '/Account/Chfee_settlement/GetDataListStr',
scope: this,
params: {
start: 0,
limit: 10000000,
sort: sortstr,
condition: _this.sqlcontext,
billtype: 1
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSRECVETTLLIST';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: Zi.LAN.E, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.Retry,
msg: Zi.LAN.ServerResponseError,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
Print_FYFZ: function () {///结算列表
var printType = 'XXH_PayAppSettle_FYFZ';
var MainList = "";
var selectedRecords = [];
selectedRecords = this.gridList.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (MainList == "") { MainList = "'" + rec.get('BILLNO') + "'"; }
else {
MainList = MainList + ",'" + rec.get('BILLNO') + "'";
}
}
var T = this.getCondition();
//if (MainList == "") {
if (T != "") { T = " where " + T; };
//} else {
// T = " where billno in (" + MainList + ") "
//}
if (T == "" && MainList == "") {
alert(Zi.LAN.NoCSearchMayMoreTime);
}
var sql1 = " select billno,customername,CURRENCY,EXCHANGERATE ";
sql1 = sql1 + " ,sum(货款) 货款,sum(税金) 税金,sum(冷藏费) 冷藏费,sum(代理费) 代理费,sum(其他) 其他 ";
sql1 = sql1 + " ,sum(货款_W) 货款_W,sum(税金_W) 税金_W,sum(冷藏费_W) 冷藏费_W,sum(代理费_W) 代理费_W,sum(其他_W) 其他_W ";
sql1 = sql1 + " from (select billno,customername,t.CURRENCY,t.EXCHANGERATE ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then case FEEGROUP when '融资款' then amount when '货款' then amount else 0 end else 0 end) 货款 ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then case FEEGROUP when '税金' then amount else 0 end else 0 end) 税金 ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then case FEEGROUP when '冷藏费' then amount else 0 end else 0 end) 冷藏费 ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then case FEEGROUP when '代理费' then amount else 0 end else 0 end) 代理费 ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then case FEEGROUP when '其他' then amount else 0 end else 0 end) 其他 ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then 0 else case FEEGROUP when '融资款' then amount when '货款' then amount else 0 end end) 货款_W ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then 0 else case FEEGROUP when '税金' then amount else 0 end end) 税金_W ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then 0 else case FEEGROUP when '冷藏费' then amount else 0 end end) 冷藏费_W ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then 0 else case FEEGROUP when '代理费' then amount else 0 end end) 代理费_W ";
sql1 = sql1 + " ,(case CURRENCY when 'RMB' then 0 else case FEEGROUP when '其他' then amount else 0 end end) 其他_W ";
sql1 = sql1 + ",总账凭证号=(select top 1 VOUALLNO from cw_vouno_bs_gl WITH(NOLOCK) where BSGID=s.GID and BSTABLENAME='ch_fee_settlement' and STARTGID in (select top 1 GID from cw_design_startusing WITH(NOLOCK) where (ISDELETE=0 or ISDELETE is null) and ISENABLE=1 and GID=(select top 1 STARTGID from [cw_design_startusing_user] WITH(NOLOCK) where USERGID='" + USERID + "')))";
sql1 = sql1 + " from (select c.billno,s.CUSTOMERNAME ,c.CURRENCY,c.EXCHANGERATE,sum(AMOUNT) amount,cf.FEEGROUP from ch_fee_do c ";
sql1 = sql1 + " left join ch_fee_settlement s on s.BILLNO=c.BILLNO ";
sql1 = sql1 + " left join code_fee cf on cf.NAME=c.FEENAME ";
if (MainList == "") {
sql1 = sql1 + " where c.billno in (select billno from ch_fee_settlement cm " + T + ")";
} else {
sql1 = sql1 + " where c.BILLNO in (" + MainList + ")"
}
sql1 = sql1 + " group by c.BILLNO,c.CURRENCY,c.EXCHANGERATE,cf.FEEGROUP,s.CUSTOMERNAME ";
sql1 = sql1 + " ) t)tt group by billno,customername,CURRENCY,EXCHANGERATE ";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
//#region 生成凭证
onAddCwVouchers: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectBillFirst, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var strGids = "";
//var strError = "";
//var iGids = 0;
//for (var i = 0; i < selections.length; i++) {
// var rec = selections[i];
// var VOUCHERNO = rec.data.VOUCHERNO; //凭证号
// var BILLSTATUS = rec.data.BILLSTATUS; //是否锁定
// var SETTLETYPEREF = rec.data.SETTLETYPEREF; //结算方式
// var ACCOUNTREF = rec.data.ACCOUNTREF; //结算账户
// //
// if (VOUCHERNO == "" && BILLSTATUS == 1 && ((SETTLETYPEREF != "现金" && ACCOUNTREF != "") || SETTLETYPEREF == "现金")) {
// if (strGids == "")
// strGids = rec.data.GID;
// else {
// strGids += "," + rec.data.GID;
// }
// iGids++;
// }
// else {
// strError = "请选择已锁定、结算账户不为空(结算方式为现金除外),且未生成凭证的单据!";
// }
//}
//if (strError != "") {
// Ext.Msg.show({ title: '提示', msg: strError, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
//
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
if (strGids == "")
strGids = rec.data.GID;
else {
strGids += "," + rec.data.GID;
}
}
Ext.Ajax.request({
waitMsg:Zi.LAN.PreReadDataWait ,
url: '/Account/Chfee_settlement/GetIsVoucher',
params: {
strGids: strGids
},
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;
}
this.storeListCw.load({
params: { strGids: strGids },
callback: function (r, options, success) {
if (success) {
this.showContactForm(false, strGids, this, selections.length);
}
},
waitMsg: Zi.LAN.RefreshDataWait, scope: this
});
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
//
},
//#endregion
//#region 层_显示信息
showContactForm: function (win, strGids, _this, iGids) {
var required = '<span style="color:red;font-weight:bold;" data-qtip="Required">*</span>';
if (!win) {
//#region 编辑formDiv 基本信息
var formDiv = Ext.widget('form', {
border: false,
bodyPadding: 10,
fieldDefaults: {
labelAlign: 'right',
labelWidth: 60,
labelStyle: 'font-weight:bold'
},
items: [this.comboxPREPARED, {
fieldLabel: Zi.LAN.AccountingDate,
format: 'Y-m-d',
xtype: 'datefield',
allowBlank: false,
name: 'VOUDATE',
value: Ext.util.Format.date(Ext.Date.add(new Date(), Ext.Date.MONTH - 1, 1), "Y-m-d")
}, this.comboxVKNO, //需求编号SR2017080200007
{
xtype: "checkbox", //checkbox控件
name: "ButtSettlement",
boxLabel: Zi.LAN.IsCreateBankAccount ,
width: 200,
inputValue: "true", //选中的值
uncheckedValue: "false" //未选中的值
}, //需求编号SR2017080200007
{
xtype: "checkbox", //checkbox控件
name: "ISSTBANKGROUP",
boxLabel: '银行科目合并',
width: 200,
inputValue: "true", //选中的值
uncheckedValue: "false" //未选中的值
}, this.comboxMergeType,{
//fieldLabel: "",
xtype: "checkbox", //checkbox控件
name: "ISRATE",
boxLabel: Zi.LAN.IsReferSysTemRate,
width: 200,
inputValue: "true", //选中的值
uncheckedValue: "false", //未选中的值
checked: true, //绘制时的选中状态,
listeners: {
'change': function (field, newValue, oldValue, eOpts) {
if (field.checked.toString() == "false") {
this.gridListCw.show();
}
else {
this.gridListCw.hide();
}
},
scope: this
}
}, this.gridListCw
],
buttons: [{
text: Zi.LAN.AddCwVouchers ,
handler: function (options, success, response) {
if (!this.up('form').getForm().isValid()) {
return;
}
var dataDiv = this.up('form').getForm().getValues(false, false, false);
//
var j = 0;
var bodydatas = [];
for (var i = 0; i < _this.storeListCw.getCount(); i += 1) {
var member = _this.storeListCw.getAt(i);
bodydatas.push(member);
}
var jsonBody;
if (bodydatas.length > 0) {
jsonBody = ConvertRecordsToJsonAll(bodydatas);
}
//
Ext.Msg.wait('正在生成' + iGids + '票结算单数据, 请稍侯...');
Ext.Ajax.request({
waitMsg: '正在生成' + iGids + '票结算单数据, 请稍侯...',
url: '/Account/Chfee_settlement/onAddCwVouchers',
scope: this,
params: {
strGids: strGids,
dataDiv: Ext.JSON.encode(dataDiv),
jsonBody: jsonBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (_this.STLSHOWVOU == 1) {
DsOpenEditWin('/MvcShipping/MsCwVouchersGl/Edit?handle=check&ordno=' + jsonresult.Data, "凭证录入", "", "940", "10", "10");
} else {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK });
_this.onRefreshClick();
}
return;
} else {
Ext.Msg.show({ title: Zi.LAN.E, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.Retry, msg: Zi.LAN.ServerResponseError, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
},
timeout: 3000000//30秒
});
//
this.up('form').getForm().reset();
this.up('window').hide();
}
}, {
text: Zi.LAN.Btn_Cancel,
handler: function () {
this.up('form').getForm().reset();
this.up('window').hide();
}
}],
listeners: {
scope: this,
'render': function (thisDiv, thisExtend) {
//var ISRATE = Ext.getCmp('ISRATE').getValue().toString();
var ISRATE = thisDiv.form.findField('ISRATE').getValue().toString();
if (ISRATE == "false") {
this.gridListCw.show();
}
else {
this.gridListCw.hide();
}
//
Ext.Ajax.request({
waitMsg: Zi.LAN.SelectDelegateNumberStatus,
url: '/MvcShipping/MsBaseInfo/GetCwVOUNO',
params: {
VKNO: "记"
},
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.INFO, buttons: Ext.Msg.OK });
return;
}
//
data = result.data;
var arrayList = new Array();
arrayList = data.split("~");
var strY = arrayList[0].toString();
var strM = arrayList[1].toString();
var sVOUNO = arrayList[2].toString();
var strVOUNO = arrayList[3].toString();
var strVOUDATE = arrayList[4].toString();
var strACCDATE = arrayList[5].toString();
//
thisDiv.form.findField('VOUDATE').setValue(strVOUDATE);
thisDiv.form.findField('VOUDATE').setMinValue(strACCDATE + "-01");
if (_this.ISRATESET == 1) thisDiv.form.findField('ISRATE').setValue(false)
//Ext.getCmp('VOUDATE').setValue(strVOUDATE);
//Ext.getCmp('VOUDATE').setMinValue(strACCDATE + "-01");
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
}
});
//#endregion
win = Ext.widget('window', {
title:Zi.LAN.AuxiliaryAccounting,
closeAction: 'hide',
width: 250,
height: 350,
layout: 'fit',
resizable: true,
modal: true,
closable: false,
items: formDiv
});
}
win.show();
}
//#endregion
});