//公众号: 声色视觉
//webSite: www.softboyo.cn
//date:2022-08-10
$(function(){GetDB(0)});$(".Search").click(function(a){GetServiceData("Searchorders/"+$(".tag").val(),function(a){Common(a)})});function GetDB(a){GetServiceData("orders/"+(void 0===a?"":a)+"/"+localStorage.getItem("caketoken"),function(a){null!=a.result[0]?(Common(a),0==$(".d-inline-block").val()&&$(".k3man").text("\u51fa\u5355"),1==$(".d-inline-block").val()&&$(".k3man").text("\u7b7e\u6536"),2==$(".d-inline-block").val()&&$(".k3man").parent().hide()):self.location="login.html"})}function Common(a){var d=$("#dataTable"),b=[],f="";b[0]='\x3ctr\x3e\x3ctd colspan\x3d"2" id\x3d"od"\x3e\u5355\u53f7\uff1a\x3cspan class\x3d"badge bg-danger"\x3e';b[1]="\x3c/span\x3e";b[2]="\uffe5";b[3]="\x3cbr\x3e\u7535\u8bdd\uff1a";b[4]="\x3cbr\x3e\u5730\u5740\uff1a";b[5]='\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd width\x3d"47%" id\x3d"statu"\x3e\u72b6\u6001\uff1a \x3cspan class\x3d"badge bg-danger badge-counter"\x3e';b[6]="\x3c/span\x3e\x3cbr\x3e\u65e5\u671f\uff1a";b[7]='\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"2" id\x3d"goods"\x3e';b[8]='\x3cbr\x3e \x3c/td\x3e\x3c/tr\x3e \x3ctr\x3e \x3ctd colspan \x3d "2" style \x3d "text-align: center"\x3e\x3cbutton class\x3d"k3man btn btn-primary py-0" onclick\x3d"modify(this)"\x3e\u51fa\u5355\x3c/button\x3e\x3c/td\x3e\x3c/tr\x3e';d.html("");a=a.result[0];for(var c=0;c<a.oid.length;c++){for(var e=a.oid[c],g="";e==a.oid[c];)g+=a.product[c]+"\uff1a"+a.quant[c]+" x \uffe5"+a.price[c].toFixed(2)+"\x3d"+(a.quant[c]*a.price[c]).toFixed(2)+"\x3cbr\x3e",c++;c--;f+=b[0]+a.oid[c]+b[1]+" "+a.statu[c]+b[2]+a.price[c]+b[3]+a.phone[c]+b[4]+a.address[c]+b[5]+a.express[c]+b[6]+$.datetime(a.purchasedate[c])+b[7]+g+b[8];d.html(f);e=a.express[c];"\u5f85\u53d1\u8d27"==e&&$(".k3man").text("\u51fa\u5355");"\u6d3e\u9001\u4e2d"==e&&$(".k3man").text("\u7b7e\u6536");"\u5df2\u5b8c\u6210"==e&&$(".k3man").parent().hide()}}function modify(a){var d=$(a).parent().parent().prev().prev().prev().children().children(".bg-danger").text(),b=$(a).parent().parent().prev().prev().children().children(".badge-counter");a=$(a).text();"\u5f85\u53d1\u8d27"==$(b).text()&&"\u51fa\u5355"==a&&GetServiceData("modify/"+d+"/0",function(a){a=a.result[0];0<a?($(b).text("\u6d3e\u9001\u4e2d"),msgbox("\u8ba2\u5355 "+d+" \u8fdb\u5165\u6d3e\u9001\u6a21\u5f0f")):msgbox("\u8ba2\u5355 "+d+" \u4fee\u6539\u5931\u8d25\uff01")});"\u6d3e\u9001\u4e2d"==$(b).text()&&"\u7b7e\u6536"==a&&GetServiceData("modify/"+d+"/1",function(a){a=a.result[0];0<a?($(b).text("\u5df2\u5b8c\u6210"),msgbox("\u8ba2\u5355 "+d+" \u4ea4\u6613\u5b8c\u6210")):msgbox("\u8ba2\u5355 "+d+" \u63d0\u4ea4\u5931\u8d25\uff01")});"\u6d3e\u9001\u4e2d"==$(b).text()&&"\u51fa\u5355"==a&&msgbox("\u8bf7\u5207\u6362\u81f3\u5728\u9014\u8ba2\u5355\u7c7b\u578b\u4e2d\u8fdb\u884c\u64cd\u4f5c");"\u5df2\u5b8c\u6210"==$(b).text()&&"\u51fa\u5355"==a&&msgbox("\u8ba2\u5355 "+d+" \u5df2\u5b8c\u6210")}$(".d-inline-block").change(function(a){a=$(".d-inline-block").val();GetDB(a)});$("#quit").click(function(a){localStorage.removeItem("caketoken")});