Bladeren bron

协议单位和会员添加退房时间

覃浩 2 jaren geleden
bovenliggende
commit
e7306ee4ae

+ 12 - 0
src/views/settings/components/roomModules/allDaysRoomFeeRule.vue

@@ -66,6 +66,9 @@
               </a-time-picker>
             </a-form-model-item>
           </div>
+          <div class="wrapper-content">
+            <a-button type="link" @click="openMoreLeaveTimeSetting">更多...</a-button>
+          </div>
           <div class="wrapper-content">,超时则</div>
           <div class="wrapper-form-item">
             <a-form-model-item
@@ -294,16 +297,21 @@
         </div>
       </a-form-model>
     </j-form-container>
+    <more-setting ref="moreSettings"></more-setting>
   </a-spin>
 </template>
 
 <script>
 import { fetch, save } from "@/api/allDaysPriceRuleApi";
 import { getAllLayouts } from "@/api/roomLayout";
+import moreSetting from './modules/moreLeaveTimeSettingModal.vue'
 import moment from 'moment'
 
 let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"))
 export default {
+  components: {
+    moreSetting
+  },
   data() {
     return {
       labelCol: {
@@ -358,6 +366,7 @@ export default {
         leaveTime: [{ required: true, message: "退房时间不能为空" }],
         dayTime: [{ required: true, message: "超时宽限多少分钟不能为空" }],
       },
+      moreLeaveTimeShow: false
     };
   },
   mounted() {
@@ -414,6 +423,9 @@ export default {
         },800)
         
     },
+    openMoreLeaveTimeSetting() {
+      this.$refs.moreSettings.show = true
+    },
     save() {
       const that = this;
       // 触发表单验证

+ 259 - 0
src/views/settings/components/roomModules/modules/huiyuanSettingTime.vue

@@ -0,0 +1,259 @@
+<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 :span="6">
+                        <a-form-item label="">
+                            <j-input placeholder="会员名称" v-model="queryParam.name" style="width: 200px"></j-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="8">
+                        <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>
+        <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="payFlagslot" slot-scope="text, record, index">
+                    {{ record.payFlag == 1 ? "是" : "否" }}
+                </template>
+                <template slot="iconslot" slot-scope="text, record, index">
+                    <a-icon :type="record.icon" theme="filled" />
+                </template>
+                <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-time-picker  v-model="record.leaveTime" format="HH:mm">
+                    </a-time-picker>
+                    <a-button type="primary" size="small" @click="setLeaveTime(record)">
+                        保存
+                    </a-button>
+                </span>
+            </a-table>
+        </div>
+
+    </a-card>
+</template>
+    
+<script>
+
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+import { filterObj } from "@/utils/util";
+import { getAction, putAction } from "@/api/manage";
+import moment from 'moment'
+export default {
+    name: "memberList",
+    mixins: [JeecgListMixin],
+    components: {
+    },
+    data() {
+        return {
+            queryParam: {},
+            // 分页参数
+            ipagination: {
+                current: 1,
+                pageSize: 10,
+                pageSizeOptions: ["10", "20", "30"],
+                showTotal: (total, range) => {
+                    return range[0] + "-" + range[1] + " 共" + total + "条";
+                },
+                showQuickJumper: true,
+                showSizeChanger: true,
+                total: 0,
+            },
+            // 表头
+            columns: [
+                {
+                    title: "商家",
+                    align: "center",
+                    dataIndex: "hotelName",
+                },
+                {
+                    title: "会员名称",
+                    align: "center",
+                    dataIndex: "name",
+                },
+                {
+                    title: "图标",
+                    align: "center",
+                    dataIndex: "icon",
+                    scopedSlots: { customRender: "iconslot" },
+                },
+                {
+                    title: "会员折扣",
+                    align: "center",
+                    dataIndex: "discount",
+                },
+                {
+                    title: "是否需要支付",
+                    align: "center",
+                    dataIndex: "payFlag",
+                    scopedSlots: { customRender: "payFlagslot" },
+                },
+                {
+                    title: "费用",
+                    align: "center",
+                    dataIndex: "payAmount",
+                },
+                {
+                    title: "积分购买",
+                    align: "center",
+                    dataIndex: "payIntegral",
+                },
+                {
+                    title: "退房时间",
+                    dataIndex: "action",
+                    align: "center",
+                    fixed: "right",
+                    width: 147,
+                    scopedSlots: { customRender: "action" },
+                },
+            ],
+            url: {
+                list: "/org.jeecg.modules.business/busMarketMember/list",
+                delete: "/org.jeecg.modules.business/busMarketMember/delete",
+                deleteBatch: "/org.jeecg.modules.business/busMarketMember/deleteBatch",
+                exportXlsUrl: "/org.jeecg.modules.business/busMarketMember/exportXls",
+                importExcelUrl:
+                    "org.jeecg.modules.business/busMarketMember/importExcel",
+            },
+            dictOptions: {},
+            superFieldList: [],
+            selectedRowKeys: [],
+            isorter: {
+                column: "createTime",
+                order: "desc",
+            },
+        };
+    },
+    created() {
+        // this.loadData()
+    },
+    watch:{
+        dataSource(old, nVal) {
+            this.dataSource.forEach(s=> {
+                s.leaveTime = s.leaveTime?moment(s.leaveTime,"HH:mm").utcOffset(8):null
+            })
+        }
+    },
+    methods: {
+        setLeaveTime(record) {
+            let data = JSON.parse(JSON.stringify(record))
+            if(data.leaveTime) {
+                data.leaveTime = data.leaveTime ? moment(new Date(data.leaveTime),"HH:mm").utcOffset(8).format("HH:mm") : null
+            }
+            putAction("/org.jeecg.modules.business/busMarketMember/edit",data).then(res=> {
+                if(res.success) {
+                    this.$message.success("保存成功")
+                }
+            })
+        },
+        getAvatarView: function (avatar) {
+            return getFileAccessHttpUrl(avatar);
+        },
+
+        batchFrozen: function (status) {
+            if (this.selectedRowKeys.length <= 0) {
+                this.$message.warning("请选择一条记录!");
+                return false;
+            } else {
+                let ids = "";
+                let that = this;
+                let isAdmin = false;
+                that.selectionRows.forEach(function (row) {
+                    if (row.username == "admin") {
+                        isAdmin = true;
+                    }
+                });
+                if (isAdmin) {
+                    that.$message.warning("管理员账号不允许此操作,请重新选择!");
+                    return;
+                }
+                that.selectedRowKeys.forEach(function (val) {
+                    ids += val + ",";
+                });
+                that.$confirm({
+                    title: "确认操作",
+                    content: "是否" + (status == 1 ? "解冻" : "冻结") + "选中账号?",
+                    onOk: function () {
+                        frozenBatch({ ids: ids, status: status }).then((res) => {
+                            if (res.success) {
+                                that.$message.success(res.message);
+                                that.loadData();
+                                that.onClearSelected();
+                            } else {
+                                that.$message.warning(res.message);
+                            }
+                        });
+                    },
+                });
+            }
+        },
+        handleMenuClick(e) {
+            if (e.key == 1) {
+                this.batchDel();
+            } else if (e.key == 2) {
+                this.batchFrozen(2);
+            } else if (e.key == 3) {
+                this.batchFrozen(1);
+            }
+        },
+        handleFrozen: function (id, status, username) {
+            let that = this;
+            //TODO 后台校验管理员角色
+            if ("admin" == username) {
+                that.$message.warning("管理员账号不允许此操作!");
+                return;
+            }
+            frozenBatch({ ids: id, status: status }).then((res) => {
+                if (res.success) {
+                    that.$message.success(res.message);
+                    that.loadData();
+                } else {
+                    that.$message.warning(res.message);
+                }
+            });
+        },
+        handleChangePassword(username) {
+            this.$refs.passwordmodal.show(username);
+        },
+        passwordModalOk() {
+            //TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
+        },
+        onSyncFinally({ isToLocal }) {
+            // 同步到本地时刷新下数据
+            if (isToLocal) {
+                this.loadData();
+            }
+        },
+    },
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 41 - 0
src/views/settings/components/roomModules/modules/moreLeaveTimeSettingModal.vue

@@ -0,0 +1,41 @@
+<template>
+    <j-modal title="全天房会员/协议单位退房设置" width="60%" :visible="show" switchFullscreen @ok="handleOk" @cancel="handleCancel"
+        cancelText="关闭">
+        <a-tabs default-active-key="1">
+            <a-tab-pane key="1" tab="会员退房">
+                <huiyuan-table></huiyuan-table>
+            </a-tab-pane>
+            <a-tab-pane key="2" tab="单位退房" force-render>
+                <xieyi-table></xieyi-table>
+            </a-tab-pane>
+            
+        </a-tabs>
+        
+    </j-modal>
+</template>
+<script>
+import huiyuanTable from './huiyuanSettingTime.vue'
+import xieyiTable from './xieyiSettingTime.vue'
+export default {
+    components: {
+        huiyuanTable,
+        xieyiTable
+    },
+    data() {
+        return {
+            show: false,
+        }
+    },
+    mounted() {
+
+    },
+    methods: {
+        handleOk() {
+
+        },
+        handleCancel() {
+            this.show = false
+        }
+    }
+}
+</script>

+ 198 - 0
src/views/settings/components/roomModules/modules/xieyiSettingTime.vue

@@ -0,0 +1,198 @@
+<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 :span="4">
+                        <a-form-item>
+                            <a-input placeholder="关键字" v-model="queryParam.keyWord" allowClear></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="8">
+                        <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>
+        <div>
+            
+
+            <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
+                :dataSource="dataSource" :pagination="ipagination" :loading="loading"
+                
+              >
+                <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-time-picker  v-model="record.leaveTime" format="HH:mm">
+                    </a-time-picker>
+                    <a-button type="primary" size="small" @click="setLeaveTime(record)">
+                        保存
+                    </a-button>
+                </span>
+
+            </a-table>
+        </div>
+    </a-card>
+</template>
+
+<script>
+
+import '@/assets/less/TableExpand.less'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { httpAction, putAction } from '@/api/manage'
+import moment from 'moment'
+
+
+export default {
+    name: 'agreementunit1',
+    mixins: [JeecgListMixin],
+    components: {
+    },
+    data() {
+        return {
+            description: '协议单位管理页面',
+            // 表头
+            columns: [
+                {
+                    title: '商家名称',
+                    align: "center",
+                    dataIndex: 'hotelName'
+                },
+                {
+                    title: '账号',
+                    align: "center",
+                    dataIndex: 'accountNo'
+                },
+                {
+                    title: '客户名称',
+                    align: "center",
+                    dataIndex: 'customerName'
+                },
+                {
+                    title: '客户类型',
+                    align: "center",
+                    dataIndex: 'customerType_dictText'
+                },
+                {
+                    title: '客户状态',
+                    align: "center",
+                    dataIndex: 'status_dictText'
+                },
+                {
+                    title: '记账额度',
+                    align: "center",
+                    dataIndex: 'bookkeeping',
+                    customRender: function (text) {
+                        return (text == null || text == 0 ? "无限制" : text)
+                    }
+                },
+                {
+                    title: '已用额度',
+                    align: "center",
+                    dataIndex: 'amountUsed'
+                },
+                {
+                    title: '剩余额度',
+                    align: "center",
+                    dataIndex: 'balance'
+                },
+                {
+                    title: '备注',
+                    align: "center",
+                    dataIndex: 'remarks'
+                },
+                {
+                    title: '账号状态',
+                    align: "center",
+                    dataIndex: 'accountStatus_dictText'
+                },
+                {
+                    title: '审核状态',
+                    align: "center",
+                    dataIndex: 'checkStatus_dictText'
+                },
+                {
+                    title: '审核时间',
+                    align: "center",
+                    dataIndex: 'checkTime',
+                    customRender: function (text) {
+                        return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
+                    }
+                },
+                {
+                    title: '退房时间',
+                    dataIndex: 'action',
+                    align: "center",
+                    fixed: "right",
+                    width: 200,
+                    scopedSlots: { customRender: 'action' }
+                }
+            ],
+            url: {
+                list: "/business/busMarketAgreementUnit/list",
+                delete: "/business/busMarketAgreementUnit/delete",
+                deleteBatch: "/business/busMarketAgreementUnit/deleteBatch",
+                exportXlsUrl: "/business/busMarketAgreementUnit/exportXls",
+                importExcelUrl: "business/busMarketAgreementUnit/importExcel",
+
+            },
+            dictOptions: {},
+            superFieldList: [],
+            customerTypeList: [],
+            customerStatusList: [],
+        }
+    },
+    created() {
+       
+    },
+    computed: {
+       
+    },
+    watch:{
+        dataSource(old, nVal) {
+            this.dataSource.forEach(s=> {
+                s.leaveTime = s.leaveTime?moment(s.leaveTime,"HH:mm").utcOffset(8):null
+            })
+        }
+    },
+    methods: {
+        setLeaveTime(record) {
+            let data = JSON.parse(JSON.stringify(record))
+            if(data.leaveTime) {
+                data.leaveTime = data.leaveTime ? moment(new Date(data.leaveTime),"HH:mm").utcOffset(8).format("HH:mm") : null
+            }
+            putAction("/business/busMarketAgreementUnit/edit",data).then(res=> {
+                if(res.success) {
+                    this.$message.success("保存成功")
+                }
+            })
+        },
+        
+        
+       
+        
+    }
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>