set.blade.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. .all{background:#eff3f6}
  7. .btn_shili{color: #FFAD56;margin-left: 20px}
  8. </style>
  9. <div class="all">
  10. <div id="app" v-cloak>
  11. <el-form ref="form_data" :model="form_data" label-width="15%">
  12. <!-- 页面设置 -->
  13. <div class="vue-head">
  14. <div class="vue-main-title">
  15. <div class="vue-main-title-left"></div>
  16. <div class="vue-main-title-content">基础设置</div>
  17. </div>
  18. <div class="vue-main-form">
  19. <el-form-item label="商品默认设置" prop="goods_plugin_type">
  20. <el-checkbox-group style="margin-top: 5px;" v-model="form_data.goods_plugin_type">
  21. <el-checkbox v-for="item in config" :key="item.plugin_id" :label="item.code">[[item.name]]</el-checkbox>
  22. </el-checkbox-group>
  23. <div style="font-size:12px;">
  24. 勾选后,发布商品时商品挂件会赋值默认设置,聚合供应链则会是导入新商品时赋值默认设置<br/>
  25. 同步默认值仅支持已勾选的商品类型
  26. </div>
  27. </el-form-item>
  28. </div>
  29. <el-form-item label="门店独立后台默认值">
  30. <el-switch v-model="form_data.store_cashier_no_premission_status" :active-value="1"
  31. :inactive-value="0"></el-switch>
  32. <div class="tip">门店独立后台无挂件权限时创建商品是否使用默认值,有挂件权限时不受此开关影响,需要商品默认设置勾选门店商品后才会生效</div>
  33. </el-form-item>
  34. <el-form-item label="门店前端默认值">
  35. <el-switch v-model="form_data.store_cashier_frontend_status" :active-value="1"
  36. :inactive-value="0"></el-switch>
  37. <div class="tip">门店前端创建商品是否使用默认值,需要商品默认设置勾选门店商品后才会生效</div>
  38. </el-form-item>
  39. </div>
  40. </el-form>
  41. <div class="vue-page">
  42. <div class="vue-center">
  43. <el-button type="primary" @click="submitForm('form_data')">保存设置</el-button>
  44. {{--<el-button @click="goBack">返回</el-button>--}}
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <script>
  50. var app = new Vue({
  51. el:"#app",
  52. delimiters: ['[[', ']]'],
  53. name: 'test',
  54. data() {
  55. return{
  56. form_data:{
  57. goods_plugin_type:[],
  58. store_cashier_no_premission_status:0,
  59. store_cashier_frontend_status:0,
  60. },
  61. config:[],
  62. }
  63. },
  64. created() {
  65. },
  66. mounted() {
  67. let result = this.viewReturn();
  68. this.__initial(result);
  69. // this.getData();
  70. },
  71. methods: {
  72. //视图返回数据
  73. viewReturn() {
  74. return {!! $data?:'{}' !!};
  75. },
  76. //初始化页面数据,请求链接
  77. __initial(data) {
  78. if (data.goods_plugin_type) {
  79. this.form_data.goods_plugin_type = data.goods_plugin_type;
  80. this.form_data.store_cashier_no_premission_status = data.store_cashier_no_premission_status;
  81. this.form_data.store_cashier_frontend_status = data.store_cashier_frontend_status;
  82. }
  83. this.config = data.config;
  84. console.log(data, this.form_data);
  85. },
  86. submitForm(formName) {
  87. console.log(this.form_data);
  88. this.$refs[formName].validate((valid) => {
  89. if (valid) {
  90. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  91. this.$http.post('{!! yzWebFullUrl('plugin.goods-default-value.admin.set.store') !!}',{data:this.form_data}).then(response => {
  92. if (response.data.result) {
  93. this.$message({type: 'success',message: '保存成功!'});
  94. location.reload();
  95. } else {
  96. this.$message({message: response.data.msg,type: 'error'});
  97. }
  98. loading.close();
  99. },response => {
  100. loading.close();
  101. });
  102. }
  103. else {
  104. console.log('error submit!!');
  105. return false;
  106. }
  107. });
  108. },
  109. },
  110. })
  111. </script>
  112. @endsection