all-set.blade.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. @extends('layouts.base')
  2. @section('title', '折扣全局设置')
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <style>
  6. .el-tabs__item,.is-top{font-size:16px}
  7. .el-tabs__active-bar { height: 3px;}
  8. </style>
  9. <div class="all">
  10. <div id="app" v-cloak>
  11. <div class="vue-nav">
  12. <el-tabs v-model="activeName" @tab-click="handleClick">
  13. <el-tab-pane label="折扣全局设置" name="1"></el-tab-pane>
  14. <el-tab-pane label="折扣设置" name="2"></el-tab-pane>
  15. <el-tab-pane label="运费批量设置" name="3"></el-tab-pane>
  16. </el-tabs>
  17. </div>
  18. <div class="vue-main">
  19. <div class="vue-main-title">
  20. <div class="vue-main-title-left"></div>
  21. <div class="vue-main-title-content">折扣全局设置</div>
  22. </div>
  23. <div class="vue-main-form">
  24. <el-form ref="form" :model="form" :rules="rules" label-width="15%">
  25. <el-form-item label="折扣类型" prop="type">
  26. <el-radio v-model.number="form.type" :label="0">商品现价</el-radio>
  27. <el-radio v-model.number="form.type" :label="1">商品原价</el-radio>
  28. </el-form-item>
  29. </el-form>
  30. </div>
  31. </div>
  32. <!-- 分页 -->
  33. <div class="vue-page">
  34. <div class="vue-center">
  35. <el-button type="primary" @click="submitForm('form')">保存设置</el-button>
  36. <!-- <el-button @click="goBack">返回</el-button> -->
  37. </div>
  38. </div>
  39. <!--end-->
  40. </div>
  41. </div>
  42. <script>
  43. var vm = new Vue({
  44. el:"#app",
  45. delimiters: ['[[', ']]'],
  46. data() {
  47. let type = JSON.parse('{!! $set !!}');
  48. return{
  49. form:{
  50. type:0,
  51. ...type
  52. },
  53. type:type,
  54. submit_loading:false,
  55. activeName:"1",
  56. rules: {
  57. },
  58. }
  59. },
  60. methods: {
  61. handleClick(val) {
  62. console.log(val.name)
  63. if(val.name == 1) {
  64. window.location.href = `{!! yzWebFullUrl('discount.batch-discount.allSet') !!}`;
  65. }
  66. else if(val.name == 2) {
  67. window.location.href = `{!! yzWebFullUrl('discount.batch-discount.index') !!}`;
  68. }
  69. else if(val.name == 3) {
  70. window.location.href = `{!! yzWebFullUrl('discount.batch-dispatch.freight') !!}`;
  71. }
  72. },
  73. submitForm(formName) {
  74. this.$refs[formName].validate((valid) => {
  75. if (valid) {
  76. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  77. this.$http.post("{!! yzWebUrl('discount.batch-discount.all-set') !!}",{'form_data':this.form}).then(response => {
  78. if (response.data.result) {
  79. this.$message({type: 'success',message: '操作成功!'});
  80. window.location.href='{!! yzWebFullUrl('discount.batch-discount.allSet') !!}';
  81. } else {
  82. this.$message({message: response.data.msg,type: 'error'});
  83. }
  84. loading.close();
  85. },response => {
  86. loading.close();
  87. });
  88. }
  89. else {
  90. console.log('error submit!!');
  91. return false;
  92. }
  93. });
  94. },
  95. },
  96. });
  97. </script>
  98. @endsection