Prechádzať zdrojové kódy

管理后台-座位

panyong 3 rokov pred
rodič
commit
7983b02367

+ 0 - 22
htmldev/manage/prd.txt

@@ -1,22 +0,0 @@
-新增一个门店管理、门店切换
-
-
-
-门店管理
-  门店、座次、营销信息
-
-歌手管理
-  资料、歌曲、排班
-
-商品管理
-  进销存
-
-订单管理
-  预约订单、购买商品订单、存酒订单、点歌订单、打赏订单、歌手分销
-
-用户管理
-  资料、消费记录(预定、点歌、打赏、购买商品)
-
-直播间管理
-
-数据看板

+ 14 - 14
htmldev/manage/src/router/modules/business.js

@@ -5,7 +5,7 @@ const businessRouter = {
   component: Layout,
   name: 'Business',
   meta: { title: '业务中心', icon: 'el-icon-s-shop' },
-  redirect: 'noRedirect',
+  redirect: '/business/outlet/list',
   children: [
     {
       path: 'outlet',
@@ -37,25 +37,25 @@ const businessRouter = {
       component: () => import('@/views/business/place/index'),
       name: 'BusinessPlace',
       meta: { title: '订座管理', icon: 'el-icon-place' },
-      redirect: '/business/place/query',
+      redirect: '/business/place/reserve',
       children: [
         {
-          path: 'list',
-          component: () => import('@/views/business/place/list/index'),
-          name: 'BusinessPlaceList',
-          meta: { title: '座位管理' }
+          path: 'reserve',
+          component: () => import('@/views/business/place/reserve/index'),
+          name: 'BusinessPlaceReserve',
+          meta: { title: '座位预订' }
         },
         {
-          path: 'query',
-          component: () => import('@/views/business/place/query/index'),
-          name: 'BusinessPlaceQuery',
-          meta: { title: '预定查询' }
+          path: 'set',
+          component: () => import('@/views/business/place/set/index'),
+          name: 'BusinessPlaceSet',
+          meta: { title: '订座安排' }
         },
         {
-          path: 'release',
-          component: () => import('@/views/business/place/release/index'),
-          name: 'BusinessPlaceRelease',
-          meta: { title: '订座安排' }
+          path: 'list',
+          component: () => import('@/views/business/place/list/index'),
+          name: 'BusinessPlaceList',
+          meta: { title: '座位管理' }
         }
       ]
     },

+ 130 - 35
htmldev/manage/src/views/business/place/list/details.vue

@@ -1,19 +1,102 @@
 <template>
   <div>
-    <el-dialog :title="exData.id ? '编辑': '新增'" :visible.sync="dialog" width="450px" :close-on-click-modal="false"
+    <el-dialog :title="exData.id ? '编辑': '新增'"
+               :visible.sync="dialog"
+               width="50%"
+               :close-on-click-modal="false"
                top="50px">
-      <el-form ref="form" :model="form" label-width="100px" class="bind-phone">
-        <el-form-item v-if="!exData.id" label="项目选择:">
-          <el-select v-model="form.department_project_id">
-            <el-option v-for="(item, index) in projectArr" :key="index" :label="item.project_name"
-                       :value="item.id"></el-option>
-          </el-select>
+      <el-form ref="form"
+               :model="form"
+               :rules="formRules"
+               label-width="160px">
+        <el-form-item prop="bar_name"
+                      :rules="formRules.required"
+                      label="座位名称:">
+          <el-col :span="16">
+            <el-input v-model="form.bar_name"
+                      placeholder="请输入座位名称"
+                      clearable></el-input>
+          </el-col>
         </el-form-item>
-        <el-form-item label="部门名称:">
-          <el-input v-model="form.department_name" placeholder="请输入部门名称"></el-input>
+        <el-form-item label="座位说明">
+          <el-col :span="16">
+            <el-input type="textarea"
+                      :rows="4"
+                      placeholder="请输入座位说明"
+                      v-model="form.note">
+            </el-input>
+          </el-col>
         </el-form-item>
-        <el-form-item label="部门描述:">
-          <el-input v-model="form.department_desc" placeholder="请输入部门描述"></el-input>
+        <el-form-item prop="bar_address"
+                      :rules="formRules.InterNum"
+                      label="座位数量:">
+          <el-col :span="16">
+            <el-input v-model="form.a"
+                      placeholder="请输入座位数量"
+                      clearable></el-input>
+          </el-col>
+        </el-form-item>
+        <el-form-item prop="bar_address"
+                      :rules="formRules.InterNum"
+                      label="单桌人数:">
+          <el-col :span="16">
+            <el-input v-model="form.b"
+                      placeholder="请输入人数"
+                      oninput="value = value.replace(/[^\d]/g, '')"
+                      clearable></el-input>
+          </el-col>
+        </el-form-item>
+        <el-form-item prop="bar_address"
+                      :rules="formRules.required"
+                      label="单价:">
+          <el-col :span="16">
+            <el-input v-model="form.c"
+                      placeholder="请输入单价"
+                      oninput="value = value.replace(/[^0-9.]/g, '')"
+                      clearable></el-input>
+          </el-col>
+        </el-form-item>
+        <el-form-item prop="bar_status"
+                      :rules="formRules.required"
+                      label="门店状态:">
+          <el-radio v-model="form.bar_status"
+                    label="1">有效
+            <el-radio v-model="form.bar_status"
+                      label="0">无效
+            </el-radio>
+          </el-radio>
+        </el-form-item>
+        <el-form-item prop="bar_song_start_time"
+                      :rules="formRules.required"
+                      label="点歌开始时间:">
+          <el-time-select placeholder="起始时间"
+                          v-model="form.bar_song_start_time"
+                          :picker-options="{start: '00:00', step: '00:05', end: '23:59'}">
+          </el-time-select>
+        </el-form-item>
+        <el-form-item prop="bar_song_end_time"
+                      :rules="formRules.required"
+                      label="点歌结束时间:">
+          <el-time-select placeholder="结束时间"
+                          v-model="form.bar_song_end_time"
+                          :picker-options="{start: '00:00', step: '00:05', end: '23:59', minTime: form.bar_song_start_time}">
+          </el-time-select>
+        </el-form-item>
+        <el-form-item prop="bar_place_reserve_start_time"
+                      :rules="formRules.required"
+                      label="座位预定开始时间:">
+          <el-time-select placeholder="起始时间"
+                          v-model="form.bar_place_reserve_start_time"
+                          :picker-options="{start: '00:00', step: '00:05', end: '23:59'}">
+          </el-time-select>
+        </el-form-item>
+        <el-form-item prop="bar_place_reserve_end_time"
+                      :rules="formRules.required"
+                      label="座位预定结束时间:">
+          <el-time-select placeholder="结束时间"
+                          v-model="form.bar_place_reserve_end_time"
+                          :picker-options="{start: '00:00', step: '00:05', end: '23:59', minTime: form.bar_place_reserve_start_time}">
+          </el-time-select>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer text-center">
@@ -25,9 +108,8 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-
 export default {
+  components: {},
   props: {
     value: {
       type: Boolean,
@@ -40,40 +122,53 @@ export default {
       }
     }
   },
-  computed: {
-    ...mapGetters([
-      'projectArr'
-    ])
-  },
   data () {
     return {
       dialog: !!this.value,
       form: {
-        department_project_id: undefined,
-        department_name: '',
-        department_desc: ''
+        bar_name: '', // 门店名称
+        bar_address: '', // 门店地址
+        bar_status: '1', // 门店状态(0无效1有效)
+        bar_img_url: [], // 门店图片
+        bar_song_start_time: '', // 点歌开始时间
+        bar_song_end_time: '', // 点歌结束时间
+        bar_place_reserve_start_time: '', // 座位预定开始时间
+        bar_place_reserve_end_time: '', // 座位预定结束时间
+        note: '' // 备注
       }
     }
   },
   methods: {
-    async handleSubmit () {
-      let url = this.exData.id ? '/department/edit' : '/department/add'
-      const data = await this.$fetch('/api/auth' + url, { ...this.form })
-      if (data.code === 200) {
-        this.$message.success('提交成功')
-        this.$emit('success')
-        this.dialog = false
-      }
+    handleSubmit () {
+      const url = this.exData.id ? '/v1/bar/modify' : '/v1/bar/add'
+      this.$refs.form.validate(async valid => {
+        if (valid) {
+          const data = await this.$fetch(url, {
+            ...this.form
+          })
+          if (data.code === 200) {
+            this.$message.success('提交成功')
+            this.$emit('success')
+            this.dialog = false
+          }
+        }
+      })
     }
   },
   mounted () {
-    if (this.projectArr.length == 0) {
-      this.$store.dispatch('common/setProjectArr')
-    }
     if (this.exData.id) {
-      this.form.id = this.exData.id
-      this.form.department_name = this.exData.department_name
-      this.form.department_desc = this.exData.department_desc
+      this.$set(this.form, 'id', this.exData.id)
+      for (const key in this.exData) {
+        if (this.form.hasOwnProperty(key)) {
+          let value = this.exData[key]
+          if ((Array.isArray(value) && value.length > 0) || value) {
+            if (key === 'bar_status') {
+              value = value.toString()
+            }
+            this.$set(this.form, key, value)
+          }
+        }
+      }
     }
   },
   watch: {

+ 33 - 23
htmldev/manage/src/views/business/place/list/index.vue

@@ -2,25 +2,14 @@
   <div class="padding-20">
     <div class="search-box">
       <el-form ref="form" :inline="true" :model="searchForm" clearable label-width="100px" class="mt-10">
-        <el-form-item label="创建时间:">
-          <el-date-picker
-            :editable="false"
-            v-model="time"
-            @change="timearr => {timearr ? (searchForm.start_time = timearr[0] + ' 00:00:00', searchForm.end_time = timearr[1] + ' 23:59:59') : searchForm.start_time = searchForm.end_time = undefined}"
-            type="daterange"
-            value-format="yyyy-MM-dd"
-            start-placeholder="开始时间"
-            end-placeholder="结束时间"
-          ></el-date-picker>
-        </el-form-item>
-        <el-form-item label="部门名称:">
-          <el-input v-model="searchForm.department_name" placeholder="请输入部门名称" clearable></el-input>
+        <el-form-item label="座位名称:">
+          <el-input v-model="searchForm.department_name" placeholder="请输入座位名称" clearable></el-input>
         </el-form-item>
         <el-form-item class="ml-10">
           <el-button icon="el-icon-search" type="primary" @click="searchSubmit">查询</el-button>
         </el-form-item>
         <el-form-item class="ml-10">
-          <el-button icon="el-icon-plus" type="primary" @click="add" v-permission="'department_list_add'">新增</el-button>
+          <el-button icon="el-icon-plus" type="primary" @click="add">添加座位</el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -31,19 +20,29 @@
               class="marginT-10 order-table"
               border
               :max-height="vheight">
-      <el-table-column label="编号" prop="id"></el-table-column>
-      <el-table-column label="名称" prop="department_name"></el-table-column>
-      <el-table-column label="数量" prop="department_project_name"></el-table-column>
-      <el-table-column label="人数" prop="department_project_name"></el-table-column>
+      <el-table-column label="ID" prop="id"></el-table-column>
+      <el-table-column label="座位名称" prop="department_name"></el-table-column>
+      <el-table-column label="座位说明" prop="department_desc"></el-table-column>
+      <el-table-column label="座位数量" prop="department_project_name"></el-table-column>
+      <el-table-column label="单桌人数" prop="department_project_name"></el-table-column>
       <el-table-column label="单价" prop="department_project_name"></el-table-column>
-      <el-table-column label="最晚保留时间(分钟)" prop="department_project_name"></el-table-column>
       <el-table-column label="最晚到店时间" prop="department_desc"></el-table-column>
-      <el-table-column label="介绍" prop="department_desc"></el-table-column>
+      <el-table-column label="最晚保留时间(分钟)" prop="department_project_name"></el-table-column>
+      <el-table-column label="添加时间" prop="department_project_name"></el-table-column>
       <el-table-column label="备注" prop="department_desc"></el-table-column>
-      <el-table-column label="操作">
+      <el-table-column label="操作" width="200">
         <template slot-scope="scope">
-          <el-button type="text" @click="edit(scope.row)" v-permission="'department_list_edit'">编辑</el-button>
-          <el-button type="text" @click="del(scope.row)" v-permission="'department_list_del'">删除</el-button>
+          <el-button type="text"
+                     @click="edit(scope.row)">编辑
+          </el-button>
+          <!--todo 图片单张下载还是ZIP包-->
+          <el-dropdown class="el-dropdown"
+                       @command="handleCommand">
+            <span class="el-dropdown-link">下载点单二维码<i class="el-icon-arrow-down el-icon--right"></i></span>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="111">黄金糕</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
         </template>
       </el-table-column>
     </el-table>
@@ -93,6 +92,9 @@ export default {
       this.detailsDialog.exData = row
       this.detailsDialog.show = true
     },
+    handleCommand (val) {
+      console.log(val)
+    },
     del (row) {
       this.$confirm('确定要删除吗', '确认', {
         confirmButtonText: '确定',
@@ -114,4 +116,12 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.el-dropdown {
+  margin-left: 10px;
+
+  .el-dropdown-link {
+    cursor: pointer;
+    color: #409EFF;
+  }
+}
 </style>

+ 0 - 0
htmldev/manage/src/views/business/place/query/details.vue → htmldev/manage/src/views/business/place/reserve/details.vue


+ 0 - 0
htmldev/manage/src/views/business/place/query/index.vue → htmldev/manage/src/views/business/place/reserve/index.vue


+ 0 - 0
htmldev/manage/src/views/business/place/release/details.vue → htmldev/manage/src/views/business/place/set/details.vue


+ 0 - 0
htmldev/manage/src/views/business/place/release/index.vue → htmldev/manage/src/views/business/place/set/index.vue