|
@@ -0,0 +1,759 @@
|
|
|
+<!-- include '../admin/header' -->
|
|
|
+
|
|
|
+<link rel=stylesheet
|
|
|
+ href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css">
|
|
|
+<script type="text/javascript"
|
|
|
+ src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
|
|
|
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
|
|
|
+<script src="<?= receipt ?>"></script>
|
|
|
+
|
|
|
+<body>
|
|
|
+ <div class="mainLayout">
|
|
|
+ <div class="mainMenu">
|
|
|
+ <div class="menuItem">
|
|
|
+ <a href="/" class="mLogo">CLD</a>
|
|
|
+ <ul>
|
|
|
+ <!-- include '../admin/menuReceipt' -->
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="warpContent">
|
|
|
+ <div class="subMenu fL">
|
|
|
+ <div class="menuItem">
|
|
|
+ <!-- include '../admin/receipt_menu' -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="adminContent autoHeight">
|
|
|
+ <div class="borad-news">
|
|
|
+ <legend>
|
|
|
+ <div class="fR"></div>
|
|
|
+ 申请报销单
|
|
|
+ </legend>
|
|
|
+ <div class="saeaList">
|
|
|
+ <div class="entry receipt-list">
|
|
|
+ <div class="seTable">
|
|
|
+ <input type="hidden" id="agencyR" value="0" /> <input
|
|
|
+ type="hidden" id="otherR" value="0" />
|
|
|
+ <form action="/addReceipt" name="recepitAdd" method="post">
|
|
|
+
|
|
|
+ <input type="hidden" name="iid" id="iid" value="" />
|
|
|
+<input type="hidden" name="itinerary" id="itinerary" value="" />
|
|
|
+
|
|
|
+ <table class="table table-bordered table-condensed table-hover">
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th colspan="2" class="taC">行程详细</th>
|
|
|
+ </tr>
|
|
|
+ <tbody itinerary >
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </tbody>
|
|
|
+
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th colspan="2" class="taC"><a href="#route-add"
|
|
|
+ class="button" addStroke data-toggle="modal">设置行程费用单</a></th>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th colspan="2" class="taC">差旅相关费用</th>
|
|
|
+ </tr>
|
|
|
+ <!-- loop acItem -->
|
|
|
+ <!-- if {{acItem' value.category}} =="差旅相关费用" -->
|
|
|
+ <tr>
|
|
|
+ <th>{{acItem' value.name}}</th>
|
|
|
+ <td width="200" class="taR">¥<span travelPrice_{{acItem' value.aid}} >0</span><input type="hidden"
|
|
|
+ id="travel_{{acItem' value.aid}}" name="travel[]" value="0"
|
|
|
+ placeholder="输入{{acItem' value.name}}" pattern="[0-9]"
|
|
|
+ step="0.01" min="0" class="span2"></td>
|
|
|
+ </tr>
|
|
|
+ <!-- endif -->
|
|
|
+ <!-- endloop -->
|
|
|
+ <tr>
|
|
|
+ <th class="taR">合计</th>
|
|
|
+ <td class="colGreen taR" id="travelResult">¥0.00</td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <tr class="warning">
|
|
|
+ <td class="taR"><b>本次报销费用合计</b></td>
|
|
|
+ <td class="colGreed taR"><b style="font-size: 24px"
|
|
|
+ id="RS">¥0.00</b></td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th colspan="2" class="taC">报销单审批</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>选择审批组</th>
|
|
|
+ <td class="taR"><select name="verify">
|
|
|
+ <option value="">请选择审批组</option>
|
|
|
+ <!-- loop veList -->
|
|
|
+ <option value="{{veList' value.vid}}">{{veList' value.description}}( {{veList' value.staff}} )</option>
|
|
|
+ <!-- endloop -->
|
|
|
+ </select></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th colspan="2" class="taC">产生费用所在办事处</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>选择办事处</th>
|
|
|
+ <td class="taR"><select name="cid" class="span2">
|
|
|
+ <!-- loop category -->
|
|
|
+ <option<!-- if {{category' value.cid}} == {{staff.0.cid}} -->
|
|
|
+ selected
|
|
|
+ <!-- endif --> value="{{category' value.cid}}"
|
|
|
+ >{{category' value.title}}
|
|
|
+ </option>
|
|
|
+ <!-- endloop -->
|
|
|
+ </select></td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th colspan="2" class="taC">收款信息</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>收款人户名</th>
|
|
|
+ <td><input type="text" name="remittanceName"
|
|
|
+ id="remittanceName" value="{{staff.0.remittanceName}}"
|
|
|
+ placeholder="请输入收款人户名"></td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th>收款银行</th>
|
|
|
+ <td><select node-rbt name="remittanceBankType">
|
|
|
+ <option value="0">广发银行</option>
|
|
|
+ <option value="1">其他</option>
|
|
|
+ </select></td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th>收款开户银行名称</th>
|
|
|
+ <td><input type="text" name="bankName" id="bankName"
|
|
|
+ value="{{staff.0.bankName}}" placeholder="请输入收款开户银行名称">
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>收款账号</th>
|
|
|
+ <td><input type="text" placeholder="请输入收款账号"
|
|
|
+ id="bankNumber" name="bankNumber"
|
|
|
+ value="{{staff.0.bankNumber}}"></td>
|
|
|
+ </tr>
|
|
|
+ <tr node-cn style="display: none">
|
|
|
+ <th class="tipFather">联行号 <span class="tipGray">?</span>
|
|
|
+ <div class="tipContent tipConactive">
|
|
|
+ <p>1.如不是公司广发,务必填上银行联行号</p>
|
|
|
+ <p>2.如不清楚银行联行号请咨询报销查款专用 QQ:2870766094</p>
|
|
|
+ </div></th>
|
|
|
+ <td><input type="text" placeholder="请输入联行号"
|
|
|
+ id="coupletNumber" name="coupletNumber"
|
|
|
+ value="{{staff.0.coupletNumber}}"></td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th colspan="2" class="taC">报销说明</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th colspan="2"><textarea name="explanation"
|
|
|
+ id="explanation" required="" rows="8"
|
|
|
+ style="width: 99%; resize: vertical"
|
|
|
+ placeholder="市内交通费、邮寄费、公关费、办公费等费用说明,请详细填写在这。"></textarea></th>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <th colspan="2" class="taC">附件</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="2">
|
|
|
+ <!--已上传文件-->
|
|
|
+ <table class="table">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th><input enclosurFile type="file"
|
|
|
+ accept="image/png,image/gif,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
|
|
+ ,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
|
|
|
+ name="file" /> <input type="hidden" id="enclosurName"
|
|
|
+ name="enclosurName" value=""></th>
|
|
|
+ <th colspan="2"><span class="fieldset flash"
|
|
|
+ id="fsUploadProgress"></span> <span id="divStatus">0
|
|
|
+ 个文件已上传</span></th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>文件名</th>
|
|
|
+ <th>大小</th>
|
|
|
+ <th>操作</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="KT">
|
|
|
+ <!--已上传文件-->
|
|
|
+
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </table>
|
|
|
+ <table class="table">
|
|
|
+ <tr>
|
|
|
+ <td><input type="submit" value="生成报销单 >>" class="button" /></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <div class="seCensor receipt-censor">
|
|
|
+ <div class="title">报销单填写说明</div>
|
|
|
+ <div class="detail">
|
|
|
+ <p>1 办事处水电费标准100元,标准内实报;</p>
|
|
|
+ <p>
|
|
|
+ 2 <b>产生费用所在办事处</b> 默认使用您所在的第一个办事处;
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ 3 邮寄费、公关费、办公费等详细说明请填写到 <b>报销说明</b>。
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--弹出 添加行程 -->
|
|
|
+ <div class="modal hide fade" id="route-add">
|
|
|
+ <div class="modal-dialog">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h3>设置行程费用单</h3>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body saeaList">
|
|
|
+ <input type="hidden" name="ediStrokeId" >
|
|
|
+ <table class="table table-bordered table-condensed">
|
|
|
+ <tr>
|
|
|
+ <th class="taC" colspan="4">出发-到达</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>出发地</th>
|
|
|
+ <td>
|
|
|
+ <select departureProvince >
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select departureCity>
|
|
|
+
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <th>到达地</th>
|
|
|
+ <td>
|
|
|
+ <select arrivalsProvince ></select>
|
|
|
+ <select arrivalsCity></select>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>出发日期</th>
|
|
|
+ <td><input type="date" departureDate ></td>
|
|
|
+ <th>到达日期</th>
|
|
|
+ <td><input type="date" arrivalsDate ></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="4" class="colGray">如果是停留,出发地和到达地填写住宿地。(如:广东省珠海市-广东省珠海市)</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <select feeTravelItem >
|
|
|
+
|
|
|
+ <!-- loop acItem -->
|
|
|
+ <!-- if {{acItem' value.category}} =="差旅相关费用" -->
|
|
|
+ <option value='{{acItem' value.aid}}'>{{acItem' value.name}}</option>
|
|
|
+
|
|
|
+ <!-- endif -->
|
|
|
+ <!-- endloop -->
|
|
|
+
|
|
|
+
|
|
|
+ </select><a href="#" feeTravelItem class="button">添加费用</a>
|
|
|
+ <table class="table table-bordered table-condensed">
|
|
|
+ <tr>
|
|
|
+ <th colspan="4" class="taC">费用详情</th>
|
|
|
+ </tr>
|
|
|
+ <tbody feeTravelItem >
|
|
|
+ </tbody>
|
|
|
+
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <a href="#" addItineraryBut class="button" data-dismiss="modal" aria-hidden="true">确认</a>
|
|
|
+ <a href="#" ediItineraryBut style="display:none" class="button" data-dismiss="modal" aria-hidden="true">确认</a>
|
|
|
+ <a href="#" class="button btn-gray" data-dismiss="modal"
|
|
|
+ aria-hidden="true">关闭</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--结束 弹出 添加行程 -->
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+ autoFlashHeight();
|
|
|
+ </script>
|
|
|
+ <script>
|
|
|
+
|
|
|
+ function fnTotTravelPrice(){
|
|
|
+ var itineraryStr=sessionStorage.getItem("itineraryList");
|
|
|
+ var sessionItinerary= JSON.parse(itineraryStr);
|
|
|
+ $("#itinerary").val(itineraryStr);
|
|
|
+ var priceList=[];
|
|
|
+ for(let i=0;i<sessionItinerary.length;i++){
|
|
|
+ let feeTraveItem=sessionItinerary[i].feeTraveItem;
|
|
|
+ for(let k=0;k<feeTraveItem.length;k++){
|
|
|
+ if(typeof priceList[feeTraveItem[k].id]==='undefined'){
|
|
|
+ priceList[feeTraveItem[k].id]=0;
|
|
|
+ }
|
|
|
+ priceList[feeTraveItem[k].id]+=parseFloat(feeTraveItem[k].price);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ for(let i=0;i<priceList.length;i++){
|
|
|
+ if(typeof priceList[i]==='number'){
|
|
|
+ $("span[travelprice_"+i+"]").html(priceList[i]);
|
|
|
+ $("#travel_"+i+"").val(priceList[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function districtTop(selected){
|
|
|
+
|
|
|
+ var storage=window.localStorage;
|
|
|
+
|
|
|
+ if(typeof storage["districtTop"]==='undefined'||storage["districtTop"]===''){
|
|
|
+ $.ajax({
|
|
|
+ url : '/api/district',
|
|
|
+ type : "post",
|
|
|
+ cache : false,
|
|
|
+ dataType : "json",
|
|
|
+ global : true,
|
|
|
+ success : function(data) {
|
|
|
+ storage.setItem("districtTop",JSON.stringify(data.districtList));
|
|
|
+ //districtTop(data.districtList);
|
|
|
+
|
|
|
+ },
|
|
|
+ error : function(err) {}
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ var districtTop=JSON.parse(storage["districtTop"]);
|
|
|
+
|
|
|
+ var html='';
|
|
|
+ for(let i=0;i<districtTop.length;i++){
|
|
|
+ if(typeof selected!=='undefined'&&selected.departureprovince==districtTop[i].name){
|
|
|
+ html+='<option selected value='+districtTop[i].id+'>'+districtTop[i].name+'</option>';
|
|
|
+ }else{
|
|
|
+ html+='<option value='+districtTop[i].id+'>'+districtTop[i].name+'</option>';
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ $("select[departureProvince]").html(html);
|
|
|
+
|
|
|
+ html='';
|
|
|
+ for(let i=0;i<districtTop.length;i++){
|
|
|
+ if(typeof selected!=='undefined'&&selected.arrivalsprovince==districtTop[i].name){
|
|
|
+ html+='<option selected value='+districtTop[i].id+'>'+districtTop[i].name+'</option>';
|
|
|
+ }else{
|
|
|
+ html+='<option value='+districtTop[i].id+'>'+districtTop[i].name+'</option>';
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ $("select[arrivalsProvince]").html(html);
|
|
|
+ }
|
|
|
+
|
|
|
+ function districtCityBuild(selectDom,obj,selected){
|
|
|
+
|
|
|
+ var storage=window.localStorage;
|
|
|
+ var id=$('select['+obj+']').val();
|
|
|
+
|
|
|
+ if(typeof storage["district_"+id]==='undefined'||storage["district_"+id]===''){
|
|
|
+ $.ajax({
|
|
|
+ url : '/api/district?did='+id,
|
|
|
+ type : "post",
|
|
|
+ cache : false,
|
|
|
+ dataType : "json",
|
|
|
+ async:false,
|
|
|
+ global : true,
|
|
|
+ success : function(data) {
|
|
|
+ storage.setItem("district_"+id,JSON.stringify(data.districtList));
|
|
|
+ //districtCity(selectDom,data.districtList);
|
|
|
+ },
|
|
|
+ error : function(err) {}
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ districtCity=JSON.parse(storage["district_"+id]);
|
|
|
+
|
|
|
+ var html='';var cityName='';
|
|
|
+ if(typeof selected!=='undefined'){
|
|
|
+ if(selectDom=='departurecity'){
|
|
|
+ cityName=selected.departurecity;
|
|
|
+ }else{
|
|
|
+ cityName=selected.arrivalscity.substring(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ for(let i=0;i<districtCity.length;i++){
|
|
|
+
|
|
|
+ if(typeof selected!=='undefined'&&cityName==districtCity[i].name){
|
|
|
+ html+='<option selected value='+districtCity[i].name+'>'+districtCity[i].name+'</option>';
|
|
|
+ }else{
|
|
|
+ html+='<option value='+districtCity[i].name+'>'+districtCity[i].name+'</option>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $("select["+selectDom+"]").html(html);
|
|
|
+ }
|
|
|
+
|
|
|
+ function buildItinerary(list){
|
|
|
+ var html='';
|
|
|
+ for(let i=0;i<list.length;i++){
|
|
|
+ html+='<tr><th colspan="2" class="ta"><i class="contactsMark icon-">P</i> '+list[i].departuredate+list[i].arrivalsdate+' '+list[i].departurecity+list[i].arrivalscity+'';
|
|
|
+ html+='<div class="fR"><a href="#route-add" ediStroke data-toggle="modal" dataId="'+i+'" >编辑</a> <a href="#" dataId="'+i+'" removeItinerary class="colRed">移除</a></div></th></tr>';
|
|
|
+ let feeTraveItem=list[i].feeTraveItem;
|
|
|
+ let price=0;
|
|
|
+ for(let k=0;k<feeTraveItem.length;k++){
|
|
|
+ price+=parseFloat(feeTraveItem[k].price);
|
|
|
+ html+='<tr><th>'+feeTraveItem[k].name+'<p class="colGray">#'+feeTraveItem[k].detail+'</p></th><td width="200" class="taR">¥'+feeTraveItem[k].price+'</td></tr>';
|
|
|
+ }
|
|
|
+ html+='<tr><th class="taR">合计</th><td class="colGreen taR">¥'+price+'</td></tr>';
|
|
|
+ }
|
|
|
+ $("tbody[itinerary]").html(html);
|
|
|
+ }
|
|
|
+
|
|
|
+ function buildFeeTravelItem(feeTraveItem){
|
|
|
+
|
|
|
+ var html='';
|
|
|
+ for(let i=0;i<feeTraveItem.length;i++){
|
|
|
+ html+='<tr class="remove" ><th>'+feeTraveItem[i].name+'</th>';
|
|
|
+ html+='<td class="taR">¥<input type="number" itemId_'+feeTraveItem[i].id+' data="'+feeTraveItem[i].name+'" dataId="'+feeTraveItem[i].id+'" value="'+feeTraveItem[i].price+'" placeholder="输入费用" pattern="[0-9]" step="1" min="0"class="span2"></td>';
|
|
|
+ html+='<td><input type="text" value="'+feeTraveItem[i].detail+'" itemDetail_'+feeTraveItem[i].id+' placeholder="填写费用说明"></td>';
|
|
|
+ html+='<td><a href="#" removeFeeTravelItem >移除</a></td></tr>';
|
|
|
+ }
|
|
|
+ $("tbody[feeTravelItem]").html(html);
|
|
|
+ }
|
|
|
+
|
|
|
+ function fnGetItineraryData(){
|
|
|
+ var departurecity=$("select[departurecity] option:selected").text();
|
|
|
+ var arrivalscity=$("select[arrivalscity] option:selected").text();
|
|
|
+ var departureprovince=$("select[departureprovince] option:selected").text();
|
|
|
+ var arrivalsprovince=$("select[arrivalsprovince] option:selected").text();
|
|
|
+
|
|
|
+ var departuredate=$("input[departuredate]").val();
|
|
|
+ var arrivalsdate=$("input[arrivalsdate]").val();
|
|
|
+
|
|
|
+ var feeTravePriceList=$("tbody[feeTravelItem]").find('input[type=number]');
|
|
|
+ var feeTraveDetailList=$("tbody[feeTravelItem]").find('input[type=text]');
|
|
|
+
|
|
|
+ if(arrivalscity!==''){
|
|
|
+ arrivalscity='-'+arrivalscity;
|
|
|
+ }
|
|
|
+ if(arrivalsdate!==''){
|
|
|
+ arrivalsdate='~'+arrivalsdate;
|
|
|
+ }
|
|
|
+
|
|
|
+ var feeTraveItem=[];
|
|
|
+ for(let i=0;i<feeTravePriceList.length;i++){
|
|
|
+ feeTraveItem.push({'id':$(feeTravePriceList[i]).attr('dataId'),'name':$(feeTravePriceList[i]).attr('data'),'price':$(feeTravePriceList[i]).val(),'detail':$(feeTraveDetailList[i]).val()});
|
|
|
+ }
|
|
|
+
|
|
|
+ var itinerary={'departuredate':departuredate,'departureprovince':departureprovince,'departurecity':departurecity,'arrivalsdate':arrivalsdate,'arrivalsprovince':arrivalsprovince,'arrivalscity':arrivalscity,'feeTraveItem':feeTraveItem};
|
|
|
+ return itinerary;
|
|
|
+ }
|
|
|
+
|
|
|
+ $(function() {
|
|
|
+
|
|
|
+ var sessionStorage= window.sessionStorage;
|
|
|
+ var sessionItinerary= sessionStorage.getItem("itineraryList");
|
|
|
+ if(typeof sessionItinerary!=='object'){
|
|
|
+ buildItinerary(JSON.parse(sessionItinerary));
|
|
|
+ fnTotTravelPrice();
|
|
|
+ }
|
|
|
+
|
|
|
+ $("a[ediStroke]").click(function() {
|
|
|
+ var sessionItinerary= sessionStorage.getItem("itineraryList");
|
|
|
+ sessionItinerary=JSON.parse(sessionItinerary);
|
|
|
+ var id=$(this).attr('dataId');
|
|
|
+
|
|
|
+ var storage=window.localStorage;
|
|
|
+
|
|
|
+ districtTop(sessionItinerary[id]);
|
|
|
+ districtCityBuild('departurecity','departureprovince',sessionItinerary[id]);
|
|
|
+ districtCityBuild('arrivalscity','arrivalsprovince',sessionItinerary[id]);
|
|
|
+
|
|
|
+ $("input[departuredate]").val(sessionItinerary[id].departuredate);
|
|
|
+ $("input[arrivalsdate]").val(sessionItinerary[id].arrivalsdate.substring(1));
|
|
|
+
|
|
|
+ buildFeeTravelItem(sessionItinerary[id].feeTraveItem);
|
|
|
+
|
|
|
+ $("a[additinerarybut]").hide();
|
|
|
+ $("a[ediItineraryBut]").show();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("a[addStroke]").click(function() {
|
|
|
+ districtTop();
|
|
|
+ districtCityBuild('departurecity','departureprovince');
|
|
|
+ districtCityBuild('arrivalscity','arrivalsprovince');
|
|
|
+ $("input[departuredate]").val('');
|
|
|
+ $("input[arrivalsdate]").val('');
|
|
|
+ $("tbody[feeTravelItem]").html('');
|
|
|
+
|
|
|
+ $("a[additinerarybut]").show();
|
|
|
+ $("a[ediItineraryBut]").hide();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("select[departureProvince]").change(function() {
|
|
|
+ districtCityBuild('departurecity','departureprovince');
|
|
|
+ });
|
|
|
+
|
|
|
+ $("select[arrivalsProvince]").change(function() {
|
|
|
+ districtCityBuild('arrivalscity','arrivalsprovince');
|
|
|
+ });
|
|
|
+
|
|
|
+ $("a[feeTravelItem]").click(function() {
|
|
|
+ var itemName=$("select[feeTravelItem] option:selected").text();
|
|
|
+ var itemId=$("select[feeTravelItem] option:selected").val();
|
|
|
+
|
|
|
+ var html='<tr class="remove" ><th>'+itemName+'</th>';
|
|
|
+ html+='<td class="taR">¥<input type="number" itemId_'+itemId+' data="'+itemName+'" dataId="'+itemId+'" value="0" placeholder="输入费用" pattern="[0-9]" step="1" min="0"class="span2"></td>';
|
|
|
+ html+='<td><input type="text" itemDetail_'+itemId+' placeholder="填写费用说明"></td>';
|
|
|
+ html+='<td><a href="#" removeFeeTravelItem >移除</a></td></tr>';
|
|
|
+ $("tbody[feeTravelItem]").append(html);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ $("tbody[feeTravelItem]").on("click","a[removeFeeTravelItem]",function(){
|
|
|
+ $(this).closest('.remove').remove();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("tbody[itinerary]").on("click","a[edistroke]",function(){
|
|
|
+ $("input[name=ediStrokeId]").val($(this).attr('dataid'));
|
|
|
+ });
|
|
|
+
|
|
|
+ $("a[ediItineraryBut]").click(function() {
|
|
|
+ var itinerary=fnGetItineraryData();
|
|
|
+ var siIndex=$("input[name=ediStrokeId]").val();
|
|
|
+
|
|
|
+ var sessionItinerary =JSON.parse(sessionStorage.getItem("itineraryList"));
|
|
|
+
|
|
|
+ sessionItinerary[siIndex]=itinerary;
|
|
|
+ sessionStorage.setItem("itineraryList",JSON.stringify(sessionItinerary));
|
|
|
+ buildItinerary(sessionItinerary);
|
|
|
+ fnTotTravelPrice();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("a[addItineraryBut]").click(function() {
|
|
|
+ var itinerary=fnGetItineraryData();
|
|
|
+
|
|
|
+ var sessionItinerary = sessionStorage.getItem("itineraryList");
|
|
|
+
|
|
|
+ if(typeof sessionItinerary==='object'){
|
|
|
+ sessionItinerary=[];
|
|
|
+ sessionItinerary.push(itinerary);
|
|
|
+ sessionStorage.setItem("itineraryList",JSON.stringify(sessionItinerary));
|
|
|
+ }else{
|
|
|
+ sessionItinerary=JSON.parse(sessionItinerary);
|
|
|
+ sessionItinerary.push(itinerary);
|
|
|
+ sessionStorage.setItem("itineraryList",JSON.stringify(sessionItinerary));
|
|
|
+ }
|
|
|
+
|
|
|
+ buildItinerary(sessionItinerary);
|
|
|
+ fnTotTravelPrice();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("tbody[itinerary]").on("click","a[removeItinerary]",function(){
|
|
|
+
|
|
|
+ var sessionItinerary= sessionStorage.getItem("itineraryList");
|
|
|
+ var id=$(this).attr('dataId');
|
|
|
+ sessionItinerary=JSON.parse(sessionItinerary);
|
|
|
+ sessionItinerary.splice(id,1);
|
|
|
+ sessionStorage.setItem("itineraryList",JSON.stringify(sessionItinerary));
|
|
|
+ buildItinerary(sessionItinerary);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ //---------------------------
|
|
|
+
|
|
|
+ $("input[id^='inttrain_']").change(function() {
|
|
|
+
|
|
|
+ $i = 0;
|
|
|
+ $("input[id^='inttrain_']").each(function(i) {
|
|
|
+ $i += parseFloat(this.value);
|
|
|
+
|
|
|
+ });
|
|
|
+ $("#inttrainResult").html("¥" + $i.toFixed(2));
|
|
|
+ $("#inttrainR").val($i.toFixed(2));
|
|
|
+
|
|
|
+ var agencyR = $("#agencyR").val();
|
|
|
+ var otherR = parseFloat($("#otherR").val());
|
|
|
+
|
|
|
+ var RS = parseFloat($i) + parseFloat(agencyR) + otherR;
|
|
|
+
|
|
|
+ $("#RS").html("¥" + RS.toFixed(2));
|
|
|
+ });
|
|
|
+
|
|
|
+ $("select[bindInvoice]").change(function() {
|
|
|
+
|
|
|
+ var option = $(this).val();
|
|
|
+ if (option != 0) {
|
|
|
+ $("div[invoice]").show();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $("div[invoice]").hide();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $("input[publicRelationsInput]").keyup(function() {
|
|
|
+ var price = $(this).val();
|
|
|
+ if (price != 0) {
|
|
|
+ $("tbody[publicRelations]").show();
|
|
|
+ $("span[publicRelationsPrice]").html(price);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $("tbody[publicRelations]").hide();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('tbody[invoiceList]').delegate("a[node-invoice='INFO']",
|
|
|
+ 'click', function() {
|
|
|
+ var postData = $(this).attr("data-isKey");
|
|
|
+ var type = $(this).attr("data-type");
|
|
|
+ invoice(postData, type);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ $('div[invoice]').delegate("a[node-invoice='INFO']", 'click',
|
|
|
+ function() {
|
|
|
+ var postData = $(this).attr("data-isKey");
|
|
|
+ var type = $(this).attr("data-type");
|
|
|
+ invoice(postData, type);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ $("button[search_invoice]").click(function() {
|
|
|
+ var wd = $("input[wd]").val();
|
|
|
+
|
|
|
+ var params = {
|
|
|
+ where : {
|
|
|
+ 'invoiceTitle_like' : wd,
|
|
|
+ 'untreadStatus_or' : [ 0, 3 ],
|
|
|
+ 'status_or' : [ 1, 2 ],
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ params = JSON.stringify(params);
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url : '/api/invoice?filter=' + params,
|
|
|
+ type : "get",
|
|
|
+ cache : false,
|
|
|
+ dataType : "json",
|
|
|
+ success : function(data) {
|
|
|
+ buildInvoice(data);
|
|
|
+
|
|
|
+ },
|
|
|
+ error : function(err) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ })
|
|
|
+ function buildInvoice(data) {
|
|
|
+ var html = '';
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ html += '<tr><td>' + data[i]['invoiceTitle'] + '</td><td>¥'
|
|
|
+ + data[i]['invoicePrice'];
|
|
|
+ if (data[i]['invoiceType'] == 1) {
|
|
|
+ html += '专';
|
|
|
+ }
|
|
|
+ html += '</td>';
|
|
|
+ if (data[i]['settlementType'] == 1) {
|
|
|
+ html += '<td>培训班(<a href="/invoiceTrainingDetail/'+data[i]['trainId']+'.html" target="_blank">查看</a>)</td>';
|
|
|
+ } else {
|
|
|
+ html += '<td>软件销售</td>';
|
|
|
+ }
|
|
|
+
|
|
|
+ html += '<td>' + data[i]['categoryName'] + ''
|
|
|
+ + data[i]['userName'] + '<br> ' + data[i]['date']
|
|
|
+ + '</td><td>' + data[i]['printer'] + '<br>'
|
|
|
+ + data[i]['printTime'] + '</td>';
|
|
|
+ html += '<td><a href="#invdetail" node-invoice="INFO" data-iskey="'+data[i]['iid']+'" data-toggle="modal">'
|
|
|
+ + data[i]['invoiceSerial'] + '</a></td>';
|
|
|
+ html += '<td><a class="button btn-block" data-dismiss="modal" aria-hidden="true" onclick="bind_invoice(\''
|
|
|
+ + data[i]['iid']
|
|
|
+ + '\',\''
|
|
|
+ + data[i]['invoiceSerial']
|
|
|
+ + '\')" href="#">添加</a></td></tr>';
|
|
|
+ }
|
|
|
+ $('tbody[invoiceList]').html(html);
|
|
|
+
|
|
|
+ }
|
|
|
+ function bind_invoice(iid, invoiceSerial) {
|
|
|
+ var html = '<a href="#invdetail" node-invoice="INFO" data-iskey="'+iid+'" data-toggle="modal">'
|
|
|
+ + invoiceSerial + '</a>';
|
|
|
+ html += '<a href="#invdetail" onclick="remove_invoice()" class="fR">移除</a>';
|
|
|
+ $('#iid').val(iid);
|
|
|
+ $('th[binded_invoce]').html(html);
|
|
|
+ }
|
|
|
+
|
|
|
+ function remove_invoice() {
|
|
|
+ $('#iid').val('');
|
|
|
+ $('th[binded_invoce]').html('');
|
|
|
+ }
|
|
|
+
|
|
|
+ function invoice(postData, type) {
|
|
|
+ /* var postData = $(this).attr("data-isKey");
|
|
|
+ var type =$(this).attr("data-type"); */
|
|
|
+
|
|
|
+ var po = 'INVOICE';
|
|
|
+ if (type == 'receivables')
|
|
|
+ po = 'RECEIVABLES';
|
|
|
+
|
|
|
+ $("div[loading-msg='true']").html(
|
|
|
+ "<img src='/global/img/loadIco.gif' />");
|
|
|
+ var url = "/ajaxGetInvoiceInfoByType";
|
|
|
+ $.ajax({
|
|
|
+ url : url,
|
|
|
+ type : "post",
|
|
|
+ cache : false,
|
|
|
+ dataType : "json",
|
|
|
+ data : {
|
|
|
+ serial : postData,
|
|
|
+ type : po
|
|
|
+ },
|
|
|
+ global : true,
|
|
|
+ success : function(data) {
|
|
|
+ if (data.status == 1) {
|
|
|
+ $("div[loading-msg='true']").html("");
|
|
|
+ if (type == 'receivables')
|
|
|
+ $("#nr").html(data.html);
|
|
|
+ else
|
|
|
+ $("#nc").html(data.html);
|
|
|
+ } else
|
|
|
+ $("div[loading-msg='true']")
|
|
|
+ .html("illegal request");
|
|
|
+ },
|
|
|
+ error : function(err) {
|
|
|
+ $("div[loading-msg='true']").html("");
|
|
|
+ $("#nr").html('');
|
|
|
+ $("#nc").html('');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</body>
|