Forráskód Böngészése

添加在途库存的点击完成 添加判断条件

lvhao 4 hónapja
szülő
commit
403d329bbe
1 módosított fájl, 41 hozzáadás és 23 törlés
  1. 41 23
      template/erp/whlabeltransport.html

+ 41 - 23
template/erp/whlabeltransport.html

@@ -110,30 +110,48 @@ var f = "";
 window.location.href = "/whlabeltransport/excelzh?excel=1&"+f;
 });
 $(".datatext").on('click',"td .ztwc",function() {
-	var id = $(this).data("id");
-	layx.load('loadId','操作中,请稍后',{shadable:0.6});
- $.ajax({
-        url: fdataurl+"/zj/",
-        data: "id="+id,
-        type: "POST",
-        dataType: "json",
-        success: function(a) {
-			layx.destroy('loadId');
-            if (a && a.success) {
-				$(".datatext #"+a.id).find("td .ztwc").hide();
-				$(".datatext #"+a.id).find("td .cz").html("已完成");
-				$(".datatext #"+a.id).find("td .wc").html(a.time);
-				$(".ts p").html(a.msg);
-                $(".ts").fadeIn();
-                setTimeout('$(".ts").fadeOut()', 800);
-				}
-             else {
-				 $(".ts p").html(a.msg);
-                $(".ts").fadeIn();
-                setTimeout('$(".ts").fadeOut()', 800);
-        }
-		}
+	var do_id = $(this).data("id");
+	//layx.load('loadId','操作中,请稍后',{shadable:0.6});
+
+    layx.confirm('提示','确定要点击完成吗',null,{
+        buttons:[
+            {
+                label:'确定',
+                callback:function(id, button, event){
+                    $.ajax({
+                        url: fdataurl+"/zj/",
+                        data: "id="+do_id,
+                        type: "POST",
+                        dataType: "json",
+                        success: function(a) {
+                            layx.destroy('loadId');
+                            if (a && a.success) {
+                                $(".datatext #"+a.id).find("td .ztwc").hide();
+                                $(".datatext #"+a.id).find("td .cz").html("已完成");
+                                $(".datatext #"+a.id).find("td .wc").html(a.time);
+                                $(".ts p").html(a.msg);
+                                $(".ts").fadeIn();
+                                setTimeout('$(".ts").fadeOut()', 800);
+                                }
+                            else {
+                                $(".ts p").html(a.msg);
+                                $(".ts").fadeIn();
+                                setTimeout('$(".ts").fadeOut()', 800);
+                        }
+                        }
+                    });
+                    layx.destroy(id);
+                }
+            },
+            {
+                label:'取消',
+                callback:function(id, button, event){
+                    layx.destroy(id);
+                }
+            }
+        ]
     });
+ 
 });
 </script>
 <script type="text/javascript" src="{$theme}js/laydate.js"></script>