DESKTOP-B78GIPM\admin hace 2 años
padre
commit
9e91855931

+ 113 - 16
src/views/fangwu/index.vue

@@ -76,10 +76,24 @@
                 </div>
                 <a-card class="card">
                     <div>
-                        客房易耗品消耗数量
+                        <div>
+                            客房易耗品消耗数量
+                        </div>
+                        <div style="display:flex;flex-wrap:wrap">
+                            <div v-for="item in roomConsumableCount" style="margin-right:20px;">
+                                {{item.good_name}} <a>{{item.num}}{{item.unit}}</a>
+                            </div>
+                        </div>
                     </div>
                     <div>
-                        布草换洗
+                        <div>
+                            布草换洗
+                        </div>
+                        <div style="display:flex;flex-wrap:wrap">
+                            <div v-for="item in linenCount" style="margin-right:20px;">
+                                {{item.good_name}} <a>{{item.num}}{{item.unit}}</a>
+                            </div>
+                        </div>
                     </div>
                 </a-card>
             </div>
@@ -181,8 +195,12 @@ import {
     delAll
 } from '@/api/roomBuildingApi'
 
-import { HousekeepingApi } from '@/api/fwApi.js'
-import { getAction } from '../../api/manage'
+import {
+    HousekeepingApi
+} from '@/api/fwApi.js'
+import {
+    getAction
+} from '../../api/manage'
 let hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
 export default {
     mixins: [JeecgListMixin],
@@ -206,15 +224,15 @@ export default {
             verifyCount: 0,
 
             activeIndex: 0,
-            dataSource:[],
+            dataSource: [],
             assignVisible: false,
             handVisible: false,
             //锁房总数
-            LockedRoom:'0',
+            LockedRoom: '0',
             //正在维修中总数
-            RepairingRoom:'0',
+            RepairingRoom: '0',
             //今日完成维修总数
-            TodayRepairRoom:'0',
+            TodayRepairRoom: '0',
 
             // 表头
             columns: [{
@@ -255,6 +273,12 @@ export default {
             dictOptions: {},
             superFieldList: [],
             selectedRowKeys: [],
+            startTime: new Date().toLocaleString().substring(0, 10).replace(/\//g, "-"),
+            endTime: new Date(new Date().getTime() + 24*60*60*1000).toLocaleString().substring(0, 10).replace(/\//g, "-"),
+            //客房易耗品数量
+            roomConsumableCount: [],
+            //布草
+            linenCount: [],
         }
     },
     methods: {
@@ -263,10 +287,79 @@ export default {
         },
         handleClick(index) {
             this.activeIndex = index
-            this.searchQuery()
+            if (index == 4) {
+                return
+            }
+            let startTime, endTime;
+            startTime = this.getTime(index).startTime
+            endTime = this.getTime(index).endTime
+            this.getRoomUseConsumableSummary(startTime, endTime, 1)
+            this.getRoomUseConsumableSummary(startTime, endTime, 2)
+            // this.searchQuery()
+        },
+
+        getTime(type) {
+
+            let startTime;
+            let endTime;
+            let now = new Date(); //当前日期 
+            let nowDayOfWeek = now.getDay(); //今天本周的第几天 
+            let nowDay = now.getDate(); //当前日 
+            let nowMonth = now.getMonth(); //当前月 
+            let nowYear = now.getFullYear(); //当前年 
+            let jd=Math.ceil((nowMonth + 1) / 3)
+            if (type == 0) {
+                startTime = new Date().toLocaleString().substring(0, 10)
+                endTime = new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toLocaleString().substring(0, 10)
+            }
+            if (type == 1) {
+                startTime = new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 2).toLocaleString().substring(0, 10)
+                endTime = new Date(new Date().getTime() - 24 * 60 * 60 * 1000).toLocaleString().substring(0, 10)
+            }
+            if(type == 2){
+                startTime = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek+1).toLocaleString().substring(0, 10)
+                endTime = new Date(nowYear, nowMonth, nowDay + 6 - nowDayOfWeek+1).toLocaleString().substring(0, 10)
+            }
+            if (type==3) {
+                startTime = new Date(nowYear, nowMonth, 1).toLocaleString().substring(0, 9)
+                endTime = new Date(nowYear, nowMonth + 1, 0).toLocaleString().substring(0, 10)
+            }
+            return {
+                startTime: startTime.replace(/\//g, '-'),
+                endTime: endTime.replace(/\//g, '-')
+            }
+        },
+
+        /**
+         * 获取房间易耗品记录
+         * @param {*} startTime 开始时间
+         * @param {*} endTime 结束时间
+         * @param {*} type 类型 1:易耗品 2:布草
+         */
+        getRoomUseConsumableSummary(startTime, endTime, type = 1) {
+            getAction(`/fw/fwRoomClean/roomUseConsumableSummary`, {
+                startTime,
+                endTime,
+                type
+            }).then(res => {
+                if (res.success) {
+                    console.log(res);
+                    if (type==1) {
+                        this.roomConsumableCount = res.result
+                    }
+                    if (type==2) {
+                        this.linenCount = res.result
+                    }
+                }
+            })
         },
         onChange(date, dateString) {
             console.log(date, dateString)
+            if (dateString[0]=="" || dateString[1]=="") {
+                return
+            }
+            this.getRoomUseConsumableSummary(dateString[0], dateString[1], 1)
+            this.getRoomUseConsumableSummary(dateString[0], dateString[1], 2)
         },
         //点击弹出框
         showAssignModal() {
@@ -293,7 +386,7 @@ export default {
         /**
          * 配置易耗品
          */
-        dispose(){
+        dispose() {
             this.$refs.configModal.visible = true
             this.$refs.configModal.title = '配置易耗品'
         }
@@ -305,18 +398,20 @@ export default {
         //         this.loadData();
         //     }
         // });
-        getAction(`/fw/fwRoomClean/list?verifyState=0`).then(res=>{
+        getAction(`/fw/fwRoomClean/list?verifyState=0`).then(res => {
             this.verifyCount = res.result.total
         })
-        HousekeepingApi.getLockedRoom().then(res=>{
+        HousekeepingApi.getLockedRoom().then(res => {
             this.LockedRoom = res.result.total
         })
-        HousekeepingApi.getInRepair().then(res=>{
+        HousekeepingApi.getInRepair().then(res => {
             this.RepairingRoom = res.result.total
         })
-        HousekeepingApi.getRepairRoom().then(res=>{
+        HousekeepingApi.getRepairRoom().then(res => {
             this.TodayRepairRoom = res.result.total
         })
+        this.getRoomUseConsumableSummary(this.startTime, this.endTime, 1)
+        this.getRoomUseConsumableSummary(this.startTime, this.endTime, 2)
     }
 }
 </script>
@@ -402,7 +497,8 @@ export default {
 h3 {
     margin-top: 15px;
 }
-.check-out{
+
+.check-out {
     // width: 22px;
     // height: 12px;
     background: #909399;
@@ -414,7 +510,8 @@ h3 {
     vertical-align: middle;
     margin-right: 10px;
 }
-.continue{
+
+.continue {
     background: #1890ff60;
     padding: 5px;
     color: #fff;

+ 128 - 54
src/views/fangwu/tabList/clearRecords.vue

@@ -31,34 +31,16 @@
 
     <!-- table区域-begin -->
     <div class="grid-clear">
-        <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="false" :loading="loading" :rowSelection="{
-          selectedRowKeys: selectedRowKeys,
-          onChange: onSelectChange,
-        }" class="j-table-force-nowrap" @change="handleTableChange">
+        <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
 
-            <template slot="layoutId" slot-scope="text, record">
-                {{ getLayoutName(record) }}
-            </template>
-            <template slot="prefix_name" slot-scope="text, record">
-                {{ (record.prefix || "") + record.name }}
-            </template>
-            <template slot="pictureSlot" slot-scope="text, record">
-                <img :src="record.cover" style="width:40px;height40px;" />
-            </template>
-            <template slot="htmlSlot" slot-scope="text">
-                <div v-html="text"></div>
-            </template>
+            <template slot="footer" v-if="dataList.length>0">
+                <div class="tableData">
 
-            <span slot="action" slot-scope="text, record">
-                <a @click="handleEdit(record)">编辑</a>
+                </div>
+                <a-table size="middle" bordered :showHeader="false" :pagination="false" :columns="columns" :dataSource="dataList">
 
-                <a-divider type="vertical" />
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                    <a>删除</a>
-                </a-popconfirm>
-                <a-divider type="vertical" />
-                <a @click="handleImage(record)">图片</a>
-            </span>
+                </a-table>
+            </template>
         </a-table>
         <a-card>
             <a-checkbox-group @change="onChange">
@@ -112,13 +94,31 @@ export default {
         // roomNumModal,
         // roomImgs
     },
+    computed:{
+        dataList(){
+            if (this.dataSource.length === 0) {
+                return []
+            }
+            let keyArr = Object.keys(this.dataSource[0])
+            keyArr = keyArr.filter(item=>item!=='waiter_name')
+            let obj = {}
+            keyArr.forEach(item=>{
+                obj[item] = this.dataSource.reduce((pre, cur)=> pre + cur[item], 0)
+            })
+            obj.waiter_name = '合计'
+            return [obj]
+        }
+    },
     data() {
         return {
             list: ['今天', '昨日', '本周', '本月', '更多'],
             activeIndex: 0,
             delLoading: false,
             layouts: [],
-            queryParam: {},
+            queryParam: {
+                startTime: new Date().toLocaleString().substring(0, 10).replace(/\//g, "-"),
+                endTime: new Date(new Date().getTime() + 24*60*60*1000).toLocaleString().substring(0, 10).replace(/\//g, "-"),
+            },
             // 分页参数
             ipagination: {
                 current: 1,
@@ -135,65 +135,72 @@ export default {
             columns: [{
                     title: "房屋人员",
                     align: "center",
-                    dataIndex: "waiterName",
+                    dataIndex: "waiter_name",
+                    width: 180,
                 },
                 {
                     title: "退房",
                     // align: "center",
-                    dataIndex: "buildName",
+                    dataIndex: "tf_num",
+                    width: 120,
                     children: [{
                         title: '脏房数',
-                        dataIndex: 'buildName',
+                        dataIndex: 'tf_num',
                         // key: 'companyAddress',
-                        // width: 200,
+                        width: 120,
                     }],
                 },
                 {
                     title: "续房",
                     // align: "center",
-                    dataIndex: "floorName",
+                    dataIndex: "xf_num",
+                    width: 120,
                     children: [{
                         title: '脏房',
-                        dataIndex: 'floorName',
+                        dataIndex: 'xf_num',
                         // key: 'companyAddress',
-                        // width: 200,
+                        width: 120,
                     }],
                 },
                 {
                     title: "钟点",
-                    align: "center",
-                    dataIndex: "layoutId",
-                    scopedSlots: {
-                        customRender: "layoutId"
-                    },
+                    // align: "center",
+                    dataIndex: "zd_num",
+                    width: 120,
+                    // scopedSlots: {
+                    //     customRender: "layoutId"
+                    // },
                 },
                 {
                     title: "特脏",
-                    align: "center",
-                    dataIndex: "name",
-                    scopedSlots: {
-                        customRender: ""
-                    },
+                    // align: "center",
+                    dataIndex: "",
+                    width: 120,
+                    // scopedSlots: {
+                    //     customRender: ""
+                    // },
                 },
                 {
                     title: "合计房间数",
-                    align: "center",
-                    dataIndex: "createAt",
+                    // align: "center",
+                    dataIndex: "count",
+                    width: 120,
                 },
                 {
                     title: "提成金额",
-                    dataIndex: "action",
-                    align: "center",
-                    fixed: "right",
-                    width: 147,
-                    scopedSlots: {
-                        customRender: "action"
-                    },
+                    dataIndex: "tc_money",
+                    // align: "center",
+                    width: 120,
+                    // fixed: "right",
+                    // width: 147,
+                    // scopedSlots: {
+                    //     customRender: "action"
+                    // },
                 },
             ],
             url: {
                 // list: 'org.jeecg.modules.business/busMarketMember/list',
-                list: "/fw/fwRoomClean/list",
+                list: "/fw/fwRoomClean/roomCleanSummary",
                 delete: "/rooms/cesRooms/remove",
                 deleteBatch: "/rooms/cesRooms/deleteBatch",
                 exportXlsUrl: "/rooms/cesRooms/exportXls",
@@ -303,14 +310,57 @@ export default {
         },
         handleClick(index) {
             this.activeIndex = index
+            if (index == 4) {
+                return
+            }
+            this.queryParam.startTime = this.getTime(index).startTime
+            this.queryParam.endTime = this.getTime(index).endTime
             this.searchQuery()
         },
+        getTime(type) {
+            let startTime;
+            let endTime;
+            let now = new Date(); //当前日期 
+            let nowDayOfWeek = now.getDay(); //今天本周的第几天 
+            let nowDay = now.getDate(); //当前日 
+            let nowMonth = now.getMonth(); //当前月 
+            let nowYear = now.getFullYear(); //当前年 
+            let jd=Math.ceil((nowMonth + 1) / 3)
+            if (type == 0) {
+                startTime = new Date().toLocaleString().substring(0, 10)
+                endTime = new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toLocaleString().substring(0, 10)
+            }
+            if (type == 1) {
+                startTime = new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 2).toLocaleString().substring(0, 10)
+                endTime = new Date(new Date().getTime() - 24 * 60 * 60 * 1000).toLocaleString().substring(0, 10)
+            }
+            if(type == 2){
+                startTime = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek+1).toLocaleString().substring(0, 10)
+                endTime = new Date(nowYear, nowMonth, nowDay + 6 - nowDayOfWeek+1).toLocaleString().substring(0, 10)
+            }
+            if (type==3) {
+                startTime = new Date(nowYear, nowMonth, 1).toLocaleString().substring(0, 9)
+                endTime = new Date(nowYear, nowMonth + 1, 0).toLocaleString().substring(0, 10)
+            }
+
+            return {
+                startTime: startTime.replace(/\//g, '-'),
+                endTime: endTime.replace(/\//g, '-')
+            }
+            // return {
+            //     startTime,
+            //     endTime
+            // }
+        },
         onChange(checkedValues) {
             console.log('checked = ', checkedValues)
         },
         //选择日期
         onChangeTime(date, dateString) {
             console.log(date, dateString)
+            this.queryParam.startTime = dateString[0]
+            this.queryParam.endTime = dateString[1]
+            this.searchQuery()
         },
     },
 };
@@ -343,7 +393,31 @@ export default {
 
 .grid-clear {
     display: grid;
-    grid-template-columns: 2fr 1fr;
+    grid-template-columns: 1.5fr 1fr;
     grid-gap: 10px;
 }
+/deep/ .ant-table-content .ant-table-body {
+    position: relative;
+    z-index: 2;
+    background: #FFFFFF;
+}
+
+/deep/ .ant-table-footer .ant-table-body {
+    overflow: hidden !important;
+    position: relative !important;
+    z-index: 1 !important;
+}
+
+/deep/ .ant-table-content>.ant-table-footer {
+    padding: 0 !important;
+    top: 0px;
+    position: relative;
+    z-index: 0;
+}
+/deep/.ant-table-footer{
+    padding: 0 !important;
+    top: -8px;
+    position: relative;
+    z-index: 2;
+}
 </style>

+ 3 - 3
src/views/fangwu/tabList/configureTable.vue

@@ -208,9 +208,9 @@ export default {
         getAllLayouts().then((res) => {
             if (res.code == 200) {
                 this.layouts = res.result.records;
-                this.layouts.forEach(ele => {
-                    ele.children = []
-                })
+                // this.layouts.forEach(ele => {
+                //     ele.children = []
+                // })
                 this.queryParam.roomLayoutId = this.layouts[0].id;
                 this.loadData(0, 1);
                 this.loadData(0, 2);

+ 34 - 8
src/views/markets/modules/meetingRoomScheduleOrder/BusMeetingRoomScheduleEditForm.vue

@@ -85,17 +85,17 @@
               :wrapperCol="wrapperCol"
               prop="settleRoomOrderNo"
             >
-              <a-input
-                v-show="false"
+              <!-- <a-input
                 v-model="model.settleRoomOrderNo"
                 placeholder="请输入入账人"
                 style="width: 100%"
-              />
-              <a @click="handleRoomOrder">请选择</a>
+              /> -->
+              <a @click="handleRoomOrder">{{selectRoomOrder? `房间:${selectRoomOrder.roomName},姓名:${selectRoomOrder.customerName}` : `请选择`}}</a>
             </a-form-model-item>
           </a-col>
 
-          <a-col :span="24">
+          <template v-if="model.payType==1">
+            <a-col :span="24">
             <a-divider orientation="left"> 支付方式 </a-divider>
           </a-col>
           <a-col :span="24">
@@ -149,19 +149,31 @@
               ></a-input-number>
             </a-form-model-item>
           </a-col>
+          </template>
+
+          
         </a-row>
       </a-form-model>
     </j-form-container>
+    <select-check-in-room-order-modal
+      ref="modalSelectCheckInRoomOrderModal"
+      @ok="modalSelectCheckInRoomOrderFormOk"
+    ></select-check-in-room-order-modal>
   </a-spin>
 </template>
 
 <script>
 import { httpAction, getAction } from "@/api/manage";
 import { validateDuplicateValue } from "@/utils/util";
+import SelectCheckInRoomOrderModal from '../../../pos/modules/SelectCheckInRoomOrderModal.vue'
+
+
 
 export default {
   name: "BusMeetingRoomForm",
-  components: {},
+  components: {
+    SelectCheckInRoomOrderModal
+  },
   props: {
     //表单禁用
     disabled: {
@@ -208,6 +220,8 @@ export default {
         { id: 3, name: "晚上" },
       ],
       paymentMethodList: [],
+      //入账人
+      selectRoomOrder:null
     };
   },
   computed: {
@@ -262,7 +276,14 @@ export default {
   },
   methods: {
     handleRoomOrder() {
-      this.$message.warning("房间订单功能暂未实现,请先选择挂房账否操作");
+      // this.$message.warning("房间订单功能暂未实现,请先选择挂房账否操作");
+      this.$refs.modalSelectCheckInRoomOrderModal.add();
+      this.$refs.modalSelectCheckInRoomOrderModal.title = "选择转帐人";
+      this.$refs.modalSelectCheckInRoomOrderModal.disableSubmit = false;
+    },
+    modalSelectCheckInRoomOrderFormOk(e) {
+      console.log(e);
+      this.selectRoomOrder = e
     },
     puls() {
       this.model.detailList.push({});
@@ -287,10 +308,15 @@ export default {
             this.$message.error("输入优惠金额不能大于订单金额");
             return;
           }
-          if (this.receiptsAmount != this.sumAmount) {
+          if (this.receiptsAmount != this.sumAmount && this.model.payType == 1) {
             this.$message.error("输入必须等于结账应收金额");
             return;
           }
+          if (this.model.payType == 2 && !this.selectRoomOrder) {
+            this.$message.error("请选择入账人");
+            return
+          }
+          this.model.settleRoomOrderNo = this.selectRoomOrder.livingOrderId;
           this.model.paymentMethodList = this.paymentMethodList;
           that.confirmLoading = true;
           let httpurl = this.url.settle;