| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- @extends('layouts.base')
- @section('title', '基础设置')
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
- <style>
- .all{background:#eff3f6}
- .btn_shili{color: #FFAD56;margin-left: 20px}
- </style>
- <div class="all">
- <div id="app" v-cloak>
- <el-form ref="form_data" :model="form_data" label-width="15%">
- <!-- 页面设置 -->
- <div class="vue-head">
- <div class="vue-main-title">
- <div class="vue-main-title-left"></div>
- <div class="vue-main-title-content">基础设置</div>
- </div>
- <div class="vue-main-form">
- <el-form-item label="商品默认设置" prop="goods_plugin_type">
- <el-checkbox-group style="margin-top: 5px;" v-model="form_data.goods_plugin_type">
- <el-checkbox v-for="item in config" :key="item.plugin_id" :label="item.code">[[item.name]]</el-checkbox>
- </el-checkbox-group>
- <div style="font-size:12px;">
- 勾选后,发布商品时商品挂件会赋值默认设置,聚合供应链则会是导入新商品时赋值默认设置<br/>
- 同步默认值仅支持已勾选的商品类型
- </div>
- </el-form-item>
- </div>
- <el-form-item label="门店独立后台默认值">
- <el-switch v-model="form_data.store_cashier_no_premission_status" :active-value="1"
- :inactive-value="0"></el-switch>
- <div class="tip">门店独立后台无挂件权限时创建商品是否使用默认值,有挂件权限时不受此开关影响,需要商品默认设置勾选门店商品后才会生效</div>
- </el-form-item>
- <el-form-item label="门店前端默认值">
- <el-switch v-model="form_data.store_cashier_frontend_status" :active-value="1"
- :inactive-value="0"></el-switch>
- <div class="tip">门店前端创建商品是否使用默认值,需要商品默认设置勾选门店商品后才会生效</div>
- </el-form-item>
- </div>
- </el-form>
- <div class="vue-page">
- <div class="vue-center">
- <el-button type="primary" @click="submitForm('form_data')">保存设置</el-button>
- {{--<el-button @click="goBack">返回</el-button>--}}
- </div>
- </div>
- </div>
- </div>
- <script>
- var app = new Vue({
- el:"#app",
- delimiters: ['[[', ']]'],
- name: 'test',
- data() {
- return{
- form_data:{
- goods_plugin_type:[],
- store_cashier_no_premission_status:0,
- store_cashier_frontend_status:0,
- },
- config:[],
- }
- },
- created() {
- },
- mounted() {
- let result = this.viewReturn();
- this.__initial(result);
- // this.getData();
- },
- methods: {
- //视图返回数据
- viewReturn() {
- return {!! $data?:'{}' !!};
- },
- //初始化页面数据,请求链接
- __initial(data) {
- if (data.goods_plugin_type) {
- this.form_data.goods_plugin_type = data.goods_plugin_type;
- this.form_data.store_cashier_no_premission_status = data.store_cashier_no_premission_status;
- this.form_data.store_cashier_frontend_status = data.store_cashier_frontend_status;
- }
- this.config = data.config;
- console.log(data, this.form_data);
- },
- submitForm(formName) {
- console.log(this.form_data);
- this.$refs[formName].validate((valid) => {
- if (valid) {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.goods-default-value.admin.set.store') !!}',{data:this.form_data}).then(response => {
- if (response.data.result) {
- this.$message({type: 'success',message: '保存成功!'});
- location.reload();
- } else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- loading.close();
- },response => {
- loading.close();
- });
- }
- else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- },
- })
- </script>
- @endsection
|