aggregateSupplyOperation.blade.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <script>
  2. Vue.component('aggregateSupplyOperation', {
  3. props: {
  4. operationType:{
  5. type:Number|String,
  6. default:'',
  7. },
  8. operationOrder:{
  9. type:Object|String,
  10. default:{},
  11. },
  12. dialog_show:{
  13. type:Number,
  14. default:0,
  15. },
  16. },
  17. delimiters: ['[[', ']]'],
  18. data(){
  19. return{
  20. }
  21. },
  22. watch:{
  23. dialog_show(val) {
  24. if (this.operationType == 'jd-supplier-create-order') {
  25. this.createOrder(this.operationOrder.id);
  26. } else if( this.operationType == 'jd-supplier-unlock-order') {
  27. this.unlockOrder(this.operationOrder.id);
  28. }
  29. },
  30. },
  31. mounted: function(){
  32. },
  33. methods:{
  34. createOrder(id) {
  35. this.$http.post('{!! yzWebFullUrl('plugin.jd-supply.admin.order-list.create-order') !!}',{order_id:this.operationOrder.id}).then(function (response) {
  36. if (response.data.result) {
  37. this.$message({type: 'success',message: '操作成功!'});
  38. }
  39. else{
  40. this.$message({type: 'error',message: response.data.msg});
  41. }
  42. this.$emit('search');
  43. },function (response) {
  44. this.$message({type: 'error',message: response.data.msg});
  45. })
  46. },
  47. unlockOrder(id) {
  48. this.$http.post('{!! yzWebFullUrl('plugin.jd-supply.admin.order-list.unlock-order') !!}',{order_id:this.operationOrder.id}).then(function (response) {
  49. if (response.data.result) {
  50. this.$message({type: 'success',message: '解锁成功!'});
  51. }
  52. else{
  53. this.$message({type: 'error',message: response.data.msg});
  54. }
  55. this.$emit('search');
  56. },function (response) {
  57. this.$message({type: 'error',message: response.data.msg});
  58. })
  59. },
  60. },
  61. template: `<div></div>`,
  62. });
  63. </script>