1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>发布运价</title>
- <link rel="stylesheet" href="../css/main.css" />
- <link rel="stylesheet" href="../css/head.css"/>
- <link rel="stylesheet" href="../font/iconfont.css" />
- <script src="../js/flexible.js"></script>
- <script src="../js/api.js"></script>
- <script src="../js/checkLanguage.js"></script>
- </head>
- <body class="ub ub-ver">
- <div id="header">
- <img src="../images/headerBG.jpg" alt=" " class="headerBG">
- <i id="backBtn"><img src="../images/backBtn.png" alt=""></i>
- <h3 class="headTit"></h3>
- <!--<a href="javascript;" id="head-txt" class="fz28 blue pr25">保存</a>-->
- <ul class="headGN">
- <li><i></i></li>
- </ul>
- </div>
- <div style="overflow-y: auto" class="ub-f1 hid" id="main">
- <div class="price-method ub ub-pac bgff plr25 bb mt20" id="nav">
- <a href="javascript:;" class="fz28 ub-f1 c3d ub ub-pac" rel="ship"><span class="method-active nav1"></span></a>
- <a href="javascript:;" class="fz28 ub-f1 c3d ub ub-pac" rel="plane"><span class="nav2"></span></a>
- <a href="javascript:;" class="fz28 ub-f1 c3d ub ub-pac" rel="train"><span class="nav3"></span></a>
- <a href="javascript:;" class="fz28 ub-f1 c3d ub ub-pac" rel="car"><span class="nav4"></span></a>
- </div>
- <h3 class="fz30 c3d tx-c bgff ptb30 mt20" id="h3"></h3>
- <ul class="bgff bt bb pl25 c81 reset-pwd h-price">
- <li class="bb ub ub-ac" id="pol">
- <b class="fz28 c81"><em class="red">*</em><span class="list1"></span>:</b>
- <div class="ub-f1">
- <input type="text" value="" id="polInput" readonly="readonly"/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- <li class="bb ub ub-ac" id="pod">
- <b class="fz28 c81"><em class="red">*</em><span class="list2"></span>:</b>
- <div class="ub-f1">
- <input type="text" value="" id="podInput" readonly="readonly"/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- <li class="ub ub-pac h-edit-input" id="cyr">
- <b class="fz26 c81 db"><em class="red">*</em><span class="list3"></span>:</b>
- <div class="h-input-box ub-f1 ub bb ub-pac">
- <input type="text" name="" id="cyrVal" value="" class="ub-f1" readonly="readonly"/>
- </div>
- <i class="iconfont icon-jiantou cbc pr50"></i>
- </li>
- <li class="ub ub-ac" id="typename">
- <b class="fz28 c81 list4"></b>
- <div class="ub-f1">
- <input type="text" value="" id="typenameVal" class="list4Input" placeholder="" readonly="readonly"/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- </ul>
- <ul class="bgff bt bb pl25 c81 reset-pwd h-price mt20">
- <li class="bb ub ub-ac" id="time">
- <b class="fz28 c81"><em class="red">*</em><span class="list5"></span>:</b>
- <div class="ub-f1">
- <input type="text" value="" id="needDay" class="list6Input" placeholder=""/>
- </div>
- <span class="fz28 ub-f1 list6"></span>
- <div class="ub-f2">
- <input type="text" value="" id="needHour" class="list7Input" placeholder=""/>
- </div>
- <span class="fz28 ub-f1 list7"></span>
- </li>
- <li class="bb ub ub-ac" id="lgrq">
- <b class="fz28 c81"><em class="red">*</em><span class="list8"></span>:</b>
- <div class="ub-f1">
- <input type="text" placeholder="" id="lgTime" readonly="readonly"/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- <!--<li class="bb ub ub-ac" id="schedule">-->
- <!--<b class="fz28 c81">船期:</b>-->
- <!--<div class="ub-f1">-->
- <!--<input type="text" value="" id="scheduleVal" />-->
- <!--</div>-->
- <!--</li>-->
- <li class="bb ub ub-ac" id="jgrq">
- <b class="fz28 c81"><em class="red">*</em><span class="list9"></span>:</b>
- <div class="ub-f1">
- <input type="text" value="" id="jgTime" readonly="readonly"/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- <div id="capacityDiv">
- <div class="capacityLiDiv" rel="{{capacityId}}">
- <li class="ub ub-ver h-edit-input">
- <div class="ub ub-pj pr25 ptb30">
- <b class="fz26 c81 db ub-f1"><em class="red">*</em><span class="list10"></span>:</b>
- <p class="fz24 blue newYL list11" onclick="addCapacity(this,capacityModel)"></p>
- </div>
- </li>
- <li class="bb ub ub-ac capacity">
- <b class="fz28 c81 list12"></b>
- <div class="ub-f1">
- <input type="text" value="{{transportCapacity}}" class="list12Input" placeholder=""/>
- </div>
- <div class="ub-f2 capacityFn">
- <input type="text" rel="{{transportCapacityUnion}}" value="{{theCode}}" class="list13Input" readonly="readonly" placeholder=""/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- <li class="ub ub-ver h-edit-input">
- <div class="ub ub-pj pr25 ptb30">
- <b class="fz26 c81 db ub-f1"><em class="red">*</em><span class="list14"></span>:</b>
- <p class="fz24 blue newYJ" onclick="addExpense(this,expenseModel)"></p>
- </div>
- </li>
- <div class="expenseDiv">
- {{expenseLi}}
- </div>
- </div>
- </div>
- <li class="bb ub ub-ac" id="subjoin">
- <b class="fz28 c81 list15"></b>
- <div class="ub-f1">
- <input type="text" value="" id="subjoinVal" readonly="readonly"/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25 pl90"></i>
- </li>
- <li class="bb ub ub-ac" id="yxrq">
- <b class="fz28 c81"><em class="red">*</em><span class="list16"></span></b>
- <div class="ub-f1">
- <input type="text" id="yxTime" value="" readonly="readonly"/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- <li class="pt30 ub-ac" id="bz">
- <b class="fz28 c81"><span class="list17"></span>:</b>
- <div class="mt30 mb30 company-profile">
- <textarea name="" rows="5" id="bzVal" cols="" placeholder=""></textarea>
- </div>
- </li>
- </ul>
- <div class="plr25 mt50 pt20 ub ub-ac">
- <button type="button" class="release-btn mb30 btn-box pr25 fz30 cff btn1" id="sureBtn"></button>
- </div>
- <div id="capacityProDiv" class="hid">
- <div class="capacityLiDiv" rel="{{capacityId}}">
- <li class="ub ub-ver h-edit-input">
- <div class="ub ub-pj pr25 ptb30">
- <b class="fz26 c81 db ub-f1"><em class="red">*</em><span class="list18"></span>:</b>
- <p class="fz24 blue newYL list19" onclick="addCapacity(this,capacityModel)"></p>
- </div>
- </li>
- <li class="bb ub ub-ac capacity">
- <b class="fz28 c81 list20"></b>
- <div class="ub-f1">
- <input type="text" value="" class="list20Input" placeholder=""/>
- </div>
- <div class="ub-f2 capacityFn">
- <input type="text" rel="" value="" class="list21Input" readonly="readonly" placeholder=""/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- <li class="ub ub-ver h-edit-input">
- <div class="ub ub-pj pr25 ptb30">
- <b class="fz26 c81 db ub-f1"><em class="red">*</em><span class="list22"></span>:</b>
- <p class="fz24 blue newYJ" onclick="addExpense(this,expenseModel)"></p>
- </div>
- </li>
- <div class="expenseDiv">
- <li class="bb ub ub-ac expense">
- <b class="fz28 c81 list23"></b>
- <div class="ub-f1">
- <input type="text" value="" placeholder="0.00"/>
- </div>
- <div class="ub-f2 expenseFn">
- <input type="text" value="" readonly="readonly" class="list23Input" placeholder=""/>
- </div>
- <i class="iconfont icon-jiantou cbc pr25"></i>
- </li>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- try {
- var text=languages.issueDetails;
- $api.dom(".headTit").innerText=text.tit;
- $api.dom(".nav1").innerText=text.nav1;
- $api.dom(".nav2").innerText=text.nav2;
- $api.dom(".nav3").innerText=text.nav3;
- $api.dom(".nav4").innerText=text.nav4;
- $api.dom("#h3").innerText=text.h3;
- $api.dom(".list1").innerText=text.list1;
- $api.dom(".list2").innerText=text.list2;
- $api.dom(".list3").innerText=text.list3;
- $api.dom(".list4").innerText=text.list4;
- $api.dom(".list4Input").setAttribute("placeholder",text.list4Input);
- $api.dom(".list5").innerText=text.list5;
- $api.dom(".list6").innerText=text.list6;
- $api.dom(".list6Input").setAttribute("placeholder",text.list6Input);
- $api.dom(".list7").innerText=text.list7;
- $api.dom(".list7Input").setAttribute("placeholder",text.list7Input);
- $api.dom(".list8").innerText=text.list8;
- $api.dom(".list9").innerText=text.list9;
- $api.dom(".list10").innerText=text.list10;
- $api.dom(".list11").innerText=text.list11;
- $api.dom(".list12").innerText=text.list12;
- $api.dom(".list12Input").setAttribute("placeholder",text.list12Input);
- $api.dom(".list13Input").setAttribute("placeholder",text.list13Input);
- $api.dom(".list14").innerText=text.list14;
- $api.dom(".list15").innerText=text.list15;
- $api.dom(".list16").innerText=text.list16;
- $api.dom(".list17").innerText=text.list17;
- $api.dom(".list18").innerText=text.list10;
- $api.dom(".list19").innerText=text.list11;
- $api.dom(".list20").innerText=text.list12;
- $api.dom(".list20Input").setAttribute("placeholder",text.list12Input);
- $api.dom(".list21Input").setAttribute("placeholder",text.list13Input);
- $api.dom(".list22").innerText=text.list14;
- $api.dom(".list23").innerText=text.list15;
- $api.dom(".list23Input").setAttribute("placeholder",text.list13Input);
- $api.dom(".btn1").innerText=text.btn1;
- }catch (e){
- alert(languages.all.list5)
- }
- </script>
- <script src="../js/publicData.js"></script>
- <script src="../js/createTime.js"></script>
- <script>
- var expenseDiv=$api.dom(".expenseDiv"),capacityProDiv=$api.dom("#capacityProDiv"),capacityDiv=$api.dom("#capacityDiv"),expenseProDiv=$api.dom(capacityProDiv,".expenseDiv")
- var expenseModel=expenseProDiv.innerHTML;
- var capacityModel=capacityProDiv.innerHTML.replace(languages.issueDetails.list11,languages.issueDetails.list24).replace("addCapacity","delCapacity");
- var newCapacity=capacityProDiv.innerHTML;
- var expenseUpModel=expenseDiv.innerHTML;
- var newCapacityUpModel=capacityDiv.innerHTML;
- var capacityUpModel=capacityDiv.innerHTML.replace(languages.issueDetails.list11,languages.issueDetails.list24).replace("addCapacity","delCapacity");
- var expenseLi='<li class="bb ub ub-ac expense" rel="{{expenseId}}"> <b class="fz28 c81">'+languages.issueDetails.list23+'</b> <div class="ub-f1"> <input type="text" value="{{price}}" placeholder='+languages.issueDetails.list12Input+'/> </div> <div class="ub-f2 expenseFn"> <input type="text" rel="{{currencyId}}" value="{{code}}" class="list23Input" readonly="readonly" placeholder='+languages.issueDetails.list13Input+'/></div> <i class="iconfont icon-jiantou cbc pr25"></i> </li>'
- var unit=[],name=[],money=[],timedata={};
- var nav=$api.dom("#nav"),navLi=$api.domAll(nav,"a");
- var issueTypeArr=$api.getStorage("carriageType"),issueType=issueTypeArr[0].id,carriageType=0;
- money=$api.getStorage("money");
- var ifClick=false;
- apiready=function () {
- api.showProgress({
- title: languages.all.list21+'...',
- text: languages.all.list25+'...',
- modal: true
- });
- var backBtn=$api.dom("#backBtn"),sureBtn=$api.dom("#sureBtn"),main=$api.dom("#main");
- var selTime={
- dateFrom:"",
- dateTo:""
- };
- unit=$api.getStorage(navLi[0].getAttribute("rel")+"Unit");
- name=$api.getStorage(navLi[0].getAttribute("rel")+"Name");
- api.ajax({
- url: pageUrl+'price/get_price_info',
- method: 'get',
- timeout: 30,
- dataType: 'json',
- returnAll: false,
- headers:{
- "content-type":"application/json"
- },
- data: {
- body: {id: api.pageParam.id}
- }
- }, function (ret, err) {
- switch (ret.data[0]['tnameCn']){
- case "海运":
- navLi[0].click();
- break;
- case "空运":
- navLi[1].click();
- break;
- case "铁路":
- navLi[2].click();
- break;
- case "集卡":
- navLi[3].click();
- break;
- }
- for(var pol in ret.data[0]['pol']){
- $api.dom("#polInput").value=ret.data[0]['pol'][pol]['nameCn'];
- $api.dom("#polInput").setAttribute("rel",pol);
- }
- for(var pod in ret.data[0]['pod']){
- $api.dom("#podInput").value=ret.data[0]['pod'][pod]['nameCn'];
- $api.dom("#podInput").setAttribute("rel",pod);
- }
- $api.dom("#cyrVal").value=ret.data[0]['tcnameCn'];
- $api.dom("#cyrVal").setAttribute("rel",ret.data[0]['commoncarrierId']);
- $api.dom("#typenameVal").value=ret.data[0]['nameOfboard'];
- // $api.dom("#scheduleVal").value=ret.data[0]['detail'][0]['scheduled'];
- $api.dom("#yxTime").value=ret.data[0]['detail'][0]['dateFrom'].split(" ")[0].split("-").join(".")+"-"+ret.data[0]['detail'][0]['dateTo'].split(" ")[0].split("-").join(".");
- selTime={
- dateFrom:ret.data[0]['detail'][0]['dateFrom'],
- dateTo:ret.data[0]['detail'][0]['dateTo']
- }
- $api.dom("#jgTime").value=ret.data[0]['detail'][0]['dateOfEndGate'];
- $api.dom("#lgTime").value=ret.data[0]['detail'][0]['dateOfStart'];
- $api.dom("#needDay").value=ret.data[0]['detail'][0]['timeSpendDay']||"";
- $api.dom("#needHour").value=ret.data[0]['detail'][0]['timeSpendHour']||"";
- $api.dom("#bzVal").value=ret.data[0]['detail'][0]['remark'];
- $api.dom("#subjoinVal").value=ret.data[0]['detail'][0]['child'][0]['additionalPrice'];
- var str="",str2="";
- for(var capacityNum in ret.data[0]['detail']){
- if(capacityNum==0){
- str=newCapacityUpModel.replace("{{transportCapacity}}",ret.data[0]['detail'][capacityNum]['transportCapacity']).replace("{{capacityId}}",ret.data[0]['detail'][capacityNum]['id'])
- .replace("{{theCode}}",ret.data[0]['detail'][capacityNum]['theCode']).replace("{{transportCapacityUnion}}",ret.data[0]['detail'][capacityNum]['transportCapacityUnion'])
- for(var expenseNum in ret.data[0]['detail'][capacityNum]['child']){
- str2+=expenseLi.replace("{{code}}",ret.data[0]['detail'][capacityNum]['child'][expenseNum]['code']).replace("{{price}}",ret.data[0]['detail'][capacityNum]['child'][expenseNum]['price'])
- .replace("{{currencyId}}",ret.data[0]['detail'][capacityNum]['child'][expenseNum]['currencyId']).replace("{{expenseId}}",ret.data[0]['detail'][capacityNum]['child'][expenseNum]['id']);
- }
- str=str.replace("{{expenseLi}}",str2);
- capacityDiv.innerHTML=str;
- }else {
- str=capacityUpModel.replace("{{transportCapacity}}",ret.data[0]['detail'][capacityNum]['transportCapacity']).replace("{{capacityId}}",ret.data[0]['detail'][capacityNum]['id'])
- .replace("{{theCode}}",ret.data[0]['detail'][capacityNum]['theCode']).replace("{{transportCapacityUnion}}",ret.data[0]['detail'][capacityNum]['transportCapacityUnion'])
- for(var expenseNum in ret.data[0]['detail'][capacityNum]['child']){
- str2+=expenseLi.replace("{{code}}",ret.data[0]['detail'][capacityNum]['child'][expenseNum]['code']).replace("{{price}}",ret.data[0]['detail'][capacityNum]['child'][expenseNum]['price'])
- .replace("{{currencyId}}",ret.data[0]['detail'][capacityNum]['child'][expenseNum]['currencyId']).replace("{{expenseId}}",ret.data[0]['detail'][capacityNum]['child'][expenseNum]['id']);
- }
- str=str.replace("{{expenseLi}}",str2);
- capacityDiv.insertAdjacentHTML("beforeend",str);
- }
- str=str2="";
- }
- addCapacityFn();
- addExpenseFN();
- main.className=main.className.replace("hid","");
- api.hideProgress();
- });
- $api.dom(".capacityFn").onclick=function () {
- showBox(this.getElementsByTagName("input")[0],unit,true);
- }
- // $api.dom(".expenseFn").onclick=function () {
- // showBox(this.getElementsByTagName("input")[0],money,true);
- // }
- $api.dom("#cyr").onclick=function () {
- showBox(this.getElementsByTagName("input")[0],JSON.parse(name),true)
- }
- $api.dom("#subjoin").onclick=function () {
- showBox(this.getElementsByTagName("input")[0],$api.getStorage("subjoin"),true)
- }
- // $api.dom("#schedule").onclick=function () {
- // showBox(this.getElementsByTagName("input")[0],$api.getStorage("schedule"),true)
- // }
- $api.dom("#pol").onclick=function () {
- api.openWin({
- name: 'chosen',
- url: 'chosen.html',
- pageParam: {
- index: '#pol',
- name:"issueDetails",
- type:carriageType
- }
- });
- }
- $api.dom("#pod").onclick=function () {
- api.openWin({
- name: 'chosen',
- url: 'chosen.html',
- pageParam: {
- index: '#pod',
- name:"issueDetails",
- type:carriageType
- }
- });
- }
- backBtn.onclick=function () {
- toBack();
- }
- $api.dom("#yxrq").onclick=function () {
- var now=new Date(),arr=[];
- arr[0]=0;
- arr[1]=now.getMonth();
- arr[2]=now.getDate()-1;
- showTime(this,timeJson,languages.issueDetails.remind2,undefined,arr);
- }
- $api.dom("#lgrq").onclick=function () {
- var arr=[],data=[languages.issueDetails.remind3,languages.issueDetails.remind4,languages.issueDetails.remind5,languages.issueDetails.remind6,languages.issueDetails.remind7,languages.issueDetails.remind8,languages.issueDetails.remind9];
- for(var i=0;i<7;i++){
- arr[i]={
- id:0,
- text: data[i],
- status: 'normal'
- }
- }
- showBox(this.getElementsByTagName("input")[0],arr,false)
- }
- $api.dom("#jgrq").onclick=function () {
- var arr=[],data=[languages.issueDetails.remind3,languages.issueDetails.remind4,languages.issueDetails.remind5,languages.issueDetails.remind6,languages.issueDetails.remind7,languages.issueDetails.remind8,languages.issueDetails.remind9];
- for(var i=0;i<7;i++){
- arr[i]={
- id:0,
- text: data[i],
- status: 'normal'
- }
- }
- showBox(this.getElementsByTagName("input")[0],arr,false)
- }
- for(var navLiNum=0,len=navLi.length;navLiNum<len;navLiNum++){
- !function (i) {
- navLi[i].onclick=function (e) {
- e.preventDefault();
- issueType=issueTypeArr[i].id;
- carriageType=i;
- for(var j=0;j<len;j++){
- navLi[j].childNodes[0].className="";
- }
- this.childNodes[0].className="method-active";
- switch (i){
- case 0:
- $api.dom($api.dom("#lgrq"),"b").innerText=languages.issueDetails.list8;
- $api.dom($api.dom("#typename"),"b").innerText=languages.issueDetails.list4;
- break;
- case 1:
- $api.dom($api.dom("#lgrq"),"b").innerText=languages.issueDetails.remind10;
- $api.dom($api.dom("#typename"),"b").innerText=languages.issueDetails.remind11;
- break;
- case 2:
- $api.dom($api.dom("#lgrq"),"b").innerText=languages.issueDetails.remind10;
- $api.dom($api.dom("#typename"),"b").innerText=languages.issueDetails.remind12;
- break;
- case 3:
- $api.dom($api.dom("#lgrq"),"b").innerText=languages.issueDetails.remind10;
- $api.dom($api.dom("#typename"),"b").innerText=languages.issueDetails.remind13;
- break;
- }
- unit=$api.getStorage(this.getAttribute("rel")+"Unit");
- name=$api.getStorage(this.getAttribute("rel")+"Name");
- capacityDiv.innerHTML=newCapacity;
- $api.dom("#cyrVal").value="";
- $api.dom("#pol").getElementsByTagName('input')[0].value="";
- $api.dom("#pod").getElementsByTagName('input')[0].value="";
- $api.dom("#typenameVal").value="";
- // $api.dom("#scheduleVal").value="";
- $api.dom(".capacityFn").onclick=function () {
- showBox(this.getElementsByTagName("input")[0],unit,true);
- }
- $api.dom("#cyr").onclick=function () {
- showBox(this.getElementsByTagName("input")[0],JSON.parse(name),true);
- }
- // $api.dom(".expenseFn").onclick=function () {
- // showBox(this.getElementsByTagName("input")[0],money,true);
- // }
- }
- }(navLiNum)
- }
- sureBtn.onclick=function () {
- if(ifClick) return;
- api.toast({
- msg: languages.issueDetails.remind14+'...',
- duration: 2000,
- location: 'bottom'
- });
- ifClick=true;
- var postArr=[];
- if(check($api.dom("#pol").getElementsByTagName("input")[0].value,"null",languages.issueDetails.remind15)) return;
- if(check($api.dom("#pod").getElementsByTagName("input")[0].value,"null",languages.issueDetails.remind16)) return;
- if(check($api.dom("#cyrVal").value,"null",languages.issueDetails.remind17)) return;
- if(check($api.dom("#time").getElementsByTagName("input")[0].value,"num",languages.issueDetails.remind18)) return;
- if(check($api.dom("#time").getElementsByTagName("input")[1].value||1,"hour",languages.issueDetails.remind19)) return;
- if(check($api.dom("#jgrq").getElementsByTagName("input")[0].value,"null",languages.issueDetails.remind20)) return;
- if(check($api.dom("#lgrq").getElementsByTagName("input")[0].value,"null",languages.issueDetails.remind21)) return;
- if(check($api.dom("#yxrq").getElementsByTagName("input")[0].value,"null",languages.issueDetails.remind22)) return;
- if(check($api.dom("#bz").getElementsByTagName("textarea")[0].value||"1","text",languages.issueDetails.remind23)) return;
- var locData={
- id:api.pageParam.id,
- transeTypeId:issueType,
- pol:$api.dom("#pol").getElementsByTagName("input")[0].getAttribute("rel"),
- pod:$api.dom("#pod").getElementsByTagName("input")[0].getAttribute("rel"),
- commoncarrierId:$api.dom("#cyr").getElementsByTagName("input")[0].getAttribute("rel"),
- nameOfboard:$api.dom("#typename").getElementsByTagName("input")[0].value
- }
- var price=[],child=[];
- var capacityLiDiv=$api.domAll(".capacityLiDiv");
- for(var i=0,len=capacityLiDiv.length;i<len-1;i++){
- if(check(capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[0].value,"num",languages.issueDetails.remind24)) return;
- if(check(capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[1].getAttribute("rel"),"null",languages.issueDetails.remind25)) return;
- if(capacityLiDiv[i].getAttribute("rel")&&capacityLiDiv[i].getAttribute("rel")!="{{capacityId}}"){
- price[i]={
- id:capacityLiDiv[i].getAttribute("rel"),
- isDirect:"直达",
- // scheduled:$api.dom("#schedule").getElementsByTagName("input")[0].value,
- dateFrom:selTime.dateFrom,
- dateTo:selTime.dateTo,
- dateOfEndGate:$api.dom("#jgrq").getElementsByTagName("input")[0].value,
- dateOfStart:$api.dom("#lgrq").getElementsByTagName("input")[0].value,
- timeSpendDay:$api.dom("#time").getElementsByTagName("input")[0].value,
- timeSpendHour:$api.dom("#time").getElementsByTagName("input")[1].value==""?0:$api.dom("#time").getElementsByTagName("input")[1].value,
- remark:$api.dom("#bz").getElementsByTagName("textarea")[0].value||languages.all.list36,
- transportCapacity:capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[0].value,
- transportCapacityUnion:capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[1].getAttribute("rel"),
- child:[]
- };
- for(var j=0;j<capacityLiDiv[i].getElementsByClassName("expense").length;j++){
- child[j]={};
- if(check(capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[0].value,"price",languages.issueDetails.remind26)) return;
- if(check(capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[1].getAttribute("rel"),"null",languages.issueDetails.remind25)) return;
- if(capacityLiDiv[i].getElementsByClassName("expense")[j].getAttribute("rel")&&capacityLiDiv[i].getElementsByClassName("expense")[j].getAttribute("rel")!="{{expenseId}}"){
- child[j]={
- id:capacityLiDiv[i].getElementsByClassName("expense")[j].getAttribute("rel"),
- price:(capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[0].value-0).toFixed(2),
- currencyId:capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[1].getAttribute("rel"),
- currencyUnion:capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[1].getAttribute("rel"),
- additionalPrice:$api.dom("#subjoin").getElementsByTagName("input")[0].value
- };
- }else {
- child[j]={
- price:(capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[0].value-0).toFixed(2),
- currencyId:capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[1].getAttribute("rel"),
- currencyUnion:capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[1].getAttribute("rel"),
- additionalPrice:$api.dom("#subjoin").getElementsByTagName("input")[0].value
- };
- }
- }
- }else {
- price[i]={
- isDirect:"直达",
- // scheduled:$api.dom("#schedule").getElementsByTagName("input")[0].value,
- dateFrom:selTime.dateFrom,
- dateTo:selTime.dateTo,
- dateOfEndGate:$api.dom("#jgrq").getElementsByTagName("input")[0].value,
- dateOfStart:$api.dom("#lgrq").getElementsByTagName("input")[0].value,
- timeSpendDay:$api.dom("#time").getElementsByTagName("input")[0].value,
- timeSpendHour:$api.dom("#time").getElementsByTagName("input")[1].value==""?0:$api.dom("#time").getElementsByTagName("input")[1].value,
- remark:$api.dom("#bz").getElementsByTagName("textarea")[0].value||languages.all.list36,
- transportCapacity:capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[0].value,
- transportCapacityUnion:capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[1].getAttribute("rel"),
- child:[]
- };
- for(var j=0;j<capacityLiDiv[i].getElementsByClassName("expense").length;j++){
- child[j]={};
- if(check(capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[0].value,"price",languages.issueDetails.remind26)) return;
- if(check(capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[1].getAttribute("rel"),"null",languages.issueDetails.remind25)) return;
- child[j]={
- price:(capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[0].value-0).toFixed(2),
- currencyId:capacityLiDiv[i].getElementsByClassName("expense")[j].getElementsByTagName("input")[1].getAttribute("rel"),
- currencyUnion:capacityLiDiv[i].getElementsByClassName("capacity")[0].getElementsByTagName("input")[1].getAttribute("rel"),
- additionalPrice:$api.dom("#subjoin").getElementsByTagName("input")[0].value
- };
- }
- }
- price[i].child=child;
- child=[]
- }
- postArr[0]=locData;
- postArr[1]=price;
- api.ajax({
- url: pageUrl+"Price/edit_price",
- method: 'post',
- timeout: 30,
- dataType: 'json',
- returnAll: false,
- headers:{
- "content-type":"application/json"
- },
- data: {
- body:postArr
- }
- }, function (ret, err) {
- var arr=ret.data.split(""),remind=null;
- arr[1]==0&&arr[2]==0?remind=languages.all.list46:remind=null;
- api.toast({
- msg: remind||ret.message,
- duration: 2000,
- location: 'bottom'
- });
- if(ret.status=="200"){
- api.sendEvent({
- name: api.pageParam.reloadName,
- extra: {key1: 'value', key2: 'value'}
- });
- api.toast({
- msg: languages.all.list45,
- duration: 2000,
- location: 'bottom'
- });
- setTimeout(function () {
- api.closeWin();
- },500)
- }else {
- ifClick=false;
- }
- })
- }
- api.addEventListener({
- name:'keyback'
- },function(ret, err){
- toBack()
- });
- function toBack() {
- api.closeWin();
- }
- function showTime(that,data,Tit,col,activeTime) {
- var UIActionSelector = api.require('UIActionSelector'),thisCol=3;
- UIActionSelector.open({
- datas: data,
- layout: {
- row: 5,
- col: col||thisCol,
- height: 30,
- size: 12,
- sizeActive: 14,
- rowSpacing: 5,
- colSpacing: 10,
- maskBg: 'rgba(0,0,0,0.2)',
- bg: '#fff',
- color: '#e0e0e0',
- colorActive: '#838383',
- colorSelected: '#838383'
- },
- actives:activeTime,
- animation: true,
- cancel: {
- text:"",
- w: 60,
- h: 30,
- bg: 'widget://images/cancel.png',
- bgActive: 'widget://images/cancel.png'
- },
- ok: {
- text:"",
- w: 60,
- h: 30,
- bg: 'widget://images/finish.png',
- bgActive: 'widget://images/finish.png'
- },
- title: {
- text:Tit,
- size: 15,
- h: 44,
- bg: '#efefef'
- }
- }, function(ret, err) {
- if (ret) {
- if(ret.eventType=="ok"){
- var val=ret.level1+"-"+ret.level2+"-"+ret.level3+" 00:00:00";
- var time="";
- if(!timedata.year||timedata.year==""){
- time=ret.level1+"."+ret.level2+"."+ret.level3;
- timedata.year=time;
- selTime.dateFrom=val;
- selTime.dateTo="";
- var now=new Date(),arr=[];
- arr[0]=0;
- arr[1]=now.getMonth()+1;
- arr[2]=now.getDate()-1;
- showTime(that,timeJson,languages.issueDetails.remind27,undefined,arr);
- }else {
- // time=checkTime(ret.level1.replace("时",""))+":"+checkTime(ret.level2.replace("分",""));
- time=ret.level1+"."+ret.level2+"."+ret.level3;
- if(new Date(timedata.day).getTime()-new Date(timedata.year).getTime() <=0){
- api.toast({
- msg: languages.issueDetails.remind28,
- duration: 2000,
- location: 'bottom'
- });
- }else {
- timedata.day=time;
- selTime.dateTo=val;
- that.getElementsByTagName("input")[0].value=timedata.year+"-"+timedata.day;
- }
- timedata={};
- }
- }else {
- timedata={};
- if(!selTime.dateTo||selTime.dateTo==""){
- selTime={
- dateFrom:"",
- dateTo:""
- }
- }
- }
- } else {
- api.toast({
- msg: languages.issueDetails.remind29,
- duration: 2000,
- location: 'bottom'
- });
- }
- });
- }
- function checkTime(val) {
- var val=val;
- if((val+"").length==1){
- val="0"+val;
- }
- return val
- }
- }
- function popups(val,fn) {
- var dialogBox = api.require('dialogBox');
- dialogBox.alert({
- texts: {
- title: languages.all.list18,
- content: val,
- leftBtnTitle: languages.all.list2,
- rightBtnTitle: languages.all.list18
- },
- styles: {
- bg: '#fff',
- w: 300,
- title: {
- marginT: 20,
- icon: 'widget://res/gou.png',
- iconSize: 40,
- titleSize: 13,
- titleColor: '#000'
- },
- content: {
- color: '#000',
- size: 16
- },
- left: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h: 60,
- corner: 2,
- bg: '#f9f9f9',
- color: '#818181',
- size: 12
- },
- right: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h:60,
- corner: 2,
- bg: '#51c4d4',
- color: '#fff',
- size: 12
- }
- }
- }, function(ret) {
- fn(ret,dialogBox)
- });
- }
- function addExpense(that,expenseModel) {
- that.parentNode.parentNode.parentNode.getElementsByClassName("expenseDiv")[0].insertAdjacentHTML("beforeend",expenseModel);
- addExpenseFN();
- }
- function addExpenseFN() {
- var expenseFn=$api.domAll(".expenseFn");
- for(var j=0,len=expenseFn.length;j<len;j++){
- !function (i) {
- expenseFn[i].onclick=function () {
- showBox(this.getElementsByTagName("input")[0],money,true);
- }
- }(j)
- }
- }
- function addCapacity(that,capacityModel) {
- capacityDiv.insertAdjacentHTML("beforeend",capacityModel);
- addCapacityFn();
- }
- function addCapacityFn() {
- var capacityFn=$api.domAll(".capacityFn"),expenseFn=$api.domAll(".expenseFn");
- for(var i=0,len=capacityFn.length;i<len;i++){
- !function (i) {
- capacityFn[i].onclick=function () {
- showBox(this.getElementsByTagName("input")[0],unit,true);
- }
- }(i)
- }
- for(var j=0,len=expenseFn.length;j<len;j++){
- !function (i) {
- expenseFn[i].onclick=function () {
- showBox(this.getElementsByTagName("input")[0],money,true);
- }
- }(j)
- }
- }
- function delCapacity(that) {
- popups(languages.all.list22,function (ret,dialogBox) {
- if(ret.eventType == 'right') {
- api.showProgress({
- title: languages.all.list21+'...',
- text: languages.all.list25+'...',
- modal: true
- });
- var id={id:that.parentNode.parentNode.parentNode.getAttribute("rel")};
- api.ajax({
- url: pageUrl+'Price/del_pricedetail',
- method: 'post',
- timeout: 30,
- headers:{
- "content-type":"application/json"
- },
- dataType: 'json',
- returnAll: false,
- data: {
- body: id
- }
- }, function (ret, err) {
- api.hideProgress();
- if(ret.status=="200"){
- api.toast({
- msg: languages.all.list23,
- duration: 2000,
- location: 'bottom'
- });
- that.parentNode.parentNode.parentNode.parentNode.removeChild(that.parentNode.parentNode.parentNode);
- }else {
- that.parentNode.parentNode.parentNode.parentNode.removeChild(that.parentNode.parentNode.parentNode);
- }
- });
- dialogBox.close({
- dialogName: 'alert'
- });
- }else if (ret.eventType == 'left') {
- dialogBox.close({
- dialogName: 'alert'
- });
- }
- })
- }
- function showBox(that,data,bl) {
- var UIMultiSelector = api.require('UIMultiSelector');
- var height=40;
- if(height>=api.winHeight){
- height=api.winHeight
- }else {
- if(data.length>4){
- height=data.length*40
- }else {
- height=data.length*40+80
- }
- }
- if(data.length==0) {
- api.toast({
- msg: languages.all.list21,
- duration: 2000,
- location: 'bottom'
- });
- return;
- }
- UIMultiSelector.open({
- rect: {
- h: height
- },
- text: {
- title: '',
- leftBtn: '',
- rightBtn: '',
- selectAll: languages.all.list20
- },
- max: 0,
- singleSelection:bl,
- styles: {
- mask: 'rgba(0,0,0,0.2)',
- title: {
- bg: '#efefef',
- h: 44
- },
- leftButton: {
- w: 60,
- h: 30,
- marginT: 5,
- marginL: 8,
- bg:"widget://images/cancel.png"
- },
- rightButton: {
- w: 60,
- h: 30,
- marginT: 5,
- marginR: 8,
- bg:"widget://images/finish.png"
- },
- item: {
- h: 40,
- bg: '#fff',
- bgActive: '#fff',
- bgHighlight: '#fff',
- color: '#818181',
- active: '#818181',
- highlight: '#818181',
- size: 14,
- lineColor: '#efefef',
- textAlign: 'left',
- marginR:5
- },
- icon: {
- w: 20,
- h: 20,
- marginT: 11,
- marginH: 8,
- bg: 'widget://images/select.png',
- bgActive: 'widget://images/selected.png',
- align: 'left'
- }
- },
- animation: true,
- items: data
- }, function(ret, err) {
- if (ret) {
- if(ret.eventType=="clickRight"){
- var nameStr="",arr=[],arr2=[],tool=[];
- try{
- for(var i in ret.items){
- arr[i]={
- type:ret.items[i].id,
- name:ret.items[i].text
- }
- arr2.push(ret.items[i].id);
- if(i==ret.items.length-1||ret.items.length==1){
- nameStr+=ret.items[i].text;
- }else {
- nameStr+=ret.items[i].text+"、";
- }
- }
- console.log(that.className)
- if(~that.className.indexOf("list23Input")){
- var input=document.getElementsByClassName("list23Input");
- for(var i=0,len=input.length;i<len;i++){
- input[i].value=nameStr;
- input[i].setAttribute("rel",arr2[0]);
- }
- }else {
- that.value=nameStr;
- that.setAttribute("rel",arr2[0]);
- }
- if(that.parentNode.parentNode.id=="cyr"){
- if(ret.items[0]['tool']["boardNameCn"]){
- $api.setStorage("tool",[{id:0,text:ret.items[0]['tool']["boardNameCn"],status:'normal'}]);
- }else {
- $api.setStorage("tool",[{id:0,text:ret.items[0].text,status:'normal'}]);
- }
- $api.dom("#typename").onclick=function () {
- showBox(this.getElementsByTagName("input")[0],$api.getStorage("tool"),true)
- }
- }
- }catch (e){
- nameStr="";
- }
- UIMultiSelector.close();
- }else if(ret.eventType=="clickLeft"){
- UIMultiSelector.close();
- }
- } else {
- }
- });
- }
- function check(val,type,txt) {
- switch (type){
- case "null":
- if(!val){
- remindTxt(txt);
- return true;
- }
- break;
- case "num":
- if(val&&!(/^\d+$/g.test(val))){
- remindTxt(txt);
- return true;
- }else {
- var hour=$api.dom("#needHour").value;
- if((!val||val==0)&&!hour){
- api.toast({
- msg: languages.issueDetails.remind30,
- duration: 2000,
- location: 'bottom'
- });
- ifClick=false;
- return true;
- }
- }
- break;
- case "price":
- if(!val||!(/(^[\\+\\-]?[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/.test(val))){
- remindTxt(txt);
- return true;
- }
- break;
- case "hour":
- if(!(/^(([0-9])|(1\d)|(2[0-3]))$/.test(val))){
- remindTxt(txt);
- return true;
- }
- break;
- case "text":
- if(val.length>25){
- remindTxt(txt);
- return true;
- }
- break;
- }
- }
- function remindTxt(txt) {
- api.toast({
- msg: txt,
- duration: 2000,
- location: 'bottom'
- });
- ifClick=false;
- }
- function changeType(data,id){
- var div=$api.dom(id),input= $api.dom(div, 'input'),bl=false;
- switch (id){
- case "#pod":
- if($api.dom("#pol").getElementsByTagName('input')[0].getAttribute("rel")==data['id']){
- bl=true;
- }
- break;
- case "#pol":
- if($api.dom("#pod").getElementsByTagName('input')[0].getAttribute("rel")==data['id']){
- bl=true;
- }
- break;
- }
- if(bl){
- api.toast({
- msg: languages.issueDetails.remind31,
- duration: 2000,
- location: 'bottom'
- });
- return;
- }
- input.value=data['nameCn'];
- input.setAttribute("rel",data['id']);
- }
- </script>
- </body>
- </html>
|