<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
@_add_js_css_@
|
<script type="text/javascript">
|
var spellPath = "/<%=session.getAttribute(SessionKey.DATA_BASE_ID)%>/<%=session.getAttribute(SessionKey.VERSION_ID)%>/<%=session.getAttribute(SessionKey.SYSTEM_LANGUAGE)%>/";
|
var Custom_Doccode="@CustomDoccode@";
|
var formId=<%=formId%>;
|
panelFormId=formId;
|
var formType=<%=formType%>;
|
var user="<%=userCode%>";
|
var isSuperUser="<%=isSuperUser %>";
|
var cccode='<%=session.getAttribute(SessionKey.CCCODE)%>';
|
//确认前状态
|
var predocstatus="[?predocstatus]";
|
var check=0;//来判断是否保存与确定
|
var grid;//全局
|
var plane;
|
var planesj;
|
var btnId=null;//决定按钮检查
|
//通过,驳回,时代按钮所需全局变量
|
var panelHasSave=false;//面板是否保存
|
//判断当前页面是不是新单
|
var isNew='<%=isNew%>';
|
|
function commitIs(check,flag){
|
//flag标记数据范围检查已通过
|
showLoading();
|
grid = mygrid;
|
var doc = getDoc('doccode', ".value");
|
var pm = panMain[panIndex];
|
grid.setPanelAction(((isNew == 1 && doc == "") ? "add" : "update"), pm.tableIs, doc);
|
plane = pm.getPanMap();
|
plane._YCAUDIT_ = shenji(panIndex, plane, doc); //审计处理
|
grid.postData(plane, check);
|
// 操作时间:2014-3-26 15:52:04 ——辛煜波
|
if (check == 3) {
|
grid.tran(btnId == null ? "" : btnId, function (showIs, check) {
|
parent.errShow.frame = parent.frames[inThisFrame];
|
parent.errShow.show_divErro(showIs, check);
|
btnId = null;
|
}, 3, flag);
|
tranOk = false;
|
grid.aflg = 0;
|
} else {
|
grid.save(btnId == null ? "" : btnId, function (showIs, check) {
|
parent.errShow.frame = parent.frames[inThisFrame];
|
parent.errShow.show_divErro(showIs, check);
|
btnId=null;
|
}, check, flag);
|
}
|
}
|
|
function save(o, c) {
|
//2012-10-12 lqc
|
var flag = checkSession();//session失效后弹出登录框,flag为true时表示已经失效
|
if (flag) {
|
return;
|
}
|
if (!c || c == 0) {
|
if (o == 5) {//表示单据类型直接点保存,是为区分有在线支付功能时,确认也是执行保存操作
|
if ("undefined" != typeof onlinePay && onlinePay != null) {
|
onlinePay.pay = 0;
|
onlinePay.refund = 0;
|
onlinePay.isOnlinePay = false;
|
}
|
o = 2;//转换为2
|
}
|
save$(o);
|
} else {
|
centerPopup(formId, 2, function () {
|
save$(o);
|
}, '');
|
}
|
}
|
|
function save$(op) {
|
showLoading();
|
if (panMain[panIndex].checkUp()) {
|
check = op;
|
commitPan(check);
|
} else {
|
closeLoading();
|
}
|
}
|
function commitPan(check){//确定是凭证状态检查
|
if(check==3){
|
var url = '/panState.do?formid='+formId+'&docdate='+getDoc("docdate",".value")+'&periodtype=#periodtype#&companyId='+getDoc("#comanyId#",".value");
|
url=encodeURI(url);url=encodeURI(url);//必须两次
|
$.post(url,'',showPanMessge,'text');
|
}else{
|
commitIs(check);
|
}
|
}
|
var notOk='';//判断是否检查凭证定义的正确性,''为正确
|
function showPanMessge(date){
|
date=date.substring(0,date.length-1);
|
var mass=date.split("#");
|
var in_fo=null;notOk='';
|
for(i=0;i<mass.length;i++){
|
if(mass[i]!=""&&mass[i]!=null){
|
in_fo=mass[i].split(";pb;");
|
if(in_fo.length>1&&in_fo[1]=="0"){
|
alert(in_fo[0]);
|
// if(confirm(in_fo[0])){
|
notOk='not';
|
// }else{
|
// notOk='not';
|
// }
|
}else{
|
if(confirm(in_fo[0])){
|
notOk=='';
|
}else{
|
notOk='not';
|
break;
|
}
|
}
|
}
|
}
|
|
if(notOk==''){
|
commitIs(check);
|
}else{
|
closeLoading();
|
}
|
}
|
function clearDoc(){//复单
|
location.href ="?isNew=1&cp=1&doccode="+getDoc('doccode','.value');
|
panMain[panIndex].noCopy();//取消不复制字段
|
}
|
function delDoc(){ //删单
|
if(confirm("是否真的删除此单据?")) {
|
showLoading();
|
$.post("/panDelete.do?docstatus="+getDoc('docstatus','.value'),{"formid":formId,"doccode":getDoc('doccode','.value')},getMess,'text');
|
}
|
}
|
function disDoc(){ //作废单
|
if(confirm("是否真的作废此单据?")) {
|
showLoading();
|
$.post("/panDiscard.do?docstatus="+getDoc('docstatus','.value'),{"formid":formId,"doccode":getDoc('doccode','.value')},getMess,'text');
|
}
|
}
|
function getMess(data){
|
closeLoading();
|
var json=JSON.parse(data);
|
if(json.state==0){
|
alert('已经处理!');
|
if(opener!=null && typeof opener !="undefined" && opener.window!=null){
|
opener.window.location.reload();//刷新父窗口
|
}
|
closeme();//关闭当前窗口
|
}else{
|
alert(json.msg);//直接弹出错误
|
}
|
}
|
if(navigator.userAgent.match(/iPad|iPhone|Android/i)){
|
try{
|
var myScroll = new IScroll('#scrollbody', {
|
mouseWheel: true,
|
scrollbars: true,
|
zoom: true,
|
scrollX: true,
|
scrollY: true,
|
wheelAction: 'zoom'
|
});
|
}catch(e){}
|
}
|
</script>
|