浏览代码

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-tenant-frontend

gqx 2 年之前
父节点
当前提交
cecf775710

+ 215 - 0
src/views/settings/components/advertContentList.vue

@@ -0,0 +1,215 @@
+<template>
+    <a-card :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                </a-row>
+            </a-form>
+        </div>
+        <!-- 查询区域-END -->
+
+        <!-- 操作按钮区域 -->
+        <div class="table-operator">
+            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+
+
+            <a-dropdown v-if="selectedRowKeys.length > 0">
+                <!--                <a-menu slot="overlay">-->
+                <!--                    <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
+                <!--                </a-menu>-->
+                <!--                <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
+                <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
+            </a-dropdown>
+        </div>
+
+        <!-- table区域-begin -->
+        <div>
+            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+            </div>
+
+            <a-table
+                    ref="table"
+                    size="middle"
+                    :scroll="{x:true}"
+                    bordered
+                    rowKey="id"
+                    :columns="columns"
+                    :dataSource="dataSource"
+                    :pagination="ipagination"
+                    :loading="loading"
+                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+                    class="j-table-force-nowrap"
+                    @change="handleTableChange">
+
+                <template slot="htmlSlot" slot-scope="text">
+                    <div v-html="text"></div>
+                </template>
+                <span slot="status" slot-scope="text,record">
+                    <a-tag v-if="text == 1" color="green">启用</a-tag>
+                    <a-tag v-else color="red">禁用</a-tag>
+                </span>
+
+                <span slot="action" slot-scope="text, record">
+                    <a-popconfirm
+                            placement="top"
+                            :title="record.status===1? '确定禁用?':'确定启用?'"
+                            @confirm="() => handleStatus(record)">
+                    <a>{{record.status == 1 ? "禁用":"启用"}}</a>
+                  </a-popconfirm>
+                    <a-divider type="vertical" />
+                  <a-dropdown>
+                    <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+                    <a-menu slot="overlay">
+                      <a-menu-item>
+                          <a @click="handleEdit(record)">修改</a>
+                      </a-menu-item>
+                      <a-menu-item>
+                        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                          <a>删除</a>
+                        </a-popconfirm>
+                      </a-menu-item>
+                    </a-menu>
+                  </a-dropdown>
+        </span>
+
+            </a-table>
+        </div>
+
+        <advert-modal ref="modalForm" @ok="modalFormOk"></advert-modal>
+    </a-card>
+</template>
+
+<script>
+
+    import '@/assets/less/TableExpand.less'
+    import { mixinDevice } from '@/utils/mixin'
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+    import advertModal from './modules/advertContentModal'
+    import { httpAction, getAction } from '@/api/manage'
+
+    export default {
+        name: 'advertContentList',
+        mixins:[JeecgListMixin, mixinDevice],
+        components: {
+            advertModal
+        },
+        data () {
+            return {
+                description: 'bus_advert_content_info管理页面',
+                // 表头
+                columns: [
+                    {
+                        title:'标题',
+                        align:"center",
+                        dataIndex: 'title'
+                    },
+                    {
+                        title:'内容',
+                        align:"center",
+                        dataIndex: 'content'
+                    },
+                    {
+                        title:'状态',
+                        align:"center",
+                        dataIndex: 'status',
+                        scopedSlots: { customRender: 'status' },
+                    },
+                    {
+                        title:'排序',
+                        align:"center",
+                        dataIndex: 'orderBy'
+                    },
+                    {
+                        title: '操作',
+                        dataIndex: 'action',
+                        align:"center",
+                        fixed:"right",
+                        width:147,
+                        scopedSlots: { customRender: 'action' }
+                    }
+                ],
+                url: {
+                    list: "/business/busAdvertContent/list",
+                    delete: "/business/busAdvertContent/delete",
+                    deleteBatch: "/business/busAdvertContent/deleteBatch",
+                    exportXlsUrl: "/business/busAdvertContent/exportXls",
+                    importExcelUrl: "business/busAdvertContent/importExcel",
+
+                },
+                dictOptions:{},
+                superFieldList:[],
+            }
+        },
+        created() {
+            this.getSuperFieldList();
+        },
+        computed: {
+            importExcelUrl: function(){
+                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+            },
+        },
+        methods: {
+            initDictConfig(){
+            },
+            getSuperFieldList(){
+                let fieldList=[];
+                fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
+                fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
+                fieldList.push({type:'string',value:'title',text:'广告标题'})
+                fieldList.push({type:'string',value:'content',text:'广告内容'})
+                fieldList.push({type:'int',value:'orderBy',text:'排序'})
+                fieldList.push({type:'int',value:'status',text:'状态(0-禁用;1-启用)'})
+                fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
+                this.superFieldList = fieldList
+            },
+            handleStatus(record){
+                var status = record.status;
+                if (record.status === 1) {
+                    status = 0;
+                } else {
+                    status = 1;
+                }
+                var updateObj = {
+                    id: record.id,
+                    status: status
+                }
+                var that = this;
+                console.log(that)
+                this.confirmLoading = true;
+                var values = JSON.parse(JSON.stringify(updateObj))
+                console.log(values)
+                httpAction('/business/busAdvertContent/edit',values,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success(res.message);
+                        that.$emit('ok');
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+                // ContractInfoChangeStatus(values).then((res) => {
+                //     if (res.success) {
+                //         this.$message.success('操作成功')
+                //         this.confirmLoading = false
+                //         this.$emit('ok', values)
+                //         this.$refs.table.refresh()
+                //     } else {
+                //         this.$message.error('操作失败:' + res.message)//  + res.message
+                //     }
+                // }).finally((res) => {
+                //     this.confirmLoading = false
+                // })
+            },
+            handleBatchDelete(){
+
+            }
+        }
+    }
+</script>
+<style scoped>
+    @import '~@assets/less/common.less';
+</style>

+ 194 - 0
src/views/settings/components/advertList.vue

@@ -0,0 +1,194 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+<!--        <a-menu slot="overlay">-->
+<!--          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
+<!--        </a-menu>-->
+<!--        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
+        <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="logoSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="50px" alt="" style="max-width:100px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <span slot="status" slot-scope="text,record">
+            <a-tag v-if="text == 1" color="green">启用</a-tag>
+            <a-tag v-else color="red">禁用</a-tag>
+        </span>
+        <span slot="type" slot-scope="text,record">
+            <a-tag v-if="text == 1" color="green">小程序首页</a-tag>
+            <a-tag v-else-if="text == 2" color="green">后台登录</a-tag>
+            <a-tag v-else-if="text == 3" color="green">商城首页</a-tag>
+        </span>
+
+        <span slot="action" slot-scope="text, record">
+            <a-popconfirm
+                    placement="top"
+                    :title="record.status===1? '确定禁用?':'确定启用?'"
+                    @confirm="() => handleStatus(record)">
+            <a>{{record.status == 1 ? "禁用":"启用"}}</a>
+          </a-popconfirm>
+            <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                  <a @click="handleEdit(record)">修改</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <advert-modal ref="modalForm" @ok="modalFormOk"></advert-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import advertModal from './modules/advertModal'
+
+  export default {
+    name: 'BusAdvertList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      advertModal
+    },
+    data () {
+      return {
+        description: '广告管理管理页面',
+        // 表头
+        columns: [
+          {
+            title:'轮播图标题',
+            align:"center",
+            dataIndex: 'title'
+          },
+          {
+            title:'图片',
+            align:"center",
+            dataIndex: 'logo',
+            scopedSlots: { customRender: 'logoSlot' },
+          },
+          {
+            title:'状态',
+            align:"center",
+            dataIndex: 'status',
+            scopedSlots: { customRender: 'status' },
+          },
+          {
+            title:'广告位置',
+            align:"center",
+            dataIndex: 'type',
+            scopedSlots: { customRender: 'type' },
+          },
+          {
+            title:'链接',
+            align:"center",
+            dataIndex: 'src'
+          },
+          {
+            title:'排序',
+            align:"center",
+            dataIndex: 'orderBy'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/business/busAdvert/list",
+          delete: "/business/busAdvert/delete",
+          deleteBatch: "/business/busAdvert/deleteBatch",
+          exportXlsUrl: "/business/busAdvert/exportXls",
+          importExcelUrl: "business/busAdvert/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
+        fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
+        fieldList.push({type:'string',value:'title',text:'广告标题'})
+        fieldList.push({type:'int',value:'type',text:'投放类型'})
+        fieldList.push({type:'string',value:'logo',text:'广告图片'})
+        fieldList.push({type:'string',value:'src',text:'链接'})
+        fieldList.push({type:'int',value:'orderBy',text:'排序'})
+        fieldList.push({type:'int',value:'status',text:'状态(0-禁用;1-启用)'})
+        fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 135 - 0
src/views/settings/components/modules/advertContentForm.vue

@@ -0,0 +1,135 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+<!--          <a-col :span="24">-->
+<!--            <a-form-model-item label="关联租户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenantId">-->
+<!--              <a-input v-model="model.tenantId" placeholder="请输入关联租户"  ></a-input>-->
+<!--            </a-form-model-item>-->
+<!--          </a-col>-->
+<!--          <a-col :span="24">-->
+<!--            <a-form-model-item label="关联酒店" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hotelId">-->
+<!--              <a-input v-model="model.hotelId" placeholder="请输入关联酒店"  ></a-input>-->
+<!--            </a-form-model-item>-->
+<!--          </a-col>-->
+          <a-col :span="24">
+            <a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
+              <a-input v-model="model.title" placeholder="请输入标题"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="content">
+              <a-textarea v-model="model.content" rows="4" placeholder="请输入内容" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderBy">
+              <a-input-number v-model="model.orderBy" placeholder="请输入序号" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'advertForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           title: [
+              { required: true, message: '请输入标题!'},
+           ],
+            content: [
+                { required: true, message: '请输入内容!'},
+            ],
+            orderBy: [
+                { required: true, message: '请输入序号!'},
+            ],
+        },
+        url: {
+          add: "/business/busAdvertContent/add",
+          edit: "/business/busAdvertContent/edit",
+          queryById: "/business/busAdvertContent/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              var info = JSON.parse(localStorage.getItem("storeInfo"));
+              this.model.hotelId = info.id;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/settings/components/modules/advertContentModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <advert-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></advert-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import advertForm from './advertContentForm'
+
+  export default {
+    name: 'advertModal',
+    components: {
+      advertForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/settings/components/modules/advertContentModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <advert-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></advert-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import advertForm from './advertContentForm'
+  export default {
+    name: 'advertModal',
+    components: {
+      advertForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 150 - 0
src/views/settings/components/modules/advertForm.vue

@@ -0,0 +1,150 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
+              <a-input v-model="model.title" placeholder="请输入标题"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="投放位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
+<!--              <a-input-number v-model="model.type" placeholder="请输入投放类型" style="width: 100%" />-->
+              <a-select placeholder="请选择投放位置" v-model="model.type">
+                <a-select-option :value="1">小程序首页</a-select-option>
+                <a-select-option :value="2">后台登录</a-select-option>
+                <a-select-option :value="3">商城首页</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+<!--            <a-form-model-item label="广告图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logo">-->
+<!--              <a-input v-model="model.logo" placeholder="请输入广告图片"  ></a-input>-->
+<!--            </a-form-model-item>-->
+<!--            <a-form-item label="图片"  :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logo">-->
+<!--              <j-image-upload class="avatar-uploader" text="上传"-->
+<!--                              v-decorator="['logo', { rules: [{ required: true, message: '请上传图片!' }] }]"></j-image-upload>-->
+<!--            </a-form-item>-->
+            <a-form-model-item label="图片"  :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logo">
+              <j-image-upload text="上传" v-model="model.logo"></j-image-upload>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="链接" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="src">
+              <a-input v-model="model.src" placeholder="请输入链接"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderBy">
+              <a-input-number v-model="model.orderBy" placeholder="请输入排序" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'advertForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+          title: [
+            { required: true, message: '请输入广告标题!'},
+          ],
+           logo: [
+              { required: true, message: '请上传图片!'},
+           ],
+          src: [
+              { required: true, message: '请输入链接地址!'},
+           ],
+          orderBy: [
+            { required: true, message: '请输入序号!'},
+          ],
+        },
+        url: {
+          add: "/business/busAdvert/add",
+          edit: "/business/busAdvert/edit",
+          queryById: "/business/busAdvert/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              var info = JSON.parse(localStorage.getItem("storeInfo"));
+              this.model.hotelId = info.id;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/settings/components/modules/advertModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <bus-advert-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></bus-advert-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import advertForm from './advertForm'
+
+  export default {
+    name: 'advertModal',
+    components: {
+      advertForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/settings/components/modules/advertModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <advert-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></advert-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import advertForm from './advertForm'
+  export default {
+    name: 'advertModal',
+    components: {
+      advertForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 7 - 2
src/views/settings/components/storeAuthInfo.vue

@@ -139,8 +139,13 @@ export default {
                 console.log(values)
                 if (!err) {
                     editAuthInfo(values).then(res=>{
-                        this.$message.success('编辑成功')
-                        localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                        if (res.code == 200){
+                            this.$message.success('编辑成功')
+                            localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                        }else{
+                            this.$message.error(res.message)
+                        }
+
                     })
                 }
             });

+ 8 - 2
src/views/settings/components/storeImages.vue

@@ -47,8 +47,14 @@ export default {
             values['imgs'] = this.model.imgList;
 
             editImage(values).then(res=>{
-                this.$message.success('编辑成功')
-                localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                // this.$message.success('编辑成功')
+                // localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                if (res.code == 200){
+                    this.$message.success('编辑成功')
+                    localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                }else{
+                    this.$message.error(res.message)
+                }
             })
         }
     },

+ 118 - 2
src/views/settings/components/storeInfos.vue

@@ -273,15 +273,19 @@
         </a-form-item>
         <a-form-item label="酒店政策">
             <j-editor v-model="model.policy" />
+            <a-button type="primary" @click="autoPolicy()" >自动输入</a-button>
         </a-form-item>
         <a-form-item label="酒店介绍">
             <j-editor v-model="model.introduction"/>
+            <a-button type="primary" @click="autoIntroduction()" >自动输入</a-button>
         </a-form-item>
         <a-form-item label="预定提醒">
             <j-editor v-model="model.reserveRemind"/>
+            <a-button type="primary" @click="autoReserveRemind()" >自动输入</a-button>
         </a-form-item>
         <a-form-item label="交通和周边">
             <j-editor v-model="model.traffic"/>
+            <a-button type="primary" @click="autoTraffic()" >自动输入</a-button>
         </a-form-item>
 
         <a-button type="primary" @click="submit">确定</a-button>
@@ -420,8 +424,14 @@
                         if(this.model.reserveRemind) values['reserveRemind'] = this.model.reserveRemind
                         if(this.model.traffic) values['traffic'] = this.model.traffic
                         editMainInfo(values).then(res=>{
-                            this.$message.success('编辑成功')
-                            localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            // this.$message.success('编辑成功')
+                            // localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            if (res.code == 200){
+                                this.$message.success('编辑成功')
+                                localStorage.setItem("storeInfo", JSON.stringify(res.result))
+                            }else{
+                                this.$message.error(res.message)
+                            }
                         })
                     }
                 });
@@ -478,6 +488,112 @@
                     inputValue: '',
                 });
             },
+            autoPolicy(){
+                var _policy = `<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
+                            font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box;
+                            font-weight: bolder;\">入离时间</span></p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
+                            counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                            white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text;
+                            padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif;
+                            font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">入住时间:入住当天14:00后&nbsp;&nbsp;&nbsp;
+                            </p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0;
+                            color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">
+                            离店时间:离店当天12:00前</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
+                            counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                             white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
+                             counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                              white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box; font-weight: bolder;\">
+                              宠物 </span></p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0;
+                              color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">
+                              &nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0;
+                              color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">
+                              不可携带宠物。</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0;
+                              color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n
+                              <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
+                              font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box;
+                              font-weight: bolder;\">外宾</span></p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
+                              counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                              white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
+                              counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                              white-space: pre-wrap; background-color: #ffffff;\">不接待外宾,该酒店只开放给持中国身份证的用户入住</p>\n<p style=\"box-sizing: border-box;
+                              margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
+                              font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n
+                              <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
+                              font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box;
+                              font-weight: bolder;\">膳食安排</span></p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
+                              counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                              white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text;
+                              padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                              white-space: pre-wrap; background-color: #ffffff;\">价格:详询酒店</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text;
+                              padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                              white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
+                               counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                               white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box; font-weight: bolder;\">儿童政策</span></p>\n
+                               <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
+                               font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n
+                               <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
+                               font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&bull;酒店允许携带儿童入住</p>\n
+                               <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
+                               font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&bull;
+                               每间客房最多容纳1名1.2米以下儿童,和成人共用现有床铺。</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
+                               counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
+                               white-space: pre-wrap; background-color: #ffffff;\">&bull;儿童/加床政策请详询酒店。</p>`;
+                var _this = this;
+                if (this.model.policy.length > 0 ){
+                    this.$confirm({
+                        title: '提示',
+                        content: '您已有酒店政策内容,是否覆盖?',
+                        onOk() {
+                            // return new Promise((resolve, reject) => {
+                            //     setTimeout(Math.random() > 0.5 ? resolve : reject, 100);
+                            // }).catch(() => console.log('Oops errors!'));
+                            _this.model.policy = _policy;
+                        },
+                        onCancel() {},
+                    })
+                }
+            },
+            autoIntroduction(){
+                var _introduction = `<p style="box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">电话:</p>
+                                        <p style="box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">房间数:</p>
+                                        <p style="box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">开业时间:</p>
+                                        <p style="box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">装修时间:</p>`;
+                var _this = this;
+                if (this.model.introduction.length > 0 ){
+                    this.$confirm({
+                        title: '提示',
+                        content: '您已有酒店介绍内容,是否覆盖?',
+                        onOk() {
+                            // return new Promise((resolve, reject) => {
+                            //     setTimeout(Math.random() > 0.5 ? resolve : reject, 100);
+                            // }).catch(() => console.log('Oops errors!'));
+                            _this.model.introduction = _introduction;
+                        },
+                        onCancel() {},
+                    })
+                }
+            },
+            autoReserveRemind(){
+                var _reserveRemind = `<p><span style="color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">预定提醒</span></p>`;
+                var _this = this;
+                if (this.model.reserveRemind.length > 0 ){
+                    this.$confirm({
+                        title: '提示',
+                        content: '您已预定提醒内容,是否覆盖?',
+                        onOk() {
+                            // return new Promise((resolve, reject) => {
+                            //     setTimeout(Math.random() > 0.5 ? resolve : reject, 100);
+                            // }).catch(() => console.log('Oops errors!'));
+                            _this.model.reserveRemind = _reserveRemind;
+                        },
+                        onCancel() {},
+                    })
+                }
+            },
+            autoTraffic(){
+                console.log('获取交通周边信息');
+                this.$message.success('获取周边交通信息')
+            }
         },
     }
 </script>

+ 44 - 0
src/views/settings/contentInfo.vue

@@ -0,0 +1,44 @@
+<template>
+    <a-card style="width: 100%; height:100%;">
+        <a-tabs default-active-key="1">
+            <a-tab-pane key="1">
+                <span slot="tab">
+                    <a-icon type="picture" />
+                    广告内容
+                </span>
+                <advert-content-list></advert-content-list>
+            </a-tab-pane>
+            <a-tab-pane key="2">
+                <span slot="tab">
+                    <a-icon type="audit" />
+                    广告管理
+                </span>
+                <advert-list></advert-list>
+            </a-tab-pane>
+        </a-tabs>
+    </a-card>
+</template>
+
+<script>
+    import advertContentList from './components/advertContentList.vue';
+    import advertList from './components/advertList.vue';
+
+    export default {
+        components:{
+            advertContentList,
+            advertList
+        },
+        data() {
+            return {
+
+            }
+        }
+    }
+</script>
+
+
+<style scoped>
+    .main{
+        height: 70% !important;
+    }
+</style>