orderOperationV.blade.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <script>
  2. Vue.component('orderOperationV', {
  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. cancel_send_show:false,// 取消发货弹窗
  21. cancel_send_con:"",//取消发货原因
  22. }
  23. },
  24. watch:{
  25. dialog_show(val) {
  26. if (this.operationType == 5) {
  27. this.cancelSend(this.operationOrder.id);
  28. }
  29. },
  30. },
  31. mounted: function(){
  32. },
  33. methods:{
  34. // 取消发货
  35. cancelSend(id) {
  36. this.cancel_send_show = true;
  37. this.cancel_send_con = "";
  38. this.cancel_send_id = id;
  39. console.log(id)
  40. },
  41. // 确认取消发货
  42. sureCancelSend() {
  43. let json = {
  44. // route:'order.operation.manualRefund',
  45. order_id:this.cancel_send_id,
  46. cancelreson:this.cancel_send_con,
  47. };
  48. console.log(json);
  49. let loading = this.$loading({target:document.querySelector("#cancel-send"),background: 'rgba(0, 0, 0, 0)'});
  50. this.$http.post('{!! yzWebFullUrl('order.vue-operation.cancel-send') !!}',json).then(function (response) {
  51. if (response.data.result) {
  52. this.$message({type: 'success',message: '关闭订单成功!'});
  53. }
  54. else{
  55. this.$message({type: 'error',message: response.data.msg});
  56. }
  57. loading.close();
  58. this.close_order_show = false;
  59. this.$emit('search');
  60. },function (response) {
  61. this.$message({type: 'error',message: response.data.msg});
  62. loading.close();
  63. this.close_order_show = false;
  64. })
  65. },
  66. },
  67. template: `
  68. <div>
  69. <!-- 取消发货 -->
  70. <el-dialog :visible.sync="cancel_send_show" width="750px" title="取消发货">
  71. <div style="height:300px;overflow:auto" id="cancel-send">
  72. <div style="color:#000;font-weight:500">取消发货原因</div>
  73. <el-input v-model="cancel_send_con" :rows="10" type="textarea"></el-input>
  74. </div>
  75. <span slot="footer" class="dialog-footer">
  76. <el-button @click="cancel_send_show = false">取 消</el-button>
  77. <el-button type="primary" @click="sureCancelSend">取消发货 </el-button>
  78. </span>
  79. </el-dialog>
  80. </div>
  81. `,
  82. });
  83. </script>