📄 js.jsp
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.baosight.project.db.result.*"%>
<%@ page import="com.baosight.project.vo.CommonVo"%>
<%@ page import="com.baosight.project.util.*"%>
<script language='javascript'>
//查询按钮JS
function searchJs() {
document.forms[0].TYPE.value = '1';
//屏蔽所有按钮,只有在提交按钮中使用,弹出窗口的按钮不要使用屏蔽功能
disAll();
searchJsValue();
}
//到按钮JS
function goJs() {
if(forwardCheck( "OPERATETYPE","Q","查询" )==false)return false;
document.forms[0].TYPE.value = '2';
pageSubmit();
}
//新增
function insertJs() {
if(forwardCheck( "OPERATETYPE","Q","查询")==false)return false;
if(document.forms[0].elements["FCWFP04__BILL_STATUS"].value!="0"){
alert("报支状态不为'0',不能进行新增");
return false;
}
//alert(document.forms[0].elements["FCWFP04__BILL_STATUS"].value);
//校验抵库单号
if(document.forms[0].elements["FCWFP04_FY_OP__ARRIVE_ID"].value==""){
alert("抵库单号不能为空");
return false;
}
//校验提单号
if(document.forms[0].elements["FCWFP04_FY_OP__TD_NUM"].value==""){
alert("提单号不能为空");
return false;
}
if(document.forms[0].elements["FCWFP04_FY_OP__FEE_PURPOSE"].value==""){
alert("款项为空,不能进行新增");
return false;
}
//明细金额是小数后2位实数
if(validateForm(document.forms[0])==false)return false;
document.forms[0].TYPE.value = '3';
pageSubmit();
}
//修改
/*function updateJs() {
if(forwardCheck( "OPERATETYPE","Q","查询")==false)return false;
if(document.forms[0].elements["FCWFP04__BILL_STATUS"].value!="0"){
alert("报支状态不为'0',不能进行修改");
return false;
}
//明细金额是小数后4位实数
if(validateForm(document.forms[0])==false)return false;
//校验抵库单号
if(document.forms[0].elements["FCWFP04_OP__ARRIVE_ID"].value==""){
alert("抵库单号不能为空");
return false;
}
//校验提单号
if(document.forms[0].elements["FCWFP04_OP__TD_NUM"].value==""){
alert("提单号不能为空");
return false;
}
if(document.forms[0].elements["FCWFP04_OP__INVOICE_LIST_ID"].value==""){
alert("明细序号为空,不能进行修改");
return false;
}
if(document.forms[0].elements["FCWFP04_OP__CATEGORY_DETL"].value==""){
alert("款项为空,不能进行修改");
return false;
}
if(window.confirm("确定修改吗?")==false)return false;
document.forms[0].TYPE.value = '4';
pageSubmit();
}*/
//删除
function deleteJs() {
if(forwardCheck( "OPERATETYPE","Q","查询")==false)return false;
if(document.forms[0].elements["FCWFP04__BILL_STATUS"].value!="0"){
alert("报支状态不为'0',不能进行删除");
return false;
}
if(document.forms[0].elements["FCWFP04_FY_OP__FEE_PURPOSE"].value==""){
alert("请选择一条记录再进行删除");
return false;
}
if(window.confirm("确定删除吗?")==false)return false;
document.forms[0].TYPE.value = '5';
pageSubmit();
}
//发票卡片链接
function detailJs() {
var val = document.forms[0].elements["FCWFP04__INVOICE_ID"].value;
location.href = "PCWFP02?WINDOW=open&PCWFP02__INVOICE_ID_S=" + val + "&TYPE=1&PAGE=1";
}
//计算明细税额和明细总额
function Count_tax_JS() {
//税率
var tax_rate=document.forms[0].elements["FCWFP04__TAX_RATE"].value*1;
//明细金额
var list_amt=document.forms[0].elements["FCWFP04_FY_OP__LIST_AMT"].value*1;
var vINVOICE_AMT = document.forms[0].elements["FCWFP04__INVOICE_AMT"].value;//发票金额
var vTAX_AMT = document.forms[0].elements["FCWFP04__TAX_AMT"].value;//发票税额
//明细税额默认为发票金额/明细金额*发票税额
var tax_amt=Math.round(list_amt/vINVOICE_AMT*vTAX_AMT*100)/100;
document.forms[0].elements["FCWFP04_FY_OP__TAX_AMT"].value = tax_amt;
//赋值税额
//document.forms[0].elements["FCWFP04_FY_OP__TAX_AMT"].value=tax_amt;
//赋值明细总额:明细金额+明细税额
document.forms[0].elements["FCWFP04_FY_OP__LIST_AMT_TOT"].value=Math.round((list_amt+tax_amt)*100)/100;
}
//当输入明细税额时自动计算明细总额
function ListAmtJs(){
//明细金额
var list_amt = document.forms[0].elements["FCWFP04_FY_OP__LIST_AMT"].value*1;
var tax_amt = document.forms[0].elements["FCWFP04_FY_OP__TAX_AMT"].value*1;
document.forms[0].elements["FCWFP04_FY_OP__LIST_AMT_TOT"].value=Math.round((list_amt+tax_amt)*100)/100;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -