set-vue.blade.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. <link rel="stylesheet" href="{{resource_get('plugins/yz-supply/assent/css/album1.css?time='.time())}}">
  6. <div class="all">
  7. <div id="app" v-cloak>
  8. <div class="vue-head">
  9. <div class="top-title">
  10. <span :class="item.class" v-for="(item,index) in albumTopTitle" @click="skipUrl(item)" :key="index">[[item.name]]</span>
  11. </div>
  12. </div>
  13. <div class="vue-main">
  14. <div class="vue-main-form" style="margin-bottom: 130px;">
  15. <el-form ref="form" :model="form" label-width="15%">
  16. <div class="block">
  17. <div class="vue-main-title" style="margin-bottom:20px">
  18. <div class="vue-main-title-left"></div>
  19. <div class="vue-main-title-content">基础设置</div>
  20. <div class="vue-main-title-button">
  21. </div>
  22. </div>
  23. <el-form-item label="商城链接" >
  24. <el-input v-model="form.yz_shop_url" placeholder="商城链接" style="width:70%;"></el-input>
  25. <span style="" class='help-block'>
  26. 如果不填写,假如商品上传图片为本地,使用推送全部商品及批量更新一键更新等操作时会造成商品图片在中台系统不显示,会自动填写默认值,如果不需要修改点击确定即可
  27. </span>
  28. </el-form-item>
  29. <el-form-item label="自动下架云仓商品">
  30. <template>
  31. <el-switch
  32. v-model="form.auto_off_shelf_goods"
  33. active-value="0"
  34. inactive-value="1"
  35. >
  36. </el-switch>
  37. </template>
  38. <div>商品下架时自动下架云仓商品</div>
  39. </el-form-item>
  40. <el-form-item label="推送成功自动申请上架">
  41. <template>
  42. <el-switch
  43. v-model="form.auto_on_shelf_goods"
  44. active-value="1"
  45. inactive-value="0"
  46. >
  47. </el-switch>
  48. </template>
  49. </el-form-item>
  50. <div style="height: 50px;"></div>
  51. </div>
  52. </div>
  53. <div class="vue-page">
  54. <div class="vue-center">
  55. <el-button type="primary" @click="submit">保存设置</el-button>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <script>
  63. var vm = new Vue({
  64. el: "#app",
  65. delimiters: ['[[', ']]'],
  66. data() {
  67. return {
  68. albumTopTitle: [
  69. {
  70. id: 1,
  71. name: "基础设置",
  72. class:"album-name",
  73. url:"{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-set.index') !!}"
  74. },
  75. {
  76. id: 2,
  77. name: "分类匹配",
  78. class:"album-name-against",
  79. url:"{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-category.index') !!}"
  80. },
  81. {
  82. id: 3,
  83. name: "运费模板",
  84. class:"album-name-against",
  85. url:"{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-dispatch.index') !!}"
  86. },
  87. ],
  88. form:{
  89. yz_shop_url:"",
  90. market_price_method:0,
  91. market_price_radio:100,
  92. price_radio:100,
  93. cost_price_radio:100,
  94. guide_price_method:0,
  95. market_price_radio_guide:100,
  96. price_radio_guide:100,
  97. cost_price_radio_guide:100,
  98. settle_price_method:0,
  99. market_price_radio_settle:100,
  100. price_radio_settle:100,
  101. cost_price_radio_settle:100,
  102. auto_off_shelf_goods:0,
  103. auto_on_shelf_goods:0,
  104. },
  105. }
  106. },
  107. mounted() {
  108. this.getData();
  109. },
  110. methods: {
  111. skipUrl(item){
  112. window.location.href = item.url
  113. },
  114. getData(){
  115. this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-set.index') !!}').then(function (response){
  116. if(response.data.data != null){
  117. this.form = response.data.data;
  118. }
  119. if(this.form.yz_shop_url == ""){
  120. this.form.yz_shop_url = window.location.origin;
  121. }
  122. },function (response) {
  123. this.$message({message: response.data.msg,type: 'error'});
  124. })
  125. },
  126. submit() {
  127. let loading = this.$loading({
  128. target: document.querySelector(".content"),
  129. background: 'rgba(0, 0, 0, 0)'
  130. });
  131. this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-set.save') !!}', {'set': this.form}).then(function (response) {
  132. if (response.data.result) {
  133. this.$message({message: response.data.msg, type: 'success'});
  134. } else {
  135. this.$message({message: response.data.msg, type: 'error'});
  136. }
  137. loading.close();
  138. location.reload();
  139. }, function (response) {
  140. this.$message({message: response.data.msg, type: 'error'});
  141. })
  142. },
  143. },
  144. });
  145. </script>
  146. @endsection