Browse Source

2024.08.21
- 完成区域设置页和桌号设置页和当前订单页和点餐订单页;
- 重构商品管理页;

zweiqin 7 months ago
parent
commit
6f9ea2f1d5
31 changed files with 3671 additions and 442 deletions
  1. 2 3
      src/api/commodity.js
  2. 82 0
      src/api/mealManagement/TableNumberSetting.js
  3. 10 0
      src/api/mealManagement/currentOrders.js
  4. 64 0
      src/api/mealManagement/mealOrders.js
  5. 55 0
      src/api/mealManagement/regionalSetting.js
  6. 227 0
      src/views/commodity/commoditySystem/components/DetailModal.vue
  7. 3 3
      src/views/commodity/commoditySystem/components/addCommodity.vue
  8. 5 5
      src/views/commodity/commoditySystem/components/addComponent.vue
  9. 304 359
      src/views/commodity/commoditySystem/index.vue
  10. 0 1
      src/views/marketing/compose/add.vue
  11. 0 1
      src/views/marketing/price/add.vue
  12. 126 0
      src/views/mealManagement/TableNumberSetting/components/DetailModal.vue
  13. 165 0
      src/views/mealManagement/TableNumberSetting/components/EditModal.vue
  14. 115 0
      src/views/mealManagement/TableNumberSetting/components/MealOrderCreate.vue
  15. 226 0
      src/views/mealManagement/TableNumberSetting/index.vue
  16. 141 0
      src/views/mealManagement/currentOrders/components/DetailModal.vue
  17. 204 0
      src/views/mealManagement/currentOrders/components/EditModal.vue
  18. 151 0
      src/views/mealManagement/currentOrders/index.vue
  19. 235 0
      src/views/mealManagement/mealOrders/components/AddDishes.vue
  20. 120 0
      src/views/mealManagement/mealOrders/components/DetailModal.vue
  21. 104 0
      src/views/mealManagement/mealOrders/components/MealOrderPlace.vue
  22. 176 0
      src/views/mealManagement/mealOrders/components/OrderDishes.vue
  23. 183 0
      src/views/mealManagement/mealOrders/index.vue
  24. 141 0
      src/views/mealManagement/mealProcessing/components/DetailModal.vue
  25. 204 0
      src/views/mealManagement/mealProcessing/components/EditModal.vue
  26. 187 0
      src/views/mealManagement/mealProcessing/index.vue
  27. 109 0
      src/views/mealManagement/regionalSetting/components/DetailModal.vue
  28. 148 0
      src/views/mealManagement/regionalSetting/components/EditModal.vue
  29. 179 0
      src/views/mealManagement/regionalSetting/index.vue
  30. 0 65
      src/views/system/imageProcessing/components/DetailModal.vue
  31. 5 5
      src/views/threeSelection/platformSelect/addCommodity.vue

+ 2 - 3
src/api/commodity.js

@@ -38,7 +38,7 @@ export function getClassifyGetAll(data) {
 }
 
 // 修改商品查询
