|
|
@@ -25,7 +25,20 @@
|
|
|
materials:{!! $materials->toJson() !!}['data']
|
|
|
},
|
|
|
methods:{
|
|
|
-
|
|
|
+ destroy($id){
|
|
|
+ axios.delete('api/material/destroy',{'id':$id}).then(res=>{
|
|
|
+ if(res.data.success){
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.showSuccess('删除成功');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show(res.data.message);
|
|
|
+ }).error(err=>{
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show(err);
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
</script>
|