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/MvcShipping/Viewsjs/MsChFee/FeeAddEdit.js

1074 lines
50 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
Shipping.FeeAddEdit= function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.FeeAddEdit.superclass.constructor.call(this);
};
// 官方推荐的多国语言方法 兼容性不好
// 自定义多国语言动态加载方法
Ext.ns("Zi.LAN.FEE");
//#region MsChFee
Zi.LAN.FEE.ACCDATE = "会计期间";
Zi.LAN.FEE.AccTaxRate = "进项税率";
Zi.LAN.FEE.AccTax = "进项税额";
Zi.LAN.FEE.AccAmount = "进项金额";
Zi.LAN.FEE.AccTaxRate2 = "销项税率";
Zi.LAN.FEE.AccTax2 = "销项税额";
Zi.LAN.FEE.AccAmount2 = "销项金额";
Zi.LAN.FEE.AMENDNO = "更改单编号";
Zi.LAN.FEE.Amount = "金额";
Zi.LAN.FEE.AuditDate = "审核日期";
Zi.LAN.FEE.Auditoperator = "审核人";
Zi.LAN.FEE.BSNO = "BSNO"; //"BSNO";
Zi.LAN.FEE.BSNO2 = "业务编号"; //"业务编号";
Zi.LAN.FEE.Commissionrate = "佣金比率";
Zi.LAN.FEE.CREATETIME = "更改日期"; //"更改日期";
Zi.LAN.FEE.CREATEUSER = "更改人";
Zi.LAN.FEE.CURR = "<a href='#'><font color='#FF0000'>总 计</font></a>";
Zi.LAN.FEE.Currency = "币别";
Zi.LAN.FEE.CUSTOMERNAME = "结算对象";
Zi.LAN.FEE.CUSTOMERFULLNAME = "结算对象全称";
Zi.LAN.FEE.CustomerType = "客户类别";
Zi.LAN.FEE.DebitNo = "対帐编号";
Zi.LAN.FEE.DRCRPR = "含税";
Zi.LAN.FEE.EnterDate = "录入日期";
Zi.LAN.FEE.ExChangerate = "汇率";
Zi.LAN.FEE.FeeDescription = "费用英文名称";
Zi.LAN.FEE.FeeFrt = "FRT";
Zi.LAN.FEE.FeeName = "应收费用名称";
Zi.LAN.FEE.FeeName2 = "应付费用名称";
Zi.LAN.FEE.FEESTATUS = "费用状态";
Zi.LAN.FEE.GID = "GID"; //"GID";
Zi.LAN.FEE.GID2 = "number"; //"惟一编号";
Zi.LAN.FEE.INPUTMODE = "录入方式";
Zi.LAN.FEE.Invoice = "已开票金额";
Zi.LAN.FEE.InvoiceNum = "发票号码";
Zi.LAN.FEE.IsAdvancedpay = "是否垫付";
Zi.LAN.FEE.IsInvoice = "禁开发票";
Zi.LAN.FEE.IsOpen = "是否机密";
Zi.LAN.FEE.LOCALCURR = "本位币";
Zi.LAN.FEE.MODIFIEDTIME = "修改日期";
Zi.LAN.FEE.MODIFIEDUSER = "修改人";
Zi.LAN.FEE.NORATE = "不含税";
Zi.LAN.FEE.NoTaxAmount = "不含税金额";
Zi.LAN.FEE.OpName = "录入人";
Zi.LAN.FEE.OrderAmount = "申请金额";
Zi.LAN.FEE.OrderInvoice = "发票申请金额";
Zi.LAN.FEE.OTCR = "其他币别应付";
Zi.LAN.FEE.OTPROFIT = "其他币别利润";
Zi.LAN.FEE.PARENTID = "PARENTID";
Zi.LAN.FEE.PreAmount = "预估金额";
Zi.LAN.FEE.Quantity = "数量";
Zi.LAN.FEE.REASON = "更改原因";
Zi.LAN.FEE.REMARK = "备注";
Zi.LAN.FEE.RMBCR = "RMB应付";
Zi.LAN.FEE.RMBDR = "RMB应收";
Zi.LAN.FEE.RMBPROFIT = "RMB利润";
Zi.LAN.FEE.Settlement = "结算金额";
Zi.LAN.FEE.Tax = "税额";
Zi.LAN.FEE.TaxRate = "税率";
Zi.LAN.FEE.TaxUnitPrice = "单价";
Zi.LAN.FEE.TTLCR = "合计应付";
Zi.LAN.FEE.TTLDR = "合计应收";
Zi.LAN.FEE.TTLPROFIT = "合计利润";
Zi.LAN.FEE.UNINVOICE = "未开票金额";
Zi.LAN.FEE.Unit = "单位标准";
Zi.LAN.FEE.UnitPrice = "不含税单价";
Zi.LAN.FEE.USDCR = "USD应付";
Zi.LAN.FEE.USDDR = "USD应收";
Zi.LAN.FEE.USDPROFIT = "USD利润";
Zi.LAN.FEE.AddAllDetailDr = "所有生成应收";
Zi.LAN.FEE.AddAllDetailCr = "所有生成应付";
Zi.LAN.FEE.AddAmend = "添加更改单";
Zi.LAN.FEE.AddSelectDetailCr = "所选生成应付";
Zi.LAN.FEE.AddSelectDetailDr = "所选生成应收";
Zi.LAN.FEE.btnFeeAuditDr = "提交审核";
Zi.LAN.FEE.btnFeeAuditOpDr = "提交审核(主管)"; //提交审核
Zi.LAN.FEE.btnFeeImpAddDr = "引入费用";
Zi.LAN.FEE.btntest = "保存列表样式";
Zi.LAN.FEE.CancelAuditNew = "撤销提交";
Zi.LAN.FEE.CancelNoIvoice = "解禁发票";
Zi.LAN.FEE.CancelShen = "取消申请";
Zi.LAN.FEE.CtnTkAddDetail = "罐箱费用引入";
Zi.LAN.FEE.DaYinYingFuZhangDan = "打印应付账单";
Zi.LAN.FEE.DaYinYingShouZhangDan = "打印应收账单";
Zi.LAN.FEE.DeleteAmend = "删除更改单";
Zi.LAN.FEE.DRFEESTATUS = "应收费用";
Zi.LAN.FEE.GuanBi = "关闭";
Zi.LAN.FEE.HistryAddDetail = "历史引入";
Zi.LAN.FEE.HistryShen = "历史申请";
Zi.LAN.FEE.LiRun = "利 润";
Zi.LAN.FEE.NoIvoice = "不开发票";
Zi.LAN.FEE.PostAmend = "保存更改单";
Zi.LAN.FEE.PrintAllDetailDr = "所有应收打印";
Zi.LAN.FEE.PrintAllDetailCr = "所有应付打印";
Zi.LAN.FEE.PrintCustDetailCr = "应付客户打印";
Zi.LAN.FEE.PrintCustDetailDr = "应收客户打印";
Zi.LAN.FEE.PrintGain = "利润核算单打印";
Zi.LAN.FEE.PrintSelectDetailCr = "所选应付打印";
Zi.LAN.FEE.PrintSelectDetailDr = "所选应收打印";
Zi.LAN.FEE.QueRenShengCheng = "确认生成";
Zi.LAN.FEE.SaveFeeTemplate = "保存为费用模板";
Zi.LAN.FEE.SaveGridPanel = "保存";
Zi.LAN.FEE.SaveGridPanel2 = "初始化";
Zi.LAN.FEE.ShenDelete = "申请删除";
Zi.LAN.FEE.ShengChengYingFu = "生成应付";
Zi.LAN.FEE.ShengChengYingShou = "生成应收";
Zi.LAN.FEE.ShenIvoice = "申请开票";
Zi.LAN.FEE.ShenModify = "申请修改";
Zi.LAN.FEE.SubmitAuditAll = "全部提交";
Zi.LAN.FEE.SubmitAuditBill = "整票提交";
Zi.LAN.FEE.SubmitAuditCr = "应付提交";
Zi.LAN.FEE.SubmitAuditDr = "应收提交";
Zi.LAN.FEE.TemplateAddDetail = "引入费用模板";
Zi.LAN.FEE.TiJiaoShenQing = "提交申请";
Zi.LAN.FEE.ViewDetail = "查看信息";
Zi.LAN.FEE.YingFu = "应 付";
Zi.LAN.FEE.CRFEESTATUS = "应付费用";
Zi.LAN.FEE.YingShou = "应 收";
Zi.LAN.FEE.btnFeeAddCr = "添加应付费用";
Zi.LAN.FEE.btnFeeAddDr = "添加应收费用";
Zi.LAN.FEE.btnFeeCancel = "取消修改";
Zi.LAN.FEE.btnFeeDelCr = "删除应付费用";
Zi.LAN.FEE.btnFeeDelDr = "删除应收费用";
Zi.LAN.FEE.btnFeePrintCr = "打印应付";
Zi.LAN.FEE.btnFeePrintDr = "打印应收";
Zi.LAN.FEE.btnFeeRefCr = "刷新应付";
Zi.LAN.FEE.btnFeeRefDr = "刷新应收";
Zi.LAN.FEE.btnFeeSaveCr = "保存应付费用";
Zi.LAN.FEE.btnFeeSaveDr = "保存应收费用";
Zi.LAN.FEE.ChuoWu = "错误";
Zi.LAN.FEE.CurrSum = "币别合计";
Zi.LAN.FEE.CustSum = "客户合计";
Zi.LAN.FEE.GengGaiDanFeiYongMingXi = "更改单费用明细";
Zi.LAN.FEE.JingGao = "警告";
Zi.LAN.FEE.LiRunSum = "利润合计";
Zi.LAN.FEE.LiRunTongJi = "利润统计";
Zi.LAN.FEE.NewFeeEdit = "费用新值";
Zi.LAN.FEE.NewFeeShow = "费用修改新值";
Zi.LAN.FEE.OldFee = "费用旧值";
Zi.LAN.FEE.panelAmend = "更改单信息";
Zi.LAN.FEE.TiShi = "提示";
Zi.LAN.FEE.winShenDeleteShow = "费用申请删除";
Zi.LAN.FEE.winShenModifyShow = "费用申请修改";
Zi.LAN.FEE.BiBieBuNengWeiKong = "币别不能为空!";
Zi.LAN.FEE.CunZaiFeiYongXinXiBuYunXuShanChu = "存在费用信息,不允许删除,请先删除费用信息!";
Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShanChu = "当前费用已対帐无法删除!";
Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShenQingShanChu = "当前费用已対帐无法申请删除!";
Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShenQingXiuGai = "当前费用已対帐无法申请修改!";
Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaXiuGai = "当前费用已対帐无法修改!";
Zi.LAN.FEE.DangQianFeiYongYiJieSuanWuFaShenQingShanChu = "当前费用已结算无法申请删除!";
Zi.LAN.FEE.DangQianFeiYongYiJieSuanWuFaShenQingXiuGai = "当前费用已结算无法申请修改!";
Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShanChu = "当前费用已开出发票无法删除!";
Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShenQingXiuGai = "当前费用已开出发票无法申请修改!";
Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShanChu = "当前费用已申请费用无法删除!";
Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingShanChu = "当前费用已申请费用无法申请删除!";
Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingXiuGai = "当前费用已申请费用无法申请修改!";
Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShanChu = "当前费用已申请开票无法删除!";
Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingShanChu = "当前费用已申请开票无法申请删除!";
Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingXiuGai = "当前费用已申请开票无法申请修改!";
Zi.LAN.FEE.DangQianFeiYongZhangTaiWuFaShenQingXiuGai = "当前费用状态无法申请修改!";
Zi.LAN.FEE.DangQianFeiYongZhuangTaiWuFaQuXiaoShenQing = "当前费用状态无法取消申请!";
Zi.LAN.FEE.DangQianFeiYongZhuangTaiWuFaShenQingShanChu = "当前费用状态无法申请删除!";
Zi.LAN.FEE.displayMsg = "当前显示{0}-{1}条记录/共{2}条记录";
Zi.LAN.FEE.emptyMsg = "没有数据";
Zi.LAN.FEE.FeiYongJinEBuYunXuWeiLing = "费用的金额不允许为0请修改后再保存";
Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong = "费用名称不能为空!";
Zi.LAN.FEE.FeiYongYiSuoDingBuYunXuShanChu = "费用已锁定,不允许删除!";
Zi.LAN.FEE.FRTWeiKongBuNengTiJiao = "FRT为空,不能提交!";
Zi.LAN.FEE.FuWuQiXiangYingChuCuo = "服务器响应出错,请重试";
Zi.LAN.FEE.HuiLvBuNengWeiKong = "汇率不能为空!";
Zi.LAN.FEE.HuiLvBuNengWeiLing = "汇率不允许为0请修改后再保存";
Zi.LAN.FEE.JieFeiDuiXiangBuNengWeiKong = "结费对象不能为空!";
Zi.LAN.FEE.JinEWeiLingBuNengTiJiao = "金额为0,不能提交!";
Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao = "客户类别为空,不能提交!";
Zi.LAN.FEE.KeHuMingChengBuNengWeiKong = "客户名称不能为空!";
Zi.LAN.FEE.KuaiJiQiJianBuNengWeiKong = "会计期间不能为空!";
Zi.LAN.FEE.QingTianJiaBingBaoCunGengGaiDan = "请添加并保存更改单,然后再添加费用明细!";
Zi.LAN.FEE.QingXianBaoCunFeiYong = "费用未保存,请先保存费用!";
Zi.LAN.FEE.QingXianXuanZeFeiYong = "请先选择要操作的费用!";
Zi.LAN.FEE.QingXianXuanZeYaoTianJiaFeiYongDeGengGaiDan = "请先选择要添加费用的更改单!";
Zi.LAN.FEE.QingXianXuanZeYaoTiJiaoShenHeDeFeiYong = "请先选择要提交审核的费用!";
Zi.LAN.FEE.QingXianXuanZeYeWu = "请先选择要操作的业务!";
Zi.LAN.FEE.QuanXianBuZuBuYunXuShanChu = "权限不足,不允许删除!";
Zi.LAN.FEE.SangQianFeiYongYiKaiChuFaPiaoWuFaShenQingShanChu = "当前费用已开出发票无法申请删除!";
Zi.LAN.FEE.ShanChuYuanYinBuNengWeiKong = "删除原因不能为空!";
Zi.LAN.FEE.ShuiLvBuNengWeiKong = "税率不能为空!";
Zi.LAN.FEE.ShuJuJiaZaiZhongQingShaoDeng = "数据加载中,请稍等...";
Zi.LAN.FEE.XiuGaiYuanYinBuNengWeiKong = "修改原因不能为空!";
Zi.LAN.FEE.ZhengZaiCaoZuoShuJu = "正在操作数据,请稍侯...";
Zi.LAN.FEE.ZhengZaiChaXunShuJu = "正在查询数据...";
Zi.LAN.FEE.ZiNengShanChuFuHeTiaoJianDeFeiYong = "只能删除费用状态为[录入状态]和[驳回提交]的费用,请重新选择";
Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong = "只能费用状态为[录入状态]和[驳回提交]的费用才能提交审核,请重新选择";
Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong2 = "只能费用状态为[提交审核]的费用才能撤销提交审核,请重新选择";
Zi.LAN.FEE.AccTaxRate3 = "财务税率";
Zi.LAN.FEE.Amount2 = "含税金额";
Zi.LAN.FEE.CUSTOMERNAME2 = "费用对象";
Zi.LAN.FEE.FeeName3 = "费用名称";
Zi.LAN.FEE.FeeType = "FeeType";
Zi.LAN.FEE.Frt = "FRT";
Zi.LAN.FEE.IsAdvancedpay2 = "仅需审核业务";
Zi.LAN.FEE.MODIFIEDTIME2 = "申请时间";
Zi.LAN.FEE.MODIFIEDUSER2 = "申请人";
Zi.LAN.FEE.Quantity2 = "计费数量";
Zi.LAN.FEE.Reason2 = "删除原因";
Zi.LAN.FEE.Reason3 = "修改原因";
Zi.LAN.FEE.Reason4 = "驳回原因";
Zi.LAN.FEE.ShenCurr = "发票币别";
Zi.LAN.FEE.TaxUnitPrice2 = "含税单价";
Zi.LAN.FEE.MANAGER = "责任人";
Zi.LAN.FEE.ViewWorkFlow = "查看工作流";
Zi.LAN.FEE.MANAGERWeiKongBuNengTiJiao = "费用责任人不能为空!";
Zi.LAN.ChangeProBefore = "更改前利润";
Zi.LAN.ChangeProfit = "更改后利润";
Zi.LAN.ProfitMargin = "利润差额"
Zi.LAN.FEE.ShenPay = "付款申请";
Zi.LAN.FEE.SetFeeIsOpen = "设置为佣金";
Zi.LAN.FEE.NewCustNameShow = "批量更改费用对象";
Zi.LAN.FEE.QuerenXiuGai = "确认修改";
Zi.LAN.FEE.CustNameIsNotNull = "费用对象不能为空";
Zi.LAN.FEE.BenWeiBiHuiLvBiXuShiYi = "本位币汇率必须为1";
Zi.LAN.FEE.SubmitRZ = "提交融资";
Zi.LAN.FEE.CancelSubmitRZ = "撤销融资";
Zi.LAN.FEE.ShenRecv = "收费申请";
Zi.LAN.FEE.PrintDebit = "打印账单";
Zi.LAN.FEE.STATEMENTNO = "账单号";
Zi.LAN.FEE.DangQianFeiYongYiShenChenPingZhengShanChu = "当前费用已生成凭证无法删除和修改!";
Zi.LAN.FEE.AddSelectOrderDr = "生成订单应收";
Zi.LAN.FEE.SALECORP = "核算单位";
Zi.LAN.FEE.MeiYouQuanXianShenQingXiuGaiDanQianFeiYong = "没有权限修改当前费用!";
Zi.LAN.FEE.TruckDetail = "派车费用";
Zi.LAN.FEE.RMBHUILVBIXUWEI1 = "币别为RMB,汇率必须为1";
Zi.LAN.FEE.YinYongBaoJia = "查看报价";
Zi.LAN.FEE.CancelAuditBill = "撤销整票提交";
Zi.LAN.FEE.MasterSum = "主票费用合计";
Zi.LAN.FEE.ViewSort = "费用信息排序";
Zi.LAN.FEE.GetCarrierInv = "引入船公司发票";
Zi.LAN.FEE.btnSubDjy = "提交到大简云";
Zi.LAN.FEE.ISDJY = "大简云";
Zi.LAN.FEE.ShenCFCust = '费用拆分';
Zi.LAN.FEE.QueDingChaiFen = '确定拆分';
//#endregion
//Zi.LAN.FEE. = "";
Ext.extend(Shipping.FeeAddEdit, Ext.Window, {
StoreList: null,
ParentPanel: null, //Tab页编辑模式
OpStatus: 'add',
StoreBill: null,
StoreCustType: null,
stroplb:'',
EditRecord: null,
// region: 'center',
initUIComponents: function () {
_thisAddFee = this;
//#region 申请修改和删除界面
this.storeFeeType = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
//this.storeFeeType.add({ "ID": "0", "NAME": "" });
this.storeFeeType.add({ "ID": 1, "NAME": "应收" });
this.storeFeeType.add({ "ID": 2, "NAME": "应付" });
this.comboxFEETYPE = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeType, //id: "STLNAME",
fieldLabel: '收付类型',
forceSelection: true,
name: 'FeeType',
value:1,
valueField: 'ID',
displayField: 'NAME'
});
this.storeFeeStatus = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
});
//this.storeFeeType.add({ "ID": "0", "NAME": "" });
this.storeFeeStatus.add({ "ID":1, "NAME": "录入状态" });
this.storeFeeStatus.add({ "ID":2, "NAME": "提交审核" });
//this.storeFeeStatus.add({ "ID":0, "NAME": "审核通过" });
this.comboxFeeStatus = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeStatus, //id: "STLNAME",
fieldLabel: '费用状态',
forceSelection: true,
name: 'FeeStatus',
value: 1,
valueField: 'ID',
displayField: 'NAME'
});
this.StoreUnit = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeUnit',
proxy: { url: '/MvcShipping/MsChFee/GetCtnUnitList' }
});
//this.StoreUnit.add({ "SUNIT": "P-单票", "UNIT": "单票", "QUANTITY":1 });
//this.StoreUnit.add({ "SUNIT": "J-件", "UNIT": "件", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "Z-重量", "UNIT": "重量", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "T-TEU", "UNIT": "TEU", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "C-CBM", "UNIT": "CBM", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "B-BILL", "UNIT": "BILL", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "V-车", "UNIT": "车", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "T-天", "UNIT": "天", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "G-个", "UNIT": "个", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "S-小时", "UNIT": "小时", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "JF-计费吨", "UNIT": "计费吨", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "ZRX-自然箱", "UNIT": "自然箱", "QUANTITY": 1 });
//this.StoreUnit.add({ "SUNIT": "D-吨", "UNIT": "吨", "QUANTITY": 1 });
this.StoreDateCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeDateCurrList' }
});
this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurr.load({ params: { condition: "" } });
this.StoreFeeFrt = Ext.create('Ext.data.Store', {
fields: ['Frt']
});
this.StoreFeeFrt.add({ "Frt": "PP" });
this.StoreFeeFrt.add({ "Frt": "CC" });
this.comboxFeeFrtModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreFeeFrt,
forceSelection: true,
fieldLabel:'FRT', //'FRT',
name: 'FeeFrt',
valueField: 'Frt',
displayField: 'Frt'
});
this.storeFeeNameRefModify = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' }
});
this.storeFeeNameRefModify.load({ params: { condition: ""} });
this.comboxFeeNameRefModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRefModify,
fieldLabel: '费用名称', //'费用名称',
forceSelection: true,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName',
listeners: {
beforequery: function (e) {
return FilterCombox(e);
},
specialkey: function (field, e) {
//将回车13转义成tab9
if (e.getKey() == e.ENTER) {
e.keyCode = 9;
}
if (e.keyCode == 9) {
//将combo
//alert(field.value);
if (field.value == null) {
_name = this.store.data.keys[0];
this.setValue(_name);
} else {
if (field.value.replace(/\s*/g, "") == "") {
_name = this.store.data.keys[0];
this.setValue(_name);
}
}
}
}
}
});
this.storeCustomerNameRefM = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
// this.storeCustomerNameRefM.load({ params: { condition: ""} });
this.comboxCustomerNameRefModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRefM,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
lazyRender: false,
fieldLabel: '结费对象', //'结费对象',
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.comboxUnitModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreUnit,
fieldLabel: '单位标准', //'单位标准',
name: 'Unit',
valueField: 'UNIT',
displayField: 'SUNIT'
});
this.CheckIsAdvancedpay = new Ext.form.Checkbox({
fieldLabel: '是否垫付', //'是否垫付',
uncheckedValue: '0',
inputValue: '1',
name: 'IsAdvancedpay'
});
this.CheckIsInvoice = new Ext.form.Checkbox({
fieldLabel: '禁开发票', //'是否垫付',
uncheckedValue: '0',
inputValue: '1',
name: 'IsInvoice'
});
this.CheckIsOpen = new Ext.form.Checkbox({
fieldLabel: '机密费用', //'是否垫付',
uncheckedValue: '0',
inputValue: '1',
name: 'IsOpen'
});
this.CheckIsSubmit = new Ext.form.Checkbox({
fieldLabel: '提交审核', //'是否垫付',
uncheckedValue: '0',
inputValue: '1',
name: 'ISDJY'
});
this.CheckIsCtn = new Ext.form.Checkbox({
fieldLabel: '按系统箱型', //'是否垫付',
uncheckedValue: '0',
inputValue: '1',
name: 'ISCTN'
});
this.comboxCurrModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCurr,
fieldLabel: '币别', //'币别',
forceSelection: true,
// labelWidth: 40,
name: 'Currency',
valueField: 'CURR',
displayField: 'CURR',
value:'RMB',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (this.DataLoading == true) return;
var CURR = records[0].data.CURR;
var form = _thisAddFee.NewFeeEdit.getForm();
if (CURR == 'RMB') {
form.findField('ExChangerate').setValue(1);
} else {
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', CURR);
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
var DEFRATE = ffdata.DEFRATE;
form.findField('ExChangerate').setValue(DEFRATE);
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', CURR);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
var DEFRATE = dfdata.DEFRATE;
form.findField('ExChangerate').setValue(DEFRATE);
} else {
form.findField('ExChangerate').setValue(1);
}
}
}
}
}
}
});
this.storeManagerModify = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeManagerModify.load({ params: { condition: ""} });
this.comboxMANAGERModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeManagerModify,
fieldLabel:'责任人', //'费用对象',
forceSelection: true,
name: 'MANAGER',
valueField: 'GID',
displayField: 'CodeAndName'
});
Ext.define('MsCompanySale', {
extend: 'Ext.data.Model',
idProperty: 'GID',
fields: [
{ name: 'GID', type: 'string' }, //GID
{ name: 'CODENAME', type: 'string' }, //CODENAME
{ name: 'NAME', type: 'string' }, //NAME
{ name: 'CodeAndName', type: 'string' }, //NAME
{ name: 'FULLNAME', type: 'string' }
]
});
this.storeSALECORPM = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCompanySale',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
this.storeSALECORPM.load();
this.comboxSALECORPM = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeSALECORPM,
fieldLabel: '核算单位', //'费用对象',
forceSelection: true,
name: 'SALECORP',
valueField: 'NAME',
displayField: 'CodeAndName'
});
this.StoreCustType = Ext.create('Ext.data.Store', {
fields: ['SCUSTTYPE', 'CUSTTYPE', 'CUSTNAME']
});
this.StoreCustType.add({ "SCUSTTYPE": "WTDW-委托单位", "CUSTTYPE": "委托单位", "CUSTNAME": "CUSTOMERNAME" });
this.StoreCustType.add({ "SCUSTTYPE": "CGS-船公司", "CUSTTYPE": "船公司", "CUSTNAME": "CARRIER" });
this.StoreCustType.add({ "SCUSTTYPE": "DCDL-订舱代理", "CUSTTYPE": "订舱代理", "CUSTNAME": "FORWARDER" });
this.StoreCustType.add({ "SCUSTTYPE": "BGH-报关行", "CUSTTYPE": "报关行", "CUSTNAME": "CUSTOMSER" });
this.StoreCustType.add({ "SCUSTTYPE": "CD-车队", "CUSTTYPE": "车队", "CUSTNAME": "TRUCKER" });
this.StoreCustType.add({ "SCUSTTYPE": "FHR-发货人", "CUSTTYPE": "发货人", "CUSTNAME": "SHIPPERID" });
this.StoreCustType.add({ "SCUSTTYPE": "SHR-收货人", "CUSTTYPE": "收货人", "CUSTNAME": "CONSIGNEEID" });
this.StoreCustType.add({ "SCUSTTYPE": "TZR-通知人", "CUSTTYPE": "通知人", "CUSTNAME": "NOTIFYPARTYID" });
this.StoreCustType.add({ "SCUSTTYPE": "DL-代理", "CUSTTYPE": "代理", "CUSTNAME": "AGENTID" });
this.StoreCustType.add({ "SCUSTTYPE": "CZ-场站", "CUSTTYPE": "场站", "CUSTNAME": "YARD" });
this.StoreCustType.add({ "SCUSTTYPE": "CDD-船代", "CUSTTYPE": "船代", "CUSTNAME": "SHIPAGENCY" });
this.StoreCustType.add({ "SCUSTTYPE": "BXGS-保险公司", "CUSTTYPE": "保险公司", "CUSTNAME": "" });
this.StoreCustType.add({ "SCUSTTYPE": "QT-其他", "CUSTTYPE": "其他", "CUSTNAME": "" });
this.StoreCustType.add({ "SCUSTTYPE": "", "CUSTTYPE": "", "CUSTNAME": "" });
this.comboxCustType = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCustType,
fieldLabel: '客户类别', //'费用对象',
// forceSelection: true,
name: 'CustomerType',
valueField: 'CUSTNAME',
displayField: 'SCUSTTYPE'
});
this.DataLoading = false;
this.NewFeeEdit = Ext.widget('form', {
frame: true,
region: 'center',
trackResetOnLoad: true,
// title: Zi.LAN.FEE.NewFeeEdit, //'费用新值',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 80,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, this.comboxFEETYPE, this.comboxFeeStatus,this.comboxFeeNameRefModify, this.comboxCustomerNameRefModify]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxUnitModify,{
fieldLabel: '不含税单价', //'不含税单价',
xtype: 'numberfield',
value: 0,
name: 'UnitPrice',
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisAddFee.NewFeeEdit.getForm();
var unitPrice = newValue;
var FeeName = form.findField('FeeName').getValue();
var quantity = form.findField('Quantity').getValue();
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (taxrate != null) {
var taxrateb = Add(1, Div(taxrate, 100, 4), 4);
var TaxUnitPrice = (parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var notaxamount = (parseFloat(unitPrice).mul(quantity)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
this.DataLoading = false;
}
}
}, {
fieldLabel: '税率', //'税率',
xtype: 'numberfield',
name: 'TaxRate',
value:0,
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisAddFee.NewFeeEdit.getForm();
var unitPrice = form.findField('UnitPrice').getValue();
var FeeName = form.findField('FeeName').getValue();
var quantity = form.findField('Quantity').getValue();
var amount = form.findField('Amount').getValue();
var taxrate = newValue;
var taxrateb = Add(1, Div(taxrate, 100, 4), 4);//parseFloat(1 + parseFloat(taxrate.mul(0.01)));
this.DataLoading = true;
if (amount > 0) {
var notaxamount = Div(amount, taxrateb);
form.findField('NoTaxAmount').setValue(notaxamount);
} else {
var notaxamount = Div(Math.abs(amount), taxrateb);
notaxamount = -notaxamount;
form.findField('NoTaxAmount').setValue(notaxamount);
}
var tax = Add(amount, -notaxamount); //parseFloat(notaxamount).mul(taxrate);
form.findField('Tax').setValue(tax);
if (quantity != null && quantity != 0) {
var unitPrice = Div(notaxamount, quantity, 4); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
var TaxUnitPrice = Div(amount, quantity, 4);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
this.DataLoading = false;
}
}
}, {
fieldLabel: '含税单价', //'含税单价',
xtype: 'numberfield',
name: 'TaxUnitPrice',
value: 0,
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisAddFee.NewFeeEdit.getForm();
var quantity = form.findField('Quantity').getValue();
var TaxUnitPrice = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (TaxUnitPrice != 0) {
var taxrateb = Add(1, Div(taxrate, 100, 4), 4);
var unitPrice = (parseFloat(TaxUnitPrice).div(parseFloat(taxrateb))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
}
if (quantity != null) {
var amount = (parseFloat(TaxUnitPrice).mul(quantity)).toFixed(2);
form.findField('Amount').setValue(amount);
var notaxamount = (parseFloat(amount).div(taxrateb)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
var tax = Add(amount, -notaxamount); //parseFloat(notaxamount).mul(taxrate);
form.findField('Tax').setValue(tax);
}
this.DataLoading = false;
}
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '计费数量', //'计费数量',
xtype: 'numberfield',
name: 'Quantity',
value: 1,
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisAddFee.NewFeeEdit.getForm();
var TaxUnitPrice = form.findField('TaxUnitPrice').getValue();
var quantity = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
var amount = Mul(TaxUnitPrice, quantity); //(parseFloat(unitPrice).mul(quantity)).toFixed(2);
form.findField('Amount').setValue(amount);
if (amount > 0) {
var notaxamount = Div(amount, taxrateb);
form.findField('NoTaxAmount').setValue(notaxamount);
} else {
var notaxamount = Div(Math.abs(amount), taxrateb);
notaxamount = -notaxamount;
form.findField('NoTaxAmount').setValue(notaxamount);
}
var tax = Add(amount, -notaxamount); //parseFloat(notaxamount).mul(taxrate);
form.findField('Tax').setValue(tax);
if (taxrate != null) {
var unitPrice = Div(notaxamount, quantity, 4); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
}
this.DataLoading = false;
}
}
}, {
fieldLabel: '不含税金额', //'不含税金额',
xtype: 'numberfield',
value: 0,
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;
},
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisAddFee.NewFeeEdit.getForm();
var notaxamount = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
var quantity = form.findField('Quantity').getValue();
if (quantity != null && quantity != 0) {
var unitPrice = Div(notaxamount, quantity); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
//var TaxUnitPrice = Div(amount, quantity);
//form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
if (taxrate != null) {
var tax = Div(Mul(notaxamount, taxrate), 100);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
if (quantity != null && quantity != 0) {
var TaxUnitPrice = Div(amount, quantity);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
}
this.DataLoading = false;
}
}
}, {
fieldLabel: '含税金额', //'含税金额',
xtype: 'numberfield',
value: 0,
name: 'Amount',
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;
},
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisAddFee.NewFeeEdit.getForm();
var amount = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (taxrate != null) {
var taxrateb = Add(1, Div(taxrate, 100, 4), 4);
var notaxamount = Div(amount, taxrateb); //(parseFloat(amount).div(taxrateb)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
var quantity = form.findField('Quantity').getValue();
if (quantity != null && quantity != 0) {
var unitPrice = Div(notaxamount, quantity); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
var TaxUnitPrice = Div(amount, quantity);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var tax = Add(amount, -notaxamount); //parseFloat(notaxamount).mul(taxrate);
form.findField('Tax').setValue(tax);
}
this.DataLoading = false;
}
}
}, this.comboxCurrModify
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: '汇率', //'汇率',
xtype: 'numberfield',
//labelWidth: 40,
decimalPrecision: 6,
value: 1,
name: 'ExChangerate',
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
}
}
}, {
fieldLabel: '税额', //'汇率',
xtype: 'numberfield',
//labelWidth: 40,
decimalPrecision: 6,
value: 0,
name: 'Tax'
}, {
fieldLabel: '财务税率', //'财务税率',
xtype: 'numberfield',
value: 0,
name: 'AccTaxRate'
},this.CheckIsOpen
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.CheckIsCtn,this.CheckIsInvoice, this.comboxMANAGERModify, this.CheckIsAdvancedpay,this.comboxSALECORPM]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCustType,{
fieldLabel: '备注', //'备注',
flex: 3,
name: 'Remark'
}]
}
]//end items(fieldset 1)
}//end fieldset 1
],
buttons: [{
text: '确定添加',
id: 'btnEnter',
handler: function (button, event) {
_thisAddFee.execSql();
},
scope: this
}, {
text:'取消',
handler: function (button, event) {
var win = this.up("window");
win.close();
}
}]//end root items
});
//#endregion
//#region 布局
Ext.apply(this, {
height: 250,
closable: true,
draggable: true,
title: '新增费用',
defaultButton: 'btnEnter',
resizable: false,
items: [this.NewFeeEdit],
layout: "border",
width: 800,
xtype: "window",
id: "DsAddFeeWin"
});
//#endregion
}, execSql: function () {
var form = _thisAddFee.NewFeeEdit.getForm();
var FeeName = form.findField('FeeName').getValue();
if (FeeName == '' || FeeName == null || FeeName == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //费用名称不能为空!'
return;
};
var CustomerName = form.findField('CustomerName').getValue();
var CustomerType = form.findField('CustomerType').getValue();
if ((CustomerName == '' || CustomerName == null || CustomerName == undefined) && (CustomerType == '' || CustomerType == null || CustomerType == undefined)) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg:'结算对象或客户类别不能同时为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var TaxRate = form.findField('TaxRate').getValue();
if (TaxRate == null || TaxRate == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.ShuiLvBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//'税率不能为空!'
return;
};
var Currency = form.findField('Currency').getValue();
if (Currency == '' || Currency == null || Currency == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = form.findField('ExChangerate').getValue();
if (ExChangerate == '' || ExChangerate == null || ExChangerate == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//汇率不能为空!
return;
};
if (Currency == this.LOCALCURR && ExChangerate != 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.RMBHUILVBIXUWEI1, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var Amount = form.findField('Amount').getValue();;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var bodyAddDatas = [];
for (i = 0; i < this.StoreList.getCount(); i += 1) {
var memberyf = this.StoreList.getAt(i);
bodyAddDatas.push(memberyf);
}
var data = this.NewFeeEdit.getForm().getValues();
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsChFee/SavePiLiang',
params: {
bslist: jsonbodyAddDatas,
optype: _thisAddFee.stroplb,
chfeebody: Ext.JSON.encode(data)
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title:'提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title:'提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
var win = Ext.getCmp("DsAddFeeWin");
win.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
});