ソースを参照

添加销售报表,修改路由改变时调用刷新房间

许智捷 2 年 前
コミット
4fe6739431
共有5 個のファイルを変更した648 個の追加12 個の削除を含む
  1. 250 0
      src/views/report/room/sellCollect.vue
  2. 208 0
      src/views/report/room/sellDetail.vue
  3. 174 0
      src/views/report/room/sellDetailModel.vue
  4. 4 2
      src/views/room/calendarfangtai.vue
  5. 12 10
      src/views/room/fangtailive.vue

+ 250 - 0
src/views/report/room/sellCollect.vue

@@ -0,0 +1,250 @@
+<template>
+  <div>
+    <a-card>
+      <a-form>
+        <a-row>
+          <a-col :span="5">
+            <a-form-item
+                label="标识号/商品名称"
+                :labelCol="{ xs: { span: 24 }, sm: { span: 8 }}"
+                :wrapperCol="{xs: { span: 24 },sm: { span: 13 }}">
+              <a-input v-model="queryParam.roomSign" placeholder="标识号/商品名称"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="9">
+            <a-form-item label="">
+              <a-radio-group v-model="queryParam.timeFrame">
+                <a-radio-button value="1">今日</a-radio-button>
+                <a-radio-button value="2">昨日</a-radio-button>
+                <a-radio-button value="3">本周</a-radio-button>
+                <a-radio-button value="4">其他</a-radio-button>
+              </a-radio-group>
+              <a-range-picker v-if="queryParam.timeFrame === '4'" v-model="chooseTime" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-button
+                type="primary"
+                @click="loadDate"
+                icon="search">查询
+            </a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+
+      <a-table
+          ref="table"
+          size="middle"
+          :scroll="{ x: true }"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :dataSource="goodDate"
+          :pagination="ipagination"
+          class="storage_collect"
+          @change="pageChange">
+        <template slot="placeName" slot-scope="text, record, index">
+            <span>
+              <a>{{ text }}</a>
+            </span>
+        </template>
+        <template slot="num" slot-scope="text, record, index">
+            <span>
+              <a @click="lookDetail(record,true)">{{ text }}</a>
+            </span>
+        </template>
+      </a-table>
+
+    </a-card>
+    <sell-detail-model ref="sellDetailModel" ></sell-detail-model>
+  </div>
+</template>
+
+<script>
+import { getAction } from '@api/manage'
+import moment from 'moment'
+import SellDetailModel from '@views/report/room/sellDetailModel'
+
+export default {
+  name: 'storageAllCollect',
+  components: { SellDetailModel },
+  data() {
+    return {
+      columns: [
+        {
+          title: '购买位置',
+          align: 'center',
+          dataIndex: 'placeName',
+          width: 80,
+          key: 'placeName',
+          customRender: (text, record, index) => {
+            const child = this.$createElement('a', {
+              domProps: {
+                innerHTML: text !== null ? text : ''
+              },
+              on: {
+                click: () => {
+                  this.lookDetail(record);
+                }
+              }
+            })
+
+            const obj = {
+              children: child,
+              attrs: {}
+            }
+            console.log(this.mergeCells(text, this.goodDate, 'placeName', index), index)
+            obj.attrs.rowSpan = this.mergeCells(text, this.goodDate, 'placeName', index)
+            return obj
+          },
+        },
+        {
+          title: '消费类目',
+          align: 'center',
+          dataIndex: 'goodTypeName',
+          width: 80,
+          // customRender: function (text, record) {
+          //   return text == null ? '--' : text
+          // },
+        },
+        {
+          title: '商品名称',
+          align: 'center',
+          dataIndex: 'goodName',
+          width: 80,
+          // customRender: function (text, record) {
+          //   return text == null ? '--' : text
+          // },
+        },
+        {
+          title: '数量',
+          align: 'center',
+          dataIndex: 'num',
+          width: 80,
+          scopedSlots: { customRender: 'num' }
+        },
+        {
+          title: '金额',
+          align: 'center',
+          dataIndex: 'money',
+          width: 80
+        },
+      ],
+      // 分页参数
+      list: '/kc/kcDepositoryInGoods/goodsSellCollect',
+      ipagination: {
+        current: 1,
+        pageSize: 999,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      goodDate: [],
+      queryParam: {
+        timeFrame: '1',
+        startTime: '',
+        endTime: '',
+        roomSign: '',
+      },
+      chooseTime: [],
+    }
+  },
+  created() {
+    this.loadDate()
+  },
+  methods: {
+    loadDate() {
+      if (this.queryParam.timeFrame === '4' && this.chooseTime.length === 0) {
+        this.$message.warning('请选择时间')
+        return
+      }
+      this.getTimeFrame()
+      let params = {
+        pageSize: this.ipagination.pageSize,
+        pageNo: this.ipagination.current,
+        startTime: this.queryParam.startTime,
+        endTime: this.queryParam.endTime,
+        roomSign: this.queryParam.roomSign
+      }
+      getAction('/kc/kcDepositoryInGoods/goodsSellCollect', params).then((res) => {
+        if (!res.success) {
+          this.$message.warning('查询失败')
+          return
+        }
+        this.goodDate = res.result.records
+        this.ipagination.pageNo = res.result.current
+        this.ipagination.total = res.result.total
+        this.expandedRowKeys = []
+      }).finally(() => {
+        // this.loading = false
+      })
+    },
+    pageChange(page) {
+      console.log(page)
+      this.ipagination = page
+      this.loadDate()
+    },
+    // 获取时间范围
+    getTimeFrame() {
+      if (this.queryParam.timeFrame === '1') {
+        // 今天
+        this.queryParam.startTime = moment().format('YYYY-MM-DD')
+        this.queryParam.endTime = moment().add(1, 'days').format('YYYY-MM-DD')
+      } else if (this.queryParam.timeFrame === '2') {
+        // 昨天
+        this.queryParam.endTime = moment().format('YYYY-MM-DD')
+        this.queryParam.startTime = moment().subtract(1, 'days').format('YYYY-MM-DD')
+      } else if (this.queryParam.timeFrame === '3') {
+        // 本周
+        this.queryParam.startTime = moment().weekday(0).format('YYYY-MM-DD')
+        this.queryParam.endTime = moment().weekday(6).format('YYYY-MM-DD')
+      } else if (this.queryParam.timeFrame === '4') {
+        // 自定义时间
+        this.queryParam.startTime = this.chooseTime[0].format('YYYY-MM-DD')
+        this.queryParam.endTime = this.chooseTime[1].format('YYYY-MM-DD')
+      }
+    },
+
+    // methods中定义,合并表格
+    mergeCells (text, data, key, index) {
+
+      // 上一行该列数据是否一样
+      if (index !== 0 && text === data[index - 1][key]) {
+        return 0
+      }
+      let rowSpan = 1
+      // 判断下一行是否相等
+      for (let i = index + 1; i < data.length; i++) {
+        if (text !== data[i][key]) {
+          break
+        }
+        rowSpan++
+      }
+      return rowSpan
+    },
+    lookDetail(record, isNum) {
+      let obj = {
+        startTime: this.queryParam.startTime,
+        endTime: this.queryParam.endTime,
+        roomSign: this.queryParam.roomSign,
+        placeId: record.placeId,
+        goodId: isNum == null ? null : record.goodId
+      }
+      this.$nextTick(() => {
+        this.$refs.sellDetailModel.edit(obj)
+      })
+    }
+
+  }
+};
+</script>
+
+<style scoped>
+.main {
+  height: 70% !important;
+}
+</style>

+ 208 - 0
src/views/report/room/sellDetail.vue

@@ -0,0 +1,208 @@
+<template>
+  <div>
+    <a-card style="width: 100%;">
+      <a-form>
+        <a-row>
+          <a-col :span="5">
+            <a-form-item
+                label="标识号/商品名称"
+                :labelCol="{ xs: { span: 24 }, sm: { span: 8 }}"
+                :wrapperCol="{xs: { span: 24 },sm: { span: 13 }}">
+              <a-input v-model="queryParam.roomSign" placeholder="标识号/商品名称"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="9">
+            <a-form-item label="">
+              <a-radio-group v-model="queryParam.timeFrame">
+                <a-radio-button value="1">今日</a-radio-button>
+                <a-radio-button value="2">昨日</a-radio-button>
+                <a-radio-button value="3">本周</a-radio-button>
+                <a-radio-button value="4">其他</a-radio-button>
+              </a-radio-group>
+              <a-range-picker v-if="queryParam.timeFrame === '4'" v-model="chooseTime" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-button
+                type="primary"
+                @click="loadDate"
+                icon="search">查询
+            </a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+      <a-table
+          ref="table"
+          size="middle"
+          :scroll="{ x: true }"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :dataSource="goodDate"
+          :pagination="ipagination"
+          class="storage_collect"
+          @change="pageChange">
+      </a-table>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { getAction } from '@api/manage'
+import moment from 'moment/moment'
+
+const columns = [
+  {
+    title: '发生时间',
+    align: 'center',
+    dataIndex: 'createTime',
+    width: 80
+  },
+  {
+    title: '商品名称',
+    align: 'center',
+    dataIndex: 'goodName',
+    width: 80
+    // customRender: function (text, record) {
+    //   return text == null ? '--' : text
+    // },
+  },
+  {
+    title: '标识号',
+    align: 'center',
+    dataIndex: 'roomSign',
+    width: 80
+  },
+  {
+    title: '消费类目',
+    align: 'center',
+    dataIndex: 'goodTypeName',
+    width: 80
+    // customRender: function (text, record) {
+    //   return text == null ? '--' : text
+    // },
+  },
+  {
+    title: '数量',
+    align: 'center',
+    dataIndex: 'num',
+    width: 80
+  },
+  {
+    title: '金额',
+    align: 'center',
+    dataIndex: 'money',
+    width: 80
+  },
+  {
+    title: '类型',
+    align: 'center',
+    dataIndex: '',
+    width: 80
+  },
+  {
+    title: '购买位置',
+    align: 'center',
+    dataIndex: 'placeName',
+    width: 80,
+  }
+]
+
+export default {
+  name: 'SellDetail',
+
+  data() {
+    return {
+      list: '/kc/kcDepositoryInGoods/storagePage',
+      columns: columns,
+      // 分页参数
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      goodDate: [],
+      queryParam: {
+        timeFrame: '1',
+        startTime: '',
+        endTime: '',
+        roomSign: '',
+      },
+      chooseTime: [],
+
+    }
+  },
+  created() {
+    this.loadDate()
+    getAction('/business/busHousePriceSchemeLayout/layoutPricePage', ).then(resp => {
+
+    })
+  },
+  methods: {
+    loadDate() {
+      if (this.queryParam.timeFrame === '4' && this.chooseTime.length === 0) {
+        this.$message.warning('请选择时间')
+        return
+      }
+      this.getTimeFrame()
+      let params = {
+        pageSize: this.ipagination.pageSize,
+        pageNo: this.ipagination.current,
+        startTime: this.queryParam.startTime,
+        endTime: this.queryParam.endTime,
+        roomSign: this.queryParam.roomSign
+      }
+      getAction('/kc/kcDepositoryInGoods/goodsSellDetailPage', params).then((res) => {
+        if (!res.success) {
+          this.$message.warning('查询失败')
+          return
+        }
+        this.goodDate = res.result.records
+        this.ipagination.pageNo = res.result.current
+        this.ipagination.total = res.result.total
+        this.expandedRowKeys = []
+      }).finally(() => {
+        // this.loading = false
+      })
+    },
+    pageChange(page) {
+      console.log(page)
+      this.ipagination = page
+      this.loadDate()
+    },
+    // 获取时间范围
+    getTimeFrame() {
+      if (this.queryParam.timeFrame === '1') {
+        // 今天
+        this.queryParam.startTime = moment().format('YYYY-MM-DD')
+        this.queryParam.endTime = moment().add(1, 'days').format('YYYY-MM-DD')
+      } else if (this.queryParam.timeFrame === '2') {
+        // 昨天
+        this.queryParam.endTime = moment().format('YYYY-MM-DD')
+        this.queryParam.startTime = moment().subtract(1, 'days').format('YYYY-MM-DD')
+      } else if (this.queryParam.timeFrame === '3') {
+        // 本周
+        this.queryParam.startTime = moment().weekday(0).format('YYYY-MM-DD')
+        this.queryParam.endTime = moment().weekday(6).format('YYYY-MM-DD')
+      } else if (this.queryParam.timeFrame === '4') {
+        // 自定义时间
+        this.queryParam.startTime = this.chooseTime[0].format('YYYY-MM-DD')
+        this.queryParam.endTime = this.chooseTime[1].format('YYYY-MM-DD')
+      }
+    },
+
+  }
+}
+</script>
+
+<style scoped>
+.main {
+  height: 70% !important;
+}
+</style>

+ 174 - 0
src/views/report/room/sellDetailModel.vue

@@ -0,0 +1,174 @@
+<template>
+  <a-modal
+      :visible="visible"
+      title="明细"
+      :width="1000"
+      @ok="handleOk"
+      @cancel="handleOk">
+    <div>
+      <a-form>
+        <a-row>
+        </a-row>
+      </a-form>
+      <a-table
+          ref="table"
+          size="middle"
+          :scroll="{ x: true, y: 500 }"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :dataSource="goodDate"
+          :pagination="ipagination"
+          class="storage_collect"
+          @change="pageChange">
+      </a-table>
+    </div>
+
+  </a-modal>
+</template>
+
+<script>
+import { getAction } from '@api/manage'
+import moment from 'moment/moment'
+
+const columns = [
+  {
+    title: '发生时间',
+    align: 'center',
+    dataIndex: 'createTime',
+    width: 80
+  },
+  {
+    title: '商品名称',
+    align: 'center',
+    dataIndex: 'goodName',
+    width: 80
+    // customRender: function (text, record) {
+    //   return text == null ? '--' : text
+    // },
+  },
+  {
+    title: '标识号',
+    align: 'center',
+    dataIndex: 'roomSign',
+    width: 80
+  },
+  {
+    title: '消费类目',
+    align: 'center',
+    dataIndex: 'goodTypeName',
+    width: 80
+    // customRender: function (text, record) {
+    //   return text == null ? '--' : text
+    // },
+  },
+  {
+    title: '数量',
+    align: 'center',
+    dataIndex: 'num',
+    width: 80
+  },
+  {
+    title: '金额',
+    align: 'center',
+    dataIndex: 'money',
+    width: 80
+  },
+  {
+    title: '类型',
+    align: 'center',
+    dataIndex: '',
+    width: 80
+  },
+  {
+    title: '购买位置',
+    align: 'center',
+    width: 80,
+    customRender: function (text, record) {
+      if (record.feeGoodId != null) {
+        return 'pos'
+      } else if (record.feeId != null) {
+        return '客房'
+      }
+    },
+  }
+]
+
+export default {
+  name: 'SellDetailModel',
+
+  data() {
+    return {
+      list: '/kc/kcDepositoryInGoods/storagePage',
+      columns: columns,
+      // 分页参数
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      goodDate: [],
+      queryParam: {
+        startTime: '',
+        endTime: '',
+        roomSign: '',
+      },
+      visible: false
+
+    }
+  },
+  created() {
+  },
+  methods: {
+    edit(obj) {
+      this.visible = true;
+      this.queryParam = obj
+      this.loadDate()
+    },
+    loadDate() {
+      let params = {
+        pageSize: this.ipagination.pageSize,
+        pageNo: this.ipagination.current,
+        startTime: this.queryParam.startTime,
+        endTime: this.queryParam.endTime,
+        roomSign: this.queryParam.roomSign,
+        placeId: this.queryParam.placeId,
+        goodId: this.queryParam.goodId
+      }
+      getAction('/kc/kcDepositoryInGoods/goodsSellDetailPage', params).then((res) => {
+        if (!res.success) {
+          this.$message.warning('查询失败')
+          return
+        }
+        this.goodDate = res.result.records
+        this.ipagination.pageNo = res.result.current
+        this.ipagination.total = res.result.total
+        this.expandedRowKeys = []
+      }).finally(() => {
+        // this.loading = false
+      })
+    },
+    pageChange(page) {
+      console.log(page)
+      this.ipagination = page
+      this.loadDate()
+    },
+    handleOk(){
+      this.visible = false
+    }
+
+  }
+}
+</script>
+
+<style scoped>
+.main {
+  height: 70% !important;
+}
+</style>

+ 4 - 2
src/views/room/calendarfangtai.vue

@@ -343,7 +343,9 @@ export default {
   },
   watch: {
     '$route'(to, from) {
-      this.getData()
+      if (to.path === '/room/dynamic/fangtai'){
+        this.getData()
+      }
     }
   },
   created() {
@@ -743,7 +745,7 @@ export default {
 
     },
     countRooms() {
-      
+
       let countObjs = []
       this.columnsCount = []
       console.log(this.roomCount, 'roomCount')

+ 12 - 10
src/views/room/fangtailive.vue

@@ -1214,7 +1214,9 @@ export default {
       // console.log('activeKey', key)
     },
     '$route'(to, from) {
-      this.loadData()
+      if (to.path == '/room/dynamic/fangtai'){
+        this.loadData()
+      }
     }
   },
 
@@ -1346,7 +1348,7 @@ export default {
       }
     })
     this.loadData()
