Browse Source

仓储业务-仓储费页面

lichao 4 năm trước cách đây
mục cha
commit
205db25b04
1 tập tin đã thay đổi với 43 bổ sung0 xóa
  1. 43 0
      src/views/warehouseBusiness/storageFeeCalculation/index.vue

+ 43 - 0
src/views/warehouseBusiness/storageFeeCalculation/index.vue

@@ -250,6 +250,8 @@
         v-loading="loading"
         :data="warehousebillsList"
         @selection-change="handleSelectionChange"
+        ref="table"
+        :height="tableHeight"
     >
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column type="index" label="行号" align="center"/>
@@ -1130,6 +1132,7 @@ export default {
   },
   data() {
     return {
+      tableHeight: '600',
       dialogFull: false,
       drag: false,
       countstate: false,
@@ -1363,6 +1366,20 @@ export default {
   },
 
   created() {
+    let date = new Date();
+    let year = parseInt(date.getFullYear())
+    let month = parseInt(date.getMonth() + 1)
+    let currentMonth = date.getMonth()
+    let nextMonth = ++currentMonth
+    let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1)  // 下个月的第一天
+    let oneDay = 1000*60*60*24
+    let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
+    let day = lastTime.getDate()
+    if (day < 10) {
+      day = '0' + day
+    }
+    this.queryParams.timeInterval = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
+
     this.getList();
     this.getDicts("tax_rate").then((response) => {
       this.fTaxrate = response.data[0].dictValue
@@ -1375,10 +1392,36 @@ export default {
   activated() {
     this.Jump()
   },
+  mounted() {
+    this.$nextTick(() => {
+      // 根据浏览器高度设置初始高度
+      this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
+      // 监听浏览器高度变化,改变表格高度
+      window.onresize = () => {
+        this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
+      }
+    })
+  },
   methods: {
     full() {
       this.dialogFull = !this.dialogFull
     },
+    // 获取当前月的第一天和最后一天
+    getMonth() {
+      let date = new Date();
+      let year = parseInt(date.getFullYear())
+      let month = parseInt(date.getMonth() + 1)
+      let currentMonth = date.getMonth()
+      let nextMonth = ++currentMonth
+      let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1)  // 下个月的第一天
+      let oneDay = 1000*60*60*24
+      let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
+      let day = lastTime.getDate()
+      if (day < 10) {
+        day = '0' + day
+      }
+      this.queryParams.timeInterval = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
+    },
     //列设置全选
     allChecked() {
       if (this.allCheck == true) {