소스 검색

房间设置-维修服务设置+物品分类管理

WIN-B904R0U0NNS\Administrator 2 년 전
부모
커밋
576bbe721c

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

@@ -12,6 +12,7 @@
                     <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>
+                            <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
                         </span>
                     </a-col>
                 </a-row>

+ 98 - 21
src/views/settings/components/roomModules/mealCouponList.vue

@@ -4,6 +4,17 @@
     <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>
+                          <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+                        </span>
+          </a-col>
         </a-row>
       </a-form>
     </div>
@@ -50,16 +61,20 @@
         <template slot="htmlSlot" slot-scope="text">
           <div v-html="text"></div>
         </template>
+        <span slot="switchAutoSlot" slot-scope="text,record">
+          <a-switch checked-children="开启" un-checked-children="禁用"
+                    default-checked :checked="text == 0" @change="e=>onAutoChange(e,record)" />
+        </span>
         <span slot="switchSlot" slot-scope="text,record">
           <a-switch checked-children="开启" un-checked-children="禁用"
-                    default-checked :checked="text == 0" @change="e=>onAutoChange(e)" />
+                    default-checked :checked="text == 0" @change="e=>onStatusChange(e,record)" />
         </span>
         <template slot="startSlot" slot-scope="text,record">
           <div style="display: flex;align-items: center">
             <a-form style="width: 90%">
               <a-form-item prop="startTime" style="margin-bottom: 0px">
                 <a-time-picker format="HH:mm" :minuteStep="5" :default-value="moment(text, 'HH:mm')"
-                               :allowClear="false" @change="onChange" />
+                               :allowClear="false" @openChange="e=>onStartOpen(e,record)" @change="event=>onStartChange(event)" />
               </a-form-item>
             </a-form>
             <!--                    <a-input v-model="text" placeholder="请输入关联号" @change="(e)=>handleNumber(e,record)" ></a-input>-->
@@ -71,7 +86,7 @@
               <a-form-item prop="associationNumber" style="margin-bottom: 0px">
                 <a-form-item prop="startTime" style="margin-bottom: 0px">
                   <a-time-picker format="HH:mm" :minuteStep="5" :default-value="moment(text, 'HH:mm')"
-                                 :allowClear="false" @change="onChange" />
+                                 :allowClear="false" @openChange="e=>onEndOpen(e,record)" @change="e=>onEndChange(e)" />
                 </a-form-item>
               </a-form-item>
             </a-form>
@@ -98,20 +113,21 @@
         <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>
+<!--          <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>
@@ -128,6 +144,7 @@
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import mealCouponModal from './modules/mealCouponModal'
   import moment from 'moment';
+  import { httpAction, getAction } from '@/api/manage'
 
   export default {
     name: 'mealCouponList',
@@ -152,7 +169,7 @@
             // customRender:function (text) {
             //   return text==1?'true':'false'
             // },
-            scopedSlots: { customRender: 'switchSlot' },
+            scopedSlots: { customRender: 'switchAutoSlot' },
           },
           {
             title:'是否启用',
@@ -190,10 +207,12 @@
           deleteBatch: "/business/busMealCoupon/deleteBatch",
           exportXlsUrl: "/business/busMealCoupon/exportXls",
           importExcelUrl: "business/busMealCoupon/importExcel",
-
+          edit: "/business/busMealCoupon/edit",
         },
         dictOptions:{},
         superFieldList:[],
+        startTime:'',
+        endTime:''
       }
     },
     created() {
@@ -220,11 +239,69 @@
         fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
         this.superFieldList = fieldList
       },