-export function getClassifyGetById(data) {
+export function getProductGetById(data) {
   return request({
     url: '/product/getById',
     method: 'post',
@@ -207,7 +207,6 @@ export function productExport(data) {
   })
 }
 
-
 //  选品库商品
 export function getlLibraryList(data) {
   return request({
@@ -215,4 +214,4 @@ export function getlLibraryList(data) {
     method: 'POST',
     data
   })
-}
+}

+ 82 - 0
src/api/mealManagement/TableNumberSetting.js

@@ -0,0 +1,82 @@
+import request from '@/utils/request'
+
+// 创建桌号二维码
+export function createQRShopAuthDept(params) {
+  return request({
+    url: '/shopAuthDept/createQR',
+    method: 'get',
+    params
+  })
+}
+
+// 部门(分页)列表
+export function getPageAllShopAuthDept(data) {
+  return request({
+    url: '/shopAuthDept/getPageAll',
+    method: 'post',
+    data
+  })
+}
+
+// 部门新增
+export function savePostShopAuthDept(data) {
+  return request({
+    url: '/shopAuthDept/savePost',
+    method: 'post',
+    data
+  })
+}
+
+// 部门修改
+export function updatePostShopAuthDept(data) {
+  return request({
+    url: '/shopAuthDept/updatePost',
+    method: 'post',
+    data
+  })
+}
+
+// 部门详情
+export function detailPostShopAuthDept(params) {
+  return request({
+    url: '/shopAuthDept/detailPost',
+    method: 'get',
+    params
+  })
+}
+
+// 部门删除
+export function deletePostShopAuthDept(params) {
+  return request({
+    url: '/shopAuthDept/deletePost',
+    method: 'get',
+    params
+  })
+}
+
+// 部门全部列表
+export function getAllShopAuthDept(data) {
+  return request({
+    url: '/shopAuthDept/getAll',
+    method: 'post',
+    data
+  })
+}
+
+// 创建点餐订单
+export function createShopLaOrders(data) {
+  return request({
+    url: '/shopLaOrders/create',
+    method: 'post',
+    data
+  })
+}
+
+// 结账
+export function checkoutShopLaOrders(params) {
+  return request({
+    url: '/shopLaOrders/checkout',
+    method: 'get',
+    params
+  })
+}

+ 10 - 0
src/api/mealManagement/currentOrders.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 获得当前商户正在进行的订单
+export function getCurrentShopLaOrders(params) {
+  return request({
+    url: '/shopLaOrders/current',
+    method: 'get',
+    params
+  })
+}

+ 64 - 0
src/api/mealManagement/mealOrders.js

@@ -0,0 +1,64 @@
+import request from '@/utils/request'
+
+// 订单列表
+export function getOrderListShopLaOrders(data) {
+  return request({
+    url: '/shopLaOrders/orderList',
+    method: 'post',
+    data
+  })
+}
+
+// 获得订单中菜品
+export function getDishShopLaOrders(params) {
+  return request({
+    url: '/shopLaOrders/dish',
+    method: 'get',
+    params
+  })
+}
+
+// 下单
+export function submitShopLaOrders(data) {
+  return request({
+    url: '/shopLaOrders/submit',
+    method: 'post',
+    data
+  })
+}
+
+// 菜品添加
+export function dishAddShopLaOrdersDish(data) {
+  return request({
+    url: '/shopLaOrdersDish/dishAdd',
+    method: 'post',
+    data
+  })
+}
+
+// 菜品+1
+export function dishIncShopLaOrdersDish(params) {
+  return request({
+    url: '/shopLaOrdersDish/dishInc',
+    method: 'get',
+    params
+  })
+}
+
+// 菜品-1
+export function dishDecShopLaOrdersDish(params) {
+  return request({
+    url: '/shopLaOrdersDish/dishDec',
+    method: 'get',
+    params
+  })
+}
+
+// 菜品清空
+export function toEmptyShopLaOrdersDish(params) {
+  return request({
+    url: '/shopLaOrdersDish/toEmpty',
+    method: 'get',
+    params
+  })
+}

+ 55 - 0
src/api/mealManagement/regionalSetting.js

@@ -0,0 +1,55 @@
+import request from '@/utils/request'
+
+// 岗位(分页)列表
+export function getPageAllShopAuthPost(data) {
+  return request({
+    url: '/shopAuthPost/getPageAll',
+    method: 'post',
+    data
+  })
+}
+
+// 岗位新增
+export function savePostShopAuthPost(data) {
+  return request({
+    url: '/shopAuthPost/savePost',
+    method: 'post',
+    data
+  })
+}
+
+// 岗位修改
+export function updatePostShopAuthPost(data) {
+  return request({
+    url: '/shopAuthPost/updatePost',
+    method: 'post',
+    data
+  })
+}
+
+// 岗位详情
+export function detailPostShopAuthPost(params) {
+  return request({
+    url: '/shopAuthPost/detailPost',
+    method: 'get',
+    params
+  })
+}
+
+// 岗位删除
+export function deletePostShopAuthPost(params) {
+  return request({
+    url: '/shopAuthPost/deletePost',
+    method: 'get',
+    params
+  })
+}
+
+// 岗位全部列表
+export function getAllShopAuthPost(data) {
+  return request({
+    url: '/shopAuthPost/getAll',
+    method: 'post',
+    data
+  })
+}

+ 227 - 0
src/views/commodity/commoditySystem/components/DetailModal.vue

@@ -0,0 +1,227 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 商品信息 -->
+      <div style="display: flex;padding-bottom: 14px;font-size: 16px;font-weight: bold;">
+        <div
+          style="width: 4px;height: 14px;margin-left: 6px;margin-right: 6px;background-color: #0519D4;border-radius: 2px;"
+        >
+        </div>
+        <div>商品详情</div>
+      </div>
+      <el-form-item label="商品名称" prop="productName">
+        {{ formData.productName || '--' }}
+      </el-form-item>
+      <el-form-item label="商品卖点" prop="productBrief">
+        {{ formData.productBrief || '--' }}
+      </el-form-item>
+      <el-form-item label="商品图片" prop="images">
+        <!-- 4机构证明材料,营业执照 -->
+        <div v-if="formData.images && formData.images.length">
+          <el-image
+            v-for="(item, index) in formData.images.map(i => i.imgPath)" :key="index" :src="item"
+            style="width:80px;height:80px;margin-right: 10px;" fit="cover"
+            :preview-src-list="formData.images.map(i => i.imgPath)"
+          />
+        </div>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="官方分类" prop="classifyName">
+        {{ formData.classifyName || '--' }}
+      </el-form-item>
+      <el-form-item label="商家分组" prop="shopGroupName">
+        {{ formData.shopGroupName || '--' }}
+      </el-form-item>
+      <el-form-item label="商家名称" prop="shopName">
+        {{ formData.shopName || '--' }}
+      </el-form-item>
+      <el-form-item label="商品状态" prop="shelveState">
+        <span v-if="formData.shelveState === 0">已下架</span>
+        <span v-else-if="formData.shelveState === 1">已上架</span>
+        <span v-else-if="formData.shelveState === 2">待审核</span>
+        <span v-else-if="formData.shelveState === 3">审核失败</span>
+        <span v-else>--</span>
+      </el-form-item>
+
+      <div style="display: flex;padding-bottom: 14px;font-size: 16px;font-weight: bold;">
+        <div
+          style="width: 4px;height: 14px;margin-left: 6px;margin-right: 6px;background-color: #0519D4;border-radius: 2px;"
+        >
+        </div>
+        <div>商品款式</div>
+      </div>
+      <el-row class="detail-box">
+        <el-col :span="24">
+          <el-table
+            :data="formData.skus" style="width: 100%"
+            :header-cell-style="{ background: '#EEF3FF', color: '#333333' }"
+          >
+            <el-table-column v-for="(skuAttr, index) in formData.names.filter(i => i.skuName && i.values.some((attr) => attr.skuValue))" :key="index" :label="skuAttr.skuName">
+              <template slot-scope="scope">
+                <div v-if="scope.row.skuAttrCodeDTOList && scope.row.skuAttrCodeDTOList[index]">
+                  {{ handleAttrValue(scope.row.skuAttrCodeDTOList && scope.row.skuAttrCodeDTOList[index]) }}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="售价">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.price" maxlength="9" disabled
+                  oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="原价">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.originalPrice" maxlength="9" disabled
+                  oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="库存">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.stockNumber" maxlength="9" disabled
+                  oninput="value=value.replace(/[^\d]/g,'')"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="重量(KG)">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.weight" maxlength="9" disabled
+                  oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="SKU">
+              <template slot-scope="scope">
+                <el-input v-model="scope.row.sku" maxlength="20" disabled />
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+
+      <el-card>
+        <div style="display: flex;padding-bottom: 14px;font-size: 16px;font-weight: bold;">
+          <div
+            style="width: 4px;height: 14px;margin-left: 6px;margin-right: 6px;background-color: #0519D4;border-radius: 2px;"
+          >
+          </div>
+          <div>商品简介</div>
+        </div>
+        <div v-html="formData.productText" />
+      </el-card>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import { getProductGetById } from '@/api/commodity'
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '商品详情'
+      },
+      visible: false,
+      formData: {
+        productId: '',
+        productName: '',
+        productBrief: '',
+        images: '',
+        classifyName: '',
+        shopGroupName: '',
+        shopName: '',
+        shelveState: '',
+        productText: '',
+        skus: [],
+        names: []
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.productId) {
+        this.getInfo(params.productId)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getProductGetById({ productId: id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          productId: res.data.productId || '',
+          productName: res.data.productName || '',
+          productBrief: res.data.productBrief || '',
+          images: res.data.images || [],
+          classifyName: res.data.classifyName || '',
+          shopGroupName: res.data.shopGroupName || '',
+          shopName: res.data.shopName || '',
+          productText: res.data.productText || '',
+          shelveState: res.data.shelveState,
+          skus: res.data.skus || [],
+          names: res.data.names || []
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleAttrValue(map) {
+      const hasChilds =
+        this.formData.names &&
+        this.formData.names.filter((skuAttr) => {
+          const hasChild = skuAttr.values.some((attr) => attr.skuValue)
+          return skuAttr.skuName && hasChild
+        })
+      if (!map) {
+        return ''
+      }
+      const { code, valueCode } = map
+      let codeStr = ''
+      hasChilds.map((item) => {
+        const { values } = item
+        values &&
+          values.some((attr) => {
+            const isSome = item.code === code && attr.valueCode === valueCode
+            if (isSome) {
+              codeStr = attr.skuValue
+            }
+            return isSome
+          })
+      })
+      return codeStr
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep img {
+	width: 100px;
+	height: 100px;
+}
+</style>
+

+ 3 - 3
src/views/commodity/commoditySystem/addCommodity.vue → src/views/commodity/commoditySystem/components/addCommodity.vue

@@ -167,7 +167,7 @@ import {
   getGroupSelect,
   getClassify,
   getClassifyAdd,
-  getClassifyGetById,
+  getProductGetById,
   getClassifyUpdate,
   getBrandList
 } from '@/api/commodity'
@@ -616,7 +616,7 @@ export default {
     },
     // 获取详情
     async details() {
-      const res = await getClassifyGetById({ productId: this.productId })
+      const res = await getProductGetById({ productId: this.productId })
       this.form = res.data
       this.$set(this.form, 'productText', res.data.productText)
       // this.form.productText = res.data.productText
@@ -654,7 +654,7 @@ export default {
 </script>
 
 <style scoped lang='scss'>
-@import url("../../../styles/elDialog.scss");
+@import url("../../../../styles/elDialog.scss");
 
 .btnList {
   float: right;

+ 5 - 5
src/views/commodity/commoditySystem/addComponent.vue → src/views/commodity/commoditySystem/components/addComponent.vue

@@ -552,10 +552,10 @@ export default {
         voucherId: 0,
         voucherPrice: 0,
         weight: 0,
-        manufacturerBasePrice:0,
-        manufacturerGuidePrice:0,
-        presenterVoucher:0,
-        sku:""
+        manufacturerBasePrice: 0,
+        manufacturerGuidePrice: 0,
+        presenterVoucher: 0,
+        sku: ''
       }
       const doExchange = (arr, depth) => {
         const map = {
@@ -648,7 +648,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-@import url("../../../styles/elDialog.scss");
+@import url("../../../../styles/elDialog.scss");
 .tipsView {
   width: 110px;
   height: 46px;

+ 304 - 359
src/views/commodity/commoditySystem/index.vue

@@ -1,108 +1,150 @@
 <template>
-  <div>
-    <div class="pending">
-      <!-- 搜索 -->
-      <div class="formSearch">
-        <el-form :inline="true" :model="formInline" class="demo-form-inline">
-          <el-form-item label="商品名称">
-            <el-input v-model="formInline.search" maxlength="20" placeholder="请输入商品名称" />
-          </el-form-item>
-          <el-form-item label="商品型号">
-            <el-input v-model="formInline.productMarque" placeholder="请输入商品型号" />
-          </el-form-item>
-          <el-form-item label="上架状态">
-            <el-select v-model="formInline.shelveState" placeholder="请选择上架状态">
-              <el-option label="全部" :value="null" />
-              <el-option label="上架" value="1" />
-              <el-option label="下架" value="0" />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="官方分类">
-            <el-cascader
-              v-model="formInline.classifyId" :options="categoryList" clearable :props="{
-                checkStrictly: true,
-                expandTrigger: 'hover',
-                label: 'categoryName',
-                value: 'id',
-                children: 'childs'
-              }"
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-select
+        v-model="listQuery.shelveState" clearable size="mini" class="filter-item"
+        style="width: 200px;"
+        placeholder="请选择上架状态"
+      >
+        <el-option label="全部" :value="null" />
+        <el-option label="上架" :value="1" />
+        <el-option label="下架" :value="0" />
+      </el-select>
+      <el-input
+        v-model="listQuery.search" clearable size="mini" class="filter-item"
+        maxlength="20" style="width: 200px;margin-left: 10px;" placeholder="请输入商品名称"
+      />
+      <el-input
+        v-model="listQuery.productMarque" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请输入商品型号"
+      />
+      <el-cascader
+        v-model="listQuery.classifyId" placeholder="请选择分类"
+        :options="categoryList" clearable size="mini" class="filter-item"
+        :props="{ checkStrictly: true, expandTrigger: 'hover', label: 'categoryName', value: 'id', children: 'childs' }"
+        style="width: 200px;margin-left: 10px;"
+      />
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+      <el-button size="mini" type="info" class="filter-item" @click="handleReset">
+        重置
+      </el-button>
+      <br />
+      <el-button size="mini" type="primary" icon="el-icon-plus" @click="handleAdd">
+        新增商品
+      </el-button>
+      <el-button size="mini" type="success" @click="handleSends">
+        批量导入
+      </el-button>
+      <el-button size="mini" type="warning" @click="handleProductDataExport">
+        导出商品
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="商品ID" prop="productId" fixed="left" />
+        <el-table-column align="center" width="100" label="商品主图" prop="productImage">
+          <template slot-scope="{ row }">
+            <el-image
+              v-if="row.productImage" lazy :src="common.seamingImgUrl(row.productImage)" style="width:40px;height:40px"
+              fit="cover" :preview-src-list="[ common.seamingImgUrl(row.productImage) ]"
             />
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" plain @click="handleSearch">查询</el-button>
-            <el-button plain @click="clear">重置</el-button>
-            <el-button type="success" plain @click="add">新增商品</el-button>
-            <el-button type="success" plain @click="sends">批量导入</el-button>
-            <el-button type="success" plain @click="productDataExport">导出商品</el-button>
-            <!-- <span v-for="(item,index) in btnList" :key="index" class="promissStyle">
-              <el-button type="success" plain @click="btnClick(item)">{{ item.permissionName }}</el-button>
-              </span> -->
-          </el-form-item>
-        </el-form>
-      </div>
-      <!-- 表格 -->
-      <div class="tableBox">
-        <el-table
-          ref="multipleTable" :data="tableData" border
-          :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%"
-        >
-          <el-table-column prop="productId" label="商品id" show-overflow-tooltip />
-          <el-table-column label="商品主图" width="150" align="center">
-            <template slot-scope="scope">
-              <!-- 修复图片不能正常显示的问题 -->
-              <img height="80" width="80" :src="scope.row.productImage.replace(/http:\/\//, 'https://')" alt srcset>
-            </template>
-          </el-table-column>
-          <el-table-column prop="productName" label="商品名称" width="220" />
-          <el-table-column prop="section" label="售价区间" show-overflow-tooltip />
-          <el-table-column prop="memberSection" label="会员价" show-overflow-tooltip />
-          <el-table-column prop="ifCredit" label="积分兑换" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <span v-if="scope.row.ifCredit == 1">允许</span>
-              <span v-if="scope.row.ifCredit == 0">不允许</span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="stockNumber" label="库存" show-overflow-tooltip />
-          <el-table-column prop="volume" label="销量" show-overflow-tooltip />
-          <el-table-column prop="volume" label="上架状态" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <span v-if="scope.row.shelveState == 0">未上架</span>
-              <span v-if="scope.row.shelveState == 1">已上架</span>
-              <span v-if="scope.row.shelveState == 2">待审核</span>
-              <span v-if="scope.row.shelveState == 3">审核失败</span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="reject" label="驳回原因" show-overflow-tooltip />
-          <el-table-column :formatter="row => getBrandName(row)" label="品牌" show-overflow-tooltip />
-          <el-table-column prop="createTime" label="创建时间" width="180" />
-          <el-table-column label="操作" width="200">
-            <template slot-scope="scope">
-              <div class="btnList">
-                <el-button v-if="!scope.row.ifSelection" type="text" @click="handleAddShopSelection(scope.row)">设为选品</el-button>
-                <el-button type="text" @click="edit(scope.row)">编辑</el-button>
-                <el-button v-if="scope.row.shelveState == 0" type="text" @click="down(scope.row)">上架</el-button>
-                <el-button v-if="scope.row.shelveState == 1" type="text" @click="down(scope.row)">下架</el-button>
-                <el-button v-if="scope.row.shelveState == 1" type="text" @click="setVipPrice(scope.row)">设置会员价</el-button>
-                <el-button v-if="scope.row.shelveState != 1" type="text" @click="del(scope.row)">删除</el-button>
-              </div>
-            </template>
-          </el-table-column>
-        </el-table>
-        <div class="fenye">
-          <el-pagination
-            :current-page="formInline.page" :page-sizes="[10, 20, 50, 100]" :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-          />
-        </div>
-      </div>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="section" label="售价区间" show-overflow-tooltip />
+        <el-table-column prop="memberSection" label="会员价" show-overflow-tooltip />
+        <el-table-column align="center" label="积分兑换" prop="ifCredit">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.ifCredit === 0">不允许</el-tag>
+            <el-tag v-else-if="row.ifCredit === 1">允许</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="stockNumber" label="库存" show-overflow-tooltip />
+        <el-table-column prop="volume" label="销量" show-overflow-tooltip />
+        <el-table-column align="center" label="上架状态" prop="shelveState">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.shelveState === 0">未上架</el-tag>
+            <el-tag v-else-if="row.shelveState === 1">已上架</el-tag>
+            <el-tag v-else-if="row.shelveState === 2">待审核</el-tag>
+            <el-tag v-else-if="row.shelveState === 3">审核失败</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="reject" label="驳回原因" show-overflow-tooltip />
+        <el-table-column align="center" label="品牌" prop="brandId">
+          <template slot-scope="{ row }">
+            <el-tag v-if="brandList.find((item) => item.id === row.brandId)">
+              {{ brandList.find((item) => item.id === row.brandId).brandName }}
+            </el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button v-if="row.shelveState === 0" type="text" @click="handleDown(row)">
+              上架
+            </el-button>
+            <el-button v-if="row.shelveState === 1" type="text" @click="handleDown(row)">
+              下架
+            </el-button>
+            <el-button size="mini" @click="handleEdit(row)">
+              编辑
+            </el-button>
+            <el-button
+              v-if="!row.ifSelection" type="warning" size="mini"
+              @click="handleAddShopSelection(row)"
+            >
+              设为选品
+            </el-button>
+            <el-button
+              v-if="row.shelveState === 1" type="warning" size="mini"
+              @click="setVipPrice(row)"
+            >
+              设置会员价
+            </el-button>
+            <el-button
+              v-if="row.shelveState !== 1"
+              type="danger" size="mini" @click="handleDelete(row)"
+            >
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
     </div>
+
     <!-- 批量导入 -->
     <el-dialog title="批量导入商品" :visible.sync="batchAdd" :close-on-click-modal="false" center width="400px">
       <div class="uploadDialog">
         <el-upload
           drag :limit="1" :auto-upload="false" accept=".xlsx"
-          :headers="headers" :action="UploadUrls"
+          :headers="headers" :action="() => ''"
           :before-upload="beforeUploadFile" :on-change="fileChange" :on-remove="batchRemove" :on-exceed="exceedFile"
           :on-success="handleSuccess" :on-error="handleError" :file-list="batchFileList"
         >
@@ -170,12 +212,16 @@
         @cancel="cancelForm"
       />
     </el-dialog>
+
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
   </div>
 </template>
 
 <script>
-import CommAdd from '@/views/commodity/commoditySystem/addCommodity.vue'
-import { getBtnList, getToken, getShopId } from '@/utils/auth'
+import CommAdd from './components/addCommodity.vue'
+import DetailModal from './components/DetailModal'
+import { getToken, getShopId } from '@/utils/auth'
 import { uploadUrl } from '@/utils/request'
 import { getAllPlatformVoucher } from '@/api/voucherManagement/voucherOperation'
 import {
@@ -193,18 +239,21 @@ import {
   getVoucher
 } from '@/api/commodity'
 import { shopSelectionAddShopLibrary } from '@/api/selectionCenter/selectionCenter'
+import XeUtils from 'xe-utils'
+
 export default {
   name: 'CommoditySystem',
   components: {
-    CommAdd
+    CommAdd,
+    DetailModal
   },
   data() {
     // 这里存放数据
     return {
-      showTinymce: false,
-      btnList: '',
-      activeName: 'first',
-      formInline: {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
         productMarque: '', // 商品型号
         search: '', // 搜索字段
         shelveState: '', // 上架状态 1-上架 0-不上架 null-全部
@@ -213,10 +262,11 @@ export default {
         page: 1, // 当前页
         pageSize: 10
       },
+
+      showTinymce: false,
+      activeName: 'first',
       batchAdd: false,
       batchFileList: [],
-      total: 1,
-      tableData: [],
       categoryList: [],
       UploadUrl: uploadUrl,
       headers: {
@@ -233,15 +283,6 @@ export default {
       voucherList: []
     }
   },
-  computed: {
-    getBrandName() {
-      return (row) => {
-        const find = this.brandList.find((item) => item.id === row.brandId)
-        if (find) return find.brandName
-        return '-'
-      }
-    }
-  },
   async created() {
     // getVoucher().then((res) => { // 获取可选的代金券,用于创建和修改商品时定义代金券的使用规则
     //   this.voucherList = Array.isArray(res.data) ? res.data : typeof res.data === 'number' && res.data ? [ { id: res.data, voucherName: res.data } ] : []
@@ -265,22 +306,129 @@ export default {
       id: 0,
       desc: '不支持代金券'
     })
-  },
-  mounted() {
-    this.getBrandList()
-    this.getAll(this.formInline)
-    this.queryAllCategory()
-    this.btnList = getBtnList()
+    getBrandList({})
+      .then((res) => {
+        this.brandList = res.data || []
+      })
+    this.getCategoryTreeList()
+    this.getList()
   },
   // 方法集合
   methods: {
-    async getBrandList() {
-      const { data } = await getBrandList()
-      this.brandList = data
+    async getCategoryTreeList() {
+      const res = await getClassify()
+      XeUtils.eachTree(res.data, (item) => {
+        if (Array.isArray(item.childs) && item.childs.length === 0) {
+          item.childs = undefined
+        }
+      }, { children: 'childs' })
+      this.categoryList = res.data
+    },
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getClassifyGetAll({
+          ...this.listQuery,
+          classifyId: Array.isArray(this.listQuery.classifyId) && this.listQuery.classifyId.length ? this.listQuery.classifyId[this.listQuery.classifyId.length - 1] : ''
+        })
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleReset() {
+      this.listQuery = { productMarque: '', search: '', shelveState: '', stock: '', classifyId: '', page: 1, pageSize: 10 }
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleAddShopSelection(row) {
+      this.$confirm('确定添加为选品?')
+        .then(async () => {
+          await shopSelectionAddShopLibrary({ shopId: getShopId(), productId: row.productId })
+          this.$message({ message: '添加成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => { })
+    },
+    // 删除商品
+    handleDelete(row) {
+      this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          getClassifyDelete({ productId: row.productId }).then((res) => {
+            if (res.code === '') {
+              this.$message({ type: 'success', message: '删除成功!' })
+              this.handleSearch()
+            }
+          })
+        })
+        .catch(() => { })
     },
+    // 商品上下架
+    async handleDown(row) {
+      console.log(row.shelveState)
+      if (row.shelveState) {
+        console.log(111)
+        const res = await getClassifyStart({
+          productId: row.productId,
+          shelveState: 0
+        })
+        if (res.code === '') {
+          this.$message({
+            type: 'success',
+            message: '下架成功!'
+          })
+          this.getList()
+        }
+      } else {
+        const res = await getClassifyStart({
+          productId: row.productId,
+          shelveState: 1
+        })
+        if (res.code === '') {
+          this.$message({
+            type: 'success',
+            message: '上架成功!'
+          })
+          this.getList()
+        }
+      }
+    },
+    // 清空会员价
+    clearProductMember() {
+      console.log(this.productData, 'this.productData')
+      this.$confirm('该商品所有旧设置的会员价将被清除, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        clearProductMember({ productId: this.productId }).then((res) => {
+          if (res.code === '') {
+            this.productData.map((item) => {
+              item.memberPrices.map((itemChild) => {
+                itemChild.price = null
+              })
+            })
+            this.$message.success('清除成功')
+            // this.vipPriceVisible = false
+          }
+        })
+      })
+    },
+
     cancelForm() {
       this.commidyVisible = false
-      this.getAll(this.formInline)
+      this.getList()
       this.closeModal()
     },
     closeModal() {
@@ -288,55 +436,23 @@ export default {
       this.$refs.child.last()
       this.$refs.child.reset()
     },
-    btnClick(id) {
-      if (id.permissionName === '批量导入') {
-        this.sends()
-      } else if (id.permissionName === '新增商品') {
-        this.add()
-      }
-    },
-    handleSizeChange(val) {
-      this.formInline.pageSize = val
-      this.getAll(this.formInline)
-    },
-    handleCurrentChange(val) {
-      this.formInline.page = val
-      this.getAll(this.formInline)
-    },
-    //  查询
-    handleSearch() {
-      this.total = 1
-      this.formInline.page = 1
-      this.getAll(this.formInline)
-    },
-    // 重置
-    clear() {
-      this.formInline = {
-        search: '', // 搜索字段
-        shelveState: '', // 上架状态 1-上架 0-不上架 null-全部
-        stock: '', // 库存状态 1-有库存 0-无库存 null-全部
-        classifyId: '', // 最下级分类id
-        page: 1, // 当前页
-        pageSize: 10
-      }
-    },
+
     // 新增商品
-    add() {
+    handleAdd() {
       this.showTinymce = true
       if (this.commId) {
         this.$refs.child.reset()
       }
       this.commidyVisible = true
       this.commId = 0
-      // this.$router.push({ name: 'addCommodity', params: { id: '1' }})
     },
     // 导出商品
-    async productDataExport() {
+    async handleProductDataExport() {
       this.$message({
         message: '数据导出中,请勿重复操作!',
         type: 'success'
       })
-      const res = await productExport(this.formInline)
+      const res = await productExport(this.listQuery)
       if (!res) { return }
       const blob = new Blob([ res ], { type: 'application/vnd.ms-excel' })
       const fileName = '商品数据明细表.xls'
@@ -356,34 +472,18 @@ export default {
       }
     },
     // 批量导入
-    sends() {
+    handleSends() {
       this.batchAdd = true
       this.batchFileList = []
     },
     // 编辑商品
-    handleAddShopSelection(row) {
-      this.$confirm('确定添加为选品?')
-        .then(async () => {
-          await shopSelectionAddShopLibrary({ shopId: getShopId(), productId: row.productId })
-          this.$message({ message: '添加成功!', type: 'success' })
-          this.handleSearch()
-        })
-        .catch(() => {})
-    },
-    // 编辑商品
-    edit(row) {
+    handleEdit(row) {
       this.showTinymce = true
       this.commidyVisible = true
       this.commId = row.productId
       this.$nextTick(() => {
         this.$refs.child?.details()
       })
-      // this.$router.push({
-      //   name: 'addCommodity',
-      //   params: { productId: row.productId }
-      // })
-      // let res = await getClassifyGetById({ productId: row.productId });
-      // console.log(res);
     },
     // 设置会员价
     setVipPrice(row) {
@@ -442,114 +542,11 @@ export default {
             type: 'success',
             message: '设置成功!'
           })
-          this.getAll(this.formInline)
+          this.getList()
           this.vipPriceVisible = false
         }
       })
     },
-    // 清空会员价
-    clearProductMember() {
-      console.log(this.productData, 'this.productData')
-      this.$confirm('该商品所有旧设置的会员价将被清除, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        clearProductMember({ productId: this.productId }).then((res) => {
-          if (res.code === '') {
-            this.productData.map((item) => {
-              item.memberPrices.map((itemChild) => {
-                itemChild.price = null
-              })
-            })
-            this.$message.success('清除成功')
-            // this.vipPriceVisible = false
-          }
-        })
-      })
-    },
-    // 删除商品
-    del(row) {
-      this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          getClassifyDelete({ productId: row.productId }).then((res) => {
-            if (res.code === '') {
-              this.$message({
-                type: 'success',
-                message: '删除成功!'
-              })
-              this.getAll(this.formInline)
-            }
-          })
-        })
-        .catch(() => { })
-    },
-    // 商品上下架
-    async down(row) {
-      console.log(row.shelveState)
-      if (row.shelveState) {
-        console.log(111)
-        const res = await getClassifyStart({
-          productId: row.productId,
-          shelveState: 0
-        })
-        if (res.code === '') {
-          this.$message({
-            type: 'success',
-            message: '下架成功!'
-          })
-          this.getAll(this.formInline)
-        }
-      } else {
-        const res = await getClassifyStart({
-          productId: row.productId,
-          shelveState: 1
-        })
-        if (res.code === '') {
-          this.$message({
-            type: 'success',
-            message: '上架成功!'
-          })
-          this.getAll(this.formInline)
-        }
-      }
-    },
-    // 初始化查询所有数据
-    async getAll(formInline) {
-      this.formInline.classifyId =
-        this.formInline.classifyId[2] ||
-        this.formInline.classifyId[1] ||
-        this.formInline.classifyId[0] ||
-        this.formInline.classifyId
-      const res = await getClassifyGetAll(formInline)
-      this.total = res.data.total
-      this.tableData = res.data.list
-    },
-    // 初始化查询所有分类
-    async queryAllCategory() {
-      const res = await getClassify()
-      this.categoryList = res.data
-      this.handleRemoveEmptyChild(this.categoryList)
-    },
-    handleRemoveEmptyChild(arr) {
-      for (let i = 0; i < arr.length; i++) {
-        if (arr[i].childs && Array.isArray(arr[i].childs)) {
-          this.handleRemoveEmptyChild(arr[i].childs)
-        }
-        if (arr[i].childs && Array.isArray(arr[i].childs) && arr[i].childs.length === 0) {
-          delete arr[i].childs
-        }
-      }
-    },
-    // *********************导入部分
-    UploadUrls() {
-      // 因为action参数是必填项,我们使用二次确认进行文件上传时,直接填上传文件的url会因为没有参数导致api报404,所以这里将action设置为一个返回为空的方法就行,避免抛错
-      return ''
-    },
     // 下载模板
     poDownload() {
       downloadTemplate().then((res) => {
@@ -587,7 +584,7 @@ export default {
             this.$message.success('导入成功')
             this.batchAdd = false
             this.batchFileList = []
-            this.getAll(this.formInline)
+            this.getList()
           }
         })
       }
@@ -638,83 +635,31 @@ export default {
 }
 </script>
 
-<style lang='scss' scoped>
-//@import url(); 引入公共css类
-@import url("../../../styles/elDialog.scss");
-
-.pending {
-  padding: 30px;
-}
-
-.fenye {
-  margin-top: 20px;
-}
-
-.clickMe {
-  color: #3a68f2;
-  cursor: pointer;
-}
-
-.uploadDialog {
-
-  // display: flex;
-  // flex-direction: column;
-  // justify-content: center;
-  >>>.el-upload__tip {
-    display: inline-block;
-    width: 360px;
-    margin: auto;
-  }
-}
-
-.vipDialog {
-  .priceTable {
-    table {
-      width: 100%;
-      text-align: center;
-      border-left: 1px solid #EBEEF5;
-      border-bottom: 1px solid #EBEEF5;
-      font-size: 14px;
-      color: #606266;
-      border-collapse: collapse;
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
 
-      tr {
-        border-top: 1px solid #EBEEF5;
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
 
-        th {
-          padding: 12px 0;
-          background: #EEF3FF;
-          color: #333;
-          border-right: 1px solid #EBEEF5;
-        }
-
-        td {
-          padding: 12px 0;
-          border-right: 1px solid #EBEEF5;
-
-          &.td-input {
-            .el-input {
-              width: 80px;
-              margin-right: 0;
-            }
-          }
-
-          &:nth-child(1),
-          &:nth-child(2) {
-            width: 80px;
-          }
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
 
-          .el-input {
-            width: 100px;
-            margin-right: 10px;
-          }
-        }
-      }
-    }
-  }
-
-  .clearBtn {
-    margin-top: 20px;
-  }
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
 }
 </style>

+ 0 - 1
src/views/marketing/compose/add.vue

@@ -133,7 +133,6 @@
 
 <script>
 import { composeAdd, composeUpate, getComposeDetail, getComposeSelectProduct } from '@/api/marketing'
-import { getClassifyGetAll } from '@/api/commodity'
 function InitComposeForm() {
   this.composeProducts = [] // 商品明细数据
   this.composeName = '' // 活动名称

+ 0 - 1
src/views/marketing/price/add.vue

@@ -137,7 +137,6 @@
 
 <script>
 import { priceAdd, priceUpate, getPriceDetail, getComposeSelectProduct } from '@/api/marketing'
-// import { getClassifyGetAll } from '@/api/commodity'
 
 function InitPriceForm() {
   this.priceProducts = [] // 商品明细数据

+ 126 - 0
src/views/mealManagement/TableNumberSetting/components/DetailModal.vue

@@ -0,0 +1,126 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 桌号信息 -->
+      <el-form-item label="桌号ID" prop="id">
+        {{ formData.id || '--' }}
+      </el-form-item>
+      <el-form-item label="桌号名称" prop="name">
+        {{ formData.name || '--' }}
+      </el-form-item>
+      <el-form-item label="商家ID" prop="aid">
+        {{ formData.aid || '--' }}
+      </el-form-item>
+      <el-form-item label="区域ID" prop="areaId">
+        {{ formData.areaId || '--' }}
+      </el-form-item>
+      <el-form-item label="最大承载人数" prop="num">
+        {{ formData.num }}
+      </el-form-item>
+      <el-form-item label="餐桌状态" prop="status">
+        <span v-if="formData.status === 1">就餐中</span>
+        <span v-else-if="formData.status === 2">空闲</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="排序编号" prop="sort">
+        {{ formData.sort || '--' }}
+      </el-form-item>
+      <el-form-item label="是否禁用" prop="isStop">
+        <span v-if="formData.isStop === 0">否</span>
+        <span v-else-if="formData.isStop === 1">是</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="是否删除" prop="isDelete">
+        <span v-if="formData.isDelete === 0">否</span>
+        <span v-else-if="formData.isDelete === 1">是</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+      <el-form-item label="更新时间" prop="updateTime">
+        {{ formData.updateTime || '--' }}
+      </el-form-item>
+      <el-form-item label="删除时间" prop="deleteTime">
+        {{ formData.deleteTime || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import { detailPostShopAuthDept } from '@/api/mealManagement/TableNumberSetting'
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看桌号详情'
+      },
+      visible: false,
+      formData: {
+        id: '',
+        name: '',
+        aid: '',
+        areaId: '',
+        num: '',
+        status: '',
+        sort: '',
+        isStop: '',
+        isDelete: '',
+        createTime: '',
+        updateTime: '',
+        deleteTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await detailPostShopAuthDept({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          name: res.data.name || '',
+          aid: res.data.aid || '',
+          areaId: res.data.areaId || '',
+          num: res.data.num,
+          status: res.data.status,
+          sort: res.data.sort,
+          isStop: res.data.isStop,
+          isDelete: res.data.isDelete,
+          createTime: res.data.createTime || '',
+          updateTime: res.data.updateTime || '',
+          deleteTime: res.data.deleteTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 165 - 0
src/views/mealManagement/TableNumberSetting/components/EditModal.vue

@@ -0,0 +1,165 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="桌号名称" prop="name">
+        <el-input v-model="formData.name" placeholder="请输入桌号名称" maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="区域" prop="areaId">
+        <el-select v-model="formData.areaId" multiple size="mini" placeholder="请输入区域">
+          <el-option v-for="item in allRangeList" :key="item.id" :label="`${item.labelName}(${item.code})`" :value="item.id" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="餐桌最大承载人数" prop="num">
+        <el-input v-model="formData.num" placeholder="请输入餐桌最大承载人数" />
+      </el-form-item>
+      <el-form-item label="餐桌状态" prop="status">
+        <el-select v-model="formData.status" size="mini" placeholder="请选择餐桌状态">
+          <el-option label="就餐中" :value="1" />
+          <el-option label="空闲" :value="2" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="排序编号" prop="sort">
+        <el-input v-model="formData.sort" placeholder="请输入排序编号" />
+      </el-form-item>
+      <el-form-item label="是否禁用" prop="isStop">
+        <el-select v-model="formData.isStop" size="mini" placeholder="请选择是否禁用">
+          <el-option label="否" :value="0" />
+          <el-option label="是" :value="1" />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="mini" @click="handleClose">取 消</el-button>
+      <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { detailPostShopAuthDept, savePostShopAuthDept, updatePostShopAuthDept } from '@/api/mealManagement/TableNumberSetting'
+import { getAllShopAuthPost } from '@/api/mealManagement/regionalSetting'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        id: '',
+        name: '',
+        // aid: '',
+        areaId: '',
+        num: '',
+        status: '',
+        sort: '',
+        isStop: ''
+      },
+      formRules: {
+        name: [
+          { required: true, message: '请输入桌号名称' }
+        ],
+        areaId: [
+          { required: true, message: '请选择所属区域' }
+        ],
+        num: [
+          { required: true, message: '请输入餐桌最大承载人数' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        status: [
+          { required: true, message: '请选择餐桌状态' }
+        ],
+        sort: [
+          { required: true, message: '请输入桌号排序' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        isStop: [
+          { required: true, message: '请选择是否禁用' }
+        ]
+      },
+      allRangeList: []
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    async initList() {
+      const res = await getAllShopAuthPost({ name: '', isStop: '' })
+      this.allRangeList = res.data
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.id ? '编辑桌号' : '添加桌号'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      if (params.id) {
+        this.getInfo(params.id)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await detailPostShopAuthDept({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          code: res.data.code || '',
+          name: res.data.name || '',
+          remarks: res.data.remarks || '',
+          sort: res.data.sort,
+          isStop: res.data.isStop
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '提交中,请稍候……' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.id ? await updatePostShopAuthDept(params) : await savePostShopAuthDept(params)
+            loading.close()
+            this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 115 - 0
src/views/mealManagement/TableNumberSetting/components/MealOrderCreate.vue

@@ -0,0 +1,115 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="桌号ID" prop="deskId">
+        <el-input
+          v-model="formData.deskId" maxlength="20" placeholder="桌号ID" disabled
+        />
+      </el-form-item>
+      <el-form-item label="用餐人数" prop="userNum">
+        <el-input v-model="formData.userNum" placeholder="请输入用餐人数" />
+      </el-form-item>
+      <el-form-item label="下单类型" prop="type">
+        <el-select v-model="formData.type" size="mini" placeholder="请选择下单类型">
+          <el-option label="后台点单" :value="0" />
+          <el-option label="扫码点单" :value="1" />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { createShopLaOrders } from '@/api/mealManagement/TableNumberSetting'
+
+export default {
+  name: 'MealOrderCreate',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '620px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        deskId: '',
+        userNum: '',
+        type: ''
+      },
+      formRules: {
+        deskId: [
+          { required: true, message: '缺少桌号信息' }
+        ],
+        userNum: [
+          { required: true, message: '请输入用餐人数' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        type: [
+          { required: true, message: '请选择下单类型' }
+        ]
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    initList() {
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = '创建点餐订单'
+      this.formData.deskId = params.id
+      // this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      this.$refs.formData && this.$refs.formData.resetFields()
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '加载中' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            await createShopLaOrders(params)
+            loading.close()
+            this.$message({ message: `操作成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 226 - 0
src/views/mealManagement/TableNumberSetting/index.vue

@@ -0,0 +1,226 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.name" clearable size="mini" class="filter-item"
+        style="width: 200px;" placeholder="请输入桌号名称"
+      />
+      <el-select
+        v-model="listQuery.isStop" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请选择是否停用"
+      >
+        <el-option label="否" :value="0" />
+        <el-option label="是" :value="1" />
+      </el-select>
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+      <br />
+      <el-button
+        size="mini" type="primary" icon="el-icon-plus"
+        @click="$refs.EditModal && $refs.EditModal.handleOpen({ id: '' })"
+      >
+        添加
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="桌号ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="桌号名称" prop="name" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="商家ID" prop="aid" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="区域ID" prop="areaId" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="最大承载人数" prop="num" show-overflow-tooltip />
+        <el-table-column align="center" label="餐桌状态" prop="status">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.status === 1" effect="plain" type="info">就餐中</el-tag>
+            <el-tag v-else-if="row.status === 2" effect="plain" type="success">空闲</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="100" label="排序编号" prop="sort" show-overflow-tooltip />
+        <el-table-column align="center" label="是否禁用" prop="isStop">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.isStop === 0" effect="plain" type="info">否</el-tag>
+            <el-tag v-else-if="row.isStop === 1" effect="plain" type="success">是</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否删除" prop="isDelete">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.isDelete === 0" effect="plain" type="info">否</el-tag>
+            <el-tag v-else-if="row.isDelete === 1" effect="plain" type="success">是</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="300" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button size="mini" @click="handleEdit(row)">
+              编辑
+            </el-button>
+            <el-button
+              type="info" size="mini"
+              @click="handleCreatCode(row)"
+            >
+              创建桌码
+            </el-button>
+            <el-button
+              type="primary" size="mini"
+              @click="$refs.MealOrderCreate && $refs.MealOrderCreate.handleOpen(row)"
+            >
+              创建订单
+            </el-button>
+            <el-button
+              type="warning" size="mini"
+              @click="handleCheckout(row)"
+            >
+              结账
+            </el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 创建点餐订单 -->
+    <MealOrderCreate ref="MealOrderCreate" @success="getList" />
+    <!-- 新增编辑 -->
+    <EditModal ref="EditModal" @success="getList" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+  </div>
+</template>
+
+<script>
+import MealOrderCreate from './components/MealOrderCreate'
+import EditModal from './components/EditModal'
+import DetailModal from './components/DetailModal'
+import { getPageAllShopAuthDept, deletePostShopAuthDept, createQRShopAuthDept, checkoutShopLaOrders } from '@/api/mealManagement/TableNumberSetting'
+
+export default {
+  name: 'TableNumberSetting',
+  components: {
+    MealOrderCreate,
+    EditModal,
+    DetailModal
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        name: '',
+        isStop: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getPageAllShopAuthDept(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleEdit(row) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    },
+    handleDelete(row) {
+      this.$confirm('确定删除此项?')
+        .then(async () => {
+          await deletePostShopAuthDept({ id: row.id })
+          this.$message({ message: '删除成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    },
+    handleCreatCode(row) {
+      this.$confirm('确定对此项创建桌号二维码?')
+        .then(async () => {
+          await createQRShopAuthDept({ id: row.id })
+          this.$message({ message: '创建成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    },
+    handleCheckout(row) {
+      this.$confirm('确定结账此项?')
+        .then(async () => {
+          await checkoutShopLaOrders({ did: row.id })
+          this.$message({ message: '结账成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 141 - 0
src/views/mealManagement/currentOrders/components/DetailModal.vue

@@ -0,0 +1,141 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 定价方案信息 -->
+      <el-form-item label="定价方案ID" prop="priceId">
+        {{ formData.priceId || '--' }}
+      </el-form-item>
+      <el-form-item label="店铺ID" prop="shopId">
+        {{ formData.shopId || '--' }}
+      </el-form-item>
+      <el-form-item label="方案名称" prop="programmeName">
+        {{ formData.programmeName || '--' }}
+      </el-form-item>
+      <el-form-item label="优惠定价系数" prop="preferentialPrice">
+        {{ formData.preferentialPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="市场价定价系数" prop="marketPrice">
+        {{ formData.marketPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="供货价定价系数" prop="supplyPrice">
+        {{ formData.supplyPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="渠道价定价系数" prop="channelPrice">
+        {{ formData.channelPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="活动开始时间" prop="startTime">
+        {{ formData.startTime || '--' }}
+      </el-form-item>
+      <el-form-item label="活动结束时间" prop="endTime">
+        {{ formData.endTime || '--' }}
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <span v-if="formData.status === 0">未开始</span>
+        <span v-else-if="formData.status === 1">进行中</span>
+        <span v-else-if="formData.status === 2">已结束</span>
+        <span v-else-if="formData.status === 3">已停用</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="类型" prop="type">
+        <span v-if="formData.type === 0">平台</span>
+        <span v-else-if="formData.type === 1">团长</span>
+        <span v-else-if="formData.type === 2">合伙人</span>
+        <span v-else-if="formData.type === 3">加盟商</span>
+        <span v-else-if="formData.type === 4">代理商</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="是否默认选择" prop="isDefault">
+        <span v-if="formData.isDefault === 0">否</span>
+        <span v-else-if="formData.isDefault === 1">是</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+      <el-form-item label="更新时间" prop="updateTime">
+        {{ formData.updateTime || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import { priceControlGetById } from '@/api/selectionCenter/selectionCenter'
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看定价方案详情'
+      },
+      visible: false,
+      formData: {
+        priceId: '',
+        shopId: '',
+        programmeName: '',
+        preferentialPrice: '',
+        marketPrice: '',
+        supplyPrice: '',
+        channelPrice: '',
+        startTime: '',
+        endTime: '',
+        status: '',
+        type: '',
+        isDefault: '',
+        createTime: '',
+        updateTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.priceId) {
+        this.getInfo(params.priceId)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await priceControlGetById({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          priceId: res.data.priceId || '',
+          shopId: res.data.shopId || '',
+          programmeName: res.data.programmeName || '',
+          preferentialPrice: res.data.preferentialPrice || '',
+          marketPrice: res.data.marketPrice || '',
+          supplyPrice: res.data.supplyPrice || '',
+          channelPrice: res.data.channelPrice || '',
+          startTime: res.data.startTime || '',
+          endTime: res.data.endTime || '',
+          status: res.data.status,
+          type: res.data.type,
+          isDefault: res.data.isDefault,
+          createTime: res.data.createTime || '',
+          updateTime: res.data.updateTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 204 - 0
src/views/mealManagement/currentOrders/components/EditModal.vue

@@ -0,0 +1,204 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="方案名称" prop="programmeName">
+        <el-input v-model="formData.programmeName" placeholder="请输入方案名称" maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="优惠定价系数" prop="preferentialPrice">
+        <el-input v-model="formData.preferentialPrice" placeholder="请输入优惠定价系数" />
+      </el-form-item>
+      <el-form-item label="市场价定价系数" prop="marketPrice">
+        <el-input v-model="formData.marketPrice" placeholder="请输入市场价定价系数" />
+      </el-form-item>
+      <el-form-item label="供货价定价系数" prop="supplyPrice">
+        <el-input v-model="formData.supplyPrice" placeholder="请输入供货价定价系数" />
+      </el-form-item>
+      <el-form-item label="渠道价定价系数" prop="channelPrice">
+        <el-input v-model="formData.channelPrice" placeholder="请输入渠道价定价系数" />
+      </el-form-item>
+      <el-form-item label="类型" prop="type">
+        <el-select v-model="formData.type" size="mini" placeholder="请选择板块类型">
+          <!-- 加盟商下有团长、合伙人。代理商下有团长、合伙人、加盟商。 -->
+          <el-option label="平台" :value="0" />
+          <el-option label="团长" :value="1" />
+          <el-option label="合伙人" :value="2" />
+          <el-option label="加盟商" :value="3" />
+          <el-option label="代理商" :value="4" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="活动开始时间" prop="startTime">
+        <el-date-picker
+          v-model="formData.startTime"
+          size="medium"
+          type="date"
+          placeholder="选择活动开始时间"
+          value-format="yyyy-MM-dd HH:mm:ss"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item label="活动结束时间" prop="endTime">
+        <el-date-picker
+          v-model="formData.endTime"
+          size="medium"
+          type="date"
+          placeholder="选择活动结束时间"
+          value-format="yyyy-MM-dd HH:mm:ss"
+        ></el-date-picker>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="mini" @click="handleClose">取 消</el-button>
+      <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { getShopId } from '@/utils/auth'
+import { priceControlGetById, priceControlSavePlan, priceControlUpdatePlan } from '@/api/selectionCenter/selectionCenter'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        priceId: '',
+        shopId: getShopId(),
+        programmeName: '',
+        preferentialPrice: '',
+        marketPrice: '',
+        supplyPrice: '',
+        channelPrice: '',
+        startTime: '',
+        endTime: '',
+        status: '',
+        type: '',
+        isDefault: '',
+        createTime: '',
+        updateTime: ''
+      },
+      formRules: {
+        shopId: [
+          { required: true, message: '缺少店铺ID' }
+        ],
+        programmeName: [
+          { required: true, message: '请输入方案名称' }
+        ],
+        preferentialPrice: [
+          { required: false, message: '请输入优惠定价系数' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' } // >0的数字, 最多2位小数正则
+        ],
+        marketPrice: [
+          { required: false, message: '请输入市场价定价系数' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        supplyPrice: [
+          { required: false, message: '请输入供货价定价系数' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        channelPrice: [
+          { required: false, message: '请输入渠道价定价系数' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        type: [
+          { required: true, message: '请选择定价方案类型' }
+        ],
+        startTime: [
+          { required: false, message: '请选择活动开始时间' }
+        ],
+        endTime: [
+          { required: false, message: '请选择活动结束时间' }
+        ]
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    initList() {
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.priceId ? '编辑定价方案' : '添加定价方案'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      if (params.priceId) {
+        this.getInfo(params.priceId)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await priceControlGetById({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          priceId: res.data.priceId || '',
+          shopId: res.data.shopId || getShopId(),
+          programmeName: res.data.programmeName || '',
+          preferentialPrice: res.data.preferentialPrice || '',
+          marketPrice: res.data.marketPrice || '',
+          supplyPrice: res.data.supplyPrice || '',
+          channelPrice: res.data.channelPrice || '',
+          startTime: res.data.startTime || '',
+          endTime: res.data.endTime || '',
+          status: res.data.status,
+          type: res.data.type,
+          isDefault: res.data.isDefault,
+          createTime: res.data.createTime || '',
+          updateTime: res.data.updateTime || ''
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '提交中,请稍候……' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.priceId ? await priceControlUpdatePlan(params) : await priceControlSavePlan(params)
+            loading.close()
+            this.$message({ message: `${this.formData.priceId ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 151 - 0
src/views/mealManagement/currentOrders/index.vue

@@ -0,0 +1,151 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="订单号" prop="number" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="商家ID" prop="aid" show-overflow-tooltip />
+        <el-table-column align="center" width="100" label="桌号ID" prop="deskId" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="用餐人数" prop="userNum" show-overflow-tooltip />
+        <el-table-column align="center" label="订单类型" prop="type">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.type === 0" effect="plain" type="info">后台点单</el-tag>
+            <el-tag v-else-if="row.type === 1" effect="plain" type="success">扫码点单</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="订单状态" prop="status">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.status === 0" effect="plain" type="info">待下单</el-tag>
+            <el-tag v-else-if="row.status === 1" effect="plain" type="danger">待结帐</el-tag>
+            <el-tag v-else-if="row.status === 2" effect="plain" type="success">已完成</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" min-width="150" label="备注" prop="remark" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="金额" prop="amount" show-overflow-tooltip />
+        <el-table-column align="center" width="150" label="结账时间" prop="checkoutTime" />
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="300" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button
+              type="warning" size="mini"
+              @click="$refs.MealOrderPlace && $refs.MealOrderPlace.handleOpen(row)"
+            >
+              下单
+            </el-button>
+            <el-button
+              type="primary" size="mini"
+              @click="$refs.AddDishes && $refs.AddDishes.handleOpen(row)"
+            >
+              菜品添加
+            </el-button>
+            <el-button
+              type="info" size="mini"
+              @click="$refs.OrderDishes && $refs.OrderDishes.handleOpen(row)"
+            >
+              订单菜品
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <!-- 点餐订单下单 -->
+    <MealOrderPlace ref="MealOrderPlace" @success="getList" />
+    <!-- 菜品添加 -->
+    <AddDishes ref="AddDishes" @success="getList" />
+    <!-- 订单菜品 -->
+    <OrderDishes ref="OrderDishes" @success="getList" />
+  </div>
+</template>
+
+<script>
+import MealOrderPlace from '../mealOrders/components/MealOrderPlace'
+import AddDishes from '../mealOrders/components/AddDishes'
+import OrderDishes from '../mealOrders/components/OrderDishes'
+import { getCurrentShopLaOrders } from '@/api/mealManagement/currentOrders'
+
+export default {
+  name: 'CurrentOrders',
+  components: {
+    MealOrderPlace,
+    AddDishes,
+    OrderDishes
+  },
+  data() {
+    return {
+      list: [],
+      listLoading: true,
+      listQuery: {}
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getCurrentShopLaOrders(this.listQuery)
+        this.list = res.data
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 235 - 0
src/views/mealManagement/mealOrders/components/AddDishes.vue

@@ -0,0 +1,235 @@
+<template>
+  <el-dialog :visible.sync="visible" v-bind="modalOptions" append-to-body>
+    <div>
+      <!-- 查询和其他操作 -->
+      <div class="filter-container">
+        <el-select
+          v-model="productListQuery.shelveState" clearable size="mini" class="filter-item"
+          style="width: 200px;"
+          placeholder="请选择上架状态"
+        >
+          <el-option label="全部" :value="null" />
+          <el-option label="上架" :value="1" />
+          <el-option label="下架" :value="0" />
+        </el-select>
+        <el-input
+          v-model="productListQuery.search" clearable size="mini" class="filter-item"
+          maxlength="20" style="width: 200px;margin-left: 10px;" placeholder="请输入商品名称"
+        />
+        <el-input
+          v-model="productListQuery.productMarque" clearable size="mini" class="filter-item"
+          style="width: 200px;margin-left: 10px;" placeholder="请输入商品型号"
+        />
+        <el-cascader
+          v-model="productListQuery.classifyId" placeholder="请选择分类"
+          :options="categoryList" clearable size="mini" class="filter-item"
+          :props="{ checkStrictly: true, expandTrigger: 'hover', label: 'categoryName', value: 'id', children: 'childs' }"
+          style="width: 200px;margin-left: 10px;"
+        />
+        <el-button
+          size="mini" class="filter-item" type="primary" icon="el-icon-search"
+          style="margin-left:10px;"
+          @click="handleSearch"
+        >
+          查找
+        </el-button>
+        <el-button size="mini" type="info" class="filter-item" @click="handleReset">
+          重置
+        </el-button>
+      </div>
+
+      <!-- 表格 -->
+      <div>
+        <el-table
+          v-loading="productListLoading" height="60vh" element-loading-text="正在查询中。。。" :data="productDataList"
+          v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+        >
+          <el-table-column align="center" width="100" label="商品ID" prop="productId" fixed="left" />
+          <el-table-column align="center" width="100" label="商品主图" prop="productImage">
+            <template slot-scope="{ row }">
+              <el-image
+                v-if="row.productImage" lazy :src="common.seamingImgUrl(row.productImage)" style="width:40px;height:40px"
+                fit="cover" :preview-src-list="[ common.seamingImgUrl(row.productImage) ]"
+              />
+              <span v-else>--</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="section" label="售价区间" show-overflow-tooltip />
+          <el-table-column prop="memberSection" label="会员价" show-overflow-tooltip />
+          <el-table-column align="center" label="积分兑换" prop="ifCredit">
+            <template slot-scope="{ row }">
+              <el-tag v-if="row.ifCredit === 0">不允许</el-tag>
+              <el-tag v-else-if="row.ifCredit === 1">允许</el-tag>
+              <span v-else>--</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="stockNumber" label="库存" show-overflow-tooltip />
+          <el-table-column prop="volume" label="销量" show-overflow-tooltip />
+          <el-table-column align="center" label="上架状态" prop="shelveState">
+            <template slot-scope="{ row }">
+              <el-tag v-if="row.shelveState === 0">未上架</el-tag>
+              <el-tag v-else-if="row.shelveState === 1">已上架</el-tag>
+              <el-tag v-else-if="row.shelveState === 2">待审核</el-tag>
+              <el-tag v-else-if="row.shelveState === 3">审核失败</el-tag>
+              <span v-else>--</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="reject" label="驳回原因" show-overflow-tooltip />
+          <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+          <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+            <template slot-scope="{ row }">
+              <el-button type="warning" size="mini" @click="$refs.DetailModal && $refs.DetailModal.handleOpen(row)">
+                详情
+              </el-button>
+              <el-button
+                type="warning" size="mini"
+                @click="handleAddAishes(row)"
+              >
+                添加菜品
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <!-- 查看详情 -->
+        <DetailModal ref="DetailModal" />
+      </div>
+      <div>
+        <el-pagination
+          :current-page="productListQuery.page" :page-sizes="[10, 20, 50, 100]"
+          :page-size="productListQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="productTotal"
+          @size-change="(val) => ((productListQuery.pageSize = val) && getProductList())"
+          @current-change="(val) => ((productListQuery.page = val) && getProductList())"
+        />
+      </div>
+    </div>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">关 闭</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import DetailModal from '../../../commodity/commoditySystem/components/DetailModal'
+import { dishAddShopLaOrdersDish } from '@/api/mealManagement/mealOrders'
+import { getClassify, getClassifyGetAll } from '@/api/commodity'
+import XeUtils from 'xe-utils'
+
+export default {
+  name: 'AddDishes',
+  components: {
+    DetailModal
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '920px',
+        title: '菜品添加'
+      },
+      visible: false,
+      formData: {
+        orderId: ''
+      },
+      categoryList: [],
+      productDataList: [],
+      productTotal: 0,
+      productListLoading: true,
+      productListQuery: {
+        productMarque: '',
+        search: '',
+        shelveState: '',
+        stock: '',
+        classifyId: '',
+        page: 1,
+        pageSize: 10
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    async getCategoryTreeList() {
+      const res = await getClassify()
+      XeUtils.eachTree(res.data, (item) => {
+        if (Array.isArray(item.childs) && item.childs.length === 0) {
+          item.childs = undefined
+        }
+      }, { children: 'childs' })
+      this.categoryList = res.data
+    },
+    async getProductList() {
+      this.productListLoading = true
+      try {
+        const res = await getClassifyGetAll(this.productListQuery)
+        this.productDataList = res.data.list
+        this.productTotal = res.data.total
+      } finally {
+        this.productListLoading = false
+      }
+    },
+    async initList() {
+      this.getCategoryTreeList()
+      this.productListQuery = { productMarque: '', search: '', shelveState: '', stock: '', classifyId: '', page: 1, pageSize: 10 }
+      this.getProductList()
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params, { orderId: params.id })
+      this.initList()
+      if (params.id) {
+        // this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await xxx({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || ''
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+    },
+
+    handleSearch() {
+      this.productListQuery.page = 1
+      this.getProductList()
+    },
+    handleReset() {
+      this.productListQuery = { productMarque: '', search: '', shelveState: '', stock: '', classifyId: '', page: 1, pageSize: 10 }
+      this.getProductList()
+    },
+    handleAddAishes(row) {
+      this.$confirm('确定对此项添加为菜品?')
+        .then(async () => {
+          await dishAddShopLaOrdersDish({ orderId: this.formData.orderId, dishId: row.productId })
+          this.$message({ message: '添加成功!', type: 'success' })
+          // this.getProductList()
+        })
+        .catch(() => { })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.small-padding {
+	.cell {
+		padding-left: 5px;
+		padding-right: 5px;
+	}
+}
+
+.fixed-width {
+	.el-button--mini {
+		padding: 7px 10px;
+	}
+}
+</style>

+ 120 - 0
src/views/mealManagement/mealOrders/components/DetailModal.vue

@@ -0,0 +1,120 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 点餐订单信息 -->
+      <el-form-item label="ID" prop="id">
+        {{ formData.id || '--' }}
+      </el-form-item>
+      <el-form-item label="订单号" prop="number">
+        {{ formData.number || '--' }}
+      </el-form-item>
+      <el-form-item label="商家ID" prop="aid">
+        {{ formData.aid || '--' }}
+      </el-form-item>
+      <el-form-item label="桌号ID" prop="deskId">
+        {{ formData.deskId || '--' }}
+      </el-form-item>
+      <el-form-item label="用餐人数" prop="userNum">
+        {{ formData.userNum }}
+      </el-form-item>
+      <el-form-item label="订单类型" prop="type">
+        <span v-if="formData.type === 0">后台点单</span>
+        <span v-else-if="formData.type === 1">扫码点单</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <span v-if="formData.status === 0">待下单</span>
+        <span v-else-if="formData.status === 1">待结帐</span>
+        <span v-else-if="formData.status === 2">已完成</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="备注" prop="remark">
+        {{ formData.remark || '--' }}
+      </el-form-item>
+      <el-form-item label="金额" prop="amount">
+        {{ formData.amount }}
+      </el-form-item>
+      <el-form-item label="结账时间" prop="checkoutTime">
+        {{ formData.checkoutTime || '--' }}
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import { priceControlGetById } from '@/api/selectionCenter/selectionCenter'
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看点餐订单详情'
+      },
+      visible: false,
+      formData: {
+        id: '',
+        number: '',
+        aid: '',
+        deskId: '',
+        userNum: '',
+        type: '',
+        status: '',
+        remark: '',
+        amount: '',
+        checkoutTime: '',
+        createTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        // this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await priceControlGetById({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          number: res.data.number || '',
+          aid: res.data.aid || '',
+          deskId: res.data.deskId || '',
+          userNum: res.data.userNum,
+          type: res.data.type,
+          status: res.data.status,
+          remark: res.data.remark || '',
+          amount: res.data.amount,
+          checkoutTime: res.data.checkoutTime || '',
+          createTime: res.data.createTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 104 - 0
src/views/mealManagement/mealOrders/components/MealOrderPlace.vue

@@ -0,0 +1,104 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="订单号Id" prop="number">
+        <el-input
+          v-model="formData.number" maxlength="20" placeholder="订单号Id" disabled
+        />
+      </el-form-item>
+      <el-form-item label="区域备注" prop="remark">
+        <el-input v-model="formData.remark" type="textarea" placeholder="请输入订单备注" maxlength="520" :rows="3" show-word-limit />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { submitShopLaOrders } from '@/api/mealManagement/mealOrders'
+
+export default {
+  name: 'MealOrderPlace',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '620px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        number: '',
+        remark: ''
+      },
+      formRules: {
+        number: [
+          { required: true, message: '缺少订单信息' }
+        ],
+        remark: [
+          { required: false, message: '请输入备注' }
+        ]
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    initList() {
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = '点餐订单下单'
+      this.formData.number = params.id
+      // this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      this.$refs.formData && this.$refs.formData.resetFields()
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '加载中' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            await submitShopLaOrders(params)
+            loading.close()
+            this.$message({ message: `操作成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 176 - 0
src/views/mealManagement/mealOrders/components/OrderDishes.vue

@@ -0,0 +1,176 @@
+<template>
+  <el-dialog :visible.sync="visible" v-bind="modalOptions">
+    <div>
+      <div style="display: flex;justify-content: flex-end;padding: 0 0 10px;">
+        <el-button
+          v-if="!listLoading && list && list.length"
+          type="danger" size="medium"
+          @click="handleEmptyDishes()"
+        >
+          菜品清空
+        </el-button>
+      </div>
+
+      <!-- 查询结果 -->
+      <div>
+        <el-table
+          v-loading="listLoading" max-height="600" element-loading-text="正在查询中。。。" :data="list"
+          :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark"
+          v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+        >
+          <el-table-column align="center" min-width="80" prop="id" label="ID" />
+          <el-table-column align="center" width="120" prop="orderId" label="订单ID" show-overflow-tooltip />
+          <el-table-column align="center" min-width="120" label="商品ID" prop="dishId">
+            <template slot-scope="{ row }">
+              <div>
+                <span>{{ row.dishId }}</span>
+                <el-button
+                  v-if="row.dishId"
+                  style="margin-left: 14px;"
+                  type="warning" size="mini"
+                  @click="$refs.DetailModal && $refs.DetailModal.handleOpen({ productId: row.dishId })"
+                >
+                  详情
+                </el-button>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" width="120" prop="quantity" label="商品数量" show-overflow-tooltip />
+          <el-table-column align="center" min-width="100" prop="amount" label="商品金额" show-overflow-tooltip />
+          <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+          <el-table-column label="操作" width="140" fixed="right" class-name="small-padding fixed-width">
+            <template slot-scope="{ row }">
+              <el-button
+                type="warning" size="mini" @click="handleAddDishes(row)"
+              >
+                菜品+1
+              </el-button>
+              <el-button
+                v-if="row.quantity"
+                type="danger" size="mini" @click="handleSubtractDishes(row)"
+              >
+                菜品-1
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <!-- 查看详情 -->
+      <DetailModal ref="DetailModal" />
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getDishShopLaOrders, dishIncShopLaOrdersDish, dishDecShopLaOrdersDish, toEmptyShopLaOrdersDish } from '@/api/mealManagement/mealOrders'
+import DetailModal from '../../../commodity/commoditySystem/components/DetailModal'
+
+export default {
+  name: 'OrderDishes',
+  components: {
+    DetailModal
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '1000px',
+        title: '查看点餐订单详情'
+      },
+      visible: false,
+      formData: {
+        id: ''
+      },
+      list: [],
+      // total: 0,
+      listLoading: true,
+      listQuery: {
+        // page: 1,
+        // pageSize: 10,
+        // id: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      // this.listQuery.id = params.id
+      if (params.activityId) {
+        // this.getInfo(params.activityId)
+        this.getList()
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await xxx({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          xxx: res.data.xxx || ''
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getDishShopLaOrders(this.listQuery)
+        this.list = res.data.list
+        // this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+
+    handleEmptyDishes() {
+      this.$confirm('确定尝试菜品清空?', '菜品清空')
+        .then(async () => {
+          await toEmptyShopLaOrdersDish({ id: this.formData.id })
+          this.$message({ message: '操作成功!', type: 'success' })
+          this.getList()
+          // this.$emit('success')
+          // this.visible = false
+        })
+        .catch(() => { })
+    },
+    handleAddDishes(row) {
+      this.$confirm('确定将该菜品数量+1?')
+        .then(async () => {
+          await dishIncShopLaOrdersDish({ id: row.dishId })
+          this.$message({ message: '+1成功!', type: 'success' })
+          this.getList()
+        })
+        .catch(() => { })
+    },
+    handleSubtractDishes(row) {
+      this.$confirm('确定将该菜品数量-1?')
+        .then(async () => {
+          await dishDecShopLaOrdersDish({ id: row.dishId })
+          this.$message({ message: '-1成功!', type: 'success' })
+          this.getList()
+        })
+        .catch(() => { })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.small-padding {
+	.cell {
+		padding-left: 5px;
+		padding-right: 5px;
+	}
+}
+
+.fixed-width {
+	.el-button--mini {
+		padding: 7px 10px;
+	}
+}
+</style>

+ 183 - 0
src/views/mealManagement/mealOrders/index.vue

@@ -0,0 +1,183 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-select
+        v-model="listQuery.type" clearable size="mini" class="filter-item"
+        style="width: 200px;" placeholder="请选择订单类型"
+      >
+        <el-option label="后台点单" :value="0" />
+        <el-option label="扫码点单" :value="1" />
+      </el-select>
+      <el-select
+        v-model="listQuery.status" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请选择订单状态"
+      >
+        <el-option label="待下单" :value="0" />
+        <el-option label="待结帐" :value="1" />
+        <el-option label="已完成" :value="2" />
+      </el-select>
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="订单号" prop="number" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="商家ID" prop="aid" show-overflow-tooltip />
+        <el-table-column align="center" width="100" label="桌号ID" prop="deskId" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="用餐人数" prop="userNum" show-overflow-tooltip />
+        <el-table-column align="center" label="订单类型" prop="type">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.type === 0" effect="plain" type="info">后台点单</el-tag>
+            <el-tag v-else-if="row.type === 1" effect="plain" type="success">扫码点单</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="订单状态" prop="status">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.status === 0" effect="plain" type="info">待下单</el-tag>
+            <el-tag v-else-if="row.status === 1" effect="plain" type="danger">待结帐</el-tag>
+            <el-tag v-else-if="row.status === 2" effect="plain" type="success">已完成</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" min-width="150" label="备注" prop="remark" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="金额" prop="amount" show-overflow-tooltip />
+        <el-table-column align="center" width="150" label="结账时间" prop="checkoutTime" />
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="300" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button
+              type="warning" size="mini"
+              @click="$refs.MealOrderPlace && $refs.MealOrderPlace.handleOpen(row)"
+            >
+              下单
+            </el-button>
+            <el-button
+              type="primary" size="mini"
+              @click="$refs.AddDishes && $refs.AddDishes.handleOpen(row)"
+            >
+              菜品添加
+            </el-button>
+            <el-button
+              type="info" size="mini"
+              @click="$refs.OrderDishes && $refs.OrderDishes.handleOpen(row)"
+            >
+              订单菜品
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 点餐订单下单 -->
+    <MealOrderPlace ref="MealOrderPlace" @success="getList" />
+    <!-- 菜品添加 -->
+    <AddDishes ref="AddDishes" @success="getList" />
+    <!-- 订单菜品 -->
+    <OrderDishes ref="OrderDishes" @success="getList" />
+  </div>
+</template>
+
+<script>
+import MealOrderPlace from './components/MealOrderPlace'
+import AddDishes from './components/AddDishes'
+import OrderDishes from './components/OrderDishes'
+import { getOrderListShopLaOrders } from '@/api/mealManagement/mealOrders'
+
+export default {
+  name: 'MealOrders',
+  components: {
+    MealOrderPlace,
+    AddDishes,
+    OrderDishes
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        type: '',
+        status: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getOrderListShopLaOrders(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 141 - 0
src/views/mealManagement/mealProcessing/components/DetailModal.vue

@@ -0,0 +1,141 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 定价方案信息 -->
+      <el-form-item label="定价方案ID" prop="priceId">
+        {{ formData.priceId || '--' }}
+      </el-form-item>
+      <el-form-item label="店铺ID" prop="shopId">
+        {{ formData.shopId || '--' }}
+      </el-form-item>
+      <el-form-item label="方案名称" prop="programmeName">
+        {{ formData.programmeName || '--' }}
+      </el-form-item>
+      <el-form-item label="优惠定价系数" prop="preferentialPrice">
+        {{ formData.preferentialPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="市场价定价系数" prop="marketPrice">
+        {{ formData.marketPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="供货价定价系数" prop="supplyPrice">
+        {{ formData.supplyPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="渠道价定价系数" prop="channelPrice">
+        {{ formData.channelPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="活动开始时间" prop="startTime">
+        {{ formData.startTime || '--' }}
+      </el-form-item>
+      <el-form-item label="活动结束时间" prop="endTime">
+        {{ formData.endTime || '--' }}
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <span v-if="formData.status === 0">未开始</span>
+        <span v-else-if="formData.status === 1">进行中</span>
+        <span v-else-if="formData.status === 2">已结束</span>
+        <span v-else-if="formData.status === 3">已停用</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="类型" prop="type">
+        <span v-if="formData.type === 0">平台</span>
+        <span v-else-if="formData.type === 1">团长</span>
+        <span v-else-if="formData.type === 2">合伙人</span>
+        <span v-else-if="formData.type === 3">加盟商</span>
+        <span v-else-if="formData.type === 4">代理商</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="是否默认选择" prop="isDefault">
+        <span v-if="formData.isDefault === 0">否</span>
+        <span v-else-if="formData.isDefault === 1">是</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+      <el-form-item label="更新时间" prop="updateTime">
+        {{ formData.updateTime || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import { priceControlGetById } from '@/api/selectionCenter/selectionCenter'
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看定价方案详情'
+      },
+      visible: false,
+      formData: {
+        priceId: '',
+        shopId: '',
+        programmeName: '',
+        preferentialPrice: '',
+        marketPrice: '',
+        supplyPrice: '',
+        channelPrice: '',
+        startTime: '',
+        endTime: '',
+        status: '',
+        type: '',
+        isDefault: '',
+        createTime: '',
+        updateTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.priceId) {
+        this.getInfo(params.priceId)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await priceControlGetById({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          priceId: res.data.priceId || '',
+          shopId: res.data.shopId || '',
+          programmeName: res.data.programmeName || '',
+          preferentialPrice: res.data.preferentialPrice || '',
+          marketPrice: res.data.marketPrice || '',
+          supplyPrice: res.data.supplyPrice || '',
+          channelPrice: res.data.channelPrice || '',
+          startTime: res.data.startTime || '',
+          endTime: res.data.endTime || '',
+          status: res.data.status,
+          type: res.data.type,
+          isDefault: res.data.isDefault,
+          createTime: res.data.createTime || '',
+          updateTime: res.data.updateTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 204 - 0
src/views/mealManagement/mealProcessing/components/EditModal.vue

@@ -0,0 +1,204 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="方案名称" prop="programmeName">
+        <el-input v-model="formData.programmeName" placeholder="请输入方案名称" maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="优惠定价系数" prop="preferentialPrice">
+        <el-input v-model="formData.preferentialPrice" placeholder="请输入优惠定价系数" />
+      </el-form-item>
+      <el-form-item label="市场价定价系数" prop="marketPrice">
+        <el-input v-model="formData.marketPrice" placeholder="请输入市场价定价系数" />
+      </el-form-item>
+      <el-form-item label="供货价定价系数" prop="supplyPrice">
+        <el-input v-model="formData.supplyPrice" placeholder="请输入供货价定价系数" />
+      </el-form-item>
+      <el-form-item label="渠道价定价系数" prop="channelPrice">
+        <el-input v-model="formData.channelPrice" placeholder="请输入渠道价定价系数" />
+      </el-form-item>
+      <el-form-item label="类型" prop="type">
+        <el-select v-model="formData.type" size="mini" placeholder="请选择板块类型">
+          <!-- 加盟商下有团长、合伙人。代理商下有团长、合伙人、加盟商。 -->
+          <el-option label="平台" :value="0" />
+          <el-option label="团长" :value="1" />
+          <el-option label="合伙人" :value="2" />
+          <el-option label="加盟商" :value="3" />
+          <el-option label="代理商" :value="4" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="活动开始时间" prop="startTime">
+        <el-date-picker
+          v-model="formData.startTime"
+          size="medium"
+          type="date"
+          placeholder="选择活动开始时间"
+          value-format="yyyy-MM-dd HH:mm:ss"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item label="活动结束时间" prop="endTime">
+        <el-date-picker
+          v-model="formData.endTime"
+          size="medium"
+          type="date"
+          placeholder="选择活动结束时间"
+          value-format="yyyy-MM-dd HH:mm:ss"
+        ></el-date-picker>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="mini" @click="handleClose">取 消</el-button>
+      <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { getShopId } from '@/utils/auth'
+import { priceControlGetById, priceControlSavePlan, priceControlUpdatePlan } from '@/api/selectionCenter/selectionCenter'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        priceId: '',
+        shopId: getShopId(),
+        programmeName: '',
+        preferentialPrice: '',
+        marketPrice: '',
+        supplyPrice: '',
+        channelPrice: '',
+        startTime: '',
+        endTime: '',
+        status: '',
+        type: '',
+        isDefault: '',
+        createTime: '',
+        updateTime: ''
+      },
+      formRules: {
+        shopId: [
+          { required: true, message: '缺少店铺ID' }
+        ],
+        programmeName: [
+          { required: true, message: '请输入方案名称' }
+        ],
+        preferentialPrice: [
+          { required: false, message: '请输入优惠定价系数' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' } // >0的数字, 最多2位小数正则
+        ],
+        marketPrice: [
+          { required: false, message: '请输入市场价定价系数' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        supplyPrice: [
+          { required: false, message: '请输入供货价定价系数' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        channelPrice: [
+          { required: false, message: '请输入渠道价定价系数' },
+          { pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/, message: '数值有误' }
+        ],
+        type: [
+          { required: true, message: '请选择定价方案类型' }
+        ],
+        startTime: [
+          { required: false, message: '请选择活动开始时间' }
+        ],
+        endTime: [
+          { required: false, message: '请选择活动结束时间' }
+        ]
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    initList() {
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.priceId ? '编辑定价方案' : '添加定价方案'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      if (params.priceId) {
+        this.getInfo(params.priceId)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await priceControlGetById({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          priceId: res.data.priceId || '',
+          shopId: res.data.shopId || getShopId(),
+          programmeName: res.data.programmeName || '',
+          preferentialPrice: res.data.preferentialPrice || '',
+          marketPrice: res.data.marketPrice || '',
+          supplyPrice: res.data.supplyPrice || '',
+          channelPrice: res.data.channelPrice || '',
+          startTime: res.data.startTime || '',
+          endTime: res.data.endTime || '',
+          status: res.data.status,
+          type: res.data.type,
+          isDefault: res.data.isDefault,
+          createTime: res.data.createTime || '',
+          updateTime: res.data.updateTime || ''
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '提交中,请稍候……' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.priceId ? await priceControlUpdatePlan(params) : await priceControlSavePlan(params)
+            loading.close()
+            this.$message({ message: `${this.formData.priceId ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 187 - 0
src/views/mealManagement/mealProcessing/index.vue

@@ -0,0 +1,187 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <div>
+        <el-tabs
+          v-model="activeRange"
+          @tab-click="(t) => currentTableList = mealTableList.filter(i => !Number(t.name) || (Number(t.name) === i.areaId))"
+        >
+          <el-tab-pane
+            v-for="item in allRangeList" :key="item.id" :label="`${item.name}${item.code ? '(' + item.code + ')' : ''}`"
+            :name="String(item.id)"
+          ></el-tab-pane>
+        </el-tabs>
+      </div>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="currentTableList"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="桌号ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="桌号名称" prop="name" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="商家ID" prop="aid" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="区域ID" prop="areaId" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="最大承载人数" prop="num" show-overflow-tooltip />
+        <el-table-column align="center" label="餐桌状态" prop="status">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.status === 1" effect="plain" type="info">就餐中</el-tag>
+            <el-tag v-else-if="row.status === 2" effect="plain" type="success">空闲</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="100" label="排序编号" prop="sort" show-overflow-tooltip />
+        <el-table-column align="center" label="是否禁用" prop="isStop">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.isStop === 0" effect="plain" type="info">否</el-tag>
+            <el-tag v-else-if="row.isStop === 1" effect="plain" type="success">是</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否删除" prop="isDelete">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.isDelete === 0" effect="plain" type="info">否</el-tag>
+            <el-tag v-else-if="row.isDelete === 1" effect="plain" type="success">是</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="300" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button
+              type="info" size="mini"
+              @click="handleCreatCode(row)"
+            >
+              创建桌码
+            </el-button>
+            <el-button
+              type="primary" size="mini"
+              @click="$refs.MealOrderCreate && $refs.MealOrderCreate.handleOpen(row)"
+            >
+              创建订单
+            </el-button>
+            <el-button
+              type="warning" size="mini"
+              @click="handleCheckout(row)"
+            >
+              结账
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <!-- 创建点餐订单 -->
+    <MealOrderCreate ref="MealOrderCreate" @success="initData" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+  </div>
+</template>
+
+<script>
+import MealOrderCreate from '../TableNumberSetting/components/MealOrderCreate'
+import DetailModal from '../TableNumberSetting/components/DetailModal'
+import { getAllShopAuthDept, createQRShopAuthDept, checkoutShopLaOrders } from '@/api/mealManagement/TableNumberSetting'
+import { getAllShopAuthPost } from '@/api/mealManagement/regionalSetting'
+
+export default {
+  name: 'MealProcessing',
+  components: {
+    MealOrderCreate,
+    DetailModal
+  },
+  data() {
+    return {
+      allRangeList: [],
+      mealTableList: [],
+      activeRange: '',
+      currentTableList: [],
+      listLoading: true
+    }
+  },
+  created() {
+    this.initData()
+  },
+  methods: {
+    async initData() {
+      this.listLoading = true
+      try {
+        const res1 = await getAllShopAuthPost({ name: '', isStop: '' })
+        this.allRangeList = [{ id: '0', name: '全部', code: '' }, ...res1.data]
+        this.activeRange = this.allRangeList[0].name
+        const res2 = await getAllShopAuthDept({ name: '', isStop: '' })
+        this.mealTableList = res2.data
+        this.currentTableList = this.mealTableList.filter((i) => !Number(this.activeRange) || (Number(this.activeRange) === i.areaId))
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.initData()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleCreatCode(row) {
+      this.$confirm('确定对此项创建桌号二维码?')
+        .then(async () => {
+          await createQRShopAuthDept({ id: row.id })
+          this.$message({ message: '创建成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    },
+    handleCheckout(row) {
+      this.$confirm('确定结账此项?')
+        .then(async () => {
+          await checkoutShopLaOrders({ did: row.id })
+          this.$message({ message: '结账成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 109 - 0
src/views/mealManagement/regionalSetting/components/DetailModal.vue

@@ -0,0 +1,109 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 区域信息 -->
+      <el-form-item label="区域ID" prop="id">
+        {{ formData.id || '--' }}
+      </el-form-item>
+      <el-form-item label="商家ID" prop="aid">
+        {{ formData.aid || '--' }}
+      </el-form-item>
+      <el-form-item label="区域编码" prop="code">
+        {{ formData.code || '--' }}
+      </el-form-item>
+      <el-form-item label="区域名称" prop="name">
+        {{ formData.name || '--' }}
+      </el-form-item>
+      <el-form-item label="区域备注" prop="remarks">
+        {{ formData.remarks || '--' }}
+      </el-form-item>
+      <el-form-item label="区域排序" prop="sort">
+        {{ formData.sort }}
+      </el-form-item>
+      <el-form-item label="是否停用" prop="isStop">
+        <span v-if="formData.isStop === 0">否</span>
+        <span v-else-if="formData.isStop === 1">是</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="是否删除" prop="isDelete">
+        <span v-if="formData.isDelete === 0">否</span>
+        <span v-else-if="formData.isDelete === 1">是</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import { detailPostShopAuthPost } from '@/api/mealManagement/regionalSetting'
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看区域详情'
+      },
+      visible: false,
+      formData: {
+        id: '',
+        aid: '',
+        code: '',
+        name: '',
+        remarks: '',
+        sort: '',
+        isStop: '',
+        isDelete: '',
+        createTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await detailPostShopAuthPost({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          aid: res.data.aid || '',
+          code: res.data.code || '',
+          name: res.data.name || '',
+          remarks: res.data.remarks || '',
+          sort: res.data.sort,
+          isStop: res.data.isStop,
+          isDelete: res.data.isDelete || '',
+          createTime: res.data.createTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 148 - 0
src/views/mealManagement/regionalSetting/components/EditModal.vue

@@ -0,0 +1,148 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="区域编码" prop="code">
+        <el-input v-model="formData.code" placeholder="请输入区域编码" />
+      </el-form-item>
+      <el-form-item label="区域名称" prop="name">
+        <el-input v-model="formData.name" placeholder="请输入区域名称" maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="区域备注" prop="remarks">
+        <el-input v-model="formData.remarks" type="textarea" placeholder="请输入区域备注" maxlength="520" :rows="3" show-word-limit />
+      </el-form-item>
+      <el-form-item label="区域排序" prop="sort">
+        <el-input v-model="formData.sort" placeholder="请输入区域排序" />
+      </el-form-item>
+      <el-form-item label="是否停用" prop="isStop">
+        <el-select v-model="formData.isStop" size="mini" placeholder="请选择是否停用">
+          <el-option label="否" :value="0" />
+          <el-option label="是" :value="1" />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="mini" @click="handleClose">取 消</el-button>
+      <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { detailPostShopAuthPost, savePostShopAuthPost, updatePostShopAuthPost } from '@/api/mealManagement/regionalSetting'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        id: '',
+        // aid: '',
+        code: '',
+        name: '',
+        remarks: '',
+        sort: '',
+        isStop: ''
+      },
+      formRules: {
+        code: [
+          { required: true, message: '缺少区域编码' }
+        ],
+        name: [
+          { required: true, message: '请输入区域名称' }
+        ],
+        remarks: [
+          { required: true, message: '请输入区域备注' }
+        ],
+        sort: [
+          { required: true, message: '请输入区域排序' },
+          { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
+        ],
+        isStop: [
+          { required: true, message: '请选择是否停用' }
+        ]
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    initList() {
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.id ? '编辑区域' : '添加区域'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      if (params.id) {
+        this.getInfo(params.id)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await detailPostShopAuthPost({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          code: res.data.code || '',
+          name: res.data.name || '',
+          remarks: res.data.remarks || '',
+          sort: res.data.sort,
+          isStop: res.data.isStop
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '提交中,请稍候……' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.id ? await updatePostShopAuthPost(params) : await savePostShopAuthPost(params)
+            loading.close()
+            this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 179 - 0
src/views/mealManagement/regionalSetting/index.vue

@@ -0,0 +1,179 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.name" clearable size="mini" class="filter-item"
+        style="width: 200px;" placeholder="请输入区域名称"
+      />
+      <el-select
+        v-model="listQuery.isStop" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请选择是否停用"
+      >
+        <el-option label="否" :value="0" />
+        <el-option label="是" :value="1" />
+      </el-select>
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+      <br />
+      <el-button
+        size="mini" type="primary" icon="el-icon-plus"
+        @click="$refs.EditModal && $refs.EditModal.handleOpen({ id: '' })"
+      >
+        添加
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="区域ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="区域名称" prop="name" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="商家ID" prop="aid" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="区域编码" prop="code" show-overflow-tooltip />
+        <el-table-column align="center" min-width="150" label="区域备注" prop="remarks" show-overflow-tooltip />
+        <el-table-column align="center" width="100" label="区域排序" prop="sort" show-overflow-tooltip />
+        <el-table-column align="center" label="是否停用" prop="isStop">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.isStop === 0" effect="plain" type="info">否</el-tag>
+            <el-tag v-else-if="row.isStop === 1" effect="plain" type="success">是</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否删除" prop="isDelete">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.isDelete === 0" effect="plain" type="info">否</el-tag>
+            <el-tag v-else-if="row.isDelete === 1" effect="plain" type="success">是</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="300" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button size="mini" @click="handleEdit(row)">
+              编辑
+            </el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 新增编辑 -->
+    <EditModal ref="EditModal" @success="getList" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+  </div>
+</template>
+
+<script>
+import EditModal from './components/EditModal'
+import DetailModal from './components/DetailModal'
+import { getPageAllShopAuthPost, deletePostShopAuthPost } from '@/api/mealManagement/regionalSetting'
+
+export default {
+  name: 'RegionalSetting',
+  components: {
+    EditModal,
+    DetailModal
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        name: '',
+        isStop: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getPageAllShopAuthPost(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleEdit(row) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    },
+    handleDelete(row) {
+      this.$confirm('确定删除此项?')
+        .then(async () => {
+          await deletePostShopAuthPost({ id: row.id })
+          this.$message({ message: '删除成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 0 - 65
src/views/system/imageProcessing/components/DetailModal.vue

@@ -1,65 +0,0 @@
-<template>
-  <el-dialog
-    :visible.sync="visible"
-    v-bind="modalOptions"
-  >
-    <el-form
-      ref="formData"
-      :model="formData"
-      size="mini"
-      label-position="left"
-      label-suffix=":"
-      label-width="200px"
-    >
-      <!-- 商品信息 -->
-      <el-form-item label="商品ID" prop="id">
-        {{ formData.id || '--' }}
-      </el-form-item>
-    </el-form>
-  </el-dialog>
-</template>
-
-<script>
-// import {  } from '@/api/threeSelection'
-
-export default {
-  name: 'DetailModal',
-  data() {
-    return {
-      modalOptions: {
-        closeOnClickModal: false,
-        width: '800px',
-        title: '查看商品详情'
-      },
-      visible: false,
-      formData: {
-        id: ''
-      }
-    }
-  },
-  methods: {
-    handleClose() {
-      this.visible = false
-    },
-    handleOpen(params = {}) {
-      this.formData = Object.assign(this.$options.data().formData, params)
-      if (params.id) {
-        this.getInfo(params.id)
-      }
-      this.visible = true
-    },
-    async getInfo(id) {
-      const loading = this.$loading({ text: '加载中' })
-      try {
-        const res = await priceControlGetById({ id })
-        this.formData = Object.assign(this.$options.data().formData, res.data, {
-          id: res.data.id || ''
-        })
-      } finally {
-        loading.close()
-      }
-    }
-  }
-}
-</script>
-

+ 5 - 5
src/views/threeSelection/platformSelect/addCommodity.vue

@@ -117,7 +117,7 @@
       </div>
       <div v-if="!active" class="centerCom">
         <el-form ref="form" :model="params" label-width="80px">
-          <StyleInformation @cancel="cancel" v-bind="$props" :form="params" @syncVoucherPrice="handleSyncVoucherPrice" @syncVoucherId="handleSyncVoucherId" />
+          <StyleInformation v-bind="$props" :form="params" @cancel="cancel" @syncVoucherPrice="handleSyncVoucherPrice" @syncVoucherId="handleSyncVoucherId" />
         </el-form>
       </div>
     </div>
@@ -135,7 +135,7 @@ import {
   getGroupSelect,
   getClassify,
   getClassifyAdd,
-  getClassifyGetById,
+  getProductGetById,
   getClassifyUpdate,
   getBrandList
 } from '@/api/commodity'
@@ -317,8 +317,8 @@ export default {
   },
   methods: {
     //  向上一级传递事件
-    cancel(){
-      this.$emit("cancel")
+    cancel() {
+      this.$emit('cancel')
     },
     handleChangeCascader() {
       console.log(this.form.classifyId)
@@ -510,7 +510,7 @@ export default {
     },
     // 获取详情
     async details() {
-      const res = await getClassifyGetById({ productId: this.productId })
+      const res = await getProductGetById({ productId: this.productId })
       this.form = res.data
       this.$set(this.form, 'productText', res.data.productText)
       // this.form.productText = res.data.productText