xinyb
2023-01-03 904c9dd32232915b7a3a6885fac002e0959ff4a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
    String isShowOnlineMsg="[?isShowOnlineMsg]";
    String isShowProcessTracking="[?isShowProcessTracking]";
%>
<link rel="stylesheet" type="text/css" href="/style/commons.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/commons.css")%>"> 
<link rel="stylesheet" type="text/css" href="/style/icon.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/icon.css")%>">
<link rel="stylesheet" type="text/css" href="/style/default/easyui.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/default/easyui.css")%>">
<link rel="stylesheet"  type="text/css" href="/layui/css/layui.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/layui/css/layui.css")%>">
<script src="/layui/layui.all.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/layui/layui.all.js")%>" type="text/javascript"></script>
<script type="text/javascript" src="/shopping/view/javascript/gotop/js/jquery-1.10.2.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/shopping/view/javascript/gotop/js/jquery-1.10.2.min.js")%>"></script>
<script type="text/javascript" src="/js/jquery-migrate-1.2.1.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/jquery-migrate-1.2.1.js")%>"></script>
<script type="text/javascript" src="/js/layer/layer.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/layer/layer.js")%>"></script>
<script type="text/javascript" src="/js/general/jquery.easyui.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/general/jquery.easyui.min.js")%>"></script>
<script type="text/javascript" src="/js/general/easyui/jquery.easyui.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/general/easyui/jquery.easyui.min.js")%>"></script>
<script type="text/javascript" src="/js/general/jquery.easyui.dialog.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/general/jquery.easyui.dialog.js")%>"></script>
<script type="text/javascript" src="/js/locale/easyui-lang-zh_CN.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/locale/easyui-lang-zh_CN.js")%>"></script>
<script type="text/javascript" src="/js/docControl/control.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/docControl/control.js")%>"></script>
<script type="text/javascript" src="/js/index/funcLink.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/index/funcLink.js")%>"></script>
<script type="text/javascript" src="/js/index/jQueryRotate.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/index/jQueryRotate.js")%>"></script>
<script type="text/javascript" src="/js/index/rotate.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/index/rotate.js")%>"></script>
<script type="text/javascript" src="/js/panel.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/panel.js")%>"></script>
<script type="text/javascript" src="/Grid/GridE.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/Grid/GridE.js")%>"></script>
<script type="text/javascript" src="/js/hotkey.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/hotkey.js")%>" ></script>
<script type="text/javascript" src="/js/iscroll5.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/iscroll5.js")%>" ></script>
<%--<link rel="stylesheet" type="text/css" href="/js/bootstrap-upload/css/bootstrap.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/bootstrap-upload/css/bootstrap.css")%>">  --%>
<%--<script type="text/javascript" src="/shopping/view/javascript/bootstrap/js/bootstrap.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/shopping/view/javascript/bootstrap/js/bootstrap.min.js")%>"></script>--%>
<link rel="stylesheet" type="text/css"
      href="/js/select2/dist/css/select2.min.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/select2/dist/css/select2.min.css")%>">
<script type="text/javascript"
        src="/js/select2/dist/js/pinyin.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/select2/dist/js/pinyin.js")%>"></script>
<script type="text/javascript"
        src="/js/select2/dist/js/select2.full.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/select2/dist/js/select2.full.js")%>"></script>
<script type="text/javascript"
        src="/js/select2/dist/js/i18n/zh-CN.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/select2/dist/js/i18n/zh-CN.js")%>"></script>
@_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 formId=<%=formId%>;
panelFormId=formId;
var formType=<%=formType%>;
var user="<%=userCode%>";
var isSuperUser="<%=isSuperUser %>";
var cccode='<%=session.getAttribute(SessionKey.CCCODE)%>';
//确认前状态
var predocstatus="[?predocstatus]";
var Custom_Doccode="@CustomDoccode@";
var btnId=null;//决定按钮检查
var check=0;//来判断是否保存与确定
var grid;//全局
var plane;
//通过,驳回,时代按钮所需全局变量
var panelHasSave=false;//面板是否保存
var btnSave=false;//是否这两个按钮保存
var isNew='<%=isNew %>';
function commitIs(check,flag){
    if(top.approvedDoc){
        top.approvedDoc.getCurTabsIndex();
    }
    //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;
    }//end
    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,'',function(date){showPanMessge(date);},'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;
                }
//                  notOk='not';  
//                 alert(in_fo[0]);//弹出信息    
             }
        }  
    }
    if(notOk==''){
           commitIs(check);
    }else{
          closeLoading();
    }
}
function clearDoc(){//复单
    isNew="1";
    panMain[panIndex].isChange=1;
//     setDoc('doccode',".value=''");//单号
//     setDoc('docstatus',".value='#predocstatus#'");  //状态
    var staname="";
    if(typeof(stas)!="undefined"){staname=stas['#predocstatus#'];}else{staname='起草';}
    setDocStatuInfo(staname);//
    setDoc('docstatusname',".value='"+staname+"'");//状态描述
    isAddLong=false;//决定有按钮控件是否还加上一定长度,使整体格式整齐
    location.href = document.URL+"&cp=1&isNew=1&doccode="+getDoc('doccode','.value');
    panMain[panIndex].noCopy();//取消不复制字段
//     panMain[panIndex].loadSet(#predocstatus#);//加载设置
    cp=true;     
    hiddenToolButton();     
//     mygrid.newRecord()
}
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'),"formtype":formType},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{
        //by by danaus 2022/9/13 17:52
        if(json.msg.indexOf("@p@")) {
            var msg=json.msg.split("@p@");
            alert(msg[0]);
            redirect(msg[1]);
        }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>
<style type="text/css">
<!--
#scroller{
    position:absolute; 
    z-index:1; 
 overflow:auto;/* winphone8º̡ndroid4+ */
-webkit-overflow-scrolling: touch; /* ios5+ */
    width:100%;
    height:100%; 
}
body{margin: 0px;padding:0px;}
-->
</style>