-      onAutoChange(){
+      onAutoChange(e,record){
+        console.log(e)
+        console.log(record)
+        let data = { ...record }
+        if (e) {
+          data.automaticGrant = 0;
+        } else {
+          data.automaticGrant = 1;
+        }
+        this.update(data)
+      },
+      onStatusChange(e,record){
+        console.log(e)
+        console.log(record)
+        let data = { ...record }
+        if (e) {
+          data.status = 0;
+        } else {
+          data.status = 1;
+        }
+        this.update(data)
+      },
+      onStartOpen(e,record){
+        if (!e){
+          //关闭时间选择面板
+          let data = { ...record }
+          if (data.startTime != this.startTime){
+            data.startTime = this.startTime;
+            this.update(data)
+          }
 
+        }
+      },
+      onStartChange(e){
+        this.startTime = moment(new Date(e)).format('HH:mm:ss')
       },
-      onChange(){
+      onEndOpen(e,record){
+        if (!e){
+          //关闭时间选择面板
+          let data = { ...record }
+          if (data.endTime != this.endTime){
+            data.endTime = this.endTime;
+            this.update(data)
+          }
 
+        }
+      },
+      onEndChange(e){
+        this.endTime = moment(new Date(e)).format('HH:mm:ss')
+      },
+      update(data){
+        const that = this;
+        httpAction(this.url.edit, data, 'put').then((res) => {
+          if (res.success) {
+            that.$message.success(res.message);
+            that.$emit('ok');
+            that.loadData();
+          } else {
+            that.$message.warning(res.message);
+          }
+        }).finally(() => {
+          that.confirmLoading = false;
+        })
       }
     }
   }

+ 2 - 6
src/views/settings/components/roomModules/modules/mealCouponForm.vue