-    
+
     // console.log(this.roomCard);
     // console.log(this.roomList);
   },
@@ -1384,7 +1386,7 @@ export default {
           this.cesRoomLayoutList.splice(tempindex,1,{label: item.label + 0,value: item.value})
         }
       })
-    }, 
+    },
     // 处理筛选条件数据-房型
     roomTypeData(val) {
       this.cesRoomLayoutList.forEach(item => {
@@ -1697,7 +1699,7 @@ export default {
         this.$message.warning(e.message)
         return
       }
-      // 
+      //
       this.$refs.ModalBillRoomForm.addList(selectRoom, e.key)
       this.$refs.ModalBillRoomForm.title =
         e.key == '1' ? '散客入住登记' : '团队入住登记'
@@ -2606,12 +2608,12 @@ export default {
           // 处理房态
           this.houseStateNumbers()
           // 处理来源
-          this.customerSourceList = Object.assign([], this.oldCustomerSourceList); 
+          this.customerSourceList = Object.assign([], this.oldCustomerSourceList);
           this.handleSourceFigure()
           // 处理房型
           this.cesRoomLayoutList = Object.assign([], this.oldCesRoomLayoutList);
           this.treatmentRoomType()
-          
+
         }
       })
       await getAction("/fw/fwLivingJx/getJxRooms", {}).then((res) => {
@@ -2633,7 +2635,7 @@ export default {
                   let temproom = true
                   cust.rooms.splice(tempindex,1,{...index,temproom:temproom})
                 }
-                
+
               })
             })
           })
@@ -2675,7 +2677,7 @@ export default {
               this.rouseinfoRoomList = res.result;
           }
           let templeaseroomlist = this.oldRoomList
-          this.roomInformationScreening = Object.assign([], this.oldRoomInformationScreening); 
+          this.roomInformationScreening = Object.assign([], this.oldRoomInformationScreening);
           // 这里处理对房间信息中的租借
           this.rouseinfoRoomList.forEach(item => {
             templeaseroomlist.forEach((cust,custindex) => {
@@ -2685,7 +2687,7 @@ export default {
                   let tempinfo = true
                   cust.rooms.splice(tempindex,1,{...index,tempinfo:tempinfo})
                 }
-                
+
               })
             })
           })
@@ -2717,7 +2719,7 @@ export default {
             }
           })
       });
-      
+
       getAction('/business/busOtherEmptyDirtyRoom/queryByHotelId', {}).then(
         (res) => {
           if (res.success) {