Prechádzať zdrojové kódy

管理后台-订座管理

panyong 3 rokov pred
rodič
commit
66f83bac5f

+ 0 - 19
htmldev/manage/src/views/business/outlet/detail/index.vue

@@ -1,19 +0,0 @@
-<template>
-  <div>{{ id }}</div>
-</template>
-
-<script>
-export default {
-  name: 'index',
-  props: {
-    id: {
-      type: [String, Number],
-      default: ''
-    }
-  }
-}
-</script>
-
-<style scoped>
-
-</style>

+ 4 - 4
htmldev/manage/src/views/business/outlet/list/details.vue

@@ -47,9 +47,9 @@
                       label="门店状态:">
           <el-radio v-model="form.bar_status"
                     label="1">有效
-            <el-radio v-model="form.bar_status"
-                      label="0">无效
-            </el-radio>
+          </el-radio>
+          <el-radio v-model="form.bar_status"
+                    label="0">无效
           </el-radio>
         </el-form-item>
         <el-form-item prop="bar_song_start_time"
@@ -96,7 +96,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer text-center">
         <el-button @click="dialog = false">取 消</el-button>
-        <el-button type="danger" @click="handleSubmit">确 定</el-button>
+        <el-button type="primary" @click="handleSubmit">确 定</el-button>
       </div>
     </el-dialog>
   </div>

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

@@ -95,14 +95,14 @@
             <el-input v-model="domain.value" placeholder="请设置桌号"></el-input>
           </el-col>
           <el-col :span="7" :offset="1">
-            <el-button type="primary" @click.prevent="removeDomain(domain)">删除</el-button>
-            <el-button type="primary" @click.prevent="addDomain">新增</el-button>
+            <el-button type="warning" size="small" @click.prevent="removeDomain(domain)">删除</el-button>
+            <el-button type="primary" size="small" @click.prevent="addDomain">新增</el-button>
           </el-col>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer text-center">
         <el-button @click="dialog = false">取 消</el-button>
-        <el-button type="danger" @click="handleSubmit">确 定</el-button>
+        <el-button type="primary" @click="handleSubmit">确 定</el-button>
       </div>
     </el-dialog>
   </div>

+ 90 - 35
htmldev/manage/src/views/business/place/reserve/details.vue

@@ -1,33 +1,60 @@
 <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"
+                      label="预订人:">
+          <el-col :span="16">
+            <el-input v-model="form.bar_name"
+                      placeholder=""
+                      disabled
+                      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 prop="bar_name"
+                      label="手机号:">
+          <el-col :span="16">
+            <el-input v-model="form.bar_name"
+                      placeholder=""
+                      disabled
+                      clearable></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_name"
+                      label="预定座位类型:">
+          <el-col :span="16">
+            <el-input v-model="form.bar_name"
+                      placeholder=""
+                      disabled
+                      clearable></el-input>
+          </el-col>
+        </el-form-item>
+        <el-form-item prop="a"
+                      :rules="formRules.InterNum"
+                      label="签到状态:">
+          <el-radio v-model="form.bar_status" label="1">签到</el-radio>
+          <br>
+          <el-radio v-model="form.bar_status" label="0">未签到</el-radio>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer text-center">
         <el-button @click="dialog = false">取 消</el-button>
-        <el-button type="danger" @click="handleSubmit">确 定</el-button>
+        <el-button type="primary" @click="handleSubmit">保 存</el-button>
       </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-
 export default {
+  components: {},
   props: {
     value: {
       type: Boolean,
@@ -40,40 +67,68 @@ 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: '', // 备注
+        domains: [{
+          value: ''
+        }]
       }
     }
   },
   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
+    removeDomain (item) {
+      var index = this.form.domains.indexOf(item)
+      if (index !== -1) {
+        this.form.domains.splice(index, 1)
       }
+    },
+    addDomain () {
+      this.form.domains.push({
+        value: '',
+        key: Date.now()
+      })
+    },
+    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: {

+ 1 - 17
htmldev/manage/src/views/business/place/reserve/index.vue

@@ -19,9 +19,6 @@
         <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-form-item>
       </el-form>
     </div>
     <el-table :data="tableData"
@@ -31,7 +28,7 @@
               class="marginT-10 order-table"
               border
               :max-height="vheight">
-      <el-table-column label="预定日期" prop="id"></el-table-column>
+      <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>
@@ -91,19 +88,6 @@ export default {
     edit (row) {
       this.detailsDialog.exData = row
       this.detailsDialog.show = true
-    },
-    del (row) {
-      this.$confirm('确定要删除吗', '确认', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(async () => {
-        const data = await this.$fetch('/api/auth/department/del', { id: row.id })
-        if (data.code == 200) {
-          this.$message.success('删除成功')
-          this.init()
-        }
-      }).catch(() => {})
     }
   },
   mounted () {

+ 1 - 1
htmldev/manage/src/views/business/place/set/details.vue

@@ -49,7 +49,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer text-center">
         <el-button @click="dialog = false">取 消</el-button>
-        <el-button type="danger" @click="handleSubmit">确 定</el-button>
+        <el-button type="primary" @click="handleSubmit">确 定</el-button>
       </div>
     </el-dialog>
   </div>