소스 검색

系统设置-订单铃声+门锁管理

WIN-B904R0U0NNS\Administrator 2 년 전
부모
커밋
23ab23fb66

+ 37 - 14
src/api/roomBuildingApi.js

@@ -42,7 +42,7 @@ export function save(parameter) {
 
 /**
  * 获取楼栋楼层树
- * @param {Object} param 
+ * @param {Object} param
  * @returns Axios Promise
  */
 export function buildingTree (param) {
@@ -54,10 +54,10 @@ export function buildingTree (param) {
 }
 /**
  * 批量添加房间
- * @param {Object} param 
- * @returns 
+ * @param {Object} param
+ * @returns
  */
-export function saveBatch(param) { 
+export function saveBatch(param) {
     return axios({
         url: '/rooms/cesRooms/saveBatchRoom',
         method: 'post',
@@ -68,10 +68,10 @@ export function saveBatch(param) {
 
  /**
  * 批量删除房间
- * @param {Object} param 
- * @returns 
+ * @param {Object} param
+ * @returns
  */
-export function delBatch(param) { 
+export function delBatch(param) {
     return axios({
         url: '/rooms/cesRooms/delete',
         method: 'delete',
@@ -81,10 +81,10 @@ export function delBatch(param) {
 
   /**
  * 删除所有
- * @param {Object} param 
- * @returns 
+ * @param {Object} param
+ * @returns
  */
-export function delAll(param) { 
+export function delAll(param) {
     return axios({
         url: '/rooms/cesRooms/removeAll',
         method: 'delete',
@@ -94,15 +94,38 @@ export function delAll(param) {
 
    /**
  * 编辑房间
- * @param {Object} param 
- * @returns 
+ * @param {Object} param
+ * @returns
  */
-export function roomEdit(param) { 
+export function roomEdit(param) {
     return axios({
         url: '/rooms/cesRooms/modify',
         method: 'put',
         data: param
     })
  }
+/**
+ * 通过上级Id获取楼栋楼层
+ * @param {Object} param
+ * @returns Axios Promise
+ */
+export function queryFloorByParentId (param) {
+    return axios({
+        url: '/rooms/cesRoomBuildingFloor/queryByParentId',
+        method: 'get',
+        params: param
+    })
+}
 
- 
+/**
+ * 通过楼层获取房间列表
+ * @param {Object} param
+ * @returns
+ */
+export function queryRoomByFloorId(param) {
+    return axios({
+        url: '/rooms/cesRooms/queryByFloorId',
+        method: 'get',
+        params: param
+    })
+}

+ 203 - 0
src/views/settings/components/doorLockList.vue

@@ -0,0 +1,203 @@
+<template>
+    <a-card :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                    <a-col :md="4" :sm="6">
+                        <a-form-item>
+                            <j-input placeholder="关联号" v-model="queryParam.associationNumber"></j-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="6">
+                        <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+                          <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                        </span>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </div>
+        <!-- 查询区域-END -->
+
+        <!-- 操作按钮区域 -->
+        <div class="table-operator">
+            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+            <a-button @click="handleBatchAdd" type="primary" icon="plus">批量添加</a-button>
+<!--            <a-button type="primary" icon="download" @click="handleExportXls('门锁管理')">导出</a-button>-->
+<!--            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
+<!--                <a-button type="primary" icon="import">导入</a-button>-->
+<!--            </a-upload>-->
+            <!-- 高级查询区域 -->
+<!--            <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
+            <a-dropdown v-if="selectedRowKeys.length > 0">
+<!--                <a-menu slot="overlay">-->
+<!--                    <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
+<!--                </a-menu>-->
+<!--                <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
+                <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
+            </a-dropdown>
+        </div>
+
+        <!-- table区域-begin -->
+        <div>
+            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+            </div>
+
+            <a-table
+                    ref="table"
+                    size="middle"
+                    :scroll="{x:true}"
+                    bordered
+                    rowKey="id"
+                    :columns="columns"
+                    :dataSource="dataSource"
+                    :pagination="ipagination"
+                    :loading="loading"
+                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+                    class="j-table-force-nowrap"
+                    @change="handleTableChange">
+
+                <template slot="htmlSlot" slot-scope="text">
+                    <div v-html="text"></div>
+                </template>
+                <template slot="imgSlot" slot-scope="text,record">
+                    <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+                    <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+                </template>
+                <template slot="fileSlot" slot-scope="text">
+                    <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+                    <a-button
+                            v-else
+                            :ghost="true"
+                            type="primary"
+                            icon="download"
+                            size="small"
+                            @click="downloadFile(text)">
+                        下载
+                    </a-button>
+                </template>
+
+                <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+            </a-table>
+        </div>
+
+        <door-lock-modal ref="modalForm" @ok="modalFormOk"></door-lock-modal>
+        <door-lock-batch-modal ref="modalBatchForm" @ok="modalFormOk"></door-lock-batch-modal>
+    </a-card>
+</template>
+
+<script>
+
+    import '@/assets/less/TableExpand.less'
+    import { mixinDevice } from '@/utils/mixin'
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+    import doorLockModal from './modules/doorLockModal'
+    import DoorLockBatchModal from "./modules/doorLockBatchModal";
+
+    export default {
+        name: 'doorLockList',
+        mixins:[JeecgListMixin, mixinDevice],
+        components: {
+            DoorLockBatchModal,
+            doorLockModal
+        },
+        data () {
+            return {
+                description: '门锁管理管理页面',
+                // 表头
+                columns: [
+                    {
+                        title:'楼栋',
+                        align:"center",
+                        dataIndex: 'buildName'
+                    },
+                    {
+                        title:'楼层',
+                        align:"center",
+                        dataIndex: 'floorName'
+                    },
+                    {
+                        title:'房间号',
+                        align:"center",
+                        dataIndex: 'roomNumber'
+                    },
+                    {
+                        title:'关联号',
+                        align:"center",
+                        dataIndex: 'associationNumber'
+                    },
+                    {
+                        title: '操作',
+                        dataIndex: 'action',
+                        align:"center",
+                        fixed:"right",
+                        width:147,
+                        scopedSlots: { customRender: 'action' }
+                    }
+                ],
+                url: {
+                    list: "/business/busDoorLock/list",
+                    delete: "/business/busDoorLock/delete",
+                    deleteBatch: "/business/busDoorLock/deleteBatch",
+                    exportXlsUrl: "/business/busDoorLock/exportXls",
+                    importExcelUrl: "business/busDoorLock/importExcel",
+
+                },
+                dictOptions:{},
+                superFieldList:[],
+            }
+        },
+        created() {
+            this.getSuperFieldList();
+        },
+        computed: {
+            importExcelUrl: function(){
+                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+            },
+        },
+        methods: {
+            initDictConfig(){
+            },
+            getSuperFieldList(){
+                let fieldList=[];
+                fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
+                fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
+                fieldList.push({type:'string',value:'buildId',text:'楼栋ID'})
+                fieldList.push({type:'string',value:'floorId',text:'楼层ID'})
+                fieldList.push({type:'string',value:'roomNumber',text:'房间号'})
+                fieldList.push({type:'string',value:'associationNumber',text:'关联号'})
+                fieldList.push({type:'int',value:'status',text:'状态(0-禁用;1-启用)'})
+                fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
+                this.superFieldList = fieldList
+            },
+            handleBatchAdd: function () {
+                this.$refs.modalBatchForm.add();
+                this.$refs.modalBatchForm.title = "批量添加";
+                this.$refs.modalBatchForm.disableSubmit = false;
+            },
+        }
+    }
+</script>
+<style scoped>
+    @import '~@assets/less/common.less';
+</style>

+ 140 - 0
src/views/settings/components/modules/doorLockBatchForm.vue

@@ -0,0 +1,140 @@
+<template>
+    <a-spin :spinning="confirmLoading">
+        <j-form-container :disabled="formDisabled">
+            <a-form-model ref="form" :rules="validatorRules" slot="detail">
+                <a-row>
+                    <a-col :span="24">
+                        <a-form-model-item label="" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchType">
+                            <a-radio-group v-model="batchType" @change="onChange">
+                                <a-radio :value="1" :style="radioStyle">
+                                    关联号与房间号相同
+                                </a-radio>
+                                <a-radio :value="2" :style="radioStyle">
+                                    关联号 =
+                                    <a-input style="width: 80px" @change="(e)=>handleFront(e)" ></a-input>
+                                    +房间号+
+                                    <a-input style="width: 80px" @change="(e)=>handleAfter(e)"></a-input>
+                                </a-radio>
+                                <a-radio :value="3" :style="radioStyle">
+                                    关联号 =
+                                    <a-input style="width: 80px" @change="(e)=>handleFront(e)"></a-input>
+                                    +缺少首位的房间号+
+                                    <a-input style="width: 80px" @change="(e)=>handleAfter(e)" ></a-input>
+                                </a-radio>
+                                <a-radio :value="4" :style="radioStyle">
+                                    关联号 = 由
+                                    <a-input style="width: 80px" @change="(e)=>handleFront(e)"></a-input>
+                                    +开始随房间号递增一位
+                                </a-radio>
+                            </a-radio-group>
+                        </a-form-model-item>
+                    </a-col>
+                </a-row>
+            </a-form-model>
+        </j-form-container>
+    </a-spin>
+</template>
+
+<script>
+    import { httpAction, getAction } from '@/api/manage'
+    import { validateDuplicateValue } from '@/utils/util'
+    import { buildingTree, queryFloorByParentId,queryRoomByFloorId } from "@/api/roomBuildingApi";
+
+    export default {
+        name: 'doorLockBatchForm',
+        components: {},
+        props: {
+            //表单禁用
+            disabled: {
+                type: Boolean,
+                default: false,
+                required: false
+            }
+        },
+        data() {
+            return {
+                batchType: '',
+                front:'',
+                after:'',
+                labelCol: {
+                    xs: {span: 24},
+                    sm: {span: 5},
+                },
+                wrapperCol: {
+                    xs: {span: 24},
+                    sm: {span: 16},
+                },
+                confirmLoading: false,
+                validatorRules: {
+                    batchType: [
+                        // {required: true, message: '请选择!'},
+                    ],
+                },
+                url: {
+                    batchAdd: "/business/busDoorLock/batchAdd"
+                },
+                radioStyle: {
+                    display: 'block',
+                    height: '50px',
+                    lineHeight: '50px',
+                },
+            }
+        },
+        computed: {
+            formDisabled() {
+                return this.disabled
+            },
+        },
+        created() {
+            //备份model原始值
+        },
+        methods: {
+            add() {
+                this.visible = true;
+            },
+            submitForm() {
+                console.log(this.batchType)
+                const that = this;
+                if (this.batchType == ''){
+                    that.$message.error('请选择');
+                }
+
+                that.confirmLoading = true;
+                let httpurl = this.url.batchAdd;
+                let method = 'post';
+                var info = JSON.parse(localStorage.getItem("storeInfo"));
+                var data = {
+                    hotelId: info.id,
+                    radioType: this.batchType,
+                    front: this.front,
+                    after: this.after
+                }
+                httpAction(httpurl, data, method).then((res) => {
+                    if (res.success) {
+                        that.$message.success(res.message);
+                        that.$emit('ok');
+                    } else {
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            onChange(e) {
+                console.log('radio checked', e.target.value);
+            },
+            handleFront(e){
+                console.log(e)
+                this.front = e.target.value
+            },
+            handleAfter(e){
+                console.log(e)
+                this.after = e.target.value
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 61 - 0
src/views/settings/components/modules/doorLockBatchModal.vue

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

+ 220 - 0
src/views/settings/components/modules/doorLockForm.vue

@@ -0,0 +1,220 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="楼栋" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buildId">
+<!--              <a-input v-model="model.buildId" placeholder="请输入楼栋ID"  ></a-input>-->
+              <a-select
+                      show-search
+                      placeholder="请选择楼栋"
+                      v-model="model.buildId"
+                      option-filter-prop="children"
+                      @change="onBuildChange"
+              >
+                <a-select-option v-for="item in buildingTreeData" :key="item.id" >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="楼层" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="floorId">
+<!--              <a-input v-model="model.floorId" placeholder="请输入楼层ID"  ></a-input>-->
+              <a-select
+                      show-search
+                      placeholder="请选择楼层"
+                      v-model="model.floorId"
+                      option-filter-prop="children"
+                      @change="onFloorChange"
+              >
+                <a-select-option v-for="item in floorData" :key="item.id" >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="房间号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="roomId">
+<!--              <a-input v-model="model.roomNumber" placeholder="请输入房间号"  ></a-input>-->
+              <a-select
+                      show-search
+                      placeholder="请选择楼栋"
+                      v-model="model.roomId"
+                      option-filter-prop="children"
+              >
+                <a-select-option v-for="item in roomData" :key="item.id" >
+                  {{ item.prefix+item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="关联号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="associationNumber">
+              <a-input v-model="model.associationNumber" placeholder="请输入关联号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+  import { buildingTree, queryFloorByParentId,queryRoomByFloorId } from "@/api/roomBuildingApi";
+
+  export default {
+      name: 'doorLockForm',
+      components: {},
+      props: {
+          //表单禁用
+          disabled: {
+              type: Boolean,
+              default: false,
+              required: false
+          }
+      },
+      data() {
+          return {
+              model: {},
+              labelCol: {
+                  xs: {span: 24},
+                  sm: {span: 5},
+              },
+              wrapperCol: {
+                  xs: {span: 24},
+                  sm: {span: 16},
+              },
+              confirmLoading: false,
+              validatorRules: {
+                  buildId: [
+                      {required: true, message: '请选择楼栋!'},
+                  ],
+                  floorId: [
+                      {required: true, message: '请选择楼层!'},
+                  ],
+                  roomId: [
+                      {required: true, message: '请选择房间号!'},
+                  ],
+                  associationNumber: [
+                      {required: true, message: '请输入关联号!'},
+                  ],
+              },
+              url: {
+                  add: "/business/busDoorLock/add",
+                  edit: "/business/busDoorLock/edit",
+                  queryById: "/business/busDoorLock/queryById"
+              },
+              buildingTreeData: [],
+              floorData: [],
+              roomData: [],
+          }
+      },
+      computed: {
+          formDisabled() {
+              return this.disabled
+          },
+      },
+      created() {
+          //备份model原始值
+          this.modelDefault = JSON.parse(JSON.stringify(this.model));
+
+          buildingTree().then((res) => {
+              if (res.code == 200) {
+                  console.log(res.result)
+                  this.buildingTreeData = res.result;
+              }
+          });
+      },
+      methods: {
+          add() {
+              this.edit(this.modelDefault);
+          },
+          edit(record) {
+              this.model = Object.assign({}, record);
+              this.visible = true;
+              if (this.model.id){
+                  queryFloorByParentId(
+                      {
+                          parentId: this.model.buildId
+                      }
+                  ).then((res) => {
+                      if (res.code == 200) {
+                          this.floorData = res.result;
+                      }
+                  });
+                  queryRoomByFloorId(
+                      {
+                          floorId: this.model.floorId
+                      }
+                  ).then((res) => {
+                      if (res.code == 200) {
+                          this.roomData = res.result;
+                      }
+                  });
+              }
+          },
+          submitForm() {
+              const that = this;
+              // 触发表单验证
+              this.$refs.form.validate(valid => {
+                  if (valid) {
+                      that.confirmLoading = true;
+                      let httpurl = '';
+                      let method = '';
+                      if (!this.model.id) {
+                          httpurl += this.url.add;
+                          var info = JSON.parse(localStorage.getItem("storeInfo"));
+                          this.model.hotelId = info.id;
+                          method = 'post';
+                      } else {
+                          httpurl += this.url.edit;
+                          method = 'put';
+                      }
+                      httpAction(httpurl, this.model, method).then((res) => {
+                          if (res.success) {
+                              that.$message.success(res.message);
+                              that.$emit('ok');
+                          } else {
+                              that.$message.warning(res.message);
+                          }
+                      }).finally(() => {
+                          that.confirmLoading = false;
+                      })
+                  }
+
+              })
+          },
+          onBuildChange() {
+              console.log(this.buildingTreeData)
+              let bIndex = this.buildingTreeData.findIndex(s => s.id == this.model.buildId)
+              let currentFloorNames = (this.buildingTreeData[bIndex].children || []).map(s => s.name)
+              console.log(currentFloorNames)
+              // this.floorNames = currentFloorNames
+              // this.roomTree = JSON.parse(JSON.stringify(this.roomTree))
+              var param = {
+                  parentId: this.model.buildId
+              }
+              queryFloorByParentId(param).then((res) => {
+                  if (res.code == 200) {
+                      this.floorData = res.result;
+                  }
+              });
+          },
+          onFloorChange() {
+              var param = {
+                  floorId: this.model.floorId
+              }
+              queryRoomByFloorId(param).then((res) => {
+                  if (res.code == 200) {
+                      this.roomData = res.result;
+                  }
+              });
+          },
+      }
+  }
+</script>

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

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

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

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

+ 138 - 0
src/views/settings/components/modules/orderSoundForm.vue

@@ -0,0 +1,138 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="铃声名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
+              <a-input v-model="model.name" placeholder="请输入铃声名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+<!--            <a-form-model-item-->
+<!--                    label="类型"-->
+<!--                    :labelCol="labelCol"-->
+<!--                    :wrapperCol="wrapperCol"-->
+<!--                    prop="type"-->
+<!--            >-->
+<!--              <a-radio-group v-model="model.type">-->
+<!--                <a-radio :value="1">订单来了</a-radio>-->
+<!--                <a-radio :value="2">订单取消</a-radio>-->
+<!--                <a-radio :value="3">通用铃声</a-radio>-->
+<!--                <a-radio :value="4">自动接单</a-radio>-->
+<!--              </a-radio-group>-->
+<!--            </a-form-model-item>-->
+            <a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
+              <j-dict-select-tag type="radio" v-model="model.type" placeholder="请选择铃声类型" dictCode="order_sound_type"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="铃声" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="path">
+              <a-input v-model="model.path" placeholder="请输入铃声地址"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'BusOrderSoundForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           tenantId: [
+              { required: true, message: '请输入关联租户!'},
+           ],
+           hotelId: [
+              { required: true, message: '请输入关联酒店!'},
+           ],
+           name: [
+              { required: true, message: '请输入铃声名称!'},
+           ],
+        },
+        url: {
+          add: "/business/busOrderSound/add",
+          edit: "/business/busOrderSound/edit",
+          queryById: "/business/busOrderSound/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+              var info = JSON.parse(localStorage.getItem("storeInfo"));
+              this.model.hotelId = info.id;
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

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

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

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

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

+ 209 - 0
src/views/settings/components/orderSoundList.vue

@@ -0,0 +1,209 @@
+<template>
+    <a-card :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                    <a-col :md="4" :sm="6">
+                        <a-form-item>
+                            <j-input placeholder="名称" v-model="queryParam.name"></j-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="6">
+                        <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+                          <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                        </span>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </div>
+        <!-- 查询区域-END -->
+
+        <!-- 操作按钮区域 -->
+        <div class="table-operator">
+            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+<!--            <a-button type="primary" icon="download" @click="handleExportXls('订单铃声')">导出</a-button>-->
+<!--            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
+<!--                <a-button type="primary" icon="import">导入</a-button>-->
+<!--            </a-upload>-->
+<!--            &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
+<!--            <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
+            <a-dropdown v-if="selectedRowKeys.length > 0">
+<!--                <a-menu slot="overlay">-->
+<!--                    <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
+<!--                </a-menu>-->
+<!--                <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
+                <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
+            </a-dropdown>
+        </div>
+
+        <!-- table区域-begin -->
+        <div>
+            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+            </div>
+
+            <a-table
+                    ref="table"
+                    size="middle"
+                    :scroll="{x:true}"
+                    bordered
+                    rowKey="id"
+                    :columns="columns"
+                    :dataSource="dataSource"
+                    :pagination="ipagination"
+                    :loading="loading"
+                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+                    class="j-table-force-nowrap"
+                    @change="handleTableChange">
+
+                <template slot="htmlSlot" slot-scope="text">
+                    <div v-html="text"></div>
+                </template>
+                <span slot="type" slot-scope="text,record">
+                    <a-tag color="green">{{text}}</a-tag>
+                </span>
+                <span slot="sound" slot-scope="text,record">
+                    <a-button icon="audio" @click="toAudition(text)" type="primary" size="small" ghost>
+                      试听
+                    </a-button>
+                </span>
+                <template slot="imgSlot" slot-scope="text,record">
+                    <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+                    <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+                </template>
+                <template slot="fileSlot" slot-scope="text">
+                    <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+                    <a-button
+                            v-else
+                            :ghost="true"
+                            type="primary"
+                            icon="download"
+                            size="small"
+                            @click="downloadFile(text)">
+                        下载
+                    </a-button>
+                </template>
+
+                <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">修改</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+<!--              <a-menu-item>-->
+<!--                <a @click="handleDetail(record)">详情</a>-->
+<!--              </a-menu-item>-->
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+                </span>
+            </a-table>
+        </div>
+        <audio ref="audition" ></audio>
+        <order-sound-modal ref="modalForm" @ok="modalFormOk"></order-sound-modal>
+    </a-card>
+</template>
+
+<script>
+
+    import '@/assets/less/TableExpand.less'
+    import { mixinDevice } from '@/utils/mixin'
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+    import orderSoundModal from './modules/orderSoundModal'
+
+    export default {
+        name: 'orderSoundList',
+        mixins:[JeecgListMixin, mixinDevice],
+        components: {
+            orderSoundModal
+        },
+        data () {
+            return {
+                description: '订单铃声管理页面',
+                // 表头
+                columns: [
+                    {
+                        title:'名称',
+                        align:"center",
+                        dataIndex: 'name'
+                    },
+                    {
+                        title:'类型',
+                        align:"center",
+                        dataIndex: 'type_dictText',
+                        scopedSlots: { customRender: 'type' },
+                    },
+                    {
+                        title:'铃声',
+                        align:"center",
+                        dataIndex: 'path',
+                        scopedSlots: { customRender: 'sound' },
+                    },
+                    {
+                        title: '操作',
+                        dataIndex: 'action',
+                        align:"center",
+                        fixed:"right",
+                        width:147,
+                        scopedSlots: { customRender: 'action' }
+                    }
+                ],
+                url: {
+                    list: "/business/busOrderSound/list",
+                    delete: "/business/busOrderSound/delete",
+                    deleteBatch: "/business/busOrderSound/deleteBatch",
+                    exportXlsUrl: "/business/busOrderSound/exportXls",
+                    importExcelUrl: "business/busOrderSound/importExcel",
+
+                },
+                dictOptions:{},
+                superFieldList:[],
+            }
+        },
+        created() {
+            this.getSuperFieldList();
+        },
+        computed: {
+            importExcelUrl: function(){
+                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+            },
+        },
+        methods: {
+            initDictConfig(){
+            },
+            getSuperFieldList(){
+                let fieldList=[];
+                fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
+                fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
+                fieldList.push({type:'string',value:'name',text:'铃声名称'})
+                fieldList.push({type:'int',value:'type',text:'铃声类型'})
+                fieldList.push({type:'string',value:'path',text:'铃声地址'})
+                fieldList.push({type:'int',value:'status',text:'状态(0-禁用;1-启用)'})
+                fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
+                this.superFieldList = fieldList
+            },
+            toAudition(e){
+                // this.$refs.audition.play();
+                if (e.indexOf('mp3') > 0){
+                    this.$refs.audition.src= e;
+                    var auto = this.$refs.audition
+                    if (auto.paused) {
+                        auto.play();
+                    } else {
+                        auto.pause();
+                    }
+                }
+            }
+        }
+    }
+</script>
+<style scoped>
+    @import '~@assets/less/common.less';
+</style>

+ 63 - 5
src/views/settings/systemInfo.vue

@@ -18,38 +18,85 @@
             <a-tab-pane key="3">
                 <span slot="tab">
                     <a-icon type="pay" />
-                    支付配置
+                    支付方式
                 </span>
                 <pay-settings></pay-settings>
             </a-tab-pane>
             <a-tab-pane key="4">
                 <span slot="tab">
+                    订单铃声
+                </span>
+                <order-sound-list></order-sound-list>
+            </a-tab-pane>
+            <a-tab-pane key="5">
+                <span slot="tab">
+                    <a-icon type="pay" />
+                    数据管理
+                </span>
+                <div>
+                    <a-form-item>
+                    <a-card title="业务数据" style="width: 300px" :headStyle="{fontWeight: 600}">
+                        <a-checkbox v-model="clearBusiness">
+                            清除全部业务数据
+                        </a-checkbox>
+                    </a-card>
+                    </a-form-item>
+                    <a-button type="primary" @click="toClearBusinessData()">确定清除</a-button>
+                </div>
+            </a-tab-pane>
+            <a-tab-pane key="6">
+                <span slot="tab">
+                    <a-icon type="pay" />
+                    门锁管理
+                </span>
+                <door-lock-list></door-lock-list>
+            </a-tab-pane>
+            <a-tab-pane key="7">
+                <span slot="tab">
                     <a-icon type="payinterface" />
                     支付接口配置
                 </span>
                 <pay-api-settings></pay-api-settings>
             </a-tab-pane>
-            <a-tab-pane key="5">
+            <a-tab-pane key="8">
                 <span slot="tab">
                     <a-icon type="parameter" />
                     参数配置
                 </span>
                 <param-settings></param-settings>
             </a-tab-pane>
-            <a-tab-pane key="6">
+            <a-tab-pane key="9">
                 <span slot="tab">
                     <a-icon type="waiter" />
                     服务员配置
                 </span>
                 <waiter-settings></waiter-settings>
             </a-tab-pane>
-            <a-tab-pane key="7">
+            <a-tab-pane key="10">
                 <span slot="tab">
                     <a-icon type="salesperson" />
                     营销人员管理
                 </span>
                 <sales-person-info></sales-person-info>
             </a-tab-pane>
+            <a-tab-pane key="11">
+                <span slot="tab">
+                    <a-icon type="salesperson" />
+                    密码锁接口管理
+                </span>
+            </a-tab-pane>
+            <a-tab-pane key="12">
+                <span slot="tab">
+                    <a-icon type="salesperson" />
+                    云打印机设置
+                </span>
+            </a-tab-pane>
+            <a-tab-pane key="13">
+                <span slot="tab">
+                    <a-icon type="salesperson" />
+                    公安接口配置
+                </span>
+            </a-tab-pane>
         </a-tabs>
     </a-card>
 </template>
@@ -62,8 +109,12 @@
     import WaiterSettings from "./components/waiterSettings";
     import SalesPersonInfo from "./components/salesPersonInfo";
     import DictionaryInfo from "./components/dictionaryInfo";
+    import OrderSoundList from "./components/orderSoundList";
+    import DoorLockList from "./components/doorLockList";
     export default {
         components:{
+            DoorLockList,
+            OrderSoundList,
             DictionaryInfo,
             SalesPersonInfo,
             WaiterSettings,
@@ -74,7 +125,14 @@
         },
         data() {
             return {
-
+                clearBusiness:false
+            }
+        },
+        methods:{
+            toClearBusinessData(){
+                if (this.clearBusiness){
+                    console.log('清除数据')
+                }
             }
         }
     }