123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541 |
- /* 批量打印提示 */
- $(".printing").click(function() {
- var a = "";
- $(".datatext input[name='check']:checked").each(function() {
- a = a + $(this).val()+",";
- });
- if (a)
- {
- if($("select[name='printer']").children("option:selected").val() == "")
- {
- $(".ts p").html("请选择打印机!");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 1000);
- }
- else
- {
- $(".systemwindow div p:eq(0)").text("是否确认批量打印所选内容?");
- $(".systemwindow div p:eq(1)").html("<p><font id='printingon'>确 定</font><font class='esc'>取 消</font></p>");
- $(".systemwindow").show();
- }
- }
- else
- {
- $(".ts p").html("请勾选需要打印的内容");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 1000);
- }
- });
- $(".systemwindow .esc").click(function() {
- $(".systemwindow").hide();
- });
- $(".systemwindow").on('click',".esc",function() {
- $(".systemwindow").hide();
- });
- /* 批量打印开始 */
- $(".systemwindow").on('click',"#printingon",function() {
- $(".systemwindow").hide();
- $(".systemwindow div p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> 正在处理打印信息,请稍后...");
- $(".systemwindow div p:eq(1)").html("");
- $(".systemwindow").show();
- var a = "";var i = 0;
- $(".datatext input[name='check']:checked").each(function() {
- a = a+$(this).val()+',';
- i++;
- });
- ajax(i-1,a);
- });
- function ajax(num,list){
- $.ajax({
- url: "/systemprint/printing/",
- data: "s=" + list+"&n=" + num,
- type: "POST",
- dataType: "json",
- timeout: 600001,
- success: function(c) {
- if (c.success) {
- if(c.rows['type'] == 1)
- {
- wprinter.pdffhd(c.rows);
- }
- else if(c.rows['type'] == 2)
- {
- wprinter.fhd(c.rows);
- }
-
- if(c.rows['n'] > -1)
- {
- ajax(c.rows['n'],c.rows['data']);
- }
- else
- {
- wprinter.sound("打印完成")
- $(".systemwindow div p:eq(0)").html("打印完成!");
- $(".systemwindow div p:eq(1)").html("<font class='printok'>确 定</font>");
- $(".systemwindow").show();
-
- }
- }
- else
- {
- $(".systemwindow").hide();
- layx.alert('错误',c.msg,function(id,button){
- $(".search span").click();
- },{dialogIcon:'error'});
- }
- },
- error: function (textStatus) {
- wprinter.sound("错误,请求数据超时!请重试")
- $(".systemwindow").hide();
- layx.alert('错误','请求数据超时!请重试',function(id,button){
- $(".search span").click();
- },{dialogIcon:'error'});
- },
- });
- }
- function outbound(data) {
- $(".search .number").val("");
- $(".search .waybill").val("");
- $.ajax({
- url: url+"outbound/",
- data: "number="+$("input[name='outbound']").val()+"&id="+LYlink+"&type="+$("select[name='type']").children("option:selected").val()+"&express="+$("select[name='express']").children("option:selected").val(),
- type: "POST",
- dataType: "json",
- success: function(b)
- {
- searchspan(1);
- $(".systemwindow").hide();
- if (b && b.success)
- {
- if(b.music == '1')
- {
- $("#music_d")[0].play();
- }
- $(".outbound").html(b.msg);
- $("#outbound").val("");
- $("#outbound").focus();
- }
- else
- {
- $("#outbound").blur();
- $("#music_c")[0].play();
- $(".systemwindow div p:eq(0)").html(b.msg);
- $(".systemwindow div p:eq(1)").html("<font class='wcoutbound'>确 定</font>");
- $(".systemwindow").show();
- $("#outbound").val("");
- }
- }
- });
- }
- $(".obdel").click(function() {
- var a = "";
- $(".datatext input[name='check']:checked").each(function() {
- a = a + $(this).val()+",";
- });
- if (a) {
- $(".systemwindow div p:eq(0)").text("是否确认删除所选内容?");
- $(".systemwindow div p:eq(1)").html("<p><font id='obdelgo'>确 定</font><font class='esc'>取 消</font></p>");
- $(".systemwindow").show();
- }
- else
- {
- $(".ts p").html("请勾选需要删除的内容");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 1000);
- }
- });
- $(".systemwindow").on('click',"#obdelgo",function() {
- $(".systemwindow").hide();
- $(".systemwindow div p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> 删除中,请稍后...");
- $(".systemwindow div p:eq(1)").html("");
- $(".systemwindow").show();
- var a = "";var i = 0;
- $(".datatext input[name='check']:checked").each(function() {
- a = a+$(this).val()+',';
- i++;
- });
- $.ajax({
- url: "/systembound/del",
- data: "delarr="+a,
- type: "POST",
- dataType: "json",
- success: function(b)
- {
- $(".systemwindow").hide();
- if (b && b.success)
- {
- searchspan(1);
- $(".outbound").html(b.data);
- $("#outbound").blur();
- $(".systemwindow div p:eq(0)").html("删除成功!");
- $(".systemwindow div p:eq(1)").html("<font class='wcoutbound'>确 定</font>");
- $(".systemwindow").show();
- }
- else
- {
- $("#outbound").blur();
- $(".systemwindow div p:eq(0)").html(b.msg);
- $(".systemwindow div p:eq(1)").html("<font class='wcoutbound'>确 定</font>");
- $(".systemwindow").show();
- }
- }
- });
- });
- /* 清空并聚焦出库input */
- $(".systemwindow").on('click',".wcsj",function() {
- $("#orderinfo").val("");
- $("#weight").val("");
- $(".systemwindow").find(".gth").remove();
- $("#orderinfo").focus();
- $(".systemwindow").hide();
- });
- $(".systemwindow").on('click',".wcoutbound",function() {
- $("#outbound").focus();
- $(".systemwindow").hide();
- });
- $(".systemwindow").on('click',".printok",function() {
- $(".search span").click();
- $(".systemwindow").hide();
- });
- /* 更改出库信息 */
- function win() {
- if(typeof editurl != "undefined")
- {
- $(".datatext tr").each(function() {
- $(this).find("td:eq("+editdj+")").html("<h9 class='window' data-h='"+editurl+$(this).attr('id')+"' data-t='"+editt+"'>"+$(this).find("td:eq("+editdj+")").text()+"</h9>");
- });
- }
- }
- $(document).keyup(function(event){
- if(event.keyCode ==13){
- if(typeof systemfout != "undefined")
- {
- if($("select[name='printer']").children("option:selected").val() == "")
- {
- $("#music_c")[0].play();
- $(".systemwindow div p:eq(0)").html('需要先选择打印机!');
- $(".systemwindow div p:eq(1)").html("<font class='wcsj'>确 定</font>");
- $(".systemwindow").show();
- $("#orderinfo").val("");
- $("#orderinfo").focus();
- return;
- }
- $("#orderinfo").blur();
- $(".systemwindow div p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> 处理中,请稍后...");
- $(".systemwindow div p:eq(1)").html("");
- $(".systemwindow").show();
- $.ajax({
- url: "/systemfout/fout/",
- data: "order="+$("#orderinfo").val()+"&weight="+$("#weight").val(),
- type: "POST",
- dataType: "json",
- success: function(a) {
- $(".systemwindow").hide();
- if (a && a.success)
- {
- if(typeof a.yd != "undefined")
- {
- $("#orderinfo").blur();
- $("#music_c")[0].play();
- $("#music_print")[0].play();
- $(".tyrows p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> 此运单已过期,系统打印处理中,请勿关闭!");
- $(".tyrows p:eq(1)").html("");
- $(".tyrows").show();
- $.ajax({
- url: "/systemfout/fedexhz/",
- data: "id="+a.id+"&name="+a.name+"&express="+a.express,
- type: "POST",
- dataType: "json",
- success: function(b)
- {
- $(".systemwindow").hide();
- if (b && b.success)
- {
- wprinter.pdf(b.data)
- setTimeout(function(){
- $("#music_print_ok")[0].play();
- $(".tyrows").hide();
- $(".systemwindow").hide();
- $("#music_d")[0].play();
- $(".systemwindow div p:eq(0)").html('运单打印完成,请更换为新运单后再次操作出库');
- $(".systemwindow div p:eq(1)").html("<font class='wcsj'>确 定</font>");
- $(".systemwindow").show();
- $("#orderinfo").val("");
- $("#orderinfo").focus();
- },7000);
- }
- else
- {
- $(".tyrows").hide();
- $("#music_c")[0].play();
- wprinter.sound(b.msg);
- $(".systemwindow div p:eq(0)").html(b.msg);
- $(".systemwindow div p:eq(1)").html("<font class='wcsj'>确 定</font>");
- $(".systemwindow").show();
- $("#orderinfo").val("");
- $("#orderinfo").focus();
- }
- }
- });
- }
- else
- {
- $("#music_d")[0].play();
- $("#orderinfo").val("");
- $("#weight").val("");
- $(".search span").click();
- $("#orderinfo").focus();
- }
- }
- else
- {
- $("#music_c")[0].play();
- wprinter.sound(a.msg);
- $(".systemwindow div p:eq(0)").html(a.msg);
- $(".systemwindow div p:eq(1)").html("<font class='wcsj'>确 定</font>");
- $(".systemwindow").prepend("<p class='gth' style='font-size: 200px;color: #F00;font-weight: bolder;text-align: center;'>X</p>");
- $(".systemwindow").show();
- $("#orderinfo").val("");
- //$("#orderinfo").focus();
- }
- }
- });
- }
- if(typeof systembound != "undefined")
- {
- $(".search .number").val("");
- $(".search .waybill").val("");
- $.ajax({
- url: "/systembound/out",
- data: "number="+$("input[name='outbound']").val()+"&type="+$("select[name='type']").children("option:selected").val()+"&express="+$("select[name='express']").children("option:selected").val(),
- type: "POST",
- dataType: "json",
- success: function(b)
- {
- searchspan(1);
- $(".systemwindow").hide();
- if (b && b.success)
- {
- if(b.music == '1')
- {
- $("#music_d")[0].play();
- }
- $(".outbound").html(b.msg);
- $("#outbound").val("");
- $("#outbound").focus();
- }
- else
- {
- $("#outbound").blur();
- $("#music_c")[0].play();
- wprinter.sound(b.msg);
- $(".systemwindow div p:eq(0)").html(b.msg);
- $(".systemwindow div p:eq(1)").html("<font class='wcoutbound'>确 定</font>");
- $(".systemwindow").show();
- $("#outbound").val("");
- }
- }
- });
- }
- if(typeof systemretreat != "undefined")
- {
- if($("select[name='printer']").children("option:selected").val() == "")
- {
- $("#music_c")[0].play();
- $(".systemwindow div p:eq(0)").html('需要先选择打印机!');
- $(".systemwindow div p:eq(1)").html("<font class='wcsj'>确 定</font>");
- $(".systemwindow").show();
- $("#orderinfo").val("");
- $("#orderinfo").focus();
- return;
- }
- $("#orderinfo").blur();
- $(".systemwindow div p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> 处理中,请稍后...");
- $(".systemwindow div p:eq(1)").html("");
- $(".systemwindow").show();
- $.ajax({
- url: "/systemretreat/out/",
- data: "order="+$("#orderinfo").val()+"&weight="+$("#weight").val(),
- type: "POST",
- dataType: "json",
- success: function(a) {
- $(".systemwindow").hide();
- if (a && a.success)
- {
- $("#music_d")[0].play();
- $("#orderinfo").val("");
- $("#weight").val("");
- $(".search span").click();
- $("#orderinfo").focus();
- }
- else
- {
- $("#music_c")[0].play();
- wprinter.sound(a.msg);
- $(".systemwindow div p:eq(0)").html(a.msg);
- $(".systemwindow div p:eq(1)").html("<font class='wcsj'>确 定</font>");
- $(".systemwindow").prepend("<p class='gth' style='font-size: 200px;color: #F00;font-weight: bolder;text-align: center;'>X</p>");
- $(".systemwindow").show();
- $("#orderinfo").val("");
- //$("#orderinfo").focus();
- }
- }
- });
- }
- }
- });
- $(".excel").click(function() {
- var f = "";
- $(".select").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
- });
- $("input:text").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("input:hidden").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- var t = "";var i = 0;
- $(".datatitle td").each(function() {
- if(i>0)
- {
- t = t + "<td>" + $(this).text() + "</td>";
- }
- i++;
- });
- var a = "";
- $(".datatext input[name='check']:checked").each(function() {
- a = a + $(this).val()+",";
- });
- f = f + "excel=1&a="+a+"&t="+t;
- window.location.href = "/systemfout/excel?fexcel="+$("select[name=fexcel]").find("option:selected").val()+"&"+f;
- $("select[name=fexcel] option:eq(0)").prop('selected','selected');
- });
- $(".cpexcel").click(function() {
- var f = "";
- $(".select").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
- });
- $("input:text").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("input:hidden").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- var t = "";var i = 0;
- $(".datatitle td").each(function() {
- if(i>0)
- {
- t = t + "<td>" + $(this).text() + "</td>";
- }
- i++;
- });
- var a = "";
- $(".datatext input[name='check']:checked").each(function() {
- a = a + $(this).val()+",";
- });
- f = f + "excel=1&a="+a+"&t="+t;
- window.location.href = "/systemfout/cpexcel?fexcel="+$("select[name=fexcel]").find("option:selected").val()+"&"+f;
- $("select[name=fexcel] option:eq(0)").prop('selected','selected');
- });
- $(".exceldy").click(function() {
- var f = "";
- $(".select").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
- });
- $("input:text").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("input:hidden").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- var t = "";var i = 0;
- $(".datatitle td").each(function() {
- if(i>0)
- {
- t = t + "<td>" + $(this).text() + "</td>";
- }
- i++;
- });
- var a = "";
- $(".datatext input[name='check']:checked").each(function() {
- a = a + $(this).val()+",";
- });
- f = f + "excel=1&a="+a+"&t="+t;
- window.location.href = "/systemprint//exceldy?fexcel=1&"+f;
- $("select[name=fexcel] option:eq(0)").prop('selected','selected');
- });
- $(".dowot").click(function() {
- var f = "";
- $(".select").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
- });
- $("input:text").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("input:hidden").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- window.location.href = "/systembound/excel?fexcel=1&"+f;
- $("select[name=fexcel] option:eq(0)").prop('selected','selected');
- });
- /* 时间计算 */
- function getBeforeDate(){//n为你要传入的参数,当前为0,前一天为-1,后一天为1
- var myDate = new Date;
- var year = myDate.getFullYear(); //获取当前年
- var mon = myDate.getMonth() + 1; //获取当前月
- var date = myDate.getDate(); //获取当前日
- var h = myDate.getHours();//获取当前小时数(0-23)
- var m = myDate.getMinutes();//获取当前分钟数(0-59)
- var s = myDate.getSeconds();//获取当前秒
- var week = myDate.getDay();
- var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
- s = year + '-' + mon + '-' + date + ' ' + h + ':' + m;
- return s ;
- }
- $(".obadd").click(function() {
- $(".boundtj div p:eq(0)").html('<label>仓库:<select name="type" class="select">'+$("select[name=type]").html()+'</select></label><label>快递:<select name="express" class="select">'+$("select[name=express]").html()+'</select></label><label>编号:<input value="" name="number" type="text"></label><label>运单:<input value="" name="waybill" type="text"></label><label>时间:<input id="time" value="" name="time" type="text" onclick="laydate({istime: true,format:\'YYYY-MM-DD hh:mm\'})" readonly></label>');
- $(".boundtj div p:eq(1)").html("<font class='obaddgo'>确 定</font><font class='esc'>取 消</font>");
- $(".boundtj label #time").val(getBeforeDate());
- $(".boundtj").show();
-
- });
- $(".boundtj").on('click',".obaddgo",function() {
- var f = "";
- $(".boundtj .select").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
- });
- $(".boundtj input:text").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $.ajax({
- url: "/systembound/add",
- data: f,
- type: "POST",
- dataType: "json",
- success: function(c) {
- if (c && c.success)
- {
- searchspan(1);
- $(".boundtj p").html("");
- $(".boundtj").hide();
- $(".boundtj div p:eq(0)").html(c.msg);
- $(".boundtj div p:eq(1)").html("<font class='esc'>确 定</font>");
- $(".boundtj").show();
- }
- else {
- $(".ts p").html(c.msg);
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 1000);
- }
- }
- });
- });
- $(".boundtj").on('click',".esc",function() {
- $(".boundtj p").html("");
- $(".boundtj").hide();
- });
|