@@ -102,7 +102,6 @@
           edit(record) {
               this.model = Object.assign({}, record);
               this.visible = true;
-              console.log(record)
               if (this.model.status == 0) {
                   this.model.status = true;
               } else {
@@ -122,13 +121,11 @@
                   this.model.startTime = moment(record.startTime, "HH:mm")
                   this.model.endTime = moment(record.endTime, "HH:mm")
               }
-
-
-              console.log(this.model)
           },
           submitForm() {
               const that = this;
               // 触发表单验证
+              console.log(that.model)
               this.$refs.form.validate(valid => {
                   if (valid) {
                       that.confirmLoading = true;
@@ -143,8 +140,7 @@
                           httpurl += this.url.edit;
                           method = 'put';
                       }
-
-                      var data = this.model;
+                      let data = { ...that.model }
                       if (this.model.status) {
                           data.status = 0;
                       } else {

+ 109 - 0
src/views/settings/components/roomModules/modules/serviceRepairCategoryForm.vue

@@ -0,0 +1,109 @@
+<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-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: 'serviceRepairCategoryForm',
+    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: {
+           name: [
+              { required: true, message: '请输入分类名称!'},
+           ],
+        },
+        url: {
+          add: "/business/busServiceRepairCategory/add",
+          edit: "/business/busServiceRepairCategory/edit",
+          queryById: "/business/busServiceRepairCategory/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/roomModules/modules/serviceRepairCategoryModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <service-repair-category-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></service-repair-category-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 serviceRepairCategoryForm from './serviceRepairCategoryForm'
+
+  export default {
+    name: 'serviceRepairCategoryModal',
+    components: {
+      serviceRepairCategoryForm
+    },
+    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/roomModules/modules/serviceRepairCategoryModal.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="关闭">
+    <service-repair-category-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></service-repair-category-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import serviceRepairCategoryForm from './serviceRepairCategoryForm'
+  export default {
+    name: 'serviceRepairCategoryModal',
+    components: {
+      serviceRepairCategoryForm
+    },
+    data () {
+      return {
+        title:'',
+        width:500,
+        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>

+ 172 - 0
src/views/settings/components/roomModules/modules/serviceRepairForm.vue

@@ -0,0 +1,172 @@
+<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="类型(1-服务;2-维修)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">-->
+<!--              <a-input-number v-model="model.type" placeholder="请输入类型(1-服务;2-维修)" style="width: 100%" />-->
+<!--            </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="service_repair_type"
+                                 @change="e=>handleChangeType(e)" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24" v-show="model.type == 1" >
+<!--            <a-form-model-item label="服务模块(1-物品;2-服务内容)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="serviceType">-->
+<!--              <a-input-number v-model="model.serviceType" placeholder="请输入服务模块(1-物品;2-服务内容)" style="width: 100%" />-->
+<!--            </a-form-model-item>-->
+            <a-form-model-item label="服务模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="serviceType">
+              <j-dict-select-tag type="radio" v-model="model.serviceType" placeholder="请选择服务模块" dictCode="service_module"
+                                 @change="e=>handleChangeServiceType(e)" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24" v-show="model.type == 1 && model.serviceType == 1">
+<!--            <a-form-model-item label="关联物品分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryId">-->
+<!--              <a-input v-model="model.categoryId" placeholder="请输入关联物品分类"  ></a-input>-->
+<!--            </a-form-model-item>-->
+            <a-form-model-item label="物品分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryId">
+<!--              <a-input v-model="model.categoryId" placeholder="请输入关联物品分类"  ></a-input>-->
+              <a-select
+                      show-search
+                      placeholder="请物品分类"
+                      v-model="model.categoryId"
+                      option-filter-prop="children"
+              >
+                <a-select-option v-for="item in categoryData" :key="item.id" >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </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: 'serviceRepairForm',
+    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: {
+           name: [
+              { required: true, message: '请输入名称!'},
+           ],
+           type: [
+              { required: true, message: '请选择类型!'},
+           ],
+        },
+        url: {
+          add: "/business/busServiceRepair/add",
+          edit: "/business/busServiceRepair/edit",
+          queryById: "/business/busServiceRepair/queryById",
+          queryCategoryData: "/business/busServiceRepairCategory/queryList"
+        },
+        categoryData:[]
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      getAction(this.url.queryCategoryData,{}).then((res)=>{
+        if(res.success){
+          this.categoryData = res.result
+        }else{
+
+        }
+      })
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        if (!record.id){
+          record.type = 1;
+          record.serviceType = 1;
+        }
+        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;
+            })
+          }
+
+        })
+      },
+      handleChangeType(e){
+        if (e != 1){
+          this.model.serviceType = 0
+          this.model.categoryId = '';
+        }
+      },
+      handleChangeServiceType(e){
+        if (e != 1){
+          this.model.categoryId = '';
+        }
+      }
+    }
+  }
+</script>

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

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <service-repair-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></service-repair-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 serviceRepairForm from './serviceRepairForm'
+
+  export default {
+    name: 'serviceRepairModal',
+    components: {
+      serviceRepairForm
+    },
+    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/roomModules/modules/serviceRepairModal.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="关闭">
+    <service-repair-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></service-repair-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import serviceRepairForm from './serviceRepairForm'
+  export default {
+    name: 'serviceRepairModal',
+    components: {
+      serviceRepairForm
+    },
+    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>

+ 197 - 0
src/views/settings/components/roomModules/serviceRepairCategoryList.vue

@@ -0,0 +1,197 @@
+<template>
+  <j-modal
+          :title="title"
+          :width="width"
+          :visible="visible"
+          switchFullscreen
+          @ok="handleOk"
+          :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+          @cancel="handleCancel"
+          cancelText="关闭">
+    <a-card :bordered="false">
+      <!-- 查询区域 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="searchQuery">
+          <a-row :gutter="24">
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 查询区域-END -->
+
+      <!-- 操作按钮区域 -->
+      <div class="table-operator">
+        <a-button @click="handleAdd" type="primary" icon="plus">新增物品分类</a-button>
+<!--        <a-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>
+          <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>
+
+      <service-repair-category-modal ref="modalForm" @ok="modalFormOk"></service-repair-category-modal>
+    </a-card>
+  </j-modal>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import serviceRepairCategoryModal from './modules/serviceRepairCategoryModal'
+
+  export default {
+    name: 'serviceRepairCategoryList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      serviceRepairCategoryModal
+    },
+    data () {
+      return {
+        description: '服务维修-物品分类管理页面',
+        // 表头
+        columns: [
+          {
+            title:'分类名称',
+            align:"center",
+            dataIndex: 'name'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/business/busServiceRepairCategory/list",
+          delete: "/business/busServiceRepairCategory/delete",
+          deleteBatch: "/business/busServiceRepairCategory/deleteBatch",
+          exportXlsUrl: "/business/busServiceRepairCategory/exportXls",
+          importExcelUrl: "business/busServiceRepairCategory/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    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:'status',text:'状态(0-禁用;1-启用)'})
+        fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
+        this.superFieldList = fieldList
+      },
+      show () {
+        this.visible=true
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 243 - 0
src/views/settings/components/roomModules/serviceRepairList.vue

@@ -0,0 +1,243 @@
+<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>
+              <a-select
+                      :maxTagCount="1"
+                      mode="multiple"
+                      v-model="queryParam.hotelId"
+                      placeholder="商家名称"
+                      :allowClear="true"
+              >
+                <a-select-option :value="item.id" v-for="(item,index) in hotelList" :key="index">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="6">
+            <a-form-item>
+              <j-dict-select-tag v-model="queryParam.type" placeholder="请选择类型" dictCode="service_repair_type"/>
+            </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>
+                            <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</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>
+      <a-button @click="handleCategory" icon="gold">物品分类管理</a-button>
+    </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>
+
+    <service-repair-modal ref="modalForm" @ok="modalFormOk"></service-repair-modal>
+    <service-repair-category-list ref="modalCategoryList"></service-repair-category-list>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import serviceRepairModal from './modules/serviceRepairModal'
+  import ServiceRepairCategoryList from "./serviceRepairCategoryList";
+  import {hotelQueryList} from "../../../../api/hotel";
+
+  export default {
+    name: 'serviceRepairList',
+    mixins: [JeecgListMixin, mixinDevice],
+    components: {
+      ServiceRepairCategoryList,
+      serviceRepairModal
+    },
+    data() {
+      return {
+        description: '服务维修管理页面',
+        // 表头
+        columns: [
+          {
+            title: '商家',
+            align: "center",
+            dataIndex: 'hotelName'
+          },
+          {
+            title: '名称',
+            align: "center",
+            dataIndex: 'name'
+          },
+          {
+            title: '类型',
+            align: "center",
+            dataIndex: 'type_dictText',
+            // customRender:function (text) {
+            //   return text==1?'服务':'维修'
+            // },
+          },
+          {
+            title: '模块',
+            align: "center",
+            dataIndex: 'serviceType_dictText',
+            // customRender:function (text) {
+            //   return text==1?'物品':'服务内容'
+            // },
+          },
+          {
+            title: '分类名称',
+            align: "center",
+            dataIndex: 'categoryName'
+          },
+          {
+            title: '时间',
+            align: "center",
+            dataIndex: 'createTime'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align: "center",
+            fixed: "right",
+            width: 147,
+            scopedSlots: {customRender: 'action'}
+          }
+        ],
+        url: {
+          list: "/business/busServiceRepair/list",
+          delete: "/business/busServiceRepair/delete",
+          deleteBatch: "/business/busServiceRepair/deleteBatch",
+          exportXlsUrl: "/business/busServiceRepair/exportXls",
+          importExcelUrl: "business/busServiceRepair/importExcel",
+
+        },
+        dictOptions: {},
+        superFieldList: [],
+        hotelList: [],
+      }
+    },
+    created() {
+      this.getSuperFieldList();
+      hotelQueryList({
+        key: ''
+      }).then(res => {
+        console.log(res)
+        if (res.code == 200 && res.result) {
+          this.hotelList = res.result;
+        }
+      })
+    },
+    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: '类型(1-服务;2-维修)'})
+        fieldList.push({type: 'int', value: 'serviceType', text: '服务模块(1-物品;2-服务内容)'})
+        fieldList.push({type: 'string', value: 'categoryId', text: '关联物品分类'})
+        fieldList.push({type: 'int', value: 'delFlag', text: '删除状态(0-正常,1-已删除)'})
+        this.superFieldList = fieldList
+      },
+      handleCategory() {
+        console.log('物品分类')
+        this.$refs.modalCategoryList.show();
+        this.$refs.modalCategoryList.title = "物品分类管理";
+        this.$refs.modalCategoryList.disableSubmit = true;
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 3 - 0
src/views/settings/roomSettings.vue

@@ -53,6 +53,7 @@
                     <a-icon type="tool" />
                     服务维修设置
                 </span>
+                <service-repair-list></service-repair-list>
             </a-tab-pane>
             <a-tab-pane key="9">
                 <span slot="tab">
@@ -77,8 +78,10 @@ import goodList from "./components/roomModules/goodList.vue";
 import roomNumList from "./components/roomModules/roomNumSettings/roomNumList.vue";
 import allDaysRule from './components/roomModules/allDaysRoomFeeRule.vue'
 import MealCouponList from "./components/roomModules/mealCouponList";
+import ServiceRepairList from "./components/roomModules/serviceRepairList";
 export default {
     components: {
+        ServiceRepairList,
         MealCouponList,
         roomLayoutList,
         goodList,