ajun 5 лет назад
Родитель
Сommit
8df38e2583
1 измененных файлов с 14 добавлено и 11 удалено
  1. 14 11
      resources/views/maintenance/material/index.blade.php

+ 14 - 11
resources/views/maintenance/material/index.blade.php

@@ -39,18 +39,21 @@
         },
         methods:{
             destroy(id,index){
-                axios.delete('{{url("apiLocal/material/destroy")}}/'+id).then(res=>{
-                    if(res.data.success){
+                window.tempTip.setIndex(1099);
+                window.tempTip.confirm("是否删除当前耗材?",()=>{
+                    window.axios.delete('{{url("apiLocal/material/destroy")}}/'+id).then(res=>{
+                        if(res.data.success){
+                            tempTip.setDuration(3000);
+                            tempTip.showSuccess('删除成功');
+                            this.$delete(this.materials,index);
+                            return;
+                        }
                         tempTip.setDuration(3000);
-                        tempTip.showSuccess('删除成功');
-                        this.$delete(this.materials,index);
-                        return;
-                    }
-                    tempTip.setDuration(3000);
-                    tempTip.show(res.data.message);
-                }).catch(err=>{
-                    tempTip.setDuration(3000);
-                    tempTip.show(err);
+                        tempTip.show(res.data.message);
+                    }).catch(err=>{
+                        tempTip.setDuration(3000);
+                        tempTip.show(err);
+                    });
                 });
             },
             edit(material,i){