123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- $(function(){
- var myScroll = null;
- myScroll=new IScroll(".scrollr",{
- scrollbars: true,
- fadeScrollbars:true,
- scrollbars: 'custom',
- shrinkScrollbars:'clip',
- tap:true
- });
- setTimeout(function () {
- myScroll.refresh();
- }, 100);
- $("#dweb").bind("blur", function() {
- var ids = $("#id").val();
- var temp = "";
- if (id != "") {
- temp = "&id=" + ids;
- }
- if($("#dweb")=="") {
- alert("dweb:"+$("#dweb").val());
- }
- haifmp.loadMobilePage("haifmp", "getZzdsSearchDweb.htm?mcid=" + $("#mcid").val() + "&cxeph=" + $("#dweb").val() + temp + "&date=" +$("#date").val());
- });
- //input[type='search']里面的val往左移动
- var k = $("input[type='search']").val();
- $("input[type='search']").focus(function(){
- $(".glyphicon-search").animate({left:"0.2rem"},250);
- $("input[type='search']").animate({"text-indent": '0.2rem'}, 250);
- if(k!=""){
- $(".glyphicon-search").animate({left:"0.2rem"},250);
- $("input[type='search']").animate({"text-indent": '0.2rem'}, 250);
- }
- });
- //选中耳标
- $(".chooseDweb,input").on("tap",function (e) {
- if (e && e.stopPropagation) {
- e.stopPropagation();
- } else {
- window.event.cancelBubble = true;
- }
- if ($(this).find("input[type='checkbox']").is(":checked")) {
- $(this).find(".checkbox").css({"transition":"background-color .5s ease"});
- $(this).find(".checkbox").css({"border-color":"#ddd","background-color":"#fff"});
- $(this).find("input[type='checkbox']").prop("checked", false);
- } else {
- $(this).find(".checkbox").css({"transition":"background-color .5s ease"});
- $(this).find(".checkbox").css({"border-color":"#4cd964","background-color":"#4cd964"});
- $(this).find("input[type='checkbox']").prop("checked", true);
- }
- });
-
- //模糊查询键盘enter键事件
- $("input[type='search']").on('keypress',function(e) {
- var keycode = e.keyCode;
- if(keycode=='13') {
- e.preventDefault();
- //请求搜索接口
- var ids = $("#id").val();
- var temp = "";
- if (id != "") {
- temp = "&id=" + ids;
- }
- if($("#dweb")=="") {
- alert("dweb:"+$("#dweb").val());
- }
- haifmp.loadMobilePage("haifmp", "getZzdsSearchDweb.htm?mcid=" + $("#mcid").val() + "&cxeph=" + $("#dweb").val() + temp + "&date=" +$("#date").val());
- return false;
- }
- });
- });
- /**
- * 返回
- */
- function backUrl() {
- var ids = $("#id").val();
- var temp = "";
- if (id != "") {
- temp = "&id=" + ids;
- }
- haifmp.loadMobilePage("haifmp", "hpSjlrDszzwhIndex.htm?mcid=" + $("#mcid").val() + "&id=" + $("#id").val() + temp + "&date=" +$("#date").val());
- }
- /**
- * 保存
- */
- function saveDweb() {
- var str = document.getElementsByName("checkbox");
- var dqzt = document.querySelectorAll("#dqzt");
- var ckStr = "";
- var xbStr = "";
- var dqztStr="";
- for(var i=0;i<str.length;i++) {
- if(str[i].checked) {
- ckStr+=str[i].value+",";
- dqztStr+=dqzt[i].innerText+",";
- //xbStr +=str[i].data("xb")+",";
-
- }
-
- }
- if(ckStr==null) {
- haifmp.loadMobilePage("haifmp", "hpSjlrDszzwhIndex.htm");
- }
- dweb=ckStr;
- jQuery('#zzdsForm').ajaxSubmit({
- dataType : 'json',
- data : {"mcid" : $("#mcid").val(),
- "dweb" : dweb ,
- "dqzt": dqztStr,
- //"xb" :xbStr
- },
- beforeSend:function() {//触发ajax请求开始时执行
- $('.finish').attr('onclick','javascript:void(0)');//改变提交按钮上的文字并将按钮设置为不可点击
- },
- success : function(msg, data) {
- // 保存成功
- if (msg.result=1) {
- alert("保存成功!");
- haifmp.loadMobilePage("haifmp", "hpSjlrDszzwhIndex.htm?mcid=" + $("#mcid").val());
-
- } else {
- alert(msg.msg);
- $('.finish').attr('onclick','submitOrder()');//改变提交按钮上的文字并将按钮设置为可点击
- }
- },
- error : function(data) {
- alert('网络繁忙,请稍后再试...');
- $('.finish').attr('onclick','submitOrder()');//改变提交按钮上的文字并将按钮设置为可点击
- },
- complete: function(msg, data)
- {
- //ajax请求完成时执行
- if(msg.result==1)
- {
- $('.finish').attr('onclick','javascript:void(0)');//改变提交按钮上的文字并将按钮设置为不可点击
- }
- }
- });
- }
|